From 7522f86d010e600e17e82f98364235e96df21c1e Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 22 Sep 2008 01:51:24 +0000 Subject: [PATCH 001/577] * Volume rendering This is an initial commit to get it in SVN and make it easier to work on. Don't expect it to work perfectly, it's still in development and there's plenty of work still needing to be done. And so no I'm not very interested in hearing bug reports or feature requests at this stage :) There's some info on this, and a todo list at: http://mke3.net/weblog/volume-rendering/ Right now I'm trying to focus on getting shading working correctly (there's currently a problem in which 'surfaces' of the volume facing towards or away from light sources are getting shaded differently to how they should be), then I'll work on integration issues, like taking materials behind the volume into account, blending with alpha, etc. You can do simple testing though, mapping textures to density or emission on a cube with volume material. --- source/blender/blenkernel/intern/material.c | 5 + source/blender/blenlib/BLI_arithb.h | 1 + source/blender/blenlib/intern/arithb.c | 13 + source/blender/blenloader/intern/readfile.c | 10 + source/blender/makesdna/DNA_material_types.h | 21 + .../blender/render/intern/include/shading.h | 2 + .../blender/render/intern/include/texture.h | 1 + .../render/intern/include/volumetric.h | 29 ++ .../render/intern/source/convertblender.c | 2 + .../blender/render/intern/source/shadeinput.c | 9 +- .../render/intern/source/shadeoutput.c | 2 +- source/blender/render/intern/source/texture.c | 135 ++++++ .../blender/render/intern/source/volumetric.c | 400 ++++++++++++++++++ source/blender/src/buttons_shading.c | 145 +++++-- source/blender/src/previewrender.c | 2 + 15 files changed, 730 insertions(+), 47 deletions(-) create mode 100644 source/blender/render/intern/include/volumetric.h create mode 100644 source/blender/render/intern/source/volumetric.c diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index f05b84f6e90..5c20858ec63 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -166,6 +166,11 @@ void init_material(Material *ma) ma->sss_texfac= 0.0f; ma->sss_front= 1.0f; ma->sss_back= 1.0f; + + ma->vol_stepsize = 0.2f; + ma->vol_shade_stepsize = 0.2f; + ma->vol_absorption = 1.0f; + ma->vol_scattering = 1.0f; ma->mode= MA_TRACEBLE|MA_SHADBUF|MA_SHADOW|MA_RADIO|MA_RAYBIAS|MA_TANGENT_STR; diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h index 6e54fae58d0..0a9abc34608 100644 --- a/source/blender/blenlib/BLI_arithb.h +++ b/source/blender/blenlib/BLI_arithb.h @@ -250,6 +250,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); diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index f89f90f7045..f311c30e0c7 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -2126,6 +2126,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; @@ -3269,6 +3276,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; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index f3f1a99cdbf..a1d50b618d1 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7681,6 +7681,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile < 11)) { Object *ob; bActionStrip *strip; + /* nla-strips - scale */ for (ob= main->object.first; ob; ob= ob->id.next) { @@ -7704,12 +7705,14 @@ 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)) { Scene *sce= main->scene.first; Sequence *seq; Editing *ed; + Material *ma; while(sce) { ed= sce->ed; @@ -7724,6 +7727,13 @@ static void do_versions(FileData *fd, Library *lib, Main *main) sce= sce->id.next; } + + for(ma=main->mat.first; ma; ma= ma->id.next) { + if (ma->vol_shade_stepsize < 0.001f) ma->vol_shade_stepsize = 0.2f; + if (ma->vol_stepsize < 0.001f) ma->vol_stepsize = 0.2f; + if (ma->vol_absorption < 0.001f) ma->vol_absorption = 1.0f; + if (ma->vol_scattering < 0.001f) ma->vol_scattering = 1.0f; + } } /*fix broken group lengths in id properties*/ diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index c92a33bbcbb..940f57c1ebc 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -62,6 +62,16 @@ typedef struct Material { float translucency; /* end synced with render_types.h */ + short material_type; /* solid, halo, volumetric */ + short pad5[3]; + + /* volumetrics */ + float vol_alphathresh; + float vol_stepsize, vol_shade_stepsize; + float vol_absorption, vol_scattering; + short vol_shadeflag; + short vpad; + float fresnel_mir, fresnel_mir_i; float fresnel_tra, fresnel_tra_i; float filter; /* filter added, for raytrace transparency and transmissivity */ @@ -154,6 +164,12 @@ typedef struct Material { /* for render */ #define MA_IS_USED 1 +/* 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 #define MA_SHADOW 2 @@ -327,5 +343,10 @@ typedef struct Material { /* sss_flag */ #define MA_DIFF_SSS 1 +/* vol_shadeflag */ +#define MA_VOL_SHADED 1 +#define MA_VOL_ATTENUATED 2 +#define MA_VOL_SHADOWED 4 + #endif diff --git a/source/blender/render/intern/include/shading.h b/source/blender/render/intern/include/shading.h index 6f1cb8dd7a9..9229e612337 100644 --- a/source/blender/render/intern/include/shading.h +++ b/source/blender/render/intern/include/shading.h @@ -52,6 +52,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); @@ -85,6 +86,7 @@ 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); diff --git a/source/blender/render/intern/include/texture.h b/source/blender/render/intern/include/texture.h index 8e56c4a852f..08c4ee5df98 100644 --- a/source/blender/render/intern/include/texture.h +++ b/source/blender/render/intern/include/texture.h @@ -56,6 +56,7 @@ void do_halo_tex(struct HaloRen *har, float xn, float yn, float *colf); void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, float *blend, int skyflag); void do_material_tex(struct ShadeInput *shi); void do_lamp_tex(LampRen *la, float *lavec, struct ShadeInput *shi, float *colf); +void do_volume_tex(ShadeInput *shi, float *xyz, float *col, float *alpha, float *emit); void init_render_textures(Render *re); diff --git a/source/blender/render/intern/include/volumetric.h b/source/blender/render/intern/include/volumetric.h new file mode 100644 index 00000000000..8db3fa63f98 --- /dev/null +++ b/source/blender/render/intern/include/volumetric.h @@ -0,0 +1,29 @@ +/** + * + * ***** 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): Farsthary (Raul FHernandez), Matt Ebb. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr); \ No newline at end of file diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 322d2066a6c..48855246e87 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -1029,6 +1029,8 @@ static Material *give_render_material(Render *re, Object *ob, int nr) if(ma->nodetree && ma->use_nodes) flag_render_node_material(re, ma->nodetree); + if (ma->material_type == MA_VOLUME) re->r.mode |= R_RAYTRACE; + return ma; } diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index 7397d623264..cd5ecc413df 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -135,6 +135,12 @@ void shade_material_loop(ShadeInput *shi, ShadeResult *shr) } } +/* delivers a fully filled in ShadeResult, for all passes */ +void shade_volume_loop(ShadeInput *shi, ShadeResult *shr) +{ + if(R.r.mode & R_RAYTRACE) volume_trace(shi, shr); +} + /* do a shade, finish up some passes, apply mist */ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr) @@ -151,7 +157,8 @@ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr) memcpy(&shi->r, &shi->mat->r, 23*sizeof(float)); shi->har= shi->mat->har; - shade_material_loop(shi, shr); + if (shi->mat->material_type == MA_SOLID) shade_material_loop(shi, shr); + else if (shi->mat->material_type == MA_VOLUME) shade_volume_loop(shi, shr); } /* copy additional passes */ diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index 5a80173d1f1..4f7c26614e9 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -58,7 +58,7 @@ extern struct Render R; /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -static ListBase *get_lights(ShadeInput *shi) +ListBase *get_lights(ShadeInput *shi) { if(shi->light_override) diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index 27628d91465..37778fafeb3 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -1451,6 +1451,141 @@ float texture_value_blend(float tex, float out, float fact, float facg, int blen return in; } +void do_volume_tex(ShadeInput *shi, float *xyz, float *col, float *alpha, float *emit) +{ + MTex *mtex; + Tex *tex; + TexResult texres= {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL}; + int tex_nr, rgbnor= 0; + float co[3], texvec[3]; + float fact, stencilTin=1.0; + + if (R.r.scemode & R_NO_TEX) return; + /* here: test flag if there's a tex (todo) */ + + for(tex_nr=0; tex_nrmat->septex & (1<mat->mtex[tex_nr]) { + mtex= shi->mat->mtex[tex_nr]; + tex= mtex->tex; + if(tex==0) continue; + + /* which coords */ + if(mtex->texco==TEXCO_OBJECT) { + Object *ob= mtex->object; + ob= mtex->object; + if(ob) { + VECCOPY(co, xyz); + if(mtex->texflag & MTEX_OB_DUPLI_ORIG) { + if(shi->obi && shi->obi->duplitexmat) + MTC_Mat4MulVecfl(shi->obi->duplitexmat, co); + } + MTC_Mat4MulVecfl(ob->imat, co); + } + } + else if(mtex->texco==TEXCO_GLOB) { + VECCOPY(co, xyz); + } + else continue; // can happen when texco defines disappear and it renders old files + + texres.nor= NULL; + + if(tex->type==TEX_IMAGE) { + continue; /* not supported yet */ + } + else { + /* placement */ + if(mtex->projx) texvec[0]= mtex->size[0]*(co[mtex->projx-1]+mtex->ofs[0]); + else texvec[0]= mtex->size[0]*(mtex->ofs[0]); + + if(mtex->projy) texvec[1]= mtex->size[1]*(co[mtex->projy-1]+mtex->ofs[1]); + else texvec[1]= mtex->size[1]*(mtex->ofs[1]); + + if(mtex->projz) texvec[2]= mtex->size[2]*(co[mtex->projz-1]+mtex->ofs[2]); + else texvec[2]= mtex->size[2]*(mtex->ofs[2]); + } + + + rgbnor= multitex(tex, co, NULL, NULL, 0, &texres); /* NULL = dxt/dyt, 0 = shi->osatex - not supported */ + + /* texture output */ + + if( (rgbnor & TEX_RGB) && (mtex->texflag & MTEX_RGBTOINT)) { + texres.tin= (0.35*texres.tr+0.45*texres.tg+0.2*texres.tb); + rgbnor-= TEX_RGB; + } + if(mtex->texflag & MTEX_NEGATIVE) { + if(rgbnor & TEX_RGB) { + texres.tr= 1.0-texres.tr; + texres.tg= 1.0-texres.tg; + texres.tb= 1.0-texres.tb; + } + texres.tin= 1.0-texres.tin; + } + if(mtex->texflag & MTEX_STENCIL) { + if(rgbnor & TEX_RGB) { + fact= texres.ta; + texres.ta*= stencilTin; + stencilTin*= fact; + } + else { + fact= texres.tin; + texres.tin*= stencilTin; + stencilTin*= fact; + } + } + + + if(mtex->mapto & (MAP_COL)) { + float tcol[3], colfac; + + /* stencil maps on the texture control slider, not texture intensity value */ + colfac= mtex->colfac*stencilTin; + + tcol[0]=texres.tr; tcol[1]=texres.tg; tcol[2]=texres.tb; + + if((rgbnor & TEX_RGB)==0) { + tcol[0]= mtex->r; + tcol[1]= mtex->g; + tcol[2]= mtex->b; + } + else if(mtex->mapto & MAP_ALPHA) { + texres.tin= stencilTin; + } + else texres.tin= texres.ta; + + if(mtex->mapto & MAP_COL) { + texture_rgb_blend(col, tcol, col, texres.tin, colfac, mtex->blendtype); + } + } + + if(mtex->mapto & MAP_VARS) { + /* stencil maps on the texture control slider, not texture intensity value */ + float varfac= mtex->varfac*stencilTin; + + if(rgbnor & TEX_RGB) { + if(texres.talpha) texres.tin= texres.ta; + else texres.tin= (0.35*texres.tr+0.45*texres.tg+0.2*texres.tb); + } + + if(mtex->mapto & MAP_EMIT) { + int flip= mtex->maptoneg & MAP_EMIT; + + *emit = texture_value_blend(mtex->def_var, *emit, texres.tin, varfac, mtex->blendtype, flip); + if(*emit<0.0) *emit= 0.0; + } + if(mtex->mapto & MAP_ALPHA) { + int flip= mtex->maptoneg & MAP_ALPHA; + + *alpha = texture_value_blend(mtex->def_var, *alpha, texres.tin, varfac, mtex->blendtype, flip); + CLAMP(*alpha, 0.0, 1.0); + } + } + } + } +} void do_material_tex(ShadeInput *shi) { diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c new file mode 100644 index 00000000000..3ca8c0a0693 --- /dev/null +++ b/source/blender/render/intern/source/volumetric.c @@ -0,0 +1,400 @@ +/** + * + * ***** 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): Farsthary (Raul FHernandez), Matt Ebb. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include +#include +#include + +#include "BLI_blenlib.h" +#include "BLI_arithb.h" +#include "BLI_rand.h" + +#include "RE_shader_ext.h" +#include "RE_raytrace.h" + +#include "DNA_material_types.h" +#include "DNA_group_types.h" +#include "DNA_lamp_types.h" + +#include "render_types.h" +#include "shading.h" + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* defined in pipeline.c, is hardcopy of active dynamic allocated Render */ +/* only to be used here in this file, it's for speed */ +extern struct Render R; +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +static int vol_backface_intersect_check(Isect *is, int ob, RayFace *face) +{ + VlakRen *vlr = (VlakRen *)face; + + /* only consider faces away, so overlapping layers + * of foward facing geometry don't cause the ray to stop */ + return (INPR(is->vec, vlr->n) < 0.0f); +} + +#define VOL_IS_SAMEOBJECT 1 +#define VOL_IS_SAMEMATERIAL 2 + +int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco) +{ + /* TODO: Box or sphere intersection types could speed things up */ + + /* raytrace method */ + Isect isect; + float maxsize = RE_ray_tree_max_size(R.raytree); + + /* TODO: use object's bounding box to calculate max size */ + VECCOPY(isect.start, co); + isect.end[0] = co[0] + vec[0] * maxsize; + isect.end[1] = co[1] + vec[1] * maxsize; + isect.end[2] = co[2] + vec[2] * maxsize; + + isect.mode= RE_RAY_MIRROR; + isect.faceorig= (RayFace*)shi->vlr; + isect.oborig= RAY_OBJECT_SET(&R, shi->obi); + isect.face_last= NULL; + isect.ob_last= 0; + isect.lay= -1; + + if(RE_ray_tree_intersect(R.raytree, &isect)) + { + float isvec[3]; + + VECCOPY(isvec, isect.vec); + hitco[0] = isect.start[0] + isect.labda*isvec[0]; + hitco[1] = isect.start[1] + isect.labda*isvec[1]; + hitco[2] = isect.start[2] + isect.labda*isvec[2]; + + return 1; + } else { + return 0; + } +} + +float vol_get_density(struct ShadeInput *shi, float *co) +{ + float density = shi->mat->alpha; + float emit_fac=0.0f; + float col[3] = {0.0, 0.0, 0.0}; + + /* do any density gain stuff here */ + + do_volume_tex(shi, co, col, &density, &emit_fac); + + return density; +} + + +/* compute emission component, amount of radiance to add per segment + * can be textured with 'emit' */ +void vol_get_emission(ShadeInput *shi, float *em, float *co, float *endco, float density) +{ + float emission = shi->mat->emit; + float col[3] = {0.0, 0.0, 0.0}; + float dens_dummy = 1.0f; + + do_volume_tex(shi, co, col, &dens_dummy, &emission); + + em[0] = em[1] = em[2] = emission; +} + + +/* Compute attenuation, otherwise known as 'optical thickness', extinction, or tau. + * Used in the relationship Transmittance = e^(-attenuation) + * can be textured with 'alpha' */ +void vol_get_attenuation(ShadeInput *shi, float *tau, float *co, float *endco, float density, float stepsize) +{ + /* input density = density at co */ + + float dist; + float absorption = shi->mat->vol_absorption; + int s, nsteps; + float step_vec[3], step_sta[3], step_end[3]; + + dist = VecLenf(co, endco); + + nsteps = (int)ceil(dist / stepsize); + + if (nsteps == 1) { + /* homogenous volume within the sampled distance */ + tau[0] = tau[1] = tau[2] = dist * density; + VecMulf(tau, absorption); + return; + } else { + tau[0] = tau[1] = tau[2] = 0.0; + } + + VecSubf(step_vec, endco, co); + VecMulf(step_vec, 1.0f / nsteps); + + VECCOPY(step_sta, co); + VecAddf(step_end, step_sta, step_vec); + + for (s = 0; s < nsteps; s++) { + + if (s > 0) density = vol_get_density(shi, step_sta); + + tau[0] += stepsize * density; + tau[1] += stepsize * density; + tau[2] += stepsize * density; + + if (s < nsteps-1) { + VECCOPY(step_sta, step_end); + VecAddf(step_end, step_end, step_vec); + } + } + VecMulf(tau, absorption); +} + +void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float *col, float stepsize, float density) +{ + float visifac, lv[3], lampdist; + float lacol[3]; + float tau[3], tr[3]={1.0,1.0,1.0}; + float hitco[3], *atten_co; + + if (lar->mode & LA_LAYER) if((lar->lay & shi->obi->lay)==0) return; + if ((lar->lay & shi->lay)==0) return; + if (lar->energy == 0.0) return; + + visifac= lamp_get_visibility(lar, co, lv, &lampdist); + if(visifac==0.0f) return; + + lacol[0] = lar->r; + lacol[1] = lar->g; + lacol[2] = lar->b; + + if(lar->mode & LA_TEXTURE) { + shi->osatex= 0; + do_lamp_tex(lar, lv, shi, lacol); + } + + VecMulf(lacol, visifac*lar->energy); + + if (shi->mat->vol_shadeflag & MA_VOL_ATTENUATED) { + /* find minimum of volume bounds, or lamp coord */ + + if (ELEM(lar->type, LA_SUN, LA_HEMI)) + VECCOPY(lv, lar->vec); + + VecMulf(lv, -1.0f); + + if (vol_get_bounds(shi, co, lv, hitco)) { + if (ELEM(lar->type, LA_SUN, LA_HEMI)) + atten_co = hitco; + else if ( lampdist < VecLenf(co, hitco) ) + atten_co = lar->co; + else + atten_co = hitco; + + atten_co = lar->co; + + vol_get_attenuation(shi, tau, co, atten_co, density, shi->mat->vol_shade_stepsize); + tr[0] = exp(-tau[0]); + tr[1] = exp(-tau[1]); + tr[2] = exp(-tau[2]); + + VecMulVecf(lacol, lacol, tr); + } + else { + /* point is on the outside edge of the volume, + * therefore no attenuation, full transmission + * radiance from lamp remains unchanged */ + } + } + + VecAddf(col, col, lacol); +} + +/* shadows -> trace a ray to find blocker geometry + - if blocker is outside the volume, use standard shadow functions + - if blocker is inside the volume, use raytracing + -- (deep shadow maps could potentially slot in here too I suppose) + - attenuate from current point, to blocked point or volume bounds +*/ + +/* single scattering only for now */ +void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float *endco, float stepsize, float density) +{ + GroupObject *go; + ListBase *lights; + LampRen *lar; + float col[3] = {0.f, 0.f, 0.f}; + + lights= get_lights(shi); + for(go=lights->first; go; go= go->next) + { + float lacol[3] = {0.f, 0.f, 0.f}; + + lar= go->lampren; + if (lar==NULL) continue; + + vol_shade_one_lamp(shi, co, lar, lacol, stepsize, density); + + /* isotropic phase function */ + VecMulf(lacol, 1.0f / (4.f * M_PI)); + + VecMulf(lacol, density); + + VecAddf(col, col, lacol); + } + + + + VECCOPY(scatter, col); +} + + + +static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float *endco) +{ + float total_tau; + float total_tr[3]; + float tr[3] = {1.f, 1.f, 1.f}; /* total transmittance */ + float radiance[3] = {0.f, 0.f, 0.f}, d_radiance[3] = {0.f, 0.f, 0.f}; + float stepsize = shi->mat->vol_stepsize; + int nsteps; + float vec[3], stepvec[3] = {0.0, 0.0, 0.0}; + float step_tau[3], step_emit[3], step_scatter[3] = {0.0, 0.0, 0.0}; + int s; + float step_sta[3], step_end[3], step_offs[3] = {0.0, 0.0, 0.0}; + float alpha_fac, emit_fac=0.0f, tex_col[3]; + + /* multiply col_behind with beam transmittance over entire distance */ +/* + // get col_behind + + // get total transmittance + vol_get_attenuation(shi, total_tau, start, dist, stepsize); + total_tr[0] = exp(-total_tau[0]); + total_tr[1] = exp(-total_tau[1]); + total_tr[2] = exp(-total_tau[2]); + VecMulVecf(radiance, total_tr, col_behind); +*/ + + /* ray marching */ + nsteps = (int)ceil(VecLenf(co, endco) / stepsize); + + VecSubf(vec, endco, co); + VECCOPY(stepvec, vec); + VecMulf(stepvec, 1.0f / nsteps); + + VECCOPY(step_sta, co); + VecAddf(step_end, step_sta, stepvec); + + + /* get radiance from all points along the ray due to participating media */ + for (s = 0; s < nsteps; s++) { + float density = vol_get_density(shi, step_sta); + + /* *** transmittance and emission *** */ + + /* transmittance component (alpha) */ + vol_get_attenuation(shi, step_tau, step_sta, step_end, density, stepsize); + tr[0] *= exp(-step_tau[0]); + tr[1] *= exp(-step_tau[1]); + tr[2] *= exp(-step_tau[2]); + + /* Terminate raymarching if transmittance is small */ + //if (rgb_to_luminance(tr[0], tr[1], tr[2]) < 1e-3) break; + + /* incoming light via emission or scattering (additive) */ + vol_get_emission(shi, step_emit, step_sta, step_end, density); + vol_get_scattering(shi, step_scatter, step_end, step_end, stepsize, density); + + VecAddf(d_radiance, step_emit, step_scatter); + + /* Lv += Tr * (Lve() + Ld) */ + VecMulVecf(d_radiance, tr, d_radiance); + VecAddf(radiance, radiance, d_radiance); + + if (s < nsteps-1) { + VECCOPY(step_sta, step_end); + VecAddf(step_end, step_end, stepvec); + } + } + + VecMulf(radiance, stepsize); + VECCOPY(col, radiance); + + /* + Incoming radiance = + outgoing radiance from behind surface * beam transmittance/attenuation + + + added radiance from all points along the ray due to participating media + --> radiance for each segment = + radiance added by scattering + + radiance added by emission + * beam transmittance/attenuation + + + -- To find transmittance: + compute optical thickness with tau (perhaps involving monte carlo integration) + return exp(-tau) + + -- To find radiance from segments along the way: + find radiance for one step: + - loop over lights and weight by phase function + + - single scattering + : integrate over sphere + + then multiply each step for final exit radiance + */ +} + +void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr) +{ + Isect isect; + float hitco[3], col[3]; + + memset(shr, 0, sizeof(ShadeResult)); + + if (vol_get_bounds(shi, shi->co, shi->view, hitco)) { + + volumeintegrate(shi, col, shi->co, hitco); + + /* hit */ + shr->alpha = 1.0f; + shr->combined[0] = col[0]; + shr->combined[1] = col[1]; + shr->combined[2] = col[2]; + + QUATCOPY(shr->diff, shr->combined); + } + else { + /* no hit */ + shr->combined[0] = 0.0f; + shr->combined[1] = 0.0f; + shr->combined[2] = 0.0f; + shr->combined[3] = shr->alpha = 0.0f; + } +} \ No newline at end of file diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 6d5e1a62ad4..bdb2fe5a3f3 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -3383,6 +3383,10 @@ static void material_panel_map_to(Object *ob, Material *ma, int from_nodes) uiDefButBitS(block, TOG, 1, B_MATPRV, "PAttr", 250,160,60,19, &pattr, 0, 0, 0, 0, "Display settings for particle attributes"); uiBlockSetCol(block, TH_AUTO); } + else if (ma->material_type == MA_VOLUME) { + uiDefButBitS(block, TOG3, MAP_ALPHA, B_MATPRV, "Density", 10,180,60,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the alpha value"); + uiDefButBitS(block, TOG3, MAP_EMIT, B_MATPRV, "Emit", 70,180,45,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the emit value"); + } else { uiDefButBitS(block, TOG, MAP_COL, B_MATPRV, "Col", 10,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect basic color of the material"); uiDefButBitS(block, TOG3, MAP_NORM, B_MATPRV, "Nor", 50,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the rendered normal"); @@ -3499,37 +3503,43 @@ static void material_panel_map_input(Object *ob, Material *ma) /* TEXCO */ uiBlockBeginAlign(block); - uiDefButS(block, ROW, B_MATPRV, "Glob", 630,180,45,18, &(mtex->texco), 4.0, (float)TEXCO_GLOB, 0, 0, "Uses global coordinates for the texture coordinates"); - uiDefButS(block, ROW, B_MATPRV, "Object", 675,180,75,18, &(mtex->texco), 4.0, (float)TEXCO_OBJECT, 0, 0, "Uses linked object's coordinates for texture coordinates"); - if(mtex->texco == TEXCO_UV && !(mtex->texflag & MTEX_DUPLI_MAPTO)) { - if(!verify_valid_uv_name(mtex->uvname)) - uiBlockSetCol(block, TH_REDALERT); - but=uiDefBut(block, TEX, B_MATPRV, "UV:", 750,180,158,18, mtex->uvname, 0, 31, 0, 0, "Set name of UV layer to use, default is active UV layer"); - uiButSetCompleteFunc(but, autocomplete_uv, NULL); - uiBlockSetCol(block, TH_AUTO); - } - else + + if (ma->material_type == MA_VOLUME) { + uiDefButS(block, ROW, B_MATPRV, "Glob", 630,180,45,18, &(mtex->texco), 4.0, (float)TEXCO_GLOB, 0, 0, "Uses global coordinates for the texture coordinates"); + uiDefButS(block, ROW, B_MATPRV, "Object", 675,180,75,18, &(mtex->texco), 4.0, (float)TEXCO_OBJECT, 0, 0, "Uses linked object's coordinates for texture coordinates"); uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_MATPRV, "Ob:",750,180,158,18, &(mtex->object), ""); - - uiDefButS(block, ROW, B_MATPRV, "UV", 630,160,40,18, &(mtex->texco), 4.0, (float)TEXCO_UV, 0, 0, "Uses UV coordinates for texture coordinates"); - uiDefButS(block, ROW, B_MATPRV, "Orco", 670,160,55,18, &(mtex->texco), 4.0, (float)TEXCO_ORCO, 0, 0, "Uses the original undeformed coordinates of the object"); - if( ob->particlesystem.first ) - uiDefButS(block, ROW, B_MATPRV, "Strand", 725,160,50,18, &(mtex->texco), 4.0, (float)TEXCO_STRAND, 0, 0, "Uses normalized strand texture coordinate (1D)"); - else - uiDefButS(block, ROW, B_MATPRV, "Stick", 725,160,50,18, &(mtex->texco), 4.0, (float)TEXCO_STICKY, 0, 0, "Uses mesh's sticky coordinates for the texture coordinates"); - uiDefButS(block, ROW, B_MATPRV, "Win", 775,160,45,18, &(mtex->texco), 4.0, (float)TEXCO_WINDOW, 0, 0, "Uses screen coordinates as texture coordinates"); - uiDefButS(block, ROW, B_MATPRV, "Nor", 820,160,44,18, &(mtex->texco), 4.0, (float)TEXCO_NORM, 0, 0, "Uses normal vector as texture coordinates"); - uiDefButS(block, ROW, B_MATPRV, "Refl", 864,160,44,18, &(mtex->texco), 4.0, (float)TEXCO_REFL, 0, 0, "Uses reflection vector as texture coordinates"); - - uiDefButS(block, ROW, B_MATPRV, "Stress", 630,140,70,18, &(mtex->texco), 4.0, (float)TEXCO_STRESS, 0, 0, "Uses the difference of edge lengths compared to original coordinates of the mesh"); - uiDefButS(block, ROW, B_MATPRV, "Tangent", 700,140,70,18, &(mtex->texco), 4.0, (float)TEXCO_TANGENT, 0, 0, "Uses the optional tangent vector as texture coordinates"); - uiBlockEndAlign(block); - - if(ELEM(mtex->texco, TEXCO_UV, TEXCO_ORCO)) - uiDefButBitS(block, TOG, MTEX_DUPLI_MAPTO, B_MATPRV, "From Dupli", 820,140,88,18, &(mtex->texflag), 0, 0, 0, 0, "Dupli's instanced from verts, faces or particles, inherit texture coordinate from their parent"); - else if(mtex->texco == TEXCO_OBJECT) - uiDefButBitS(block, TOG, MTEX_OB_DUPLI_ORIG, B_MATPRV, "From Original", 820,140,88,18, &(mtex->texflag), 0, 0, 0, 0, "Dupli's derive their object coordinates from the original objects transformation"); + } else { + uiDefButS(block, ROW, B_MATPRV, "Glob", 630,180,45,18, &(mtex->texco), 4.0, (float)TEXCO_GLOB, 0, 0, "Uses global coordinates for the texture coordinates"); + uiDefButS(block, ROW, B_MATPRV, "Object", 675,180,75,18, &(mtex->texco), 4.0, (float)TEXCO_OBJECT, 0, 0, "Uses linked object's coordinates for texture coordinates"); + if(mtex->texco == TEXCO_UV && !(mtex->texflag & MTEX_DUPLI_MAPTO)) { + if(!verify_valid_uv_name(mtex->uvname)) + uiBlockSetCol(block, TH_REDALERT); + but=uiDefBut(block, TEX, B_MATPRV, "UV:", 750,180,158,18, mtex->uvname, 0, 31, 0, 0, "Set name of UV layer to use, default is active UV layer"); + uiButSetCompleteFunc(but, autocomplete_uv, NULL); + uiBlockSetCol(block, TH_AUTO); + } + else + uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_MATPRV, "Ob:",750,180,158,18, &(mtex->object), ""); + + uiDefButS(block, ROW, B_MATPRV, "UV", 630,160,40,18, &(mtex->texco), 4.0, (float)TEXCO_UV, 0, 0, "Uses UV coordinates for texture coordinates"); + uiDefButS(block, ROW, B_MATPRV, "Orco", 670,160,55,18, &(mtex->texco), 4.0, (float)TEXCO_ORCO, 0, 0, "Uses the original undeformed coordinates of the object"); + if( ob->particlesystem.first ) + uiDefButS(block, ROW, B_MATPRV, "Strand", 725,160,50,18, &(mtex->texco), 4.0, (float)TEXCO_STRAND, 0, 0, "Uses normalized strand texture coordinate (1D)"); + else + uiDefButS(block, ROW, B_MATPRV, "Stick", 725,160,50,18, &(mtex->texco), 4.0, (float)TEXCO_STICKY, 0, 0, "Uses mesh's sticky coordinates for the texture coordinates"); + uiDefButS(block, ROW, B_MATPRV, "Win", 775,160,45,18, &(mtex->texco), 4.0, (float)TEXCO_WINDOW, 0, 0, "Uses screen coordinates as texture coordinates"); + uiDefButS(block, ROW, B_MATPRV, "Nor", 820,160,44,18, &(mtex->texco), 4.0, (float)TEXCO_NORM, 0, 0, "Uses normal vector as texture coordinates"); + uiDefButS(block, ROW, B_MATPRV, "Refl", 864,160,44,18, &(mtex->texco), 4.0, (float)TEXCO_REFL, 0, 0, "Uses reflection vector as texture coordinates"); + + uiDefButS(block, ROW, B_MATPRV, "Stress", 630,140,70,18, &(mtex->texco), 4.0, (float)TEXCO_STRESS, 0, 0, "Uses the difference of edge lengths compared to original coordinates of the mesh"); + uiDefButS(block, ROW, B_MATPRV, "Tangent", 700,140,70,18, &(mtex->texco), 4.0, (float)TEXCO_TANGENT, 0, 0, "Uses the optional tangent vector as texture coordinates"); + uiBlockEndAlign(block); + if(ELEM(mtex->texco, TEXCO_UV, TEXCO_ORCO)) + uiDefButBitS(block, TOG, MTEX_DUPLI_MAPTO, B_MATPRV, "From Dupli", 820,140,88,18, &(mtex->texflag), 0, 0, 0, 0, "Dupli's instanced from verts, faces or particles, inherit texture coordinate from their parent"); + else if(mtex->texco == TEXCO_OBJECT) + uiDefButBitS(block, TOG, MTEX_OB_DUPLI_ORIG, B_MATPRV, "From Original", 820,140,88,18, &(mtex->texflag), 0, 0, 0, 0, "Dupli's derive their object coordinates from the original objects transformation"); + } /* COORDS */ uiBlockBeginAlign(block); @@ -4111,7 +4121,7 @@ static uiBlock *strand_menu(void *mat_v) } -static void material_panel_material(Material *ma) +static void material_panel_material_solid(Material *ma) { uiBlock *block; float *colpoin = NULL; @@ -4199,6 +4209,43 @@ static void material_panel_material(Material *ma) } +static void material_panel_material_volume(Material *ma) +{ + uiBlock *block; + short yco=PANEL_YMAX; + + block= uiNewBlock(&curarea->uiblocks, "material_panel_material_volume", UI_EMBOSS, UI_HELV, curarea->win); + if(uiNewPanel(curarea, block, "Volume", "Material", PANELX, PANELY, PANELW, PANELH)==0) return; + + uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE); + + uiBlockBeginAlign(block); + uiDefButF(block, NUM, B_MATPRV, "Step Size: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_stepsize), 0.001, 100.0, 10, 2, "Ray marching step size"); + uiDefButF(block, NUMSLI, B_MATPRV, "Density: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->alpha), 0.0, 1.0, 0, 0, "Base opacity value"); + uiDefButF(block, NUM, B_MATPRV, "Absorption: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_absorption), 0.0, 5.0, 0, 0, "Multiplier for absorption"); + uiBlockEndAlign(block); + + yco -= YSPACE; + + uiDefButF(block, NUMSLI, B_MATPRV, "Emit: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->emit), 0.0, 2.0, 0, 0, "Emission component"); + + yco -= YSPACE; + + uiBlockBeginAlign(block); + uiDefButBitS(block, TOG, MA_VOL_ATTENUATED, B_MATPRV, "Shading", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shadeflag), 0, 0, 0, 0, "Uses absorption for light attenuation"); + uiDefButF(block, NUM, B_MATPRV, "Step Size: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shade_stepsize), 0.001, 100.0, 10, 2, "Step"); + uiBlockEndAlign(block); + + uiDefBut(block, LABEL, B_DIFF, "", + X2CLM2, yco, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); +} + static void material_panel_nodes(Material *ma) { bNode *node; @@ -4237,7 +4284,7 @@ static void material_panel_links(Object *ob, Material *ma) block= uiNewBlock(&curarea->uiblocks, "material_panel_links", UI_EMBOSS, UI_HELV, curarea->win); /* 310 makes sorting code to put it right after preview panel */ - if(uiNewPanel(curarea, block, "Links and Pipeline", "Material", 310, 0, 318, 204)==0) return; + if(uiNewPanel(curarea, block, "Links and Pipeline", "Material", 310, 0, 338, 204)==0) return; /* Links from object to material/nodes */ uiDefBut(block, ROUNDBOX, 0, "", 5, 90, 310, 110, NULL, 7.0, 0.0, 15 , 20, ""); @@ -4330,7 +4377,10 @@ static void material_panel_links(Object *ob, Material *ma) uiDefButBitI(block, TOG, MA_ONLYCAST, B_MATPRV,"OnlyCast", 85,10,75,19, &(ma->mode), 0, 0, 0, 0, "Makes faces cast shadows only, not rendered"); uiDefButBitI(block, TOG, MA_TRACEBLE, B_NOP,"Traceable", 160,10,75,19, &(ma->mode), 0, 0, 0, 0, "Makes material detectable by ray tracing"); uiDefButBitI(block, TOG, MA_SHADBUF, B_MATPRV, "Shadbuf", 235,10,75,19, &(ma->mode), 0, 0, 0, 0, "Makes material cast shadows from shadow buffer lamps"); - + uiBlockEndAlign(block); + + uiDefButS(block, MENU, B_MATPRV, "Material Type %t|Solid %x0|Halo %x1|Volume %x2", + 10, -15, 300, 20, &(ma->material_type), 0.0, 0.0, 0, 0, ""); } @@ -4388,21 +4438,26 @@ void material_panels() ma= editnode_get_active_material(ma); if(ma) { - material_panel_material(ma); - material_panel_ramps(ma); - material_panel_shading(ma); - - if (G.scene->r.renderer==R_INTERN) - material_panel_tramir(ma); - else { - if(ma->YF_ar==0.f) { - ma->YF_ar = ma->YF_ag = ma->YF_ab = 1; - ma->YF_dscale = 1; + if (ma->material_type == MA_SOLID) { + material_panel_material_solid(ma); + material_panel_ramps(ma); + material_panel_shading(ma); + + if (G.scene->r.renderer==R_INTERN) + material_panel_tramir(ma); + else { + if(ma->YF_ar==0.f) { + ma->YF_ar = ma->YF_ag = ma->YF_ab = 1; + ma->YF_dscale = 1; + } + material_panel_tramir_yafray(ma); } - material_panel_tramir_yafray(ma); - } - material_panel_sss(ma); + material_panel_sss(ma); + + } else if (ma->material_type == MA_VOLUME) { + material_panel_material_volume(ma); + } material_panel_texture(ob, ma); mtex= ma->mtex[ ma->texact ]; diff --git a/source/blender/src/previewrender.c b/source/blender/src/previewrender.c index 1730bb890bc..dacb26b99a4 100644 --- a/source/blender/src/previewrender.c +++ b/source/blender/src/previewrender.c @@ -315,6 +315,8 @@ static Scene *preview_prepare_scene(RenderInfo *ri, int id_type, ID *id, int pr_ /* turn on raytracing if needed */ if(mat->mode_l & (MA_RAYTRANSP|MA_RAYMIRROR)) sce->r.mode |= R_RAYTRACE; + if(mat->material_type == MA_VOLUME) + sce->r.mode |= R_RAYTRACE; if(mat->sss_flag & MA_DIFF_SSS) sce->r.mode |= R_SSS; From 50d0e1a988a55a7e7a59823c030ce9ac3413a9a2 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 23 Sep 2008 04:26:52 +0000 Subject: [PATCH 002/577] * Volumetrics update - Fixed a shading bug, due to issues in the raytrace engine where it would ignore intersections from the starting face (as it should). Disabled this for single scattering intersections, thanks to Brecht for a hint there. It still shows a little bit of noise, I think due to raytrace inaccuracy, which will have to be fixed up later. before: http://mke3.net/blender/devel/rendering/volumetrics/vol_shaded_old.png after: http://mke3.net/blender/devel/rendering/volumetrics/vol_shaded_correct.png Now single scatttering shading works very nicely and is capable of things like this: http://mke3.net/blender/devel/rendering/volumetrics/vol_shaded_clouds.mov - Added colour emission. Now as well as the overall 'Emit:' slider to control overall emission strength, there's also a colour swatch for the volume to emit that colour. This can also be textured, using 'Emit Col' in the map to panel. This animation was made using a clouds texture, with colour band, mapped to both emit colour and emit (strength): http://mke3.net/blender/devel/rendering/volumetrics/vol_col_emit.mov - Added 'Local' mapping to 'map input' - it's similar to Orco - Fixed texture 'map input', wasn't using the offsets or scale values. --- source/blender/makesdna/DNA_material_types.h | 3 + .../render/intern/source/convertblender.c | 24 +++++++ .../blender/render/intern/source/raytrace.c | 2 +- source/blender/render/intern/source/texture.c | 16 ++++- .../blender/render/intern/source/volumetric.c | 71 ++++++++++--------- source/blender/src/buttons_shading.c | 20 +++++- 6 files changed, 97 insertions(+), 39 deletions(-) diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index ee4779779ec..98ddc0aa7d3 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -69,6 +69,8 @@ typedef struct Material { float vol_alphathresh; float vol_stepsize, vol_shade_stepsize; float vol_absorption, vol_scattering; + float vol_absorption_col[3]; + float vpad2; short vol_shadeflag; short vpad; @@ -163,6 +165,7 @@ typedef struct Material { /* flag */ /* for render */ #define MA_IS_USED 1 +#define MA_IS_TEXTURED 2 /* material_type */ #define MA_SOLID 0 diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index a752561218c..17cd71ecb79 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -921,6 +921,28 @@ static void flag_render_node_material(Render *re, bNodeTree *ntree) } } +static void check_material_is_textured(Material *ma) +{ + MTex *mtex; + Tex *tex; + int tex_nr; + + for(tex_nr=0; tex_nrseptex & (1<mtex[tex_nr]) { + mtex= ma->mtex[tex_nr]; + tex= mtex->tex; + if(tex==NULL) + continue; + else + ma->flag |= MA_IS_TEXTURED; + return; + } + } +} + static Material *give_render_material(Render *re, Object *ob, int nr) { extern Material defmaterial; /* material.c */ @@ -943,6 +965,8 @@ static Material *give_render_material(Render *re, Object *ob, int nr) if (ma->material_type == MA_VOLUME) re->r.mode |= R_RAYTRACE; + check_material_is_textured(ma); + return ma; } diff --git a/source/blender/render/intern/source/raytrace.c b/source/blender/render/intern/source/raytrace.c index ec47df74d04..d14d221b099 100644 --- a/source/blender/render/intern/source/raytrace.c +++ b/source/blender/render/intern/source/raytrace.c @@ -931,7 +931,7 @@ int RE_ray_face_intersection(Isect *is, RayObjectTransformFunc transformfunc, Ra intersection to be detected in its neighbour face */ if(is->facecontr && is->faceisect); // optimizing, the tests below are not needed - else if(is->labda< .1) { + else if(is->labda< .1 && is->faceorig) { RayFace *face= is->faceorig; float *origv1, *origv2, *origv3, *origv4; short de= 0; diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index e874f98ede1..6d3cc57cd32 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -1485,8 +1485,20 @@ void do_volume_tex(ShadeInput *shi, float *xyz, float *col, float *alpha, float MTC_Mat4MulVecfl(ob->imat, co); } } + /* not really orco, but 'local' */ + else if(mtex->texco==TEXCO_ORCO) { + + if(mtex->texflag & MTEX_DUPLI_MAPTO) { + VECCOPY(co, shi->duplilo); + } + else { + Object *ob= shi->obi->ob; + VECCOPY(co, xyz); + MTC_Mat4MulVecfl(ob->imat, co); + } + } else if(mtex->texco==TEXCO_GLOB) { - VECCOPY(co, xyz); + VECCOPY(co, xyz); } else continue; // can happen when texco defines disappear and it renders old files @@ -1508,7 +1520,7 @@ void do_volume_tex(ShadeInput *shi, float *xyz, float *col, float *alpha, float } - rgbnor= multitex(tex, co, NULL, NULL, 0, &texres); /* NULL = dxt/dyt, 0 = shi->osatex - not supported */ + rgbnor= multitex(tex, texvec, NULL, NULL, 0, &texres); /* NULL = dxt/dyt, 0 = shi->osatex - not supported */ /* texture output */ diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 3ca8c0a0693..298b08c3545 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -42,8 +42,11 @@ #include "DNA_group_types.h" #include "DNA_lamp_types.h" +#include "BKE_global.h" + #include "render_types.h" #include "shading.h" +#include "texture.h" /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ /* defined in pipeline.c, is hardcopy of active dynamic allocated Render */ @@ -51,6 +54,7 @@ extern struct Render R; /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +#if 0 static int vol_backface_intersect_check(Isect *is, int ob, RayFace *face) { VlakRen *vlr = (VlakRen *)face; @@ -59,11 +63,16 @@ static int vol_backface_intersect_check(Isect *is, int ob, RayFace *face) * of foward facing geometry don't cause the ray to stop */ return (INPR(is->vec, vlr->n) < 0.0f); } +#endif #define VOL_IS_SAMEOBJECT 1 #define VOL_IS_SAMEMATERIAL 2 -int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco) + +#define VOL_BOUNDS_DEPTH 0 +#define VOL_BOUNDS_SS 1 + +int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, int intersect_type) { /* TODO: Box or sphere intersection types could speed things up */ @@ -77,8 +86,10 @@ int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco) isect.end[1] = co[1] + vec[1] * maxsize; isect.end[2] = co[2] + vec[2] * maxsize; + if (intersect_type == VOL_BOUNDS_DEPTH) isect.faceorig= (RayFace*)shi->vlr; + else if (intersect_type == VOL_BOUNDS_SS) isect.faceorig= NULL; + isect.mode= RE_RAY_MIRROR; - isect.faceorig= (RayFace*)shi->vlr; isect.oborig= RAY_OBJECT_SET(&R, shi->obi); isect.face_last= NULL; isect.ob_last= 0; @@ -106,8 +117,8 @@ float vol_get_density(struct ShadeInput *shi, float *co) float col[3] = {0.0, 0.0, 0.0}; /* do any density gain stuff here */ - - do_volume_tex(shi, co, col, &density, &emit_fac); + if (shi->mat->flag & MA_IS_TEXTURED) + do_volume_tex(shi, co, col, &density, &emit_fac); return density; } @@ -115,15 +126,18 @@ float vol_get_density(struct ShadeInput *shi, float *co) /* compute emission component, amount of radiance to add per segment * can be textured with 'emit' */ -void vol_get_emission(ShadeInput *shi, float *em, float *co, float *endco, float density) +void vol_get_emission(ShadeInput *shi, float *em, float *co, float density) { float emission = shi->mat->emit; - float col[3] = {0.0, 0.0, 0.0}; + float col[3]; float dens_dummy = 1.0f; + VECCOPY(col, &shi->mat->r); + do_volume_tex(shi, co, col, &dens_dummy, &emission); em[0] = em[1] = em[2] = emission; + VecMulVecf(em, em, col); } @@ -133,7 +147,6 @@ void vol_get_emission(ShadeInput *shi, float *em, float *co, float *endco, float void vol_get_attenuation(ShadeInput *shi, float *tau, float *co, float *endco, float density, float stepsize) { /* input density = density at co */ - float dist; float absorption = shi->mat->vol_absorption; int s, nsteps; @@ -194,29 +207,29 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * if(lar->mode & LA_TEXTURE) { shi->osatex= 0; - do_lamp_tex(lar, lv, shi, lacol); + do_lamp_tex(lar, lv, shi, lacol, LA_TEXTURE); } VecMulf(lacol, visifac*lar->energy); + if (shi->mat->vol_shadeflag & MA_VOL_ATTENUATED) { - /* find minimum of volume bounds, or lamp coord */ if (ELEM(lar->type, LA_SUN, LA_HEMI)) VECCOPY(lv, lar->vec); - VecMulf(lv, -1.0f); - if (vol_get_bounds(shi, co, lv, hitco)) { + /* find minimum of volume bounds, or lamp coord */ + if (vol_get_bounds(shi, co, lv, hitco, VOL_BOUNDS_SS)) { + float dist = VecLenf(co, hitco); + if (ELEM(lar->type, LA_SUN, LA_HEMI)) atten_co = hitco; - else if ( lampdist < VecLenf(co, hitco) ) + else if ( lampdist < dist ) { atten_co = lar->co; - else + } else atten_co = hitco; - atten_co = lar->co; - vol_get_attenuation(shi, tau, co, atten_co, density, shi->mat->vol_shade_stepsize); tr[0] = exp(-tau[0]); tr[1] = exp(-tau[1]); @@ -232,7 +245,7 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * } VecAddf(col, col, lacol); -} +} /* shadows -> trace a ray to find blocker geometry - if blocker is outside the volume, use standard shadow functions @@ -242,7 +255,7 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * */ /* single scattering only for now */ -void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float *endco, float stepsize, float density) +void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsize, float density) { GroupObject *go; ListBase *lights; @@ -267,8 +280,6 @@ void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float *endco VecAddf(col, col, lacol); } - - VECCOPY(scatter, col); } @@ -276,8 +287,6 @@ void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float *endco static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float *endco) { - float total_tau; - float total_tr[3]; float tr[3] = {1.f, 1.f, 1.f}; /* total transmittance */ float radiance[3] = {0.f, 0.f, 0.f}, d_radiance[3] = {0.f, 0.f, 0.f}; float stepsize = shi->mat->vol_stepsize; @@ -285,8 +294,7 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float float vec[3], stepvec[3] = {0.0, 0.0, 0.0}; float step_tau[3], step_emit[3], step_scatter[3] = {0.0, 0.0, 0.0}; int s; - float step_sta[3], step_end[3], step_offs[3] = {0.0, 0.0, 0.0}; - float alpha_fac, emit_fac=0.0f, tex_col[3]; + float step_sta[3], step_end[3]; /* multiply col_behind with beam transmittance over entire distance */ /* @@ -314,7 +322,7 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float /* get radiance from all points along the ray due to participating media */ for (s = 0; s < nsteps; s++) { float density = vol_get_density(shi, step_sta); - + /* *** transmittance and emission *** */ /* transmittance component (alpha) */ @@ -327,8 +335,8 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float //if (rgb_to_luminance(tr[0], tr[1], tr[2]) < 1e-3) break; /* incoming light via emission or scattering (additive) */ - vol_get_emission(shi, step_emit, step_sta, step_end, density); - vol_get_scattering(shi, step_scatter, step_end, step_end, stepsize, density); + vol_get_emission(shi, step_emit, step_sta, density); + vol_get_scattering(shi, step_scatter, step_end, stepsize, density); VecAddf(d_radiance, step_emit, step_scatter); @@ -336,10 +344,8 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float VecMulVecf(d_radiance, tr, d_radiance); VecAddf(radiance, radiance, d_radiance); - if (s < nsteps-1) { - VECCOPY(step_sta, step_end); - VecAddf(step_end, step_end, stepvec); - } + VECCOPY(step_sta, step_end); + VecAddf(step_end, step_end, stepvec); } VecMulf(radiance, stepsize); @@ -373,12 +379,11 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr) { - Isect isect; float hitco[3], col[3]; memset(shr, 0, sizeof(ShadeResult)); - if (vol_get_bounds(shi, shi->co, shi->view, hitco)) { + if (vol_get_bounds(shi, shi->co, shi->view, hitco, VOL_BOUNDS_DEPTH)) { volumeintegrate(shi, col, shi->co, hitco); @@ -397,4 +402,4 @@ void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr) shr->combined[2] = 0.0f; shr->combined[3] = shr->alpha = 0.0f; } -} \ No newline at end of file +} diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 73ff5945d25..eaf432f2397 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -3402,7 +3402,8 @@ static void material_panel_map_to(Object *ob, Material *ma, int from_nodes) } else if (ma->material_type == MA_VOLUME) { uiDefButBitS(block, TOG3, MAP_ALPHA, B_MATPRV, "Density", 10,180,60,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the alpha value"); - uiDefButBitS(block, TOG3, MAP_EMIT, B_MATPRV, "Emit", 70,180,45,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the emit value"); + uiDefButBitS(block, TOG3, MAP_EMIT, B_MATPRV, "Emit", 70,180,50,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the emit value"); + uiDefButBitS(block, TOG, MAP_COL, B_MATPRV, "Emit Col", 120,180,80,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect basic color of the material"); } else { uiDefButBitS(block, TOG, MAP_COL, B_MATPRV, "Col", 10,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect basic color of the material"); @@ -3525,6 +3526,7 @@ static void material_panel_map_input(Object *ob, Material *ma) uiDefButS(block, ROW, B_MATPRV, "Glob", 630,180,45,18, &(mtex->texco), 4.0, (float)TEXCO_GLOB, 0, 0, "Uses global coordinates for the texture coordinates"); uiDefButS(block, ROW, B_MATPRV, "Object", 675,180,75,18, &(mtex->texco), 4.0, (float)TEXCO_OBJECT, 0, 0, "Uses linked object's coordinates for texture coordinates"); uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_MATPRV, "Ob:",750,180,158,18, &(mtex->object), ""); + uiDefButS(block, ROW, B_MATPRV, "Local", 630,160,55,18, &(mtex->texco), 4.0, (float)TEXCO_ORCO, 0, 0, "Uses the original undeformed coordinates of the object"); } else { uiDefButS(block, ROW, B_MATPRV, "Glob", 630,180,45,18, &(mtex->texco), 4.0, (float)TEXCO_GLOB, 0, 0, "Uses global coordinates for the texture coordinates"); uiDefButS(block, ROW, B_MATPRV, "Object", 675,180,75,18, &(mtex->texco), 4.0, (float)TEXCO_OBJECT, 0, 0, "Uses linked object's coordinates for texture coordinates"); @@ -4241,14 +4243,26 @@ static void material_panel_material_volume(Material *ma) X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_stepsize), 0.001, 100.0, 10, 2, "Ray marching step size"); uiDefButF(block, NUMSLI, B_MATPRV, "Density: ", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->alpha), 0.0, 1.0, 0, 0, "Base opacity value"); - uiDefButF(block, NUM, B_MATPRV, "Absorption: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_absorption), 0.0, 5.0, 0, 0, "Multiplier for absorption"); uiBlockEndAlign(block); yco -= YSPACE; + uiBlockBeginAlign(block); + uiDefButF(block, NUM, B_MATPRV, "Absorption: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_absorption), 0.0, 5.0, 0, 0, "Multiplier for absorption"); + /* uiDefButF(block, COL, B_MATPRV, "", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_absorption_col), 0, 0, 0, B_MATCOL, ""); + */ + uiBlockEndAlign(block); + + yco -= YSPACE; + + uiBlockBeginAlign(block); uiDefButF(block, NUMSLI, B_MATPRV, "Emit: ", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->emit), 0.0, 2.0, 0, 0, "Emission component"); + uiDefButF(block, COL, B_MATPRV, "", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->r), 0, 0, 0, B_MATCOL, ""); + uiBlockEndAlign(block); yco -= YSPACE; From 6b4ac3e7def9e1b7e11398f483f2b64581939766 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 23 Sep 2008 07:05:06 +0000 Subject: [PATCH 003/577] * Volume colour absorption Rather than a single absorption value to control how much light is absorbed as it travels through a volume, there's now an additional absorption colour. This is used to absorb different R/G/B components of light at different amounts. For example, if a white light shines on a volume which absorbs green and blue components, the volume will appear red. To make it easier to use, the colour set in the UI is actually the inverse of the absorption colour, so the colour you set is the colour that the volume will appear as. Here's an example of how it works: http://mke3.net/blender/devel/rendering/volumetrics/vol_col_absorption.jpg And this can be textured too: http://mke3.net/blender/devel/rendering/volumetrics/vol_absorb_textured.png Keep in mind, this doesn't use accurate spectral light wavelength mixing (just R/G/B channels) so in cases where the absorption colour is fully red green or blue, you'll get non-physical results. Todo: refactor the volume texturing internal interface... --- source/blender/blenkernel/intern/material.c | 1 + source/blender/blenloader/intern/readfile.c | 12 ++++--- source/blender/makesdna/DNA_material_types.h | 2 +- .../blender/render/intern/include/texture.h | 2 +- source/blender/render/intern/source/texture.c | 9 +++-- .../blender/render/intern/source/volumetric.c | 35 +++++++++++++++---- source/blender/src/buttons_shading.c | 5 +-- 7 files changed, 49 insertions(+), 17 deletions(-) diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 5c20858ec63..473a035ecce 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -171,6 +171,7 @@ void init_material(Material *ma) 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->mode= MA_TRACEBLE|MA_SHADBUF|MA_SHADOW|MA_RADIO|MA_RAYBIAS|MA_TANGENT_STR; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 63f3f88da50..41035b1c373 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7737,10 +7737,14 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } for(ma=main->mat.first; ma; ma= ma->id.next) { - if (ma->vol_shade_stepsize < 0.001f) ma->vol_shade_stepsize = 0.2f; - if (ma->vol_stepsize < 0.001f) ma->vol_stepsize = 0.2f; - if (ma->vol_absorption < 0.001f) ma->vol_absorption = 1.0f; - if (ma->vol_scattering < 0.001f) ma->vol_scattering = 1.0f; + /* 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; + } } } diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index 98ddc0aa7d3..c322295fff9 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -302,7 +302,7 @@ typedef struct Material { #define MAP_AMB 2048 #define MAP_DISPLACE 4096 #define MAP_WARP 8192 -#define MAP_LAYER 16384 +#define MAP_LAYER 16384 /* mapto for halo */ //#define MAP_HA_COL 1 diff --git a/source/blender/render/intern/include/texture.h b/source/blender/render/intern/include/texture.h index 64b88c050d2..eee4ad7069a 100644 --- a/source/blender/render/intern/include/texture.h +++ b/source/blender/render/intern/include/texture.h @@ -56,7 +56,7 @@ void do_halo_tex(struct HaloRen *har, float xn, float yn, float *colf); void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, float *blend, int skyflag); void do_material_tex(struct ShadeInput *shi); void do_lamp_tex(LampRen *la, float *lavec, struct ShadeInput *shi, float *colf, int effect); -void do_volume_tex(ShadeInput *shi, float *xyz, float *col, float *alpha, float *emit); +void do_volume_tex(ShadeInput *shi, float *xyz, float *col, float *absorb_col, float *alpha, float *emit); void init_render_textures(Render *re); diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index 6d3cc57cd32..1bcefb049ae 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -1451,7 +1451,7 @@ float texture_value_blend(float tex, float out, float fact, float facg, int blen return in; } -void do_volume_tex(ShadeInput *shi, float *xyz, float *col, float *alpha, float *emit) +void do_volume_tex(ShadeInput *shi, float *xyz, float *col, float *absorb_col, float *alpha, float *emit) { MTex *mtex; Tex *tex; @@ -1550,7 +1550,7 @@ void do_volume_tex(ShadeInput *shi, float *xyz, float *col, float *alpha, float } - if(mtex->mapto & (MAP_COL)) { + if(mtex->mapto & (MAP_COL+MAP_COLMIR)) { float tcol[3], colfac; /* stencil maps on the texture control slider, not texture intensity value */ @@ -1571,6 +1571,11 @@ void do_volume_tex(ShadeInput *shi, float *xyz, float *col, float *alpha, float if(mtex->mapto & MAP_COL) { texture_rgb_blend(col, tcol, col, texres.tin, colfac, mtex->blendtype); } + + /* MAP_COLMIR is abused for absorption colour at the moment */ + if(mtex->mapto & MAP_COLMIR) { + texture_rgb_blend(absorb_col, tcol, absorb_col, texres.tin, colfac, mtex->blendtype); + } } if(mtex->mapto & MAP_VARS) { diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 298b08c3545..5966e10e1dd 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -115,10 +115,11 @@ float vol_get_density(struct ShadeInput *shi, float *co) float density = shi->mat->alpha; float emit_fac=0.0f; float col[3] = {0.0, 0.0, 0.0}; + float absorb_col[3] = {0.0, 0.0, 0.0}; /* do any density gain stuff here */ if (shi->mat->flag & MA_IS_TEXTURED) - do_volume_tex(shi, co, col, &density, &emit_fac); + do_volume_tex(shi, co, col, absorb_col, &density, &emit_fac); return density; } @@ -131,15 +132,32 @@ void vol_get_emission(ShadeInput *shi, float *em, float *co, float density) float emission = shi->mat->emit; float col[3]; float dens_dummy = 1.0f; + float absorb_col[3] = {0.0, 0.0, 0.0}; VECCOPY(col, &shi->mat->r); - do_volume_tex(shi, co, col, &dens_dummy, &emission); + do_volume_tex(shi, co, col, absorb_col, &dens_dummy, &emission); em[0] = em[1] = em[2] = emission; VecMulVecf(em, em, col); } +void vol_get_absorption(ShadeInput *shi, float *absorb_col, float *co) +{ + float col[3]; + float dummy = 1.0f; + float vec_one[3] = {1.0f, 1.0f, 1.0f}; + float absorption = shi->mat->vol_absorption; + + VECCOPY(absorb_col, shi->mat->vol_absorption_col); + + if (shi->mat->flag & MA_IS_TEXTURED) + do_volume_tex(shi, co, col, absorb_col, &dummy, &dummy); + + absorb_col[0] = (1.0f - absorb_col[0]) * absorption; + absorb_col[1] = (1.0f - absorb_col[1]) * absorption; + absorb_col[2] = (1.0f - absorb_col[2]) * absorption; +} /* Compute attenuation, otherwise known as 'optical thickness', extinction, or tau. * Used in the relationship Transmittance = e^(-attenuation) @@ -148,18 +166,20 @@ void vol_get_attenuation(ShadeInput *shi, float *tau, float *co, float *endco, f { /* input density = density at co */ float dist; - float absorption = shi->mat->vol_absorption; + float absorb_col[3]; int s, nsteps; float step_vec[3], step_sta[3], step_end[3]; - dist = VecLenf(co, endco); + vol_get_absorption(shi, absorb_col, co); + dist = VecLenf(co, endco); nsteps = (int)ceil(dist / stepsize); if (nsteps == 1) { /* homogenous volume within the sampled distance */ tau[0] = tau[1] = tau[2] = dist * density; - VecMulf(tau, absorption); + + VecMulVecf(tau, tau, absorb_col); return; } else { tau[0] = tau[1] = tau[2] = 0.0; @@ -173,7 +193,8 @@ void vol_get_attenuation(ShadeInput *shi, float *tau, float *co, float *endco, f for (s = 0; s < nsteps; s++) { - if (s > 0) density = vol_get_density(shi, step_sta); + if (s > 0) + density = vol_get_density(shi, step_sta); tau[0] += stepsize * density; tau[1] += stepsize * density; @@ -184,7 +205,7 @@ void vol_get_attenuation(ShadeInput *shi, float *tau, float *co, float *endco, f VecAddf(step_end, step_end, step_vec); } } - VecMulf(tau, absorption); + VecMulVecf(tau, tau, absorb_col); } void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float *col, float stepsize, float density) diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index eaf432f2397..7db44e4c0eb 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -3404,6 +3404,7 @@ static void material_panel_map_to(Object *ob, Material *ma, int from_nodes) uiDefButBitS(block, TOG3, MAP_ALPHA, B_MATPRV, "Density", 10,180,60,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the alpha value"); uiDefButBitS(block, TOG3, MAP_EMIT, B_MATPRV, "Emit", 70,180,50,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect the emit value"); uiDefButBitS(block, TOG, MAP_COL, B_MATPRV, "Emit Col", 120,180,80,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect basic color of the material"); + uiDefButBitS(block, TOG, MAP_COLMIR, B_MATPRV, "Absorb Col", 200,180,80,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect basic color of the material"); } else { uiDefButBitS(block, TOG, MAP_COL, B_MATPRV, "Col", 10,180,40,19, &(mtex->mapto), 0, 0, 0, 0, "Causes the texture to affect basic color of the material"); @@ -4250,9 +4251,9 @@ static void material_panel_material_volume(Material *ma) uiBlockBeginAlign(block); uiDefButF(block, NUM, B_MATPRV, "Absorption: ", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_absorption), 0.0, 5.0, 0, 0, "Multiplier for absorption"); - /* uiDefButF(block, COL, B_MATPRV, "", + uiDefButF(block, COL, B_MATPRV, "", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_absorption_col), 0, 0, 0, B_MATCOL, ""); - */ + uiBlockEndAlign(block); yco -= YSPACE; From 340c3b945e5ac5ef0076f0006f8f2248bd2a327d Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 23 Sep 2008 07:44:25 +0000 Subject: [PATCH 004/577] * Refactored the volume texture code. Seems to go ok so far, stress tests and all my old files render fine, but anyone feel free to let me know if you find a bug in this :) Should be a bit faster too, this file renders in about 60% of the time it did before (http://mke3.net/blender/devel/rendering/volumetrics/vol_col_emit.mov) --- .../blender/render/intern/include/texture.h | 2 +- source/blender/render/intern/source/texture.c | 28 +++++++++++-------- .../blender/render/intern/source/volumetric.c | 16 ++++------- 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/source/blender/render/intern/include/texture.h b/source/blender/render/intern/include/texture.h index eee4ad7069a..6e1ad562c14 100644 --- a/source/blender/render/intern/include/texture.h +++ b/source/blender/render/intern/include/texture.h @@ -56,7 +56,7 @@ void do_halo_tex(struct HaloRen *har, float xn, float yn, float *colf); void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, float *blend, int skyflag); void do_material_tex(struct ShadeInput *shi); void do_lamp_tex(LampRen *la, float *lavec, struct ShadeInput *shi, float *colf, int effect); -void do_volume_tex(ShadeInput *shi, float *xyz, float *col, float *absorb_col, float *alpha, float *emit); +void do_volume_tex(ShadeInput *shi, float *xyz, int mapto_flag, float *col, float *val); void init_render_textures(Render *re); diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index 1bcefb049ae..0fa8d2bf909 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -1451,7 +1451,7 @@ float texture_value_blend(float tex, float out, float fact, float facg, int blen return in; } -void do_volume_tex(ShadeInput *shi, float *xyz, float *col, float *absorb_col, float *alpha, float *emit) +void do_volume_tex(ShadeInput *shi, float *xyz, int mapto_flag, float *col, float *val) { MTex *mtex; Tex *tex; @@ -1472,6 +1472,10 @@ void do_volume_tex(ShadeInput *shi, float *xyz, float *col, float *absorb_col, f tex= mtex->tex; if(tex==0) continue; + /* only process if this texture is mapped + * to one that we're interested in */ + if (!(mtex->mapto & mapto_flag)) continue; + /* which coords */ if(mtex->texco==TEXCO_OBJECT) { Object *ob= mtex->object; @@ -1550,7 +1554,7 @@ void do_volume_tex(ShadeInput *shi, float *xyz, float *col, float *absorb_col, f } - if(mtex->mapto & (MAP_COL+MAP_COLMIR)) { + if((mapto_flag & (MAP_COL+MAP_COLMIR)) && (mtex->mapto & (MAP_COL+MAP_COLMIR))) { float tcol[3], colfac; /* stencil maps on the texture control slider, not texture intensity value */ @@ -1568,17 +1572,17 @@ void do_volume_tex(ShadeInput *shi, float *xyz, float *col, float *absorb_col, f } else texres.tin= texres.ta; - if(mtex->mapto & MAP_COL) { + if((mapto_flag & MAP_COL) && (mtex->mapto & MAP_COL)) { texture_rgb_blend(col, tcol, col, texres.tin, colfac, mtex->blendtype); } /* MAP_COLMIR is abused for absorption colour at the moment */ - if(mtex->mapto & MAP_COLMIR) { - texture_rgb_blend(absorb_col, tcol, absorb_col, texres.tin, colfac, mtex->blendtype); + if((mapto_flag & MAP_COLMIR) && (mtex->mapto & MAP_COLMIR)) { + texture_rgb_blend(col, tcol, col, texres.tin, colfac, mtex->blendtype); } } - if(mtex->mapto & MAP_VARS) { + if((mapto_flag & MAP_VARS) && (mtex->mapto & MAP_VARS)) { /* stencil maps on the texture control slider, not texture intensity value */ float varfac= mtex->varfac*stencilTin; @@ -1587,17 +1591,17 @@ void do_volume_tex(ShadeInput *shi, float *xyz, float *col, float *absorb_col, f else texres.tin= (0.35*texres.tr+0.45*texres.tg+0.2*texres.tb); } - if(mtex->mapto & MAP_EMIT) { + if((mapto_flag & MAP_EMIT) && (mtex->mapto & MAP_EMIT)) { int flip= mtex->maptoneg & MAP_EMIT; - *emit = texture_value_blend(mtex->def_var, *emit, texres.tin, varfac, mtex->blendtype, flip); - if(*emit<0.0) *emit= 0.0; + *val = texture_value_blend(mtex->def_var, *val, texres.tin, varfac, mtex->blendtype, flip); + if(*val<0.0) *val= 0.0; } - if(mtex->mapto & MAP_ALPHA) { + if((mapto_flag & MAP_ALPHA) && (mtex->mapto & MAP_ALPHA)) { int flip= mtex->maptoneg & MAP_ALPHA; - *alpha = texture_value_blend(mtex->def_var, *alpha, texres.tin, varfac, mtex->blendtype, flip); - CLAMP(*alpha, 0.0, 1.0); + *val = texture_value_blend(mtex->def_var, *val, texres.tin, varfac, mtex->blendtype, flip); + CLAMP(*val, 0.0, 1.0); } } } diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 5966e10e1dd..f3ce9279225 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -113,13 +113,11 @@ int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, int int float vol_get_density(struct ShadeInput *shi, float *co) { float density = shi->mat->alpha; - float emit_fac=0.0f; float col[3] = {0.0, 0.0, 0.0}; - float absorb_col[3] = {0.0, 0.0, 0.0}; - + /* do any density gain stuff here */ if (shi->mat->flag & MA_IS_TEXTURED) - do_volume_tex(shi, co, col, absorb_col, &density, &emit_fac); + do_volume_tex(shi, co, MAP_ALPHA, col, &density); return density; } @@ -130,13 +128,11 @@ float vol_get_density(struct ShadeInput *shi, float *co) void vol_get_emission(ShadeInput *shi, float *em, float *co, float density) { float emission = shi->mat->emit; - float col[3]; - float dens_dummy = 1.0f; - float absorb_col[3] = {0.0, 0.0, 0.0}; + float col[3] = {0.0, 0.0, 0.0}; VECCOPY(col, &shi->mat->r); - do_volume_tex(shi, co, col, absorb_col, &dens_dummy, &emission); + do_volume_tex(shi, co, MAP_EMIT+MAP_COL, col, &emission); em[0] = em[1] = em[2] = emission; VecMulVecf(em, em, col); @@ -144,15 +140,13 @@ void vol_get_emission(ShadeInput *shi, float *em, float *co, float density) void vol_get_absorption(ShadeInput *shi, float *absorb_col, float *co) { - float col[3]; float dummy = 1.0f; - float vec_one[3] = {1.0f, 1.0f, 1.0f}; float absorption = shi->mat->vol_absorption; VECCOPY(absorb_col, shi->mat->vol_absorption_col); if (shi->mat->flag & MA_IS_TEXTURED) - do_volume_tex(shi, co, col, absorb_col, &dummy, &dummy); + do_volume_tex(shi, co, MAP_COLMIR, absorb_col, &dummy); absorb_col[0] = (1.0f - absorb_col[0]) * absorption; absorb_col[1] = (1.0f - absorb_col[1]) * absorption; From 45acf427a7352bbffffcec93d43b50220febbd04 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 23 Sep 2008 08:00:55 +0000 Subject: [PATCH 005/577] * bugfix, old files (including default cube) weren't loading up with correctly initialised volume settings --- source/blender/blenloader/intern/readfile.c | 28 ++++++++++++--------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 41035b1c373..e106dd6cb59 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7720,7 +7720,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) Scene *sce= main->scene.first; Sequence *seq; Editing *ed; - Material *ma; while(sce) { ed= sce->ed; @@ -7735,17 +7734,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) sce= sce->id.next; } - - 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; - } - } } /*fix broken group lengths in id properties*/ @@ -7869,6 +7857,22 @@ 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; + + 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; + } + } } /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */ From aed107cf4a31f4b07d1f065d407e6ad55935afb2 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 24 Sep 2008 02:52:47 +0000 Subject: [PATCH 006/577] * Volumetrics scene integration Now other objects (and sky) correctly render if they're partially inside or behind a volume. Previously all other objects were ignored, and volumes just rendered on black. The colour of surfaces inside or behind the volume gets correctly attenuated by the density of the volume in between - i.e. thicker volumes will block the light coming from behind. However, other solid objects don't receive volume shadows yet, this is to be worked on later. http://mke3.net/blender/devel/rendering/volumetrics/vol_inside_behind.png Currently this uses raytracing to find intersections within the volume, and rays are also traced from the volume, heading behind into the scene, to see what's behind it (similar effect to ray transp with IOR 1). Because of this, objects inside or behind the volume will not be antialiased. Perhaps I can come up with a solution for this, but until then, for antialiasing, you can turn on Full OSA (warning, this will incur a slowdown). Of course you can always avoid this by rendering volumes on a separate renderlayer, and compositing in post, too. Another idea I've started thinking about is to calculate an alpha value, then use ztransp to overlay on top of other objects. This won't accurately attenuate and absorb light coming from objects behind the volume, but for some situations it may be fine, and faster too. --- .../blender/render/intern/include/shading.h | 3 + .../blender/render/intern/source/rayshade.c | 2 +- .../blender/render/intern/source/volumetric.c | 178 +++++++++++++----- 3 files changed, 134 insertions(+), 49 deletions(-) diff --git a/source/blender/render/intern/include/shading.h b/source/blender/render/intern/include/shading.h index 9229e612337..4e63d0f0d79 100644 --- a/source/blender/render/intern/include/shading.h +++ b/source/blender/render/intern/include/shading.h @@ -91,3 +91,6 @@ 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); diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index 0fd9365477c..e000a55ece6 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -205,7 +205,7 @@ void makeraytree(Render *re) re->stats_draw(&re->i); } -static void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr) +void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr) { VlakRen *vlr= (VlakRen*)is->face; ObjectInstanceRen *obi= RAY_OBJECT_GET(&R, is->ob); diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index f3ce9279225..e3d21f2d2b0 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -45,6 +45,7 @@ #include "BKE_global.h" #include "render_types.h" +#include "pixelshading.h" #include "shading.h" #include "texture.h" @@ -72,37 +73,36 @@ static int vol_backface_intersect_check(Isect *is, int ob, RayFace *face) #define VOL_BOUNDS_DEPTH 0 #define VOL_BOUNDS_SS 1 -int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, int intersect_type) +static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, Isect *isect, int intersect_type) { /* TODO: Box or sphere intersection types could speed things up */ /* raytrace method */ - Isect isect; float maxsize = RE_ray_tree_max_size(R.raytree); /* TODO: use object's bounding box to calculate max size */ - VECCOPY(isect.start, co); - isect.end[0] = co[0] + vec[0] * maxsize; - isect.end[1] = co[1] + vec[1] * maxsize; - isect.end[2] = co[2] + vec[2] * maxsize; + VECCOPY(isect->start, co); + isect->end[0] = co[0] + vec[0] * maxsize; + isect->end[1] = co[1] + vec[1] * maxsize; + isect->end[2] = co[2] + vec[2] * maxsize; - if (intersect_type == VOL_BOUNDS_DEPTH) isect.faceorig= (RayFace*)shi->vlr; - else if (intersect_type == VOL_BOUNDS_SS) isect.faceorig= NULL; + if (intersect_type == VOL_BOUNDS_DEPTH) isect->faceorig= (RayFace*)shi->vlr; + else if (intersect_type == VOL_BOUNDS_SS) isect->faceorig= NULL; - isect.mode= RE_RAY_MIRROR; - isect.oborig= RAY_OBJECT_SET(&R, shi->obi); - isect.face_last= NULL; - isect.ob_last= 0; - isect.lay= -1; + isect->mode= RE_RAY_MIRROR; + isect->oborig= RAY_OBJECT_SET(&R, shi->obi); + isect->face_last= NULL; + isect->ob_last= 0; + isect->lay= -1; - if(RE_ray_tree_intersect(R.raytree, &isect)) + if(RE_ray_tree_intersect(R.raytree, isect)) { float isvec[3]; - VECCOPY(isvec, isect.vec); - hitco[0] = isect.start[0] + isect.labda*isvec[0]; - hitco[1] = isect.start[1] + isect.labda*isvec[1]; - hitco[2] = isect.start[2] + isect.labda*isvec[2]; + VECCOPY(isvec, isect->vec); + hitco[0] = isect->start[0] + isect->labda*isvec[0]; + hitco[1] = isect->start[1] + isect->labda*isvec[1]; + hitco[2] = isect->start[2] + isect->labda*isvec[2]; return 1; } else { @@ -229,13 +229,14 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * if (shi->mat->vol_shadeflag & MA_VOL_ATTENUATED) { + Isect is; if (ELEM(lar->type, LA_SUN, LA_HEMI)) VECCOPY(lv, lar->vec); VecMulf(lv, -1.0f); /* find minimum of volume bounds, or lamp coord */ - if (vol_get_bounds(shi, co, lv, hitco, VOL_BOUNDS_SS)) { + if (vol_get_bounds(shi, co, lv, hitco, &is, VOL_BOUNDS_SS)) { float dist = VecLenf(co, hitco); if (ELEM(lar->type, LA_SUN, LA_HEMI)) @@ -298,31 +299,101 @@ void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsi VECCOPY(scatter, col); } - - -static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float *endco) +static void shade_intersection(ShadeInput *shi, float *col, Isect *is) { - float tr[3] = {1.f, 1.f, 1.f}; /* total transmittance */ + ShadeInput shi_new; + ShadeResult shr_new; + + memset(&shi_new, 0, sizeof(ShadeInput)); + + shi_new.mask= shi->mask; + shi_new.osatex= shi->osatex; + shi_new.depth= 1; /* only used to indicate tracing */ + shi_new.thread= shi->thread; + shi_new.xs= shi->xs; + shi_new.ys= shi->ys; + shi_new.lay= shi->lay; + shi_new.passflag= SCE_PASS_COMBINED; /* result of tracing needs no pass info */ + shi_new.combinedflag= 0xFFFFFF; /* ray trace does all options */ + shi_new.light_override= shi->light_override; + shi_new.mat_override= shi->mat_override; + + memset(&shr_new, 0, sizeof(ShadeResult)); + + shade_ray(is, &shi_new, &shr_new); + + col[0]= shr_new.diff[0] + shr_new.spec[0]; + col[1]= shr_new.diff[1] + shr_new.spec[1]; + col[2]= shr_new.diff[2] + shr_new.spec[2]; +} + + +static void vol_trace_behind(ShadeInput *shi, float *co, Isect *isect_first, float *col) +{ + if (isect_first != NULL) { + /* found an intersection, + * either back of volume object or another object */ + ObjectInstanceRen *obi= RAY_OBJECT_GET(&R, isect_first->ob); + + if (obi != shi->obi) { + /* already intersected with another object, so shade it */ + shade_intersection(shi, col, isect_first); + return; + } else { + /* trace a new ray onwards behind the volume */ + Isect isect; + float maxsize = RE_ray_tree_max_size(R.raytree); + + VECCOPY(isect.start, co); + isect.end[0] = co[0] + shi->view[0] * maxsize; + isect.end[1] = co[1] + shi->view[1] * maxsize; + isect.end[2] = co[2] + shi->view[2] * maxsize; + + isect.faceorig= isect_first->face; + isect.mode= RE_RAY_MIRROR; + isect.oborig= RAY_OBJECT_SET(&R, shi->obi); + isect.face_last= NULL; + isect.ob_last= 0; + isect.lay= -1; + + if(RE_ray_tree_intersect(R.raytree, &isect)) + shade_intersection(shi, col, &isect); + else + shadeSkyView(col, co, shi->view, NULL); + + return; + } + } + + col[0] = col[1] = col[2] = 0.0f; +} + +static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float *endco, Isect *isect) +{ + float tr[3] = {1.0f, 1.0f, 1.0f}; /* total transmittance */ float radiance[3] = {0.f, 0.f, 0.f}, d_radiance[3] = {0.f, 0.f, 0.f}; float stepsize = shi->mat->vol_stepsize; int nsteps; float vec[3], stepvec[3] = {0.0, 0.0, 0.0}; - float step_tau[3], step_emit[3], step_scatter[3] = {0.0, 0.0, 0.0}; + float tau[3], step_emit[3], step_scatter[3] = {0.0, 0.0, 0.0}; int s; float step_sta[3], step_end[3]; + float col_behind[3]; + float total_density = 0.f; + + float density = vol_get_density(shi, co); /* multiply col_behind with beam transmittance over entire distance */ -/* - // get col_behind - - // get total transmittance - vol_get_attenuation(shi, total_tau, start, dist, stepsize); - total_tr[0] = exp(-total_tau[0]); - total_tr[1] = exp(-total_tau[1]); - total_tr[2] = exp(-total_tau[2]); - VecMulVecf(radiance, total_tr, col_behind); -*/ - + vol_trace_behind(shi, endco, isect, col_behind); + vol_get_attenuation(shi, tau, co, endco, density, stepsize); + tr[0] *= exp(-tau[0]); + tr[1] *= exp(-tau[1]); + tr[2] *= exp(-tau[2]); + VecMulVecf(radiance, tr, col_behind); + tr[0] = tr[1] = tr[2] = 1.0f; + + + /* ray marching */ nsteps = (int)ceil(VecLenf(co, endco) / stepsize); @@ -333,18 +404,17 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float VECCOPY(step_sta, co); VecAddf(step_end, step_sta, stepvec); - /* get radiance from all points along the ray due to participating media */ for (s = 0; s < nsteps; s++) { - float density = vol_get_density(shi, step_sta); + if (s > 0) density = vol_get_density(shi, step_sta); /* *** transmittance and emission *** */ /* transmittance component (alpha) */ - vol_get_attenuation(shi, step_tau, step_sta, step_end, density, stepsize); - tr[0] *= exp(-step_tau[0]); - tr[1] *= exp(-step_tau[1]); - tr[2] *= exp(-step_tau[2]); + vol_get_attenuation(shi, tau, step_sta, step_end, density, stepsize); + tr[0] *= exp(-tau[0]); + tr[1] *= exp(-tau[1]); + tr[2] *= exp(-tau[2]); /* Terminate raymarching if transmittance is small */ //if (rgb_to_luminance(tr[0], tr[1], tr[2]) < 1e-3) break; @@ -357,14 +427,24 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float /* Lv += Tr * (Lve() + Ld) */ VecMulVecf(d_radiance, tr, d_radiance); + VecMulf(d_radiance, stepsize); + VecAddf(radiance, radiance, d_radiance); VECCOPY(step_sta, step_end); VecAddf(step_end, step_end, stepvec); + + total_density += density; } - VecMulf(radiance, stepsize); - VECCOPY(col, radiance); + + + col[0] = radiance[0]; + col[1] = radiance[1]; + col[2] = radiance[2]; + + col[3] = 1.0f; + //col[3] = total_density * stepsize; /* Incoming radiance = @@ -394,21 +474,23 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr) { - float hitco[3], col[3]; + float hitco[3], col[4]; + Isect is; memset(shr, 0, sizeof(ShadeResult)); - if (vol_get_bounds(shi, shi->co, shi->view, hitco, VOL_BOUNDS_DEPTH)) { + if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH)) { - volumeintegrate(shi, col, shi->co, hitco); + volumeintegrate(shi, col, shi->co, hitco, &is); /* hit */ - shr->alpha = 1.0f; shr->combined[0] = col[0]; shr->combined[1] = col[1]; shr->combined[2] = col[2]; + shr->combined[3] = 0.0f; + shr->alpha = col[3]; - QUATCOPY(shr->diff, shr->combined); + VECCOPY(shr->diff, shr->combined); } else { /* no hit */ From a0a5198a03ec705e6faf3a995315c8615336963a Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 24 Sep 2008 07:38:12 +0000 Subject: [PATCH 007/577] Volumetrics: * Now it's possible to render with the camera inside a volume. I'm not sure how this goes with overlapping volumes yet, will look at it. But it allows nice things like this :) http://mke3.net/blender/devel/rendering/volumetrics/clouds_sky.mov * Sped up shading significantly by not doing any shading if the density of the current sample is less than 0.01 (there's nothing to shade there anyway!) Speeds up around 200% on that clouds scene. * Fixed a bug in global texture coordinates for volume textures --- .../blender/render/intern/include/shading.h | 1 + .../blender/render/intern/source/rayshade.c | 7 +- source/blender/render/intern/source/texture.c | 1 + .../blender/render/intern/source/volumetric.c | 150 +++++++++++------- source/blender/src/buttons_shading.c | 7 +- 5 files changed, 108 insertions(+), 58 deletions(-) diff --git a/source/blender/render/intern/include/shading.h b/source/blender/render/intern/include/shading.h index 4e63d0f0d79..54a8d4b0404 100644 --- a/source/blender/render/intern/include/shading.h +++ b/source/blender/render/intern/include/shading.h @@ -33,6 +33,7 @@ struct VlakRen; struct StrandSegment; struct StrandPoint; struct ObjectInstanceRen obi; +struct Isect; /* shadeinput.c */ diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index e000a55ece6..5e06b298bdb 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -274,9 +274,10 @@ void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr) ntreeShaderExecTree(shi->mat->nodetree, shi, shr); shi->mat= vlr->mat; /* shi->mat is being set in nodetree */ } - else - shade_material_loop(shi, shr); - + else { + if (shi->mat->material_type == MA_SOLID) shade_material_loop(shi, shr); + else if (shi->mat->material_type == MA_VOLUME) shade_volume_loop(shi, shr); + } /* raytrace likes to separate the spec color */ VECSUB(shr->diff, shr->combined, shr->spec); } diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index 0fa8d2bf909..2c143986900 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -1503,6 +1503,7 @@ void do_volume_tex(ShadeInput *shi, float *xyz, int mapto_flag, float *col, floa } else if(mtex->texco==TEXCO_GLOB) { VECCOPY(co, xyz); + MTC_Mat4MulVecfl(R.viewinv, co); } else continue; // can happen when texco defines disappear and it renders old files diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index e3d21f2d2b0..032175f522b 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -138,6 +138,15 @@ void vol_get_emission(ShadeInput *shi, float *em, float *co, float density) VecMulVecf(em, em, col); } +void vol_get_scattering_fac(ShadeInput *shi, float *scatter_fac, float *co, float density) +{ + //float col[3] = {0.0, 0.0, 0.0}; + //do_volume_tex(shi, co, MAP_EMIT+MAP_COL, col, &emission); + + *scatter_fac = shi->mat->vol_scattering; +} + + void vol_get_absorption(ShadeInput *shi, float *absorb_col, float *co) { float dummy = 1.0f; @@ -282,12 +291,16 @@ void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsi for(go=lights->first; go; go= go->next) { float lacol[3] = {0.f, 0.f, 0.f}; + float scatter_fac; lar= go->lampren; if (lar==NULL) continue; vol_shade_one_lamp(shi, co, lar, lacol, stepsize, density); + vol_get_scattering_fac(shi, &scatter_fac, co, density); + VecMulf(lacol, scatter_fac); + /* isotropic phase function */ VecMulf(lacol, 1.0f / (4.f * M_PI)); @@ -330,9 +343,13 @@ static void shade_intersection(ShadeInput *shi, float *col, Isect *is) static void vol_trace_behind(ShadeInput *shi, float *co, Isect *isect_first, float *col) { + RayFace *rforig=NULL; + Isect isect; + float maxsize = RE_ray_tree_max_size(R.raytree); + if (isect_first != NULL) { - /* found an intersection, - * either back of volume object or another object */ + /* there was already a ray intersection - + * either the back of volume object or another object */ ObjectInstanceRen *obi= RAY_OBJECT_GET(&R, isect_first->ob); if (obi != shi->obi) { @@ -340,32 +357,39 @@ static void vol_trace_behind(ShadeInput *shi, float *co, Isect *isect_first, flo shade_intersection(shi, col, isect_first); return; } else { - /* trace a new ray onwards behind the volume */ - Isect isect; - float maxsize = RE_ray_tree_max_size(R.raytree); - - VECCOPY(isect.start, co); - isect.end[0] = co[0] + shi->view[0] * maxsize; - isect.end[1] = co[1] + shi->view[1] * maxsize; - isect.end[2] = co[2] + shi->view[2] * maxsize; - - isect.faceorig= isect_first->face; - isect.mode= RE_RAY_MIRROR; - isect.oborig= RAY_OBJECT_SET(&R, shi->obi); - isect.face_last= NULL; - isect.ob_last= 0; - isect.lay= -1; - - if(RE_ray_tree_intersect(R.raytree, &isect)) - shade_intersection(shi, col, &isect); - else - shadeSkyView(col, co, shi->view, NULL); - - return; + rforig = isect_first->face; } } - col[0] = col[1] = col[2] = 0.0f; + /* get ready to trace a new ray behind the volume */ + VECCOPY(isect.start, co) + + if (rforig == NULL) { + /* if there's no original ray intersection then the original + * shaded surface is the inside of the volume at the far bounds. + * We can use this face for the raytrace orig face */ + isect.faceorig= (RayFace *)shi->vlr; + } else { + isect.faceorig= rforig; + } + + isect.end[0] = isect.start[0] + shi->view[0] * maxsize; + isect.end[1] = isect.start[1] + shi->view[1] * maxsize; + isect.end[2] = isect.start[2] + shi->view[2] * maxsize; + + isect.mode= RE_RAY_MIRROR; + isect.oborig= RAY_OBJECT_SET(&R, shi->obi); + isect.face_last= NULL; + isect.ob_last= 0; + isect.lay= -1; + + /* check to see if there's anything behind the volume, otherwise shade the sky */ + if(RE_ray_tree_intersect(R.raytree, &isect)) { + shade_intersection(shi, col, &isect); + } else { + shadeSkyView(col, co, shi->view, NULL); + } + } static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float *endco, Isect *isect) @@ -392,8 +416,6 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float VecMulVecf(radiance, tr, col_behind); tr[0] = tr[1] = tr[2] = 1.0f; - - /* ray marching */ nsteps = (int)ceil(VecLenf(co, endco) / stepsize); @@ -408,28 +430,31 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float for (s = 0; s < nsteps; s++) { if (s > 0) density = vol_get_density(shi, step_sta); - /* *** transmittance and emission *** */ + /* there's only any point shading here + * if there's actually some density to shade! */ + if (density > 0.01f) { - /* transmittance component (alpha) */ - vol_get_attenuation(shi, tau, step_sta, step_end, density, stepsize); - tr[0] *= exp(-tau[0]); - tr[1] *= exp(-tau[1]); - tr[2] *= exp(-tau[2]); - - /* Terminate raymarching if transmittance is small */ - //if (rgb_to_luminance(tr[0], tr[1], tr[2]) < 1e-3) break; - - /* incoming light via emission or scattering (additive) */ - vol_get_emission(shi, step_emit, step_sta, density); - vol_get_scattering(shi, step_scatter, step_end, stepsize, density); - - VecAddf(d_radiance, step_emit, step_scatter); - - /* Lv += Tr * (Lve() + Ld) */ - VecMulVecf(d_radiance, tr, d_radiance); - VecMulf(d_radiance, stepsize); - - VecAddf(radiance, radiance, d_radiance); + /* transmittance component (alpha) */ + vol_get_attenuation(shi, tau, step_sta, step_end, density, stepsize); + tr[0] *= exp(-tau[0]); + tr[1] *= exp(-tau[1]); + tr[2] *= exp(-tau[2]); + + /* Terminate raymarching if transmittance is small */ + //if (rgb_to_luminance(tr[0], tr[1], tr[2]) < 1e-3) break; + + /* incoming light via emission or scattering (additive) */ + vol_get_emission(shi, step_emit, step_sta, density); + vol_get_scattering(shi, step_scatter, step_end, stepsize, density); + + VecAddf(d_radiance, step_emit, step_scatter); + + /* Lv += Tr * (Lve() + Ld) */ + VecMulVecf(d_radiance, tr, d_radiance); + VecMulf(d_radiance, stepsize); + + VecAddf(radiance, radiance, d_radiance); + } VECCOPY(step_sta, step_end); VecAddf(step_end, step_end, stepvec); @@ -479,15 +504,32 @@ void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr) memset(shr, 0, sizeof(ShadeResult)); - if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH)) { + /* if original normal is facing away from the camera, + * then we're inside the volume already. + * so integrate from the camera to the shading coord */ + //if (INPR(shi->orignor, shi->view) < 0.0f) { + if (shi->flippednor) { - volumeintegrate(shi, col, shi->co, hitco, &is); + const float co_cam[3] = {0.0, 0.0, 0.0}; + volumeintegrate(shi, col, co_cam, shi->co, NULL); - /* hit */ shr->combined[0] = col[0]; shr->combined[1] = col[1]; shr->combined[2] = col[2]; - shr->combined[3] = 0.0f; + shr->combined[3] = 1.0f; + shr->alpha = col[3]; + + VECCOPY(shr->diff, shr->combined); + + } + else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH)) { + volumeintegrate(shi, col, shi->co, hitco, &is); + + + shr->combined[0] = col[0]; + shr->combined[1] = col[1]; + shr->combined[2] = col[2]; + shr->combined[3] = 1.0f; shr->alpha = col[3]; VECCOPY(shr->diff, shr->combined); @@ -496,7 +538,7 @@ void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr) /* no hit */ shr->combined[0] = 0.0f; shr->combined[1] = 0.0f; - shr->combined[2] = 0.0f; - shr->combined[3] = shr->alpha = 0.0f; + shr->combined[2] = 1.0f; + shr->combined[3] = shr->alpha = 1.0f; } } diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 7db44e4c0eb..3972e4c3338 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -4250,7 +4250,7 @@ static void material_panel_material_volume(Material *ma) uiBlockBeginAlign(block); uiDefButF(block, NUM, B_MATPRV, "Absorption: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_absorption), 0.0, 5.0, 0, 0, "Multiplier for absorption"); + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_absorption), 0.0, 10.0, 10, 0, "Multiplier for absorption"); uiDefButF(block, COL, B_MATPRV, "", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_absorption_col), 0, 0, 0, B_MATCOL, ""); @@ -4266,6 +4266,11 @@ static void material_panel_material_volume(Material *ma) uiBlockEndAlign(block); yco -= YSPACE; + + uiDefButF(block, NUM, B_MATPRV, "Scattering: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_scattering), 0.0, 10.0, 10, 0, "Multiplier for scattering"); + + yco -= YSPACE; uiBlockBeginAlign(block); uiDefButBitS(block, TOG, MA_VOL_ATTENUATED, B_MATPRV, "Shading", From 0417e79586fd1857ac101d17cd6038bc4f2efe3f Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 24 Sep 2008 07:49:24 +0000 Subject: [PATCH 008/577] * Moved the sample location for shading to the middle of the volumetric step. This fixes a nagging bug that would cause noise/odd moire-ish patterns, due to raytrace numerical errors: http://mke3.net/blender/devel/rendering/volumetrics/vol_clouds_moire.jpg --- source/blender/render/intern/source/volumetric.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 032175f522b..d4c3f393a0e 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -401,7 +401,7 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float float vec[3], stepvec[3] = {0.0, 0.0, 0.0}; float tau[3], step_emit[3], step_scatter[3] = {0.0, 0.0, 0.0}; int s; - float step_sta[3], step_end[3]; + float step_sta[3], step_end[3], step_mid[3]; float col_behind[3]; float total_density = 0.f; @@ -433,6 +433,9 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float /* there's only any point shading here * if there's actually some density to shade! */ if (density > 0.01f) { + step_mid[0] = step_sta[0] + (stepvec[0] * 0.5); + step_mid[1] = step_sta[1] + (stepvec[1] * 0.5); + step_mid[2] = step_sta[2] + (stepvec[2] * 0.5); /* transmittance component (alpha) */ vol_get_attenuation(shi, tau, step_sta, step_end, density, stepsize); @@ -444,8 +447,8 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float //if (rgb_to_luminance(tr[0], tr[1], tr[2]) < 1e-3) break; /* incoming light via emission or scattering (additive) */ - vol_get_emission(shi, step_emit, step_sta, density); - vol_get_scattering(shi, step_scatter, step_end, stepsize, density); + vol_get_emission(shi, step_emit, step_mid, density); + vol_get_scattering(shi, step_scatter, step_mid, stepsize, density); VecAddf(d_radiance, step_emit, step_scatter); From 707f2e300cb44891210bf0168489a0cfb36b3c69 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 25 Sep 2008 06:08:41 +0000 Subject: [PATCH 009/577] * Worked a bit on cleaning up the code involving layering volumes on solids, in front of other volumes, etc. Now there's a 'layer depth' value that works similarly to refraction depth - a limit for how many times the view ray will penetrate different volumetric surfaces. I have it close to being able to return alpha, but it's still not 100% correct and needs a bit more work. Going to sit on this for a while. --- source/blender/blenkernel/intern/material.c | 1 + source/blender/blenloader/intern/readfile.c | 1 + source/blender/makesdna/DNA_material_types.h | 2 +- .../render/extern/include/RE_shader_ext.h | 2 +- .../blender/render/intern/source/shadeinput.c | 4 + .../blender/render/intern/source/volumetric.c | 248 +++++++++--------- source/blender/src/buttons_shading.c | 54 ++-- 7 files changed, 159 insertions(+), 153 deletions(-) diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 473a035ecce..8f4e65576d8 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -172,6 +172,7 @@ void init_material(Material *ma) 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_raydepth = 15; ma->mode= MA_TRACEBLE|MA_SHADBUF|MA_SHADOW|MA_RADIO|MA_RAYBIAS|MA_TANGENT_STR; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index e106dd6cb59..658c14f5876 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7871,6 +7871,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) 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_raydepth == 0) ma->vol_raydepth = 15; } } } diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index c322295fff9..d20ea600fea 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -71,8 +71,8 @@ typedef struct Material { float vol_absorption, vol_scattering; float vol_absorption_col[3]; float vpad2; + short vol_raydepth; short vol_shadeflag; - short vpad; float fresnel_mir, fresnel_mir_i; float fresnel_tra, fresnel_tra_i; diff --git a/source/blender/render/extern/include/RE_shader_ext.h b/source/blender/render/extern/include/RE_shader_ext.h index e8403053e0b..5d74895f0c8 100644 --- a/source/blender/render/extern/include/RE_shader_ext.h +++ b/source/blender/render/extern/include/RE_shader_ext.h @@ -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 */ diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index cd5ecc413df..8d4206a75ae 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -671,6 +671,10 @@ void shade_input_set_viewco(ShadeInput *shi, float x, float y, float z) } } + /* set camera coords - for scanline, it's always 0.0,0.0,0.0 (render is in camera space) + * however for raytrace it can be different - the position of the last intersection */ + shi->camera_co[0] = shi->camera_co[1] = shi->camera_co[2] = 0.0f; + /* cannot normalize earlier, code above needs it at viewplane level */ Normalize(shi->view); } diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index d4c3f393a0e..4baeabcfa7a 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -55,7 +55,7 @@ extern struct Render R; /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -#if 0 + static int vol_backface_intersect_check(Isect *is, int ob, RayFace *face) { VlakRen *vlr = (VlakRen *)face; @@ -64,21 +64,33 @@ static int vol_backface_intersect_check(Isect *is, int ob, RayFace *face) * of foward facing geometry don't cause the ray to stop */ return (INPR(is->vec, vlr->n) < 0.0f); } -#endif -#define VOL_IS_SAMEOBJECT 1 +static int vol_frontface_intersect_check(Isect *is, int ob, RayFace *face) +{ + VlakRen *vlr = (VlakRen *)face; + + /* only consider faces away, so overlapping layers + * of foward facing geometry don't cause the ray to stop */ + return (INPR(is->vec, vlr->n) > 0.0f); +} + +static int vol_always_intersect_check(Isect *is, int ob, RayFace *face) +{ + return 1; +} + +#define VOL_IS_BACKFACE 1 #define VOL_IS_SAMEMATERIAL 2 #define VOL_BOUNDS_DEPTH 0 #define VOL_BOUNDS_SS 1 -static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, Isect *isect, int intersect_type) +/* TODO: Box or sphere intersection types could speed things up */ +static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, Isect *isect, int intersect_type, int checkfunc) { - /* TODO: Box or sphere intersection types could speed things up */ - - /* raytrace method */ float maxsize = RE_ray_tree_max_size(R.raytree); + int intersected=0; /* TODO: use object's bounding box to calculate max size */ VECCOPY(isect->start, co); @@ -86,16 +98,21 @@ static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, isect->end[1] = co[1] + vec[1] * maxsize; isect->end[2] = co[2] + vec[2] * maxsize; - if (intersect_type == VOL_BOUNDS_DEPTH) isect->faceorig= (RayFace*)shi->vlr; - else if (intersect_type == VOL_BOUNDS_SS) isect->faceorig= NULL; - isect->mode= RE_RAY_MIRROR; isect->oborig= RAY_OBJECT_SET(&R, shi->obi); isect->face_last= NULL; isect->ob_last= 0; isect->lay= -1; - if(RE_ray_tree_intersect(R.raytree, isect)) + if (intersect_type == VOL_BOUNDS_DEPTH) isect->faceorig= (RayFace*)shi->vlr; + else if (intersect_type == VOL_BOUNDS_SS) isect->faceorig= NULL; + + if (checkfunc==VOL_IS_BACKFACE) + intersected = RE_ray_tree_intersect_check(R.raytree, isect, vol_backface_intersect_check); + else + intersected = RE_ray_tree_intersect(R.raytree, isect); + + if(intersected) { float isvec[3]; @@ -245,7 +262,7 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * VecMulf(lv, -1.0f); /* find minimum of volume bounds, or lamp coord */ - if (vol_get_bounds(shi, co, lv, hitco, &is, VOL_BOUNDS_SS)) { + if (vol_get_bounds(shi, co, lv, hitco, &is, VOL_BOUNDS_SS, 0)) { float dist = VecLenf(co, hitco); if (ELEM(lar->type, LA_SUN, LA_HEMI)) @@ -312,87 +329,7 @@ void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsi VECCOPY(scatter, col); } -static void shade_intersection(ShadeInput *shi, float *col, Isect *is) -{ - ShadeInput shi_new; - ShadeResult shr_new; - - memset(&shi_new, 0, sizeof(ShadeInput)); - - shi_new.mask= shi->mask; - shi_new.osatex= shi->osatex; - shi_new.depth= 1; /* only used to indicate tracing */ - shi_new.thread= shi->thread; - shi_new.xs= shi->xs; - shi_new.ys= shi->ys; - shi_new.lay= shi->lay; - shi_new.passflag= SCE_PASS_COMBINED; /* result of tracing needs no pass info */ - shi_new.combinedflag= 0xFFFFFF; /* ray trace does all options */ - shi_new.light_override= shi->light_override; - shi_new.mat_override= shi->mat_override; - - memset(&shr_new, 0, sizeof(ShadeResult)); - - shade_ray(is, &shi_new, &shr_new); - - col[0]= shr_new.diff[0] + shr_new.spec[0]; - col[1]= shr_new.diff[1] + shr_new.spec[1]; - col[2]= shr_new.diff[2] + shr_new.spec[2]; -} - - -static void vol_trace_behind(ShadeInput *shi, float *co, Isect *isect_first, float *col) -{ - RayFace *rforig=NULL; - Isect isect; - float maxsize = RE_ray_tree_max_size(R.raytree); - - if (isect_first != NULL) { - /* there was already a ray intersection - - * either the back of volume object or another object */ - ObjectInstanceRen *obi= RAY_OBJECT_GET(&R, isect_first->ob); - - if (obi != shi->obi) { - /* already intersected with another object, so shade it */ - shade_intersection(shi, col, isect_first); - return; - } else { - rforig = isect_first->face; - } - } - - /* get ready to trace a new ray behind the volume */ - VECCOPY(isect.start, co) - - if (rforig == NULL) { - /* if there's no original ray intersection then the original - * shaded surface is the inside of the volume at the far bounds. - * We can use this face for the raytrace orig face */ - isect.faceorig= (RayFace *)shi->vlr; - } else { - isect.faceorig= rforig; - } - - isect.end[0] = isect.start[0] + shi->view[0] * maxsize; - isect.end[1] = isect.start[1] + shi->view[1] * maxsize; - isect.end[2] = isect.start[2] + shi->view[2] * maxsize; - - isect.mode= RE_RAY_MIRROR; - isect.oborig= RAY_OBJECT_SET(&R, shi->obi); - isect.face_last= NULL; - isect.ob_last= 0; - isect.lay= -1; - - /* check to see if there's anything behind the volume, otherwise shade the sky */ - if(RE_ray_tree_intersect(R.raytree, &isect)) { - shade_intersection(shi, col, &isect); - } else { - shadeSkyView(col, co, shi->view, NULL); - } - -} - -static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float *endco, Isect *isect) +static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float *endco) { float tr[3] = {1.0f, 1.0f, 1.0f}; /* total transmittance */ float radiance[3] = {0.f, 0.f, 0.f}, d_radiance[3] = {0.f, 0.f, 0.f}; @@ -403,18 +340,17 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float int s; float step_sta[3], step_end[3], step_mid[3]; float col_behind[3]; - float total_density = 0.f; - + float alpha; float density = vol_get_density(shi, co); /* multiply col_behind with beam transmittance over entire distance */ - vol_trace_behind(shi, endco, isect, col_behind); vol_get_attenuation(shi, tau, co, endco, density, stepsize); tr[0] *= exp(-tau[0]); tr[1] *= exp(-tau[1]); tr[2] *= exp(-tau[2]); - VecMulVecf(radiance, tr, col_behind); + VecMulVecf(radiance, tr, col); tr[0] = tr[1] = tr[2] = 1.0f; + /* ray marching */ nsteps = (int)ceil(VecLenf(co, endco) / stepsize); @@ -444,7 +380,7 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float tr[2] *= exp(-tau[2]); /* Terminate raymarching if transmittance is small */ - //if (rgb_to_luminance(tr[0], tr[1], tr[2]) < 1e-3) break; + //if ((tr[0] + tr[1] + tr[2] * 0.333f) < 0.01f) continue; /* incoming light via emission or scattering (additive) */ vol_get_emission(shi, step_emit, step_mid, density); @@ -461,18 +397,14 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float VECCOPY(step_sta, step_end); VecAddf(step_end, step_end, stepvec); - - total_density += density; } - - col[0] = radiance[0]; col[1] = radiance[1]; col[2] = radiance[2]; - col[3] = 1.0f; - //col[3] = total_density * stepsize; + alpha = 1.0f -(tr[0] + tr[1] + tr[2]) * 0.333f; + col[3] = alpha; /* Incoming radiance = @@ -492,56 +424,124 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float -- To find radiance from segments along the way: find radiance for one step: - loop over lights and weight by phase function - - - single scattering - : integrate over sphere - - then multiply each step for final exit radiance */ } +static void shade_intersection(ShadeInput *shi, float *col, Isect *is) +{ + ShadeInput shi_new; + ShadeResult shr_new; + + memset(&shi_new, 0, sizeof(ShadeInput)); + + shi_new.mask= shi->mask; + shi_new.osatex= shi->osatex; + shi_new.depth= shi->depth + 1; + shi_new.thread= shi->thread; + shi_new.xs= shi->xs; + shi_new.ys= shi->ys; + shi_new.lay= shi->lay; + shi_new.passflag= SCE_PASS_COMBINED; /* result of tracing needs no pass info */ + shi_new.combinedflag= 0xFFFFFF; /* ray trace does all options */ + shi_new.light_override= shi->light_override; + shi_new.mat_override= shi->mat_override; + + VECCOPY(shi_new.camera_co, is->start); + + memset(&shr_new, 0, sizeof(ShadeResult)); + + if (shi->depth < shi->mat->vol_raydepth) + shade_ray(is, &shi_new, &shr_new); + + col[0] = shr_new.combined[0]; + col[1] = shr_new.combined[1]; + col[2] = shr_new.combined[2]; + col[3] = shr_new.alpha; +} + +static void vol_trace_behind(ShadeInput *shi, VlakRen *vlr, float *co, float *col) +{ + Isect isect; + float maxsize = RE_ray_tree_max_size(R.raytree); + + VECCOPY(isect.start, co); + isect.end[0] = isect.start[0] + shi->view[0] * maxsize; + isect.end[1] = isect.start[1] + shi->view[1] * maxsize; + isect.end[2] = isect.start[2] + shi->view[2] * maxsize; + + isect.faceorig= (RayFace *)vlr; + + isect.mode= RE_RAY_MIRROR; + isect.oborig= RAY_OBJECT_SET(&R, shi->obi); + isect.face_last= NULL; + isect.ob_last= 0; + isect.lay= -1; + + /* check to see if there's anything behind the volume, otherwise shade the sky */ + if(RE_ray_tree_intersect(R.raytree, &isect)) { + shade_intersection(shi, col, &isect); + } else { + shadeSkyView(col, co, shi->view, NULL); + } +} + void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr) { - float hitco[3], col[4]; + float hitco[3], col[4] = {0.f,0.f,0.f,0.f}; Isect is; memset(shr, 0, sizeof(ShadeResult)); - /* if original normal is facing away from the camera, - * then we're inside the volume already. - * so integrate from the camera to the shading coord */ - //if (INPR(shi->orignor, shi->view) < 0.0f) { + /* if 1st hit normal is facing away from the camera, + * then we're inside the volume already. */ if (shi->flippednor) { + /* trace behind the 1st hit point */ + vol_trace_behind(shi, shi->vlr, shi->co, col); - const float co_cam[3] = {0.0, 0.0, 0.0}; - volumeintegrate(shi, col, co_cam, shi->co, NULL); + /* shade volume from 'camera' to 1st hit point */ + volumeintegrate(shi, col, shi->camera_co, shi->co); shr->combined[0] = col[0]; shr->combined[1] = col[1]; shr->combined[2] = col[2]; - shr->combined[3] = 1.0f; + + if (col[3] > 1.0f) col[3] = 1.0f; + shr->combined[3] = col[3]; shr->alpha = col[3]; VECCOPY(shr->diff, shr->combined); - } - else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH)) { - volumeintegrate(shi, col, shi->co, hitco, &is); + /* trace to find a backface, the other side bounds of the volume */ + /* (ray intersect ignores front faces here) */ + else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH, 0)) { + VlakRen *vlr = (VlakRen *)is.face; + + /* if it's another face in the same material */ + if (vlr->mat == shi->mat) { + /* trace behind the 2nd (raytrace) hit point */ + vol_trace_behind(shi, (VlakRen *)is.face, hitco, col); + } else { + shade_intersection(shi, col, &is); + } + + /* shade volume from 1st hit point to 2nd hit point */ + volumeintegrate(shi, col, shi->co, hitco); - shr->combined[0] = col[0]; shr->combined[1] = col[1]; shr->combined[2] = col[2]; - shr->combined[3] = 1.0f; + + //if (col[3] > 1.0f) + col[3] = 1.0f; + shr->combined[3] = col[3]; shr->alpha = col[3]; VECCOPY(shr->diff, shr->combined); } else { - /* no hit */ shr->combined[0] = 0.0f; shr->combined[1] = 0.0f; - shr->combined[2] = 1.0f; + shr->combined[2] = 0.0f; shr->combined[3] = shr->alpha = 1.0f; } } diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 3972e4c3338..a288845c39d 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -3528,6 +3528,8 @@ static void material_panel_map_input(Object *ob, Material *ma) uiDefButS(block, ROW, B_MATPRV, "Object", 675,180,75,18, &(mtex->texco), 4.0, (float)TEXCO_OBJECT, 0, 0, "Uses linked object's coordinates for texture coordinates"); uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_MATPRV, "Ob:",750,180,158,18, &(mtex->object), ""); uiDefButS(block, ROW, B_MATPRV, "Local", 630,160,55,18, &(mtex->texco), 4.0, (float)TEXCO_ORCO, 0, 0, "Uses the original undeformed coordinates of the object"); + + } else { uiDefButS(block, ROW, B_MATPRV, "Glob", 630,180,45,18, &(mtex->texco), 4.0, (float)TEXCO_GLOB, 0, 0, "Uses global coordinates for the texture coordinates"); uiDefButS(block, ROW, B_MATPRV, "Object", 675,180,75,18, &(mtex->texco), 4.0, (float)TEXCO_OBJECT, 0, 0, "Uses linked object's coordinates for texture coordinates"); @@ -4244,43 +4246,41 @@ static void material_panel_material_volume(Material *ma) X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_stepsize), 0.001, 100.0, 10, 2, "Ray marching step size"); uiDefButF(block, NUMSLI, B_MATPRV, "Density: ", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->alpha), 0.0, 1.0, 0, 0, "Base opacity value"); + uiDefButS(block, NUM, B_MATPRV, "Layer Depth: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_raydepth), 0.0, 512.0, 10, 2, "Number of layered volume ray intersections allowed per pixel"); uiBlockEndAlign(block); yco -= YSPACE; - - uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_MATPRV, "Absorption: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_absorption), 0.0, 10.0, 10, 0, "Multiplier for absorption"); - uiDefButF(block, COL, B_MATPRV, "", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_absorption_col), 0, 0, 0, B_MATCOL, ""); - - uiBlockEndAlign(block); - - yco -= YSPACE; - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, B_MATPRV, "Emit: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->emit), 0.0, 2.0, 0, 0, "Emission component"); - uiDefButF(block, COL, B_MATPRV, "", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->r), 0, 0, 0, B_MATCOL, ""); - uiBlockEndAlign(block); - - yco -= YSPACE; - - uiDefButF(block, NUM, B_MATPRV, "Scattering: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_scattering), 0.0, 10.0, 10, 0, "Multiplier for scattering"); - - yco -= YSPACE; - + uiBlockBeginAlign(block); uiDefButBitS(block, TOG, MA_VOL_ATTENUATED, B_MATPRV, "Shading", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shadeflag), 0, 0, 0, 0, "Uses absorption for light attenuation"); uiDefButF(block, NUM, B_MATPRV, "Step Size: ", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shade_stepsize), 0.001, 100.0, 10, 2, "Step"); uiBlockEndAlign(block); + + yco = PANEL_YMAX; + + uiBlockBeginAlign(block); + uiDefButF(block, NUM, B_MATPRV, "Absorption: ", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->vol_absorption), 0.0, 10.0, 10, 0, "Multiplier for absorption"); + uiDefButF(block, COL, B_MATPRV, "", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->vol_absorption_col), 0, 0, 0, B_MATCOL, ""); + uiBlockEndAlign(block); - uiDefBut(block, LABEL, B_DIFF, "", - X2CLM2, yco, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + yco -= YSPACE; + + uiBlockBeginAlign(block); + uiDefButF(block, NUMSLI, B_MATPRV, "Emit: ", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->emit), 0.0, 2.0, 0, 0, "Emission component"); + uiDefButF(block, COL, B_MATPRV, "", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->r), 0, 0, 0, B_MATCOL, ""); + uiBlockEndAlign(block); + + yco -= YSPACE; + + uiDefButF(block, NUM, B_MATPRV, "Scattering: ", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->vol_scattering), 0.0, 10.0, 10, 0, "Multiplier for scattering"); } static void material_panel_nodes(Material *ma) From 78c50f7af1d694252984885e0eac87682647e2d2 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Fri, 26 Sep 2008 01:54:31 +0000 Subject: [PATCH 010/577] Wheee! Initial commit for supporting rendering particles directly as volume density. It works by looking up how many particles are within a specified radius of the currently shaded point and using that to calculate density (which is used just as any other measure of density would be). http://mke3.net/blender/devel/rendering/volumetrics/smoke_test01.mov http://mke3.net/blender/devel/rendering/volumetrics/smoke_test01.blend Right now it's an early implementation, just to see that it can work - it may end up changing quite a bit. Currently, it's just a single switch on the volume material - it looks up all particles in the scene for density at the current shaded point in world space (so the volume region must enclose the particles in order to render them. This will probably change - one idea I have is to make the particle density estimation a procedural texture with options for: * the object and particle system to use * the origin of the co-ordinate system, i.e. object center, world space, etc. This would allow you in a sense, to instance particle systems for render - you only need to bake one particle system, but you can render it anywhere. Anyway, plenty of work to do here, firstly on getting a nice density evaluation with falloff etc... --- source/blender/makesdna/DNA_material_types.h | 3 +- .../render/intern/include/render_types.h | 12 +++++++ .../render/intern/include/renderdatabase.h | 2 ++ .../render/intern/source/convertblender.c | 13 +++++-- .../render/intern/source/renderdatabase.c | 15 ++++++++ .../blender/render/intern/source/volumetric.c | 35 ++++++++++++++++--- source/blender/src/buttons_shading.c | 9 +++++ 7 files changed, 82 insertions(+), 7 deletions(-) diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index d20ea600fea..814e9b9ab66 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -70,7 +70,7 @@ typedef struct Material { float vol_stepsize, vol_shade_stepsize; float vol_absorption, vol_scattering; float vol_absorption_col[3]; - float vpad2; + float vol_part_searchradius; short vol_raydepth; short vol_shadeflag; @@ -351,6 +351,7 @@ typedef struct Material { #define MA_VOL_SHADED 1 #define MA_VOL_ATTENUATED 2 #define MA_VOL_SHADOWED 4 +#define MA_VOL_PARTICLES 8 #endif diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index 1768b052b54..2db70c460f9 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -198,6 +198,8 @@ struct Render ListBase *sss_points; struct Material *sss_mat; + struct KDTree *particles_tree; + ListBase customdata_names; struct Object *excludeob; @@ -347,6 +349,16 @@ typedef struct HaloRen /* ------------------------------------------------------------------------- */ +typedef struct ParticleRen +{ + struct ParticleRen *next, *prev; + float co[3]; // location + // float col[3]; // colour + // float vec[3]; // direction +} ParticleRen; + +/* ------------------------------------------------------------------------- */ + typedef struct StrandVert { float co[3]; float strandco; diff --git a/source/blender/render/intern/include/renderdatabase.h b/source/blender/render/intern/include/renderdatabase.h index dc28eae1cc2..6fcd8576ed9 100644 --- a/source/blender/render/intern/include/renderdatabase.h +++ b/source/blender/render/intern/include/renderdatabase.h @@ -98,6 +98,8 @@ struct HaloRen *RE_inithalo(struct Render *re, struct ObjectRen *obr, struct Mat struct HaloRen *RE_inithalo_particle(struct Render *re, struct ObjectRen *obr, struct DerivedMesh *dm, struct Material *ma, float *vec, float *vec1, float *orco, float *uvco, float hasize, float vectsize, int seed); struct StrandBuffer *RE_addStrandBuffer(struct ObjectRen *obr, int totvert); +struct ParticleRen *RE_cache_particle(Render *re, float *co, int index, float *vec); + struct ObjectRen *RE_addRenderObject(struct Render *re, struct Object *ob, struct Object *par, int index, int psysindex, int lay); struct ObjectInstanceRen *RE_addRenderInstance(struct Render *re, struct ObjectRen *obr, struct Object *ob, struct Object *par, int index, int psysindex, float mat[][4], int lay); void RE_makeRenderInstances(struct Render *re); diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 17cd71ecb79..5eac30bf3be 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -41,6 +41,7 @@ #include "BLI_rand.h" #include "BLI_memarena.h" #include "BLI_ghash.h" +#include "BLI_kdtree.h" #include "DNA_armature_types.h" #include "DNA_camera_types.h" @@ -1475,8 +1476,9 @@ static void render_new_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mat static_particle_strand(re, obr, ma, orco, surfnor, uvco, totuv, mcol, totcol, loc, loc1, time, first, line, adapt, adapt_angle, adapt_pix, override_uv); } else{ - har= RE_inithalo_particle(re, obr, dm, ma, loc, NULL, orco, uvco, size, 0.0, seed); - if(har) har->lay= obr->ob->lay; + //har= RE_inithalo_particle(re, obr, dm, ma, loc, NULL, orco, uvco, size, 0.0, seed); + //if(har) har->lay= obr->ob->lay; + RE_cache_particle(re, loc, 0, loc1); } } static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem *psys, int timeoffset) @@ -1703,6 +1705,8 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem if(path_nbr==0) psys->lattice=psys_get_lattice(ob,psys); + re->particles_tree = BLI_kdtree_new(totpart+totchild); + /* 3. start creating renderable things */ for(a=0,pa=pars; asurface= cache_strand_surface(re, obr, psmd->dm, mat, timeoffset); /* 4. clean up */ + if (re->particles_tree) + BLI_kdtree_balance(re->particles_tree); + if(ma) do_mat_ipo(ma); if(orco1) @@ -4410,6 +4417,8 @@ void RE_Database_Free(Render *re) BLI_freelistN(&re->lampren); BLI_freelistN(&re->lights); + + BLI_kdtree_free(re->particles_tree); free_renderdata_tables(re); diff --git a/source/blender/render/intern/source/renderdatabase.c b/source/blender/render/intern/source/renderdatabase.c index d44b49cc706..7fc8dc05ec3 100644 --- a/source/blender/render/intern/source/renderdatabase.c +++ b/source/blender/render/intern/source/renderdatabase.c @@ -1041,6 +1041,21 @@ HaloRen *RE_inithalo(Render *re, ObjectRen *obr, Material *ma, float *vec, f return har; } +ParticleRen *RE_cache_particle(Render *re, float *co, int index, float *vec) +{ + /* + ParticleRen *pr; + + pr= (LampRen *)MEM_callocN(sizeof(ParticleRen),"particleren"); + VECCOPY(pr->co, co); + BLI_addtail(&re->vol_particles, pr); + */ + + BLI_kdtree_insert(re->particles_tree, index, co, vec); + + +} + HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Material *ma, float *vec, float *vec1, float *orco, float *uvco, float hasize, float vectsize, int seed) { diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 4baeabcfa7a..83250ebfd36 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -34,6 +34,7 @@ #include "BLI_blenlib.h" #include "BLI_arithb.h" #include "BLI_rand.h" +#include "BLI_kdtree.h" #include "RE_shader_ext.h" #include "RE_raytrace.h" @@ -127,14 +128,41 @@ static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, } } +/* need to figure out a good default here */ +#define MAX_PARTICLES_NEAREST 10 +float get_particle_density(float *co, float radius) +{ + KDTreeNearest nearest[MAX_PARTICLES_NEAREST]; + float density=0.0f; + int n, neighbours=0; + + /* no particles in preview for now - + * can check for existence of particle kdtree better later on */ + if(R.r.scemode & R_PREVIEWBUTS) return; + + neighbours = BLI_kdtree_find_n_nearest(R.particles_tree, MAX_PARTICLES_NEAREST, co, NULL, nearest); + + for(n=1; nmat->alpha; float col[3] = {0.0, 0.0, 0.0}; - - /* do any density gain stuff here */ - if (shi->mat->flag & MA_IS_TEXTURED) + + if (shi->mat->vol_shadeflag & MA_VOL_PARTICLES) { + density += get_particle_density(co, shi->mat->vol_part_searchradius); + } + else if (shi->mat->flag & MA_IS_TEXTURED) { do_volume_tex(shi, co, MAP_ALPHA, col, &density); + } return density; } @@ -339,7 +367,6 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float float tau[3], step_emit[3], step_scatter[3] = {0.0, 0.0, 0.0}; int s; float step_sta[3], step_end[3], step_mid[3]; - float col_behind[3]; float alpha; float density = vol_get_density(shi, co); diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index a288845c39d..50e5e69ea16 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -4281,6 +4281,15 @@ static void material_panel_material_volume(Material *ma) uiDefButF(block, NUM, B_MATPRV, "Scattering: ", X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->vol_scattering), 0.0, 10.0, 10, 0, "Multiplier for scattering"); + + yco -= YSPACE; + + uiBlockBeginAlign(block); + uiDefButBitS(block, TOG, MA_VOL_PARTICLES, B_MATPRV, "Particles", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shadeflag), 0, 0, 0, 0, "Render global particle cache"); + uiDefButF(block, NUM, B_MATPRV, "Search Radius: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_part_searchradius), 0.001, 100.0, 10, 2, "Radius to look for nearby particles within"); + uiBlockEndAlign(block); } static void material_panel_nodes(Material *ma) From 5adff90b0868f88050e601092b35628fa3ae132b Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Fri, 26 Sep 2008 07:12:36 +0000 Subject: [PATCH 011/577] * Some more tweaks to particle density rendering. I'm not 100% sure if this is 'correct' but so far in testing it's been working pretty well. This also exposes a new 'Nearest' value, to determine how many nearby particles are taken into account when determining density. A greater number is more accurate, but slower. --- source/blender/blenkernel/intern/material.c | 4 +++- source/blender/blenloader/intern/readfile.c | 2 ++ source/blender/makesdna/DNA_material_types.h | 3 +++ .../render/intern/source/renderdatabase.c | 2 +- .../blender/render/intern/source/volumetric.c | 18 ++++++++++++------ source/blender/src/buttons_shading.c | 4 +++- 6 files changed, 24 insertions(+), 9 deletions(-) diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 8f4e65576d8..04a68d1b1e1 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -173,7 +173,9 @@ void init_material(Material *ma) ma->vol_scattering = 1.0f; ma->vol_absorption_col[0] = ma->vol_absorption_col[1] = ma->vol_absorption_col[2] = 0.0f; ma->vol_raydepth = 15; - + ma->vol_part_maxnearest = 5; + ma->vol_part_searchradius = 0.2f; + ma->mode= MA_TRACEBLE|MA_SHADBUF|MA_SHADOW|MA_RADIO|MA_RAYBIAS|MA_TANGENT_STR; ma->preview = NULL; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 658c14f5876..49ad3096957 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7872,6 +7872,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) 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_raydepth == 0) ma->vol_raydepth = 15; + if (ma->vol_part_maxnearest == 0) ma->vol_part_maxnearest = 5; + if (ma->vol_part_searchradius < 0.001f) ma->vol_part_searchradius = 0.20; } } } diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index 814e9b9ab66..dc23e7fcc6a 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -72,7 +72,10 @@ typedef struct Material { float vol_absorption_col[3]; float vol_part_searchradius; short vol_raydepth; + short vol_part_maxnearest; short vol_shadeflag; + short vol_pad[3]; + float fresnel_mir, fresnel_mir_i; float fresnel_tra, fresnel_tra_i; diff --git a/source/blender/render/intern/source/renderdatabase.c b/source/blender/render/intern/source/renderdatabase.c index 7fc8dc05ec3..14288167c4a 100644 --- a/source/blender/render/intern/source/renderdatabase.c +++ b/source/blender/render/intern/source/renderdatabase.c @@ -1051,7 +1051,7 @@ ParticleRen *RE_cache_particle(Render *re, float *co, int index, float *vec) BLI_addtail(&re->vol_particles, pr); */ - BLI_kdtree_insert(re->particles_tree, index, co, vec); + BLI_kdtree_insert(re->particles_tree, index, co, NULL); } diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 83250ebfd36..543c89f6b96 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -129,8 +129,8 @@ static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, } /* need to figure out a good default here */ -#define MAX_PARTICLES_NEAREST 10 -float get_particle_density(float *co, float radius) +#define MAX_PARTICLES_NEAREST 50 +float get_particle_density(float *co, float radius, int max_nearest) { KDTreeNearest nearest[MAX_PARTICLES_NEAREST]; float density=0.0f; @@ -140,14 +140,20 @@ float get_particle_density(float *co, float radius) * can check for existence of particle kdtree better later on */ if(R.r.scemode & R_PREVIEWBUTS) return; - neighbours = BLI_kdtree_find_n_nearest(R.particles_tree, MAX_PARTICLES_NEAREST, co, NULL, nearest); + neighbours = BLI_kdtree_find_n_nearest(R.particles_tree, max_nearest, co, NULL, nearest); for(n=1; nmat->vol_shadeflag & MA_VOL_PARTICLES) { - density += get_particle_density(co, shi->mat->vol_part_searchradius); + density += get_particle_density(co, shi->mat->vol_part_searchradius, shi->mat->vol_part_maxnearest); } else if (shi->mat->flag & MA_IS_TEXTURED) { do_volume_tex(shi, co, MAP_ALPHA, col, &density); diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 50e5e69ea16..4e6560a035a 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -4287,8 +4287,10 @@ static void material_panel_material_volume(Material *ma) uiBlockBeginAlign(block); uiDefButBitS(block, TOG, MA_VOL_PARTICLES, B_MATPRV, "Particles", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shadeflag), 0, 0, 0, 0, "Render global particle cache"); - uiDefButF(block, NUM, B_MATPRV, "Search Radius: ", + uiDefButF(block, NUM, B_MATPRV, "Radius: ", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_part_searchradius), 0.001, 100.0, 10, 2, "Radius to look for nearby particles within"); + uiDefButS(block, NUM, B_MATPRV, "Nearby: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_part_maxnearest), 2.0, 30.0, 10, 2, "The number of nearby particles to check for density"); uiBlockEndAlign(block); } From 8056705ae9b2467a013f2372c0579687d3723229 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sun, 28 Sep 2008 08:00:22 +0000 Subject: [PATCH 012/577] * Volumetrics Removed all the old particle rendering code and options I had in there before, in order to make way for... A new procedural texture: 'Point Density' Point Density is a 3d texture that find the density of a group of 'points' in space and returns that in the texture as an intensity value. Right now, its at an early stage and it's only enabled for particles, but it would be cool to extend it later for things like object vertices, or point cache files from disk - i.e. to import point cloud data into Blender for rendering volumetrically. Currently there are just options for an Object and its particle system number, this is the particle system that will get cached before rendering, and then used for the texture's density estimation. It works totally consistent with as any other procedural texture, so previously where I've mapped a clouds texture to volume density to make some of those test renders, now I just map a point density texture to volume density. Here's a version of the same particle smoke test file from before, updated to use the point density texture instead: http://mke3.net/blender/devel/rendering/volumetrics/smoke_test02.blend There are a few cool things about implementing this as a texture: - The one texture (and cache) can be instanced across many different materials: http://mke3.net/blender/devel/rendering/volumetrics/pointdensity_instanced.png This means you can calculate and bake one particle system, but render it multiple times across the scene, with different material settings, at no extra memory cost. Right now, the particles are cached in world space, so you have to map it globally, and if you want it offset, you have to do it in the material (as in the file above). I plan to add an option to bake in local space, so you can just map the texture to local and it just works. - It also works for solid surfaces too, it just gets the density at that particular point on the surface, eg: http://mke3.net/blender/devel/rendering/volumetrics/pointdensity_solid.mov - You can map it to whatever you want, not only density but the various emissions and colours as well. I'd like to investigate using the other outputs in the texture too (like the RGB or normal outputs), perhaps with options to colour by particle age, generating normals for making particle 'dents' in a surface, whatever! --- source/blender/blenkernel/BKE_texture.h | 6 + source/blender/blenkernel/intern/material.c | 2 - source/blender/blenkernel/intern/texture.c | 47 +++++ source/blender/blenloader/intern/readfile.c | 7 +- source/blender/blenloader/intern/writefile.c | 1 + source/blender/makesdna/DNA_material_types.h | 8 +- source/blender/makesdna/DNA_texture_types.h | 30 +++ .../render/intern/include/pointdensity.h | 43 ++++ .../render/intern/include/render_types.h | 11 - .../render/intern/include/renderdatabase.h | 2 - .../render/intern/source/convertblender.c | 18 +- .../render/intern/source/pointdensity.c | 195 ++++++++++++++++++ .../render/intern/source/renderdatabase.c | 15 -- source/blender/render/intern/source/texture.c | 4 + .../blender/render/intern/source/volumetric.c | 35 +--- source/blender/src/buttons_shading.c | 61 ++++-- 16 files changed, 391 insertions(+), 94 deletions(-) create mode 100644 source/blender/render/intern/include/pointdensity.h create mode 100644 source/blender/render/intern/source/pointdensity.c diff --git a/source/blender/blenkernel/BKE_texture.h b/source/blender/blenkernel/BKE_texture.h index cfcae3c44bc..e16ac2d369b 100644 --- a/source/blender/blenkernel/BKE_texture.h +++ b/source/blender/blenkernel/BKE_texture.h @@ -39,6 +39,7 @@ struct ColorBand; struct HaloRen; struct TexMapping; struct EnvMap; +struct PointDensity; /* in ColorBand struct */ #define MAXCOLORBAND 32 @@ -74,6 +75,11 @@ 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); + int BKE_texture_dependsOnTime(const struct Tex *texture); #endif diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 04a68d1b1e1..64125d5834e 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -173,8 +173,6 @@ void init_material(Material *ma) ma->vol_scattering = 1.0f; ma->vol_absorption_col[0] = ma->vol_absorption_col[1] = ma->vol_absorption_col[2] = 0.0f; ma->vol_raydepth = 15; - ma->vol_part_maxnearest = 5; - ma->vol_part_searchradius = 0.2f; ma->mode= MA_TRACEBLE|MA_SHADBUF|MA_SHADOW|MA_RADIO|MA_RAYBIAS|MA_TANGENT_STR; diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index bb726887d32..62bab45dd50 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -409,6 +409,7 @@ 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); BKE_previewimg_free(&tex->preview); BKE_icon_delete((struct ID*)tex); tex->id.icon_id = 0; @@ -470,6 +471,11 @@ void default_tex(Tex *tex) tex->env->depth=0; } + if (tex->pd) { + tex->pd->radius = 0.3f; + tex->pd->nearest = 5; + } + pit = tex->plugin; if (pit) { varstr= pit->varstr; @@ -566,6 +572,7 @@ 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(tex->preview) texn->preview = BKE_previewimg_copy(tex->preview); @@ -858,6 +865,46 @@ void BKE_free_envmap(EnvMap *env) } +/* ------------------------------------------------------------------------- */ + +PointDensity *BKE_add_pointdensity(void) +{ + PointDensity *pd; + + pd= MEM_callocN(sizeof(PointDensity), "pointdensity"); + pd->radius = 0.3f; + pd->nearest = 5; + pd->type = TEX_PD_PSYS; + pd->point_tree = NULL; + + return pd; +} + +PointDensity *BKE_copy_pointdensity(PointDensity *pd) +{ + PointDensity *pdn; + int a; + + pdn= MEM_dupallocN(pd); + pdn->point_tree = NULL; + + return pd; +} + +void BKE_free_pointdensitydata(PointDensity *pd) +{ + if (pd->point_tree) { + BLI_kdtree_free(pd->point_tree); + pd->point_tree = NULL; + } +} + +void BKE_free_pointdensity(PointDensity *pd) +{ + BKE_free_pointdensitydata(pd); + MEM_freeN(pd); +} + /* ------------------------------------------------------------------------- */ int BKE_texture_dependsOnTime(const struct Tex *texture) { diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index e80d2c7ce67..8aa0c8c5d5e 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2475,6 +2475,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); tex->id.flag -= LIB_NEEDLINK; } @@ -2501,6 +2502,10 @@ static void direct_link_texture(FileData *fd, Tex *tex) memset(tex->env->cube, 0, 6*sizeof(void *)); tex->env->ok= 0; } + tex->pd= newdataadr(fd, tex->pd); + if(tex->pd) { + tex->pd->point_tree = NULL; + } tex->preview = direct_link_preview_image(fd, tex->preview); tex->iuser.ok= 1; @@ -7885,8 +7890,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) 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_raydepth == 0) ma->vol_raydepth = 15; - if (ma->vol_part_maxnearest == 0) ma->vol_part_maxnearest = 5; - if (ma->vol_part_searchradius < 0.001f) ma->vol_part_searchradius = 0.20; } } } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index e53c725867a..c4ae6ef858b 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1334,6 +1334,7 @@ static void write_textures(WriteData *wd, ListBase *idbase) if(tex->plugin) writestruct(wd, DATA, "PluginTex", 1, tex->plugin); if(tex->coba) writestruct(wd, DATA, "ColorBand", 1, tex->coba); if(tex->env) writestruct(wd, DATA, "EnvMap", 1, tex->env); + if(tex->pd) writestruct(wd, DATA, "PointDensity", 1, tex->pd); write_previews(wd, tex->preview); } diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index dc23e7fcc6a..5d5ae042950 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -70,13 +70,10 @@ typedef struct Material { float vol_stepsize, vol_shade_stepsize; float vol_absorption, vol_scattering; float vol_absorption_col[3]; - float vol_part_searchradius; short vol_raydepth; - short vol_part_maxnearest; short vol_shadeflag; - short vol_pad[3]; - - + int volpad; + float fresnel_mir, fresnel_mir_i; float fresnel_tra, fresnel_tra_i; float filter; /* filter added, for raytrace transparency and transmissivity */ @@ -354,7 +351,6 @@ typedef struct Material { #define MA_VOL_SHADED 1 #define MA_VOL_ATTENUATED 2 #define MA_VOL_SHADOWED 4 -#define MA_VOL_PARTICLES 8 #endif diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index 111dc08ee02..ed172c24474 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -127,6 +127,22 @@ typedef struct EnvMap { short recalc, lastsize; } EnvMap; +typedef struct PointDensity { + short flag; + + short nearest; + float radius; + + short type; + short pdpad[3]; + + struct Object *object; /* for 'Particle system' type - source object */ + short psysindex; /* and object's psys number */ + short pdpad2[3]; + + void *point_tree; /* the kd-tree containing points */ +} PointDensity; + typedef struct Tex { ID id; @@ -172,6 +188,7 @@ typedef struct Tex { struct ColorBand *coba; struct EnvMap *env; struct PreviewImage * preview; + struct PointDensity *pd; } Tex; @@ -208,6 +225,8 @@ typedef struct TexMapping { #define TEX_MUSGRAVE 11 #define TEX_VORONOI 12 #define TEX_DISTNOISE 13 +/* predicting ocean texture for 14 */ +#define TEX_POINTDENSITY 15 /* musgrave stype */ #define TEX_MFRACTAL 0 @@ -385,5 +404,16 @@ typedef struct TexMapping { #define ENV_NORMAL 1 #define ENV_OSA 2 +/* **************** PointDensity ********************* */ + +/* type */ +#define TEX_PD_PSYS 0 +#define TEX_PD_OBJECT 1 +#define TEX_PD_FILE 2 + +/* psys_space */ +#define TEX_PD_PSYS_WORLDSPACE 0 +#define TEX_PD_PSYS_OBJECTSPACE 1 + #endif diff --git a/source/blender/render/intern/include/pointdensity.h b/source/blender/render/intern/include/pointdensity.h new file mode 100644 index 00000000000..9c21cc0c253 --- /dev/null +++ b/source/blender/render/intern/include/pointdensity.h @@ -0,0 +1,43 @@ +/* + * + * ***** 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); +int pointdensitytex(struct Tex *tex, float *texvec, struct TexResult *texres); + +#endif /* POINTDENSITY_H */ + diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index 2db70c460f9..b0003cadb55 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -198,8 +198,6 @@ struct Render ListBase *sss_points; struct Material *sss_mat; - struct KDTree *particles_tree; - ListBase customdata_names; struct Object *excludeob; @@ -347,15 +345,6 @@ typedef struct HaloRen struct Material *mat; } HaloRen; -/* ------------------------------------------------------------------------- */ - -typedef struct ParticleRen -{ - struct ParticleRen *next, *prev; - float co[3]; // location - // float col[3]; // colour - // float vec[3]; // direction -} ParticleRen; /* ------------------------------------------------------------------------- */ diff --git a/source/blender/render/intern/include/renderdatabase.h b/source/blender/render/intern/include/renderdatabase.h index 6fcd8576ed9..dc28eae1cc2 100644 --- a/source/blender/render/intern/include/renderdatabase.h +++ b/source/blender/render/intern/include/renderdatabase.h @@ -98,8 +98,6 @@ struct HaloRen *RE_inithalo(struct Render *re, struct ObjectRen *obr, struct Mat struct HaloRen *RE_inithalo_particle(struct Render *re, struct ObjectRen *obr, struct DerivedMesh *dm, struct Material *ma, float *vec, float *vec1, float *orco, float *uvco, float hasize, float vectsize, int seed); struct StrandBuffer *RE_addStrandBuffer(struct ObjectRen *obr, int totvert); -struct ParticleRen *RE_cache_particle(Render *re, float *co, int index, float *vec); - struct ObjectRen *RE_addRenderObject(struct Render *re, struct Object *ob, struct Object *par, int index, int psysindex, int lay); struct ObjectInstanceRen *RE_addRenderInstance(struct Render *re, struct ObjectRen *obr, struct Object *ob, struct Object *par, int index, int psysindex, float mat[][4], int lay); void RE_makeRenderInstances(struct Render *re); diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 5eac30bf3be..40e9a32d003 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -103,6 +103,7 @@ #include "envmap.h" #include "multires.h" #include "occlusion.h" +#include "pointdensity.h" #include "render_types.h" #include "rendercore.h" #include "renderdatabase.h" @@ -1476,9 +1477,8 @@ static void render_new_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Mat static_particle_strand(re, obr, ma, orco, surfnor, uvco, totuv, mcol, totcol, loc, loc1, time, first, line, adapt, adapt_angle, adapt_pix, override_uv); } else{ - //har= RE_inithalo_particle(re, obr, dm, ma, loc, NULL, orco, uvco, size, 0.0, seed); - //if(har) har->lay= obr->ob->lay; - RE_cache_particle(re, loc, 0, loc1); + har= RE_inithalo_particle(re, obr, dm, ma, loc, NULL, orco, uvco, size, 0.0, seed); + if(har) har->lay= obr->ob->lay; } } static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem *psys, int timeoffset) @@ -1705,8 +1705,6 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem if(path_nbr==0) psys->lattice=psys_get_lattice(ob,psys); - re->particles_tree = BLI_kdtree_new(totpart+totchild); - /* 3. start creating renderable things */ for(a=0,pa=pars; asurface= cache_strand_surface(re, obr, psmd->dm, mat, timeoffset); /* 4. clean up */ - if (re->particles_tree) - BLI_kdtree_balance(re->particles_tree); if(ma) do_mat_ipo(ma); @@ -4417,8 +4413,6 @@ void RE_Database_Free(Render *re) BLI_freelistN(&re->lampren); BLI_freelistN(&re->lights); - - BLI_kdtree_free(re->particles_tree); free_renderdata_tables(re); @@ -4441,6 +4435,8 @@ void RE_Database_Free(Render *re) end_radio_render(); end_render_materials(); + free_pointdensities(re); + if(re->wrld.aosphere) { MEM_freeN(re->wrld.aosphere); re->wrld.aosphere= NULL; @@ -4890,6 +4886,10 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view) /* ENVIRONMENT MAPS */ if(!re->test_break()) make_envmaps(re); + + /* point density texture */ + if(!re->test_break()) + make_pointdensities(re); } if(!re->test_break()) diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c new file mode 100644 index 00000000000..00dbbd34f96 --- /dev/null +++ b/source/blender/render/intern/source/pointdensity.c @@ -0,0 +1,195 @@ +/* + * ***** 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. + * + * Contributors: Matt Ebb + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include + +#include "BLI_kdtree.h" + +#include "BKE_DerivedMesh.h" +#include "BKE_global.h" +#include "BKE_main.h" + +#include "DNA_texture_types.h" +#include "DNA_particle_types.h" + +#include "render_types.h" +#include "texture.h" + + +static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, ParticleSystem *psys) +{ + DerivedMesh* dm; + ParticleKey state; + float cfra=bsystem_time(ob,(float)G.scene->r.cfra,0.0); + int i, childexists; + + /* init crap */ + if (!psys || !ob || !pd) return; + + /* Just to create a valid rendering context */ + psys_render_set(ob, psys, re->viewmat, re->winmat, re->winx, re->winy, 0); + + dm = mesh_create_derived_render(ob,CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL); + dm->release(dm); + + if ( !psys_check_enabled(ob, psys) ){ + psys_render_restore(ob, psys); + return; + } + + /* finally do something */ + pd->point_tree = BLI_kdtree_new(psys->totpart+psys->totchild); + + if (psys->totchild > 0 && !(psys->part->draw & PART_DRAW_PARENT)) + childexists = 1; + + for (i = 0; i < psys->totpart + psys->totchild; i++) { + + state.time = cfra; + if(psys_get_particle_state(ob, psys, i, &state, 0)) { + BLI_kdtree_insert(pd->point_tree, 0, state.co, NULL); + } + } + + BLI_kdtree_balance(pd->point_tree); + psys_render_restore(ob, psys); +} + + +static void cache_pointdensity(Render *re, Tex *tex) +{ + PointDensity *pd = tex->pd; + + if (pd->point_tree) { + BLI_kdtree_free(pd->point_tree); + pd->point_tree = NULL; + } + + if (pd->type == TEX_PD_PSYS) { + ParticleSystem *psys; + Object *ob = pd->object; + int i; + + for(psys=ob->particlesystem.first, i=0; i< pd->psysindex-1; i++) + psys= psys->next; + + if (!ob || !psys) return; + + pointdensity_cache_psys(re, pd, ob, psys); + } +} + +static void free_pointdensity(Render *re, Tex *tex) +{ + PointDensity *pd = tex->pd; + + if (pd->point_tree) { + BLI_kdtree_free(pd->point_tree); + pd->point_tree = NULL; + } +} + + + +void make_pointdensities(Render *re) +{ + Tex *tex; + + if(re->scene->r.scemode & R_PREVIEWBUTS) + return; + + re->i.infostr= "Caching Point Densities"; + re->stats_draw(&re->i); + + for (tex= G.main->tex.first; tex; tex= tex->id.next) { + if(tex->id.us && tex->type==TEX_POINTDENSITY) { + cache_pointdensity(re, tex); + } + } +} + +void free_pointdensities(Render *re) +{ + Tex *tex; + + if(re->scene->r.scemode & R_PREVIEWBUTS) + return; + + for (tex= G.main->tex.first; tex; tex= tex->id.next) { + if(tex->id.us && tex->type==TEX_POINTDENSITY) { + free_pointdensity(re, tex); + } + } +} + +#define MAX_POINTS_NEAREST 25 +int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) +{ + int rv = TEX_INT; + + PointDensity *pd = tex->pd; + KDTreeNearest nearest[MAX_POINTS_NEAREST]; + float density=0.0f; + int n, neighbours=0; + + if ((!pd) || (!pd->point_tree)) { + texres->tin = 0.0f; + return 0; + } + + neighbours = BLI_kdtree_find_n_nearest(pd->point_tree, pd->nearest, texvec, NULL, nearest); + + for(n=1; nradius) { + float dist = 1.0 - (nearest[n].dist / pd->radius); + + density += 3.0f*dist*dist - 2.0f*dist*dist*dist; + } + } + + density /= neighbours; + density *= 1.0 / pd->radius; + + texres->tin = density; + + /* + texres->tr = 1.0f; + texres->tg = 1.0f; + texres->tb = 0.0f; + + BRICONTRGB; + + texres->ta = 1.0; + + if (texres->nor!=NULL) { + texres->nor[0] = texres->nor[1] = texres->nor[2] = 0.0f; + } + */ + + BRICONT; + + return rv; +} \ No newline at end of file diff --git a/source/blender/render/intern/source/renderdatabase.c b/source/blender/render/intern/source/renderdatabase.c index 14288167c4a..d44b49cc706 100644 --- a/source/blender/render/intern/source/renderdatabase.c +++ b/source/blender/render/intern/source/renderdatabase.c @@ -1041,21 +1041,6 @@ HaloRen *RE_inithalo(Render *re, ObjectRen *obr, Material *ma, float *vec, f return har; } -ParticleRen *RE_cache_particle(Render *re, float *co, int index, float *vec) -{ - /* - ParticleRen *pr; - - pr= (LampRen *)MEM_callocN(sizeof(ParticleRen),"particleren"); - VECCOPY(pr->co, co); - BLI_addtail(&re->vol_particles, pr); - */ - - BLI_kdtree_insert(re->particles_tree, index, co, NULL); - - -} - HaloRen *RE_inithalo_particle(Render *re, ObjectRen *obr, DerivedMesh *dm, Material *ma, float *vec, float *vec1, float *orco, float *uvco, float hasize, float vectsize, int seed) { diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index 2c143986900..3df53f7041a 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -62,6 +62,7 @@ #include "BKE_ipo.h" #include "envmap.h" +#include "pointdensity.h" #include "renderpipeline.h" #include "render_types.h" #include "rendercore.h" @@ -1216,6 +1217,9 @@ static int multitex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, retval= mg_distNoiseTex(tex, tmpvec, texres); break; + case TEX_POINTDENSITY: + retval= pointdensitytex(tex, texvec, texres); + break; } if (tex->flag & TEX_COLORBAND) { diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 543c89f6b96..dcff34429b6 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -128,45 +128,12 @@ static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, } } -/* need to figure out a good default here */ -#define MAX_PARTICLES_NEAREST 50 -float get_particle_density(float *co, float radius, int max_nearest) -{ - KDTreeNearest nearest[MAX_PARTICLES_NEAREST]; - float density=0.0f; - int n, neighbours=0; - - /* no particles in preview for now - - * can check for existence of particle kdtree better later on */ - if(R.r.scemode & R_PREVIEWBUTS) return; - - neighbours = BLI_kdtree_find_n_nearest(R.particles_tree, max_nearest, co, NULL, nearest); - - for(n=1; nmat->alpha; float col[3] = {0.0, 0.0, 0.0}; - if (shi->mat->vol_shadeflag & MA_VOL_PARTICLES) { - density += get_particle_density(co, shi->mat->vol_part_searchradius, shi->mat->vol_part_maxnearest); - } - else if (shi->mat->flag & MA_IS_TEXTURED) { + if (shi->mat->flag & MA_IS_TEXTURED) { do_volume_tex(shi, co, MAP_ALPHA, col, &density); } diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 0cfe469b7da..002c62c1a17 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -731,6 +731,49 @@ static void texture_panel_voronoi(Tex *tex) uiDefButF(block, NUMSLI, B_TEXPRV, "W4: ", 10, 10, 150, 19, &tex->vn_w4, -2.0, 2.0, 10, 0, "Sets feature weight 4"); } +static void texture_panel_pointdensity(Tex *tex) +{ + uiBlock *block; + PointDensity *pd; + short yco=PANEL_YMAX; + + block= uiNewBlock(&curarea->uiblocks, "texture_panel_pointdensity", UI_EMBOSS, UI_HELV, curarea->win); + if(uiNewPanel(curarea, block, "Point Density", "Texture", PANELX, PANELY, PANELW, PANELH)==0) return; + uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE); + + if(tex->pd==NULL) { + tex->pd= BKE_add_pointdensity(); + tex->pd->object= OBACT; + } + if(tex->pd) { + pd= tex->pd; + + uiBlockBeginAlign(block); + uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_REDR, "Ob:", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->object), "Object that has the particle system"); + + if (pd->object->particlesystem.first) { + uiDefButS(block, NUM, B_REDR, "PSys:", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->psysindex), 1, 10, 10, 3, "Particle system number in the object"); + } + uiBlockEndAlign(block); + + yco -= YSPACE; + + uiBlockBeginAlign(block); + uiDefButF(block, NUM, B_REDR, "Radius: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->radius), 0.001, 100.0, 10, 2, "Radius to look for nearby particles within"); + uiDefButS(block, NUM, B_REDR, "Nearby: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->nearest), 2.0, 30.0, 10, 2, "The number of nearby particles to check for density"); + uiBlockEndAlign(block); + + uiDefBut(block, LABEL, B_NOP, " ", + X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + } + + +} + static char *layer_menu(RenderResult *rr, short *curlay) { @@ -1688,7 +1731,7 @@ static void texture_panel_texture(MTex *actmtex, Material *ma, World *wrld, Lamp /* newnoise: all texture types as menu, not enough room for more buttons. * Can widen panel, but looks ugly when other panels overlap it */ - sprintf(textypes, "Texture Type %%t|None %%x%d|Image %%x%d|EnvMap %%x%d|Clouds %%x%d|Marble %%x%d|Stucci %%x%d|Wood %%x%d|Magic %%x%d|Blend %%x%d|Noise %%x%d|Plugin %%x%d|Musgrave %%x%d|Voronoi %%x%d|DistortedNoise %%x%d", 0, TEX_IMAGE, TEX_ENVMAP, TEX_CLOUDS, TEX_MARBLE, TEX_STUCCI, TEX_WOOD, TEX_MAGIC, TEX_BLEND, TEX_NOISE, TEX_PLUGIN, TEX_MUSGRAVE, TEX_VORONOI, TEX_DISTNOISE); + sprintf(textypes, "Texture Type %%t|None %%x%d|Image %%x%d|EnvMap %%x%d|Clouds %%x%d|Marble %%x%d|Stucci %%x%d|Wood %%x%d|Magic %%x%d|Blend %%x%d|Noise %%x%d|Plugin %%x%d|Musgrave %%x%d|Voronoi %%x%d|DistortedNoise %%x%d|Point Density %%x%d", 0, TEX_IMAGE, TEX_ENVMAP, TEX_CLOUDS, TEX_MARBLE, TEX_STUCCI, TEX_WOOD, TEX_MAGIC, TEX_BLEND, TEX_NOISE, TEX_PLUGIN, TEX_MUSGRAVE, TEX_VORONOI, TEX_DISTNOISE, TEX_POINTDENSITY); uiDefBut(block, LABEL, 0, "Texture Type", 160, 150, 140, 20, 0, 0.0, 0.0, 0, 0, ""); uiDefButS(block, MENU, B_TEXTYPE, textypes, 160, 125, 140, 25, &tex->type, 0,0,0,0, "Select texture type"); @@ -4272,7 +4315,7 @@ static void material_panel_material_volume(Material *ma) uiDefButF(block, NUM, B_MATPRV, "Absorption: ", X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->vol_absorption), 0.0, 10.0, 10, 0, "Multiplier for absorption"); uiDefButF(block, COL, B_MATPRV, "", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->vol_absorption_col), 0, 0, 0, B_MATCOL, ""); + X2CLM2, yco-=BUTH, BUTW2, BUTH, ma->vol_absorption_col, 0, 0, 0, B_MATCOL, ""); uiBlockEndAlign(block); yco -= YSPACE; @@ -4288,17 +4331,6 @@ static void material_panel_material_volume(Material *ma) uiDefButF(block, NUM, B_MATPRV, "Scattering: ", X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->vol_scattering), 0.0, 10.0, 10, 0, "Multiplier for scattering"); - - yco -= YSPACE; - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, MA_VOL_PARTICLES, B_MATPRV, "Particles", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shadeflag), 0, 0, 0, 0, "Render global particle cache"); - uiDefButF(block, NUM, B_MATPRV, "Radius: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_part_searchradius), 0.001, 100.0, 10, 2, "Radius to look for nearby particles within"); - uiDefButS(block, NUM, B_MATPRV, "Nearby: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_part_maxnearest), 2.0, 30.0, 10, 2, "The number of nearby particles to check for density"); - uiBlockEndAlign(block); } static void material_panel_nodes(Material *ma) @@ -4683,6 +4715,9 @@ void texture_panels() case TEX_VORONOI: texture_panel_voronoi(tex); break; + case TEX_POINTDENSITY: + texture_panel_pointdensity(tex); + break; } } } From 345dc8eb9464efdf6cccac8dddc2cd24e1fe3dbb Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sun, 28 Sep 2008 23:40:36 +0000 Subject: [PATCH 013/577] Fix: point density texture now works with the 'auto name' button --- source/blender/src/butspace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/src/butspace.c b/source/blender/src/butspace.c index 5b5c7f2d5ba..f134e9a9650 100644 --- a/source/blender/src/butspace.c +++ b/source/blender/src/butspace.c @@ -92,7 +92,7 @@ MTex mtexcopybuf; char texstr[20][12]= {"None" , "Clouds" , "Wood", "Marble", "Magic" , "Blend", "Stucci", "Noise" , "Image", "Plugin", "EnvMap" , "Musgrave", - "Voronoi", "DistNoise", "", "", "", "", "", ""}; + "Voronoi", "DistNoise", "", "PointDensity", "", "", "", ""}; /* ---------------------------------------------------------------------- */ void test_idbutton_cb(void *namev, void *arg2) From bab94c46e07563c65e7a1b0392d70814ddf0de28 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 29 Sep 2008 04:19:24 +0000 Subject: [PATCH 014/577] Point Density texture The Point Density texture now has some additional options for how the point locations are cached. Previously it was all relative to worldspace, but there are now some other options that make things a lot more convenient for mapping the texture to Local (or Orco). Thanks to theeth for helping with the space conversions! The new Object space options allow this sort of thing to be possible - a particle system, instanced on a transformed renderable object: http://mke3.net/blender/devel/rendering/volumetrics/pd_objectspace.mov It's also a lot easier to use multiple instances, just duplicate the renderable objects and move them around. The new particle cache options are: * Emit Object space This caches the particles relative to the emitter object's coordinate space (i.e. relative to the emitter's object center). This makes it possible to map the Texture to Local or Orco easily, so you can easily move, rotate or scale the rendering object that has the Point Density texture. It's relative to the emitter's location, rotation and scale, so if the object you're rendering the texture on is aligned differently to the emitter, the results will be rotated etc. * Emit Object Location This offsets the particles to the emitter object's location in 3D space. It's similar to Emit Object Space, however the emitter object's rotation and scale are ignored. This is probably the easiest to use, since you don't need to worry about the rotation and scale of the emitter object (just the rendered object), so it's the default. * Global Space This is the same as previously, the particles are cached in global space, so to use this effectively you'll need to map the texture to Global, and have the rendered object in the right global location. --- source/blender/blenkernel/intern/texture.c | 6 +-- source/blender/makesdna/DNA_texture_types.h | 13 +++-- .../render/intern/source/pointdensity.c | 32 +++++++++++-- source/blender/src/buttons_shading.c | 48 ++++++++++++------- 4 files changed, 71 insertions(+), 28 deletions(-) diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 62bab45dd50..45fd11faa32 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -43,6 +43,7 @@ #include "BLI_blenlib.h" #include "BLI_arithb.h" #include "BLI_rand.h" +#include "BLI_kdtree.h" #include "DNA_texture_types.h" #include "DNA_key_types.h" @@ -874,7 +875,7 @@ PointDensity *BKE_add_pointdensity(void) pd= MEM_callocN(sizeof(PointDensity), "pointdensity"); pd->radius = 0.3f; pd->nearest = 5; - pd->type = TEX_PD_PSYS; + pd->source = TEX_PD_PSYS; pd->point_tree = NULL; return pd; @@ -883,8 +884,7 @@ PointDensity *BKE_add_pointdensity(void) PointDensity *BKE_copy_pointdensity(PointDensity *pd) { PointDensity *pdn; - int a; - + pdn= MEM_dupallocN(pd); pdn->point_tree = NULL; diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index ed172c24474..aef8bd95ee4 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -133,12 +133,14 @@ typedef struct PointDensity { short nearest; float radius; - short type; + short source; short pdpad[3]; struct Object *object; /* for 'Particle system' type - source object */ short psysindex; /* and object's psys number */ - short pdpad2[3]; + short psys_cache_space; /* cache particles in worldspace, object space, ... ? */ + + short pdpad2[2]; void *point_tree; /* the kd-tree containing points */ } PointDensity; @@ -406,14 +408,15 @@ typedef struct TexMapping { /* **************** PointDensity ********************* */ -/* type */ +/* source */ #define TEX_PD_PSYS 0 #define TEX_PD_OBJECT 1 #define TEX_PD_FILE 2 -/* psys_space */ -#define TEX_PD_PSYS_WORLDSPACE 0 +/* psys_cache_space */ +#define TEX_PD_PSYS_OBJECTLOC 0 #define TEX_PD_PSYS_OBJECTSPACE 1 +#define TEX_PD_PSYS_WORLDSPACE 2 #endif diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index 00dbbd34f96..e589e579565 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -26,11 +26,14 @@ #include #include +#include "BLI_arithb.h" #include "BLI_kdtree.h" #include "BKE_DerivedMesh.h" #include "BKE_global.h" #include "BKE_main.h" +#include "BKE_object.h" +#include "BKE_particle.h" #include "DNA_texture_types.h" #include "DNA_particle_types.h" @@ -45,10 +48,15 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa ParticleKey state; float cfra=bsystem_time(ob,(float)G.scene->r.cfra,0.0); int i, childexists; - + float partco[3]; + float obview[4][4]; + /* init crap */ if (!psys || !ob || !pd) return; + //Mat4CpyMat4(obview, ob->obmat); + Mat4MulMat4(obview, re->viewinv, ob->obmat); + /* Just to create a valid rendering context */ psys_render_set(ob, psys, re->viewmat, re->winmat, re->winx, re->winy, 0); @@ -60,6 +68,9 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa return; } + /* in case ob->imat isn't up-to-date */ + Mat4Invert(ob->imat, ob->obmat); + /* finally do something */ pd->point_tree = BLI_kdtree_new(psys->totpart+psys->totchild); @@ -70,7 +81,20 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa state.time = cfra; if(psys_get_particle_state(ob, psys, i, &state, 0)) { - BLI_kdtree_insert(pd->point_tree, 0, state.co, NULL); + + VECCOPY(partco, state.co); + + if (pd->psys_cache_space == TEX_PD_PSYS_OBJECTSPACE) + Mat4MulVecfl(ob->imat, partco); + else if (pd->psys_cache_space == TEX_PD_PSYS_OBJECTLOC) { + float obloc[3]; + VECCOPY(obloc, ob->loc); + VecSubf(partco, partco, obloc); + } else { + /* TEX_PD_PSYS_WORLDSPACE */ + } + + BLI_kdtree_insert(pd->point_tree, 0, partco, NULL); } } @@ -88,7 +112,7 @@ static void cache_pointdensity(Render *re, Tex *tex) pd->point_tree = NULL; } - if (pd->type == TEX_PD_PSYS) { + if (pd->source == TEX_PD_PSYS) { ParticleSystem *psys; Object *ob = pd->object; int i; @@ -192,4 +216,4 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) BRICONT; return rv; -} \ No newline at end of file +} diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 002c62c1a17..5397ab84f1c 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -748,18 +748,9 @@ static void texture_panel_pointdensity(Tex *tex) if(tex->pd) { pd= tex->pd; - uiBlockBeginAlign(block); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_REDR, "Ob:", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->object), "Object that has the particle system"); - - if (pd->object->particlesystem.first) { - uiDefButS(block, NUM, B_REDR, "PSys:", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->psysindex), 1, 10, 10, 3, "Particle system number in the object"); - } - uiBlockEndAlign(block); - - yco -= YSPACE; - + uiDefBut(block, LABEL, B_NOP, "Density estimation:", + X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + uiBlockBeginAlign(block); uiDefButF(block, NUM, B_REDR, "Radius: ", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->radius), 0.001, 100.0, 10, 2, "Radius to look for nearby particles within"); @@ -767,11 +758,36 @@ static void texture_panel_pointdensity(Tex *tex) X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->nearest), 2.0, 30.0, 10, 2, "The number of nearby particles to check for density"); uiBlockEndAlign(block); - uiDefBut(block, LABEL, B_NOP, " ", - X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + yco = PANEL_YMAX; + + uiDefBut(block, LABEL, B_NOP, "Point data source:", + X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + + uiDefButS(block, MENU, B_TEXREDR_PRV, "Particle System %x0", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &pd->source, 0.0, 0.0, 0, 0, "Source"); + + yco -= YSPACE; + + if (pd->source == TEX_PD_PSYS) { + uiBlockBeginAlign(block); + uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_REDR, "Ob:", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(pd->object), "Object that has the particle system"); + + if (pd->object->particlesystem.first) { + uiDefButS(block, NUM, B_REDR, "PSys:", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(pd->psysindex), 1, 10, 10, 3, "Particle system number in the object"); + } + uiBlockEndAlign(block); + + yco -= YSPACE; + + uiDefBut(block, LABEL, B_NOP, "Cache particles in:", + X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + uiDefButS(block, MENU, B_TEXREDR_PRV, "Emit Object Location %x0|Emit Object Space %x1|Global Space %x2", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &pd->psys_cache_space, 0.0, 0.0, 0, 0, "Co-ordinate system to cache particles in"); + } } - - + } From 31d6a6be68066cb0e084e0aa66e6eaf08e438851 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 29 Sep 2008 07:56:41 +0000 Subject: [PATCH 015/577] * New Point Density texture option: 'Object Vertices' This works very similarly to particles, it just uses the object's renderable vertices as the points instead. http://mke3.net/blender/devel/rendering/volumetrics/pd_objectvertices.png --- source/blender/makesdna/DNA_texture_types.h | 16 ++--- .../render/intern/source/pointdensity.c | 59 +++++++++++++++++-- source/blender/src/buttons_shading.c | 20 ++++++- 3 files changed, 79 insertions(+), 16 deletions(-) diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index aef8bd95ee4..52055f24f82 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -136,11 +136,13 @@ typedef struct PointDensity { short source; short pdpad[3]; - struct Object *object; /* for 'Particle system' type - source object */ - short psysindex; /* and object's psys number */ - short psys_cache_space; /* cache particles in worldspace, object space, ... ? */ + 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 pdpad2[2]; + short ob_cache_space; /* cache points in worldspace, object space, ... ? */ + + short pdpad2; void *point_tree; /* the kd-tree containing points */ } PointDensity; @@ -414,9 +416,9 @@ typedef struct TexMapping { #define TEX_PD_FILE 2 /* psys_cache_space */ -#define TEX_PD_PSYS_OBJECTLOC 0 -#define TEX_PD_PSYS_OBJECTSPACE 1 -#define TEX_PD_PSYS_WORLDSPACE 2 +#define TEX_PD_OBJECTLOC 0 +#define TEX_PD_OBJECTSPACE 1 +#define TEX_PD_WORLDSPACE 2 #endif diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index e589e579565..17bc6bb58cf 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -39,6 +39,7 @@ #include "DNA_particle_types.h" #include "render_types.h" +#include "renderdatabase.h" #include "texture.h" @@ -54,7 +55,6 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa /* init crap */ if (!psys || !ob || !pd) return; - //Mat4CpyMat4(obview, ob->obmat); Mat4MulMat4(obview, re->viewinv, ob->obmat); /* Just to create a valid rendering context */ @@ -71,7 +71,6 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa /* in case ob->imat isn't up-to-date */ Mat4Invert(ob->imat, ob->obmat); - /* finally do something */ pd->point_tree = BLI_kdtree_new(psys->totpart+psys->totchild); if (psys->totchild > 0 && !(psys->part->draw & PART_DRAW_PARENT)) @@ -84,17 +83,17 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa VECCOPY(partco, state.co); - if (pd->psys_cache_space == TEX_PD_PSYS_OBJECTSPACE) + if (pd->psys_cache_space == TEX_PD_OBJECTSPACE) Mat4MulVecfl(ob->imat, partco); - else if (pd->psys_cache_space == TEX_PD_PSYS_OBJECTLOC) { + else if (pd->psys_cache_space == TEX_PD_OBJECTLOC) { float obloc[3]; VECCOPY(obloc, ob->loc); VecSubf(partco, partco, obloc); } else { - /* TEX_PD_PSYS_WORLDSPACE */ + /* TEX_PD_WORLDSPACE */ } - BLI_kdtree_insert(pd->point_tree, 0, partco, NULL); + BLI_kdtree_insert(pd->point_tree, i, partco, NULL); } } @@ -103,6 +102,38 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa } +static void pointdensity_cache_object(Render *re, PointDensity *pd, ObjectRen *obr) +{ + int i; + + if (!obr || !pd) return; + if(!obr->vertnodes) return; + + /* in case ob->imat isn't up-to-date */ + Mat4Invert(obr->ob->imat, obr->ob->obmat); + + pd->point_tree = BLI_kdtree_new(obr->totvert); + + for(i=0; itotvert; i++) { + float ver_co[3]; + VertRen *ver= RE_findOrAddVert(obr, i); + + VECCOPY(ver_co, ver->co); + + if (pd->ob_cache_space == TEX_PD_OBJECTSPACE) { + Mat4MulVecfl(re->viewinv, ver_co); + Mat4MulVecfl(obr->ob->imat, ver_co); + } else { + /* TEX_PD_WORLDSPACE */ + Mat4MulVecfl(re->viewinv, ver_co); + } + + BLI_kdtree_insert(pd->point_tree, i, ver_co, NULL); + } + + BLI_kdtree_balance(pd->point_tree); + +} static void cache_pointdensity(Render *re, Tex *tex) { PointDensity *pd = tex->pd; @@ -124,6 +155,22 @@ static void cache_pointdensity(Render *re, Tex *tex) pointdensity_cache_psys(re, pd, ob, psys); } + else if (pd->source == TEX_PD_OBJECT) { + Object *ob = pd->object; + ObjectRen *obr; + int found=0; + + /* find the obren that corresponds to the object */ + for (obr=re->objecttable.first; obr; obr=obr->next) { + if (obr->ob == ob) { + found=1; + break; + } + } + if (!found) return; + + pointdensity_cache_object(re, pd, obr); + } } static void free_pointdensity(Render *re, Tex *tex) diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 5397ab84f1c..873b93fb4c4 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -763,7 +763,7 @@ static void texture_panel_pointdensity(Tex *tex) uiDefBut(block, LABEL, B_NOP, "Point data source:", X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); - uiDefButS(block, MENU, B_TEXREDR_PRV, "Particle System %x0", + uiDefButS(block, MENU, B_TEXREDR_PRV, "Particle System %x0|Object Vertices %x1", X2CLM2, yco-=BUTH, BUTW2, BUTH, &pd->source, 0.0, 0.0, 0, 0, "Source"); yco -= YSPACE; @@ -786,6 +786,17 @@ static void texture_panel_pointdensity(Tex *tex) uiDefButS(block, MENU, B_TEXREDR_PRV, "Emit Object Location %x0|Emit Object Space %x1|Global Space %x2", X2CLM2, yco-=BUTH, BUTW2, BUTH, &pd->psys_cache_space, 0.0, 0.0, 0, 0, "Co-ordinate system to cache particles in"); } + else if (pd->source == TEX_PD_OBJECT) { + uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_REDR, "Ob:", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(pd->object), "Object to render as points"); + + yco -= YSPACE; + + uiDefBut(block, LABEL, B_NOP, "Cache vertices in:", + X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + uiDefButS(block, MENU, B_TEXREDR_PRV, "Object Space %x1|Global Space %x2", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &pd->ob_cache_space, 0.0, 0.0, 0, 0, "Co-ordinate system to cache vertices in"); + } } } @@ -4310,8 +4321,6 @@ static void material_panel_material_volume(Material *ma) uiBlockBeginAlign(block); uiDefButF(block, NUM, B_MATPRV, "Step Size: ", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_stepsize), 0.001, 100.0, 10, 2, "Ray marching step size"); - uiDefButF(block, NUMSLI, B_MATPRV, "Density: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->alpha), 0.0, 1.0, 0, 0, "Base opacity value"); uiDefButS(block, NUM, B_MATPRV, "Layer Depth: ", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_raydepth), 0.0, 512.0, 10, 2, "Number of layered volume ray intersections allowed per pixel"); uiBlockEndAlign(block); @@ -4327,6 +4336,11 @@ static void material_panel_material_volume(Material *ma) yco = PANEL_YMAX; + uiDefButF(block, NUMSLI, B_MATPRV, "Density: ", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->alpha), 0.0, 1.0, 0, 0, "Base opacity value"); + + yco -= YSPACE; + uiBlockBeginAlign(block); uiDefButF(block, NUM, B_MATPRV, "Absorption: ", X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->vol_absorption), 0.0, 10.0, 10, 0, "Multiplier for absorption"); From a667fc61d44ed35a8bfd13b062a3469a8aa88138 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 30 Sep 2008 10:41:47 +0000 Subject: [PATCH 016/577] * Removed the volume 'layer depth' control' (was used to limit ray intersections like as for ray transparency). It remains to be seen if it's even that useful, and was preventing refracting materials behind volumes from working easily. --- source/blender/blenkernel/intern/material.c | 1 - source/blender/blenloader/intern/readfile.c | 3 +-- source/blender/makesdna/DNA_material_types.h | 3 +-- source/blender/render/intern/source/volumetric.c | 4 +--- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 64125d5834e..f54c0ae7ab1 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -172,7 +172,6 @@ void init_material(Material *ma) 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_raydepth = 15; ma->mode= MA_TRACEBLE|MA_SHADBUF|MA_SHADOW|MA_RADIO|MA_RAYBIAS|MA_TANGENT_STR; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 8aa0c8c5d5e..555a7455c60 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7888,8 +7888,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) 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_raydepth == 0) ma->vol_raydepth = 15; + ma->vol_absorption_col[0] = ma->vol_absorption_col[1] = ma->vol_absorption_col[2] = 0.0f; } } } diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index 5d5ae042950..8215f73d8ce 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -70,9 +70,8 @@ typedef struct Material { float vol_stepsize, vol_shade_stepsize; float vol_absorption, vol_scattering; float vol_absorption_col[3]; - short vol_raydepth; short vol_shadeflag; - int volpad; + short volpad[3]; float fresnel_mir, fresnel_mir_i; float fresnel_tra, fresnel_tra_i; diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index dcff34429b6..4d138ea8545 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -436,7 +436,6 @@ static void shade_intersection(ShadeInput *shi, float *col, Isect *is) shi_new.mask= shi->mask; shi_new.osatex= shi->osatex; - shi_new.depth= shi->depth + 1; shi_new.thread= shi->thread; shi_new.xs= shi->xs; shi_new.ys= shi->ys; @@ -450,8 +449,7 @@ static void shade_intersection(ShadeInput *shi, float *col, Isect *is) memset(&shr_new, 0, sizeof(ShadeResult)); - if (shi->depth < shi->mat->vol_raydepth) - shade_ray(is, &shi_new, &shr_new); + shade_ray(is, &shi_new, &shr_new); col[0] = shr_new.combined[0]; col[1] = shr_new.combined[1]; From 3c99a0f73539e5a3c8ceeb02e6c5a21ed4985f71 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 30 Sep 2008 23:58:48 +0000 Subject: [PATCH 017/577] Fix for build error, mustn't have committed this properly last night --- source/blender/src/buttons_shading.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 873b93fb4c4..85154682819 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -755,7 +755,7 @@ static void texture_panel_pointdensity(Tex *tex) uiDefButF(block, NUM, B_REDR, "Radius: ", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->radius), 0.001, 100.0, 10, 2, "Radius to look for nearby particles within"); uiDefButS(block, NUM, B_REDR, "Nearby: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->nearest), 2.0, 30.0, 10, 2, "The number of nearby particles to check for density"); + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->nearest), 2.0, 25.0, 10, 2, "The number of nearby particles to check for density (higher is more accurate, but slower)"); uiBlockEndAlign(block); yco = PANEL_YMAX; @@ -4321,8 +4321,6 @@ static void material_panel_material_volume(Material *ma) uiBlockBeginAlign(block); uiDefButF(block, NUM, B_MATPRV, "Step Size: ", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_stepsize), 0.001, 100.0, 10, 2, "Ray marching step size"); - uiDefButS(block, NUM, B_MATPRV, "Layer Depth: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_raydepth), 0.0, 512.0, 10, 2, "Number of layered volume ray intersections allowed per pixel"); uiBlockEndAlign(block); yco -= YSPACE; From 8622cbca359d77eb980250b42d0635c0dddfa48b Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 1 Oct 2008 03:35:53 +0000 Subject: [PATCH 018/577] * Point Density texture Replaced the previous KD-tree (for caching points) with a BVH-tree (thanks to Andre 'jaguarandi' Pinto for help here!). The bvh is quite a bit faster and doesn't suffer some of the artifacts that were apparent with the kd-tree. I've also added a choice of falloff types: Standard, Smooth, and Sharp. Standard gives a harder edge, easier to see individual particles, and when used with a larger radius, Smooth and Sharp falloffs make a much cloudier appearance possible. See the image below (note the settings and render times too) http://mke3.net/blender/devel/rendering/volumetrics/pointdensity_bvh.jpg --- source/blender/blenkernel/intern/texture.c | 16 ++- source/blender/blenlib/BLI_kdopbvh.h | 7 ++ source/blender/blenlib/intern/BLI_kdopbvh.c | 109 ++++++++++++++++-- source/blender/makesdna/DNA_texture_types.h | 13 ++- .../render/intern/source/pointdensity.c | 72 ++++++++---- source/blender/src/buttons_shading.c | 11 +- 6 files changed, 183 insertions(+), 45 deletions(-) diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 45fd11faa32..ec34fcf4103 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -43,7 +43,7 @@ #include "BLI_blenlib.h" #include "BLI_arithb.h" #include "BLI_rand.h" -#include "BLI_kdtree.h" +#include "BLI_kdopbvh.h" #include "DNA_texture_types.h" #include "DNA_key_types.h" @@ -474,7 +474,7 @@ void default_tex(Tex *tex) if (tex->pd) { tex->pd->radius = 0.3f; - tex->pd->nearest = 5; + tex->pd->falloff_type = TEX_PD_FALLOFF_STD; } pit = tex->plugin; @@ -874,9 +874,10 @@ PointDensity *BKE_add_pointdensity(void) pd= MEM_callocN(sizeof(PointDensity), "pointdensity"); pd->radius = 0.3f; - pd->nearest = 5; + pd->falloff_type = TEX_PD_FALLOFF_STD; pd->source = TEX_PD_PSYS; pd->point_tree = NULL; + //pd->point_data = NULL; return pd; } @@ -887,6 +888,7 @@ PointDensity *BKE_copy_pointdensity(PointDensity *pd) pdn= MEM_dupallocN(pd); pdn->point_tree = NULL; + //pdn->point_data = NULL; return pd; } @@ -894,9 +896,15 @@ PointDensity *BKE_copy_pointdensity(PointDensity *pd) void BKE_free_pointdensitydata(PointDensity *pd) { if (pd->point_tree) { - BLI_kdtree_free(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; + } + */ } void BKE_free_pointdensity(PointDensity *pd) diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h index e3591a84e98..8912ac5bd13 100644 --- a/source/blender/blenlib/BLI_kdopbvh.h +++ b/source/blender/blenlib/BLI_kdopbvh.h @@ -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, float radius); + 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 diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index 30472beb3e6..f82b6b7f162 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -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, data->radius ); + } + 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, data.radius ); + } + else + dfs_range_query( &data, root ); + } + } + + return data.hits; +} diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index 52055f24f82..d23672f9284 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -130,7 +130,7 @@ typedef struct EnvMap { typedef struct PointDensity { short flag; - short nearest; + short falloff_type; float radius; short source; @@ -144,7 +144,10 @@ typedef struct PointDensity { short pdpad2; - void *point_tree; /* the kd-tree containing points */ + void *point_tree; /* the acceleration tree containing points */ + //void *point_data; /* dynamically allocated extra for extra information, like particle age */ + //int pdpad3; + } PointDensity; typedef struct Tex { @@ -415,10 +418,16 @@ typedef struct TexMapping { #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_SHARP 2 + /* psys_cache_space */ #define TEX_PD_OBJECTLOC 0 #define TEX_PD_OBJECTSPACE 1 #define TEX_PD_WORLDSPACE 2 + #endif diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index 17bc6bb58cf..4422b9fbbdd 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -27,7 +27,7 @@ #include #include "BLI_arithb.h" -#include "BLI_kdtree.h" +#include "BLI_kdopbvh.h" #include "BKE_DerivedMesh.h" #include "BKE_global.h" @@ -71,7 +71,7 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa /* in case ob->imat isn't up-to-date */ Mat4Invert(ob->imat, ob->obmat); - pd->point_tree = BLI_kdtree_new(psys->totpart+psys->totchild); + pd->point_tree = BLI_bvhtree_new(psys->totpart+psys->totchild, 0.0, 2, 6); if (psys->totchild > 0 && !(psys->part->draw & PART_DRAW_PARENT)) childexists = 1; @@ -93,11 +93,12 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa /* TEX_PD_WORLDSPACE */ } - BLI_kdtree_insert(pd->point_tree, i, partco, NULL); + BLI_bvhtree_insert(pd->point_tree, i, partco, 1); } } - BLI_kdtree_balance(pd->point_tree); + BLI_bvhtree_balance(pd->point_tree); + psys_render_restore(ob, psys); } @@ -112,7 +113,7 @@ static void pointdensity_cache_object(Render *re, PointDensity *pd, ObjectRen *o /* in case ob->imat isn't up-to-date */ Mat4Invert(obr->ob->imat, obr->ob->obmat); - pd->point_tree = BLI_kdtree_new(obr->totvert); + pd->point_tree = BLI_bvhtree_new(obr->totvert, 0.0, 2, 6); for(i=0; itotvert; i++) { float ver_co[3]; @@ -128,10 +129,10 @@ static void pointdensity_cache_object(Render *re, PointDensity *pd, ObjectRen *o Mat4MulVecfl(re->viewinv, ver_co); } - BLI_kdtree_insert(pd->point_tree, i, ver_co, NULL); + BLI_bvhtree_insert(pd->point_tree, i, ver_co, 1); } - BLI_kdtree_balance(pd->point_tree); + BLI_bvhtree_balance(pd->point_tree); } static void cache_pointdensity(Render *re, Tex *tex) @@ -139,7 +140,7 @@ static void cache_pointdensity(Render *re, Tex *tex) PointDensity *pd = tex->pd; if (pd->point_tree) { - BLI_kdtree_free(pd->point_tree); + BLI_bvhtree_free(pd->point_tree); pd->point_tree = NULL; } @@ -178,9 +179,16 @@ static void free_pointdensity(Render *re, Tex *tex) PointDensity *pd = tex->pd; if (pd->point_tree) { - BLI_kdtree_free(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; + } + */ } @@ -216,33 +224,49 @@ void free_pointdensities(Render *re) } } + +void accum_density_std(void *userdata, int index, float squared_dist, float squared_radius) +{ + float *density = userdata; + const float dist = squared_radius - squared_dist; + + *density+= dist; +} + +void accum_density_smooth(void *userdata, int index, float squared_dist, float squared_radius) +{ + float *density = userdata; + const float dist = squared_radius - squared_dist; + + *density+= 3.0f*dist*dist - 2.0f*dist*dist*dist; +} + +void accum_density_sharp(void *userdata, int index, float squared_dist, float squared_radius) +{ + float *density = userdata; + const float dist = squared_radius - squared_dist; + + *density+= dist*dist; +} + #define MAX_POINTS_NEAREST 25 int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) { int rv = TEX_INT; - PointDensity *pd = tex->pd; - KDTreeNearest nearest[MAX_POINTS_NEAREST]; float density=0.0f; - int n, neighbours=0; if ((!pd) || (!pd->point_tree)) { texres->tin = 0.0f; return 0; } - neighbours = BLI_kdtree_find_n_nearest(pd->point_tree, pd->nearest, texvec, NULL, nearest); - - for(n=1; nradius) { - float dist = 1.0 - (nearest[n].dist / pd->radius); - - density += 3.0f*dist*dist - 2.0f*dist*dist*dist; - } - } - - density /= neighbours; - density *= 1.0 / pd->radius; + if (pd->falloff_type == TEX_PD_FALLOFF_STD) + BLI_bvhtree_range_query(pd->point_tree, texvec, pd->radius, accum_density_std, &density); + else if (pd->falloff_type == TEX_PD_FALLOFF_SMOOTH) + BLI_bvhtree_range_query(pd->point_tree, texvec, pd->radius, accum_density_smooth, &density); + else if (pd->falloff_type == TEX_PD_FALLOFF_SHARP) + BLI_bvhtree_range_query(pd->point_tree, texvec, pd->radius, accum_density_sharp, &density); texres->tin = density; diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 85154682819..050dae6026e 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -751,12 +751,15 @@ static void texture_panel_pointdensity(Tex *tex) uiDefBut(block, LABEL, B_NOP, "Density estimation:", X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); uiDefButF(block, NUM, B_REDR, "Radius: ", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->radius), 0.001, 100.0, 10, 2, "Radius to look for nearby particles within"); - uiDefButS(block, NUM, B_REDR, "Nearby: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->nearest), 2.0, 25.0, 10, 2, "The number of nearby particles to check for density (higher is more accurate, but slower)"); - uiBlockEndAlign(block); + + yco -= YSPACE; + + uiDefBut(block, LABEL, B_NOP, "Falloff:", + X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + uiDefButS(block, MENU, B_REDR, "Standard %x0|Smooth %x1|Sharp %x2", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &pd->falloff_type, 0.0, 0.0, 0, 0, "Falloff type"); yco = PANEL_YMAX; From 25236b56a6c8c5619a3a8d35841be7e413df1e5e Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 1 Oct 2008 07:13:28 +0000 Subject: [PATCH 019/577] * Fix for volumetric rendering. It previously wasn't multiplying the emission component by the density at the current point, which made the volume too bright in less dense areas. This made it look too rough, as opposed to smooth as it should be. This makes the particle rendering look *much* better, thanks a bunch to ZanQdo for complaining and kicking my butt to make me realise the error. Here's an example of how smooth it looks now: http://mke3.net/blender/devel/rendering/volumetrics/smoke_test03.mov http://mke3.net/blender/devel/rendering/volumetrics/smoke_test03.blend Settings in existing files will have to be tweaked a bit, since what they were set up for before, was incorrect. * Added two new interpolation types to Point Density: Constant and Root. These work similarly to in proportional edit for example, just gives a bit more choice over how hard-edged the particles should look. --- source/blender/makesdna/DNA_texture_types.h | 3 ++- .../render/intern/source/pointdensity.c | 23 +++++++++++++++++-- .../blender/render/intern/source/volumetric.c | 16 ++++++------- source/blender/src/buttons_shading.c | 4 ++-- 4 files changed, 32 insertions(+), 14 deletions(-) diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index d23672f9284..9c608302b22 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -132,7 +132,6 @@ typedef struct PointDensity { short falloff_type; float radius; - short source; short pdpad[3]; @@ -422,6 +421,8 @@ typedef struct TexMapping { #define TEX_PD_FALLOFF_STD 0 #define TEX_PD_FALLOFF_SMOOTH 1 #define TEX_PD_FALLOFF_SHARP 2 +#define TEX_PD_FALLOFF_CONSTANT 3 +#define TEX_PD_FALLOFF_ROOT 4 /* psys_cache_space */ #define TEX_PD_OBJECTLOC 0 diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index 4422b9fbbdd..c4124fba8bb 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -224,7 +224,6 @@ void free_pointdensities(Render *re) } } - void accum_density_std(void *userdata, int index, float squared_dist, float squared_radius) { float *density = userdata; @@ -249,6 +248,22 @@ void accum_density_sharp(void *userdata, int index, float squared_dist, float sq *density+= dist*dist; } +void accum_density_constant(void *userdata, int index, float squared_dist, float squared_radius) +{ + float *density = userdata; + + *density+= squared_radius; +} + +void accum_density_root(void *userdata, int index, float squared_dist, float squared_radius) +{ + float *density = userdata; + const float dist = squared_radius - squared_dist; + + *density+= sqrt(dist); +} + + #define MAX_POINTS_NEAREST 25 int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) { @@ -267,7 +282,11 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) BLI_bvhtree_range_query(pd->point_tree, texvec, pd->radius, accum_density_smooth, &density); else if (pd->falloff_type == TEX_PD_FALLOFF_SHARP) BLI_bvhtree_range_query(pd->point_tree, texvec, pd->radius, accum_density_sharp, &density); - + else if (pd->falloff_type == TEX_PD_FALLOFF_CONSTANT) + BLI_bvhtree_range_query(pd->point_tree, texvec, pd->radius, accum_density_constant, &density); + else if (pd->falloff_type == TEX_PD_FALLOFF_ROOT) + BLI_bvhtree_range_query(pd->point_tree, texvec, pd->radius, accum_density_root, &density); + texres->tin = density; /* diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 4d138ea8545..5d28540f17a 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -152,7 +152,7 @@ void vol_get_emission(ShadeInput *shi, float *em, float *co, float density) do_volume_tex(shi, co, MAP_EMIT+MAP_COL, col, &emission); - em[0] = em[1] = em[2] = emission; + em[0] = em[1] = em[2] = emission * density; VecMulVecf(em, em, col); } @@ -365,13 +365,10 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float /* get radiance from all points along the ray due to participating media */ for (s = 0; s < nsteps; s++) { if (s > 0) density = vol_get_density(shi, step_sta); - - /* there's only any point shading here + + /* there's only any use in shading here * if there's actually some density to shade! */ if (density > 0.01f) { - step_mid[0] = step_sta[0] + (stepvec[0] * 0.5); - step_mid[1] = step_sta[1] + (stepvec[1] * 0.5); - step_mid[2] = step_sta[2] + (stepvec[2] * 0.5); /* transmittance component (alpha) */ vol_get_attenuation(shi, tau, step_sta, step_end, density, stepsize); @@ -379,9 +376,10 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float tr[1] *= exp(-tau[1]); tr[2] *= exp(-tau[2]); - /* Terminate raymarching if transmittance is small */ - //if ((tr[0] + tr[1] + tr[2] * 0.333f) < 0.01f) continue; - + step_mid[0] = step_sta[0] + (stepvec[0] * 0.5); + step_mid[1] = step_sta[1] + (stepvec[1] * 0.5); + step_mid[2] = step_sta[2] + (stepvec[2] * 0.5); + /* incoming light via emission or scattering (additive) */ vol_get_emission(shi, step_emit, step_mid, density); vol_get_scattering(shi, step_scatter, step_mid, stepsize, density); diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 050dae6026e..7a154d084bc 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -758,7 +758,7 @@ static void texture_panel_pointdensity(Tex *tex) uiDefBut(block, LABEL, B_NOP, "Falloff:", X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); - uiDefButS(block, MENU, B_REDR, "Standard %x0|Smooth %x1|Sharp %x2", + uiDefButS(block, MENU, B_REDR, "Standard %x0|Smooth %x1|Sharp %x2|Constant %x3|Root %x4", X2CLM1, yco-=BUTH, BUTW2, BUTH, &pd->falloff_type, 0.0, 0.0, 0, 0, "Falloff type"); yco = PANEL_YMAX; @@ -4334,7 +4334,7 @@ static void material_panel_material_volume(Material *ma) uiDefButF(block, NUM, B_MATPRV, "Step Size: ", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shade_stepsize), 0.001, 100.0, 10, 2, "Step"); uiBlockEndAlign(block); - + yco = PANEL_YMAX; uiDefButF(block, NUMSLI, B_MATPRV, "Density: ", From 2745517ecda2a72603fa7c8ec5a44f2b857c5782 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 1 Oct 2008 07:30:56 +0000 Subject: [PATCH 020/577] Added 'Object Location' option to 'object vertices' mode in Point Density. This brings it consistent with the 'particle system' mode, and allows silly things like this a bit easier (especially after the last fix and BVH improvements!): http://mke3.net/blender/devel/rendering/volumetrics/pd_objectloc.mov --- source/blender/render/intern/source/pointdensity.c | 6 ++++-- source/blender/src/buttons_shading.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index c4124fba8bb..a3f174be68b 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -120,13 +120,15 @@ static void pointdensity_cache_object(Render *re, PointDensity *pd, ObjectRen *o VertRen *ver= RE_findOrAddVert(obr, i); VECCOPY(ver_co, ver->co); + Mat4MulVecfl(re->viewinv, ver_co); if (pd->ob_cache_space == TEX_PD_OBJECTSPACE) { - Mat4MulVecfl(re->viewinv, ver_co); Mat4MulVecfl(obr->ob->imat, ver_co); + } else if (pd->psys_cache_space == TEX_PD_OBJECTLOC) { + VecSubf(ver_co, ver_co, obr->ob->loc); } else { /* TEX_PD_WORLDSPACE */ - Mat4MulVecfl(re->viewinv, ver_co); + } BLI_bvhtree_insert(pd->point_tree, i, ver_co, 1); diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 7a154d084bc..c9df2f6d833 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -797,7 +797,7 @@ static void texture_panel_pointdensity(Tex *tex) uiDefBut(block, LABEL, B_NOP, "Cache vertices in:", X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); - uiDefButS(block, MENU, B_TEXREDR_PRV, "Object Space %x1|Global Space %x2", + uiDefButS(block, MENU, B_TEXREDR_PRV, "Object Location %x0|Object Space %x1|Global Space %x2", X2CLM2, yco-=BUTH, BUTW2, BUTH, &pd->ob_cache_space, 0.0, 0.0, 0, 0, "Co-ordinate system to cache vertices in"); } } From e114d194ae44cb72aa52954f4fdeb67805a2c7c6 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 2 Oct 2008 01:38:12 +0000 Subject: [PATCH 021/577] * Re-coded the point density range checking to be a bit cleaner, and not necessary to modify the BVH functions. --- source/blender/blenkernel/intern/texture.c | 6 +- source/blender/blenlib/BLI_kdopbvh.h | 2 +- source/blender/blenlib/intern/BLI_kdopbvh.c | 4 +- source/blender/makesdna/DNA_texture_types.h | 4 +- .../render/intern/source/pointdensity.c | 79 ++++++++----------- 5 files changed, 38 insertions(+), 57 deletions(-) diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index ec34fcf4103..7b558008a92 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -877,7 +877,7 @@ PointDensity *BKE_add_pointdensity(void) pd->falloff_type = TEX_PD_FALLOFF_STD; pd->source = TEX_PD_PSYS; pd->point_tree = NULL; - //pd->point_data = NULL; + pd->point_data = NULL; return pd; } @@ -888,7 +888,7 @@ PointDensity *BKE_copy_pointdensity(PointDensity *pd) pdn= MEM_dupallocN(pd); pdn->point_tree = NULL; - //pdn->point_data = NULL; + pdn->point_data = NULL; return pd; } @@ -899,12 +899,10 @@ void BKE_free_pointdensitydata(PointDensity *pd) BLI_bvhtree_free(pd->point_tree); pd->point_tree = NULL; } - /* if (pd->point_data) { MEM_freeN(pd->point_data); pd->point_data = NULL; } - */ } void BKE_free_pointdensity(PointDensity *pd) diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h index 8912ac5bd13..dabf12d48d3 100644 --- a/source/blender/blenlib/BLI_kdopbvh.h +++ b/source/blender/blenlib/BLI_kdopbvh.h @@ -72,7 +72,7 @@ typedef void (*BVHTree_NearestPointCallback) (void *userdata, int index, const f 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, float radius); +typedef void (*BVHTree_RangeQuery) (void *userdata, int index, float squared_dist); BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis); diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index f82b6b7f162..df37ff457f6 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -1570,7 +1570,7 @@ static void dfs_range_query(RangeQueryData *data, BVHNode *node) if(node->children[i]->totnode == 0) { data->hits++; - data->callback( data->userdata, node->children[i]->index, dist, data->radius ); + data->callback( data->userdata, node->children[i]->index, dist ); } else dfs_range_query( data, node->children[i] ); @@ -1602,7 +1602,7 @@ int BLI_bvhtree_range_query(BVHTree *tree, const float *co, float radius, BVHTre if(root->totnode == 0) { data.hits++; - data.callback( data.userdata, root->index, dist, data.radius ); + data.callback( data.userdata, root->index, dist ); } else dfs_range_query( &data, root ); diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index 9c608302b22..95bacbbd4c6 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -144,8 +144,8 @@ typedef struct PointDensity { short pdpad2; void *point_tree; /* the acceleration tree containing points */ - //void *point_data; /* dynamically allocated extra for extra information, like particle age */ - //int pdpad3; + void *point_data; /* dynamically allocated extra for extra information, like particle age */ + int pdpad3[2]; } PointDensity; diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index a3f174be68b..7998fa82836 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -23,9 +23,12 @@ * ***** END GPL LICENSE BLOCK ***** */ +#include #include #include +#include "MEM_guardedalloc.h" + #include "BLI_arithb.h" #include "BLI_kdopbvh.h" @@ -185,12 +188,10 @@ static void free_pointdensity(Render *re, Tex *tex) pd->point_tree = NULL; } - /* if (pd->point_data) { MEM_freeN(pd->point_data); pd->point_data = NULL; } - */ } @@ -226,51 +227,37 @@ void free_pointdensities(Render *re) } } -void accum_density_std(void *userdata, int index, float squared_dist, float squared_radius) +typedef struct PointDensityRangeData { - float *density = userdata; - const float dist = squared_radius - squared_dist; + float *density; + float squared_radius; + float *point_data; + short falloff_type; +} PointDensityRangeData; + +void accum_density(void *userdata, int index, float squared_dist) +{ + PointDensityRangeData *pdr = (PointDensityRangeData *)userdata; + const float dist = pdr->squared_radius - squared_dist; - *density+= dist; + if (pdr->falloff_type == TEX_PD_FALLOFF_STD) + *pdr->density += dist; + else if (pdr->falloff_type == TEX_PD_FALLOFF_SMOOTH) + *pdr->density+= 3.0f*dist*dist - 2.0f*dist*dist*dist; + else if (pdr->falloff_type == TEX_PD_FALLOFF_SHARP) + *pdr->density+= dist*dist; + else if (pdr->falloff_type == TEX_PD_FALLOFF_CONSTANT) + *pdr->density+= pdr->squared_radius; + else if (pdr->falloff_type == TEX_PD_FALLOFF_ROOT) + *pdr->density+= sqrt(dist); } -void accum_density_smooth(void *userdata, int index, float squared_dist, float squared_radius) -{ - float *density = userdata; - const float dist = squared_radius - squared_dist; - - *density+= 3.0f*dist*dist - 2.0f*dist*dist*dist; -} - -void accum_density_sharp(void *userdata, int index, float squared_dist, float squared_radius) -{ - float *density = userdata; - const float dist = squared_radius - squared_dist; - - *density+= dist*dist; -} - -void accum_density_constant(void *userdata, int index, float squared_dist, float squared_radius) -{ - float *density = userdata; - - *density+= squared_radius; -} - -void accum_density_root(void *userdata, int index, float squared_dist, float squared_radius) -{ - float *density = userdata; - const float dist = squared_radius - squared_dist; - - *density+= sqrt(dist); -} - - #define MAX_POINTS_NEAREST 25 int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) { int rv = TEX_INT; PointDensity *pd = tex->pd; + PointDensityRangeData pdr; float density=0.0f; if ((!pd) || (!pd->point_tree)) { @@ -278,16 +265,12 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) return 0; } - if (pd->falloff_type == TEX_PD_FALLOFF_STD) - BLI_bvhtree_range_query(pd->point_tree, texvec, pd->radius, accum_density_std, &density); - else if (pd->falloff_type == TEX_PD_FALLOFF_SMOOTH) - BLI_bvhtree_range_query(pd->point_tree, texvec, pd->radius, accum_density_smooth, &density); - else if (pd->falloff_type == TEX_PD_FALLOFF_SHARP) - BLI_bvhtree_range_query(pd->point_tree, texvec, pd->radius, accum_density_sharp, &density); - else if (pd->falloff_type == TEX_PD_FALLOFF_CONSTANT) - BLI_bvhtree_range_query(pd->point_tree, texvec, pd->radius, accum_density_constant, &density); - else if (pd->falloff_type == TEX_PD_FALLOFF_ROOT) - BLI_bvhtree_range_query(pd->point_tree, texvec, pd->radius, accum_density_root, &density); + pdr.squared_radius = pd->radius*pd->radius; + pdr.density = &density; + pdr.point_data = pd->point_data; + pdr.falloff_type = pd->falloff_type; + + BLI_bvhtree_range_query(pd->point_tree, texvec, pd->radius, accum_density, &pdr); texres->tin = density; From 67a9d4154d520a98e572e98f680995fca701f728 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sat, 4 Oct 2008 12:23:57 +0000 Subject: [PATCH 022/577] * New volumetrics feature: scattering types Otherwise known as a phase function, this determines in which directions the light is scattered in the volume. Until now it's been isotropic scattering, meaning that the light gets scattered equally in all directions. This adds some new types for anisotropic scattering, to scatter light more forwards or backwards towards the viewing direction, which can be more similar to how light is scattered by particles in nature. Here's a diagram of how light is scattered isotropically and anisotropically: http://mke3.net/blender/devel/rendering/volumetrics/phase_diagram.png The new additions are: - Rayleigh describes scattering by very small particles in the atmosphere. - Mie Hazy / Mie Murky more generalised, describes scattering from large particle sizes. - Henyey-Greenstein a very flexible formula, that can be used to simulate a wide range of scattering. It uses an additional 'Asymmetry' slider, ranging from -1.0 (backward scattering) to 1.0 (forward scattering) to control the direction of scattering. - Schlick an approximation of Henyey-Greenstein, working similarly but faster. And a description of how they look visually (just an omnidirectional lamp inside a volume box) http://mke3.net/blender/devel/rendering/volumetrics/phasefunctions.jpg * Sun/sky integration Volumes now correctly render in front of the new physical sky. Atmosphere still doesn't work correctly with volumes, due to something that i hope can be fixed in the atmosphere rendering, but the sky looks quite good. http://mke3.net/blender/devel/rendering/volumetrics/sky_clouds.png This also works very nicely with the anisotropic scattering, giving clouds their signature bright halos when the sun is behind them: http://mke3.net/blender/devel/rendering/volumetrics/phase_cloud.mov in comparison here's a render with isotropic scattering: http://mke3.net/blender/devel/rendering/volumetrics/phase_cloud_isotropic.png * Added back the max volume depth tracing limit, as a hard coded value - fixes crashes with weird geometry, like the overlapping faces around suzanne's eyes. As a general note, it's always best to use volume materials on airtight geometry, without intersecting or overlapping faces. --- source/blender/makesdna/DNA_material_types.h | 11 ++- .../render/extern/include/RE_shader_ext.h | 1 + .../blender/render/intern/source/volumetric.c | 73 ++++++++++++++----- source/blender/src/buttons_shading.c | 12 +++ 4 files changed, 76 insertions(+), 21 deletions(-) diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index 8215f73d8ce..4e006d17682 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -71,7 +71,8 @@ typedef struct Material { float vol_absorption, vol_scattering; float vol_absorption_col[3]; short vol_shadeflag; - short volpad[3]; + short vol_phasefunc_type; + float vol_phasefunc_g; float fresnel_mir, fresnel_mir_i; float fresnel_tra, fresnel_tra_i; @@ -351,5 +352,13 @@ typedef struct Material { #define MA_VOL_ATTENUATED 2 #define MA_VOL_SHADOWED 4 +/* 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 diff --git a/source/blender/render/extern/include/RE_shader_ext.h b/source/blender/render/extern/include/RE_shader_ext.h index 5d74895f0c8..16449df02b0 100644 --- a/source/blender/render/extern/include/RE_shader_ext.h +++ b/source/blender/render/extern/include/RE_shader_ext.h @@ -160,6 +160,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 */ diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 5d28540f17a..9a6790976af 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -164,6 +164,33 @@ void vol_get_scattering_fac(ShadeInput *shi, float *scatter_fac, float *co, floa *scatter_fac = shi->mat->vol_scattering; } +float vol_get_phasefunc(ShadeInput *shi, short phasefunc_type, float g, float *w, float *wp) +{ + const float costheta = Inpf(w, wp); + + if (phasefunc_type == MA_VOL_PH_ISOTROPIC) { + return 1.f / (4.f * M_PI); + } + else if (phasefunc_type == MA_VOL_PH_MIEHAZY) { + return (0.5f + 4.5f * powf(0.5 * (1.f + costheta), 8.f)) / (4.f*M_PI); + } + else if (phasefunc_type == MA_VOL_PH_MIEMURKY) { + return (0.5f + 16.5f * powf(0.5 * (1.f + costheta), 32.f)) / (4.f*M_PI); + } + else if (phasefunc_type == MA_VOL_PH_RAYLEIGH) { + return 3.f/(16.f*M_PI) * (1 + costheta * costheta); + } + else if (phasefunc_type == MA_VOL_PH_HG) { + return 1.f / (4.f * M_PI) * (1.f - g*g) / powf(1.f + g*g - 2.f * g * costheta, 1.5f); + } + else if (phasefunc_type == MA_VOL_PH_SCHLICK) { + const float k = 1.55f * g - .55f * g * g * g; + const float kcostheta = k * costheta; + return 1.f / (4.f * M_PI) * (1.f - k*k) / ((1.f - kcostheta) * (1.f - kcostheta)); + } else { + return 1.0f; + } +} void vol_get_absorption(ShadeInput *shi, float *absorb_col, float *co) { @@ -229,13 +256,14 @@ void vol_get_attenuation(ShadeInput *shi, float *tau, float *co, float *endco, f VecMulVecf(tau, tau, absorb_col); } -void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float *col, float stepsize, float density) +void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float *lacol, float stepsize, float density) { float visifac, lv[3], lampdist; - float lacol[3]; float tau[3], tr[3]={1.0,1.0,1.0}; float hitco[3], *atten_co; - + float p; + float scatter_fac; + if (lar->mode & LA_LAYER) if((lar->lay & shi->obi->lay)==0) return; if ((lar->lay & shi->lay)==0) return; if (lar->energy == 0.0) return; @@ -253,15 +281,17 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * } VecMulf(lacol, visifac*lar->energy); - - + + if (ELEM(lar->type, LA_SUN, LA_HEMI)) + VECCOPY(lv, lar->vec); + VecMulf(lv, -1.0f); + + p = vol_get_phasefunc(shi, shi->mat->vol_phasefunc_type, shi->mat->vol_phasefunc_g, shi->view, lv); + VecMulf(lacol, p); + if (shi->mat->vol_shadeflag & MA_VOL_ATTENUATED) { Isect is; - if (ELEM(lar->type, LA_SUN, LA_HEMI)) - VECCOPY(lv, lar->vec); - VecMulf(lv, -1.0f); - /* find minimum of volume bounds, or lamp coord */ if (vol_get_bounds(shi, co, lv, hitco, &is, VOL_BOUNDS_SS, 0)) { float dist = VecLenf(co, hitco); @@ -287,7 +317,11 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * } } - VecAddf(col, col, lacol); + vol_get_scattering_fac(shi, &scatter_fac, co, density); + VecMulf(lacol, scatter_fac); + + + } /* shadows -> trace a ray to find blocker geometry @@ -309,19 +343,12 @@ void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsi for(go=lights->first; go; go= go->next) { float lacol[3] = {0.f, 0.f, 0.f}; - float scatter_fac; lar= go->lampren; if (lar==NULL) continue; vol_shade_one_lamp(shi, co, lar, lacol, stepsize, density); - - vol_get_scattering_fac(shi, &scatter_fac, co, density); - VecMulf(lacol, scatter_fac); - - /* isotropic phase function */ - VecMulf(lacol, 1.0f / (4.f * M_PI)); - + VecMulf(lacol, density); VecAddf(col, col, lacol); @@ -435,6 +462,8 @@ static void shade_intersection(ShadeInput *shi, float *col, Isect *is) shi_new.mask= shi->mask; shi_new.osatex= shi->osatex; shi_new.thread= shi->thread; + shi_new.depth= shi->depth; + shi_new.volume_depth= shi->volume_depth + 1; shi_new.xs= shi->xs; shi_new.ys= shi->ys; shi_new.lay= shi->lay; @@ -446,8 +475,11 @@ static void shade_intersection(ShadeInput *shi, float *col, Isect *is) VECCOPY(shi_new.camera_co, is->start); memset(&shr_new, 0, sizeof(ShadeResult)); - - shade_ray(is, &shi_new, &shr_new); + + /* hardcoded limit of 100 for now - prevents problems in weird geometry */ + if (shi->volume_depth < 100) { + shade_ray(is, &shi_new, &shr_new); + } col[0] = shr_new.combined[0]; col[1] = shr_new.combined[1]; @@ -478,6 +510,7 @@ static void vol_trace_behind(ShadeInput *shi, VlakRen *vlr, float *co, float *co shade_intersection(shi, col, &isect); } else { shadeSkyView(col, co, shi->view, NULL); + shadeSunView(col, shi->view); } } diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 949487fc06f..ec5419c1704 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -4342,6 +4342,18 @@ static void material_panel_material_volume(Material *ma) uiDefButF(block, NUM, B_MATPRV, "Step Size: ", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shade_stepsize), 0.001, 100.0, 10, 2, "Step"); uiBlockEndAlign(block); + + yco -= YSPACE; + + uiBlockBeginAlign(block); + uiDefButS(block, MENU, B_TEXREDR_PRV, "Scattering Direction %t|Isotropic %x0|Mie Hazy %x1|Mie Murky %x2|Rayleigh %x3|Henyey-Greenstein %x4|Schlick %x5", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &ma->vol_phasefunc_type, 0.0, 0.0, 0, 0, "Scattering Direction (Phase Function)"); + if (ELEM(ma->vol_phasefunc_type, MA_VOL_PH_HG, MA_VOL_PH_SCHLICK)) { + uiDefButF(block, NUM, B_MATPRV, "Asymmetry: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_phasefunc_g), -1.0, 1.0, 0, 0, "> 0 is forward scattering, < 0 is back scattering"); + } + uiBlockEndAlign(block); + yco = PANEL_YMAX; From 25ece3ba2f60ec4271828bb4ab1c083c6fa36761 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 6 Oct 2008 12:25:22 +0000 Subject: [PATCH 023/577] * New point density update: Turbulence This addition allows you to perturb the point density with noise, to give the impression of more resolution. It's a quick way to add detail, without having to use large, complex, and slower to render particle systems. Rather than just overlaying noise, like you might do by adding a secondary clouds texture, it uses noise to perturb the actual coordinate looked up in the density evaluation. This gives a much better looking result, as it actually alters the original density. Comparison of the particle cloud render without, and with added turbulence (the render with turbulence only renders slightly more slowly): http://mke3.net/blender/devel/rendering/volumetrics/pd_turbulence.jpg Using the same constant noise function/spatial coordinates will give a static appearance. This is fine (and quicker) if the particles aren't moving, but on animated particle systems, it looks bad, as if the particles are moving through a static noise field. To overcome this, there are additional options for particle systems, to influence the turbulence with the particles' average velocity, or average angular velocity. This information is only available for particle systems at the present. Here you can see the (dramatic) difference between no turbulence, static turbulence, and turbulence influenced by particle velocity: http://mke3.net/blender/devel/rendering/volumetrics/turbu_compare.mov --- source/blender/blenkernel/intern/texture.c | 4 + source/blender/blenloader/intern/readfile.c | 13 +++ source/blender/makesdna/DNA_texture_types.h | 18 +++- .../render/intern/source/pointdensity.c | 83 +++++++++++++++---- source/blender/src/buttons_shading.c | 34 +++++++- 5 files changed, 131 insertions(+), 21 deletions(-) diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 7b558008a92..33b824623fa 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -878,6 +878,10 @@ PointDensity *BKE_add_pointdensity(void) 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; return pd; } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 568513650e0..249459bf3a4 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7882,6 +7882,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) if (main->versionfile <= 247) { Material *ma; + Tex *tex; for(ma=main->mat.first; ma; ma= ma->id.next) { /* trigger for non-volumetric file */ @@ -7893,6 +7894,18 @@ static void do_versions(FileData *fd, Library *lib, Main *main) ma->vol_absorption_col[0] = ma->vol_absorption_col[1] = ma->vol_absorption_col[2] = 0.0f; } } + + 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; + } + } + } /* set the curve radius interpolation to 2.47 default - easy */ diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index 95bacbbd4c6..95f61e73c79 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -144,8 +144,13 @@ typedef struct PointDensity { short pdpad2; void *point_tree; /* the acceleration tree containing points */ - void *point_data; /* dynamically allocated extra for extra information, like particle age */ - int pdpad3[2]; + float *point_data; /* dynamically allocated extra for extra information, like particle age */ + + float noise_size; + short noise_depth; + short noise_influence; + float noise_fac; + float pdpad4; } PointDensity; @@ -429,6 +434,15 @@ typedef struct TexMapping { #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_ANGVEL 2 +#define TEX_PD_NOISE_TIME 3 #endif diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index 7998fa82836..e7e2d4fc26e 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -30,6 +30,7 @@ #include "MEM_guardedalloc.h" #include "BLI_arithb.h" +#include "BLI_blenlib.h" #include "BLI_kdopbvh.h" #include "BKE_DerivedMesh.h" @@ -45,13 +46,13 @@ #include "renderdatabase.h" #include "texture.h" - static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, ParticleSystem *psys) { DerivedMesh* dm; ParticleKey state; float cfra=bsystem_time(ob,(float)G.scene->r.cfra,0.0); int i, childexists; + int total_particles; float partco[3]; float obview[4][4]; @@ -74,12 +75,16 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa /* in case ob->imat isn't up-to-date */ Mat4Invert(ob->imat, ob->obmat); - pd->point_tree = BLI_bvhtree_new(psys->totpart+psys->totchild, 0.0, 2, 6); + total_particles = psys->totpart+psys->totchild; + + pd->point_tree = BLI_bvhtree_new(total_particles, 0.0, 2, 6); + if (pd->noise_influence != TEX_PD_NOISE_STATIC) + pd->point_data = MEM_mallocN(sizeof(float)*3*total_particles, "point_data"); if (psys->totchild > 0 && !(psys->part->draw & PART_DRAW_PARENT)) childexists = 1; - for (i = 0; i < psys->totpart + psys->totchild; i++) { + for (i = 0; i < total_particles; i++) { state.time = cfra; if(psys_get_particle_state(ob, psys, i, &state, 0)) { @@ -97,6 +102,16 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa } BLI_bvhtree_insert(pd->point_tree, i, partco, 1); + + if (pd->noise_influence == TEX_PD_NOISE_VEL) { + pd->point_data[i*3 + 0] = state.vel[0]; + pd->point_data[i*3 + 1] = state.vel[1]; + pd->point_data[i*3 + 2] = state.vel[2]; + } else if (pd->noise_influence == TEX_PD_NOISE_ANGVEL) { + pd->point_data[i*3 + 0] = state.ave[0]; + pd->point_data[i*3 + 1] = state.ave[1]; + pd->point_data[i*3 + 2] = state.ave[2]; + } } } @@ -131,7 +146,6 @@ static void pointdensity_cache_object(Render *re, PointDensity *pd, ObjectRen *o VecSubf(ver_co, ver_co, obr->ob->loc); } else { /* TEX_PD_WORLDSPACE */ - } BLI_bvhtree_insert(pd->point_tree, i, ver_co, 1); @@ -232,6 +246,7 @@ typedef struct PointDensityRangeData float *density; float squared_radius; float *point_data; + float *vec; short falloff_type; } PointDensityRangeData; @@ -239,17 +254,26 @@ void accum_density(void *userdata, int index, float squared_dist) { PointDensityRangeData *pdr = (PointDensityRangeData *)userdata; const float dist = pdr->squared_radius - squared_dist; + float density; if (pdr->falloff_type == TEX_PD_FALLOFF_STD) - *pdr->density += dist; + density = dist; else if (pdr->falloff_type == TEX_PD_FALLOFF_SMOOTH) - *pdr->density+= 3.0f*dist*dist - 2.0f*dist*dist*dist; + density = 3.0f*dist*dist - 2.0f*dist*dist*dist; else if (pdr->falloff_type == TEX_PD_FALLOFF_SHARP) - *pdr->density+= dist*dist; + density = dist*dist; else if (pdr->falloff_type == TEX_PD_FALLOFF_CONSTANT) - *pdr->density+= pdr->squared_radius; + density = pdr->squared_radius; else if (pdr->falloff_type == TEX_PD_FALLOFF_ROOT) - *pdr->density+= sqrt(dist); + density = sqrt(dist); + + if (pdr->point_data) { + pdr->vec[0] += pdr->point_data[index*3 + 0];// * density; + pdr->vec[1] += pdr->point_data[index*3 + 1];// * density; + pdr->vec[2] += pdr->point_data[index*3 + 2];// * density; + } + + *pdr->density += density; } #define MAX_POINTS_NEAREST 25 @@ -259,6 +283,9 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) PointDensity *pd = tex->pd; PointDensityRangeData pdr; float density=0.0f; + float vec[3] = {0.0, 0.0, 0.0}; + float tv[3]; + float turb; if ((!pd) || (!pd->point_tree)) { texres->tin = 0.0f; @@ -269,16 +296,40 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) pdr.density = &density; pdr.point_data = pd->point_data; pdr.falloff_type = pd->falloff_type; + pdr.vec = vec; - BLI_bvhtree_range_query(pd->point_tree, texvec, pd->radius, accum_density, &pdr); + if (pd->flag & TEX_PD_TURBULENCE) { + VECCOPY(tv, texvec); + + /* find the average speed vectors, for perturbing final density lookup with */ + BLI_bvhtree_range_query(pd->point_tree, texvec, pd->radius, accum_density, &pdr); + + density = 0.0f; + Normalize(vec); + turb = BLI_turbulence(pd->noise_size, texvec[0]+vec[0], texvec[1]+vec[1], texvec[2]+vec[2], pd->noise_depth); + + turb -= 0.5f; /* re-center 0.0-1.0 range around 0 to prevent offsetting result */ + + tv[0] = texvec[0] + pd->noise_fac * turb; + tv[1] = texvec[1] + pd->noise_fac * turb; + tv[2] = texvec[2] + pd->noise_fac * turb; + + /* do density lookup with altered coordinates */ + BLI_bvhtree_range_query(pd->point_tree, tv, pd->radius, accum_density, &pdr); + } + else + BLI_bvhtree_range_query(pd->point_tree, texvec, pd->radius, accum_density, &pdr); + texres->tin = density; - /* - texres->tr = 1.0f; - texres->tg = 1.0f; - texres->tb = 0.0f; + //texres->tr = vec[0]; + //texres->tg = vec[1]; + //texres->tb = vec[2]; + return TEX_INT; + + /* BRICONTRGB; texres->ta = 1.0; @@ -288,7 +339,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) } */ - BRICONT; + //BRICONT; - return rv; + //return rv; } diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index ec5419c1704..b6c3e39bac2 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -759,15 +759,42 @@ static void texture_panel_pointdensity(Tex *tex) uiDefBut(block, LABEL, B_NOP, "Falloff:", X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); uiDefButS(block, MENU, B_REDR, "Standard %x0|Smooth %x1|Sharp %x2|Constant %x3|Root %x4", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &pd->falloff_type, 0.0, 0.0, 0, 0, "Falloff type"); + X2CLM1, yco-=BUTH, BUTW2, BUTH, &pd->falloff_type, 0.0, 0.0, 0, 0, "Falloff type"); + yco -= YSPACE; + + + uiBlockBeginAlign(block); + uiDefButBitS(block, TOG, TEX_PD_TURBULENCE, B_REDR, "Turbulence", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->flag), 0, 0, 0, 0, "Add directed turbulence to the density estimation"); + + if (pd->flag & TEX_PD_TURBULENCE) { + + uiDefButF(block, NUM, B_REDR, "Size: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_size), 0.001, 100.0, 10, 2, "Turbulence size"); + uiDefButS(block, NUM, B_REDR, "Depth: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_depth), 0.0, 100.0, 10, 2, "Turbulence depth"); + uiDefButF(block, NUM, B_REDR, "Strength: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_fac), 0.001, 100.0, 10, 2, ""); + + uiBlockEndAlign(block); + + yco -= YSPACE; + + if (pd->source == TEX_PD_PSYS) { + uiDefButS(block, MENU, B_REDR, "Noise Influence %t|Static %x0|Velocity %x1|Angular Velocity %x2", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_influence), 0.0, 0.0, 0, 0, "Noise Influence"); + } + } + uiBlockEndAlign(block); + yco = PANEL_YMAX; uiDefBut(block, LABEL, B_NOP, "Point data source:", - X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); uiDefButS(block, MENU, B_TEXREDR_PRV, "Particle System %x0|Object Vertices %x1", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &pd->source, 0.0, 0.0, 0, 0, "Source"); + X2CLM2, yco-=BUTH, BUTW2, BUTH, &pd->source, 0.0, 0.0, 0, 0, "Source"); yco -= YSPACE; @@ -788,6 +815,7 @@ static void texture_panel_pointdensity(Tex *tex) X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); uiDefButS(block, MENU, B_TEXREDR_PRV, "Emit Object Location %x0|Emit Object Space %x1|Global Space %x2", X2CLM2, yco-=BUTH, BUTW2, BUTH, &pd->psys_cache_space, 0.0, 0.0, 0, 0, "Co-ordinate system to cache particles in"); + } else if (pd->source == TEX_PD_OBJECT) { uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_REDR, "Ob:", From 8c3e960dd40cf36f8d4140fe545cb6e584d8900c Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 6 Oct 2008 22:39:06 +0000 Subject: [PATCH 024/577] * Fix for silly crash in point density UI, showed up in files with an existing empty texture. --- source/blender/src/buttons_shading.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index b6c3e39bac2..6ec8ce78e73 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -803,7 +803,7 @@ static void texture_panel_pointdensity(Tex *tex) uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_REDR, "Ob:", X2CLM2, yco-=BUTH, BUTW2, BUTH, &(pd->object), "Object that has the particle system"); - if (pd->object->particlesystem.first) { + if (pd->object && pd->object->particlesystem.first) { uiDefButS(block, NUM, B_REDR, "PSys:", X2CLM2, yco-=BUTH, BUTW2, BUTH, &(pd->psysindex), 1, 10, 10, 3, "Particle system number in the object"); } From 837211077ce17f17b946c46dde63555d56640aae Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 9 Oct 2008 01:15:54 +0000 Subject: [PATCH 025/577] * fix for silly bug in point density with no object in the object field --- source/blender/render/intern/source/pointdensity.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index e7e2d4fc26e..6ba9ace043d 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -168,10 +168,12 @@ static void cache_pointdensity(Render *re, Tex *tex) Object *ob = pd->object; int i; + if (!ob) return; + for(psys=ob->particlesystem.first, i=0; i< pd->psysindex-1; i++) psys= psys->next; - if (!ob || !psys) return; + if (!psys) return; pointdensity_cache_psys(re, pd, ob, psys); } From 21075b1a17b901a104efd1a8cb47241947942ffd Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Sun, 12 Oct 2008 11:38:28 +0000 Subject: [PATCH 026/577] Using quad trees instead of binary ones give another 10% speedup --- source/blender/render/intern/source/pointdensity.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index 6ba9ace043d..bdfb4d3b9d1 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -77,7 +77,7 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa total_particles = psys->totpart+psys->totchild; - pd->point_tree = BLI_bvhtree_new(total_particles, 0.0, 2, 6); + pd->point_tree = BLI_bvhtree_new(total_particles, 0.0, 4, 6); if (pd->noise_influence != TEX_PD_NOISE_STATIC) pd->point_data = MEM_mallocN(sizeof(float)*3*total_particles, "point_data"); @@ -131,7 +131,7 @@ static void pointdensity_cache_object(Render *re, PointDensity *pd, ObjectRen *o /* in case ob->imat isn't up-to-date */ Mat4Invert(obr->ob->imat, obr->ob->obmat); - pd->point_tree = BLI_bvhtree_new(obr->totvert, 0.0, 2, 6); + pd->point_tree = BLI_bvhtree_new(obr->totvert, 0.0, 4, 6); for(i=0; itotvert; i++) { float ver_co[3]; From a6bd4480ee218d4e3885691262aed13abf4241b0 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sun, 12 Oct 2008 23:39:52 +0000 Subject: [PATCH 027/577] * A few volume rendering tweaks: - modified point density so that it returns a more consistent density with regards to search radius. Previously larger radii would give much higher density but this is equalised out now. - Added a new volume material option 'density scale'. This is an overall scale multiplier for density, allowing you to (for example) crank down the density to a more desirable range if you're working at a large physical scale. Volume rendering is fundamentally scale dependant so this lets you correct to get the right visual result. - Also tweaked a few constants, old files won't render exactly the same, just minor things though. --- source/blender/blenkernel/intern/material.c | 1 + source/blender/blenloader/intern/readfile.c | 2 ++ source/blender/makesdna/DNA_material_types.h | 2 +- source/blender/render/intern/source/pointdensity.c | 11 ++++++----- source/blender/render/intern/source/volumetric.c | 3 ++- source/blender/src/buttons_shading.c | 14 +++++++++----- 6 files changed, 21 insertions(+), 12 deletions(-) diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index f54c0ae7ab1..3fcc76bf058 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -167,6 +167,7 @@ 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; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 3cae5fe4972..a3e6a21dd0b 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7893,6 +7893,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) 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; } for(tex=main->tex.first; tex; tex= tex->id.next) { diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index 4e006d17682..3efb8d9c116 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -66,7 +66,7 @@ typedef struct Material { short pad5[3]; /* volumetrics */ - float vol_alphathresh; + float vol_density_scale; float vol_stepsize, vol_shade_stepsize; float vol_absorption, vol_scattering; float vol_absorption_col[3]; diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index bdfb4d3b9d1..e7b6aedb894 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -255,7 +255,7 @@ typedef struct PointDensityRangeData void accum_density(void *userdata, int index, float squared_dist) { PointDensityRangeData *pdr = (PointDensityRangeData *)userdata; - const float dist = pdr->squared_radius - squared_dist; + const float dist = (pdr->squared_radius - squared_dist) / pdr->squared_radius * 0.5f; float density; if (pdr->falloff_type == TEX_PD_FALLOFF_STD) @@ -287,7 +287,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) float density=0.0f; float vec[3] = {0.0, 0.0, 0.0}; float tv[3]; - float turb; + float turb, noise_fac; if ((!pd) || (!pd->point_tree)) { texres->tin = 0.0f; @@ -299,6 +299,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) pdr.point_data = pd->point_data; pdr.falloff_type = pd->falloff_type; pdr.vec = vec; + noise_fac = pd->noise_fac * 0.5f; /* better default */ if (pd->flag & TEX_PD_TURBULENCE) { VECCOPY(tv, texvec); @@ -313,9 +314,9 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) turb -= 0.5f; /* re-center 0.0-1.0 range around 0 to prevent offsetting result */ - tv[0] = texvec[0] + pd->noise_fac * turb; - tv[1] = texvec[1] + pd->noise_fac * turb; - tv[2] = texvec[2] + pd->noise_fac * turb; + tv[0] = texvec[0] + noise_fac * turb; + tv[1] = texvec[1] + noise_fac * turb; + tv[2] = texvec[2] + noise_fac * turb; /* do density lookup with altered coordinates */ BLI_bvhtree_range_query(pd->point_tree, tv, pd->radius, accum_density, &pdr); diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 9a6790976af..ea661c42cff 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -131,13 +131,14 @@ static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, float vol_get_density(struct ShadeInput *shi, float *co) { float density = shi->mat->alpha; + float density_scale = shi->mat->vol_density_scale; float col[3] = {0.0, 0.0, 0.0}; if (shi->mat->flag & MA_IS_TEXTURED) { do_volume_tex(shi, co, MAP_ALPHA, col, &density); } - return density; + return density * density_scale; } diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 7be862b0f15..8d94d5f1ea3 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -4363,7 +4363,7 @@ static void material_panel_material_volume(Material *ma) uiBlockBeginAlign(block); uiDefButF(block, NUM, B_MATPRV, "Step Size: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_stepsize), 0.001, 100.0, 10, 2, "Ray marching step size"); + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_stepsize), 0.001, 100.0, 100, 2, "Ray marching step size"); uiBlockEndAlign(block); yco -= YSPACE; @@ -4372,7 +4372,7 @@ static void material_panel_material_volume(Material *ma) uiDefButBitS(block, TOG, MA_VOL_ATTENUATED, B_MATPRV, "Shading", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shadeflag), 0, 0, 0, 0, "Uses absorption for light attenuation"); uiDefButF(block, NUM, B_MATPRV, "Step Size: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shade_stepsize), 0.001, 100.0, 10, 2, "Step"); + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shade_stepsize), 0.001, 100.0, 100, 2, "Step"); uiBlockEndAlign(block); yco -= YSPACE; @@ -4389,14 +4389,18 @@ static void material_panel_material_volume(Material *ma) yco = PANEL_YMAX; + uiBlockBeginAlign(block); uiDefButF(block, NUMSLI, B_MATPRV, "Density: ", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->alpha), 0.0, 1.0, 0, 0, "Base opacity value"); + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->alpha), 0.0, 1.0, 0, 0, "Base density value - textured density is added on top"); + uiDefButF(block, NUM, B_MATPRV, "Density Scale: ", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->vol_density_scale), 0.000001, 100.0, 100, 2, "Global density multiplier"); + uiBlockEndAlign(block); yco -= YSPACE; uiBlockBeginAlign(block); uiDefButF(block, NUM, B_MATPRV, "Absorption: ", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->vol_absorption), 0.0, 10.0, 10, 0, "Multiplier for absorption"); + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->vol_absorption), 0.0, 100.0, 10, 0, "Multiplier for absorption"); uiDefButF(block, COL, B_MATPRV, "", X2CLM2, yco-=BUTH, BUTW2, BUTH, ma->vol_absorption_col, 0, 0, 0, B_MATCOL, ""); uiBlockEndAlign(block); @@ -4413,7 +4417,7 @@ static void material_panel_material_volume(Material *ma) yco -= YSPACE; uiDefButF(block, NUM, B_MATPRV, "Scattering: ", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->vol_scattering), 0.0, 10.0, 10, 0, "Multiplier for scattering"); + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->vol_scattering), 0.0, 100.0, 10, 0, "Multiplier for scattering"); } static void material_panel_nodes(Material *ma) From c0ddd5fd4914f7876cdf36225566d795e415bbf1 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 13 Oct 2008 00:35:58 +0000 Subject: [PATCH 028/577] * New option for step size: Randomized This is on by default, and trades random noise for banding. It jitters the step size from 75% to 125% of its original amount, and since it uses the threaded random seeds, shouldn't flicker during animation. These two images took roughly the same time to render: http://mke3.net/blender/devel/rendering/volumetrics/vol_stepsize_randomized.jpg --- source/blender/makesdna/DNA_material_types.h | 10 ++++-- .../blender/render/intern/source/volumetric.c | 32 ++++++++++++++++--- source/blender/src/buttons_shading.c | 8 +++-- 3 files changed, 40 insertions(+), 10 deletions(-) diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index 3efb8d9c116..86de34e5d26 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -63,11 +63,12 @@ typedef struct Material { /* end synced with render_types.h */ short material_type; /* solid, halo, volumetric */ - short pad5[3]; + short pad5[2]; /* volumetrics */ - float vol_density_scale; + short vol_stepsize_type; float vol_stepsize, vol_shade_stepsize; + float vol_density_scale; float vol_absorption, vol_scattering; float vol_absorption_col[3]; short vol_shadeflag; @@ -347,6 +348,11 @@ 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_ATTENUATED 2 diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index ea661c42cff..e0006a24fba 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -128,6 +128,29 @@ static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, } } +#define STEPSIZE_VIEW 0 +#define STEPSIZE_SHADE 1 +float vol_get_stepsize(struct ShadeInput *shi, int context) +{ + if (shi->mat->vol_stepsize_type == MA_VOL_STEP_RANDOMIZED) { + /* range between 0.75 and 1.25 */ + const float rnd = 0.5f * BLI_thread_frand(shi->thread) + 0.75f; + + if (context == STEPSIZE_VIEW) + return shi->mat->vol_stepsize * rnd; + else if (context == STEPSIZE_SHADE) + return shi->mat->vol_shade_stepsize * rnd; + } + else { + // MA_VOL_STEP_CONSTANT + + if (context == STEPSIZE_VIEW) + return shi->mat->vol_stepsize; + else if (context == STEPSIZE_SHADE) + return shi->mat->vol_shade_stepsize; + } +} + float vol_get_density(struct ShadeInput *shi, float *co) { float density = shi->mat->alpha; @@ -264,6 +287,7 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * float hitco[3], *atten_co; float p; float scatter_fac; + float shade_stepsize = vol_get_stepsize(shi, STEPSIZE_SHADE); if (lar->mode & LA_LAYER) if((lar->lay & shi->obi->lay)==0) return; if ((lar->lay & shi->lay)==0) return; @@ -303,8 +327,8 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * atten_co = lar->co; } else atten_co = hitco; - - vol_get_attenuation(shi, tau, co, atten_co, density, shi->mat->vol_shade_stepsize); + + vol_get_attenuation(shi, tau, co, atten_co, density, shade_stepsize); tr[0] = exp(-tau[0]); tr[1] = exp(-tau[1]); tr[2] = exp(-tau[2]); @@ -321,8 +345,6 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * vol_get_scattering_fac(shi, &scatter_fac, co, density); VecMulf(lacol, scatter_fac); - - } /* shadows -> trace a ray to find blocker geometry @@ -362,7 +384,7 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float { float tr[3] = {1.0f, 1.0f, 1.0f}; /* total transmittance */ float radiance[3] = {0.f, 0.f, 0.f}, d_radiance[3] = {0.f, 0.f, 0.f}; - float stepsize = shi->mat->vol_stepsize; + float stepsize = vol_get_stepsize(shi, STEPSIZE_VIEW); int nsteps; float vec[3], stepvec[3] = {0.0, 0.0, 0.0}; float tau[3], step_emit[3], step_scatter[3] = {0.0, 0.0, 0.0}; diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 8d94d5f1ea3..ac4f10cf214 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -4363,7 +4363,9 @@ static void material_panel_material_volume(Material *ma) uiBlockBeginAlign(block); uiDefButF(block, NUM, B_MATPRV, "Step Size: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_stepsize), 0.001, 100.0, 100, 2, "Ray marching step size"); + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_stepsize), 0.001, 100.0, 10, 2, "Ray marching step size"); + uiDefButS(block, MENU, B_TEXREDR_PRV, "Step Size Calculation %t|Randomized %x0|Constant %x1", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &ma->vol_stepsize_type, 0.0, 0.0, 0, 0, "Step size calculation, replace banding with jittering"); uiBlockEndAlign(block); yco -= YSPACE; @@ -4372,7 +4374,7 @@ static void material_panel_material_volume(Material *ma) uiDefButBitS(block, TOG, MA_VOL_ATTENUATED, B_MATPRV, "Shading", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shadeflag), 0, 0, 0, 0, "Uses absorption for light attenuation"); uiDefButF(block, NUM, B_MATPRV, "Step Size: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shade_stepsize), 0.001, 100.0, 100, 2, "Step"); + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shade_stepsize), 0.001, 100.0, 10, 2, "Step"); uiBlockEndAlign(block); yco -= YSPACE; @@ -4393,7 +4395,7 @@ static void material_panel_material_volume(Material *ma) uiDefButF(block, NUMSLI, B_MATPRV, "Density: ", X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->alpha), 0.0, 1.0, 0, 0, "Base density value - textured density is added on top"); uiDefButF(block, NUM, B_MATPRV, "Density Scale: ", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->vol_density_scale), 0.000001, 100.0, 100, 2, "Global density multiplier"); + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->vol_density_scale), 0.000001, 100.0, 10, 2, "Global density multiplier"); uiBlockEndAlign(block); yco -= YSPACE; From d6808c2b4b9d53f5481e96d4041e67b20f1d56f0 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 13 Oct 2008 05:22:31 +0000 Subject: [PATCH 029/577] * Raytraced shadow casting for volumes This is a first version and still has a couple of things undefined or unimplemented, such as external objects casting shadows on or within volumes, however volume->solid shadows are going ok. http://mke3.net/blender/devel/rendering/volumetrics/shadows_test_02.mov http://mke3.net/blender/devel/rendering/volumetrics/vol_test_shad3.blend As with other transparent raytraced shadows in Blender ,in order to make it work, you must enable 'TraShad' on the material *receiving* the shadow. It would be nice to make this a bit easier to use, since there's not much chance you want a volume material to be casting solid shadows, but that's a bigger issue in the renderer outside this scope. The volume shadows are working from the same physical basis of absorption, and support coloured absorption: http://mke3.net/blender/devel/rendering/volumetrics/vol_shad_absorption.png They also work properly with multi-sampled (i.e. QMC) soft shadows: http://mke3.net/blender/devel/rendering/volumetrics/vol_shad_sharp.png http://mke3.net/blender/devel/rendering/volumetrics/vol_shad_soft.png And by popular request the test file: http://mke3.net/blender/devel/rendering/volumetrics/vol_test_shad_clouds.blend --- .../render/intern/include/pointdensity.h | 1 + .../render/intern/include/rendercore.h | 2 + .../render/intern/include/volumetric.h | 3 +- .../render/intern/source/convertblender.c | 2 - .../blender/render/intern/source/rayshade.c | 33 ++++++---- .../blender/render/intern/source/volumetric.c | 60 ++++++++++++++++++- 6 files changed, 87 insertions(+), 14 deletions(-) diff --git a/source/blender/render/intern/include/pointdensity.h b/source/blender/render/intern/include/pointdensity.h index 9c21cc0c253..93cdef3b14e 100644 --- a/source/blender/render/intern/include/pointdensity.h +++ b/source/blender/render/intern/include/pointdensity.h @@ -37,6 +37,7 @@ 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 */ diff --git a/source/blender/render/intern/include/rendercore.h b/source/blender/render/intern/include/rendercore.h index 4b28529a147..972071764d2 100644 --- a/source/blender/render/intern/include/rendercore.h +++ b/source/blender/render/intern/include/rendercore.h @@ -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); diff --git a/source/blender/render/intern/include/volumetric.h b/source/blender/render/intern/include/volumetric.h index 8db3fa63f98..290be427f01 100644 --- a/source/blender/render/intern/include/volumetric.h +++ b/source/blender/render/intern/include/volumetric.h @@ -26,4 +26,5 @@ * ***** END GPL LICENSE BLOCK ***** */ -void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr); \ No newline at end of file +void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr); +void volume_trace_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct Isect *last_is); \ No newline at end of file diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 4b663c6caa6..0660d9e0b24 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -965,8 +965,6 @@ static Material *give_render_material(Render *re, Object *ob, int nr) if(ma->nodetree && ma->use_nodes) flag_render_node_material(re, ma->nodetree); - if (ma->material_type == MA_VOLUME) re->r.mode |= R_RAYTRACE; - check_material_is_textured(ma); return ma; diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index c431340d770..d06bbcf3300 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -54,6 +54,7 @@ #include "pixelshading.h" #include "shading.h" #include "texture.h" +#include "volumetric.h" #include "RE_raytrace.h" @@ -262,21 +263,28 @@ void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr) shade_input_set_shade_texco(shi); - if(is->mode==RE_RAY_SHADOW_TRA) + if (shi->mat->material_type == MA_VOLUME) { + if(ELEM(is->mode, RE_RAY_SHADOW, RE_RAY_SHADOW_TRA)) { + volume_trace_shadow(shi, shr, is); + } else { + shade_volume_loop(shi, shr); + } + } + else if(is->mode==RE_RAY_SHADOW_TRA) if(shi->mat->nodetree && shi->mat->use_nodes) { ntreeShaderExecTree(shi->mat->nodetree, shi, shr); shi->mat= vlr->mat; /* shi->mat is being set in nodetree */ } - else + else { shade_color(shi, shr); + } else { if(shi->mat->nodetree && shi->mat->use_nodes) { ntreeShaderExecTree(shi->mat->nodetree, shi, shr); shi->mat= vlr->mat; /* shi->mat is being set in nodetree */ } else { - if (shi->mat->material_type == MA_SOLID) shade_material_loop(shi, shr); - else if (shi->mat->material_type == MA_VOLUME) shade_volume_loop(shi, shr); + shade_material_loop(shi, shr); } /* raytrace likes to separate the spec color */ VECSUB(shr->diff, shr->combined, shr->spec); @@ -1274,7 +1282,7 @@ static void addAlphaLight(float *shadfac, float *col, float alpha, float filter) shadfac[3]= (1.0f-alpha)*shadfac[3]; } -static void ray_trace_shadow_tra(Isect *is, int depth, int traflag) +void ray_trace_shadow_tra(Isect *is, int depth, int traflag) { /* ray to lamp, find first face that intersects, check alpha properties, if it has col[3]>0.0f continue. so exit when alpha is full */ @@ -1303,11 +1311,16 @@ static void ray_trace_shadow_tra(Isect *is, int depth, int traflag) shi.mat_override= NULL;*/ shade_ray(is, &shi, &shr); - if (traflag & RAY_TRA) - d= shade_by_transmission(is, &shi, &shr); - - /* mix colors based on shadfac (rgb + amount of light factor) */ - addAlphaLight(is->col, shr.diff, shr.alpha, d*shi.mat->filter); + if (shi.mat->material_type == MA_SOLID) { + if (traflag & RAY_TRA) + d= shade_by_transmission(is, &shi, &shr); + + /* mix colors based on shadfac (rgb + amount of light factor) */ + addAlphaLight(is->col, shr.diff, shr.alpha, d*shi.mat->filter); + } else { + // MA_VOLUME + addAlphaLight(is->col, shr.combined, shr.alpha, 1.0f); + } if(depth>0 && is->col[3]>0.0f) { diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index e0006a24fba..3b44e1bb87f 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -149,6 +149,8 @@ float vol_get_stepsize(struct ShadeInput *shi, int context) else if (context == STEPSIZE_SHADE) return shi->mat->vol_shade_stepsize; } + + return shi->mat->vol_stepsize; } float vol_get_density(struct ShadeInput *shi, float *co) @@ -247,6 +249,8 @@ void vol_get_attenuation(ShadeInput *shi, float *tau, float *co, float *endco, f dist = VecLenf(co, endco); nsteps = (int)ceil(dist / stepsize); + if (density < -0.001f) density = vol_get_density(shi, co); + if (nsteps == 1) { /* homogenous volume within the sampled distance */ tau[0] = tau[1] = tau[2] = dist * density; @@ -485,7 +489,7 @@ static void shade_intersection(ShadeInput *shi, float *col, Isect *is) shi_new.mask= shi->mask; shi_new.osatex= shi->osatex; shi_new.thread= shi->thread; - shi_new.depth= shi->depth; + shi_new.depth= 1; shi_new.volume_depth= shi->volume_depth + 1; shi_new.xs= shi->xs; shi_new.ys= shi->ys; @@ -597,3 +601,57 @@ void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr) shr->combined[3] = shr->alpha = 1.0f; } } + +void volume_trace_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct Isect *last_is) +{ + float hitco[3], col[4] = {0.f,0.f,0.f,0.f}; + float tr[3] = {1.0,1.0,1.0}; + float tau[3] = {0.0,0.0,0.0}; + Isect is; + float shade_stepsize = vol_get_stepsize(shi, STEPSIZE_SHADE); + + memset(shr, 0, sizeof(ShadeResult)); + + /* if 1st hit normal is facing away from the camera, + * then we're inside the volume already. */ + if (shi->flippednor) { + + vol_get_attenuation(shi, tau, last_is->start, shi->co, -1.0f, shade_stepsize); + tr[0] = exp(-tau[0]); + tr[1] = exp(-tau[1]); + tr[2] = exp(-tau[2]); + + shr->combined[0] = tr[0]; + shr->combined[1] = tr[1]; + shr->combined[2] = tr[2]; + + shr->combined[3] = 1.0f -(tr[0] + tr[1] + tr[2]) * 0.333f; + shr->alpha = shr->combined[3]; + } + /* trace to find a backface, the other side bounds of the volume */ + /* (ray intersect ignores front faces here) */ + else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH, 0)) { + float dist = VecLenf(shi->co, hitco); + + vol_get_attenuation(shi, tau, shi->co, hitco, -1.0f, shade_stepsize); + tr[0] = exp(-tau[0]); + tr[1] = exp(-tau[1]); + tr[2] = exp(-tau[2]); + + shr->combined[0] = tr[0]; + shr->combined[1] = tr[1]; + shr->combined[2] = tr[2]; + + shr->combined[3] = 1.0f -(tr[0] + tr[1] + tr[2]) * 0.333f; + shr->alpha = shr->combined[3]; + + } + else { + shr->combined[0] = 0.0f; + shr->combined[1] = 0.0f; + shr->combined[2] = 0.0f; + shr->combined[3] = shr->alpha = 0.0f; + } + +} + From 51d51991e59f98e7cff3a035d5ba3a142f1ed7e0 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 13 Oct 2008 06:46:23 +0000 Subject: [PATCH 030/577] * Added support for solid objects casting shadows within a volume. Currently it only supports solid shadows - if it's a solid object, it will cast 100% shadow. Support for transparent shadows can potentially be added down the track. http://mke3.net/blender/devel/rendering/volumetrics/vol_shad_internal.jpg --- source/blender/makesdna/DNA_material_types.h | 2 +- source/blender/render/intern/source/volumetric.c | 12 +++++++++--- source/blender/src/buttons_shading.c | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index 86de34e5d26..7b6e945dfbf 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -356,7 +356,7 @@ typedef struct Material { /* vol_shadeflag */ #define MA_VOL_SHADED 1 #define MA_VOL_ATTENUATED 2 -#define MA_VOL_SHADOWED 4 +#define MA_VOL_RECVSHADOW 4 /* vol_phasefunc_type */ #define MA_VOL_PH_ISOTROPIC 0 diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 3b44e1bb87f..6e2e817fc85 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -292,7 +292,8 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * float p; float scatter_fac; float shade_stepsize = vol_get_stepsize(shi, STEPSIZE_SHADE); - + float shadfac[4]; + if (lar->mode & LA_LAYER) if((lar->lay & shi->obi->lay)==0) return; if ((lar->lay & shi->lay)==0) return; if (lar->energy == 0.0) return; @@ -324,7 +325,13 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * /* find minimum of volume bounds, or lamp coord */ if (vol_get_bounds(shi, co, lv, hitco, &is, VOL_BOUNDS_SS, 0)) { float dist = VecLenf(co, hitco); + VlakRen *vlr = (VlakRen *)is.face; + if (vlr->mat->material_type == MA_SOLID) { + lacol[0] = lacol[1] = lacol[2] = 0.0f; + return; + } + if (ELEM(lar->type, LA_SUN, LA_HEMI)) atten_co = hitco; else if ( lampdist < dist ) { @@ -604,7 +611,7 @@ void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr) void volume_trace_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct Isect *last_is) { - float hitco[3], col[4] = {0.f,0.f,0.f,0.f}; + float hitco[3]; float tr[3] = {1.0,1.0,1.0}; float tau[3] = {0.0,0.0,0.0}; Isect is; @@ -631,7 +638,6 @@ void volume_trace_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct /* trace to find a backface, the other side bounds of the volume */ /* (ray intersect ignores front faces here) */ else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH, 0)) { - float dist = VecLenf(shi->co, hitco); vol_get_attenuation(shi, tau, shi->co, hitco, -1.0f, shade_stepsize); tr[0] = exp(-tau[0]); diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index ac4f10cf214..430b50717df 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -4371,7 +4371,7 @@ static void material_panel_material_volume(Material *ma) yco -= YSPACE; uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, MA_VOL_ATTENUATED, B_MATPRV, "Shading", + uiDefButBitS(block, TOG, MA_VOL_ATTENUATED, B_MATPRV, "Self Shading", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shadeflag), 0, 0, 0, 0, "Uses absorption for light attenuation"); uiDefButF(block, NUM, B_MATPRV, "Step Size: ", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shade_stepsize), 0.001, 100.0, 10, 2, "Step"); @@ -4388,7 +4388,10 @@ static void material_panel_material_volume(Material *ma) } uiBlockEndAlign(block); - + /*uiDefButBitS(block, TOG, MA_VOL_RECVSHADOW, B_MATPRV, "Receive Shadows", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shadeflag), 0, 0, 0, 0, "Receive shadows from external objects"); + */ + yco = PANEL_YMAX; uiBlockBeginAlign(block); From b3000c5529d10ae5002d25384c50d934b233a216 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Fri, 17 Oct 2008 05:54:42 +0000 Subject: [PATCH 031/577] non-working WIP commit to continue coding at home. nothing to see here, move along! --- source/blender/makesdna/DNA_material_types.h | 1 + .../render/intern/include/render_types.h | 14 ++ .../render/intern/include/volumetric.h | 4 +- .../render/intern/source/convertblender.c | 20 +++ .../render/intern/source/renderdatabase.c | 1 + .../blender/render/intern/source/volumetric.c | 126 +++++++++++++++--- source/blender/src/buttons_shading.c | 2 + 7 files changed, 150 insertions(+), 18 deletions(-) diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index 7b6e945dfbf..3ceb267ce67 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -357,6 +357,7 @@ typedef struct Material { #define MA_VOL_SHADED 1 #define MA_VOL_ATTENUATED 2 #define MA_VOL_RECVSHADOW 4 +#define MA_VOL_PRECACHESHADING 8 /* vol_phasefunc_type */ #define MA_VOL_PH_ISOTROPIC 0 diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index b0003cadb55..6f4537d84fb 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -201,6 +201,8 @@ struct Render ListBase customdata_names; struct Object *excludeob; + + ListBase vol_precache_obs; /* arena for allocating data for use during render, for * example dynamic TFaces to go in the VlakRen structure. @@ -285,6 +287,8 @@ typedef struct ObjectInstanceRen { float dupliorco[3], dupliuv[2]; float (*duplitexmat)[4]; + + float *volume_precache; float *vectors; int totvector; @@ -396,6 +400,16 @@ typedef struct StrandRen { float orco[3]; } StrandRen; +/* ------------------------------------------------------------------------- */ + +typedef struct VolPrecache +{ + struct VolPrecache *next, *prev; + struct Material *ma; + struct ObjectRen *obr; +} VolPrecache; + +/* ------------------------------------------------------------------------- */ struct LampRen; struct MTex; diff --git a/source/blender/render/intern/include/volumetric.h b/source/blender/render/intern/include/volumetric.h index 290be427f01..fb87035145f 100644 --- a/source/blender/render/intern/include/volumetric.h +++ b/source/blender/render/intern/include/volumetric.h @@ -27,4 +27,6 @@ */ void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr); -void volume_trace_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct Isect *last_is); \ No newline at end of file +void volume_trace_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct Isect *last_is); +void volume_precache(Render *re); +void free_volume_precache(Render *re); \ No newline at end of file diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 0660d9e0b24..4c9914aa4d3 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -3026,6 +3026,18 @@ static void use_mesh_edge_lookup(ObjectRen *obr, DerivedMesh *dm, MEdge *medge, } } +static void add_vol_precache(Render *re, ObjectRen *obr, Material *ma) +{ + struct VolPrecache *vp; + + vp = MEM_mallocN(sizeof(VolPrecache), "volume precache object"); + + vp->ma = ma; + vp->obr = obr; + + BLI_addtail(&re->vol_precache_obs, vp); +} + static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) { Object *ob= obr->ob; @@ -3080,6 +3092,10 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) if(re->r.mode & R_RADIO) if(ma->mode & MA_RADIO) do_autosmooth= 1; + + if (ma->vol_shadeflag & MA_VOL_PRECACHESHADING) { + add_vol_precache(re, obr, ma); + } } } @@ -4436,6 +4452,7 @@ void RE_Database_Free(Render *re) end_render_materials(); free_pointdensities(re); + free_volume_precache(re); if(re->wrld.aosphere) { MEM_freeN(re->wrld.aosphere); @@ -4891,6 +4908,9 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view) /* point density texture */ if(!re->test_break()) make_pointdensities(re); + + if(!re->test_break()) + volume_precache(re); } if(!re->test_break()) diff --git a/source/blender/render/intern/source/renderdatabase.c b/source/blender/render/intern/source/renderdatabase.c index d44b49cc706..1bc1c1a712a 100644 --- a/source/blender/render/intern/source/renderdatabase.c +++ b/source/blender/render/intern/source/renderdatabase.c @@ -1323,6 +1323,7 @@ ObjectInstanceRen *RE_addRenderInstance(Render *re, ObjectRen *obr, Object *ob, obi->index= index; obi->psysindex= psysindex; obi->lay= lay; + obi->volume_precache = NULL; if(mat) { Mat4CpyMat4(obi->mat, mat); diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 6e2e817fc85..3128c67ee88 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -31,6 +31,8 @@ #include #include +#include "MEM_guardedalloc.h" + #include "BLI_blenlib.h" #include "BLI_arithb.h" #include "BLI_rand.h" @@ -44,6 +46,7 @@ #include "DNA_lamp_types.h" #include "BKE_global.h" +#include "BKE_main.h" #include "render_types.h" #include "pixelshading.h" @@ -166,7 +169,6 @@ float vol_get_density(struct ShadeInput *shi, float *co) return density * density_scale; } - /* compute emission component, amount of radiance to add per segment * can be textured with 'emit' */ void vol_get_emission(ShadeInput *shi, float *em, float *co, float density) @@ -182,14 +184,16 @@ void vol_get_emission(ShadeInput *shi, float *em, float *co, float density) VecMulVecf(em, em, col); } +/* scattering multiplier, values above 1.0 are non-physical, + * but can be useful to tweak lighting */ void vol_get_scattering_fac(ShadeInput *shi, float *scatter_fac, float *co, float density) { - //float col[3] = {0.0, 0.0, 0.0}; - //do_volume_tex(shi, co, MAP_EMIT+MAP_COL, col, &emission); - *scatter_fac = shi->mat->vol_scattering; } +/* phase function - determines in which directions the light + * is scattered in the volume relative to incoming direction + * and view direction */ float vol_get_phasefunc(ShadeInput *shi, short phasefunc_type, float g, float *w, float *wp) { const float costheta = Inpf(w, wp); @@ -235,7 +239,7 @@ void vol_get_absorption(ShadeInput *shi, float *absorb_col, float *co) /* Compute attenuation, otherwise known as 'optical thickness', extinction, or tau. * Used in the relationship Transmittance = e^(-attenuation) - * can be textured with 'alpha' */ + */ void vol_get_attenuation(ShadeInput *shi, float *tau, float *co, float *endco, float density, float stepsize) { /* input density = density at co */ @@ -249,6 +253,7 @@ void vol_get_attenuation(ShadeInput *shi, float *tau, float *co, float *endco, f dist = VecLenf(co, endco); nsteps = (int)ceil(dist / stepsize); + /* trigger for recalculating density */ if (density < -0.001f) density = vol_get_density(shi, co); if (nsteps == 1) { @@ -327,6 +332,7 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * float dist = VecLenf(co, hitco); VlakRen *vlr = (VlakRen *)is.face; + /* simple internal shadowing */ if (vlr->mat->material_type == MA_SOLID) { lacol[0] = lacol[1] = lacol[2] = 0.0f; return; @@ -347,9 +353,9 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * VecMulVecf(lacol, lacol, tr); } else { - /* point is on the outside edge of the volume, - * therefore no attenuation, full transmission - * radiance from lamp remains unchanged */ + /* Point is on the outside edge of the volume, + * therefore no attenuation, full transmission. + * Radiance from lamp remains unchanged */ } } @@ -358,13 +364,6 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * } -/* shadows -> trace a ray to find blocker geometry - - if blocker is outside the volume, use standard shadow functions - - if blocker is inside the volume, use raytracing - -- (deep shadow maps could potentially slot in here too I suppose) - - attenuate from current point, to blocked point or volume bounds -*/ - /* single scattering only for now */ void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsize, float density) { @@ -382,7 +381,7 @@ void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsi if (lar==NULL) continue; vol_shade_one_lamp(shi, co, lar, lacol, stepsize, density); - + VecMulf(lacol, density); VecAddf(col, col, lacol); @@ -425,7 +424,28 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float /* get radiance from all points along the ray due to participating media */ for (s = 0; s < nsteps; s++) { - if (s > 0) density = vol_get_density(shi, step_sta); + + if (shi->mat->vol_shadeflag & MA_VOL_PRECACHESHADING) { + int res = 10; + int x,y,z; + + step_mid[0] = step_sta[0] + (stepvec[0] * 0.5); + step_mid[1] = step_sta[1] + (stepvec[1] * 0.5); + step_mid[2] = step_sta[2] + (stepvec[2] * 0.5); + + //CLAMP(step_mid[0], 0.0f, 1.0f); + //CLAMP(step_mid[1], 0.0f, 1.0f); + //CLAMP(step_mid[2], 0.0f, 1.0f); + + MTC_Mat4MulVecfl(R.viewinv, step_mid); + + x = (int)step_mid[0] * res; + y = (int)step_mid[1] * res; + z = (int)step_mid[2] * res; + + density = shi->obi->volume_precache[x*res + y*res + z*res]; + } + else if (s > 0) density = vol_get_density(shi, step_sta); /* there's only any use in shading here * if there's actually some density to shade! */ @@ -661,3 +681,75 @@ void volume_trace_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct } +void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *ma) +{ + int x, y, z; + int res = 10; + float co[3]; + ShadeInput shi; + int foundma=0; + float density; + float resf; + int i; + + memset(&shi, 0, sizeof(ShadeInput)); + shi.depth= 1; + shi.mask= 1; + shi.mat = ma; + shi.vlr = NULL; + memcpy(&shi.r, &shi.mat->r, 23*sizeof(float)); // note, keep this synced with render_types.h + shi.har= shi.mat->har; + + shi.obi= obi; + shi.obr= obi->obr; + + resf = (float) res; + + obi->volume_precache = MEM_mallocN(sizeof(float)*res*res*res, "volume light cache"); + + for (x=0; x < res; x++) { + co[0] = (float)x / resf; + + for (y=0; y < res; y++) { + co[1] = (float)y / resf; + + for (z=0; z < res; z++) { + co[2] = (float)z / resf; + + density = vol_get_density(&shi, co); + + obi->volume_precache[x*res + y*res + z*res] = density; + + printf("vol_light_cache[%d][%d][%d] = %f \n", x, y, z, obi->volume_precache[x*res + y*res + z*res]); + } + } + } +} + +void volume_precache(Render *re) +{ + ObjectInstanceRen *obi; + VolPrecache *vp; + + printf("Precaching %d volumes... \n", BLI_countlist(&re->vol_precache_obs)); + + for(vp= re->vol_precache_obs.first; vp; vp= vp->next) { + for(obi= re->instancetable.first; obi; obi= obi->next) { + if (obi->obr == vp->obr) + printf("precaching object: %s with material: %s \n", vp->obr->ob->id.name+2, vp->ma->id.name+2); + vol_precache_objectinstance(re, obi, vp->ma); + } + } +} + +void free_volume_precache(Render *re) +{ + ObjectInstanceRen *obi; + + for(obi= re->instancetable.first; obi; obi= obi->next) { + if (obi->volume_precache) + MEM_freeN(obi->volume_precache); + } + + BLI_freelistN(&re->vol_precache_obs); +} \ No newline at end of file diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 430b50717df..63fa127824a 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -4375,6 +4375,8 @@ static void material_panel_material_volume(Material *ma) X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shadeflag), 0, 0, 0, 0, "Uses absorption for light attenuation"); uiDefButF(block, NUM, B_MATPRV, "Step Size: ", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shade_stepsize), 0.001, 100.0, 10, 2, "Step"); + uiDefButBitS(block, TOG, MA_VOL_PRECACHESHADING, B_MATPRV, "Precache", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shadeflag), 0, 0, 0, 0, "precache"); uiBlockEndAlign(block); yco -= YSPACE; From 49aa7edb7708fcc0119d8251fa423903b022e706 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sun, 19 Oct 2008 08:25:10 +0000 Subject: [PATCH 032/577] Another WIP commit, nothing to see yet. --- source/blender/makesdna/DNA_material_types.h | 3 +- .../render/intern/source/convertblender.c | 11 +- .../render/intern/source/pointdensity.c | 3 + .../blender/render/intern/source/volumetric.c | 128 +++++++++++------- source/blender/src/buttons_shading.c | 2 + 5 files changed, 94 insertions(+), 53 deletions(-) diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index 3ceb267ce67..66f23c7905d 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -63,10 +63,11 @@ typedef struct Material { /* end synced with render_types.h */ short material_type; /* solid, halo, volumetric */ - short pad5[2]; + short pad5; /* volumetrics */ short vol_stepsize_type; + short vol_precache_resolution; float vol_stepsize, vol_shade_stepsize; float vol_density_scale; float vol_absorption, vol_scattering; diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 4c9914aa4d3..c58946bb64b 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -3093,7 +3093,7 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) if(ma->mode & MA_RADIO) do_autosmooth= 1; - if (ma->vol_shadeflag & MA_VOL_PRECACHESHADING) { + if ((ma->material_type == MA_VOLUME) && (ma->vol_shadeflag & MA_VOL_PRECACHESHADING)) { add_vol_precache(re, obr, ma); } } @@ -4429,6 +4429,8 @@ void RE_Database_Free(Render *re) BLI_freelistN(&re->lampren); BLI_freelistN(&re->lights); + + free_volume_precache(re); free_renderdata_tables(re); @@ -4452,7 +4454,6 @@ void RE_Database_Free(Render *re) end_render_materials(); free_pointdensities(re); - free_volume_precache(re); if(re->wrld.aosphere) { MEM_freeN(re->wrld.aosphere); @@ -4908,9 +4909,6 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view) /* point density texture */ if(!re->test_break()) make_pointdensities(re); - - if(!re->test_break()) - volume_precache(re); } if(!re->test_break()) @@ -4927,6 +4925,9 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view) if((re->r.mode & R_SSS) && !re->test_break()) if(re->r.renderer==R_INTERN) make_sss_tree(re); + + if(!re->test_break()) + volume_precache(re); } if(re->test_break()) diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index e7b6aedb894..f7c6767fcd8 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -227,6 +227,9 @@ void make_pointdensities(Render *re) cache_pointdensity(re, tex); } } + + re->i.infostr= NULL; + re->stats_draw(&re->i); } void free_pointdensities(Render *re) diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 3128c67ee88..fc2e4a630b1 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -21,7 +21,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): Farsthary (Raul FHernandez), Matt Ebb. + * Contributor(s): Matt Ebb, Raul Hernandez. * * ***** END GPL LICENSE BLOCK ***** */ @@ -38,6 +38,8 @@ #include "BLI_rand.h" #include "BLI_kdtree.h" +#include "PIL_time.h" + #include "RE_shader_ext.h" #include "RE_raytrace.h" @@ -59,6 +61,7 @@ extern struct Render R; /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +#define PRECACHE_RES 5 static int vol_backface_intersect_check(Isect *is, int ob, RayFace *face) { @@ -365,7 +368,7 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * } /* single scattering only for now */ -void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsize, float density) +void vol_get_scattering(Render *re, ShadeInput *shi, float *scatter, float *co, float stepsize, float density) { GroupObject *go; ListBase *lights; @@ -378,13 +381,14 @@ void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsi float lacol[3] = {0.f, 0.f, 0.f}; lar= go->lampren; - if (lar==NULL) continue; + if (lar) { - vol_shade_one_lamp(shi, co, lar, lacol, stepsize, density); + vol_shade_one_lamp(shi, co, lar, lacol, stepsize, density); - VecMulf(lacol, density); + VecMulf(lacol, density); - VecAddf(col, col, lacol); + VecAddf(col, col, lacol); + } } VECCOPY(scatter, col); @@ -397,7 +401,7 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float float stepsize = vol_get_stepsize(shi, STEPSIZE_VIEW); int nsteps; float vec[3], stepvec[3] = {0.0, 0.0, 0.0}; - float tau[3], step_emit[3], step_scatter[3] = {0.0, 0.0, 0.0}; + float tau[3], emit_col[3], scatter_col[3] = {0.0, 0.0, 0.0}; int s; float step_sta[3], step_end[3], step_mid[3]; float alpha; @@ -425,27 +429,7 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float /* get radiance from all points along the ray due to participating media */ for (s = 0; s < nsteps; s++) { - if (shi->mat->vol_shadeflag & MA_VOL_PRECACHESHADING) { - int res = 10; - int x,y,z; - - step_mid[0] = step_sta[0] + (stepvec[0] * 0.5); - step_mid[1] = step_sta[1] + (stepvec[1] * 0.5); - step_mid[2] = step_sta[2] + (stepvec[2] * 0.5); - - //CLAMP(step_mid[0], 0.0f, 1.0f); - //CLAMP(step_mid[1], 0.0f, 1.0f); - //CLAMP(step_mid[2], 0.0f, 1.0f); - - MTC_Mat4MulVecfl(R.viewinv, step_mid); - - x = (int)step_mid[0] * res; - y = (int)step_mid[1] * res; - z = (int)step_mid[2] * res; - - density = shi->obi->volume_precache[x*res + y*res + z*res]; - } - else if (s > 0) density = vol_get_density(shi, step_sta); + if (s > 0) density = vol_get_density(shi, step_sta); /* there's only any use in shading here * if there's actually some density to shade! */ @@ -462,10 +446,26 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float step_mid[2] = step_sta[2] + (stepvec[2] * 0.5); /* incoming light via emission or scattering (additive) */ - vol_get_emission(shi, step_emit, step_mid, density); - vol_get_scattering(shi, step_scatter, step_mid, stepsize, density); + vol_get_emission(shi, emit_col, step_mid, density); + if ((shi->mat->vol_shadeflag & MA_VOL_PRECACHESHADING) && shi->obi->volume_precache) { + const int res = shi->mat->vol_precache_resolution; + int x,y,z; + float bbmin[3], bbmax[3], dim[3]; + + VECCOPY(bbmin, shi->obi->obr->boundbox[0]); + VECCOPY(bbmax, shi->obi->obr->boundbox[1]); + VecSubf(dim, bbmax, bbmin); + + x = (int)(((step_mid[0] - bbmin[0]) / dim[0]) * res); + y = (int)(((step_mid[1] - bbmin[1]) / dim[1]) * res); + z = (int)(((step_mid[2] - bbmin[2]) / dim[2]) * res); + + scatter_col[0] = scatter_col[1] = scatter_col[2] = shi->obi->volume_precache[x*res*res + y*res + z]; + } + else + vol_get_scattering(&R, shi, scatter_col, step_mid, stepsize, density); - VecAddf(d_radiance, step_emit, step_scatter); + VecAddf(d_radiance, emit_col, scatter_col); /* Lv += Tr * (Lve() + Ld) */ VecMulVecf(d_radiance, tr, d_radiance); @@ -681,17 +681,23 @@ void volume_trace_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct } -void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *ma) +void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *ma, float *bbmin, float *bbmax) { int x, y, z; - int res = 10; - float co[3]; + + float co[3], voxel[3], scatter_col[3]; ShadeInput shi; - int foundma=0; float density; - float resf; - int i; + float stepsize; + float resf; + int res_2; + float res_3; + + float i = 1.0f; + double lasttime= PIL_check_seconds_timer(); + const int res = ma->vol_precache_resolution; + memset(&shi, 0, sizeof(ShadeInput)); shi.depth= 1; shi.mask= 1; @@ -699,28 +705,49 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m shi.vlr = NULL; memcpy(&shi.r, &shi.mat->r, 23*sizeof(float)); // note, keep this synced with render_types.h shi.har= shi.mat->har; - shi.obi= obi; shi.obr= obi->obr; + + stepsize = vol_get_stepsize(&shi, STEPSIZE_VIEW); resf = (float) res; + res_2 = res*res; + res_3 = res*res*res; + + VecSubf(voxel, bbmax, bbmin); + VecMulf(voxel, 1.0f/res); obi->volume_precache = MEM_mallocN(sizeof(float)*res*res*res, "volume light cache"); for (x=0; x < res; x++) { - co[0] = (float)x / resf; + co[0] = bbmin[0] + (voxel[0] * x); for (y=0; y < res; y++) { - co[1] = (float)y / resf; + co[1] = bbmin[1] + (voxel[1] * y); for (z=0; z < res; z++) { - co[2] = (float)z / resf; + double time= PIL_check_seconds_timer(); + + co[2] = bbmin[2] + (voxel[2] * z); density = vol_get_density(&shi, co); + vol_get_scattering(re, &shi, scatter_col, co, stepsize, density); - obi->volume_precache[x*res + y*res + z*res] = density; + obi->volume_precache[x*res_2 + y*res + z] = (scatter_col[0] + scatter_col[1] + scatter_col[2]) / 3.0f; - printf("vol_light_cache[%d][%d][%d] = %f \n", x, y, z, obi->volume_precache[x*res + y*res + z*res]); + /* display progress every second */ + if(re->test_break()) + return; + if(time-lasttime>1.0f) { + char str[64]; + sprintf(str, "Precaching volume: %d%%", (int)(100.0f * (i / res_3))); + re->i.infostr= str; + re->stats_draw(&re->i); + re->i.infostr= NULL; + lasttime= time; + } + + i++; } } } @@ -730,16 +757,21 @@ void volume_precache(Render *re) { ObjectInstanceRen *obi; VolPrecache *vp; + int i=1; printf("Precaching %d volumes... \n", BLI_countlist(&re->vol_precache_obs)); for(vp= re->vol_precache_obs.first; vp; vp= vp->next) { for(obi= re->instancetable.first; obi; obi= obi->next) { - if (obi->obr == vp->obr) - printf("precaching object: %s with material: %s \n", vp->obr->ob->id.name+2, vp->ma->id.name+2); - vol_precache_objectinstance(re, obi, vp->ma); + if (obi->obr == vp->obr) { + printf("Precaching Object: %s with Material: %s \n", vp->obr->ob->id.name+2, vp->ma->id.name+2); + vol_precache_objectinstance(re, obi, vp->ma, obi->obr->boundbox[0], obi->obr->boundbox[1]); + } } } + + re->i.infostr= NULL; + re->stats_draw(&re->i); } void free_volume_precache(Render *re) @@ -747,8 +779,10 @@ void free_volume_precache(Render *re) ObjectInstanceRen *obi; for(obi= re->instancetable.first; obi; obi= obi->next) { - if (obi->volume_precache) + if (obi->volume_precache) { MEM_freeN(obi->volume_precache); + printf("freed volume precache of object: %s \n", obi->obr->ob->id.name+2); + } } BLI_freelistN(&re->vol_precache_obs); diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 63fa127824a..8ad4078b90e 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -4377,6 +4377,8 @@ static void material_panel_material_volume(Material *ma) X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shade_stepsize), 0.001, 100.0, 10, 2, "Step"); uiDefButBitS(block, TOG, MA_VOL_PRECACHESHADING, B_MATPRV, "Precache", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shadeflag), 0, 0, 0, 0, "precache"); + uiDefButS(block, NUM, B_MATPRV, "Resolution: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_precache_resolution), 0.0, 1024.0, 10, 2, "precache voxel resolution"); uiBlockEndAlign(block); yco -= YSPACE; From 9d2fc97827e2b94eb436081185108db9043ae54e Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 20 Oct 2008 07:08:06 +0000 Subject: [PATCH 033/577] New volume rendering feature: Light Cache This was a bit complicated to do, but is working pretty well now, and can make shading significantly faster to render. This option pre-calculates self-shading information into a 3d voxel grid before rendering, then uses and interpolates that data during the main rendering phase, rather than calculating shading for each sample. It's an approximation and isn't as accurate as getting the lighting directly, but in many cases it looks very similar and renders much faster. The voxel grid covers the object's 3D screen-aligned bounding box so this may not be that useful for large volume regions like a big range of cloud cover, since you'll need a lot of resolution. The render time speaks for itself here: http://mke3.net/blender/devel/rendering/volumetrics/vol_light_cache_interpolation.jpg The resolution is set in the volume panel - it's the resolution of one edge of the voxel grid. Keep in mind that the higher the resolution, the more memory needed, like in fluid sim. The memory requirements increase with the cube of the edge resolution so be careful. I might try and add a little memory calculator thing like fluid sim has there later. The voxels are interpolated using trilinear interpolation - here's a comparison image I made during testing: http://mke3.net/blender/devel/rendering/volumetrics/vol_light_cache_compare.jpg There might still be a couple of little tweaks I can do to improve the visual quality, I'll see. --- source/blender/blenkernel/intern/material.c | 1 + source/blender/blenloader/intern/readfile.c | 2 + .../render/extern/include/RE_shader_ext.h | 1 + .../blender/render/intern/source/shadeinput.c | 1 + .../blender/render/intern/source/volumetric.c | 301 ++++++++++++++---- source/blender/src/buttons_shading.c | 47 ++- 6 files changed, 275 insertions(+), 78 deletions(-) diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 3fcc76bf058..b47e4d2ebaa 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -173,6 +173,7 @@ void init_material(Material *ma) 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; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index a3e6a21dd0b..4af54832221 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7895,6 +7895,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } if (ma->vol_density_scale < 0.0001f) ma->vol_density_scale = 1.0f; + if (ma->vol_precache_resolution == 0) + ma->vol_precache_resolution = 50; } for(tex=main->tex.first; tex; tex= tex->id.next) { diff --git a/source/blender/render/extern/include/RE_shader_ext.h b/source/blender/render/extern/include/RE_shader_ext.h index 112a1e9929d..5a320da522f 100644 --- a/source/blender/render/extern/include/RE_shader_ext.h +++ b/source/blender/render/extern/include/RE_shader_ext.h @@ -100,6 +100,7 @@ typedef struct ShadeInput struct StrandRen *strand; struct ObjectInstanceRen *obi; struct ObjectRen *obr; + struct Render *re; /* link back to the Render */ int facenr; float facenor[3]; /* copy from face */ short flippednor; /* is facenor flipped? */ diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index aa11e3d75dd..6989fe66b67 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -1270,6 +1270,7 @@ void shade_input_initialize(ShadeInput *shi, RenderPart *pa, RenderLayer *rl, in shi->combinedflag= ~rl->pass_xor; shi->mat_override= rl->mat_override; shi->light_override= rl->light_override; + shi->re = &R; // shi->rl= rl; /* note shi.depth==0 means first hit, not raytracing */ diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index fc2e4a630b1..0f6e7591ece 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -51,6 +51,7 @@ #include "BKE_main.h" #include "render_types.h" +#include "renderdatabase.h" #include "pixelshading.h" #include "shading.h" #include "texture.h" @@ -61,8 +62,6 @@ extern struct Render R; /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -#define PRECACHE_RES 5 - static int vol_backface_intersect_check(Isect *is, int ob, RayFace *face) { VlakRen *vlr = (VlakRen *)face; @@ -96,7 +95,7 @@ static int vol_always_intersect_check(Isect *is, int ob, RayFace *face) /* TODO: Box or sphere intersection types could speed things up */ static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, Isect *isect, int intersect_type, int checkfunc) { - float maxsize = RE_ray_tree_max_size(R.raytree); + float maxsize = RE_ray_tree_max_size(shi->re->raytree); int intersected=0; /* TODO: use object's bounding box to calculate max size */ @@ -115,9 +114,9 @@ static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, else if (intersect_type == VOL_BOUNDS_SS) isect->faceorig= NULL; if (checkfunc==VOL_IS_BACKFACE) - intersected = RE_ray_tree_intersect_check(R.raytree, isect, vol_backface_intersect_check); + intersected = RE_ray_tree_intersect_check(shi->re->raytree, isect, vol_backface_intersect_check); else - intersected = RE_ray_tree_intersect(R.raytree, isect); + intersected = RE_ray_tree_intersect(shi->re->raytree, isect); if(intersected) { @@ -240,6 +239,82 @@ void vol_get_absorption(ShadeInput *shi, float *absorb_col, float *co) absorb_col[2] = (1.0f - absorb_col[2]) * absorption; } + +static float D(ShadeInput *shi, int rgb, int x, int y, int z) +{ + const int res = shi->mat->vol_precache_resolution; + CLAMP(x, 0, res-1); + CLAMP(y, 0, res-1); + CLAMP(y, 0, res-1); + return shi->obi->volume_precache[rgb*res*res*res + x*res*res + y*res + z]; +} + +inline float lerp(float t, float v1, float v2) { + return (1.f - t) * v1 + t * v2; +} + +/* trilinear interpolation */ +static void vol_get_precached_scattering(ShadeInput *shi, float *scatter_col, float *co) +{ + const int res = shi->mat->vol_precache_resolution; + float voxx, voxy, voxz; + int vx, vy, vz; + float dx, dy, dz; + float d00, d10, d01, d11, d0, d1, d_final; + float bbmin[3], bbmax[3], dim[3]; + int rgb; + + if (!shi->obi->volume_precache) return; + + VECCOPY(bbmin, shi->obi->obr->boundbox[0]); + VECCOPY(bbmax, shi->obi->obr->boundbox[1]); + VecSubf(dim, bbmax, bbmin); + + voxx = ((co[0] - bbmin[0]) / dim[0]) * res - 0.5f; + voxy = ((co[1] - bbmin[1]) / dim[1]) * res - 0.5f; + voxz = ((co[2] - bbmin[2]) / dim[2]) * res - 0.5f; + + vx = (int)voxx; vy = (int)voxy; vz = (int)voxz; + + dx = voxx - vx; dy = voxy - vy; dz = voxz - vz; + + for (rgb=0; rgb < 3; rgb++) { + d00 = lerp(dx, D(shi, rgb, vx, vy, vz), D(shi, rgb, vx+1, vy, vz)); + d10 = lerp(dx, D(shi, rgb, vx, vy+1, vz), D(shi, rgb, vx+1, vy+1, vz)); + d01 = lerp(dx, D(shi, rgb, vx, vy, vz+1), D(shi, rgb, vx+1, vy, vz+1)); + d11 = lerp(dx, D(shi, rgb, vx, vy+1, vz+1), D(shi, rgb, vx+1, vy+1, vz+1)); + d0 = lerp(dy, d00, d10); + d1 = lerp(dy, d01, d11); + d_final = lerp(dz, d0, d1); + + scatter_col[rgb] = d_final; + } +} + +#if 0 +/* no interpolation, not used */ +static void vol_get_precached_scattering_nearest(ShadeInput *shi, float *scatter_col, float *co) +{ + const int res = shi->mat->vol_precache_resolution; + int x,y,z; + float bbmin[3], bbmax[3], dim[3]; + + if (!shi->obi->volume_precache) return; + + VECCOPY(bbmin, shi->obi->obr->boundbox[0]); + VECCOPY(bbmax, shi->obi->obr->boundbox[1]); + VecSubf(dim, bbmax, bbmin); + + x = (int)(((co[0] - bbmin[0]) / dim[0]) * res); + y = (int)(((co[1] - bbmin[1]) / dim[1]) * res); + z = (int)(((co[2] - bbmin[2]) / dim[2]) * res); + + scatter_col[0] = shi->obi->volume_precache[0*res*res*res + x*res*res + y*res + z]; + scatter_col[1] = shi->obi->volume_precache[1*res*res*res + x*res*res + y*res + z]; + scatter_col[2] = shi->obi->volume_precache[2*res*res*res + x*res*res + y*res + z]; +} +#endif + /* Compute attenuation, otherwise known as 'optical thickness', extinction, or tau. * Used in the relationship Transmittance = e^(-attenuation) */ @@ -276,7 +351,6 @@ void vol_get_attenuation(ShadeInput *shi, float *tau, float *co, float *endco, f VecAddf(step_end, step_sta, step_vec); for (s = 0; s < nsteps; s++) { - if (s > 0) density = vol_get_density(shi, step_sta); @@ -317,9 +391,9 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * shi->osatex= 0; do_lamp_tex(lar, lv, shi, lacol, LA_TEXTURE); } - + VecMulf(lacol, visifac*lar->energy); - + if (ELEM(lar->type, LA_SUN, LA_HEMI)) VECCOPY(lv, lar->vec); VecMulf(lv, -1.0f); @@ -364,27 +438,27 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * vol_get_scattering_fac(shi, &scatter_fac, co, density); VecMulf(lacol, scatter_fac); - } /* single scattering only for now */ -void vol_get_scattering(Render *re, ShadeInput *shi, float *scatter, float *co, float stepsize, float density) +void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsize, float density) { GroupObject *go; ListBase *lights; LampRen *lar; float col[3] = {0.f, 0.f, 0.f}; - - lights= get_lights(shi); - for(go=lights->first; go; go= go->next) + int i=0; + + for(go=shi->re->lights.first; go; go= go->next) { float lacol[3] = {0.f, 0.f, 0.f}; + i++; + lar= go->lampren; if (lar) { - vol_shade_one_lamp(shi, co, lar, lacol, stepsize, density); - + VecMulf(lacol, density); VecAddf(col, col, lacol); @@ -415,7 +489,6 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float VecMulVecf(radiance, tr, col); tr[0] = tr[1] = tr[2] = 1.0f; - /* ray marching */ nsteps = (int)ceil(VecLenf(co, endco) / stepsize); @@ -447,23 +520,12 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float /* incoming light via emission or scattering (additive) */ vol_get_emission(shi, emit_col, step_mid, density); - if ((shi->mat->vol_shadeflag & MA_VOL_PRECACHESHADING) && shi->obi->volume_precache) { - const int res = shi->mat->vol_precache_resolution; - int x,y,z; - float bbmin[3], bbmax[3], dim[3]; - - VECCOPY(bbmin, shi->obi->obr->boundbox[0]); - VECCOPY(bbmax, shi->obi->obr->boundbox[1]); - VecSubf(dim, bbmax, bbmin); - - x = (int)(((step_mid[0] - bbmin[0]) / dim[0]) * res); - y = (int)(((step_mid[1] - bbmin[1]) / dim[1]) * res); - z = (int)(((step_mid[2] - bbmin[2]) / dim[2]) * res); - - scatter_col[0] = scatter_col[1] = scatter_col[2] = shi->obi->volume_precache[x*res*res + y*res + z]; - } - else - vol_get_scattering(&R, shi, scatter_col, step_mid, stepsize, density); + + if ((shi->mat->vol_shadeflag & MA_VOL_PRECACHESHADING) && + (shi->mat->vol_shadeflag & MA_VOL_ATTENUATED)) { + vol_get_precached_scattering(shi, scatter_col, step_mid); + } else + vol_get_scattering(shi, scatter_col, step_mid, stepsize, density); VecAddf(d_radiance, emit_col, scatter_col); @@ -544,7 +606,7 @@ static void shade_intersection(ShadeInput *shi, float *col, Isect *is) static void vol_trace_behind(ShadeInput *shi, VlakRen *vlr, float *co, float *col) { Isect isect; - float maxsize = RE_ray_tree_max_size(R.raytree); + float maxsize = RE_ray_tree_max_size(shi->re->raytree); VECCOPY(isect.start, co); isect.end[0] = isect.start[0] + shi->view[0] * maxsize; @@ -560,7 +622,7 @@ static void vol_trace_behind(ShadeInput *shi, VlakRen *vlr, float *co, float *co isect.lay= -1; /* check to see if there's anything behind the volume, otherwise shade the sky */ - if(RE_ray_tree_intersect(R.raytree, &isect)) { + if(RE_ray_tree_intersect(shi->re->raytree, &isect)) { shade_intersection(shi, col, &isect); } else { shadeSkyView(col, co, shi->view, NULL); @@ -568,6 +630,7 @@ static void vol_trace_behind(ShadeInput *shi, VlakRen *vlr, float *co, float *co } } +/* the main entry point for volume shading */ void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr) { float hitco[3], col[4] = {0.f,0.f,0.f,0.f}; @@ -629,6 +692,8 @@ void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr) } } +/* Traces a shadow through the object, + * pretty much gets the transmission over a ray path */ void volume_trace_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct Isect *last_is) { float hitco[3]; @@ -678,26 +743,125 @@ void volume_trace_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct shr->combined[2] = 0.0f; shr->combined[3] = shr->alpha = 0.0f; } - } + +/* Recursive test for intersections, from a point inside the mesh, to outside + * Number of intersections (depth) determine if a point is inside or outside the mesh */ +int intersect_outside_volume(RayTree *tree, Isect *isect, float *offset, int limit, int depth) +{ + if (limit == 0) return depth; + + if (RE_ray_tree_intersect(tree, isect)) { + float hitco[3]; + + hitco[0] = isect->start[0] + isect->labda*isect->vec[0]; + hitco[1] = isect->start[1] + isect->labda*isect->vec[1]; + hitco[2] = isect->start[2] + isect->labda*isect->vec[2]; + VecAddf(isect->start, hitco, offset); + + return intersect_outside_volume(tree, isect, offset, limit-1, depth+1); + } else { + return depth; + } +} + +/* Uses ray tracing to check if a point is inside or outside an ObjectInstanceRen */ +int point_inside_obi(RayTree *tree, ObjectInstanceRen *obi, float *co) +{ + float maxsize = RE_ray_tree_max_size(tree); + int intersected; + Isect isect; + float vec[3] = {0.0f,0.0f,1.0f}; + int final_depth=0, depth=0, limit=20; + + /* set up the isect */ + memset(&isect, 0, sizeof(isect)); + VECCOPY(isect.start, co); + isect.end[0] = co[0] + vec[0] * maxsize; + isect.end[1] = co[1] + vec[1] * maxsize; + isect.end[2] = co[2] + vec[2] * maxsize; + + /* and give it a little offset to prevent self-intersections */ + VecMulf(vec, 1e-5); + VecAddf(isect.start, isect.start, vec); + + isect.mode= RE_RAY_MIRROR; + isect.face_last= NULL; + isect.lay= -1; + + final_depth = intersect_outside_volume(tree, &isect, vec, limit, depth); + + /* even number of intersections: point is outside + * odd number: point is inside */ + if (final_depth % 2 == 0) return 0; + else return 1; +} + +static int inside_check_func(Isect *is, int ob, RayFace *face) +{ + return 1; +} +static void vlr_face_coords(RayFace *face, float **v1, float **v2, float **v3, float **v4) +{ + VlakRen *vlr= (VlakRen*)face; + + *v1 = (vlr->v1)? vlr->v1->co: NULL; + *v2 = (vlr->v2)? vlr->v2->co: NULL; + *v3 = (vlr->v3)? vlr->v3->co: NULL; + *v4 = (vlr->v4)? vlr->v4->co: NULL; +} + +RayTree *create_raytree_obi(ObjectInstanceRen *obi, float *bbmin, float *bbmax) +{ + int v; + VlakRen *vlr= NULL; + + /* create empty raytree */ + RayTree *tree = RE_ray_tree_create(64, obi->obr->totvlak, bbmin, bbmax, + vlr_face_coords, inside_check_func, NULL, NULL); + + /* fill it with faces */ + for(v=0; vobr->totvlak; v++) { + if((v & 255)==0) + vlr= obi->obr->vlaknodes[v>>8].vlak; + else + vlr++; + + RE_ray_tree_add_face(tree, 0, vlr); + } + + RE_ray_tree_done(tree); +} + +/* Precache a volume into a 3D voxel grid. + * The voxel grid is stored in the ObjectInstanceRen, + * in camera space, aligned with the ObjectRen's bounding box. + * Resolution is defined by the user. + */ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *ma, float *bbmin, float *bbmax) { int x, y, z; float co[3], voxel[3], scatter_col[3]; ShadeInput shi; + float view[3] = {0.0,0.0,1.0}; float density; float stepsize; - float resf; - int res_2; - float res_3; + float resf, res_3f; + int res_2, res_3; float i = 1.0f; - double lasttime= PIL_check_seconds_timer(); + double time, lasttime= PIL_check_seconds_timer(); const int res = ma->vol_precache_resolution; + /* create a raytree with just the faces of the instanced ObjectRen, + * used for checking if the cached point is inside or outside. */ + RayTree *tree = create_raytree_obi(obi, bbmin, bbmax); + if (!tree) return; + + /* Need a shadeinput to calculate scattering */ memset(&shi, 0, sizeof(ShadeInput)); shi.depth= 1; shi.mask= 1; @@ -707,18 +871,28 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m shi.har= shi.mat->har; shi.obi= obi; shi.obr= obi->obr; + shi.lay = re->scene->lay; + shi.re = re; + VECCOPY(shi.view, view); stepsize = vol_get_stepsize(&shi, STEPSIZE_VIEW); - resf = (float) res; + resf = (float)res; res_2 = res*res; res_3 = res*res*res; + res_3f = (float)res_3; VecSubf(voxel, bbmax, bbmin); VecMulf(voxel, 1.0f/res); - obi->volume_precache = MEM_mallocN(sizeof(float)*res*res*res, "volume light cache"); + obi->volume_precache = MEM_callocN(sizeof(float)*res_3*3, "volume light cache"); + /* Iterate over the 3d voxel grid, and fill the voxels with scattering information + * + * It's stored in memory as 3 big float grids next to each other, one for each RGB channel. + * I'm guessing the memory alignment may work out better this way for the purposes + * of doing linear interpolation, but I haven't actually tested this theory! :) + */ for (x=0; x < res; x++) { co[0] = bbmin[0] + (voxel[0] * x); @@ -726,47 +900,54 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m co[1] = bbmin[1] + (voxel[1] * y); for (z=0; z < res; z++) { - double time= PIL_check_seconds_timer(); - co[2] = bbmin[2] + (voxel[2] * z); - - density = vol_get_density(&shi, co); - vol_get_scattering(re, &shi, scatter_col, co, stepsize, density); - obi->volume_precache[x*res_2 + y*res + z] = (scatter_col[0] + scatter_col[1] + scatter_col[2]) / 3.0f; - + time= PIL_check_seconds_timer(); + i++; + /* display progress every second */ if(re->test_break()) return; if(time-lasttime>1.0f) { char str[64]; - sprintf(str, "Precaching volume: %d%%", (int)(100.0f * (i / res_3))); + sprintf(str, "Precaching volume: %d%%", (int)(100.0f * (i / res_3f))); re->i.infostr= str; re->stats_draw(&re->i); re->i.infostr= NULL; lasttime= time; } - i++; + /* don't bother if the point is not inside the volume mesh */ + if (!point_inside_obi(tree, obi, co)) + continue; + + density = vol_get_density(&shi, co); + vol_get_scattering(&shi, scatter_col, co, stepsize, density); + + obi->volume_precache[0*res_3 + x*res_2 + y*res + z] = scatter_col[0]; + obi->volume_precache[1*res_3 + x*res_2 + y*res + z] = scatter_col[1]; + obi->volume_precache[2*res_3 + x*res_2 + y*res + z] = scatter_col[2]; } } } + + if(tree) { + RE_ray_tree_free(tree); + tree= NULL; + } } +/* loop through all objects (and their associated materials) + * marked for pre-caching in convertblender.c, and pre-cache them */ void volume_precache(Render *re) { ObjectInstanceRen *obi; VolPrecache *vp; - int i=1; - - printf("Precaching %d volumes... \n", BLI_countlist(&re->vol_precache_obs)); - + for(vp= re->vol_precache_obs.first; vp; vp= vp->next) { for(obi= re->instancetable.first; obi; obi= obi->next) { - if (obi->obr == vp->obr) { - printf("Precaching Object: %s with Material: %s \n", vp->obr->ob->id.name+2, vp->ma->id.name+2); + if (obi->obr == vp->obr) vol_precache_objectinstance(re, obi, vp->ma, obi->obr->boundbox[0], obi->obr->boundbox[1]); - } } } @@ -779,10 +960,8 @@ void free_volume_precache(Render *re) ObjectInstanceRen *obi; for(obi= re->instancetable.first; obi; obi= obi->next) { - if (obi->volume_precache) { + if (obi->volume_precache) MEM_freeN(obi->volume_precache); - printf("freed volume precache of object: %s \n", obi->obr->ob->id.name+2); - } } BLI_freelistN(&re->vol_precache_obs); diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 8ad4078b90e..72a396d63be 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -4357,7 +4357,7 @@ static void material_panel_material_volume(Material *ma) short yco=PANEL_YMAX; block= uiNewBlock(&curarea->uiblocks, "material_panel_material_volume", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Volume", "Material", PANELX, PANELY, PANELW, PANELH)==0) return; + if(uiNewPanel(curarea, block, "Volume", "Material", PANELX, PANELY, PANELW, PANELH+40)==0) return; uiSetButLock(ma->id.lib!=NULL, ERROR_LIBDATA_MESSAGE); @@ -4365,32 +4365,28 @@ static void material_panel_material_volume(Material *ma) uiDefButF(block, NUM, B_MATPRV, "Step Size: ", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_stepsize), 0.001, 100.0, 10, 2, "Ray marching step size"); uiDefButS(block, MENU, B_TEXREDR_PRV, "Step Size Calculation %t|Randomized %x0|Constant %x1", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &ma->vol_stepsize_type, 0.0, 0.0, 0, 0, "Step size calculation, replace banding with jittering"); + X2CLM1, yco-=BUTH, BUTW2, BUTH, &ma->vol_stepsize_type, 0.0, 0.0, 0, 0, "Step size calculation, randomized replaces banding with jittering"); uiBlockEndAlign(block); yco -= YSPACE; - + uiBlockBeginAlign(block); uiDefButBitS(block, TOG, MA_VOL_ATTENUATED, B_MATPRV, "Self Shading", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shadeflag), 0, 0, 0, 0, "Uses absorption for light attenuation"); uiDefButF(block, NUM, B_MATPRV, "Step Size: ", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shade_stepsize), 0.001, 100.0, 10, 2, "Step"); - uiDefButBitS(block, TOG, MA_VOL_PRECACHESHADING, B_MATPRV, "Precache", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shadeflag), 0, 0, 0, 0, "precache"); - uiDefButS(block, NUM, B_MATPRV, "Resolution: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_precache_resolution), 0.0, 1024.0, 10, 2, "precache voxel resolution"); uiBlockEndAlign(block); yco -= YSPACE; - uiBlockBeginAlign(block); - uiDefButS(block, MENU, B_TEXREDR_PRV, "Scattering Direction %t|Isotropic %x0|Mie Hazy %x1|Mie Murky %x2|Rayleigh %x3|Henyey-Greenstein %x4|Schlick %x5", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &ma->vol_phasefunc_type, 0.0, 0.0, 0, 0, "Scattering Direction (Phase Function)"); - if (ELEM(ma->vol_phasefunc_type, MA_VOL_PH_HG, MA_VOL_PH_SCHLICK)) { - uiDefButF(block, NUM, B_MATPRV, "Asymmetry: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_phasefunc_g), -1.0, 1.0, 0, 0, "> 0 is forward scattering, < 0 is back scattering"); + if (ma->vol_shadeflag & MA_VOL_ATTENUATED) { + uiBlockBeginAlign(block); + uiDefButBitS(block, TOG, MA_VOL_PRECACHESHADING, B_MATPRV, "Light Cache", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shadeflag), 0, 0, 0, 0, "Pre-cache the shading information into a voxel grid"); + uiDefButS(block, NUM, B_MATPRV, "Resolution: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_precache_resolution), 0.0, 1024.0, 10, 2, "Resolution of the voxel grid, low resolutions are faster, high resolutions use more memory (res ^3)"); + uiBlockEndAlign(block); } - uiBlockEndAlign(block); /*uiDefButBitS(block, TOG, MA_VOL_RECVSHADOW, B_MATPRV, "Receive Shadows", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shadeflag), 0, 0, 0, 0, "Receive shadows from external objects"); @@ -4409,7 +4405,7 @@ static void material_panel_material_volume(Material *ma) uiBlockBeginAlign(block); uiDefButF(block, NUM, B_MATPRV, "Absorption: ", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->vol_absorption), 0.0, 100.0, 10, 0, "Multiplier for absorption"); + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->vol_absorption), 0.0, 100.0, 10, 0, "Amount of light absorbed by the volume"); uiDefButF(block, COL, B_MATPRV, "", X2CLM2, yco-=BUTH, BUTW2, BUTH, ma->vol_absorption_col, 0, 0, 0, B_MATCOL, ""); uiBlockEndAlign(block); @@ -4418,7 +4414,7 @@ static void material_panel_material_volume(Material *ma) uiBlockBeginAlign(block); uiDefButF(block, NUMSLI, B_MATPRV, "Emit: ", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->emit), 0.0, 2.0, 0, 0, "Emission component"); + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->emit), 0.0, 2.0, 0, 0, "Amount of light emitted from the volume"); uiDefButF(block, COL, B_MATPRV, "", X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->r), 0, 0, 0, B_MATCOL, ""); uiBlockEndAlign(block); @@ -4426,7 +4422,24 @@ static void material_panel_material_volume(Material *ma) yco -= YSPACE; uiDefButF(block, NUM, B_MATPRV, "Scattering: ", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->vol_scattering), 0.0, 100.0, 10, 0, "Multiplier for scattering"); + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->vol_scattering), 0.0, 100.0, 10, 0, "Amount of light scattered through the volume from lamps"); + + yco -= YSPACE; + + uiBlockBeginAlign(block); + uiDefButS(block, MENU, B_TEXREDR_PRV, "Scattering Direction %t|Isotropic %x0|Mie Hazy %x1|Mie Murky %x2|Rayleigh %x3|Henyey-Greenstein %x4|Schlick %x5", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &ma->vol_phasefunc_type, 0.0, 0.0, 0, 0, "Scattering Direction (Phase Function)"); + if (ELEM(ma->vol_phasefunc_type, MA_VOL_PH_HG, MA_VOL_PH_SCHLICK)) { + uiDefButF(block, NUM, B_MATPRV, "Asymmetry: ", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(ma->vol_phasefunc_g), -1.0, 1.0, 0, 0, "> 0 is forward scattering, < 0 is back scattering"); + uiBlockEndAlign(block); + } else { + uiBlockEndAlign(block); + /* spacer */ + uiDefBut(block, LABEL, B_NOP, "", + X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + } + } static void material_panel_nodes(Material *ma) From 07f072457da87b1940970831422d3569ef069b7a Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 20 Oct 2008 23:12:42 +0000 Subject: [PATCH 034/577] * fix for crash after latest light cache commit --- source/blender/render/intern/source/convertblender.c | 3 ++- source/blender/render/intern/source/volumetric.c | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index c58946bb64b..74b03d1082f 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -4927,7 +4927,8 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view) make_sss_tree(re); if(!re->test_break()) - volume_precache(re); + if(re->r.mode & R_RAYTRACE) + volume_precache(re); } if(re->test_break()) diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 0f6e7591ece..6004442e4bc 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -253,6 +253,12 @@ inline float lerp(float t, float v1, float v2) { return (1.f - t) * v1 + t * v2; } +inline float do_lerp(float t, float a, float b) { + if (a > 0.f && b > 0.f) return lerp(t, a, b); + else if (a < 0.f) return b; + else if (b < 0.f) return a; +} + /* trilinear interpolation */ static void vol_get_precached_scattering(ShadeInput *shi, float *scatter_col, float *co) { @@ -587,6 +593,7 @@ static void shade_intersection(ShadeInput *shi, float *col, Isect *is) shi_new.combinedflag= 0xFFFFFF; /* ray trace does all options */ shi_new.light_override= shi->light_override; shi_new.mat_override= shi->mat_override; + shi_new.re = shi->re; VECCOPY(shi_new.camera_co, is->start); @@ -920,7 +927,7 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m /* don't bother if the point is not inside the volume mesh */ if (!point_inside_obi(tree, obi, co)) continue; - + density = vol_get_density(&shi, co); vol_get_scattering(&shi, scatter_col, co, stepsize, density); From d335c2dfcf95e120ebc5e5f84b0c960cb9ca14ae Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 21 Oct 2008 02:04:29 +0000 Subject: [PATCH 035/577] * fixed a memory leak that was happening during preview render --- source/blender/render/intern/source/volumetric.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 6004442e4bc..c8cead3e8c7 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -913,8 +913,13 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m i++; /* display progress every second */ - if(re->test_break()) + if(re->test_break()) { + if(tree) { + RE_ray_tree_free(tree); + tree= NULL; + } return; + } if(time-lasttime>1.0f) { char str[64]; sprintf(str, "Precaching volume: %d%%", (int)(100.0f * (i / res_3f))); @@ -937,11 +942,13 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m } } } - + if(tree) { RE_ray_tree_free(tree); tree= NULL; } + + } /* loop through all objects (and their associated materials) From 97a7b05068254543615ff274d77e66aea356df28 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 21 Oct 2008 06:10:36 +0000 Subject: [PATCH 036/577] fixed a crash in volume shadows --- source/blender/render/intern/source/rayshade.c | 2 ++ source/blender/render/intern/source/volumetric.c | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index d06bbcf3300..7e9a5c9abb3 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -467,6 +467,7 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, flo //shi.do_preview= 0; // memset above, so dont need this shi.light_override= origshi->light_override; shi.mat_override= origshi->mat_override; + shi.re = origshi->re; memset(&shr, 0, sizeof(ShadeResult)); @@ -1300,6 +1301,7 @@ void ray_trace_shadow_tra(Isect *is, int depth, int traflag) shi.depth= 1; /* only used to indicate tracing */ shi.mask= 1; + shi.re = &R; /*shi.osatex= 0; shi.thread= shi.sample= 0; diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index c8cead3e8c7..82149f38176 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -297,8 +297,8 @@ static void vol_get_precached_scattering(ShadeInput *shi, float *scatter_col, fl } } -#if 0 -/* no interpolation, not used */ + +/* no interpolation */ static void vol_get_precached_scattering_nearest(ShadeInput *shi, float *scatter_col, float *co) { const int res = shi->mat->vol_precache_resolution; @@ -319,7 +319,7 @@ static void vol_get_precached_scattering_nearest(ShadeInput *shi, float *scatter scatter_col[1] = shi->obi->volume_precache[1*res*res*res + x*res*res + y*res + z]; scatter_col[2] = shi->obi->volume_precache[2*res*res*res + x*res*res + y*res + z]; } -#endif + /* Compute attenuation, otherwise known as 'optical thickness', extinction, or tau. * Used in the relationship Transmittance = e^(-attenuation) @@ -529,7 +529,10 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float if ((shi->mat->vol_shadeflag & MA_VOL_PRECACHESHADING) && (shi->mat->vol_shadeflag & MA_VOL_ATTENUATED)) { - vol_get_precached_scattering(shi, scatter_col, step_mid); + if (G.rt==0) + vol_get_precached_scattering(shi, scatter_col, step_mid); + else + vol_get_precached_scattering_nearest(shi, scatter_col, step_mid); } else vol_get_scattering(shi, scatter_col, step_mid, stepsize, density); From b12d9bfa9caf6d99ca2e19b9cb456d037c17f049 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 21 Oct 2008 08:21:36 +0000 Subject: [PATCH 037/577] * reimplemented some things, hopefully may fix some problems zanqdo was having --- .../render/extern/include/RE_shader_ext.h | 1 - source/blender/render/intern/source/rayshade.c | 2 -- source/blender/render/intern/source/shadeinput.c | 1 - source/blender/render/intern/source/volumetric.c | 16 ++++++++-------- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/source/blender/render/extern/include/RE_shader_ext.h b/source/blender/render/extern/include/RE_shader_ext.h index 5a320da522f..112a1e9929d 100644 --- a/source/blender/render/extern/include/RE_shader_ext.h +++ b/source/blender/render/extern/include/RE_shader_ext.h @@ -100,7 +100,6 @@ typedef struct ShadeInput struct StrandRen *strand; struct ObjectInstanceRen *obi; struct ObjectRen *obr; - struct Render *re; /* link back to the Render */ int facenr; float facenor[3]; /* copy from face */ short flippednor; /* is facenor flipped? */ diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index 7e9a5c9abb3..d06bbcf3300 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -467,7 +467,6 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, flo //shi.do_preview= 0; // memset above, so dont need this shi.light_override= origshi->light_override; shi.mat_override= origshi->mat_override; - shi.re = origshi->re; memset(&shr, 0, sizeof(ShadeResult)); @@ -1301,7 +1300,6 @@ void ray_trace_shadow_tra(Isect *is, int depth, int traflag) shi.depth= 1; /* only used to indicate tracing */ shi.mask= 1; - shi.re = &R; /*shi.osatex= 0; shi.thread= shi.sample= 0; diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index 6989fe66b67..aa11e3d75dd 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -1270,7 +1270,6 @@ void shade_input_initialize(ShadeInput *shi, RenderPart *pa, RenderLayer *rl, in shi->combinedflag= ~rl->pass_xor; shi->mat_override= rl->mat_override; shi->light_override= rl->light_override; - shi->re = &R; // shi->rl= rl; /* note shi.depth==0 means first hit, not raytracing */ diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 82149f38176..ebaf70f1cfe 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -95,7 +95,7 @@ static int vol_always_intersect_check(Isect *is, int ob, RayFace *face) /* TODO: Box or sphere intersection types could speed things up */ static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, Isect *isect, int intersect_type, int checkfunc) { - float maxsize = RE_ray_tree_max_size(shi->re->raytree); + float maxsize = RE_ray_tree_max_size(R.raytree); int intersected=0; /* TODO: use object's bounding box to calculate max size */ @@ -114,9 +114,9 @@ static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, else if (intersect_type == VOL_BOUNDS_SS) isect->faceorig= NULL; if (checkfunc==VOL_IS_BACKFACE) - intersected = RE_ray_tree_intersect_check(shi->re->raytree, isect, vol_backface_intersect_check); + intersected = RE_ray_tree_intersect_check(R.raytree, isect, vol_backface_intersect_check); else - intersected = RE_ray_tree_intersect(shi->re->raytree, isect); + intersected = RE_ray_tree_intersect(R.raytree, isect); if(intersected) { @@ -455,7 +455,7 @@ void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsi float col[3] = {0.f, 0.f, 0.f}; int i=0; - for(go=shi->re->lights.first; go; go= go->next) + for(go=R.lights.first; go; go= go->next) { float lacol[3] = {0.f, 0.f, 0.f}; @@ -596,7 +596,6 @@ static void shade_intersection(ShadeInput *shi, float *col, Isect *is) shi_new.combinedflag= 0xFFFFFF; /* ray trace does all options */ shi_new.light_override= shi->light_override; shi_new.mat_override= shi->mat_override; - shi_new.re = shi->re; VECCOPY(shi_new.camera_co, is->start); @@ -616,7 +615,7 @@ static void shade_intersection(ShadeInput *shi, float *col, Isect *is) static void vol_trace_behind(ShadeInput *shi, VlakRen *vlr, float *co, float *col) { Isect isect; - float maxsize = RE_ray_tree_max_size(shi->re->raytree); + float maxsize = RE_ray_tree_max_size(R.raytree); VECCOPY(isect.start, co); isect.end[0] = isect.start[0] + shi->view[0] * maxsize; @@ -632,7 +631,7 @@ static void vol_trace_behind(ShadeInput *shi, VlakRen *vlr, float *co, float *co isect.lay= -1; /* check to see if there's anything behind the volume, otherwise shade the sky */ - if(RE_ray_tree_intersect(shi->re->raytree, &isect)) { + if(RE_ray_tree_intersect(R.raytree, &isect)) { shade_intersection(shi, col, &isect); } else { shadeSkyView(col, co, shi->view, NULL); @@ -865,6 +864,8 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m float i = 1.0f; double time, lasttime= PIL_check_seconds_timer(); const int res = ma->vol_precache_resolution; + + R = *re; /* create a raytree with just the faces of the instanced ObjectRen, * used for checking if the cached point is inside or outside. */ @@ -882,7 +883,6 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m shi.obi= obi; shi.obr= obi->obr; shi.lay = re->scene->lay; - shi.re = re; VECCOPY(shi.view, view); stepsize = vol_get_stepsize(&shi, STEPSIZE_VIEW); From 094fda8cd9c1e6f5f452bf6c47ad53bebb8dd4e6 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 22 Oct 2008 00:09:12 +0000 Subject: [PATCH 038/577] * Fixed a crash with using light cache on a plane (which doesn't really make sense, but shouldn't crash at least) --- source/blender/render/intern/source/volumetric.c | 7 +++++-- source/blender/src/drawnode.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index ebaf70f1cfe..cd35bc027d1 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -245,7 +245,7 @@ static float D(ShadeInput *shi, int rgb, int x, int y, int z) const int res = shi->mat->vol_precache_resolution; CLAMP(x, 0, res-1); CLAMP(y, 0, res-1); - CLAMP(y, 0, res-1); + CLAMP(z, 0, res-1); return shi->obi->volume_precache[rgb*res*res*res + x*res*res + y*res + z]; } @@ -864,12 +864,13 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m float i = 1.0f; double time, lasttime= PIL_check_seconds_timer(); const int res = ma->vol_precache_resolution; + RayTree *tree; R = *re; /* create a raytree with just the faces of the instanced ObjectRen, * used for checking if the cached point is inside or outside. */ - RayTree *tree = create_raytree_obi(obi, bbmin, bbmax); + tree = create_raytree_obi(obi, bbmin, bbmax); if (!tree) return; /* Need a shadeinput to calculate scattering */ @@ -893,6 +894,8 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m res_3f = (float)res_3; VecSubf(voxel, bbmax, bbmin); + if ((voxel[0] < FLT_EPSILON) || (voxel[1] < FLT_EPSILON) || (voxel[2] < FLT_EPSILON)) + return; VecMulf(voxel, 1.0f/res); obi->volume_precache = MEM_callocN(sizeof(float)*res_3*3, "volume light cache"); diff --git a/source/blender/src/drawnode.c b/source/blender/src/drawnode.c index 618eca15ac6..7decec3f0e3 100644 --- a/source/blender/src/drawnode.c +++ b/source/blender/src/drawnode.c @@ -1550,7 +1550,7 @@ static int node_composit_buts_vecblur(uiBlock *block, bNodeTree *ntree, bNode *n &nbd->maxspeed, 0, 1024, 0, 0, "If not zero, maximum speed in pixels"); uiDefButF(block, NUM, B_NODE_EXEC+node->nr, "BlurFac:", butr->xmin, dy+19, dx, 19, - &nbd->fac, 0.0f, 2.0f, 10, 2, "Scaling factor for motion vectors, actually 'shutter speed' in frames"); + &nbd->fac, 0.0f, 10.0f, 10, 2, "Scaling factor for motion vectors, actually 'shutter speed' in frames"); uiDefButS(block, TOG, B_NODE_EXEC+node->nr, "Curved", butr->xmin, dy, dx, 19, &nbd->curved, 0.0f, 2.0f, 10, 2, "Interpolate between frames in a bezier curve, rather than linearly"); From 6f656f6482adfa93b010b364cac41a449b8fdc91 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 22 Oct 2008 00:26:19 +0000 Subject: [PATCH 039/577] fix for a compile error with msvc --- source/blender/render/intern/source/volumetric.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index cd35bc027d1..95cd9e5588b 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -56,6 +56,10 @@ #include "shading.h" #include "texture.h" +#if defined( _MSC_VER ) && !defined( __cplusplus ) +# define inline __inline +#endif // defined( _MSC_VER ) && !defined( __cplusplus ) + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ /* defined in pipeline.c, is hardcopy of active dynamic allocated Render */ /* only to be used here in this file, it's for speed */ From 652e4b5225cc88d7bc74dfe092d60a8363ef3189 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 22 Oct 2008 01:31:46 +0000 Subject: [PATCH 040/577] Point Density: Replaced 'Sharp' falloff with 'Soft'. This falloff type has a variable softness, and can get some quite smooth results. It can be useful to get smooth transitions in density when you're using particles on a large scale: http://mke3.net/blender/devel/rendering/volumetrics/pd_falloff_soft.jpg Also removed 'angular velocity' turbulence source - it wasn't doing anything useful atm --- source/blender/blenkernel/intern/texture.c | 1 + source/blender/blenloader/intern/readfile.c | 2 ++ source/blender/makesdna/DNA_texture_types.h | 8 ++++---- .../render/intern/source/pointdensity.c | 19 ++++++++++--------- source/blender/src/buttons_shading.c | 12 +++++++++--- 5 files changed, 26 insertions(+), 16 deletions(-) diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 33b824623fa..6f58e054f69 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -875,6 +875,7 @@ PointDensity *BKE_add_pointdensity(void) pd= MEM_callocN(sizeof(PointDensity), "pointdensity"); 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; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 4af54832221..8f005e99053 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7908,6 +7908,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) 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; } } diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index 95f61e73c79..c51311bb621 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -131,9 +131,10 @@ typedef struct PointDensity { short flag; short falloff_type; + float falloff_softness; float radius; short source; - short pdpad[3]; + short pdpad; struct Object *object; /* for 'Object' or 'Particle system' type - source object */ short psys_cache_space; /* cache points in worldspace, object space, ... ? */ @@ -425,7 +426,7 @@ typedef struct TexMapping { /* falloff_type */ #define TEX_PD_FALLOFF_STD 0 #define TEX_PD_FALLOFF_SMOOTH 1 -#define TEX_PD_FALLOFF_SHARP 2 +#define TEX_PD_FALLOFF_SOFT 2 #define TEX_PD_FALLOFF_CONSTANT 3 #define TEX_PD_FALLOFF_ROOT 4 @@ -441,8 +442,7 @@ typedef struct TexMapping { /* noise_influence */ #define TEX_PD_NOISE_STATIC 0 #define TEX_PD_NOISE_VEL 1 -#define TEX_PD_NOISE_ANGVEL 2 -#define TEX_PD_NOISE_TIME 3 +#define TEX_PD_NOISE_TIME 2 #endif diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index f7c6767fcd8..5f2c6153384 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -107,10 +107,6 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa pd->point_data[i*3 + 0] = state.vel[0]; pd->point_data[i*3 + 1] = state.vel[1]; pd->point_data[i*3 + 2] = state.vel[2]; - } else if (pd->noise_influence == TEX_PD_NOISE_ANGVEL) { - pd->point_data[i*3 + 0] = state.ave[0]; - pd->point_data[i*3 + 1] = state.ave[1]; - pd->point_data[i*3 + 2] = state.ave[2]; } } } @@ -252,6 +248,7 @@ typedef struct PointDensityRangeData float squared_radius; float *point_data; float *vec; + float softness; short falloff_type; } PointDensityRangeData; @@ -265,8 +262,8 @@ void accum_density(void *userdata, int index, float squared_dist) density = dist; else if (pdr->falloff_type == TEX_PD_FALLOFF_SMOOTH) density = 3.0f*dist*dist - 2.0f*dist*dist*dist; - else if (pdr->falloff_type == TEX_PD_FALLOFF_SHARP) - density = dist*dist; + else if (pdr->falloff_type == TEX_PD_FALLOFF_SOFT) + density = pow(dist, pdr->softness); else if (pdr->falloff_type == TEX_PD_FALLOFF_CONSTANT) density = pdr->squared_radius; else if (pdr->falloff_type == TEX_PD_FALLOFF_ROOT) @@ -302,6 +299,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) pdr.point_data = pd->point_data; pdr.falloff_type = pd->falloff_type; pdr.vec = vec; + pdr.softness = pd->falloff_softness; noise_fac = pd->noise_fac * 0.5f; /* better default */ if (pd->flag & TEX_PD_TURBULENCE) { @@ -329,13 +327,16 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) texres->tin = density; - //texres->tr = vec[0]; - //texres->tg = vec[1]; - //texres->tb = vec[2]; + + + BRICONT; return TEX_INT; /* + texres->tr = vec[0]; + texres->tg = vec[1]; + texres->tb = vec[2]; BRICONTRGB; texres->ta = 1.0; diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 72a396d63be..7e4298b4b6b 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -738,7 +738,7 @@ static void texture_panel_pointdensity(Tex *tex) short yco=PANEL_YMAX; block= uiNewBlock(&curarea->uiblocks, "texture_panel_pointdensity", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Point Density", "Texture", PANELX, PANELY, PANELW, PANELH)==0) return; + if(uiNewPanel(curarea, block, "Point Density", "Texture", PANELX, PANELY, PANELW, PANELH+25)==0) return; uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE); if(tex->pd==NULL) { @@ -758,8 +758,14 @@ static void texture_panel_pointdensity(Tex *tex) uiDefBut(block, LABEL, B_NOP, "Falloff:", X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); - uiDefButS(block, MENU, B_REDR, "Standard %x0|Smooth %x1|Sharp %x2|Constant %x3|Root %x4", + uiBlockBeginAlign(block); + uiDefButS(block, MENU, B_REDR, "Standard %x0|Smooth %x1|Soft %x2|Constant %x3|Root %x4", X2CLM1, yco-=BUTH, BUTW2, BUTH, &pd->falloff_type, 0.0, 0.0, 0, 0, "Falloff type"); + if (pd->falloff_type == TEX_PD_FALLOFF_SOFT) { + uiDefButF(block, NUM, B_REDR, "Softness: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->falloff_softness), 1.0, 1024.0, 10, 2, "The intensity of the falloff"); + } + uiBlockEndAlign(block); yco -= YSPACE; @@ -782,7 +788,7 @@ static void texture_panel_pointdensity(Tex *tex) yco -= YSPACE; if (pd->source == TEX_PD_PSYS) { - uiDefButS(block, MENU, B_REDR, "Noise Influence %t|Static %x0|Velocity %x1|Angular Velocity %x2", + uiDefButS(block, MENU, B_REDR, "Noise Influence %t|Static %x0|Velocity %x1", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_influence), 0.0, 0.0, 0, 0, "Noise Influence"); } } From febcbdcfcd5e7f7a480f7980410eec853ef04a5e Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 22 Oct 2008 02:59:33 +0000 Subject: [PATCH 041/577] Tweaked rendering inside a volume to always return alpha 1.0. This fixes an issue which darkened the render from inside a volume with sky or premul on. Still need to find a good way to get an alpha value back into the shader (for compositing etc) without getting the render distorted by premul. --- source/blender/render/intern/source/volumetric.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 95cd9e5588b..4ff6f5aea41 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -664,7 +664,8 @@ void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr) shr->combined[1] = col[1]; shr->combined[2] = col[2]; - if (col[3] > 1.0f) col[3] = 1.0f; + //if (col[3] > 1.0f) + col[3] = 1.0f; shr->combined[3] = col[3]; shr->alpha = col[3]; @@ -858,7 +859,7 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m float co[3], voxel[3], scatter_col[3]; ShadeInput shi; - float view[3] = {0.0,0.0,1.0}; + float view[3] = {0.0,0.0,-1.0}; float density; float stepsize; From 876368d859593c8ad152f94ea06214bacf516b0d Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 22 Oct 2008 05:24:41 +0000 Subject: [PATCH 042/577] * fix for point density - particle systems weren't being deformed by lattices --- source/blender/render/intern/source/pointdensity.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index 5f2c6153384..28d8c2388c4 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -65,9 +65,8 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa psys_render_set(ob, psys, re->viewmat, re->winmat, re->winx, re->winy, 0); dm = mesh_create_derived_render(ob,CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL); - dm->release(dm); - if ( !psys_check_enabled(ob, psys) ){ + if ( !psys_check_enabled(ob, psys)) { psys_render_restore(ob, psys); return; } @@ -76,8 +75,10 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa Mat4Invert(ob->imat, ob->obmat); total_particles = psys->totpart+psys->totchild; + psys->lattice=psys_get_lattice(ob,psys); pd->point_tree = BLI_bvhtree_new(total_particles, 0.0, 4, 6); + if (pd->noise_influence != TEX_PD_NOISE_STATIC) pd->point_data = MEM_mallocN(sizeof(float)*3*total_particles, "point_data"); @@ -112,6 +113,12 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa } BLI_bvhtree_balance(pd->point_tree); + dm->release(dm); + + if(psys->lattice){ + end_latt_deform(); + psys->lattice=0; + } psys_render_restore(ob, psys); } From c62c61a413f90f0af387027f9f94782904c40f17 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 22 Oct 2008 06:10:16 +0000 Subject: [PATCH 043/577] * Fixed a bug in copying (making single user) a point density texture --- source/blender/blenkernel/intern/texture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 6f58e054f69..0dbc0228820 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -895,7 +895,7 @@ PointDensity *BKE_copy_pointdensity(PointDensity *pd) pdn->point_tree = NULL; pdn->point_data = NULL; - return pd; + return pdn; } void BKE_free_pointdensitydata(PointDensity *pd) From 8a6c82684f0e8463bf0a82862929c43b93f18c0b Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 22 Oct 2008 09:26:18 +0000 Subject: [PATCH 044/577] * Did some small tweaks to how density is used with light cache - it makes some very good improvements clearing up artifacts: http://mke3.net/blender/devel/rendering/volumetrics/vol_lc_fixed.jpg --- source/blender/render/intern/source/volumetric.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 4ff6f5aea41..7005f1a6952 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -468,9 +468,6 @@ void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsi lar= go->lampren; if (lar) { vol_shade_one_lamp(shi, co, lar, lacol, stepsize, density); - - VecMulf(lacol, density); - VecAddf(col, col, lacol); } } @@ -539,7 +536,8 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float vol_get_precached_scattering_nearest(shi, scatter_col, step_mid); } else vol_get_scattering(shi, scatter_col, step_mid, stepsize, density); - + + VecMulf(scatter_col, density); VecAddf(d_radiance, emit_col, scatter_col); /* Lv += Tr * (Lve() + Ld) */ From 3a347c1cafd864f9cce3ba30df8ec45f70a6cbfd Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 23 Oct 2008 01:14:30 +0000 Subject: [PATCH 045/577] Just adding some temporary testing code to help try and find a bug. --- .../blender/render/intern/source/volumetric.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 7005f1a6952..ff1c1ca7b67 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -386,10 +386,14 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * float shade_stepsize = vol_get_stepsize(shi, STEPSIZE_SHADE); float shadfac[4]; + if (G.rt==5) printf("s_o_l pre checks col %f %f %f \n", lacol[0], lacol[1], lacol[2]); + if (lar->mode & LA_LAYER) if((lar->lay & shi->obi->lay)==0) return; if ((lar->lay & shi->lay)==0) return; if (lar->energy == 0.0) return; + if (G.rt==5) printf("s_o_l post checks col %f %f %f \n", lacol[0], lacol[1], lacol[2]); + visifac= lamp_get_visibility(lar, co, lv, &lampdist); if(visifac==0.0f) return; @@ -397,6 +401,8 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * lacol[1] = lar->g; lacol[2] = lar->b; + if (G.rt==5) printf("s_o_l post lacol col %f %f %f \n", lacol[0], lacol[1], lacol[2]); + if(lar->mode & LA_TEXTURE) { shi->osatex= 0; do_lamp_tex(lar, lv, shi, lacol, LA_TEXTURE); @@ -404,6 +410,8 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * VecMulf(lacol, visifac*lar->energy); + if (G.rt==5) printf("s_o_l post energy col %f %f %f \n", lacol[0], lacol[1], lacol[2]); + if (ELEM(lar->type, LA_SUN, LA_HEMI)) VECCOPY(lv, lar->vec); VecMulf(lv, -1.0f); @@ -414,6 +422,8 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * if (shi->mat->vol_shadeflag & MA_VOL_ATTENUATED) { Isect is; + if (G.rt==5) printf("s_o_l inside atten col %f %f %f \n", lacol[0], lacol[1], lacol[2]); + /* find minimum of volume bounds, or lamp coord */ if (vol_get_bounds(shi, co, lv, hitco, &is, VOL_BOUNDS_SS, 0)) { float dist = VecLenf(co, hitco); @@ -446,6 +456,8 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * } } + if (G.rt==5) printf("s_o_l post atten col %f %f %f \n", lacol[0], lacol[1], lacol[2]); + vol_get_scattering_fac(shi, &scatter_fac, co, density); VecMulf(lacol, scatter_fac); } @@ -459,16 +471,21 @@ void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsi float col[3] = {0.f, 0.f, 0.f}; int i=0; + if (G.rt==5) printf("lights count: %d \n", BLI_countlist(&R.lights)); + for(go=R.lights.first; go; go= go->next) { float lacol[3] = {0.f, 0.f, 0.f}; i++; + if (G.rt==5) printf("pre light %d \n", i); lar= go->lampren; if (lar) { + if (G.rt==5) printf("pre vol_shade_one_lamp %d col %f %f %f \n", i, lacol[0], lacol[1], lacol[2]); vol_shade_one_lamp(shi, co, lar, lacol, stepsize, density); VecAddf(col, col, lacol); + if (G.rt==5) printf("post vol_shade_one_lamp %d col %f %f %f \n", i, lacol[0], lacol[1], lacol[2]); } } From ee1a143947ebfc8fe26cf9083fd41c520db3e86b Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 23 Oct 2008 01:40:49 +0000 Subject: [PATCH 046/577] more testing code --- source/blender/render/intern/source/volumetric.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index ff1c1ca7b67..f718dbba703 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -956,9 +956,11 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m } /* don't bother if the point is not inside the volume mesh */ - if (!point_inside_obi(tree, obi, co)) + if (!point_inside_obi(tree, obi, co)) { + if (G.rt==5) printf("not inside mesh \n"); continue; - + } + if (G.rt==5) printf("inside mesh \n"); density = vol_get_density(&shi, co); vol_get_scattering(&shi, scatter_col, co, stepsize, density); From 5fabc7781be98305acda9d8d69042dcba3ac3eef Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 23 Oct 2008 01:52:04 +0000 Subject: [PATCH 047/577] and more debugging --- source/blender/render/intern/source/convertblender.c | 5 ++++- source/blender/render/intern/source/volumetric.c | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 74b03d1082f..d7491d9e3fb 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -3094,6 +3094,7 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) do_autosmooth= 1; if ((ma->material_type == MA_VOLUME) && (ma->vol_shadeflag & MA_VOL_PRECACHESHADING)) { + printf("before add_vol_precache \n"); add_vol_precache(re, obr, ma); } } @@ -4927,8 +4928,10 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view) make_sss_tree(re); if(!re->test_break()) - if(re->r.mode & R_RAYTRACE) + if(re->r.mode & R_RAYTRACE) { + printf("before volume_precache \n"); volume_precache(re); + } } if(re->test_break()) diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index f718dbba703..dbd241498a9 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -888,11 +888,14 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m R = *re; + if (G.rt==5) printf("before create raytree \n"); /* create a raytree with just the faces of the instanced ObjectRen, * used for checking if the cached point is inside or outside. */ tree = create_raytree_obi(obi, bbmin, bbmax); if (!tree) return; + if (G.rt==5) printf("after create raytree \n"); + /* Need a shadeinput to calculate scattering */ memset(&shi, 0, sizeof(ShadeInput)); shi.depth= 1; @@ -918,6 +921,8 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m return; VecMulf(voxel, 1.0f/res); + if (G.rt==5) printf("before alloc \n"); + obi->volume_precache = MEM_callocN(sizeof(float)*res_3*3, "volume light cache"); /* Iterate over the 3d voxel grid, and fill the voxels with scattering information @@ -986,6 +991,8 @@ void volume_precache(Render *re) ObjectInstanceRen *obi; VolPrecache *vp; + if (G.rt==5) printf("precache obs: %d \n", BLI_countlist(&re->vol_precache_obs)); + for(vp= re->vol_precache_obs.first; vp; vp= vp->next) { for(obi= re->instancetable.first; obi; obi= obi->next) { if (obi->obr == vp->obr) From ffe81354f8c7aebaed6168ecb942c86c2da56ce4 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 23 Oct 2008 02:03:54 +0000 Subject: [PATCH 048/577] removed debug stuff --- .../render/intern/source/convertblender.c | 5 +--- .../blender/render/intern/source/volumetric.c | 30 ++----------------- 2 files changed, 3 insertions(+), 32 deletions(-) diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index d7491d9e3fb..74b03d1082f 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -3094,7 +3094,6 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) do_autosmooth= 1; if ((ma->material_type == MA_VOLUME) && (ma->vol_shadeflag & MA_VOL_PRECACHESHADING)) { - printf("before add_vol_precache \n"); add_vol_precache(re, obr, ma); } } @@ -4928,10 +4927,8 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view) make_sss_tree(re); if(!re->test_break()) - if(re->r.mode & R_RAYTRACE) { - printf("before volume_precache \n"); + if(re->r.mode & R_RAYTRACE) volume_precache(re); - } } if(re->test_break()) diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index dbd241498a9..7005f1a6952 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -386,14 +386,10 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * float shade_stepsize = vol_get_stepsize(shi, STEPSIZE_SHADE); float shadfac[4]; - if (G.rt==5) printf("s_o_l pre checks col %f %f %f \n", lacol[0], lacol[1], lacol[2]); - if (lar->mode & LA_LAYER) if((lar->lay & shi->obi->lay)==0) return; if ((lar->lay & shi->lay)==0) return; if (lar->energy == 0.0) return; - if (G.rt==5) printf("s_o_l post checks col %f %f %f \n", lacol[0], lacol[1], lacol[2]); - visifac= lamp_get_visibility(lar, co, lv, &lampdist); if(visifac==0.0f) return; @@ -401,8 +397,6 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * lacol[1] = lar->g; lacol[2] = lar->b; - if (G.rt==5) printf("s_o_l post lacol col %f %f %f \n", lacol[0], lacol[1], lacol[2]); - if(lar->mode & LA_TEXTURE) { shi->osatex= 0; do_lamp_tex(lar, lv, shi, lacol, LA_TEXTURE); @@ -410,8 +404,6 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * VecMulf(lacol, visifac*lar->energy); - if (G.rt==5) printf("s_o_l post energy col %f %f %f \n", lacol[0], lacol[1], lacol[2]); - if (ELEM(lar->type, LA_SUN, LA_HEMI)) VECCOPY(lv, lar->vec); VecMulf(lv, -1.0f); @@ -422,8 +414,6 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * if (shi->mat->vol_shadeflag & MA_VOL_ATTENUATED) { Isect is; - if (G.rt==5) printf("s_o_l inside atten col %f %f %f \n", lacol[0], lacol[1], lacol[2]); - /* find minimum of volume bounds, or lamp coord */ if (vol_get_bounds(shi, co, lv, hitco, &is, VOL_BOUNDS_SS, 0)) { float dist = VecLenf(co, hitco); @@ -456,8 +446,6 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * } } - if (G.rt==5) printf("s_o_l post atten col %f %f %f \n", lacol[0], lacol[1], lacol[2]); - vol_get_scattering_fac(shi, &scatter_fac, co, density); VecMulf(lacol, scatter_fac); } @@ -471,21 +459,16 @@ void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsi float col[3] = {0.f, 0.f, 0.f}; int i=0; - if (G.rt==5) printf("lights count: %d \n", BLI_countlist(&R.lights)); - for(go=R.lights.first; go; go= go->next) { float lacol[3] = {0.f, 0.f, 0.f}; i++; - if (G.rt==5) printf("pre light %d \n", i); lar= go->lampren; if (lar) { - if (G.rt==5) printf("pre vol_shade_one_lamp %d col %f %f %f \n", i, lacol[0], lacol[1], lacol[2]); vol_shade_one_lamp(shi, co, lar, lacol, stepsize, density); VecAddf(col, col, lacol); - if (G.rt==5) printf("post vol_shade_one_lamp %d col %f %f %f \n", i, lacol[0], lacol[1], lacol[2]); } } @@ -888,14 +871,11 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m R = *re; - if (G.rt==5) printf("before create raytree \n"); /* create a raytree with just the faces of the instanced ObjectRen, * used for checking if the cached point is inside or outside. */ tree = create_raytree_obi(obi, bbmin, bbmax); if (!tree) return; - if (G.rt==5) printf("after create raytree \n"); - /* Need a shadeinput to calculate scattering */ memset(&shi, 0, sizeof(ShadeInput)); shi.depth= 1; @@ -921,8 +901,6 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m return; VecMulf(voxel, 1.0f/res); - if (G.rt==5) printf("before alloc \n"); - obi->volume_precache = MEM_callocN(sizeof(float)*res_3*3, "volume light cache"); /* Iterate over the 3d voxel grid, and fill the voxels with scattering information @@ -961,11 +939,9 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m } /* don't bother if the point is not inside the volume mesh */ - if (!point_inside_obi(tree, obi, co)) { - if (G.rt==5) printf("not inside mesh \n"); + if (!point_inside_obi(tree, obi, co)) continue; - } - if (G.rt==5) printf("inside mesh \n"); + density = vol_get_density(&shi, co); vol_get_scattering(&shi, scatter_col, co, stepsize, density); @@ -991,8 +967,6 @@ void volume_precache(Render *re) ObjectInstanceRen *obi; VolPrecache *vp; - if (G.rt==5) printf("precache obs: %d \n", BLI_countlist(&re->vol_precache_obs)); - for(vp= re->vol_precache_obs.first; vp; vp= vp->next) { for(obi= re->instancetable.first; obi; obi= obi->next) { if (obi->obr == vp->obr) From ba829e5c36b0e1282f5799720142d464c57c7d54 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 23 Oct 2008 02:15:36 +0000 Subject: [PATCH 049/577] Debugging tests paid off, fixed a ridiculously silly bug that was preventing light cache from working on some people's systems (but went just fine on both my windows pc and mac). I have no idea how the original code even worked at all, it really shouldn't have. But fixed now anyway! Thanks a bunch to Zanqdo for patience in helping me pinpoint this. --- source/blender/render/intern/source/volumetric.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 7005f1a6952..aad8f44441e 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -844,6 +844,8 @@ RayTree *create_raytree_obi(ObjectInstanceRen *obi, float *bbmin, float *bbmax) } RE_ray_tree_done(tree); + + return tree; } /* Precache a volume into a 3D voxel grid. From deea0fa2e70a094cd289ac0083dcbf624453df51 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 23 Oct 2008 03:50:56 +0000 Subject: [PATCH 050/577] * More improvements for light cache Previously when using light cache, there could be artifacts caused when voxel points that were sampled outside the volume object's geometry got interpolated into the rest of the volume. This commit adds a (similar to a dilate) filter pass after creating the light cache, that fills these empty areas with the average of their surrounding voxels. http://mke3.net/blender/devel/rendering/volumetrics/vol_lightcache_filter.jpg --- .../blender/render/intern/source/volumetric.c | 92 ++++++++++++++++--- 1 file changed, 77 insertions(+), 15 deletions(-) diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index aad8f44441e..02ebbd83c31 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -75,6 +75,7 @@ static int vol_backface_intersect_check(Isect *is, int ob, RayFace *face) return (INPR(is->vec, vlr->n) < 0.0f); } +#if 0 static int vol_frontface_intersect_check(Isect *is, int ob, RayFace *face) { VlakRen *vlr = (VlakRen *)face; @@ -88,6 +89,7 @@ static int vol_always_intersect_check(Isect *is, int ob, RayFace *face) { return 1; } +#endif #define VOL_IS_BACKFACE 1 #define VOL_IS_SAMEMATERIAL 2 @@ -257,12 +259,6 @@ inline float lerp(float t, float v1, float v2) { return (1.f - t) * v1 + t * v2; } -inline float do_lerp(float t, float a, float b) { - if (a > 0.f && b > 0.f) return lerp(t, a, b); - else if (a < 0.f) return b; - else if (b < 0.f) return a; -} - /* trilinear interpolation */ static void vol_get_precached_scattering(ShadeInput *shi, float *scatter_col, float *co) { @@ -384,7 +380,6 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * float p; float scatter_fac; float shade_stepsize = vol_get_stepsize(shi, STEPSIZE_SHADE); - float shadfac[4]; if (lar->mode & LA_LAYER) if((lar->lay & shi->obi->lay)==0) return; if ((lar->lay & shi->lay)==0) return; @@ -454,7 +449,6 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsize, float density) { GroupObject *go; - ListBase *lights; LampRen *lar; float col[3] = {0.f, 0.f, 0.f}; int i=0; @@ -530,10 +524,10 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float if ((shi->mat->vol_shadeflag & MA_VOL_PRECACHESHADING) && (shi->mat->vol_shadeflag & MA_VOL_ATTENUATED)) { - if (G.rt==0) - vol_get_precached_scattering(shi, scatter_col, step_mid); - else + if (G.rt==100) vol_get_precached_scattering_nearest(shi, scatter_col, step_mid); + else + vol_get_precached_scattering(shi, scatter_col, step_mid); } else vol_get_scattering(shi, scatter_col, step_mid, stepsize, density); @@ -782,7 +776,6 @@ int intersect_outside_volume(RayTree *tree, Isect *isect, float *offset, int lim int point_inside_obi(RayTree *tree, ObjectInstanceRen *obi, float *co) { float maxsize = RE_ray_tree_max_size(tree); - int intersected; Isect isect; float vec[3] = {0.0f,0.0f,1.0f}; int final_depth=0, depth=0, limit=20; @@ -848,6 +841,70 @@ RayTree *create_raytree_obi(ObjectInstanceRen *obi, float *bbmin, float *bbmax) return tree; } +static float get_avg_surrounds(float *cache, int res, int res_2, int res_3, int rgb, int xx, int yy, int zz) +{ + int x, y, z, x_, y_, z_; + int added=0; + float tot=0.0f; + int i; + + for (x=-1; x <= 1; x++) { + x_ = xx+x; + if (x_ >= 0 && x_ <= res-1) { + + for (y=-1; y <= 1; y++) { + y_ = yy+y; + if (y_ >= 0 && y_ <= res-1) { + + for (z=-1; z <= 1; z++) { + z_ = zz+z; + if (z_ >= 0 && z_ <= res-1) { + + i = rgb*res_3 + x_*res_2 + y_*res + z_; + if (cache[i] > 0.0f) { + tot += cache[i]; + added++; + } + + } + } + } + } + } + } + + tot /= added; + + return ((added>0)?tot:0.0f); +} + +/* function to filter the edges of the light cache, where there was no volume originally. + * For each voxel which was originally external to the mesh, it finds the average values of + * the surrounding internal voxels and sets the original external voxel to that average amount. + * Works almost a bit like a 'dilate' filter */ +static void lightcache_filter(float *cache, int res) +{ + int x, y, z, rgb; + int res_2, res_3; + int i; + + res_2 = res*res; + res_3 = res*res*res; + + for (x=0; x < res; x++) { + for (y=0; y < res; y++) { + for (z=0; z < res; z++) { + for (rgb=0; rgb < 3; rgb++) { + i = rgb*res_3 + x*res_2 + y*res + z; + + /* trigger for outside mesh */ + if (cache[i] < 0.5f) cache[i] = get_avg_surrounds(cache, res, res_2, res_3, rgb, x, y, z); + } + } + } + } +} + /* Precache a volume into a 3D voxel grid. * The voxel grid is stored in the ObjectInstanceRen, * in camera space, aligned with the ObjectRen's bounding box. @@ -941,9 +998,12 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m } /* don't bother if the point is not inside the volume mesh */ - if (!point_inside_obi(tree, obi, co)) + if (!point_inside_obi(tree, obi, co)) { + obi->volume_precache[0*res_3 + x*res_2 + y*res + z] = -1.0f; + obi->volume_precache[1*res_3 + x*res_2 + y*res + z] = -1.0f; + obi->volume_precache[2*res_3 + x*res_2 + y*res + z] = -1.0f; continue; - + } density = vol_get_density(&shi, co); vol_get_scattering(&shi, scatter_col, co, stepsize, density); @@ -959,6 +1019,7 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m tree= NULL; } + lightcache_filter(obi->volume_precache, res); } @@ -990,4 +1051,5 @@ void free_volume_precache(Render *re) } BLI_freelistN(&re->vol_precache_obs); -} \ No newline at end of file +} + From 5fb8debada3db41d2ff40ee9a30e10ddcf35d35e Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 30 Oct 2008 09:26:30 +0000 Subject: [PATCH 051/577] * Added a new, slightly experimental force field type: 'Spin'. It works similarly to Vortex, but it's a more controllable - it doesn't send the particles off accelerating into space, but keeps them spinning around the Z axis of the force field object. This is safe in the branch, but Jahka if you have any feedback, I'd be curious to hear :) --- source/blender/blenkernel/intern/effect.c | 13 +++++++++++++ source/blender/makesdna/DNA_object_force.h | 1 + source/blender/src/buttons_object.c | 4 ++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 122c6c71a6c..8b38fadafb1 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -420,6 +420,19 @@ void do_physical_effector(Object *ob, float *opco, short type, float force_val, VecMulf(mag_vec,force_val*distance*falloff); VecAddf(field,field,mag_vec); + break; + case PFIELD_SPIN: + Projf(temp, velocity, eff_vel); + + Crossf(mag_vec,eff_vel,vec_to_part); + + Normalize(mag_vec); + + VecMulf(mag_vec,force_val*distance*falloff); + VecAddf(mag_vec, mag_vec, temp); + + VecCopyf(velocity, mag_vec); + break; case PFIELD_MAGNET: if(planar) diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h index 21c5242a703..2b8a86ac67b 100644 --- a/source/blender/makesdna/DNA_object_force.h +++ b/source/blender/makesdna/DNA_object_force.h @@ -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 */ diff --git a/source/blender/src/buttons_object.c b/source/blender/src/buttons_object.c index a8ce9da8780..763038adaae 100644 --- a/source/blender/src/buttons_object.c +++ b/source/blender/src/buttons_object.c @@ -3409,8 +3409,8 @@ static void object_panel_fields(Object *ob) sprintf(menustr, "Field Type%%t|None%%x0|Spherical%%x%d|Wind%%x%d|Vortex%%x%d|Curve Guide%%x%d|Magnetic%%x%d|Harmonic%%x%d|Texture%%x%d|Charge%%x%d|Lennard-Jones%%x%d", PFIELD_FORCE, PFIELD_WIND, PFIELD_VORTEX, PFIELD_GUIDE, PFIELD_MAGNET, PFIELD_HARMONIC, PFIELD_TEXTURE, PFIELD_CHARGE, PFIELD_LENNARDJ); else - sprintf(menustr, "Field Type%%t|None%%x0|Spherical%%x%d|Wind%%x%d|Vortex%%x%d|Magnetic%%x%d|Harmonic%%x%d|Texture%%x%d|Charge%%x%d|Lennard-Jones%%x%d", - PFIELD_FORCE, PFIELD_WIND, PFIELD_VORTEX, PFIELD_MAGNET, PFIELD_HARMONIC, PFIELD_TEXTURE, PFIELD_CHARGE, PFIELD_LENNARDJ); + sprintf(menustr, "Field Type%%t|None%%x0|Spherical%%x%d|Wind%%x%d|Vortex%%x%d|Spin%%x%d|Magnetic%%x%d|Harmonic%%x%d|Texture%%x%d|Charge%%x%d|Lennard-Jones%%x%d", + PFIELD_FORCE, PFIELD_WIND, PFIELD_VORTEX, PFIELD_SPIN, PFIELD_MAGNET, PFIELD_HARMONIC, PFIELD_TEXTURE, PFIELD_CHARGE, PFIELD_LENNARDJ); if(pd->forcefield==PFIELD_FORCE) tipstr= "Object center attracts or repels particles (On shared object layers)"; else if(pd->forcefield==PFIELD_WIND) tipstr= "Constant force applied in direction of Object Z axis (On shared object layers)"; From 15579884b1255cba9de7662f72cd21323ad2c701 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Fri, 31 Oct 2008 05:29:54 +0000 Subject: [PATCH 052/577] * Added a new turbulence type: Time. It's not entirely well tested, but so far working ok. It's smoother looking than 'velocity' but may need more in depth investigation. --- .../render/intern/source/pointdensity.c | 89 +++++++++++-------- source/blender/render/intern/source/texture.c | 13 ++- source/blender/src/buttons_shading.c | 2 +- 3 files changed, 57 insertions(+), 47 deletions(-) diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index 28d8c2388c4..483cc96122b 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -35,6 +35,7 @@ #include "BKE_DerivedMesh.h" #include "BKE_global.h" +#include "BKE_lattice.h" #include "BKE_main.h" #include "BKE_object.h" #include "BKE_particle.h" @@ -56,12 +57,12 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa float partco[3]; float obview[4][4]; - /* init crap */ + /* init everything */ if (!psys || !ob || !pd) return; Mat4MulMat4(obview, re->viewinv, ob->obmat); - /* Just to create a valid rendering context */ + /* Just to create a valid rendering context for particles */ psys_render_set(ob, psys, re->viewmat, re->winmat, re->winx, re->winy, 0); dm = mesh_create_derived_render(ob,CD_MASK_BAREMESH|CD_MASK_MTFACE|CD_MASK_MCOL); @@ -79,8 +80,10 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa pd->point_tree = BLI_bvhtree_new(total_particles, 0.0, 4, 6); - if (pd->noise_influence != TEX_PD_NOISE_STATIC) - pd->point_data = MEM_mallocN(sizeof(float)*3*total_particles, "point_data"); + if (pd->noise_influence == TEX_PD_NOISE_VEL) + pd->point_data = MEM_mallocN(sizeof(float)*3*total_particles, "velocity point data"); + else if (pd->noise_influence == TEX_PD_NOISE_TIME) + pd->point_data = MEM_mallocN(sizeof(float)*total_particles, "time point data"); if (psys->totchild > 0 && !(psys->part->draw & PART_DRAW_PARENT)) childexists = 1; @@ -108,6 +111,8 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa pd->point_data[i*3 + 0] = state.vel[0]; pd->point_data[i*3 + 1] = state.vel[1]; pd->point_data[i*3 + 2] = state.vel[2]; + } else if (pd->noise_influence == TEX_PD_NOISE_TIME) { + pd->point_data[i] = state.time; } } } @@ -256,7 +261,9 @@ typedef struct PointDensityRangeData float *point_data; float *vec; float softness; - short falloff_type; + short falloff_type; + short noise_influence; + float *time; } PointDensityRangeData; void accum_density(void *userdata, int index, float squared_dist) @@ -277,10 +284,14 @@ void accum_density(void *userdata, int index, float squared_dist) density = sqrt(dist); if (pdr->point_data) { - pdr->vec[0] += pdr->point_data[index*3 + 0];// * density; - pdr->vec[1] += pdr->point_data[index*3 + 1];// * density; - pdr->vec[2] += pdr->point_data[index*3 + 2];// * density; - } + if (pdr->noise_influence == TEX_PD_NOISE_VEL) { + pdr->vec[0] += pdr->point_data[index*3 + 0];// * density; + pdr->vec[1] += pdr->point_data[index*3 + 1];// * density; + pdr->vec[2] += pdr->point_data[index*3 + 2];// * density; + } else if (pdr->noise_influence == TEX_PD_NOISE_TIME) { + *pdr->time += pdr->point_data[index]; // * density; + } + } *pdr->density += density; } @@ -288,12 +299,13 @@ void accum_density(void *userdata, int index, float squared_dist) #define MAX_POINTS_NEAREST 25 int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) { - int rv = TEX_INT; + int retval = TEX_INT; PointDensity *pd = tex->pd; PointDensityRangeData pdr; - float density=0.0f; + float density=0.0f, time=0.0f; float vec[3] = {0.0, 0.0, 0.0}; float tv[3]; + float co[3]; float turb, noise_fac; if ((!pd) || (!pd->point_tree)) { @@ -306,54 +318,53 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) pdr.point_data = pd->point_data; pdr.falloff_type = pd->falloff_type; pdr.vec = vec; + pdr.time = &time; pdr.softness = pd->falloff_softness; + pdr.noise_influence = pd->noise_influence; noise_fac = pd->noise_fac * 0.5f; /* better default */ - if (pd->flag & TEX_PD_TURBULENCE) { - VECCOPY(tv, texvec); - - /* find the average speed vectors, for perturbing final density lookup with */ - BLI_bvhtree_range_query(pd->point_tree, texvec, pd->radius, accum_density, &pdr); - - density = 0.0f; - Normalize(vec); + VECCOPY(co, texvec); - turb = BLI_turbulence(pd->noise_size, texvec[0]+vec[0], texvec[1]+vec[1], texvec[2]+vec[2], pd->noise_depth); + if (pd->flag & TEX_PD_TURBULENCE) { + retval |= TEX_RGB; + if (ELEM(pd->noise_influence, TEX_PD_NOISE_VEL, TEX_PD_NOISE_TIME)) { + /* find the average speed vectors or particle time, + * for perturbing final density lookup with */ + BLI_bvhtree_range_query(pd->point_tree, co, pd->radius, accum_density, &pdr); + density = 0.0f; + + if (pd->noise_influence == TEX_PD_NOISE_TIME) + vec[0] = vec[1] = vec[2] = time; + + Normalize(vec); + } + + turb = BLI_turbulence(pd->noise_size, texvec[0]+vec[0], texvec[1]+vec[1], texvec[2]+vec[2], pd->noise_depth); turb -= 0.5f; /* re-center 0.0-1.0 range around 0 to prevent offsetting result */ - tv[0] = texvec[0] + noise_fac * turb; - tv[1] = texvec[1] + noise_fac * turb; - tv[2] = texvec[2] + noise_fac * turb; - - /* do density lookup with altered coordinates */ - BLI_bvhtree_range_query(pd->point_tree, tv, pd->radius, accum_density, &pdr); + /* now we have an offset coordinate to use for the density lookup */ + co[0] = texvec[0] + noise_fac * turb; + co[1] = texvec[1] + noise_fac * turb; + co[2] = texvec[2] + noise_fac * turb; } - else - BLI_bvhtree_range_query(pd->point_tree, texvec, pd->radius, accum_density, &pdr); + + BLI_bvhtree_range_query(pd->point_tree, co, pd->radius, accum_density, &pdr); texres->tin = density; - - - BRICONT; - return TEX_INT; - - /* texres->tr = vec[0]; texres->tg = vec[1]; texres->tb = vec[2]; + texres->ta = density; BRICONTRGB; - texres->ta = 1.0; + return retval; + /* if (texres->nor!=NULL) { texres->nor[0] = texres->nor[1] = texres->nor[2] = 0.0f; } */ - - //BRICONT; - - //return rv; } diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index dfeb775aca6..972ab4b55a9 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -1565,17 +1565,15 @@ void do_volume_tex(ShadeInput *shi, float *xyz, int mapto_flag, float *col, floa /* stencil maps on the texture control slider, not texture intensity value */ colfac= mtex->colfac*stencilTin; - tcol[0]=texres.tr; tcol[1]=texres.tg; tcol[2]=texres.tb; - if((rgbnor & TEX_RGB)==0) { tcol[0]= mtex->r; tcol[1]= mtex->g; tcol[2]= mtex->b; + } else { + tcol[0]=texres.tr; + tcol[1]=texres.tg; + tcol[2]=texres.tb; } - else if(mtex->mapto & MAP_ALPHA) { - texres.tin= stencilTin; - } - else texres.tin= texres.ta; if((mapto_flag & MAP_COL) && (mtex->mapto & MAP_COL)) { texture_rgb_blend(col, tcol, col, texres.tin, colfac, mtex->blendtype); @@ -1591,7 +1589,8 @@ void do_volume_tex(ShadeInput *shi, float *xyz, int mapto_flag, float *col, floa /* stencil maps on the texture control slider, not texture intensity value */ float varfac= mtex->varfac*stencilTin; - if(rgbnor & TEX_RGB) { + /* convert RGB to intensity if intensity info isn't provided */ + if((rgbnor & TEX_RGB) && !(rgbnor & TEX_INT)) { if(texres.talpha) texres.tin= texres.ta; else texres.tin= (0.35*texres.tr+0.45*texres.tg+0.2*texres.tb); } diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 04fc9d5314f..dbe3db871b4 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -788,7 +788,7 @@ static void texture_panel_pointdensity(Tex *tex) yco -= YSPACE; if (pd->source == TEX_PD_PSYS) { - uiDefButS(block, MENU, B_REDR, "Noise Influence %t|Static %x0|Velocity %x1", + uiDefButS(block, MENU, B_REDR, "Noise Influence %t|Static %x0|Velocity %x1|Time %x2", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_influence), 0.0, 0.0, 0, 0, "Noise Influence"); } } From 5cdbbe3a925383472c852c0db958d1af11c6413b Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sat, 1 Nov 2008 12:45:19 +0000 Subject: [PATCH 053/577] * Tweaked the spin force field a bit. It worked great for its purpose before, but wasn't playing nice with the other force fields (was overwriting the velocity rather than acting as a force). This version is slightly different, but will work a lot better with other force fields too. --- source/blender/blenkernel/intern/effect.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 8b38fadafb1..4c8394f0eeb 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -422,18 +422,25 @@ void do_physical_effector(Object *ob, float *opco, short type, float force_val, break; case PFIELD_SPIN: - Projf(temp, velocity, eff_vel); + { + 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); + VecSubf(mag_vec, mag_vec, inward); + VecMulf(mag_vec,force_val*distance*falloff); VecAddf(mag_vec, mag_vec, temp); - - VecCopyf(velocity, mag_vec); - + + /* compensate for existing velocity */ + VecSubf(mag_vec, mag_vec, velocity); + VecAddf(field,field,mag_vec); break; + } case PFIELD_MAGNET: if(planar) VecCopyf(temp,eff_vel); From 389588bb4f9f273d5cc1f679e351604859dafc0b Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sun, 2 Nov 2008 23:25:21 +0000 Subject: [PATCH 054/577] Reverted to the previous, more hackish version of the spin field. There has to be a better way of doing this though... jahka? :) --- source/blender/blenkernel/intern/effect.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 4c8394f0eeb..f3d9ea7005a 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -422,25 +422,20 @@ void do_physical_effector(Object *ob, float *opco, short type, float force_val, 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); - VecSubf(mag_vec, mag_vec, inward); - VecMulf(mag_vec,force_val*distance*falloff); VecAddf(mag_vec, mag_vec, temp); - - /* compensate for existing velocity */ - VecSubf(mag_vec, mag_vec, velocity); - VecAddf(field,field,mag_vec); + + 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); From f5f0c8fb37eaac8be9efc44b2802fb87fcf85727 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 4 Nov 2008 05:17:02 +0000 Subject: [PATCH 055/577] * Fixed a strange problem with the way textures are interpreted - was causing weird things with point density turbulence on * Reverted the spin field once more.. --- source/blender/blenkernel/intern/effect.c | 15 +++++++++++---- .../blender/render/intern/source/pointdensity.c | 12 +++++++----- source/blender/render/intern/source/texture.c | 8 +++++--- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index f3d9ea7005a..f91a99accef 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -422,20 +422,27 @@ void do_physical_effector(Object *ob, float *opco, short type, float force_val, 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); + //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); diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index 483cc96122b..c80ee767142 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -304,9 +304,9 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) PointDensityRangeData pdr; float density=0.0f, time=0.0f; float vec[3] = {0.0, 0.0, 0.0}; - float tv[3]; float co[3]; float turb, noise_fac; + int num; if ((!pd) || (!pd->point_tree)) { texres->tin = 0.0f; @@ -331,11 +331,13 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) if (ELEM(pd->noise_influence, TEX_PD_NOISE_VEL, TEX_PD_NOISE_TIME)) { /* find the average speed vectors or particle time, * for perturbing final density lookup with */ - BLI_bvhtree_range_query(pd->point_tree, co, pd->radius, accum_density, &pdr); + num = BLI_bvhtree_range_query(pd->point_tree, co, pd->radius, accum_density, &pdr); density = 0.0f; - if (pd->noise_influence == TEX_PD_NOISE_TIME) - vec[0] = vec[1] = vec[2] = time; + if (pd->noise_influence == TEX_PD_NOISE_TIME) { + vec[0] = vec[1] = vec[2] = time/num; + //if ((G.rt==1) && (time > 0.f)) printf("time: %f time/num: %f \n", time, time/num); + } Normalize(vec); } @@ -357,7 +359,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) texres->tr = vec[0]; texres->tg = vec[1]; texres->tb = vec[2]; - texres->ta = density; + //texres->ta = density; BRICONTRGB; return retval; diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index 972ab4b55a9..4fdccc9d892 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -1590,9 +1590,11 @@ void do_volume_tex(ShadeInput *shi, float *xyz, int mapto_flag, float *col, floa float varfac= mtex->varfac*stencilTin; /* convert RGB to intensity if intensity info isn't provided */ - if((rgbnor & TEX_RGB) && !(rgbnor & TEX_INT)) { - if(texres.talpha) texres.tin= texres.ta; - else texres.tin= (0.35*texres.tr+0.45*texres.tg+0.2*texres.tb); + if (rgbnor & TEX_INT) { + if (rgbnor & TEX_RGB) { + if(texres.talpha) texres.tin= texres.ta; + else texres.tin= (0.35*texres.tr+0.45*texres.tg+0.2*texres.tb); + } } if((mapto_flag & MAP_EMIT) && (mtex->mapto & MAP_EMIT)) { From a972107b03a3b8b00e1548d99e790612dc9f0ccc Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sun, 9 Nov 2008 01:16:12 +0000 Subject: [PATCH 056/577] Point Density texture: colouring This introduces a few new ways of modifying the intensity and colour output generated by the Point Density texture. Previously, the texture only output intensity information, but now you can map it to colours along a gradient ramp, based on information coming out of a particle system. This lets you do things like colour a particle system based on the individual particles' age - the main reason I need it is to fade particles out over time. The colorband influences both the colour and intensity (using the colorband's alpha value), which makes it easy to map a single point density texture to both intensity values in the Map To panel (such as density or emit) and colour values (such as absorb col or emit col). This is how the below examples are set up, an example .blend file is available here: http://mke3.net/blender/devel/rendering/volumetrics/pd_test4.blend The different modes: * Constant No modifications to intensity or colour (pure white) * Particle Age Maps the color ramp along the particles' lifetimes: http://mke3.net/blender/devel/rendering/volumetrics/pd_mod_partage.mov * Particle Speed Maps the color ramp to the particles' absolute speed per frame (in Blender units). There's an additional scale parameter that you can use to bring this speed into a 0.0 - 1.0 range, if your particles are travelling too faster or slower than 0-1. http://mke3.net/blender/devel/rendering/volumetrics/pd_mod_speed.mov * Velocity -> RGB Outputs the particle XYZ velocity vector as RGB colours. This may be useful for comp work, or maybe in the future things like displacement. Again, there's a scale parameter to control it. http://mke3.net/blender/devel/rendering/volumetrics/pd_mod_velrgb.mov --- source/blender/blenkernel/intern/texture.c | 6 +- source/blender/blenloader/intern/readfile.c | 5 + source/blender/blenloader/intern/writefile.c | 5 +- source/blender/makesdna/DNA_texture_types.h | 21 +- .../render/intern/source/pointdensity.c | 209 ++++++--- source/blender/src/buttons_shading.c | 427 ++++++++++-------- 6 files changed, 424 insertions(+), 249 deletions(-) diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 0dbc0228820..76ef6bdb4e8 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -883,7 +883,9 @@ PointDensity *BKE_add_pointdensity(void) 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; return pd; } @@ -894,6 +896,7 @@ PointDensity *BKE_copy_pointdensity(PointDensity *pd) pdn= MEM_dupallocN(pd); pdn->point_tree = NULL; pdn->point_data = NULL; + if(pdn->coba) pdn->coba= MEM_dupallocN(pdn->coba); return pdn; } @@ -908,6 +911,7 @@ void BKE_free_pointdensitydata(PointDensity *pd) MEM_freeN(pd->point_data); pd->point_data = NULL; } + if(pd->coba) MEM_freeN(pd->coba); } void BKE_free_pointdensity(PointDensity *pd) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 83a66143ffc..372e9856b98 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2506,6 +2506,7 @@ static void direct_link_texture(FileData *fd, Tex *tex) tex->pd= newdataadr(fd, tex->pd); if(tex->pd) { tex->pd->point_tree = NULL; + tex->pd->coba= newdataadr(fd, tex->pd->coba); } tex->preview = direct_link_preview_image(fd, tex->preview); @@ -7902,6 +7903,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } 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; + } } } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 7249090dfa7..5c1032045d7 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1335,7 +1335,10 @@ static void write_textures(WriteData *wd, ListBase *idbase) if(tex->plugin) writestruct(wd, DATA, "PluginTex", 1, tex->plugin); if(tex->coba) writestruct(wd, DATA, "ColorBand", 1, tex->coba); if(tex->env) writestruct(wd, DATA, "EnvMap", 1, tex->env); - if(tex->pd) writestruct(wd, DATA, "PointDensity", 1, tex->pd); + if(tex->pd) { + writestruct(wd, DATA, "PointDensity", 1, tex->pd); + if(tex->pd->coba) writestruct(wd, DATA, "ColorBand", 1, tex->pd->coba); + } write_previews(wd, tex->preview); } diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index c51311bb621..b057efb4a55 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -134,7 +134,10 @@ typedef struct PointDensity { float falloff_softness; float radius; short source; - short pdpad; + 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, ... ? */ @@ -151,7 +154,9 @@ typedef struct PointDensity { short noise_depth; short noise_influence; float noise_fac; - float pdpad4; + + float speed_scale; + struct ColorBand *coba; /* for time -> color */ } PointDensity; @@ -442,7 +447,17 @@ typedef struct TexMapping { /* noise_influence */ #define TEX_PD_NOISE_STATIC 0 #define TEX_PD_NOISE_VEL 1 -#define TEX_PD_NOISE_TIME 2 +#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 #endif diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index c80ee767142..db3e57e0b79 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -39,6 +39,7 @@ #include "BKE_main.h" #include "BKE_object.h" #include "BKE_particle.h" +#include "BKE_texture.h" #include "DNA_texture_types.h" #include "DNA_particle_types.h" @@ -47,16 +48,59 @@ #include "renderdatabase.h" #include "texture.h" +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* defined in pipeline.c, is hardcopy of active dynamic allocated Render */ +/* only to be used here in this file, it's for speed */ +extern struct Render R; +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + + +static int point_data_used(PointDensity *pd) +{ + int pd_bitflag = 0; + + if ((pd->noise_influence == TEX_PD_NOISE_VEL) || (pd->color_source == TEX_PD_COLOR_PARTVEL) || (pd->color_source == TEX_PD_COLOR_PARTSPEED)) + pd_bitflag |= POINT_DATA_VEL; + if ((pd->noise_influence == TEX_PD_NOISE_AGE) || (pd->color_source == TEX_PD_COLOR_PARTAGE)) + pd_bitflag |= POINT_DATA_LIFE; + + return pd_bitflag; +} + + +/* additional data stored alongside the point density BVH, + * accessible by point index number to retrieve other information + * such as particle velocity or lifetime */ +static void make_point_data(PointDensity *pd, int total_particles, int point_data_used) +{ + int data_size = 0; + + if (point_data_used & POINT_DATA_VEL) { + /* store 3 channels of velocity data */ + data_size += 3; + } + if (point_data_used & POINT_DATA_LIFE) { + /* store 1 channel of lifetime data */ + data_size += 1; + } + + if (data_size) + pd->point_data = MEM_mallocN(sizeof(float)*data_size*total_particles, "particle point data"); +} + static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, ParticleSystem *psys) { DerivedMesh* dm; ParticleKey state; + ParticleData *pa=NULL; float cfra=bsystem_time(ob,(float)G.scene->r.cfra,0.0); int i, childexists; - int total_particles; + int total_particles, offset=0; + int data_used = point_data_used(pd); float partco[3]; float obview[4][4]; + /* init everything */ if (!psys || !ob || !pd) return; @@ -79,16 +123,14 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa psys->lattice=psys_get_lattice(ob,psys); pd->point_tree = BLI_bvhtree_new(total_particles, 0.0, 4, 6); - - if (pd->noise_influence == TEX_PD_NOISE_VEL) - pd->point_data = MEM_mallocN(sizeof(float)*3*total_particles, "velocity point data"); - else if (pd->noise_influence == TEX_PD_NOISE_TIME) - pd->point_data = MEM_mallocN(sizeof(float)*total_particles, "time point data"); + make_point_data(pd, total_particles, data_used); + pd->totpoints = total_particles; + if (data_used & POINT_DATA_VEL) offset = pd->totpoints*3; if (psys->totchild > 0 && !(psys->part->draw & PART_DRAW_PARENT)) childexists = 1; - for (i = 0; i < total_particles; i++) { + for (i=0, pa=psys->particles; i < total_particles; i++, pa++) { state.time = cfra; if(psys_get_particle_state(ob, psys, i, &state, 0)) { @@ -107,12 +149,14 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa BLI_bvhtree_insert(pd->point_tree, i, partco, 1); - if (pd->noise_influence == TEX_PD_NOISE_VEL) { + if (data_used & POINT_DATA_VEL) { pd->point_data[i*3 + 0] = state.vel[0]; pd->point_data[i*3 + 1] = state.vel[1]; pd->point_data[i*3 + 2] = state.vel[2]; - } else if (pd->noise_influence == TEX_PD_NOISE_TIME) { - pd->point_data[i] = state.time; + } + if (data_used & POINT_DATA_LIFE) { + float pa_time = (cfra - pa->time)/pa->lifetime; + pd->point_data[offset + i] = pa_time; } } } @@ -140,6 +184,7 @@ static void pointdensity_cache_object(Render *re, PointDensity *pd, ObjectRen *o Mat4Invert(obr->ob->imat, obr->ob->obmat); pd->point_tree = BLI_bvhtree_new(obr->totvert, 0.0, 4, 6); + pd->totpoints = obr->totvert; for(i=0; itotvert; i++) { float ver_co[3]; @@ -216,6 +261,7 @@ static void free_pointdensity(Render *re, Tex *tex) MEM_freeN(pd->point_data); pd->point_data = NULL; } + pd->totpoints = 0; } @@ -263,7 +309,9 @@ typedef struct PointDensityRangeData float softness; short falloff_type; short noise_influence; - float *time; + float *age; + int point_data_used; + int offset; } PointDensityRangeData; void accum_density(void *userdata, int index, float squared_dist) @@ -283,83 +331,130 @@ void accum_density(void *userdata, int index, float squared_dist) else if (pdr->falloff_type == TEX_PD_FALLOFF_ROOT) density = sqrt(dist); - if (pdr->point_data) { - if (pdr->noise_influence == TEX_PD_NOISE_VEL) { - pdr->vec[0] += pdr->point_data[index*3 + 0];// * density; - pdr->vec[1] += pdr->point_data[index*3 + 1];// * density; - pdr->vec[2] += pdr->point_data[index*3 + 2];// * density; - } else if (pdr->noise_influence == TEX_PD_NOISE_TIME) { - *pdr->time += pdr->point_data[index]; // * density; - } - } + if (pdr->point_data_used & POINT_DATA_VEL) { + pdr->vec[0] += pdr->point_data[index*3 + 0]; //* density; + pdr->vec[1] += pdr->point_data[index*3 + 1]; //* density; + pdr->vec[2] += pdr->point_data[index*3 + 2]; //* density; + } + if (pdr->point_data_used & POINT_DATA_LIFE) { + *pdr->age += pdr->point_data[pdr->offset + index]; // * density; + } *pdr->density += density; } -#define MAX_POINTS_NEAREST 25 + +static void init_pointdensityrangedata(PointDensity *pd, PointDensityRangeData *pdr, float *density, float *vec, float *age) +{ + pdr->squared_radius = pd->radius*pd->radius; + pdr->density = density; + pdr->point_data = pd->point_data; + pdr->falloff_type = pd->falloff_type; + pdr->vec = vec; + pdr->age = age; + pdr->softness = pd->falloff_softness; + pdr->noise_influence = pd->noise_influence; + pdr->point_data_used = point_data_used(pd); + pdr->offset = (pdr->point_data_used & POINT_DATA_VEL)?pd->totpoints*3:0; +} + + int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) { - int retval = TEX_INT; + int retval = TEX_INT+TEX_RGB; PointDensity *pd = tex->pd; PointDensityRangeData pdr; - float density=0.0f, time=0.0f; - float vec[3] = {0.0, 0.0, 0.0}; - float co[3]; + float density=0.0f, age=0.0f, time=0.0f; + float vec[3] = {0.0f, 0.0f, 0.0f}, co[3]; + float col[4]; float turb, noise_fac; - int num; + int num=0; if ((!pd) || (!pd->point_tree)) { texres->tin = 0.0f; return 0; } - pdr.squared_radius = pd->radius*pd->radius; - pdr.density = &density; - pdr.point_data = pd->point_data; - pdr.falloff_type = pd->falloff_type; - pdr.vec = vec; - pdr.time = &time; - pdr.softness = pd->falloff_softness; - pdr.noise_influence = pd->noise_influence; + init_pointdensityrangedata(pd, &pdr, &density, vec, &age); noise_fac = pd->noise_fac * 0.5f; /* better default */ VECCOPY(co, texvec); - if (pd->flag & TEX_PD_TURBULENCE) { - retval |= TEX_RGB; - - if (ELEM(pd->noise_influence, TEX_PD_NOISE_VEL, TEX_PD_NOISE_TIME)) { - /* find the average speed vectors or particle time, - * for perturbing final density lookup with */ - num = BLI_bvhtree_range_query(pd->point_tree, co, pd->radius, accum_density, &pdr); - density = 0.0f; - - if (pd->noise_influence == TEX_PD_NOISE_TIME) { - vec[0] = vec[1] = vec[2] = time/num; - //if ((G.rt==1) && (time > 0.f)) printf("time: %f time/num: %f \n", time, time/num); - } - - Normalize(vec); + if (point_data_used(pd)) { + /* does a BVH lookup to find accumulated density and additional point data * + * stores particle velocity vector in 'vec', and particle lifetime in 'time' */ + num = BLI_bvhtree_range_query(pd->point_tree, co, pd->radius, accum_density, &pdr); + if (num > 0) { + age /= num; + VecMulf(vec, 1.0f/num); } - - turb = BLI_turbulence(pd->noise_size, texvec[0]+vec[0], texvec[1]+vec[1], texvec[2]+vec[2], pd->noise_depth); + } + + if (pd->flag & TEX_PD_TURBULENCE) { + + if (pd->noise_influence == TEX_PD_NOISE_AGE) { + turb = BLI_turbulence(pd->noise_size, texvec[0]+age, texvec[1]+age, texvec[2]+age, pd->noise_depth); + } + else if (pd->noise_influence == TEX_PD_NOISE_TIME) { + time = R.cfra / (float)R.r.efra; + turb = BLI_turbulence(pd->noise_size, texvec[0]+time, texvec[1]+time, texvec[2]+time, pd->noise_depth); + } + else { + turb = BLI_turbulence(pd->noise_size, texvec[0]+vec[0], texvec[1]+vec[1], texvec[2]+vec[2], pd->noise_depth); + } + turb -= 0.5f; /* re-center 0.0-1.0 range around 0 to prevent offsetting result */ /* now we have an offset coordinate to use for the density lookup */ co[0] = texvec[0] + noise_fac * turb; co[1] = texvec[1] + noise_fac * turb; co[2] = texvec[2] + noise_fac * turb; + + /* reset and do a new BVH query with the perturbed coordinates */ + density = vec[0] = vec[1] = vec[2] = 0.0f; + num = BLI_bvhtree_range_query(pd->point_tree, co, pd->radius, accum_density, &pdr); + if (num > 0) { + age /= num; + VecMulf(vec, 1.0f/num); + } + } - BLI_bvhtree_range_query(pd->point_tree, co, pd->radius, accum_density, &pdr); - texres->tin = density; BRICONT; - texres->tr = vec[0]; - texres->tg = vec[1]; - texres->tb = vec[2]; - //texres->ta = density; + switch (pd->color_source) { + case TEX_PD_COLOR_PARTAGE: + if (pd->coba) { + if (do_colorband(pd->coba, age, col)) { + texres->talpha= 1; + QUATCOPY(&texres->tr, col); + texres->tin *= texres->ta; + } + } + break; + case TEX_PD_COLOR_PARTSPEED: + { + float speed = VecLength(vec) * pd->speed_scale; + + if (pd->coba) { + if (do_colorband(pd->coba, speed, col)) { + texres->talpha= 1; + QUATCOPY(&texres->tr, col); + texres->tin *= texres->ta; + } + } + break; + } + case TEX_PD_COLOR_PARTVEL: + VecMulf(vec, pd->speed_scale); + VECCOPY(&texres->tr, vec); + texres->ta = 1.0f; + break; + default: + texres->tr = texres->tg = texres->tb = texres->ta = 1.0f; + break; + } BRICONTRGB; return retval; diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index dbe3db871b4..b9ea4ebe9d6 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -427,6 +427,115 @@ void do_texbuts(unsigned short event) } } +static void colorband_pos_cb(void *coba_v, void *unused_v) +{ + ColorBand *coba= coba_v; + int a; + + if(coba->tot<2) return; + + for(a=0; atot; a++) coba->data[a].cur= a; + qsort(coba->data, coba->tot, sizeof(CBData), vergcband); + for(a=0; atot; a++) { + if(coba->data[a].cur==coba->cur) { + if(coba->cur!=a) addqueue(curarea->win, REDRAW, 0); /* button cur */ + coba->cur= a; + break; + } + } +} + +static void colorband_add_cb(void *coba_v, void *unused_v) +{ + ColorBand *coba= coba_v; + + if(coba->tot < MAXCOLORBAND-1) coba->tot++; + coba->cur= coba->tot-1; + + colorband_pos_cb(coba, NULL); + BIF_undo_push("Add colorband"); + +} + +static void colorband_del_cb(void *coba_v, void *unused_v) +{ + ColorBand *coba= coba_v; + int a; + + if(coba->tot<2) return; + + for(a=coba->cur; atot; a++) { + coba->data[a]= coba->data[a+1]; + } + if(coba->cur) coba->cur--; + coba->tot--; + + BIF_undo_push("Delete colorband"); + BIF_preview_changed(ID_TE); +} + + +/* offset aligns from bottom, standard width 300, height 115 */ +static void draw_colorband_buts(uiBlock *block, ColorBand *coba, int xoffs, int yoffs, int redraw) +{ + CBData *cbd; + uiBut *bt; + + if(coba==NULL) return; + + bt= uiDefBut(block, BUT, redraw, "Add", 80+xoffs,95+yoffs,37,20, 0, 0, 0, 0, 0, "Adds a new color position to the colorband"); + uiButSetFunc(bt, colorband_add_cb, coba, NULL); + uiDefButS(block, NUM, redraw, "Cur:", 117+xoffs,95+yoffs,81,20, &coba->cur, 0.0, (float)(coba->tot-1), 0, 0, "Displays the active color from the colorband"); + bt= uiDefBut(block, BUT, redraw, "Del", 199+xoffs,95+yoffs,37,20, 0, 0, 0, 0, 0, "Deletes the active position"); + uiButSetFunc(bt, colorband_del_cb, coba, NULL); + uiDefButS(block, ROW, redraw, "E", 236+xoffs,95+yoffs,16,20, &coba->ipotype, 5.0, 1.0, 0, 0, "Sets interpolation type 'Ease' (quadratic) "); + uiDefButS(block, ROW, redraw, "C", 252+xoffs,95+yoffs,16,20, &coba->ipotype, 5.0, 3.0, 0, 0, "Sets interpolation type Cardinal"); + uiDefButS(block, ROW, redraw, "L", 268+xoffs,95+yoffs,16,20, &coba->ipotype, 5.0, 0.0, 0, 0, "Sets interpolation type Linear"); + uiDefButS(block, ROW, redraw, "S", 284+xoffs,95+yoffs,16,20, &coba->ipotype, 5.0, 2.0, 0, 0, "Sets interpolation type B-Spline"); + + uiDefBut(block, BUT_COLORBAND, redraw, "", xoffs,65+yoffs,300,30, coba, 0, 0, 0, 0, ""); + + cbd= coba->data + coba->cur; + + uiBlockBeginAlign(block); + bt= uiDefButF(block, NUM, redraw, "Pos", xoffs,40+yoffs,110,20, &cbd->pos, 0.0, 1.0, 10, 0, "Sets the position of the active color"); + uiButSetFunc(bt, colorband_pos_cb, coba, NULL); + uiDefButF(block, COL, redraw, "", xoffs,20+yoffs,110,20, &(cbd->r), 0, 0, 0, B_BANDCOL, ""); + uiDefButF(block, NUMSLI, redraw, "A ", xoffs,yoffs,110,20, &cbd->a, 0.0, 1.0, 10, 0, "Sets the alpha value for this position"); + + uiBlockBeginAlign(block); + uiDefButF(block, NUMSLI, redraw, "R ", 115+xoffs,40+yoffs,185,20, &cbd->r, 0.0, 1.0, B_BANDCOL, 0, "Sets the red value for the active color"); + uiDefButF(block, NUMSLI, redraw, "G ", 115+xoffs,20+yoffs,185,20, &cbd->g, 0.0, 1.0, B_BANDCOL, 0, "Sets the green value for the active color"); + uiDefButF(block, NUMSLI, redraw, "B ", 115+xoffs,yoffs,185,20, &cbd->b, 0.0, 1.0, B_BANDCOL, 0, "Sets the blue value for the active color"); + uiBlockEndAlign(block); +} + +void draw_colorband_buts_small(uiBlock *block, ColorBand *coba, rctf *butr, int event) +{ + CBData *cbd; + uiBut *bt; + float unit= (butr->xmax-butr->xmin)/14.0f; + float xs= butr->xmin; + + cbd= coba->data + coba->cur; + + uiBlockBeginAlign(block); + uiDefButF(block, COL, event, "", xs,butr->ymin+20.0f,2.0f*unit,20, &(cbd->r), 0, 0, 0, B_BANDCOL, ""); + uiDefButF(block, NUM, event, "A:", xs+2.0f*unit,butr->ymin+20.0f,4.0f*unit,20, &(cbd->a), 0.0f, 1.0f, 10, 2, ""); + bt= uiDefBut(block, BUT, event, "Add", xs+6.0f*unit,butr->ymin+20.0f,2.0f*unit,20, NULL, 0, 0, 0, 0, "Adds a new color position to the colorband"); + uiButSetFunc(bt, colorband_add_cb, coba, NULL); + bt= uiDefBut(block, BUT, event, "Del", xs+8.0f*unit,butr->ymin+20.0f,2.0f*unit,20, NULL, 0, 0, 0, 0, "Deletes the active position"); + uiButSetFunc(bt, colorband_del_cb, coba, NULL); + uiDefButS(block, ROW, event, "E", xs+10.0f*unit,butr->ymin+20.0f,unit,20, &coba->ipotype, 5.0, 1.0, 0, 0, "Sets interpolation type 'Ease' (quadratic) "); + uiDefButS(block, ROW, event, "C", xs+11.0f*unit,butr->ymin+20.0f,unit,20, &coba->ipotype, 5.0, 3.0, 0, 0, "Sets interpolation type Cardinal"); + uiDefButS(block, ROW, event, "L", xs+12.0f*unit,butr->ymin+20.0f,unit,20, &coba->ipotype, 5.0, 0.0, 0, 0, "Sets interpolation type Linear"); + uiDefButS(block, ROW, event, "S", xs+13.0f*unit,butr->ymin+20.0f,unit,20, &coba->ipotype, 5.0, 2.0, 0, 0, "Sets interpolation type B-Spline"); + + uiDefBut(block, BUT_COLORBAND, event, "", xs,butr->ymin,butr->xmax-butr->xmin,20.0f, coba, 0, 0, 0, 0, ""); + uiBlockEndAlign(block); + +} + static void texture_panel_plugin(Tex *tex) { uiBlock *block; @@ -731,6 +840,87 @@ static void texture_panel_voronoi(Tex *tex) uiDefButF(block, NUMSLI, B_TEXPRV, "W4: ", 10, 10, 150, 19, &tex->vn_w4, -2.0, 2.0, 10, 0, "Sets feature weight 4"); } +static void texture_panel_pointdensity_modify(Tex *tex) +{ + uiBlock *block; + PointDensity *pd; + short yco=PANEL_YMAX, ymid; + + block= uiNewBlock(&curarea->uiblocks, "texture_panel_pointdensity_modify", UI_EMBOSS, UI_HELV, curarea->win); + if(uiNewPanel(curarea, block, "Modifiers", "Texture", PANELX, PANELY, PANELW, PANELH+20)==0) return; + uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE); + + if(tex->pd==NULL) { + tex->pd= BKE_add_pointdensity(); + } + if(!tex->pd) return; + + if (pd->source == TEX_PD_PSYS) { + uiDefBut(block, LABEL, B_NOP, "Color & Intensity By:", + X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + + uiBlockBeginAlign(block); + uiDefButS(block, MENU, B_TEXREDR_PRV, "Constant %x0|Particle Age %x1|Particle Speed %x2|Velocity -> RGB %x3|", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &pd->color_source, 0.0, 0.0, 0, 0, "Particle Life: Lifetime mapped as 0.0 - 1.0 intensity, Velocity: XYZ velocity mapped as RGB colours"); + if (ELEM(pd->color_source, TEX_PD_COLOR_PARTSPEED, TEX_PD_COLOR_PARTVEL)) { + uiDefButF(block, NUM, B_REDR, "Scale: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->speed_scale), 0.001, 100.0, 10, 2, "Multipler to bring particle speed within an acceptable range"); + } + uiBlockEndAlign(block); + + yco-= 2*BUTH; + + if (ELEM(pd->color_source, TEX_PD_COLOR_PARTAGE, TEX_PD_COLOR_PARTSPEED)) { + rctf rect = {X2CLM1, X2CLM1+BUTW1, yco, yco}; + if (tex->pd->coba == NULL) tex->pd->coba = add_colorband(1); + draw_colorband_buts_small(block, tex->pd->coba, &rect, B_TEXREDR_PRV); + } else { + /* spacer */ + uiDefBut(block, LABEL, B_NOP, "", + X2CLM2, yco, BUTW2, BUTH*2, 0, 0, 0, 0, 0, ""); + } + + if (!ELEM(pd->color_source, TEX_PD_COLOR_PARTSPEED, TEX_PD_COLOR_PARTVEL)) yco -= BUTH; + } + + ymid = yco -= YSPACE; + + uiDefButBitS(block, TOG, TEX_PD_TURBULENCE, B_REDR, "Turbulence", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->flag), 0, 0, 0, 0, "Add directed turbulence to the density estimation"); + + yco -= YSPACE; + + uiBlockBeginAlign(block); + if (pd->flag & TEX_PD_TURBULENCE) { + + uiDefButF(block, NUM, B_REDR, "Size: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_size), 0.001, 100.0, 10, 2, "Turbulence size"); + uiDefButS(block, NUM, B_REDR, "Depth: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_depth), 0.0, 100.0, 10, 2, "Turbulence depth"); + uiDefButF(block, NUM, B_REDR, "Strength: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_fac), 0.001, 100.0, 10, 2, ""); + + uiBlockEndAlign(block); + + yco = ymid - BUTH - YSPACE; + + uiDefBut(block, LABEL, B_NOP, "Noise Influence:", + X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + + if (pd->source == TEX_PD_PSYS) { + uiDefButS(block, MENU, B_REDR, "Noise Influence %t|Static %x0|Velocity %x1|Particle Age %x2|Time %x3", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(pd->noise_influence), 0.0, 0.0, 0, 0, "Noise Influence"); + } else if (pd->source == TEX_PD_OBJECT) { + uiDefButS(block, MENU, B_REDR, "Noise Influence %t|Static %x0|Time %x3", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(pd->noise_influence), 0.0, 0.0, 0, 0, "Noise Influence"); + } + } else { + uiDefBut(block, LABEL, B_NOP, "", + X2CLM2, yco-=2*BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + } + +} + static void texture_panel_pointdensity(Tex *tex) { uiBlock *block; @@ -738,102 +928,73 @@ static void texture_panel_pointdensity(Tex *tex) short yco=PANEL_YMAX; block= uiNewBlock(&curarea->uiblocks, "texture_panel_pointdensity", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Point Density", "Texture", PANELX, PANELY, PANELW, PANELH+25)==0) return; + if(uiNewPanel(curarea, block, "Point Density", "Texture", PANELX, PANELY, PANELW, PANELH)==0) return; uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE); if(tex->pd==NULL) { tex->pd= BKE_add_pointdensity(); tex->pd->object= OBACT; } - if(tex->pd) { - pd= tex->pd; + if(!tex->pd) return; + pd= tex->pd; - uiDefBut(block, LABEL, B_NOP, "Density estimation:", - X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + uiDefBut(block, LABEL, B_NOP, "Density estimation:", + X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); - uiDefButF(block, NUM, B_REDR, "Radius: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->radius), 0.001, 100.0, 10, 2, "Radius to look for nearby particles within"); - - yco -= YSPACE; - - uiDefBut(block, LABEL, B_NOP, "Falloff:", - X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + uiDefButF(block, NUM, B_REDR, "Radius: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->radius), 0.001, 100.0, 10, 2, "Radius to look for nearby particles within"); + + yco -= YSPACE; + + uiDefBut(block, LABEL, B_NOP, "Falloff:", + X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + uiBlockBeginAlign(block); + uiDefButS(block, MENU, B_REDR, "Standard %x0|Smooth %x1|Soft %x2|Constant %x3|Root %x4", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &pd->falloff_type, 0.0, 0.0, 0, 0, "Falloff type"); + if (pd->falloff_type == TEX_PD_FALLOFF_SOFT) { + uiDefButF(block, NUM, B_REDR, "Softness: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->falloff_softness), 1.0, 1024.0, 10, 2, "The intensity of the falloff"); + } + uiBlockEndAlign(block); + + yco = PANEL_YMAX; + + uiDefBut(block, LABEL, B_NOP, "Point data source:", + X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + + uiDefButS(block, MENU, B_TEXREDR_PRV, "Particle System %x0|Object Vertices %x1", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &pd->source, 0.0, 0.0, 0, 0, "Source"); + + yco -= YSPACE; + + if (pd->source == TEX_PD_PSYS) { uiBlockBeginAlign(block); - uiDefButS(block, MENU, B_REDR, "Standard %x0|Smooth %x1|Soft %x2|Constant %x3|Root %x4", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &pd->falloff_type, 0.0, 0.0, 0, 0, "Falloff type"); - if (pd->falloff_type == TEX_PD_FALLOFF_SOFT) { - uiDefButF(block, NUM, B_REDR, "Softness: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->falloff_softness), 1.0, 1024.0, 10, 2, "The intensity of the falloff"); + uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_REDR, "Ob:", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(pd->object), "Object that has the particle system"); + + if (pd->object && pd->object->particlesystem.first) { + uiDefButS(block, NUM, B_REDR, "PSys:", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(pd->psysindex), 1, 10, 10, 3, "Particle system number in the object"); } uiBlockEndAlign(block); yco -= YSPACE; - - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, TEX_PD_TURBULENCE, B_REDR, "Turbulence", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->flag), 0, 0, 0, 0, "Add directed turbulence to the density estimation"); - - if (pd->flag & TEX_PD_TURBULENCE) { - - uiDefButF(block, NUM, B_REDR, "Size: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_size), 0.001, 100.0, 10, 2, "Turbulence size"); - uiDefButS(block, NUM, B_REDR, "Depth: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_depth), 0.0, 100.0, 10, 2, "Turbulence depth"); - uiDefButF(block, NUM, B_REDR, "Strength: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_fac), 0.001, 100.0, 10, 2, ""); - - uiBlockEndAlign(block); - - yco -= YSPACE; - - if (pd->source == TEX_PD_PSYS) { - uiDefButS(block, MENU, B_REDR, "Noise Influence %t|Static %x0|Velocity %x1|Time %x2", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_influence), 0.0, 0.0, 0, 0, "Noise Influence"); - } - } - uiBlockEndAlign(block); - - yco = PANEL_YMAX; - - uiDefBut(block, LABEL, B_NOP, "Point data source:", + uiDefBut(block, LABEL, B_NOP, "Cache particles in:", X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); - - uiDefButS(block, MENU, B_TEXREDR_PRV, "Particle System %x0|Object Vertices %x1", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &pd->source, 0.0, 0.0, 0, 0, "Source"); + uiDefButS(block, MENU, B_TEXREDR_PRV, "Emit Object Location %x0|Emit Object Space %x1|Global Space %x2", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &pd->psys_cache_space, 0.0, 0.0, 0, 0, "Co-ordinate system to cache particles in"); + } + else if (pd->source == TEX_PD_OBJECT) { + uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_REDR, "Ob:", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(pd->object), "Object to render as points"); yco -= YSPACE; - if (pd->source == TEX_PD_PSYS) { - uiBlockBeginAlign(block); - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_REDR, "Ob:", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(pd->object), "Object that has the particle system"); - - if (pd->object && pd->object->particlesystem.first) { - uiDefButS(block, NUM, B_REDR, "PSys:", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(pd->psysindex), 1, 10, 10, 3, "Particle system number in the object"); - } - uiBlockEndAlign(block); - - yco -= YSPACE; - - uiDefBut(block, LABEL, B_NOP, "Cache particles in:", - X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); - uiDefButS(block, MENU, B_TEXREDR_PRV, "Emit Object Location %x0|Emit Object Space %x1|Global Space %x2", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &pd->psys_cache_space, 0.0, 0.0, 0, 0, "Co-ordinate system to cache particles in"); - - } - else if (pd->source == TEX_PD_OBJECT) { - uiDefIDPoinBut(block, test_obpoin_but, ID_OB, B_REDR, "Ob:", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(pd->object), "Object to render as points"); - - yco -= YSPACE; - - uiDefBut(block, LABEL, B_NOP, "Cache vertices in:", - X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); - uiDefButS(block, MENU, B_TEXREDR_PRV, "Object Location %x0|Object Space %x1|Global Space %x2", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &pd->ob_cache_space, 0.0, 0.0, 0, 0, "Co-ordinate system to cache vertices in"); - } + uiDefBut(block, LABEL, B_NOP, "Cache vertices in:", + X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + uiDefButS(block, MENU, B_TEXREDR_PRV, "Object Location %x0|Object Space %x1|Global Space %x2", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &pd->ob_cache_space, 0.0, 0.0, 0, 0, "Co-ordinate system to cache vertices in"); } } @@ -1514,115 +1675,6 @@ static void texture_panel_envmap(Tex *tex) } } -static void colorband_pos_cb(void *coba_v, void *unused_v) -{ - ColorBand *coba= coba_v; - int a; - - if(coba->tot<2) return; - - for(a=0; atot; a++) coba->data[a].cur= a; - qsort(coba->data, coba->tot, sizeof(CBData), vergcband); - for(a=0; atot; a++) { - if(coba->data[a].cur==coba->cur) { - if(coba->cur!=a) addqueue(curarea->win, REDRAW, 0); /* button cur */ - coba->cur= a; - break; - } - } -} - -static void colorband_add_cb(void *coba_v, void *unused_v) -{ - ColorBand *coba= coba_v; - - if(coba->tot < MAXCOLORBAND-1) coba->tot++; - coba->cur= coba->tot-1; - - colorband_pos_cb(coba, NULL); - BIF_undo_push("Add colorband"); - -} - -static void colorband_del_cb(void *coba_v, void *unused_v) -{ - ColorBand *coba= coba_v; - int a; - - if(coba->tot<2) return; - - for(a=coba->cur; atot; a++) { - coba->data[a]= coba->data[a+1]; - } - if(coba->cur) coba->cur--; - coba->tot--; - - BIF_undo_push("Delete colorband"); - BIF_preview_changed(ID_TE); -} - - -/* offset aligns from bottom, standard width 300, height 115 */ -static void draw_colorband_buts(uiBlock *block, ColorBand *coba, int xoffs, int yoffs, int redraw) -{ - CBData *cbd; - uiBut *bt; - - if(coba==NULL) return; - - bt= uiDefBut(block, BUT, redraw, "Add", 80+xoffs,95+yoffs,37,20, 0, 0, 0, 0, 0, "Adds a new color position to the colorband"); - uiButSetFunc(bt, colorband_add_cb, coba, NULL); - uiDefButS(block, NUM, redraw, "Cur:", 117+xoffs,95+yoffs,81,20, &coba->cur, 0.0, (float)(coba->tot-1), 0, 0, "Displays the active color from the colorband"); - bt= uiDefBut(block, BUT, redraw, "Del", 199+xoffs,95+yoffs,37,20, 0, 0, 0, 0, 0, "Deletes the active position"); - uiButSetFunc(bt, colorband_del_cb, coba, NULL); - uiDefButS(block, ROW, redraw, "E", 236+xoffs,95+yoffs,16,20, &coba->ipotype, 5.0, 1.0, 0, 0, "Sets interpolation type 'Ease' (quadratic) "); - uiDefButS(block, ROW, redraw, "C", 252+xoffs,95+yoffs,16,20, &coba->ipotype, 5.0, 3.0, 0, 0, "Sets interpolation type Cardinal"); - uiDefButS(block, ROW, redraw, "L", 268+xoffs,95+yoffs,16,20, &coba->ipotype, 5.0, 0.0, 0, 0, "Sets interpolation type Linear"); - uiDefButS(block, ROW, redraw, "S", 284+xoffs,95+yoffs,16,20, &coba->ipotype, 5.0, 2.0, 0, 0, "Sets interpolation type B-Spline"); - - uiDefBut(block, BUT_COLORBAND, redraw, "", xoffs,65+yoffs,300,30, coba, 0, 0, 0, 0, ""); - - cbd= coba->data + coba->cur; - - uiBlockBeginAlign(block); - bt= uiDefButF(block, NUM, redraw, "Pos", xoffs,40+yoffs,110,20, &cbd->pos, 0.0, 1.0, 10, 0, "Sets the position of the active color"); - uiButSetFunc(bt, colorband_pos_cb, coba, NULL); - uiDefButF(block, COL, redraw, "", xoffs,20+yoffs,110,20, &(cbd->r), 0, 0, 0, B_BANDCOL, ""); - uiDefButF(block, NUMSLI, redraw, "A ", xoffs,yoffs,110,20, &cbd->a, 0.0, 1.0, 10, 0, "Sets the alpha value for this position"); - - uiBlockBeginAlign(block); - uiDefButF(block, NUMSLI, redraw, "R ", 115+xoffs,40+yoffs,185,20, &cbd->r, 0.0, 1.0, B_BANDCOL, 0, "Sets the red value for the active color"); - uiDefButF(block, NUMSLI, redraw, "G ", 115+xoffs,20+yoffs,185,20, &cbd->g, 0.0, 1.0, B_BANDCOL, 0, "Sets the green value for the active color"); - uiDefButF(block, NUMSLI, redraw, "B ", 115+xoffs,yoffs,185,20, &cbd->b, 0.0, 1.0, B_BANDCOL, 0, "Sets the blue value for the active color"); - uiBlockEndAlign(block); -} - -void draw_colorband_buts_small(uiBlock *block, ColorBand *coba, rctf *butr, int event) -{ - CBData *cbd; - uiBut *bt; - float unit= (butr->xmax-butr->xmin)/14.0f; - float xs= butr->xmin; - - cbd= coba->data + coba->cur; - - uiBlockBeginAlign(block); - uiDefButF(block, COL, event, "", xs,butr->ymin+20.0f,2.0f*unit,20, &(cbd->r), 0, 0, 0, B_BANDCOL, ""); - uiDefButF(block, NUM, event, "A:", xs+2.0f*unit,butr->ymin+20.0f,4.0f*unit,20, &(cbd->a), 0.0f, 1.0f, 10, 2, ""); - bt= uiDefBut(block, BUT, event, "Add", xs+6.0f*unit,butr->ymin+20.0f,2.0f*unit,20, NULL, 0, 0, 0, 0, "Adds a new color position to the colorband"); - uiButSetFunc(bt, colorband_add_cb, coba, NULL); - bt= uiDefBut(block, BUT, event, "Del", xs+8.0f*unit,butr->ymin+20.0f,2.0f*unit,20, NULL, 0, 0, 0, 0, "Deletes the active position"); - uiButSetFunc(bt, colorband_del_cb, coba, NULL); - uiDefButS(block, ROW, event, "E", xs+10.0f*unit,butr->ymin+20.0f,unit,20, &coba->ipotype, 5.0, 1.0, 0, 0, "Sets interpolation type 'Ease' (quadratic) "); - uiDefButS(block, ROW, event, "C", xs+11.0f*unit,butr->ymin+20.0f,unit,20, &coba->ipotype, 5.0, 3.0, 0, 0, "Sets interpolation type Cardinal"); - uiDefButS(block, ROW, event, "L", xs+12.0f*unit,butr->ymin+20.0f,unit,20, &coba->ipotype, 5.0, 0.0, 0, 0, "Sets interpolation type Linear"); - uiDefButS(block, ROW, event, "S", xs+13.0f*unit,butr->ymin+20.0f,unit,20, &coba->ipotype, 5.0, 2.0, 0, 0, "Sets interpolation type B-Spline"); - - uiDefBut(block, BUT_COLORBAND, event, "", xs,butr->ymin,butr->xmax-butr->xmin,20.0f, coba, 0, 0, 0, 0, ""); - uiBlockEndAlign(block); - -} - static void texture_panel_colors(Tex *tex) { uiBlock *block; @@ -4833,6 +4885,7 @@ void texture_panels() break; case TEX_POINTDENSITY: texture_panel_pointdensity(tex); + texture_panel_pointdensity_modify(tex); break; } } From 3b2f996c25e911fb6497fd45b3b4a5ab5e5609ac Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 10 Nov 2008 00:14:35 +0000 Subject: [PATCH 057/577] Point Density * Fixed a stupid crash caused by last commit that worked fine on the mac (but never should have...) * Fix for using child particles with the new particle age color options --- source/blender/blenkernel/intern/texture.c | 2 + .../render/intern/source/pointdensity.c | 14 +- source/blender/src/buttons_shading.c | 162 +++++++++--------- 3 files changed, 94 insertions(+), 84 deletions(-) diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 76ef6bdb4e8..1bb4ef3eeff 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -873,6 +873,7 @@ 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; @@ -886,6 +887,7 @@ PointDensity *BKE_add_pointdensity(void) pd->coba = add_colorband(1); pd->speed_scale = 1.0f; pd->totpoints = 0; + pd->coba = add_colorband(1); return pd; } diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index db3e57e0b79..af2a7edae06 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -71,7 +71,7 @@ static int point_data_used(PointDensity *pd) /* additional data stored alongside the point density BVH, * accessible by point index number to retrieve other information * such as particle velocity or lifetime */ -static void make_point_data(PointDensity *pd, int total_particles, int point_data_used) +static void alloc_point_data(PointDensity *pd, int total_particles, int point_data_used) { int data_size = 0; @@ -123,7 +123,7 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa psys->lattice=psys_get_lattice(ob,psys); pd->point_tree = BLI_bvhtree_new(total_particles, 0.0, 4, 6); - make_point_data(pd, total_particles, data_used); + alloc_point_data(pd, total_particles, data_used); pd->totpoints = total_particles; if (data_used & POINT_DATA_VEL) offset = pd->totpoints*3; @@ -155,7 +155,15 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa pd->point_data[i*3 + 2] = state.vel[2]; } if (data_used & POINT_DATA_LIFE) { - float pa_time = (cfra - pa->time)/pa->lifetime; + float pa_time; + + if (i < psys->totpart) { + pa_time = (cfra - pa->time)/pa->lifetime; + } else { + ChildParticle *cpa= (psys->child + i) - psys->totpart; + pa_time = psys_get_child_time(psys, cpa, cfra); + } + pd->point_data[offset + i] = pa_time; } } diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index b9ea4ebe9d6..5ed39764af0 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -840,87 +840,6 @@ static void texture_panel_voronoi(Tex *tex) uiDefButF(block, NUMSLI, B_TEXPRV, "W4: ", 10, 10, 150, 19, &tex->vn_w4, -2.0, 2.0, 10, 0, "Sets feature weight 4"); } -static void texture_panel_pointdensity_modify(Tex *tex) -{ - uiBlock *block; - PointDensity *pd; - short yco=PANEL_YMAX, ymid; - - block= uiNewBlock(&curarea->uiblocks, "texture_panel_pointdensity_modify", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Modifiers", "Texture", PANELX, PANELY, PANELW, PANELH+20)==0) return; - uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - if(tex->pd==NULL) { - tex->pd= BKE_add_pointdensity(); - } - if(!tex->pd) return; - - if (pd->source == TEX_PD_PSYS) { - uiDefBut(block, LABEL, B_NOP, "Color & Intensity By:", - X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); - - uiBlockBeginAlign(block); - uiDefButS(block, MENU, B_TEXREDR_PRV, "Constant %x0|Particle Age %x1|Particle Speed %x2|Velocity -> RGB %x3|", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &pd->color_source, 0.0, 0.0, 0, 0, "Particle Life: Lifetime mapped as 0.0 - 1.0 intensity, Velocity: XYZ velocity mapped as RGB colours"); - if (ELEM(pd->color_source, TEX_PD_COLOR_PARTSPEED, TEX_PD_COLOR_PARTVEL)) { - uiDefButF(block, NUM, B_REDR, "Scale: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->speed_scale), 0.001, 100.0, 10, 2, "Multipler to bring particle speed within an acceptable range"); - } - uiBlockEndAlign(block); - - yco-= 2*BUTH; - - if (ELEM(pd->color_source, TEX_PD_COLOR_PARTAGE, TEX_PD_COLOR_PARTSPEED)) { - rctf rect = {X2CLM1, X2CLM1+BUTW1, yco, yco}; - if (tex->pd->coba == NULL) tex->pd->coba = add_colorband(1); - draw_colorband_buts_small(block, tex->pd->coba, &rect, B_TEXREDR_PRV); - } else { - /* spacer */ - uiDefBut(block, LABEL, B_NOP, "", - X2CLM2, yco, BUTW2, BUTH*2, 0, 0, 0, 0, 0, ""); - } - - if (!ELEM(pd->color_source, TEX_PD_COLOR_PARTSPEED, TEX_PD_COLOR_PARTVEL)) yco -= BUTH; - } - - ymid = yco -= YSPACE; - - uiDefButBitS(block, TOG, TEX_PD_TURBULENCE, B_REDR, "Turbulence", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->flag), 0, 0, 0, 0, "Add directed turbulence to the density estimation"); - - yco -= YSPACE; - - uiBlockBeginAlign(block); - if (pd->flag & TEX_PD_TURBULENCE) { - - uiDefButF(block, NUM, B_REDR, "Size: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_size), 0.001, 100.0, 10, 2, "Turbulence size"); - uiDefButS(block, NUM, B_REDR, "Depth: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_depth), 0.0, 100.0, 10, 2, "Turbulence depth"); - uiDefButF(block, NUM, B_REDR, "Strength: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_fac), 0.001, 100.0, 10, 2, ""); - - uiBlockEndAlign(block); - - yco = ymid - BUTH - YSPACE; - - uiDefBut(block, LABEL, B_NOP, "Noise Influence:", - X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); - - if (pd->source == TEX_PD_PSYS) { - uiDefButS(block, MENU, B_REDR, "Noise Influence %t|Static %x0|Velocity %x1|Particle Age %x2|Time %x3", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(pd->noise_influence), 0.0, 0.0, 0, 0, "Noise Influence"); - } else if (pd->source == TEX_PD_OBJECT) { - uiDefButS(block, MENU, B_REDR, "Noise Influence %t|Static %x0|Time %x3", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(pd->noise_influence), 0.0, 0.0, 0, 0, "Noise Influence"); - } - } else { - uiDefBut(block, LABEL, B_NOP, "", - X2CLM2, yco-=2*BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); - } - -} - static void texture_panel_pointdensity(Tex *tex) { uiBlock *block; @@ -999,6 +918,87 @@ static void texture_panel_pointdensity(Tex *tex) } +static void texture_panel_pointdensity_modify(Tex *tex) +{ + uiBlock *block; + PointDensity *pd; + short yco=PANEL_YMAX, ymid; + + block= uiNewBlock(&curarea->uiblocks, "texture_panel_pointdensity_modify", UI_EMBOSS, UI_HELV, curarea->win); + if(uiNewPanel(curarea, block, "Modifiers", "Texture", PANELX, PANELY, PANELW, PANELH+20)==0) return; + uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE); + + if(tex->pd==NULL) { + tex->pd= BKE_add_pointdensity(); + } + if(!tex->pd) return; + pd= tex->pd; + + if (pd->source == TEX_PD_PSYS) { + uiDefBut(block, LABEL, B_NOP, "Color & Intensity By:", + X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + + uiBlockBeginAlign(block); + uiDefButS(block, MENU, B_TEXREDR_PRV, "Constant %x0|Particle Age %x1|Particle Speed %x2|Velocity -> RGB %x3|", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &pd->color_source, 0.0, 0.0, 0, 0, "Particle Life: Lifetime mapped as 0.0 - 1.0 intensity, Velocity: XYZ velocity mapped as RGB colours"); + if (ELEM(pd->color_source, TEX_PD_COLOR_PARTSPEED, TEX_PD_COLOR_PARTVEL)) { + uiDefButF(block, NUM, B_REDR, "Scale: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->speed_scale), 0.001, 100.0, 10, 2, "Multipler to bring particle speed within an acceptable range"); + } + uiBlockEndAlign(block); + + yco-= 2*BUTH; + + + if (ELEM(pd->color_source, TEX_PD_COLOR_PARTAGE, TEX_PD_COLOR_PARTSPEED)) { + rctf rect = {X2CLM1, X2CLM1+BUTW1, yco, yco}; + if (pd->coba == NULL) pd->coba = add_colorband(1); + draw_colorband_buts_small(block, pd->coba, &rect, B_TEXREDR_PRV); + } else { + uiDefBut(block, LABEL, B_NOP, "", + X2CLM2, yco, BUTW2, BUTH*2, 0, 0, 0, 0, 0, ""); + } + + if (!ELEM(pd->color_source, TEX_PD_COLOR_PARTSPEED, TEX_PD_COLOR_PARTVEL)) yco -= BUTH; + } + + ymid = yco -= YSPACE; + + uiDefButBitS(block, TOG, TEX_PD_TURBULENCE, B_REDR, "Turbulence", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->flag), 0, 0, 0, 0, "Add directed turbulence to the density estimation"); + + yco -= YSPACE; + + uiBlockBeginAlign(block); + if (pd->flag & TEX_PD_TURBULENCE) { + + uiDefButF(block, NUM, B_REDR, "Size: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_size), 0.001, 100.0, 10, 2, "Turbulence size"); + uiDefButS(block, NUM, B_REDR, "Depth: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_depth), 0.0, 100.0, 10, 2, "Turbulence depth"); + uiDefButF(block, NUM, B_REDR, "Strength: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_fac), 0.001, 100.0, 10, 2, ""); + + uiBlockEndAlign(block); + + yco = ymid - BUTH - YSPACE; + + uiDefBut(block, LABEL, B_NOP, "Noise Influence:", + X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + + if (pd->source == TEX_PD_PSYS) { + uiDefButS(block, MENU, B_REDR, "Noise Influence %t|Static %x0|Velocity %x1|Particle Age %x2|Time %x3", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(pd->noise_influence), 0.0, 0.0, 0, 0, "Noise Influence"); + } else if (pd->source == TEX_PD_OBJECT) { + uiDefButS(block, MENU, B_REDR, "Noise Influence %t|Static %x0|Time %x3", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(pd->noise_influence), 0.0, 0.0, 0, 0, "Noise Influence"); + } + } else { + uiDefBut(block, LABEL, B_NOP, "", + X2CLM2, yco-=2*BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + } + +} static char *layer_menu(RenderResult *rr, short *curlay) { From bf747a30af000c024ecb9e98a295a54dd286d0b3 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 11 Nov 2008 23:24:10 +0000 Subject: [PATCH 058/577] * Added a button to the volume material controls 'Alpha' to generate an alpha channel based on the volume's transmission properties, allowing you to use it in comp etc. I'd rather not have this button at all, and make it just work properly by default, however it causes problems with overlapping volumes when 'premul' is on (stoopid thing..) so for the time being, there's the button. I'll try and fix this up later on when I have more time. --- source/blender/makesdna/DNA_material_types.h | 1 + source/blender/render/intern/source/volumetric.c | 16 ++++++++++++---- source/blender/src/buttons_shading.c | 6 ++++++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index 66f23c7905d..f332537e9a8 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -359,6 +359,7 @@ typedef struct Material { #define MA_VOL_ATTENUATED 2 #define MA_VOL_RECVSHADOW 4 #define MA_VOL_PRECACHESHADING 8 +#define MA_VOL_USEALPHA 16 /* vol_phasefunc_type */ #define MA_VOL_PH_ISOTROPIC 0 diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 02ebbd83c31..52d23de45ff 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -656,8 +656,12 @@ void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr) shr->combined[1] = col[1]; shr->combined[2] = col[2]; - //if (col[3] > 1.0f) - col[3] = 1.0f; + if (shi->mat->vol_shadeflag & MA_VOL_USEALPHA) { + if (col[3] > 1.0f) + col[3] = 1.0f; + } + else + col[3] = 1.0f; shr->combined[3] = col[3]; shr->alpha = col[3]; @@ -683,8 +687,12 @@ void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr) shr->combined[1] = col[1]; shr->combined[2] = col[2]; - //if (col[3] > 1.0f) - col[3] = 1.0f; + if (shi->mat->vol_shadeflag & MA_VOL_USEALPHA) { + if (col[3] > 1.0f) + col[3] = 1.0f; + } + else + col[3] = 1.0f; shr->combined[3] = col[3]; shr->alpha = col[3]; diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 5ed39764af0..3e5f5305033 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -4447,6 +4447,12 @@ static void material_panel_material_volume(Material *ma) uiBlockEndAlign(block); } + yco -= YSPACE; + + uiDefButBitS(block, TOG, MA_VOL_USEALPHA, B_MATPRV, "Alpha", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shadeflag), 0, 0, 0, 0, "Generate an alpha channel (causes problems with Premul)"); + + /*uiDefButBitS(block, TOG, MA_VOL_RECVSHADOW, B_MATPRV, "Receive Shadows", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shadeflag), 0, 0, 0, 0, "Receive shadows from external objects"); */ From a2da0911a6da23dc420f7a25fc258ae048913b7a Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 13 Nov 2008 10:43:02 +0000 Subject: [PATCH 059/577] * Fixed a float -> int conversion rounding error in volume rendering, which was manifesting in little dark dots --- source/blender/render/intern/source/volumetric.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 52d23de45ff..1c0828d868c 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -335,7 +335,7 @@ void vol_get_attenuation(ShadeInput *shi, float *tau, float *co, float *endco, f vol_get_absorption(shi, absorb_col, co); dist = VecLenf(co, endco); - nsteps = (int)ceil(dist / stepsize); + nsteps = (int)((dist / stepsize) + 0.5); /* trigger for recalculating density */ if (density < -0.001f) density = vol_get_density(shi, co); @@ -491,7 +491,7 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float tr[0] = tr[1] = tr[2] = 1.0f; /* ray marching */ - nsteps = (int)ceil(VecLenf(co, endco) / stepsize); + nsteps = (int)((VecLenf(co, endco) / stepsize) + 0.5); VecSubf(vec, endco, co); VECCOPY(stepvec, vec); From 8d5c14b20d61d990691ccaecefc3b5cbce449ef5 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Fri, 14 Nov 2008 06:01:06 +0000 Subject: [PATCH 060/577] Volume rendering: * Use a slightly better (but still not exact) approximation for the view vector when pre-shading the light cache. This still doesn't give exactly the same results as non-light-cache shading, but it's better. Will investigate getting a better view vector when there's more time - or if anyone has a simple formula to derive shi->view from shi->co that would be great to hear about too :) --- source/blender/render/intern/source/volumetric.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 1c0828d868c..83c25ad68c6 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -984,7 +984,7 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m for (z=0; z < res; z++) { co[2] = bbmin[2] + (voxel[2] * z); - + time= PIL_check_seconds_timer(); i++; @@ -1012,6 +1012,9 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m obi->volume_precache[2*res_3 + x*res_2 + y*res + z] = -1.0f; continue; } + + VECCOPY(shi.view, co); + Normalize(shi.view); density = vol_get_density(&shi, co); vol_get_scattering(&shi, scatter_col, co, stepsize, density); From e6a903c06e24ce9afd7b6e3de70e36fa450171d6 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sat, 15 Nov 2008 04:16:46 +0000 Subject: [PATCH 061/577] cleaned some code and split volume precaching into a new file --- .../render/intern/include/volume_precache.h | 30 + .../render/intern/include/volumetric.h | 17 +- .../render/intern/source/convertblender.c | 1 + .../render/intern/source/volume_precache.c | 356 +++++++++++ .../blender/render/intern/source/volumetric.c | 566 ++++-------------- 5 files changed, 509 insertions(+), 461 deletions(-) create mode 100644 source/blender/render/intern/include/volume_precache.h create mode 100644 source/blender/render/intern/source/volume_precache.c diff --git a/source/blender/render/intern/include/volume_precache.h b/source/blender/render/intern/include/volume_precache.h new file mode 100644 index 00000000000..7a719840f48 --- /dev/null +++ b/source/blender/render/intern/include/volume_precache.h @@ -0,0 +1,30 @@ +/** + * + * ***** 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 ***** + */ + +void volume_precache(Render *re); +void free_volume_precache(Render *re); \ No newline at end of file diff --git a/source/blender/render/intern/include/volumetric.h b/source/blender/render/intern/include/volumetric.h index fb87035145f..a69238f54b3 100644 --- a/source/blender/render/intern/include/volumetric.h +++ b/source/blender/render/intern/include/volumetric.h @@ -21,12 +21,23 @@ * * The Original Code is: all of this file. * - * Contributor(s): Farsthary (Raul FHernandez), Matt Ebb. + * Contributor(s): Matt Ebb. * * ***** END GPL LICENSE BLOCK ***** */ +float vol_get_stepsize(struct ShadeInput *shi, int context); +float vol_get_density(struct ShadeInput *shi, float *co); +void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsize, float density); + void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr); void volume_trace_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct Isect *last_is); -void volume_precache(Render *re); -void free_volume_precache(Render *re); \ No newline at end of file + +#define STEPSIZE_VIEW 0 +#define STEPSIZE_SHADE 1 + +#define VOL_IS_BACKFACE 1 +#define VOL_IS_SAMEMATERIAL 2 + +#define VOL_BOUNDS_DEPTH 0 +#define VOL_BOUNDS_SS 1 \ No newline at end of file diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 45e934e5273..b9b151ab9fd 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -113,6 +113,7 @@ #include "shading.h" #include "strand.h" #include "texture.h" +#include "volume_precache.h" #include "sss.h" #include "strand.h" #include "zbuf.h" diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c new file mode 100644 index 00000000000..5b43aa8f935 --- /dev/null +++ b/source/blender/render/intern/source/volume_precache.c @@ -0,0 +1,356 @@ +/** + * + * ***** 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 ***** + */ + +#include +#include +#include +#include + +#include "MEM_guardedalloc.h" + +#include "BLI_blenlib.h" +#include "BLI_arithb.h" + +#include "PIL_time.h" + +#include "RE_shader_ext.h" +#include "RE_raytrace.h" + +#include "DNA_material_types.h" + +#include "render_types.h" +#include "renderdatabase.h" +#include "volumetric.h" + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* defined in pipeline.c, is hardcopy of active dynamic allocated Render */ +/* only to be used here in this file, it's for speed */ +extern struct Render R; +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + + +/* Recursive test for intersections, from a point inside the mesh, to outside + * Number of intersections (depth) determine if a point is inside or outside the mesh */ +int intersect_outside_volume(RayTree *tree, Isect *isect, float *offset, int limit, int depth) +{ + if (limit == 0) return depth; + + if (RE_ray_tree_intersect(tree, isect)) { + float hitco[3]; + + hitco[0] = isect->start[0] + isect->labda*isect->vec[0]; + hitco[1] = isect->start[1] + isect->labda*isect->vec[1]; + hitco[2] = isect->start[2] + isect->labda*isect->vec[2]; + VecAddf(isect->start, hitco, offset); + + return intersect_outside_volume(tree, isect, offset, limit-1, depth+1); + } else { + return depth; + } +} + +/* Uses ray tracing to check if a point is inside or outside an ObjectInstanceRen */ +int point_inside_obi(RayTree *tree, ObjectInstanceRen *obi, float *co) +{ + float maxsize = RE_ray_tree_max_size(tree); + Isect isect; + float vec[3] = {0.0f,0.0f,1.0f}; + int final_depth=0, depth=0, limit=20; + + /* set up the isect */ + memset(&isect, 0, sizeof(isect)); + VECCOPY(isect.start, co); + isect.end[0] = co[0] + vec[0] * maxsize; + isect.end[1] = co[1] + vec[1] * maxsize; + isect.end[2] = co[2] + vec[2] * maxsize; + + /* and give it a little offset to prevent self-intersections */ + VecMulf(vec, 1e-5); + VecAddf(isect.start, isect.start, vec); + + isect.mode= RE_RAY_MIRROR; + isect.face_last= NULL; + isect.lay= -1; + + final_depth = intersect_outside_volume(tree, &isect, vec, limit, depth); + + /* even number of intersections: point is outside + * odd number: point is inside */ + if (final_depth % 2 == 0) return 0; + else return 1; +} + +static int inside_check_func(Isect *is, int ob, RayFace *face) +{ + return 1; +} +static void vlr_face_coords(RayFace *face, float **v1, float **v2, float **v3, float **v4) +{ + VlakRen *vlr= (VlakRen*)face; + + *v1 = (vlr->v1)? vlr->v1->co: NULL; + *v2 = (vlr->v2)? vlr->v2->co: NULL; + *v3 = (vlr->v3)? vlr->v3->co: NULL; + *v4 = (vlr->v4)? vlr->v4->co: NULL; +} + +RayTree *create_raytree_obi(ObjectInstanceRen *obi, float *bbmin, float *bbmax) +{ + int v; + VlakRen *vlr= NULL; + + /* create empty raytree */ + RayTree *tree = RE_ray_tree_create(64, obi->obr->totvlak, bbmin, bbmax, + vlr_face_coords, inside_check_func, NULL, NULL); + + /* fill it with faces */ + for(v=0; vobr->totvlak; v++) { + if((v & 255)==0) + vlr= obi->obr->vlaknodes[v>>8].vlak; + else + vlr++; + + RE_ray_tree_add_face(tree, 0, vlr); + } + + RE_ray_tree_done(tree); + + return tree; +} + +static float get_avg_surrounds(float *cache, int res, int res_2, int res_3, int rgb, int xx, int yy, int zz) +{ + int x, y, z, x_, y_, z_; + int added=0; + float tot=0.0f; + int i; + + for (x=-1; x <= 1; x++) { + x_ = xx+x; + if (x_ >= 0 && x_ <= res-1) { + + for (y=-1; y <= 1; y++) { + y_ = yy+y; + if (y_ >= 0 && y_ <= res-1) { + + for (z=-1; z <= 1; z++) { + z_ = zz+z; + if (z_ >= 0 && z_ <= res-1) { + + i = rgb*res_3 + x_*res_2 + y_*res + z_; + if (cache[i] > 0.0f) { + tot += cache[i]; + added++; + } + + } + } + } + } + } + } + + tot /= added; + + return ((added>0)?tot:0.0f); +} + +/* function to filter the edges of the light cache, where there was no volume originally. + * For each voxel which was originally external to the mesh, it finds the average values of + * the surrounding internal voxels and sets the original external voxel to that average amount. + * Works almost a bit like a 'dilate' filter */ +static void lightcache_filter(float *cache, int res) +{ + int x, y, z, rgb; + int res_2, res_3; + int i; + + res_2 = res*res; + res_3 = res*res*res; + + for (x=0; x < res; x++) { + for (y=0; y < res; y++) { + for (z=0; z < res; z++) { + for (rgb=0; rgb < 3; rgb++) { + i = rgb*res_3 + x*res_2 + y*res + z; + + /* trigger for outside mesh */ + if (cache[i] < 0.5f) cache[i] = get_avg_surrounds(cache, res, res_2, res_3, rgb, x, y, z); + } + } + } + } +} + +/* Precache a volume into a 3D voxel grid. + * The voxel grid is stored in the ObjectInstanceRen, + * in camera space, aligned with the ObjectRen's bounding box. + * Resolution is defined by the user. + */ +void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *ma, float *bbmin, float *bbmax) +{ + int x, y, z; + + float co[3], voxel[3], scatter_col[3]; + ShadeInput shi; + float view[3] = {0.0,0.0,-1.0}; + float density; + float stepsize; + + float resf, res_3f; + int res_2, res_3; + + float i = 1.0f; + double time, lasttime= PIL_check_seconds_timer(); + const int res = ma->vol_precache_resolution; + RayTree *tree; + + R = *re; + + /* create a raytree with just the faces of the instanced ObjectRen, + * used for checking if the cached point is inside or outside. */ + tree = create_raytree_obi(obi, bbmin, bbmax); + if (!tree) return; + + /* Need a shadeinput to calculate scattering */ + memset(&shi, 0, sizeof(ShadeInput)); + shi.depth= 1; + shi.mask= 1; + shi.mat = ma; + shi.vlr = NULL; + memcpy(&shi.r, &shi.mat->r, 23*sizeof(float)); // note, keep this synced with render_types.h + shi.har= shi.mat->har; + shi.obi= obi; + shi.obr= obi->obr; + shi.lay = re->scene->lay; + VECCOPY(shi.view, view); + + stepsize = vol_get_stepsize(&shi, STEPSIZE_VIEW); + + resf = (float)res; + res_2 = res*res; + res_3 = res*res*res; + res_3f = (float)res_3; + + VecSubf(voxel, bbmax, bbmin); + if ((voxel[0] < FLT_EPSILON) || (voxel[1] < FLT_EPSILON) || (voxel[2] < FLT_EPSILON)) + return; + VecMulf(voxel, 1.0f/res); + + obi->volume_precache = MEM_callocN(sizeof(float)*res_3*3, "volume light cache"); + + /* Iterate over the 3d voxel grid, and fill the voxels with scattering information + * + * It's stored in memory as 3 big float grids next to each other, one for each RGB channel. + * I'm guessing the memory alignment may work out better this way for the purposes + * of doing linear interpolation, but I haven't actually tested this theory! :) + */ + for (x=0; x < res; x++) { + co[0] = bbmin[0] + (voxel[0] * x); + + for (y=0; y < res; y++) { + co[1] = bbmin[1] + (voxel[1] * y); + + for (z=0; z < res; z++) { + co[2] = bbmin[2] + (voxel[2] * z); + + time= PIL_check_seconds_timer(); + i++; + + /* display progress every second */ + if(re->test_break()) { + if(tree) { + RE_ray_tree_free(tree); + tree= NULL; + } + return; + } + if(time-lasttime>1.0f) { + char str[64]; + sprintf(str, "Precaching volume: %d%%", (int)(100.0f * (i / res_3f))); + re->i.infostr= str; + re->stats_draw(&re->i); + re->i.infostr= NULL; + lasttime= time; + } + + /* don't bother if the point is not inside the volume mesh */ + if (!point_inside_obi(tree, obi, co)) { + obi->volume_precache[0*res_3 + x*res_2 + y*res + z] = -1.0f; + obi->volume_precache[1*res_3 + x*res_2 + y*res + z] = -1.0f; + obi->volume_precache[2*res_3 + x*res_2 + y*res + z] = -1.0f; + continue; + } + density = vol_get_density(&shi, co); + vol_get_scattering(&shi, scatter_col, co, stepsize, density); + + obi->volume_precache[0*res_3 + x*res_2 + y*res + z] = scatter_col[0]; + obi->volume_precache[1*res_3 + x*res_2 + y*res + z] = scatter_col[1]; + obi->volume_precache[2*res_3 + x*res_2 + y*res + z] = scatter_col[2]; + } + } + } + + if(tree) { + RE_ray_tree_free(tree); + tree= NULL; + } + + lightcache_filter(obi->volume_precache, res); + +} + +/* loop through all objects (and their associated materials) + * marked for pre-caching in convertblender.c, and pre-cache them */ +void volume_precache(Render *re) +{ + ObjectInstanceRen *obi; + VolPrecache *vp; + + for(vp= re->vol_precache_obs.first; vp; vp= vp->next) { + for(obi= re->instancetable.first; obi; obi= obi->next) { + if (obi->obr == vp->obr) + vol_precache_objectinstance(re, obi, vp->ma, obi->obr->boundbox[0], obi->obr->boundbox[1]); + } + } + + re->i.infostr= NULL; + re->stats_draw(&re->i); +} + +void free_volume_precache(Render *re) +{ + ObjectInstanceRen *obi; + + for(obi= re->instancetable.first; obi; obi= obi->next) { + if (obi->volume_precache) + MEM_freeN(obi->volume_precache); + } + + BLI_freelistN(&re->vol_precache_obs); +} diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 83c25ad68c6..86705232b1e 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -27,8 +27,8 @@ */ #include -#include #include +#include #include #include "MEM_guardedalloc.h" @@ -36,9 +36,6 @@ #include "BLI_blenlib.h" #include "BLI_arithb.h" #include "BLI_rand.h" -#include "BLI_kdtree.h" - -#include "PIL_time.h" #include "RE_shader_ext.h" #include "RE_raytrace.h" @@ -48,13 +45,12 @@ #include "DNA_lamp_types.h" #include "BKE_global.h" -#include "BKE_main.h" #include "render_types.h" -#include "renderdatabase.h" #include "pixelshading.h" #include "shading.h" #include "texture.h" +#include "volumetric.h" #if defined( _MSC_VER ) && !defined( __cplusplus ) # define inline __inline @@ -75,29 +71,6 @@ static int vol_backface_intersect_check(Isect *is, int ob, RayFace *face) return (INPR(is->vec, vlr->n) < 0.0f); } -#if 0 -static int vol_frontface_intersect_check(Isect *is, int ob, RayFace *face) -{ - VlakRen *vlr = (VlakRen *)face; - - /* only consider faces away, so overlapping layers - * of foward facing geometry don't cause the ray to stop */ - return (INPR(is->vec, vlr->n) > 0.0f); -} - -static int vol_always_intersect_check(Isect *is, int ob, RayFace *face) -{ - return 1; -} -#endif - -#define VOL_IS_BACKFACE 1 -#define VOL_IS_SAMEMATERIAL 2 - - -#define VOL_BOUNDS_DEPTH 0 -#define VOL_BOUNDS_SS 1 - /* TODO: Box or sphere intersection types could speed things up */ static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, Isect *isect, int intersect_type, int checkfunc) { @@ -139,8 +112,6 @@ static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, } } -#define STEPSIZE_VIEW 0 -#define STEPSIZE_SHADE 1 float vol_get_stepsize(struct ShadeInput *shi, int context) { if (shi->mat->vol_stepsize_type == MA_VOL_STEP_RANDOMIZED) { @@ -152,8 +123,7 @@ float vol_get_stepsize(struct ShadeInput *shi, int context) else if (context == STEPSIZE_SHADE) return shi->mat->vol_shade_stepsize * rnd; } - else { - // MA_VOL_STEP_CONSTANT + else { // MA_VOL_STEP_CONSTANT if (context == STEPSIZE_VIEW) return shi->mat->vol_stepsize; @@ -164,6 +134,81 @@ float vol_get_stepsize(struct ShadeInput *shi, int context) return shi->mat->vol_stepsize; } +/* SHADING */ + +static float D(ShadeInput *shi, int rgb, int x, int y, int z) +{ + const int res = shi->mat->vol_precache_resolution; + CLAMP(x, 0, res-1); + CLAMP(y, 0, res-1); + CLAMP(z, 0, res-1); + return shi->obi->volume_precache[rgb*res*res*res + x*res*res + y*res + z]; +} + +inline float lerp(float t, float v1, float v2) { + return (1.f - t) * v1 + t * v2; +} + +/* trilinear interpolation */ +static void vol_get_precached_scattering(ShadeInput *shi, float *scatter_col, float *co) +{ + const int res = shi->mat->vol_precache_resolution; + float voxx, voxy, voxz; + int vx, vy, vz; + float dx, dy, dz; + float d00, d10, d01, d11, d0, d1, d_final; + float bbmin[3], bbmax[3], dim[3]; + int rgb; + + if (!shi->obi->volume_precache) return; + + VECCOPY(bbmin, shi->obi->obr->boundbox[0]); + VECCOPY(bbmax, shi->obi->obr->boundbox[1]); + VecSubf(dim, bbmax, bbmin); + + voxx = ((co[0] - bbmin[0]) / dim[0]) * res - 0.5f; + voxy = ((co[1] - bbmin[1]) / dim[1]) * res - 0.5f; + voxz = ((co[2] - bbmin[2]) / dim[2]) * res - 0.5f; + + vx = (int)voxx; vy = (int)voxy; vz = (int)voxz; + + dx = voxx - vx; dy = voxy - vy; dz = voxz - vz; + + for (rgb=0; rgb < 3; rgb++) { + d00 = lerp(dx, D(shi, rgb, vx, vy, vz), D(shi, rgb, vx+1, vy, vz)); + d10 = lerp(dx, D(shi, rgb, vx, vy+1, vz), D(shi, rgb, vx+1, vy+1, vz)); + d01 = lerp(dx, D(shi, rgb, vx, vy, vz+1), D(shi, rgb, vx+1, vy, vz+1)); + d11 = lerp(dx, D(shi, rgb, vx, vy+1, vz+1), D(shi, rgb, vx+1, vy+1, vz+1)); + d0 = lerp(dy, d00, d10); + d1 = lerp(dy, d01, d11); + d_final = lerp(dz, d0, d1); + + scatter_col[rgb] = d_final; + } +} + +/* no interpolation */ +static void vol_get_precached_scattering_nearest(ShadeInput *shi, float *scatter_col, float *co) +{ + const int res = shi->mat->vol_precache_resolution; + int x,y,z; + float bbmin[3], bbmax[3], dim[3]; + + if (!shi->obi->volume_precache) return; + + VECCOPY(bbmin, shi->obi->obr->boundbox[0]); + VECCOPY(bbmax, shi->obi->obr->boundbox[1]); + VecSubf(dim, bbmax, bbmin); + + x = (int)(((co[0] - bbmin[0]) / dim[0]) * res); + y = (int)(((co[1] - bbmin[1]) / dim[1]) * res); + z = (int)(((co[2] - bbmin[2]) / dim[2]) * res); + + scatter_col[0] = shi->obi->volume_precache[0*res*res*res + x*res*res + y*res + z]; + scatter_col[1] = shi->obi->volume_precache[1*res*res*res + x*res*res + y*res + z]; + scatter_col[2] = shi->obi->volume_precache[2*res*res*res + x*res*res + y*res + z]; +} + float vol_get_density(struct ShadeInput *shi, float *co) { float density = shi->mat->alpha; @@ -245,82 +290,6 @@ void vol_get_absorption(ShadeInput *shi, float *absorb_col, float *co) absorb_col[2] = (1.0f - absorb_col[2]) * absorption; } - -static float D(ShadeInput *shi, int rgb, int x, int y, int z) -{ - const int res = shi->mat->vol_precache_resolution; - CLAMP(x, 0, res-1); - CLAMP(y, 0, res-1); - CLAMP(z, 0, res-1); - return shi->obi->volume_precache[rgb*res*res*res + x*res*res + y*res + z]; -} - -inline float lerp(float t, float v1, float v2) { - return (1.f - t) * v1 + t * v2; -} - -/* trilinear interpolation */ -static void vol_get_precached_scattering(ShadeInput *shi, float *scatter_col, float *co) -{ - const int res = shi->mat->vol_precache_resolution; - float voxx, voxy, voxz; - int vx, vy, vz; - float dx, dy, dz; - float d00, d10, d01, d11, d0, d1, d_final; - float bbmin[3], bbmax[3], dim[3]; - int rgb; - - if (!shi->obi->volume_precache) return; - - VECCOPY(bbmin, shi->obi->obr->boundbox[0]); - VECCOPY(bbmax, shi->obi->obr->boundbox[1]); - VecSubf(dim, bbmax, bbmin); - - voxx = ((co[0] - bbmin[0]) / dim[0]) * res - 0.5f; - voxy = ((co[1] - bbmin[1]) / dim[1]) * res - 0.5f; - voxz = ((co[2] - bbmin[2]) / dim[2]) * res - 0.5f; - - vx = (int)voxx; vy = (int)voxy; vz = (int)voxz; - - dx = voxx - vx; dy = voxy - vy; dz = voxz - vz; - - for (rgb=0; rgb < 3; rgb++) { - d00 = lerp(dx, D(shi, rgb, vx, vy, vz), D(shi, rgb, vx+1, vy, vz)); - d10 = lerp(dx, D(shi, rgb, vx, vy+1, vz), D(shi, rgb, vx+1, vy+1, vz)); - d01 = lerp(dx, D(shi, rgb, vx, vy, vz+1), D(shi, rgb, vx+1, vy, vz+1)); - d11 = lerp(dx, D(shi, rgb, vx, vy+1, vz+1), D(shi, rgb, vx+1, vy+1, vz+1)); - d0 = lerp(dy, d00, d10); - d1 = lerp(dy, d01, d11); - d_final = lerp(dz, d0, d1); - - scatter_col[rgb] = d_final; - } -} - - -/* no interpolation */ -static void vol_get_precached_scattering_nearest(ShadeInput *shi, float *scatter_col, float *co) -{ - const int res = shi->mat->vol_precache_resolution; - int x,y,z; - float bbmin[3], bbmax[3], dim[3]; - - if (!shi->obi->volume_precache) return; - - VECCOPY(bbmin, shi->obi->obr->boundbox[0]); - VECCOPY(bbmax, shi->obi->obr->boundbox[1]); - VecSubf(dim, bbmax, bbmin); - - x = (int)(((co[0] - bbmin[0]) / dim[0]) * res); - y = (int)(((co[1] - bbmin[1]) / dim[1]) * res); - z = (int)(((co[2] - bbmin[2]) / dim[2]) * res); - - scatter_col[0] = shi->obi->volume_precache[0*res*res*res + x*res*res + y*res + z]; - scatter_col[1] = shi->obi->volume_precache[1*res*res*res + x*res*res + y*res + z]; - scatter_col[2] = shi->obi->volume_precache[2*res*res*res + x*res*res + y*res + z]; -} - - /* Compute attenuation, otherwise known as 'optical thickness', extinction, or tau. * Used in the relationship Transmittance = e^(-attenuation) */ @@ -353,7 +322,7 @@ void vol_get_attenuation(ShadeInput *shi, float *tau, float *co, float *endco, f VecSubf(step_vec, endco, co); VecMulf(step_vec, 1.0f / nsteps); - VECCOPY(step_sta, co); + VecCopyf(step_sta, co); VecAddf(step_end, step_sta, step_vec); for (s = 0; s < nsteps; s++) { @@ -469,17 +438,33 @@ void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsi VECCOPY(scatter, col); } + +/* +The main volumetric integrator, using an emission/absorption/scattering model. + +Incoming radiance = + +outgoing radiance from behind surface * beam transmittance/attenuation ++ added radiance from all points along the ray due to participating media + --> radiance for each segment = + (radiance added by scattering + radiance added by emission) * beam transmittance/attenuation + +-- To find transmittance: + compute optical thickness with tau (perhaps involving monte carlo integration) + transmittance = exp(-tau) + +-- To find radiance from segments along the way: + find radiance for one step: + - loop over lights and weight by phase function +*/ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float *endco) { - float tr[3] = {1.0f, 1.0f, 1.0f}; /* total transmittance */ + float tr[3] = {1.0f, 1.0f, 1.0f}; float radiance[3] = {0.f, 0.f, 0.f}, d_radiance[3] = {0.f, 0.f, 0.f}; float stepsize = vol_get_stepsize(shi, STEPSIZE_VIEW); - int nsteps; - float vec[3], stepvec[3] = {0.0, 0.0, 0.0}; + int nsteps, s; float tau[3], emit_col[3], scatter_col[3] = {0.0, 0.0, 0.0}; - int s; - float step_sta[3], step_end[3], step_mid[3]; - float alpha; + float stepvec[3], step_sta[3], step_end[3], step_mid[3]; float density = vol_get_density(shi, co); /* multiply col_behind with beam transmittance over entire distance */ @@ -493,11 +478,9 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float /* ray marching */ nsteps = (int)((VecLenf(co, endco) / stepsize) + 0.5); - VecSubf(vec, endco, co); - VECCOPY(stepvec, vec); + VecSubf(stepvec, endco, co); VecMulf(stepvec, 1.0f / nsteps); - - VECCOPY(step_sta, co); + VecCopyf(step_sta, co); VecAddf(step_end, step_sta, stepvec); /* get radiance from all points along the ray due to participating media */ @@ -505,8 +488,7 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float if (s > 0) density = vol_get_density(shi, step_sta); - /* there's only any use in shading here - * if there's actually some density to shade! */ + /* there's only any use in shading here if there's actually some density to shade! */ if (density > 0.01f) { /* transmittance component (alpha) */ @@ -524,10 +506,7 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float if ((shi->mat->vol_shadeflag & MA_VOL_PRECACHESHADING) && (shi->mat->vol_shadeflag & MA_VOL_ATTENUATED)) { - if (G.rt==100) - vol_get_precached_scattering_nearest(shi, scatter_col, step_mid); - else - vol_get_precached_scattering(shi, scatter_col, step_mid); + vol_get_precached_scattering(shi, scatter_col, step_mid); } else vol_get_scattering(shi, scatter_col, step_mid, stepsize, density); @@ -541,36 +520,12 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float VecAddf(radiance, radiance, d_radiance); } - VECCOPY(step_sta, step_end); + VecCopyf(step_sta, step_end); VecAddf(step_end, step_end, stepvec); } - col[0] = radiance[0]; - col[1] = radiance[1]; - col[2] = radiance[2]; - - alpha = 1.0f -(tr[0] + tr[1] + tr[2]) * 0.333f; - col[3] = alpha; - - /* - Incoming radiance = - outgoing radiance from behind surface * beam transmittance/attenuation - - + added radiance from all points along the ray due to participating media - --> radiance for each segment = - radiance added by scattering - + radiance added by emission - * beam transmittance/attenuation - - - -- To find transmittance: - compute optical thickness with tau (perhaps involving monte carlo integration) - return exp(-tau) - - -- To find radiance from segments along the way: - find radiance for one step: - - loop over lights and weight by phase function - */ + VecCopyf(col, radiance); + col[3] = 1.0f -(tr[0] + tr[1] + tr[2]) * 0.333f; } static void shade_intersection(ShadeInput *shi, float *col, Isect *is) @@ -759,308 +714,3 @@ void volume_trace_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct } } - -/* Recursive test for intersections, from a point inside the mesh, to outside - * Number of intersections (depth) determine if a point is inside or outside the mesh */ -int intersect_outside_volume(RayTree *tree, Isect *isect, float *offset, int limit, int depth) -{ - if (limit == 0) return depth; - - if (RE_ray_tree_intersect(tree, isect)) { - float hitco[3]; - - hitco[0] = isect->start[0] + isect->labda*isect->vec[0]; - hitco[1] = isect->start[1] + isect->labda*isect->vec[1]; - hitco[2] = isect->start[2] + isect->labda*isect->vec[2]; - VecAddf(isect->start, hitco, offset); - - return intersect_outside_volume(tree, isect, offset, limit-1, depth+1); - } else { - return depth; - } -} - -/* Uses ray tracing to check if a point is inside or outside an ObjectInstanceRen */ -int point_inside_obi(RayTree *tree, ObjectInstanceRen *obi, float *co) -{ - float maxsize = RE_ray_tree_max_size(tree); - Isect isect; - float vec[3] = {0.0f,0.0f,1.0f}; - int final_depth=0, depth=0, limit=20; - - /* set up the isect */ - memset(&isect, 0, sizeof(isect)); - VECCOPY(isect.start, co); - isect.end[0] = co[0] + vec[0] * maxsize; - isect.end[1] = co[1] + vec[1] * maxsize; - isect.end[2] = co[2] + vec[2] * maxsize; - - /* and give it a little offset to prevent self-intersections */ - VecMulf(vec, 1e-5); - VecAddf(isect.start, isect.start, vec); - - isect.mode= RE_RAY_MIRROR; - isect.face_last= NULL; - isect.lay= -1; - - final_depth = intersect_outside_volume(tree, &isect, vec, limit, depth); - - /* even number of intersections: point is outside - * odd number: point is inside */ - if (final_depth % 2 == 0) return 0; - else return 1; -} - -static int inside_check_func(Isect *is, int ob, RayFace *face) -{ - return 1; -} -static void vlr_face_coords(RayFace *face, float **v1, float **v2, float **v3, float **v4) -{ - VlakRen *vlr= (VlakRen*)face; - - *v1 = (vlr->v1)? vlr->v1->co: NULL; - *v2 = (vlr->v2)? vlr->v2->co: NULL; - *v3 = (vlr->v3)? vlr->v3->co: NULL; - *v4 = (vlr->v4)? vlr->v4->co: NULL; -} - -RayTree *create_raytree_obi(ObjectInstanceRen *obi, float *bbmin, float *bbmax) -{ - int v; - VlakRen *vlr= NULL; - - /* create empty raytree */ - RayTree *tree = RE_ray_tree_create(64, obi->obr->totvlak, bbmin, bbmax, - vlr_face_coords, inside_check_func, NULL, NULL); - - /* fill it with faces */ - for(v=0; vobr->totvlak; v++) { - if((v & 255)==0) - vlr= obi->obr->vlaknodes[v>>8].vlak; - else - vlr++; - - RE_ray_tree_add_face(tree, 0, vlr); - } - - RE_ray_tree_done(tree); - - return tree; -} - -static float get_avg_surrounds(float *cache, int res, int res_2, int res_3, int rgb, int xx, int yy, int zz) -{ - int x, y, z, x_, y_, z_; - int added=0; - float tot=0.0f; - int i; - - for (x=-1; x <= 1; x++) { - x_ = xx+x; - if (x_ >= 0 && x_ <= res-1) { - - for (y=-1; y <= 1; y++) { - y_ = yy+y; - if (y_ >= 0 && y_ <= res-1) { - - for (z=-1; z <= 1; z++) { - z_ = zz+z; - if (z_ >= 0 && z_ <= res-1) { - - i = rgb*res_3 + x_*res_2 + y_*res + z_; - if (cache[i] > 0.0f) { - tot += cache[i]; - added++; - } - - } - } - } - } - } - } - - tot /= added; - - return ((added>0)?tot:0.0f); -} - -/* function to filter the edges of the light cache, where there was no volume originally. - * For each voxel which was originally external to the mesh, it finds the average values of - * the surrounding internal voxels and sets the original external voxel to that average amount. - * Works almost a bit like a 'dilate' filter */ -static void lightcache_filter(float *cache, int res) -{ - int x, y, z, rgb; - int res_2, res_3; - int i; - - res_2 = res*res; - res_3 = res*res*res; - - for (x=0; x < res; x++) { - for (y=0; y < res; y++) { - for (z=0; z < res; z++) { - for (rgb=0; rgb < 3; rgb++) { - i = rgb*res_3 + x*res_2 + y*res + z; - - /* trigger for outside mesh */ - if (cache[i] < 0.5f) cache[i] = get_avg_surrounds(cache, res, res_2, res_3, rgb, x, y, z); - } - } - } - } -} - -/* Precache a volume into a 3D voxel grid. - * The voxel grid is stored in the ObjectInstanceRen, - * in camera space, aligned with the ObjectRen's bounding box. - * Resolution is defined by the user. - */ -void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *ma, float *bbmin, float *bbmax) -{ - int x, y, z; - - float co[3], voxel[3], scatter_col[3]; - ShadeInput shi; - float view[3] = {0.0,0.0,-1.0}; - float density; - float stepsize; - - float resf, res_3f; - int res_2, res_3; - - float i = 1.0f; - double time, lasttime= PIL_check_seconds_timer(); - const int res = ma->vol_precache_resolution; - RayTree *tree; - - R = *re; - - /* create a raytree with just the faces of the instanced ObjectRen, - * used for checking if the cached point is inside or outside. */ - tree = create_raytree_obi(obi, bbmin, bbmax); - if (!tree) return; - - /* Need a shadeinput to calculate scattering */ - memset(&shi, 0, sizeof(ShadeInput)); - shi.depth= 1; - shi.mask= 1; - shi.mat = ma; - shi.vlr = NULL; - memcpy(&shi.r, &shi.mat->r, 23*sizeof(float)); // note, keep this synced with render_types.h - shi.har= shi.mat->har; - shi.obi= obi; - shi.obr= obi->obr; - shi.lay = re->scene->lay; - VECCOPY(shi.view, view); - - stepsize = vol_get_stepsize(&shi, STEPSIZE_VIEW); - - resf = (float)res; - res_2 = res*res; - res_3 = res*res*res; - res_3f = (float)res_3; - - VecSubf(voxel, bbmax, bbmin); - if ((voxel[0] < FLT_EPSILON) || (voxel[1] < FLT_EPSILON) || (voxel[2] < FLT_EPSILON)) - return; - VecMulf(voxel, 1.0f/res); - - obi->volume_precache = MEM_callocN(sizeof(float)*res_3*3, "volume light cache"); - - /* Iterate over the 3d voxel grid, and fill the voxels with scattering information - * - * It's stored in memory as 3 big float grids next to each other, one for each RGB channel. - * I'm guessing the memory alignment may work out better this way for the purposes - * of doing linear interpolation, but I haven't actually tested this theory! :) - */ - for (x=0; x < res; x++) { - co[0] = bbmin[0] + (voxel[0] * x); - - for (y=0; y < res; y++) { - co[1] = bbmin[1] + (voxel[1] * y); - - for (z=0; z < res; z++) { - co[2] = bbmin[2] + (voxel[2] * z); - - time= PIL_check_seconds_timer(); - i++; - - /* display progress every second */ - if(re->test_break()) { - if(tree) { - RE_ray_tree_free(tree); - tree= NULL; - } - return; - } - if(time-lasttime>1.0f) { - char str[64]; - sprintf(str, "Precaching volume: %d%%", (int)(100.0f * (i / res_3f))); - re->i.infostr= str; - re->stats_draw(&re->i); - re->i.infostr= NULL; - lasttime= time; - } - - /* don't bother if the point is not inside the volume mesh */ - if (!point_inside_obi(tree, obi, co)) { - obi->volume_precache[0*res_3 + x*res_2 + y*res + z] = -1.0f; - obi->volume_precache[1*res_3 + x*res_2 + y*res + z] = -1.0f; - obi->volume_precache[2*res_3 + x*res_2 + y*res + z] = -1.0f; - continue; - } - - VECCOPY(shi.view, co); - Normalize(shi.view); - density = vol_get_density(&shi, co); - vol_get_scattering(&shi, scatter_col, co, stepsize, density); - - obi->volume_precache[0*res_3 + x*res_2 + y*res + z] = scatter_col[0]; - obi->volume_precache[1*res_3 + x*res_2 + y*res + z] = scatter_col[1]; - obi->volume_precache[2*res_3 + x*res_2 + y*res + z] = scatter_col[2]; - } - } - } - - if(tree) { - RE_ray_tree_free(tree); - tree= NULL; - } - - lightcache_filter(obi->volume_precache, res); - -} - -/* loop through all objects (and their associated materials) - * marked for pre-caching in convertblender.c, and pre-cache them */ -void volume_precache(Render *re) -{ - ObjectInstanceRen *obi; - VolPrecache *vp; - - for(vp= re->vol_precache_obs.first; vp; vp= vp->next) { - for(obi= re->instancetable.first; obi; obi= obi->next) { - if (obi->obr == vp->obr) - vol_precache_objectinstance(re, obi, vp->ma, obi->obr->boundbox[0], obi->obr->boundbox[1]); - } - } - - re->i.infostr= NULL; - re->stats_draw(&re->i); -} - -void free_volume_precache(Render *re) -{ - ObjectInstanceRen *obi; - - for(obi= re->instancetable.first; obi; obi= obi->next) { - if (obi->volume_precache) - MEM_freeN(obi->volume_precache); - } - - BLI_freelistN(&re->vol_precache_obs); -} - From e5b51109e955e3dd6ec4857f833c3aa51f0fa3f4 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 18 Nov 2008 01:53:52 +0000 Subject: [PATCH 062/577] * Exclude volume materials from AO --- source/blender/render/intern/source/occlusion.c | 2 +- source/blender/render/intern/source/rayshade.c | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c index d2d2cf3fb77..04404d71f30 100644 --- a/source/blender/render/intern/source/occlusion.c +++ b/source/blender/render/intern/source/occlusion.c @@ -663,7 +663,7 @@ static OcclusionTree *occ_tree_build(Render *re) if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak; else vlr++; - if(vlr->mat->mode & MA_TRACEBLE) { + if((vlr->mat->mode & MA_TRACEBLE) && (vlr->mat->material_type == MA_SOLID)) { tree->face[b].obi= c; tree->face[b].facenr= a; tree->occlusion[b]= 1.0f; diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index d06bbcf3300..bba7cb924eb 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -96,6 +96,17 @@ static int vlr_check_intersect(Isect *is, int ob, RayFace *face) return (is->lay & obi->lay); } +static int vlr_check_intersect_solid(Isect *is, int ob, RayFace *face) +{ + VlakRen *vlr = (VlakRen*)face; + + /* solid material types only */ + if (vlr->mat->material_type == MA_SOLID) + return 1; + else + return 0; +} + static float *vlr_get_transform(void *userdata, int i) { ObjectInstanceRen *obi= RAY_OBJECT_GET((Render*)userdata, i); @@ -1621,7 +1632,7 @@ static void ray_ao_qmc(ShadeInput *shi, float *shadfac) prev = fac; - if(RE_ray_tree_intersect(R.raytree, &isec)) { + if(RE_ray_tree_intersect_check(R.raytree, &isec, vlr_check_intersect_solid)) { if (R.wrld.aomode & WO_AODIST) fac+= exp(-isec.labda*R.wrld.aodistfac); else fac+= 1.0f; } @@ -1746,7 +1757,7 @@ static void ray_ao_spheresamp(ShadeInput *shi, float *shadfac) isec.end[2] = shi->co[2] - maxdist*vec[2]; /* do the trace */ - if(RE_ray_tree_intersect(R.raytree, &isec)) { + if(RE_ray_tree_intersect_check(R.raytree, &isec, vlr_check_intersect_solid)) { if (R.wrld.aomode & WO_AODIST) sh+= exp(-isec.labda*R.wrld.aodistfac); else sh+= 1.0f; } From 14a0718a8a4ed3ee95f6374e20dbe9e74cf3b5c6 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 19 Nov 2008 05:30:52 +0000 Subject: [PATCH 063/577] * fix - constant colour output in point density wasn't working --- .../blender/render/intern/source/pointdensity.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index af2a7edae06..db675c81840 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -418,14 +418,14 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) co[1] = texvec[1] + noise_fac * turb; co[2] = texvec[2] + noise_fac * turb; - /* reset and do a new BVH query with the perturbed coordinates */ + /* reset and prepare for a new BVH query with the perturbed coordinates */ density = vec[0] = vec[1] = vec[2] = 0.0f; - num = BLI_bvhtree_range_query(pd->point_tree, co, pd->radius, accum_density, &pdr); - if (num > 0) { - age /= num; - VecMulf(vec, 1.0f/num); - } - + } + + num = BLI_bvhtree_range_query(pd->point_tree, co, pd->radius, accum_density, &pdr); + if (num > 0) { + age /= num; + VecMulf(vec, 1.0f/num); } texres->tin = density; @@ -459,6 +459,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) VECCOPY(&texres->tr, vec); texres->ta = 1.0f; break; + case TEX_PD_COLOR_CONSTANT: default: texres->tr = texres->tg = texres->tb = texres->ta = 1.0f; break; From 6df8cf842a926e9354ee74f1892530b69897da5f Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 19 Nov 2008 23:27:47 +0000 Subject: [PATCH 064/577] * Allow for light linking/overrides in volume materials --- source/blender/render/intern/source/volumetric.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 359f6202fe4..45d54d40fa1 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -417,12 +417,14 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * /* single scattering only for now */ void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsize, float density) { + ListBase *lights; GroupObject *go; LampRen *lar; float col[3] = {0.f, 0.f, 0.f}; int i=0; - for(go=R.lights.first; go; go= go->next) + lights= get_lights(shi); + for(go=lights->first; go; go= go->next) { float lacol[3] = {0.f, 0.f, 0.f}; From bdf6711b70e1800dbf390c8a9264368c0fe01760 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Fri, 28 Nov 2008 07:12:32 +0000 Subject: [PATCH 065/577] * Some extra sanity checks for point density --- source/blender/render/intern/source/pointdensity.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index db675c81840..2034ed2d466 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -230,6 +230,8 @@ static void cache_pointdensity(Render *re, Tex *tex) int i; if (!ob) return; + if (BLI_countlist(&ob->particlesystem) == 0) return; + for(psys=ob->particlesystem.first, i=0; i< pd->psysindex-1; i++) psys= psys->next; @@ -260,6 +262,8 @@ static void free_pointdensity(Render *re, Tex *tex) { PointDensity *pd = tex->pd; + if (!pd) return; + if (pd->point_tree) { BLI_bvhtree_free(pd->point_tree); pd->point_tree = NULL; From 1b9eabeef6ac895a4818c4ad74c0899226cabc84 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Fri, 5 Dec 2008 04:06:41 +0000 Subject: [PATCH 066/577] * Added other noise basis types to point density turbulence * Fixed a bug in 'ignoring volumes in AAO' --- source/blender/makesdna/DNA_texture_types.h | 2 + .../blender/render/intern/source/occlusion.c | 2 +- .../render/intern/source/pointdensity.c | 7 +- .../render/intern/source/volume_precache.c | 129 ++++++++++++++++++ source/blender/src/buttons_shading.c | 5 + 5 files changed, 141 insertions(+), 4 deletions(-) diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index fd497cef178..b4fcb5efe40 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -153,6 +153,8 @@ typedef struct PointDensity { float noise_size; short noise_depth; short noise_influence; + short noise_basis; + short pdpad3[3]; float noise_fac; float speed_scale; diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c index 04404d71f30..f1ea4665120 100644 --- a/source/blender/render/intern/source/occlusion.c +++ b/source/blender/render/intern/source/occlusion.c @@ -630,7 +630,7 @@ static OcclusionTree *occ_tree_build(Render *re) if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak; else vlr++; - if(vlr->mat->mode & MA_TRACEBLE) + if((vlr->mat->mode & MA_TRACEBLE) && (vlr->mat->material_type == MA_SOLID)) totface++; } } diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index 2034ed2d466..392af8411c5 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -405,14 +405,15 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) if (pd->flag & TEX_PD_TURBULENCE) { if (pd->noise_influence == TEX_PD_NOISE_AGE) { - turb = BLI_turbulence(pd->noise_size, texvec[0]+age, texvec[1]+age, texvec[2]+age, pd->noise_depth); + turb = BLI_gTurbulence(pd->noise_size, texvec[0]+age, texvec[1]+age, texvec[2]+age, pd->noise_depth, 0, pd->noise_basis); } else if (pd->noise_influence == TEX_PD_NOISE_TIME) { time = R.cfra / (float)R.r.efra; - turb = BLI_turbulence(pd->noise_size, texvec[0]+time, texvec[1]+time, texvec[2]+time, pd->noise_depth); + turb = BLI_gTurbulence(pd->noise_size, texvec[0]+time, texvec[1]+time, texvec[2]+time, pd->noise_depth, 0, pd->noise_basis); + //turb = BLI_turbulence(pd->noise_size, texvec[0]+time, texvec[1]+time, texvec[2]+time, pd->noise_depth); } else { - turb = BLI_turbulence(pd->noise_size, texvec[0]+vec[0], texvec[1]+vec[1], texvec[2]+vec[2], pd->noise_depth); + turb = BLI_gTurbulence(pd->noise_size, texvec[0]+vec[0], texvec[1]+vec[1], texvec[2]+vec[2], pd->noise_depth, 0, pd->noise_basis); } turb -= 0.5f; /* re-center 0.0-1.0 range around 0 to prevent offsetting result */ diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c index 5b43aa8f935..c56d17f7cc3 100644 --- a/source/blender/render/intern/source/volume_precache.c +++ b/source/blender/render/intern/source/volume_precache.c @@ -325,6 +325,135 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m } +#if 0 +void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *obi, Material *ma, float *bbmin, float *bbmax) +{ + int x, y, z; + + float co[3], voxel[3], scatter_col[3]; + ShadeInput shi; + float view[3] = {0.0,0.0,-1.0}; + float density; + float stepsize; + + float resf, res_3f; + int res_2, res_3; + + int edgeparts=2; + int totparts; + + float i = 1.0f; + double time, lasttime= PIL_check_seconds_timer(); + const int res = ma->vol_precache_resolution; + RayTree *tree; + + R = *re; + + /* create a raytree with just the faces of the instanced ObjectRen, + * used for checking if the cached point is inside or outside. */ + tree = create_raytree_obi(obi, bbmin, bbmax); + if (!tree) return; + + /* Need a shadeinput to calculate scattering */ + memset(&shi, 0, sizeof(ShadeInput)); + shi.depth= 1; + shi.mask= 1; + shi.mat = ma; + shi.vlr = NULL; + memcpy(&shi.r, &shi.mat->r, 23*sizeof(float)); // note, keep this synced with render_types.h + shi.har= shi.mat->har; + shi.obi= obi; + shi.obr= obi->obr; + shi.lay = re->scene->lay; + VECCOPY(shi.view, view); + + stepsize = vol_get_stepsize(&shi, STEPSIZE_VIEW); + + resf = (float)res; + res_2 = res*res; + res_3 = res*res*res; + res_3f = (float)res_3; + + VecSubf(voxel, bbmax, bbmin); + if ((voxel[0] < FLT_EPSILON) || (voxel[1] < FLT_EPSILON) || (voxel[2] < FLT_EPSILON)) + return; + VecMulf(voxel, 1.0f/res); + + + part[0] = parceil(res/(float)xparts); + part[1] = ceil(rex/(float)yparts); + part[2] = ceil(rex/(float)zparts); + + + + //obi->volume_precache = MEM_callocN(sizeof(float)*res_3*3, "volume light cache"); + + /* Iterate over the 3d voxel grid, and fill the voxels with scattering information + * + * It's stored in memory as 3 big float grids next to each other, one for each RGB channel. + * I'm guessing the memory alignment may work out better this way for the purposes + * of doing linear interpolation, but I haven't actually tested this theory! :) + */ + /* + for (x=0; x < res; x++) { + co[0] = bbmin[0] + (voxel[0] * x); + + for (y=0; y < res; y++) { + co[1] = bbmin[1] + (voxel[1] * y); + + for (z=0; z < res; z++) { + co[2] = bbmin[2] + (voxel[2] * z); + + time= PIL_check_seconds_timer(); + i++; + + // display progress every second + if(re->test_break()) { + if(tree) { + RE_ray_tree_free(tree); + tree= NULL; + } + return; + } + if(time-lasttime>1.0f) { + char str[64]; + sprintf(str, "Precaching volume: %d%%", (int)(100.0f * (i / res_3f))); + re->i.infostr= str; + re->stats_draw(&re->i); + re->i.infostr= NULL; + lasttime= time; + } + + // don't bother if the point is not inside the volume mesh + + if (!point_inside_obi(tree, obi, co)) { + obi->volume_precache[0*res_3 + x*res_2 + y*res + z] = -1.0f; + obi->volume_precache[1*res_3 + x*res_2 + y*res + z] = -1.0f; + obi->volume_precache[2*res_3 + x*res_2 + y*res + z] = -1.0f; + continue; + } + density = vol_get_density(&shi, co); + vol_get_scattering(&shi, scatter_col, co, stepsize, density); + + obi->volume_precache[0*res_3 + x*res_2 + y*res + z] = scatter_col[0]; + obi->volume_precache[1*res_3 + x*res_2 + y*res + z] = scatter_col[1]; + obi->volume_precache[2*res_3 + x*res_2 + y*res + z] = scatter_col[2]; + + } + } + } + */ + + if(tree) { + RE_ray_tree_free(tree); + tree= NULL; + } + + lightcache_filter(obi->volume_precache, res); + +} +#endif + /* loop through all objects (and their associated materials) * marked for pre-caching in convertblender.c, and pre-cache them */ void volume_precache(Render *re) diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 55475e74450..c88c341fe53 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -994,6 +994,11 @@ static void texture_panel_pointdensity_modify(Tex *tex) yco = ymid - BUTH - YSPACE; + uiDefBut(block, LABEL, B_NOP, "Noise Basis:", + X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + uiDefButS(block, MENU, B_REDR, noisebasis_menu(), + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(pd->noise_basis), 0.0, 0.0, 0, 0, "Noise formula used for tubulence"); + uiDefBut(block, LABEL, B_NOP, "Noise Influence:", X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); From 9e1da805e19b3efd822803fa53e4bbc23223f58f Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 9 Dec 2008 04:27:34 +0000 Subject: [PATCH 067/577] * Added back the GR: field for volume materials, limiting lighting to a certain group --- source/blender/src/buttons_shading.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index c88c341fe53..a8aa00370d9 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -4529,6 +4529,10 @@ static void material_panel_material_volume(Material *ma) X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); } + yco -= YSPACE; + uiDefIDPoinBut(block, test_grouppoin_but, ID_GR, B_MATPRV, "GR:", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &ma->group, "Limit Lighting to Lamps in this Group"); + } static void material_panel_nodes(Material *ma) From aef61a7000c279a96f1bb0e1fedf7da2574292fd Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 9 Dec 2008 07:19:55 +0000 Subject: [PATCH 068/577] wip commit to work on at home, nothing to see --- .../render/intern/source/volume_precache.c | 187 +++++++++++++++--- 1 file changed, 164 insertions(+), 23 deletions(-) diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c index c56d17f7cc3..246f9bc6d69 100644 --- a/source/blender/render/intern/source/volume_precache.c +++ b/source/blender/render/intern/source/volume_precache.c @@ -326,13 +326,104 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m } #if 0 +typedef struct VolPrecachePart { + struct VolPrecachePart *next, *prev; + int num; + int minx, maxx; + int miny, maxy; + int minz, maxz; + int res; + float bbmin[3], voxel[3]; + struct RayTree *tree; + struct ShadeInput *shi; + struct ObjectInstanceRen *obi; + int done; +} VolPrecachePart; + +static void *vol_precache_part_test(void *data) +{ + VolPrecachePart *vpt = (VolPrecachePart *)data; + + printf("part number: %d \n", vpt->num); + + return 0; +} + +/* Iterate over the 3d voxel grid, and fill the voxels with scattering information + * + * It's stored in memory as 3 big float grids next to each other, one for each RGB channel. + * I'm guessing the memory alignment may work out better this way for the purposes + * of doing linear interpolation, but I haven't actually tested this theory! :) + */ +static void *vol_precache_part(void *data) +{ + VolPrecachePart *vpt = (VolPrecachePart *)data; + ObjectInstanceRen *obi = vpt->obi; + RayTree *tree = vpt->tree; + ShadeInput *shi = vpt->shi; + float scatter_col[3] = {0.f, 0.f, 0.f}; + float co[3]; + int x, y, z; + const int res=vpt->res, res_2=vpt->res*vpt->res, res_3=vpt->res*vpt->res*vpt->res; + const float stepsize = vol_get_stepsize(shi, STEPSIZE_VIEW); + + res = vpt->res; + res_2 = res*res; + res_3 = res*res*res; + + for (x= vpt->minx; x < vpt->maxx; x++) { + co[0] = vpt->bbmin[0] + (vpt->voxel[0] * x); + + for (y= vpt->miny; y < vpt->maxy; y++) { + co[1] = vpt->bbmin[1] + (vpt->voxel[1] * y); + + for (z=vpt->minz; z < vpt->maxz; z++) { + co[2] = vpt->bbmin[2] + (vpt->voxel[2] * z); + + // don't bother if the point is not inside the volume mesh + if (!point_inside_obi(tree, obi, co)) { + obi->volume_precache[0*res_3 + x*res_2 + y*res + z] = -1.0f; + obi->volume_precache[1*res_3 + x*res_2 + y*res + z] = -1.0f; + obi->volume_precache[2*res_3 + x*res_2 + y*res + z] = -1.0f; + continue; + } + density = vol_get_density(shi, co); + vol_get_scattering(shi, scatter_col, co, stepsize, density); + + obi->volume_precache[0*res_3 + x*res_2 + y*res + z] = scatter_col[0]; + obi->volume_precache[1*res_3 + x*res_2 + y*res + z] = scatter_col[1]; + obi->volume_precache[2*res_3 + x*res_2 + y*res + z] = scatter_col[2]; + } + } + } + + return 0; +} + +void precache_setup_shadeinput(Render *re, ObjectInstanceRen *obi, Material *ma, ShadeInput *shi) +{ + float view[3] = {0.0,0.0,-1.0}; + + memset(&shi, 0, sizeof(ShadeInput)); + shi->depth= 1; + shi->mask= 1; + shi->mat = ma; + shi->vlr = NULL; + memcpy(&shi->r, &shi->mat->r, 23*sizeof(float)); // note, keep this synced with render_types.h + shi->har= shi->mat->har; + shi->obi= obi; + shi->obr= obi->obr; + shi->lay = re->scene->lay; + VECCOPY(shi->view, view); +} + void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *obi, Material *ma, float *bbmin, float *bbmax) { int x, y, z; float co[3], voxel[3], scatter_col[3]; ShadeInput shi; - float view[3] = {0.0,0.0,-1.0}; + float density; float stepsize; @@ -341,6 +432,14 @@ void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *obi, Mat int edgeparts=2; int totparts; + ListBase threads; + int cont= 1; + int xparts, yparts, zparts; + float part[3]; + int totthread = re->r.threads; + ListBase precache_parts; + VolPrecachePart *nextpa; + int j; float i = 1.0f; double time, lasttime= PIL_check_seconds_timer(); @@ -355,38 +454,80 @@ void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *obi, Mat if (!tree) return; /* Need a shadeinput to calculate scattering */ - memset(&shi, 0, sizeof(ShadeInput)); - shi.depth= 1; - shi.mask= 1; - shi.mat = ma; - shi.vlr = NULL; - memcpy(&shi.r, &shi.mat->r, 23*sizeof(float)); // note, keep this synced with render_types.h - shi.har= shi.mat->har; - shi.obi= obi; - shi.obr= obi->obr; - shi.lay = re->scene->lay; - VECCOPY(shi.view, view); - - stepsize = vol_get_stepsize(&shi, STEPSIZE_VIEW); + precache_setup_shadeinput(re, obi, ma, &shi); - resf = (float)res; - res_2 = res*res; - res_3 = res*res*res; - res_3f = (float)res_3; - VecSubf(voxel, bbmax, bbmin); if ((voxel[0] < FLT_EPSILON) || (voxel[1] < FLT_EPSILON) || (voxel[2] < FLT_EPSILON)) return; VecMulf(voxel, 1.0f/res); + part[0] = ceil(res/(float)xparts); + part[1] = ceil(res/(float)yparts); + part[2] = ceil(res/(float)zparts); - part[0] = parceil(res/(float)xparts); - part[1] = ceil(rex/(float)yparts); - part[2] = ceil(rex/(float)zparts); + obi->volume_precache = MEM_callocN(sizeof(float)*res_3*3, "volume light cache"); + totparts = edgeparts*edgeparts*edgeparts; + precache_parts= MEM_callocN(sizeof(VolPrecachePart)*totparts, "VolPrecachePart"); + memset(precache_parts, 0, sizeof(VolPrecachePart)*totparts); + + precache_init_parts(precache_parts); + + for(j=0; j < totparts; j++) { + VolPrecachePart *pa= MEM_callocN(sizeof(VolPrecachePart), "new precache part"); + pa->done = 0; + pa->num = j; + + pa->res = res; + VECCOPY(pa->bbmin, bbmin); + VECCOPY(precache_parts[j].voxel, voxel); + precache_parts[j].tree = tree; + precache_parts[j].shi = shi; + precache_parts[j].obi = obi; + } - //obi->volume_precache = MEM_callocN(sizeof(float)*res_3*3, "volume light cache"); + BLI_init_threads(&threads, vol_precache_part, totthread); + + nextpa = precache_get_new_part(precache_threads); + + while(cont) { + + if(BLI_available_threads(&threads) && !(re->test_break())) { + + precache_get_new_part( + // get new job (data pointer) + for(j=0; j < totparts; j++) { + if (!precache_threads[j].done) { + // tag job 'processed + precache_threads[j].done = 1; + } + } + + BLI_insert_thread(&threads, precache_get_new_part(precache_threads)); + } + else PIL_sleep_ms(50); + + // find if a job is ready, this the do_something_func() should write in job somewhere + cont= 0; + for(go over all jobs) + if(job is ready) { + if(job was not removed) { + BLI_remove_thread(&lb, job); + } + } + else cont= 1; + } + // conditions to exit loop + if(if escape loop event) { + if(BLI_available_threadslots(&lb)==maxthreads) + break; + } + } + + BLI_end_threads(&threads); + + // /* Iterate over the 3d voxel grid, and fill the voxels with scattering information * From 92f5c719aedf79db7e45d3b887146a559321981e Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sat, 13 Dec 2008 05:41:34 +0000 Subject: [PATCH 069/577] * Volume Rendering: Voxel data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit introduces a new texture ('Voxel Data'), used to load up saved voxel data sets for rendering, contributed by RauÌl 'farsthary' FernaÌndez HernaÌndez with some additional tweaks. Thanks, RauÌl! The texture works similar to the existing point density texture, currently it only provides intensity information, which can then be mapped (for example) to density in a volume material. This is an early version, intended to read the voxel format saved by RauÌl's command line simulators, in future revisions there's potential for making a more full-featured 'Blender voxel file format', and also for supporting other formats too. Note: Due to some subtleties in RauÌl's existing released simulators, in order to load them correctly the voxel data texture, you'll need to raise the 'resolution' value by 2. So if you baked out the simulation at resolution 50, enter 52 for the resolution in the texture panel. This can possibly be fixed in the simulator later on. Right now, the way the texture is mapped is just in the space 0,0,0 <-> 1,1,1 and it can appear rotated 90 degrees incorrectly. This will be tackled, for now, probably the easiest way to map it is with and empty, using Map Input -> Object. Smoke test: http://www.vimeo.com/2449270 One more note, trilinear interpolation seems a bit slow at the moment, we'll look into this. For curiosity, while testing/debugging this, I made a script that exports a mesh to voxel data. Here's a test of grogan (www.kajimba.com) converted to voxels, rendered as a volume: http://www.vimeo.com/2512028 The script is available here: http://mke3.net/projects/bpython/export_object_voxeldata.py * Another smaller thing, brought back early ray termination (was disabled previously for debugging) and made it user configurable. It now appears as a new value in the volume material: 'Depth Cutoff'. For some background info on what this does, check: http://farsthary.wordpress.com/2008/12/11/cutting-down-render-times/ * Also some disabled work-in-progess code for light cache --- source/blender/blenkernel/BKE_texture.h | 6 ++ source/blender/blenkernel/intern/texture.c | 49 ++++++++++ source/blender/blenloader/intern/readfile.c | 18 ++++ source/blender/blenloader/intern/writefile.c | 1 + source/blender/include/butspace.h | 2 + source/blender/makesdna/DNA_material_types.h | 2 + source/blender/makesdna/DNA_texture_types.h | 24 ++++- .../render/intern/include/render_types.h | 14 +++ .../render/intern/include/volume_precache.h | 3 +- .../render/intern/source/convertblender.c | 61 ++++++++++-- source/blender/render/intern/source/texture.c | 5 + .../render/intern/source/volume_precache.c | 98 +++++++++++-------- .../blender/render/intern/source/volumetric.c | 16 ++- source/blender/src/butspace.c | 2 +- source/blender/src/buttons_shading.c | 80 ++++++++++++++- 15 files changed, 324 insertions(+), 57 deletions(-) diff --git a/source/blender/blenkernel/BKE_texture.h b/source/blender/blenkernel/BKE_texture.h index e16ac2d369b..985094a7e62 100644 --- a/source/blender/blenkernel/BKE_texture.h +++ b/source/blender/blenkernel/BKE_texture.h @@ -40,6 +40,7 @@ struct HaloRen; struct TexMapping; struct EnvMap; struct PointDensity; +struct VoxelData; /* in ColorBand struct */ #define MAXCOLORBAND 32 @@ -80,6 +81,11 @@ 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 diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index c972d70d927..c9cae91da6f 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -420,6 +420,7 @@ void free_texture(Tex *tex) 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; @@ -490,6 +491,11 @@ void default_tex(Tex *tex) 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) { @@ -588,6 +594,7 @@ 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); @@ -945,6 +952,48 @@ void BKE_free_pointdensity(PointDensity *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) { diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 1fd766be256..8347920319a 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2535,6 +2535,11 @@ static void direct_link_texture(FileData *fd, Tex *tex) 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); @@ -7939,6 +7944,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main) 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) { @@ -7956,6 +7963,17 @@ static void do_versions(FileData *fd, Library *lib, Main *main) 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; + } } } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 93bf8111c98..fd87080d0ee 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1339,6 +1339,7 @@ static void write_textures(WriteData *wd, ListBase *idbase) 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) { diff --git a/source/blender/include/butspace.h b/source/blender/include/butspace.h index fd3f6e926b9..a3cd9d1875b 100644 --- a/source/blender/include/butspace.h +++ b/source/blender/include/butspace.h @@ -260,6 +260,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 diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index f332537e9a8..5172f6a970c 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -69,6 +69,8 @@ typedef struct Material { short vol_stepsize_type; short vol_precache_resolution; float vol_stepsize, vol_shade_stepsize; + float vol_depth_cutoff; + float vpad; float vol_density_scale; float vol_absorption, vol_scattering; float vol_absorption_col[3]; diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index b4fcb5efe40..e90df908c2b 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -154,7 +154,7 @@ typedef struct PointDensity { short noise_depth; short noise_influence; short noise_basis; - short pdpad3[3]; + short pdpad3[3]; float noise_fac; float speed_scale; @@ -162,6 +162,18 @@ typedef struct PointDensity { } PointDensity; +typedef struct VoxelData { + int resolX, resolY, resolZ; + int interp_type; + + float int_multiplier; + float vxpad; + + char source_path[240]; + float *dataset; + +} VoxelData; + typedef struct Tex { ID id; @@ -209,6 +221,7 @@ typedef struct Tex { struct EnvMap *env; struct PreviewImage * preview; struct PointDensity *pd; + struct VoxelData *vd; char use_nodes; char pad[7]; @@ -250,6 +263,7 @@ typedef struct TexMapping { #define TEX_DISTNOISE 13 /* predicting ocean texture for 14 */ #define TEX_POINTDENSITY 15 +#define TEX_VOXELDATA 16 /* musgrave stype */ #define TEX_MFRACTAL 0 @@ -465,5 +479,13 @@ typedef struct TexMapping { #define POINT_DATA_VEL 1 #define POINT_DATA_LIFE 2 +/******************** Voxel Data *****************************/ +#define TEX_VD_CUBIC 0 +#define TEX_VD_PARALLELOGRAM 1 + +#define TEX_VD_NEARESTNEIGHBOR 0 +#define TEX_VD_LINEAR 1 +#define TEX_VD_TRICUBIC 2 + #endif diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index 6f4537d84fb..65bb12e059d 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -203,6 +203,8 @@ struct Render struct Object *excludeob; ListBase vol_precache_obs; + ListBase render_volumes_inside; + ListBase volumes; /* arena for allocating data for use during render, for * example dynamic TFaces to go in the VlakRen structure. @@ -409,6 +411,18 @@ typedef struct VolPrecache struct ObjectRen *obr; } VolPrecache; +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; + /* ------------------------------------------------------------------------- */ struct LampRen; diff --git a/source/blender/render/intern/include/volume_precache.h b/source/blender/render/intern/include/volume_precache.h index 7a719840f48..78409e4c646 100644 --- a/source/blender/render/intern/include/volume_precache.h +++ b/source/blender/render/intern/include/volume_precache.h @@ -27,4 +27,5 @@ */ void volume_precache(Render *re); -void free_volume_precache(Render *re); \ No newline at end of file +void free_volume_precache(Render *re); +int point_inside_volume_objectinstance(ObjectInstanceRen *obi, float *co); \ No newline at end of file diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 09f2d1275f4..d87ee65c42c 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -104,6 +104,7 @@ #include "multires.h" #include "occlusion.h" #include "pointdensity.h" +#include "voxeldata.h" #include "render_types.h" #include "rendercore.h" #include "renderdatabase.h" @@ -3028,16 +3029,51 @@ static void use_mesh_edge_lookup(ObjectRen *obr, DerivedMesh *dm, MEdge *medge, } } -static void add_vol_precache(Render *re, ObjectRen *obr, Material *ma) +static void free_camera_inside_volumes(Render *re) { - struct VolPrecache *vp; + BLI_freelistN(&re->render_volumes_inside); +} + +static void init_camera_inside_volumes(Render *re) +{ + ObjectInstanceRen *obi; + VolumeOb *vo; + float co[3] = {0.f, 0.f, 0.f}; + + for(vo= re->volumes.first; vo; vo= vo->next) { + for(obi= re->instancetable.first; obi; obi= obi->next) { + if (obi->obr == vo->obr) { + if (point_inside_volume_objectinstance(obi, co)) { + MatInside *mi; + + mi = MEM_mallocN(sizeof(MatInside), "camera inside material"); + mi->ma = vo->ma; + + BLI_addtail(&(re->render_volumes_inside), mi); + } + } + } + } - vp = MEM_mallocN(sizeof(VolPrecache), "volume precache object"); + { + MatInside *m; + for (m=re->render_volumes_inside.first; m; m=m->next) { + printf("matinside: ma: %s \n", m->ma->id.name+2); + } - vp->ma = ma; - vp->obr = obr; + } +} + +static void add_volume(Render *re, ObjectRen *obr, Material *ma) +{ + struct VolumeOb *vo; - BLI_addtail(&re->vol_precache_obs, vp); + vo = MEM_mallocN(sizeof(VolumeOb), "volume object"); + + vo->ma = ma; + vo->obr = obr; + + BLI_addtail(&re->volumes, vo); } static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) @@ -3095,9 +3131,8 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) if(ma->mode & MA_RADIO) do_autosmooth= 1; - if ((ma->material_type == MA_VOLUME) && (ma->vol_shadeflag & MA_VOL_PRECACHESHADING)) { - add_vol_precache(re, obr, ma); - } + if (ma->material_type == MA_VOLUME) + add_volume(re, obr, ma); } } @@ -4457,6 +4492,9 @@ void RE_Database_Free(Render *re) end_render_textures(); free_pointdensities(re); + free_voxeldata(re); + + free_camera_inside_volumes(re); if(re->wrld.aosphere) { MEM_freeN(re->wrld.aosphere); @@ -4861,6 +4899,8 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view) /* MAKE RENDER DATA */ database_init_objects(re, lay, 0, 0, 0, 0); + + init_camera_inside_volumes(re); if(!re->test_break()) { int tothalo; @@ -4912,6 +4952,9 @@ void RE_Database_FromScene(Render *re, Scene *scene, int use_camera_view) /* point density texture */ if(!re->test_break()) make_pointdensities(re); + /* voxel data texture */ + if(!re->test_break()) + make_voxeldata(re);//Volumetrics } if(!re->test_break()) diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index d7d4d124b18..d7b41d7cc2c 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -65,6 +65,7 @@ #include "envmap.h" #include "pointdensity.h" +#include "voxeldata.h" #include "renderpipeline.h" #include "render_types.h" #include "rendercore.h" @@ -1257,6 +1258,10 @@ static int multitex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, case TEX_POINTDENSITY: retval= pointdensitytex(tex, texvec, texres); break; + case TEX_VOXELDATA: + retval= voxeldatatex(tex, texvec, texres); + break; + } if (tex->flag & TEX_COLORBAND) { diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c index 246f9bc6d69..89f997f4b99 100644 --- a/source/blender/render/intern/source/volume_precache.c +++ b/source/blender/render/intern/source/volume_precache.c @@ -400,7 +400,7 @@ static void *vol_precache_part(void *data) return 0; } -void precache_setup_shadeinput(Render *re, ObjectInstanceRen *obi, Material *ma, ShadeInput *shi) +static void precache_setup_shadeinput(Render *re, ObjectInstanceRen *obi, Material *ma, ShadeInput *shi) { float view[3] = {0.0,0.0,-1.0}; @@ -417,6 +417,34 @@ void precache_setup_shadeinput(Render *re, ObjectInstanceRen *obi, Material *ma, VECCOPY(shi->view, view); } +static void precache_init_parts(ListBase *precache_parts, RayTree *tree, ShadeInput *shi, ObjectInstanceRen *obi, float *bbmin, float *bbmax, int res) +{ + int i; + float voxel[3]; + + VecSubf(voxel, bbmax, bbmin); + if ((voxel[0] < FLT_EPSILON) || (voxel[1] < FLT_EPSILON) || (voxel[2] < FLT_EPSILON)) + return; + VecMulf(voxel, 1.0f/res); + + for(i=0; i < totparts; i++) { + VolPrecachePart *pa= MEM_callocN(sizeof(VolPrecachePart), "new precache part"); + + pa->done = 0; + pa->num = i; + + pa->res = res; + VECCOPY(pa->bbmin, bbmin); + VECCOPY(precache_parts[j].voxel, voxel); + precache_parts[j].tree = tree; + precache_parts[j].shi = shi; + precache_parts[j].obi = obi; + + BLI_addtail(precache_parts, pa); + } + +} + void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *obi, Material *ma, float *bbmin, float *bbmax) { int x, y, z; @@ -431,13 +459,12 @@ void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *obi, Mat int res_2, res_3; int edgeparts=2; - int totparts; - ListBase threads; + ListBase threads, precache_parts; int cont= 1; int xparts, yparts, zparts; float part[3]; int totthread = re->r.threads; - ListBase precache_parts; + int totparts = edgeparts*edgeparts*edgeparts; VolPrecachePart *nextpa; int j; @@ -452,41 +479,13 @@ void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *obi, Mat * used for checking if the cached point is inside or outside. */ tree = create_raytree_obi(obi, bbmin, bbmax); if (!tree) return; + + obi->volume_precache = MEM_callocN(sizeof(float)*res_3*3, "volume light cache"); /* Need a shadeinput to calculate scattering */ precache_setup_shadeinput(re, obi, ma, &shi); + precache_init_parts(&precache_parts, tree, shi, obi, bbmin, bbmax, res); - VecSubf(voxel, bbmax, bbmin); - if ((voxel[0] < FLT_EPSILON) || (voxel[1] < FLT_EPSILON) || (voxel[2] < FLT_EPSILON)) - return; - VecMulf(voxel, 1.0f/res); - - part[0] = ceil(res/(float)xparts); - part[1] = ceil(res/(float)yparts); - part[2] = ceil(res/(float)zparts); - - obi->volume_precache = MEM_callocN(sizeof(float)*res_3*3, "volume light cache"); - - totparts = edgeparts*edgeparts*edgeparts; - precache_parts= MEM_callocN(sizeof(VolPrecachePart)*totparts, "VolPrecachePart"); - memset(precache_parts, 0, sizeof(VolPrecachePart)*totparts); - - precache_init_parts(precache_parts); - - for(j=0; j < totparts; j++) { - VolPrecachePart *pa= MEM_callocN(sizeof(VolPrecachePart), "new precache part"); - - pa->done = 0; - pa->num = j; - - pa->res = res; - VECCOPY(pa->bbmin, bbmin); - VECCOPY(precache_parts[j].voxel, voxel); - precache_parts[j].tree = tree; - precache_parts[j].shi = shi; - precache_parts[j].obi = obi; - } - BLI_init_threads(&threads, vol_precache_part, totthread); nextpa = precache_get_new_part(precache_threads); @@ -600,12 +599,15 @@ void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *obi, Mat void volume_precache(Render *re) { ObjectInstanceRen *obi; - VolPrecache *vp; + VolumeOb *vo; - for(vp= re->vol_precache_obs.first; vp; vp= vp->next) { - for(obi= re->instancetable.first; obi; obi= obi->next) { - if (obi->obr == vp->obr) - vol_precache_objectinstance(re, obi, vp->ma, obi->obr->boundbox[0], obi->obr->boundbox[1]); + for(vo= re->volumes.first; vo; vo= vo->next) { + if (vo->ma->vol_shadeflag & MA_VOL_PRECACHESHADING) { + for(obi= re->instancetable.first; obi; obi= obi->next) { + if (obi->obr == vo->obr) { + vol_precache_objectinstance(re, obi, vo->ma, obi->obr->boundbox[0], obi->obr->boundbox[1]); + } + } } } @@ -624,3 +626,19 @@ void free_volume_precache(Render *re) BLI_freelistN(&re->vol_precache_obs); } + +int point_inside_volume_objectinstance(ObjectInstanceRen *obi, float *co) +{ + RayTree *tree; + int inside=0; + + tree = create_raytree_obi(obi, obi->obr->boundbox[0], obi->obr->boundbox[1]); + if (!tree) return 0; + + inside = point_inside_obi(tree, obi, co); + + RE_ray_tree_free(tree); + tree= NULL; + + return inside; +} diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 45d54d40fa1..fba847da2ad 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -21,7 +21,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): Matt Ebb, Raul Hernandez. + * Contributor(s): Matt Ebb, Raul Fernandez Hernandez (Farsthary) * * ***** END GPL LICENSE BLOCK ***** */ @@ -134,6 +134,11 @@ float vol_get_stepsize(struct ShadeInput *shi, int context) return shi->mat->vol_stepsize; } +static float vol_get_depth_cutoff(struct ShadeInput *shi) +{ + return shi->mat->vol_depth_cutoff; +} + /* SHADING */ static float D(ShadeInput *shi, int rgb, int x, int y, int z) @@ -278,7 +283,7 @@ float vol_get_phasefunc(ShadeInput *shi, short phasefunc_type, float g, float *w void vol_get_absorption(ShadeInput *shi, float *absorb_col, float *co) { float dummy = 1.0f; - float absorption = shi->mat->vol_absorption; + const float absorption = shi->mat->vol_absorption; VECCOPY(absorb_col, shi->mat->vol_absorption_col); @@ -296,14 +301,13 @@ void vol_get_absorption(ShadeInput *shi, float *absorb_col, float *co) void vol_get_attenuation(ShadeInput *shi, float *tau, float *co, float *endco, float density, float stepsize) { /* input density = density at co */ - float dist; float absorb_col[3]; int s, nsteps; float step_vec[3], step_sta[3], step_end[3]; + const float dist = VecLenf(co, endco); vol_get_absorption(shi, absorb_col, co); - dist = VecLenf(co, endco); nsteps = (int)((dist / stepsize) + 0.5); /* trigger for recalculating density */ @@ -468,6 +472,7 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float float tau[3], emit_col[3], scatter_col[3] = {0.0, 0.0, 0.0}; float stepvec[3], step_sta[3], step_end[3], step_mid[3]; float density = vol_get_density(shi, co); + const float depth_cutoff = vol_get_depth_cutoff(shi); /* multiply col_behind with beam transmittance over entire distance */ vol_get_attenuation(shi, tau, co, endco, density, stepsize); @@ -524,6 +529,9 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float VecCopyf(step_sta, step_end); VecAddf(step_end, step_end, stepvec); + + /* luminance rec. 709 */ + if ((0.2126*tr[0] + 0.7152*tr[1] + 0.0722*tr[2]) < depth_cutoff) break; } VecCopyf(col, radiance); diff --git a/source/blender/src/butspace.c b/source/blender/src/butspace.c index 2ca709184c5..6d8f806d8f9 100644 --- a/source/blender/src/butspace.c +++ b/source/blender/src/butspace.c @@ -92,7 +92,7 @@ MTex mtexcopybuf; char texstr[20][12]= {"None" , "Clouds" , "Wood", "Marble", "Magic" , "Blend", "Stucci", "Noise" , "Image", "Plugin", "EnvMap" , "Musgrave", - "Voronoi", "DistNoise", "", "PointDensity", "", "", "", ""}; + "Voronoi", "DistNoise", "", "PointDensity", "VoxelData", "", "", ""}; /* ---------------------------------------------------------------------- */ void test_idbutton_cb(void *namev, void *arg2) diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index a8aa00370d9..6e69414fbe0 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -264,6 +264,19 @@ static int vergcband(const void *a1, const void *a2) return 0; } +static void voxeldata_filename(char *str, void *tex_v, void *unused) /* called from fileselect */ +{ + Tex *tex= tex_v; + + if(tex->type!=TEX_VOXELDATA) return; + + strcpy(tex->vd->source_path, str); + + allqueue(REDRAWBUTSSHADING, 0); + BIF_preview_changed(ID_TE); + BIF_undo_push("Open voxel data source"); +} + void do_texbuts(unsigned short event) { Tex *tex; @@ -425,7 +438,25 @@ void do_texbuts(unsigned short event) allqueue(REDRAWBUTSSHADING, 0); allqueue(REDRAWIPO, 0); break; + + case B_VOXELDATA_LOAD: + if (tex->vd==NULL) { + tex->vd= BKE_add_voxeldata(); +#ifdef _WIN32 + if (strcmp (U.textudir, "/") == 0) + strcpy(str, G.sce); + else + strcpy(str, U.textudir); +#else + strcpy(str, U.textudir); +#endif + } + else strcpy(str, tex->vd->source_path); + sa= closest_bigger_area(); + areawinset(sa->win); + activate_fileselect_args(FILE_SPECIAL, "Open Voxel Data", str, voxeldata_filename, tex, NULL); + break; default: if(event>=B_PLUGBUT && event<=B_PLUGBUT+23) { PluginTex *pit= tex->plugin; @@ -1016,6 +1047,48 @@ static void texture_panel_pointdensity_modify(Tex *tex) } +static void texture_panel_voxeldata(Tex *tex) +{ + uiBlock *block; + VoxelData *vd; + short yco=PANEL_YMAX; + + block= uiNewBlock(&curarea->uiblocks, "texture_panel_voxeldata", UI_EMBOSS, UI_HELV, curarea->win); + if(uiNewPanel(curarea, block, "Voxel Data", "Texture", PANELX, PANELY, PANELW, PANELH)==0) return; + uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE); + + if(tex->vd==NULL) { + tex->vd= BKE_add_voxeldata(); + } + + if(tex->vd) { + vd= tex->vd; + + uiDefBut(block, LABEL, B_NOP, "Data source:", + X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + + uiDefIconTextBut(block, BUT, B_VOXELDATA_LOAD, ICON_FILESEL, "Open", + X4CLM1, yco-=BUTH, BUTW4, BUTH, 0, 0, 0, 0, 0, ""); + uiDefBut(block, TEX, 0, "", + X4CLM2+XSPACE, yco, BUTW2+BUTW4+2*XSPACE, BUTH, &vd->source_path, 0.0, 79.0, 0, 0, "File path to the voxel data set"); + + yco -= YSPACE; + + uiDefBut(block, LABEL, B_NOP, "Interpolation:", + X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + uiDefButI(block, MENU, B_REDR, "None %x0|Linear %x1|Tricubic %x2", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &vd->interp_type, 0.0, 0.0, 0, 0, "Interpolation type"); + + uiDefButI(block, NUM, B_REDR, "Resolution: ", + X2CLM2, yco, BUTW2, BUTH, &(vd->resolX), 1, 10000, 0, 0, "Resolution of the voxel data"); + + yco -= YSPACE; + + uiDefButF(block, NUM, B_REDR, "Intensity: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(vd->int_multiplier), 0.0001, 10000.0, 0, 0, "Multiplier to scale up or down the texture's intensity"); + } +} + static char *layer_menu(RenderResult *rr, short *curlay) { RenderLayer *rl; @@ -1865,7 +1938,7 @@ static void texture_panel_texture(MTex *actmtex, Material *ma, World *wrld, Lamp /* newnoise: all texture types as menu, not enough room for more buttons. * Can widen panel, but looks ugly when other panels overlap it */ if( !tex->use_nodes ) { - sprintf(textypes, "Texture Type %%t|None %%x%d|Image %%x%d|EnvMap %%x%d|Clouds %%x%d|Marble %%x%d|Stucci %%x%d|Wood %%x%d|Magic %%x%d|Blend %%x%d|Noise %%x%d|Plugin %%x%d|Musgrave %%x%d|Voronoi %%x%d|DistortedNoise %%x%d|Point Density %%x%d", 0, TEX_IMAGE, TEX_ENVMAP, TEX_CLOUDS, TEX_MARBLE, TEX_STUCCI, TEX_WOOD, TEX_MAGIC, TEX_BLEND, TEX_NOISE, TEX_PLUGIN, TEX_MUSGRAVE, TEX_VORONOI, TEX_DISTNOISE, TEX_POINTDENSITY); + sprintf(textypes, "Texture Type %%t|None %%x%d|Image %%x%d|EnvMap %%x%d|Clouds %%x%d|Marble %%x%d|Stucci %%x%d|Wood %%x%d|Magic %%x%d|Blend %%x%d|Noise %%x%d|Plugin %%x%d|Musgrave %%x%d|Voronoi %%x%d|DistortedNoise %%x%d|Point Density %%x%d|Voxel Data %%x%d", 0, TEX_IMAGE, TEX_ENVMAP, TEX_CLOUDS, TEX_MARBLE, TEX_STUCCI, TEX_WOOD, TEX_MAGIC, TEX_BLEND, TEX_NOISE, TEX_PLUGIN, TEX_MUSGRAVE, TEX_VORONOI, TEX_DISTNOISE, TEX_POINTDENSITY, TEX_VOXELDATA); uiDefBut(block, LABEL, 0, "Texture Type", 160, 150, 140, 20, 0, 0.0, 0.0, 0, 0, ""); uiDefButS(block, MENU, B_TEXTYPE, textypes, 160, 125, 140, 25, &tex->type, 0,0,0,0, "Select texture type"); } @@ -4449,6 +4522,8 @@ static void material_panel_material_volume(Material *ma) X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_stepsize), 0.001, 100.0, 10, 2, "Ray marching step size"); uiDefButS(block, MENU, B_TEXREDR_PRV, "Step Size Calculation %t|Randomized %x0|Constant %x1", X2CLM1, yco-=BUTH, BUTW2, BUTH, &ma->vol_stepsize_type, 0.0, 0.0, 0, 0, "Step size calculation, randomized replaces banding with jittering"); + uiDefButF(block, NUM, B_MATPRV, "Depth Cutoff: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_depth_cutoff), 0.001, 1.0, 10, 2, "Stop ray marching early if transmission drops below this luminance - higher values give speedups in dense volumes at the expense of accuracy "); uiBlockEndAlign(block); yco -= YSPACE; @@ -4921,6 +4996,9 @@ void texture_panels() texture_panel_pointdensity(tex); texture_panel_pointdensity_modify(tex); break; + case TEX_VOXELDATA: + texture_panel_voxeldata(tex); + break; } } } From c2f037da073856ab44096df6d7e5dfbebb5f5efa Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sat, 13 Dec 2008 05:43:10 +0000 Subject: [PATCH 070/577] and the new voxel data files.. --- .../blender/render/intern/include/voxeldata.h | 45 ++ .../blender/render/intern/source/voxeldata.c | 444 ++++++++++++++++++ 2 files changed, 489 insertions(+) create mode 100644 source/blender/render/intern/include/voxeldata.h create mode 100644 source/blender/render/intern/source/voxeldata.c diff --git a/source/blender/render/intern/include/voxeldata.h b/source/blender/render/intern/include/voxeldata.h new file mode 100644 index 00000000000..504d5523db6 --- /dev/null +++ b/source/blender/render/intern/include/voxeldata.h @@ -0,0 +1,45 @@ +/** + * + * ***** 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): Raul Fernandez Hernandez (Farsthary), Matt Ebb. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef VOXELDATA_H +#define VOXELDATA_H + +/** + * Load voxel data for all point density textures in the scene + */ + +struct Render; +struct TexResult; + +int _I(int x,int y,int z,int n); +void make_voxeldata(struct Render *re); +void free_voxeldata(struct Render *re); +int voxeldatatex(struct Tex *tex, float *texvec, struct TexResult *texres); + + +#endif /* VOXELDATA_H */ diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c new file mode 100644 index 00000000000..b2521e59b41 --- /dev/null +++ b/source/blender/render/intern/source/voxeldata.c @@ -0,0 +1,444 @@ +/** + * + * ***** 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): Raul Fernandez Hernandez (Farsthary), Matt Ebb. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include +#include + +#include "MEM_guardedalloc.h" + +#include "BLI_arithb.h" +#include "BLI_blenlib.h" + +#include "BKE_global.h" +#include "BKE_main.h" + +#include "DNA_texture_types.h" +#include "render_types.h" +#include "renderdatabase.h" +#include "texture.h" + +/*---------------------------Utils----------------------------------------*/ +int _I(int x,int y,int z,int n) +{ + return (z*(n)+y)*(n)+x; +} + +float Linear(float xx,float yy,float zz,float *x0,int n) +{ + float sx1,sx0,sy1,sy0,sz1,sz0,v0,v1; + int i0,i1,j0,j1,k0,k1; + + if (xx<0.5) xx=0.5f; if (xx>n+0.5) xx=n+0.5f; i0=(int)xx; i1=i0+1; + if (yy<0.5) yy=0.5f; if (yy>n+0.5) yy=n+0.5f; j0=(int)yy; j1=j0+1; + if (zz<0.5) zz=0.5f; if (zz>n+0.5) zz=n+0.5f; k0=(int)zz; k1=k0+1; + + sx1 = xx-i0; sx0 = 1-sx1; + sy1 = yy-j0; sy0 = 1-sy1; + sz1 = zz-k0; sz0 = 1-sz1; + v0 = sx0*(sy0*x0[_I(i0,j0,k0,n)]+sy1*x0[_I(i0,j1,k0,n)])+sx1*(sy0*x0[_I(i1,j0,k0,n)]+sy1*x0[_I(i1,j1,k0,n)]); + v1 = sx0*(sy0*x0[_I(i0,j0,k1,n)]+sy1*x0[_I(i0,j1,k1,n)])+sx1*(sy0*x0[_I(i1,j0,k1,n)]+sy1*x0[_I(i1,j1,k1,n)]); + return sz0*v0 + sz1*v1; + +} + +int C[64][64] = { + { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {-3, 3, 0, 0, 0, 0, 0, 0,-2,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 2,-2, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 9,-9,-9, 9, 0, 0, 0, 0, 6, 3,-6,-3, 0, 0, 0, 0, 6,-6, 3,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {-6, 6, 6,-6, 0, 0, 0, 0,-3,-3, 3, 3, 0, 0, 0, 0,-4, 4,-2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-2,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 2, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {-6, 6, 6,-6, 0, 0, 0, 0,-4,-2, 4, 2, 0, 0, 0, 0,-3, 3,-3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-1,-2,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 4,-4,-4, 4, 0, 0, 0, 0, 2, 2,-2,-2, 0, 0, 0, 0, 2,-2, 2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 3, 0, 0, 0, 0, 0, 0,-2,-1, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,-2, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9,-9,-9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 3,-6,-3, 0, 0, 0, 0, 6,-6, 3,-3, 0, 0, 0, 0, 4, 2, 2, 1, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-6, 6, 6,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3,-3, 3, 3, 0, 0, 0, 0,-4, 4,-2, 2, 0, 0, 0, 0,-2,-2,-1,-1, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-6, 6, 6,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4,-2, 4, 2, 0, 0, 0, 0,-3, 3,-3, 3, 0, 0, 0, 0,-2,-1,-2,-1, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4,-4,-4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2,-2,-2, 0, 0, 0, 0, 2,-2, 2,-2, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0}, + {-3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0, 0, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0, 0, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 9,-9, 0, 0,-9, 9, 0, 0, 6, 3, 0, 0,-6,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,-6, 0, 0, 3,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 2, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {-6, 6, 0, 0, 6,-6, 0, 0,-3,-3, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4, 4, 0, 0,-2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-2, 0, 0,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0, 0, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0, 0, 0,-1, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9,-9, 0, 0,-9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 3, 0, 0,-6,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,-6, 0, 0, 3,-3, 0, 0, 4, 2, 0, 0, 2, 1, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-6, 6, 0, 0, 6,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3,-3, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4, 4, 0, 0,-2, 2, 0, 0,-2,-2, 0, 0,-1,-1, 0, 0}, + { 9, 0,-9, 0,-9, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 3, 0,-6, 0,-3, 0, 6, 0,-6, 0, 3, 0,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 2, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 9, 0,-9, 0,-9, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 3, 0,-6, 0,-3, 0, 6, 0,-6, 0, 3, 0,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 2, 0, 2, 0, 1, 0}, + {-27,27,27,-27,27,-27,-27,27,-18,-9,18, 9,18, 9,-18,-9,-18,18,-9, 9,18,-18, 9,-9,-18,18,18,-18,-9, 9, 9,-9,-12,-6,-6,-3,12, 6, 6, 3,-12,-6,12, 6,-6,-3, 6, 3,-12,12,-6, 6,-6, 6,-3, 3,-8,-4,-4,-2,-4,-2,-2,-1}, + {18,-18,-18,18,-18,18,18,-18, 9, 9,-9,-9,-9,-9, 9, 9,12,-12, 6,-6,-12,12,-6, 6,12,-12,-12,12, 6,-6,-6, 6, 6, 6, 3, 3,-6,-6,-3,-3, 6, 6,-6,-6, 3, 3,-3,-3, 8,-8, 4,-4, 4,-4, 2,-2, 4, 4, 2, 2, 2, 2, 1, 1}, + {-6, 0, 6, 0, 6, 0,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0,-3, 0, 3, 0, 3, 0,-4, 0, 4, 0,-2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-2, 0,-1, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0,-6, 0, 6, 0, 6, 0,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0,-3, 0, 3, 0, 3, 0,-4, 0, 4, 0,-2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-2, 0,-1, 0,-1, 0}, + {18,-18,-18,18,-18,18,18,-18,12, 6,-12,-6,-12,-6,12, 6, 9,-9, 9,-9,-9, 9,-9, 9,12,-12,-12,12, 6,-6,-6, 6, 6, 3, 6, 3,-6,-3,-6,-3, 8, 4,-8,-4, 4, 2,-4,-2, 6,-6, 6,-6, 3,-3, 3,-3, 4, 2, 4, 2, 2, 1, 2, 1}, + {-12,12,12,-12,12,-12,-12,12,-6,-6, 6, 6, 6, 6,-6,-6,-6, 6,-6, 6, 6,-6, 6,-6,-8, 8, 8,-8,-4, 4, 4,-4,-3,-3,-3,-3, 3, 3, 3, 3,-4,-4, 4, 4,-2,-2, 2, 2,-4, 4,-4, 4,-2, 2,-2, 2,-2,-2,-2,-2,-1,-1,-1,-1}, + { 2, 0, 0, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {-6, 6, 0, 0, 6,-6, 0, 0,-4,-2, 0, 0, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 3, 0, 0,-3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-1, 0, 0,-2,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 4,-4, 0, 0,-4, 4, 0, 0, 2, 2, 0, 0,-2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,-2, 0, 0, 2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-6, 6, 0, 0, 6,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4,-2, 0, 0, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 3, 0, 0,-3, 3, 0, 0,-2,-1, 0, 0,-2,-1, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4,-4, 0, 0,-4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0,-2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,-2, 0, 0, 2,-2, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0}, + {-6, 0, 6, 0, 6, 0,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4, 0,-2, 0, 4, 0, 2, 0,-3, 0, 3, 0,-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0,-2, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0,-6, 0, 6, 0, 6, 0,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4, 0,-2, 0, 4, 0, 2, 0,-3, 0, 3, 0,-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0,-2, 0,-1, 0}, + {18,-18,-18,18,-18,18,18,-18,12, 6,-12,-6,-12,-6,12, 6,12,-12, 6,-6,-12,12,-6, 6, 9,-9,-9, 9, 9,-9,-9, 9, 8, 4, 4, 2,-8,-4,-4,-2, 6, 3,-6,-3, 6, 3,-6,-3, 6,-6, 3,-3, 6,-6, 3,-3, 4, 2, 2, 1, 4, 2, 2, 1}, + {-12,12,12,-12,12,-12,-12,12,-6,-6, 6, 6, 6, 6,-6,-6,-8, 8,-4, 4, 8,-8, 4,-4,-6, 6, 6,-6,-6, 6, 6,-6,-4,-4,-2,-2, 4, 4, 2, 2,-3,-3, 3, 3,-3,-3, 3, 3,-4, 4,-2, 2,-4, 4,-2, 2,-2,-2,-1,-1,-2,-2,-1,-1}, + { 4, 0,-4, 0,-4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0,-2, 0,-2, 0, 2, 0,-2, 0, 2, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + { 0, 0, 0, 0, 0, 0, 0, 0, 4, 0,-4, 0,-4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0,-2, 0,-2, 0, 2, 0,-2, 0, 2, 0,-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}}; + +int ijk2n(int i, int j, int k) { + return(i+4*j+16*k); +} + +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]; + } + } +} + +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; + } +} + + +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); +} + +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); +} + + +float tricubic(float xx,float yy,float zz,float *heap,int n) +{ + + int xi,yi,zi; + + if (xx<0.5) xx=0.5f; if (xx>n+0.5) xx=n+0.5f; xi=(int)xx; + if (yy<0.5) yy=0.5f; if (yy>n+0.5) yy=n+0.5f; yi=(int)yy; + if (zz<0.5) zz=0.5f; if (zz>n+0.5) zz=n+0.5f; zi=(int)zz; + + float a[64]; + + float fval[8]={heap[_I(xi,yi,zi,n)],heap[_I(xi+1,yi,zi,n)],heap[_I(xi,yi+1,zi,n)],heap[_I(xi+1,yi+1,zi,n)],heap[_I(xi,yi,zi+1,n)],heap[_I(xi+1,yi,zi+1,n)],heap[_I(xi,yi+1,zi+1,n)],heap[_I(xi+1,yi+1,zi+1,n)]}; + + float dfdxval[8]={0.5f*(heap[_I(xi+1,yi,zi,n)]-heap[_I(xi-1,yi,zi,n)]),0.5f*(heap[_I(xi+2,yi,zi,n)]-heap[_I(xi,yi,zi,n)]), + 0.5f*(heap[_I(xi+1,yi+1,zi,n)]-heap[_I(xi-1,yi+1,zi,n)]),0.5f*(heap[_I(xi+2,yi+1,zi,n)]-heap[_I(xi,yi+1,zi,n)]), + 0.5f*(heap[_I(xi+1,yi,zi+1,n)]-heap[_I(xi-1,yi,zi+1,n)]),0.5f*(heap[_I(xi+2,yi,zi+1,n)]-heap[_I(xi,yi,zi+1,n)]), + 0.5f*(heap[_I(xi+1,yi+1,zi+1,n)]-heap[_I(xi-1,yi+1,zi+1,n)]), + 0.5f*(heap[_I(xi+2,yi+1,zi+1,n)]-heap[_I(xi,yi+1,zi+1,n)])}; + + float dfdyval[8]={0.5f*(heap[_I(xi,yi+1,zi,n)]-heap[_I(xi,yi-1,zi,n)]),0.5f*(heap[_I(xi+1,yi+1,zi,n)]-heap[_I(xi+1,yi-1,zi,n)]), + 0.5f*(heap[_I(xi,yi+2,zi,n)]-heap[_I(xi,yi,zi,n)]),0.5f*(heap[_I(xi+1,yi+2,zi,n)]-heap[_I(xi+1,yi,zi,n)]), + 0.5f*(heap[_I(xi,yi+1,zi+1,n)]-heap[_I(xi,yi-1,zi+1,n)]),0.5f*(heap[_I(xi+1,yi+1,zi+1,n)]-heap[_I(xi+1,yi-1,zi+1,n)]), + 0.5f*(heap[_I(xi,yi+2,zi+1,n)]-heap[_I(xi,yi,zi+1,n)]), + 0.5f*(heap[_I(xi+1,yi+2,zi+1,n)]-heap[_I(xi+1,yi,zi+1,n)])}; + + float dfdzval[8]={0.5f*(heap[_I(xi,yi,zi+1,n)]-heap[_I(xi,yi,zi-1,n)]),0.5f*(heap[_I(xi+1,yi,zi+1,n)]-heap[_I(xi+1,yi,zi-1,n)]), + 0.5f*(heap[_I(xi,yi+1,zi+1,n)]-heap[_I(xi,yi+1,zi-1,n)]),0.5f*(heap[_I(xi+1,yi+1,zi+1,n)]-heap[_I(xi+1,yi+1,zi-1,n)]), + 0.5f*(heap[_I(xi,yi,zi+2,n)]-heap[_I(xi,yi,zi,n)]),0.5f*(heap[_I(xi+1,yi,zi+2,n)]-heap[_I(xi+1,yi,zi,n)]), + 0.5f*(heap[_I(xi,yi+1,zi+2,n)]-heap[_I(xi,yi+1,zi,n)]), + 0.5f*(heap[_I(xi+1,yi+1,zi+2,n)]-heap[_I(xi+1,yi+1,zi,n)])}; + + float d2fdxdyval[8]={0.25*(heap[_I(xi+1,yi+1,zi,n)]-heap[_I(xi-1,yi+1,zi,n)]-heap[_I(xi+1,yi-1,zi,n)]+heap[_I(xi-1,yi-1,zi,n)]), + 0.25*(heap[_I(xi+2,yi+1,zi,n)]-heap[_I(xi,yi+1,zi,n)]-heap[_I(xi+2,yi-1,zi,n)]+heap[_I(xi,yi-1,zi,n)]), + 0.25*(heap[_I(xi+1,yi+2,zi,n)]-heap[_I(xi-1,yi+2,zi,n)]-heap[_I(xi+1,yi,zi,n)]+heap[_I(xi-1,yi,zi,n)]), + 0.25*(heap[_I(xi+2,yi+2,zi,n)]-heap[_I(xi,yi+2,zi,n)]-heap[_I(xi+2,yi,zi,n)]+heap[_I(xi,yi,zi,n)]), + 0.25*(heap[_I(xi+1,yi+1,zi+1,n)]-heap[_I(xi-1,yi+1,zi+1,n)]-heap[_I(xi+1,yi-1,zi+1,n)]+heap[_I(xi-1,yi-1,zi+1,n)]), + 0.25*(heap[_I(xi+2,yi+1,zi+1,n)]-heap[_I(xi,yi+1,zi+1,n)]-heap[_I(xi+2,yi-1,zi+1,n)]+heap[_I(xi,yi-1,zi+1,n)]), + 0.25*(heap[_I(xi+1,yi+2,zi+1,n)]-heap[_I(xi-1,yi+2,zi+1,n)]-heap[_I(xi+1,yi,zi+1,n)]+heap[_I(xi-1,yi,zi+1,n)]), + 0.25*(heap[_I(xi+2,yi+2,zi+1,n)]-heap[_I(xi,yi+2,zi+1,n)]-heap[_I(xi+2,yi,zi+1,n)]+heap[_I(xi,yi,zi+1,n)])}; + + float d2fdxdzval[8]={0.25f*(heap[_I(xi+1,yi,zi+1,n)]-heap[_I(xi-1,yi,zi+1,n)]-heap[_I(xi+1,yi,zi-1,n)]+heap[_I(xi-1,yi,zi-1,n)]), + 0.25f*(heap[_I(xi+2,yi,zi+1,n)]-heap[_I(xi,yi,zi+1,n)]-heap[_I(xi+2,yi,zi-1,n)]+heap[_I(xi,yi,zi-1,n)]), + 0.25f*(heap[_I(xi+1,yi+1,zi+1,n)]-heap[_I(xi-1,yi+1,zi+1,n)]-heap[_I(xi+1,yi+1,zi-1,n)]+heap[_I(xi-1,yi+1,zi-1,n)]), + 0.25f*(heap[_I(xi+2,yi+1,zi+1,n)]-heap[_I(xi,yi+1,zi+1,n)]-heap[_I(xi+2,yi+1,zi-1,n)]+heap[_I(xi,yi+1,zi-1,n)]), + 0.25f*(heap[_I(xi+1,yi,zi+2,n)]-heap[_I(xi-1,yi,zi+2,n)]-heap[_I(xi+1,yi,zi,n)]+heap[_I(xi-1,yi,zi,n)]), + 0.25f*(heap[_I(xi+2,yi,zi+2,n)]-heap[_I(xi,yi,zi+2,n)]-heap[_I(xi+2,yi,zi,n)]+heap[_I(xi,yi,zi,n)]), + 0.25f*(heap[_I(xi+1,yi+1,zi+2,n)]-heap[_I(xi-1,yi+1,zi+2,n)]-heap[_I(xi+1,yi+1,zi,n)]+heap[_I(xi-1,yi+1,zi,n)]), + 0.25f*(heap[_I(xi+2,yi+1,zi+2,n)]-heap[_I(xi,yi+1,zi+2,n)]-heap[_I(xi+2,yi+1,zi,n)]+heap[_I(xi,yi+1,zi,n)])}; + + + float d2fdydzval[8]={0.25f*(heap[_I(xi,yi+1,zi+1,n)]-heap[_I(xi,yi-1,zi+1,n)]-heap[_I(xi,yi+1,zi-1,n)]+heap[_I(xi,yi-1,zi-1,n)]), + 0.25f*(heap[_I(xi+1,yi+1,zi+1,n)]-heap[_I(xi+1,yi-1,zi+1,n)]-heap[_I(xi+1,yi+1,zi-1,n)]+heap[_I(xi+1,yi-1,zi-1,n)]), + 0.25f*(heap[_I(xi,yi+2,zi+1,n)]-heap[_I(xi,yi,zi+1,n)]-heap[_I(xi,yi+2,zi-1,n)]+heap[_I(xi,yi,zi-1,n)]), + 0.25f*(heap[_I(xi+1,yi+2,zi+1,n)]-heap[_I(xi+1,yi,zi+1,n)]-heap[_I(xi+1,yi+2,zi-1,n)]+heap[_I(xi+1,yi,zi-1,n)]), + 0.25f*(heap[_I(xi,yi+1,zi+2,n)]-heap[_I(xi,yi-1,zi+2,n)]-heap[_I(xi,yi+1,zi,n)]+heap[_I(xi,yi-1,zi,n)]), + 0.25f*(heap[_I(xi+1,yi+1,zi+2,n)]-heap[_I(xi+1,yi-1,zi+2,n)]-heap[_I(xi+1,yi+1,zi,n)]+heap[_I(xi+1,yi-1,zi,n)]), + 0.25f*(heap[_I(xi,yi+2,zi+2,n)]-heap[_I(xi,yi,zi+2,n)]-heap[_I(xi,yi+2,zi,n)]+heap[_I(xi,yi,zi,n)]), + 0.25f*(heap[_I(xi+1,yi+2,zi+2,n)]-heap[_I(xi+1,yi,zi+2,n)]-heap[_I(xi+1,yi+2,zi,n)]+heap[_I(xi+1,yi,zi,n)])}; + + + float d3fdxdydzval[8]={0.125f*(heap[_I(xi+1,yi+1,zi+1,n)]-heap[_I(xi-1,yi+1,zi+1,n)]-heap[_I(xi+1,yi-1,zi+1,n)]+heap[_I(xi-1,yi-1,zi+1,n)]-heap[_I(xi+1,yi+1,zi-1,n)]+heap[_I(xi-1,yi+1,zi-1,n)]+heap[_I(xi+1,yi-1,zi-1,n)]-heap[_I(xi-1,yi-1,zi-1,n)]), + 0.125f*(heap[_I(xi+2,yi+1,zi+1,n)]-heap[_I(xi,yi+1,zi+1,n)]-heap[_I(xi+2,yi-1,zi+1,n)]+heap[_I(xi,yi-1,zi+1,n)]-heap[_I(xi+2,yi+1,zi-1,n)]+heap[_I(xi,yi+1,zi-1,n)]+heap[_I(xi+2,yi-1,zi-1,n)]-heap[_I(xi,yi-1,zi-1,n)]), + 0.125f*(heap[_I(xi+1,yi+2,zi+1,n)]-heap[_I(xi-1,yi+2,zi+1,n)]-heap[_I(xi+1,yi,zi+1,n)]+heap[_I(xi-1,yi,zi+1,n)]-heap[_I(xi+1,yi+2,zi-1,n)]+heap[_I(xi-1,yi+2,zi-1,n)]+heap[_I(xi+1,yi,zi-1,n)]-heap[_I(xi-1,yi,zi-1,n)]), + 0.125f*(heap[_I(xi+2,yi+2,zi+1,n)]-heap[_I(xi,yi+2,zi+1,n)]-heap[_I(xi+2,yi,zi+1,n)]+heap[_I(xi,yi,zi+1,n)]-heap[_I(xi+2,yi+2,zi-1,n)]+heap[_I(xi,yi+2,zi-1,n)]+heap[_I(xi+2,yi,zi-1,n)]-heap[_I(xi,yi,zi-1,n)]), + 0.125f*(heap[_I(xi+1,yi+1,zi+2,n)]-heap[_I(xi-1,yi+1,zi+2,n)]-heap[_I(xi+1,yi-1,zi+2,n)]+heap[_I(xi-1,yi-1,zi+2,n)]-heap[_I(xi+1,yi+1,zi,n)]+heap[_I(xi-1,yi+1,zi,n)]+heap[_I(xi+1,yi-1,zi,n)]-heap[_I(xi-1,yi-1,zi,n)]), + 0.125f*(heap[_I(xi+2,yi+1,zi+2,n)]-heap[_I(xi,yi+1,zi+2,n)]-heap[_I(xi+2,yi-1,zi+2,n)]+heap[_I(xi,yi-1,zi+2,n)]-heap[_I(xi+2,yi+1,zi,n)]+heap[_I(xi,yi+1,zi,n)]+heap[_I(xi+2,yi-1,zi,n)]-heap[_I(xi,yi-1,zi,n)]), + 0.125f*(heap[_I(xi+1,yi+2,zi+2,n)]-heap[_I(xi-1,yi+2,zi+2,n)]-heap[_I(xi+1,yi,zi+2,n)]+heap[_I(xi-1,yi,zi+2,n)]-heap[_I(xi+1,yi+2,zi,n)]+heap[_I(xi-1,yi+2,zi,n)]+heap[_I(xi+1,yi,zi,n)]-heap[_I(xi-1,yi,zi,n)]), + 0.125f*(heap[_I(xi+2,yi+2,zi+2,n)]-heap[_I(xi,yi+2,zi+2,n)]-heap[_I(xi+2,yi,zi+2,n)]+heap[_I(xi,yi,zi+2,n)]-heap[_I(xi+2,yi+2,zi,n)]+heap[_I(xi,yi+2,zi,n)]+heap[_I(xi+2,yi,zi,n)]-heap[_I(xi,yi,zi,n)])}; + + tricubic_get_coeff(a,fval,dfdxval,dfdyval,dfdzval,d2fdxdyval,d2fdxdzval,d2fdydzval,d3fdxdydzval); + + float dx=xx-xi; + float dy=yy-yi; + float dz=zz-zi; + + return tricubic_eval(a,dx,dy,dz); + +} + + + + + +/*--------------------------------------------------------------------*/ + +void load_frame (FILE *fp,float *F, int size,int frame) +{ + + fseek(fp,frame*size*sizeof(float),0); + fread(F,sizeof(float),size,fp); +} + + + + +void cache_voxeldata(struct Render *re,Tex *tex) +{ + VoxelData *vd = tex->vd; + FILE *fp; + int size; + + if (!vd) return; + + vd->resolY=vd->resolX; //for now only support cubic datasets (rectangular datasets could be added latter) + vd->resolZ=vd->resolX; + size = (vd->resolX)*(vd->resolY)*(vd->resolZ); + + vd->dataset=MEM_mallocN(sizeof(float)*size, "voxel dataset"); + + if (!BLI_exists(vd->source_path)) return; + fp = fopen(vd->source_path,"rb"); + if (!fp) return; + + load_frame(fp, vd->dataset, size, re->r.cfra); //here improve the dataset loading function for more dataset types + + fclose(fp); + +} + +void make_voxeldata(struct Render *re) +{ + Tex *tex; + + if(re->scene->r.scemode & R_PREVIEWBUTS) + return; + + re->i.infostr= "Loading voxel datasets"; + re->stats_draw(&re->i); + + for (tex= G.main->tex.first; tex; tex= tex->id.next) { + if(tex->id.us && tex->type==TEX_VOXELDATA) { + cache_voxeldata(re, tex); + } + } + + re->i.infostr= NULL; + re->stats_draw(&re->i); + +} + +static void free_voxeldata_one(Render *re, Tex *tex) +{ + VoxelData *vd = tex->vd; + + if (vd->dataset) { + MEM_freeN(vd->dataset); + vd->dataset = NULL; + } +} + + +void free_voxeldata(Render *re) +{ + Tex *tex; + + if(re->scene->r.scemode & R_PREVIEWBUTS) + return; + + for (tex= G.main->tex.first; tex; tex= tex->id.next) { + if(tex->id.us && tex->type==TEX_VOXELDATA) { + free_voxeldata_one(re, tex); + } + } +} + +int voxeldatatex(struct Tex *tex, float *texvec, struct TexResult *texres) +{ + int retval = TEX_INT; + VoxelData *vd = tex->vd; + float vec[3] = {0.0, 0.0, 0.0}; + float co[3]; + float dx, dy, dz; + int xi, yi, zi; + float xf, yf, zf; + int i=0, fail=0; + int resolX, resolY, resolZ; + + if ((!vd) || (vd->dataset==NULL)) { + texres->tin = 0.0f; + return 0; + } + + //here do the calculation of the interpolation types + + resolX=vd->resolX; + resolY=vd->resolY; + resolZ=vd->resolZ; + + VECCOPY(co, texvec); + + dx=1.0f/(resolX); + dy=1.0f/(resolY); + dz=1.0f/(resolZ); + + xi=co[0]/dx; + yi=co[1]/dy; + zi=co[2]/dz; + + xf=co[0]/dx; + yf=co[1]/dy; + zf=co[2]/dz; + + if (xi>1 && xi1 && yi1 && ziinterp_type) + { + + case TEX_VD_NEARESTNEIGHBOR: + { + texres->tin = vd->dataset[_I(xi,yi,zi,resolX)]; + BRICONT; + break; + } + case TEX_VD_LINEAR: + { + texres->tin = Linear(xf,yf,zf,vd->dataset,resolX); + } + case TEX_VD_TRICUBIC: + { + texres->tin = tricubic(xf,yf,zf,vd->dataset,resolX); + } + + } + + + + } else fail++; + } else fail++; + } else fail++; + + if (fail) texres->tin=0.0f; + + texres->tin *= vd->int_multiplier; + + texres->tr = texres->tin; + texres->tg = texres->tin; + texres->tb = texres->tin; + texres->ta = texres->tin; + BRICONTRGB; + + return retval; +} + + From 5f55aa43d055883af35b7c91474e78e79c6fe352 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sun, 14 Dec 2008 02:22:29 +0000 Subject: [PATCH 071/577] * Compile fixes for voxeldata.c (thanks jms) * Fixed a typo in the patch that made trilinear interpolation really slow * Replaced the patch's trilinear interpolation code with the existing trilinear code from pbrt / light cache (first stage of unifying this voxel interpolation code) --- .../blender/render/intern/source/volumetric.c | 2 +- .../blender/render/intern/source/voxeldata.c | 80 +++++++++++++++---- 2 files changed, 64 insertions(+), 18 deletions(-) diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index fba847da2ad..3206989d1d7 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -150,7 +150,7 @@ static float D(ShadeInput *shi, int rgb, int x, int y, int z) return shi->obi->volume_precache[rgb*res*res*res + x*res*res + y*res + z]; } -inline float lerp(float t, float v1, float v2) { +static inline float lerp(float t, float v1, float v2) { return (1.f - t) * v1 + t * v2; } diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c index b2521e59b41..bffe30b7d80 100644 --- a/source/blender/render/intern/source/voxeldata.c +++ b/source/blender/render/intern/source/voxeldata.c @@ -44,7 +44,7 @@ #include "texture.h" /*---------------------------Utils----------------------------------------*/ -int _I(int x,int y,int z,int n) +static inline int _I(int x,int y,int z,int n) { return (z*(n)+y)*(n)+x; } @@ -67,6 +67,51 @@ float Linear(float xx,float yy,float zz,float *x0,int n) } + +static float D(float *data, const int res, int x, int y, int z) +{ + CLAMP(x, 0, res-1); + CLAMP(y, 0, res-1); + CLAMP(z, 0, res-1); + return data[ _I(x, y, z, res) ]; +} + +static inline float lerp(float t, float v1, float v2) { + return (1.f - t) * v1 + t * v2; +} + +/* trilinear interpolation */ +static float trilinear(float *data, const 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; + float dim[3]; + + if (!data) return; + + voxx = co[0] * res - 0.5f; + voxy = co[1] * res - 0.5f; + voxz = co[2] * res - 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; + +} + + int C[64][64] = { { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, @@ -196,14 +241,16 @@ float tricubic_eval(float a[64], float x, float y, float z) { float tricubic(float xx,float yy,float zz,float *heap,int n) { - int xi,yi,zi; + int xi,yi,zi; + float dx,dy,dz; + float a[64]; + if (xx<0.5) xx=0.5f; if (xx>n+0.5) xx=n+0.5f; xi=(int)xx; if (yy<0.5) yy=0.5f; if (yy>n+0.5) yy=n+0.5f; yi=(int)yy; if (zz<0.5) zz=0.5f; if (zz>n+0.5) zz=n+0.5f; zi=(int)zz; - float a[64]; - + { float fval[8]={heap[_I(xi,yi,zi,n)],heap[_I(xi+1,yi,zi,n)],heap[_I(xi,yi+1,zi,n)],heap[_I(xi+1,yi+1,zi,n)],heap[_I(xi,yi,zi+1,n)],heap[_I(xi+1,yi,zi+1,n)],heap[_I(xi,yi+1,zi+1,n)],heap[_I(xi+1,yi+1,zi+1,n)]}; float dfdxval[8]={0.5f*(heap[_I(xi+1,yi,zi,n)]-heap[_I(xi-1,yi,zi,n)]),0.5f*(heap[_I(xi+2,yi,zi,n)]-heap[_I(xi,yi,zi,n)]), @@ -261,12 +308,14 @@ float tricubic(float xx,float yy,float zz,float *heap,int n) 0.125f*(heap[_I(xi+2,yi+1,zi+2,n)]-heap[_I(xi,yi+1,zi+2,n)]-heap[_I(xi+2,yi-1,zi+2,n)]+heap[_I(xi,yi-1,zi+2,n)]-heap[_I(xi+2,yi+1,zi,n)]+heap[_I(xi,yi+1,zi,n)]+heap[_I(xi+2,yi-1,zi,n)]-heap[_I(xi,yi-1,zi,n)]), 0.125f*(heap[_I(xi+1,yi+2,zi+2,n)]-heap[_I(xi-1,yi+2,zi+2,n)]-heap[_I(xi+1,yi,zi+2,n)]+heap[_I(xi-1,yi,zi+2,n)]-heap[_I(xi+1,yi+2,zi,n)]+heap[_I(xi-1,yi+2,zi,n)]+heap[_I(xi+1,yi,zi,n)]-heap[_I(xi-1,yi,zi,n)]), 0.125f*(heap[_I(xi+2,yi+2,zi+2,n)]-heap[_I(xi,yi+2,zi+2,n)]-heap[_I(xi+2,yi,zi+2,n)]+heap[_I(xi,yi,zi+2,n)]-heap[_I(xi+2,yi+2,zi,n)]+heap[_I(xi,yi+2,zi,n)]+heap[_I(xi+2,yi,zi,n)]-heap[_I(xi,yi,zi,n)])}; + tricubic_get_coeff(a,fval,dfdxval,dfdyval,dfdzval,d2fdxdyval,d2fdxdzval,d2fdydzval,d3fdxdydzval); - - float dx=xx-xi; - float dy=yy-yi; - float dz=zz-zi; + } + + dx = xx-xi; + dy = yy-yi; + dz = zz-zi; return tricubic_eval(a,dx,dy,dz); @@ -390,7 +439,7 @@ int voxeldatatex(struct Tex *tex, float *texvec, struct TexResult *texres) xi=co[0]/dx; yi=co[1]/dy; zi=co[2]/dz; - + xf=co[0]/dx; yf=co[1]/dy; zf=co[2]/dz; @@ -401,29 +450,24 @@ int voxeldatatex(struct Tex *tex, float *texvec, struct TexResult *texres) { if (zi>1 && ziinterp_type) { - case TEX_VD_NEARESTNEIGHBOR: { texres->tin = vd->dataset[_I(xi,yi,zi,resolX)]; - BRICONT; break; } case TEX_VD_LINEAR: { - texres->tin = Linear(xf,yf,zf,vd->dataset,resolX); + texres->tin = trilinear(vd->dataset, resolX, co); + break; } case TEX_VD_TRICUBIC: { texres->tin = tricubic(xf,yf,zf,vd->dataset,resolX); + break; } - } - - - } else fail++; } else fail++; } else fail++; @@ -432,6 +476,8 @@ int voxeldatatex(struct Tex *tex, float *texvec, struct TexResult *texres) texres->tin *= vd->int_multiplier; + BRICONT; + texres->tr = texres->tin; texres->tg = texres->tin; texres->tb = texres->tin; From 7124d321d88240f14161c365ec1238ade2ec224d Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 15 Dec 2008 05:49:56 +0000 Subject: [PATCH 072/577] * msvc compile fix --- source/blender/render/intern/source/voxeldata.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c index bffe30b7d80..2f0bbd44a7c 100644 --- a/source/blender/render/intern/source/voxeldata.c +++ b/source/blender/render/intern/source/voxeldata.c @@ -43,6 +43,10 @@ #include "renderdatabase.h" #include "texture.h" +#if defined( _MSC_VER ) && !defined( __cplusplus ) +# define inline __inline +#endif // defined( _MSC_VER ) && !defined( __cplusplus ) + /*---------------------------Utils----------------------------------------*/ static inline int _I(int x,int y,int z,int n) { From be1d06a2c544a4ea27139475a72edb75afa37879 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 22 Dec 2008 20:28:02 +0000 Subject: [PATCH 073/577] Volume rendering: * Multithreaded volume light cache While the render process itself is multithreaded, the light cache pre-process previously wasn't (painfully noticed this the other week rendering on some borrowed octocore nodes!). This commit adds threading, similar to the tiled render - it divides the light cache's voxel grid into 3d parts and renders them with the available threads. This makes the most significant difference on shots where the light cache pre- process is the bottleneck, so shots with either several lights, or a high res light cache, or both. On this file (3 lights, light cache res 120), on my Core 2 Duo it now renders in 27 seconds compared to 49 previously. http://mke3.net/blender/devel/rendering/volumetrics/threaded_cache.jpg --- .../render/intern/include/render_types.h | 26 +- .../render/intern/source/volume_precache.c | 325 ++++++++---------- 2 files changed, 168 insertions(+), 183 deletions(-) diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index 65bb12e059d..8dbdde77726 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -202,9 +202,9 @@ struct Render struct Object *excludeob; - ListBase vol_precache_obs; 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. @@ -404,13 +404,6 @@ typedef struct StrandRen { /* ------------------------------------------------------------------------- */ -typedef struct VolPrecache -{ - struct VolPrecache *next, *prev; - struct Material *ma; - struct ObjectRen *obr; -} VolPrecache; - typedef struct VolumeOb { struct VolumeOb *next, *prev; @@ -423,6 +416,23 @@ typedef struct MatInside { 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; + float bbmin[3]; + float voxel[3]; + int working, done; +} VolPrecachePart; + + /* ------------------------------------------------------------------------- */ struct LampRen; diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c index 89f997f4b99..18687962d79 100644 --- a/source/blender/render/intern/source/volume_precache.c +++ b/source/blender/render/intern/source/volume_precache.c @@ -35,6 +35,7 @@ #include "BLI_blenlib.h" #include "BLI_arithb.h" +#include "BLI_threads.h" #include "PIL_time.h" @@ -47,6 +48,9 @@ #include "renderdatabase.h" #include "volumetric.h" + +#include "BKE_global.h" + /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ /* defined in pipeline.c, is hardcopy of active dynamic allocated Render */ /* only to be used here in this file, it's for speed */ @@ -207,11 +211,7 @@ static void lightcache_filter(float *cache, int res) } } -/* Precache a volume into a 3D voxel grid. - * The voxel grid is stored in the ObjectInstanceRen, - * in camera space, aligned with the ObjectRen's bounding box. - * Resolution is defined by the user. - */ + void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *ma, float *bbmin, float *bbmax) { int x, y, z; @@ -325,29 +325,20 @@ void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *m } -#if 0 -typedef struct VolPrecachePart { - struct VolPrecachePart *next, *prev; - int num; - int minx, maxx; - int miny, maxy; - int minz, maxz; - int res; - float bbmin[3], voxel[3]; - struct RayTree *tree; - struct ShadeInput *shi; - struct ObjectInstanceRen *obi; - int done; -} VolPrecachePart; - +#if 0 // debug stuff static void *vol_precache_part_test(void *data) { - VolPrecachePart *vpt = (VolPrecachePart *)data; + VolPrecachePart *pa = data; - printf("part number: %d \n", vpt->num); + printf("part number: %d \n", pa->num); + printf("done: %d \n", pa->done); + printf("x min: %d x max: %d \n", pa->minx, pa->maxx); + printf("y min: %d y max: %d \n", pa->miny, pa->maxy); + printf("z min: %d z max: %d \n", pa->minz, pa->maxz); - return 0; + return NULL; } +#endif /* Iterate over the 3d voxel grid, and fill the voxels with scattering information * @@ -357,28 +348,24 @@ static void *vol_precache_part_test(void *data) */ static void *vol_precache_part(void *data) { - VolPrecachePart *vpt = (VolPrecachePart *)data; - ObjectInstanceRen *obi = vpt->obi; - RayTree *tree = vpt->tree; - ShadeInput *shi = vpt->shi; - float scatter_col[3] = {0.f, 0.f, 0.f}; + VolPrecachePart *pa = (VolPrecachePart *)data; + ObjectInstanceRen *obi = pa->obi; + RayTree *tree = pa->tree; + ShadeInput *shi = pa->shi; + float density, scatter_col[3] = {0.f, 0.f, 0.f}; float co[3]; int x, y, z; - const int res=vpt->res, res_2=vpt->res*vpt->res, res_3=vpt->res*vpt->res*vpt->res; + const int res=pa->res, res_2=pa->res*pa->res, res_3=pa->res*pa->res*pa->res; const float stepsize = vol_get_stepsize(shi, STEPSIZE_VIEW); - - res = vpt->res; - res_2 = res*res; - res_3 = res*res*res; - - for (x= vpt->minx; x < vpt->maxx; x++) { - co[0] = vpt->bbmin[0] + (vpt->voxel[0] * x); + + for (x= pa->minx; x < pa->maxx; x++) { + co[0] = pa->bbmin[0] + (pa->voxel[0] * x); - for (y= vpt->miny; y < vpt->maxy; y++) { - co[1] = vpt->bbmin[1] + (vpt->voxel[1] * y); + for (y= pa->miny; y < pa->maxy; y++) { + co[1] = pa->bbmin[1] + (pa->voxel[1] * y); - for (z=vpt->minz; z < vpt->maxz; z++) { - co[2] = vpt->bbmin[2] + (vpt->voxel[2] * z); + for (z=pa->minz; z < pa->maxz; z++) { + co[2] = pa->bbmin[2] + (pa->voxel[2] * z); // don't bother if the point is not inside the volume mesh if (!point_inside_obi(tree, obi, co)) { @@ -397,14 +384,17 @@ static void *vol_precache_part(void *data) } } + pa->done = 1; + return 0; } + static void precache_setup_shadeinput(Render *re, ObjectInstanceRen *obi, Material *ma, ShadeInput *shi) { float view[3] = {0.0,0.0,-1.0}; - memset(&shi, 0, sizeof(ShadeInput)); + memset(shi, 0, sizeof(ShadeInput)); shi->depth= 1; shi->mask= 1; shi->mat = ma; @@ -417,61 +407,102 @@ static void precache_setup_shadeinput(Render *re, ObjectInstanceRen *obi, Materi VECCOPY(shi->view, view); } -static void precache_init_parts(ListBase *precache_parts, RayTree *tree, ShadeInput *shi, ObjectInstanceRen *obi, float *bbmin, float *bbmax, int res) +static void precache_init_parts(Render *re, RayTree *tree, ShadeInput *shi, ObjectInstanceRen *obi, float *bbmin, float *bbmax, int res, int totthread, int *parts) { - int i; + int i=0, x, y, z; float voxel[3]; - + int sizex, sizey, sizez; + int minx, maxx; + int miny, maxy; + int minz, maxz; + + BLI_freelistN(&re->volume_precache_parts); + + /* currently we just subdivide the box, number of threads per side */ + parts[0] = parts[1] = parts[2] = totthread; + VecSubf(voxel, bbmax, bbmin); if ((voxel[0] < FLT_EPSILON) || (voxel[1] < FLT_EPSILON) || (voxel[2] < FLT_EPSILON)) return; VecMulf(voxel, 1.0f/res); - for(i=0; i < totparts; i++) { - VolPrecachePart *pa= MEM_callocN(sizeof(VolPrecachePart), "new precache part"); - - pa->done = 0; - pa->num = i; + for (x=0; x < parts[0]; x++) { + sizex = ceil(res / (float)parts[0]); + minx = x * sizex; + maxx = minx + sizex; + maxx = (maxx>res)?res:maxx; - pa->res = res; - VECCOPY(pa->bbmin, bbmin); - VECCOPY(precache_parts[j].voxel, voxel); - precache_parts[j].tree = tree; - precache_parts[j].shi = shi; - precache_parts[j].obi = obi; - - BLI_addtail(precache_parts, pa); + for (y=0; y < parts[1]; y++) { + sizey = ceil(res / (float)parts[1]); + miny = y * sizey; + maxy = miny + sizey; + maxy = (maxy>res)?res:maxy; + + for (z=0; z < parts[2]; z++) { + VolPrecachePart *pa= MEM_callocN(sizeof(VolPrecachePart), "new precache part"); + + sizez = ceil(res / (float)parts[2]); + minz = z * sizez; + maxz = minz + sizez; + maxz = (maxz>res)?res:maxz; + + pa->done = 0; + pa->working = 0; + + pa->num = i; + pa->tree = tree; + pa->shi = shi; + pa->obi = obi; + VECCOPY(pa->bbmin, bbmin); + VECCOPY(pa->voxel, voxel); + pa->res = res; + + pa->minx = minx; pa->maxx = maxx; + pa->miny = miny; pa->maxy = maxy; + pa->minz = minz; pa->maxz = maxz; + + + BLI_addtail(&re->volume_precache_parts, pa); + + i++; + } + } } - } +static VolPrecachePart *precache_get_new_part(Render *re) +{ + VolPrecachePart *pa, *nextpa=NULL; + + for (pa = re->volume_precache_parts.first; pa; pa=pa->next) + { + if (pa->done==0 && pa->working==0) { + nextpa = pa; + break; + } + } + + return nextpa; +} + +/* Precache a volume into a 3D voxel grid. + * The voxel grid is stored in the ObjectInstanceRen, + * in camera space, aligned with the ObjectRen's bounding box. + * Resolution is defined by the user. + */ void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *obi, Material *ma, float *bbmin, float *bbmax) { - int x, y, z; - - float co[3], voxel[3], scatter_col[3]; - ShadeInput shi; - - float density; - float stepsize; - - float resf, res_3f; - int res_2, res_3; - - int edgeparts=2; - ListBase threads, precache_parts; - int cont= 1; - int xparts, yparts, zparts; - float part[3]; - int totthread = re->r.threads; - int totparts = edgeparts*edgeparts*edgeparts; - VolPrecachePart *nextpa; - int j; - - float i = 1.0f; - double time, lasttime= PIL_check_seconds_timer(); - const int res = ma->vol_precache_resolution; + VolPrecachePart *nextpa, *pa; RayTree *tree; + ShadeInput shi; + ListBase threads; + const int res = ma->vol_precache_resolution; + int parts[3], totparts; + + int caching=1, counter=0; + int totthread = re->r.threads; + + double time, lasttime= PIL_check_seconds_timer(); R = *re; @@ -480,119 +511,62 @@ void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *obi, Mat tree = create_raytree_obi(obi, bbmin, bbmax); if (!tree) return; - obi->volume_precache = MEM_callocN(sizeof(float)*res_3*3, "volume light cache"); + obi->volume_precache = MEM_callocN(sizeof(float)*res*res*res*3, "volume light cache"); /* Need a shadeinput to calculate scattering */ precache_setup_shadeinput(re, obi, ma, &shi); - precache_init_parts(&precache_parts, tree, shi, obi, bbmin, bbmax, res); - + + precache_init_parts(re, tree, &shi, obi, bbmin, bbmax, res, totthread, parts); + totparts = parts[0] * parts[1] * parts[2]; + BLI_init_threads(&threads, vol_precache_part, totthread); - nextpa = precache_get_new_part(precache_threads); - - while(cont) { + while(caching) { if(BLI_available_threads(&threads) && !(re->test_break())) { - - precache_get_new_part( - // get new job (data pointer) - for(j=0; j < totparts; j++) { - if (!precache_threads[j].done) { - // tag job 'processed - precache_threads[j].done = 1; - } + nextpa = precache_get_new_part(re); + if (nextpa) { + nextpa->working = 1; + BLI_insert_thread(&threads, nextpa); } - - BLI_insert_thread(&threads, precache_get_new_part(precache_threads)); } else PIL_sleep_ms(50); - // find if a job is ready, this the do_something_func() should write in job somewhere - cont= 0; - for(go over all jobs) - if(job is ready) { - if(job was not removed) { - BLI_remove_thread(&lb, job); - } - } - else cont= 1; + caching=0; + counter=0; + for(pa= re->volume_precache_parts.first; pa; pa= pa->next) { + + if(pa->done) { + counter++; + BLI_remove_thread(&threads, pa); + } else + caching = 1; } - // conditions to exit loop - if(if escape loop event) { - if(BLI_available_threadslots(&lb)==maxthreads) - break; - } - } - - BLI_end_threads(&threads); - - // - - /* Iterate over the 3d voxel grid, and fill the voxels with scattering information - * - * It's stored in memory as 3 big float grids next to each other, one for each RGB channel. - * I'm guessing the memory alignment may work out better this way for the purposes - * of doing linear interpolation, but I haven't actually tested this theory! :) - */ - /* - for (x=0; x < res; x++) { - co[0] = bbmin[0] + (voxel[0] * x); - for (y=0; y < res; y++) { - co[1] = bbmin[1] + (voxel[1] * y); - - for (z=0; z < res; z++) { - co[2] = bbmin[2] + (voxel[2] * z); - - time= PIL_check_seconds_timer(); - i++; - - // display progress every second - if(re->test_break()) { - if(tree) { - RE_ray_tree_free(tree); - tree= NULL; - } - return; - } - if(time-lasttime>1.0f) { - char str[64]; - sprintf(str, "Precaching volume: %d%%", (int)(100.0f * (i / res_3f))); - re->i.infostr= str; - re->stats_draw(&re->i); - re->i.infostr= NULL; - lasttime= time; - } - - // don't bother if the point is not inside the volume mesh - - if (!point_inside_obi(tree, obi, co)) { - obi->volume_precache[0*res_3 + x*res_2 + y*res + z] = -1.0f; - obi->volume_precache[1*res_3 + x*res_2 + y*res + z] = -1.0f; - obi->volume_precache[2*res_3 + x*res_2 + y*res + z] = -1.0f; - continue; - } - density = vol_get_density(&shi, co); - vol_get_scattering(&shi, scatter_col, co, stepsize, density); - - obi->volume_precache[0*res_3 + x*res_2 + y*res + z] = scatter_col[0]; - obi->volume_precache[1*res_3 + x*res_2 + y*res + z] = scatter_col[1]; - obi->volume_precache[2*res_3 + x*res_2 + y*res + z] = scatter_col[2]; - - } + if (re->test_break() && BLI_available_threads(&threads)==totthread) + caching=0; + + time= PIL_check_seconds_timer(); + if(time-lasttime>1.0f) { + char str[64]; + sprintf(str, "Precaching volume: %d%%", (int)(100.0f * ((float)counter / (float)totparts))); + re->i.infostr= str; + re->stats_draw(&re->i); + re->i.infostr= NULL; + lasttime= time; } } - */ - + + BLI_end_threads(&threads); + BLI_freelistN(&re->volume_precache_parts); + if(tree) { RE_ray_tree_free(tree); tree= NULL; } lightcache_filter(obi->volume_precache, res); - } -#endif /* loop through all objects (and their associated materials) * marked for pre-caching in convertblender.c, and pre-cache them */ @@ -605,7 +579,8 @@ void volume_precache(Render *re) if (vo->ma->vol_shadeflag & MA_VOL_PRECACHESHADING) { for(obi= re->instancetable.first; obi; obi= obi->next) { if (obi->obr == vo->obr) { - vol_precache_objectinstance(re, obi, vo->ma, obi->obr->boundbox[0], obi->obr->boundbox[1]); + if (G.rt==10) vol_precache_objectinstance(re, obi, vo->ma, obi->obr->boundbox[0], obi->obr->boundbox[1]); + else vol_precache_objectinstance_threads(re, obi, vo->ma, obi->obr->boundbox[0], obi->obr->boundbox[1]); } } } @@ -624,7 +599,7 @@ void free_volume_precache(Render *re) MEM_freeN(obi->volume_precache); } - BLI_freelistN(&re->vol_precache_obs); + BLI_freelistN(&re->volumes); } int point_inside_volume_objectinstance(ObjectInstanceRen *obi, float *co) From 834fda50d99210a5a69360bbed84f76934792171 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 31 Dec 2008 05:08:04 +0000 Subject: [PATCH 074/577] Volume rendering * Fixed an old problem where if both the camera and a solid surface were inside a volume, the volume wouldn't attenuate in front of the surface (was visible in the blender conference art festival clouds animation: http://mke3.net/blender/devel/rendering/volumetrics/vol_shade_cam_inside.mov * Initial support for refracting solids inside volumes. I might be able to make this work better, but not sure at the moment. It's a bit dodgy, limited by the code that does the recursive ray shading - it's really not set up for this kind of thing and could use a refactor very much. --- .../render/intern/include/volumetric.h | 10 ++- .../blender/render/intern/source/rayshade.c | 20 ++++-- .../blender/render/intern/source/shadeinput.c | 23 +++---- .../blender/render/intern/source/volumetric.c | 61 ++++++++++++++++--- 4 files changed, 87 insertions(+), 27 deletions(-) diff --git a/source/blender/render/intern/include/volumetric.h b/source/blender/render/intern/include/volumetric.h index a69238f54b3..40d79e8d173 100644 --- a/source/blender/render/intern/include/volumetric.h +++ b/source/blender/render/intern/include/volumetric.h @@ -30,8 +30,9 @@ float vol_get_stepsize(struct ShadeInput *shi, int context); float vol_get_density(struct ShadeInput *shi, float *co); void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsize, float density); -void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr); -void volume_trace_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct Isect *last_is); +void shade_volume_outside(ShadeInput *shi, ShadeResult *shr); +void shade_volume_inside(ShadeInput *shi, ShadeResult *shr); +void shade_volume_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct Isect *last_is); #define STEPSIZE_VIEW 0 #define STEPSIZE_SHADE 1 @@ -40,4 +41,7 @@ void volume_trace_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct #define VOL_IS_SAMEMATERIAL 2 #define VOL_BOUNDS_DEPTH 0 -#define VOL_BOUNDS_SS 1 \ No newline at end of file +#define VOL_BOUNDS_SS 1 + +#define VOL_SHADE_OUTSIDE 0 +#define VOL_SHADE_INSIDE 1 \ No newline at end of file diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index 8bbdb243c8a..d09bd5c707a 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -276,9 +276,9 @@ void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr) if (shi->mat->material_type == MA_VOLUME) { if(ELEM(is->mode, RE_RAY_SHADOW, RE_RAY_SHADOW_TRA)) { - volume_trace_shadow(shi, shr, is); + shade_volume_shadow(shi, shr, is); } else { - shade_volume_loop(shi, shr); + shade_volume_outside(shi, shr); } } else if(is->mode==RE_RAY_SHADOW_TRA) @@ -295,7 +295,18 @@ void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr) shi->mat= vlr->mat; /* shi->mat is being set in nodetree */ } else { - shade_material_loop(shi, shr); + int tempdepth; + /* XXX dodgy business here, set ray depth to -1 + * to ignore raytrace in shade_material_loop() + * this could really use a refactor --Matt */ + if (shi->volume_depth == 0) { + tempdepth = shi->depth; + shi->depth = -1; + shade_material_loop(shi, shr); + shi->depth = tempdepth; + } else { + shade_material_loop(shi, shr); + } } /* raytrace likes to separate the spec color */ VECSUB(shr->diff, shr->combined, shr->spec); @@ -467,7 +478,7 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, flo shi.mask= origshi->mask; shi.osatex= origshi->osatex; - shi.depth= 1; /* only used to indicate tracing */ + shi.depth = origshi->depth + 1; /* only used to indicate tracing */ shi.thread= origshi->thread; //shi.sample= 0; // memset above, so dont need this shi.xs= origshi->xs; @@ -482,6 +493,7 @@ static void traceray(ShadeInput *origshi, ShadeResult *origshr, short depth, flo memset(&shr, 0, sizeof(ShadeResult)); shade_ray(&isec, &shi, &shr); + if (traflag & RAY_TRA) d= shade_by_transmission(&isec, &shi, &shr); diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index aa11e3d75dd..5bf2f58ae4e 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -121,7 +121,7 @@ void shade_material_loop(ShadeInput *shi, ShadeResult *shr) } /* depth >= 1 when ray-shading */ - if(shi->depth==0) { + if(shi->depth >= 0 && (shi->depth < MAX2(shi->mat->ray_depth_tra, shi->mat->ray_depth))) { if(R.r.mode & R_RAYTRACE) { if(shi->ray_mirror!=0.0f || ((shi->mat->mode & MA_RAYTRANSP) && shr->alpha!=1.0f)) { /* ray trace works on combined, but gives pass info */ @@ -132,16 +132,13 @@ void shade_material_loop(ShadeInput *shi, ShadeResult *shr) if(shi->mat->mode & MA_RAYTRANSP) if((shi->layflag & SCE_LAY_SKY) && (R.r.alphamode==R_ADDSKY)) shr->alpha= 1.0f; - } + } + + if(R.r.mode & R_RAYTRACE) { + shade_volume_inside(shi, shr); + } } -/* delivers a fully filled in ShadeResult, for all passes */ -void shade_volume_loop(ShadeInput *shi, ShadeResult *shr) -{ - if(R.r.mode & R_RAYTRACE) volume_trace(shi, shr); -} - - /* do a shade, finish up some passes, apply mist */ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr) { @@ -157,8 +154,12 @@ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr) memcpy(&shi->r, &shi->mat->r, 23*sizeof(float)); shi->har= shi->mat->har; - if (shi->mat->material_type == MA_SOLID) shade_material_loop(shi, shr); - else if (shi->mat->material_type == MA_VOLUME) shade_volume_loop(shi, shr); + if (shi->mat->material_type == MA_SOLID) { + shade_material_loop(shi, shr); + } else if (shi->mat->material_type == MA_VOLUME) { + if(R.r.mode & R_RAYTRACE) + shade_volume_outside(shi, shr); + } } /* copy additional passes */ diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 3206989d1d7..10a3f83758c 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -548,7 +548,7 @@ static void shade_intersection(ShadeInput *shi, float *col, Isect *is) shi_new.mask= shi->mask; shi_new.osatex= shi->osatex; shi_new.thread= shi->thread; - shi_new.depth= 1; + shi_new.depth = shi->depth + 1; shi_new.volume_depth= shi->volume_depth + 1; shi_new.xs= shi->xs; shi_new.ys= shi->ys; @@ -601,18 +601,31 @@ static void vol_trace_behind(ShadeInput *shi, VlakRen *vlr, float *co, float *co } /* the main entry point for volume shading */ -void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr) +static void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr, int inside_volume) { float hitco[3], col[4] = {0.f,0.f,0.f,0.f}; + int trace_behind = 1; Isect is; - memset(shr, 0, sizeof(ShadeResult)); + /* check for shading an internal face a volume object directly */ + if (inside_volume == VOL_SHADE_INSIDE) { + trace_behind = 0; + } + if (inside_volume == VOL_SHADE_OUTSIDE) { + if (shi->flippednor) + inside_volume = VOL_SHADE_INSIDE; + } - /* if 1st hit normal is facing away from the camera, - * then we're inside the volume already. */ - if (shi->flippednor) { - /* trace behind the 1st hit point */ - vol_trace_behind(shi, shi->vlr, shi->co, col); + if (inside_volume == VOL_SHADE_INSIDE) { + + if (trace_behind) { + /* trace behind the volume object */ + vol_trace_behind(shi, shi->vlr, shi->co, col); + } else { + /* we're tracing through the volume between the camera + * and a solid surface, so use that pre-shaded radiance */ + QUATCOPY(col, shr->combined); + } /* shade volume from 'camera' to 1st hit point */ volumeintegrate(shi, col, shi->camera_co, shi->co); @@ -673,7 +686,7 @@ void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr) /* Traces a shadow through the object, * pretty much gets the transmission over a ray path */ -void volume_trace_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct Isect *last_is) +void shade_volume_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct Isect *last_is) { float hitco[3]; float tr[3] = {1.0,1.0,1.0}; @@ -724,3 +737,33 @@ void volume_trace_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct } } + +/* delivers a fully filled in ShadeResult, for all passes */ +void shade_volume_outside(ShadeInput *shi, ShadeResult *shr) +{ + memset(shr, 0, sizeof(ShadeResult)); + + volume_trace(shi, shr, VOL_SHADE_OUTSIDE); +} + + +void shade_volume_inside(ShadeInput *shi, ShadeResult *shr) +{ + MatInside *m; + Material *mat_backup; + + if (BLI_countlist(&R.render_volumes_inside) == 0) return; + + mat_backup = shi->mat; + +// for (m=R.render_volumes_inside.first; m; m=m->next) { +// printf("matinside: ma: %s \n", m->ma->id.name+2); +// } + + m = R.render_volumes_inside.first; + shi->mat = m->ma; + + volume_trace(shi, shr, VOL_SHADE_INSIDE); + + shi->mat = mat_backup; +} \ No newline at end of file From 0572f1a5f61c96c44e81af5a49d9f1f01e9c9b69 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 8 Jan 2009 22:49:03 +0000 Subject: [PATCH 075/577] * fixed an incredibly silly typo-bug in light cache --- source/blender/render/intern/source/volume_precache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c index 18687962d79..75759b651ed 100644 --- a/source/blender/render/intern/source/volume_precache.c +++ b/source/blender/render/intern/source/volume_precache.c @@ -204,7 +204,7 @@ static void lightcache_filter(float *cache, int res) i = rgb*res_3 + x*res_2 + y*res + z; /* trigger for outside mesh */ - if (cache[i] < 0.5f) cache[i] = get_avg_surrounds(cache, res, res_2, res_3, rgb, x, y, z); + if (cache[i] < -0.5f) cache[i] = get_avg_surrounds(cache, res, res_2, res_3, rgb, x, y, z); } } } From 6cfbb0017a525262f55767bf3b560ba3ae2e8d42 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 13 Jan 2009 02:39:46 +0000 Subject: [PATCH 076/577] * Little feature, blend texture can have extrapolation modes (like repeat). This should probably go in trunk, but I'll stay away for now with all the 2.5 work on. --- source/blender/blenkernel/BKE_blender.h | 2 +- source/blender/blenloader/intern/readfile.c | 11 ++++++++++- source/blender/render/intern/source/texture.c | 17 +++++++++++++++++ source/blender/src/buttons_shading.c | 6 ++++++ 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index f392d57521c..db6d4762b17 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -41,7 +41,7 @@ struct ListBase; struct MemFile; #define BLENDER_VERSION 248 -#define BLENDER_SUBVERSION 1 +#define BLENDER_SUBVERSION 3 #define BLENDER_MINVERSION 245 #define BLENDER_MINSUBVERSION 15 diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 8347920319a..35e4c8b915c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7975,7 +7975,6 @@ static void do_versions(FileData *fd, Library *lib, Main *main) tex->vd->int_multiplier = 1.0; } } - } /* set the curve radius interpolation to 2.47 default - easy */ @@ -8074,6 +8073,16 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } + if (main->versionfile < 248 || (main->versionfile == 248 && main->subversionfile < 3)) { + Tex *tex; + + /* blend texture extrapolation */ + for(tex=main->tex.first; tex; tex= tex->id.next) { + if (tex->type == TEX_BLEND) + tex->extend = TEX_EXTEND; + } + } + /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */ diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index d7b41d7cc2c..e5e8a285f28 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -197,6 +197,23 @@ static int blend(Tex *tex, float *texvec, TexResult *texres) y= texvec[1]; } + if (tex->extend == TEX_REPEAT) { + if (x < -1.0 || x > 1.0) { + const float x2 = (x + 1.0)* 0.5; /* to 0.0, 1.0 */ + x = (x2 - floor(x2) - 0.5) * 2.0; /* to -1.0, 1.0 */ + } + if (y < -1.0 || y > 1.0) { + const float y2 = (y + 1.0)* 0.5; /* to 0.0, 1.0 */ + y = (y2 - floor(y2) - 0.5) * 2.0; /* to -1.0, 1.0 */ + } + } else if (tex->extend == TEX_CLIP) { + if (x < -1.0 || x > 1.0 || y < -1.0 || y > 1.0) { + texres->tin = 0.f; + BRICONT; + return TEX_INT; + } + } + if(tex->stype==TEX_LIN) { /* lin */ texres->tin= (1.0+x)/2.0; } diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 6e69414fbe0..4f6a25058c3 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -644,7 +644,13 @@ static void texture_panel_blend(Tex *tex) uiDefButS(block, ROW, B_TEXPRV, "Sphere", 85, 160, 75, 19, &tex->stype, 2.0, (float)TEX_SPHERE, 0, 0, "Use progression with the shape of a sphere"); uiDefButS(block, ROW, B_TEXPRV, "Halo", 160, 160, 75, 19, &tex->stype, 2.0, (float)TEX_HALO, 0, 0, "Use a quadratic progression with the shape of a sphere"); uiDefButS(block, ROW, B_TEXPRV, "Radial", 235, 160, 75, 19, &tex->stype, 2.0, (float)TEX_RAD, 0, 0, "Use a polar progression"); + uiBlockEndAlign(block); + uiBlockBeginAlign(block); + uiDefButS(block, ROW, B_TEXREDR_PRV, "Extend", 10,120,63,19, &tex->extend, 4.0, 1.0, 0, 0, "Extends the color of the edge pixels"); + uiDefButS(block, ROW, B_TEXREDR_PRV, "Clip", 73,120,48,19, &tex->extend, 4.0, 2.0, 0, 0, "Sets alpha 0.0 outside Image edges"); + uiDefButS(block, ROW, B_TEXREDR_PRV, "Repeat", 121,120,63,19, &tex->extend, 4.0, 3.0, 0, 0, "Causes Image to repeat horizontally and vertically"); + uiBlockEndAlign(block); } /* newnoise: noisebasis menu string */ From 1ed26fffb88ffcf70aa62c65964cc98348712b9d Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 26 Jan 2009 02:42:17 +0000 Subject: [PATCH 077/577] Volume rendering: multiple scattering This is mostly a contribution from Raul 'farsthary' Hernandez - an approximation for multiple scattering within volumes. Thanks, Raul! Where single scattering considers the path from the light to a point in the volume, and to the eye, multiple scattering approximates the interactions of light as it bounces around randomly within the volume, before eventually reaching the eye. It works as a diffusion process that effectively blurs the lighting information that's already stored within the light cache. A cloudy sky setup, with single scattering, and multiple scattering: http://mke3.net/blender/devel/rendering/volumetrics/vol_sky_ss_ms.jpg http://mke3.net/blender/devel/rendering/volumetrics/sky_ms.blend To enable it, there is a menu in the volume panel (which needs a bit of cleanup, for later), that lets you choose between self-shading methods: * None: No attenuation of the light source by the volume - light passes straight through at full strength * Single Scattering: (same as previously, with 'self-shading' enabled) * Multiple Scattering: Uses multiple scattering only for shading information * Single + Multiple: Adds the multiple scattering lighting on top of the existing single scattered light - this can be useful to tweak the strength of the effect, while still retaining details in the lighting. An example of how the different scattering methods affect the visual result: http://mke3.net/blender/devel/rendering/volumetrics/ss_ms_comparison.jpg http://mke3.net/blender/devel/rendering/volumetrics/ss_ms_comparison.blend The multiple scattering methods introduce 3 new controls when enabled: * Blur: A factor blending between fully diffuse/blurred lighting, and sharper * Spread: The range that the diffuse blurred lighting spreads over - similar to a blur width. The higher the spread, the slower the processing time. * Intensity: A multiplier for the multiple scattering light brightness Here's the effect of multiple scattering on a tight beam (similar to a laser). The effect of the 'spread' value is pretty clear here: http://mke3.net/blender/devel/rendering/volumetrics/ms_spread_laser.jpg Unlike the rest of the system so far, this part of the volume rendering engine isn't physically based, and currently it's not unusual to get non-physical results (i.e. much more light being scattered out then goes in via lamps or emit). To counter this, you can use the intensity slider to tweak the brightness - on the todo, perhaps there is a more automatic method we can work on for this later on. I'd also like to check on speeding this up further with threading too. --- source/blender/blenloader/intern/readfile.c | 14 +- source/blender/makesdna/DNA_material_types.h | 14 +- .../render/intern/include/volume_precache.h | 4 +- .../render/intern/source/volume_precache.c | 229 ++++++++++-------- .../blender/render/intern/source/volumetric.c | 10 +- source/blender/src/buttons_shading.c | 62 ++++- 6 files changed, 212 insertions(+), 121 deletions(-) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 35e4c8b915c..7993d2eec89 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -8072,17 +8072,27 @@ 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; + } + } } - + /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */ diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index 5172f6a970c..dafa816cb96 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -70,13 +70,18 @@ typedef struct Material { short vol_precache_resolution; float vol_stepsize, vol_shade_stepsize; float vol_depth_cutoff; - float vpad; + 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; @@ -358,11 +363,16 @@ typedef struct Material { /* vol_shadeflag */ #define MA_VOL_SHADED 1 -#define MA_VOL_ATTENUATED 2 #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 diff --git a/source/blender/render/intern/include/volume_precache.h b/source/blender/render/intern/include/volume_precache.h index 78409e4c646..9d87a219c82 100644 --- a/source/blender/render/intern/include/volume_precache.h +++ b/source/blender/render/intern/include/volume_precache.h @@ -28,4 +28,6 @@ void volume_precache(Render *re); void free_volume_precache(Render *re); -int point_inside_volume_objectinstance(ObjectInstanceRen *obi, float *co); \ No newline at end of file +int point_inside_volume_objectinstance(ObjectInstanceRen *obi, float *co); + +#define VOL_MS_TIMESTEP 0.1f \ No newline at end of file diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c index 75759b651ed..4cdffc5ad35 100644 --- a/source/blender/render/intern/source/volume_precache.c +++ b/source/blender/render/intern/source/volume_precache.c @@ -47,6 +47,7 @@ #include "render_types.h" #include "renderdatabase.h" #include "volumetric.h" +#include "volume_precache.h" #include "BKE_global.h" @@ -211,120 +212,141 @@ static void lightcache_filter(float *cache, int res) } } +static inline int I(int x,int y,int z,int n) //has a pad of 1 voxel surrounding the core for boundary simulation +{ + return (x*(n+2)+y)*(n+2)+z; +} -void vol_precache_objectinstance(Render *re, ObjectInstanceRen *obi, Material *ma, float *bbmin, float *bbmax) +static void ms_diffuse(int b, float* x0, float* x, float diff, int n) { - int x, y, z; + int i, j, k, l; + const float dt = VOL_MS_TIMESTEP; + const float a = dt*diff*n*n*n; + + for (l=0; l<20; l++) + { + for (k=1; k<=n; k++) + { + for (j=1; j<=n; j++) + { + for (i=1; i<=n; i++) + { + x[I(i,j,k,n)] = (x0[I(i,j,k,n)] + a*( + x[I(i-1,j,k,n)]+x[I(i+1,j,k,n)]+ + x[I(i,j-1,k,n)]+x[I(i,j+1,k,n)]+ + x[I(i,j,k-1,n)]+x[I(i,j,k+1,n)]))/(1+6*a); + } + } + } + } +} - float co[3], voxel[3], scatter_col[3]; - ShadeInput shi; - float view[3] = {0.0,0.0,-1.0}; - float density; - float stepsize; - - float resf, res_3f; - int res_2, res_3; - - float i = 1.0f; +void multiple_scattering_diffusion(Render *re, float *cache, int res, Material *ma) +{ + const float diff = ma->vol_ms_diff * 0.001f; /* compensate for scaling for a nicer UI range */ + const float fac = ma->vol_ms_intensity; + const float simframes = ma->vol_ms_steps; + const int shade_type = ma->vol_shade_type; + const float dt = VOL_MS_TIMESTEP; + + int i, j, k, m; + int n = res; + const int size = (n+2)*(n+2)*(n+2); double time, lasttime= PIL_check_seconds_timer(); - const int res = ma->vol_precache_resolution; - RayTree *tree; + float total; + float c=1.0f; + int index; + float origf; /* factor for blending in original light cache */ - R = *re; + + float *sr0=(float *)MEM_callocN(size*sizeof(float), "temporary multiple scattering buffer"); + float *sr=(float *)MEM_callocN(size*sizeof(float), "temporary multiple scattering buffer"); + float *sg0=(float *)MEM_callocN(size*sizeof(float), "temporary multiple scattering buffer"); + float *sg=(float *)MEM_callocN(size*sizeof(float), "temporary multiple scattering buffer"); + float *sb0=(float *)MEM_callocN(size*sizeof(float), "temporary multiple scattering buffer"); + float *sb=(float *)MEM_callocN(size*sizeof(float), "temporary multiple scattering buffer"); - /* create a raytree with just the faces of the instanced ObjectRen, - * used for checking if the cached point is inside or outside. */ - tree = create_raytree_obi(obi, bbmin, bbmax); - if (!tree) return; + total = (float)(n*n*n*simframes); + + /* Scattering as diffusion pass */ + for (m=0; m 0.0f) + sr[I(i,j,k,n)] += cache[index]; + if (cache[1*n*n*n + index] > 0.0f) + sg[I(i,j,k,n)] += cache[1*n*n*n + index]; + if (cache[2*n*n*n + index] > 0.0f) + sb[I(i,j,k,n)] += cache[2*n*n*n + index]; - /* Need a shadeinput to calculate scattering */ - memset(&shi, 0, sizeof(ShadeInput)); - shi.depth= 1; - shi.mask= 1; - shi.mat = ma; - shi.vlr = NULL; - memcpy(&shi.r, &shi.mat->r, 23*sizeof(float)); // note, keep this synced with render_types.h - shi.har= shi.mat->har; - shi.obi= obi; - shi.obr= obi->obr; - shi.lay = re->scene->lay; - VECCOPY(shi.view, view); - - stepsize = vol_get_stepsize(&shi, STEPSIZE_VIEW); - resf = (float)res; - res_2 = res*res; - res_3 = res*res*res; - res_3f = (float)res_3; - - VecSubf(voxel, bbmax, bbmin); - if ((voxel[0] < FLT_EPSILON) || (voxel[1] < FLT_EPSILON) || (voxel[2] < FLT_EPSILON)) - return; - VecMulf(voxel, 1.0f/res); - - obi->volume_precache = MEM_callocN(sizeof(float)*res_3*3, "volume light cache"); - - /* Iterate over the 3d voxel grid, and fill the voxels with scattering information - * - * It's stored in memory as 3 big float grids next to each other, one for each RGB channel. - * I'm guessing the memory alignment may work out better this way for the purposes - * of doing linear interpolation, but I haven't actually tested this theory! :) - */ - for (x=0; x < res; x++) { - co[0] = bbmin[0] + (voxel[0] * x); - - for (y=0; y < res; y++) { - co[1] = bbmin[1] + (voxel[1] * y); - - for (z=0; z < res; z++) { - co[2] = bbmin[2] + (voxel[2] * z); - - time= PIL_check_seconds_timer(); - i++; - - /* display progress every second */ - if(re->test_break()) { - if(tree) { - RE_ray_tree_free(tree); - tree= NULL; + /* Displays progress every second */ + if(time-lasttime>1.0f) { + char str[64]; + sprintf(str, "Simulating multiple scattering: %d%%", (int) + (100.0f * (c / total))); + re->i.infostr= str; + re->stats_draw(&re->i); + re->i.infostr= NULL; + lasttime= time; } - return; } - if(time-lasttime>1.0f) { - char str[64]; - sprintf(str, "Precaching volume: %d%%", (int)(100.0f * (i / res_3f))); - re->i.infostr= str; - re->stats_draw(&re->i); - re->i.infostr= NULL; - lasttime= time; - } - - /* don't bother if the point is not inside the volume mesh */ - if (!point_inside_obi(tree, obi, co)) { - obi->volume_precache[0*res_3 + x*res_2 + y*res + z] = -1.0f; - obi->volume_precache[1*res_3 + x*res_2 + y*res + z] = -1.0f; - obi->volume_precache[2*res_3 + x*res_2 + y*res + z] = -1.0f; - continue; - } - density = vol_get_density(&shi, co); - vol_get_scattering(&shi, scatter_col, co, stepsize, density); - - obi->volume_precache[0*res_3 + x*res_2 + y*res + z] = scatter_col[0]; - obi->volume_precache[1*res_3 + x*res_2 + y*res + z] = scatter_col[1]; - obi->volume_precache[2*res_3 + x*res_2 + y*res + z] = scatter_col[2]; + } + } + SWAP(float *, sr, sr0); + SWAP(float *, sg, sg0); + SWAP(float *, sb, sb0); + + /* main diffusion simulation */ + ms_diffuse(0, sr0, sr, diff, n); + ms_diffuse(0, sg0, sg, diff, n); + ms_diffuse(0, sb0, sb, diff, n); + + if (re->test_break()) break; + } + + /* copy to light cache */ + + if (shade_type == MA_VOL_SHADE_SINGLEPLUSMULTIPLE) + origf = 1.0f; + else + origf = 0.0f; + + for (k=1;k<=n;k++) + { + for (j=1;j<=n;j++) + { + for (i=1;i<=n;i++) + { + index=(i-1)*n*n + (j-1)*n + k-1; + cache[index] = origf * cache[index] + fac * sr[I(i,j,k,n)]; + cache[1*n*n*n + index] = origf * cache[1*n*n*n + index] + fac * sg[I(i,j,k,n)]; + cache[2*n*n*n + index] = origf * cache[2*n*n*n + index] + fac * sb[I(i,j,k,n)]; } } } - if(tree) { - RE_ray_tree_free(tree); - tree= NULL; - } - - lightcache_filter(obi->volume_precache, res); - + MEM_freeN(sr0); + MEM_freeN(sr); + MEM_freeN(sg0); + MEM_freeN(sg); + MEM_freeN(sb0); + MEM_freeN(sb); } + + #if 0 // debug stuff static void *vol_precache_part_test(void *data) { @@ -566,6 +588,11 @@ void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *obi, Mat } lightcache_filter(obi->volume_precache, res); + + if (ELEM(ma->vol_shade_type, MA_VOL_SHADE_MULTIPLE, MA_VOL_SHADE_SINGLEPLUSMULTIPLE)) + { + multiple_scattering_diffusion(re, obi->volume_precache, res, ma); + } } /* loop through all objects (and their associated materials) @@ -575,12 +602,14 @@ void volume_precache(Render *re) ObjectInstanceRen *obi; VolumeOb *vo; + /* ignore light cache and multiple scattering for preview render .. for now? */ + if (re->r.scemode & R_PREVIEWBUTS) return; + for(vo= re->volumes.first; vo; vo= vo->next) { if (vo->ma->vol_shadeflag & MA_VOL_PRECACHESHADING) { for(obi= re->instancetable.first; obi; obi= obi->next) { if (obi->obr == vo->obr) { - if (G.rt==10) vol_precache_objectinstance(re, obi, vo->ma, obi->obr->boundbox[0], obi->obr->boundbox[1]); - else vol_precache_objectinstance_threads(re, obi, vo->ma, obi->obr->boundbox[0], obi->obr->boundbox[1]); + vol_precache_objectinstance_threads(re, obi, vo->ma, obi->obr->boundbox[0], obi->obr->boundbox[1]); } } } diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 10a3f83758c..c8361844e11 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -379,7 +379,7 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * p = vol_get_phasefunc(shi, shi->mat->vol_phasefunc_type, shi->mat->vol_phasefunc_g, shi->view, lv); VecMulf(lacol, p); - if (shi->mat->vol_shadeflag & MA_VOL_ATTENUATED) { + if (shi->mat->vol_shade_type != MA_VOL_SHADE_NONE) { Isect is; /* find minimum of volume bounds, or lamp coord */ @@ -511,8 +511,12 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float /* incoming light via emission or scattering (additive) */ vol_get_emission(shi, emit_col, step_mid, density); - if ((shi->mat->vol_shadeflag & MA_VOL_PRECACHESHADING) && - (shi->mat->vol_shadeflag & MA_VOL_ATTENUATED)) { + + if (R.r.scemode & R_PREVIEWBUTS) { + vol_get_scattering(shi, scatter_col, step_mid, stepsize, density); + } else if (((shi->mat->vol_shadeflag & MA_VOL_PRECACHESHADING) && + (shi->mat->vol_shade_type == MA_VOL_SHADE_SINGLE)) || + (ELEM(shi->mat->vol_shade_type, MA_VOL_SHADE_MULTIPLE, MA_VOL_SHADE_SINGLEPLUSMULTIPLE))) { vol_get_precached_scattering(shi, scatter_col, step_mid); } else vol_get_scattering(shi, scatter_col, step_mid, stepsize, density); diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 4f6a25058c3..658b79f99fb 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -4534,23 +4534,59 @@ static void material_panel_material_volume(Material *ma) yco -= YSPACE; + uiDefBut(block, LABEL, B_NOP, "Self Shading:", + X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, MA_VOL_ATTENUATED, B_MATPRV, "Self Shading", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shadeflag), 0, 0, 0, 0, "Uses absorption for light attenuation"); - uiDefButF(block, NUM, B_MATPRV, "Step Size: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shade_stepsize), 0.001, 100.0, 10, 2, "Step"); - uiBlockEndAlign(block); + uiDefButS(block, MENU, B_TEXREDR_PRV, "Self Shading %t|None %x0|Single Scattering %x1|Multiple Scattering %x2|Single + Multiple %x3", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &ma->vol_shade_type, 0.0, 0.0, 0, 0, "Use absorbtion to attenuate light - Single scattering: direct lighting, Multiple scattering: internal light bouncing & diffusion"); + + if (ELEM3(ma->vol_shade_type, MA_VOL_SHADE_SINGLE, MA_VOL_SHADE_MULTIPLE, MA_VOL_SHADE_SINGLEPLUSMULTIPLE)) + { + uiDefButF(block, NUM, B_MATPRV, "Step Size: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shade_stepsize), 0.001, 100.0, 10, 2, "Step"); - yco -= YSPACE; - - if (ma->vol_shadeflag & MA_VOL_ATTENUATED) { - uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, MA_VOL_PRECACHESHADING, B_MATPRV, "Light Cache", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shadeflag), 0, 0, 0, 0, "Pre-cache the shading information into a voxel grid"); - uiDefButS(block, NUM, B_MATPRV, "Resolution: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_precache_resolution), 0.0, 1024.0, 10, 2, "Resolution of the voxel grid, low resolutions are faster, high resolutions use more memory (res ^3)"); uiBlockEndAlign(block); + + yco -= YSPACE; + + if (ma->vol_shade_type == MA_VOL_SHADE_SINGLE) + { + uiBlockBeginAlign(block); + uiDefButBitS(block, TOG, MA_VOL_PRECACHESHADING, B_MATPRV, "Light Cache", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_shadeflag), 0, 0, 0, 0, "Pre-cache the shading information into a voxel grid, speeds up shading at slightly less accuracy"); + uiDefButS(block, NUM, B_MATPRV, "Resolution: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_precache_resolution), 0.0, 1024.0, 10, 2, "Resolution of the voxel grid, low resolutions are faster, high resolutions use more memory (res ^3)"); + + } + else if (ELEM(ma->vol_shade_type, MA_VOL_SHADE_MULTIPLE, MA_VOL_SHADE_SINGLEPLUSMULTIPLE)) + { + uiDefBut(block, LABEL, B_NOP, "Light Cache:", + X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + uiDefButS(block, NUM, B_MATPRV, "Resolution: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_precache_resolution), 0.0, 1024.0, 10, 2, "Resolution of the voxel grid, low resolutions are faster, high resolutions use more memory (res ^3)"); + + } + + uiBlockEndAlign(block); + + yco -= YSPACE; + + if (ELEM(ma->vol_shade_type, MA_VOL_SHADE_MULTIPLE, MA_VOL_SHADE_SINGLEPLUSMULTIPLE)) { + uiDefBut(block, LABEL, B_NOP, "Multiple Scattering:", + X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + + uiBlockBeginAlign(block); + uiDefButF(block, NUM, B_MATPRV, "Blur: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_ms_diff), 0.01, 1.0, 10, 2, "Diffusion factor, the strength of the blurring effect"); + uiDefButI(block, NUM, B_MATPRV, "Spread: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_ms_steps), 1, 512.0, 10, 2, "Simulation steps, the effective distance over which the light is diffused"); + uiDefButF(block, NUM, B_MATPRV, "Intensity: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(ma->vol_ms_intensity), 0.00001, 1024.0, 10, 2, "Multiplier for multiple scattered light energy"); + uiBlockEndAlign(block); + } } + uiBlockEndAlign(block); yco -= YSPACE; From 8fa180a9b19649067edce3b973be4a27ea5b8daa Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 26 Feb 2009 00:13:40 +0000 Subject: [PATCH 078/577] * Fix for a small bug where multiple scattering wasn't being enabled properly. * Also a MSVC compile fix --- .../render/intern/include/volume_precache.h | 1 + .../blender/render/intern/source/volume_precache.c | 14 +++++++++++--- source/blender/render/intern/source/volumetric.c | 4 +--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/source/blender/render/intern/include/volume_precache.h b/source/blender/render/intern/include/volume_precache.h index 9d87a219c82..d8a94c2d560 100644 --- a/source/blender/render/intern/include/volume_precache.h +++ b/source/blender/render/intern/include/volume_precache.h @@ -29,5 +29,6 @@ void volume_precache(Render *re); void free_volume_precache(Render *re); int point_inside_volume_objectinstance(ObjectInstanceRen *obi, float *co); +int using_lightcache(Material *ma); #define VOL_MS_TIMESTEP 0.1f \ No newline at end of file diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c index 4cdffc5ad35..ba5fae0f284 100644 --- a/source/blender/render/intern/source/volume_precache.c +++ b/source/blender/render/intern/source/volume_precache.c @@ -49,6 +49,9 @@ #include "volumetric.h" #include "volume_precache.h" +#if defined( _MSC_VER ) && !defined( __cplusplus ) +# define inline __inline +#endif // defined( _MSC_VER ) && !defined( __cplusplus ) #include "BKE_global.h" @@ -247,8 +250,7 @@ void multiple_scattering_diffusion(Render *re, float *cache, int res, Material * const float fac = ma->vol_ms_intensity; const float simframes = ma->vol_ms_steps; const int shade_type = ma->vol_shade_type; - const float dt = VOL_MS_TIMESTEP; - + int i, j, k, m; int n = res; const int size = (n+2)*(n+2)*(n+2); @@ -595,6 +597,12 @@ void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *obi, Mat } } +int using_lightcache(Material *ma) +{ + return (((ma->vol_shadeflag & MA_VOL_PRECACHESHADING) && (ma->vol_shade_type == MA_VOL_SHADE_SINGLE)) + || (ELEM(ma->vol_shade_type, MA_VOL_SHADE_MULTIPLE, MA_VOL_SHADE_SINGLEPLUSMULTIPLE))); +} + /* loop through all objects (and their associated materials) * marked for pre-caching in convertblender.c, and pre-cache them */ void volume_precache(Render *re) @@ -606,7 +614,7 @@ void volume_precache(Render *re) if (re->r.scemode & R_PREVIEWBUTS) return; for(vo= re->volumes.first; vo; vo= vo->next) { - if (vo->ma->vol_shadeflag & MA_VOL_PRECACHESHADING) { + if (using_lightcache(vo->ma)) { for(obi= re->instancetable.first; obi; obi= obi->next) { if (obi->obr == vo->obr) { vol_precache_objectinstance_threads(re, obi, vo->ma, obi->obr->boundbox[0], obi->obr->boundbox[1]); diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index c8361844e11..01c4ac8fa74 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -514,9 +514,7 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float if (R.r.scemode & R_PREVIEWBUTS) { vol_get_scattering(shi, scatter_col, step_mid, stepsize, density); - } else if (((shi->mat->vol_shadeflag & MA_VOL_PRECACHESHADING) && - (shi->mat->vol_shade_type == MA_VOL_SHADE_SINGLE)) || - (ELEM(shi->mat->vol_shade_type, MA_VOL_SHADE_MULTIPLE, MA_VOL_SHADE_SINGLEPLUSMULTIPLE))) { + } else if (using_lightcache(shi->mat)) { vol_get_precached_scattering(shi, scatter_col, step_mid); } else vol_get_scattering(shi, scatter_col, step_mid, stepsize, density); From ce637a00469bf5caf620d4ed27a54e658469ee54 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 11 Mar 2009 05:32:11 +0000 Subject: [PATCH 079/577] * Patch by Raul F Hernandez This adds a header to the voxel data texture's data file format, to auto-fill the resolution settings upon loading a file. I don't have a data file of the right format to test with, so I'll trust it works and wait for confirmation! It also adds a 'still frame' setting, to pause the voxel data sequence on a specified frame, throughout the course of the rendered animation. --- source/blender/makesdna/DNA_texture_types.h | 1 + .../blender/render/intern/include/voxeldata.h | 8 +- .../blender/render/intern/source/voxeldata.c | 115 +++++++++--------- source/blender/src/buttons_shading.c | 28 ++++- 4 files changed, 91 insertions(+), 61 deletions(-) diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index e90df908c2b..420850ce396 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -169,6 +169,7 @@ typedef struct VoxelData { float int_multiplier; float vxpad; + int still, still_frame; char source_path[240]; float *dataset; diff --git a/source/blender/render/intern/include/voxeldata.h b/source/blender/render/intern/include/voxeldata.h index 504d5523db6..190a5a5a1c4 100644 --- a/source/blender/render/intern/include/voxeldata.h +++ b/source/blender/render/intern/include/voxeldata.h @@ -36,7 +36,13 @@ struct Render; struct TexResult; -int _I(int x,int y,int z,int n); +typedef struct VoxelDataHeader +{ +int resolX, resolY, resolZ; +int frames; +} VoxelDataHeader; + +inline int _I(int x, int y, int z, int *n); void make_voxeldata(struct Render *re); void free_voxeldata(struct Render *re); int voxeldatatex(struct Tex *tex, float *texvec, struct TexResult *texres); diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c index 2f0bbd44a7c..86cc54c0d44 100644 --- a/source/blender/render/intern/source/voxeldata.c +++ b/source/blender/render/intern/source/voxeldata.c @@ -42,25 +42,26 @@ #include "render_types.h" #include "renderdatabase.h" #include "texture.h" +#include "voxeldata.h" #if defined( _MSC_VER ) && !defined( __cplusplus ) # define inline __inline #endif // defined( _MSC_VER ) && !defined( __cplusplus ) /*---------------------------Utils----------------------------------------*/ -static inline int _I(int x,int y,int z,int n) +inline int _I(int x, int y, int z, int *n) { - return (z*(n)+y)*(n)+x; + return (z*(n[1])+y)*(n[2])+x; } -float Linear(float xx,float yy,float zz,float *x0,int n) +float Linear(float xx, float yy, float zz, float *x0, int *n) { float sx1,sx0,sy1,sy0,sz1,sz0,v0,v1; int i0,i1,j0,j1,k0,k1; - if (xx<0.5) xx=0.5f; if (xx>n+0.5) xx=n+0.5f; i0=(int)xx; i1=i0+1; - if (yy<0.5) yy=0.5f; if (yy>n+0.5) yy=n+0.5f; j0=(int)yy; j1=j0+1; - if (zz<0.5) zz=0.5f; if (zz>n+0.5) zz=n+0.5f; k0=(int)zz; k1=k0+1; + if (xx<0.5) xx=0.5f; if (xx>n[0]+0.5) xx=n[0]+0.5f; i0=(int)xx; i1=i0+1; + if (yy<0.5) yy=0.5f; if (yy>n[1]+0.5) yy=n[1]+0.5f; j0=(int)yy; j1=j0+1; + if (zz<0.5) zz=0.5f; if (zz>n[2]+0.5) zz=n[2]+0.5f; k0=(int)zz; k1=k0+1; sx1 = xx-i0; sx0 = 1-sx1; sy1 = yy-j0; sy0 = 1-sy1; @@ -68,15 +69,14 @@ float Linear(float xx,float yy,float zz,float *x0,int n) v0 = sx0*(sy0*x0[_I(i0,j0,k0,n)]+sy1*x0[_I(i0,j1,k0,n)])+sx1*(sy0*x0[_I(i1,j0,k0,n)]+sy1*x0[_I(i1,j1,k0,n)]); v1 = sx0*(sy0*x0[_I(i0,j0,k1,n)]+sy1*x0[_I(i0,j1,k1,n)])+sx1*(sy0*x0[_I(i1,j0,k1,n)]+sy1*x0[_I(i1,j1,k1,n)]); return sz0*v0 + sz1*v1; - } -static float D(float *data, const int res, int x, int y, int z) +static float D(float *data, int *res, int x, int y, int z) { - CLAMP(x, 0, res-1); - CLAMP(y, 0, res-1); - CLAMP(z, 0, res-1); + CLAMP(x, 0, res[0]-1); + CLAMP(y, 0, res[1]-1); + CLAMP(z, 0, res[2]-1); return data[ _I(x, y, z, res) ]; } @@ -85,19 +85,18 @@ static inline float lerp(float t, float v1, float v2) { } /* trilinear interpolation */ -static float trilinear(float *data, const int res, float *co) +static float 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; - float dim[3]; - - if (!data) return; + + if (!data) return 0.f; - voxx = co[0] * res - 0.5f; - voxy = co[1] * res - 0.5f; - voxz = co[2] * res - 0.5f; + 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; @@ -112,7 +111,6 @@ static float trilinear(float *data, const int res, float *co) d_final = lerp(dz, d0, d1); return d_final; - } @@ -242,17 +240,16 @@ float tricubic_eval(float a[64], float x, float y, float z) { } -float tricubic(float xx,float yy,float zz,float *heap,int n) +float tricubic(float xx, float yy, float zz, float *heap, int *n) { int xi,yi,zi; float dx,dy,dz; float a[64]; - - if (xx<0.5) xx=0.5f; if (xx>n+0.5) xx=n+0.5f; xi=(int)xx; - if (yy<0.5) yy=0.5f; if (yy>n+0.5) yy=n+0.5f; yi=(int)yy; - if (zz<0.5) zz=0.5f; if (zz>n+0.5) zz=n+0.5f; zi=(int)zz; + if (xx<0.5) xx=0.5f; if (xx>n[0]+0.5) xx=n[0]+0.5f; xi=(int)xx; + if (yy<0.5) yy=0.5f; if (yy>n[1]+0.5) yy=n[1]+0.5f; yi=(int)yy; + if (zz<0.5) zz=0.5f; if (zz>n[2]+0.5) zz=n[2]+0.5f; zi=(int)zz; { float fval[8]={heap[_I(xi,yi,zi,n)],heap[_I(xi+1,yi,zi,n)],heap[_I(xi,yi+1,zi,n)],heap[_I(xi+1,yi+1,zi,n)],heap[_I(xi,yi,zi+1,n)],heap[_I(xi+1,yi,zi+1,n)],heap[_I(xi,yi+1,zi+1,n)],heap[_I(xi+1,yi+1,zi+1,n)]}; @@ -325,21 +322,30 @@ float tricubic(float xx,float yy,float zz,float *heap,int n) } - - - - -/*--------------------------------------------------------------------*/ - -void load_frame (FILE *fp,float *F, int size,int frame) -{ - - fseek(fp,frame*size*sizeof(float),0); +void load_frame (FILE *fp, float *F, int size, int frame, int offset) +{ + fseek(fp,frame*size*sizeof(float)+offset,0); fread(F,sizeof(float),size,fp); } +void write_voxeldata_header(struct VoxelDataHeader *h, FILE *fp) +{ + fwrite(h,sizeof(struct VoxelDataHeader),1,fp); +} +void read_voxeldata_header(FILE *fp, struct VoxelData *vd) +{ + VoxelDataHeader *h=(VoxelDataHeader *)MEM_mallocN(sizeof(VoxelDataHeader), "voxel data header"); + + rewind(fp); + fread(h,sizeof(VoxelDataHeader),1,fp); + + vd->resolX=h->resolX; + vd->resolY=h->resolY; + vd->resolZ=h->resolZ; + MEM_freeN(h); +} void cache_voxeldata(struct Render *re,Tex *tex) { @@ -349,20 +355,19 @@ void cache_voxeldata(struct Render *re,Tex *tex) if (!vd) return; - vd->resolY=vd->resolX; //for now only support cubic datasets (rectangular datasets could be added latter) - vd->resolZ=vd->resolX; - size = (vd->resolX)*(vd->resolY)*(vd->resolZ); - - vd->dataset=MEM_mallocN(sizeof(float)*size, "voxel dataset"); + read_voxeldata_header(fp, vd); + size = (vd->resolX)*(vd->resolY)*(vd->resolZ); + vd->dataset = MEM_mallocN(sizeof(float)*size, "voxel dataset"); if (!BLI_exists(vd->source_path)) return; fp = fopen(vd->source_path,"rb"); if (!fp) return; - load_frame(fp, vd->dataset, size, re->r.cfra); //here improve the dataset loading function for more dataset types + //here improve the dataset loading function for more dataset types + if (vd->still) load_frame(fp, vd->dataset, size, vd->still_frame, sizeof(VoxelDataHeader)); + else load_frame(fp, vd->dataset, size, re->r.cfra, sizeof(VoxelDataHeader)); fclose(fp); - } void make_voxeldata(struct Render *re) @@ -421,24 +426,22 @@ int voxeldatatex(struct Tex *tex, float *texvec, struct TexResult *texres) int xi, yi, zi; float xf, yf, zf; int i=0, fail=0; - int resolX, resolY, resolZ; + int resol[3]; if ((!vd) || (vd->dataset==NULL)) { texres->tin = 0.0f; return 0; } - //here do the calculation of the interpolation types - - resolX=vd->resolX; - resolY=vd->resolY; - resolZ=vd->resolZ; + resol[0] = vd->resolX; + resol[1] = vd->resolY; + resol[2] = vd->resolZ; VECCOPY(co, texvec); - dx=1.0f/(resolX); - dy=1.0f/(resolY); - dz=1.0f/(resolZ); + dx=1.0f/(resol[0]); + dy=1.0f/(resol[1]); + dz=1.0f/(resol[2]); xi=co[0]/dx; yi=co[1]/dy; @@ -448,27 +451,27 @@ int voxeldatatex(struct Tex *tex, float *texvec, struct TexResult *texres) yf=co[1]/dy; zf=co[2]/dz; - if (xi>1 && xi1 && xi1 && yi1 && yi1 && zi1 && ziinterp_type) { case TEX_VD_NEARESTNEIGHBOR: { - texres->tin = vd->dataset[_I(xi,yi,zi,resolX)]; + texres->tin = vd->dataset[_I(xi,yi,zi,resol)]; break; } case TEX_VD_LINEAR: { - texres->tin = trilinear(vd->dataset, resolX, co); + texres->tin = trilinear(vd->dataset, resol, co); break; } case TEX_VD_TRICUBIC: { - texres->tin = tricubic(xf,yf,zf,vd->dataset,resolX); + texres->tin = tricubic(xf, yf, zf, vd->dataset, resol); break; } } diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 658b79f99fb..875184d6cc1 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -1060,7 +1060,7 @@ static void texture_panel_voxeldata(Tex *tex) short yco=PANEL_YMAX; block= uiNewBlock(&curarea->uiblocks, "texture_panel_voxeldata", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Voxel Data", "Texture", PANELX, PANELY, PANELW, PANELH)==0) return; + if(uiNewPanel(curarea, block, "Voxel Data", "Texture", PANELX, PANELY, PANELW, PANELH+YSPACE)==0) return; uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE); if(tex->vd==NULL) { @@ -1085,13 +1085,33 @@ static void texture_panel_voxeldata(Tex *tex) uiDefButI(block, MENU, B_REDR, "None %x0|Linear %x1|Tricubic %x2", X2CLM1, yco-=BUTH, BUTW2, BUTH, &vd->interp_type, 0.0, 0.0, 0, 0, "Interpolation type"); - uiDefButI(block, NUM, B_REDR, "Resolution: ", - X2CLM2, yco, BUTW2, BUTH, &(vd->resolX), 1, 10000, 0, 0, "Resolution of the voxel data"); - yco -= YSPACE; uiDefButF(block, NUM, B_REDR, "Intensity: ", X2CLM1, yco-=BUTH, BUTW2, BUTH, &(vd->int_multiplier), 0.0001, 10000.0, 0, 0, "Multiplier to scale up or down the texture's intensity"); + + yco = PANEL_YMAX - 2*BUTH - 2*YSPACE; + + uiDefBut(block, LABEL, B_NOP, "Resolution:", + X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + uiBlockBeginAlign(block); + uiDefButI(block, NUM, B_REDR, "X: ", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(vd->resolX), 1, 10000, 0, 0, "Resolution of the voxel data"); + uiDefButI(block, NUM, B_REDR, "Y: ", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(vd->resolY), 1, 10000, 0, 0, "Resolution of the voxel data"); + uiDefButI(block, NUM, B_REDR, "Z: ", + X2CLM2, yco-= BUTH, BUTW2, BUTH, &(vd->resolZ), 1, 10000, 0, 0, "Resolution of the voxel data"); + uiBlockEndAlign(block); + + yco -= YSPACE; + + uiBlockBeginAlign(block); + uiDefButI(block,TOG, B_REDR, "Still", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(vd->still), 0,1, 0, 0, "Use a still frame from the data sequence for the entire rendered animation"); + if (vd->still) uiDefButI(block, NUM, B_REDR, "Frame: ", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(vd->still_frame), 1, 10000, 0, 0, "The frame to pause on for the entire rendered animation"); + uiBlockEndAlign(block); + } } From 2b05a837295e32c2dd91a59984870803a3f0a52d Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 17 Mar 2009 05:33:05 +0000 Subject: [PATCH 080/577] Fixed a problem in how volumes were interpreting textures, and removed associated workarounds in point density texture. --- .../render/intern/source/pointdensity.c | 35 ++++++++++++------- source/blender/render/intern/source/texture.c | 2 +- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index 392af8411c5..2c8b6aaf0a5 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -373,7 +373,7 @@ static void init_pointdensityrangedata(PointDensity *pd, PointDensityRangeData * int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) { - int retval = TEX_INT+TEX_RGB; + int retval = TEX_INT; PointDensity *pd = tex->pd; PointDensityRangeData pdr; float density=0.0f, age=0.0f, time=0.0f; @@ -382,11 +382,11 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) float turb, noise_fac; int num=0; - if ((!pd) || (!pd->point_tree)) { - texres->tin = 0.0f; - return 0; - } + texres->tin = 0.0f; + if ((!pd) || (!pd->point_tree)) + return 0; + init_pointdensityrangedata(pd, &pdr, &density, vec, &age); noise_fac = pd->noise_fac * 0.5f; /* better default */ @@ -400,6 +400,9 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) age /= num; VecMulf(vec, 1.0f/num); } + + /* reset */ + density = vec[0] = vec[1] = vec[2] = 0.0f; } if (pd->flag & TEX_PD_TURBULENCE) { @@ -422,11 +425,9 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) co[0] = texvec[0] + noise_fac * turb; co[1] = texvec[1] + noise_fac * turb; co[2] = texvec[2] + noise_fac * turb; - - /* reset and prepare for a new BVH query with the perturbed coordinates */ - density = vec[0] = vec[1] = vec[2] = 0.0f; } + /* BVH query with the potentially perturbed coordinates */ num = BLI_bvhtree_range_query(pd->point_tree, co, pd->radius, accum_density, &pdr); if (num > 0) { age /= num; @@ -436,13 +437,19 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) texres->tin = density; BRICONT; + if (pd->color_source == TEX_PD_COLOR_CONSTANT) + return retval; + + retval |= TEX_RGB; + switch (pd->color_source) { case TEX_PD_COLOR_PARTAGE: if (pd->coba) { if (do_colorband(pd->coba, age, col)) { texres->talpha= 1; - QUATCOPY(&texres->tr, col); - texres->tin *= texres->ta; + VECCOPY(&texres->tr, col); + texres->tin *= col[3]; + texres->ta = texres->tin; } } break; @@ -453,16 +460,18 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres) if (pd->coba) { if (do_colorband(pd->coba, speed, col)) { texres->talpha= 1; - QUATCOPY(&texres->tr, col); - texres->tin *= texres->ta; + VECCOPY(&texres->tr, col); + texres->tin *= col[3]; + texres->ta = texres->tin; } } break; } case TEX_PD_COLOR_PARTVEL: + texres->talpha= 1; VecMulf(vec, pd->speed_scale); VECCOPY(&texres->tr, vec); - texres->ta = 1.0f; + texres->ta = texres->tin; break; case TEX_PD_COLOR_CONSTANT: default: diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index e5e8a285f28..d1115e1d399 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -1653,7 +1653,7 @@ void do_volume_tex(ShadeInput *shi, float *xyz, int mapto_flag, float *col, floa float varfac= mtex->varfac*stencilTin; /* convert RGB to intensity if intensity info isn't provided */ - if (rgbnor & TEX_INT) { + if (!(rgbnor & TEX_INT)) { if (rgbnor & TEX_RGB) { if(texres.talpha) texres.tin= texres.ta; else texres.tin= (0.35*texres.tr+0.45*texres.tg+0.2*texres.tb); From 41b2a2a530804db35c3a0fed2d881acf6f332c3d Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 18 Mar 2009 03:52:17 +0000 Subject: [PATCH 081/577] * Volume rendering / multiple scattering - normalisation This changes the effect of the multiple scattering approximation to be more physically plausible (and easier to use) by making it conserve energy. Previously, the multiple scattering could show wildly different results based on the spread settings, often outputting much more light than was put in (via lamps), which is physically incorrect and made it difficult to use by requiring a lot of tweaking of the intensity value. This fixes it to some extent with a simple normalization, where it scales the light energy after multiple scattering to be the same as what was previously there in the light cache via single scattering. This means that using the default intensity of 1.0 should give good results by default, although you can still use it to tweak the effect. Note: This will render differently if you've already set up a .blend using multiple scattering with the old code, so you'll need to tweak older files. Setting the intensity back to the default 1.0 should be good though. * Smaller thing - fixed the camera view vector stuff up a bit in light cache, it now gives much more similar results to non-light cache when using anisotropic scattering. --- .../render/intern/source/volume_precache.c | 80 ++++++++++++++++--- 1 file changed, 68 insertions(+), 12 deletions(-) diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c index ba5fae0f284..b3cffb45a27 100644 --- a/source/blender/render/intern/source/volume_precache.c +++ b/source/blender/render/intern/source/volume_precache.c @@ -220,6 +220,53 @@ static inline int I(int x,int y,int z,int n) //has a pad of 1 voxel surrounding return (x*(n+2)+y)*(n+2)+z; } + +/* get the total amount of light energy in the light cache. used to normalise after multiple scattering */ +static float total_ss_energy(float *cache, const int res) +{ + int x, y, z, rgb; + int res_2, res_3; + int i; + float energy=0.f; + + res_2 = res*res; + res_3 = res*res*res; + + for (x=0; x < res; x++) { + for (y=0; y < res; y++) { + for (z=0; z < res; z++) { + for (rgb=0; rgb < 3; rgb++) { + i = rgb*res_3 + x*res_2 + y*res + z; + + if (cache[i] > 0.f) energy += cache[i]; + } + } + } + } + + return energy; +} + +static float total_ms_energy(float *sr, float *sg, float *sb, const int res) +{ + int x, y, z, i; + float energy=0.f; + + for (z=1;z<=res;z++) { + for (y=1;y<=res;y++) { + for (x=1;x<=res;x++) { + + i = I(x,y,z,res); + if (sr[i] > 0.f) energy += sr[i]; + if (sg[i] > 0.f) energy += sg[i]; + if (sb[i] > 0.f) energy += sb[i]; + } + } + } + + return energy; +} + static void ms_diffuse(int b, float* x0, float* x, float diff, int n) { int i, j, k, l; @@ -247,9 +294,9 @@ static void ms_diffuse(int b, float* x0, float* x, float diff, int n) void multiple_scattering_diffusion(Render *re, float *cache, int res, Material *ma) { const float diff = ma->vol_ms_diff * 0.001f; /* compensate for scaling for a nicer UI range */ - const float fac = ma->vol_ms_intensity; const float simframes = ma->vol_ms_steps; const int shade_type = ma->vol_shade_type; + float fac = ma->vol_ms_intensity; int i, j, k, m; int n = res; @@ -259,8 +306,8 @@ void multiple_scattering_diffusion(Render *re, float *cache, int res, Material * float c=1.0f; int index; float origf; /* factor for blending in original light cache */ - - + float energy_ss, energy_ms; + float *sr0=(float *)MEM_callocN(size*sizeof(float), "temporary multiple scattering buffer"); float *sr=(float *)MEM_callocN(size*sizeof(float), "temporary multiple scattering buffer"); float *sg0=(float *)MEM_callocN(size*sizeof(float), "temporary multiple scattering buffer"); @@ -270,6 +317,8 @@ void multiple_scattering_diffusion(Render *re, float *cache, int res, Material * total = (float)(n*n*n*simframes); + energy_ss = total_ss_energy(cache, res); + /* Scattering as diffusion pass */ for (m=0; mtest_break()) break; } - /* copy to light cache */ - - if (shade_type == MA_VOL_SHADE_SINGLEPLUSMULTIPLE) - origf = 1.0f; - else + /* normalisation factor to conserve energy */ + energy_ms = total_ms_energy(sr, sg, sb, res); + fac *= (energy_ss / energy_ms); + + /* blend multiple scattering back in the light cache */ + if (shade_type == MA_VOL_SHADE_SINGLEPLUSMULTIPLE) { + /* conserve energy - half single, half multiple */ + origf = 0.5f; + fac *= 0.5f; + } else { origf = 0.0f; + } for (k=1;k<=n;k++) { @@ -390,7 +445,7 @@ static void *vol_precache_part(void *data) for (z=pa->minz; z < pa->maxz; z++) { co[2] = pa->bbmin[2] + (pa->voxel[2] * z); - + // don't bother if the point is not inside the volume mesh if (!point_inside_obi(tree, obi, co)) { obi->volume_precache[0*res_3 + x*res_2 + y*res + z] = -1.0f; @@ -398,6 +453,9 @@ static void *vol_precache_part(void *data) obi->volume_precache[2*res_3 + x*res_2 + y*res + z] = -1.0f; continue; } + + VecCopyf(shi->view, co); + Normalize(shi->view); density = vol_get_density(shi, co); vol_get_scattering(shi, scatter_col, co, stepsize, density); @@ -416,8 +474,6 @@ static void *vol_precache_part(void *data) static void precache_setup_shadeinput(Render *re, ObjectInstanceRen *obi, Material *ma, ShadeInput *shi) { - float view[3] = {0.0,0.0,-1.0}; - memset(shi, 0, sizeof(ShadeInput)); shi->depth= 1; shi->mask= 1; @@ -428,7 +484,6 @@ static void precache_setup_shadeinput(Render *re, ObjectInstanceRen *obi, Materi shi->obi= obi; shi->obr= obi->obr; shi->lay = re->scene->lay; - VECCOPY(shi->view, view); } static void precache_init_parts(Render *re, RayTree *tree, ShadeInput *shi, ObjectInstanceRen *obi, float *bbmin, float *bbmax, int res, int totthread, int *parts) @@ -654,3 +709,4 @@ int point_inside_volume_objectinstance(ObjectInstanceRen *obi, float *co) return inside; } + From fc7a561de1b384280fdae7d3e50dde1736576733 Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Tue, 21 Apr 2009 09:31:07 +0000 Subject: [PATCH 082/577] 4th: another file corrupted --- source/blender/imbuf/intern/IMB_jp2.h | 56 --------------------------- 1 file changed, 56 deletions(-) diff --git a/source/blender/imbuf/intern/IMB_jp2.h b/source/blender/imbuf/intern/IMB_jp2.h index 1d89ab8e375..fcdd4589fca 100644 --- a/source/blender/imbuf/intern/IMB_jp2.h +++ b/source/blender/imbuf/intern/IMB_jp2.h @@ -1,62 +1,7 @@ -<<<<<<< .working -/* - * IMB_jp2.h - * -<<<<<<< .working - * $Id: IMB_jp2.h 19805 2009-04-20 00:19:16Z genscher $ - * - * ***** 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 ***** - */ -/** - * \file IMB_jp2.h - * \ingroup imbuf - * \brief Function declarations for jp2.c - */ - -#ifndef IMB_JP2_H -#define IMB_JP2_H - -#ifdef WITH_OPENJPEG -struct ImBuf; - -int imb_is_a_jp2(void *buf); -struct ImBuf *imb_jp2_decode(unsigned char *mem, int size, int flags); -short imb_savejp2(struct ImBuf *ibuf, char *name, int flags); -#endif /* WITH_OPENJPEG */ - -#endif - -======= /* * IMB_jp2.h * * $Id: IMB_bmp.h 14444 2008-04-16 22:40:48Z hos $ -======= - * $Id$ ->>>>>>> .merge-right.r19825 * * ***** BEGIN GPL LICENSE BLOCK ***** * @@ -102,4 +47,3 @@ short imb_savejp2(struct ImBuf *ibuf, char *name, int flags); #endif ->>>>>>> .merge-right.r19804 From e1122a1b67173ee180cfda9fe8dda2f4c37481bf Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Tue, 21 Apr 2009 10:19:14 +0000 Subject: [PATCH 083/577] 5th: another compile fix --- source/gameengine/Ketsji/KX_PythonInit.cpp | 43 ++++++++++++---------- source/gameengine/Ketsji/KX_PythonInit.h | 2 +- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 2227072d2e7..873e49be6bb 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -216,13 +216,13 @@ static PyObject* gPyGetSpectrum(PyObject*) for (int index = 0; index < 512; index++) { - PyList_SetItem(resultlist, index, PyFloat_FromDouble(spectrum[index])); + PyList_SET_ITEM(resultlist, index, PyFloat_FromDouble(spectrum[index])); } } else { for (int index = 0; index < 512; index++) { - PyList_SetItem(resultlist, index, PyFloat_FromDouble(0.0)); + PyList_SET_ITEM(resultlist, index, PyFloat_FromDouble(0.0)); } } @@ -553,7 +553,7 @@ static PyObject* gPySetEyeSeparation(PyObject*, PyObject* args) return NULL; if (!gp_Rasterizer) { - PyErr_SetString(PyExc_RuntimeError, "Rasterizer not available"); + PyErr_SetString(PyExc_RuntimeError, "Rasterizer.setEyeSeparation(float), Rasterizer not available"); return NULL; } @@ -565,7 +565,7 @@ static PyObject* gPySetEyeSeparation(PyObject*, PyObject* args) static PyObject* gPyGetEyeSeparation(PyObject*) { if (!gp_Rasterizer) { - PyErr_SetString(PyExc_RuntimeError, "Rasterizer not available"); + PyErr_SetString(PyExc_RuntimeError, "Rasterizer.getEyeSeparation(), Rasterizer not available"); return NULL; } @@ -579,7 +579,7 @@ static PyObject* gPySetFocalLength(PyObject*, PyObject* args) return NULL; if (!gp_Rasterizer) { - PyErr_SetString(PyExc_RuntimeError, "Rasterizer not available"); + PyErr_SetString(PyExc_RuntimeError, "Rasterizer.setFocalLength(float), Rasterizer not available"); return NULL; } @@ -591,7 +591,7 @@ static PyObject* gPySetFocalLength(PyObject*, PyObject* args) static PyObject* gPyGetFocalLength(PyObject*, PyObject*, PyObject*) { if (!gp_Rasterizer) { - PyErr_SetString(PyExc_RuntimeError, "Rasterizer not available"); + PyErr_SetString(PyExc_RuntimeError, "Rasterizer.getFocalLength(), Rasterizer not available"); return NULL; } @@ -624,7 +624,7 @@ static PyObject* gPySetMistColor(PyObject*, PyObject* value) return NULL; if (!gp_Rasterizer) { - PyErr_SetString(PyExc_RuntimeError, "Rasterizer not available"); + PyErr_SetString(PyExc_RuntimeError, "Rasterizer.setMistColor(color), Rasterizer not available"); return NULL; } gp_Rasterizer->SetFogColor(vec[0], vec[1], vec[2]); @@ -642,7 +642,7 @@ static PyObject* gPySetMistStart(PyObject*, PyObject* args) return NULL; if (!gp_Rasterizer) { - PyErr_SetString(PyExc_RuntimeError, "Rasterizer not available"); + PyErr_SetString(PyExc_RuntimeError, "Rasterizer.setMistStart(float), Rasterizer not available"); return NULL; } @@ -661,7 +661,7 @@ static PyObject* gPySetMistEnd(PyObject*, PyObject* args) return NULL; if (!gp_Rasterizer) { - PyErr_SetString(PyExc_RuntimeError, "Rasterizer not available"); + PyErr_SetString(PyExc_RuntimeError, "Rasterizer.setMistEnd(float), Rasterizer not available"); return NULL; } @@ -679,7 +679,7 @@ static PyObject* gPySetAmbientColor(PyObject*, PyObject* value) return NULL; if (!gp_Rasterizer) { - PyErr_SetString(PyExc_RuntimeError, "Rasterizer not available"); + PyErr_SetString(PyExc_RuntimeError, "Rasterizer.setAmbientColor(color), Rasterizer not available"); return NULL; } gp_Rasterizer->SetAmbientColor(vec[0], vec[1], vec[2]); @@ -711,7 +711,7 @@ static PyObject* gPyEnableMotionBlur(PyObject*, PyObject* args) return NULL; if (!gp_Rasterizer) { - PyErr_SetString(PyExc_RuntimeError, "Rasterizer not available"); + PyErr_SetString(PyExc_RuntimeError, "Rasterizer.enableMotionBlur(float), Rasterizer not available"); return NULL; } @@ -723,7 +723,7 @@ static PyObject* gPyEnableMotionBlur(PyObject*, PyObject* args) static PyObject* gPyDisableMotionBlur(PyObject*, PyObject* args) { if (!gp_Rasterizer) { - PyErr_SetString(PyExc_RuntimeError, "Rasterizer not available"); + PyErr_SetString(PyExc_RuntimeError, "Rasterizer.disableMotionBlur(), Rasterizer not available"); return NULL; } @@ -763,7 +763,7 @@ static PyObject* gPySetGLSLMaterialSetting(PyObject*, flag = getGLSLSettingFlag(setting); if (flag==-1) { - PyErr_SetString(PyExc_ValueError, "glsl setting is not known"); + PyErr_SetString(PyExc_ValueError, "Rasterizer.setGLSLMaterialSetting(string): glsl setting is not known"); return NULL; } @@ -804,7 +804,7 @@ static PyObject* gPyGetGLSLMaterialSetting(PyObject*, flag = getGLSLSettingFlag(setting); if (flag==-1) { - PyErr_SetString(PyExc_ValueError, "glsl setting is not known"); + PyErr_SetString(PyExc_ValueError, "Rasterizer.getGLSLMaterialSetting(string): glsl setting is not known"); return NULL; } @@ -832,7 +832,7 @@ static PyObject* gPySetMaterialType(PyObject*, else if(type == KX_TEXFACE_MATERIAL) flag = 0; else { - PyErr_SetString(PyExc_ValueError, "material type is not known"); + PyErr_SetString(PyExc_ValueError, "Rasterizer.setMaterialType(int): material type is not known"); return NULL; } @@ -863,7 +863,7 @@ static PyObject* gPyDrawLine(PyObject*, PyObject* args) PyObject* ob_color; if (!gp_Rasterizer) { - PyErr_SetString(PyExc_RuntimeError, "Rasterizer not available"); + PyErr_SetString(PyExc_RuntimeError, "Rasterizer.drawLine(obFrom, obTo, color): Rasterizer not available"); return NULL; } @@ -1270,7 +1270,7 @@ PyObject *KXpy_reload(PyObject *self, PyObject *args) { return newmodule; if (found==0) /* if its found but could not import then it has its own error */ - PyErr_SetString(PyExc_ImportError, "failed to reload from blenders internal text"); + PyErr_SetString(PyExc_ImportError, "reload(module): failed to reload from blenders internal text"); return newmodule; } @@ -1357,14 +1357,17 @@ void setSandbox(TPythonSecurityLevel level) /** * Python is not initialised. */ -PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecurityLevel level, Main *maggie) +PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecurityLevel level, Main *maggie, int argc, char** argv) { STR_String pname = progname; Py_SetProgramName(pname.Ptr()); Py_NoSiteFlag=1; Py_FrozenFlag=1; Py_Initialize(); - + + if(argv) /* browser plugins dont currently set this */ + PySys_SetArgv(argc, argv); + //importBlenderModules() setSandbox(level); @@ -1517,7 +1520,7 @@ static PyObject* gPyEventToString(PyObject*, PyObject* value) PyErr_Clear(); // incase there was an error clearing Py_DECREF(mod); - if (!ret) PyErr_SetString(PyExc_ValueError, "expected a valid int keyboard event"); + if (!ret) PyErr_SetString(PyExc_ValueError, "GameKeys.EventToString(int): expected a valid int keyboard event"); else Py_INCREF(ret); return ret; diff --git a/source/gameengine/Ketsji/KX_PythonInit.h b/source/gameengine/Ketsji/KX_PythonInit.h index 97d23fe391c..11360197b95 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.h +++ b/source/gameengine/Ketsji/KX_PythonInit.h @@ -43,7 +43,7 @@ extern bool gUseVisibilityTemp; PyObject* initGameLogic(class KX_KetsjiEngine *engine, class KX_Scene* ketsjiscene); PyObject* initGameKeys(); PyObject* initRasterizer(class RAS_IRasterizer* rasty,class RAS_ICanvas* canvas); -PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecurityLevel level, struct Main *maggie); +PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecurityLevel level, struct Main *maggie, int argc, char** argv); PyObject* initMathutils(); PyObject* initBGL(); PyObject* initVideoTexture(void); From ffbd75e57116ba05a1261f14be0d1206acce7e3d Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sat, 16 May 2009 13:17:21 +0000 Subject: [PATCH 084/577] * Fix for simple bug in voxel data texture --- source/blender/render/intern/source/voxeldata.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c index 86cc54c0d44..f0816cfddff 100644 --- a/source/blender/render/intern/source/voxeldata.c +++ b/source/blender/render/intern/source/voxeldata.c @@ -355,14 +355,14 @@ void cache_voxeldata(struct Render *re,Tex *tex) if (!vd) return; - read_voxeldata_header(fp, vd); - size = (vd->resolX)*(vd->resolY)*(vd->resolZ); - vd->dataset = MEM_mallocN(sizeof(float)*size, "voxel dataset"); - if (!BLI_exists(vd->source_path)) return; fp = fopen(vd->source_path,"rb"); if (!fp) return; + read_voxeldata_header(fp, vd); + size = (vd->resolX)*(vd->resolY)*(vd->resolZ); + vd->dataset = MEM_mallocN(sizeof(float)*size, "voxel dataset"); + //here improve the dataset loading function for more dataset types if (vd->still) load_frame(fp, vd->dataset, size, vd->still_frame, sizeof(VoxelDataHeader)); else load_frame(fp, vd->dataset, size, re->r.cfra, sizeof(VoxelDataHeader)); From 44cebb39b88a6f411dbe0eb05109869ae82bbc9f Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 10 Jun 2009 07:45:12 +0000 Subject: [PATCH 085/577] * raised some limits in point density --- source/blender/src/buttons_shading.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 2e6dc7da9e1..f74afde5e81 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -909,7 +909,7 @@ static void texture_panel_pointdensity(Tex *tex) X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); uiDefButF(block, NUM, B_REDR, "Radius: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->radius), 0.001, 100.0, 10, 2, "Radius to look for nearby particles within"); + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->radius), 0.001, 10000.0, 10, 2, "Radius to look for nearby particles within"); yco -= YSPACE; @@ -1021,11 +1021,11 @@ static void texture_panel_pointdensity_modify(Tex *tex) if (pd->flag & TEX_PD_TURBULENCE) { uiDefButF(block, NUM, B_REDR, "Size: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_size), 0.001, 100.0, 10, 2, "Turbulence size"); + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_size), 0.001, 10000.0, 10, 2, "Turbulence size"); uiDefButS(block, NUM, B_REDR, "Depth: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_depth), 0.0, 100.0, 10, 2, "Turbulence depth"); + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_depth), 0.0, 1024.0, 10, 2, "Turbulence depth"); uiDefButF(block, NUM, B_REDR, "Strength: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_fac), 0.001, 100.0, 10, 2, ""); + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(pd->noise_fac), 0.001, 10000.0, 10, 2, ""); uiBlockEndAlign(block); From 3b2ec949778649f19b83c5ada413f3a50bb0e0e8 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sat, 20 Jun 2009 06:41:50 +0000 Subject: [PATCH 086/577] Voxel data & volume light cache * Added support for additional file types in the voxel data texture. I added support for 8 bit raw files, but most notably for image sequences. Image sequences generate the voxel grid by stacking layers of image slices on top of each other to generate the voxels in the Z axis - the number of slices in the sequence is the resolution of the voxel grid's Z axis. i.e. http://mke3.net/blender/devel/rendering/volumetrics/skull_layers.jpg The image sequence option is particularly useful for loading medical data into Blender. 3d medical data such as MRIs or CT scans are often stored as DICOM format image sequences. It's not in Blender's scope to support the DICOM format, but there are plenty of utilities such as ImageMagick, Photoshop or OsiriX that can easily convert DICOM files to formats that Blender supports, such as PNG or JPEG. Here are some example renderings using these file formats to load medical data: http://vimeo.com/5242961 http://vimeo.com/5242989 http://vimeo.com/5243228 Currently the 8 bit raw and image sequence formats only support the 'still' rendering feature. * Changed the default texture placement to be centred around 0.5,0.5,0.5, rather than within the 0.0,1.0 cube. This is more consistent with image textures, and it also means you can easily add a voxel data texture to a default cube without having to mess around with mapping. * Added some more extrapolation modes such as Repeat and Extend rather than just clipping http://mke3.net/blender/devel/rendering/volumetrics/bradybunch.jpg * Changed the voxel data storage to use MEM_Mapalloc (memory mapped disk cache) rather than storing in ram, to help cut down memory usage. * Refactored and cleaned up the code a lot. Now the access and interpolation code is separated into a separate voxel library inside blenlib. This is now properly shared between voxel data texture and light cache (previously there was some duplicated code). * Made volume light cache support non-cubic voxel grids. Now the resolution specified in the material properties is used for the longest edge of the volume object's bounding box, and the shorter edges are proportional (similar to how resolution is calculated for fluid sim domains). This is *much* more memory efficient for squashed volume regions like clouds layer bounding boxes, allowing you to raise the resolution considerably while still keeping memory usage acceptable. --- source/blender/blenlib/BLI_voxel.h | 40 ++ source/blender/blenlib/intern/voxel.c | 311 +++++++++++ source/blender/makesdna/DNA_texture_types.h | 22 +- .../render/intern/include/render_types.h | 13 +- .../blender/render/intern/include/voxeldata.h | 10 +- .../blender/render/intern/source/shadeinput.c | 1 + .../render/intern/source/volume_precache.c | 260 +++++----- .../blender/render/intern/source/volumetric.c | 73 +-- .../blender/render/intern/source/voxeldata.c | 484 ++++++------------ source/blender/src/buttons_shading.c | 198 ++++--- 10 files changed, 816 insertions(+), 596 deletions(-) create mode 100644 source/blender/blenlib/BLI_voxel.h create mode 100644 source/blender/blenlib/intern/voxel.c diff --git a/source/blender/blenlib/BLI_voxel.h b/source/blender/blenlib/BLI_voxel.h new file mode 100644 index 00000000000..091d8e3682d --- /dev/null +++ b/source/blender/blenlib/BLI_voxel.h @@ -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 */ \ No newline at end of file diff --git a/source/blender/blenlib/intern/voxel.c b/source/blender/blenlib/intern/voxel.c new file mode 100644 index 00000000000..8a1ca6e59ff --- /dev/null +++ b/source/blender/blenlib/intern/voxel.c @@ -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 + +#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] = { +{ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{-3, 3, 0, 0, 0, 0, 0, 0,-2,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 2,-2, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 9,-9,-9, 9, 0, 0, 0, 0, 6, 3,-6,-3, 0, 0, 0, 0, 6,-6, 3,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{-6, 6, 6,-6, 0, 0, 0, 0,-3,-3, 3, 3, 0, 0, 0, 0,-4, 4,-2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-2,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 2, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{-6, 6, 6,-6, 0, 0, 0, 0,-4,-2, 4, 2, 0, 0, 0, 0,-3, 3,-3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-1,-2,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 4,-4,-4, 4, 0, 0, 0, 0, 2, 2,-2,-2, 0, 0, 0, 0, 2,-2, 2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 3, 0, 0, 0, 0, 0, 0,-2,-1, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,-2, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9,-9,-9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 3,-6,-3, 0, 0, 0, 0, 6,-6, 3,-3, 0, 0, 0, 0, 4, 2, 2, 1, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-6, 6, 6,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3,-3, 3, 3, 0, 0, 0, 0,-4, 4,-2, 2, 0, 0, 0, 0,-2,-2,-1,-1, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-6, 6, 6,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4,-2, 4, 2, 0, 0, 0, 0,-3, 3,-3, 3, 0, 0, 0, 0,-2,-1,-2,-1, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4,-4,-4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2,-2,-2, 0, 0, 0, 0, 2,-2, 2,-2, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0}, +{-3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0, 0, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0, 0, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 9,-9, 0, 0,-9, 9, 0, 0, 6, 3, 0, 0,-6,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,-6, 0, 0, 3,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 2, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{-6, 6, 0, 0, 6,-6, 0, 0,-3,-3, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4, 4, 0, 0,-2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-2, 0, 0,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0, 0, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0, 0, 0,-1, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9,-9, 0, 0,-9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 3, 0, 0,-6,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,-6, 0, 0, 3,-3, 0, 0, 4, 2, 0, 0, 2, 1, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-6, 6, 0, 0, 6,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3,-3, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4, 4, 0, 0,-2, 2, 0, 0,-2,-2, 0, 0,-1,-1, 0, 0}, +{ 9, 0,-9, 0,-9, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 3, 0,-6, 0,-3, 0, 6, 0,-6, 0, 3, 0,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 2, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 9, 0,-9, 0,-9, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 3, 0,-6, 0,-3, 0, 6, 0,-6, 0, 3, 0,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 2, 0, 2, 0, 1, 0}, +{-27,27,27,-27,27,-27,-27,27,-18,-9,18, 9,18, 9,-18,-9,-18,18,-9, 9,18,-18, 9,-9,-18,18,18,-18,-9, 9, 9,-9,-12,-6,-6,-3,12, 6, 6, 3,-12,-6,12, 6,-6,-3, 6, 3,-12,12,-6, 6,-6, 6,-3, 3,-8,-4,-4,-2,-4,-2,-2,-1}, +{18,-18,-18,18,-18,18,18,-18, 9, 9,-9,-9,-9,-9, 9, 9,12,-12, 6,-6,-12,12,-6, 6,12,-12,-12,12, 6,-6,-6, 6, 6, 6, 3, 3,-6,-6,-3,-3, 6, 6,-6,-6, 3, 3,-3,-3, 8,-8, 4,-4, 4,-4, 2,-2, 4, 4, 2, 2, 2, 2, 1, 1}, +{-6, 0, 6, 0, 6, 0,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0,-3, 0, 3, 0, 3, 0,-4, 0, 4, 0,-2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-2, 0,-1, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0,-6, 0, 6, 0, 6, 0,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0,-3, 0, 3, 0, 3, 0,-4, 0, 4, 0,-2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-2, 0,-1, 0,-1, 0}, +{18,-18,-18,18,-18,18,18,-18,12, 6,-12,-6,-12,-6,12, 6, 9,-9, 9,-9,-9, 9,-9, 9,12,-12,-12,12, 6,-6,-6, 6, 6, 3, 6, 3,-6,-3,-6,-3, 8, 4,-8,-4, 4, 2,-4,-2, 6,-6, 6,-6, 3,-3, 3,-3, 4, 2, 4, 2, 2, 1, 2, 1}, +{-12,12,12,-12,12,-12,-12,12,-6,-6, 6, 6, 6, 6,-6,-6,-6, 6,-6, 6, 6,-6, 6,-6,-8, 8, 8,-8,-4, 4, 4,-4,-3,-3,-3,-3, 3, 3, 3, 3,-4,-4, 4, 4,-2,-2, 2, 2,-4, 4,-4, 4,-2, 2,-2, 2,-2,-2,-2,-2,-1,-1,-1,-1}, +{ 2, 0, 0, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{-6, 6, 0, 0, 6,-6, 0, 0,-4,-2, 0, 0, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 3, 0, 0,-3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-1, 0, 0,-2,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 4,-4, 0, 0,-4, 4, 0, 0, 2, 2, 0, 0,-2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,-2, 0, 0, 2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-6, 6, 0, 0, 6,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4,-2, 0, 0, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 3, 0, 0,-3, 3, 0, 0,-2,-1, 0, 0,-2,-1, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4,-4, 0, 0,-4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0,-2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,-2, 0, 0, 2,-2, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0}, +{-6, 0, 6, 0, 6, 0,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4, 0,-2, 0, 4, 0, 2, 0,-3, 0, 3, 0,-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0,-2, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0,-6, 0, 6, 0, 6, 0,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4, 0,-2, 0, 4, 0, 2, 0,-3, 0, 3, 0,-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0,-2, 0,-1, 0}, +{18,-18,-18,18,-18,18,18,-18,12, 6,-12,-6,-12,-6,12, 6,12,-12, 6,-6,-12,12,-6, 6, 9,-9,-9, 9, 9,-9,-9, 9, 8, 4, 4, 2,-8,-4,-4,-2, 6, 3,-6,-3, 6, 3,-6,-3, 6,-6, 3,-3, 6,-6, 3,-3, 4, 2, 2, 1, 4, 2, 2, 1}, +{-12,12,12,-12,12,-12,-12,12,-6,-6, 6, 6, 6, 6,-6,-6,-8, 8,-4, 4, 8,-8, 4,-4,-6, 6, 6,-6,-6, 6, 6,-6,-4,-4,-2,-2, 4, 4, 2, 2,-3,-3, 3, 3,-3,-3, 3, 3,-4, 4,-2, 2,-4, 4,-2, 2,-2,-2,-1,-1,-2,-2,-1,-1}, +{ 4, 0,-4, 0,-4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0,-2, 0,-2, 0, 2, 0,-2, 0, 2, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, +{ 0, 0, 0, 0, 0, 0, 0, 0, 4, 0,-4, 0,-4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0,-2, 0,-2, 0, 2, 0,-2, 0, 2, 0,-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); + +} + diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index 420850ce396..5cbad6cf424 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -165,9 +165,10 @@ typedef struct PointDensity { typedef struct VoxelData { int resolX, resolY, resolZ; int interp_type; - + short file_format; + short flag; + float int_multiplier; - float vxpad; int still, still_frame; char source_path[240]; @@ -480,13 +481,20 @@ typedef struct TexMapping { #define POINT_DATA_VEL 1 #define POINT_DATA_LIFE 2 -/******************** Voxel Data *****************************/ -#define TEX_VD_CUBIC 0 -#define TEX_VD_PARALLELOGRAM 1 - +/******************** Voxel Data *****************************/ +/* flag */ + + +/* interpolation */ #define TEX_VD_NEARESTNEIGHBOR 0 -#define TEX_VD_LINEAR 1 +#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 diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index 8dbdde77726..9703ab10821 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -290,8 +290,8 @@ typedef struct ObjectInstanceRen { float dupliorco[3], dupliuv[2]; float (*duplitexmat)[4]; - float *volume_precache; - + struct VolumePrecache *volume_precache; + float *vectors; int totvector; } ObjectInstanceRen; @@ -426,12 +426,19 @@ typedef struct VolPrecachePart int minx, maxx; int miny, maxy; int minz, maxz; - int res; + 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; /* ------------------------------------------------------------------------- */ diff --git a/source/blender/render/intern/include/voxeldata.h b/source/blender/render/intern/include/voxeldata.h index 36c7789da80..b291bdc096d 100644 --- a/source/blender/render/intern/include/voxeldata.h +++ b/source/blender/render/intern/include/voxeldata.h @@ -29,23 +29,17 @@ #ifndef VOXELDATA_H #define VOXELDATA_H -/** - * Load voxel data for all point density textures in the scene - */ - struct Render; struct TexResult; typedef struct VoxelDataHeader { -int resolX, resolY, resolZ; -int frames; + int resolX, resolY, resolZ; + int frames; } VoxelDataHeader; -__inline int _I(int x, int y, int z, int *n); void make_voxeldata(struct Render *re); void free_voxeldata(struct Render *re); int voxeldatatex(struct Tex *tex, float *texvec, struct TexResult *texres); - #endif /* VOXELDATA_H */ diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index 294175460bf..59ab5661c19 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -51,6 +51,7 @@ #include "shading.h" #include "strand.h" #include "texture.h" +#include "volumetric.h" #include "zbuf.h" /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c index b3cffb45a27..98a1a2ec2c8 100644 --- a/source/blender/render/intern/source/volume_precache.c +++ b/source/blender/render/intern/source/volume_precache.c @@ -36,6 +36,7 @@ #include "BLI_blenlib.h" #include "BLI_arithb.h" #include "BLI_threads.h" +#include "BLI_voxel.h" #include "PIL_time.h" @@ -61,6 +62,7 @@ extern struct Render R; /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* *** utility code to set up an individual raytree for objectinstance, for checking inside/outside *** */ /* Recursive test for intersections, from a point inside the mesh, to outside * Number of intersections (depth) determine if a point is inside or outside the mesh */ @@ -151,28 +153,28 @@ RayTree *create_raytree_obi(ObjectInstanceRen *obi, float *bbmin, float *bbmax) return tree; } -static float get_avg_surrounds(float *cache, int res, int res_2, int res_3, int rgb, int xx, int yy, int zz) +/* *** light cache filtering *** */ + +static float get_avg_surrounds(float *cache, int *res, int xx, int yy, int zz) { int x, y, z, x_, y_, z_; int added=0; float tot=0.0f; - int i; - for (x=-1; x <= 1; x++) { - x_ = xx+x; - if (x_ >= 0 && x_ <= res-1) { + for (z=-1; z <= 1; z++) { + z_ = zz+z; + if (z_ >= 0 && z_ <= res[2]-1) { for (y=-1; y <= 1; y++) { y_ = yy+y; - if (y_ >= 0 && y_ <= res-1) { + if (y_ >= 0 && y_ <= res[1]-1) { - for (z=-1; z <= 1; z++) { - z_ = zz+z; - if (z_ >= 0 && z_ <= res-1) { + for (x=-1; x <= 1; x++) { + x_ = xx+x; + if (x_ >= 0 && x_ <= res[0]-1) { - i = rgb*res_3 + x_*res_2 + y_*res + z_; - if (cache[i] > 0.0f) { - tot += cache[i]; + if (cache[ V_I(x_, y_, z_, res) ] > 0.0f) { + tot += cache[ V_I(x_, y_, z_, res) ]; added++; } @@ -192,54 +194,46 @@ static float get_avg_surrounds(float *cache, int res, int res_2, int res_3, int * For each voxel which was originally external to the mesh, it finds the average values of * the surrounding internal voxels and sets the original external voxel to that average amount. * Works almost a bit like a 'dilate' filter */ -static void lightcache_filter(float *cache, int res) +static void lightcache_filter(VolumePrecache *vp) { - int x, y, z, rgb; - int res_2, res_3; - int i; - - res_2 = res*res; - res_3 = res*res*res; + int x, y, z; - for (x=0; x < res; x++) { - for (y=0; y < res; y++) { - for (z=0; z < res; z++) { - for (rgb=0; rgb < 3; rgb++) { - i = rgb*res_3 + x*res_2 + y*res + z; - - /* trigger for outside mesh */ - if (cache[i] < -0.5f) cache[i] = get_avg_surrounds(cache, res, res_2, res_3, rgb, x, y, z); - } + for (z=0; z < vp->res[2]; z++) { + for (y=0; y < vp->res[1]; y++) { + for (x=0; x < vp->res[0]; x++) { + /* trigger for outside mesh */ + if (vp->data_r[ V_I(x, y, z, vp->res) ] < -0.5f) + vp->data_r[ V_I(x, y, z, vp->res) ] = get_avg_surrounds(vp->data_r, vp->res, x, y, z); + if (vp->data_g[ V_I(x, y, z, vp->res) ] < -0.5f) + vp->data_g[ V_I(x, y, z, vp->res) ] = get_avg_surrounds(vp->data_g, vp->res, x, y, z); + if (vp->data_b[ V_I(x, y, z, vp->res) ] < -0.5f) + vp->data_b[ V_I(x, y, z, vp->res) ] = get_avg_surrounds(vp->data_b, vp->res, x, y, z); } } } } -static inline int I(int x,int y,int z,int n) //has a pad of 1 voxel surrounding the core for boundary simulation +static inline int ms_I(int x, int y, int z, int *n) //has a pad of 1 voxel surrounding the core for boundary simulation { - return (x*(n+2)+y)*(n+2)+z; + return z*(n[1]+2)*(n[0]+2) + y*(n[0]+2) + x; } +/* *** multiple scattering approximation *** */ + /* get the total amount of light energy in the light cache. used to normalise after multiple scattering */ -static float total_ss_energy(float *cache, const int res) +static float total_ss_energy(VolumePrecache *vp) { - int x, y, z, rgb; - int res_2, res_3; - int i; + int x, y, z; + int *res = vp->res; float energy=0.f; - res_2 = res*res; - res_3 = res*res*res; - - for (x=0; x < res; x++) { - for (y=0; y < res; y++) { - for (z=0; z < res; z++) { - for (rgb=0; rgb < 3; rgb++) { - i = rgb*res_3 + x*res_2 + y*res + z; - - if (cache[i] > 0.f) energy += cache[i]; - } + for (z=0; z < res[2]; z++) { + for (y=0; y < res[1]; y++) { + for (x=0; x < res[0]; x++) { + if (vp->data_r[ V_I(x, y, z, res) ] > 0.f) energy += vp->data_r[ V_I(x, y, z, res) ]; + if (vp->data_g[ V_I(x, y, z, res) ] > 0.f) energy += vp->data_g[ V_I(x, y, z, res) ]; + if (vp->data_b[ V_I(x, y, z, res) ] > 0.f) energy += vp->data_b[ V_I(x, y, z, res) ]; } } } @@ -247,16 +241,16 @@ static float total_ss_energy(float *cache, const int res) return energy; } -static float total_ms_energy(float *sr, float *sg, float *sb, const int res) +static float total_ms_energy(float *sr, float *sg, float *sb, int *res) { int x, y, z, i; float energy=0.f; - for (z=1;z<=res;z++) { - for (y=1;y<=res;y++) { - for (x=1;x<=res;x++) { + for (z=1;z<=res[2];z++) { + for (y=1;y<=res[1];y++) { + for (x=1;x<=res[0];x++) { - i = I(x,y,z,res); + i = ms_I(x,y,z,res); if (sr[i] > 0.f) energy += sr[i]; if (sg[i] > 0.f) energy += sg[i]; if (sb[i] > 0.f) energy += sb[i]; @@ -267,44 +261,44 @@ static float total_ms_energy(float *sr, float *sg, float *sb, const int res) return energy; } -static void ms_diffuse(int b, float* x0, float* x, float diff, int n) +static void ms_diffuse(int b, float* x0, float* x, float diff, int *n) { int i, j, k, l; const float dt = VOL_MS_TIMESTEP; - const float a = dt*diff*n*n*n; + const float a = dt*diff*n[0]*n[1]*n[2]; for (l=0; l<20; l++) { - for (k=1; k<=n; k++) + for (k=1; k<=n[2]; k++) { - for (j=1; j<=n; j++) + for (j=1; j<=n[1]; j++) { - for (i=1; i<=n; i++) + for (i=1; i<=n[0]; i++) { - x[I(i,j,k,n)] = (x0[I(i,j,k,n)] + a*( - x[I(i-1,j,k,n)]+x[I(i+1,j,k,n)]+ - x[I(i,j-1,k,n)]+x[I(i,j+1,k,n)]+ - x[I(i,j,k-1,n)]+x[I(i,j,k+1,n)]))/(1+6*a); + x[ms_I(i,j,k,n)] = (x0[ms_I(i,j,k,n)] + a*( + x[ms_I(i-1,j,k,n)]+x[ms_I(i+1,j,k,n)]+ + x[ms_I(i,j-1,k,n)]+x[ms_I(i,j+1,k,n)]+ + x[ms_I(i,j,k-1,n)]+x[ms_I(i,j,k+1,n)]))/(1+6*a); } } } } } -void multiple_scattering_diffusion(Render *re, float *cache, int res, Material *ma) +void multiple_scattering_diffusion(Render *re, VolumePrecache *vp, Material *ma) { const float diff = ma->vol_ms_diff * 0.001f; /* compensate for scaling for a nicer UI range */ const float simframes = ma->vol_ms_steps; const int shade_type = ma->vol_shade_type; float fac = ma->vol_ms_intensity; - int i, j, k, m; - int n = res; - const int size = (n+2)*(n+2)*(n+2); + int x, y, z, m; + int *n = vp->res; + const int size = (n[0]+2)*(n[1]+2)*(n[2]+2); double time, lasttime= PIL_check_seconds_timer(); float total; float c=1.0f; - int index; + int i; float origf; /* factor for blending in original light cache */ float energy_ss, energy_ms; @@ -315,33 +309,31 @@ void multiple_scattering_diffusion(Render *re, float *cache, int res, Material * float *sb0=(float *)MEM_callocN(size*sizeof(float), "temporary multiple scattering buffer"); float *sb=(float *)MEM_callocN(size*sizeof(float), "temporary multiple scattering buffer"); - total = (float)(n*n*n*simframes); + total = (float)(n[0]*n[1]*n[2]*simframes); - energy_ss = total_ss_energy(cache, res); + energy_ss = total_ss_energy(vp); /* Scattering as diffusion pass */ for (m=0; mdata_r[i] > 0.f) + sr[ms_I(x,y,z,n)] += vp->data_r[i]; + if (vp->data_g[i] > 0.f) + sg[ms_I(x,y,z,n)] += vp->data_g[i]; + if (vp->data_b[i] > 0.f) + sb[ms_I(x,y,z,n)] += vp->data_b[i]; - index=(i-1)*n*n + (j-1)*n + k-1; - - if (cache[index] > 0.0f) - sr[I(i,j,k,n)] += cache[index]; - if (cache[1*n*n*n + index] > 0.0f) - sg[I(i,j,k,n)] += cache[1*n*n*n + index]; - if (cache[2*n*n*n + index] > 0.0f) - sb[I(i,j,k,n)] += cache[2*n*n*n + index]; - - /* Displays progress every second */ if(time-lasttime>1.0f) { char str[64]; @@ -368,7 +360,7 @@ void multiple_scattering_diffusion(Render *re, float *cache, int res, Material * } /* normalisation factor to conserve energy */ - energy_ms = total_ms_energy(sr, sg, sb, res); + energy_ms = total_ms_energy(sr, sg, sb, n); fac *= (energy_ss / energy_ms); /* blend multiple scattering back in the light cache */ @@ -380,16 +372,16 @@ void multiple_scattering_diffusion(Render *re, float *cache, int res, Material * origf = 0.0f; } - for (k=1;k<=n;k++) + for (z=1;z<=n[2];z++) { - for (j=1;j<=n;j++) + for (y=1;y<=n[1];y++) { - for (i=1;i<=n;i++) + for (x=1;x<=n[0];x++) { - index=(i-1)*n*n + (j-1)*n + k-1; - cache[index] = origf * cache[index] + fac * sr[I(i,j,k,n)]; - cache[1*n*n*n + index] = origf * cache[1*n*n*n + index] + fac * sg[I(i,j,k,n)]; - cache[2*n*n*n + index] = origf * cache[2*n*n*n + index] + fac * sb[I(i,j,k,n)]; + int index=(x-1)*n[1]*n[2] + (y-1)*n[2] + z-1; + vp->data_r[index] = origf * vp->data_r[index] + fac * sr[ms_I(x,y,z,n)]; + vp->data_g[index] = origf * vp->data_g[index] + fac * sg[ms_I(x,y,z,n)]; + vp->data_b[index] = origf * vp->data_b[index] + fac * sb[ms_I(x,y,z,n)]; } } } @@ -434,23 +426,23 @@ static void *vol_precache_part(void *data) float density, scatter_col[3] = {0.f, 0.f, 0.f}; float co[3]; int x, y, z; - const int res=pa->res, res_2=pa->res*pa->res, res_3=pa->res*pa->res*pa->res; + const int res[3]= {pa->res[0], pa->res[1], pa->res[2]}; const float stepsize = vol_get_stepsize(shi, STEPSIZE_VIEW); - for (x= pa->minx; x < pa->maxx; x++) { - co[0] = pa->bbmin[0] + (pa->voxel[0] * x); + for (z= pa->minz; z < pa->maxz; z++) { + co[2] = pa->bbmin[2] + (pa->voxel[2] * z); for (y= pa->miny; y < pa->maxy; y++) { co[1] = pa->bbmin[1] + (pa->voxel[1] * y); - for (z=pa->minz; z < pa->maxz; z++) { - co[2] = pa->bbmin[2] + (pa->voxel[2] * z); + for (x=pa->minx; x < pa->maxx; x++) { + co[0] = pa->bbmin[0] + (pa->voxel[0] * x); // don't bother if the point is not inside the volume mesh if (!point_inside_obi(tree, obi, co)) { - obi->volume_precache[0*res_3 + x*res_2 + y*res + z] = -1.0f; - obi->volume_precache[1*res_3 + x*res_2 + y*res + z] = -1.0f; - obi->volume_precache[2*res_3 + x*res_2 + y*res + z] = -1.0f; + obi->volume_precache->data_r[ V_I(x, y, z, res) ] = -1.0f; + obi->volume_precache->data_g[ V_I(x, y, z, res) ] = -1.0f; + obi->volume_precache->data_b[ V_I(x, y, z, res) ] = -1.0f; continue; } @@ -459,9 +451,9 @@ static void *vol_precache_part(void *data) density = vol_get_density(shi, co); vol_get_scattering(shi, scatter_col, co, stepsize, density); - obi->volume_precache[0*res_3 + x*res_2 + y*res + z] = scatter_col[0]; - obi->volume_precache[1*res_3 + x*res_2 + y*res + z] = scatter_col[1]; - obi->volume_precache[2*res_3 + x*res_2 + y*res + z] = scatter_col[2]; + obi->volume_precache->data_r[ V_I(x, y, z, res) ] = scatter_col[0]; + obi->volume_precache->data_g[ V_I(x, y, z, res) ] = scatter_col[1]; + obi->volume_precache->data_b[ V_I(x, y, z, res) ] = scatter_col[2]; } } } @@ -486,44 +478,52 @@ static void precache_setup_shadeinput(Render *re, ObjectInstanceRen *obi, Materi shi->lay = re->scene->lay; } -static void precache_init_parts(Render *re, RayTree *tree, ShadeInput *shi, ObjectInstanceRen *obi, float *bbmin, float *bbmax, int res, int totthread, int *parts) +static void precache_init_parts(Render *re, RayTree *tree, ShadeInput *shi, ObjectInstanceRen *obi, int totthread, int *parts) { + VolumePrecache *vp = obi->volume_precache; int i=0, x, y, z; float voxel[3]; int sizex, sizey, sizez; + float *bbmin=obi->obr->boundbox[0], *bbmax=obi->obr->boundbox[1]; + int *res; int minx, maxx; int miny, maxy; int minz, maxz; + if (!vp) return; + BLI_freelistN(&re->volume_precache_parts); /* currently we just subdivide the box, number of threads per side */ parts[0] = parts[1] = parts[2] = totthread; + res = vp->res; VecSubf(voxel, bbmax, bbmin); if ((voxel[0] < FLT_EPSILON) || (voxel[1] < FLT_EPSILON) || (voxel[2] < FLT_EPSILON)) return; - VecMulf(voxel, 1.0f/res); + voxel[0] /= res[0]; + voxel[1] /= res[1]; + voxel[2] /= res[2]; for (x=0; x < parts[0]; x++) { - sizex = ceil(res / (float)parts[0]); + sizex = ceil(res[0] / (float)parts[0]); minx = x * sizex; maxx = minx + sizex; - maxx = (maxx>res)?res:maxx; + maxx = (maxx>res[0])?res[0]:maxx; for (y=0; y < parts[1]; y++) { - sizey = ceil(res / (float)parts[1]); + sizey = ceil(res[1] / (float)parts[1]); miny = y * sizey; maxy = miny + sizey; - maxy = (maxy>res)?res:maxy; + maxy = (maxy>res[1])?res[1]:maxy; for (z=0; z < parts[2]; z++) { VolPrecachePart *pa= MEM_callocN(sizeof(VolPrecachePart), "new precache part"); - sizez = ceil(res / (float)parts[2]); + sizez = ceil(res[2] / (float)parts[2]); minz = z * sizez; maxz = minz + sizez; - maxz = (maxz>res)?res:maxz; + maxz = (maxz>res[2])?res[2]:maxz; pa->done = 0; pa->working = 0; @@ -534,7 +534,7 @@ static void precache_init_parts(Render *re, RayTree *tree, ShadeInput *shi, Obje pa->obi = obi; VECCOPY(pa->bbmin, bbmin); VECCOPY(pa->voxel, voxel); - pa->res = res; + VECCOPY(pa->res, res); pa->minx = minx; pa->maxx = maxx; pa->miny = miny; pa->maxy = maxy; @@ -564,19 +564,37 @@ static VolPrecachePart *precache_get_new_part(Render *re) return nextpa; } +static void precache_resolution(VolumePrecache *vp, float *bbmin, float *bbmax, int res) +{ + float dim[3], div; + + VecSubf(dim, bbmax, bbmin); + + div = MAX3(dim[0], dim[1], dim[2]); + dim[0] /= div; + dim[1] /= div; + dim[2] /= div; + + vp->res[0] = dim[0] * (float)res; + vp->res[1] = dim[1] * (float)res; + vp->res[2] = dim[2] * (float)res; +} + /* Precache a volume into a 3D voxel grid. * The voxel grid is stored in the ObjectInstanceRen, * in camera space, aligned with the ObjectRen's bounding box. * Resolution is defined by the user. */ -void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *obi, Material *ma, float *bbmin, float *bbmax) +void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *obi, Material *ma) { + VolumePrecache *vp; VolPrecachePart *nextpa, *pa; RayTree *tree; ShadeInput shi; ListBase threads; - const int res = ma->vol_precache_resolution; + float *bbmin=obi->obr->boundbox[0], *bbmax=obi->obr->boundbox[1]; int parts[3], totparts; + int res[3]; int caching=1, counter=0; int totthread = re->r.threads; @@ -589,13 +607,19 @@ void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *obi, Mat * used for checking if the cached point is inside or outside. */ tree = create_raytree_obi(obi, bbmin, bbmax); if (!tree) return; - - obi->volume_precache = MEM_callocN(sizeof(float)*res*res*res*3, "volume light cache"); + + vp = MEM_callocN(sizeof(VolumePrecache), "volume light cache"); + precache_resolution(vp, bbmin, bbmax, ma->vol_precache_resolution); + + vp->data_r = MEM_callocN(sizeof(float)*vp->res[0]*vp->res[1]*vp->res[2], "volume light cache data red channel"); + vp->data_g = MEM_callocN(sizeof(float)*vp->res[0]*vp->res[1]*vp->res[2], "volume light cache data green channel"); + vp->data_b = MEM_callocN(sizeof(float)*vp->res[0]*vp->res[1]*vp->res[2], "volume light cache data blue channel"); + obi->volume_precache = vp; /* Need a shadeinput to calculate scattering */ precache_setup_shadeinput(re, obi, ma, &shi); - precache_init_parts(re, tree, &shi, obi, bbmin, bbmax, res, totthread, parts); + precache_init_parts(re, tree, &shi, obi, totthread, parts); totparts = parts[0] * parts[1] * parts[2]; BLI_init_threads(&threads, vol_precache_part, totthread); @@ -644,11 +668,11 @@ void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *obi, Mat tree= NULL; } - lightcache_filter(obi->volume_precache, res); + lightcache_filter(obi->volume_precache); if (ELEM(ma->vol_shade_type, MA_VOL_SHADE_MULTIPLE, MA_VOL_SHADE_SINGLEPLUSMULTIPLE)) { - multiple_scattering_diffusion(re, obi->volume_precache, res, ma); + multiple_scattering_diffusion(re, vp, ma); } } @@ -672,7 +696,7 @@ void volume_precache(Render *re) if (using_lightcache(vo->ma)) { for(obi= re->instancetable.first; obi; obi= obi->next) { if (obi->obr == vo->obr) { - vol_precache_objectinstance_threads(re, obi, vo->ma, obi->obr->boundbox[0], obi->obr->boundbox[1]); + vol_precache_objectinstance_threads(re, obi, vo->ma); } } } @@ -687,8 +711,12 @@ void free_volume_precache(Render *re) ObjectInstanceRen *obi; for(obi= re->instancetable.first; obi; obi= obi->next) { - if (obi->volume_precache) + if (obi->volume_precache != NULL) { MEM_freeN(obi->volume_precache); + MEM_freeN(obi->volume_precache->data_r); + MEM_freeN(obi->volume_precache->data_g); + MEM_freeN(obi->volume_precache->data_b); + } } BLI_freelistN(&re->volumes); diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 01c4ac8fa74..65f2916af59 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -36,6 +36,7 @@ #include "BLI_blenlib.h" #include "BLI_arithb.h" #include "BLI_rand.h" +#include "BLI_voxel.h" #include "RE_shader_ext.h" #include "RE_raytrace.h" @@ -139,79 +140,27 @@ static float vol_get_depth_cutoff(struct ShadeInput *shi) return shi->mat->vol_depth_cutoff; } -/* SHADING */ - -static float D(ShadeInput *shi, int rgb, int x, int y, int z) -{ - const int res = shi->mat->vol_precache_resolution; - CLAMP(x, 0, res-1); - CLAMP(y, 0, res-1); - CLAMP(z, 0, res-1); - return shi->obi->volume_precache[rgb*res*res*res + x*res*res + y*res + z]; -} - -static inline float lerp(float t, float v1, float v2) { - return (1.f - t) * v1 + t * v2; -} - /* trilinear interpolation */ static void vol_get_precached_scattering(ShadeInput *shi, float *scatter_col, float *co) { - const int res = shi->mat->vol_precache_resolution; - float voxx, voxy, voxz; - int vx, vy, vz; - float dx, dy, dz; - float d00, d10, d01, d11, d0, d1, d_final; + VolumePrecache *vp = shi->obi->volume_precache; float bbmin[3], bbmax[3], dim[3]; - int rgb; + float sample_co[3]; - if (!shi->obi->volume_precache) return; + if (!vp) return; + /* convert input coords to 0.0, 1.0 */ VECCOPY(bbmin, shi->obi->obr->boundbox[0]); VECCOPY(bbmax, shi->obi->obr->boundbox[1]); VecSubf(dim, bbmax, bbmin); - - voxx = ((co[0] - bbmin[0]) / dim[0]) * res - 0.5f; - voxy = ((co[1] - bbmin[1]) / dim[1]) * res - 0.5f; - voxz = ((co[2] - bbmin[2]) / dim[2]) * res - 0.5f; - - vx = (int)voxx; vy = (int)voxy; vz = (int)voxz; - - dx = voxx - vx; dy = voxy - vy; dz = voxz - vz; - - for (rgb=0; rgb < 3; rgb++) { - d00 = lerp(dx, D(shi, rgb, vx, vy, vz), D(shi, rgb, vx+1, vy, vz)); - d10 = lerp(dx, D(shi, rgb, vx, vy+1, vz), D(shi, rgb, vx+1, vy+1, vz)); - d01 = lerp(dx, D(shi, rgb, vx, vy, vz+1), D(shi, rgb, vx+1, vy, vz+1)); - d11 = lerp(dx, D(shi, rgb, vx, vy+1, vz+1), D(shi, rgb, vx+1, vy+1, vz+1)); - d0 = lerp(dy, d00, d10); - d1 = lerp(dy, d01, d11); - d_final = lerp(dz, d0, d1); - - scatter_col[rgb] = d_final; - } -} -/* no interpolation */ -static void vol_get_precached_scattering_nearest(ShadeInput *shi, float *scatter_col, float *co) -{ - const int res = shi->mat->vol_precache_resolution; - int x,y,z; - float bbmin[3], bbmax[3], dim[3]; + sample_co[0] = ((co[0] - bbmin[0]) / dim[0]); + sample_co[1] = ((co[1] - bbmin[1]) / dim[1]); + sample_co[2] = ((co[2] - bbmin[2]) / dim[2]); - if (!shi->obi->volume_precache) return; - - VECCOPY(bbmin, shi->obi->obr->boundbox[0]); - VECCOPY(bbmax, shi->obi->obr->boundbox[1]); - VecSubf(dim, bbmax, bbmin); - - x = (int)(((co[0] - bbmin[0]) / dim[0]) * res); - y = (int)(((co[1] - bbmin[1]) / dim[1]) * res); - z = (int)(((co[2] - bbmin[2]) / dim[2]) * res); - - scatter_col[0] = shi->obi->volume_precache[0*res*res*res + x*res*res + y*res + z]; - scatter_col[1] = shi->obi->volume_precache[1*res*res*res + x*res*res + y*res + z]; - scatter_col[2] = shi->obi->volume_precache[2*res*res*res + x*res*res + y*res + z]; + scatter_col[0] = voxel_sample_trilinear(vp->data_r, vp->res, sample_co); + scatter_col[1] = voxel_sample_trilinear(vp->data_g, vp->res, sample_co); + scatter_col[2] = voxel_sample_trilinear(vp->data_b, vp->res, sample_co); } float vol_get_density(struct ShadeInput *shi, float *co) diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c index f0816cfddff..241b11e04b9 100644 --- a/source/blender/render/intern/source/voxeldata.c +++ b/source/blender/render/intern/source/voxeldata.c @@ -34,8 +34,13 @@ #include "BLI_arithb.h" #include "BLI_blenlib.h" +#include "BLI_voxel.h" + +#include "IMB_imbuf.h" +#include "IMB_imbuf_types.h" #include "BKE_global.h" +#include "BKE_image.h" #include "BKE_main.h" #include "DNA_texture_types.h" @@ -44,290 +49,81 @@ #include "texture.h" #include "voxeldata.h" -#if defined( _MSC_VER ) && !defined( __cplusplus ) -# define inline __inline -#endif // defined( _MSC_VER ) && !defined( __cplusplus ) - -/*---------------------------Utils----------------------------------------*/ -inline int _I(int x, int y, int z, int *n) -{ - return (z*(n[1])+y)*(n[2])+x; -} - -float Linear(float xx, float yy, float zz, float *x0, int *n) -{ - float sx1,sx0,sy1,sy0,sz1,sz0,v0,v1; - int i0,i1,j0,j1,k0,k1; - - if (xx<0.5) xx=0.5f; if (xx>n[0]+0.5) xx=n[0]+0.5f; i0=(int)xx; i1=i0+1; - if (yy<0.5) yy=0.5f; if (yy>n[1]+0.5) yy=n[1]+0.5f; j0=(int)yy; j1=j0+1; - if (zz<0.5) zz=0.5f; if (zz>n[2]+0.5) zz=n[2]+0.5f; k0=(int)zz; k1=k0+1; - - sx1 = xx-i0; sx0 = 1-sx1; - sy1 = yy-j0; sy0 = 1-sy1; - sz1 = zz-k0; sz0 = 1-sz1; - v0 = sx0*(sy0*x0[_I(i0,j0,k0,n)]+sy1*x0[_I(i0,j1,k0,n)])+sx1*(sy0*x0[_I(i1,j0,k0,n)]+sy1*x0[_I(i1,j1,k0,n)]); - v1 = sx0*(sy0*x0[_I(i0,j0,k1,n)]+sy1*x0[_I(i0,j1,k1,n)])+sx1*(sy0*x0[_I(i1,j0,k1,n)]+sy1*x0[_I(i1,j1,k1,n)]); - return sz0*v0 + sz1*v1; -} - - -static 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[ _I(x, y, z, res) ]; -} - -static inline float lerp(float t, float v1, float v2) { - return (1.f - t) * v1 + t * v2; -} - -/* trilinear interpolation */ -static float 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; -} - - -int C[64][64] = { - { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {-3, 3, 0, 0, 0, 0, 0, 0,-2,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 2,-2, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 9,-9,-9, 9, 0, 0, 0, 0, 6, 3,-6,-3, 0, 0, 0, 0, 6,-6, 3,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {-6, 6, 6,-6, 0, 0, 0, 0,-3,-3, 3, 3, 0, 0, 0, 0,-4, 4,-2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-2,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 2, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {-6, 6, 6,-6, 0, 0, 0, 0,-4,-2, 4, 2, 0, 0, 0, 0,-3, 3,-3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-1,-2,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 4,-4,-4, 4, 0, 0, 0, 0, 2, 2,-2,-2, 0, 0, 0, 0, 2,-2, 2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 3, 0, 0, 0, 0, 0, 0,-2,-1, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,-2, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9,-9,-9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 3,-6,-3, 0, 0, 0, 0, 6,-6, 3,-3, 0, 0, 0, 0, 4, 2, 2, 1, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-6, 6, 6,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3,-3, 3, 3, 0, 0, 0, 0,-4, 4,-2, 2, 0, 0, 0, 0,-2,-2,-1,-1, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-6, 6, 6,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4,-2, 4, 2, 0, 0, 0, 0,-3, 3,-3, 3, 0, 0, 0, 0,-2,-1,-2,-1, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4,-4,-4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2,-2,-2, 0, 0, 0, 0, 2,-2, 2,-2, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0}, - {-3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0, 0, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0, 0, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 9,-9, 0, 0,-9, 9, 0, 0, 6, 3, 0, 0,-6,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,-6, 0, 0, 3,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 2, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {-6, 6, 0, 0, 6,-6, 0, 0,-3,-3, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4, 4, 0, 0,-2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-2, 0, 0,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0, 0, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0, 0, 0,-1, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9,-9, 0, 0,-9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 3, 0, 0,-6,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,-6, 0, 0, 3,-3, 0, 0, 4, 2, 0, 0, 2, 1, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-6, 6, 0, 0, 6,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3,-3, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4, 4, 0, 0,-2, 2, 0, 0,-2,-2, 0, 0,-1,-1, 0, 0}, - { 9, 0,-9, 0,-9, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 3, 0,-6, 0,-3, 0, 6, 0,-6, 0, 3, 0,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 2, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 9, 0,-9, 0,-9, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 3, 0,-6, 0,-3, 0, 6, 0,-6, 0, 3, 0,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 2, 0, 2, 0, 1, 0}, - {-27,27,27,-27,27,-27,-27,27,-18,-9,18, 9,18, 9,-18,-9,-18,18,-9, 9,18,-18, 9,-9,-18,18,18,-18,-9, 9, 9,-9,-12,-6,-6,-3,12, 6, 6, 3,-12,-6,12, 6,-6,-3, 6, 3,-12,12,-6, 6,-6, 6,-3, 3,-8,-4,-4,-2,-4,-2,-2,-1}, - {18,-18,-18,18,-18,18,18,-18, 9, 9,-9,-9,-9,-9, 9, 9,12,-12, 6,-6,-12,12,-6, 6,12,-12,-12,12, 6,-6,-6, 6, 6, 6, 3, 3,-6,-6,-3,-3, 6, 6,-6,-6, 3, 3,-3,-3, 8,-8, 4,-4, 4,-4, 2,-2, 4, 4, 2, 2, 2, 2, 1, 1}, - {-6, 0, 6, 0, 6, 0,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0,-3, 0, 3, 0, 3, 0,-4, 0, 4, 0,-2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-2, 0,-1, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0,-6, 0, 6, 0, 6, 0,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0,-3, 0, 3, 0, 3, 0,-4, 0, 4, 0,-2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-2, 0,-1, 0,-1, 0}, - {18,-18,-18,18,-18,18,18,-18,12, 6,-12,-6,-12,-6,12, 6, 9,-9, 9,-9,-9, 9,-9, 9,12,-12,-12,12, 6,-6,-6, 6, 6, 3, 6, 3,-6,-3,-6,-3, 8, 4,-8,-4, 4, 2,-4,-2, 6,-6, 6,-6, 3,-3, 3,-3, 4, 2, 4, 2, 2, 1, 2, 1}, - {-12,12,12,-12,12,-12,-12,12,-6,-6, 6, 6, 6, 6,-6,-6,-6, 6,-6, 6, 6,-6, 6,-6,-8, 8, 8,-8,-4, 4, 4,-4,-3,-3,-3,-3, 3, 3, 3, 3,-4,-4, 4, 4,-2,-2, 2, 2,-4, 4,-4, 4,-2, 2,-2, 2,-2,-2,-2,-2,-1,-1,-1,-1}, - { 2, 0, 0, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {-6, 6, 0, 0, 6,-6, 0, 0,-4,-2, 0, 0, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 3, 0, 0,-3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-1, 0, 0,-2,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 4,-4, 0, 0,-4, 4, 0, 0, 2, 2, 0, 0,-2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,-2, 0, 0, 2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-6, 6, 0, 0, 6,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4,-2, 0, 0, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 3, 0, 0,-3, 3, 0, 0,-2,-1, 0, 0,-2,-1, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4,-4, 0, 0,-4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0,-2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,-2, 0, 0, 2,-2, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0}, - {-6, 0, 6, 0, 6, 0,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4, 0,-2, 0, 4, 0, 2, 0,-3, 0, 3, 0,-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0,-2, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0,-6, 0, 6, 0, 6, 0,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4, 0,-2, 0, 4, 0, 2, 0,-3, 0, 3, 0,-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0,-2, 0,-1, 0}, - {18,-18,-18,18,-18,18,18,-18,12, 6,-12,-6,-12,-6,12, 6,12,-12, 6,-6,-12,12,-6, 6, 9,-9,-9, 9, 9,-9,-9, 9, 8, 4, 4, 2,-8,-4,-4,-2, 6, 3,-6,-3, 6, 3,-6,-3, 6,-6, 3,-3, 6,-6, 3,-3, 4, 2, 2, 1, 4, 2, 2, 1}, - {-12,12,12,-12,12,-12,-12,12,-6,-6, 6, 6, 6, 6,-6,-6,-8, 8,-4, 4, 8,-8, 4,-4,-6, 6, 6,-6,-6, 6, 6,-6,-4,-4,-2,-2, 4, 4, 2, 2,-3,-3, 3, 3,-3,-3, 3, 3,-4, 4,-2, 2,-4, 4,-2, 2,-2,-2,-1,-1,-2,-2,-1,-1}, - { 4, 0,-4, 0,-4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0,-2, 0,-2, 0, 2, 0,-2, 0, 2, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 4, 0,-4, 0,-4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0,-2, 0,-2, 0, 2, 0,-2, 0, 2, 0,-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}}; - -int ijk2n(int i, int j, int k) { - return(i+4*j+16*k); -} - -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]; - } - } -} - -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; - } -} - - -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); -} - -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); -} - - -float tricubic(float xx, float yy, float zz, float *heap, int *n) -{ - - int xi,yi,zi; - float dx,dy,dz; - float a[64]; - - if (xx<0.5) xx=0.5f; if (xx>n[0]+0.5) xx=n[0]+0.5f; xi=(int)xx; - if (yy<0.5) yy=0.5f; if (yy>n[1]+0.5) yy=n[1]+0.5f; yi=(int)yy; - if (zz<0.5) zz=0.5f; if (zz>n[2]+0.5) zz=n[2]+0.5f; zi=(int)zz; - - { - float fval[8]={heap[_I(xi,yi,zi,n)],heap[_I(xi+1,yi,zi,n)],heap[_I(xi,yi+1,zi,n)],heap[_I(xi+1,yi+1,zi,n)],heap[_I(xi,yi,zi+1,n)],heap[_I(xi+1,yi,zi+1,n)],heap[_I(xi,yi+1,zi+1,n)],heap[_I(xi+1,yi+1,zi+1,n)]}; - - float dfdxval[8]={0.5f*(heap[_I(xi+1,yi,zi,n)]-heap[_I(xi-1,yi,zi,n)]),0.5f*(heap[_I(xi+2,yi,zi,n)]-heap[_I(xi,yi,zi,n)]), - 0.5f*(heap[_I(xi+1,yi+1,zi,n)]-heap[_I(xi-1,yi+1,zi,n)]),0.5f*(heap[_I(xi+2,yi+1,zi,n)]-heap[_I(xi,yi+1,zi,n)]), - 0.5f*(heap[_I(xi+1,yi,zi+1,n)]-heap[_I(xi-1,yi,zi+1,n)]),0.5f*(heap[_I(xi+2,yi,zi+1,n)]-heap[_I(xi,yi,zi+1,n)]), - 0.5f*(heap[_I(xi+1,yi+1,zi+1,n)]-heap[_I(xi-1,yi+1,zi+1,n)]), - 0.5f*(heap[_I(xi+2,yi+1,zi+1,n)]-heap[_I(xi,yi+1,zi+1,n)])}; - - float dfdyval[8]={0.5f*(heap[_I(xi,yi+1,zi,n)]-heap[_I(xi,yi-1,zi,n)]),0.5f*(heap[_I(xi+1,yi+1,zi,n)]-heap[_I(xi+1,yi-1,zi,n)]), - 0.5f*(heap[_I(xi,yi+2,zi,n)]-heap[_I(xi,yi,zi,n)]),0.5f*(heap[_I(xi+1,yi+2,zi,n)]-heap[_I(xi+1,yi,zi,n)]), - 0.5f*(heap[_I(xi,yi+1,zi+1,n)]-heap[_I(xi,yi-1,zi+1,n)]),0.5f*(heap[_I(xi+1,yi+1,zi+1,n)]-heap[_I(xi+1,yi-1,zi+1,n)]), - 0.5f*(heap[_I(xi,yi+2,zi+1,n)]-heap[_I(xi,yi,zi+1,n)]), - 0.5f*(heap[_I(xi+1,yi+2,zi+1,n)]-heap[_I(xi+1,yi,zi+1,n)])}; - - float dfdzval[8]={0.5f*(heap[_I(xi,yi,zi+1,n)]-heap[_I(xi,yi,zi-1,n)]),0.5f*(heap[_I(xi+1,yi,zi+1,n)]-heap[_I(xi+1,yi,zi-1,n)]), - 0.5f*(heap[_I(xi,yi+1,zi+1,n)]-heap[_I(xi,yi+1,zi-1,n)]),0.5f*(heap[_I(xi+1,yi+1,zi+1,n)]-heap[_I(xi+1,yi+1,zi-1,n)]), - 0.5f*(heap[_I(xi,yi,zi+2,n)]-heap[_I(xi,yi,zi,n)]),0.5f*(heap[_I(xi+1,yi,zi+2,n)]-heap[_I(xi+1,yi,zi,n)]), - 0.5f*(heap[_I(xi,yi+1,zi+2,n)]-heap[_I(xi,yi+1,zi,n)]), - 0.5f*(heap[_I(xi+1,yi+1,zi+2,n)]-heap[_I(xi+1,yi+1,zi,n)])}; - - float d2fdxdyval[8]={0.25*(heap[_I(xi+1,yi+1,zi,n)]-heap[_I(xi-1,yi+1,zi,n)]-heap[_I(xi+1,yi-1,zi,n)]+heap[_I(xi-1,yi-1,zi,n)]), - 0.25*(heap[_I(xi+2,yi+1,zi,n)]-heap[_I(xi,yi+1,zi,n)]-heap[_I(xi+2,yi-1,zi,n)]+heap[_I(xi,yi-1,zi,n)]), - 0.25*(heap[_I(xi+1,yi+2,zi,n)]-heap[_I(xi-1,yi+2,zi,n)]-heap[_I(xi+1,yi,zi,n)]+heap[_I(xi-1,yi,zi,n)]), - 0.25*(heap[_I(xi+2,yi+2,zi,n)]-heap[_I(xi,yi+2,zi,n)]-heap[_I(xi+2,yi,zi,n)]+heap[_I(xi,yi,zi,n)]), - 0.25*(heap[_I(xi+1,yi+1,zi+1,n)]-heap[_I(xi-1,yi+1,zi+1,n)]-heap[_I(xi+1,yi-1,zi+1,n)]+heap[_I(xi-1,yi-1,zi+1,n)]), - 0.25*(heap[_I(xi+2,yi+1,zi+1,n)]-heap[_I(xi,yi+1,zi+1,n)]-heap[_I(xi+2,yi-1,zi+1,n)]+heap[_I(xi,yi-1,zi+1,n)]), - 0.25*(heap[_I(xi+1,yi+2,zi+1,n)]-heap[_I(xi-1,yi+2,zi+1,n)]-heap[_I(xi+1,yi,zi+1,n)]+heap[_I(xi-1,yi,zi+1,n)]), - 0.25*(heap[_I(xi+2,yi+2,zi+1,n)]-heap[_I(xi,yi+2,zi+1,n)]-heap[_I(xi+2,yi,zi+1,n)]+heap[_I(xi,yi,zi+1,n)])}; - - float d2fdxdzval[8]={0.25f*(heap[_I(xi+1,yi,zi+1,n)]-heap[_I(xi-1,yi,zi+1,n)]-heap[_I(xi+1,yi,zi-1,n)]+heap[_I(xi-1,yi,zi-1,n)]), - 0.25f*(heap[_I(xi+2,yi,zi+1,n)]-heap[_I(xi,yi,zi+1,n)]-heap[_I(xi+2,yi,zi-1,n)]+heap[_I(xi,yi,zi-1,n)]), - 0.25f*(heap[_I(xi+1,yi+1,zi+1,n)]-heap[_I(xi-1,yi+1,zi+1,n)]-heap[_I(xi+1,yi+1,zi-1,n)]+heap[_I(xi-1,yi+1,zi-1,n)]), - 0.25f*(heap[_I(xi+2,yi+1,zi+1,n)]-heap[_I(xi,yi+1,zi+1,n)]-heap[_I(xi+2,yi+1,zi-1,n)]+heap[_I(xi,yi+1,zi-1,n)]), - 0.25f*(heap[_I(xi+1,yi,zi+2,n)]-heap[_I(xi-1,yi,zi+2,n)]-heap[_I(xi+1,yi,zi,n)]+heap[_I(xi-1,yi,zi,n)]), - 0.25f*(heap[_I(xi+2,yi,zi+2,n)]-heap[_I(xi,yi,zi+2,n)]-heap[_I(xi+2,yi,zi,n)]+heap[_I(xi,yi,zi,n)]), - 0.25f*(heap[_I(xi+1,yi+1,zi+2,n)]-heap[_I(xi-1,yi+1,zi+2,n)]-heap[_I(xi+1,yi+1,zi,n)]+heap[_I(xi-1,yi+1,zi,n)]), - 0.25f*(heap[_I(xi+2,yi+1,zi+2,n)]-heap[_I(xi,yi+1,zi+2,n)]-heap[_I(xi+2,yi+1,zi,n)]+heap[_I(xi,yi+1,zi,n)])}; - - - float d2fdydzval[8]={0.25f*(heap[_I(xi,yi+1,zi+1,n)]-heap[_I(xi,yi-1,zi+1,n)]-heap[_I(xi,yi+1,zi-1,n)]+heap[_I(xi,yi-1,zi-1,n)]), - 0.25f*(heap[_I(xi+1,yi+1,zi+1,n)]-heap[_I(xi+1,yi-1,zi+1,n)]-heap[_I(xi+1,yi+1,zi-1,n)]+heap[_I(xi+1,yi-1,zi-1,n)]), - 0.25f*(heap[_I(xi,yi+2,zi+1,n)]-heap[_I(xi,yi,zi+1,n)]-heap[_I(xi,yi+2,zi-1,n)]+heap[_I(xi,yi,zi-1,n)]), - 0.25f*(heap[_I(xi+1,yi+2,zi+1,n)]-heap[_I(xi+1,yi,zi+1,n)]-heap[_I(xi+1,yi+2,zi-1,n)]+heap[_I(xi+1,yi,zi-1,n)]), - 0.25f*(heap[_I(xi,yi+1,zi+2,n)]-heap[_I(xi,yi-1,zi+2,n)]-heap[_I(xi,yi+1,zi,n)]+heap[_I(xi,yi-1,zi,n)]), - 0.25f*(heap[_I(xi+1,yi+1,zi+2,n)]-heap[_I(xi+1,yi-1,zi+2,n)]-heap[_I(xi+1,yi+1,zi,n)]+heap[_I(xi+1,yi-1,zi,n)]), - 0.25f*(heap[_I(xi,yi+2,zi+2,n)]-heap[_I(xi,yi,zi+2,n)]-heap[_I(xi,yi+2,zi,n)]+heap[_I(xi,yi,zi,n)]), - 0.25f*(heap[_I(xi+1,yi+2,zi+2,n)]-heap[_I(xi+1,yi,zi+2,n)]-heap[_I(xi+1,yi+2,zi,n)]+heap[_I(xi+1,yi,zi,n)])}; - - - float d3fdxdydzval[8]={0.125f*(heap[_I(xi+1,yi+1,zi+1,n)]-heap[_I(xi-1,yi+1,zi+1,n)]-heap[_I(xi+1,yi-1,zi+1,n)]+heap[_I(xi-1,yi-1,zi+1,n)]-heap[_I(xi+1,yi+1,zi-1,n)]+heap[_I(xi-1,yi+1,zi-1,n)]+heap[_I(xi+1,yi-1,zi-1,n)]-heap[_I(xi-1,yi-1,zi-1,n)]), - 0.125f*(heap[_I(xi+2,yi+1,zi+1,n)]-heap[_I(xi,yi+1,zi+1,n)]-heap[_I(xi+2,yi-1,zi+1,n)]+heap[_I(xi,yi-1,zi+1,n)]-heap[_I(xi+2,yi+1,zi-1,n)]+heap[_I(xi,yi+1,zi-1,n)]+heap[_I(xi+2,yi-1,zi-1,n)]-heap[_I(xi,yi-1,zi-1,n)]), - 0.125f*(heap[_I(xi+1,yi+2,zi+1,n)]-heap[_I(xi-1,yi+2,zi+1,n)]-heap[_I(xi+1,yi,zi+1,n)]+heap[_I(xi-1,yi,zi+1,n)]-heap[_I(xi+1,yi+2,zi-1,n)]+heap[_I(xi-1,yi+2,zi-1,n)]+heap[_I(xi+1,yi,zi-1,n)]-heap[_I(xi-1,yi,zi-1,n)]), - 0.125f*(heap[_I(xi+2,yi+2,zi+1,n)]-heap[_I(xi,yi+2,zi+1,n)]-heap[_I(xi+2,yi,zi+1,n)]+heap[_I(xi,yi,zi+1,n)]-heap[_I(xi+2,yi+2,zi-1,n)]+heap[_I(xi,yi+2,zi-1,n)]+heap[_I(xi+2,yi,zi-1,n)]-heap[_I(xi,yi,zi-1,n)]), - 0.125f*(heap[_I(xi+1,yi+1,zi+2,n)]-heap[_I(xi-1,yi+1,zi+2,n)]-heap[_I(xi+1,yi-1,zi+2,n)]+heap[_I(xi-1,yi-1,zi+2,n)]-heap[_I(xi+1,yi+1,zi,n)]+heap[_I(xi-1,yi+1,zi,n)]+heap[_I(xi+1,yi-1,zi,n)]-heap[_I(xi-1,yi-1,zi,n)]), - 0.125f*(heap[_I(xi+2,yi+1,zi+2,n)]-heap[_I(xi,yi+1,zi+2,n)]-heap[_I(xi+2,yi-1,zi+2,n)]+heap[_I(xi,yi-1,zi+2,n)]-heap[_I(xi+2,yi+1,zi,n)]+heap[_I(xi,yi+1,zi,n)]+heap[_I(xi+2,yi-1,zi,n)]-heap[_I(xi,yi-1,zi,n)]), - 0.125f*(heap[_I(xi+1,yi+2,zi+2,n)]-heap[_I(xi-1,yi+2,zi+2,n)]-heap[_I(xi+1,yi,zi+2,n)]+heap[_I(xi-1,yi,zi+2,n)]-heap[_I(xi+1,yi+2,zi,n)]+heap[_I(xi-1,yi+2,zi,n)]+heap[_I(xi+1,yi,zi,n)]-heap[_I(xi-1,yi,zi,n)]), - 0.125f*(heap[_I(xi+2,yi+2,zi+2,n)]-heap[_I(xi,yi+2,zi+2,n)]-heap[_I(xi+2,yi,zi+2,n)]+heap[_I(xi,yi,zi+2,n)]-heap[_I(xi+2,yi+2,zi,n)]+heap[_I(xi,yi+2,zi,n)]+heap[_I(xi+2,yi,zi,n)]-heap[_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); - -} - -void load_frame (FILE *fp, float *F, int size, int frame, int offset) +void load_frame_blendervoxel(FILE *fp, float *F, int size, int frame, int offset) { fseek(fp,frame*size*sizeof(float)+offset,0); fread(F,sizeof(float),size,fp); } +void load_frame_raw8(FILE *fp, float *F, int size, int frame) +{ + char *tmp; + int i; + + tmp = (char *)MEM_mallocN(sizeof(char)*size, "temporary voxel file reading storage"); + + fseek(fp,(frame-1)*size*sizeof(char),0); + fread(tmp, sizeof(char), size, fp); + + for (i=0; iima; + ImageUser *iuser = &tex->iuser; + int x=0, y=0, z=0; + float r, g, b; + float *rf; + + if (!ima || !iuser) return; + + ima->source = IMA_SRC_SEQUENCE; + iuser->framenr = 1 + iuser->offset; + + /* find the first valid ibuf and use it to initialise the resolution of the data set */ + /* need to do this in advance so we know how much memory to allocate */ + ibuf= BKE_image_get_ibuf(ima, iuser); + while (!ibuf && (iuser->framenr < iuser->frames)) { + iuser->framenr++; + ibuf= BKE_image_get_ibuf(ima, iuser); + } + if (!ibuf) return; + if (!ibuf->rect_float) IMB_float_from_rect(ibuf); + + vd->still = 1; + vd->resolX = ibuf->x; + vd->resolY = ibuf->y; + vd->resolZ = iuser->frames; + vd->dataset = MEM_mapallocN(sizeof(float)*(vd->resolX)*(vd->resolY)*(vd->resolZ), "voxel dataset"); + + for (z=0; z < iuser->frames; z++) + { + /* get a new ibuf for each frame */ + if (z > 0) { + iuser->framenr++; + ibuf= BKE_image_get_ibuf(ima, iuser); + if (!ibuf) break; + if (!ibuf->rect_float) IMB_float_from_rect(ibuf); + } + rf = ibuf->rect_float; + + for (y=0; y < ibuf->y; y++) + { + for (x=0; x < ibuf->x; x++) + { + /* currently converted to monchrome */ + vd->dataset[ V_I(x, y, z, &vd->resolX) ] = (rf[0] + rf[1] + rf[2])*0.333f; + rf +=4; + } + } + } +} + void write_voxeldata_header(struct VoxelDataHeader *h, FILE *fp) { fwrite(h,sizeof(struct VoxelDataHeader),1,fp); @@ -352,20 +148,37 @@ void cache_voxeldata(struct Render *re,Tex *tex) VoxelData *vd = tex->vd; FILE *fp; int size; + int curframe; if (!vd) return; + /* image sequence gets special treatment */ + if (vd->file_format == TEX_VD_IMAGE_SEQUENCE) { + load_frame_image_sequence(re, vd, tex); + return; + } + if (!BLI_exists(vd->source_path)) return; fp = fopen(vd->source_path,"rb"); if (!fp) return; + + if (vd->file_format == TEX_VD_BLENDERVOXEL) + read_voxeldata_header(fp, vd); - read_voxeldata_header(fp, vd); size = (vd->resolX)*(vd->resolY)*(vd->resolZ); - vd->dataset = MEM_mallocN(sizeof(float)*size, "voxel dataset"); + vd->dataset = MEM_mapallocN(sizeof(float)*size, "voxel dataset"); + + if (vd->still) curframe = vd->still_frame; + else curframe = re->r.cfra; - //here improve the dataset loading function for more dataset types - if (vd->still) load_frame(fp, vd->dataset, size, vd->still_frame, sizeof(VoxelDataHeader)); - else load_frame(fp, vd->dataset, size, re->r.cfra, sizeof(VoxelDataHeader)); + switch(vd->file_format) { + case TEX_VD_BLENDERVOXEL: + load_frame_blendervoxel(fp, vd->dataset, size, curframe-1, sizeof(VoxelDataHeader)); + break; + case TEX_VD_RAW_8BIT: + load_frame_raw8(fp, vd->dataset, size, curframe); + break; + } fclose(fp); } @@ -380,6 +193,7 @@ void make_voxeldata(struct Render *re) re->i.infostr= "Loading voxel datasets"; re->stats_draw(&re->i); + /* XXX: should be doing only textures used in this render */ for (tex= G.main->tex.first; tex; tex= tex->id.next) { if(tex->id.us && tex->type==TEX_VOXELDATA) { cache_voxeldata(re, tex); @@ -420,69 +234,59 @@ int voxeldatatex(struct Tex *tex, float *texvec, struct TexResult *texres) { int retval = TEX_INT; VoxelData *vd = tex->vd; - float vec[3] = {0.0, 0.0, 0.0}; - float co[3]; - float dx, dy, dz; - int xi, yi, zi; - float xf, yf, zf; - int i=0, fail=0; - int resol[3]; - + float co[3], offset[3] = {0.5, 0.5, 0.5}; + if ((!vd) || (vd->dataset==NULL)) { texres->tin = 0.0f; return 0; } - resol[0] = vd->resolX; - resol[1] = vd->resolY; - resol[2] = vd->resolZ; - - VECCOPY(co, texvec); - - dx=1.0f/(resol[0]); - dy=1.0f/(resol[1]); - dz=1.0f/(resol[2]); - - xi=co[0]/dx; - yi=co[1]/dy; - zi=co[2]/dz; - - xf=co[0]/dx; - yf=co[1]/dy; - zf=co[2]/dz; - - if (xi>1 && xi1 && yi1 && ziinterp_type) - { - case TEX_VD_NEARESTNEIGHBOR: - { - texres->tin = vd->dataset[_I(xi,yi,zi,resol)]; - break; - } - case TEX_VD_LINEAR: - { - texres->tin = trilinear(vd->dataset, resol, co); - break; - } - case TEX_VD_TRICUBIC: - { - texres->tin = tricubic(xf, yf, zf, vd->dataset, resol); - break; - } - } - } else fail++; - } else fail++; - } else fail++; - - if (fail) texres->tin=0.0f; + /* scale lookup from 0.0-1.0 (original location) to -1.0, 1.0, consistent with image texture tex coords */ + /* in implementation this works backwards, bringing sample locations from -1.0, 1.0 + * to the range 0.0, 1.0, before looking up in the voxel structure. */ + VecCopyf(co, texvec); + VecMulf(co, 0.5f); + VecAddf(co, co, offset); - texres->tin *= vd->int_multiplier; + /* co is now in the range 0.0, 1.0 */ + switch (tex->extend) { + case TEX_CLIP: + { + if ((co[0] < 0.f || co[0] > 1.f) || (co[1] < 0.f || co[1] > 1.f) || (co[2] < 0.f || co[2] > 1.f)) { + texres->tin = 0.f; + return retval; + } + break; + } + case TEX_REPEAT: + { + co[0] = co[0] - floor(co[0]); + co[1] = co[1] - floor(co[1]); + co[2] = co[2] - floor(co[2]); + break; + } + case TEX_EXTEND: + { + CLAMP(co[0], 0.f, 1.f); + CLAMP(co[1], 0.f, 1.f); + CLAMP(co[2], 0.f, 1.f); + break; + } + } + switch (vd->interp_type) { + case TEX_VD_NEARESTNEIGHBOR: + texres->tin = voxel_sample_nearest(vd->dataset, &vd->resolX, co); + break; + case TEX_VD_LINEAR: + texres->tin = voxel_sample_trilinear(vd->dataset, &vd->resolX, co); + break; + case TEX_VD_TRICUBIC: + texres->tin = voxel_sample_tricubic(vd->dataset, &vd->resolX, co); + break; + } + + texres->tin *= vd->int_multiplier; BRICONT; texres->tr = texres->tin; diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index f74afde5e81..54fc639059d 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -1053,67 +1053,7 @@ static void texture_panel_pointdensity_modify(Tex *tex) } -static void texture_panel_voxeldata(Tex *tex) -{ - uiBlock *block; - VoxelData *vd; - short yco=PANEL_YMAX; - block= uiNewBlock(&curarea->uiblocks, "texture_panel_voxeldata", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Voxel Data", "Texture", PANELX, PANELY, PANELW, PANELH+YSPACE)==0) return; - uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE); - - if(tex->vd==NULL) { - tex->vd= BKE_add_voxeldata(); - } - - if(tex->vd) { - vd= tex->vd; - - uiDefBut(block, LABEL, B_NOP, "Data source:", - X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); - - uiDefIconTextBut(block, BUT, B_VOXELDATA_LOAD, ICON_FILESEL, "Open", - X4CLM1, yco-=BUTH, BUTW4, BUTH, 0, 0, 0, 0, 0, ""); - uiDefBut(block, TEX, 0, "", - X4CLM2+XSPACE, yco, BUTW2+BUTW4+2*XSPACE, BUTH, &vd->source_path, 0.0, 79.0, 0, 0, "File path to the voxel data set"); - - yco -= YSPACE; - - uiDefBut(block, LABEL, B_NOP, "Interpolation:", - X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); - uiDefButI(block, MENU, B_REDR, "None %x0|Linear %x1|Tricubic %x2", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &vd->interp_type, 0.0, 0.0, 0, 0, "Interpolation type"); - - yco -= YSPACE; - - uiDefButF(block, NUM, B_REDR, "Intensity: ", - X2CLM1, yco-=BUTH, BUTW2, BUTH, &(vd->int_multiplier), 0.0001, 10000.0, 0, 0, "Multiplier to scale up or down the texture's intensity"); - - yco = PANEL_YMAX - 2*BUTH - 2*YSPACE; - - uiDefBut(block, LABEL, B_NOP, "Resolution:", - X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); - uiBlockBeginAlign(block); - uiDefButI(block, NUM, B_REDR, "X: ", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(vd->resolX), 1, 10000, 0, 0, "Resolution of the voxel data"); - uiDefButI(block, NUM, B_REDR, "Y: ", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(vd->resolY), 1, 10000, 0, 0, "Resolution of the voxel data"); - uiDefButI(block, NUM, B_REDR, "Z: ", - X2CLM2, yco-= BUTH, BUTW2, BUTH, &(vd->resolZ), 1, 10000, 0, 0, "Resolution of the voxel data"); - uiBlockEndAlign(block); - - yco -= YSPACE; - - uiBlockBeginAlign(block); - uiDefButI(block,TOG, B_REDR, "Still", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(vd->still), 0,1, 0, 0, "Use a still frame from the data sequence for the entire rendered animation"); - if (vd->still) uiDefButI(block, NUM, B_REDR, "Frame: ", - X2CLM2, yco-=BUTH, BUTW2, BUTH, &(vd->still_frame), 1, 10000, 0, 0, "The frame to pause on for the entire rendered animation"); - uiBlockEndAlign(block); - - } -} static char *layer_menu(RenderResult *rr, short *curlay) { @@ -1791,6 +1731,144 @@ static void texture_panel_envmap(Tex *tex) } } +static void texture_panel_voxeldata(Tex *tex) +{ + uiBlock *block; + VoxelData *vd; + short yco=PANEL_YMAX; + + block= uiNewBlock(&curarea->uiblocks, "texture_panel_voxeldata", UI_EMBOSS, UI_HELV, curarea->win); + if(uiNewPanel(curarea, block, "Voxel Data", "Texture", PANELX, PANELY, PANELW, PANELH+BUTH+2*YSPACE)==0) return; + uiSetButLock(tex->id.lib!=0, ERROR_LIBDATA_MESSAGE); + + if(tex->vd==NULL) { + tex->vd= BKE_add_voxeldata(); + } + + if(tex->vd) { + vd= tex->vd; + + uiDefBut(block, LABEL, B_NOP, "Data source:", + X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + + if (vd->file_format != TEX_VD_IMAGE_SEQUENCE) { + uiDefIconTextBut(block, BUT, B_VOXELDATA_LOAD, ICON_FILESEL, "Open", + X4CLM1, yco-=BUTH, BUTW4, BUTH, 0, 0, 0, 0, 0, ""); + uiDefBut(block, TEX, 0, "", + X4CLM2+XSPACE, yco, BUTW2+BUTW4+2*XSPACE, BUTH, &vd->source_path, 0.0, 79.0, 0, 0, "File path to the voxel data set"); + } + else { + char *strp; + char str[128]; + ImageUser *iuser = &(tex->iuser); + uiBut *but; + + /* Browse */ + IMAnames_to_pupstring(&strp, NULL, NULL, &(G.main->image), NULL, &iuser->menunr); + + uiBlockBeginAlign(block); + but= uiDefButS(block, MENU, B_REDR, strp, + X2CLM1, yco-=BUTH, ICONBUTW, BUTH, &iuser->menunr, 0, 0, 0, 0, "Selects an existing Image or Movie"); + uiButSetFunc(but, image_browse_cb, &(tex->ima), iuser); + + MEM_freeN(strp); + + if (tex->ima) { + uiSetButLock(tex->ima->id.lib!=NULL, ERROR_LIBDATA_MESSAGE); + but= uiDefIconBut(block, BUT, B_REDR, ICON_FILESEL, + X2CLM1+ICONBUTW, yco, X2CLM1+ICONBUTW, BUTH, 0, 0, 0, 0, 0, "Open Fileselect to load new Image"); + uiButSetFunc(but, image_load_fs_cb, &(tex->ima), iuser); + + but= uiDefBut(block, TEX, B_IDNAME, "IM:", + X2CLM1+2*ICONBUTW, yco, PANEL_XMAX-4*ICONBUTW-BUTW4, BUTH, tex->ima->id.name+2, 0.0, 21.0, 0, 0, "Current Image Datablock name."); + uiButSetFunc(but, test_idbutton_cb, tex->ima->id.name, NULL); + + but= uiDefBut(block, BUT, B_REDR, "Reload", + PANEL_XMAX-2*ICONBUTW-BUTW4, yco, BUTW4, BUTH, NULL, 0, 0, 0, 0, "Reloads Image or Movie"); + uiButSetFunc(but, image_reload_cb, &(tex->ima), iuser); + + but= uiDefIconBut(block, BUT, B_REDR, ICON_X, + PANEL_XMAX-2*ICONBUTW, yco, ICONBUTW, BUTH, 0, 0, 0, 0, 0, "Unlink Image block"); + uiButSetFunc(but, image_unlink_cb, &(tex->ima), NULL); + + sprintf(str, "%d", tex->ima->id.us); + uiDefBut(block, BUT, B_NOP, str, + PANEL_XMAX-ICONBUTW, yco, ICONBUTW, BUTH, 0, 0, 0, 0, 0, "Only displays number of users of Image block"); + uiBlockEndAlign(block); + + yco -= (BUTH); + + uiBlockBeginAlign(block); + uiDefButI(block, NUM, B_NOP, "Slices:", + X2CLM1, yco, BUTW2, BUTH, &iuser->frames, 1.0, MAXFRAMEF, 0, 0, "Number of images in the sequence"); + uiDefButI(block, NUM, B_NOP, "Offset:", + X2CLM2, yco, BUTW2, BUTH, &iuser->offset, -MAXFRAMEF, MAXFRAMEF, 0, 0, "Offsets the file number to consider as the start of the sequence"); + uiBlockEndAlign(block); + + } else { + but= uiDefBut(block, BUT, B_REDR, "Load", + X2CLM1+ICONBUTW, yco, BUTW2-ICONBUTW, BUTH, NULL, 0, 0, 0, 0, "Load new Image"); + uiButSetFunc(but, image_load_fs_cb, &(tex->ima), iuser); + } + } + + yco -= YSPACE; + + uiDefBut(block, LABEL, B_NOP, "Interpolation:", + X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + uiDefButI(block, MENU, B_REDR, "None %x0|Linear %x1|Tricubic %x2", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &vd->interp_type, 0.0, 0.0, 0, 0, "Interpolation type"); + + yco -= YSPACE; + + uiDefBut(block, LABEL, B_NOP, "Extend:", + X2CLM1, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + uiDefButS(block, MENU, B_REDR, "Repeat %x3|Clip %x2|Extend %x1", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(tex->extend), 0.0, 0.0, 0, 0, "Extrapolation type"); + + yco -= YSPACE; + + uiDefButF(block, NUM, B_REDR, "Intensity: ", + X2CLM1, yco-=BUTH, BUTW2, BUTH, &(vd->int_multiplier), 0.0001, 10000.0, 0, 0, "Multiplier to scale up or down the texture's intensity"); + + yco = PANEL_YMAX - 2*BUTH - YSPACE; + if (vd->file_format == TEX_VD_IMAGE_SEQUENCE) yco -= BUTH; + + uiDefBut(block, LABEL, B_NOP, "File Format:", + X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + uiDefButS(block, MENU, B_REDR, "Blender Voxel %x0|Raw (8 bit) %x1|Image Sequence %x3", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &vd->file_format, 0.0, 0.0, 0, 0, "File format of the voxel data file"); + + if (ELEM(vd->file_format, TEX_VD_RAW_8BIT, TEX_VD_RAW_16BIT)) { + uiDefBut(block, LABEL, B_NOP, "Resolution:", + X2CLM2, yco-=BUTH, BUTW2, BUTH, 0, 0, 0, 0, 0, ""); + uiBlockBeginAlign(block); + uiDefButI(block, NUM, B_REDR, "X: ", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(vd->resolX), 1, 10000, 0, 0, "Resolution of the voxel data"); + uiDefButI(block, NUM, B_REDR, "Y: ", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(vd->resolY), 1, 10000, 0, 0, "Resolution of the voxel data"); + uiDefButI(block, NUM, B_REDR, "Z: ", + X2CLM2, yco-= BUTH, BUTW2, BUTH, &(vd->resolZ), 1, 10000, 0, 0, "Resolution of the voxel data"); + uiBlockEndAlign(block); + + yco -= YSPACE; + } + + if (vd->file_format == TEX_VD_BLENDERVOXEL) { + yco -= (BUTH+YSPACE); + uiBlockBeginAlign(block); + uiDefButI(block,TOG, B_REDR, "Still", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(vd->still), 0,1, 0, 0, "Use a still frame from the data sequence for the entire rendered animation"); + if (vd->still) + uiDefButI(block, NUM, B_REDR, "Frame: ", + X2CLM2, yco-=BUTH, BUTW2, BUTH, &(vd->still_frame), 1, 10000, 0, 0, "The frame to pause on for the entire rendered animation"); + uiBlockEndAlign(block); + } + + + } +} + static void texture_panel_colors(Tex *tex) { uiBlock *block; From d5e9eb7d76792ef019021d64a7229a82b10fdb62 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sun, 21 Jun 2009 22:17:06 +0000 Subject: [PATCH 087/577] * fix for small bug in volume texture stack --- source/blender/render/intern/source/texture.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index d1115e1d399..5df814358d5 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -1289,7 +1289,7 @@ static int multitex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, texres->tg= col[1]; texres->tb= col[2]; texres->ta= col[3]; - retval |= 1; + retval |= TEX_RGB; } } return retval; @@ -1636,8 +1636,11 @@ void do_volume_tex(ShadeInput *shi, float *xyz, int mapto_flag, float *col, floa tcol[0]=texres.tr; tcol[1]=texres.tg; tcol[2]=texres.tb; + if(texres.talpha) + texres.tin= texres.ta; } + /* used for emit */ if((mapto_flag & MAP_COL) && (mtex->mapto & MAP_COL)) { texture_rgb_blend(col, tcol, col, texres.tin, colfac, mtex->blendtype); } From 7da0d1a71efee9b360eb344e7bfaa9b5f0f4ece5 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Fri, 3 Jul 2009 11:03:09 +0000 Subject: [PATCH 088/577] * Fixed a crazy memory leak in voxel data image sequence data source --- source/blender/render/intern/source/voxeldata.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c index 241b11e04b9..8a1a8e0bbeb 100644 --- a/source/blender/render/intern/source/voxeldata.c +++ b/source/blender/render/intern/source/voxeldata.c @@ -121,6 +121,8 @@ void load_frame_image_sequence(Render *re, VoxelData *vd, Tex *tex) rf +=4; } } + + BKE_image_free_anim_ibufs(ima, iuser->framenr); } } From a8872d99a9ff638fe46ec264bfe9636855807f9e Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sat, 15 Aug 2009 07:49:56 +0000 Subject: [PATCH 089/577] * scons fixes for voxel data texture --- source/blender/render/SConscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/render/SConscript b/source/blender/render/SConscript index dbd9f65254b..db151775b96 100644 --- a/source/blender/render/SConscript +++ b/source/blender/render/SConscript @@ -6,7 +6,7 @@ sources = env.Glob('intern/source/*.c') incs = 'intern/include #/intern/guardedalloc ../blenlib ../makesdna ../makesrna' incs += ' extern/include ../blenkernel ../radiosity/extern/include ../imbuf' -incs += ' ../include ../blenloader' +incs += ' ../include ../blenloader ../../../intern/smoke/extern' defs = [] From f27bee3d2192000feeb6b7ae4a8abe23c072caef Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 15 Aug 2009 19:28:28 +0000 Subject: [PATCH 090/577] had support for single triangular brush commented when it works ok. thanks to j michaelson for pointing out. --- release/scripts/export_map.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/scripts/export_map.py b/release/scripts/export_map.py index aca02288c7a..2262ae3b89b 100644 --- a/release/scripts/export_map.py +++ b/release/scripts/export_map.py @@ -197,7 +197,7 @@ def is_tricyl_facegroup(faces): is the face group a tri cylinder Returens a bool, true if the faces make an extruded tri solid ''' - return False + # cube must have 5 faces if len(faces) != 5: print '1' From fe984a6e6ca9de9cb358fea0f4f3cf42742a1667 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sun, 16 Aug 2009 06:10:31 +0000 Subject: [PATCH 091/577] volume material * data reorganisation - uses own values now instead of reusing surface material properties (i.e. an individual density value, rather than reusing alpha) Files saved with the old system won't load up the same after this. * improved defaults and ui --- release/ui/buttons_material.py | 115 ++++++++++---- release/ui/buttons_texture.py | 68 +++++---- source/blender/blenkernel/intern/material.c | 13 +- source/blender/blenkernel/intern/texture.c | 6 +- source/blender/blenloader/intern/readfile.c | 13 +- source/blender/makesdna/DNA_material_types.h | 39 +++-- source/blender/makesrna/intern/rna_material.c | 107 +++++++++++-- source/blender/makesrna/intern/rna_texture.c | 4 +- source/blender/render/intern/source/texture.c | 26 +++- .../blender/render/intern/source/volumetric.c | 143 +++++++++--------- 10 files changed, 364 insertions(+), 170 deletions(-) diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py index 4c919f813e2..5b3ad34a09a 100644 --- a/release/ui/buttons_material.py +++ b/release/ui/buttons_material.py @@ -107,7 +107,7 @@ class MATERIAL_PT_strand(MaterialButtonsPanel): COMPAT_ENGINES = set(['BLENDER_RENDER']) def poll(self, context): - return context.material.type in ['SURFACE', 'WIRE', 'HALO'] + return context.material.type in ('SURFACE', 'WIRE', 'HALO') def draw(self, context): layout = self.layout @@ -165,7 +165,7 @@ class MATERIAL_PT_options(MaterialButtonsPanel): COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME']) def poll(self, context): - return (context.material.type in ['SURFACE', 'WIRE', 'HALO']) + return (context.material.type in ('SURFACE', 'WIRE', 'HALO')) def draw(self, context): layout = self.layout @@ -202,7 +202,7 @@ class MATERIAL_PT_shadows(MaterialButtonsPanel): COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME']) def poll(self, context): - return context.material.type in ['SURFACE', 'WIRE'] + return context.material.type in ('SURFACE', 'WIRE') def draw(self, context): layout = self.layout @@ -235,7 +235,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel): def poll(self, context): mat = context.material - return mat and (mat.type in ['SURFACE', 'WIRE']) and (context.scene.render_data.engine in self.COMPAT_ENGINES) + return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -289,7 +289,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel): def poll(self, context): mat = context.material - return mat and (mat.type in ['SURFACE', 'WIRE']) and (context.scene.render_data.engine in self.COMPAT_ENGINES) + return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -341,7 +341,7 @@ class MATERIAL_PT_sss(MaterialButtonsPanel): def poll(self, context): mat = context.material - return mat and (mat.type in ['SURFACE', 'WIRE']) and (context.scene.render_data.engine in self.COMPAT_ENGINES) + return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES) def draw_header(self, context): layout = self.layout @@ -383,7 +383,7 @@ class MATERIAL_PT_raymir(MaterialButtonsPanel): def poll(self, context): mat = context.material - return mat and (mat.type in ['SURFACE', 'WIRE']) and (context.scene.render_data.engine in self.COMPAT_ENGINES) + return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES) def draw_header(self, context): layout = self.layout @@ -435,7 +435,7 @@ class MATERIAL_PT_raytransp(MaterialButtonsPanel): def poll(self, context): mat = context.material - return mat and (mat.type in ['SURFACE', 'WIRE']) and (context.scene.render_data.engine in self.COMPAT_ENGINES) + return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES) def draw_header(self, context): layout = self.layout @@ -481,8 +481,40 @@ class MATERIAL_PT_raytransp(MaterialButtonsPanel): sub.itemR(rayt, "gloss_threshold", slider=True, text="Threshold") sub.itemR(rayt, "gloss_samples", text="Samples") -class MATERIAL_PT_volume(MaterialButtonsPanel): - __label__ = "Volume" +class MATERIAL_PT_volume_shading(MaterialButtonsPanel): + __label__ = "Shading" + __default_closed__ = False + COMPAT_ENGINES = set(['BLENDER_RENDER']) + + def poll(self, context): + return (context.material.type == 'VOLUME') and (context.scene.render_data.engine in self.COMPAT_ENGINES) + + def draw(self, context): + layout = self.layout + + mat = context.material + vol = context.material.volume + + split = layout.split() + + row = split.row() + row.itemR(vol, "density") + row.itemR(vol, "scattering") + + split = layout.split() + col = split.column() + col.itemR(vol, "absorption") + col.itemR(vol, "absorption_color", text="") + + + col = split.column() + col.itemR(vol, "emission") + col.itemR(vol, "emission_color", text="") + + + +class MATERIAL_PT_volume_scattering(MaterialButtonsPanel): + __label__ = "Scattering" __default_closed__ = False COMPAT_ENGINES = set(['BLENDER_RENDER']) @@ -498,40 +530,55 @@ class MATERIAL_PT_volume(MaterialButtonsPanel): split = layout.split() col = split.column() - col.itemR(vol, "step_calculation") - col.itemR(vol, "step_size") - col.itemR(vol, "shading_step_size") - - col.itemR(mat, "alpha", text="Density", slider=True) - - col.itemR(vol, "scattering_mode") - if vol.scattering_mode == 'SINGLE': + col.itemR(vol, "scattering_mode", text="") + if vol.scattering_mode == 'SINGLE_SCATTERING': col.itemR(vol, "light_cache") sub = col.column() sub.active = vol.light_cache + sub.itemR(vol, "cache_resolution") + elif vol.scattering_mode in ('MULTIPLE_SCATTERING', 'SINGLE_PLUS_MULTIPLE_SCATTERING'): col.itemR(vol, "cache_resolution") - elif vol.scattering_mode in ['MULTIPLE', 'SINGLE_PLUS_MULTIPLE']: - col.itemR(vol, "cache_resolution") + + col = col.column(align=True) col.itemR(vol, "ms_diffusion") col.itemR(vol, "ms_spread") col.itemR(vol, "ms_intensity") - - col.itemR(vol, "density_scale") - col.itemR(vol, "depth_cutoff") col = split.column() - col.itemR(vol, "absorption") - col.itemR(vol, "absorption_color") - col.itemR(vol, "scattering") + # col.itemL(text="Anisotropic Scattering:") + col.itemR(vol, "phase_function", text="") + if vol.phase_function in ('SCHLICK', 'HENYEY-GREENSTEIN'): + col.itemR(vol, "asymmetry") - col.itemR(mat, "emit") - col.itemR(mat, "diffuse_color") +class MATERIAL_PT_volume_integration(MaterialButtonsPanel): + __label__ = "Integration" + __default_closed__ = False + COMPAT_ENGINES = set(['BLENDER_RENDER']) + + def poll(self, context): + return (context.material.type == 'VOLUME') and (context.scene.render_data.engine in self.COMPAT_ENGINES) + + def draw(self, context): + layout = self.layout + + mat = context.material + vol = context.material.volume + + split = layout.split() + + col = split.column() + col.itemL(text="Step Calculation:") + col.itemR(vol, "step_calculation", text="") + col = col.column(align=True) + col.itemR(vol, "step_size") + col.itemR(vol, "shading_step_size") + + col = split.column() + col.itemL() + col.itemR(vol, "depth_cutoff") + col.itemR(vol, "density_scale") - col.itemR(vol, "phase_function") - col.itemR(vol, "asymmetry") - - class MATERIAL_PT_halo(MaterialButtonsPanel): __label__= "Halo" COMPAT_ENGINES = set(['BLENDER_RENDER']) @@ -592,7 +639,9 @@ bpy.types.register(MATERIAL_PT_specular) bpy.types.register(MATERIAL_PT_raymir) bpy.types.register(MATERIAL_PT_raytransp) bpy.types.register(MATERIAL_PT_sss) -bpy.types.register(MATERIAL_PT_volume) +bpy.types.register(MATERIAL_PT_volume_shading) +bpy.types.register(MATERIAL_PT_volume_scattering) +bpy.types.register(MATERIAL_PT_volume_integration) bpy.types.register(MATERIAL_PT_halo) bpy.types.register(MATERIAL_PT_physics) bpy.types.register(MATERIAL_PT_strand) diff --git a/release/ui/buttons_texture.py b/release/ui/buttons_texture.py index 5998eca870a..5b48fdfbaa4 100644 --- a/release/ui/buttons_texture.py +++ b/release/ui/buttons_texture.py @@ -176,35 +176,51 @@ class TEXTURE_PT_influence(TextureButtonsPanel): sub.itemR(tex, factor, text=name, slider=True) if ma: - split = layout.split() - - col = split.column() - col.itemL(text="Diffuse:") - factor_but(col, tex.map_diffuse, "map_diffuse", "diffuse_factor", "Intensity") - factor_but(col, tex.map_colordiff, "map_colordiff", "colordiff_factor", "Color") - factor_but(col, tex.map_alpha, "map_alpha", "alpha_factor", "Alpha") - factor_but(col, tex.map_translucency, "map_translucency", "translucency_factor", "Translucency") + if ma.type in ['SURFACE', 'HALO', 'WIRE']: + split = layout.split() + + col = split.column() + col.itemL(text="Diffuse:") + factor_but(col, tex.map_diffuse, "map_diffuse", "diffuse_factor", "Intensity") + factor_but(col, tex.map_colordiff, "map_colordiff", "colordiff_factor", "Color") + factor_but(col, tex.map_alpha, "map_alpha", "alpha_factor", "Alpha") + factor_but(col, tex.map_translucency, "map_translucency", "translucency_factor", "Translucency") - col.itemL(text="Specular:") - factor_but(col, tex.map_specular, "map_specular", "specular_factor", "Intensity") - factor_but(col, tex.map_colorspec, "map_colorspec", "colorspec_factor", "Color") - factor_but(col, tex.map_hardness, "map_hardness", "hardness_factor", "Hardness") + col.itemL(text="Specular:") + factor_but(col, tex.map_specular, "map_specular", "specular_factor", "Intensity") + factor_but(col, tex.map_colorspec, "map_colorspec", "colorspec_factor", "Color") + factor_but(col, tex.map_hardness, "map_hardness", "hardness_factor", "Hardness") - col = split.column() - col.itemL(text="Shading:") - factor_but(col, tex.map_ambient, "map_ambient", "ambient_factor", "Ambient") - factor_but(col, tex.map_emit, "map_emit", "emit_factor", "Emit") - factor_but(col, tex.map_mirror, "map_mirror", "mirror_factor", "Mirror") - factor_but(col, tex.map_raymir, "map_raymir", "raymir_factor", "Ray Mirror") + col = split.column() + col.itemL(text="Shading:") + factor_but(col, tex.map_ambient, "map_ambient", "ambient_factor", "Ambient") + factor_but(col, tex.map_emit, "map_emit", "emit_factor", "Emit") + factor_but(col, tex.map_mirror, "map_mirror", "mirror_factor", "Mirror") + factor_but(col, tex.map_raymir, "map_raymir", "raymir_factor", "Ray Mirror") - col.itemL(text="Geometry:") - factor_but(col, tex.map_normal, "map_normal", "normal_factor", "Normal") - factor_but(col, tex.map_warp, "map_warp", "warp_factor", "Warp") - factor_but(col, tex.map_displacement, "map_displacement", "displacement_factor", "Displace") + col.itemL(text="Geometry:") + factor_but(col, tex.map_normal, "map_normal", "normal_factor", "Normal") + factor_but(col, tex.map_warp, "map_warp", "warp_factor", "Warp") + factor_but(col, tex.map_displacement, "map_displacement", "displacement_factor", "Displace") + + #sub = col.column() + #sub.active = tex.map_translucency or tex.map_emit or tex.map_alpha or tex.map_raymir or tex.map_hardness or tex.map_ambient or tex.map_specularity or tex.map_reflection or tex.map_mirror + #sub.itemR(tex, "default_value", text="Amount", slider=True) + elif ma.type == 'VOLUME': + split = layout.split() + + col = split.column() + factor_but(col, tex.map_density, "map_density", "density_factor", "Density") + factor_but(col, tex.map_emission, "map_emission", "emission_factor", "Emission") + factor_but(col, tex.map_absorption, "map_absorption", "absorption_factor", "Absorption") + factor_but(col, tex.map_scattering, "map_scattering", "scattering_factor", "Scattering") + + col = split.column() + col.itemL(text=" ") + factor_but(col, tex.map_alpha, "map_coloremission", "coloremission_factor", "Emission Color") + factor_but(col, tex.map_colorabsorption, "map_colorabsorption", "colorabsorption_factor", "Absorption Color") + - #sub = col.column() - #sub.active = tex.map_translucency or tex.map_emit or tex.map_alpha or tex.map_raymir or tex.map_hardness or tex.map_ambient or tex.map_specularity or tex.map_reflection or tex.map_mirror - #sub.itemR(tex, "default_value", text="Amount", slider=True) elif la: row = layout.row() factor_but(row, tex.map_color, "map_color", "color_factor", "Color") @@ -641,7 +657,7 @@ class TEXTURE_PT_voxeldata(TextureButtonsPanel): if vd.file_format == 'RAW_8BIT': layout.itemR(vd, "resolution") if vd.file_format == 'SMOKE': - layout.itemR(vd, "object") + layout.itemR(vd, "domain_object") layout.itemR(vd, "still") if vd.still: diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index a46014d0a7c..51748443c97 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -170,12 +170,19 @@ 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.density = 1.0f; + ma->vol.emission = 0.0f; ma->vol.absorption = 1.0f; ma->vol.scattering = 1.0f; + ma->vol.emission_col[0] = ma->vol.emission_col[1] = ma->vol.emission_col[2] = 1.0f; ma->vol.absorption_col[0] = ma->vol.absorption_col[1] = ma->vol.absorption_col[2] = 0.0f; + ma->vol.density_scale = 1.0f; + ma->vol.depth_cutoff = 0.01f; + ma->vol.stepsize_type = MA_VOL_STEP_RANDOMIZED; + ma->vol.stepsize = 0.2f; + ma->vol.shade_stepsize = 0.2f; + ma->vol.shade_type = MA_VOL_SHADE_SINGLE; + ma->vol.shadeflag |= MA_VOL_PRECACHESHADING; ma->vol.precache_resolution = 50; ma->mode= MA_TRACEBLE|MA_SHADBUF|MA_SHADOW|MA_RADIO|MA_RAYBIAS|MA_TANGENT_STR; diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 234078f66ae..fc9948f8d95 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -496,7 +496,8 @@ void default_tex(Tex *tex) if (tex->vd) { tex->vd->resol[0] = tex->vd->resol[1] = tex->vd->resol[2] = 0; - tex->vd->interp_type=0; + tex->vd->interp_type=TEX_VD_LINEAR; + tex->vd->file_format=TEX_VD_SMOKE; } pit = tex->plugin; if (pit) { @@ -978,7 +979,8 @@ struct VoxelData *BKE_add_voxeldata(void) vd= MEM_callocN(sizeof(struct VoxelData), "voxeldata"); vd->dataset = NULL; vd->resol[0] = vd->resol[1] = vd->resol[2] = 1; - vd->interp_type= TEX_VD_NEARESTNEIGHBOR; + vd->interp_type= TEX_VD_LINEAR; + vd->file_format= TEX_VD_SMOKE; vd->int_multiplier = 1.0; return vd; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 4ee71ea92db..c5588ccf7d6 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9491,12 +9491,19 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } /* volume rendering settings */ - ma->vol.density_scale = 1.0f; - ma->vol.stepsize = 0.2f; - ma->vol.shade_stepsize = 0.2f; + ma->vol.density = 1.0f; + ma->vol.emission = 0.0f; ma->vol.absorption = 1.0f; ma->vol.scattering = 1.0f; + ma->vol.emission_col[0] = ma->vol.emission_col[1] = ma->vol.emission_col[2] = 1.0f; ma->vol.absorption_col[0] = ma->vol.absorption_col[1] = ma->vol.absorption_col[2] = 0.0f; + ma->vol.density_scale = 1.0f; + ma->vol.depth_cutoff = 0.01f; + ma->vol.stepsize_type = MA_VOL_STEP_RANDOMIZED; + ma->vol.stepsize = 0.2f; + ma->vol.shade_stepsize = 0.2f; + ma->vol.shade_type = MA_VOL_SHADE_SINGLE; + ma->vol.shadeflag |= MA_VOL_PRECACHESHADING; ma->vol.precache_resolution = 50; } diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index 22ec0f6d59e..1729db37ad1 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -48,21 +48,30 @@ struct Ipo; /* WATCH IT: change type? also make changes in ipo.h */ typedef struct VolumeSettings { - short stepsize_type; - short precache_resolution; - float stepsize, shade_stepsize; - float depth_cutoff; - short shade_type; - short vpad; - float density_scale; - float absorption, scattering; + float density; + float emission; + float absorption; + float scattering; + + float emission_col[3]; float absorption_col[3]; - short shadeflag; + float density_scale; + float depth_cutoff; + short phasefunc_type; + short vpad[3]; float phasefunc_g; - float vpad2[2]; - float ms_diff, ms_intensity; + float stepsize; + float shade_stepsize; + + short stepsize_type; + short shadeflag; + short shade_type; + short precache_resolution; + + float ms_diff; + float ms_intensity; int ms_steps; } VolumeSettings; @@ -308,6 +317,14 @@ typedef struct Material { #define MAP_WARP 8192 #define MAP_LAYER 16384 +/* volume mapto - reuse definitions for now - a bit naughty! */ +#define MAP_DENSITY 128 +#define MAP_EMISSION 64 +#define MAP_EMISSION_COL 1 +#define MAP_ABSORPTION 512 +#define MAP_ABSORPTION_COL 8 +#define MAP_SCATTERING 16 + /* mapto for halo */ //#define MAP_HA_COL 1 //#define MAP_HA_ALPHA 128 diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 4ca1db09374..3f225321024 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -468,6 +468,75 @@ static void rna_def_material_mtex(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Ambient Factor", "Amount texture affects ambient."); RNA_def_property_update(prop, NC_TEXTURE, NULL); + /* volume material */ + prop= RNA_def_property(srna, "map_coloremission", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMISSION_COL); + RNA_def_property_ui_text(prop, "Emission Color", "Causes the texture to affect the colour of emission"); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + + prop= RNA_def_property(srna, "map_colorabsorption", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_ABSORPTION_COL); + RNA_def_property_ui_text(prop, "Absorption Color", "Causes the texture to affect the result colour after absorption"); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + + prop= RNA_def_property(srna, "map_density", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_DENSITY); + RNA_def_property_ui_text(prop, "Density", "Causes the texture to affect the volume's density"); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + + prop= RNA_def_property(srna, "map_emission", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_EMISSION); + RNA_def_property_ui_text(prop, "Emission", "Causes the texture to affect the volume's emission"); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + + prop= RNA_def_property(srna, "map_absorption", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_ABSORPTION); + RNA_def_property_ui_text(prop, "Absorption", "Causes the texture to affect the volume's absorption"); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + + prop= RNA_def_property(srna, "map_scattering", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "mapto", MAP_SCATTERING); + RNA_def_property_ui_text(prop, "Scattering", "Causes the texture to affect the volume's scattering"); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + + prop= RNA_def_property(srna, "coloremission_factor", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "colfac"); + RNA_def_property_ui_range(prop, 0, 1, 10, 3); + RNA_def_property_ui_text(prop, "Emission Color Factor", "Amount texture affects emission color."); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + + prop= RNA_def_property(srna, "colorabsorption_factor", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "colfac"); + RNA_def_property_ui_range(prop, 0, 1, 10, 3); + RNA_def_property_ui_text(prop, "Absorpion Color Factor", "Amount texture affects diffuse color."); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + + prop= RNA_def_property(srna, "density_factor", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "varfac"); + RNA_def_property_ui_range(prop, 0, 1, 10, 3); + RNA_def_property_ui_text(prop, "Density Factor", "Amount texture affects density."); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + + prop= RNA_def_property(srna, "emission_factor", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "varfac"); + RNA_def_property_ui_range(prop, 0, 1, 10, 3); + RNA_def_property_ui_text(prop, "Emission Factor", "Amount texture affects emission."); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + + prop= RNA_def_property(srna, "absorption_factor", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "varfac"); + RNA_def_property_ui_range(prop, 0, 1, 10, 3); + RNA_def_property_ui_text(prop, "Absorption Factor", "Amount texture affects absorption."); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + + prop= RNA_def_property(srna, "scattering_factor", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "varfac"); + RNA_def_property_ui_range(prop, 0, 1, 10, 3); + RNA_def_property_ui_text(prop, "Scattering Factor", "Amount texture affects scattering."); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + + /* end volume material */ + prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_MaterialTextureSlot_enabled_get", "rna_MaterialTextureSlot_enabled_set"); RNA_def_property_ui_text(prop, "Enabled", "Enable this material texture slot."); @@ -810,9 +879,9 @@ static void rna_def_material_volume(BlenderRNA *brna) static EnumPropertyItem prop_scattering_items[] = { {MA_VOL_SHADE_NONE, "NONE", 0, "None", ""}, - {MA_VOL_SHADE_SINGLE, "SINGLE", 0, "Single", ""}, - {MA_VOL_SHADE_MULTIPLE, "MULTIPLE", 0, "Multiple", ""}, - {MA_VOL_SHADE_SINGLEPLUSMULTIPLE, "SINGLE_PLUS_MULTIPLE", 0, "Single + Multiple", ""}, + {MA_VOL_SHADE_SINGLE, "SINGLE_SCATTERING", 0, "Single Scattering", ""}, + {MA_VOL_SHADE_MULTIPLE, "MULTIPLE_SCATTERING", 0, "Multiple Scattering", ""}, + {MA_VOL_SHADE_SINGLEPLUSMULTIPLE, "SINGLE_PLUS_MULTIPLE_SCATTERING", 0, "Single + Multiple Scattering", ""}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_stepsize_items[] = { @@ -844,12 +913,14 @@ static void rna_def_material_volume(BlenderRNA *brna) prop= RNA_def_property(srna, "step_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "stepsize"); RNA_def_property_range(prop, 0.0f, FLT_MAX); + RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3); RNA_def_property_ui_text(prop, "Step Size", "Distance between subsequent volume depth samples."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "shading_step_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "shade_stepsize"); RNA_def_property_range(prop, 0.0f, FLT_MAX); + RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3); RNA_def_property_ui_text(prop, "Shading Step Size", "Distance between subsequent volume shading samples."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); @@ -894,15 +965,23 @@ static void rna_def_material_volume(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Depth Cutoff", "Stop ray marching early if transmission drops below this luminance - higher values give speedups in dense volumes at the expense of accuracy."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + prop= RNA_def_property(srna, "density", PROP_FLOAT, PROP_PERCENTAGE); + RNA_def_property_float_sdna(prop, NULL, "density"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Density", "The base density of the volume"); + RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + prop= RNA_def_property(srna, "density_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "density_scale"); RNA_def_property_range(prop, 0.0f, FLT_MAX); + RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); RNA_def_property_ui_text(prop, "Density Scale", "Multiplier for the material's density"); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "absorption", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "absorption"); RNA_def_property_range(prop, 0.0f, FLT_MAX); + RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); RNA_def_property_ui_text(prop, "Absorption", "Amount of light that gets absorbed by the volume - higher values mean light travels less distance"); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); @@ -915,9 +994,23 @@ static void rna_def_material_volume(BlenderRNA *brna) prop= RNA_def_property(srna, "scattering", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "scattering"); RNA_def_property_range(prop, 0.0f, FLT_MAX); + RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1 ,3); RNA_def_property_ui_text(prop, "Scattering", "Amount of light that gets scattered by the volume - values > 1.0 are non-physical"); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + prop= RNA_def_property(srna, "emission", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "emission"); + RNA_def_property_range(prop, 0.0f, FLT_MAX); + RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); + RNA_def_property_ui_text(prop, "Emission", "Amount of light that gets emitted by the volume"); + RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); + + prop= RNA_def_property(srna, "emission_color", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "emission_col"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Emission Color", ""); + RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL); + prop= RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shadeflag", MA_VOL_USEALPHA); /* use bitflags */ RNA_def_property_ui_text(prop, "Use Alpha", "Temp method for getting a usable alpha channel"); @@ -934,14 +1027,6 @@ static void rna_def_material_volume(BlenderRNA *brna) RNA_def_property_range(prop, -1.0f, 1.0f); RNA_def_property_ui_text(prop, "Asymmetry", "Continuum between forward scattering and back scattering"); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - - /* - prop= RNA_def_property(srna, "samples", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "samp_gloss_mir"); - RNA_def_property_range(prop, 0, 1024); - RNA_def_property_ui_text(prop, "Gloss Samples", "Number of cone samples averaged for blurry reflections."); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - */ } diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 203012dbc80..01078ac2412 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -1448,9 +1448,9 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Still Frame Number", "The frame number to always use"); RNA_def_property_update(prop, NC_TEXTURE, NULL); - prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); + prop= RNA_def_property(srna, "domain_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "object"); - RNA_def_property_ui_text(prop, "Object", "Object to use for smoke simulations"); + RNA_def_property_ui_text(prop, "Domain Object", "Object used as the smoke simulation domain"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, NC_TEXTURE, NULL); diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index 27cf698aabe..1b25edaab34 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -2362,7 +2362,7 @@ void do_volume_tex(ShadeInput *shi, float *xyz, int mapto_flag, float *col, floa } - if((mapto_flag & (MAP_COL+MAP_COLMIR)) && (mtex->mapto & (MAP_COL+MAP_COLMIR))) { + if((mapto_flag & (MAP_EMISSION_COL+MAP_ABSORPTION_COL)) && (mtex->mapto & (MAP_EMISSION_COL+MAP_ABSORPTION_COL))) { float tcol[3], colfac; /* stencil maps on the texture control slider, not texture intensity value */ @@ -2386,12 +2386,12 @@ void do_volume_tex(ShadeInput *shi, float *xyz, int mapto_flag, float *col, floa } /* used for emit */ - if((mapto_flag & MAP_COL) && (mtex->mapto & MAP_COL)) { + if((mapto_flag & MAP_EMISSION_COL) && (mtex->mapto & MAP_EMISSION_COL)) { texture_rgb_blend(col, tcol, col, texres.tin, colfac, mtex->blendtype); } /* MAP_COLMIR is abused for absorption colour at the moment */ - if((mapto_flag & MAP_COLMIR) && (mtex->mapto & MAP_COLMIR)) { + if((mapto_flag & MAP_ABSORPTION_COL) && (mtex->mapto & MAP_ABSORPTION_COL)) { texture_rgb_blend(col, tcol, col, texres.tin, colfac, mtex->blendtype); } } @@ -2408,15 +2408,27 @@ void do_volume_tex(ShadeInput *shi, float *xyz, int mapto_flag, float *col, floa } } - if((mapto_flag & MAP_EMIT) && (mtex->mapto & MAP_EMIT)) { - int flip= mtex->maptoneg & MAP_EMIT; + if((mapto_flag & MAP_EMISSION) && (mtex->mapto & MAP_EMISSION)) { + int flip= mtex->maptoneg & MAP_EMISSION; *val = texture_value_blend(mtex->def_var, *val, texres.tin, varfac, mtex->blendtype, flip); if(*val<0.0) *val= 0.0; } - if((mapto_flag & MAP_ALPHA) && (mtex->mapto & MAP_ALPHA)) { - int flip= mtex->maptoneg & MAP_ALPHA; + if((mapto_flag & MAP_DENSITY) && (mtex->mapto & MAP_DENSITY)) { + int flip= mtex->maptoneg & MAP_DENSITY; + *val = texture_value_blend(mtex->def_var, *val, texres.tin, varfac, mtex->blendtype, flip); + CLAMP(*val, 0.0, 1.0); + } + if((mapto_flag & MAP_ABSORPTION) && (mtex->mapto & MAP_ABSORPTION)) { + int flip= mtex->maptoneg & MAP_ABSORPTION; + + *val = texture_value_blend(mtex->def_var, *val, texres.tin, varfac, mtex->blendtype, flip); + CLAMP(*val, 0.0, 1.0); + } + if((mapto_flag & MAP_SCATTERING) && (mtex->mapto & MAP_SCATTERING)) { + int flip= mtex->maptoneg & MAP_SCATTERING; + *val = texture_value_blend(mtex->def_var, *val, texres.tin, varfac, mtex->blendtype, flip); CLAMP(*val, 0.0, 1.0); } diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 04eb1b5e3bf..63c4e97f86e 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -165,80 +165,89 @@ static void vol_get_precached_scattering(ShadeInput *shi, float *scatter_col, fl float vol_get_density(struct ShadeInput *shi, float *co) { - float density = shi->mat->alpha; + float density = shi->mat->vol.density; float density_scale = shi->mat->vol.density_scale; float col[3] = {0.0, 0.0, 0.0}; - do_volume_tex(shi, co, MAP_ALPHA, col, &density); + do_volume_tex(shi, co, MAP_DENSITY, col, &density); return density * density_scale; } -/* compute emission component, amount of radiance to add per segment - * can be textured with 'emit' */ -void vol_get_emission(ShadeInput *shi, float *em, float *co, float density) -{ - float emission = shi->mat->emit; - float col[3] = {0.0, 0.0, 0.0}; - - VECCOPY(col, &shi->mat->r); - - do_volume_tex(shi, co, MAP_EMIT+MAP_COL, col, &emission); - - em[0] = em[1] = em[2] = emission * density; - VecMulVecf(em, em, col); -} - /* scattering multiplier, values above 1.0 are non-physical, * but can be useful to tweak lighting */ -void vol_get_scattering_fac(ShadeInput *shi, float *scatter_fac, float *co, float density) +float vol_get_scattering_fac(ShadeInput *shi, float *co) { - *scatter_fac = shi->mat->vol.scattering; + float scatter = shi->mat->vol.scattering; + float col[3] = {0.0, 0.0, 0.0}; + + do_volume_tex(shi, co, MAP_SCATTERING, col, &scatter); + + return scatter; } +/* compute emission component, amount of radiance to add per segment + * can be textured with 'emit' */ +void vol_get_emission(ShadeInput *shi, float *emission_col, float *co, float density) +{ + float emission = shi->mat->vol.emission; + VECCOPY(emission_col, shi->mat->vol.emission_col); + + do_volume_tex(shi, co, MAP_EMISSION+MAP_EMISSION_COL, emission_col, &emission); + + emission_col[0] = emission_col[0] * emission * density; + emission_col[1] = emission_col[1] * emission * density; + emission_col[2] = emission_col[2] * emission * density; +} + +void vol_get_absorption(ShadeInput *shi, float *absorb_col, float *co) +{ + float absorption = shi->mat->vol.absorption; + VECCOPY(absorb_col, shi->mat->vol.absorption_col); + + do_volume_tex(shi, co, MAP_ABSORPTION+MAP_ABSORPTION_COL, absorb_col, &absorption); + + absorb_col[0] = (1.0f - absorb_col[0]) * absorption; + absorb_col[1] = (1.0f - absorb_col[1]) * absorption; + absorb_col[2] = (1.0f - absorb_col[2]) * absorption; +} + + /* phase function - determines in which directions the light * is scattered in the volume relative to incoming direction * and view direction */ float vol_get_phasefunc(ShadeInput *shi, short phasefunc_type, float g, float *w, float *wp) { const float costheta = Inpf(w, wp); + const float scale = M_PI; - if (phasefunc_type == MA_VOL_PH_ISOTROPIC) { - return 1.f / (4.f * M_PI); - } - else if (phasefunc_type == MA_VOL_PH_MIEHAZY) { - return (0.5f + 4.5f * powf(0.5 * (1.f + costheta), 8.f)) / (4.f*M_PI); - } - else if (phasefunc_type == MA_VOL_PH_MIEMURKY) { - return (0.5f + 16.5f * powf(0.5 * (1.f + costheta), 32.f)) / (4.f*M_PI); - } - else if (phasefunc_type == MA_VOL_PH_RAYLEIGH) { - return 3.f/(16.f*M_PI) * (1 + costheta * costheta); - } - else if (phasefunc_type == MA_VOL_PH_HG) { - return 1.f / (4.f * M_PI) * (1.f - g*g) / powf(1.f + g*g - 2.f * g * costheta, 1.5f); - } - else if (phasefunc_type == MA_VOL_PH_SCHLICK) { - const float k = 1.55f * g - .55f * g * g * g; - const float kcostheta = k * costheta; - return 1.f / (4.f * M_PI) * (1.f - k*k) / ((1.f - kcostheta) * (1.f - kcostheta)); - } else { - return 1.0f; - } -} - -void vol_get_absorption(ShadeInput *shi, float *absorb_col, float *co) -{ - float dummy = 1.0f; - const float absorption = shi->mat->vol.absorption; + /* + * Scale constant is required, since Blender's shading system doesn't normalise for + * energy conservation - eg. scaling by 1/pi for a lambert shader. + * This makes volumes darker than other solid objects, for the same lighting intensity. + * To correct this, scale up the phase function values + * until Blender's shading system supports this better. --matt + */ - VECCOPY(absorb_col, shi->mat->vol.absorption_col); - - do_volume_tex(shi, co, MAP_COLMIR, absorb_col, &dummy); - - absorb_col[0] = (1.0f - absorb_col[0]) * absorption; - absorb_col[1] = (1.0f - absorb_col[1]) * absorption; - absorb_col[2] = (1.0f - absorb_col[2]) * absorption; + switch (phasefunc_type) { + case MA_VOL_PH_MIEHAZY: + return scale * (0.5f + 4.5f * powf(0.5 * (1.f + costheta), 8.f)) / (4.f*M_PI); + case MA_VOL_PH_MIEMURKY: + return scale * (0.5f + 16.5f * powf(0.5 * (1.f + costheta), 32.f)) / (4.f*M_PI); + case MA_VOL_PH_RAYLEIGH: + return scale * 3.f/(16.f*M_PI) * (1 + costheta * costheta); + case MA_VOL_PH_HG: + return scale * (1.f / (4.f * M_PI) * (1.f - g*g) / powf(1.f + g*g - 2.f * g * costheta, 1.5f)); + case MA_VOL_PH_SCHLICK: + { + const float k = 1.55f * g - .55f * g * g * g; + const float kcostheta = k * costheta; + return scale * (1.f / (4.f * M_PI) * (1.f - k*k) / ((1.f - kcostheta) * (1.f - kcostheta))); + } + case MA_VOL_PH_ISOTROPIC: + default: + return scale * (1.f / (4.f * M_PI)); + } } /* Compute attenuation, otherwise known as 'optical thickness', extinction, or tau. @@ -360,7 +369,7 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * } } - vol_get_scattering_fac(shi, &scatter_fac, co, density); + scatter_fac = vol_get_scattering_fac(shi, co); VecMulf(lacol, scatter_fac); } @@ -371,16 +380,13 @@ void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsi GroupObject *go; LampRen *lar; float col[3] = {0.f, 0.f, 0.f}; - int i=0; - + lights= get_lights(shi); for(go=lights->first; go; go= go->next) { float lacol[3] = {0.f, 0.f, 0.f}; - - i++; - lar= go->lampren; + if (lar) { vol_shade_one_lamp(shi, co, lar, lacol, stepsize, density); VecAddf(col, col, lacol); @@ -575,9 +581,7 @@ static void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr, int in /* shade volume from 'camera' to 1st hit point */ volumeintegrate(shi, col, shi->camera_co, shi->co); - shr->combined[0] = col[0]; - shr->combined[1] = col[1]; - shr->combined[2] = col[2]; + VecCopyf(shr->combined, col); if (shi->mat->vol.shadeflag & MA_VOL_USEALPHA) { if (col[3] > 1.0f) @@ -606,9 +610,7 @@ static void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr, int in /* shade volume from 1st hit point to 2nd hit point */ volumeintegrate(shi, col, shi->co, hitco); - shr->combined[0] = col[0]; - shr->combined[1] = col[1]; - shr->combined[2] = col[2]; + VecCopyf(shr->combined, col); if (shi->mat->vol.shadeflag & MA_VOL_USEALPHA) { if (col[3] > 1.0f) @@ -650,9 +652,8 @@ void shade_volume_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct tr[1] = exp(-tau[1]); tr[2] = exp(-tau[2]); - shr->combined[0] = tr[0]; - shr->combined[1] = tr[1]; - shr->combined[2] = tr[2]; + + VecCopyf(shr->combined, tr); shr->combined[3] = 1.0f -(tr[0] + tr[1] + tr[2]) * 0.333f; shr->alpha = shr->combined[3]; @@ -666,9 +667,7 @@ void shade_volume_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct tr[1] = exp(-tau[1]); tr[2] = exp(-tau[2]); - shr->combined[0] = tr[0]; - shr->combined[1] = tr[1]; - shr->combined[2] = tr[2]; + VecCopyf(shr->combined, tr); shr->combined[3] = 1.0f -(tr[0] + tr[1] + tr[2]) * 0.333f; shr->alpha = shr->combined[3]; From 71cc934c6fb0037c6f0cd87f5f984250645ad42f Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Sun, 16 Aug 2009 14:43:30 +0000 Subject: [PATCH 092/577] == Sequencer == Make coverity scan happy and check for input strip on speed control map rebuild. --- source/blender/src/seqeffects.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/blender/src/seqeffects.c b/source/blender/src/seqeffects.c index 2e339f433c3..1aab9a00506 100644 --- a/source/blender/src/seqeffects.c +++ b/source/blender/src/seqeffects.c @@ -2791,6 +2791,10 @@ void sequence_effect_speed_rebuild_map(struct Sequence * seq, int force) if (!(force || seq->len != v->length || !v->frameMap)) { return; } + if (!seq->seq1) { /* make coverity happy and check for + input strip ... */ + return; + } if (!v->frameMap || v->length != seq->len) { if (v->frameMap) MEM_freeN(v->frameMap); @@ -2807,7 +2811,7 @@ void sequence_effect_speed_rebuild_map(struct Sequence * seq, int force) strip */ if ((!seq->ipo || !seq->ipo->curve.first) && - seq->seq1 && seq->seq1->enddisp != seq->seq1->start + seq->seq1->enddisp != seq->seq1->start && seq->seq1->len != 0) { fallback_fac = (float) seq->seq1->len / (float) (seq->seq1->enddisp - seq->seq1->start); From c73bad7bddb3a5368b28d061bdc3b2c86b05a53d Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Sun, 16 Aug 2009 14:52:05 +0000 Subject: [PATCH 093/577] == Sequencer == Forgot coverity id: CID 598 --- source/blender/src/seqeffects.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/src/seqeffects.c b/source/blender/src/seqeffects.c index 1aab9a00506..731bbaea9f4 100644 --- a/source/blender/src/seqeffects.c +++ b/source/blender/src/seqeffects.c @@ -2791,7 +2791,7 @@ void sequence_effect_speed_rebuild_map(struct Sequence * seq, int force) if (!(force || seq->len != v->length || !v->frameMap)) { return; } - if (!seq->seq1) { /* make coverity happy and check for + if (!seq->seq1) { /* make coverity happy and check for (CID 598) input strip ... */ return; } From c00d610e3e704efe27cf35cbfa2ae9d0a48274ec Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Mon, 17 Aug 2009 17:14:37 +0000 Subject: [PATCH 094/577] 2.5: * Added icons to viewport shading enum. On a side note, why do we have an icon called "ICON_POTATO" for texture mode? * Fixed clay brush at zero-strength bug, was dividing by zero. Still todo is fixing clay brush strength relative to other brushes. --- source/blender/editors/sculpt_paint/sculpt.c | 37 ++++++++++++-------- source/blender/makesrna/intern/rna_space.c | 10 +++--- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 2a4c553a94c..9931ae15f23 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -542,12 +542,27 @@ static void point_plane_project(float intr[3], float co[3], float plane_normal[3 VecAddf(intr, intr, p1); } +static int plane_point_side(float co[3], float plane_normal[3], float plane_center[3], int flip) +{ + float delta[3]; + float d; + + VecSubf(delta, co, plane_center); + d = Inpf(plane_normal, delta); + + if(flip) + d = -d; + + return d <= 0.0f; +} + static void do_flatten_clay_brush(Sculpt *sd, SculptSession *ss, const ListBase *active_verts, int clay) { ActiveData *node= active_verts->first; /* area_normal and cntr define the plane towards which vertices are squashed */ float area_normal[3]; float cntr[3], cntr2[3], bstr; + int flip = 0; calc_area_normal(sd, ss, area_normal, active_verts); calc_flatten_center(ss, node, cntr); @@ -558,31 +573,24 @@ static void do_flatten_clay_brush(Sculpt *sd, SculptSession *ss, const ListBase cntr2[0]=cntr[0]+area_normal[0]*bstr*ss->cache->scale[0]; cntr2[1]=cntr[1]+area_normal[1]*bstr*ss->cache->scale[1]; cntr2[2]=cntr[2]+area_normal[2]*bstr*ss->cache->scale[2]; + flip = bstr < 0; } while(node){ float *co= ss->mvert[node->Index].co; - float intr[3], val[3], d; + float intr[3], val[3]; - if(clay) { - float delta[3]; - - VecSubf(delta, co, cntr2); - d = Inpf(area_normal, delta); - - /* Check for subtractive mode */ - if(bstr < 0) - d = -d; - } - - if(!clay || d <= 0.0f) { + if(!clay || plane_point_side(co, area_normal, cntr2, flip)) { /* Find the intersection between squash-plane and vertex (along the area normal) */ point_plane_project(intr, co, area_normal, cntr); VecSubf(val, intr, co); if(clay) { - VecMulf(val, node->Fade / bstr); + if(bstr > FLT_EPSILON) + VecMulf(val, node->Fade / bstr); + else + VecMulf(val, node->Fade); /* Clay displacement */ val[0]+=area_normal[0] * ss->cache->scale[0]*node->Fade; val[1]+=area_normal[1] * ss->cache->scale[1]*node->Fade; @@ -592,6 +600,7 @@ static void do_flatten_clay_brush(Sculpt *sd, SculptSession *ss, const ListBase VecMulf(val, fabs(node->Fade)); VecAddf(val, val, co); + sculpt_clip(sd, ss, co, val); } diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 664b1713b31..41361dd69a4 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -519,11 +519,11 @@ static void rna_def_space_3dview(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem viewport_shading_items[] = { - {OB_BOUNDBOX, "BOUNDBOX", 0, "Bounding Box", "Display the object's local bounding boxes only"}, - {OB_WIRE, "WIREFRAME", 0, "Wireframe", "Display the object as wire edges"}, - {OB_SOLID, "SOLID", 0, "Solid", "Display the object solid, lit with default OpenGL lights"}, - {OB_SHADED, "SHADED", 0, "Shaded", "Display the object solid, with preview shading interpolated at vertices"}, - {OB_TEXTURE, "TEXTURED", 0, "Textured", "Display the object solid, with face-assigned textures"}, + {OB_BOUNDBOX, "BOUNDBOX", ICON_BBOX, "Bounding Box", "Display the object's local bounding boxes only"}, + {OB_WIRE, "WIREFRAME", ICON_WIRE, "Wireframe", "Display the object as wire edges"}, + {OB_SOLID, "SOLID", ICON_SOLID, "Solid", "Display the object solid, lit with default OpenGL lights"}, + {OB_SHADED, "SHADED", ICON_SMOOTH, "Shaded", "Display the object solid, with preview shading interpolated at vertices"}, + {OB_TEXTURE, "TEXTURED", ICON_POTATO, "Textured", "Display the object solid, with face-assigned textures"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem pivot_items[] = { From f3caa80a49fc1978e04915d663be540390180791 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 17 Aug 2009 17:26:54 +0000 Subject: [PATCH 095/577] rna reference doc generation - rna classes, only include props and functions that are not inherited (epydoc then gives inheritance info) - include function arguments and return values for in cross reference --- source/blender/python/epy_doc_gen.py | 58 +++++++++++++++++++++------- 1 file changed, 43 insertions(+), 15 deletions(-) diff --git a/source/blender/python/epy_doc_gen.py b/source/blender/python/epy_doc_gen.py index 1da69c622a6..6a515648340 100644 --- a/source/blender/python/epy_doc_gen.py +++ b/source/blender/python/epy_doc_gen.py @@ -89,7 +89,7 @@ def write_func(rna, ident, out, func_type): rna_prop_type = rna_prop.type.lower() # enum, float, int, boolean - # only for rna funcions, operators should not get pointers as args + # only for rna functions, operators should not get pointers as args if rna_prop_type=='pointer': rna_prop_type_refine = "L{%s}" % rna_prop.fixed_type.identifier else: @@ -200,6 +200,7 @@ def rna2epy(target_path): # Use for faster lookups # use rna_struct.identifier as the key for each dict + rna_struct_dict = {} # store identifier:rna lookups rna_full_path_dict = {} # store the result of full_rna_struct_path(rna_struct) rna_children_dict = {} # store all rna_structs nested from here rna_references_dict = {} # store a list of rna path strings that reference this type @@ -216,8 +217,12 @@ def rna2epy(target_path): if rna_base: out.write(ident+ 'class %s(%s):\n' % (identifier, rna_base.identifier)) + rna_base_prop_keys = rna_base.properties.keys() # could be cached + rna_base_func_keys = [f.identifier for f in rna_base.functions] else: out.write(ident+ 'class %s:\n' % identifier) + rna_base_prop_keys = [] + rna_base_func_keys = [] out.write(ident+ '\t"""\n') @@ -249,11 +254,9 @@ def rna2epy(target_path): for rna_prop_identifier, rna_prop in rna_struct.properties.items(): - if rna_prop_identifier=='RNA': - continue - - if rna_prop_identifier=='rna_type': - continue + if rna_prop_identifier=='RNA': continue + if rna_prop_identifier=='rna_type': continue + if rna_prop_identifier in rna_base_prop_keys: continue # does this prop exist in our parent class, if so skip rna_desc = rna_prop.description.strip() @@ -308,7 +311,8 @@ def rna2epy(target_path): # Write functions # for rna_func in rna_struct.functions: # Better ignore inherited (line below) for rna_func in rna_functions_dict[identifier]: - write_func(rna_func, ident+'\t', out, 'FUNCTION') + if rna_func not in rna_base_func_keys: + write_func(rna_func, ident+'\t', out, 'FUNCTION') out.write('\n') @@ -331,13 +335,18 @@ def rna2epy(target_path): structs = [] for rna_type_name in dir(bpy.types): rna_type = getattr(bpy.types, rna_type_name) - if hasattr(rna_type, '__rna__'): + + try: rna_struct = rna_type.__rna__ + except: rna_struct = None + + if rna_struct: #if not rna_type_name.startswith('__'): - rna_struct = rna_type.__rna__ + identifier = rna_struct.identifier structs.append( (base_id(rna_struct), identifier, rna_struct) ) - + # Simple lookup + rna_struct_dict[identifier] = rna_struct # Store full rna path 'GameObjectSettings' -> 'Object.GameObjectSettings' rna_full_path_dict[identifier] = full_rna_struct_path(rna_struct) @@ -395,16 +404,21 @@ def rna2epy(target_path): # precalc vars to avoid a lot of looping for (rna_base, identifier, rna_struct) in structs: + if rna_base: + rna_base_prop_keys = rna_struct_dict[rna_base].properties.keys() # could cache + rna_base_func_keys = [f.identifier for f in rna_struct_dict[rna_base].functions] + else: + rna_base_prop_keys = [] + rna_base_func_keys= [] # rna_struct_path = full_rna_struct_path(rna_struct) rna_struct_path = rna_full_path_dict[identifier] for rna_prop_identifier, rna_prop in rna_struct.properties.items(): - if rna_prop_identifier=='RNA': - continue - if rna_prop_identifier=='rna_type': - continue + if rna_prop_identifier=='RNA': continue + if rna_prop_identifier=='rna_type': continue + if rna_prop_identifier in rna_base_prop_keys: continue try: rna_prop_ptr = rna_prop.fixed_type except: rna_prop_ptr = None @@ -413,7 +427,21 @@ def rna2epy(target_path): if rna_prop_ptr: rna_references_dict[rna_prop_ptr.identifier].append( "%s.%s" % (rna_struct_path, rna_prop_identifier) ) - + for rna_func in rna_struct.functions: + for rna_prop_identifier, rna_prop in rna_func.parameters.items(): + + if rna_prop_identifier=='RNA': continue + if rna_prop_identifier=='rna_type': continue + if rna_prop_identifier in rna_base_func_keys: continue + + + try: rna_prop_ptr = rna_prop.fixed_type + except: rna_prop_ptr = None + + # Does this property point to me? + if rna_prop_ptr: + rna_references_dict[rna_prop_ptr.identifier].append( "%s.%s" % (rna_struct_path, rna_func.identifier) ) + # Store nested children nested = rna_struct.nested From b0508659f650bce8ed7e7142aa362088c6597d62 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Mon, 17 Aug 2009 17:26:58 +0000 Subject: [PATCH 096/577] 2.5 editmode: * Added a poll to the editmode operator that checks first that the object is an editable type (no more tabkey on camera, bug reported by DingTo) --- source/blender/editors/object/object_edit.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index d4f2493be2b..f8d969d2462 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -3859,6 +3859,16 @@ static int editmode_toggle_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } +static int editmode_toggle_poll(bContext *C) +{ + Object *ob = CTX_data_active_object(C); + + return ob && (ob->type == OB_MESH || ob->type == OB_ARMATURE || + ob->type == OB_FONT || ob->type == OB_MBALL || + ob->type == OB_LATTICE || ob->type == OB_SURF || + ob->type == OB_CURVE); +} + void OBJECT_OT_editmode_toggle(wmOperatorType *ot) { @@ -3870,7 +3880,7 @@ void OBJECT_OT_editmode_toggle(wmOperatorType *ot) /* api callbacks */ ot->exec= editmode_toggle_exec; - ot->poll= ED_operator_object_active; + ot->poll= editmode_toggle_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; From 77f60458e28f154b8f3e0b377ef6c8d11b9627f8 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Mon, 17 Aug 2009 17:34:15 +0000 Subject: [PATCH 097/577] 2.5 Particle edit: * Fixed cursor poll, so the cursor won't show up outside the 3d view --- source/blender/editors/physics/editparticle.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/physics/editparticle.c b/source/blender/editors/physics/editparticle.c index 83bf12d651e..0317a500196 100644 --- a/source/blender/editors/physics/editparticle.c +++ b/source/blender/editors/physics/editparticle.c @@ -109,7 +109,8 @@ static int PE_poll(bContext *C) static int PE_poll_3dview(bContext *C) { - return PE_poll(C) && CTX_wm_region_view3d(C); + return PE_poll(C) && CTX_wm_area(C)->spacetype == SPACE_VIEW3D && + CTX_wm_region(C)->regiontype == RGN_TYPE_WINDOW; } static void PE_free_particle_edit(ParticleSystem *psys) @@ -2260,7 +2261,7 @@ static void toggle_particle_cursor(bContext *C, int enable) pset->paintcursor = NULL; } else if(enable) - pset->paintcursor= WM_paint_cursor_activate(CTX_wm_manager(C), PE_poll, brush_drawcursor, NULL); + pset->paintcursor= WM_paint_cursor_activate(CTX_wm_manager(C), PE_poll_3dview, brush_drawcursor, NULL); } /********************* radial control operator *********************/ From e19e654d84ccb697941586df74a42cf3bd13ca96 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Mon, 17 Aug 2009 17:49:33 +0000 Subject: [PATCH 098/577] 2.5/Sculpt: * Fixed a mem leak with the grab brush --- source/blender/editors/sculpt_paint/sculpt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 9931ae15f23..43d70cfcf7a 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -1191,12 +1191,15 @@ static float unproject_brush_radius(SculptSession *ss, float offset) static void sculpt_cache_free(StrokeCache *cache) { + int i; if(cache->orig_norms) MEM_freeN(cache->orig_norms); if(cache->face_norms) MEM_freeN(cache->face_norms); if(cache->mats) MEM_freeN(cache->mats); + for(i = 0; i < 8; ++i) + BLI_freelistN(&cache->grab_active_verts[i]); MEM_freeN(cache); } From 6aeb2f687ae1d41715351ef265a0e0a9af06121a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 17 Aug 2009 18:07:40 +0000 Subject: [PATCH 099/577] - rna sequence sound was referencing unknown struct - cmake was using libs that were disabled (whitespace changes too) - unit conversion missing checks for % ~ & operators --- CMake/macros.cmake | 53 ++++++------ CMakeLists.txt | 83 ++++++++++--------- source/blender/blenkernel/intern/unit.c | 3 + source/blender/makesrna/intern/rna_sequence.c | 2 +- 4 files changed, 75 insertions(+), 66 deletions(-) diff --git a/CMake/macros.cmake b/CMake/macros.cmake index e6c4664b68d..9ba33dfb158 100644 --- a/CMake/macros.cmake +++ b/CMake/macros.cmake @@ -42,8 +42,12 @@ MACRO(SETUP_LIBDIRS) if(COMMAND cmake_policy) CMAKE_POLICY(SET CMP0003 NEW) endif(COMMAND cmake_policy) - LINK_DIRECTORIES(${PYTHON_LIBPATH} ${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${OPENEXR_LIBPATH} ${QUICKTIME_LIBPATH} ${FFMPEG_LIBPATH}) - LINK_DIRECTORIES(${FREETYPE_LIBPATH} ${LIBSAMPLERATE_LIBPATH}) + + LINK_DIRECTORIES(${JPEG_LIBPATH} ${PNG_LIBPATH} ${ZLIB_LIBPATH} ${FREETYPE_LIBPATH} ${LIBSAMPLERATE_LIBPATH}) + + IF(WITH_PYTHON) + LINK_DIRECTORIES(${PYTHON_LIBPATH}) + ENDIF(WITH_PYTHON) IF(WITH_INTERNATIONAL) LINK_DIRECTORIES(${ICONV_LIBPATH}) LINK_DIRECTORIES(${GETTEXT_LIBPATH}) @@ -51,6 +55,15 @@ MACRO(SETUP_LIBDIRS) IF(WITH_SDL) LINK_DIRECTORIES(${SDL_LIBPATH}) ENDIF(WITH_SDL) + IF(WITH_FFMPEG) + LINK_DIRECTORIES(${FFMPEG_LIBPATH}) + ENDIF(WITH_FFMPEG) + IF(WITH_OPENEXR) + LINK_DIRECTORIES(${OPENEXR_LIBPATH}) + ENDIF(WITH_OPENEXR) + IF(WITH_QUICKTIME) + LINK_DIRECTORIES(${QUICKTIME_LIBPATH}) + ENDIF(WITH_QUICKTIME) IF(WITH_OPENAL) LINK_DIRECTORIES(${OPENAL_LIBPATH}) ENDIF(WITH_OPENAL) @@ -59,7 +72,7 @@ MACRO(SETUP_LIBDIRS) ENDIF(WITH_JACK) IF(WITH_FFTW3) LINK_DIRECTORIES(${FFTW3_LIBPATH}) - ENDIF(WITH_FFTW3) + ENDIF(WITH_FFTW3) IF(WIN32) LINK_DIRECTORIES(${PTHREADS_LIBPATH}) @@ -71,38 +84,26 @@ MACRO(SETUP_LIBLINKS SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${PLATFORM_LINKFLAGS} ") #TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LIB} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${SDL_LIBRARY} ${LLIBS}) - TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${FFTW3_LIB} ${JPEG_LIBRARY} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${LLIBS}) + TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${JPEG_LIBRARY} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${LLIBS}) # since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions - IF(WIN32) - - TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d) - - TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB}) - + TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d) + TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB}) ELSE(WIN32) - - TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB}) - + TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB}) ENDIF(WIN32) - - + TARGET_LINK_LIBRARIES(${target} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${PYTHON_LINKFLAGS} ${JPEG_LIB} ${PNG_LIB} ${ZLIB_LIB} ${LLIBS}) TARGET_LINK_LIBRARIES(${target} ${FREETYPE_LIBRARY} ${LIBSAMPLERATE_LIB}) # since we are using the local libs for python when compiling msvc projects, we need to add _d when compiling debug versions IF(WIN32) - - TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d) - - TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB}) - - ELSE(WIN32) - - TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB}) - + TARGET_LINK_LIBRARIES(${target} debug ${PYTHON_LIB}_d) + TARGET_LINK_LIBRARIES(${target} optimized ${PYTHON_LIB}) + ELSE(WIN32) + TARGET_LINK_LIBRARIES(${target} ${PYTHON_LIB}) ENDIF(WIN32) IF(WITH_INTERNATIONAL) @@ -111,6 +112,9 @@ MACRO(SETUP_LIBLINKS IF(WITH_OPENAL) TARGET_LINK_LIBRARIES(${target} ${OPENAL_LIBRARY}) ENDIF(WITH_OPENAL) + IF(WITH_FFTW3) + TARGET_LINK_LIBRARIES(${target} ${FFTW3_LIB}) + ENDIF(WITH_FFTW3) IF(WITH_JACK) TARGET_LINK_LIBRARIES(${target} ${JACK_LIB}) ENDIF(WITH_JACK) @@ -133,3 +137,4 @@ MACRO(SETUP_LIBLINKS TARGET_LINK_LIBRARIES(${target} ${PTHREADS_LIB}) ENDIF(WIN32) ENDMACRO(SETUP_LIBLINKS) + diff --git a/CMakeLists.txt b/CMakeLists.txt index 029a65eb739..5e72227982d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,24 +53,24 @@ SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib) #----------------------------------------------------------------------------- # Set default config options -OPTION(WITH_PLAYER "Build Player" OFF) -OPTION(WITH_GAMEENGINE "Enable Game Engine" ON) -OPTION(WITH_BULLET "Enable Bullet (Physics Engine)" ON) -OPTION(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON) -OPTION(WITH_ELBEEM "Enable Elbeem (Fluid Simulation)" ON) -OPTION(WITH_QUICKTIME "Enable Quicktime Support" OFF) -OPTION(WITH_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON) -OPTION(WITH_DDS "Enable DDS Support" ON) -OPTION(WITH_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF) -OPTION(WITH_PYTHON "Enable Embedded Python API" ON) -OPTION(WITH_SDL "Enable SDL for sound and joystick support" ON) -OPTION(WITH_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org/)" OFF) -OPTION(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON) -OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OFF) -OPTION(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF) -OPTION(WITH_FFTW3 "Enable FFTW3 support" OFF) -OPTION(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" OFF) -OPTION(WITH_INSTALL "Install accompanying scripts and language files needed to run blender" ON) +OPTION(WITH_PLAYER "Build Player" OFF) +OPTION(WITH_GAMEENGINE "Enable Game Engine" ON) +OPTION(WITH_BULLET "Enable Bullet (Physics Engine)" ON) +OPTION(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON) +OPTION(WITH_ELBEEM "Enable Elbeem (Fluid Simulation)" ON) +OPTION(WITH_QUICKTIME "Enable Quicktime Support" OFF) +OPTION(WITH_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON) +OPTION(WITH_DDS "Enable DDS Support" ON) +OPTION(WITH_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF) +OPTION(WITH_PYTHON "Enable Embedded Python API" ON) +OPTION(WITH_SDL "Enable SDL for sound and joystick support" ON) +OPTION(WITH_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org/)" OFF) +OPTION(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON) +OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OFF) +OPTION(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF) +OPTION(WITH_FFTW3 "Enable FFTW3 support" OFF) +OPTION(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" OFF) +OPTION(WITH_INSTALL "Install accompanying scripts and language files needed to run blender" ON) IF(NOT WITH_GAMEENGINE AND WITH_PLAYER) MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE") @@ -102,10 +102,10 @@ IF(UNIX AND NOT APPLE) ENDIF(WITH_OPENAL) IF(WITH_JACK) - SET(JACK /usr) - SET(JACK_INC ${JACK}/include/jack) - SET(JACK_LIB jack) - SET(JACK_LIBPATH ${JACK}/lib) + SET(JACK /usr) + SET(JACK_INC ${JACK}/include/jack) + SET(JACK_LIB jack) + SET(JACK_LIBPATH ${JACK}/lib) ENDIF(WITH_JACK) FIND_LIBRARY(INTL_LIBRARY @@ -239,10 +239,10 @@ IF(WIN32) ENDIF(CMAKE_CL_64) IF(WITH_JACK) - SET(JACK ${LIBDIR}/jack) - SET(JACK_INC ${JACK}/include/jack) - SET(JACK_LIB jack) - SET(JACK_LIBPATH ${JACK}/lib) + SET(JACK ${LIBDIR}/jack) + SET(JACK_INC ${JACK}/include/jack) + SET(JACK_LIB jack) + SET(JACK_LIBPATH ${JACK}/lib) ENDIF(WITH_JACK) IF(CMAKE_CL_64) @@ -268,10 +268,10 @@ IF(WIN32) SET(ICONV_LIBPATH ${ICONV}/lib) IF(WITH_FFTW3) - SET(FFTW3 ${LIBDIR}/fftw3) - SET(FFTW3_INC ${FFTW3}/include) - SET(FFTW3_LIB libfftw) - SET(FFTW3_LIBPATH ${FFTW3}/lib) + SET(FFTW3 ${LIBDIR}/fftw3) + SET(FFTW3_INC ${FFTW3}/include) + SET(FFTW3_LIB libfftw) + SET(FFTW3_LIBPATH ${FFTW3}/lib) ENDIF(WITH_FFTW3) SET(GETTEXT ${LIBDIR}/gettext) @@ -292,12 +292,12 @@ IF(WIN32) SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/IlmImf ${OPENEXR}/include/Iex ${OPENEXR}/include/Imath) SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread) IF (MSVC80) - SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005) + SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005) ELSE (MSVC80) - SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc) + SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc) ENDIF(MSVC80) IF (MSVC90) - SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008) + SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008) ENDIF(MSVC90) @@ -317,9 +317,9 @@ IF(WIN32) SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib) IF(CMAKE_CL_64) - SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 ) + SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 ) ELSE(CMAKE_CL_64) - SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm) + SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm) ENDIF(CMAKE_CL_64) SET(CMAKE_CXX_FLAGS_DEBUG "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE) @@ -355,10 +355,11 @@ IF(WIN32) SET(WINTAB_INC ${LIBDIR}/wintab/include) IF(CMAKE_CL_64) - SET(PLATFORM_LINKFLAGS "/MANIFEST:NO /MANIFESTUAC:NO /MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ") + SET(PLATFORM_LINKFLAGS "/MANIFEST:NO /MANIFESTUAC:NO /MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ") ELSE(CMAKE_CL_64) - SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ") + SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ") ENDIF(CMAKE_CL_64) + SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ") ENDIF(WIN32) @@ -379,10 +380,10 @@ IF(APPLE) ENDIF(WITH_OPENAL) IF(WITH_JACK) - SET(JACK /usr) - SET(JACK_INC ${JACK}/include/jack) - SET(JACK_LIB jack) - SET(JACK_LIBPATH ${JACK}/lib) + SET(JACK /usr) + SET(JACK_INC ${JACK}/include/jack) + SET(JACK_LIB jack) + SET(JACK_LIBPATH ${JACK}/lib) ENDIF(WITH_JACK) SET(PYTHON_VERSION 3.1) diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c index e56d8f173e5..f8e3b3c5ad2 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -317,11 +317,14 @@ static int ch_is_op(char op) case '*': case '/': case '|': + case '&': + case '~': case '<': case '>': case '^': case '!': case '=': + case '%': return 1; default: return 0; diff --git a/source/blender/makesrna/intern/rna_sequence.c b/source/blender/makesrna/intern/rna_sequence.c index 06f9972d93f..71f5b480061 100644 --- a/source/blender/makesrna/intern/rna_sequence.c +++ b/source/blender/makesrna/intern/rna_sequence.c @@ -742,7 +742,7 @@ static void rna_def_sound(BlenderRNA *brna) RNA_def_struct_sdna(srna, "Sequence"); prop= RNA_def_property(srna, "sound", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "UnknownType"); + RNA_def_property_struct_type(prop, "Sound"); RNA_def_property_ui_text(prop, "Sound", "Sound datablock used by this sequence (RAM audio only)."); prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH); From 55b6230464a140c62ec4cea4e11a4a05c8910d13 Mon Sep 17 00:00:00 2001 From: Robin Allen Date: Mon, 17 Aug 2009 18:37:58 +0000 Subject: [PATCH 100/577] Made texture nodes accessible in the interface. * Exposed Tex.use_nodes, Tex.nodetree, MTex.which_output in RNA * Added node controls to texture buttons (Use Nodes and Use Output) * Made new texture outputs have unique names by default, though unique names still aren't required. Note: The preview window in the texture buttons only takes which_output into account when in "material" mode, and in the material half of "both" mode; the plain texture display ignores the user's output choice. This is because ED_preview_draw draws a Tex* and not an MTex* -- still some work to do here. --- release/ui/buttons_texture.py | 194 ++++++++---------- source/blender/makesrna/intern/rna_texture.c | 77 ++++++- .../nodes/intern/TEX_nodes/TEX_output.c | 63 +++++- source/blender/nodes/intern/TEX_util.c | 15 +- 4 files changed, 232 insertions(+), 117 deletions(-) diff --git a/release/ui/buttons_texture.py b/release/ui/buttons_texture.py index 51a90b2c9ee..a1b89bec0ce 100644 --- a/release/ui/buttons_texture.py +++ b/release/ui/buttons_texture.py @@ -7,7 +7,8 @@ class TextureButtonsPanel(bpy.types.Panel): __context__ = "texture" def poll(self, context): - return (context.texture and context.texture.type != 'NONE') + tex = context.texture + return (tex and (tex.type != 'NONE' or tex.use_nodes)) class TEXTURE_PT_preview(TextureButtonsPanel): __label__ = "Preview" @@ -31,7 +32,7 @@ class TEXTURE_PT_preview(TextureButtonsPanel): layout.template_preview(tex, parent=br) else: layout.template_preview(tex) - + class TEXTURE_PT_context_texture(TextureButtonsPanel): __show_header__ = False @@ -61,25 +62,62 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel): elif tex: split.template_ID(space, "pin_id") - if (not space.pin_id) and ( context.sculpt_object or \ - context.vertex_paint_object or \ - context.weight_paint_object or \ - context.texture_paint_object \ - ): + if (not space.pin_id) and ( + context.sculpt_object or + context.vertex_paint_object or + context.weight_paint_object or + context.texture_paint_object + ): split.itemR(space, "brush_texture", text="Brush", toggle=True) if tex: + layout.itemR(tex, "use_nodes") + split = layout.split(percentage=0.2) - - split.itemL(text="Type:") - split.itemR(tex, "type", text="") + + if tex.use_nodes: + slot = context.texture_slot + split.itemL(text="Output:") + split.itemR(slot, "output_node", text="") -class TEXTURE_PT_mapping(TextureButtonsPanel): + else: + split.itemL(text="Type:") + split.itemR(tex, "type", text="") + +class TEXTURE_PT_colors(TextureButtonsPanel): + __label__ = "Colors" + __default_closed__ = True + + def draw(self, context): + layout = self.layout + + tex = context.texture + + layout.itemR(tex, "use_color_ramp", text="Ramp") + if tex.use_color_ramp: + layout.template_color_ramp(tex.color_ramp, expand=True) + + split = layout.split() + + split.itemR(tex, "rgb_factor", text="Multiply RGB") + + col = split.column() + col.itemL(text="Adjust:") + col.itemR(tex, "brightness") + col.itemR(tex, "contrast") + +# Texture Slot Panels # + +class TextureSlotPanel(TextureButtonsPanel): + def poll(self, context): + return ( + context.texture_slot and + TextureButtonsPanel.poll(self, context) + ) + +class TEXTURE_PT_mapping(TextureSlotPanel): __label__ = "Mapping" - def poll(self, context): - return (context.texture_slot and context.texture and context.texture.type != 'NONE') - def draw(self, context): layout = self.layout @@ -150,12 +188,9 @@ class TEXTURE_PT_mapping(TextureButtonsPanel): row.column().itemR(tex, "offset") row.column().itemR(tex, "size") -class TEXTURE_PT_influence(TextureButtonsPanel): +class TEXTURE_PT_influence(TextureSlotPanel): __label__ = "Influence" - def poll(self, context): - return (context.texture_slot and context.texture and context.texture.type != 'NONE' and (not context.brush)) - def draw(self, context): layout = self.layout @@ -235,36 +270,16 @@ class TEXTURE_PT_influence(TextureButtonsPanel): if ma or wo: col.itemR(tex, "default_value", text="DVar", slider=True) -class TEXTURE_PT_colors(TextureButtonsPanel): - __label__ = "Colors" - __default_closed__ = True - - def draw(self, context): - layout = self.layout - - tex = context.texture - - layout.itemR(tex, "use_color_ramp", text="Ramp") - if tex.use_color_ramp: - layout.template_color_ramp(tex.color_ramp, expand=True) - - split = layout.split() - - split.itemR(tex, "rgb_factor", text="Multiply RGB") - - col = split.column() - col.itemL(text="Adjust:") - col.itemR(tex, "brightness") - col.itemR(tex, "contrast") - # Texture Type Panels # -class TEXTURE_PT_clouds(TextureButtonsPanel): - __label__ = "Clouds" - +class TextureTypePanel(TextureButtonsPanel): def poll(self, context): tex = context.texture - return (tex and tex.type == 'CLOUDS') + return (tex and tex.type == self.tex_type and not tex.use_nodes) + +class TEXTURE_PT_clouds(TextureTypePanel): + __label__ = "Clouds" + tex_type = 'CLOUDS' def draw(self, context): layout = self.layout @@ -281,12 +296,9 @@ class TEXTURE_PT_clouds(TextureButtonsPanel): flow.itemR(tex, "noise_depth", text="Depth") flow.itemR(tex, "nabla", text="Nabla") -class TEXTURE_PT_wood(TextureButtonsPanel): +class TEXTURE_PT_wood(TextureTypePanel): __label__ = "Wood" - - def poll(self, context): - tex = context.texture - return (tex and tex.type == 'WOOD') + tex_type = 'WOOD' def draw(self, context): layout = self.layout @@ -308,13 +320,10 @@ class TEXTURE_PT_wood(TextureButtonsPanel): flow.itemR(tex, "turbulence") flow.itemR(tex, "nabla") -class TEXTURE_PT_marble(TextureButtonsPanel): +class TEXTURE_PT_marble(TextureTypePanel): __label__ = "Marble" + tex_type = 'MARBLE' - def poll(self, context): - tex = context.texture - return (tex and tex.type == 'MARBLE') - def draw(self, context): layout = self.layout @@ -332,13 +341,10 @@ class TEXTURE_PT_marble(TextureButtonsPanel): flow.itemR(tex, "turbulence") flow.itemR(tex, "nabla") -class TEXTURE_PT_magic(TextureButtonsPanel): +class TEXTURE_PT_magic(TextureTypePanel): __label__ = "Magic" + tex_type = 'MAGIC' - def poll(self, context): - tex = context.texture - return (tex and tex.type == 'MAGIC') - def draw(self, context): layout = self.layout @@ -348,13 +354,10 @@ class TEXTURE_PT_magic(TextureButtonsPanel): row.itemR(tex, "noise_depth", text="Depth") row.itemR(tex, "turbulence") -class TEXTURE_PT_blend(TextureButtonsPanel): +class TEXTURE_PT_blend(TextureTypePanel): __label__ = "Blend" + tex_type = 'BLEND' - def poll(self, context): - tex = context.texture - return (tex and tex.type == 'BLEND') - def draw(self, context): layout = self.layout @@ -363,13 +366,10 @@ class TEXTURE_PT_blend(TextureButtonsPanel): layout.itemR(tex, "progression") layout.itemR(tex, "flip_axis") -class TEXTURE_PT_stucci(TextureButtonsPanel): +class TEXTURE_PT_stucci(TextureTypePanel): __label__ = "Stucci" + tex_type = 'STUCCI' - def poll(self, context): - tex = context.texture - return (tex and tex.type == 'STUCCI') - def draw(self, context): layout = self.layout @@ -384,13 +384,10 @@ class TEXTURE_PT_stucci(TextureButtonsPanel): row.itemR(tex, "noise_size", text="Size") row.itemR(tex, "turbulence") -class TEXTURE_PT_image(TextureButtonsPanel): +class TEXTURE_PT_image(TextureTypePanel): __label__ = "Image" + tex_type = 'IMAGE' - def poll(self, context): - tex = context.texture - return (tex and tex.type == 'IMAGE') - def draw(self, context): layout = self.layout @@ -398,14 +395,11 @@ class TEXTURE_PT_image(TextureButtonsPanel): layout.template_texture_image(tex) -class TEXTURE_PT_image_sampling(TextureButtonsPanel): +class TEXTURE_PT_image_sampling(TextureTypePanel): __label__ = "Image Sampling" __default_closed__ = True + tex_type = 'IMAGE' - def poll(self, context): - tex = context.texture - return (tex and tex.type == 'IMAGE') - def draw(self, context): layout = self.layout @@ -449,14 +443,11 @@ class TEXTURE_PT_image_sampling(TextureButtonsPanel): else: col.itemR(tex, "filter_eccentricity", text="Eccentricity") -class TEXTURE_PT_image_mapping(TextureButtonsPanel): +class TEXTURE_PT_image_mapping(TextureTypePanel): __label__ = "Image Mapping" __default_closed__ = True + tex_type = 'IMAGE' - def poll(self, context): - tex = context.texture - return (tex and tex.type == 'IMAGE') - def draw(self, context): layout = self.layout @@ -499,13 +490,10 @@ class TEXTURE_PT_image_mapping(TextureButtonsPanel): col.itemR(tex, "crop_max_x", text="X") col.itemR(tex, "crop_max_y", text="Y") -class TEXTURE_PT_plugin(TextureButtonsPanel): +class TEXTURE_PT_plugin(TextureTypePanel): __label__ = "Plugin" + tex_type = 'PLUGIN' - def poll(self, context): - tex = context.texture - return (tex and tex.type == 'PLUGIN') - def draw(self, context): layout = self.layout @@ -513,13 +501,10 @@ class TEXTURE_PT_plugin(TextureButtonsPanel): layout.itemL(text="Nothing yet") -class TEXTURE_PT_envmap(TextureButtonsPanel): +class TEXTURE_PT_envmap(TextureTypePanel): __label__ = "Environment Map" + tex_type = 'ENVIRONMENT_MAP' - def poll(self, context): - tex = context.texture - return (tex and tex.type == 'ENVIRONMENT_MAP') - def draw(self, context): layout = self.layout @@ -527,13 +512,10 @@ class TEXTURE_PT_envmap(TextureButtonsPanel): layout.itemL(text="Nothing yet") -class TEXTURE_PT_musgrave(TextureButtonsPanel): +class TEXTURE_PT_musgrave(TextureTypePanel): __label__ = "Musgrave" + tex_type = 'MUSGRAVE' - def poll(self, context): - tex = context.texture - return (tex and tex.type == 'MUSGRAVE') - def draw(self, context): layout = self.layout @@ -563,12 +545,9 @@ class TEXTURE_PT_musgrave(TextureButtonsPanel): row.itemR(tex, "noise_size", text="Size") row.itemR(tex, "nabla") -class TEXTURE_PT_voronoi(TextureButtonsPanel): +class TEXTURE_PT_voronoi(TextureTypePanel): __label__ = "Voronoi" - - def poll(self, context): - tex = context.texture - return (tex and tex.type == 'VORONOI') + tex_type = 'VORONOI' def draw(self, context): layout = self.layout @@ -600,13 +579,10 @@ class TEXTURE_PT_voronoi(TextureButtonsPanel): row.itemR(tex, "noise_size", text="Size") row.itemR(tex, "nabla") -class TEXTURE_PT_distortednoise(TextureButtonsPanel): +class TEXTURE_PT_distortednoise(TextureTypePanel): __label__ = "Distorted Noise" + tex_type = 'DISTORTED_NOISE' - def poll(self, context): - tex = context.texture - return (tex and tex.type == 'DISTORTED_NOISE') - def draw(self, context): layout = self.layout diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index ccb5e5b2f95..76cb9986306 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -36,6 +36,9 @@ #include "DNA_material_types.h" #include "DNA_texture_types.h" #include "DNA_world_types.h" +#include "DNA_node_types.h" + +#include "BKE_node.h" #include "WM_types.h" @@ -107,6 +110,43 @@ static void rna_TextureSlot_name_get(PointerRNA *ptr, char *str) strcpy(str, ""); } +static EnumPropertyItem *rna_TextureSlot_output_node_itemf(bContext *C, PointerRNA *ptr, int *free) +{ + MTex *mtex= ptr->data; + Tex *tex= mtex->tex; + EnumPropertyItem *item= NULL; + int totitem= 0; + + if(tex) + { + bNodeTree *ntree= tex->nodetree; + if(ntree) + { + EnumPropertyItem tmp= {0, "", 0, "", ""}; + bNode *node; + + tmp.value = 0; + tmp.name = "Not Specified"; + tmp.identifier = "NOT_SPECIFIED"; + RNA_enum_item_add(&item, &totitem, &tmp); + + for(node= ntree->nodes.first; node; node= node->next) { + if(node->type == TEX_NODE_OUTPUT) { + tmp.value= node->custom1; + tmp.name= ((TexNodeOutput*)node->storage)->name; + tmp.identifier = tmp.name; + RNA_enum_item_add(&item, &totitem, &tmp); + } + } + } + } + + RNA_enum_item_end(&item, &totitem); + + *free = 1; + return item; +} + static void rna_Texture_use_color_ramp_set(PointerRNA *ptr, int value) { Tex *tex= (Tex*)ptr->data; @@ -118,6 +158,18 @@ static void rna_Texture_use_color_ramp_set(PointerRNA *ptr, int value) tex->coba= add_colorband(0); } +void rna_Texture_use_nodes_set(PointerRNA *ptr, int v) +{ + Tex *tex= (Tex*)ptr->data; + + tex->use_nodes = v; + tex->type = 0; + + if(v && tex->nodetree==NULL) { + node_texture_default(tex); + } +} + static void rna_ImageTexture_mipmap_set(PointerRNA *ptr, int value) { Tex *tex= (Tex*)ptr->data; @@ -287,6 +339,10 @@ static void rna_def_mtex(BlenderRNA *brna) {MTEX_MAP_MODE_3D, "3D", 0, "3D", ""}, {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem output_node_items[] = { + {0, "DUMMY", 0, "Dummy", ""}, + {0, NULL, 0, NULL, NULL}}; + srna= RNA_def_struct(brna, "TextureSlot", NULL); RNA_def_struct_sdna(srna, "MTex"); RNA_def_struct_ui_text(srna, "Texture Slot", "Texture slot defining the mapping and influence of a texture."); @@ -373,6 +429,13 @@ static void rna_def_mtex(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0, 5, 10, 3); RNA_def_property_ui_text(prop, "Normal Factor", "Amount texture affects normal values."); RNA_def_property_update(prop, NC_TEXTURE, NULL); + + prop= RNA_def_property(srna, "output_node", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "which_output"); + RNA_def_property_enum_items(prop, output_node_items); + RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_TextureSlot_output_node_itemf"); + RNA_def_property_ui_text(prop, "Output Node", "Which output node to use, for node-based textures."); + RNA_def_property_update(prop, NC_TEXTURE, NULL); } static void rna_def_filter_size_common(StructRNA *srna) @@ -1285,7 +1348,19 @@ static void rna_def_texture(BlenderRNA *brna) RNA_def_property_range(prop, 0, 2); RNA_def_property_ui_text(prop, "RGB Factor", ""); RNA_def_property_update(prop, NC_TEXTURE, NULL); - + + /* nodetree */ + prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1); + RNA_def_property_boolean_funcs(prop, NULL, "rna_Texture_use_nodes_set"); + RNA_def_property_ui_text(prop, "Use Nodes", "Make this a node-based texture"); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + + prop= RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "nodetree"); + RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node-based textures"); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + rna_def_animdata_common(srna); /* specific types */ diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_output.c b/source/blender/nodes/intern/TEX_nodes/TEX_output.c index 060ea8d7e67..d0538d11900 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_output.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_output.c @@ -64,11 +64,64 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) } } -static void init(bNode* node) +static void unique_name(bNode *node) { - TexNodeOutput *tno = MEM_callocN(sizeof(TexNodeOutput), "TEX_output"); - strcpy(tno->name, "Default"); - node->storage= tno; + TexNodeOutput *tno = (TexNodeOutput *)node->storage; + char *new_name = 0; + int new_len; + int suffix; + bNode *i; + char *name = tno->name; + + i = node; + while(i->prev) i = i->prev; + for(; i; i=i->next) { + if( + i == node || + i->type != TEX_NODE_OUTPUT || + strcmp(name, ((TexNodeOutput*)(i->storage))->name) + ) + continue; + + if(!new_name) { + int len = strlen(name); + if(len >= 4 && sscanf(name + len - 4, ".%03d", &suffix) == 1) { + new_len = len; + } else { + suffix = 0; + new_len = len + 4; + if(new_len > 31) + new_len = 31; + } + + new_name = malloc(new_len + 1); + strcpy(new_name, name); + name = new_name; + } + sprintf(new_name + new_len - 4, ".%03d", ++suffix); + } + + if(new_name) { + strcpy(tno->name, new_name); + free(new_name); + } +} + +static void init(bNode *node) +{ + TexNodeOutput *tno = MEM_callocN(sizeof(TexNodeOutput), "TEX_output"); + node->storage= tno; + + strcpy(tno->name, "Default"); + unique_name(node); + ntreeTexAssignIndex(0, node); +} + +static void copy(bNode *orig, bNode *new) +{ + node_copy_standard_storage(orig, new); + unique_name(new); + ntreeTexAssignIndex(0, new); } @@ -85,6 +138,6 @@ bNodeType tex_node_output= { /* butfunc */ NULL, /* initfunc */ init, /* freestoragefunc */ node_free_standard_storage, - /* copystoragefunc */ node_copy_standard_storage, + /* copystoragefunc */ copy, /* id */ NULL }; diff --git a/source/blender/nodes/intern/TEX_util.c b/source/blender/nodes/intern/TEX_util.c index 867e754f960..d25decd4111 100644 --- a/source/blender/nodes/intern/TEX_util.c +++ b/source/blender/nodes/intern/TEX_util.c @@ -197,6 +197,10 @@ void ntreeTexExecTree(bNodeTree *nodes, TexResult *texres, float *coord, char do TexResult dummy_texres; TexCallData data; + /* 0 means don't care, so just use first */ + if(which_output == 0) + which_output = 1; + if(!texres) texres = &dummy_texres; data.coord = coord; data.target = texres; @@ -270,10 +274,17 @@ char* ntreeTexOutputMenu(bNodeTree *ntree) void ntreeTexAssignIndex(struct bNodeTree *ntree, struct bNode *node) { bNode *tnode; - int index = 0; + int index = 1; + + if(ntree) + tnode = ntree->nodes.first; + else { + tnode = node; + while(tnode->prev) tnode = tnode->prev; + } check_index: - for(tnode= ntree->nodes.first; tnode; tnode= tnode->next) + for(; tnode; tnode= tnode->next) if(tnode->type == TEX_NODE_OUTPUT && tnode != node) if(tnode->custom1 == index) { index ++; From 912c48442cf661bbc06ef37dd38f52a86eb7d036 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Mon, 17 Aug 2009 19:54:29 +0000 Subject: [PATCH 101/577] 2.5/Ghost: * Hopefully fixed X tablet support. The name string was not a reliable way of finding tablet anymore, so now we get the type string and search it for 'stylus' and 'eraser'. Still not very robust, but without UI I don't see how to do better. --- intern/ghost/intern/GHOST_WindowX11.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp index f9774b6df70..88ae8afd0ce 100644 --- a/intern/ghost/intern/GHOST_WindowX11.cpp +++ b/intern/ghost/intern/GHOST_WindowX11.cpp @@ -42,6 +42,9 @@ #include #include +#include +#include + // For obscure full screen mode stuuf // lifted verbatim from blut. @@ -428,7 +431,20 @@ void GHOST_WindowX11::initXInputDevices() old_handler = XSetErrorHandler(ApplicationErrorHandler) ; for(int i=0; i Date: Mon, 17 Aug 2009 20:04:28 +0000 Subject: [PATCH 102/577] New command line argument to specify render engine -E -E help: lists all available engine and then quits. (blender window might flash open and then disappear. io python scripts need to be read for all engine, so we have to load interface and not do that before like other help options). When run after -b, only builtin engines are available because of the python scripts not being read correctly bug. --- source/creator/creator.c | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/source/creator/creator.c b/source/creator/creator.c index 4f7a4afb5a6..5ecd95ecc21 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -177,6 +177,8 @@ static void print_help(void) printf (" When the filename has no #, The suffix #### is added to the filename\n"); printf (" The frame number will be added at the end of the filename.\n"); printf (" eg: blender -b foobar.blend -o //render_ -F PNG -x 1 -a\n"); + printf (" -E \tSpecify the render engine.\n"); + printf (" use -E help to list available engines.\n"); printf ("\nFormat options:\n"); printf (" -F \tSet the render format, Valid options are...\n"); printf (" \tTGA IRIS HAMX JPEG MOVIE IRIZ RAWTGA\n"); @@ -692,6 +694,47 @@ int main(int argc, char **argv) printf("\nError: you must specify a path after '-o '.\n"); } break; + case 'E': + a++; + if (a < argc) + { + if (!strcmp(argv[a],"help")) + { + RenderEngineType *type = NULL; + + for( type = R_engines.first; type; type = type->next ) + { + printf("\t%s\n", type->idname); + } + exit(0); + } + else + { + if (CTX_data_scene(C)==NULL) + { + printf("\nError: no blend loaded. order the arguments so '-E ' is after the blend is loaded.\n"); + } + else + { + Scene *scene= CTX_data_scene(C); + RenderData *rd = &scene->r; + RenderEngineType *type = NULL; + + for( type = R_engines.first; type; type = type->next ) + { + if (!strcmp(argv[a],type->idname)) + { + BLI_strncpy(rd->engine, type->idname, sizeof(rd->engine)); + } + } + } + } + } + else + { + printf("\nEngine not specified.\n"); + } + break; case 'F': a++; if (a < argc){ From f9ceeeede672a634913188c775e020c23170f4e1 Mon Sep 17 00:00:00 2001 From: Robin Allen Date: Mon, 17 Aug 2009 20:30:11 +0000 Subject: [PATCH 103/577] Slight refactor of texture nodes. Delegates now receive a TexParams* instead of float *coords. This gives texture nodes access to dxt, dyt, cfra as well as coords. This fixes the time node and allows nice sampling to be implemented. --- source/blender/blenkernel/BKE_node.h | 2 +- .../blender/nodes/intern/TEX_nodes/TEX_at.c | 8 +- .../nodes/intern/TEX_nodes/TEX_bricks.c | 20 +++-- .../nodes/intern/TEX_nodes/TEX_checker.c | 16 ++-- .../nodes/intern/TEX_nodes/TEX_compose.c | 6 +- .../nodes/intern/TEX_nodes/TEX_coord.c | 8 +- .../nodes/intern/TEX_nodes/TEX_curves.c | 13 ++- .../nodes/intern/TEX_nodes/TEX_decompose.c | 18 ++-- .../nodes/intern/TEX_nodes/TEX_distance.c | 6 +- .../nodes/intern/TEX_nodes/TEX_hueSatVal.c | 12 +-- .../nodes/intern/TEX_nodes/TEX_image.c | 8 +- .../nodes/intern/TEX_nodes/TEX_invert.c | 6 +- .../blender/nodes/intern/TEX_nodes/TEX_math.c | 8 +- .../nodes/intern/TEX_nodes/TEX_mixRgb.c | 10 +-- .../nodes/intern/TEX_nodes/TEX_output.c | 9 +- .../blender/nodes/intern/TEX_nodes/TEX_proc.c | 86 +++++++++---------- .../nodes/intern/TEX_nodes/TEX_rotate.c | 15 ++-- .../nodes/intern/TEX_nodes/TEX_scale.c | 16 ++-- .../nodes/intern/TEX_nodes/TEX_texture.c | 9 +- .../nodes/intern/TEX_nodes/TEX_translate.c | 16 ++-- .../nodes/intern/TEX_nodes/TEX_valToNor.c | 16 ++-- .../nodes/intern/TEX_nodes/TEX_valToRgb.c | 10 +-- .../nodes/intern/TEX_nodes/TEX_viewer.c | 2 +- source/blender/nodes/intern/TEX_util.c | 58 +++++++++---- source/blender/nodes/intern/TEX_util.h | 23 +++-- source/blender/render/intern/source/texture.c | 6 +- 26 files changed, 231 insertions(+), 176 deletions(-) diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 183cdaff0e6..4ac95b61a5e 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -422,7 +422,7 @@ extern struct ListBase node_all_textures; /* API */ int ntreeTexTagAnimated(struct bNodeTree *ntree); void ntreeTexUpdatePreviews( struct bNodeTree* nodetree ); -void ntreeTexExecTree(struct bNodeTree *ntree, struct TexResult *target, float *coord, char do_preview, short thread, struct Tex *tex, short which_output, int cfra); +void ntreeTexExecTree(struct bNodeTree *ntree, struct TexResult *target, float *coord, float *dxt, float *dyt, char do_preview, short thread, struct Tex *tex, short which_output, int cfra); void ntreeTexCheckCyclics(struct bNodeTree *ntree); void ntreeTexAssignIndex(struct bNodeTree *ntree, struct bNode *node); char* ntreeTexOutputMenu(struct bNodeTree *ntree); diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_at.c b/source/blender/nodes/intern/TEX_nodes/TEX_at.c index 80f232ccd0c..4d714d91130 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_at.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_at.c @@ -38,12 +38,14 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { + TexParams np = *p; float new_coord[3]; + np.coord = new_coord; - tex_input_vec(new_coord, in[1], coord, thread); - tex_input_rgba(out, in[0], new_coord, thread); + tex_input_vec(new_coord, in[1], p, thread); + tex_input_rgba(out, in[0], &np, thread); } static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_bricks.c b/source/blender/nodes/intern/TEX_nodes/TEX_bricks.c index 80cbd6188ee..f1f3b0919ae 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_bricks.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_bricks.c @@ -21,7 +21,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Robin Allen * * ***** END GPL LICENSE BLOCK ***** */ @@ -57,8 +57,10 @@ static float noise(int n) /* fast integer noise */ return 0.5f * ((float)nn / 1073741824.0f); } -static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { + float *coord = p->coord; + float x = coord[0]; float y = coord[1]; @@ -71,14 +73,14 @@ static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, shor float bricks2[4]; float mortar[4]; - float mortar_thickness = tex_input_value(in[3], coord, thread); - float bias = tex_input_value(in[4], coord, thread); - float brick_width = tex_input_value(in[5], coord, thread); - float row_height = tex_input_value(in[6], coord, thread); + float mortar_thickness = tex_input_value(in[3], p, thread); + float bias = tex_input_value(in[4], p, thread); + float brick_width = tex_input_value(in[5], p, thread); + float row_height = tex_input_value(in[6], p, thread); - tex_input_rgba(bricks1, in[0], coord, thread); - tex_input_rgba(bricks2, in[1], coord, thread); - tex_input_rgba(mortar, in[2], coord, thread); + tex_input_rgba(bricks1, in[0], p, thread); + tex_input_rgba(bricks2, in[1], p, thread); + tex_input_rgba(mortar, in[2], p, thread); rownum = (int)floor(y / row_height); diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_checker.c b/source/blender/nodes/intern/TEX_nodes/TEX_checker.c index 60357782e25..b889f1e2164 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_checker.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_checker.c @@ -21,7 +21,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Robin Allen * * ***** END GPL LICENSE BLOCK ***** */ @@ -40,12 +40,12 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { - float x = coord[0]; - float y = coord[1]; - float z = coord[2]; - float sz = tex_input_value(in[2], coord, thread); + float x = p->coord[0]; + float y = p->coord[1]; + float z = p->coord[2]; + float sz = tex_input_value(in[2], p, thread); /* 0.00001 because of unit sized stuff */ int xi = (int)fabs(floor(0.00001 + x / sz)); @@ -53,9 +53,9 @@ static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, shor int zi = (int)fabs(floor(0.00001 + z / sz)); if( (xi % 2 == yi % 2) == (zi % 2) ) { - tex_input_rgba(out, in[0], coord, thread); + tex_input_rgba(out, in[0], p, thread); } else { - tex_input_rgba(out, in[1], coord, thread); + tex_input_rgba(out, in[1], p, thread); } } diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_compose.c b/source/blender/nodes/intern/TEX_nodes/TEX_compose.c index 26576befa3e..9fc4b2ff7c2 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_compose.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_compose.c @@ -21,7 +21,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Robin Allen * * ***** END GPL LICENSE BLOCK ***** */ @@ -40,11 +40,11 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { int i; for(i = 0; i < 4; i++) - out[i] = tex_input_value(in[i], coord, thread); + out[i] = tex_input_value(in[i], p, thread); } static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_coord.c b/source/blender/nodes/intern/TEX_nodes/TEX_coord.c index da487c190af..e5c2b309fb3 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_coord.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_coord.c @@ -33,11 +33,11 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void vectorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void vectorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { - out[0] = coord[0]; - out[1] = coord[1]; - out[2] = coord[2]; + out[0] = p->coord[0]; + out[1] = p->coord[1]; + out[2] = p->coord[2]; } static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_curves.c b/source/blender/nodes/intern/TEX_nodes/TEX_curves.c index 7d1366b5b18..61ebcea7360 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_curves.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_curves.c @@ -21,7 +21,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Robin Allen * * ***** END GPL LICENSE BLOCK ***** */ @@ -36,14 +36,13 @@ static bNodeSocketType time_outputs[]= { { -1, 0, "" } }; -static void time_colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void time_colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { /* stack order output: fac */ float fac= 0.0f; - // XXX SOLVE! these functions should get the TexCallData pointer -// if(node->custom1 < node->custom2) -// fac = (scene->r.cfra - node->custom1)/(float)(node->custom2-node->custom1); + if(node->custom1 < node->custom2) + fac = (p->cfra - node->custom1)/(float)(node->custom2-node->custom1); fac = curvemapping_evaluateF(node->storage, 0, fac); out[0] = CLAMPIS(fac, 0.0f, 1.0f); @@ -90,10 +89,10 @@ static bNodeSocketType rgb_outputs[]= { { -1, 0, "" } }; -static void rgb_colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void rgb_colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { float cin[4]; - tex_input_rgba(cin, in[0], coord, thread); + tex_input_rgba(cin, in[0], p, thread); curvemapping_evaluateRGBF(node->storage, out, cin); out[3] = cin[3]; diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_decompose.c b/source/blender/nodes/intern/TEX_nodes/TEX_decompose.c index c08eb12a18f..f7a409f0230 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_decompose.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_decompose.c @@ -21,7 +21,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Robin Allen * * ***** END GPL LICENSE BLOCK ***** */ @@ -41,27 +41,27 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void valuefn_r(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void valuefn_r(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { - tex_input_rgba(out, in[0], coord, thread); + tex_input_rgba(out, in[0], p, thread); *out = out[0]; } -static void valuefn_g(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void valuefn_g(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { - tex_input_rgba(out, in[0], coord, thread); + tex_input_rgba(out, in[0], p, thread); *out = out[1]; } -static void valuefn_b(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void valuefn_b(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { - tex_input_rgba(out, in[0], coord, thread); + tex_input_rgba(out, in[0], p, thread); *out = out[2]; } -static void valuefn_a(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void valuefn_a(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { - tex_input_rgba(out, in[0], coord, thread); + tex_input_rgba(out, in[0], p, thread); *out = out[3]; } diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_distance.c b/source/blender/nodes/intern/TEX_nodes/TEX_distance.c index d23eb6bc589..4e145e26b72 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_distance.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_distance.c @@ -41,12 +41,12 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void valuefn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { float coord1[3], coord2[3]; - tex_input_vec(coord1, in[0], coord, thread); - tex_input_vec(coord2, in[1], coord, thread); + tex_input_vec(coord1, in[0], p, thread); + tex_input_vec(coord2, in[1], p, thread); *out = VecLenf(coord2, coord1); } diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c b/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c index bb1a49fb235..192c7a39ee8 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_hueSatVal.c @@ -65,15 +65,15 @@ static void do_hue_sat_fac(bNode *node, float *out, float hue, float sat, float } } -static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { - float hue = tex_input_value(in[0], coord, thread); - float sat = tex_input_value(in[1], coord, thread); - float val = tex_input_value(in[2], coord, thread); - float fac = tex_input_value(in[3], coord, thread); + float hue = tex_input_value(in[0], p, thread); + float sat = tex_input_value(in[1], p, thread); + float val = tex_input_value(in[2], p, thread); + float fac = tex_input_value(in[3], p, thread); float col[4]; - tex_input_rgba(col, in[4], coord, thread); + tex_input_rgba(col, in[4], p, thread); hue += 0.5f; /* [-.5, .5] -> [0, 1] */ diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_image.c b/source/blender/nodes/intern/TEX_nodes/TEX_image.c index b84088da154..0a55af70b52 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_image.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_image.c @@ -22,7 +22,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Robin Allen * * ***** END GPL LICENSE BLOCK ***** */ @@ -34,10 +34,10 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { - float x = coord[0]; - float y = coord[1]; + float x = p->coord[0]; + float y = p->coord[1]; Image *ima= (Image *)node->id; ImageUser *iuser= (ImageUser *)node->storage; diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_invert.c b/source/blender/nodes/intern/TEX_nodes/TEX_invert.c index 09716951009..5663f897ff5 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_invert.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_invert.c @@ -21,7 +21,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Robin Allen * * ***** END GPL LICENSE BLOCK ***** */ @@ -39,11 +39,11 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { float col[4]; - tex_input_rgba(col, in[0], coord, thread); + tex_input_rgba(col, in[0], p, thread); col[0] = 1.0f - col[0]; col[1] = 1.0f - col[1]; diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_math.c b/source/blender/nodes/intern/TEX_nodes/TEX_math.c index bac91fc0901..4ee04140fca 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_math.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_math.c @@ -21,7 +21,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Robin Allen * * ***** END GPL LICENSE BLOCK ***** */ @@ -42,10 +42,10 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void valuefn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { - float in0 = tex_input_value(in[0], coord, thread); - float in1 = tex_input_value(in[1], coord, thread); + float in0 = tex_input_value(in[0], p, thread); + float in1 = tex_input_value(in[1], p, thread); switch(node->custom1){ diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_mixRgb.c b/source/blender/nodes/intern/TEX_nodes/TEX_mixRgb.c index b1ccb7a3d07..24bdde70127 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_mixRgb.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_mixRgb.c @@ -21,7 +21,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Robin Allen * * ***** END GPL LICENSE BLOCK ***** */ @@ -41,13 +41,13 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { - float fac = tex_input_value(in[0], coord, thread); + float fac = tex_input_value(in[0], p, thread); float col1[4], col2[4]; - tex_input_rgba(col1, in[1], coord, thread); - tex_input_rgba(col2, in[2], coord, thread); + tex_input_rgba(col1, in[1], p, thread); + tex_input_rgba(col2, in[2], p, thread); CLAMP(fac, 0.0f, 1.0f); diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_output.c b/source/blender/nodes/intern/TEX_nodes/TEX_output.c index d0538d11900..355de796c7e 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_output.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_output.c @@ -21,7 +21,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Robin Allen * * ***** END GPL LICENSE BLOCK ***** */ @@ -49,14 +49,17 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) if(!cdata->do_preview) { if(cdata->which_output == node->custom1) { - tex_input_rgba(&target->tr, in[0], cdata->coord, cdata->thread); + TexParams params; + params_from_cdata(¶ms, cdata); + + tex_input_rgba(&target->tr, in[0], ¶ms, cdata->thread); target->tin = (target->tr + target->tg + target->tb) / 3.0f; target->talpha = 1.0f; if(target->nor) { if(in[1]->hasinput) - tex_input_vec(target->nor, in[1], cdata->coord, cdata->thread); + tex_input_vec(target->nor, in[1], ¶ms, cdata->thread); else target->nor = 0; } diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_proc.c b/source/blender/nodes/intern/TEX_nodes/TEX_proc.c index ec65cf186a8..ce7324e2085 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_proc.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_proc.c @@ -21,7 +21,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Robin Allen * * ***** END GPL LICENSE BLOCK ***** */ @@ -51,7 +51,7 @@ static bNodeSocketType outputs_color_only[]= { { SOCK_RGBA, 1, "Color 2", 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f } /* Calls multitex and copies the result to the outputs. Called by xxx_exec, which handles inputs. */ -static void do_proc(float *result, float *coord, float *col1, float *col2, char is_normal, Tex *tex, short thread) +static void do_proc(float *result, TexParams *p, float *col1, float *col2, char is_normal, Tex *tex, short thread) { TexResult texres; int textype; @@ -62,7 +62,7 @@ static void do_proc(float *result, float *coord, float *col1, float *col2, char else texres.nor = NULL; - textype = multitex_thread(tex, coord, 0, 0, 0, &texres, thread, 0); + textype = multitex_thread(tex, p->coord, p->dxt, p->dyt, 0, &texres, thread, 0); if(is_normal) return; @@ -76,11 +76,11 @@ static void do_proc(float *result, float *coord, float *col1, float *col2, char } } -typedef void (*MapFn) (Tex *tex, bNodeStack **in, float *coord, short thread); +typedef void (*MapFn) (Tex *tex, bNodeStack **in, TexParams *p, short thread); static void texfn( float *result, - float *coord, + TexParams *p, bNode *node, bNodeStack **in, char is_normal, @@ -89,12 +89,12 @@ static void texfn( { Tex tex = *((Tex*)(node->storage)); float col1[4], col2[4]; - tex_input_rgba(col1, in[0], coord, thread); - tex_input_rgba(col2, in[1], coord, thread); + tex_input_rgba(col1, in[0], p, thread); + tex_input_rgba(col2, in[1], p, thread); - map_inputs(&tex, in, coord, thread); + map_inputs(&tex, in, p, thread); - do_proc(result, coord, col1, col2, is_normal, &tex, thread); + do_proc(result, p, col1, col2, is_normal, &tex, thread); } static int count_outputs(bNode *node) @@ -110,17 +110,17 @@ static int count_outputs(bNode *node) /* Boilerplate generators */ #define ProcNoInputs(name) \ - static void name##_map_inputs(Tex *tex, bNodeStack **in, float *coord, short thread) \ + static void name##_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread) \ {} #define ProcDef(name) \ - static void name##_colorfn(float *result, float *coord, bNode *node, bNodeStack **in, short thread) \ + static void name##_colorfn(float *result, TexParams *p, bNode *node, bNodeStack **in, short thread) \ { \ - texfn(result, coord, node, in, 0, &name##_map_inputs, thread); \ + texfn(result, p, node, in, 0, &name##_map_inputs, thread); \ } \ - static void name##_normalfn(float *result, float *coord, bNode *node, bNodeStack **in, short thread) \ + static void name##_normalfn(float *result, TexParams *p, bNode *node, bNodeStack **in, short thread) \ { \ - texfn(result, coord, node, in, 1, &name##_map_inputs, thread); \ + texfn(result, p, node, in, 1, &name##_map_inputs, thread); \ } \ static void name##_exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) \ { \ @@ -144,15 +144,15 @@ static bNodeSocketType voronoi_inputs[]= { { -1, 0, "" } }; -static void voronoi_map_inputs(Tex *tex, bNodeStack **in, float *coord, short thread) +static void voronoi_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread) { - tex->vn_w1 = tex_input_value(in[I+0], coord, thread); - tex->vn_w2 = tex_input_value(in[I+1], coord, thread); - tex->vn_w3 = tex_input_value(in[I+2], coord, thread); - tex->vn_w4 = tex_input_value(in[I+3], coord, thread); + tex->vn_w1 = tex_input_value(in[I+0], p, thread); + tex->vn_w2 = tex_input_value(in[I+1], p, thread); + tex->vn_w3 = tex_input_value(in[I+2], p, thread); + tex->vn_w4 = tex_input_value(in[I+3], p, thread); - tex->ns_outscale = tex_input_value(in[I+4], coord, thread); - tex->noisesize = tex_input_value(in[I+5], coord, thread); + tex->ns_outscale = tex_input_value(in[I+4], p, thread); + tex->noisesize = tex_input_value(in[I+5], p, thread); } ProcDef(voronoi) @@ -170,9 +170,9 @@ static bNodeSocketType magic_inputs[]= { { SOCK_VALUE, 1, "Turbulence", 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 200.0f }, { -1, 0, "" } }; -static void magic_map_inputs(Tex *tex, bNodeStack **in, float *coord, short thread) +static void magic_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread) { - tex->turbul = tex_input_value(in[I+0], coord, thread); + tex->turbul = tex_input_value(in[I+0], p, thread); } ProcDef(magic) @@ -183,10 +183,10 @@ static bNodeSocketType marble_inputs[]= { { SOCK_VALUE, 1, "Turbulence", 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 200.0f }, { -1, 0, "" } }; -static void marble_map_inputs(Tex *tex, bNodeStack **in, float *coord, short thread) +static void marble_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread) { - tex->noisesize = tex_input_value(in[I+0], coord, thread); - tex->turbul = tex_input_value(in[I+1], coord, thread); + tex->noisesize = tex_input_value(in[I+0], p, thread); + tex->turbul = tex_input_value(in[I+1], p, thread); } ProcDef(marble) @@ -196,9 +196,9 @@ static bNodeSocketType clouds_inputs[]= { { SOCK_VALUE, 1, "Size", 0.25f, 0.0f, 0.0f, 0.0f, 0.0001f, 2.0f }, { -1, 0, "" } }; -static void clouds_map_inputs(Tex *tex, bNodeStack **in, float *coord, short thread) +static void clouds_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread) { - tex->noisesize = tex_input_value(in[I+0], coord, thread); + tex->noisesize = tex_input_value(in[I+0], p, thread); } ProcDef(clouds) @@ -209,10 +209,10 @@ static bNodeSocketType distnoise_inputs[]= { { SOCK_VALUE, 1, "Distortion", 1.00f, 0.0f, 0.0f, 0.0f, 0.0000f, 10.0f }, { -1, 0, "" } }; -static void distnoise_map_inputs(Tex *tex, bNodeStack **in, float *coord, short thread) +static void distnoise_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread) { - tex->noisesize = tex_input_value(in[I+0], coord, thread); - tex->dist_amount = tex_input_value(in[I+1], coord, thread); + tex->noisesize = tex_input_value(in[I+0], p, thread); + tex->dist_amount = tex_input_value(in[I+1], p, thread); } ProcDef(distnoise) @@ -223,10 +223,10 @@ static bNodeSocketType wood_inputs[]= { { SOCK_VALUE, 1, "Turbulence", 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 200.0f }, { -1, 0, "" } }; -static void wood_map_inputs(Tex *tex, bNodeStack **in, float *coord, short thread) +static void wood_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread) { - tex->noisesize = tex_input_value(in[I+0], coord, thread); - tex->turbul = tex_input_value(in[I+1], coord, thread); + tex->noisesize = tex_input_value(in[I+0], p, thread); + tex->turbul = tex_input_value(in[I+1], p, thread); } ProcDef(wood) @@ -241,13 +241,13 @@ static bNodeSocketType musgrave_inputs[]= { { SOCK_VALUE, 1, "Size", 0.25f, 0.0f, 0.0f, 0.0f, 0.0001f, 2.0f }, { -1, 0, "" } }; -static void musgrave_map_inputs(Tex *tex, bNodeStack **in, float *coord, short thread) +static void musgrave_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread) { - tex->mg_H = tex_input_value(in[I+0], coord, thread); - tex->mg_lacunarity = tex_input_value(in[I+1], coord, thread); - tex->mg_octaves = tex_input_value(in[I+2], coord, thread); - tex->ns_outscale = tex_input_value(in[I+3], coord, thread); - tex->noisesize = tex_input_value(in[I+4], coord, thread); + tex->mg_H = tex_input_value(in[I+0], p, thread); + tex->mg_lacunarity = tex_input_value(in[I+1], p, thread); + tex->mg_octaves = tex_input_value(in[I+2], p, thread); + tex->ns_outscale = tex_input_value(in[I+3], p, thread); + tex->noisesize = tex_input_value(in[I+4], p, thread); } ProcDef(musgrave) @@ -266,10 +266,10 @@ static bNodeSocketType stucci_inputs[]= { { SOCK_VALUE, 1, "Turbulence", 5.0f, 0.0f, 0.0f, 0.0f, 0.0f, 200.0f }, { -1, 0, "" } }; -static void stucci_map_inputs(Tex *tex, bNodeStack **in, float *coord, short thread) +static void stucci_map_inputs(Tex *tex, bNodeStack **in, TexParams *p, short thread) { - tex->noisesize = tex_input_value(in[I+0], coord, thread); - tex->turbul = tex_input_value(in[I+1], coord, thread); + tex->noisesize = tex_input_value(in[I+0], p, thread); + tex->turbul = tex_input_value(in[I+1], p, thread); } ProcDef(stucci) diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c b/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c index 3a2c2b1def1..0fd95642be6 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c @@ -21,7 +21,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Robin Allen * * ***** END GPL LICENSE BLOCK ***** */ @@ -42,9 +42,10 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { float new_coord[3]; + float *coord = p->coord; float ax[4]; float para[3]; @@ -53,13 +54,13 @@ static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, shor float magsq, ndx; - float a = tex_input_value(in[1], coord, thread); + float a = tex_input_value(in[1], p, thread); float cos_a = cos(a * 2 * M_PI); float sin_a = sin(a * 2 * M_PI); // x' = xcosa + n(n.x)(1-cosa)+(x*n)sina - tex_input_vec(ax, in[2], coord, thread); + tex_input_vec(ax, in[2], p, thread); magsq = ax[0]*ax[0] + ax[1]*ax[1] + ax[2]*ax[2]; if(magsq == 0) magsq = 1; @@ -86,7 +87,11 @@ static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, shor new_coord[1] = para[1] + perp[1] + cp[1]; new_coord[2] = para[2] + perp[2] + cp[2]; - tex_input_rgba(out, in[0], new_coord, thread); + { + TexParams np = *p; + np.coord = new_coord; + tex_input_rgba(out, in[0], &np, thread); + } } static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) { diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_scale.c b/source/blender/nodes/intern/TEX_nodes/TEX_scale.c index 792c3468e9f..3d4415365aa 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_scale.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_scale.c @@ -21,7 +21,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Robin Allen * * ***** END GPL LICENSE BLOCK ***** */ @@ -40,17 +40,19 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { float scale[3], new_coord[3]; + TexParams np = *p; + np.coord = new_coord; - tex_input_vec(scale, in[1], coord, thread); + tex_input_vec(scale, in[1], p, thread); - new_coord[0] = coord[0] * scale[0]; - new_coord[1] = coord[1] * scale[1]; - new_coord[2] = coord[2] * scale[2]; + new_coord[0] = p->coord[0] * scale[0]; + new_coord[1] = p->coord[1] * scale[1]; + new_coord[2] = p->coord[2] * scale[2]; - tex_input_rgba(out, in[0], new_coord, thread); + tex_input_rgba(out, in[0], &np, thread); } static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) { diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_texture.c b/source/blender/nodes/intern/TEX_nodes/TEX_texture.c index 30492b84764..0ca80a82271 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_texture.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_texture.c @@ -21,7 +21,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Robin Allen * * ***** END GPL LICENSE BLOCK ***** */ @@ -40,10 +40,11 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { static float red[] = {1,0,0,1}; static float white[] = {1,1,1,1}; + float *coord = p->coord; Tex *nodetex = (Tex *)node->id; @@ -60,8 +61,8 @@ static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, shor float nor[] = {0,0,0}; float col1[4], col2[4]; - tex_input_rgba(col1, in[0], coord, thread); - tex_input_rgba(col2, in[1], coord, thread); + tex_input_rgba(col1, in[0], p, thread); + tex_input_rgba(col2, in[1], p, thread); texres.nor = nor; textype = multitex_ext(nodetex, coord, 0, 0, 0, &texres); diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_translate.c b/source/blender/nodes/intern/TEX_nodes/TEX_translate.c index cadd27612f4..ba3dcfa27a2 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_translate.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_translate.c @@ -21,7 +21,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Robin Allen * * ***** END GPL LICENSE BLOCK ***** */ @@ -40,17 +40,19 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { float offset[3], new_coord[3]; + TexParams np = *p; + np.coord = new_coord; - tex_input_vec(offset, in[1], coord, thread); + tex_input_vec(offset, in[1], p, thread); - new_coord[0] = coord[0] + offset[0]; - new_coord[1] = coord[1] + offset[1]; - new_coord[2] = coord[2] + offset[2]; + new_coord[0] = p->coord[0] + offset[0]; + new_coord[1] = p->coord[1] + offset[1]; + new_coord[2] = p->coord[2] + offset[2]; - tex_input_rgba(out, in[0], new_coord, thread); + tex_input_rgba(out, in[0], &np, thread); } static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) { diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c b/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c index 0d24652a8f6..75b88c3a460 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_valToNor.c @@ -39,28 +39,32 @@ static bNodeSocketType outputs[]= { { -1, 0, "" } }; -static void normalfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void normalfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { float new_coord[3]; + float *coord = p->coord; - float nabla = tex_input_value(in[1], coord, thread); + float nabla = tex_input_value(in[1], p, thread); float val; float nor[3]; + + TexParams np = *p; + np.coord = new_coord; - val = tex_input_value(in[0], coord, thread); + val = tex_input_value(in[0], p, thread); new_coord[0] = coord[0] + nabla; new_coord[1] = coord[1]; new_coord[2] = coord[2]; - nor[0] = tex_input_value(in[0], new_coord, thread); + nor[0] = tex_input_value(in[0], &np, thread); new_coord[0] = coord[0]; new_coord[1] = coord[1] + nabla; - nor[1] = tex_input_value(in[0], new_coord, thread); + nor[1] = tex_input_value(in[0], &np, thread); new_coord[1] = coord[1]; new_coord[2] = coord[2] + nabla; - nor[2] = tex_input_value(in[0], new_coord, thread); + nor[2] = tex_input_value(in[0], &np, thread); out[0] = val-nor[0]; out[1] = val-nor[1]; diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c b/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c index 71d9cb07e18..90a444bcff0 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_valToRgb.c @@ -22,7 +22,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Robin Allen * * ***** END GPL LICENSE BLOCK ***** */ @@ -39,10 +39,10 @@ static bNodeSocketType valtorgb_out[]= { { -1, 0, "" } }; -static void valtorgb_colorfn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void valtorgb_colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { if(node->storage) { - float fac = tex_input_value(in[0], coord, thread); + float fac = tex_input_value(in[0], p, thread); do_colorband(node->storage, fac, out); } @@ -87,10 +87,10 @@ static bNodeSocketType rgbtobw_out[]= { }; -static void rgbtobw_valuefn(float *out, float *coord, bNode *node, bNodeStack **in, short thread) +static void rgbtobw_valuefn(float *out, TexParams *p, bNode *node, bNodeStack **in, short thread) { float cin[4]; - tex_input_rgba(cin, in[0], coord, thread); + tex_input_rgba(cin, in[0], p, thread); *out = cin[0] * 0.35f + cin[1] * 0.45f + cin[2] * 0.2f; } diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_viewer.c b/source/blender/nodes/intern/TEX_nodes/TEX_viewer.c index acdaacf873c..2d29b03b38c 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_viewer.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_viewer.c @@ -21,7 +21,7 @@ * * The Original Code is: all of this file. * - * Contributor(s): none yet. + * Contributor(s): Robin Allen * * ***** END GPL LICENSE BLOCK ***** */ diff --git a/source/blender/nodes/intern/TEX_util.c b/source/blender/nodes/intern/TEX_util.c index d25decd4111..b88efb47990 100644 --- a/source/blender/nodes/intern/TEX_util.c +++ b/source/blender/nodes/intern/TEX_util.c @@ -47,17 +47,17 @@ #define PREV_RES 128 /* default preview resolution */ -void tex_call_delegate(TexDelegate *dg, float *out, float *coord, short thread) +void tex_call_delegate(TexDelegate *dg, float *out, TexParams *params, short thread) { if(dg->node->need_exec) - dg->fn(out, coord, dg->node, dg->in, thread); + dg->fn(out, params, dg->node, dg->in, thread); } -void tex_input(float *out, int sz, bNodeStack *in, float *coord, short thread) +void tex_input(float *out, int sz, bNodeStack *in, TexParams *params, short thread) { TexDelegate *dg = in->data; if(dg) { - tex_call_delegate(dg, in->vec, coord, thread); + tex_call_delegate(dg, in->vec, params, thread); if(in->hasoutput && in->sockettype == SOCK_VALUE) in->vec[1] = in->vec[2] = in->vec[0]; @@ -65,14 +65,14 @@ void tex_input(float *out, int sz, bNodeStack *in, float *coord, short thread) memcpy(out, in->vec, sz * sizeof(float)); } -void tex_input_vec(float *out, bNodeStack *in, float *coord, short thread) +void tex_input_vec(float *out, bNodeStack *in, TexParams *params, short thread) { - tex_input(out, 3, in, coord, thread); + tex_input(out, 3, in, params, thread); } -void tex_input_rgba(float *out, bNodeStack *in, float *coord, short thread) +void tex_input_rgba(float *out, bNodeStack *in, TexParams *params, short thread) { - tex_input(out, 4, in, coord, thread); + tex_input(out, 4, in, params, thread); if(in->hasoutput && in->sockettype == SOCK_VALUE) { @@ -88,10 +88,10 @@ void tex_input_rgba(float *out, bNodeStack *in, float *coord, short thread) } } -float tex_input_value(bNodeStack *in, float *coord, short thread) +float tex_input_value(bNodeStack *in, TexParams *params, short thread) { float out[4]; - tex_input_vec(out, in, coord, thread); + tex_input_vec(out, in, params, thread); return out[0]; } @@ -121,11 +121,21 @@ static void init_preview(bNode *node) } } +void params_from_cdata(TexParams *out, TexCallData *in) +{ + out->coord = in->coord; + out->dxt = in->dxt; + out->dyt = in->dyt; + out->cfra = in->cfra; +} + void tex_do_preview(bNode *node, bNodeStack *ns, TexCallData *cdata) { int x, y; float *result; bNodePreview *preview; + float coord[3] = {0, 0, 0}; + TexParams params; if(!cdata->do_preview) return; @@ -137,15 +147,20 @@ void tex_do_preview(bNode *node, bNodeStack *ns, TexCallData *cdata) preview = node->preview; + params.dxt = 0; + params.dyt = 0; + params.cfra = 0; /* XXX Use current? */ + params.coord = coord; + for(x=0; xxsize; x++) for(y=0; yysize; y++) { - cdata->coord[0] = ((float) x / preview->xsize) * 2 - 1; - cdata->coord[1] = ((float) y / preview->ysize) * 2 - 1; + params.coord[0] = ((float) x / preview->xsize) * 2 - 1; + params.coord[1] = ((float) y / preview->ysize) * 2 - 1; result = preview->rect + 4 * (preview->xsize*y + x); - tex_input_rgba(result, ns, cdata->coord, cdata->thread); + tex_input_rgba(result, ns, ¶ms, cdata->thread); } } @@ -192,8 +207,17 @@ void ntreeTexCheckCyclics(struct bNodeTree *ntree) } } -void ntreeTexExecTree(bNodeTree *nodes, TexResult *texres, float *coord, char do_preview, short thread, Tex *tex, short which_output, int cfra) -{ +void ntreeTexExecTree( + bNodeTree *nodes, + TexResult *texres, + float *coord, + float *dxt, float *dyt, + char do_preview, + short thread, + Tex *tex, + short which_output, + int cfra +){ TexResult dummy_texres; TexCallData data; @@ -203,6 +227,8 @@ void ntreeTexExecTree(bNodeTree *nodes, TexResult *texres, float *coord, char do if(!texres) texres = &dummy_texres; data.coord = coord; + data.dxt = dxt; + data.dyt = dyt; data.target = texres; data.do_preview = do_preview; data.thread = thread; @@ -225,7 +251,7 @@ void ntreeTexUpdatePreviews(bNodeTree* nodetree) dummy_texres.nor = 0; ntreeBeginExecTree(nodetree); - ntreeTexExecTree(nodetree, &dummy_texres, coord, 1, 0, tex, 0, 0); + ntreeTexExecTree(nodetree, &dummy_texres, coord, 0, 0, 1, 0, tex, 0, 0); ntreeEndExecTree(nodetree); } diff --git a/source/blender/nodes/intern/TEX_util.h b/source/blender/nodes/intern/TEX_util.h index e560aa57921..7fff8d04651 100644 --- a/source/blender/nodes/intern/TEX_util.h +++ b/source/blender/nodes/intern/TEX_util.h @@ -71,13 +71,20 @@ typedef struct TexCallData { TexResult *target; float *coord; + float *dxt, *dyt; char do_preview; short thread; short which_output; int cfra; } TexCallData; -typedef void(*TexFn) (float *out, float *coord, bNode *node, bNodeStack **in, short thread); +typedef struct TexParams { + float *coord; + float *dxt, *dyt; + int cfra; +} TexParams; + +typedef void(*TexFn) (float *out, TexParams *params, bNode *node, bNodeStack **in, short thread); typedef struct TexDelegate { TexFn fn; @@ -86,16 +93,18 @@ typedef struct TexDelegate { int type; } TexDelegate; -void tex_call_delegate(TexDelegate*, float *out, float *coord, short thread); +void tex_call_delegate(TexDelegate*, float *out, TexParams *params, short thread); -void tex_input_rgba(float *out, bNodeStack *in, float *coord, short thread); -void tex_input_vec(float *out, bNodeStack *in, float *coord, short thread); -float tex_input_value(bNodeStack *in, float *coord, short thread); +void tex_input_rgba(float *out, bNodeStack *in, TexParams *params, short thread); +void tex_input_vec(float *out, bNodeStack *in, TexParams *params, short thread); +float tex_input_value(bNodeStack *in, TexParams *params, short thread); void tex_output(bNode *node, bNodeStack **in, bNodeStack *out, TexFn texfn); void tex_do_preview(bNode *node, bNodeStack *ns, TexCallData *cdata); void ntreeTexUpdatePreviews( bNodeTree* nodetree ); -void ntreeTexExecTree(bNodeTree *nodes, TexResult *texres, float *coord, char do_preview, short thread, struct Tex *tex, short which_output, int cfra); - +void ntreeTexExecTree(bNodeTree *nodes, TexResult *texres, float *coord, float *dxt, float *dyt, char do_preview, short thread, struct Tex *tex, short which_output, int cfra); + +void params_from_cdata(TexParams *out, TexCallData *in); + #endif diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index bb491efdaba..3db78bfea93 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -714,12 +714,12 @@ static float voronoiTex(Tex *tex, float *texvec, TexResult *texres) /* ------------------------------------------------------------------------- */ -static int evalnodes(Tex *tex, float *texvec, TexResult *texres, short thread, short which_output) +static int evalnodes(Tex *tex, float *texvec, float *dxt, float *dyt, TexResult *texres, short thread, short which_output) { short rv = TEX_INT; bNodeTree *nodes = tex->nodetree; - ntreeTexExecTree(nodes, texres, texvec, 0, thread, tex, which_output, R.r.cfra); + ntreeTexExecTree(nodes, texres, texvec, dxt, dyt, 0, thread, tex, which_output, R.r.cfra); if(texres->nor) rv |= TEX_NOR; rv |= TEX_RGB; @@ -1180,7 +1180,7 @@ static int multitex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, texres->talpha= 0; /* is set when image texture returns alpha (considered premul) */ if(tex->use_nodes && tex->nodetree) { - retval = evalnodes(tex, texvec, texres, thread, which_output); + retval = evalnodes(tex, texvec, dxt, dyt, texres, thread, which_output); } else switch(tex->type) { From 6412fe4b92f136fd7b9bdb7592476df26c8e46ce Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 17 Aug 2009 22:09:36 +0000 Subject: [PATCH 104/577] * Point density texture works again --- release/ui/buttons_texture.py | 12 +- source/blender/blenkernel/intern/texture.c | 3 + source/blender/blenlib/intern/BLI_kdopbvh.c | 188 +++++++++--------- source/blender/blenloader/intern/readfile.c | 35 ++-- source/blender/makesdna/DNA_texture_types.h | 5 +- source/blender/makesrna/intern/rna_texture.c | 58 ++---- .../render/intern/source/pointdensity.c | 10 +- .../blender/render/intern/source/volumetric.c | 5 +- 8 files changed, 146 insertions(+), 170 deletions(-) diff --git a/release/ui/buttons_texture.py b/release/ui/buttons_texture.py index 5b48fdfbaa4..acd398ed5ff 100644 --- a/release/ui/buttons_texture.py +++ b/release/ui/buttons_texture.py @@ -680,8 +680,18 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel): pd = tex.pointdensity layout.itemR(pd, "point_source") - + layout.itemR(pd, "object") + if pd.point_source == 'PARTICLE_SYSTEM': + layout.item_pointerR(pd, "particle_system", pd.object, "particle_systems", text="") + layout.itemR(pd, "radius") layout.itemR(pd, "falloff") + if pd.falloff == 'SOFT': + layout.itemR(pd, "falloff_softness") + layout.itemR(pd, "color_source") + layout.itemR(pd, "turbulence") + layout.itemR(pd, "turbulence_size") + layout.itemR(pd, "turbulence_depth") + layout.itemR(pd, "turbulence_influence") bpy.types.register(TEXTURE_PT_context_texture) diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index fc9948f8d95..96e9f54fc0c 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -922,6 +922,8 @@ PointDensity *BKE_add_pointdensity(void) pd->speed_scale = 1.0f; pd->totpoints = 0; pd->coba = add_colorband(1); + pd->object = NULL; + pd->psys = NULL; return pd; } @@ -982,6 +984,7 @@ struct VoxelData *BKE_add_voxeldata(void) vd->interp_type= TEX_VD_LINEAR; vd->file_format= TEX_VD_SMOKE; vd->int_multiplier = 1.0; + vd->object = NULL; return vd; } diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index 014c3d52cda..08e8a5871cd 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -72,10 +72,10 @@ struct BVHTree char start_axis, stop_axis; // KDOP_AXES array indices according to axis }; -typedef struct BVHOverlapData -{ - BVHTree *tree1, *tree2; - BVHTreeOverlap *overlap; +typedef struct BVHOverlapData +{ + BVHTree *tree1, *tree2; + BVHTreeOverlap *overlap; int i, max_overlap; /* i is number of overlaps */ int start_axis, stop_axis; } BVHOverlapData; @@ -109,7 +109,7 @@ typedef struct BVHRayCastData //////////////////////////////////////////////////////////////////////// // Bounding Volume Hierarchy Definition -// +// // Notes: From OBB until 26-DOP --> all bounding volumes possible, just choose type below // Notes: You have to choose the type at compile time ITM // Notes: You can choose the tree type --> binary, quad, octree, choose below @@ -188,10 +188,10 @@ int ADJUST_MEMORY(void *local_memblock, void **memblock, int new_size, int *max_ ////////////////////////////////////////////////////////////////////////////////////////////////////// -// Introsort +// Introsort // with permission deriven from the following Java code: // http://ralphunden.net/content/tutorials/a-guide-to-introsort/ -// and he derived it from the SUN STL +// and he derived it from the SUN STL ////////////////////////////////////////////////////////////////////////////////////////////////////// static int size_threshold = 16; /* @@ -362,7 +362,7 @@ static void create_kdop_hull(BVHTree *tree, BVHNode *node, float *co, int numpoi float newminmax; float *bv = node->bv; int i, k; - + // don't init boudings for the moving case if(!moving) { @@ -372,7 +372,7 @@ static void create_kdop_hull(BVHTree *tree, BVHNode *node, float *co, int numpoi bv[2*i + 1] = -FLT_MAX; } } - + for(k = 0; k < numpoints; k++) { // for all Axes. @@ -394,7 +394,7 @@ static void refit_kdop_hull(BVHTree *tree, BVHNode *node, int start, int end) int i, j; float *bv = node->bv; - + for (i = tree->start_axis; i < tree->stop_axis; i++) { bv[2*i] = FLT_MAX; @@ -406,10 +406,10 @@ static void refit_kdop_hull(BVHTree *tree, BVHNode *node, int start, int end) // for all Axes. for (i = tree->start_axis; i < tree->stop_axis; i++) { - newmin = tree->nodes[j]->bv[(2 * i)]; + newmin = tree->nodes[j]->bv[(2 * i)]; if ((newmin < bv[(2 * i)])) bv[(2 * i)] = newmin; - + newmax = tree->nodes[j]->bv[(2 * i) + 1]; if ((newmax > bv[(2 * i) + 1])) bv[(2 * i) + 1] = newmax; @@ -427,14 +427,14 @@ static char get_largest_axis(float *bv) middle_point[0] = (bv[1]) - (bv[0]); // x axis middle_point[1] = (bv[3]) - (bv[2]); // y axis middle_point[2] = (bv[5]) - (bv[4]); // z axis - if (middle_point[0] > middle_point[1]) + if (middle_point[0] > middle_point[1]) { if (middle_point[0] > middle_point[2]) return 1; // max x axis else return 5; // max z axis } - else + else { if (middle_point[1] > middle_point[2]) return 3; // max y axis @@ -448,24 +448,24 @@ static char get_largest_axis(float *bv) static void node_join(BVHTree *tree, BVHNode *node) { int i, j; - + for (i = tree->start_axis; i < tree->stop_axis; i++) { node->bv[2*i] = FLT_MAX; node->bv[2*i + 1] = -FLT_MAX; } - + for (i = 0; i < tree->tree_type; i++) { - if (node->children[i]) + if (node->children[i]) { for (j = tree->start_axis; j < tree->stop_axis; j++) { - // update minimum - if (node->children[i]->bv[(2 * j)] < node->bv[(2 * j)]) + // update minimum + if (node->children[i]->bv[(2 * j)] < node->bv[(2 * j)]) node->bv[(2 * j)] = node->children[i]->bv[(2 * j)]; - - // update maximum + + // update maximum if (node->children[i]->bv[(2 * j) + 1] > node->bv[(2 * j) + 1]) node->bv[(2 * j) + 1] = node->children[i]->bv[(2 * j) + 1]; } @@ -518,7 +518,7 @@ static void bvhtree_info(BVHTree *tree) static void verify_tree(BVHTree *tree) { int i, j, check = 0; - + // check the pointer list for(i = 0; i < tree->totleaf; i++) { @@ -538,7 +538,7 @@ static void verify_tree(BVHTree *tree) check = 0; } } - + // check the leaf list for(i = 0; i < tree->totleaf; i++) { @@ -558,7 +558,7 @@ static void verify_tree(BVHTree *tree) check = 0; } } - + printf("branches: %d, leafs: %d, total: %d\n", tree->totbranch, tree->totleaf, tree->totbranch + tree->totleaf); } #endif @@ -703,7 +703,7 @@ static void non_recursive_bvh_div_nodes(BVHTree *tree, BVHNode *branches_array, BVHBuildHelper data; int depth; - + // set parent from root node to NULL BVHNode *tmp = branches_array+0; tmp->parent = NULL; @@ -722,7 +722,7 @@ static void non_recursive_bvh_div_nodes(BVHTree *tree, BVHNode *branches_array, } branches_array--; //Implicit trees use 1-based indexs - + build_implicit_tree_helper(tree, &data); //Loop tree levels (log N) loops @@ -806,11 +806,11 @@ BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis) { BVHTree *tree; int numnodes, i; - + // theres not support for trees below binary-trees :P if(tree_type < 2) return NULL; - + if(tree_type > MAX_TREETYPE) return NULL; @@ -820,13 +820,13 @@ BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis) //so that tangent rays can still hit a bounding volume.. //this bug would show up when casting a ray aligned with a kdop-axis and with an edge of 2 faces epsilon = MAX2(FLT_EPSILON, epsilon); - + if(tree) { tree->epsilon = epsilon; - tree->tree_type = tree_type; + tree->tree_type = tree_type; tree->axis = axis; - + if(axis == 26) { tree->start_axis = 0; @@ -863,13 +863,13 @@ BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis) numnodes = maxsize + implicit_needed_branches(tree_type, maxsize) + tree_type; tree->nodes = (BVHNode **)MEM_callocN(sizeof(BVHNode *)*numnodes, "BVHNodes"); - + if(!tree->nodes) { MEM_freeN(tree); return NULL; } - + tree->nodebv = (float*)MEM_callocN(sizeof(float)* axis * numnodes, "BVHNodeBV"); if(!tree->nodebv) { @@ -886,7 +886,7 @@ BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis) } tree->nodearray = (BVHNode *)MEM_callocN(sizeof(BVHNode)* numnodes, "BVHNodeArray"); - + if(!tree->nodearray) { MEM_freeN(tree->nodechild); @@ -902,14 +902,14 @@ BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis) tree->nodearray[i].bv = tree->nodebv + i * axis; tree->nodearray[i].children = tree->nodechild + i * tree_type; } - + } return tree; } void BLI_bvhtree_free(BVHTree *tree) -{ +{ if(tree) { MEM_freeN(tree->nodes); @@ -946,27 +946,27 @@ int BLI_bvhtree_insert(BVHTree *tree, int index, float *co, int numpoints) { int i; BVHNode *node = NULL; - + // insert should only possible as long as tree->totbranch is 0 if(tree->totbranch > 0) return 0; - + if(tree->totleaf+1 >= MEM_allocN_len(tree->nodes)/sizeof(*(tree->nodes))) return 0; - + // TODO check if have enough nodes in array - + node = tree->nodes[tree->totleaf] = &(tree->nodearray[tree->totleaf]); tree->totleaf++; - + create_kdop_hull(tree, node, co, numpoints, 0); node->index= index; - + // inflate the bv with some epsilon for (i = tree->start_axis; i < tree->stop_axis; i++) { - node->bv[(2 * i)] -= tree->epsilon; // minimum - node->bv[(2 * i) + 1] += tree->epsilon; // maximum + node->bv[(2 * i)] -= tree->epsilon; // minimum + node->bv[(2 * i) + 1] += tree->epsilon; // maximum } return 1; @@ -978,23 +978,23 @@ int BLI_bvhtree_update_node(BVHTree *tree, int index, float *co, float *co_movin { int i; BVHNode *node= NULL; - + // check if index exists if(index > tree->totleaf) return 0; - + node = tree->nodearray + index; - + create_kdop_hull(tree, node, co, numpoints, 0); - + if(co_moving) create_kdop_hull(tree, node, co_moving, numpoints, 1); - + // inflate the bv with some epsilon for (i = tree->start_axis; i < tree->stop_axis; i++) { - node->bv[(2 * i)] -= tree->epsilon; // minimum - node->bv[(2 * i) + 1] += tree->epsilon; // maximum + node->bv[(2 * i)] -= tree->epsilon; // minimum + node->bv[(2 * i) + 1] += tree->epsilon; // maximum } return 1; @@ -1030,24 +1030,24 @@ static int tree_overlap(BVHNode *node1, BVHNode *node2, int start_axis, int stop float *bv2 = node2->bv; float *bv1_end = bv1 + (stop_axis<<1); - + bv1 += start_axis<<1; bv2 += start_axis<<1; - + // test all axis if min + max overlap for (; bv1 != bv1_end; bv1+=2, bv2+=2) { - if ((*(bv1) > *(bv2 + 1)) || (*(bv2) > *(bv1 + 1))) + if ((*(bv1) > *(bv2 + 1)) || (*(bv2) > *(bv1 + 1))) return 0; } - + return 1; } static void traverse(BVHOverlapData *data, BVHNode *node1, BVHNode *node2) { int j; - + if(tree_overlap(node1, node2, data->start_axis, data->stop_axis)) { // check if node1 is a leaf @@ -1056,17 +1056,17 @@ static void traverse(BVHOverlapData *data, BVHNode *node1, BVHNode *node2) // check if node2 is a leaf if(!node2->totnode) { - + if(node1 == node2) { return; } - + if(data->i >= data->max_overlap) - { + { // try to make alloc'ed memory bigger data->overlap = realloc(data->overlap, sizeof(BVHTreeOverlap)*data->max_overlap*2); - + if(!data->overlap) { printf("Out of Memory in traverse\n"); @@ -1074,7 +1074,7 @@ static void traverse(BVHOverlapData *data, BVHNode *node1, BVHNode *node2) } data->max_overlap *= 2; } - + // both leafs, insert overlap! data->overlap[data->i].indexA = node1->index; data->overlap[data->i].indexB = node2->index; @@ -1092,7 +1092,7 @@ static void traverse(BVHOverlapData *data, BVHNode *node1, BVHNode *node2) } else { - + for(j = 0; j < data->tree2->tree_type; j++) { if(node1->children[j]) @@ -1108,21 +1108,21 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result) int j, total = 0; BVHTreeOverlap *overlap = NULL, *to = NULL; BVHOverlapData **data; - + // check for compatibility of both trees (can't compare 14-DOP with 18-DOP) if((tree1->axis != tree2->axis) && (tree1->axis == 14 || tree2->axis == 14) && (tree1->axis == 18 || tree2->axis == 18)) return 0; - + // fast check root nodes for collision before doing big splitting + traversal if(!tree_overlap(tree1->nodes[tree1->totleaf], tree2->nodes[tree2->totleaf], MIN2(tree1->start_axis, tree2->start_axis), MIN2(tree1->stop_axis, tree2->stop_axis))) return 0; data = MEM_callocN(sizeof(BVHOverlapData *)* tree1->tree_type, "BVHOverlapData_star"); - + for(j = 0; j < tree1->tree_type; j++) { data[j] = (BVHOverlapData *)MEM_callocN(sizeof(BVHOverlapData), "BVHOverlapData"); - + // init BVHOverlapData data[j]->overlap = (BVHTreeOverlap *)malloc(sizeof(BVHTreeOverlap)*MAX2(tree1->totleaf, tree2->totleaf)); data[j]->tree1 = tree1; @@ -1138,25 +1138,25 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result) { traverse(data[j], tree1->nodes[tree1->totleaf]->children[j], tree2->nodes[tree2->totleaf]); } - + for(j = 0; j < tree1->tree_type; j++) total += data[j]->i; - + to = overlap = (BVHTreeOverlap *)MEM_callocN(sizeof(BVHTreeOverlap)*total, "BVHTreeOverlap"); - + for(j = 0; j < tree1->tree_type; j++) { memcpy(to, data[j]->overlap, data[j]->i*sizeof(BVHTreeOverlap)); to+=data[j]->i; } - + for(j = 0; j < tree1->tree_type; j++) { free(data[j]->overlap); MEM_freeN(data[j]); } MEM_freeN(data); - + (*result) = total; return overlap; } @@ -1173,7 +1173,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; @@ -1181,12 +1181,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]; } /* @@ -1208,7 +1208,7 @@ static float calc_nearest_point(BVHNearestData *data, BVHNode *node, float *near } } */ - return squared_dist(data->co, nearest); + return squared_dist(proj, nearest); } @@ -1231,7 +1231,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 @@ -1240,12 +1240,12 @@ static void dfs_find_nearest_dfs(BVHNearestData *data, BVHNode *node) int i; float nearest[3]; - if(data->proj[ (int)node->main_axis ] <= node->children[0]->bv[(int)node->main_axis*2+1]) + if(data->proj[ node->main_axis ] <= node->children[0]->bv[node->main_axis*2+1]) { 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]); } } @@ -1253,7 +1253,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]); } } @@ -1263,7 +1263,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); } @@ -1301,7 +1301,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) { @@ -1329,7 +1329,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++; @@ -1339,7 +1339,7 @@ static void bfs_find_nearest(BVHNearestData *data, BVHNode *node) push_heaps++; } } - + if(heap_size == 0) break; current = heap[0]; @@ -1355,6 +1355,7 @@ static void bfs_find_nearest(BVHNearestData *data, BVHNode *node) } #endif + int BLI_bvhtree_find_nearest(BVHTree *tree, const float *co, BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata) { int i; @@ -1435,7 +1436,7 @@ static float ray_nearest_hit(BVHRayCastData *data, float *bv) if(lu > low) low = lu; if(ll < upper) upper = ll; } - + if(low > upper) return FLT_MAX; } } @@ -1530,32 +1531,31 @@ float BLI_bvhtree_bb_raycast(float *bv, float *light_start, float *light_end, fl { BVHRayCastData data; float dist = 0.0; - int i; - + data.hit.dist = FLT_MAX; - + // get light direction data.ray.direction[0] = light_end[0] - light_start[0]; data.ray.direction[1] = light_end[1] - light_start[1]; data.ray.direction[2] = light_end[2] - light_start[2]; - + data.ray.radius = 0.0; - + data.ray.origin[0] = light_start[0]; data.ray.origin[1] = light_start[1]; data.ray.origin[2] = light_start[2]; - + Normalize(data.ray.direction); VECCOPY(data.ray_dot_axis, data.ray.direction); - + dist = ray_nearest_hit(&data, bv); - + if(dist > 0.0) { VECADDFAC(pos, light_start, data.ray.direction, dist); } return dist; - + } /* diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index c5588ccf7d6..8aade4c223e 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2820,7 +2820,10 @@ 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->pd) { + tex->pd->object= newlibadr(fd, tex->id.lib, tex->pd->object); + tex->pd->psys= newlibadr(fd, tex->id.lib, tex->pd->psys); + } if(tex->vd) tex->vd->object= newlibadr(fd, tex->id.lib, tex->vd->object); if(tex->nodetree) @@ -9491,20 +9494,22 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } /* volume rendering settings */ - ma->vol.density = 1.0f; - ma->vol.emission = 0.0f; - ma->vol.absorption = 1.0f; - ma->vol.scattering = 1.0f; - ma->vol.emission_col[0] = ma->vol.emission_col[1] = ma->vol.emission_col[2] = 1.0f; - ma->vol.absorption_col[0] = ma->vol.absorption_col[1] = ma->vol.absorption_col[2] = 0.0f; - ma->vol.density_scale = 1.0f; - ma->vol.depth_cutoff = 0.01f; - ma->vol.stepsize_type = MA_VOL_STEP_RANDOMIZED; - ma->vol.stepsize = 0.2f; - ma->vol.shade_stepsize = 0.2f; - ma->vol.shade_type = MA_VOL_SHADE_SINGLE; - ma->vol.shadeflag |= MA_VOL_PRECACHESHADING; - ma->vol.precache_resolution = 50; + if (ma->vol.stepsize < 0.0001f) { + ma->vol.density = 1.0f; + ma->vol.emission = 0.0f; + ma->vol.absorption = 1.0f; + ma->vol.scattering = 1.0f; + ma->vol.emission_col[0] = ma->vol.emission_col[1] = ma->vol.emission_col[2] = 1.0f; + ma->vol.absorption_col[0] = ma->vol.absorption_col[1] = ma->vol.absorption_col[2] = 0.0f; + ma->vol.density_scale = 1.0f; + ma->vol.depth_cutoff = 0.01f; + ma->vol.stepsize_type = MA_VOL_STEP_RANDOMIZED; + ma->vol.stepsize = 0.2f; + ma->vol.shade_stepsize = 0.2f; + ma->vol.shade_type = MA_VOL_SHADE_SINGLE; + ma->vol.shadeflag |= MA_VOL_PRECACHESHADING; + ma->vol.precache_resolution = 50; + } } for(sce = main->scene.first; sce; sce = sce->id.next) { diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index 6e889fda20a..1b6ed1bc032 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -141,12 +141,11 @@ typedef struct PointDensity { int pdpad; struct Object *object; /* for 'Object' or 'Particle system' type - source object */ + struct ParticleSystem *psys; 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; + short pdpad2[2]; void *point_tree; /* the acceleration tree containing points */ float *point_data; /* dynamically allocated extra for extra information, like particle age */ diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 01078ac2412..cce1654da52 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -1282,6 +1282,19 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Point Source", "Point data to use as renderable point density"); RNA_def_property_update(prop, NC_TEXTURE, NULL); + prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "object"); + RNA_def_property_ui_text(prop, "Object", "Object to take point data from"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + + prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "psys"); + RNA_def_property_ui_text(prop, "Particle System", "Particle System to render as points"); + RNA_def_property_struct_type(prop, "ParticleSystem"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "radius"); RNA_def_property_range(prop, 0.01, FLT_MAX); @@ -1329,52 +1342,7 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Turbulence Influence", "Method for driving added turbulent noise"); RNA_def_property_update(prop, NC_TEXTURE, NULL); - /* - prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "interp_type"); - RNA_def_property_enum_items(prop, interpolation_type_items); - RNA_def_property_ui_text(prop, "Interpolation", "Method to interpolate/smooth values between voxel cells"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); - prop= RNA_def_property(srna, "intensity", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "int_multiplier"); - RNA_def_property_range(prop, 0.01, FLT_MAX); - RNA_def_property_ui_text(prop, "Intensity", "Multiplier for intensity values"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); - - prop= RNA_def_property(srna, "file_format", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "file_format"); - RNA_def_property_enum_items(prop, file_format_items); - RNA_def_property_ui_text(prop, "File Format", "Format of the source data set to render "); - RNA_def_property_update(prop, NC_TEXTURE, NULL); - - prop= RNA_def_property(srna, "source_path", PROP_STRING, PROP_FILEPATH); - RNA_def_property_string_sdna(prop, NULL, "source_path"); - RNA_def_property_ui_text(prop, "Source Path", "The external source data file to use"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); - - prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_VECTOR); - RNA_def_property_int_sdna(prop, NULL, "resol"); - RNA_def_property_ui_text(prop, "Resolution", "Resolution of the voxel grid."); - RNA_def_property_update(prop, NC_TEXTURE, NULL); - - prop= RNA_def_property(srna, "still", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_VD_STILL); - RNA_def_property_ui_text(prop, "Still Frame Only", "Always render a still frame from the voxel data sequence"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); - - prop= RNA_def_property(srna, "still_frame_number", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "still_frame"); - RNA_def_property_range(prop, 0, INT_MAX); - RNA_def_property_ui_text(prop, "Still Frame Number", "The frame number to always use"); - RNA_def_property_update(prop, NC_TEXTURE, NULL); - - prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "object"); - RNA_def_property_ui_text(prop, "Object", "Object to use for smoke simulations"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_TEXTURE, NULL); - */ srna= RNA_def_struct(brna, "PointDensityTexture", "Texture"); RNA_def_struct_sdna(srna, "Tex"); diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index fb7ec4dadc2..9a9e3de7247 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -232,15 +232,9 @@ static void cache_pointdensity(Render *re, Tex *tex) int i; if (!ob) return; - if (BLI_countlist(&ob->particlesystem) == 0) return; + if (!pd->psys) return; - - for(psys=ob->particlesystem.first, i=0; i< pd->psysindex-1; i++) - psys= psys->next; - - if (!psys) return; - - pointdensity_cache_psys(re, pd, ob, psys); + pointdensity_cache_psys(re, pd, ob, pd->psys); } else if (pd->source == TEX_PD_OBJECT) { Object *ob = pd->object; diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 63c4e97f86e..f112c237319 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -93,10 +93,7 @@ static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, if (intersect_type == VOL_BOUNDS_DEPTH) isect->faceorig= (RayFace*)shi->vlr; else if (intersect_type == VOL_BOUNDS_SS) isect->faceorig= NULL; - if (checkfunc==VOL_IS_BACKFACE) - intersected = RE_ray_tree_intersect_check(R.raytree, isect, vol_backface_intersect_check); - else - intersected = RE_ray_tree_intersect(R.raytree, isect); + intersected = RE_ray_tree_intersect(R.raytree, isect); if(intersected) { From 2de4c8f2b20efe57a27804bd20d7e4882e9137d4 Mon Sep 17 00:00:00 2001 From: Robin Allen Date: Mon, 17 Aug 2009 22:17:25 +0000 Subject: [PATCH 105/577] Implemented multisampling for texture nodes. --- .../nodes/intern/TEX_nodes/TEX_output.c | 46 ++++++++++++++++++- source/blender/nodes/intern/TEX_util.c | 2 +- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_output.c b/source/blender/nodes/intern/TEX_nodes/TEX_output.c index 355de796c7e..96ee5d74f66 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_output.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_output.c @@ -35,6 +35,48 @@ static bNodeSocketType inputs[]= { { -1, 0, "" } }; +static void osa( + void (*input_fn)(float *, bNodeStack *, TexParams *, short), + float *out, + bNodeStack *in, + TexParams *p, + short thread +){ + if(!p->dxt) { + input_fn(out, in, p, thread); + } else { + float sample[4] = {0}; + float coord[3]; + TexParams sp = *p; + int i; + + sp.coord = coord; + sp.dxt = sp.dyt = 0; + + QUATCOPY(out, sample); + + for(i=0; i<5; i++) { + VECCOPY(coord, p->coord); + + if(i < 4) + { + if(i % 2) VECADD(coord, coord, p->dxt); + if(i > 1) VECADD(coord, coord, p->dyt); + } + else + { + VECADDFAC(coord, coord, p->dxt, 0.5); + VECADDFAC(coord, coord, p->dyt, 0.5); + } + + input_fn(sample, in, &sp, thread); + + QUATADDFAC(out, out, sample, 0.2); + } + } +} + + /* applies to render pipeline */ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) { @@ -52,14 +94,14 @@ static void exec(void *data, bNode *node, bNodeStack **in, bNodeStack **out) TexParams params; params_from_cdata(¶ms, cdata); - tex_input_rgba(&target->tr, in[0], ¶ms, cdata->thread); + osa(tex_input_rgba, &target->tr, in[0], ¶ms, cdata->thread); target->tin = (target->tr + target->tg + target->tb) / 3.0f; target->talpha = 1.0f; if(target->nor) { if(in[1]->hasinput) - tex_input_vec(target->nor, in[1], ¶ms, cdata->thread); + osa(tex_input_vec, target->nor, in[1], ¶ms, cdata->thread); else target->nor = 0; } diff --git a/source/blender/nodes/intern/TEX_util.c b/source/blender/nodes/intern/TEX_util.c index b88efb47990..36182d2498d 100644 --- a/source/blender/nodes/intern/TEX_util.c +++ b/source/blender/nodes/intern/TEX_util.c @@ -149,7 +149,7 @@ void tex_do_preview(bNode *node, bNodeStack *ns, TexCallData *cdata) params.dxt = 0; params.dyt = 0; - params.cfra = 0; /* XXX Use current? */ + params.cfra = cdata->cfra; params.coord = coord; for(x=0; xxsize; x++) From 7d93d1c8f8f537d5213c5014a196d6e1452b483f Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Mon, 17 Aug 2009 22:27:08 +0000 Subject: [PATCH 106/577] Bugfix for time line: Fixing usage of uninitialized memory which resulted in e.g. backward playing time line. --- source/blender/editors/screen/screen_edit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 76a62128e91..aa36675fb90 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1527,7 +1527,7 @@ void ED_screen_animation_timer(bContext *C, int redraws, int sync, int enable) screen->animtimer= NULL; if(enable) { - struct ScreenAnimData *sad= MEM_mallocN(sizeof(ScreenAnimData), "ScreenAnimData"); + struct ScreenAnimData *sad= MEM_callocN(sizeof(ScreenAnimData), "ScreenAnimData"); screen->animtimer= WM_event_add_window_timer(win, TIMER0, (1.0/FPS)); sad->ar= CTX_wm_region(C); From 2d7305f12db9cd07c6c9e7cad565d48de7996aa9 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Mon, 17 Aug 2009 23:37:39 +0000 Subject: [PATCH 107/577] 2.5/Sculpt: * Fixed tablet pressure for brush size. --- source/blender/editors/sculpt_paint/sculpt.c | 29 ++++++++------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 43d70cfcf7a..b24162a76e1 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -125,7 +125,7 @@ typedef enum StrokeFlags { */ typedef struct StrokeCache { /* Invariants */ - float radius; + float initial_radius; float scale[3]; int flag; float clip_tolerance[3]; @@ -133,6 +133,7 @@ typedef struct StrokeCache { float depth; /* Variants */ + float radius; float true_location[3]; float location[3]; float flip; @@ -214,21 +215,6 @@ static void project(bglMats *mats, const float v[3], short p[2]) * */ -/* Return modified brush size. Uses current tablet pressure (if available) to - shrink the brush. Skipped for grab brush because only the first mouse down - size is used, which is small if the user has just touched the pen to the - tablet */ -static char brush_size(Sculpt *sd, SculptSession *ss) -{ - Brush *brush = paint_brush(&sd->paint); - float size= brush->size; - - if((brush->sculpt_tool != SCULPT_TOOL_GRAB) && (brush->flag & BRUSH_SIZE_PRESSURE)) - size *= ss->cache->pressure; - - return size; -} - /* Return modified brush strength. Includes the direction of the brush, positive values pull vertices, negative values push. Uses tablet pressure and a special multiplier found experimentally to scale the strength factor. */ @@ -1267,7 +1253,7 @@ static void sculpt_update_cache_invariants(Sculpt *sd, SculptSession *ss, bConte } unproject(cache->mats, cache->true_location, cache->initial_mouse[0], cache->initial_mouse[1], cache->depth); - cache->radius = unproject_brush_radius(ss, brush_size(sd, ss)); + cache->initial_radius = unproject_brush_radius(ss, brush->size); cache->rotation = 0; cache->first_time = 1; } @@ -1289,7 +1275,14 @@ static void sculpt_update_cache_variants(Sculpt *sd, SculptSession *ss, PointerR /* Truly temporary data that isn't stored in properties */ cache->previous_pixel_radius = cache->pixel_radius; - cache->pixel_radius = brush_size(sd, ss); + cache->pixel_radius = brush->size; + + if(brush->flag & BRUSH_SIZE_PRESSURE) { + cache->pixel_radius *= cache->pressure; + cache->radius = cache->initial_radius * cache->pressure; + } + else + cache->radius = cache->initial_radius; if(brush->flag & BRUSH_ANCHORED) { dx = cache->mouse[0] - cache->initial_mouse[0]; From a5da26f59d8cd820ca4d27a06028dd6aaee65784 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Tue, 18 Aug 2009 01:19:00 +0000 Subject: [PATCH 108/577] 2.5/Sculpt: * Added UI for brush stroke. Contains for now spacing and smooth stroke * Removed Sculpt UI for airbrush -- doesn't do anything in sculpt mode * Improved smooth stroke by using float instead of int precision, so smooth stroke is even smoother now --- release/ui/space_view3d_toolbar.py | 28 ++++++++++++++- source/blender/blenkernel/intern/brush.c | 2 ++ source/blender/editors/sculpt_paint/sculpt.c | 37 ++++++++++---------- source/blender/makesdna/DNA_brush_types.h | 4 ++- source/blender/makesrna/intern/rna_brush.c | 10 +++++- 5 files changed, 60 insertions(+), 21 deletions(-) diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py index 1308791bdbc..be378cc46fe 100644 --- a/release/ui/space_view3d_toolbar.py +++ b/release/ui/space_view3d_toolbar.py @@ -341,7 +341,7 @@ class VIEW3D_PT_tools_brush(PaintPanel): row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") col = layout.column() - col.itemR(brush, "airbrush") + if brush.sculpt_tool != 'LAYER': col.itemR(brush, "anchored") @@ -421,6 +421,31 @@ class VIEW3D_PT_tools_brush(PaintPanel): row.itemR(brush, "strength", slider=True) row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") +class VIEW3D_PT_tools_brush_stroke(PaintPanel): + __label__ = "Stroke" + __default_closed__ = True + + def poll(self, context): + settings = self.paint_settings(context) + return (settings and settings.brush and context.sculpt_object) + + def draw(self, context): + settings = self.paint_settings(context) + brush = settings.brush + layout = self.layout + + layout.itemR(brush, "smooth_stroke") + col = layout.column() + col.active = brush.smooth_stroke + col.itemR(brush, "smooth_stroke_radius", text="Radius", slider=True) + col.itemR(brush, "smooth_stroke_factor", text="Factor", slider=True) + + layout.itemR(brush, "space") + col = layout.column() + col.active = brush.space + col.itemR(brush, "spacing", text="Distance", slider=True) + + class VIEW3D_PT_tools_brush_curve(PaintPanel): __label__ = "Curve" __default_closed__ = True @@ -602,6 +627,7 @@ bpy.types.register(VIEW3D_PT_tools_mballedit) bpy.types.register(VIEW3D_PT_tools_latticeedit) bpy.types.register(VIEW3D_PT_tools_posemode) bpy.types.register(VIEW3D_PT_tools_brush) +bpy.types.register(VIEW3D_PT_tools_brush_stroke) bpy.types.register(VIEW3D_PT_tools_brush_curve) bpy.types.register(VIEW3D_PT_sculpt_options) bpy.types.register(VIEW3D_PT_tools_vertexpaint) diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index 612f6d2051d..a7b5a16d924 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -75,6 +75,8 @@ Brush *add_brush(const char *name) brush->alpha= 0.2f; brush->size= 25; brush->spacing= 10.0f; + brush->smooth_stroke_radius= 75; + brush->smooth_stroke_factor= 0.9; brush->rate= 0.1f; brush->innerradius= 0.5f; brush->clone.alpha= 0.5; diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index b24162a76e1..f7f72d611dc 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -129,7 +129,7 @@ typedef struct StrokeCache { float scale[3]; int flag; float clip_tolerance[3]; - int initial_mouse[2]; + float initial_mouse[2]; float depth; /* Variants */ @@ -138,7 +138,7 @@ typedef struct StrokeCache { float location[3]; float flip; float pressure; - int mouse[2]; + float mouse[2]; /* The rest is temporary storage that isn't saved as a property */ @@ -1077,7 +1077,7 @@ static void draw_paint_cursor(bContext *C, int x, int y, void *customdata) if(ss && ss->cache && brush && (brush->flag & BRUSH_SMOOTH_STROKE)) { ARegion *ar = CTX_wm_region(C); - sdrawline(x, y, ss->cache->mouse[0] - ar->winrct.xmin, ss->cache->mouse[1] - ar->winrct.ymin); + sdrawline(x, y, (int)ss->cache->mouse[0] - ar->winrct.xmin, (int)ss->cache->mouse[1] - ar->winrct.ymin); } glDisable(GL_BLEND); @@ -1201,7 +1201,7 @@ static void sculpt_update_cache_invariants(Sculpt *sd, SculptSession *ss, bConte RNA_float_get_array(op->ptr, "scale", cache->scale); cache->flag = RNA_int_get(op->ptr, "flag"); RNA_float_get_array(op->ptr, "clip_tolerance", cache->clip_tolerance); - RNA_int_get_array(op->ptr, "initial_mouse", cache->initial_mouse); + RNA_float_get_array(op->ptr, "initial_mouse", cache->initial_mouse); cache->depth = RNA_float_get(op->ptr, "depth"); cache->mouse[0] = cache->initial_mouse[0]; @@ -1264,12 +1264,13 @@ static void sculpt_update_cache_variants(Sculpt *sd, SculptSession *ss, PointerR StrokeCache *cache = ss->cache; Brush *brush = paint_brush(&sd->paint); float grab_location[3]; + int dx, dy; if(!(brush->flag & BRUSH_ANCHORED)) RNA_float_get_array(ptr, "location", cache->true_location); cache->flip = RNA_boolean_get(ptr, "flip"); - RNA_int_get_array(ptr, "mouse", cache->mouse); + RNA_float_get_array(ptr, "mouse", cache->mouse); cache->pressure = RNA_float_get(ptr, "pressure"); /* Truly temporary data that isn't stored in properties */ @@ -1326,7 +1327,8 @@ static void sculpt_brush_stroke_init_properties(bContext *C, wmOperator *op, wmE ModifierData *md; ViewContext vc; float scale[3], clip_tolerance[3] = {0,0,0}; - int mouse[2], flag = 0; + float mouse[2]; + int flag = 0; /* Set scaling adjustment */ scale[0] = 1.0f / ob->size[0]; @@ -1353,7 +1355,7 @@ static void sculpt_brush_stroke_init_properties(bContext *C, wmOperator *op, wmE /* Initial mouse location */ mouse[0] = event->x; mouse[1] = event->y; - RNA_int_set_array(op->ptr, "initial_mouse", mouse); + RNA_float_set_array(op->ptr, "initial_mouse", mouse); /* Initial screen depth under the mouse */ view3d_set_viewcontext(C, &vc); @@ -1434,7 +1436,7 @@ static void sculpt_flush_update(bContext *C) } /* Returns zero if no sculpt changes should be made, non-zero otherwise */ -static int sculpt_smooth_stroke(Sculpt *s, SculptSession *ss, int output[2], wmEvent *event) +static int sculpt_smooth_stroke(Sculpt *s, SculptSession *ss, float output[2], wmEvent *event) { Brush *brush = paint_brush(&s->paint); @@ -1443,13 +1445,12 @@ static int sculpt_smooth_stroke(Sculpt *s, SculptSession *ss, int output[2], wmE if(brush->flag & BRUSH_SMOOTH_STROKE && brush->sculpt_tool != SCULPT_TOOL_GRAB) { StrokeCache *cache = ss->cache; - float u = .9, v = 1.0 - u; - int dx = cache->mouse[0] - event->x, dy = cache->mouse[1] - event->y; - int radius = 50; + float u = brush->smooth_stroke_factor, v = 1.0 - u; + float dx = cache->mouse[0] - event->x, dy = cache->mouse[1] - event->y; /* If the mouse is moving within the radius of the last move, don't update the mouse position. This allows sharp turns. */ - if(dx*dx + dy*dy < radius*radius) + if(dx*dx + dy*dy < brush->smooth_stroke_radius * brush->smooth_stroke_radius) return 0; output[0] = event->x * v + cache->mouse[0] * u; @@ -1467,7 +1468,7 @@ int sculpt_space_stroke_enabled(Sculpt *s) } /* Put the location of the next sculpt stroke dot into the stroke RNA and apply it to the mesh */ -static void sculpt_brush_stroke_add_step(bContext *C, wmOperator *op, wmEvent *event, int mouse[2]) +static void sculpt_brush_stroke_add_step(bContext *C, wmOperator *op, wmEvent *event, float mouse[2]) { Sculpt *sd = CTX_data_tool_settings(C)->sculpt; SculptSession *ss = CTX_data_active_object(C)->sculpt; @@ -1489,7 +1490,7 @@ static void sculpt_brush_stroke_add_step(bContext *C, wmOperator *op, wmEvent *e /* Add to stroke */ RNA_collection_add(op->ptr, "stroke", &itemptr); RNA_float_set_array(&itemptr, "location", center); - RNA_int_set_array(&itemptr, "mouse", mouse); + RNA_float_set_array(&itemptr, "mouse", mouse); RNA_boolean_set(&itemptr, "flip", event->shift); RNA_float_set(&itemptr, "pressure", pressure); sculpt_update_cache_variants(sd, ss, &itemptr); @@ -1500,7 +1501,7 @@ static void sculpt_brush_stroke_add_step(bContext *C, wmOperator *op, wmEvent *e /* For brushes with stroke spacing enabled, moves mouse in steps towards the final mouse location. */ -static int sculpt_space_stroke(bContext *C, wmOperator *op, wmEvent *event, Sculpt *s, SculptSession *ss, const int final_mouse[2]) +static int sculpt_space_stroke(bContext *C, wmOperator *op, wmEvent *event, Sculpt *s, SculptSession *ss, const float final_mouse[2]) { StrokeCache *cache = ss->cache; Brush *brush = paint_brush(&s->paint); @@ -1508,7 +1509,7 @@ static int sculpt_space_stroke(bContext *C, wmOperator *op, wmEvent *event, Scul if(sculpt_space_stroke_enabled(s)) { float vec[2] = {final_mouse[0] - cache->mouse[0], final_mouse[1] - cache->mouse[1]}; - int mouse[2] = {cache->mouse[0], cache->mouse[1]}; + float mouse[2] = {cache->mouse[0], cache->mouse[1]}; float length, scale; int steps = 0, i; @@ -1556,7 +1557,7 @@ static int sculpt_brush_stroke_modal(bContext *C, wmOperator *op, wmEvent *event } if(ss->cache) { - int mouse[2]; + float mouse[2]; if(sculpt_smooth_stroke(sd, ss, mouse, event)) { if(sculpt_space_stroke_enabled(sd)) { @@ -1646,7 +1647,7 @@ static void SCULPT_OT_brush_stroke(wmOperatorType *ot) RNA_def_float_vector(ot->srna, "clip_tolerance", 3, NULL, 0.0f, FLT_MAX, "clip_tolerance", "", 0.0f, 1000.0f); /* The initial 2D location of the mouse */ - RNA_def_int_vector(ot->srna, "initial_mouse", 2, NULL, INT_MIN, INT_MAX, "initial_mouse", "", INT_MIN, INT_MAX); + RNA_def_float_vector(ot->srna, "initial_mouse", 2, NULL, INT_MIN, INT_MAX, "initial_mouse", "", INT_MIN, INT_MAX); /* The initial screen depth of the mouse */ RNA_def_float(ot->srna, "depth", 0.0f, 0.0f, FLT_MAX, "depth", "", 0.0f, FLT_MAX); diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index e8962d013f4..52ea298c110 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -58,6 +58,8 @@ typedef struct Brush { int size; /* brush diameter */ float innerradius; /* inner radius after which the falloff starts */ float spacing; /* spacing of paint operations */ + int smooth_stroke_radius; /* turning radius (in pixels) for smooth stroke */ + float smooth_stroke_factor; /* higher values limit fast changes in the stroke direction */ float rate; /* paint operations / second (airbrush) */ float rgb[3]; /* color */ @@ -66,7 +68,7 @@ typedef struct Brush { short texact; /* active texture */ char sculpt_tool; /* active tool */ - char pad; + char pad[1]; } Brush; /* Brush.flag */ diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 65c66800f41..03b5a44f52b 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -130,6 +130,14 @@ void rna_def_brush(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "spacing"); RNA_def_property_range(prop, 1.0f, 100.0f); RNA_def_property_ui_text(prop, "Spacing", "Spacing between brush stamps."); + + prop= RNA_def_property(srna, "smooth_stroke_radius", PROP_INT, PROP_NONE); + RNA_def_property_range(prop, 10, 200); + RNA_def_property_ui_text(prop, "Smooth Stroke Radius", "Minimum distance from last point before stroke continues."); + + prop= RNA_def_property(srna, "smooth_stroke_factor", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.5, 0.99); + RNA_def_property_ui_text(prop, "Smooth Stroke Factor", "Higher values give a smoother stroke."); prop= RNA_def_property(srna, "rate", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rate"); @@ -247,7 +255,7 @@ static void rna_def_operator_stroke_element(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Location", ""); - prop= RNA_def_property(srna, "mouse", PROP_INT, PROP_XYZ); + prop= RNA_def_property(srna, "mouse", PROP_FLOAT, PROP_XYZ); RNA_def_property_flag(prop, PROP_IDPROPERTY); RNA_def_property_array(prop, 2); RNA_def_property_ui_text(prop, "Mouse", ""); From 4fb19159ea47027bbaf31d379da3d6b0ea0f0f28 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 18 Aug 2009 01:29:25 +0000 Subject: [PATCH 109/577] 2.5: RNA, defining enums, pointers and collections properties is now possible from python, but it's still work in progress. Pointers and collections are restricted to types derived from IDPropertyGroup (same as for operators), because RNA knows how to allocate/deallocate those. Collections have .add() and .remove(number) functions that can be used. The remove function should be fixed to take an other argument than a number. With the IDPropertyGroup restriction, pointers are more like nested structs. They don't have add(), remove() yet, not sure where to put them. Currently the pointer / nested struct is automatically allocated in the get() function, this needs to be fixed, rule is that RNA get() will not change any data for thread safety. Also, it is only possible to add properties to structs after they have been registered, which needs to be improved as well. Example code: http://www.pasteall.org/7201/python --- source/blender/blenkernel/intern/idprop.c | 2 +- source/blender/blenloader/intern/readfile.c | 7 +- source/blender/blenloader/intern/writefile.c | 6 +- source/blender/editors/screen/screen_ops.c | 1 - source/blender/makesrna/RNA_access.h | 2 +- source/blender/makesrna/RNA_types.h | 2 +- source/blender/makesrna/intern/rna_ID.c | 26 ++ source/blender/makesrna/intern/rna_access.c | 36 ++- source/blender/makesrna/intern/rna_define.c | 17 ++ source/blender/makesrna/intern/rna_internal.h | 3 + source/blender/makesrna/intern/rna_main.c | 58 ++-- source/blender/makesrna/intern/rna_render.c | 2 +- source/blender/makesrna/intern/rna_ui.c | 6 +- source/blender/python/intern/bpy_rna.c | 260 ++++++++++++++++-- source/blender/python/intern/bpy_rna.h | 7 +- 15 files changed, 358 insertions(+), 77 deletions(-) diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index 54366aadd92..3cff82f522a 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -167,7 +167,7 @@ void IDP_ResizeIDPArray(IDProperty *prop, int newlen) for (i=newlen; ilen; i++) { IDP_FreeProperty(GETPROP(prop, i)); } - memcpy(newarr, prop->data.pointer, newlen*prop->len*sizeof(IDProperty)); + memcpy(newarr, prop->data.pointer, newlen*sizeof(IDProperty)); } if(prop->data.pointer) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 9272c6fe353..61f6cb8b44c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1366,7 +1366,7 @@ void IDP_LibLinkProperty(IDProperty *prop, int switch_endian, FileData *fd); static void IDP_DirectLinkIDPArray(IDProperty *prop, int switch_endian, FileData *fd) { - IDProperty **array; + IDProperty *array; int i; /*since we didn't save the extra buffer, set totallen to len.*/ @@ -1374,11 +1374,10 @@ static void IDP_DirectLinkIDPArray(IDProperty *prop, int switch_endian, FileData prop->data.pointer = newdataadr(fd, prop->data.pointer); if (switch_endian) { - test_pointer_array(fd, prop->data.pointer); - array= (IDProperty**) prop->data.pointer; + array= (IDProperty*) prop->data.pointer; for(i=0; ilen; i++) - IDP_DirectLinkProperty(array[i], switch_endian, fd); + IDP_DirectLinkProperty(&array[i], switch_endian, fd); } } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index cd388cdf9cc..9d059af9887 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -407,13 +407,13 @@ static void IDP_WriteIDPArray(IDProperty *prop, void *wd) { /*REMEMBER to set totalen to len in the linking code!!*/ if (prop->data.pointer) { - IDProperty **array = prop->data.pointer; + IDProperty *array = prop->data.pointer; int a; - writedata(wd, DATA, MEM_allocN_len(prop->data.pointer), prop->data.pointer); + writestruct(wd, DATA, "IDProperty", prop->len, array); for(a=0; alen; a++) - IDP_WriteProperty(array[a], wd); + IDP_WriteProperty_OnlyData(&array[a], wd); } } diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index b591c6e6856..fab4de50568 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -1582,7 +1582,6 @@ static void SCREEN_OT_screen_set(wmOperatorType *ot) ot->poll= ED_operator_screenactive; /* rna */ - RNA_def_pointer_runtime(ot->srna, "screen", &RNA_Screen, "Screen", ""); RNA_def_int(ot->srna, "delta", 0, INT_MIN, INT_MAX, "Delta", "", INT_MIN, INT_MAX); } diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 95c46515204..d5680ac77ba 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -649,7 +649,7 @@ RawPropertyType RNA_property_raw_type(PropertyRNA *prop); void RNA_property_pointer_add(PointerRNA *ptr, PropertyRNA *prop); void RNA_property_pointer_remove(PointerRNA *ptr, PropertyRNA *prop); void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr); -void RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key); +int RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key); void RNA_property_collection_clear(PointerRNA *ptr, PropertyRNA *prop); /* Path diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 72ecf0e7a93..042f7578cf4 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -263,7 +263,7 @@ typedef int (*StructValidateFunc)(struct PointerRNA *ptr, void *data, int *have_ typedef int (*StructCallbackFunc)(struct PointerRNA *ptr, struct FunctionRNA *func, ParameterList *list); typedef void (*StructFreeFunc)(void *data); typedef struct StructRNA *(*StructRegisterFunc)(const struct bContext *C, struct ReportList *reports, void *data, - StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free); + const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free); typedef void (*StructUnregisterFunc)(const struct bContext *C, struct StructRNA *type); typedef struct StructRNA StructRNA; diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index cf3d59f78a0..f6e0a2468c4 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -152,6 +152,30 @@ IDProperty *rna_IDPropertyGroup_idproperties(PointerRNA *ptr, int create) return ptr->data; } +void rna_IDPropertyGroup_unregister(const bContext *C, StructRNA *type) +{ + RNA_struct_free(&BLENDER_RNA, type); +} + +StructRNA *rna_IDPropertyGroup_register(const bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) +{ + PointerRNA dummyptr; + + /* create dummy pointer */ + RNA_pointer_create(NULL, &RNA_IDPropertyGroup, NULL, &dummyptr); + + /* validate the python class */ + if(validate(&dummyptr, data, NULL) != 0) + return NULL; + + return RNA_def_struct(&BLENDER_RNA, identifier, "IDPropertyGroup"); // XXX +} + +StructRNA* rna_IDPropertyGroup_refine(PointerRNA *ptr) +{ + return ptr->type; +} + #else static void rna_def_ID_properties(BlenderRNA *brna) @@ -210,6 +234,8 @@ static void rna_def_ID_properties(BlenderRNA *brna) srna= RNA_def_struct(brna, "IDPropertyGroup", NULL); RNA_def_struct_ui_text(srna, "ID Property Group", "Group of ID properties."); RNA_def_struct_idproperties_func(srna, "rna_IDPropertyGroup_idproperties"); + RNA_def_struct_register_funcs(srna, "rna_IDPropertyGroup_register", "rna_IDPropertyGroup_unregister"); + RNA_def_struct_refine_func(srna, "rna_IDPropertyGroup_refine"); } static void rna_def_ID(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 2de59586611..54cde57a54f 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -1259,8 +1259,15 @@ PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop) else if(pprop->get) { return pprop->get(ptr); } + else if(prop->flag & PROP_IDPROPERTY) { + /* XXX temporary hack to add it automatically, reading should + never do any write ops, to ensure thread safety etc .. */ + RNA_property_pointer_add(ptr, prop); + return RNA_property_pointer_get(ptr, prop); + } else { PointerRNA result; + memset(&result, 0, sizeof(result)); return result; } @@ -1398,7 +1405,7 @@ int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop) void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr) { IDProperty *idprop; - //CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop; + CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop; if((idprop=rna_idproperty_check(&prop, ptr))) { IDPropertyTemplate val = {0}; @@ -1424,7 +1431,6 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA MEM_freeN(item); } } -#if 0 else if(cprop->add){ if(!(cprop->add->flag & FUNC_USE_CONTEXT)) { /* XXX check for this somewhere else */ ParameterList params; @@ -1433,9 +1439,8 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA RNA_parameter_list_free(¶ms); } } -#endif - else - printf("RNA_property_collection_add %s.%s: not implemented for this property.\n", ptr->type->identifier, prop->identifier); + /*else + printf("RNA_property_collection_add %s.%s: not implemented for this property.\n", ptr->type->identifier, prop->identifier);*/ if(r_ptr) { if(idprop) { @@ -1450,10 +1455,10 @@ void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA } } -void RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key) +int RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key) { IDProperty *idprop; - //CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop; + CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop; if((idprop=rna_idproperty_check(&prop, ptr))) { IDProperty tmp, *array; @@ -1472,20 +1477,25 @@ void RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key) IDP_ResizeIDPArray(idprop, len-1); } + + return 1; } - else if(prop->flag & PROP_IDPROPERTY); -#if 0 + else if(prop->flag & PROP_IDPROPERTY) + return 1; else if(cprop->remove){ if(!(cprop->remove->flag & FUNC_USE_CONTEXT)) { /* XXX check for this somewhere else */ ParameterList params; - RNA_parameter_list_create(&ptr, cprop->remove); + RNA_parameter_list_create(¶ms, ptr, cprop->remove); RNA_function_call(NULL, NULL, ptr, cprop->remove, ¶ms); RNA_parameter_list_free(¶ms); } + + return 0; } -#endif - else - printf("RNA_property_collection_remove %s.%s: only supported for id properties.\n", ptr->type->identifier, prop->identifier); + /*else + printf("RNA_property_collection_remove %s.%s: only supported for id properties.\n", ptr->type->identifier, prop->identifier);*/ + + return 0; } void RNA_property_collection_clear(PointerRNA *ptr, PropertyRNA *prop) diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 0861d7d51a0..9bdbc8baed7 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -2419,6 +2419,7 @@ void RNA_def_property_duplicate_pointers(PropertyRNA *prop) EnumPropertyItem *earray; float *farray; int *iarray; + int a; if(prop->identifier) prop->identifier= BLI_strdup(prop->identifier); if(prop->name) prop->name= BLI_strdup(prop->name); @@ -2452,7 +2453,14 @@ void RNA_def_property_duplicate_pointers(PropertyRNA *prop) earray= MEM_callocN(sizeof(EnumPropertyItem)*(eprop->totitem+1), "RNA_def_property_store"), memcpy(earray, eprop->item, sizeof(EnumPropertyItem)*(eprop->totitem+1)); eprop->item= earray; + + for(a=0; atotitem; a++) { + if(eprop->item[a].identifier) eprop->item[a].identifier= BLI_strdup(eprop->item[a].identifier); + if(eprop->item[a].name) eprop->item[a].name= BLI_strdup(eprop->item[a].name); + if(eprop->item[a].description) eprop->item[a].description= BLI_strdup(eprop->item[a].description); + } } + break; } case PROP_FLOAT: { FloatPropertyRNA *fprop= (FloatPropertyRNA*)prop; @@ -2479,6 +2487,8 @@ void RNA_def_property_duplicate_pointers(PropertyRNA *prop) void RNA_def_property_free_pointers(PropertyRNA *prop) { if(prop->flag & PROP_FREE_POINTERS) { + int a; + if(prop->identifier) MEM_freeN((void*)prop->identifier); if(prop->name) MEM_freeN((void*)prop->name); if(prop->description) MEM_freeN((void*)prop->description); @@ -2502,6 +2512,13 @@ void RNA_def_property_free_pointers(PropertyRNA *prop) case PROP_ENUM: { EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop; if(eprop->item) MEM_freeN((void*)eprop->item); + + for(a=0; atotitem; a++) { + if(eprop->item[a].identifier) MEM_freeN((void*)eprop->item[a].identifier); + if(eprop->item[a].name) MEM_freeN((void*)eprop->item[a].name); + if(eprop->item[a].description) MEM_freeN((void*)eprop->item[a].description); + } + break; } case PROP_STRING: { StringPropertyRNA *sprop= (StringPropertyRNA*)prop; diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index a8c7032733f..579441691ff 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -181,6 +181,9 @@ struct StructRNA *rna_ID_refine(struct PointerRNA *ptr); struct IDProperty *rna_ID_idproperties(struct PointerRNA *ptr, int create); void rna_ID_fake_user_set(struct PointerRNA *ptr, int value); struct IDProperty *rna_IDPropertyGroup_idproperties(struct PointerRNA *ptr, int create); +void rna_IDPropertyGroup_unregister(const struct bContext *C, struct StructRNA *type); +struct StructRNA *rna_IDPropertyGroup_register(const struct bContext *C, struct ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free); +struct StructRNA* rna_IDPropertyGroup_refine(struct PointerRNA *ptr); void rna_object_vgroup_name_index_get(struct PointerRNA *ptr, char *value, int index); int rna_object_vgroup_name_index_length(struct PointerRNA *ptr, int index); diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index 26fc3c2941e..c09b83dd682 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -220,34 +220,34 @@ void RNA_def_main(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - const char *lists[][5]= { - {"cameras", "Camera", "rna_Main_camera_begin", "Cameras", "Camera datablocks."}, - {"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene datablocks."}, - {"objects", "Object", "rna_Main_object_begin", "Objects", "Object datablocks."}, - {"materials", "Material", "rna_Main_mat_begin", "Materials", "Material datablocks."}, - {"nodetrees", "NodeTree", "rna_Main_nodetree_begin", "Node Trees", "Nodetree datablocks."}, - {"meshes", "Mesh", "rna_Main_mesh_begin", "Meshes", "Mesh datablocks."}, - {"lamps", "Lamp", "rna_Main_lamp_begin", "Lamps", "Lamp datablocks."}, - {"libraries", "Library", "rna_Main_library_begin", "Libraries", "Library datablocks."}, - {"screens", "Screen", "rna_Main_screen_begin", "Screens", "Screen datablocks."}, - {"windowmanagers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager datablocks."}, - {"images", "Image", "rna_Main_image_begin", "Images", "Image datablocks."}, - {"lattices", "Lattice", "rna_Main_latt_begin", "Lattices", "Lattice datablocks."}, - {"curves", "Curve", "rna_Main_curve_begin", "Curves", "Curve datablocks."}, - {"metaballs", "MetaBall", "rna_Main_mball_begin", "Metaballs", "Metaball datablocks."}, - {"vfonts", "VectorFont", "rna_Main_vfont_begin", "Vector Fonts", "Vector font datablocks."}, - {"textures", "Texture", "rna_Main_tex_begin", "Textures", "Texture datablocks."}, - {"brushes", "Brush", "rna_Main_brush_begin", "Brushes", "Brush datablocks."}, - {"worlds", "World", "rna_Main_world_begin", "Worlds", "World datablocks."}, - {"groups", "Group", "rna_Main_group_begin", "Groups", "Group datablocks."}, - {"keys", "ID", "rna_Main_key_begin", "Keys", "Key datablocks."}, - {"scripts", "ID", "rna_Main_script_begin", "Scripts", "Script datablocks."}, - {"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks."}, - {"sounds", "ID", "rna_Main_sound_begin", "Sounds", "Sound datablocks."}, - {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks."}, - {"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks."}, - {"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle datablocks."}, - {NULL, NULL, NULL, NULL, NULL}}; + const char *lists[][7]= { + {"cameras", "Camera", "rna_Main_camera_begin", "Cameras", "Camera datablocks.", NULL, NULL}, + {"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene datablocks.", NULL, NULL}, + {"objects", "Object", "rna_Main_object_begin", "Objects", "Object datablocks.", NULL, NULL}, + {"materials", "Material", "rna_Main_mat_begin", "Materials", "Material datablocks.", NULL, NULL}, + {"nodetrees", "NodeTree", "rna_Main_nodetree_begin", "Node Trees", "Nodetree datablocks.", NULL, NULL}, + {"meshes", "Mesh", "rna_Main_mesh_begin", "Meshes", "Mesh datablocks.", "add_mesh", "remove_mesh"}, + {"lamps", "Lamp", "rna_Main_lamp_begin", "Lamps", "Lamp datablocks.", NULL, NULL}, + {"libraries", "Library", "rna_Main_library_begin", "Libraries", "Library datablocks.", NULL, NULL}, + {"screens", "Screen", "rna_Main_screen_begin", "Screens", "Screen datablocks.", NULL, NULL}, + {"windowmanagers", "WindowManager", "rna_Main_wm_begin", "Window Managers", "Window manager datablocks.", NULL, NULL}, + {"images", "Image", "rna_Main_image_begin", "Images", "Image datablocks.", NULL, NULL}, + {"lattices", "Lattice", "rna_Main_latt_begin", "Lattices", "Lattice datablocks.", NULL, NULL}, + {"curves", "Curve", "rna_Main_curve_begin", "Curves", "Curve datablocks.", NULL, NULL} , + {"metaballs", "MetaBall", "rna_Main_mball_begin", "Metaballs", "Metaball datablocks.", NULL, NULL}, + {"vfonts", "VectorFont", "rna_Main_vfont_begin", "Vector Fonts", "Vector font datablocks.", NULL, NULL}, + {"textures", "Texture", "rna_Main_tex_begin", "Textures", "Texture datablocks.", NULL, NULL}, + {"brushes", "Brush", "rna_Main_brush_begin", "Brushes", "Brush datablocks.", NULL, NULL}, + {"worlds", "World", "rna_Main_world_begin", "Worlds", "World datablocks.", NULL, NULL}, + {"groups", "Group", "rna_Main_group_begin", "Groups", "Group datablocks.", NULL, NULL}, + {"keys", "ID", "rna_Main_key_begin", "Keys", "Key datablocks.", NULL, NULL}, + {"scripts", "ID", "rna_Main_script_begin", "Scripts", "Script datablocks.", NULL, NULL}, + {"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks.", NULL, NULL}, + {"sounds", "ID", "rna_Main_sound_begin", "Sounds", "Sound datablocks.", NULL, NULL}, + {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks.", NULL, NULL}, + {"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks.", NULL, NULL}, + {"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle datablocks.", NULL, NULL}, + {NULL, NULL, NULL, NULL, NULL, NULL, NULL}}; int i; srna= RNA_def_struct(brna, "Main", NULL); @@ -264,7 +264,7 @@ void RNA_def_main(BlenderRNA *brna) { prop= RNA_def_property(srna, lists[i][0], PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, lists[i][1]); - RNA_def_property_collection_funcs(prop, lists[i][2], "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0, 0); + RNA_def_property_collection_funcs(prop, lists[i][2], "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, lists[i][5], lists[i][6]); RNA_def_property_ui_text(prop, lists[i][3], lists[i][4]); } diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index a219bd5aefa..9137e596da1 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -111,7 +111,7 @@ static void rna_RenderEngine_unregister(const bContext *C, StructRNA *type) RNA_struct_free(&BLENDER_RNA, type); } -static StructRNA *rna_RenderEngine_register(const bContext *C, ReportList *reports, void *data, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) +static StructRNA *rna_RenderEngine_register(const bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) { RenderEngineType *et, dummyet = {0}; RenderEngine dummyengine= {0}; diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index 660dbb49027..f16180451a7 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -148,7 +148,7 @@ static void rna_Panel_unregister(const bContext *C, StructRNA *type) WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL); } -static StructRNA *rna_Panel_register(const bContext *C, ReportList *reports, void *data, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) +static StructRNA *rna_Panel_register(const bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) { ARegionType *art; PanelType *pt, dummypt = {0}; @@ -245,7 +245,7 @@ static void rna_Header_unregister(const bContext *C, StructRNA *type) WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL); } -static StructRNA *rna_Header_register(const bContext *C, ReportList *reports, void *data, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) +static StructRNA *rna_Header_register(const bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) { ARegionType *art; HeaderType *ht, dummyht = {0}; @@ -361,7 +361,7 @@ static void rna_Menu_unregister(const bContext *C, StructRNA *type) WM_event_add_notifier(C, NC_SCREEN|NA_EDITED, NULL); } -static StructRNA *rna_Menu_register(const bContext *C, ReportList *reports, void *data, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) +static StructRNA *rna_Menu_register(const bContext *C, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) { ARegionType *art; MenuType *mt, dummymt = {0}; diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 114727eeef5..bece114d8bd 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -1451,6 +1451,38 @@ static PyObject *pyrna_prop_get(BPy_PropertyRNA *self, PyObject *args) } +static PyObject *pyrna_prop_add(BPy_PropertyRNA *self, PyObject *args) +{ + PointerRNA newptr; + + RNA_property_collection_add(&self->ptr, self->prop, &newptr); + if(!newptr.data) { + PyErr_SetString( PyExc_TypeError, "add() not supported for this collection"); + return NULL; + } + else { + return pyrna_struct_CreatePyObject(&newptr); + } +} + +static PyObject *pyrna_prop_remove(BPy_PropertyRNA *self, PyObject *args) +{ + PyObject *ret; + int key= 0; + + if (!PyArg_ParseTuple(args, "i:remove", &key)) + return NULL; + + if(!RNA_property_collection_remove(&self->ptr, self->prop, key)) { + PyErr_SetString( PyExc_TypeError, "remove() not supported for this collection"); + return NULL; + } + + ret = Py_None; + Py_INCREF(ret); + + return ret; +} static void foreach_attr_type( BPy_PropertyRNA *self, char *attr, /* values to assign */ @@ -1736,6 +1768,9 @@ static struct PyMethodDef pyrna_prop_methods[] = { {"get", (PyCFunction)pyrna_prop_get, METH_VARARGS, NULL}, + {"add", (PyCFunction)pyrna_prop_add, METH_VARARGS, NULL}, + {"remove", (PyCFunction)pyrna_prop_remove, METH_VARARGS, NULL}, + /* array accessor function */ {"foreach_get", (PyCFunction)pyrna_prop_foreach_get, METH_VARARGS, NULL}, {"foreach_set", (PyCFunction)pyrna_prop_foreach_set, METH_VARARGS, NULL}, @@ -2307,10 +2342,13 @@ PyObject *BPy_GetStructRNA(PyObject *self) */ static struct PyMethodDef pyrna_struct_subtype_methods[] = { - {"FloatProperty", (PyCFunction)BPy_FloatProperty, METH_VARARGS|METH_KEYWORDS, ""}, - {"IntProperty", (PyCFunction)BPy_IntProperty, METH_VARARGS|METH_KEYWORDS, ""}, {"BoolProperty", (PyCFunction)BPy_BoolProperty, METH_VARARGS|METH_KEYWORDS, ""}, + {"IntProperty", (PyCFunction)BPy_IntProperty, METH_VARARGS|METH_KEYWORDS, ""}, + {"FloatProperty", (PyCFunction)BPy_FloatProperty, METH_VARARGS|METH_KEYWORDS, ""}, {"StringProperty", (PyCFunction)BPy_StringProperty, METH_VARARGS|METH_KEYWORDS, ""}, + {"EnumProperty", (PyCFunction)BPy_EnumProperty, METH_VARARGS|METH_KEYWORDS, ""}, + {"PointerProperty", (PyCFunction)BPy_PointerProperty, METH_VARARGS|METH_KEYWORDS, ""}, + {"CollectionProperty", (PyCFunction)BPy_CollectionProperty, METH_VARARGS|METH_KEYWORDS, ""}, // {"__get_rna", (PyCFunction)BPy_GetStructRNA, METH_NOARGS, ""}, {NULL, NULL, 0, NULL} @@ -2583,10 +2621,13 @@ PyObject *BPY_rna_types(void) } static struct PyMethodDef props_methods[] = { - {"FloatProperty", (PyCFunction)BPy_FloatProperty, METH_VARARGS|METH_KEYWORDS, ""}, - {"IntProperty", (PyCFunction)BPy_IntProperty, METH_VARARGS|METH_KEYWORDS, ""}, {"BoolProperty", (PyCFunction)BPy_BoolProperty, METH_VARARGS|METH_KEYWORDS, ""}, + {"IntProperty", (PyCFunction)BPy_IntProperty, METH_VARARGS|METH_KEYWORDS, ""}, + {"FloatProperty", (PyCFunction)BPy_FloatProperty, METH_VARARGS|METH_KEYWORDS, ""}, {"StringProperty", (PyCFunction)BPy_StringProperty, METH_VARARGS|METH_KEYWORDS, ""}, + {"EnumProperty", (PyCFunction)BPy_EnumProperty, METH_VARARGS|METH_KEYWORDS, ""}, + {"PointerProperty", (PyCFunction)BPy_PointerProperty, METH_VARARGS|METH_KEYWORDS, ""}, + {"CollectionProperty", (PyCFunction)BPy_CollectionProperty, METH_VARARGS|METH_KEYWORDS, ""}, {NULL, NULL, 0, NULL} }; @@ -2679,15 +2720,16 @@ static PyObject *bpy_prop_deferred_return(void *func, PyObject *kw) /* Function that sets RNA, NOTE - self is NULL when called from python, but being abused from C so we can pass the srna allong * This isnt incorrect since its a python object - but be careful */ -PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw) + +PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw) { - static char *kwlist[] = {"attr", "name", "description", "min", "max", "soft_min", "soft_max", "default", NULL}; + static char *kwlist[] = {"attr", "name", "description", "default", NULL}; char *id, *name="", *description=""; - float min=FLT_MIN, max=FLT_MAX, soft_min=FLT_MIN, soft_max=FLT_MAX, def=0.0f; + int def=0; PropertyRNA *prop; StructRNA *srna; - if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssfffff:FloatProperty", kwlist, &id, &name, &description, &min, &max, &soft_min, &soft_max, &def)) + if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssi:BoolProperty", kwlist, &id, &name, &description, &def)) return NULL; if (PyTuple_Size(args) > 0) { @@ -2700,12 +2742,12 @@ PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw) return NULL; /* self's type was compatible but error getting the srna */ } else if(srna) { - prop= RNA_def_float(srna, id, def, min, max, name, description, soft_min, soft_max); + prop= RNA_def_boolean(srna, id, def, name, description); RNA_def_property_duplicate_pointers(prop); Py_RETURN_NONE; } else { /* operators defer running this function */ - return bpy_prop_deferred_return((void *)BPy_FloatProperty, kw); + return bpy_prop_deferred_return((void *)BPy_BoolProperty, kw); } } @@ -2739,15 +2781,15 @@ PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw) } } -PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw) +PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw) { - static char *kwlist[] = {"attr", "name", "description", "default", NULL}; + static char *kwlist[] = {"attr", "name", "description", "min", "max", "soft_min", "soft_max", "default", NULL}; char *id, *name="", *description=""; - int def=0; + float min=FLT_MIN, max=FLT_MAX, soft_min=FLT_MIN, soft_max=FLT_MAX, def=0.0f; PropertyRNA *prop; StructRNA *srna; - if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssi:BoolProperty", kwlist, &id, &name, &description, &def)) + if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ssfffff:FloatProperty", kwlist, &id, &name, &description, &min, &max, &soft_min, &soft_max, &def)) return NULL; if (PyTuple_Size(args) > 0) { @@ -2760,12 +2802,12 @@ PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw) return NULL; /* self's type was compatible but error getting the srna */ } else if(srna) { - prop= RNA_def_boolean(srna, id, def, name, description); + prop= RNA_def_float(srna, id, def, min, max, name, description, soft_min, soft_max); RNA_def_property_duplicate_pointers(prop); Py_RETURN_NONE; } else { /* operators defer running this function */ - return bpy_prop_deferred_return((void *)BPy_BoolProperty, kw); + return bpy_prop_deferred_return((void *)BPy_FloatProperty, kw); } } @@ -2799,6 +2841,178 @@ PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw) } } +static EnumPropertyItem *enum_items_from_py(PyObject *value, const char *def, int *defvalue) +{ + EnumPropertyItem *items= NULL; + PyObject *item; + int seq_len, i, totitem= 0; + + if(!PySequence_Check(value)) { + PyErr_SetString(PyExc_TypeError, "expected a sequence of tuples for the enum items"); + return NULL; + } + + seq_len = PySequence_Length(value); + for(i=0; i 0) { + PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. + return NULL; + } + + srna= srna_from_self(self); + if(srna==NULL && PyErr_Occurred()) { + return NULL; /* self's type was compatible but error getting the srna */ + } + else if(srna) { + eitems= enum_items_from_py(items, def, &defvalue); + if(!eitems) + return NULL; + + prop= RNA_def_enum(srna, id, eitems, defvalue, name, description); + RNA_def_property_duplicate_pointers(prop); + MEM_freeN(eitems); + + Py_RETURN_NONE; + } + else { /* operators defer running this function */ + return bpy_prop_deferred_return((void *)BPy_EnumProperty, kw); + } +} + +static StructRNA *pointer_type_from_py(PyObject *value) +{ + StructRNA *srna; + + srna= srna_from_self(value); + if(!srna) { + PyErr_SetString(PyExc_SystemError, "expected an RNA type derived from IDPropertyGroup (1)"); + return NULL; + } + + if(!RNA_struct_is_a(srna, &RNA_IDPropertyGroup)) { + PyErr_SetString(PyExc_SystemError, "expected an RNA type derived from IDPropertyGroup (3)"); + return NULL; + } + + return srna; +} + +PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw) +{ + static char *kwlist[] = {"attr", "type", "name", "description", NULL}; + char *id, *name="", *description=""; + PropertyRNA *prop; + StructRNA *srna, *ptype; + PyObject *type= Py_None; + + if (!PyArg_ParseTupleAndKeywords(args, kw, "sO|ss:PointerProperty", kwlist, &id, &type, &name, &description)) + return NULL; + + if (PyTuple_Size(args) > 0) { + PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. + return NULL; + } + + srna= srna_from_self(self); + if(srna==NULL && PyErr_Occurred()) { + return NULL; /* self's type was compatible but error getting the srna */ + } + else if(srna) { + ptype= pointer_type_from_py(type); + if(!ptype) + return NULL; + + prop= RNA_def_pointer_runtime(srna, id, ptype, name, description); + RNA_def_property_duplicate_pointers(prop); + Py_RETURN_NONE; + } + else { /* operators defer running this function */ + return bpy_prop_deferred_return((void *)BPy_PointerProperty, kw); + } + return NULL; +} + +PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw) +{ + static char *kwlist[] = {"attr", "type", "name", "description", NULL}; + char *id, *name="", *description=""; + PropertyRNA *prop; + StructRNA *srna, *ptype; + PyObject *type= Py_None; + + if (!PyArg_ParseTupleAndKeywords(args, kw, "sO|ss:CollectionProperty", kwlist, &id, &type, &name, &description)) + return NULL; + + if (PyTuple_Size(args) > 0) { + PyErr_SetString(PyExc_ValueError, "all args must be keywors"); // TODO - py3 can enforce this. + return NULL; + } + + srna= srna_from_self(self); + if(srna==NULL && PyErr_Occurred()) { + return NULL; /* self's type was compatible but error getting the srna */ + } + else if(srna) { + ptype= pointer_type_from_py(type); + if(!ptype) + return NULL; + + prop= RNA_def_collection_runtime(srna, id, ptype, name, description); + RNA_def_property_duplicate_pointers(prop); + Py_RETURN_NONE; + } + else { /* operators defer running this function */ + return bpy_prop_deferred_return((void *)BPy_CollectionProperty, kw); + } + return NULL; +} + /*-------------------- Type Registration ------------------------*/ static int rna_function_arg_count(FunctionRNA *func) @@ -3113,6 +3327,8 @@ PyObject *pyrna_basetype_register(PyObject *self, PyObject *py_class) StructRegisterFunc reg; StructRNA *srna; StructRNA *srna_new; + PyObject *item; + const char *identifier= ""; srna= pyrna_struct_as_srna(py_class); if(srna==NULL) @@ -3129,9 +3345,17 @@ PyObject *pyrna_basetype_register(PyObject *self, PyObject *py_class) /* get the context, so register callback can do necessary refreshes */ C= BPy_GetContext(); - /* call the register callback */ + /* call the register callback with reports & identifier */ BKE_reports_init(&reports, RPT_STORE); - srna_new= reg(C, &reports, py_class, bpy_class_validate, bpy_class_call, bpy_class_free); + + item= PyObject_GetAttrString(py_class, "__name__"); + + if(item) { + identifier= _PyUnicode_AsString(item); + Py_DECREF(item); /* no need to keep a ref, the class owns it */ + } + + srna_new= reg(C, &reports, py_class, identifier, bpy_class_validate, bpy_class_call, bpy_class_free); if(!srna_new) { BPy_reports_to_error(&reports); diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h index 717ea75a7a8..1b8d69bc511 100644 --- a/source/blender/python/intern/bpy_rna.h +++ b/source/blender/python/intern/bpy_rna.h @@ -75,10 +75,13 @@ int pyrna_pydict_to_props(PointerRNA *ptr, PyObject *kw, int all_args, const cha PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop); /* functions for setting up new props - experemental */ -PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw); -PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw); PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw); +PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw); +PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw); PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw); +PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw); +PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw); +PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw); /* function for registering types */ PyObject *pyrna_basetype_register(PyObject *self, PyObject *args); From ca20107edb7e80a9a87f1e7a3a38ae2ed63a3d4b Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Tue, 18 Aug 2009 01:39:49 +0000 Subject: [PATCH 110/577] 2.5/Sculpt: * Added UI for rake mode --- release/ui/space_view3d_toolbar.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py index be378cc46fe..1b4c1e25c34 100644 --- a/release/ui/space_view3d_toolbar.py +++ b/release/ui/space_view3d_toolbar.py @@ -352,6 +352,8 @@ class VIEW3D_PT_tools_brush(PaintPanel): col.itemR(brush, "persistent") col.itemO("sculpt.set_persistent_base") + col.itemR(brush, "rake") + col.itemR(brush, "sculpt_tool") # Texture Paint Mode # From 0dad5cfbcafeaa45b59b581dc217fe2ebd297f2d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 18 Aug 2009 03:24:46 +0000 Subject: [PATCH 111/577] CMake/Warnings * WITH_GAMEENGINE and WITH_BULLET were being added to the compiler flags, only define in areas that use them. * removed C++ unix warnings by adding -Wno-invalid-offsetof -Wno-sign-compare. the py api uses invalid offsets for attributes. * removed C unix -Wnested-externs warning, these are everywhere in blender. * removed unused BGE python headers * undefine _XOPEN_SOURCE and _POSIX_C_SOURCE in the BGE, python redefines. * renamed USE_BULLET in collision.c to WITH_BULLET for consistency --- CMakeLists.txt | 10 ++---- source/blender/blenkernel/CMakeLists.txt | 10 ++++-- source/blender/blenkernel/intern/collision.c | 4 +-- source/blender/editors/CMakeLists.txt | 4 +++ source/blender/makesrna/intern/CMakeLists.txt | 4 +++ source/gameengine/Expressions/KX_Python.h | 11 ++++++ .../Expressions/KX_Python_dynamic.h | 36 ------------------- .../gameengine/Expressions/KX_Python_static.h | 36 ------------------- 8 files changed, 31 insertions(+), 84 deletions(-) delete mode 100644 source/gameengine/Expressions/KX_Python_dynamic.h delete mode 100644 source/gameengine/Expressions/KX_Python_static.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e72227982d..16110e76607 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -204,6 +204,7 @@ IF(UNIX AND NOT APPLE) # Better warnings SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wnested-externs -Wdeclaration-after-statement") + SET(CXX_WARNINGS "-Wall -Wno-invalid-offsetof -Wno-sign-compare") INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ) ENDIF(UNIX AND NOT APPLE) @@ -510,14 +511,8 @@ INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) #----------------------------------------------------------------------------- # Extra compile flags -IF(WITH_GAMEENGINE) - SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DGAMEBLENDER ") -ENDIF(WITH_GAMEENGINE) -IF(WITH_BULLET) - SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DWITH_BULLET ") -ENDIF(WITH_BULLET) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ${C_WARNINGS}") -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ") +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ${CXX_WARNINGS}") #----------------------------------------------------------------------------- # Libraries @@ -537,3 +532,4 @@ ADD_SUBDIRECTORY(source/creator) IF(WITH_PLAYER) ADD_SUBDIRECTORY(blenderplayer) ENDIF(WITH_PLAYER) + diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index c1dfc2cf639..08d0d40f5be 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -30,14 +30,18 @@ SET(INC . ../../../intern/guardedalloc ../../../intern/memutil ../editors/include ../blenlib ../makesdna ../render/extern/include ../../../intern/decimation/extern ../imbuf ../avi ../../../intern/elbeem/extern ../../../intern/opennl/extern - ../../../intern/iksolver/extern ../blenloader ../quicktime - ../../../extern/bullet2/src + ../../../intern/iksolver/extern ../blenloader ../nodes ../../../extern/glew/include ../gpu ../makesrna ../../../intern/smoke/extern ../../../intern/bsp/extern ../../../intern/audaspace/intern ${ZLIB_INC} ) +IF(WITH_BULLET) + SET(INC ${INC} ../../../extern/bullet2/src) + ADD_DEFINITIONS(-DWITH_BULLET) +ENDIF(WITH_BULLET) + IF(WITH_OPENEXR) ADD_DEFINITIONS(-DWITH_OPENEXR) ENDIF(WITH_OPENEXR) @@ -51,7 +55,7 @@ IF(WITH_DDS) ENDIF(WITH_DDS) IF(WITH_QUICKTIME) - SET(INC ${INC} ${QUICKTIME_INC}) + SET(INC ${INC} ../quicktime ${QUICKTIME_INC}) ADD_DEFINITIONS(-DWITH_QUICKTIME) ENDIF(WITH_QUICKTIME) diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index c122145c98f..37e9c93a108 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -591,7 +591,7 @@ CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2, BVHTreeOverlap ClothModifierData *clmd = ( ClothModifierData * ) md1; CollisionModifierData *collmd = ( CollisionModifierData * ) md2; MFace *face1=NULL, *face2 = NULL; -#ifdef WITH_BULLET +#ifdef USE_BULLET ClothVertex *verts1 = clmd->clothObject->verts; #endif double distance = 0; @@ -669,7 +669,7 @@ CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2, BVHTreeOverlap break; } -#ifdef WITH_BULLET +#ifdef USE_BULLET // calc distance + normal distance = plNearestPoints ( verts1[collpair->ap1].txold, verts1[collpair->ap2].txold, verts1[collpair->ap3].txold, collmd->current_x[collpair->bp1].co, collmd->current_x[collpair->bp2].co, collmd->current_x[collpair->bp3].co, collpair->pa,collpair->pb,collpair->vector ); diff --git a/source/blender/editors/CMakeLists.txt b/source/blender/editors/CMakeLists.txt index fc28e21ab8f..96b6fa5b7ab 100644 --- a/source/blender/editors/CMakeLists.txt +++ b/source/blender/editors/CMakeLists.txt @@ -42,6 +42,10 @@ SET(INC ../windowmanager ../blenfont ) +IF(WITH_GAMEENGINE) + ADD_DEFINITIONS(-DGAMEBLENDER) +ENDIF(WITH_GAMEENGINE) + IF(WITH_INTERNATIONAL) ADD_DEFINITIONS(-DINTERNATIONAL) ENDIF(WITH_INTERNATIONAL) diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 343df04d4ff..152f4031b91 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -42,6 +42,10 @@ SET(SRC INCLUDE_DIRECTORIES(../../../../intern/guardedalloc .. ../../makesdna ../../blenkernel ../../blenlib ../../windowmanager ../../editors/include ../../imbuf ../../render/extern/include .) FILE(GLOB INC_FILES ../*.h ../../makesdna/*.h) +IF(WITH_GAMEENGINE) + ADD_DEFINITIONS(-DGAMEBLENDER) +ENDIF(WITH_GAMEENGINE) + IF(WITH_OPENEXR) ADD_DEFINITIONS(-DWITH_OPENEXR) ENDIF(WITH_OPENEXR) diff --git a/source/gameengine/Expressions/KX_Python.h b/source/gameengine/Expressions/KX_Python.h index 61f7ef05042..f41accec730 100644 --- a/source/gameengine/Expressions/KX_Python.h +++ b/source/gameengine/Expressions/KX_Python.h @@ -30,6 +30,17 @@ #define KX_PYTHON_H //#define USE_DL_EXPORT + +/* python redefines, quiet the compiler */ +#ifdef _XOPEN_SOURCE +#undef _XOPEN_SOURCE +#endif + +#ifdef _POSIX_C_SOURCE +#undef _POSIX_C_SOURCE +#endif + + #include "Python.h" #define USE_MATHUTILS // Blender 2.5x api will use mathutils, for a while we might want to test without it diff --git a/source/gameengine/Expressions/KX_Python_dynamic.h b/source/gameengine/Expressions/KX_Python_dynamic.h deleted file mode 100644 index eb435bdf1c3..00000000000 --- a/source/gameengine/Expressions/KX_Python_dynamic.h +++ /dev/null @@ -1,36 +0,0 @@ -/** - * $Id$ - * - * ***** 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 ***** - */ -#ifndef KX_PYTHON_H -#define KX_PYTHON_H - -//#define USE_DL_EXPORT -#include "Python.h" - -#endif // KX_PYTHON_H - diff --git a/source/gameengine/Expressions/KX_Python_static.h b/source/gameengine/Expressions/KX_Python_static.h deleted file mode 100644 index f4f31f9b058..00000000000 --- a/source/gameengine/Expressions/KX_Python_static.h +++ /dev/null @@ -1,36 +0,0 @@ -/** - * $Id$ - * - * ***** 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 ***** - */ -#ifndef KX_PYTHON_H -#define KX_PYTHON_H - -#define USE_DL_EXPORT -#include "Python.h" - -#endif // KX_PYTHON_H - From 798bed8424c64db8d6ac8e613a37b73eee303ec1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 18 Aug 2009 04:15:28 +0000 Subject: [PATCH 112/577] forgot to updated scons and make for the bullet defines --- source/blender/blenkernel/SConscript | 2 +- source/nan_compile.mk | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript index 6772cccbda6..261d5ee1471 100644 --- a/source/blender/blenkernel/SConscript +++ b/source/blender/blenkernel/SConscript @@ -52,7 +52,7 @@ if env['WITH_BF_QUICKTIME']: incs += ' ' + env['BF_QUICKTIME_INC'] if env['WITH_BF_BULLET']: - defs.append('WITH_BULLET') + defs.append('USE_BULLET') if env['BF_NO_ELBEEM']: defs.append('DISABLE_ELBEEM') diff --git a/source/nan_compile.mk b/source/nan_compile.mk index 4a4e472fa66..c62b4f2681b 100644 --- a/source/nan_compile.mk +++ b/source/nan_compile.mk @@ -40,8 +40,8 @@ CPPFLAGS ?= $(NAN_CPPFLAGS) ifneq ($(NAN_NO_KETSJI), true) CFLAGS += -DGAMEBLENDER=1 ifeq ($(NAN_USE_BULLET), true) - CFLAGS += -DUSE_BULLET -DWITH_BULLET - CCFLAGS += -DUSE_BULLET -DWITH_BULLET + CFLAGS += -DUSE_BULLET + CCFLAGS += -DUSE_BULLET endif else CPPFLAGS += -DNO_KETSJI From 61ffa9f1319133e5017b668af60644bd6c4eddc6 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 18 Aug 2009 04:15:47 +0000 Subject: [PATCH 113/577] 2.5 - Newly created KeyingSets are now automatically named properly. --- source/blender/blenkernel/intern/anim_sys.c | 4 ++-- source/blender/editors/space_outliner/outliner.c | 2 +- source/blender/editors/space_outliner/outliner_header.c | 4 +++- source/blender/makesrna/intern/rna_scene.c | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 204935cc38d..5eaf2133515 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -276,7 +276,7 @@ KeyingSet *BKE_keyingset_add (ListBase *list, const char name[], short flag, sho if (name) BLI_snprintf(ks->name, 64, name); else - strcpy(ks->name, "Keying Set"); + strcpy(ks->name, "KeyingSet"); ks->flag= flag; ks->keyingflag= keyingflag; @@ -285,7 +285,7 @@ KeyingSet *BKE_keyingset_add (ListBase *list, const char name[], short flag, sho BLI_addtail(list, ks); /* make sure KeyingSet has a unique name (this helps with identification) */ - BLI_uniquename(list, ks, "Keying Set", ' ', offsetof(KeyingSet, name), 64); + BLI_uniquename(list, ks, "KeyingSet", '.', offsetof(KeyingSet, name), 64); /* return new KeyingSet for further editing */ return ks; diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index fffec61ec60..762ad82344b 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -3901,7 +3901,7 @@ static KeyingSet *verify_active_keyingset(Scene *scene, short add) /* add if none found */ // XXX the default settings have yet to evolve if ((add) && (ks==NULL)) { - ks= BKE_keyingset_add(&scene->keyingsets, "Keying Set", KEYINGSET_ABSOLUTE, 0); + ks= BKE_keyingset_add(&scene->keyingsets, NULL, KEYINGSET_ABSOLUTE, 0); scene->active_keyingset= BLI_countlist(&scene->keyingsets); } diff --git a/source/blender/editors/space_outliner/outliner_header.c b/source/blender/editors/space_outliner/outliner_header.c index 0c7859ed4e2..d4eeaabd1d3 100644 --- a/source/blender/editors/space_outliner/outliner_header.c +++ b/source/blender/editors/space_outliner/outliner_header.c @@ -177,7 +177,7 @@ static void do_outliner_buttons(bContext *C, void *arg, int event) /* add a new KeyingSet if active is -1 */ if (scene->active_keyingset == -1) { // XXX the default settings have yet to evolve... need to keep this in sync with the - BKE_keyingset_add(&scene->keyingsets, "KeyingSet", KEYINGSET_ABSOLUTE, 0); + BKE_keyingset_add(&scene->keyingsets, NULL, KEYINGSET_ABSOLUTE, 0); scene->active_keyingset= BLI_countlist(&scene->keyingsets); } @@ -196,6 +196,8 @@ static void do_outliner_buttons(bContext *C, void *arg, int event) BLI_freelinkN(&scene->keyingsets, ks); scene->active_keyingset= 0; } + else + scene->active_keyingset= 0; } /* redraw regions with KeyingSet info */ diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 440f12be2ce..bb6611205b6 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1845,6 +1845,7 @@ void RNA_def_scene(BlenderRNA *brna) prop= RNA_def_property(srna, "active_keying_set", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "KeyingSet"); + RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_editable_func(prop, "rna_Scene_active_keying_set_editable"); RNA_def_property_pointer_funcs(prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL); RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes."); From 88f114af560d25dcc733695ff3c412144f3023cb Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 18 Aug 2009 11:25:50 +0000 Subject: [PATCH 114/577] Bugfix: Crash in demo file from ZanQdo (reported by jaguarandi). Was caused by old animation-system code that was no longer working. I've commented out this code for now until we need something like this again. --- source/blender/editors/animation/anim_deps.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c index 13667159fe0..af2355b91a5 100644 --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@ -138,6 +138,7 @@ void ANIM_action_to_pose_sync (Object *ob) */ void ANIM_pose_to_action_sync (Object *ob, ScrArea *sa) { +#if 0 // XXX old animation system SpaceAction *saction= (SpaceAction *)sa->spacedata.first; bArmature *arm= (bArmature *)ob->data; bAction *act= (bAction *)ob->action; @@ -174,4 +175,5 @@ void ANIM_pose_to_action_sync (Object *ob, ScrArea *sa) // XXX step 2 needs to be coded still... currently missing action/bone group API to do any more work here... // XXX step 3 needs to be coded still... it's a messy case to deal with (we'll use the temp indices for this?) +#endif // XXX old animation system } From a238034c61a47d1bc31098a48ee004bc1740ca8e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 18 Aug 2009 11:28:57 +0000 Subject: [PATCH 115/577] missed this define when renaming bullet defines --- source/blender/blenkernel/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index 08d0d40f5be..516845b5b76 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -39,7 +39,7 @@ SET(INC IF(WITH_BULLET) SET(INC ${INC} ../../../extern/bullet2/src) - ADD_DEFINITIONS(-DWITH_BULLET) + ADD_DEFINITIONS(-DUSE_BULLET) ENDIF(WITH_BULLET) IF(WITH_OPENEXR) From 34b947d0bc0ef196f11b3ac4370d991b2faa2020 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 18 Aug 2009 11:48:34 +0000 Subject: [PATCH 116/577] 2.5 - Fixing some drawing problems I noticed in ZanQdo's file... Alpha for icons wasn't getting set correctly in animation editors anymore. This commit should fix the issues there, though the scrollbars still have a few minor issues still too. Also, NLA strips with repeats now have the repeat indicators drawn only 80% or so of the height, making it easier to distinguish between strips with repeats and bunches of strips. --- source/blender/editors/animation/anim_channels_defines.c | 4 ++++ source/blender/editors/space_graph/graph_draw.c | 6 ++++++ source/blender/editors/space_nla/nla_draw.c | 8 +++++++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 25e3c112389..acf7467713b 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -1902,6 +1902,10 @@ void ANIM_channel_draw (bAnimContext *ac, bAnimListElem *ale, float yminc, float selected= ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_SELECT); else selected= 0; + + /* set blending again, as may not be set in previous step */ + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); /* step 1) draw backdrop ........................................... */ if (acf->draw_backdrop) diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index c2d8d7b1345..f3aa0fac42b 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -926,6 +926,10 @@ void graph_draw_channel_names(bContext *C, bAnimContext *ac, SpaceIpo *sipo, ARe y= (float)ACHANNEL_FIRST; + /* set blending again, as may not be set in previous step */ + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + for (ale= anim_data.first, i=0; ale; ale= ale->next, i++) { const float yminc= (float)(y - ACHANNEL_HEIGHT_HALF); const float ymaxc= (float)(y + ACHANNEL_HEIGHT_HALF); @@ -944,6 +948,8 @@ void graph_draw_channel_names(bContext *C, bAnimContext *ac, SpaceIpo *sipo, ARe uiEndBlock(C, block); uiDrawBlock(C, block); + + glDisable(GL_BLEND); } /* free tempolary channels */ diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 3a0e150050b..f30954292b4 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -411,7 +411,7 @@ static void nla_draw_strip (SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStr /* don't draw if line would end up on or after the end of the strip */ if (repeatPos < strip->end) - fdrawline(repeatPos, yminc, repeatPos, ymaxc); + fdrawline(repeatPos, yminc+4, repeatPos, ymaxc-4); } } /* or if meta-strip, draw lines delimiting extents of sub-strips (in same color as outline, if more than 1 exists) */ @@ -875,6 +875,10 @@ void draw_nla_channel_list (bContext *C, bAnimContext *ac, SpaceNla *snla, ARegi y= (float)(-NLACHANNEL_HEIGHT); + /* set blending again, as may not be set in previous step */ + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + /* loop through channels, and set up drawing depending on their type */ for (ale= anim_data.first; ale; ale= ale->next) { const float yminc= (float)(y - NLACHANNEL_HEIGHT_HALF); @@ -894,6 +898,8 @@ void draw_nla_channel_list (bContext *C, bAnimContext *ac, SpaceNla *snla, ARegi uiEndBlock(C, block); uiDrawBlock(C, block); + + glDisable(GL_BLEND); } /* free tempolary channels */ From 6e10e93965291f011f48a0fb2cf0b3c149a8a1e6 Mon Sep 17 00:00:00 2001 From: William Reynish Date: Tue, 18 Aug 2009 12:10:12 +0000 Subject: [PATCH 117/577] Renamed Buttons Window to Properties, for these reasons: 1) This fits with our splitting the old Buttons Window into Tools and Properties 2) The name Buttons Window doesn't communicate what it is for, only that it includes buttons. Of course, most other editors include a fair amount of 'buttons' too. 3) A 'button' is not usually what you'd associate with a slider, number field, checkbox or menu. Really there are hardly any true buttons in this window space. Also added some notifiers to sequencer RNA, though there seems to be some refresh errors in the image preview area. --- source/blender/editors/screen/area.c | 51 ++++++++++--------- source/blender/makesrna/intern/rna_sequence.c | 33 ++++++++++-- source/blender/makesrna/intern/rna_space.c | 4 +- source/blender/makesrna/intern/rna_userdef.c | 6 +-- 4 files changed, 61 insertions(+), 33 deletions(-) diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 296c38fa51a..ff84542a7cd 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1041,39 +1041,42 @@ void ED_area_prevspace(bContext *C) static char *windowtype_pup(void) { return( - "Window type:%t" //14 - "|3D View %x1" //30 + "Window type:%t" + "|3D View %x1" + + "|%l" + "|%l" - "|%l" // 33 + "|Timeline %x15" + "|Graph Editor %x2" + "|DopeSheet %x12" + "|NLA Editor %x13" - "|Graph Editor %x2" //54 - "|DopeSheet %x12" //73 - "|NLA Editor %x13" //94 + "|%l" + "|%l" - "|%l" //97 + "|UV/Image Editor %x6" - "|UV/Image Editor %x6" //117 - - "|Video Sequence Editor %x8" //143 - "|Timeline %x15" //163 - // "|Audio Window %x11" //163 - "|Text Editor %x9" //179 - - "|%l" //192 - - - "|User Preferences %x7" //213 - "|Outliner %x3" //232 - "|Buttons Window %x4" //251 + "|Video Sequence Editor %x8" + "|Text Editor %x9" "|Node Editor %x16" "|Logic Editor %x17" - "|%l" //254 - "|File Browser %x5" //290 + "|%l" + "|%l" - "|%l" //293 + "|Properties %x4" + "|User Preferences %x7" + "|Outliner %x3" + + "|%l" + "|%l" + + "|File Browser %x5" + + "|%l" + "|%l" - // "|Scripts Window %x14"//313 "|Console %x18" ); } diff --git a/source/blender/makesrna/intern/rna_sequence.c b/source/blender/makesrna/intern/rna_sequence.c index 71f5b480061..470909f4eff 100644 --- a/source/blender/makesrna/intern/rna_sequence.c +++ b/source/blender/makesrna/intern/rna_sequence.c @@ -443,7 +443,8 @@ static void rna_def_sequence(BlenderRNA *brna) RNA_def_property_range(prop, 1, MAXFRAME); RNA_def_property_ui_text(prop, "Length", "The length of the contents of this strip before the handles are applied"); RNA_def_property_int_funcs(prop, "rna_SequenceEditor_length_get", "rna_SequenceEditor_length_set",NULL); - + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); + prop= RNA_def_property(srna, "start_frame", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "start"); RNA_def_property_ui_text(prop, "Start Frame", ""); @@ -638,11 +639,13 @@ static void rna_def_input(StructRNA *srna) RNA_def_property_int_sdna(prop, NULL, "anim_startofs"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap test RNA_def_property_ui_text(prop, "Animation Start Offset", "Animation start offset (trim start)."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "animation_end_offset", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "anim_endofs"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap test RNA_def_property_ui_text(prop, "Animation End Offset", "Animation end offset (trim end)."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); } static void rna_def_image(BlenderRNA *brna) @@ -813,21 +816,25 @@ static void rna_def_wipe(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "edgeWidth"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Blur Width", "Width of the blur edge, in percentage relative to the image size."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "angle"); RNA_def_property_range(prop, -90.0f, 90.0f); RNA_def_property_ui_text(prop, "Angle", "Edge angle."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "forward"); RNA_def_property_enum_items(prop, wipe_direction_items); RNA_def_property_ui_text(prop, "Direction", "Wipe direction."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "transition_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "wipetype"); RNA_def_property_enum_items(prop, wipe_type_items); RNA_def_property_ui_text(prop, "Transition Type", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); } static void rna_def_glow(BlenderRNA *brna) @@ -843,30 +850,36 @@ static void rna_def_glow(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "fMini"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Threshold", "Minimum intensity to trigger a glow"); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "clamp", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fClamp"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Clamp", "rightness limit of intensity."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "boost_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fBoost"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Boost Factor", "Brightness multiplier."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "blur_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dDist"); RNA_def_property_range(prop, 0.5f, 20.0f); RNA_def_property_ui_text(prop, "Blur Distance", "Radius of glow effect."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "quality", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "dQuality"); RNA_def_property_range(prop, 1, 5); RNA_def_property_ui_text(prop, "Quality", "Accuracy of the blur effect."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "only_boost", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "bNoComp", 0); RNA_def_property_ui_text(prop, "Only Boost", "Show the glow buffer only."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); } static void rna_def_transform(BlenderRNA *brna) @@ -895,60 +908,72 @@ static void rna_def_transform(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "ScalexIni"); RNA_def_property_ui_text(prop, "Scale Start X", ""); RNA_def_property_ui_range(prop, 0, 10, 3, 10); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "scale_start_y", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "ScaleyIni"); RNA_def_property_ui_text(prop, "Scale Start Y", ""); RNA_def_property_ui_range(prop, 0, 10, 3, 10); - + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); + prop= RNA_def_property(srna, "scale_end_x", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "ScalexFin"); RNA_def_property_ui_text(prop, "Scale End X", ""); RNA_def_property_ui_range(prop, 0, 10, 3, 10); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "scale_end_y", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "ScaleyFin"); RNA_def_property_ui_text(prop, "Scale End Y", ""); RNA_def_property_ui_range(prop, 0, 10, 3, 10); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "translate_start_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "xIni"); RNA_def_property_ui_text(prop, "Translate Start X", ""); RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10); - + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); + prop= RNA_def_property(srna, "translate_start_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "yIni"); RNA_def_property_ui_text(prop, "Translate Start Y", ""); RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10); - + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); + prop= RNA_def_property(srna, "translate_end_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "xFin"); RNA_def_property_ui_text(prop, "Translate End X", ""); RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "translate_end_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "yFin"); RNA_def_property_ui_text(prop, "Translate End Y", ""); RNA_def_property_ui_range(prop, -500.0f, 500.0f, 3, 10); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "rotation_start", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rotIni"); RNA_def_property_range(prop, 0.0f, 360.0f); RNA_def_property_ui_text(prop, "Rotation Start", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "rotation_end", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rotFin"); RNA_def_property_range(prop, 0.0f, 360.0f); RNA_def_property_ui_text(prop, "Rotation End", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "translation_unit", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "percent"); RNA_def_property_enum_items(prop, translation_unit_items); RNA_def_property_ui_text(prop, "Translation Unit", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, interpolation_items); RNA_def_property_ui_text(prop, "Interpolation", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); } static void rna_def_solid_color(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 41361dd69a4..991b50afa5a 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -46,7 +46,7 @@ EnumPropertyItem space_type_items[] = { {SPACE_VIEW3D, "VIEW_3D", 0, "3D View", ""}, {SPACE_IPO, "GRAPH_EDITOR", 0, "Graph Editor", ""}, {SPACE_OUTLINER, "OUTLINER", 0, "Outliner", ""}, - {SPACE_BUTS, "BUTTONS_WINDOW", 0, "Buttons Window", ""}, + {SPACE_BUTS, "PROPERTIES", 0, "Properties", ""}, {SPACE_FILE, "FILE_BROWSER", 0, "File Browser", ""}, {SPACE_IMAGE, "IMAGE_EDITOR", 0, "Image Editor", ""}, {SPACE_INFO, "USER_PREFERENCES", 0, "User Preferences", ""}, @@ -1142,7 +1142,7 @@ static void rna_def_space_time(BlenderRNA *brna) prop= RNA_def_property(srna, "play_buttons", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_BUTS_WIN); - RNA_def_property_ui_text(prop, "Buttons Windows", ""); + RNA_def_property_ui_text(prop, "Properties Windows", ""); RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update"); prop= RNA_def_property(srna, "play_image", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 59333f1191d..836e6a2fda7 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -999,7 +999,7 @@ static void rna_def_userdef_theme_space_buts(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeButtonsWindow", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); - RNA_def_struct_ui_text(srna, "Theme Buttons Window", "Theme settings for the Buttons Window."); + RNA_def_struct_ui_text(srna, "Theme Properties", "Theme settings for the Properties."); rna_def_userdef_theme_spaces_main(srna, SPACE_BUTS); @@ -1400,10 +1400,10 @@ static void rna_def_userdef_themes(BlenderRNA *brna) RNA_def_property_struct_type(prop, "ThemeSequenceEditor"); RNA_def_property_ui_text(prop, "Sequence Editor", ""); - prop= RNA_def_property(srna, "buttons_window", PROP_POINTER, PROP_NEVER_NULL); + prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "tbuts"); RNA_def_property_struct_type(prop, "ThemeButtonsWindow"); - RNA_def_property_ui_text(prop, "Buttons Window", ""); + RNA_def_property_ui_text(prop, "Properties", ""); prop= RNA_def_property(srna, "text_editor", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "text"); From ac2451c6be437fba14f9c0ceeeaeab382fd9ad58 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 18 Aug 2009 12:56:43 +0000 Subject: [PATCH 118/577] 2.5: RNA. Default values were not set when calling functions, this is fixed now. Also added option for spaces without menus in the header in uiTemplateHeader. --- source/blender/editors/include/UI_interface.h | 2 +- .../editors/interface/interface_templates.c | 5 ++- source/blender/makesrna/intern/rna_access.c | 42 ++++++++++++++++++- source/blender/makesrna/intern/rna_ui_api.c | 3 +- 4 files changed, 47 insertions(+), 5 deletions(-) diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index cc3b243d38d..8da2702b603 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -625,7 +625,7 @@ uiLayout *uiLayoutSplit(uiLayout *layout, float percentage); uiBlock *uiLayoutFreeBlock(uiLayout *layout); /* templates */ -void uiTemplateHeader(uiLayout *layout, struct bContext *C); +void uiTemplateHeader(uiLayout *layout, struct bContext *C, int menus); void uiTemplateID(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, char *newop, char *unlinkop); uiLayout *uiTemplateModifier(uiLayout *layout, struct PointerRNA *ptr); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 1a5c1178983..0ee21cbcf77 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -56,12 +56,13 @@ void ui_template_fix_linking() /********************** Header Template *************************/ -void uiTemplateHeader(uiLayout *layout, bContext *C) +void uiTemplateHeader(uiLayout *layout, bContext *C, int menus) { uiBlock *block; block= uiLayoutFreeBlock(layout); - ED_area_header_standardbuttons(C, block, 0); + if(menus) ED_area_header_standardbuttons(C, block, 0); + else ED_area_header_switchbutton(C, block, 0); } /********************** Search Callbacks *************************/ diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 54cde57a54f..c2f1f31a4bc 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -2844,8 +2844,10 @@ const struct ListBase *RNA_function_defined_parameters(FunctionRNA *func) ParameterList *RNA_parameter_list_create(ParameterList *parms, PointerRNA *ptr, FunctionRNA *func) { PropertyRNA *parm; - int tot= 0; + void *data; + int tot= 0, size; + /* allocate data */ for(parm= func->cont.properties.first; parm; parm= parm->next) tot+= rna_parameter_size(parm); @@ -2853,6 +2855,44 @@ ParameterList *RNA_parameter_list_create(ParameterList *parms, PointerRNA *ptr, parms->func= func; parms->tot= tot; + /* set default values */ + data= parms->data; + + for(parm= func->cont.properties.first; parm; parm= parm->next) { + size= rna_parameter_size(parm); + + if(!(parm->flag & PROP_REQUIRED)) { + switch(parm->type) { + case PROP_BOOLEAN: + if(parm->arraylength) memcpy(data, &((BooleanPropertyRNA*)parm)->defaultarray, size); + else memcpy(data, &((BooleanPropertyRNA*)parm)->defaultvalue, size); + break; + case PROP_INT: + if(parm->arraylength) memcpy(data, &((IntPropertyRNA*)parm)->defaultarray, size); + else memcpy(data, &((IntPropertyRNA*)parm)->defaultvalue, size); + break; + case PROP_FLOAT: + if(parm->arraylength) memcpy(data, &((FloatPropertyRNA*)parm)->defaultarray, size); + else memcpy(data, &((FloatPropertyRNA*)parm)->defaultvalue, size); + break; + case PROP_ENUM: + memcpy(data, &((EnumPropertyRNA*)parm)->defaultvalue, size); + break; + case PROP_STRING: { + const char *defvalue= ((StringPropertyRNA*)parm)->defaultvalue; + if(defvalue && defvalue[0]) + memcpy(data, &defvalue, size); + break; + } + case PROP_POINTER: + case PROP_COLLECTION: + break; + } + } + + data= ((char*)data) + size; + } + return parms; } diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 40d300315f5..f9287bddc10 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -119,7 +119,7 @@ void RNA_api_ui_layout(StructRNA *srna) func= RNA_def_function(srna, "split", "uiLayoutSplit"); parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); RNA_def_function_return(func, parm); - RNA_def_float(func, "percentage", 0.5f, 0.0f, 1.0f, "Percentage", "Percentage of width to split at.", 0.0f, 1.0f); + RNA_def_float(func, "percentage", 0.0f, 0.0f, 1.0f, "Percentage", "Percentage of width to split at.", 0.0f, 1.0f); /* items */ func= RNA_def_function(srna, "itemR", "uiItemR"); @@ -220,6 +220,7 @@ void RNA_api_ui_layout(StructRNA *srna) /* templates */ func= RNA_def_function(srna, "template_header", "uiTemplateHeader"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); + RNA_def_boolean(func, "menus", 1, "", "The header has menus, and should show menu expander."); func= RNA_def_function(srna, "template_ID", "uiTemplateID"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); From 990dcd0f7f362828eddeaca191640c1680808a6c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 18 Aug 2009 12:58:51 +0000 Subject: [PATCH 119/577] 2.5: * Split Info and User preferences into two separate spaces. * Renamed Buttons Window to Properties also in RNA identifiers. --- release/io/engine_render_pov.py | 2 +- release/ui/buttons_data_armature.py | 2 +- release/ui/buttons_data_bone.py | 2 +- release/ui/buttons_data_camera.py | 2 +- release/ui/buttons_data_curve.py | 2 +- release/ui/buttons_data_empty.py | 2 +- release/ui/buttons_data_lamp.py | 4 +- release/ui/buttons_data_lattice.py | 2 +- release/ui/buttons_data_mesh.py | 2 +- release/ui/buttons_data_metaball.py | 2 +- release/ui/buttons_data_modifier.py | 2 +- release/ui/buttons_data_text.py | 2 +- release/ui/buttons_game.py | 6 +- release/ui/buttons_material.py | 2 +- release/ui/buttons_object.py | 2 +- release/ui/buttons_object_constraint.py | 2 +- release/ui/buttons_particle.py | 2 +- release/ui/buttons_physics_cloth.py | 2 +- release/ui/buttons_physics_field.py | 2 +- release/ui/buttons_physics_fluid.py | 2 +- release/ui/buttons_physics_smoke.py | 4 +- release/ui/buttons_physics_softbody.py | 2 +- release/ui/buttons_scene.py | 2 +- release/ui/buttons_texture.py | 2 +- release/ui/buttons_world.py | 2 +- release/ui/space_buttons.py | 4 +- release/ui/space_info.py | 417 +---------------- release/ui/space_time.py | 7 - release/ui/space_userpref.py | 418 ++++++++++++++++++ source/blender/blenkernel/BKE_context.h | 1 + source/blender/blenkernel/intern/context.c | 7 + source/blender/blenloader/intern/writefile.c | 4 + source/blender/editors/Makefile | 1 + source/blender/editors/SConscript | 1 + source/blender/editors/include/ED_space_api.h | 1 + .../editors/interface/interface_panel.c | 2 +- source/blender/editors/interface/resources.c | 9 + source/blender/editors/screen/area.c | 3 +- source/blender/editors/space_api/spacetypes.c | 1 + .../editors/space_buttons/buttons_context.c | 3 +- .../editors/space_buttons/buttons_ops.c | 2 +- .../blender/editors/space_info/info_intern.h | 3 - .../blender/editors/space_userpref/Makefile | 55 +++ .../blender/editors/space_userpref/SConscript | 14 + .../editors/space_userpref/space_userpref.c | 188 ++++++++ .../editors/space_userpref/userpref_intern.h | 34 ++ .../editors/space_userpref/userpref_ops.c | 33 ++ source/blender/makesdna/DNA_space_types.h | 10 +- source/blender/makesdna/DNA_userdef_types.h | 1 + source/blender/makesrna/RNA_access.h | 22 +- source/blender/makesrna/intern/rna_space.c | 68 ++- source/blender/makesrna/intern/rna_userdef.c | 32 +- .../blender/windowmanager/intern/wm_window.c | 4 +- 53 files changed, 923 insertions(+), 480 deletions(-) create mode 100644 release/ui/space_userpref.py create mode 100644 source/blender/editors/space_userpref/Makefile create mode 100644 source/blender/editors/space_userpref/SConscript create mode 100644 source/blender/editors/space_userpref/space_userpref.c create mode 100644 source/blender/editors/space_userpref/userpref_intern.h create mode 100644 source/blender/editors/space_userpref/userpref_ops.c diff --git a/release/io/engine_render_pov.py b/release/io/engine_render_pov.py index ba9e7377535..97337ebc853 100644 --- a/release/io/engine_render_pov.py +++ b/release/io/engine_render_pov.py @@ -791,7 +791,7 @@ for member in dir(buttons_material): del buttons_material class RenderButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "scene" # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here diff --git a/release/ui/buttons_data_armature.py b/release/ui/buttons_data_armature.py index 681b8ba8954..9b640776a9e 100644 --- a/release/ui/buttons_data_armature.py +++ b/release/ui/buttons_data_armature.py @@ -2,7 +2,7 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "data" diff --git a/release/ui/buttons_data_bone.py b/release/ui/buttons_data_bone.py index e05b64e5e11..1eb09377892 100644 --- a/release/ui/buttons_data_bone.py +++ b/release/ui/buttons_data_bone.py @@ -2,7 +2,7 @@ import bpy class BoneButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "bone" diff --git a/release/ui/buttons_data_camera.py b/release/ui/buttons_data_camera.py index 51d8c8c61e6..f2fa4207ec8 100644 --- a/release/ui/buttons_data_camera.py +++ b/release/ui/buttons_data_camera.py @@ -2,7 +2,7 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "data" diff --git a/release/ui/buttons_data_curve.py b/release/ui/buttons_data_curve.py index d0e1756986d..35d557afe32 100644 --- a/release/ui/buttons_data_curve.py +++ b/release/ui/buttons_data_curve.py @@ -2,7 +2,7 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "data" diff --git a/release/ui/buttons_data_empty.py b/release/ui/buttons_data_empty.py index 827fe02e411..2a2f51ed292 100644 --- a/release/ui/buttons_data_empty.py +++ b/release/ui/buttons_data_empty.py @@ -2,7 +2,7 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "data" diff --git a/release/ui/buttons_data_lamp.py b/release/ui/buttons_data_lamp.py index 6fb021802f0..a00bb23d5b5 100644 --- a/release/ui/buttons_data_lamp.py +++ b/release/ui/buttons_data_lamp.py @@ -2,7 +2,7 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "data" @@ -319,4 +319,4 @@ bpy.types.register(DATA_PT_falloff_curve) bpy.types.register(DATA_PT_area) bpy.types.register(DATA_PT_spot) bpy.types.register(DATA_PT_shadow) -bpy.types.register(DATA_PT_sunsky) \ No newline at end of file +bpy.types.register(DATA_PT_sunsky) diff --git a/release/ui/buttons_data_lattice.py b/release/ui/buttons_data_lattice.py index 3766b9ff1a5..5d8a07c7d44 100644 --- a/release/ui/buttons_data_lattice.py +++ b/release/ui/buttons_data_lattice.py @@ -2,7 +2,7 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "data" diff --git a/release/ui/buttons_data_mesh.py b/release/ui/buttons_data_mesh.py index d6ca0817edc..b681218a8fe 100644 --- a/release/ui/buttons_data_mesh.py +++ b/release/ui/buttons_data_mesh.py @@ -2,7 +2,7 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "data" diff --git a/release/ui/buttons_data_metaball.py b/release/ui/buttons_data_metaball.py index a3781705799..e31c3d7fcd0 100644 --- a/release/ui/buttons_data_metaball.py +++ b/release/ui/buttons_data_metaball.py @@ -1,7 +1,7 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "data" diff --git a/release/ui/buttons_data_modifier.py b/release/ui/buttons_data_modifier.py index 6dd11457ec9..436baa540d4 100644 --- a/release/ui/buttons_data_modifier.py +++ b/release/ui/buttons_data_modifier.py @@ -2,7 +2,7 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "modifier" diff --git a/release/ui/buttons_data_text.py b/release/ui/buttons_data_text.py index 757e61307df..754d6fcda39 100644 --- a/release/ui/buttons_data_text.py +++ b/release/ui/buttons_data_text.py @@ -2,7 +2,7 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "data" diff --git a/release/ui/buttons_game.py b/release/ui/buttons_game.py index b662254f1bb..3158536585e 100644 --- a/release/ui/buttons_game.py +++ b/release/ui/buttons_game.py @@ -2,7 +2,7 @@ import bpy class PhysicsButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "physics" @@ -171,7 +171,7 @@ bpy.types.register(PHYSICS_PT_game_physics) bpy.types.register(PHYSICS_PT_game_collision_bounds) class SceneButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "scene" @@ -276,7 +276,7 @@ bpy.types.register(SCENE_PT_game_player) bpy.types.register(SCENE_PT_game_stereo) class WorldButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "world" diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py index ff587d47668..b971a678926 100644 --- a/release/ui/buttons_material.py +++ b/release/ui/buttons_material.py @@ -2,7 +2,7 @@ import bpy class MaterialButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "material" # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here diff --git a/release/ui/buttons_object.py b/release/ui/buttons_object.py index 5bd4bbbd6bd..6b6d583e2ca 100644 --- a/release/ui/buttons_object.py +++ b/release/ui/buttons_object.py @@ -2,7 +2,7 @@ import bpy class ObjectButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "object" diff --git a/release/ui/buttons_object_constraint.py b/release/ui/buttons_object_constraint.py index 505fa57fa0b..c67d6e40cfb 100644 --- a/release/ui/buttons_object_constraint.py +++ b/release/ui/buttons_object_constraint.py @@ -2,7 +2,7 @@ import bpy class ConstraintButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "constraint" diff --git a/release/ui/buttons_particle.py b/release/ui/buttons_particle.py index 07ad3b7841c..8bc84b734bf 100644 --- a/release/ui/buttons_particle.py +++ b/release/ui/buttons_particle.py @@ -11,7 +11,7 @@ def particle_panel_poll(context): return psys.settings.type in ('EMITTER', 'REACTOR', 'HAIR') class ParticleButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "particle" diff --git a/release/ui/buttons_physics_cloth.py b/release/ui/buttons_physics_cloth.py index d18df9e5003..f34077c758a 100644 --- a/release/ui/buttons_physics_cloth.py +++ b/release/ui/buttons_physics_cloth.py @@ -2,7 +2,7 @@ import bpy class PhysicButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "physics" diff --git a/release/ui/buttons_physics_field.py b/release/ui/buttons_physics_field.py index 02802779c04..fb29dd92833 100644 --- a/release/ui/buttons_physics_field.py +++ b/release/ui/buttons_physics_field.py @@ -2,7 +2,7 @@ import bpy class PhysicButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "physics" diff --git a/release/ui/buttons_physics_fluid.py b/release/ui/buttons_physics_fluid.py index 0ad87120a7f..304d419b388 100644 --- a/release/ui/buttons_physics_fluid.py +++ b/release/ui/buttons_physics_fluid.py @@ -2,7 +2,7 @@ import bpy class PhysicButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "physics" diff --git a/release/ui/buttons_physics_smoke.py b/release/ui/buttons_physics_smoke.py index a225aedbe23..7e2395216c0 100644 --- a/release/ui/buttons_physics_smoke.py +++ b/release/ui/buttons_physics_smoke.py @@ -2,7 +2,7 @@ import bpy class PhysicButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "physics" @@ -156,4 +156,4 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel): bpy.types.register(PHYSICS_PT_smoke) bpy.types.register(PHYSICS_PT_smoke_highres) -bpy.types.register(PHYSICS_PT_smoke_groups) \ No newline at end of file +bpy.types.register(PHYSICS_PT_smoke_groups) diff --git a/release/ui/buttons_physics_softbody.py b/release/ui/buttons_physics_softbody.py index d0d3475c11b..2613f9e8032 100644 --- a/release/ui/buttons_physics_softbody.py +++ b/release/ui/buttons_physics_softbody.py @@ -2,7 +2,7 @@ import bpy class PhysicButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "physics" diff --git a/release/ui/buttons_scene.py b/release/ui/buttons_scene.py index 12200eb26ca..e9ee97468e8 100644 --- a/release/ui/buttons_scene.py +++ b/release/ui/buttons_scene.py @@ -2,7 +2,7 @@ import bpy class RenderButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "scene" # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here diff --git a/release/ui/buttons_texture.py b/release/ui/buttons_texture.py index a1b89bec0ce..18c836f9080 100644 --- a/release/ui/buttons_texture.py +++ b/release/ui/buttons_texture.py @@ -2,7 +2,7 @@ import bpy class TextureButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "texture" diff --git a/release/ui/buttons_world.py b/release/ui/buttons_world.py index 7840a4946f2..599f45d160b 100644 --- a/release/ui/buttons_world.py +++ b/release/ui/buttons_world.py @@ -2,7 +2,7 @@ import bpy class WorldButtonsPanel(bpy.types.Panel): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" __context__ = "world" # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here diff --git a/release/ui/space_buttons.py b/release/ui/space_buttons.py index b444913809d..cf1c385e3dc 100644 --- a/release/ui/space_buttons.py +++ b/release/ui/space_buttons.py @@ -2,7 +2,7 @@ import bpy class Buttons_HT_header(bpy.types.Header): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" def draw(self, context): layout = self.layout @@ -21,7 +21,7 @@ class Buttons_HT_header(bpy.types.Header): row.itemR(scene, "current_frame") class Buttons_MT_view(bpy.types.Menu): - __space_type__ = "BUTTONS_WINDOW" + __space_type__ = "PROPERTIES" __label__ = "View" def draw(self, context): diff --git a/release/ui/space_info.py b/release/ui/space_info.py index af2dac02ccb..12005ea3ecb 100644 --- a/release/ui/space_info.py +++ b/release/ui/space_info.py @@ -2,7 +2,7 @@ import bpy class INFO_HT_header(bpy.types.Header): - __space_type__ = "USER_PREFERENCES" + __space_type__ = "INFO" def draw(self, context): layout = self.layout @@ -34,7 +34,7 @@ class INFO_HT_header(bpy.types.Header): layout.template_running_jobs() class INFO_MT_file(bpy.types.Menu): - __space_type__ = "USER_PREFERENCES" + __space_type__ = "INFO" __label__ = "File" def draw(self, context): @@ -70,14 +70,14 @@ class INFO_MT_file(bpy.types.Menu): layout.itemO("wm.exit_blender", text="Quit") class INFO_MT_file_import(bpy.types.Menu): - __space_type__ = "USER_PREFERENCES" + __space_type__ = "INFO" __label__ = "Import" def draw(self, context): layout = self.layout class INFO_MT_file_export(bpy.types.Menu): - __space_type__ = "USER_PREFERENCES" + __space_type__ = "INFO" __label__ = "Export" def draw(self, context): @@ -86,7 +86,7 @@ class INFO_MT_file_export(bpy.types.Menu): layout.itemO("export.ply", text="PLY") class INFO_MT_file_external_data(bpy.types.Menu): - __space_type__ = "USER_PREFERENCES" + __space_type__ = "INFO" __label__ = "External Data" def draw(self, context): @@ -103,7 +103,7 @@ class INFO_MT_file_external_data(bpy.types.Menu): layout.itemO("file.find_missing_files") class INFO_MT_add(bpy.types.Menu): - __space_type__ = "USER_PREFERENCES" + __space_type__ = "INFO" __label__ = "Add" def draw(self, context): @@ -129,7 +129,7 @@ class INFO_MT_add(bpy.types.Menu): layout.item_enumO("OBJECT_OT_object_add", "type", 'LAMP', icon='ICON_OUTLINER_OB_LAMP') class INFO_MT_game(bpy.types.Menu): - __space_type__ = "USER_PREFERENCES" + __space_type__ = "INFO" __label__ = "Game" def draw(self, context): @@ -138,7 +138,7 @@ class INFO_MT_game(bpy.types.Menu): layout.itemO("view3d.game_start") class INFO_MT_render(bpy.types.Menu): - __space_type__ = "USER_PREFERENCES" + __space_type__ = "INFO" __label__ = "Render" def draw(self, context): @@ -154,7 +154,7 @@ class INFO_MT_render(bpy.types.Menu): layout.itemO("screen.render_view_show") class INFO_MT_help(bpy.types.Menu): - __space_type__ = "USER_PREFERENCES" + __space_type__ = "INFO" __label__ = "Help" def draw(self, context): @@ -170,397 +170,6 @@ class INFO_MT_help(bpy.types.Menu): layout.itemO("help.developer_community") layout.itemO("help.user_community") -class INFO_PT_tabs(bpy.types.Panel): - __space_type__ = "USER_PREFERENCES" - __show_header__ = False - - def draw(self, context): - layout = self.layout - - userpref = context.user_preferences - - layout.itemR(userpref, "active_section", expand=True) - -class INFO_PT_view(bpy.types.Panel): - __space_type__ = "USER_PREFERENCES" - __label__ = "View" - __show_header__ = False - - def poll(self, context): - userpref = context.user_preferences - return (userpref.active_section == 'VIEW_CONTROLS') - - def draw(self, context): - layout = self.layout - - userpref = context.user_preferences - view = userpref.view - - split = layout.split() - - col = split.column() - sub = col.split(percentage=0.85) - - sub1 = sub.column() - sub1.itemL(text="Display:") - sub1.itemR(view, "tooltips") - sub1.itemR(view, "display_object_info", text="Object Info") - sub1.itemR(view, "use_large_cursors") - sub1.itemR(view, "show_view_name", text="View Name") - sub1.itemR(view, "show_playback_fps", text="Playback FPS") - sub1.itemR(view, "global_scene") - sub1.itemR(view, "pin_floating_panels") - sub1.itemR(view, "object_center_size") - sub1.itemS() - sub1.itemS() - sub1.itemS() - sub1.itemR(view, "show_mini_axis") - sub2 = sub1.column() - sub2.enabled = view.show_mini_axis - sub2.itemR(view, "mini_axis_size") - sub2.itemR(view, "mini_axis_brightness") - - col = split.column() - sub = col.split(percentage=0.85) - - sub1 = sub.column() - sub1.itemL(text="View Manipulation:") - sub1.itemR(view, "auto_depth") - sub1.itemR(view, "global_pivot") - sub1.itemR(view, "zoom_to_mouse") - sub1.itemR(view, "rotate_around_selection") - sub1.itemS() - sub1.itemL(text="Zoom Style:") - sub1.row().itemR(view, "viewport_zoom_style", expand=True) - sub1.itemL(text="Orbit Style:") - sub1.row().itemR(view, "view_rotation", expand=True) - sub1.itemR(view, "perspective_orthographic_switch") - sub1.itemR(view, "smooth_view") - sub1.itemR(view, "rotation_angle") - sub1.itemS() - sub1.itemL(text="NDOF Device:") - sub1.itemR(view, "ndof_pan_speed", text="Pan Speed") - sub1.itemR(view, "ndof_rotate_speed", text="Orbit Speed") - - col = split.column() - sub = col.split(percentage=0.85) - - sub1 = sub.column() - sub1.itemL(text="Mouse Buttons:") - sub1.itemR(view, "left_mouse_button_select") - sub1.itemR(view, "right_mouse_button_select") - sub1.itemR(view, "emulate_3_button_mouse") - sub1.itemR(view, "use_middle_mouse_paste") - sub1.itemR(view, "middle_mouse_rotate") - sub1.itemR(view, "middle_mouse_pan") - sub1.itemR(view, "wheel_invert_zoom") - sub1.itemR(view, "wheel_scroll_lines") - sub1.itemS() - sub1.itemS() - sub1.itemS() - sub1.itemL(text="Menus:") - sub1.itemR(view, "open_mouse_over") - sub1.itemL(text="Menu Open Delay:") - sub1.itemR(view, "open_toplevel_delay", text="Top Level") - sub1.itemR(view, "open_sublevel_delay", text="Sub Level") - - col = split.column() - sub = col.split(percentage=0.85) - - sub1 = sub.column() - #manipulator - sub1.itemR(view, "use_manipulator") - sub2 = sub1.column() - sub2.enabled = view.use_manipulator - sub2.itemR(view, "manipulator_size", text="Size") - sub2.itemR(view, "manipulator_handle_size", text="Handle Size") - sub2.itemR(view, "manipulator_hotspot", text="Hotspot") - sub1.itemS() - sub1.itemS() - sub1.itemS() - sub1.itemL(text="Toolbox:") - sub1.itemR(view, "use_column_layout") - sub1.itemL(text="Open Toolbox Delay:") - sub1.itemR(view, "open_left_mouse_delay", text="Hold LMB") - sub1.itemR(view, "open_right_mouse_delay", text="Hold RMB") - -class INFO_PT_edit(bpy.types.Panel): - __space_type__ = "USER_PREFERENCES" - __label__ = "Edit" - __show_header__ = False - - def poll(self, context): - userpref = context.user_preferences - return (userpref.active_section == 'EDIT_METHODS') - - def draw(self, context): - layout = self.layout - - userpref = context.user_preferences - edit = userpref.edit - view = userpref.view - - split = layout.split() - - col = split.column() - sub = col.split(percentage=0.85) - - sub1 = sub.column() - sub1.itemL(text="Materials:") - sub1.itemR(edit, "material_linked_object", text="Linked to Object") - sub1.itemR(edit, "material_linked_obdata", text="Linked to ObData") - sub1.itemS() - sub1.itemS() - sub1.itemS() - sub1.itemL(text="New Objects:") - sub1.itemR(edit, "enter_edit_mode") - sub1.itemR(edit, "align_to_view") - sub1.itemS() - sub1.itemS() - sub1.itemS() - sub1.itemL(text="Transform:") - sub1.itemR(edit, "drag_immediately") - - col = split.column() - sub = col.split(percentage=0.85) - - sub1 = sub.column() - sub1.itemL(text="Snap:") - sub1.itemR(edit, "snap_translate", text="Translate") - sub1.itemR(edit, "snap_rotate", text="Rotate") - sub1.itemR(edit, "snap_scale", text="Scale") - sub1.itemS() - sub1.itemS() - sub1.itemS() - sub1.itemL(text="Grease Pencil:") - sub1.itemR(edit, "grease_pencil_manhattan_distance", text="Manhattan Distance") - sub1.itemR(edit, "grease_pencil_euclidean_distance", text="Euclidean Distance") - sub1.itemR(edit, "grease_pencil_smooth_stroke", text="Smooth Stroke") - # sub1.itemR(edit, "grease_pencil_simplify_stroke", text="Simplify Stroke") - sub1.itemR(edit, "grease_pencil_eraser_radius", text="Eraser Radius") - - col = split.column() - sub = col.split(percentage=0.85) - - sub1 = sub.column() - sub1.itemL(text="Keyframing:") - sub1.itemR(edit, "use_visual_keying") - sub1.itemR(edit, "new_interpolation_type") - sub1.itemS() - sub1.itemR(edit, "auto_keying_enable", text="Auto Keyframing") - sub2 = sub1.column() - sub2.enabled = edit.auto_keying_enable - sub2.row().itemR(edit, "auto_keying_mode", expand=True) - sub2.itemR(edit, "auto_keyframe_insert_available", text="Only Insert Available") - sub2.itemR(edit, "auto_keyframe_insert_needed", text="Only Insert Needed") - sub1.itemS() - sub1.itemS() - sub1.itemS() - sub1.itemL(text="Undo:") - sub1.itemR(edit, "global_undo") - sub1.itemR(edit, "undo_steps", text="Steps") - sub1.itemR(edit, "undo_memory_limit", text="Memory Limit") - sub1.itemS() - sub1.itemS() - sub1.itemS() - - col = split.column() - sub = col.split(percentage=0.85) - - sub1 = sub.column() - sub1.itemL(text="Duplicate:") - sub1.itemR(edit, "duplicate_mesh", text="Mesh") - sub1.itemR(edit, "duplicate_surface", text="Surface") - sub1.itemR(edit, "duplicate_curve", text="Curve") - sub1.itemR(edit, "duplicate_text", text="Text") - sub1.itemR(edit, "duplicate_metaball", text="Metaball") - sub1.itemR(edit, "duplicate_armature", text="Armature") - sub1.itemR(edit, "duplicate_lamp", text="Lamp") - sub1.itemR(edit, "duplicate_material", text="Material") - sub1.itemR(edit, "duplicate_texture", text="Texture") - sub1.itemR(edit, "duplicate_ipo", text="F-Curve") - sub1.itemR(edit, "duplicate_action", text="Action") - -class INFO_PT_system(bpy.types.Panel): - __space_type__ = "USER_PREFERENCES" - __label__ = "System" - __show_header__ = False - - def poll(self, context): - userpref = context.user_preferences - return (userpref.active_section == 'SYSTEM_OPENGL') - - def draw(self, context): - layout = self.layout - - userpref = context.user_preferences - system = userpref.system - lan = userpref.language - - split = layout.split() - - col = split.column() - sub = col.split(percentage=0.85) - - sub1 = sub.column() - sub1.itemR(system, "emulate_numpad") - sub1.itemS() - sub1.itemS() - - #Weight Colors - sub1.itemL(text="Weight Colors:") - sub1.itemR(system, "use_weight_color_range", text="Use Custom Range") - - sub2 = sub1.column() - sub2.active = system.use_weight_color_range - sub2.template_color_ramp(system.weight_color_range, expand=True) - sub1.itemS() - sub1.itemS() - - #sequencer - sub1.itemL(text="Sequencer:") - sub1.itemR(system, "prefetch_frames") - sub1.itemR(system, "memory_cache_limit") - - col = split.column() - sub = col.split(percentage=0.85) - - sub1 = sub .column() - #System - sub1.itemL(text="System:") - sub1.itemR(lan, "dpi") - sub1.itemR(system, "auto_run_python_scripts") - sub1.itemR(system, "frame_server_port") - sub1.itemR(system, "filter_file_extensions") - sub1.itemR(system, "hide_dot_files_datablocks") - sub1.itemR(lan, "scrollback", text="Console Scrollback") - sub1.itemS() - sub1.itemS() - sub1.itemL(text="Sound:") - sub1.itemR(system, "audio_device") - sub2 = sub1.column() - sub2.active = system.audio_device != 'AUDIO_DEVICE_NULL' - sub2.itemR(system, "enable_all_codecs") - sub2.itemR(system, "game_sound") - sub2.itemR(system, "audio_channels") - sub2.itemR(system, "audio_mixing_buffer") - sub2.itemR(system, "audio_sample_rate") - sub2.itemR(system, "audio_sample_format") - - col = split.column() - sub = col.split(percentage=0.85) - - sub1 = sub.column() - #OpenGL - sub1.itemL(text="OpenGL:") - sub1.itemR(system, "clip_alpha", slider=True) - sub1.itemR(system, "use_mipmaps") - sub1.itemL(text="Window Draw Method:") - sub1.row().itemR(system, "window_draw_method", expand=True) - sub1.itemL(text="Textures:") - sub1.itemR(system, "gl_texture_limit", text="Limit Size") - sub1.itemR(system, "texture_time_out", text="Time Out") - sub1.itemR(system, "texture_collection_rate", text="Collection Rate") - -class INFO_PT_filepaths(bpy.types.Panel): - __space_type__ = "USER_PREFERENCES" - __label__ = "File Paths" - __show_header__ = False - - def poll(self, context): - userpref = context.user_preferences - return (userpref.active_section == 'FILE_PATHS') - - def draw(self, context): - layout = self.layout - - userpref = context.user_preferences - paths = userpref.filepaths - - split = layout.split() - - col = split.column() - col.itemL(text="File Paths:") - sub = col.split(percentage=0.3) - - sub.itemL(text="Fonts:") - sub.itemR(paths, "fonts_directory", text="") - sub = col.split(percentage=0.3) - sub.itemL(text="Textures:") - sub.itemR(paths, "textures_directory", text="") - sub = col.split(percentage=0.3) - sub.itemL(text="Texture Plugins:") - sub.itemR(paths, "texture_plugin_directory", text="") - sub = col.split(percentage=0.3) - sub.itemL(text="Sequence Plugins:") - sub.itemR(paths, "sequence_plugin_directory", text="") - sub = col.split(percentage=0.3) - sub.itemL(text="Render Output:") - sub.itemR(paths, "render_output_directory", text="") - sub = col.split(percentage=0.3) - sub.itemL(text="Scripts:") - sub.itemR(paths, "python_scripts_directory", text="") - sub = col.split(percentage=0.3) - sub.itemL(text="Sounds:") - sub.itemR(paths, "sounds_directory", text="") - sub = col.split(percentage=0.3) - sub.itemL(text="Temp:") - sub.itemR(paths, "temporary_directory", text="") - - col = split.column() - sub = col.split(percentage=0.2) - sub1 = sub.column() - sub2 = sub.column() - sub2.itemL(text="Save & Load:") - sub2.itemR(paths, "use_relative_paths") - sub2.itemR(paths, "compress_file") - sub2.itemL(text="Auto Save:") - sub2.itemR(paths, "save_version") - sub2.itemR(paths, "recent_files") - sub2.itemR(paths, "save_preview_images") - sub2.itemR(paths, "auto_save_temporary_files") - sub3 = sub2.column() - sub3.enabled = paths.auto_save_temporary_files - sub3.itemR(paths, "auto_save_time") - -class INFO_PT_language(bpy.types.Panel): - __space_type__ = "USER_PREFERENCES" - __label__ = "Language" - __show_header__ = False - - def poll(self, context): - userpref = context.user_preferences - return (userpref.active_section == 'LANGUAGE_COLORS') - - def draw(self, context): - layout = self.layout - - userpref = context.user_preferences - lan = userpref.language - - split = layout.split() - col = split.column() - - col.itemR(lan, "language") - col.itemR(lan, "translate_tooltips") - col.itemR(lan, "translate_buttons") - col.itemR(lan, "translate_toolbox") - col.itemR(lan, "use_textured_fonts") - -class INFO_PT_bottombar(bpy.types.Panel): - __space_type__ = "USER_PREFERENCES" - __label__ = " " - __show_header__ = False - - def draw(self, context): - layout = self.layout - userpref = context.user_preferences - - split = layout.split(percentage=0.8) - split.itemL(text="") - layout.operator_context = "EXEC_AREA" - split.itemO("wm.save_homefile", text="Save As Default") - bpy.types.register(INFO_HT_header) bpy.types.register(INFO_MT_file) bpy.types.register(INFO_MT_file_import) @@ -570,13 +179,6 @@ bpy.types.register(INFO_MT_add) bpy.types.register(INFO_MT_game) bpy.types.register(INFO_MT_render) bpy.types.register(INFO_MT_help) -bpy.types.register(INFO_PT_tabs) -bpy.types.register(INFO_PT_view) -bpy.types.register(INFO_PT_edit) -bpy.types.register(INFO_PT_system) -bpy.types.register(INFO_PT_filepaths) -bpy.types.register(INFO_PT_language) -bpy.types.register(INFO_PT_bottombar) # Help operators @@ -631,3 +233,4 @@ bpy.ops.add(HELP_OT_blender_website) bpy.ops.add(HELP_OT_blender_eshop) bpy.ops.add(HELP_OT_developer_community) bpy.ops.add(HELP_OT_user_community) + diff --git a/release/ui/space_time.py b/release/ui/space_time.py index 45fdeb04ead..785d11a8fc5 100644 --- a/release/ui/space_time.py +++ b/release/ui/space_time.py @@ -23,8 +23,6 @@ class TIME_HT_header(bpy.types.Header): layout.itemR(scene, "use_preview_range", text="PR", toggle=True) - layout.itemS() - row = layout.row(align=True) if not scene.use_preview_range: row.itemR(scene, "start_frame", text="Start") @@ -33,10 +31,7 @@ class TIME_HT_header(bpy.types.Header): row.itemR(scene, "preview_range_start_frame", text="Start") row.itemR(scene, "preview_range_end_frame", text="End") - layout.itemS() layout.itemR(scene, "current_frame", text="") - - layout.itemS() row = layout.row(align=True) row.item_booleanO("screen.frame_jump", "end", False, text="", icon='ICON_REW') @@ -51,8 +46,6 @@ class TIME_HT_header(bpy.types.Header): row.item_booleanO("screen.keyframe_jump", "next", True, text="", icon='ICON_NEXT_KEYFRAME') row.item_booleanO("screen.frame_jump", "end", True, text="", icon='ICON_FF') - layout.itemS() - layout.itemR(rd, "sync_audio", text="", toggle=True, icon='ICON_SPEAKER') layout.itemS() diff --git a/release/ui/space_userpref.py b/release/ui/space_userpref.py new file mode 100644 index 00000000000..95054efcb25 --- /dev/null +++ b/release/ui/space_userpref.py @@ -0,0 +1,418 @@ + +import bpy + +class USERPREF_HT_header(bpy.types.Header): + __space_type__ = "USER_PREFERENCES" + + def draw(self, context): + layout = self.layout + layout.template_header(menus=False) + +class USERPREF_MT_view(bpy.types.Menu): + __space_type__ = "USER_PREFERENCES" + __label__ = "View" + + def draw(self, context): + layout = self.layout + +class USERPREF_PT_tabs(bpy.types.Panel): + __space_type__ = "USER_PREFERENCES" + __show_header__ = False + + def draw(self, context): + layout = self.layout + + userpref = context.user_preferences + + layout.itemR(userpref, "active_section", expand=True) + +class USERPREF_PT_view(bpy.types.Panel): + __space_type__ = "USER_PREFERENCES" + __label__ = "View" + __show_header__ = False + + def poll(self, context): + userpref = context.user_preferences + return (userpref.active_section == 'VIEW_CONTROLS') + + def draw(self, context): + layout = self.layout + + userpref = context.user_preferences + view = userpref.view + + split = layout.split() + + col = split.column() + sub = col.split(percentage=0.85) + + sub1 = sub.column() + sub1.itemL(text="Display:") + sub1.itemR(view, "tooltips") + sub1.itemR(view, "display_object_info", text="Object Info") + sub1.itemR(view, "use_large_cursors") + sub1.itemR(view, "show_view_name", text="View Name") + sub1.itemR(view, "show_playback_fps", text="Playback FPS") + sub1.itemR(view, "global_scene") + sub1.itemR(view, "pin_floating_panels") + sub1.itemR(view, "object_center_size") + sub1.itemS() + sub1.itemS() + sub1.itemS() + sub1.itemR(view, "show_mini_axis") + sub2 = sub1.column() + sub2.enabled = view.show_mini_axis + sub2.itemR(view, "mini_axis_size") + sub2.itemR(view, "mini_axis_brightness") + + col = split.column() + sub = col.split(percentage=0.85) + + sub1 = sub.column() + sub1.itemL(text="View Manipulation:") + sub1.itemR(view, "auto_depth") + sub1.itemR(view, "global_pivot") + sub1.itemR(view, "zoom_to_mouse") + sub1.itemR(view, "rotate_around_selection") + sub1.itemS() + sub1.itemL(text="Zoom Style:") + sub1.row().itemR(view, "viewport_zoom_style", expand=True) + sub1.itemL(text="Orbit Style:") + sub1.row().itemR(view, "view_rotation", expand=True) + sub1.itemR(view, "perspective_orthographic_switch") + sub1.itemR(view, "smooth_view") + sub1.itemR(view, "rotation_angle") + sub1.itemS() + sub1.itemL(text="NDOF Device:") + sub1.itemR(view, "ndof_pan_speed", text="Pan Speed") + sub1.itemR(view, "ndof_rotate_speed", text="Orbit Speed") + + col = split.column() + sub = col.split(percentage=0.85) + + sub1 = sub.column() + sub1.itemL(text="Mouse Buttons:") + sub1.itemR(view, "left_mouse_button_select") + sub1.itemR(view, "right_mouse_button_select") + sub1.itemR(view, "emulate_3_button_mouse") + sub1.itemR(view, "use_middle_mouse_paste") + sub1.itemR(view, "middle_mouse_rotate") + sub1.itemR(view, "middle_mouse_pan") + sub1.itemR(view, "wheel_invert_zoom") + sub1.itemR(view, "wheel_scroll_lines") + sub1.itemS() + sub1.itemS() + sub1.itemS() + sub1.itemL(text="Menus:") + sub1.itemR(view, "open_mouse_over") + sub1.itemL(text="Menu Open Delay:") + sub1.itemR(view, "open_toplevel_delay", text="Top Level") + sub1.itemR(view, "open_sublevel_delay", text="Sub Level") + + col = split.column() + sub = col.split(percentage=0.85) + + sub1 = sub.column() + #manipulator + sub1.itemR(view, "use_manipulator") + sub2 = sub1.column() + sub2.enabled = view.use_manipulator + sub2.itemR(view, "manipulator_size", text="Size") + sub2.itemR(view, "manipulator_handle_size", text="Handle Size") + sub2.itemR(view, "manipulator_hotspot", text="Hotspot") + sub1.itemS() + sub1.itemS() + sub1.itemS() + sub1.itemL(text="Toolbox:") + sub1.itemR(view, "use_column_layout") + sub1.itemL(text="Open Toolbox Delay:") + sub1.itemR(view, "open_left_mouse_delay", text="Hold LMB") + sub1.itemR(view, "open_right_mouse_delay", text="Hold RMB") + +class USERPREF_PT_edit(bpy.types.Panel): + __space_type__ = "USER_PREFERENCES" + __label__ = "Edit" + __show_header__ = False + + def poll(self, context): + userpref = context.user_preferences + return (userpref.active_section == 'EDIT_METHODS') + + def draw(self, context): + layout = self.layout + + userpref = context.user_preferences + edit = userpref.edit + view = userpref.view + + split = layout.split() + + col = split.column() + sub = col.split(percentage=0.85) + + sub1 = sub.column() + sub1.itemL(text="Materials:") + sub1.itemR(edit, "material_linked_object", text="Linked to Object") + sub1.itemR(edit, "material_linked_obdata", text="Linked to ObData") + sub1.itemS() + sub1.itemS() + sub1.itemS() + sub1.itemL(text="New Objects:") + sub1.itemR(edit, "enter_edit_mode") + sub1.itemR(edit, "align_to_view") + sub1.itemS() + sub1.itemS() + sub1.itemS() + sub1.itemL(text="Transform:") + sub1.itemR(edit, "drag_immediately") + + col = split.column() + sub = col.split(percentage=0.85) + + sub1 = sub.column() + sub1.itemL(text="Snap:") + sub1.itemR(edit, "snap_translate", text="Translate") + sub1.itemR(edit, "snap_rotate", text="Rotate") + sub1.itemR(edit, "snap_scale", text="Scale") + sub1.itemS() + sub1.itemS() + sub1.itemS() + sub1.itemL(text="Grease Pencil:") + sub1.itemR(edit, "grease_pencil_manhattan_distance", text="Manhattan Distance") + sub1.itemR(edit, "grease_pencil_euclidean_distance", text="Euclidean Distance") + sub1.itemR(edit, "grease_pencil_smooth_stroke", text="Smooth Stroke") + # sub1.itemR(edit, "grease_pencil_simplify_stroke", text="Simplify Stroke") + sub1.itemR(edit, "grease_pencil_eraser_radius", text="Eraser Radius") + + col = split.column() + sub = col.split(percentage=0.85) + + sub1 = sub.column() + sub1.itemL(text="Keyframing:") + sub1.itemR(edit, "use_visual_keying") + sub1.itemR(edit, "new_interpolation_type") + sub1.itemS() + sub1.itemR(edit, "auto_keying_enable", text="Auto Keyframing") + sub2 = sub1.column() + sub2.enabled = edit.auto_keying_enable + sub2.row().itemR(edit, "auto_keying_mode", expand=True) + sub2.itemR(edit, "auto_keyframe_insert_available", text="Only Insert Available") + sub2.itemR(edit, "auto_keyframe_insert_needed", text="Only Insert Needed") + sub1.itemS() + sub1.itemS() + sub1.itemS() + sub1.itemL(text="Undo:") + sub1.itemR(edit, "global_undo") + sub1.itemR(edit, "undo_steps", text="Steps") + sub1.itemR(edit, "undo_memory_limit", text="Memory Limit") + sub1.itemS() + sub1.itemS() + sub1.itemS() + + col = split.column() + sub = col.split(percentage=0.85) + + sub1 = sub.column() + sub1.itemL(text="Duplicate:") + sub1.itemR(edit, "duplicate_mesh", text="Mesh") + sub1.itemR(edit, "duplicate_surface", text="Surface") + sub1.itemR(edit, "duplicate_curve", text="Curve") + sub1.itemR(edit, "duplicate_text", text="Text") + sub1.itemR(edit, "duplicate_metaball", text="Metaball") + sub1.itemR(edit, "duplicate_armature", text="Armature") + sub1.itemR(edit, "duplicate_lamp", text="Lamp") + sub1.itemR(edit, "duplicate_material", text="Material") + sub1.itemR(edit, "duplicate_texture", text="Texture") + sub1.itemR(edit, "duplicate_ipo", text="F-Curve") + sub1.itemR(edit, "duplicate_action", text="Action") + +class USERPREF_PT_system(bpy.types.Panel): + __space_type__ = "USER_PREFERENCES" + __label__ = "System" + __show_header__ = False + + def poll(self, context): + userpref = context.user_preferences + return (userpref.active_section == 'SYSTEM_OPENGL') + + def draw(self, context): + layout = self.layout + + userpref = context.user_preferences + system = userpref.system + lan = userpref.language + + split = layout.split() + + col = split.column() + sub = col.split(percentage=0.85) + + sub1 = sub.column() + sub1.itemR(system, "emulate_numpad") + sub1.itemS() + sub1.itemS() + + #Weight Colors + sub1.itemL(text="Weight Colors:") + sub1.itemR(system, "use_weight_color_range", text="Use Custom Range") + + sub2 = sub1.column() + sub2.active = system.use_weight_color_range + sub2.template_color_ramp(system.weight_color_range, expand=True) + sub1.itemS() + sub1.itemS() + + #sequencer + sub1.itemL(text="Sequencer:") + sub1.itemR(system, "prefetch_frames") + sub1.itemR(system, "memory_cache_limit") + + col = split.column() + sub = col.split(percentage=0.85) + + sub1 = sub .column() + #System + sub1.itemL(text="System:") + sub1.itemR(lan, "dpi") + sub1.itemR(system, "auto_run_python_scripts") + sub1.itemR(system, "frame_server_port") + sub1.itemR(system, "filter_file_extensions") + sub1.itemR(system, "hide_dot_files_datablocks") + sub1.itemR(lan, "scrollback", text="Console Scrollback") + sub1.itemS() + sub1.itemS() + sub1.itemL(text="Sound:") + sub1.itemR(system, "audio_device") + sub2 = sub1.column() + sub2.active = system.audio_device != 'AUDIO_DEVICE_NULL' + sub2.itemR(system, "enable_all_codecs") + sub2.itemR(system, "game_sound") + sub2.itemR(system, "audio_channels") + sub2.itemR(system, "audio_mixing_buffer") + sub2.itemR(system, "audio_sample_rate") + sub2.itemR(system, "audio_sample_format") + + col = split.column() + sub = col.split(percentage=0.85) + + sub1 = sub.column() + #OpenGL + sub1.itemL(text="OpenGL:") + sub1.itemR(system, "clip_alpha", slider=True) + sub1.itemR(system, "use_mipmaps") + sub1.itemL(text="Window Draw Method:") + sub1.row().itemR(system, "window_draw_method", expand=True) + sub1.itemL(text="Textures:") + sub1.itemR(system, "gl_texture_limit", text="Limit Size") + sub1.itemR(system, "texture_time_out", text="Time Out") + sub1.itemR(system, "texture_collection_rate", text="Collection Rate") + +class USERPREF_PT_filepaths(bpy.types.Panel): + __space_type__ = "USER_PREFERENCES" + __label__ = "File Paths" + __show_header__ = False + + def poll(self, context): + userpref = context.user_preferences + return (userpref.active_section == 'FILE_PATHS') + + def draw(self, context): + layout = self.layout + + userpref = context.user_preferences + paths = userpref.filepaths + + split = layout.split() + + col = split.column() + col.itemL(text="File Paths:") + sub = col.split(percentage=0.3) + + sub.itemL(text="Fonts:") + sub.itemR(paths, "fonts_directory", text="") + sub = col.split(percentage=0.3) + sub.itemL(text="Textures:") + sub.itemR(paths, "textures_directory", text="") + sub = col.split(percentage=0.3) + sub.itemL(text="Texture Plugins:") + sub.itemR(paths, "texture_plugin_directory", text="") + sub = col.split(percentage=0.3) + sub.itemL(text="Sequence Plugins:") + sub.itemR(paths, "sequence_plugin_directory", text="") + sub = col.split(percentage=0.3) + sub.itemL(text="Render Output:") + sub.itemR(paths, "render_output_directory", text="") + sub = col.split(percentage=0.3) + sub.itemL(text="Scripts:") + sub.itemR(paths, "python_scripts_directory", text="") + sub = col.split(percentage=0.3) + sub.itemL(text="Sounds:") + sub.itemR(paths, "sounds_directory", text="") + sub = col.split(percentage=0.3) + sub.itemL(text="Temp:") + sub.itemR(paths, "temporary_directory", text="") + + col = split.column() + sub = col.split(percentage=0.2) + sub1 = sub.column() + sub2 = sub.column() + sub2.itemL(text="Save & Load:") + sub2.itemR(paths, "use_relative_paths") + sub2.itemR(paths, "compress_file") + sub2.itemL(text="Auto Save:") + sub2.itemR(paths, "save_version") + sub2.itemR(paths, "recent_files") + sub2.itemR(paths, "save_preview_images") + sub2.itemR(paths, "auto_save_temporary_files") + sub3 = sub2.column() + sub3.enabled = paths.auto_save_temporary_files + sub3.itemR(paths, "auto_save_time") + +class USERPREF_PT_language(bpy.types.Panel): + __space_type__ = "USER_PREFERENCES" + __label__ = "Language" + __show_header__ = False + + def poll(self, context): + userpref = context.user_preferences + return (userpref.active_section == 'LANGUAGE_COLORS') + + def draw(self, context): + layout = self.layout + + userpref = context.user_preferences + lan = userpref.language + + split = layout.split() + col = split.column() + + col.itemR(lan, "language") + col.itemR(lan, "translate_tooltips") + col.itemR(lan, "translate_buttons") + col.itemR(lan, "translate_toolbox") + col.itemR(lan, "use_textured_fonts") + +class USERPREF_PT_bottombar(bpy.types.Panel): + __space_type__ = "USER_PREFERENCES" + __label__ = " " + __show_header__ = False + + def draw(self, context): + layout = self.layout + userpref = context.user_preferences + + split = layout.split(percentage=0.8) + split.itemL(text="") + layout.operator_context = "EXEC_AREA" + split.itemO("wm.save_homefile", text="Save As Default") + +bpy.types.register(USERPREF_HT_header) +bpy.types.register(USERPREF_MT_view) +bpy.types.register(USERPREF_PT_tabs) +bpy.types.register(USERPREF_PT_view) +bpy.types.register(USERPREF_PT_edit) +bpy.types.register(USERPREF_PT_system) +bpy.types.register(USERPREF_PT_filepaths) +bpy.types.register(USERPREF_PT_language) +bpy.types.register(USERPREF_PT_bottombar) + diff --git a/source/blender/blenkernel/BKE_context.h b/source/blender/blenkernel/BKE_context.h index 035b7e2e5b9..09e13c2930e 100644 --- a/source/blender/blenkernel/BKE_context.h +++ b/source/blender/blenkernel/BKE_context.h @@ -152,6 +152,7 @@ struct SpaceLogic *CTX_wm_space_logic(const bContext *C); struct SpaceIpo *CTX_wm_space_graph(const bContext *C); struct SpaceAction *CTX_wm_space_action(const bContext *C); struct SpaceInfo *CTX_wm_space_info(const bContext *C); +struct SpaceUserPref *CTX_wm_space_userpref(const bContext *C); void CTX_wm_manager_set(bContext *C, struct wmWindowManager *wm); void CTX_wm_window_set(bContext *C, struct wmWindow *win); diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index c38b994849a..bbfe077c15e 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -338,6 +338,13 @@ struct SpaceInfo *CTX_wm_space_info(const bContext *C) return NULL; } +struct SpaceUserPref *CTX_wm_space_userpref(const bContext *C) +{ + if(C->wm.area && C->wm.area->spacetype==SPACE_USERPREF) + return C->wm.area->spacedata.first; + return NULL; +} + void CTX_wm_manager_set(bContext *C, wmWindowManager *wm) { C->wm.manager= wm; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 9d059af9887..62ec1b71938 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2023,6 +2023,10 @@ static void write_screens(WriteData *wd, ListBase *scrbase) else if(sl->spacetype==SPACE_CONSOLE) { writestruct(wd, DATA, "SpaceConsole", 1, sl); } + else if(sl->spacetype==SPACE_USERPREF) { + writestruct(wd, DATA, "SpaceUserPref", 1, sl); + } + sl= sl->next; } } diff --git a/source/blender/editors/Makefile b/source/blender/editors/Makefile index dbd0ca779aa..bbbb3fb985f 100644 --- a/source/blender/editors/Makefile +++ b/source/blender/editors/Makefile @@ -65,5 +65,6 @@ DIRS = armature \ space_text \ space_sequencer \ space_logic \ + space_userpref \ include nan_subdirs.mk diff --git a/source/blender/editors/SConscript b/source/blender/editors/SConscript index 0a13082faaf..05f17dae1a1 100644 --- a/source/blender/editors/SConscript +++ b/source/blender/editors/SConscript @@ -32,6 +32,7 @@ SConscript(['datafiles/SConscript', 'space_sequencer/SConscript', 'space_logic/SConscript', 'space_console/SConscript', + 'space_userpref/SConscript', 'transform/SConscript', 'screen/SConscript', 'sculpt_paint/SConscript', diff --git a/source/blender/editors/include/ED_space_api.h b/source/blender/editors/include/ED_space_api.h index efaf0f56f92..04b6be3bcaa 100644 --- a/source/blender/editors/include/ED_space_api.h +++ b/source/blender/editors/include/ED_space_api.h @@ -52,6 +52,7 @@ void ED_spacetype_text(void); void ED_spacetype_sequencer(void); void ED_spacetype_logic(void); void ED_spacetype_console(void); +void ED_spacetype_userpref(void); /* calls for instancing and freeing spacetype static data called in WM_init_exit */ diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index efff5b8f39c..05001109b53 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -104,7 +104,7 @@ static int panel_aligned(ScrArea *sa, ARegion *ar) SpaceButs *sbuts= sa->spacedata.first; return sbuts->align; } - else if(sa->spacetype==SPACE_INFO && ar->regiontype == RGN_TYPE_WINDOW) + else if(sa->spacetype==SPACE_USERPREF && ar->regiontype == RGN_TYPE_WINDOW) return BUT_VERTICAL; else if(sa->spacetype==SPACE_FILE && ar->regiontype == RGN_TYPE_CHANNELS) return BUT_VERTICAL; diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 297e22610a6..5b51d898235 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -150,6 +150,9 @@ char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid) case SPACE_INFO: ts= &btheme->tinfo; break; + case SPACE_USERPREF: + ts= &btheme->tuserpref; + break; case SPACE_TIME: ts= &btheme->ttime; break; @@ -402,6 +405,7 @@ static void ui_theme_init_new(bTheme *btheme) ui_theme_init_new_do(&btheme->ttime); ui_theme_init_new_do(&btheme->tnode); ui_theme_init_new_do(&btheme->tlogic); + ui_theme_init_new_do(&btheme->tuserpref); } @@ -583,6 +587,10 @@ void ui_theme_init_userdef(void) btheme->tinfo= btheme->tv3d; SETCOLF(btheme->tinfo.back, 0.45, 0.45, 0.45, 1.0); + /* space user preferences */ + btheme->tuserpref= btheme->tv3d; + SETCOLF(btheme->tuserpref.back, 0.45, 0.45, 0.45, 1.0); + /* space sound */ btheme->tsnd= btheme->tv3d; SETCOLF(btheme->tsnd.back, 0.45, 0.45, 0.45, 1.0); @@ -1233,6 +1241,7 @@ void init_userdef_do_versions(void) } SETCOLF(btheme->tinfo.back, 0.45, 0.45, 0.45, 1.0); + SETCOLF(btheme->tuserpref.back, 0.45, 0.45, 0.45, 1.0); } } diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index ff84542a7cd..ea1541a4e02 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1066,8 +1066,9 @@ static char *windowtype_pup(void) "|%l" "|Properties %x4" - "|User Preferences %x7" "|Outliner %x3" + "|User Preferences %x19" + "|Info%x7" "|%l" "|%l" diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c index 5c33b648947..041e6a09323 100644 --- a/source/blender/editors/space_api/spacetypes.c +++ b/source/blender/editors/space_api/spacetypes.c @@ -77,6 +77,7 @@ void ED_spacetypes_init(void) ED_spacetype_sequencer(); ED_spacetype_logic(); ED_spacetype_console(); + ED_spacetype_userpref(); // ... /* register operator types for screen and all spaces */ diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 6b89532cdaf..530500cfafa 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -311,7 +311,6 @@ static int buttons_context_path_brush(const bContext *C, ButsContextPath *path) ToolSettings *ts; Brush *br= NULL; PointerRNA *ptr= &path->ptr[path->len-1]; - const Object *obact = CTX_data_active_object(C); /* if we already have a (pinned) brush, we're done */ if(RNA_struct_is_a(ptr->type, &RNA_Brush)) { @@ -333,7 +332,7 @@ static int buttons_context_path_brush(const bContext *C, ButsContextPath *path) } } - /* no path to a world possible */ + /* no path to a brush possible */ return 0; } diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index e52efe8508d..057f35a2487 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -916,7 +916,7 @@ static int toolbox_invoke(bContext *C, wmOperator *op, wmEvent *event) uiPopupMenu *pup; uiLayout *layout; - RNA_pointer_create(&sc->id, &RNA_SpaceButtonsWindow, sbuts, &ptr); + RNA_pointer_create(&sc->id, &RNA_SpaceProperties, sbuts, &ptr); pup= uiPupMenuBegin(C, "Align", 0); layout= uiPupMenuLayout(pup); diff --git a/source/blender/editors/space_info/info_intern.h b/source/blender/editors/space_info/info_intern.h index 519364b58d9..070b627af07 100644 --- a/source/blender/editors/space_info/info_intern.h +++ b/source/blender/editors/space_info/info_intern.h @@ -32,9 +32,6 @@ struct wmOperatorType; -/* info_header.c */ -void info_header_buttons(const bContext *C, ARegion *ar); - void FILE_OT_pack_all(struct wmOperatorType *ot); void FILE_OT_unpack_all(struct wmOperatorType *ot); void FILE_OT_make_paths_relative(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_userpref/Makefile b/source/blender/editors/space_userpref/Makefile new file mode 100644 index 00000000000..be7206f51ce --- /dev/null +++ b/source/blender/editors/space_userpref/Makefile @@ -0,0 +1,55 @@ +# +# $Id$ +# +# ***** 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) 2007 Blender Foundation +# All rights reserved. +# +# The Original Code is: all of this file. +# +# Contributor(s): none yet. +# +# ***** END GPL LICENSE BLOCK ***** +# +# Makes module object directory and bounces make to subdirectories. + +LIBNAME = ed_userpref +DIR = $(OCGDIR)/blender/$(LIBNAME) + +include nan_compile.mk + +CFLAGS += $(LEVEL_1_C_WARNINGS) + +CPPFLAGS += -I$(NAN_GLEW)/include +CPPFLAGS += -I$(OPENGL_HEADERS) + +# not very neat.... +CPPFLAGS += -I../../windowmanager +CPPFLAGS += -I../../blenloader +CPPFLAGS += -I../../blenkernel +CPPFLAGS += -I../../blenlib +CPPFLAGS += -I../../makesdna +CPPFLAGS += -I../../makesrna +CPPFLAGS += -I../../imbuf +CPPFLAGS += -I../../python +CPPFLAGS += -I../../blenfont +CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include + +# own include + +CPPFLAGS += -I../include diff --git a/source/blender/editors/space_userpref/SConscript b/source/blender/editors/space_userpref/SConscript new file mode 100644 index 00000000000..1b808a5a7c0 --- /dev/null +++ b/source/blender/editors/space_userpref/SConscript @@ -0,0 +1,14 @@ +#!/usr/bin/python +Import ('env') + +sources = env.Glob('*.c') + +incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf ../../blenfont' +incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' + +defs = [] + +if env['WITH_BF_GAMEENGINE']: + defs.append('GAMEBLENDER=1') + +env.BlenderLib ( 'bf_editors_space_userpref', sources, Split(incs), defs, libtype=['core'], priority=[70] ) diff --git a/source/blender/editors/space_userpref/space_userpref.c b/source/blender/editors/space_userpref/space_userpref.c new file mode 100644 index 00000000000..8c9d723ce2c --- /dev/null +++ b/source/blender/editors/space_userpref/space_userpref.c @@ -0,0 +1,188 @@ +/** + * $Id: + * + * ***** 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) 2008 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include + +#include "DNA_space_types.h" +#include "DNA_screen_types.h" + +#include "MEM_guardedalloc.h" + +#include "BLI_blenlib.h" + +#include "BKE_context.h" +#include "BKE_screen.h" + +#include "ED_space_api.h" +#include "ED_screen.h" + +#include "BIF_gl.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "userpref_intern.h" // own include + +/* ******************** default callbacks for userpref space ***************** */ + +static SpaceLink *userpref_new(const bContext *C) +{ + ARegion *ar; + SpaceUserPref *spref; + + spref= MEM_callocN(sizeof(SpaceUserPref), "inituserpref"); + spref->spacetype= SPACE_USERPREF; + + /* header */ + ar= MEM_callocN(sizeof(ARegion), "header for userpref"); + + BLI_addtail(&spref->regionbase, ar); + ar->regiontype= RGN_TYPE_HEADER; + ar->alignment= RGN_ALIGN_BOTTOM; + + /* main area */ + ar= MEM_callocN(sizeof(ARegion), "main area for userpref"); + + BLI_addtail(&spref->regionbase, ar); + ar->regiontype= RGN_TYPE_WINDOW; + + return (SpaceLink *)spref; +} + +/* not spacelink itself */ +static void userpref_free(SpaceLink *sl) +{ +// SpaceUserPref *spref= (SpaceUserPref*) sl; + +} + + +/* spacetype; init callback */ +static void userpref_init(struct wmWindowManager *wm, ScrArea *sa) +{ + +} + +static SpaceLink *userpref_duplicate(SpaceLink *sl) +{ + SpaceUserPref *sprefn= MEM_dupallocN(sl); + + /* clear or remove stuff from old */ + + return (SpaceLink *)sprefn; +} + + + +/* add handlers, stuff you only do once or on area/region changes */ +static void userpref_main_area_init(wmWindowManager *wm, ARegion *ar) +{ + ED_region_panels_init(wm, ar); +} + +static void userpref_main_area_draw(const bContext *C, ARegion *ar) +{ + ED_region_panels(C, ar, 1, NULL, -1); +} + +void userpref_operatortypes(void) +{ +} + +void userpref_keymap(struct wmWindowManager *wm) +{ + +} + +/* add handlers, stuff you only do once or on area/region changes */ +static void userpref_header_area_init(wmWindowManager *wm, ARegion *ar) +{ + ED_region_header_init(ar); +} + +static void userpref_header_area_draw(const bContext *C, ARegion *ar) +{ + ED_region_header(C, ar); +} + +static void userpref_main_area_listener(ARegion *ar, wmNotifier *wmn) +{ + /* context changes */ +} + +static void userpref_header_listener(ARegion *ar, wmNotifier *wmn) +{ + /* context changes */ + switch(wmn->category) { + default: + break; + } + +} + +/* only called once, from space/spacetypes.c */ +void ED_spacetype_userpref(void) +{ + SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype userpref"); + ARegionType *art; + + st->spaceid= SPACE_USERPREF; + + st->new= userpref_new; + st->free= userpref_free; + st->init= userpref_init; + st->duplicate= userpref_duplicate; + st->operatortypes= userpref_operatortypes; + st->keymap= userpref_keymap; + + /* regions: main window */ + art= MEM_callocN(sizeof(ARegionType), "spacetype userpref region"); + art->regionid = RGN_TYPE_WINDOW; + art->init= userpref_main_area_init; + art->draw= userpref_main_area_draw; + art->listener= userpref_main_area_listener; + art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D; + + BLI_addhead(&st->regiontypes, art); + + /* regions: header */ + art= MEM_callocN(sizeof(ARegionType), "spacetype userpref region"); + art->regionid = RGN_TYPE_HEADER; + art->minsizey= HEADERY; + art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D; + art->listener= userpref_header_listener; + art->init= userpref_header_area_init; + art->draw= userpref_header_area_draw; + + BLI_addhead(&st->regiontypes, art); + + + BKE_spacetype_register(st); +} + diff --git a/source/blender/editors/space_userpref/userpref_intern.h b/source/blender/editors/space_userpref/userpref_intern.h new file mode 100644 index 00000000000..596c2675b01 --- /dev/null +++ b/source/blender/editors/space_userpref/userpref_intern.h @@ -0,0 +1,34 @@ +/** + * $Id: + * + * ***** 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) 2008 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ +#ifndef ED_USERPREF_INTERN_H +#define ED_USERPREF_INTERN_H + +/* internal exports only */ + +#endif /* ED_USERPREF_INTERN_H */ + diff --git a/source/blender/editors/space_userpref/userpref_ops.c b/source/blender/editors/space_userpref/userpref_ops.c new file mode 100644 index 00000000000..91a6651bd92 --- /dev/null +++ b/source/blender/editors/space_userpref/userpref_ops.c @@ -0,0 +1,33 @@ +/** + * $Id$ + * + * ***** 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) 2008 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include + +#include "userpref_intern.h" + diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 6eb5afbd6ac..37f28cfeaa6 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -508,6 +508,13 @@ typedef struct SpaceConsole { } SpaceConsole; +typedef struct SpaceUserPref { + SpaceLink *next, *prev; + ListBase regionbase; /* storage of regions for inactive spaces */ + int spacetype; + + int pad; +} SpaceUserPref; /* view3d Now in DNA_view3d_types.h */ @@ -861,7 +868,8 @@ enum { SPACE_NODE, SPACE_LOGIC, SPACE_CONSOLE, - SPACEICONMAX = SPACE_CONSOLE + SPACE_USERPREF, + SPACEICONMAX = SPACE_USERPREF }; #endif diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 019dad4eed5..c2314e1e3a2 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -260,6 +260,7 @@ typedef struct bTheme { ThemeSpace ttime; ThemeSpace tnode; ThemeSpace tlogic; + ThemeSpace tuserpref; /* 20 sets of bone colors for this theme */ ThemeWireColor tarm[20]; diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index d5680ac77ba..e08bc734242 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -252,6 +252,7 @@ extern StructRNA RNA_MarbleTexture; extern StructRNA RNA_MaskModifier; extern StructRNA RNA_Material; extern StructRNA RNA_MaterialHalo; +extern StructRNA RNA_MaterialPhysics; extern StructRNA RNA_MaterialRaytraceMirror; extern StructRNA RNA_MaterialRaytraceTransparency; extern StructRNA RNA_MaterialSlot; @@ -304,8 +305,11 @@ extern StructRNA RNA_OperatorStrokeElement; extern StructRNA RNA_OrController; extern StructRNA RNA_OutflowFluidSettings; extern StructRNA RNA_PackedFile; +extern StructRNA RNA_Paint; extern StructRNA RNA_Panel; extern StructRNA RNA_Particle; +extern StructRNA RNA_ParticleBrush; +extern StructRNA RNA_ParticleEdit; extern StructRNA RNA_ParticleFluidSettings; extern StructRNA RNA_ParticleHairKey; extern StructRNA RNA_ParticleInstanceModifier; @@ -328,6 +332,7 @@ extern StructRNA RNA_RadarSensor; extern StructRNA RNA_RandomSensor; extern StructRNA RNA_RaySensor; extern StructRNA RNA_Region; +extern StructRNA RNA_RenderEngine; extern StructRNA RNA_RenderLayer; extern StructRNA RNA_RenderPass; extern StructRNA RNA_RenderResult; @@ -378,6 +383,9 @@ extern StructRNA RNA_ShapeKeyPoint; extern StructRNA RNA_ShrinkwrapConstraint; extern StructRNA RNA_ShrinkwrapModifier; extern StructRNA RNA_SimpleDeformModifier; +extern StructRNA RNA_SmokeCollSettings; +extern StructRNA RNA_SmokeDomainSettings; +extern StructRNA RNA_SmokeFlowSettings; extern StructRNA RNA_SmokeModifier; extern StructRNA RNA_SmoothModifier; extern StructRNA RNA_SoftBodyModifier; @@ -386,18 +394,22 @@ extern StructRNA RNA_Sound; extern StructRNA RNA_SoundSequence; extern StructRNA RNA_Space; extern StructRNA RNA_Space3DView; -extern StructRNA RNA_SpaceButtonsWindow; extern StructRNA RNA_SpaceConsole; extern StructRNA RNA_SpaceDopeSheetEditor; extern StructRNA RNA_SpaceFileBrowser; extern StructRNA RNA_SpaceGraphEditor; extern StructRNA RNA_SpaceImageEditor; +extern StructRNA RNA_SpaceInfo; +extern StructRNA RNA_SpaceLogicEditor; extern StructRNA RNA_SpaceNLA; -extern StructRNA RNA_SpaceTimeline; +extern StructRNA RNA_SpaceNodeEditor; extern StructRNA RNA_SpaceOutliner; +extern StructRNA RNA_SpaceProperties; extern StructRNA RNA_SpaceSequenceEditor; extern StructRNA RNA_SpaceTextEditor; +extern StructRNA RNA_SpaceTimeline; extern StructRNA RNA_SpaceUVEditor; +extern StructRNA RNA_SpaceUserPreferences; extern StructRNA RNA_SpeedControlSequence; extern StructRNA RNA_SpotLamp; extern StructRNA RNA_StretchToConstraint; @@ -443,16 +455,17 @@ extern StructRNA RNA_TextureSlot; extern StructRNA RNA_Theme; extern StructRNA RNA_ThemeAudioWindow; extern StructRNA RNA_ThemeBoneColorSet; -extern StructRNA RNA_ThemeButtonsWindow; extern StructRNA RNA_ThemeDopeSheet; extern StructRNA RNA_ThemeFileBrowser; extern StructRNA RNA_ThemeFontStyle; extern StructRNA RNA_ThemeGraphEditor; extern StructRNA RNA_ThemeImageEditor; +extern StructRNA RNA_ThemeInfo; extern StructRNA RNA_ThemeLogicEditor; extern StructRNA RNA_ThemeNLAEditor; extern StructRNA RNA_ThemeNodeEditor; extern StructRNA RNA_ThemeOutliner; +extern StructRNA RNA_ThemeProperties; extern StructRNA RNA_ThemeSequenceEditor; extern StructRNA RNA_ThemeStyle; extern StructRNA RNA_ThemeTextEditor; @@ -474,17 +487,16 @@ extern StructRNA RNA_UVProjectModifier; extern StructRNA RNA_UnitSettings; extern StructRNA RNA_UnknownType; extern StructRNA RNA_UserPreferences; -extern StructRNA RNA_UserPreferencesAutosave; extern StructRNA RNA_UserPreferencesEdit; extern StructRNA RNA_UserPreferencesFilePaths; extern StructRNA RNA_UserPreferencesLanguage; extern StructRNA RNA_UserPreferencesSystem; extern StructRNA RNA_UserPreferencesView; extern StructRNA RNA_UserSolidLight; -extern StructRNA RNA_VertexPaint; extern StructRNA RNA_VectorFont; extern StructRNA RNA_VertexGroup; extern StructRNA RNA_VertexGroupElement; +extern StructRNA RNA_VertexPaint; extern StructRNA RNA_VoronoiTexture; extern StructRNA RNA_WaveModifier; extern StructRNA RNA_Window; diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 991b50afa5a..e5332d32f13 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -49,7 +49,7 @@ EnumPropertyItem space_type_items[] = { {SPACE_BUTS, "PROPERTIES", 0, "Properties", ""}, {SPACE_FILE, "FILE_BROWSER", 0, "File Browser", ""}, {SPACE_IMAGE, "IMAGE_EDITOR", 0, "Image Editor", ""}, - {SPACE_INFO, "USER_PREFERENCES", 0, "User Preferences", ""}, + {SPACE_INFO, "INFO", 0, "Info", ""}, {SPACE_SEQ, "SEQUENCE_EDITOR", 0, "Sequence Editor", ""}, {SPACE_TEXT, "TEXT_EDITOR", 0, "Text Editor", ""}, //{SPACE_IMASEL, "IMAGE_BROWSER", 0, "Image Browser", ""}, @@ -61,6 +61,7 @@ EnumPropertyItem space_type_items[] = { {SPACE_NODE, "NODE_EDITOR", 0, "Node Editor", ""}, {SPACE_LOGIC, "LOGIC_EDITOR", 0, "Logic Editor", ""}, {SPACE_CONSOLE, "CONSOLE", 0, "Console", ""}, + {SPACE_USERPREF, "USER_PREFERENCES", 0, "User Preferences", ""}, {0, NULL, 0, NULL, NULL}}; #define DC_RGB {0, "COLOR", ICON_IMAGE_RGB, "Color", "Draw image with RGB colors."} @@ -101,13 +102,13 @@ static StructRNA* rna_Space_refine(struct PointerRNA *ptr) case SPACE_OUTLINER: return &RNA_SpaceOutliner; case SPACE_BUTS: - return &RNA_SpaceButtonsWindow; + return &RNA_SpaceProperties; case SPACE_FILE: return &RNA_SpaceFileBrowser; case SPACE_IMAGE: return &RNA_SpaceImageEditor; - /*case SPACE_INFO: - return &RNA_SpaceUserPreferences;*/ + case SPACE_INFO: + return &RNA_SpaceInfo; case SPACE_SEQ: return &RNA_SpaceSequenceEditor; case SPACE_TEXT: @@ -124,12 +125,14 @@ static StructRNA* rna_Space_refine(struct PointerRNA *ptr) return &RNA_SpaceScriptsWindow;*/ case SPACE_TIME: return &RNA_SpaceTimeline; - /*case SPACE_NODE: + case SPACE_NODE: return &RNA_SpaceNodeEditor; case SPACE_LOGIC: - return &RNA_SpaceLogicEditor;*/ + return &RNA_SpaceLogicEditor; case SPACE_CONSOLE: return &RNA_SpaceConsole; + case SPACE_USERPREF: + return &RNA_SpaceUserPreferences; default: return &RNA_Space; } @@ -230,9 +233,9 @@ void rna_SpaceFileBrowser_params_set(PointerRNA *ptr, PointerRNA value) sfile->params= value.data; } -/* Space Buttons */ +/* Space Properties */ -StructRNA *rna_SpaceButtonsWindow_pin_id_typef(PointerRNA *ptr) +StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr) { SpaceButs *sbuts= (SpaceButs*)(ptr->data); @@ -242,7 +245,7 @@ StructRNA *rna_SpaceButtonsWindow_pin_id_typef(PointerRNA *ptr) return &RNA_ID; } -void rna_SpaceButtonsWindow_align_set(PointerRNA *ptr, int value) +void rna_SpaceProperties_align_set(PointerRNA *ptr, int value) { SpaceButs *sbuts= (SpaceButs*)(ptr->data); @@ -718,9 +721,9 @@ static void rna_def_space_buttons(BlenderRNA *brna) {BUT_VERTICAL, "VERTICAL", 0, "Vertical", ""}, {0, NULL, 0, NULL, NULL}}; - srna= RNA_def_struct(brna, "SpaceButtonsWindow", "Space"); + srna= RNA_def_struct(brna, "SpaceProperties", "Space"); RNA_def_struct_sdna(srna, "SpaceButs"); - RNA_def_struct_ui_text(srna, "Buttons Space", "Buttons Window space data"); + RNA_def_struct_ui_text(srna, "Properties Space", "Properties space data"); prop= RNA_def_property(srna, "context", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "mainb"); @@ -731,7 +734,7 @@ static void rna_def_space_buttons(BlenderRNA *brna) prop= RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "align"); RNA_def_property_enum_items(prop, align_items); - RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceButtonsWindow_align_set", NULL); + RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_align_set", NULL); RNA_def_property_ui_text(prop, "Align", "Arrangement of the panels."); RNA_def_property_update(prop, NC_WINDOW, NULL); @@ -744,7 +747,7 @@ static void rna_def_space_buttons(BlenderRNA *brna) prop= RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "pinid"); RNA_def_property_struct_type(prop, "ID"); - RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_SpaceButtonsWindow_pin_id_typef"); + RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_SpaceProperties_pin_id_typef"); RNA_def_property_flag(prop, PROP_EDITABLE); } @@ -1377,7 +1380,42 @@ static void rna_def_space_filebrowser(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "params"); RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceFileBrowser_params_set", NULL); RNA_def_property_ui_text(prop, "Filebrowser Parameter", "Parameters and Settings for the Filebrowser."); +} +static void rna_def_space_info(BlenderRNA *brna) +{ + StructRNA *srna; + + srna= RNA_def_struct(brna, "SpaceInfo", "Space"); + RNA_def_struct_sdna(srna, "SpaceInfo"); + RNA_def_struct_ui_text(srna, "Space Info", "Info space data."); +} + +static void rna_def_space_userpref(BlenderRNA *brna) +{ + StructRNA *srna; + + srna= RNA_def_struct(brna, "SpaceUserPreferences", "Space"); + RNA_def_struct_sdna(srna, "SpaceUserPref"); + RNA_def_struct_ui_text(srna, "Space User Preferences", "User preferences space data."); +} + +static void rna_def_space_node(BlenderRNA *brna) +{ + StructRNA *srna; + + srna= RNA_def_struct(brna, "SpaceNodeEditor", "Space"); + RNA_def_struct_sdna(srna, "SpaceNode"); + RNA_def_struct_ui_text(srna, "Space Node Editor", "Node editor space data."); +} + +static void rna_def_space_logic(BlenderRNA *brna) +{ + StructRNA *srna; + + srna= RNA_def_struct(brna, "SpaceLogicEditor", "Space"); + RNA_def_struct_sdna(srna, "SpaceLogic"); + RNA_def_struct_ui_text(srna, "Space Logic Editor", "Logic editor space data."); } void RNA_def_space(BlenderRNA *brna) @@ -1398,6 +1436,10 @@ void RNA_def_space(BlenderRNA *brna) rna_def_space_time(brna); rna_def_space_console(brna); rna_def_console_line(brna); + rna_def_space_info(brna); + rna_def_space_userpref(brna); + rna_def_space_node(brna); + rna_def_space_logic(brna); } #endif diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 836e6a2fda7..d1245528100 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -690,7 +690,7 @@ static void rna_def_userdef_theme_space_graph(BlenderRNA *brna) srna= RNA_def_struct(brna, "ThemeGraphEditor", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); - RNA_def_struct_ui_text(srna, "Theme Graph Editor", "Theme settings for the Ipo Editor."); + RNA_def_struct_ui_text(srna, "Theme Graph Editor", "Theme settings for the graph editor."); rna_def_userdef_theme_spaces_main(srna, SPACE_IPO); @@ -827,19 +827,33 @@ static void rna_def_userdef_theme_space_outliner(BlenderRNA *brna) rna_def_userdef_theme_spaces_main(srna, SPACE_OUTLINER); } +static void rna_def_userdef_theme_space_userpref(BlenderRNA *brna) +{ + StructRNA *srna; + + /* space_userpref */ + + srna= RNA_def_struct(brna, "ThemeUserPreferences", NULL); + RNA_def_struct_sdna(srna, "ThemeSpace"); + RNA_def_struct_ui_text(srna, "Theme User Preferences", "Theme settings for the User Preferences."); + + rna_def_userdef_theme_spaces_main(srna, SPACE_USERPREF); +} + static void rna_def_userdef_theme_space_info(BlenderRNA *brna) { StructRNA *srna; /* space_info */ - srna= RNA_def_struct(brna, "ThemeUserPreferences", NULL); + srna= RNA_def_struct(brna, "ThemeInfo", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); - RNA_def_struct_ui_text(srna, "Theme User Preferences", "Theme settings for the User Preferences."); + RNA_def_struct_ui_text(srna, "Theme Info", "Theme settings for Info."); rna_def_userdef_theme_spaces_main(srna, SPACE_INFO); } + static void rna_def_userdef_theme_space_text(BlenderRNA *brna) { StructRNA *srna; @@ -997,7 +1011,7 @@ static void rna_def_userdef_theme_space_buts(BlenderRNA *brna) /* space_buts */ - srna= RNA_def_struct(brna, "ThemeButtonsWindow", NULL); + srna= RNA_def_struct(brna, "ThemeProperties", NULL); RNA_def_struct_sdna(srna, "ThemeSpace"); RNA_def_struct_ui_text(srna, "Theme Properties", "Theme settings for the Properties."); @@ -1402,7 +1416,7 @@ static void rna_def_userdef_themes(BlenderRNA *brna) prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "tbuts"); - RNA_def_property_struct_type(prop, "ThemeButtonsWindow"); + RNA_def_property_struct_type(prop, "ThemeProperties"); RNA_def_property_ui_text(prop, "Properties", ""); prop= RNA_def_property(srna, "text_editor", PROP_POINTER, PROP_NEVER_NULL); @@ -1430,8 +1444,13 @@ static void rna_def_userdef_themes(BlenderRNA *brna) RNA_def_property_struct_type(prop, "ThemeOutliner"); RNA_def_property_ui_text(prop, "Outliner", ""); - prop= RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NEVER_NULL); + prop= RNA_def_property(srna, "info", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "tinfo"); + RNA_def_property_struct_type(prop, "ThemeInfo"); + RNA_def_property_ui_text(prop, "Info", ""); + + prop= RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NEVER_NULL); + RNA_def_property_pointer_sdna(prop, NULL, "tuserpref"); RNA_def_property_struct_type(prop, "ThemeUserPreferences"); RNA_def_property_ui_text(prop, "User Preferences", ""); @@ -1460,6 +1479,7 @@ static void rna_def_userdef_dothemes(BlenderRNA *brna) rna_def_userdef_theme_space_node(brna); rna_def_userdef_theme_space_outliner(brna); rna_def_userdef_theme_space_info(brna); + rna_def_userdef_theme_space_userpref(brna); rna_def_userdef_theme_space_sound(brna); rna_def_userdef_theme_space_logic(brna); rna_def_userdef_theme_colorset(brna); diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index a6fbb0515bc..d6bde9a468c 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -446,14 +446,14 @@ void WM_window_open_temp(bContext *C, rcti *position, int type) ED_area_newspace(C, sa, SPACE_IMAGE); } else { - ED_area_newspace(C, sa, SPACE_INFO); + ED_area_newspace(C, sa, SPACE_USERPREF); } ED_screen_set(C, win->screen); if(sa->spacetype==SPACE_IMAGE) GHOST_SetTitle(win->ghostwin, "Blender Render"); - else if(ELEM(sa->spacetype, SPACE_OUTLINER, SPACE_INFO)) + else if(ELEM(sa->spacetype, SPACE_OUTLINER, SPACE_USERPREF)) GHOST_SetTitle(win->ghostwin, "Blender User Preferences"); else if(sa->spacetype==SPACE_FILE) GHOST_SetTitle(win->ghostwin, "Blender File View"); From 3803a3c5a7c063718c6cdbdb025143ff93b2d5bb Mon Sep 17 00:00:00 2001 From: Robin Allen Date: Tue, 18 Aug 2009 14:31:13 +0000 Subject: [PATCH 120/577] Fixed some redraw problems with texture nodes. --- source/blender/blenkernel/intern/node.c | 6 ----- source/blender/editors/space_node/node_draw.c | 6 ++--- source/blender/editors/space_node/node_edit.c | 6 ++--- .../blender/editors/space_node/space_node.c | 11 ++++++-- .../nodes/intern/TEX_nodes/TEX_output.c | 25 ++++++++++++++++--- source/blender/nodes/intern/TEX_util.c | 23 ----------------- 6 files changed, 36 insertions(+), 41 deletions(-) diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 836f4281eb9..bd6919dc115 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -950,9 +950,6 @@ bNode *nodeAddNodeType(bNodeTree *ntree, int type, bNodeTree *ngroup, ID *id) if(ntype->initfunc!=NULL) ntype->initfunc(node); - if(type==TEX_NODE_OUTPUT) - ntreeTexAssignIndex(ntree, node); - nodeAddSockets(node, ntype); return node; @@ -1021,9 +1018,6 @@ bNode *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node, int internal) nnode->new_node= NULL; nnode->preview= NULL; - if(node->type==TEX_NODE_OUTPUT) - ntreeTexAssignIndex(ntree, node); - return nnode; } diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index 70e2167c1e4..f3df7a29c2e 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -607,9 +607,9 @@ static void do_node_internal_buttons(bContext *C, void *node_v, int event) } WM_event_add_notifier(C, NC_SCENE|ND_NODES, CTX_data_scene(C)); } - - // else if(snode->treetype==NTREE_TEXTURE) - // texture_node_event(snode, val); + else if(snode->treetype==NTREE_TEXTURE) { + WM_event_add_notifier(C, NC_TEXTURE|ND_NODES, snode->id); + } } } diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index d66cbb55baa..20abcdf9f97 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -213,10 +213,8 @@ void snode_handle_recalc(bContext *C, SpaceNode *snode) WM_event_add_notifier(C, NC_MATERIAL|ND_NODES, snode->id); else if(snode->treetype==NTREE_COMPOSIT) WM_event_add_notifier(C, NC_SCENE|ND_NODES, snode->id); - else if(snode->treetype==NTREE_TEXTURE) { - // ntreeTexUpdatePreviews(snode->nodetree); /* XXX texture nodes should follow shader node methods (ton) */ - // XXX BIF_preview_changed(ID_TE); - } + else if(snode->treetype==NTREE_TEXTURE) + WM_event_add_notifier(C, NC_TEXTURE|ND_NODES, snode->id); } #if 0 diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index 25e1b368ccb..5db9d7331b8 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -152,12 +152,16 @@ static void node_area_listener(ScrArea *sa, wmNotifier *wmn) if(wmn->data==ND_FILEREAD) ED_area_tag_refresh(sa); break; - + + /* future: add ID checks? */ case NC_MATERIAL: - /* future: add ID check? */ if(wmn->data==ND_SHADING) ED_area_tag_refresh(sa); break; + case NC_TEXTURE: + if(wmn->data==ND_NODES) + ED_area_tag_refresh(sa); + break; } } @@ -280,6 +284,9 @@ static void node_region_listener(ARegion *ar, wmNotifier *wmn) case NC_MATERIAL: ED_region_tag_redraw(ar); break; + case NC_TEXTURE: + ED_region_tag_redraw(ar); + break; } } diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_output.c b/source/blender/nodes/intern/TEX_nodes/TEX_output.c index 96ee5d74f66..7ce5ec88c48 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_output.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_output.c @@ -152,6 +152,26 @@ static void unique_name(bNode *node) } } +static void assign_index(struct bNode *node) +{ + bNode *tnode; + int index = 1; + + tnode = node; + while(tnode->prev) + tnode = tnode->prev; + + check_index: + for(; tnode; tnode= tnode->next) + if(tnode->type == TEX_NODE_OUTPUT && tnode != node) + if(tnode->custom1 == index) { + index ++; + goto check_index; + } + + node->custom1 = index; +} + static void init(bNode *node) { TexNodeOutput *tno = MEM_callocN(sizeof(TexNodeOutput), "TEX_output"); @@ -159,17 +179,16 @@ static void init(bNode *node) strcpy(tno->name, "Default"); unique_name(node); - ntreeTexAssignIndex(0, node); + assign_index(node); } static void copy(bNode *orig, bNode *new) { node_copy_standard_storage(orig, new); unique_name(new); - ntreeTexAssignIndex(0, new); + assign_index(new); } - bNodeType tex_node_output= { /* *next,*prev */ NULL, NULL, /* type code */ TEX_NODE_OUTPUT, diff --git a/source/blender/nodes/intern/TEX_util.c b/source/blender/nodes/intern/TEX_util.c index 36182d2498d..0bb9d887ae3 100644 --- a/source/blender/nodes/intern/TEX_util.c +++ b/source/blender/nodes/intern/TEX_util.c @@ -297,26 +297,3 @@ char* ntreeTexOutputMenu(bNodeTree *ntree) return str; } -void ntreeTexAssignIndex(struct bNodeTree *ntree, struct bNode *node) -{ - bNode *tnode; - int index = 1; - - if(ntree) - tnode = ntree->nodes.first; - else { - tnode = node; - while(tnode->prev) tnode = tnode->prev; - } - - check_index: - for(; tnode; tnode= tnode->next) - if(tnode->type == TEX_NODE_OUTPUT && tnode != node) - if(tnode->custom1 == index) { - index ++; - goto check_index; - } - - node->custom1 = index; -} - From ede954b93821e3eda5e30ce362ce8472ee17368d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 18 Aug 2009 15:20:29 +0000 Subject: [PATCH 121/577] compile time option to override C++'s new/delete to use guardedalloc, useful for debugging. shows memory leaks very quickly. currently cmake only - WITH_CXX_GUARDEDALLOC --- CMakeLists.txt | 6 +++++ blenderplayer/CMakeLists.txt | 4 +++ intern/guardedalloc/CMakeLists.txt | 7 ++++- intern/guardedalloc/cpp/mallocn.cpp | 41 +++++++++++++++++++++++++++++ source/creator/CMakeLists.txt | 4 +++ 5 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 intern/guardedalloc/cpp/mallocn.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 16110e76607..2f12d342726 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,7 @@ OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OPTION(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF) OPTION(WITH_FFTW3 "Enable FFTW3 support" OFF) OPTION(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" OFF) +OPTION(WITH_CXX_GUARDEDALLOC "" OFF) OPTION(WITH_INSTALL "Install accompanying scripts and language files needed to run blender" ON) IF(NOT WITH_GAMEENGINE AND WITH_PLAYER) @@ -514,6 +515,11 @@ INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ${C_WARNINGS}") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ${CXX_WARNINGS}") +# better not define flags here but this is a debugging option thats off by default. +IF(WITH_CXX_GUARDEDALLOC) + SET(CMAKE_CXX_FLAGS " -DWITH_CXX_GUARDEDALLOC -I${CMAKE_SOURCE_DIR}/intern/guardedalloc ${CMAKE_CXX_FLAGS}") +ENDIF(WITH_CXX_GUARDEDALLOC) + #----------------------------------------------------------------------------- # Libraries FILE(WRITE ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt "") diff --git a/blenderplayer/CMakeLists.txt b/blenderplayer/CMakeLists.txt index 4539701a3ae..77bc059a6a0 100644 --- a/blenderplayer/CMakeLists.txt +++ b/blenderplayer/CMakeLists.txt @@ -110,6 +110,10 @@ IF(UNIX) extern_glew ) + IF(WITH_CXX_GUARDEDALLOC) + SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_guardedalloc_cpp) + ENDIF(WITH_CXX_GUARDEDALLOC) + FOREACH(SORTLIB ${BLENDER_SORTED_LIBS}) SET(REMLIB ${SORTLIB}) FOREACH(SEARCHLIB ${BLENDER_LINK_LIBS}) diff --git a/intern/guardedalloc/CMakeLists.txt b/intern/guardedalloc/CMakeLists.txt index af64fb99d58..b29837fac7d 100644 --- a/intern/guardedalloc/CMakeLists.txt +++ b/intern/guardedalloc/CMakeLists.txt @@ -29,4 +29,9 @@ SET(INC .) FILE(GLOB SRC intern/*.c) BLENDERLIB(bf_guardedalloc "${SRC}" "${INC}") -#, libtype=['intern', 'player'], priority = [10, 175] ) + +# Override C++ alloc optional +IF(WITH_CXX_GUARDEDALLOC) + FILE(GLOB SRC cpp/*.cpp) + BLENDERLIB(bf_guardedalloc_cpp "${SRC}" "${INC}") +ENDIF(WITH_CXX_GUARDEDALLOC) diff --git a/intern/guardedalloc/cpp/mallocn.cpp b/intern/guardedalloc/cpp/mallocn.cpp new file mode 100644 index 00000000000..bb2839c7986 --- /dev/null +++ b/intern/guardedalloc/cpp/mallocn.cpp @@ -0,0 +1,41 @@ +/** + * $Id: mallocn.c 21060 2009-06-21 16:37:13Z campbellbarton $ + * ***** 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. + * + * Contributor(s): Campbell Barton + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include "../MEM_guardedalloc.h" + +void* operator new (size_t size) +{ + return MEM_mallocN(size, "c++/anonymous"); +} + +/* not default but can be used when needing to set a string */ +void* operator new (size_t size, const char *str) +{ + return MEM_mallocN(size, str); +} + +void operator delete (void *p) +{ + MEM_freeN(p); +} diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index a0ebf627e2c..a9368e021cd 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -348,6 +348,10 @@ IF(UNIX) bf_audaspace ) + IF(WITH_CXX_GUARDEDALLOC) + SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_guardedalloc_cpp) + ENDIF(WITH_CXX_GUARDEDALLOC) + FOREACH(SORTLIB ${BLENDER_SORTED_LIBS}) SET(REMLIB ${SORTLIB}) FOREACH(SEARCHLIB ${BLENDER_LINK_LIBS}) From 368262461641f23239c1a7bd2e6fa9d5057902e7 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 18 Aug 2009 15:27:48 +0000 Subject: [PATCH 122/577] 2.5: Game Engine * Added Shading and Performance panels in the scene buttons, containing the options previously in the 2.4x game menu. * Added show framerate/debug/physics/warnings back in game menu. * Moved these settings from G.fileflags to scene GameData. * Enabled Display Lists by default. * Some other small game scene button tweaks. --- release/ui/buttons_game.py | 52 +++++++++++- release/ui/space_info.py | 9 ++ source/blender/blenkernel/BKE_blender.h | 2 +- source/blender/blenkernel/BKE_global.h | 32 ++++---- source/blender/blenkernel/intern/scene.c | 3 + source/blender/blenloader/intern/readfile.c | 39 +++++++++ source/blender/blenloader/intern/readfile.h | 1 + .../blender/editors/space_view3d/drawobject.c | 3 +- .../editors/space_view3d/view3d_draw.c | 8 +- source/blender/gpu/intern/gpu_material.c | 38 ++++----- source/blender/makesdna/DNA_scene_types.h | 22 ++++- source/blender/makesrna/intern/rna_scene.c | 82 ++++++++++++++++++- .../BlenderRoutines/BL_KetsjiEmbedStart.cpp | 6 +- .../GamePlayer/ghost/GPG_Application.cpp | 13 +-- source/gameengine/Ketsji/KX_PythonInit.cpp | 46 +++++------ 15 files changed, 273 insertions(+), 83 deletions(-) diff --git a/release/ui/buttons_game.py b/release/ui/buttons_game.py index 3158536585e..7334b453e91 100644 --- a/release/ui/buttons_game.py +++ b/release/ui/buttons_game.py @@ -192,7 +192,7 @@ class SCENE_PT_game(SceneButtonsPanel): row.itemL() class SCENE_PT_game_player(SceneButtonsPanel): - __label__ = "Player" + __label__ = "Standalone Player" def draw(self, context): layout = self.layout @@ -219,8 +219,8 @@ class SCENE_PT_game_player(SceneButtonsPanel): col = layout.column() col.itemL(text="Framing:") col.row().itemR(gs, "framing_type", expand=True) - sub = col.column() - sub.itemR(gs, "framing_color", text="") + if gs.framing_type == 'LETTERBOX': + col.itemR(gs, "framing_color", text="") class SCENE_PT_game_stereo(SceneButtonsPanel): __label__ = "Stereo" @@ -271,9 +271,55 @@ class SCENE_PT_game_stereo(SceneButtonsPanel): layout.itemR(gs, "dome_text") +class SCENE_PT_game_shading(SceneButtonsPanel): + __label__ = "Shading" + + def draw(self, context): + layout = self.layout + + gs = context.scene.game_data + layout.itemR(gs, "material_mode", expand=True) + + if gs.material_mode == 'GLSL': + split = layout.split() + + col = split.column() + col.itemR(gs, "glsl_lights", text="Lights") + col.itemR(gs, "glsl_shaders", text="Shaders") + col.itemR(gs, "glsl_shadows", text="Shadows") + + col = split.column() + col.itemR(gs, "glsl_ramps", text="Ramps") + col.itemR(gs, "glsl_nodes", text="Nodes") + col.itemR(gs, "glsl_extra_textures", text="Extra Textures") + +class SCENE_PT_game_performance(SceneButtonsPanel): + __label__ = "Performance" + + def draw(self, context): + layout = self.layout + + gs = context.scene.game_data + + split = layout.split() + + col = split.column() + col.itemL(text="Show:") + col.itemR(gs, "show_debug_properties", text="Debug Properties") + col.itemR(gs, "show_framerate_profile", text="Framerate and Profile") + col.itemR(gs, "show_physics_visualization", text="Physics Visualization") + col.itemR(gs, "deprecation_warnings") + + col = split.column() + col.itemL(text="Render:") + col.itemR(gs, "all_frames") + col.itemR(gs, "display_lists") + bpy.types.register(SCENE_PT_game) bpy.types.register(SCENE_PT_game_player) bpy.types.register(SCENE_PT_game_stereo) +bpy.types.register(SCENE_PT_game_shading) +bpy.types.register(SCENE_PT_game_performance) class WorldButtonsPanel(bpy.types.Panel): __space_type__ = "PROPERTIES" diff --git a/release/ui/space_info.py b/release/ui/space_info.py index 12005ea3ecb..e0b5c770f29 100644 --- a/release/ui/space_info.py +++ b/release/ui/space_info.py @@ -135,8 +135,17 @@ class INFO_MT_game(bpy.types.Menu): def draw(self, context): layout = self.layout + gs = context.scene.game_data + layout.itemO("view3d.game_start") + layout.itemS() + + layout.itemR(gs, "show_debug_properties") + layout.itemR(gs, "show_framerate_profile") + layout.itemR(gs, "show_physics_visualization") + layout.itemR(gs, "deprecation_warnings") + class INFO_MT_render(bpy.types.Menu): __space_type__ = "INFO" __label__ = "Render" diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 4fe1eec55c0..42ee11587a7 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -43,7 +43,7 @@ struct bContext; struct ReportList; #define BLENDER_VERSION 250 -#define BLENDER_SUBVERSION 1 +#define BLENDER_SUBVERSION 2 #define BLENDER_MINVERSION 250 #define BLENDER_MINSUBVERSION 0 diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h index 7ce616c37c9..6323258ff43 100644 --- a/source/blender/blenkernel/BKE_global.h +++ b/source/blender/blenkernel/BKE_global.h @@ -126,26 +126,26 @@ typedef struct Global { #define G_AUTOPACK (1 << 0) #define G_FILE_COMPRESS (1 << 1) #define G_FILE_AUTOPLAY (1 << 2) -#define G_FILE_ENABLE_ALL_FRAMES (1 << 3) -#define G_FILE_SHOW_DEBUG_PROPS (1 << 4) -#define G_FILE_SHOW_FRAMERATE (1 << 5) -#define G_FILE_SHOW_PROFILE (1 << 6) +#define G_FILE_ENABLE_ALL_FRAMES (1 << 3) /* deprecated */ +#define G_FILE_SHOW_DEBUG_PROPS (1 << 4) /* deprecated */ +#define G_FILE_SHOW_FRAMERATE (1 << 5) /* deprecated */ +#define G_FILE_SHOW_PROFILE (1 << 6) /* deprecated */ #define G_FILE_LOCK (1 << 7) #define G_FILE_SIGN (1 << 8) #define G_FIle_PUBLISH (1 << 9) #define G_FILE_NO_UI (1 << 10) -#define G_FILE_GAME_TO_IPO (1 << 11) -#define G_FILE_GAME_MAT (1 << 12) -#define G_FILE_DISPLAY_LISTS (1 << 13) -#define G_FILE_SHOW_PHYSICS (1 << 14) -#define G_FILE_GAME_MAT_GLSL (1 << 15) -#define G_FILE_GLSL_NO_LIGHTS (1 << 16) -#define G_FILE_GLSL_NO_SHADERS (1 << 17) -#define G_FILE_GLSL_NO_SHADOWS (1 << 18) -#define G_FILE_GLSL_NO_RAMPS (1 << 19) -#define G_FILE_GLSL_NO_NODES (1 << 20) -#define G_FILE_GLSL_NO_EXTRA_TEX (1 << 21) -#define G_FILE_IGNORE_DEPRECATION_WARNINGS (1 << 22) +#define G_FILE_GAME_TO_IPO (1 << 11) /* deprecated */ +#define G_FILE_GAME_MAT (1 << 12) /* deprecated */ +#define G_FILE_DISPLAY_LISTS (1 << 13) /* deprecated */ +#define G_FILE_SHOW_PHYSICS (1 << 14) /* deprecated */ +#define G_FILE_GAME_MAT_GLSL (1 << 15) /* deprecated */ +#define G_FILE_GLSL_NO_LIGHTS (1 << 16) /* deprecated */ +#define G_FILE_GLSL_NO_SHADERS (1 << 17) /* deprecated */ +#define G_FILE_GLSL_NO_SHADOWS (1 << 18) /* deprecated */ +#define G_FILE_GLSL_NO_RAMPS (1 << 19) /* deprecated */ +#define G_FILE_GLSL_NO_NODES (1 << 20) /* deprecated */ +#define G_FILE_GLSL_NO_EXTRA_TEX (1 << 21) /* deprecated */ +#define G_FILE_IGNORE_DEPRECATION_WARNINGS (1 << 22) /* deprecated */ /* G.windowstate */ #define G_WINDOWSTATE_USERDEF 0 diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 8488d7ab247..2a8fd765386 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -442,6 +442,9 @@ Scene *add_scene(char *name) sce->gm.physubstep = 1; sce->gm.maxphystep = 5; + sce->gm.flag = GAME_DISPLAY_LISTS; + sce->gm.matmode = GAME_MAT_MULTITEX; + return sce; } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 61f6cb8b44c..779a898bd6a 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5345,6 +5345,9 @@ static BHead *read_global(BlendFileData *bfd, FileData *fd, BHead *bhead) bfd->curscene= fg->curscene; MEM_freeN(fg); + + fd->globalf= bfd->globalf; + fd->fileflags= bfd->fileflags; return blo_nextbhead(fd, bhead); } @@ -9560,6 +9563,42 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } + if (main->versionfile < 250 || (main->versionfile == 250 && main->subversionfile < 2)) { + Scene *sce; + + for(sce = main->scene.first; sce; sce = sce->id.next) { + if(fd->fileflags & G_FILE_ENABLE_ALL_FRAMES) + sce->gm.flag |= GAME_ENABLE_ALL_FRAMES; + if(fd->fileflags & G_FILE_SHOW_DEBUG_PROPS) + sce->gm.flag |= GAME_SHOW_DEBUG_PROPS; + if(fd->fileflags & G_FILE_SHOW_FRAMERATE) + sce->gm.flag |= GAME_SHOW_FRAMERATE; + if(fd->fileflags & G_FILE_SHOW_PHYSICS) + sce->gm.flag |= GAME_SHOW_PHYSICS; + if(fd->fileflags & G_FILE_GLSL_NO_SHADOWS) + sce->gm.flag |= GAME_GLSL_NO_SHADOWS; + if(fd->fileflags & G_FILE_GLSL_NO_SHADERS) + sce->gm.flag |= GAME_GLSL_NO_SHADERS; + if(fd->fileflags & G_FILE_GLSL_NO_RAMPS) + sce->gm.flag |= GAME_GLSL_NO_RAMPS; + if(fd->fileflags & G_FILE_GLSL_NO_NODES) + sce->gm.flag |= GAME_GLSL_NO_NODES; + if(fd->fileflags & G_FILE_GLSL_NO_EXTRA_TEX) + sce->gm.flag |= GAME_GLSL_NO_EXTRA_TEX; + if(fd->fileflags & G_FILE_IGNORE_DEPRECATION_WARNINGS) + sce->gm.flag |= GAME_IGNORE_DEPRECATION_WARNINGS; + + if(fd->fileflags & G_FILE_GAME_MAT_GLSL) + sce->gm.matmode= GAME_MAT_GLSL; + else if(fd->fileflags & G_FILE_GAME_MAT) + sce->gm.matmode= GAME_MAT_MULTITEX; + else + sce->gm.matmode= GAME_MAT_TEXFACE; + + sce->gm.flag |= GAME_DISPLAY_LISTS; + } + } + /* put 2.50 compatibility code here until next subversion bump */ { } diff --git a/source/blender/blenloader/intern/readfile.h b/source/blender/blenloader/intern/readfile.h index f0e00b75b67..e39fefa8205 100644 --- a/source/blender/blenloader/intern/readfile.h +++ b/source/blender/blenloader/intern/readfile.h @@ -69,6 +69,7 @@ typedef struct FileData { int fileversion; int id_name_offs; /* used to retrieve ID names from (bhead+1) */ + int globalf, fileflags; /* for do_versions patching */ struct OldNewMap *datamap; struct OldNewMap *globmap; diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index cb07796ed67..466b55ba862 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -216,8 +216,7 @@ int draw_glsl_material(Scene *scene, Object *ob, View3D *v3d, int dt) if(ob==OBACT && (ob && ob->mode & OB_MODE_WEIGHT_PAINT)) return 0; - return ((G.fileflags & G_FILE_GAME_MAT) && - (G.fileflags & G_FILE_GAME_MAT_GLSL) && (dt >= OB_SHADED)); + return (scene->gm.matmode == GAME_MAT_GLSL) && (dt >= OB_SHADED); } static int check_material_alpha(Base *base, Mesh *me, int glsl) diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 01bc330267d..3140ae76d4b 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1855,7 +1855,7 @@ static void gpu_update_lamps_shadows(Scene *scene, View3D *v3d) /* *********************** customdata **************** */ /* goes over all modes and view3d settings */ -static CustomDataMask get_viewedit_datamask(bScreen *screen, Object *ob) +static CustomDataMask get_viewedit_datamask(bScreen *screen, Scene *scene, Object *ob) { CustomDataMask mask = CD_MASK_BAREMESH; ScrArea *sa; @@ -1875,10 +1875,8 @@ static CustomDataMask get_viewedit_datamask(bScreen *screen, Object *ob) if((view->drawtype == OB_TEXTURE) || ((view->drawtype == OB_SOLID) && (view->flag2 & V3D_SOLID_TEX))) { mask |= CD_MASK_MTFACE | CD_MASK_MCOL; - if((G.fileflags & G_FILE_GAME_MAT) && - (G.fileflags & G_FILE_GAME_MAT_GLSL)) { + if(scene->gm.matmode == GAME_MAT_GLSL) mask |= CD_MASK_ORCO; - } } } } @@ -1909,7 +1907,7 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) char *grid_unit= NULL; /* from now on all object derived meshes check this */ - v3d->customdata_mask= get_viewedit_datamask(CTX_wm_screen(C), obact); + v3d->customdata_mask= get_viewedit_datamask(CTX_wm_screen(C), scene, obact); /* shadow buffers, before we setup matrices */ if(draw_glsl_material(scene, NULL, v3d, v3d->drawtype)) diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index c85e2b5a7f1..c0fb069fc41 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -500,7 +500,7 @@ static void ramp_diffuse_result(GPUShadeInput *shi, GPUNodeLink **diff) GPUMaterial *mat= shi->gpumat; GPUNodeLink *fac; - if(!(G.fileflags & G_FILE_GLSL_NO_RAMPS)) { + if(!(mat->scene->gm.flag & GAME_GLSL_NO_RAMPS)) { if(ma->ramp_col) { if(ma->rampin_col==MA_RAMP_IN_RESULT) { GPU_link(mat, "ramp_rgbtobw", *diff, &fac); @@ -516,7 +516,7 @@ static void add_to_diffuse(GPUMaterial *mat, Material *ma, GPUShadeInput *shi, G { GPUNodeLink *fac, *tmp, *addcol; - if(!(G.fileflags & G_FILE_GLSL_NO_RAMPS) && + if(!(mat->scene->gm.flag & GAME_GLSL_NO_RAMPS) && ma->ramp_col && (ma->mode & MA_RAMP_COL)) { /* MA_RAMP_IN_RESULT is exceptional */ if(ma->rampin_col==MA_RAMP_IN_RESULT) { @@ -556,7 +556,7 @@ static void ramp_spec_result(GPUShadeInput *shi, GPUNodeLink **spec) GPUMaterial *mat= shi->gpumat; GPUNodeLink *fac; - if(!(G.fileflags & G_FILE_GLSL_NO_RAMPS) && + if(!(mat->scene->gm.flag & GAME_GLSL_NO_RAMPS) && ma->ramp_spec && ma->rampin_spec==MA_RAMP_IN_RESULT) { GPU_link(mat, "ramp_rgbtobw", *spec, &fac); @@ -644,7 +644,7 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la is= inp; /* Lambert */ - if(!(G.fileflags & G_FILE_GLSL_NO_SHADERS)) { + if(!(mat->scene->gm.flag & GAME_GLSL_NO_SHADERS)) { if(ma->diff_shader==MA_DIFF_ORENNAYAR) GPU_link(mat, "shade_diffuse_oren_nayer", inp, vn, lv, view, GPU_uniform(&ma->roughness), &is); else if(ma->diff_shader==MA_DIFF_TOON) @@ -656,7 +656,7 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la } } - if(!(G.fileflags & G_FILE_GLSL_NO_SHADERS)) + if(!(mat->scene->gm.flag & GAME_GLSL_NO_SHADERS)) if(ma->shade_flag & MA_CUBIC) GPU_link(mat, "shade_cubic", is, &is); @@ -671,7 +671,7 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la // done in shade_visifac now, GPU_link(mat, "mtex_value_clamp_positive", i, &i); if((ma->mode & MA_SHADOW) && GPU_lamp_has_shadow_buffer(lamp)) { - if(!(G.fileflags & G_FILE_GLSL_NO_SHADOWS)) { + if(!(mat->scene->gm.flag & GAME_GLSL_NO_SHADOWS)) { mat->dynproperty |= DYN_LAMP_PERSMAT; GPU_link(mat, "test_shadowbuf", @@ -700,7 +700,7 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la GPU_link(mat, "math_multiply", i, shadfac, &i); } } - else if((G.fileflags & G_FILE_GLSL_NO_SHADOWS) && (lamp->mode & LA_ONLYSHADOW)) { + else if((mat->scene->gm.flag & GAME_GLSL_NO_SHADOWS) && (lamp->mode & LA_ONLYSHADOW)) { add_user_list(&mat->lamps, lamp); add_user_list(&lamp->materials, shi->gpumat->ma); return; @@ -716,7 +716,7 @@ static void shade_one_light(GPUShadeInput *shi, GPUShadeResult *shr, GPULamp *la } } - if(G.fileflags & G_FILE_GLSL_NO_SHADERS); + if(mat->scene->gm.flag & GAME_GLSL_NO_SHADERS); else if(!(lamp->mode & LA_NO_SPEC) && !(lamp->mode & LA_ONLYSHADOW) && (GPU_link_changed(shi->spec) || ma->spec != 0.0f)) { if(lamp->type == LA_HEMI) { @@ -1015,11 +1015,11 @@ static void do_material_tex(GPUShadeInput *shi) if(mtex->mapto & MAP_COL) texture_rgb_blend(mat, tcol, shi->rgb, tin, colfac, mtex->blendtype, &shi->rgb); - if(!(G.fileflags & G_FILE_GLSL_NO_EXTRA_TEX) && (mtex->mapto & MAP_COLSPEC)) + if(!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && (mtex->mapto & MAP_COLSPEC)) texture_rgb_blend(mat, tcol, shi->specrgb, tin, colfac, mtex->blendtype, &shi->specrgb); } - if(!(G.fileflags & G_FILE_GLSL_NO_EXTRA_TEX) && (mtex->mapto & MAP_NORM)) { + if(!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && (mtex->mapto & MAP_NORM)) { if(mtex->maptoneg & MAP_NORM) tex->norfac= -mtex->norfac; else tex->norfac= mtex->norfac; @@ -1065,22 +1065,22 @@ static void do_material_tex(GPUShadeInput *shi) GPU_link(mat, "mtex_rgbtoint", trgb, &tin); } - if(!(G.fileflags & G_FILE_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_REF) { + if(!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_REF) { int flip= mtex->maptoneg & MAP_REF; texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->refl, tin, varfac, mtex->blendtype, flip, &shi->refl); GPU_link(mat, "mtex_value_clamp_positive", shi->refl, &shi->refl); } - if(!(G.fileflags & G_FILE_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_SPEC) { + if(!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_SPEC) { int flip= mtex->maptoneg & MAP_SPEC; texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->spec, tin, varfac, mtex->blendtype, flip, &shi->spec); GPU_link(mat, "mtex_value_clamp_positive", shi->spec, &shi->spec); } - if(!(G.fileflags & G_FILE_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_EMIT) { + if(!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_EMIT) { int flip= mtex->maptoneg & MAP_EMIT; texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->emit, tin, varfac, mtex->blendtype, flip, &shi->emit); GPU_link(mat, "mtex_value_clamp_positive", shi->emit, &shi->emit); } - if(!(G.fileflags & G_FILE_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_HAR) { + if(!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_HAR) { int flip= mtex->maptoneg & MAP_HAR; GPU_link(mat, "mtex_har_divide", shi->har, &shi->har); texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->har, tin, varfac, mtex->blendtype, flip, &shi->har); @@ -1091,7 +1091,7 @@ static void do_material_tex(GPUShadeInput *shi) texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->alpha, tin, varfac, mtex->blendtype, flip, &shi->alpha); GPU_link(mat, "mtex_value_clamp", shi->alpha, &shi->alpha); } - if(!(G.fileflags & G_FILE_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_AMB) { + if(!(mat->scene->gm.flag & GAME_GLSL_NO_EXTRA_TEX) && mtex->mapto & MAP_AMB) { int flip= mtex->maptoneg & MAP_AMB; texture_value_blend(mat, GPU_uniform(&mtex->def_var), shi->amb, tin, varfac, mtex->blendtype, flip, &shi->amb); GPU_link(mat, "mtex_value_clamp", shi->amb, &shi->amb); @@ -1142,7 +1142,7 @@ void GPU_shaderesult_set(GPUShadeInput *shi, GPUShadeResult *shr) if((ma->mode & MA_TRANSP) && (ma->mode & MA_ZTRANSP)) GPU_material_enable_alpha(mat); - if((G.fileflags & G_FILE_GLSL_NO_LIGHTS) || (ma->mode & MA_SHLESS)) { + if((mat->scene->gm.flag & GAME_GLSL_NO_LIGHTS) || (ma->mode & MA_SHLESS)) { shr->combined = shi->rgb; shr->alpha = shi->alpha; GPU_link(mat, "set_rgb", shi->rgb, &shr->diff); @@ -1251,7 +1251,7 @@ GPUMaterial *GPU_material_from_blender(Scene *scene, Material *ma) mat = GPU_material_construct_begin(ma); mat->scene = scene; - if(!(G.fileflags & G_FILE_GLSL_NO_NODES) && ma->nodetree && ma->use_nodes) { + if(!(scene->gm.flag & GAME_GLSL_NO_NODES) && ma->nodetree && ma->use_nodes) { ntreeGPUMaterialNodes(ma->nodetree, mat); } else { @@ -1458,8 +1458,8 @@ void GPU_lamp_free(Object *ob) int GPU_lamp_has_shadow_buffer(GPULamp *lamp) { - return (!(G.fileflags & G_FILE_GLSL_NO_SHADOWS) && - !(G.fileflags & G_FILE_GLSL_NO_LIGHTS) && + return (!(lamp->scene->gm.flag & GAME_GLSL_NO_SHADOWS) && + !(lamp->scene->gm.flag & GAME_GLSL_NO_LIGHTS) && lamp->tex && lamp->fb); } diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index f00813b58f1..4a3d555ca33 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -387,7 +387,7 @@ typedef struct GameData { * bit 3: (gameengine): Activity culling is enabled. * bit 5: (gameengine) : enable Bullet DBVT tree for view frustrum culling */ - short mode, pad11; + short mode, flag, matmode, pad[3]; short occlusionRes; /* resolution of occlusion Z buffer in pixel */ short physicsEngine; short ticrate, maxlogicstep, physubstep, maxphystep; @@ -401,6 +401,7 @@ typedef struct GameData { struct GameDome dome; short stereoflag, stereomode, xsch, ysch; //xsch and ysch can be deleted !!! } GameData; + #define STEREO_NOSTEREO 1 #define STEREO_ENABLED 2 #define STEREO_DOME 3 @@ -422,6 +423,25 @@ typedef struct GameData { #define WOPHY_ODE 4 #define WOPHY_BULLET 5 +/* GameData.flag */ +#define GAME_ENABLE_ALL_FRAMES (1 << 1) +#define GAME_SHOW_DEBUG_PROPS (1 << 2) +#define GAME_SHOW_FRAMERATE (1 << 3) +#define GAME_SHOW_PHYSICS (1 << 4) +#define GAME_DISPLAY_LISTS (1 << 5) +#define GAME_GLSL_NO_LIGHTS (1 << 6) +#define GAME_GLSL_NO_SHADERS (1 << 7) +#define GAME_GLSL_NO_SHADOWS (1 << 8) +#define GAME_GLSL_NO_RAMPS (1 << 9) +#define GAME_GLSL_NO_NODES (1 << 10) +#define GAME_GLSL_NO_EXTRA_TEX (1 << 11) +#define GAME_IGNORE_DEPRECATION_WARNINGS (1 << 12) + +/* GameData.matmode */ +#define GAME_MAT_TEXFACE 0 +#define GAME_MAT_MULTITEX 1 +#define GAME_MAT_GLSL 2 + typedef struct TimeMarker { struct TimeMarker *next, *prev; int frame; diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index bb6611205b6..c8be3c7afac 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -776,9 +776,9 @@ void rna_def_scene_game_data(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem framing_types_items[] ={ - {SCE_GAMEFRAMING_BARS, "BARS", 0, "Stretch", ""}, - {SCE_GAMEFRAMING_EXTEND, "EXTEND", 0, "Extend", ""}, - {SCE_GAMEFRAMING_SCALE, "SCALE", 0, "Scale", ""}, + {SCE_GAMEFRAMING_BARS, "LETTERBOX", 0, "Letterbox", "Show the entire viewport in the display window, using bar horizontally or vertically"}, + {SCE_GAMEFRAMING_EXTEND, "EXTEND", 0, "Extend", "Show the entire viewport in the display window, viewing more horizontally or vertically"}, + {SCE_GAMEFRAMING_SCALE, "SCALE", 0, "Scale", "Stretch or squeeze the viewport to fill the display window"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem dome_modes_items[] ={ @@ -801,7 +801,7 @@ void rna_def_scene_game_data(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem stereo_items[] ={ - {STEREO_NOSTEREO, "NO_STEREO", 0, "No Stereo", ""}, + {STEREO_NOSTEREO, "NONE", 0, "None", ""}, {STEREO_ENABLED, "STEREO", 0, "Stereo", ""}, {STEREO_DOME, "DOME", 0, "Dome", ""}, {0, NULL, 0, NULL, NULL}}; @@ -815,6 +815,12 @@ void rna_def_scene_game_data(BlenderRNA *brna) {WOPHY_BULLET, "BULLET", 0, "Bullet", ""}, {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem material_items[] ={ + {GAME_MAT_TEXFACE, "TEXTURE_FACE", 0, "Texture Face", "Single texture face materials."}, + {GAME_MAT_MULTITEX, "MULTITEXTURE", 0, "Multitexture", "Multitexture materials."}, + {GAME_MAT_GLSL, "GLSL", 0, "GLSL", "OpenGL shading language shaders."}, + {0, NULL, 0, NULL, NULL}}; + srna= RNA_def_struct(brna, "SceneGameData", NULL); RNA_def_struct_sdna(srna, "GameData"); RNA_def_struct_nested(brna, srna, "Scene"); @@ -979,6 +985,74 @@ void rna_def_scene_game_data(BlenderRNA *brna) RNA_def_property_range(prop, 0.0, 1000.0); RNA_def_property_ui_text(prop, "box radius", "Radius of the activity bubble, in Manhattan length. Objects outside the box are activity-culled"); RNA_def_property_update(prop, NC_SCENE, NULL); + + /* booleans */ + prop= RNA_def_property(srna, "all_frames", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_ENABLE_ALL_FRAMES); + RNA_def_property_ui_text(prop, "All Frames", "Render as many frames as possible, rather than respecting framerate."); + RNA_def_property_update(prop, NC_SCENE, NULL); + + prop= RNA_def_property(srna, "show_debug_properties", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_DEBUG_PROPS); + RNA_def_property_ui_text(prop, "Show Debug Properties", "Show properties marked for debugging while the game runs."); + RNA_def_property_update(prop, NC_SCENE, NULL); + + prop= RNA_def_property(srna, "show_framerate_profile", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_FRAMERATE); + RNA_def_property_ui_text(prop, "Show Framerate and Profile", "Show framerate and profiling information while the game runs."); + RNA_def_property_update(prop, NC_SCENE, NULL); + + prop= RNA_def_property(srna, "show_physics_visualization", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_SHOW_PHYSICS); + RNA_def_property_ui_text(prop, "Show Physics Visualization", "Show a visualization of physics bounds and interactions."); + RNA_def_property_update(prop, NC_SCENE, NULL); + + prop= RNA_def_property(srna, "display_lists", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GAME_DISPLAY_LISTS); + RNA_def_property_ui_text(prop, "Display Lists", "Use display lists to speed up rendering by keeping geometry on the GPU."); + RNA_def_property_update(prop, NC_SCENE, NULL); + + prop= RNA_def_property(srna, "deprecation_warnings", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_IGNORE_DEPRECATION_WARNINGS); + RNA_def_property_ui_text(prop, "Deprecation Warnings", "Print warnings when using deprecated features in the python API."); + RNA_def_property_update(prop, NC_SCENE, NULL); + + /* materials */ + prop= RNA_def_property(srna, "material_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "matmode"); + RNA_def_property_enum_items(prop, material_items); + RNA_def_property_ui_text(prop, "Material Mode", "Material mode to use for rendering."); + RNA_def_property_update(prop, NC_SCENE, NULL); + + prop= RNA_def_property(srna, "glsl_lights", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_LIGHTS); + RNA_def_property_ui_text(prop, "GLSL Lights", "Use lights for GLSL rendering."); + RNA_def_property_update(prop, NC_SCENE, NULL); + + prop= RNA_def_property(srna, "glsl_shaders", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADERS); + RNA_def_property_ui_text(prop, "GLSL Shaders", "Use shaders for GLSL rendering."); + RNA_def_property_update(prop, NC_SCENE, NULL); + + prop= RNA_def_property(srna, "glsl_shadows", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_SHADOWS); + RNA_def_property_ui_text(prop, "GLSL Shadows", "Use shadows for GLSL rendering."); + RNA_def_property_update(prop, NC_SCENE, NULL); + + prop= RNA_def_property(srna, "glsl_ramps", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_RAMPS); + RNA_def_property_ui_text(prop, "GLSL Ramps", "Use ramps for GLSL rendering."); + RNA_def_property_update(prop, NC_SCENE, NULL); + + prop= RNA_def_property(srna, "glsl_nodes", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_NODES); + RNA_def_property_ui_text(prop, "GLSL Nodes", "Use nodes for GLSL rendering."); + RNA_def_property_update(prop, NC_SCENE, NULL); + + prop= RNA_def_property(srna, "glsl_extra_textures", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_EXTRA_TEX); + RNA_def_property_ui_text(prop, "GLSL Extra Textures", "Use extra textures like normal or specular maps for GLSL rendering."); + RNA_def_property_update(prop, NC_SCENE, NULL); } static void rna_def_scene_render_layer(BlenderRNA *brna) diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index 4efdf04890e..ae46f880711 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -350,12 +350,12 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int alw if(GPU_extensions_minimum_support()) useglslmat = true; - else if(G.fileflags & G_FILE_GAME_MAT_GLSL) + else if(blscene->gm.matmode == GAME_MAT_GLSL) usemat = false; - if(usemat && (G.fileflags & G_FILE_GAME_MAT)) + if(usemat && (blscene->gm.matmode != GAME_MAT_TEXFACE)) sceneconverter->SetMaterials(true); - if(useglslmat && (G.fileflags & G_FILE_GAME_MAT_GLSL)) + if(useglslmat && (blscene->gm.matmode == GAME_MAT_GLSL)) sceneconverter->SetGLSLMaterials(true); KX_Scene* startscene = new KX_Scene(keyboarddevice, diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index 4c824a8df40..c9a2e81bdae 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -524,16 +524,17 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) // SYS_WriteCommandLineInt(syshandle, "fixedtime", 0); // SYS_WriteCommandLineInt(syshandle, "vertexarrays",1); + GameData *gm= &m_startScene->gm; bool properties = (SYS_GetCommandLineInt(syshandle, "show_properties", 0) != 0); bool profile = (SYS_GetCommandLineInt(syshandle, "show_profile", 0) != 0); - bool fixedFr = (G.fileflags & G_FILE_ENABLE_ALL_FRAMES); + bool fixedFr = (gm->flag & GAME_ENABLE_ALL_FRAMES); - bool showPhysics = (G.fileflags & G_FILE_SHOW_PHYSICS); + bool showPhysics = (gm->flag & GAME_SHOW_PHYSICS); SYS_WriteCommandLineInt(syshandle, "show_physics", showPhysics); bool fixed_framerate= (SYS_GetCommandLineInt(syshandle, "fixed_framerate", fixedFr) != 0); bool frameRate = (SYS_GetCommandLineInt(syshandle, "show_framerate", 0) != 0); - bool useLists = (SYS_GetCommandLineInt(syshandle, "displaylists", G.fileflags & G_FILE_DISPLAY_LISTS) != 0); + bool useLists = (SYS_GetCommandLineInt(syshandle, "displaylists", gm->flag & GAME_DISPLAY_LISTS) != 0); bool nodepwarnings = (SYS_GetCommandLineInt(syshandle, "ignore_deprecation_warnings", 1) != 0); if(GLEW_ARB_multitexture && GLEW_VERSION_1_1) @@ -541,7 +542,7 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) if(GPU_extensions_minimum_support()) m_blenderglslmat = (SYS_GetCommandLineInt(syshandle, "blender_glsl_material", 1) != 0); - else if(G.fileflags & G_FILE_GAME_MAT_GLSL) + else if(gm->matmode == GAME_MAT_GLSL) m_blendermat = false; // create the canvas, rasterizer and rendertools @@ -671,9 +672,9 @@ bool GPG_Application::startEngine(void) // if (always_use_expand_framing) // sceneconverter->SetAlwaysUseExpandFraming(true); - if(m_blendermat && (G.fileflags & G_FILE_GAME_MAT)) + if(m_blendermat && (m_startScene->gm.matmode != GAME_MAT_TEXFACE)) m_sceneconverter->SetMaterials(true); - if(m_blenderglslmat && (G.fileflags & G_FILE_GAME_MAT_GLSL)) + if(m_blenderglslmat && (m_startScene->gm.matmode == GAME_MAT_GLSL)) m_sceneconverter->SetGLSLMaterials(true); KX_Scene* startscene = new KX_Scene(m_keyboard, diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 0eef33f927e..de3dcd0ebf8 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -92,6 +92,7 @@ extern "C" { /* we only need this to get a list of libraries from the main struct */ #include "DNA_ID.h" +#include "DNA_scene_types.h" #include "marshal.h" /* python header for loading/saving dicts */ @@ -206,8 +207,6 @@ static PyObject* gPySendMessage(PyObject*, PyObject* args) Py_RETURN_NONE; } -static bool usedsp = false; - // this gets a pointer to an array filled with floats static PyObject* gPyGetSpectrum(PyObject*) { @@ -769,17 +768,17 @@ static PyObject* gPyDisableMotionBlur(PyObject*) int getGLSLSettingFlag(char *setting) { if(strcmp(setting, "lights") == 0) - return G_FILE_GLSL_NO_LIGHTS; + return GAME_GLSL_NO_LIGHTS; else if(strcmp(setting, "shaders") == 0) - return G_FILE_GLSL_NO_SHADERS; + return GAME_GLSL_NO_SHADERS; else if(strcmp(setting, "shadows") == 0) - return G_FILE_GLSL_NO_SHADOWS; + return GAME_GLSL_NO_SHADOWS; else if(strcmp(setting, "ramps") == 0) - return G_FILE_GLSL_NO_RAMPS; + return GAME_GLSL_NO_RAMPS; else if(strcmp(setting, "nodes") == 0) - return G_FILE_GLSL_NO_NODES; + return GAME_GLSL_NO_NODES; else if(strcmp(setting, "extra_textures") == 0) - return G_FILE_GLSL_NO_EXTRA_TEX; + return GAME_GLSL_NO_EXTRA_TEX; else return -1; } @@ -788,8 +787,9 @@ static PyObject* gPySetGLSLMaterialSetting(PyObject*, PyObject* args, PyObject*) { + GameData *gm= &(gp_KetsjiScene->GetBlenderScene()->gm); char *setting; - int enable, flag, fileflags; + int enable, flag, sceneflag; if (!PyArg_ParseTuple(args,"si:setGLSLMaterialSetting",&setting,&enable)) return NULL; @@ -801,15 +801,15 @@ static PyObject* gPySetGLSLMaterialSetting(PyObject*, return NULL; } - fileflags = G.fileflags; + sceneflag= gm->flag; if (enable) - G.fileflags &= ~flag; + gm->flag &= ~flag; else - G.fileflags |= flag; + gm->flag |= flag; /* display lists and GLSL materials need to be remade */ - if(G.fileflags != fileflags) { + if(sceneflag != gm->flag) { GPU_materials_free(); if(gp_KetsjiEngine) { KX_SceneList *scenes = gp_KetsjiEngine->CurrentScenes(); @@ -830,6 +830,7 @@ static PyObject* gPyGetGLSLMaterialSetting(PyObject*, PyObject* args, PyObject*) { + GameData *gm= &(gp_KetsjiScene->GetBlenderScene()->gm); char *setting; int enabled = 0, flag; @@ -843,7 +844,7 @@ static PyObject* gPyGetGLSLMaterialSetting(PyObject*, return NULL; } - enabled = ((G.fileflags & flag) != 0); + enabled = ((gm->flag & flag) != 0); return PyLong_FromSsize_t(enabled); } @@ -855,35 +856,34 @@ static PyObject* gPySetMaterialType(PyObject*, PyObject* args, PyObject*) { - int flag, type; + GameData *gm= &(gp_KetsjiScene->GetBlenderScene()->gm); + int type; if (!PyArg_ParseTuple(args,"i:setMaterialType",&type)) return NULL; if(type == KX_BLENDER_GLSL_MATERIAL) - flag = G_FILE_GAME_MAT|G_FILE_GAME_MAT_GLSL; + gm->matmode= GAME_MAT_GLSL; else if(type == KX_BLENDER_MULTITEX_MATERIAL) - flag = G_FILE_GAME_MAT; + gm->matmode= GAME_MAT_MULTITEX; else if(type == KX_TEXFACE_MATERIAL) - flag = 0; + gm->matmode= GAME_MAT_TEXFACE; else { PyErr_SetString(PyExc_ValueError, "Rasterizer.setMaterialType(int): material type is not known"); return NULL; } - G.fileflags &= ~(G_FILE_GAME_MAT|G_FILE_GAME_MAT_GLSL); - G.fileflags |= flag; - Py_RETURN_NONE; } static PyObject* gPyGetMaterialType(PyObject*) { + GameData *gm= &(gp_KetsjiScene->GetBlenderScene()->gm); int flag; - if(G.fileflags & G_FILE_GAME_MAT_GLSL) + if(gm->matmode == GAME_MAT_GLSL) flag = KX_BLENDER_GLSL_MATERIAL; - else if(G.fileflags & G_FILE_GAME_MAT) + else if(gm->matmode == GAME_MAT_MULTITEX) flag = KX_BLENDER_MULTITEX_MATERIAL; else flag = KX_TEXFACE_MATERIAL; From 14d33b3c1fd629ca3ebc2f369b38d9d2ebc09e2e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 18 Aug 2009 15:37:31 +0000 Subject: [PATCH 123/577] BGE guardedalloc, Uses WITH_CXX_GUARDEDALLOC but gives a string to MEM_mallocN for better tracking memory usage. * off by default. * new/delete are at the bottom of each class * python BGE objects have the new/delete in the Py_Header macro. --- .../BlenderRoutines/KX_BlenderCanvas.h | 11 +++++++++ .../BlenderRoutines/KX_BlenderInputDevice.h | 10 +++++++- .../KX_BlenderKeyboardDevice.h | 11 +++++++++ .../BlenderRoutines/KX_BlenderMouseDevice.h | 11 +++++++++ .../BlenderRoutines/KX_BlenderRenderTools.h | 11 +++++++++ .../BlenderRoutines/KX_BlenderSystem.h | 12 ++++++++++ .../gameengine/Converter/BL_ArmatureObject.h | 7 ++++++ .../Converter/BL_DeformableGameObject.h | 7 +++++- source/gameengine/Converter/BL_MeshDeformer.h | 7 ++++++ .../Converter/BL_ModifierDeformer.h | 6 +++++ .../gameengine/Converter/BL_ShapeDeformer.h | 6 +++++ source/gameengine/Converter/BL_SkinDeformer.h | 6 +++++ .../gameengine/Converter/BL_SkinMeshObject.h | 7 ++++++ .../gameengine/Converter/BlenderWorldInfo.h | 7 ++++++ .../Converter/KX_BlenderScalarInterpolator.h | 14 +++++++++++ .../Converter/KX_BlenderSceneConverter.h | 6 +++++ source/gameengine/Expressions/BoolValue.h | 7 ++++++ source/gameengine/Expressions/ConstExpr.h | 7 ++++++ source/gameengine/Expressions/EmptyValue.h | 7 ++++++ source/gameengine/Expressions/ErrorValue.h | 7 ++++++ source/gameengine/Expressions/Expression.h | 13 +++++++++++ source/gameengine/Expressions/FloatValue.h | 6 +++++ .../gameengine/Expressions/IdentifierExpr.h | 7 ++++++ source/gameengine/Expressions/IfExpr.h | 7 ++++++ source/gameengine/Expressions/InputParser.h | 8 ++++++- source/gameengine/Expressions/IntValue.h | 6 +++++ source/gameengine/Expressions/KX_HashedPtr.h | 11 +++++++++ source/gameengine/Expressions/Operator1Expr.h | 7 ++++++ source/gameengine/Expressions/Operator2Expr.h | 8 ++++++- source/gameengine/Expressions/PyObjectPlus.h | 12 +++++++++- source/gameengine/Expressions/StringValue.h | 7 ++++++ source/gameengine/Expressions/Value.h | 19 ++++++++++++++- source/gameengine/Expressions/VectorValue.h | 7 ++++++ source/gameengine/Expressions/VoidValue.h | 7 ++++++ .../GameLogic/SCA_ActuatorEventManager.h | 7 ++++++ .../GameLogic/SCA_AlwaysEventManager.h | 5 ++++ .../gameengine/GameLogic/SCA_EventManager.h | 7 ++++++ .../GameLogic/SCA_ExpressionController.h | 7 ++++++ source/gameengine/GameLogic/SCA_IActuator.h | 7 ++++++ .../gameengine/GameLogic/SCA_IInputDevice.h | 10 ++++++++ source/gameengine/GameLogic/SCA_IScene.h | 11 +++++++++ .../GameLogic/SCA_JoystickManager.h | 6 +++++ .../GameLogic/SCA_KeyboardManager.h | 7 ++++++ .../gameengine/GameLogic/SCA_LogicManager.h | 7 ++++++ .../gameengine/GameLogic/SCA_MouseManager.h | 7 ++++++ .../GameLogic/SCA_PropertyEventManager.h | 6 +++++ .../GameLogic/SCA_RandomEventManager.h | 7 ++++++ .../GameLogic/SCA_RandomNumberGenerator.h | 11 +++++++++ .../GameLogic/SCA_TimeEventManager.h | 7 ++++++ source/gameengine/Ketsji/BL_BlenderShader.h | 7 ++++++ source/gameengine/Ketsji/BL_Material.h | 11 +++++++++ source/gameengine/Ketsji/BL_Shader.h | 20 ++++++++++++++++ source/gameengine/Ketsji/BL_Texture.h | 6 +++++ source/gameengine/Ketsji/KX_BlenderMaterial.h | 4 ++++ .../Ketsji/KX_BulletPhysicsController.h | 7 +++++- .../Ketsji/KX_CameraIpoSGController.h | 7 ++++++ .../gameengine/Ketsji/KX_ClientObjectInfo.h | 7 ++++++ source/gameengine/Ketsji/KX_Dome.h | 11 +++++++-- source/gameengine/Ketsji/KX_EmptyObject.h | 8 ++++++- source/gameengine/Ketsji/KX_IInterpolator.h | 11 +++++++++ .../gameengine/Ketsji/KX_IPO_SGController.h | 6 +++++ .../gameengine/Ketsji/KX_IPhysicsController.h | 7 ++++++ .../Ketsji/KX_IScalarInterpolator.h | 11 +++++++++ source/gameengine/Ketsji/KX_ISceneConverter.h | 11 +++++++++ source/gameengine/Ketsji/KX_ISystem.h | 11 +++++++++ source/gameengine/Ketsji/KX_KetsjiEngine.h | 8 ++++++- .../Ketsji/KX_LightIpoSGController.h | 7 ++++++ .../Ketsji/KX_MaterialIpoController.h | 7 ++++++ source/gameengine/Ketsji/KX_MotionState.h | 10 ++++++++ .../Ketsji/KX_ObColorIpoSGController.h | 7 ++++++ .../Ketsji/KX_OrientationInterpolator.h | 7 ++++++ source/gameengine/Ketsji/KX_PolygonMaterial.h | 5 ++++ .../Ketsji/KX_PositionInterpolator.h | 7 ++++++ source/gameengine/Ketsji/KX_RayCast.h | 14 ++++++++++- source/gameengine/Ketsji/KX_RayEventManager.h | 7 ++++++ .../Ketsji/KX_SG_BoneParentNodeRelationship.h | 7 +++++- .../Ketsji/KX_SG_NodeRelationships.h | 19 ++++++++++++++- .../gameengine/Ketsji/KX_ScalarInterpolator.h | 7 ++++++ .../Ketsji/KX_ScalingInterpolator.h | 7 ++++++ .../gameengine/Ketsji/KX_TimeCategoryLogger.h | 6 +++++ source/gameengine/Ketsji/KX_TimeLogger.h | 11 +++++++++ .../gameengine/Ketsji/KX_TouchEventManager.h | 6 +++++ source/gameengine/Ketsji/KX_WorldInfo.h | 11 +++++++++ .../gameengine/Ketsji/KX_WorldIpoController.h | 7 ++++++ .../Network/NG_NetworkDeviceInterface.h | 7 ++++++ source/gameengine/Network/NG_NetworkMessage.h | 11 +++++++++ source/gameengine/Network/NG_NetworkObject.h | 11 +++++++++ source/gameengine/Network/NG_NetworkScene.h | 13 ++++++++++- .../Physics/Bullet/CcdGraphicController.h | 6 +++++ .../Physics/Bullet/CcdPhysicsController.h | 23 +++++++++++++++---- .../Physics/Bullet/CcdPhysicsEnvironment.h | 6 ++++- .../Physics/Dummy/DummyPhysicsEnvironment.h | 6 +++++ .../Physics/common/PHY_IController.h | 11 +++++++-- .../Physics/common/PHY_IGraphicController.h | 7 ++++-- .../Physics/common/PHY_IMotionState.h | 14 +++++++++-- .../Physics/common/PHY_IPhysicsController.h | 6 ++++- .../Physics/common/PHY_IPhysicsEnvironment.h | 18 +++++++++++++++ .../gameengine/Physics/common/PHY_IVehicle.h | 11 ++++++++- .../Rasterizer/RAS_2DFilterManager.h | 11 +++++++++ .../gameengine/Rasterizer/RAS_BucketManager.h | 6 +++++ source/gameengine/Rasterizer/RAS_Deformer.h | 10 ++++++++ .../Rasterizer/RAS_FramingManager.h | 19 ++++++++++++++- source/gameengine/Rasterizer/RAS_ICanvas.h | 11 +++++++++ .../Rasterizer/RAS_IPolygonMaterial.h | 12 +++++++++- .../gameengine/Rasterizer/RAS_IRasterizer.h | 12 +++++++++- .../gameengine/Rasterizer/RAS_IRenderTools.h | 11 +++++++++ .../Rasterizer/RAS_MaterialBucket.h | 20 ++++++++++++++++ source/gameengine/Rasterizer/RAS_MeshObject.h | 7 ++++++ .../RAS_OpenGLRasterizer/RAS_ListRasterizer.h | 7 ++++++ .../RAS_OpenGLRasterizer.h | 7 ++++++ .../RAS_VAOpenGLRasterizer.h | 6 +++++ source/gameengine/Rasterizer/RAS_Polygon.h | 10 ++++++++ source/gameengine/Rasterizer/RAS_Rect.h | 10 ++++++++ source/gameengine/Rasterizer/RAS_TexVert.h | 10 ++++++++ source/gameengine/SceneGraph/SG_BBox.h | 10 ++++++++ source/gameengine/SceneGraph/SG_Controller.h | 6 +++++ source/gameengine/SceneGraph/SG_DList.h | 11 +++++++++ source/gameengine/SceneGraph/SG_IObject.h | 7 ++++-- source/gameengine/SceneGraph/SG_Node.h | 7 +++++- .../gameengine/SceneGraph/SG_ParentRelation.h | 8 ++++++- source/gameengine/SceneGraph/SG_QList.h | 7 ++++++ source/gameengine/SceneGraph/SG_Spatial.h | 7 +++++- source/gameengine/SceneGraph/SG_Tree.h | 13 +++++++++++ 123 files changed, 1068 insertions(+), 36 deletions(-) diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h index fd41fb90f2f..d49c877f610 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.h @@ -40,6 +40,10 @@ #include "KX_BlenderGL.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + struct ARegion; struct wmWindow; @@ -166,6 +170,13 @@ private: struct ARegion* m_ar; struct wmWindow* m_win; RAS_Rect m_area_rect; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderCanvas"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // __KX_BLENDERCANVAS diff --git a/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h b/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h index 32391e63264..d4dd9af3d4f 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderInputDevice.h @@ -39,7 +39,9 @@ #include "WM_types.h" #include "SCA_IInputDevice.h" - +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif /** Base Class for Blender specific inputdevices. Blender specific inputdevices are used when the gameengine is running in embedded mode instead of standalone mode. @@ -222,6 +224,12 @@ public: // virtual const SCA_InputEvent& GetEventValue(SCA_IInputDevice::KX_EnumInputs inputcode)=0; virtual bool ConvertBlenderEvent(unsigned short incode,short val)=0; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_BlenderInputDevice"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_BLENDERINPUTDEVICE diff --git a/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h b/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h index 5bf37acf236..c801322e787 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderKeyboardDevice.h @@ -31,6 +31,10 @@ #include "KX_BlenderInputDevice.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class KX_BlenderKeyboardDevice : public BL_BlenderInputDevice { bool m_hookesc; @@ -43,6 +47,13 @@ public: virtual bool ConvertBlenderEvent(unsigned short incode,short val); virtual void NextFrame(); virtual void HookEscape(); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderKeyboardDevice"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_BLENDERKEYBOARDDEVICE diff --git a/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.h b/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.h index 2f9e956a1d8..92383e4b533 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderMouseDevice.h @@ -31,6 +31,10 @@ #include "KX_BlenderInputDevice.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class KX_BlenderMouseDevice : public BL_BlenderInputDevice { public: @@ -41,6 +45,13 @@ public: // virtual const SCA_InputEvent& GetEventValue(SCA_IInputDevice::KX_EnumInputs inputcode); virtual bool ConvertBlenderEvent(unsigned short incode,short val); virtual void NextFrame(); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderMouseDevice"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_BLENDERMOUSEDEVICE diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h index 60130e6bfc9..70672b8350b 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.h @@ -37,6 +37,10 @@ #include "RAS_IRenderTools.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + struct KX_ClientObjectInfo; class KX_RayCast; @@ -95,6 +99,13 @@ public: virtual void Render2DFilters(RAS_ICanvas* canvas); virtual void SetClientObject(RAS_IRasterizer *rasty, void* obj); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderRenderTools"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_BLENDERRENDERTOOLS diff --git a/source/gameengine/BlenderRoutines/KX_BlenderSystem.h b/source/gameengine/BlenderRoutines/KX_BlenderSystem.h index d99bb9b14a8..b6b2841e81c 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderSystem.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderSystem.h @@ -34,6 +34,10 @@ */ #include "KX_ISystem.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class KX_BlenderSystem : public KX_ISystem { double m_starttime; @@ -42,6 +46,14 @@ public: KX_BlenderSystem(); virtual ~KX_BlenderSystem() {}; virtual double GetTimeInSeconds(); + + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderSystem"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_BLENDERSYSTEM diff --git a/source/gameengine/Converter/BL_ArmatureObject.h b/source/gameengine/Converter/BL_ArmatureObject.h index 684d89d492b..af0b7dc201c 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.h +++ b/source/gameengine/Converter/BL_ArmatureObject.h @@ -93,6 +93,13 @@ protected: short m_activePriority; double m_lastapplyframe; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ArmatureObject"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Converter/BL_DeformableGameObject.h b/source/gameengine/Converter/BL_DeformableGameObject.h index b20b8e81b37..ed329e7953d 100644 --- a/source/gameengine/Converter/BL_DeformableGameObject.h +++ b/source/gameengine/Converter/BL_DeformableGameObject.h @@ -45,7 +45,6 @@ struct Key; class BL_DeformableGameObject : public KX_GameObject { public: - CValue* GetReplica(); double GetLastFrame () @@ -100,6 +99,12 @@ protected: Object* m_blendobj; short m_activePriority; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_DeformableGameObject"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Converter/BL_MeshDeformer.h b/source/gameengine/Converter/BL_MeshDeformer.h index 289826e45e7..1749d438d21 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.h +++ b/source/gameengine/Converter/BL_MeshDeformer.h @@ -85,6 +85,13 @@ protected: int m_tvtot; BL_DeformableGameObject* m_gameobj; double m_lastDeformUpdate; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_MeshDeformer"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Converter/BL_ModifierDeformer.h b/source/gameengine/Converter/BL_ModifierDeformer.h index b09cc2087ca..5cc84c7d1e4 100644 --- a/source/gameengine/Converter/BL_ModifierDeformer.h +++ b/source/gameengine/Converter/BL_ModifierDeformer.h @@ -101,6 +101,12 @@ protected: Scene *m_scene; DerivedMesh *m_dm; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ModifierDeformer"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Converter/BL_ShapeDeformer.h b/source/gameengine/Converter/BL_ShapeDeformer.h index 949e5e1e3ad..ca3770d4006 100644 --- a/source/gameengine/Converter/BL_ShapeDeformer.h +++ b/source/gameengine/Converter/BL_ShapeDeformer.h @@ -83,6 +83,12 @@ protected: vector m_shapeDrivers; double m_lastShapeUpdate; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ShapeDeformer"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Converter/BL_SkinDeformer.h b/source/gameengine/Converter/BL_SkinDeformer.h index 7c43246a9d7..b83895d5609 100644 --- a/source/gameengine/Converter/BL_SkinDeformer.h +++ b/source/gameengine/Converter/BL_SkinDeformer.h @@ -105,6 +105,12 @@ protected: bool m_poseApplied; bool m_recalcNormal; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_SkinDeformer"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Converter/BL_SkinMeshObject.h b/source/gameengine/Converter/BL_SkinMeshObject.h index e2d0e37664d..838c6c3cb95 100644 --- a/source/gameengine/Converter/BL_SkinMeshObject.h +++ b/source/gameengine/Converter/BL_SkinMeshObject.h @@ -54,6 +54,13 @@ public: // for shape keys, void CheckWeightCache(struct Object* obj); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_SkinMeshObject"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Converter/BlenderWorldInfo.h b/source/gameengine/Converter/BlenderWorldInfo.h index fd6bb0212b7..7ccb96e4683 100644 --- a/source/gameengine/Converter/BlenderWorldInfo.h +++ b/source/gameengine/Converter/BlenderWorldInfo.h @@ -94,6 +94,13 @@ public: setMistColorBlue( float d ); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BlenderWorldInfo"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__BLENDERWORLDINFO_H diff --git a/source/gameengine/Converter/KX_BlenderScalarInterpolator.h b/source/gameengine/Converter/KX_BlenderScalarInterpolator.h index 396a7d197df..eb15cee8ff9 100644 --- a/source/gameengine/Converter/KX_BlenderScalarInterpolator.h +++ b/source/gameengine/Converter/KX_BlenderScalarInterpolator.h @@ -49,6 +49,13 @@ public: private: struct FCurve *m_fcu; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_ScalarInterpolator"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; @@ -58,6 +65,13 @@ public: ~BL_InterpolatorList(); KX_IScalarInterpolator *GetScalarInterpolator(char *rna_path, int array_index); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_InterpolatorList"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_SCALARINTERPOLATOR_H diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.h b/source/gameengine/Converter/KX_BlenderSceneConverter.h index 7b5351344ae..bb87a21a683 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.h +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.h @@ -143,6 +143,12 @@ public: struct Main* GetMain() { return m_maggie; }; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BlenderSceneConverter"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_BLENDERSCENECONVERTER_H diff --git a/source/gameengine/Expressions/BoolValue.h b/source/gameengine/Expressions/BoolValue.h index 726619e7193..4d0103ec1dd 100644 --- a/source/gameengine/Expressions/BoolValue.h +++ b/source/gameengine/Expressions/BoolValue.h @@ -49,6 +49,13 @@ public: private: bool m_bool; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CBoolValue"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined _BOOLVALUE_H diff --git a/source/gameengine/Expressions/ConstExpr.h b/source/gameengine/Expressions/ConstExpr.h index b117140fe70..f48b8d34355 100644 --- a/source/gameengine/Expressions/ConstExpr.h +++ b/source/gameengine/Expressions/ConstExpr.h @@ -41,6 +41,13 @@ public: private: CValue* m_value; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CConstExpr"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined(AFX_CONSTEXPR_H__061ECFC3_BE87_11D1_A51C_00A02472FC58__INCLUDED_) diff --git a/source/gameengine/Expressions/EmptyValue.h b/source/gameengine/Expressions/EmptyValue.h index fb6b4a477a6..01029d1655d 100644 --- a/source/gameengine/Expressions/EmptyValue.h +++ b/source/gameengine/Expressions/EmptyValue.h @@ -34,6 +34,13 @@ public: CValue * Calc(VALUE_OPERATOR op, CValue *val); CValue * CalcFinal(VALUE_DATA_TYPE dtype, VALUE_OPERATOR op, CValue *val); virtual CValue* GetReplica(); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CEmptyValue"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined _EMPTYVALUE_H diff --git a/source/gameengine/Expressions/ErrorValue.h b/source/gameengine/Expressions/ErrorValue.h index b4b758feea7..2f65850c4f1 100644 --- a/source/gameengine/Expressions/ErrorValue.h +++ b/source/gameengine/Expressions/ErrorValue.h @@ -33,6 +33,13 @@ public: private: STR_String m_strErrorText; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CErrorValue"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined _ERRORVALUE_H diff --git a/source/gameengine/Expressions/Expression.h b/source/gameengine/Expressions/Expression.h index 400a2b7c789..bd346fd0552 100644 --- a/source/gameengine/Expressions/Expression.h +++ b/source/gameengine/Expressions/Expression.h @@ -63,6 +63,12 @@ class CBrokenLinkInfo CExpression* m_pExpr; bool m_bRestored; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CBrokenLinkInfo"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; @@ -126,6 +132,13 @@ public: protected: int m_refcount; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CExpression"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined _EXPRESSION_H diff --git a/source/gameengine/Expressions/FloatValue.h b/source/gameengine/Expressions/FloatValue.h index fb75b7c702b..442f0eb6cf8 100644 --- a/source/gameengine/Expressions/FloatValue.h +++ b/source/gameengine/Expressions/FloatValue.h @@ -42,6 +42,12 @@ protected: float m_float; STR_String* m_pstrRep; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CFloatValue"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined _FLOATVALUE_H diff --git a/source/gameengine/Expressions/IdentifierExpr.h b/source/gameengine/Expressions/IdentifierExpr.h index b307228c8b9..7c14329f755 100644 --- a/source/gameengine/Expressions/IdentifierExpr.h +++ b/source/gameengine/Expressions/IdentifierExpr.h @@ -46,6 +46,13 @@ public: virtual CExpression* CheckLink(std::vector& brokenlinks); virtual void ClearModified(); virtual void BroadcastOperators(VALUE_OPERATOR op); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CIdentifierExpr"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__IDENTIFIER_EXPR diff --git a/source/gameengine/Expressions/IfExpr.h b/source/gameengine/Expressions/IfExpr.h index 9ab13dca413..f06718c851f 100644 --- a/source/gameengine/Expressions/IfExpr.h +++ b/source/gameengine/Expressions/IfExpr.h @@ -44,6 +44,13 @@ public: virtual CExpression* CheckLink(std::vector& brokenlinks); virtual void ClearModified(); virtual void BroadcastOperators(VALUE_OPERATOR op); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CIfExpr"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined(AFX_IFEXPR_H__1F691841_C5C7_11D1_A863_0000B4542BD8__INCLUDED_) diff --git a/source/gameengine/Expressions/InputParser.h b/source/gameengine/Expressions/InputParser.h index 810bdc244a8..0d7eab27aeb 100644 --- a/source/gameengine/Expressions/InputParser.h +++ b/source/gameengine/Expressions/InputParser.h @@ -102,7 +102,13 @@ private: int Priority(int optor); CExpression *Ex(int i); CExpression *Expr(); - + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CParser"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Expressions/IntValue.h b/source/gameengine/Expressions/IntValue.h index 06bf1755749..0513026c4cf 100644 --- a/source/gameengine/Expressions/IntValue.h +++ b/source/gameengine/Expressions/IntValue.h @@ -56,6 +56,12 @@ private: cInt m_int; STR_String* m_pstrRep; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CIntValue"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined _INTVALUE_H diff --git a/source/gameengine/Expressions/KX_HashedPtr.h b/source/gameengine/Expressions/KX_HashedPtr.h index b11efb99d68..0b54436147b 100644 --- a/source/gameengine/Expressions/KX_HashedPtr.h +++ b/source/gameengine/Expressions/KX_HashedPtr.h @@ -29,6 +29,10 @@ #ifndef __KX_HASHEDPTR #define __KX_HASHEDPTR +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + unsigned int KX_Hash(void * inDWord); class CHashedPtr @@ -44,6 +48,13 @@ public: { return rhs.m_valptr == lhs.m_valptr; } + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CHashedPtr"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_HASHEDPTR diff --git a/source/gameengine/Expressions/Operator1Expr.h b/source/gameengine/Expressions/Operator1Expr.h index 4a1deb0eca3..c2bc68076a0 100644 --- a/source/gameengine/Expressions/Operator1Expr.h +++ b/source/gameengine/Expressions/Operator1Expr.h @@ -46,6 +46,13 @@ public: private: VALUE_OPERATOR m_op; CExpression * m_lhs; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:COperator1Expr"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined(AFX_OPERATOR1EXPR_H__A1653901_BF41_11D1_A51C_00A02472FC58__INCLUDED_) diff --git a/source/gameengine/Expressions/Operator2Expr.h b/source/gameengine/Expressions/Operator2Expr.h index 4064890bbae..bb26b7c03be 100644 --- a/source/gameengine/Expressions/Operator2Expr.h +++ b/source/gameengine/Expressions/Operator2Expr.h @@ -52,7 +52,13 @@ protected: private: VALUE_OPERATOR m_op; - + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:COperator2Expr"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined _OPERATOR2EXPR_H diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index d68aa9f0410..e9e81dddaaa 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -102,7 +102,7 @@ typedef struct { // This must be the first line of each // PyC++ class -#define Py_Header \ +#define __Py_Header \ public: \ static PyTypeObject Type; \ static PyMethodDef Methods[]; \ @@ -111,6 +111,16 @@ typedef struct { virtual PyObject *GetProxy() {return GetProxy_Ext(this, &Type);}; \ virtual PyObject *NewProxy(bool py_owns) {return NewProxy_Ext(this, &Type, py_owns);}; \ + +#ifdef WITH_CXX_GUARDEDALLOC +#define Py_Header __Py_Header \ + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, Type.tp_name); } \ + void operator delete( void *mem ) { MEM_freeN(mem); } \ + +#else +#define Py_Header __Py_Header +#endif + /* * nonzero values are an error for setattr * however because of the nested lookups we need to know if the errors diff --git a/source/gameengine/Expressions/StringValue.h b/source/gameengine/Expressions/StringValue.h index c580e8fd23a..069eb8d9c24 100644 --- a/source/gameengine/Expressions/StringValue.h +++ b/source/gameengine/Expressions/StringValue.h @@ -46,6 +46,13 @@ public: private: // data member STR_String m_strString; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CStringValue"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index 8c9f99b335e..5f08736afde 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -42,6 +42,10 @@ #include // array functionality for the propertylist #include "STR_String.h" // STR_String class +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + #ifndef GEN_NO_ASSERT #undef assert #define assert(exp) ((void)NULL) @@ -173,6 +177,13 @@ public: virtual ~CAction(){ }; virtual void Execute() const =0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CAction"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; // @@ -407,7 +418,6 @@ public: \ class CPropValue : public CValue { public: - #ifndef NO_EXP_PYTHON_EMBEDDING CPropValue() : CValue(), @@ -436,6 +446,13 @@ public: protected: STR_String m_strNewName; // Identification + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CPropValue"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined _VALUEBASECLASS_H diff --git a/source/gameengine/Expressions/VectorValue.h b/source/gameengine/Expressions/VectorValue.h index 19c7dd30076..49fb1e7ea08 100644 --- a/source/gameengine/Expressions/VectorValue.h +++ b/source/gameengine/Expressions/VectorValue.h @@ -79,6 +79,13 @@ public: protected: double m_vec[3]; double m_transformedvec[3]; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CVectorValue"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined _VECTORVALUE_H diff --git a/source/gameengine/Expressions/VoidValue.h b/source/gameengine/Expressions/VoidValue.h index 10a6ff9ad3d..50ec4ff1ee7 100644 --- a/source/gameengine/Expressions/VoidValue.h +++ b/source/gameengine/Expressions/VoidValue.h @@ -59,6 +59,13 @@ public: /// Data members bool m_bDeleteOnDestruct; void* m_pAnything; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CVoidValue"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // !defined _VOIDVALUE_H diff --git a/source/gameengine/GameLogic/SCA_ActuatorEventManager.h b/source/gameengine/GameLogic/SCA_ActuatorEventManager.h index a7d61627c23..f3884c87a75 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorEventManager.h +++ b/source/gameengine/GameLogic/SCA_ActuatorEventManager.h @@ -45,6 +45,13 @@ public: virtual void NextFrame(); virtual void UpdateFrame(); //SCA_LogicManager* GetLogicManager() { return m_logicmgr;} + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_ActuatorEventManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_ACTUATOREVENTMANAGER diff --git a/source/gameengine/GameLogic/SCA_AlwaysEventManager.h b/source/gameengine/GameLogic/SCA_AlwaysEventManager.h index a619eecddd4..9540e3b71f6 100644 --- a/source/gameengine/GameLogic/SCA_AlwaysEventManager.h +++ b/source/gameengine/GameLogic/SCA_AlwaysEventManager.h @@ -41,6 +41,11 @@ public: virtual void NextFrame(); +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_AlwaysEventManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_ALWAYSEVENTMGR diff --git a/source/gameengine/GameLogic/SCA_EventManager.h b/source/gameengine/GameLogic/SCA_EventManager.h index 5ff55849bfe..424150ffa63 100644 --- a/source/gameengine/GameLogic/SCA_EventManager.h +++ b/source/gameengine/GameLogic/SCA_EventManager.h @@ -71,6 +71,13 @@ public: protected: EVENT_MANAGER_TYPE m_mgrtype; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_EventManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/GameLogic/SCA_ExpressionController.h b/source/gameengine/GameLogic/SCA_ExpressionController.h index 705f6dfc415..4c1dfcb95a2 100644 --- a/source/gameengine/GameLogic/SCA_ExpressionController.h +++ b/source/gameengine/GameLogic/SCA_ExpressionController.h @@ -53,6 +53,13 @@ public: * so that self references are removed before the controller itself is released */ virtual void Delete(); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_ExpressionController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_EXPRESSIONCONTROLLER diff --git a/source/gameengine/GameLogic/SCA_IActuator.h b/source/gameengine/GameLogic/SCA_IActuator.h index 13c718ee837..00ba8c9ce4e 100644 --- a/source/gameengine/GameLogic/SCA_IActuator.h +++ b/source/gameengine/GameLogic/SCA_IActuator.h @@ -127,6 +127,13 @@ public: void IncLink() { m_links++; } void DecLink(); bool IsNoLink() const { return !m_links; } + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_IActuator"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_IACTUATOR diff --git a/source/gameengine/GameLogic/SCA_IInputDevice.h b/source/gameengine/GameLogic/SCA_IInputDevice.h index a0d77ed3c03..228d7684b0f 100644 --- a/source/gameengine/GameLogic/SCA_IInputDevice.h +++ b/source/gameengine/GameLogic/SCA_IInputDevice.h @@ -33,6 +33,10 @@ #ifndef KX_INPUTDEVICE_H #define KX_INPUTDEVICE_H +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class SCA_InputEvent { @@ -302,6 +306,12 @@ public: */ virtual void NextFrame(); + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_InputEvent"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //KX_INPUTDEVICE_H diff --git a/source/gameengine/GameLogic/SCA_IScene.h b/source/gameengine/GameLogic/SCA_IScene.h index 79d922a998e..ced9ca94cec 100644 --- a/source/gameengine/GameLogic/SCA_IScene.h +++ b/source/gameengine/GameLogic/SCA_IScene.h @@ -33,6 +33,10 @@ #include "STR_String.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + struct SCA_DebugProp { class CValue* m_obj; @@ -60,6 +64,13 @@ public: void AddDebugProperty(class CValue* debugprop, const STR_String &name); void RemoveAllDebugProperties(); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_IScene"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_ISCENE_H diff --git a/source/gameengine/GameLogic/SCA_JoystickManager.h b/source/gameengine/GameLogic/SCA_JoystickManager.h index d3a7ac95bea..be55e95b033 100644 --- a/source/gameengine/GameLogic/SCA_JoystickManager.h +++ b/source/gameengine/GameLogic/SCA_JoystickManager.h @@ -47,6 +47,12 @@ public: virtual void NextFrame(double curtime,double deltatime); SCA_Joystick* GetJoystickDevice(short int joyindex); + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_JoystickManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/GameLogic/SCA_KeyboardManager.h b/source/gameengine/GameLogic/SCA_KeyboardManager.h index 8f3cc0ab715..c5553a74aef 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardManager.h +++ b/source/gameengine/GameLogic/SCA_KeyboardManager.h @@ -56,6 +56,13 @@ public: virtual void NextFrame(); SCA_IInputDevice* GetInputDevice(); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_KeyboardManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_KEYBOARDMANAGER diff --git a/source/gameengine/GameLogic/SCA_LogicManager.h b/source/gameengine/GameLogic/SCA_LogicManager.h index 53e75e1eaee..402090357cb 100644 --- a/source/gameengine/GameLogic/SCA_LogicManager.h +++ b/source/gameengine/GameLogic/SCA_LogicManager.h @@ -137,6 +137,13 @@ public: void RegisterGameObj(void* blendobj, CValue* gameobj); void UnregisterGameObj(void* blendobj, CValue* gameobj); CValue* FindGameObjByBlendObj(void* blendobj); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_LogicManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_LOGICMANAGER diff --git a/source/gameengine/GameLogic/SCA_MouseManager.h b/source/gameengine/GameLogic/SCA_MouseManager.h index efa4c639ce7..ef1533c636b 100644 --- a/source/gameengine/GameLogic/SCA_MouseManager.h +++ b/source/gameengine/GameLogic/SCA_MouseManager.h @@ -63,6 +63,13 @@ public: bool IsPressed(SCA_IInputDevice::KX_EnumInputs inputcode); virtual void NextFrame(); SCA_IInputDevice* GetInputDevice(); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_MouseManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_MOUSEMANAGER diff --git a/source/gameengine/GameLogic/SCA_PropertyEventManager.h b/source/gameengine/GameLogic/SCA_PropertyEventManager.h index f166065b198..011f3285f63 100644 --- a/source/gameengine/GameLogic/SCA_PropertyEventManager.h +++ b/source/gameengine/GameLogic/SCA_PropertyEventManager.h @@ -40,6 +40,12 @@ class SCA_PropertyEventManager : public SCA_EventManager class SCA_LogicManager* m_logicmgr; public: + +#ifdef WITH_CXX_GUARDEDALLOC + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_PropertyEventManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif + SCA_PropertyEventManager(class SCA_LogicManager* logicmgr); virtual ~SCA_PropertyEventManager(); virtual void NextFrame(); diff --git a/source/gameengine/GameLogic/SCA_RandomEventManager.h b/source/gameengine/GameLogic/SCA_RandomEventManager.h index 79138c23c62..c8b511b87b7 100644 --- a/source/gameengine/GameLogic/SCA_RandomEventManager.h +++ b/source/gameengine/GameLogic/SCA_RandomEventManager.h @@ -45,6 +45,13 @@ public: SCA_RandomEventManager(class SCA_LogicManager* logicmgr); virtual void NextFrame(); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_RandomEventManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_RANDOMEVENTMGR diff --git a/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h b/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h index 842a0331752..f986fadeaf0 100644 --- a/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h +++ b/source/gameengine/GameLogic/SCA_RandomNumberGenerator.h @@ -34,6 +34,10 @@ #ifndef __KX_RANDOMNUMBERGENERATOR #define __KX_RANDOMNUMBERGENERATOR +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class SCA_RandomNumberGenerator { /* reference counted for memleak */ @@ -69,6 +73,13 @@ class SCA_RandomNumberGenerator { if (--m_refcount == 0) delete this; } + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_RandomNumberGenerator"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif /* __KX_RANDOMNUMBERGENERATOR */ diff --git a/source/gameengine/GameLogic/SCA_TimeEventManager.h b/source/gameengine/GameLogic/SCA_TimeEventManager.h index bd57e12eb44..089f21e603b 100644 --- a/source/gameengine/GameLogic/SCA_TimeEventManager.h +++ b/source/gameengine/GameLogic/SCA_TimeEventManager.h @@ -48,6 +48,13 @@ public: virtual void RemoveSensor(class SCA_ISensor* sensor); void AddTimeProperty(CValue* timeval); void RemoveTimeProperty(CValue* timeval); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_TimeEventManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_TIMEEVENTMANAGER diff --git a/source/gameengine/Ketsji/BL_BlenderShader.h b/source/gameengine/Ketsji/BL_BlenderShader.h index 9af53bfc863..073ce8f1ca5 100644 --- a/source/gameengine/Ketsji/BL_BlenderShader.h +++ b/source/gameengine/Ketsji/BL_BlenderShader.h @@ -57,6 +57,13 @@ public: int GetBlendMode(); bool Equals(BL_BlenderShader *blshader); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_BlenderShader"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif//__BL_GPUSHADER_H__ diff --git a/source/gameengine/Ketsji/BL_Material.h b/source/gameengine/Ketsji/BL_Material.h index 4f572f95891..6b53e7fa8b1 100644 --- a/source/gameengine/Ketsji/BL_Material.h +++ b/source/gameengine/Ketsji/BL_Material.h @@ -4,6 +4,10 @@ #include "STR_String.h" #include "MT_Point2.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + // -- struct MTex; struct Material; @@ -98,6 +102,13 @@ public: void SetSharedMaterial(bool v); bool IsShared(); void SetUsers(int num); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Material"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; // BL_Material::IdMode diff --git a/source/gameengine/Ketsji/BL_Shader.h b/source/gameengine/Ketsji/BL_Shader.h index 42969996b3e..b2610d7762a 100644 --- a/source/gameengine/Ketsji/BL_Shader.h +++ b/source/gameengine/Ketsji/BL_Shader.h @@ -25,6 +25,12 @@ public: { } int mLoc; // Sampler location + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Sampler"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; /** @@ -65,6 +71,13 @@ public: int GetLocation() { return mLoc; } void* getData() { return mData; } + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Uniform"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; /** @@ -83,6 +96,13 @@ public: int mType; int mLoc; unsigned int mFlag; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_DefUniform"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; /** diff --git a/source/gameengine/Ketsji/BL_Texture.h b/source/gameengine/Ketsji/BL_Texture.h index 830ffceb0f7..2dfd9c542d3 100644 --- a/source/gameengine/Ketsji/BL_Texture.h +++ b/source/gameengine/Ketsji/BL_Texture.h @@ -67,6 +67,12 @@ public: return tmp; } + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:BL_Texture"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif//__BL_TEXTURE_H__ diff --git a/source/gameengine/Ketsji/KX_BlenderMaterial.h b/source/gameengine/Ketsji/KX_BlenderMaterial.h index 605ca207949..cdbdc4bd429 100644 --- a/source/gameengine/Ketsji/KX_BlenderMaterial.h +++ b/source/gameengine/Ketsji/KX_BlenderMaterial.h @@ -15,6 +15,10 @@ #include "MT_Vector3.h" #include "MT_Vector4.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + struct MTFace; class KX_Scene; diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.h b/source/gameengine/Ketsji/KX_BulletPhysicsController.h index 755b1cbd780..7fc799abb7e 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.h +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.h @@ -18,7 +18,6 @@ private: btCollisionShape* m_bulletChildShape; public: - KX_BulletPhysicsController (const CcdConstructionInfo& ci, bool dyna, bool sensor, bool compound); virtual ~KX_BulletPhysicsController (); @@ -81,6 +80,12 @@ public: // intentionally empty }; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BulletPhysicsController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //KX_BULLET2PHYSICS_CONTROLLER diff --git a/source/gameengine/Ketsji/KX_CameraIpoSGController.h b/source/gameengine/Ketsji/KX_CameraIpoSGController.h index 33245e79c23..85d93962a14 100644 --- a/source/gameengine/Ketsji/KX_CameraIpoSGController.h +++ b/source/gameengine/Ketsji/KX_CameraIpoSGController.h @@ -84,6 +84,13 @@ public: m_modify_clipstart = modify; } void AddInterpolator(KX_IInterpolator* interp); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_CameraIpoSGController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // KX_CAMERAIPOSGCONTROLLER_H diff --git a/source/gameengine/Ketsji/KX_ClientObjectInfo.h b/source/gameengine/Ketsji/KX_ClientObjectInfo.h index 1898dc71ef8..74647dd47fd 100644 --- a/source/gameengine/Ketsji/KX_ClientObjectInfo.h +++ b/source/gameengine/Ketsji/KX_ClientObjectInfo.h @@ -74,6 +74,13 @@ public: bool isActor() { return m_type <= ACTOR; } bool isSensor() { return m_type >= SENSOR && m_type <= OBACTORSENSOR; } + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ClientObjectInfo"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_CLIENTOBJECT_INFO_H diff --git a/source/gameengine/Ketsji/KX_Dome.h b/source/gameengine/Ketsji/KX_Dome.h index 20b60ef0173..9ff33fe2852 100644 --- a/source/gameengine/Ketsji/KX_Dome.h +++ b/source/gameengine/Ketsji/KX_Dome.h @@ -18,7 +18,7 @@ http://www.gnu.org/copyleft/lesser.txt. Contributor(s): Dalai Felinto This source uses some of the ideas and code from Paul Bourke. -Developed as part of a Research and Development project for SAT - La Société des arts technologiques. +Developed as part of a Research and Development project for SAT - La Soci�t� des arts technologiques. ----------------------------------------------------------------------------- */ @@ -78,7 +78,7 @@ public: bool fboSupported; //openGL names: - GLuint domefacesId[7]; // ID of the images -- room for 7 images, using only 4 for 180º x 360º dome, 6 for panoramic and +1 for warp mesh + GLuint domefacesId[7]; // ID of the images -- room for 7 images, using only 4 for 180� x 360� dome, 6 for panoramic and +1 for warp mesh GLuint dlistId; // ID of the Display Lists of the images (used as an offset) typedef struct { @@ -184,6 +184,13 @@ protected: RAS_IRenderTools* m_rendertools; /// engine KX_KetsjiEngine* m_engine; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_Dome"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Ketsji/KX_EmptyObject.h b/source/gameengine/Ketsji/KX_EmptyObject.h index 62aa7fcd017..fa405e20076 100644 --- a/source/gameengine/Ketsji/KX_EmptyObject.h +++ b/source/gameengine/Ketsji/KX_EmptyObject.h @@ -37,7 +37,13 @@ public: KX_GameObject(sgReplicationInfo,callbacks) {}; virtual ~KX_EmptyObject(); - + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_EmptyObject"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_EMPTYOBJECT diff --git a/source/gameengine/Ketsji/KX_IInterpolator.h b/source/gameengine/Ketsji/KX_IInterpolator.h index 8c899a4db0b..52b9b3be5af 100644 --- a/source/gameengine/Ketsji/KX_IInterpolator.h +++ b/source/gameengine/Ketsji/KX_IInterpolator.h @@ -31,11 +31,22 @@ #include +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class KX_IInterpolator { public: virtual ~KX_IInterpolator() {} virtual void Execute(float currentTime) const = 0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IInterpolator"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; typedef std::vector T_InterpolatorList; diff --git a/source/gameengine/Ketsji/KX_IPO_SGController.h b/source/gameengine/Ketsji/KX_IPO_SGController.h index 031b74294ce..68a74c3a364 100644 --- a/source/gameengine/Ketsji/KX_IPO_SGController.h +++ b/source/gameengine/Ketsji/KX_IPO_SGController.h @@ -116,6 +116,12 @@ public: m_ipotime = time; m_modified = true; } + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IpoSGController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__IPO_SGCONTROLLER_H diff --git a/source/gameengine/Ketsji/KX_IPhysicsController.h b/source/gameengine/Ketsji/KX_IPhysicsController.h index 81c01045071..f9dcf81bca5 100644 --- a/source/gameengine/Ketsji/KX_IPhysicsController.h +++ b/source/gameengine/Ketsji/KX_IPhysicsController.h @@ -126,6 +126,13 @@ public: // call from scene graph to update virtual bool Update(double time)=0; void* GetUserData() { return m_userdata;} + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IPhysicsController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_IPHYSICSCONTROLLER_H diff --git a/source/gameengine/Ketsji/KX_IScalarInterpolator.h b/source/gameengine/Ketsji/KX_IScalarInterpolator.h index 6ba685885e9..ec6183b88a1 100644 --- a/source/gameengine/Ketsji/KX_IScalarInterpolator.h +++ b/source/gameengine/Ketsji/KX_IScalarInterpolator.h @@ -29,11 +29,22 @@ #ifndef KX_ISCALARINTERPOLATOR_H #define KX_ISCALARINTERPOLATOR_H +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class KX_IScalarInterpolator { public: virtual ~KX_IScalarInterpolator() {} virtual float GetValue(float currentTime) const = 0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_IScalarInterpolator"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Ketsji/KX_ISceneConverter.h b/source/gameengine/Ketsji/KX_ISceneConverter.h index 45b3276e98c..f098b0bebf5 100644 --- a/source/gameengine/Ketsji/KX_ISceneConverter.h +++ b/source/gameengine/Ketsji/KX_ISceneConverter.h @@ -32,6 +32,10 @@ #include "STR_String.h" #include "KX_Python.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + struct Scene; class KX_ISceneConverter @@ -80,6 +84,13 @@ public: virtual bool GetGLSLMaterials()=0; virtual struct Scene* GetBlenderSceneForName(const STR_String& name)=0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ISceneConverter"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_ISCENECONVERTER_H diff --git a/source/gameengine/Ketsji/KX_ISystem.h b/source/gameengine/Ketsji/KX_ISystem.h index 204e116e822..deee91f62e8 100644 --- a/source/gameengine/Ketsji/KX_ISystem.h +++ b/source/gameengine/Ketsji/KX_ISystem.h @@ -37,6 +37,10 @@ using namespace std; #include "STR_String.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + /** * System Abstraction, needed only for getting some timing stuff from the host. */ @@ -47,6 +51,13 @@ public: virtual ~KX_ISystem() {}; virtual double GetTimeInSeconds()=0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ISystem"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h index a36b3f163fd..acb9e53df8a 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.h +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h @@ -190,7 +190,6 @@ private: void DoSound(KX_Scene* scene); public: - KX_KetsjiEngine(class KX_ISystem* system); virtual ~KX_KetsjiEngine(); @@ -396,6 +395,13 @@ protected: bool BeginFrame(); void ClearFrame(); void EndFrame(); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_KetsjiEngine"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_KETSJI_ENGINE diff --git a/source/gameengine/Ketsji/KX_LightIpoSGController.h b/source/gameengine/Ketsji/KX_LightIpoSGController.h index 98870cf5b3f..811dba5dba8 100644 --- a/source/gameengine/Ketsji/KX_LightIpoSGController.h +++ b/source/gameengine/Ketsji/KX_LightIpoSGController.h @@ -92,6 +92,13 @@ public: }; void AddInterpolator(KX_IInterpolator* interp); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_LightIpoSGController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // KX_LIGHTIPOSGCONTROLLER_H diff --git a/source/gameengine/Ketsji/KX_MaterialIpoController.h b/source/gameengine/Ketsji/KX_MaterialIpoController.h index 4d2e258bf94..906c12426eb 100644 --- a/source/gameengine/Ketsji/KX_MaterialIpoController.h +++ b/source/gameengine/Ketsji/KX_MaterialIpoController.h @@ -50,6 +50,13 @@ public: void AddInterpolator(KX_IInterpolator* interp); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_MaterialIpoController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; diff --git a/source/gameengine/Ketsji/KX_MotionState.h b/source/gameengine/Ketsji/KX_MotionState.h index 0e43e88fbeb..63c265aa8a7 100644 --- a/source/gameengine/Ketsji/KX_MotionState.h +++ b/source/gameengine/Ketsji/KX_MotionState.h @@ -31,6 +31,10 @@ #include "PHY_IMotionState.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class KX_MotionState : public PHY_IMotionState { class SG_Spatial* m_node; @@ -48,6 +52,12 @@ public: virtual void setWorldOrientation(const float* ori); virtual void calculateWorldTransformations(); + + +#ifdef WITH_CXX_GUARDEDALLOC + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_MotionState"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_MOTIONSTATE diff --git a/source/gameengine/Ketsji/KX_ObColorIpoSGController.h b/source/gameengine/Ketsji/KX_ObColorIpoSGController.h index 6d63dd77683..a32d027be9c 100644 --- a/source/gameengine/Ketsji/KX_ObColorIpoSGController.h +++ b/source/gameengine/Ketsji/KX_ObColorIpoSGController.h @@ -67,6 +67,13 @@ public: void AddInterpolator(KX_IInterpolator* interp); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ObColorIpoSGController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // KX_OBCOLORIPOSGCONTROLLER_H diff --git a/source/gameengine/Ketsji/KX_OrientationInterpolator.h b/source/gameengine/Ketsji/KX_OrientationInterpolator.h index 2bd9f69d824..d8ecc74277c 100644 --- a/source/gameengine/Ketsji/KX_OrientationInterpolator.h +++ b/source/gameengine/Ketsji/KX_OrientationInterpolator.h @@ -50,6 +50,13 @@ public: private: MT_Matrix3x3& m_target; KX_IScalarInterpolator *m_ipos[3]; + + +#ifdef WITH_CXX_GUARDEDALLOC +private: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_OrientationInterpolator"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Ketsji/KX_PolygonMaterial.h b/source/gameengine/Ketsji/KX_PolygonMaterial.h index 266b4d7e789..dc42bd2f81b 100644 --- a/source/gameengine/Ketsji/KX_PolygonMaterial.h +++ b/source/gameengine/Ketsji/KX_PolygonMaterial.h @@ -35,6 +35,10 @@ #include "RAS_IRasterizer.h" #include "DNA_ID.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + struct MTFace; struct Material; struct MTex; @@ -57,6 +61,7 @@ private: mutable int m_pass; public: + KX_PolygonMaterial(); void Initialize(const STR_String &texname, Material* ma, diff --git a/source/gameengine/Ketsji/KX_PositionInterpolator.h b/source/gameengine/Ketsji/KX_PositionInterpolator.h index bff0b4201c2..f6c6fa98a0e 100644 --- a/source/gameengine/Ketsji/KX_PositionInterpolator.h +++ b/source/gameengine/Ketsji/KX_PositionInterpolator.h @@ -50,6 +50,13 @@ public: private: MT_Point3& m_target; KX_IScalarInterpolator *m_ipos[3]; + + +#ifdef WITH_CXX_GUARDEDALLOC +private: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_PositionInterpolator"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Ketsji/KX_RayCast.h b/source/gameengine/Ketsji/KX_RayCast.h index c3084c997a1..cdafc894f6c 100644 --- a/source/gameengine/Ketsji/KX_RayCast.h +++ b/source/gameengine/Ketsji/KX_RayCast.h @@ -89,6 +89,12 @@ public: const MT_Point3& topoint, KX_RayCast& callback); + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayCast"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; template class KX_RayCast::Callback : public KX_RayCast @@ -121,7 +127,13 @@ public: } return self->NeedRayCast(info); } - + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayCast::Callback"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; diff --git a/source/gameengine/Ketsji/KX_RayEventManager.h b/source/gameengine/Ketsji/KX_RayEventManager.h index b816d4d5250..27c9be14d1f 100644 --- a/source/gameengine/Ketsji/KX_RayEventManager.h +++ b/source/gameengine/Ketsji/KX_RayEventManager.h @@ -45,6 +45,13 @@ public: m_logicmgr(logicmgr) {} virtual void NextFrame(); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_RayEventManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_RAYEVENTMGR diff --git a/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h b/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h index c9baf228855..dd4419543a2 100644 --- a/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h +++ b/source/gameengine/Ketsji/KX_SG_BoneParentNodeRelationship.h @@ -59,7 +59,6 @@ class KX_BoneParentRelation : public SG_ParentRelation { public : - /** * Allocate and construct a new KX_SG_BoneParentRelation * on the heap. @@ -101,6 +100,12 @@ private : KX_BoneParentRelation(Bone* bone ); + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_BoneParentRelation"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Ketsji/KX_SG_NodeRelationships.h b/source/gameengine/Ketsji/KX_SG_NodeRelationships.h index d8fb9211f21..c1640f3e0a0 100644 --- a/source/gameengine/Ketsji/KX_SG_NodeRelationships.h +++ b/source/gameengine/Ketsji/KX_SG_NodeRelationships.h @@ -53,7 +53,6 @@ class KX_NormalParentRelation : public SG_ParentRelation { public : - /** * Allocate and construct a new KX_NormalParentRelation * on the heap. @@ -91,6 +90,12 @@ private : KX_NormalParentRelation( ); + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_NormalParentRelation"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; @@ -142,6 +147,12 @@ private : KX_VertexParentRelation( ); + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_VertexParentRelation"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; @@ -219,6 +230,12 @@ private : bool m_initialized; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_SlowParentRelation"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Ketsji/KX_ScalarInterpolator.h b/source/gameengine/Ketsji/KX_ScalarInterpolator.h index 8835c98c184..ca011ab5db0 100644 --- a/source/gameengine/Ketsji/KX_ScalarInterpolator.h +++ b/source/gameengine/Ketsji/KX_ScalarInterpolator.h @@ -55,6 +55,13 @@ public: private: MT_Scalar* m_target; KX_IScalarInterpolator *m_ipo; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ScalarInterpolator"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Ketsji/KX_ScalingInterpolator.h b/source/gameengine/Ketsji/KX_ScalingInterpolator.h index a7b5d7e559a..460563d4135 100644 --- a/source/gameengine/Ketsji/KX_ScalingInterpolator.h +++ b/source/gameengine/Ketsji/KX_ScalingInterpolator.h @@ -50,6 +50,13 @@ public: private: MT_Vector3& m_target; KX_IScalarInterpolator *m_ipos[3]; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_ScalingInterpolator"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Ketsji/KX_TimeCategoryLogger.h b/source/gameengine/Ketsji/KX_TimeCategoryLogger.h index 0cc34b53736..fe15967f93c 100644 --- a/source/gameengine/Ketsji/KX_TimeCategoryLogger.h +++ b/source/gameengine/Ketsji/KX_TimeCategoryLogger.h @@ -125,6 +125,12 @@ protected: /** Maximum number of measurements. */ unsigned int m_maxNumMeasurements; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TimeCategoryLogger"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // __KX_TIME_CATEGORY_LOGGER_H diff --git a/source/gameengine/Ketsji/KX_TimeLogger.h b/source/gameengine/Ketsji/KX_TimeLogger.h index 0962f02a877..2e73abc75b5 100644 --- a/source/gameengine/Ketsji/KX_TimeLogger.h +++ b/source/gameengine/Ketsji/KX_TimeLogger.h @@ -36,6 +36,10 @@ #include +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + /** * Stores and manages time measurements. */ @@ -98,6 +102,13 @@ protected: /** State of logging. */ bool m_logging; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TimeLogger"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // __KX_TIME_LOGGER_H diff --git a/source/gameengine/Ketsji/KX_TouchEventManager.h b/source/gameengine/Ketsji/KX_TouchEventManager.h index cc77bccfc31..6da37d615a4 100644 --- a/source/gameengine/Ketsji/KX_TouchEventManager.h +++ b/source/gameengine/Ketsji/KX_TouchEventManager.h @@ -76,6 +76,12 @@ public: SCA_LogicManager* GetLogicManager() { return m_logicmgr;} PHY_IPhysicsEnvironment *GetPhysicsEnvironment() { return m_physEnv; } + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_TouchEventManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_TOUCHEVENTMANAGER diff --git a/source/gameengine/Ketsji/KX_WorldInfo.h b/source/gameengine/Ketsji/KX_WorldInfo.h index fe4e0c51b24..2c2346ca38e 100644 --- a/source/gameengine/Ketsji/KX_WorldInfo.h +++ b/source/gameengine/Ketsji/KX_WorldInfo.h @@ -31,6 +31,10 @@ #include "MT_Scalar.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class MT_CmMatrix4x4; class KX_WorldInfo @@ -59,6 +63,13 @@ public: virtual void setMistColorRed(float)=0; virtual void setMistColorGreen(float)=0; virtual void setMistColorBlue(float)=0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_WorldInfo"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_WORLDINFO_H diff --git a/source/gameengine/Ketsji/KX_WorldIpoController.h b/source/gameengine/Ketsji/KX_WorldIpoController.h index d90c03d09ee..8622d80a35f 100644 --- a/source/gameengine/Ketsji/KX_WorldIpoController.h +++ b/source/gameengine/Ketsji/KX_WorldIpoController.h @@ -90,6 +90,13 @@ public: }; void AddInterpolator(KX_IInterpolator* interp); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:KX_WorldIpoController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // KX_LIGHTIPOSGCONTROLLER_H diff --git a/source/gameengine/Network/NG_NetworkDeviceInterface.h b/source/gameengine/Network/NG_NetworkDeviceInterface.h index 4a47774a762..2a2a909a04d 100644 --- a/source/gameengine/Network/NG_NetworkDeviceInterface.h +++ b/source/gameengine/Network/NG_NetworkDeviceInterface.h @@ -76,6 +76,13 @@ public: */ virtual STR_String GetNetworkVersion(void)=0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkDeviceInterface"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //NG_NETWORKDEVICEINTERFACE_H diff --git a/source/gameengine/Network/NG_NetworkMessage.h b/source/gameengine/Network/NG_NetworkMessage.h index 687c8120eca..a2f76dc1fae 100644 --- a/source/gameengine/Network/NG_NetworkMessage.h +++ b/source/gameengine/Network/NG_NetworkMessage.h @@ -32,6 +32,10 @@ #include "STR_HashedString.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class NG_NetworkMessage { static int s_nextID; @@ -122,6 +126,13 @@ public: int GetMessageID() { return m_uniqueMessageID; } + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkMessage"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //NG_NETWORKMESSAGE_H diff --git a/source/gameengine/Network/NG_NetworkObject.h b/source/gameengine/Network/NG_NetworkObject.h index c01d76a47fc..4bf636bf011 100644 --- a/source/gameengine/Network/NG_NetworkObject.h +++ b/source/gameengine/Network/NG_NetworkObject.h @@ -32,6 +32,10 @@ #include "STR_String.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class NG_NetworkObject { STR_String m_name; @@ -39,6 +43,13 @@ public: NG_NetworkObject(); ~NG_NetworkObject(); const STR_String& GetName(); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkObject"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //NG_NETWORKOBJECT_H diff --git a/source/gameengine/Network/NG_NetworkScene.h b/source/gameengine/Network/NG_NetworkScene.h index fc6367c3526..d5d6e8e0534 100644 --- a/source/gameengine/Network/NG_NetworkScene.h +++ b/source/gameengine/Network/NG_NetworkScene.h @@ -34,6 +34,10 @@ #include "STR_HashedString.h" #include +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + //MSVC defines SendMessage as a win api function, even though we aren't using it #ifdef SendMessage #undef SendMessage @@ -52,7 +56,7 @@ class NG_NetworkScene TMessageMap m_messagesBySenderName; TMessageMap m_messagesBySubject; -public: +public: NG_NetworkScene(NG_NetworkDeviceInterface *nic); ~NG_NetworkScene(); @@ -100,6 +104,13 @@ protected: * @param map Message map with messages. */ void ClearMessageMap(TMessageMap& map); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:NG_NetworkScene"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__NG_NETWORKSCENE_H diff --git a/source/gameengine/Physics/Bullet/CcdGraphicController.h b/source/gameengine/Physics/Bullet/CcdGraphicController.h index b0626f902c2..99885eb99ee 100644 --- a/source/gameengine/Physics/Bullet/CcdGraphicController.h +++ b/source/gameengine/Physics/Bullet/CcdGraphicController.h @@ -75,6 +75,12 @@ private: btBroadphaseProxy* m_handle; void* m_newClientInfo; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdGraphicController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //BULLET2_PHYSICSCONTROLLER_H diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.h b/source/gameengine/Physics/Bullet/CcdPhysicsController.h index 8eb2e616ecf..69b16ca35bd 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.h @@ -58,8 +58,6 @@ class btCollisionShape; class CcdShapeConstructionInfo { public: - - static CcdShapeConstructionInfo* FindMesh(class RAS_MeshObject* mesh, struct DerivedMesh* dm, bool polytope, bool gimpact); CcdShapeConstructionInfo() : @@ -191,6 +189,13 @@ protected: bool m_forceReInstance; //use gimpact for concave dynamic/moving collision detection float m_weldingThreshold1; //welding closeby vertices together can improve softbody stability etc. CcdShapeConstructionInfo* m_shapeProxy; // only used for PHY_SHAPE_PROXY, pointer to actual shape info + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdShapeConstructionInfo"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; struct CcdConstructionInfo @@ -559,7 +564,11 @@ protected: } - +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdPhysicsController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; @@ -587,7 +596,13 @@ class DefaultMotionState : public PHY_IMotionState btTransform m_worldTransform; btVector3 m_localScaling; - + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:DefaultMotionState"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h index bc5491e00cc..e087eac32c5 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h @@ -275,7 +275,11 @@ protected: bool m_scalingPropagated; - +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:CcdPhysicsEnvironment"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //CCDPHYSICSENVIRONMENT diff --git a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h index 8dbd137f9de..28440ebdad4 100644 --- a/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h +++ b/source/gameengine/Physics/Dummy/DummyPhysicsEnvironment.h @@ -93,6 +93,12 @@ public: return 0.f; } + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:DummyPhysicsEnvironment"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //_DUMMYPHYSICSENVIRONMENT diff --git a/source/gameengine/Physics/common/PHY_IController.h b/source/gameengine/Physics/common/PHY_IController.h index 45e93f9d24e..a053a9679b8 100644 --- a/source/gameengine/Physics/common/PHY_IController.h +++ b/source/gameengine/Physics/common/PHY_IController.h @@ -31,7 +31,9 @@ #include "PHY_DynamicTypes.h" - +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif /** PHY_IController is the abstract simplified Interface to objects @@ -41,12 +43,17 @@ class PHY_IController { public: - virtual ~PHY_IController(); // clientinfo for raycasts for example virtual void* getNewClientInfo()=0; virtual void setNewClientInfo(void* clientinfo)=0; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //PHY_ICONTROLLER_H diff --git a/source/gameengine/Physics/common/PHY_IGraphicController.h b/source/gameengine/Physics/common/PHY_IGraphicController.h index 470d42cb84a..aae971ff42a 100644 --- a/source/gameengine/Physics/common/PHY_IGraphicController.h +++ b/source/gameengine/Physics/common/PHY_IGraphicController.h @@ -39,9 +39,7 @@ */ class PHY_IGraphicController : public PHY_IController { - public: - virtual ~PHY_IGraphicController(); /** SynchronizeMotionStates ynchronizes dynas, kinematic and deformable entities (and do 'late binding') @@ -53,6 +51,11 @@ class PHY_IGraphicController : public PHY_IController virtual PHY_IGraphicController* GetReplica(class PHY_IMotionState* motionstate) {return 0;} + +#ifdef WITH_CXX_GUARDEDALLOC + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //PHY_IGRAPHICCONTROLLER_H diff --git a/source/gameengine/Physics/common/PHY_IMotionState.h b/source/gameengine/Physics/common/PHY_IMotionState.h index f7bcbd4f2d0..c3d01c010ff 100644 --- a/source/gameengine/Physics/common/PHY_IMotionState.h +++ b/source/gameengine/Physics/common/PHY_IMotionState.h @@ -29,6 +29,10 @@ #ifndef PHY__MOTIONSTATE_H #define PHY__MOTIONSTATE_H +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + /** PHY_IMotionState is the Interface to explicitly synchronize the world transformation. Default implementations for mayor graphics libraries like OpenGL and DirectX can be provided. @@ -36,8 +40,7 @@ class PHY_IMotionState { - public: - + public: virtual ~PHY_IMotionState(); virtual void getWorldPosition(float& posX,float& posY,float& posZ)=0; @@ -52,6 +55,13 @@ class PHY_IMotionState virtual void calculateWorldTransformations()=0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IMotionState"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //PHY__MOTIONSTATE_H diff --git a/source/gameengine/Physics/common/PHY_IPhysicsController.h b/source/gameengine/Physics/common/PHY_IPhysicsController.h index d7b8cb0b54f..664e5fddd83 100644 --- a/source/gameengine/Physics/common/PHY_IPhysicsController.h +++ b/source/gameengine/Physics/common/PHY_IPhysicsController.h @@ -41,7 +41,6 @@ class PHY_IPhysicsController : public PHY_IController { public: - virtual ~PHY_IPhysicsController(); /** SynchronizeMotionStates ynchronizes dynas, kinematic and deformable entities (and do 'late binding') @@ -99,6 +98,11 @@ class PHY_IPhysicsController : public PHY_IController PHY__Vector3 GetWorldPosition(PHY__Vector3& localpos); +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IPhysicsController"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //PHY_IPHYSICSCONTROLLER_H diff --git a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h index c76e9d175ce..291dac298dc 100644 --- a/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h +++ b/source/gameengine/Physics/common/PHY_IPhysicsEnvironment.h @@ -32,6 +32,11 @@ #include #include "PHY_DynamicTypes.h" + +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class PHY_IVehicle; class RAS_MeshObject; class PHY_IPhysicsController; @@ -76,6 +81,12 @@ public: m_faceNormal(faceNormal) { } + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IRayCastFilterCallback"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; /** @@ -160,6 +171,13 @@ class PHY_IPhysicsEnvironment virtual void setConstraintParam(int constraintId,int param,float value,float value1) = 0; virtual float getConstraintParam(int constraintId,int param) = 0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IPhysicsEnvironment"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //_IPHYSICSENVIRONMENT diff --git a/source/gameengine/Physics/common/PHY_IVehicle.h b/source/gameengine/Physics/common/PHY_IVehicle.h index 498df0dd840..261bae480f5 100644 --- a/source/gameengine/Physics/common/PHY_IVehicle.h +++ b/source/gameengine/Physics/common/PHY_IVehicle.h @@ -6,10 +6,13 @@ class PHY_IMotionState; #include "PHY_DynamicTypes.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class PHY_IVehicle { public: - virtual ~PHY_IVehicle(); virtual void AddWheel( @@ -52,6 +55,12 @@ public: virtual void SetCoordinateSystem(int rightIndex,int upIndex,int forwardIndex) =0; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:PHY_IVehicle"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //PHY_IVEHICLE_H diff --git a/source/gameengine/Rasterizer/RAS_2DFilterManager.h b/source/gameengine/Rasterizer/RAS_2DFilterManager.h index 6a420a974d4..99d4ea595ab 100644 --- a/source/gameengine/Rasterizer/RAS_2DFilterManager.h +++ b/source/gameengine/Rasterizer/RAS_2DFilterManager.h @@ -30,6 +30,10 @@ #define MAX_RENDER_PASS 100 +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class RAS_2DFilterManager { private: @@ -97,5 +101,12 @@ public: void RenderFilters(RAS_ICanvas* canvas); void EnableFilter(vector& propNames, void* gameObj, RAS_2DFILTER_MODE mode, int pass, STR_String& text); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_2DFilterManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.h b/source/gameengine/Rasterizer/RAS_BucketManager.h index 2b81ddd3c82..dcac41ab6e9 100644 --- a/source/gameengine/Rasterizer/RAS_BucketManager.h +++ b/source/gameengine/Rasterizer/RAS_BucketManager.h @@ -67,6 +67,12 @@ private: RAS_IRasterizer* rasty, RAS_IRenderTools* rendertools); void RenderAlphaBuckets(const MT_Transform& cameratrans, RAS_IRasterizer* rasty, RAS_IRenderTools* rendertools); + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_BucketManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__RAS_BUCKETMANAGER diff --git a/source/gameengine/Rasterizer/RAS_Deformer.h b/source/gameengine/Rasterizer/RAS_Deformer.h index 75c0dcd1eeb..6f4cd425c6c 100644 --- a/source/gameengine/Rasterizer/RAS_Deformer.h +++ b/source/gameengine/Rasterizer/RAS_Deformer.h @@ -37,6 +37,10 @@ #include #include "GEN_Map.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + struct DerivedMesh; class RAS_MeshObject; @@ -82,6 +86,12 @@ public: protected: class RAS_MeshObject *m_pMesh; bool m_bDynamic; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_Deformer"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Rasterizer/RAS_FramingManager.h b/source/gameengine/Rasterizer/RAS_FramingManager.h index 4398e2d00c3..3ae794c430a 100644 --- a/source/gameengine/Rasterizer/RAS_FramingManager.h +++ b/source/gameengine/Rasterizer/RAS_FramingManager.h @@ -29,6 +29,10 @@ #ifndef RAS_FRAMINGMANAGER_H #define RAS_FRAMINGMANAGER_H +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class RAS_Rect; /** @@ -55,7 +59,6 @@ class RAS_Rect; class RAS_FrameSettings { public : - /** * enum defining the policy to use * in each axis. @@ -154,6 +157,13 @@ private : float m_bar_b; unsigned int m_design_aspect_width; unsigned int m_design_aspect_height; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_FrameSettings"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; struct RAS_FrameFrustum @@ -274,6 +284,13 @@ private : RAS_FramingManager( const RAS_FramingManager & ); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_FramingManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Rasterizer/RAS_ICanvas.h b/source/gameengine/Rasterizer/RAS_ICanvas.h index f3f817a943d..dae4fb3f4d2 100644 --- a/source/gameengine/Rasterizer/RAS_ICanvas.h +++ b/source/gameengine/Rasterizer/RAS_ICanvas.h @@ -33,6 +33,10 @@ * 2D rendering device context. The connection from 3d rendercontext to 2d surface. */ +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class RAS_Rect; @@ -173,6 +177,13 @@ public: MakeScreenShot( const char* filename )=0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_ICanvas"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__RAS_ICANVAS diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h index a01196ef307..af909dfa731 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h @@ -38,6 +38,10 @@ #include "MT_Vector3.h" #include "STR_HashedString.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class RAS_IRasterizer; struct MTFace; struct Material; @@ -82,7 +86,6 @@ protected: unsigned int m_flag;//MaterialProps int m_multimode; // sum of values public: - MT_Vector3 m_diffuse; float m_shininess; MT_Vector3 m_specular; @@ -165,6 +168,13 @@ public: * PreCalculate texture gen */ virtual void OnConstruction(int layer){} + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_IPolyMaterial"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; inline bool operator ==( const RAS_IPolyMaterial & rhs,const RAS_IPolyMaterial & lhs) diff --git a/source/gameengine/Rasterizer/RAS_IRasterizer.h b/source/gameengine/Rasterizer/RAS_IRasterizer.h index dc8c3c1ebf8..05406413941 100644 --- a/source/gameengine/Rasterizer/RAS_IRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_IRasterizer.h @@ -43,6 +43,10 @@ #include using namespace std; +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class RAS_ICanvas; class RAS_IPolyMaterial; @@ -57,7 +61,6 @@ typedef vector< KX_IndexArray* > vecIndexArrays; class RAS_IRasterizer { public: - RAS_IRasterizer(RAS_ICanvas* canv){}; virtual ~RAS_IRasterizer(){}; /** @@ -407,6 +410,13 @@ public: virtual void SetBlendingMode(int blendmode)=0; virtual void SetFrontFace(bool ccw)=0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_IRasterizer"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__RAS_IRASTERIZER diff --git a/source/gameengine/Rasterizer/RAS_IRenderTools.h b/source/gameengine/Rasterizer/RAS_IRenderTools.h index 52f6397cf6c..5d52ddc9688 100644 --- a/source/gameengine/Rasterizer/RAS_IRenderTools.h +++ b/source/gameengine/Rasterizer/RAS_IRenderTools.h @@ -36,6 +36,10 @@ #include #include +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class RAS_IPolyMaterial; struct RAS_LightObject; @@ -180,6 +184,13 @@ public: virtual void Render2DFilters(RAS_ICanvas* canvas)=0; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_IRenderTools"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__RAS_IRENDERTOOLS diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.h b/source/gameengine/Rasterizer/RAS_MaterialBucket.h index 8db75b8b735..207763392b2 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.h +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.h @@ -169,6 +169,13 @@ public: bool IsCulled() { return m_bCulled; } #endif void SetCulled(bool culled) { m_bCulled = culled; } + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MeshSlot"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; /* Used by RAS_MeshObject, to point to it's slots in a bucket */ @@ -179,6 +186,13 @@ public: RAS_MeshSlot *m_baseslot; class RAS_MaterialBucket *m_bucket; GEN_Map m_slots; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MeshMaterial"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; /* Contains a list of display arrays with the same material, @@ -232,6 +246,12 @@ private: RAS_IPolyMaterial* m_material; SG_DList m_activeMeshSlotsHead; // only those which must be rendered + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MaterialBucket"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__RAS_MATERIAL_BUCKET diff --git a/source/gameengine/Rasterizer/RAS_MeshObject.h b/source/gameengine/Rasterizer/RAS_MeshObject.h index f34546a8ff7..1738423c4f3 100644 --- a/source/gameengine/Rasterizer/RAS_MeshObject.h +++ b/source/gameengine/Rasterizer/RAS_MeshObject.h @@ -173,6 +173,13 @@ public: }; vector > m_sharedvertex_map; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_MeshObject"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__RAS_MESHOBJECT diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h index fe358808e4a..cff48081f02 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h @@ -66,6 +66,13 @@ public: virtual void SetDrawingMode(int drawingmode); virtual bool QueryLists(){return true;} + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_ListRasterizer"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h index e3422394e9e..db0f97bf46f 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.h @@ -289,6 +289,13 @@ public: virtual void SetBlendingMode(int blendmode); virtual void SetFrontFace(bool ccw); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_OpenGLRasterizer"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__RAS_OPENGLRASTERIZER diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h index 766bbfbed0e..6112c1a4d98 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.h @@ -58,6 +58,12 @@ private: //virtual bool QueryArrays(){return true;} //virtual bool QueryLists(){return m_Lock;} + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_VAOpenGLRasterizer"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_VERTEXARRAYOPENGLRASTERIZER diff --git a/source/gameengine/Rasterizer/RAS_Polygon.h b/source/gameengine/Rasterizer/RAS_Polygon.h index 41eaa6bdd4a..a5b77738026 100644 --- a/source/gameengine/Rasterizer/RAS_Polygon.h +++ b/source/gameengine/Rasterizer/RAS_Polygon.h @@ -35,6 +35,10 @@ #include using namespace std; +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + /* polygon flags */ class RAS_Polygon @@ -85,6 +89,12 @@ public: RAS_MaterialBucket* GetMaterial(); RAS_DisplayArray* GetDisplayArray(); + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_Polygon"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/Rasterizer/RAS_Rect.h b/source/gameengine/Rasterizer/RAS_Rect.h index 4cd0c636cfd..ca7435673c9 100644 --- a/source/gameengine/Rasterizer/RAS_Rect.h +++ b/source/gameengine/Rasterizer/RAS_Rect.h @@ -30,6 +30,10 @@ #ifndef _RAS_RECT #define _RAS_RECT +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + /** * @section interface class. * RAS_Rect just encodes a simple rectangle. @@ -89,6 +93,12 @@ public: { m_y2 = y2; } + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_Rect"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif // _RAS_RECT diff --git a/source/gameengine/Rasterizer/RAS_TexVert.h b/source/gameengine/Rasterizer/RAS_TexVert.h index 811867f3579..b93078f4712 100644 --- a/source/gameengine/Rasterizer/RAS_TexVert.h +++ b/source/gameengine/Rasterizer/RAS_TexVert.h @@ -34,6 +34,10 @@ #include "MT_Point2.h" #include "MT_Transform.h" +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + static MT_Point3 g_pt3; static MT_Point2 g_pt2; @@ -134,6 +138,12 @@ public: // compare two vertices, to test if they can be shared, used for // splitting up based on uv's, colors, etc bool closeTo(const RAS_TexVert* other); + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:RAS_TexVert"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__RAS_TEXVERT diff --git a/source/gameengine/SceneGraph/SG_BBox.h b/source/gameengine/SceneGraph/SG_BBox.h index c39ad268e25..8dbb9869dae 100644 --- a/source/gameengine/SceneGraph/SG_BBox.h +++ b/source/gameengine/SceneGraph/SG_BBox.h @@ -38,6 +38,10 @@ #include +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + class SG_Node; /** @@ -128,6 +132,12 @@ public: friend class SG_Tree; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_BBox"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif /* __SG_BBOX_H__ */ diff --git a/source/gameengine/SceneGraph/SG_Controller.h b/source/gameengine/SceneGraph/SG_Controller.h index c32885b915f..db9d7bdb464 100644 --- a/source/gameengine/SceneGraph/SG_Controller.h +++ b/source/gameengine/SceneGraph/SG_Controller.h @@ -40,6 +40,12 @@ class SG_Controller { public: + +#ifdef WITH_CXX_GUARDEDALLOC + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "SG_Controller"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif + SG_Controller( ) : m_pObject(NULL) { diff --git a/source/gameengine/SceneGraph/SG_DList.h b/source/gameengine/SceneGraph/SG_DList.h index 7bef13cc9e3..3e17fb55dc0 100644 --- a/source/gameengine/SceneGraph/SG_DList.h +++ b/source/gameengine/SceneGraph/SG_DList.h @@ -31,6 +31,10 @@ #include +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif + /** * Double circular linked list */ @@ -155,6 +159,13 @@ public: { return this; } + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_DList"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__SG_DLIST diff --git a/source/gameengine/SceneGraph/SG_IObject.h b/source/gameengine/SceneGraph/SG_IObject.h index 8f448a0e890..23e6c1e9c99 100644 --- a/source/gameengine/SceneGraph/SG_IObject.h +++ b/source/gameengine/SceneGraph/SG_IObject.h @@ -160,8 +160,6 @@ private : SGControllerList m_SGcontrollers; public: - - virtual ~SG_IObject(); @@ -338,6 +336,11 @@ protected : ); +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_IObject"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__SG_IOBJECT diff --git a/source/gameengine/SceneGraph/SG_Node.h b/source/gameengine/SceneGraph/SG_Node.h index 7c6ef92f670..4281bcd11f6 100644 --- a/source/gameengine/SceneGraph/SG_Node.h +++ b/source/gameengine/SceneGraph/SG_Node.h @@ -40,7 +40,6 @@ typedef std::vector NodeList; class SG_Node : public SG_Spatial { public: - SG_Node( void* clientobj, void* clientinfo, @@ -260,6 +259,12 @@ private: */ SG_Node* m_SGparent; + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_Node"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__SG_NODE_H diff --git a/source/gameengine/SceneGraph/SG_ParentRelation.h b/source/gameengine/SceneGraph/SG_ParentRelation.h index 8f45df09b27..a6a43c19115 100644 --- a/source/gameengine/SceneGraph/SG_ParentRelation.h +++ b/source/gameengine/SceneGraph/SG_ParentRelation.h @@ -55,7 +55,6 @@ class SG_Spatial; class SG_ParentRelation { public : - /** * Update the childs local and global coordinates * based upon the parents global coordinates. @@ -128,6 +127,13 @@ protected : SG_ParentRelation( const SG_ParentRelation & ); + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_ParentRelation"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif diff --git a/source/gameengine/SceneGraph/SG_QList.h b/source/gameengine/SceneGraph/SG_QList.h index d8afc33ea4f..6399111d80b 100644 --- a/source/gameengine/SceneGraph/SG_QList.h +++ b/source/gameengine/SceneGraph/SG_QList.h @@ -151,6 +151,13 @@ public: { return m_bqlink; } + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_QList"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__SG_QLIST diff --git a/source/gameengine/SceneGraph/SG_Spatial.h b/source/gameengine/SceneGraph/SG_Spatial.h index 6e274487c9d..a818c8c81f7 100644 --- a/source/gameengine/SceneGraph/SG_Spatial.h +++ b/source/gameengine/SceneGraph/SG_Spatial.h @@ -66,7 +66,6 @@ protected: bool m_ogldirty; // true if the openGL matrix for this object must be recomputed public: - inline void ClearModified() { m_modified = false; @@ -284,6 +283,12 @@ protected: bool& parentUpdated ); + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_Spatial"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__SG_SPATIAL_H diff --git a/source/gameengine/SceneGraph/SG_Tree.h b/source/gameengine/SceneGraph/SG_Tree.h index 4741af83aae..6ca3307920e 100644 --- a/source/gameengine/SceneGraph/SG_Tree.h +++ b/source/gameengine/SceneGraph/SG_Tree.h @@ -111,6 +111,13 @@ public: } }; + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_Tree"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; @@ -148,6 +155,12 @@ public: SG_Tree* MakeTree(); + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SG_TreeFactory"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif /* __SG_BBOX_H__ */ From b51ebdf0bafd5f9baed88673fb58d947aba426b3 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 18 Aug 2009 16:11:53 +0000 Subject: [PATCH 124/577] 2.5: Middle mouse button emulation with alt + left mouse button works again, implemented at windowmanager level this time. --- .../blender/windowmanager/intern/wm_event_system.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 737028843d3..f0d9f8c0989 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -672,7 +672,19 @@ static int wm_eventmatch(wmEvent *winevent, wmKeymapItem *kmi) int kmitype= wm_userdef_event_map(kmi->type); if(kmi->inactive) return 0; - + + /* exception for middlemouse emulation */ + if((U.flag & USER_TWOBUTTONMOUSE) && (kmi->type == MIDDLEMOUSE)) { + if(winevent->type == LEFTMOUSE && winevent->alt) { + wmKeymapItem tmp= *kmi; + + tmp.type= winevent->type; + tmp.alt= winevent->alt; + if(wm_eventmatch(winevent, &tmp)) + return 1; + } + } + /* the matching rules */ if(kmitype==KM_TEXTINPUT) if(ISKEYBOARD(winevent->type)) return 1; From 94511c672920e8ae0ebca4fca2a563a46d07b85b Mon Sep 17 00:00:00 2001 From: Diego Borghetti Date: Tue, 18 Aug 2009 17:01:59 +0000 Subject: [PATCH 125/577] Missing libed_userpref in source/Makefile --- source/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/source/Makefile b/source/Makefile index b4d6ba9d013..cd2e7cf75ba 100644 --- a/source/Makefile +++ b/source/Makefile @@ -244,6 +244,7 @@ PULIB += $(OCGDIR)/blender/ed_image/$(DEBUG_DIR)libed_image.a PULIB += $(OCGDIR)/blender/ed_uvedit/$(DEBUG_DIR)libed_uvedit.a PULIB += $(OCGDIR)/blender/ed_screen/$(DEBUG_DIR)libed_screen.a PULIB += $(OCGDIR)/blender/ed_console/$(DEBUG_DIR)libed_console.a +PULIB += $(OCGDIR)/blender/ed_userpref/$(DEBUG_DIR)libed_userpref.a PULIB += $(OCGDIR)/blender/windowmanager/$(DEBUG_DIR)libwindowmanager.a PULIB += $(OCGDIR)/blender/python/$(DEBUG_DIR)libpython.a PULIB += $(OCGDIR)/blender/makesrna/$(DEBUG_DIR)librna.a From 7d812822bd9c522efc0730a4f219ccec9cfb4a57 Mon Sep 17 00:00:00 2001 From: Diego Borghetti Date: Tue, 18 Aug 2009 19:26:53 +0000 Subject: [PATCH 126/577] Stamp info back only for float buffer. (next commit add unsigned char). A couple of new functions: BLF_width_and_height - Merge of BLF_width and BLF_height in one call to avoid freetype2 stuff. BLF_buffer - Set the buffer, size and number of channel. BLF_buffer_col - Set the text color (the alpha is not used right now). BLF_draw_buffer - Draw the text in the current buffer. Also tweak a little the boundbox and draw function to avoid access the freetype2 and use the cache info. By default the font size is 12, the UI still need work to allow change the font and size. --- source/blender/blenfont/BLF_api.h | 27 +++ source/blender/blenfont/intern/blf.c | 45 ++++ source/blender/blenfont/intern/blf_font.c | 169 ++++++++++++-- source/blender/blenfont/intern/blf_glyph.c | 2 + source/blender/blenfont/intern/blf_internal.h | 2 + .../blenfont/intern/blf_internal_types.h | 20 ++ source/blender/blenkernel/intern/Makefile | 1 + source/blender/blenkernel/intern/image.c | 220 +++++++++++------- 8 files changed, 383 insertions(+), 103 deletions(-) diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h index 05df927f921..760b7059bc7 100644 --- a/source/blender/blenfont/BLF_api.h +++ b/source/blender/blenfont/BLF_api.h @@ -70,6 +70,11 @@ void BLF_boundbox(char *str, struct rctf *box); float BLF_width(char *str); float BLF_height(char *str); +/* + * The following function return the width and height of the string, but + * just in one call, so avoid extra freetype2 stuff. + */ +void BLF_width_and_height(char *str, float *width, float *height); /* * For fixed width fonts only, returns the width of a @@ -116,6 +121,28 @@ void BLF_shadow(int level, float r, float g, float b, float a); */ void BLF_shadow_offset(int x, int y); +/* + * Set the buffer, size and number of channels to draw, one thing to take care is call + * this function with NULL pointer when we finish, for example: + * BLF_buffer(my_fbuf, my_cbuf, 100, 100, 4); + * + * ... set color, position and draw ... + * + * BLF_buffer(NULL, NULL, 0, 0, 0); + */ +void BLF_buffer(float *fbuf, unsigned char *cbuf, unsigned int w, unsigned int h, int nch); + +/* + * Set the color to be used for text. + */ +void BLF_buffer_col(float r, float g, float b, float a); + +/* + * Draw the string into the buffer, this function draw in both buffer, float and unsigned char _BUT_ + * it's not necessary set both buffer, NULL is valid here. + */ +void BLF_draw_buffer(char *str); + /* * Search the path directory to the locale files, this try all * the case for Linux, Win and Mac. diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index ded89d18387..8cb237a19ac 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -371,6 +371,15 @@ void BLF_boundbox(char *str, rctf *box) blf_font_boundbox(font, str, box); } +void BLF_width_and_height(char *str, float *width, float *height) +{ + FontBLF *font; + + font= global_font[global_font_cur]; + if (font) + blf_font_width_and_height(font, str, width, height); +} + float BLF_width(char *str) { FontBLF *font; @@ -513,3 +522,39 @@ void BLF_shadow_offset(int x, int y) font->shadow_y= y; } } + +void BLF_buffer(float *fbuf, unsigned char *cbuf, unsigned int w, unsigned int h, int nch) +{ + FontBLF *font; + + font= global_font[global_font_cur]; + if (font) { + font->b_fbuf= fbuf; + font->b_cbuf= cbuf; + font->bw= w; + font->bh= h; + font->bch= nch; + } +} + +void BLF_buffer_col(float r, float g, float b, float a) +{ + FontBLF *font; + + font= global_font[global_font_cur]; + if (font) { + font->b_col[0]= r; + font->b_col[1]= g; + font->b_col[2]= b; + font->b_col[3]= a; + } +} + +void BLF_draw_buffer(char *str) +{ + FontBLF *font; + + font= global_font[global_font_cur]; + if (font) + blf_font_buffer(font, str); +} diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 7521b7815f1..432c3b5f854 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -100,7 +100,7 @@ void blf_font_draw(FontBLF *font, char *str) unsigned int c; GlyphBLF *g, *g_prev; FT_Vector delta; - FT_UInt glyph_index, g_prev_index; + FT_UInt glyph_index; int pen_x, pen_y; int i, has_kerning, st; @@ -112,17 +112,17 @@ void blf_font_draw(FontBLF *font, char *str) pen_y= 0; has_kerning= FT_HAS_KERNING(font->face); g_prev= NULL; - g_prev_index= 0; while (str[i]) { c= blf_utf8_next((unsigned char *)str, &i); if (c == 0) break; - glyph_index= FT_Get_Char_Index(font->face, c); g= blf_glyph_search(font->glyph_cache, c); - if (!g) + if (!g) { + glyph_index= FT_Get_Char_Index(font->face, c); g= blf_glyph_add(font, glyph_index, c); + } /* if we don't found a glyph, skip it. */ if (!g) @@ -133,9 +133,9 @@ void blf_font_draw(FontBLF *font, char *str) delta.y= 0; if (font->flags & BLF_KERNING_DEFAULT) - st= FT_Get_Kerning(font->face, g_prev_index, glyph_index, ft_kerning_default, &delta); + st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, ft_kerning_default, &delta); else - st= FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta); + st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, FT_KERNING_UNFITTED, &delta); if (st == 0) pen_x += delta.x >> 6; @@ -146,7 +146,129 @@ void blf_font_draw(FontBLF *font, char *str) pen_x += g->advance; g_prev= g; - g_prev_index= glyph_index; + } +} + +void blf_font_buffer(FontBLF *font, char *str) +{ + unsigned char *data; + unsigned int c; + GlyphBLF *g, *g_prev; + FT_Vector delta; + FT_UInt glyph_index; + float a, *fbuf; + int pen_x, pen_y, y, x, yb, diff; + int i, has_kerning, st, chx, chy; + + if (!font->glyph_cache) + return; + + i= 0; + pen_x= (int)font->pos[0]; + pen_y= (int)font->pos[1]; + has_kerning= FT_HAS_KERNING(font->face); + g_prev= NULL; + + while (str[i]) { + c= blf_utf8_next((unsigned char *)str, &i); + if (c == 0) + break; + + g= blf_glyph_search(font->glyph_cache, c); + if (!g) { + glyph_index= FT_Get_Char_Index(font->face, c); + g= blf_glyph_add(font, glyph_index, c); + } + + /* if we don't found a glyph, skip it. */ + if (!g) + continue; + + if (has_kerning && g_prev) { + delta.x= 0; + delta.y= 0; + + if (font->flags & BLF_KERNING_DEFAULT) + st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, ft_kerning_default, &delta); + else + st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, FT_KERNING_UNFITTED, &delta); + + if (st == 0) + pen_x += delta.x >> 6; + } + + if (font->b_fbuf) { + chx= pen_x + ((int)g->pos_x); + + diff= g->height - ((int)g->pos_y); + + if (diff > 0) { + if (g->pitch < 0) + pen_y += diff; + else + pen_y -= diff; + } + else if (diff < 0) { + if (g->pitch < 0) + pen_y -= diff; + else + pen_y += diff; + } + + + if (g->pitch < 0) + chy= pen_y - ((int)g->pos_y); + else + chy= pen_y + ((int)g->pos_y); + + if (chx >= 0 && chx < font->bw && pen_y >= 0 && pen_y < font->bh) { + if (g->pitch < 0) + yb= 0; + else + yb= g->height-1; + + for (y= 0; y < g->height; y++) { + for (x= 0; x < g->width; x++) { + fbuf= font->b_fbuf + font->bch * ((chx + x) + ((pen_y + y)*font->bw)); + data= g->bitmap + x + (yb * g->pitch); + a= data[0]/255.0f; + + if (a == 1.0) { + fbuf[0]= font->b_col[0]; + fbuf[1]= font->b_col[1]; + fbuf[2]= font->b_col[2]; + } + else { + fbuf[0]= (font->b_col[0]*a) + (fbuf[0] * (1-a)); + fbuf[1]= (font->b_col[1]*a) + (fbuf[1] * (1-a)); + fbuf[2]= (font->b_col[2]*a) + (fbuf[2] * (1-a)); + } + } + + if (g->pitch < 0) + yb++; + else + yb--; + } + } + + if (diff > 0) { + if (g->pitch < 0) + pen_x -= diff; + else + pen_y += diff; + } + else if (diff < 0) { + if (g->pitch < 0) + pen_x += diff; + else + pen_y -= diff; + } + + } + + pen_x += g->advance; + g_prev= g; } } @@ -155,7 +277,7 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box) unsigned int c; GlyphBLF *g, *g_prev; FT_Vector delta; - FT_UInt glyph_index, g_prev_index; + FT_UInt glyph_index; rctf gbox; int pen_x, pen_y; int i, has_kerning, st; @@ -173,17 +295,17 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box) pen_y= 0; has_kerning= FT_HAS_KERNING(font->face); g_prev= NULL; - g_prev_index= 0; while (str[i]) { c= blf_utf8_next((unsigned char *)str, &i); if (c == 0) break; - glyph_index= FT_Get_Char_Index(font->face, c); g= blf_glyph_search(font->glyph_cache, c); - if (!g) + if (!g) { + glyph_index= FT_Get_Char_Index(font->face, c); g= blf_glyph_add(font, glyph_index, c); + } /* if we don't found a glyph, skip it. */ if (!g) @@ -194,9 +316,9 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box) delta.y= 0; if (font->flags & BLF_KERNING_DEFAULT) - st= FT_Get_Kerning(font->face, g_prev_index, glyph_index, ft_kerning_default, &delta); + st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, ft_kerning_default, &delta); else - st= FT_Get_Kerning(font->face, g_prev_index, glyph_index, FT_KERNING_UNFITTED, &delta); + st= FT_Get_Kerning(font->face, g_prev->idx, g->idx, FT_KERNING_UNFITTED, &delta); if (st == 0) pen_x += delta.x >> 6; @@ -219,7 +341,6 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box) pen_x += g->advance; g_prev= g; - g_prev_index= glyph_index; } if (box->xmin > box->xmax) { @@ -230,6 +351,17 @@ void blf_font_boundbox(FontBLF *font, char *str, rctf *box) } } +void blf_font_width_and_height(FontBLF *font, char *str, float *width, float *height) +{ + rctf box; + + if (font->glyph_cache) { + blf_font_boundbox(font, str, &box); + *width= ((box.xmax - box.xmin) * font->aspect); + *height= ((box.ymax - box.ymin) * font->aspect); + } +} + float blf_font_width(FontBLF *font, char *str) { rctf box; @@ -311,6 +443,15 @@ void blf_font_fill(FontBLF *font) font->glyph_cache= NULL; font->blur= 0; font->max_tex_size= -1; + font->b_fbuf= NULL; + font->b_cbuf= NULL; + font->bw= 0; + font->bh= 0; + font->bch= 0; + font->b_col[0]= 0; + font->b_col[1]= 0; + font->b_col[2]= 0; + font->b_col[3]= 0; } FontBLF *blf_font_new(char *name, char *filename) diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index 78df8ff2bc6..f3db3ddc9a5 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -217,6 +217,7 @@ GlyphBLF *blf_glyph_add(FontBLF *font, FT_UInt index, unsigned int c) g->next= NULL; g->prev= NULL; g->c= c; + g->idx= index; g->tex= 0; g->build_tex= 0; g->bitmap= NULL; @@ -238,6 +239,7 @@ GlyphBLF *blf_glyph_add(FontBLF *font, FT_UInt index, unsigned int c) g->advance= ((float)slot->advance.x) / 64.0f; g->pos_x= slot->bitmap_left; g->pos_y= slot->bitmap_top; + g->pitch= slot->bitmap.pitch; FT_Outline_Get_CBox(&(slot->outline), &bbox); g->box.xmin= ((float)bbox.xMin) / 64.0f; diff --git a/source/blender/blenfont/intern/blf_internal.h b/source/blender/blenfont/intern/blf_internal.h index 30d5c8ede65..2a69b8652ea 100644 --- a/source/blender/blenfont/intern/blf_internal.h +++ b/source/blender/blenfont/intern/blf_internal.h @@ -45,7 +45,9 @@ void blf_font_attach_from_mem(FontBLF *font, const unsigned char *mem, int mem_s void blf_font_size(FontBLF *font, int size, int dpi); void blf_font_draw(FontBLF *font, char *str); +void blf_font_buffer(FontBLF *font, char *str); void blf_font_boundbox(FontBLF *font, char *str, rctf *box); +void blf_font_width_and_height(FontBLF *font, char *str, float *width, float *height); float blf_font_width(FontBLF *font, char *str); float blf_font_height(FontBLF *font, char *str); float blf_font_fixed_width(FontBLF *font); diff --git a/source/blender/blenfont/intern/blf_internal_types.h b/source/blender/blenfont/intern/blf_internal_types.h index d457225662f..fb4a2e6a9e5 100644 --- a/source/blender/blenfont/intern/blf_internal_types.h +++ b/source/blender/blenfont/intern/blf_internal_types.h @@ -85,6 +85,9 @@ typedef struct GlyphBLF { /* and the character, as UTF8 */ unsigned int c; + /* freetype2 index, to speed-up the search. */ + FT_UInt idx; + /* glyph box. */ rctf box; @@ -106,6 +109,7 @@ typedef struct GlyphBLF { /* glyph width and height. */ int width; int height; + int pitch; /* uv coords. */ float uv[2][2]; @@ -176,6 +180,22 @@ typedef struct FontBLF { /* freetype2 face. */ FT_Face face; + + /* for draw to buffer, always set this to NULL after finish! */ + float *b_fbuf; + + /* the same but unsigned char */ + unsigned char *b_cbuf; + + /* buffer size. */ + unsigned int bw; + unsigned int bh; + + /* number of channels. */ + int bch; + + /* and the color, the alphas is get from the glyph! */ + float b_col[4]; } FontBLF; typedef struct DirBLF { diff --git a/source/blender/blenkernel/intern/Makefile b/source/blender/blenkernel/intern/Makefile index 60ffdc78726..d6d41d6579e 100644 --- a/source/blender/blenkernel/intern/Makefile +++ b/source/blender/blenkernel/intern/Makefile @@ -51,6 +51,7 @@ CPPFLAGS += -I../../imbuf CPPFLAGS += -I../../blenlib CPPFLAGS += -I../../blenloader CPPFLAGS += -I../../python +CPPFLAGS += -I../../blenfont # also avi is used CPPFLAGS += -I../../avi CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 62af05fbc9a..eb8872c43a5 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -73,6 +73,8 @@ //XXX #include "BIF_editseq.h" +#include "BLF_api.h" + #include "PIL_time.h" #include "RE_pipeline.h" @@ -978,7 +980,6 @@ static void stampdata(Scene *scene, StampData *stamp_data, int do_prefix) if (do_prefix) strcpy(stamp_data->file, "File "); else strcpy(stamp_data->file, ""); } - stamp_data->note[0] = '\0'; } else { stamp_data->file[0] = '\0'; } @@ -1046,8 +1047,8 @@ static void stampdata(Scene *scene, StampData *stamp_data, int do_prefix) if (scene->r.stamp & R_STAMP_FRAME) { char format[32]; - if (do_prefix) sprintf(format, "Frame %%0%di\n", 1 + (int) log10(scene->r.efra)); - else sprintf(format, "%%0%di\n", 1 + (int) log10(scene->r.efra)); + if (do_prefix) sprintf(format, "Frame %%0%di", 1 + (int) log10(scene->r.efra)); + else sprintf(format, "%%0%di", 1 + (int) log10(scene->r.efra)); sprintf (stamp_data->frame, format, scene->r.cfra); } else { stamp_data->frame[0] = '\0'; @@ -1083,131 +1084,172 @@ static void stampdata(Scene *scene, StampData *stamp_data, int do_prefix) } } +// XXX - Bad level call. +extern int datatoc_bmonofont_ttf_size; +extern char datatoc_bmonofont_ttf[]; + +// XXX - copied from text_font_begin +static void stamp_font_begin(int size) +{ + static int mono= -1; + + if (mono == -1) + mono= BLF_load_mem("monospace", (unsigned char *)datatoc_bmonofont_ttf, datatoc_bmonofont_ttf_size); + + BLF_set(mono); + BLF_aspect(1.0); + BLF_size(size, 72); +} + void BKE_stamp_buf(Scene *scene, unsigned char *rect, float *rectf, int width, int height, int channels) { -#if 0 -// XXX -// This go back when BLF_draw_buffer is implemented - Diego struct StampData stamp_data; - - int x=1,y=1; - int font_height; - int text_width; - int text_pad; - struct BMF_Font *font; + float w, h, pad; + int x, y; if (!rect && !rectf) return; stampdata(scene, &stamp_data, 1); - - switch (scene->r.stamp_font_id) { - case 1: /* tiny */ - font = BMF_GetFont(BMF_kHelveticaBold8); - break; - case 2: /* small */ - font = BMF_GetFont(BMF_kHelveticaBold10); - break; - case 3: /* medium */ - font = BMF_GetFont(BMF_kScreen12); - break; - case 0: /* large - default */ - font = BMF_GetFont(BMF_kScreen15); - break; - case 4: /* huge */ - font = BMF_GetFont(BMF_kHelveticaBold14); - break; - default: - font = NULL; - break; - } - - font_height = BMF_GetFontHeight(font); - /* All texts get halfspace+1 pixel on each side and 1 pix - above and below as padding against their backing rectangles */ - text_pad = BMF_GetStringWidth(font, " "); - - x = 1; /* Inits for everyone, text position, so 1 for padding, not 0 */ - y = height - font_height - 1; /* Also inits for everyone, notice padding pixel */ - + stamp_font_begin(12); + + BLF_buffer(rectf, rect, width, height, channels); + BLF_buffer_col(scene->r.fg_stamp[0], scene->r.fg_stamp[1], scene->r.fg_stamp[2], 1.0); + pad= BLF_width("--"); + + x= 0; + y= height; + if (stamp_data.file[0]) { /* Top left corner */ - text_width = BMF_GetStringWidth(font, stamp_data.file); - buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1); - BMF_DrawStringBuf(font, stamp_data.file, x+(text_pad/2), y, scene->r.fg_stamp, rect, rectf, width, height, channels); - y -= font_height+2; /* Top and bottom 1 pix padding each */ + BLF_width_and_height(stamp_data.file, &w, &h); + y -= h; + + /* also a little of space to the background. */ + buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y-3, w+3, y+h+3); + + /* and draw the text. */ + BLF_position(x, y, 0.0); + BLF_draw_buffer(stamp_data.file); + + /* the extra pixel for background. */ + y -= 4; } /* Top left corner, below File */ if (stamp_data.note[0]) { - text_width = BMF_GetStringWidth(font, stamp_data.note); - buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1); - BMF_DrawStringBuf(font, stamp_data.note, x+(text_pad/2), y, scene->r.fg_stamp, rect, rectf, width, height, channels); - y -= font_height+2; /* Top and bottom 1 pix padding each */ + BLF_width_and_height(stamp_data.note, &w, &h); + y -= h; + + /* and space for background. */ + buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-2, w+3, y+h+2); + + BLF_position(x, y+1, 0.0); + BLF_draw_buffer(stamp_data.note); + + /* the extra pixel for background. */ + y -= 4; } /* Top left corner, below File (or Note) */ if (stamp_data.date[0]) { - text_width = BMF_GetStringWidth(font, stamp_data.date); - buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1); - BMF_DrawStringBuf(font, stamp_data.date, x+(text_pad/2), y, scene->r.fg_stamp, rect, rectf, width, height, channels); + BLF_width_and_height(stamp_data.date, &w, &h); + y -= h; + + /* and space for background. */ + buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-3, w+3, y+h+3); + + BLF_position(x, y, 0.0); + BLF_draw_buffer(stamp_data.date); } + x= 0; + y= 0; + /* Bottom left corner, leaving space for timing */ if (stamp_data.marker[0]) { - x = 1; - y = font_height+2+1; /* 2 for padding in TIME|FRAME fields below and 1 for padding in this one */ - text_width = BMF_GetStringWidth(font, stamp_data.marker); - buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1); - BMF_DrawStringBuf(font, stamp_data.marker, x+(text_pad/2), y, scene->r.fg_stamp, rect, rectf, width, height, channels); + BLF_width_and_height(stamp_data.marker, &w, &h); + + /* extra space for background. */ + buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, w+2, y+h+3); + + /* and pad the text. */ + BLF_position(x, y+3, 0.0); + BLF_draw_buffer(stamp_data.marker); + + /* space width. */ + x += w + pad; } /* Left bottom corner */ if (stamp_data.time[0]) { - x = 1; - y = 1; - text_width = BMF_GetStringWidth(font, stamp_data.time); - buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1); - BMF_DrawStringBuf(font, stamp_data.time, x+(text_pad/2), y, scene->r.fg_stamp, rect, rectf, width, height, channels); - x += text_width+text_pad+2; /* Both sides have 1 pix additional padding each */ + BLF_width_and_height(stamp_data.time, &w, &h); + + /* extra space for background */ + buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+3); + + /* and pad the text. */ + BLF_position(x, y+3, 0.0); + BLF_draw_buffer(stamp_data.time); + + /* space width. */ + x += w + pad; } if (stamp_data.frame[0]) { - text_width = BMF_GetStringWidth(font, stamp_data.frame); - /* Left bottom corner (after SMPTE if exists) */ - if (!stamp_data.time[0]) x = 1; - y = 1; - buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1); - BMF_DrawStringBuf(font, stamp_data.frame, x+(text_pad/2), y, scene->r.fg_stamp, rect, rectf, width, height, channels); + BLF_width_and_height(stamp_data.frame, &w, &h); + + /* extra space for background. */ + buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+3); + + /* and pad the text. */ + BLF_position(x, y+3, 0.0); + + BLF_draw_buffer(stamp_data.frame); + + /* space width. */ + x += w + pad; } if (stamp_data.camera[0]) { - text_width = BMF_GetStringWidth(font, stamp_data.camera); - /* Center of bottom edge */ - x = (width/2) - (BMF_GetStringWidth(font, stamp_data.camera)/2); - y = 1; - buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1); - BMF_DrawStringBuf(font, stamp_data.camera, x+(text_pad/2), y, scene->r.fg_stamp, rect, rectf, width, height, channels); + BLF_width_and_height(stamp_data.camera, &w, &h); + + /* extra space for background. */ + buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+3); + BLF_position(x, y+3, 0.0); + BLF_draw_buffer(stamp_data.camera); } if (stamp_data.scene[0]) { - text_width = BMF_GetStringWidth(font, stamp_data.scene); - /* Bottom right corner */ - x = width - (text_width+1+text_pad); - y = 1; - buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1); - BMF_DrawStringBuf(font, stamp_data.scene, x+(text_pad/2), y, scene->r.fg_stamp, rect, rectf, width, height, channels); + BLF_width_and_height(stamp_data.scene, &w, &h); + + /* Bottom right corner, with an extra space because blenfont is too strict! */ + x= width - w - 2; + + /* extra space for background. */ + buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+3, y+h+3); + + /* and pad the text. */ + BLF_position(x, y+3, 0.0); + BLF_draw_buffer(stamp_data.scene); } if (stamp_data.strip[0]) { - text_width = BMF_GetStringWidth(font, stamp_data.strip); - /* Top right corner */ - x = width - (text_width+1+text_pad); - y = height - font_height - 1; - buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x-1, y-1, x+text_width+text_pad+1, y+font_height+1); - BMF_DrawStringBuf(font, stamp_data.strip, x+(text_pad/2), y, scene->r.fg_stamp, rect, rectf, width, height, channels); + BLF_width_and_height(stamp_data.scene, &w, &h); + + /* Top right corner, with an extra space because blenfont is too strict! */ + x= width - w - pad; + y= height - h; + + /* extra space for background. */ + buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y-3, x+w+pad, y+h+3); + + BLF_position(x, y, 0.0); + BLF_draw_buffer(stamp_data.strip); } -#endif // 0 XXX + + /* cleanup the buffer. */ + BLF_buffer(NULL, NULL, 0, 0, 0); } void BKE_stamp_info(Scene *scene, struct ImBuf *ibuf) From c9795eae45c278460e27ae7f5937ca9bd1300531 Mon Sep 17 00:00:00 2001 From: Robin Allen Date: Tue, 18 Aug 2009 19:58:27 +0000 Subject: [PATCH 127/577] Fixed the texture preview to work with multi-output node-based textures. --- release/ui/buttons_texture.py | 11 ++++--- .../editors/include/ED_previewrender.h | 5 +-- source/blender/editors/include/UI_interface.h | 5 +-- source/blender/editors/interface/interface.c | 5 +-- .../editors/interface/interface_intern.h | 5 +-- .../editors/interface/interface_templates.c | 4 +-- .../editors/interface/interface_widgets.c | 2 +- .../blender/editors/preview/previewrender.c | 13 ++++++-- .../blender/editors/space_node/space_node.c | 2 +- source/blender/makesrna/intern/rna_texture.c | 32 ++++++++++++++++--- source/blender/makesrna/intern/rna_ui_api.c | 1 + 11 files changed, 60 insertions(+), 25 deletions(-) diff --git a/release/ui/buttons_texture.py b/release/ui/buttons_texture.py index 18c836f9080..29e43981fd2 100644 --- a/release/ui/buttons_texture.py +++ b/release/ui/buttons_texture.py @@ -17,21 +17,22 @@ class TEXTURE_PT_preview(TextureButtonsPanel): layout = self.layout tex = context.texture + slot = context.texture_slot ma = context.material la = context.lamp wo = context.world br = context.brush if ma: - layout.template_preview(tex, parent=ma) + layout.template_preview(tex, parent=ma, slot=slot) elif la: - layout.template_preview(tex, parent=la) + layout.template_preview(tex, parent=la, slot=slot) elif wo: - layout.template_preview(tex, parent=wo) + layout.template_preview(tex, parent=wo, slot=slot) elif br: - layout.template_preview(tex, parent=br) + layout.template_preview(tex, parent=br, slot=slot) else: - layout.template_preview(tex) + layout.template_preview(tex, slot=slot) class TEXTURE_PT_context_texture(TextureButtonsPanel): __show_header__ = False diff --git a/source/blender/editors/include/ED_previewrender.h b/source/blender/editors/include/ED_previewrender.h index 41cbecb5353..7e0d71db7e1 100644 --- a/source/blender/editors/include/ED_previewrender.h +++ b/source/blender/editors/include/ED_previewrender.h @@ -34,6 +34,7 @@ struct Image; struct Render; struct bContext; struct ID; +struct MTex; #define PREVIEW_RENDERSIZE 140 @@ -70,9 +71,9 @@ pr_method: void ED_preview_init_dbase(void); void ED_preview_free_dbase(void); -void ED_preview_shader_job(const struct bContext *C, void *owner, struct ID *id, struct ID *parent, int sizex, int sizey); +void ED_preview_shader_job(const struct bContext *C, void *owner, struct ID *id, struct ID *parent, struct MTex *slot, int sizex, int sizey); void ED_preview_iconrender(struct Scene *scene, struct ID *id, unsigned int *rect, int sizex, int sizey); -void ED_preview_draw(const struct bContext *C, void *idp, void *parentp, rcti *rect); +void ED_preview_draw(const struct bContext *C, void *idp, void *parentp, void *slot, rcti *rect); #endif diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 8da2702b603..46da4b507a7 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -60,6 +60,7 @@ struct Image; struct ImageUser; struct uiWidgetColors; struct Tex; +struct MTex; typedef struct uiBut uiBut; typedef struct uiBlock uiBlock; @@ -490,7 +491,7 @@ void uiButSetNFunc (uiBut *but, uiButHandleNFunc func, void *argN, void *arg2) void uiButSetCompleteFunc(uiBut *but, uiButCompleteFunc func, void *arg); -void uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)(const struct bContext *C, void *, void *, struct rcti *rect), void *arg); +void uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)(const struct bContext *C, void *, void *, void *, struct rcti *rect), void *arg1, void *arg2); /* Autocomplete * @@ -630,7 +631,7 @@ void uiTemplateID(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *newop, char *unlinkop); uiLayout *uiTemplateModifier(uiLayout *layout, struct PointerRNA *ptr); uiLayout *uiTemplateConstraint(uiLayout *layout, struct PointerRNA *ptr); -void uiTemplatePreview(uiLayout *layout, struct ID *id, struct ID *parent); +void uiTemplatePreview(uiLayout *layout, struct ID *id, struct ID *parent, struct MTex *slot); void uiTemplateColorRamp(uiLayout *layout, struct ColorBand *coba, int expand); void uiTemplateCurveMapping(uiLayout *layout, struct CurveMapping *cumap, int type, int compact); void uiTemplateTriColorSet(uiLayout *layout, struct PointerRNA *ptr, char *propname); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 4f6c6db3b16..92a3a4cf841 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -2931,10 +2931,11 @@ void uiButSetRenameFunc(uiBut *but, uiButHandleRenameFunc func, void *arg1) but->rename_arg1= arg1; } -void uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)(const bContext *C, void *idv, void *argv, rcti *rect), void *arg) +void uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)(const bContext *C, void *idv, void *arg1, void *arg2, rcti *rect), void *arg1, void *arg2) { block->drawextra= func; - block->drawextra_arg= arg; + block->drawextra_arg1= arg1; + block->drawextra_arg2= arg2; } void uiButSetFunc(uiBut *but, uiButHandleFunc func, void *arg1, void *arg2) diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index fbf95a4cde8..9ef5d65b69f 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -273,8 +273,9 @@ struct uiBlock { int (*block_event_func)(const struct bContext *C, struct uiBlock *, struct wmEvent *); /* extra draw function for custom blocks */ - void (*drawextra)(const struct bContext *C, void *idv, void *argv, rcti *rect); - void *drawextra_arg; + void (*drawextra)(const struct bContext *C, void *idv, void *arg1, void *arg2, rcti *rect); + void *drawextra_arg1; + void *drawextra_arg2; int afterval, flag; diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 0ee21cbcf77..0557512cc2a 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1088,7 +1088,7 @@ static void do_preview_buttons(bContext *C, void *arg, int event) } } -void uiTemplatePreview(uiLayout *layout, ID *id, ID *parent) +void uiTemplatePreview(uiLayout *layout, ID *id, ID *parent, MTex *slot) { uiLayout *row, *col; uiBlock *block; @@ -1129,7 +1129,7 @@ void uiTemplatePreview(uiLayout *layout, ID *id, ID *parent) /* add preview */ uiDefBut(block, BUT_EXTRA, 0, "", 0, 0, UI_UNIT_X*6, UI_UNIT_Y*6, pid, 0.0, 0.0, 0, 0, ""); - uiBlockSetDrawExtraFunc(block, ED_preview_draw, pparent); + uiBlockSetDrawExtraFunc(block, ED_preview_draw, pparent, slot); uiBlockSetHandleFunc(block, do_preview_buttons, NULL); /* add buttons */ diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index cea3038b901..2e0f0897af4 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2065,7 +2065,7 @@ static void widget_draw_extra_mask(const bContext *C, uiBut *but, uiWidgetType * if(but->block->drawextra) { /* note: drawextra can change rect +1 or -1, to match round errors of existing previews */ - but->block->drawextra(C, but->poin, but->block->drawextra_arg, rect); + but->block->drawextra(C, but->poin, but->block->drawextra_arg1, but->block->drawextra_arg2, rect); /* make mask to draw over image */ UI_GetThemeColor3ubv(TH_BACK, col); diff --git a/source/blender/editors/preview/previewrender.c b/source/blender/editors/preview/previewrender.c index 159e644bb39..8fcf65202ee 100644 --- a/source/blender/editors/preview/previewrender.c +++ b/source/blender/editors/preview/previewrender.c @@ -113,6 +113,7 @@ typedef struct ShaderPreview { Scene *scene; ID *id; ID *parent; + MTex *slot; int sizex, sizey; int *pr_rect; @@ -364,6 +365,10 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre Material *mat= give_current_material(base->object, base->object->actcol); if(mat && mat->mtex[0]) { mat->mtex[0]->tex= tex; + + if(sp && sp->slot) + mat->mtex[0]->which_output = sp->slot->which_output; + /* show alpha in this case */ if(tex==NULL || (tex->flag & TEX_PRV_ALPHA)) { mat->mtex[0]->mapto |= MAP_ALPHA; @@ -457,13 +462,14 @@ static int ed_preview_draw_rect(ScrArea *sa, Scene *sce, ID *id, int split, int return 0; } -void ED_preview_draw(const bContext *C, void *idp, void *parentp, rcti *rect) +void ED_preview_draw(const bContext *C, void *idp, void *parentp, void *slotp, rcti *rect) { if(idp) { ScrArea *sa= CTX_wm_area(C); Scene *sce = CTX_data_scene(C); ID *id = (ID *)idp; ID *parent= (ID *)parentp; + MTex *slot= (MTex *)slotp; SpaceButs *sbuts= sa->spacedata.first; rcti newrect; int ok; @@ -491,7 +497,7 @@ void ED_preview_draw(const bContext *C, void *idp, void *parentp, rcti *rect) } if(ok==0) { - ED_preview_shader_job(C, sa, id, parent, newx, newy); + ED_preview_shader_job(C, sa, id, parent, slot, newx, newy); } } } @@ -932,7 +938,7 @@ static void shader_preview_free(void *customdata) MEM_freeN(sp); } -void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, int sizex, int sizey) +void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, MTex *slot, int sizex, int sizey) { wmJob *steve; ShaderPreview *sp; @@ -952,6 +958,7 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, i sp->pr_method= PR_DO_RENDER; sp->id = id; sp->parent= parent; + sp->slot= slot; /* setup job */ WM_jobs_customdata(steve, sp, shader_preview_free); diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index 5db9d7331b8..07277fe878d 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -174,7 +174,7 @@ static void node_area_refresh(const struct bContext *C, struct ScrArea *sa) if(snode->treetype==NTREE_SHADER) { Material *ma= (Material *)snode->id; if(ma->use_nodes) - ED_preview_shader_job(C, sa, snode->id, NULL, 100, 100); + ED_preview_shader_job(C, sa, snode->id, NULL, NULL, 100, 100); } else if(snode->treetype==NTREE_COMPOSIT) { Scene *scene= (Scene *)snode->id; diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 76cb9986306..a5737536b7d 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -110,6 +110,30 @@ static void rna_TextureSlot_name_get(PointerRNA *ptr, char *str) strcpy(str, ""); } +static int rna_TextureSlot_output_node_get(PointerRNA *ptr) +{ + MTex *mtex= ptr->data; + Tex *tex= mtex->tex; + int cur= mtex->which_output; + + if(tex) { + bNodeTree *ntree= tex->nodetree; + bNode *node; + if(ntree) { + for(node= ntree->nodes.first; node; node= node->next) { + if(node->type == TEX_NODE_OUTPUT) { + if(cur == node->custom1) + return cur; + } + } + } + } + + mtex->which_output= 0; + return 0; +} + + static EnumPropertyItem *rna_TextureSlot_output_node_itemf(bContext *C, PointerRNA *ptr, int *free) { MTex *mtex= ptr->data; @@ -117,11 +141,9 @@ static EnumPropertyItem *rna_TextureSlot_output_node_itemf(bContext *C, PointerR EnumPropertyItem *item= NULL; int totitem= 0; - if(tex) - { + if(tex) { bNodeTree *ntree= tex->nodetree; - if(ntree) - { + if(ntree) { EnumPropertyItem tmp= {0, "", 0, "", ""}; bNode *node; @@ -433,7 +455,7 @@ static void rna_def_mtex(BlenderRNA *brna) prop= RNA_def_property(srna, "output_node", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "which_output"); RNA_def_property_enum_items(prop, output_node_items); - RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_TextureSlot_output_node_itemf"); + RNA_def_property_enum_funcs(prop, "rna_TextureSlot_output_node_get", NULL, "rna_TextureSlot_output_node_itemf"); RNA_def_property_ui_text(prop, "Output Node", "Which output node to use, for node-based textures."); RNA_def_property_update(prop, NC_TEXTURE, NULL); } diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index f9287bddc10..82694098e69 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -244,6 +244,7 @@ void RNA_api_ui_layout(StructRNA *srna) parm= RNA_def_pointer(func, "id", "ID", "", "ID datablock."); RNA_def_property_flag(parm, PROP_REQUIRED); parm= RNA_def_pointer(func, "parent", "ID", "", "ID datablock."); + parm= RNA_def_pointer(func, "slot", "TextureSlot", "", "Texture slot."); func= RNA_def_function(srna, "template_curve_mapping", "uiTemplateCurveMapping"); parm= RNA_def_pointer(func, "curvemap", "CurveMapping", "", "Curve mapping pointer."); From 074797731707fbfbd679095f0987478c05113c4d Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Tue, 18 Aug 2009 20:24:40 +0000 Subject: [PATCH 128/577] SVN maintenance. --- intern/guardedalloc/cpp/mallocn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intern/guardedalloc/cpp/mallocn.cpp b/intern/guardedalloc/cpp/mallocn.cpp index bb2839c7986..0ee22e734b9 100644 --- a/intern/guardedalloc/cpp/mallocn.cpp +++ b/intern/guardedalloc/cpp/mallocn.cpp @@ -1,5 +1,5 @@ /** - * $Id: mallocn.c 21060 2009-06-21 16:37:13Z campbellbarton $ + * $Id$ * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or From 05dec4a9d848c33e118c08d4e1067f8f10ebe901 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Tue, 18 Aug 2009 20:47:31 +0000 Subject: [PATCH 129/577] Scons compile fix. Missing blenfont directory, caused error. --- source/blender/blenkernel/SConscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript index 261d5ee1471..fdc7782a0b1 100644 --- a/source/blender/blenkernel/SConscript +++ b/source/blender/blenkernel/SConscript @@ -3,7 +3,7 @@ Import ('env') sources = env.Glob('intern/*.c') -incs = '. #/intern/guardedalloc #/intern/memutil ../editors/include ../blenlib ../makesdna' +incs = '. #/intern/guardedalloc #/intern/memutil ../editors/include ../blenlib ../blenfont ../makesdna' incs += ' ../render/extern/include #/intern/decimation/extern ../makesrna' incs += ' ../imbuf ../avi #/intern/elbeem/extern ../nodes' incs += ' #/intern/iksolver/extern ../blenloader' From 80cbcfed2740d252551baf3542502a240a59129b Mon Sep 17 00:00:00 2001 From: Robin Allen Date: Tue, 18 Aug 2009 21:10:03 +0000 Subject: [PATCH 130/577] Fixed redraw issues in texture node tree. --- source/blender/editors/space_node/space_node.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index 07277fe878d..877f9133e4a 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -181,6 +181,9 @@ static void node_area_refresh(const struct bContext *C, struct ScrArea *sa) if(scene->use_nodes) snode_composite_job(C, sa); } + else if(snode->treetype==NTREE_TEXTURE) { + ntreeTexUpdatePreviews(snode->nodetree); + } } } From d96edd041ef18e53eb47aebdac94b2030979fc32 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Tue, 18 Aug 2009 21:14:36 +0000 Subject: [PATCH 131/577] 2.5: * Fixed CMake includes for blenkernel * Fixed an RNA property read that was causing failures in a couple paint modes --- source/blender/blenkernel/CMakeLists.txt | 2 +- source/blender/editors/physics/editparticle.c | 10 ++++++---- source/blender/editors/sculpt_paint/paint_image.c | 12 ++++++++---- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index 516845b5b76..8d1df98c5b4 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -32,7 +32,7 @@ SET(INC ../imbuf ../avi ../../../intern/elbeem/extern ../../../intern/opennl/extern ../../../intern/iksolver/extern ../blenloader ../nodes ../../../extern/glew/include ../gpu ../makesrna ../../../intern/smoke/extern - ../../../intern/bsp/extern + ../../../intern/bsp/extern ../blenfont ../../../intern/audaspace/intern ${ZLIB_INC} ) diff --git a/source/blender/editors/physics/editparticle.c b/source/blender/editors/physics/editparticle.c index 0317a500196..b92632b45af 100644 --- a/source/blender/editors/physics/editparticle.c +++ b/source/blender/editors/physics/editparticle.c @@ -3068,11 +3068,13 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) ParticleSystemModifierData *psmd= psys_get_modifier(ob, psys); ParticleBrushData *brush= &pset->brush[pset->brushtype]; ARegion *ar= CTX_wm_region(C); - float vec1[3], vec2[3]; + float vec1[3], vec2[3], mousef[2]; short mval[2], mvalo[2]; int flip, mouse[2], dx, dy, removed= 0, selected= 0; - RNA_int_get_array(itemptr, "mouse", mouse); + RNA_float_get_array(itemptr, "mouse", mousef); + mouse[0] = mousef[0]; + mouse[1] = mousef[1]; flip= RNA_boolean_get(itemptr, "flip"); if(bedit->first) { @@ -3283,7 +3285,7 @@ static void brush_edit_apply_event(bContext *C, wmOperator *op, wmEvent *event) { ARegion *ar= CTX_wm_region(C); PointerRNA itemptr; - int mouse[2]; + float mouse[2]; mouse[0]= event->x - ar->winrct.xmin; mouse[1]= event->y - ar->winrct.ymin; @@ -3291,7 +3293,7 @@ static void brush_edit_apply_event(bContext *C, wmOperator *op, wmEvent *event) /* fill in stroke */ RNA_collection_add(op->ptr, "stroke", &itemptr); - RNA_int_set_array(&itemptr, "mouse", mouse); + RNA_float_set_array(&itemptr, "mouse", mouse); RNA_boolean_set(&itemptr, "flip", event->shift != 0); // XXX hardcoded /* apply */ diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 975bfd8dbe7..465aa281e25 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -4612,11 +4612,13 @@ static int texture_paint_init(bContext *C, wmOperator *op) static void paint_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) { PaintOperation *pop= op->customdata; - float time; + float time, mousef[2]; float pressure; int mouse[2], redraw; - RNA_int_get_array(itemptr, "mouse", mouse); + RNA_float_get_array(itemptr, "mouse", mousef); + mouse[0] = mousef[0]; + mouse[1] = mousef[1]; time= RNA_float_get(itemptr, "time"); pressure= RNA_float_get(itemptr, "pressure"); @@ -4696,7 +4698,7 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event) PaintOperation *pop= op->customdata; wmTabletData *wmtab; PointerRNA itemptr; - float pressure; + float pressure, mousef[2]; double time; int tablet, mouse[2]; @@ -4737,7 +4739,9 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event) /* fill in stroke */ RNA_collection_add(op->ptr, "stroke", &itemptr); - RNA_int_set_array(&itemptr, "mouse", mouse); + mousef[0] = mouse[0]; + mousef[1] = mouse[1]; + RNA_float_set_array(&itemptr, "mouse", mousef); RNA_float_set(&itemptr, "time", (float)(time - pop->starttime)); RNA_float_set(&itemptr, "pressure", pressure); From d37d6738946bfecd2cf15f13e3067325bb227542 Mon Sep 17 00:00:00 2001 From: Robin Allen Date: Tue, 18 Aug 2009 21:19:29 +0000 Subject: [PATCH 132/577] Fix for my previous fix. --- source/blender/editors/space_node/node_draw.c | 1 + source/blender/editors/space_node/space_node.c | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index f3df7a29c2e..93e7505693f 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -609,6 +609,7 @@ static void do_node_internal_buttons(bContext *C, void *node_v, int event) } else if(snode->treetype==NTREE_TEXTURE) { WM_event_add_notifier(C, NC_TEXTURE|ND_NODES, snode->id); + ntreeTexUpdatePreviews(snode->nodetree); } } diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index 877f9133e4a..07277fe878d 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -181,9 +181,6 @@ static void node_area_refresh(const struct bContext *C, struct ScrArea *sa) if(scene->use_nodes) snode_composite_job(C, sa); } - else if(snode->treetype==NTREE_TEXTURE) { - ntreeTexUpdatePreviews(snode->nodetree); - } } } From e21c1dde810b3447eaa1f6a667ae027978b18d9b Mon Sep 17 00:00:00 2001 From: Robin Allen Date: Wed, 19 Aug 2009 00:46:06 +0000 Subject: [PATCH 133/577] Texture node previews: Well and truly fixed. (Probably.) --- source/blender/editors/space_node/node_draw.c | 1 - source/blender/editors/space_node/space_node.c | 6 ++++++ source/blender/nodes/intern/TEX_util.c | 12 +++++------- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index 93e7505693f..f3df7a29c2e 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -609,7 +609,6 @@ static void do_node_internal_buttons(bContext *C, void *node_v, int event) } else if(snode->treetype==NTREE_TEXTURE) { WM_event_add_notifier(C, NC_TEXTURE|ND_NODES, snode->id); - ntreeTexUpdatePreviews(snode->nodetree); } } diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index 07277fe878d..20873566867 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -46,6 +46,7 @@ #include "BKE_colortools.h" #include "BKE_context.h" #include "BKE_screen.h" +#include "BKE_node.h" #include "ED_previewrender.h" #include "ED_space_api.h" @@ -181,6 +182,11 @@ static void node_area_refresh(const struct bContext *C, struct ScrArea *sa) if(scene->use_nodes) snode_composite_job(C, sa); } + else if(snode->treetype==NTREE_TEXTURE) { + Tex *tex= (Tex *)snode->id; + if(tex->use_nodes) + ntreeTexUpdatePreviews(tex->nodetree); + } } } diff --git a/source/blender/nodes/intern/TEX_util.c b/source/blender/nodes/intern/TEX_util.c index 0bb9d887ae3..a6a5877722b 100644 --- a/source/blender/nodes/intern/TEX_util.c +++ b/source/blender/nodes/intern/TEX_util.c @@ -246,14 +246,12 @@ void ntreeTexUpdatePreviews(bNodeTree* nodetree) for(tex= G.main->tex.first; tex; tex= tex->id.next) if(tex->nodetree == nodetree) break; - if(!tex) return; - - dummy_texres.nor = 0; - - ntreeBeginExecTree(nodetree); - ntreeTexExecTree(nodetree, &dummy_texres, coord, 0, 0, 1, 0, tex, 0, 0); - ntreeEndExecTree(nodetree); + if(tex) { + dummy_texres.nor = 0; + ntreeBeginExecTree(nodetree); + ntreeTexExecTree(nodetree, &dummy_texres, coord, 0, 0, 1, 0, tex, 0, 0); + } } char* ntreeTexOutputMenu(bNodeTree *ntree) From 184ac26dd0187d70985cdc49ae527a1900fce840 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 19 Aug 2009 00:55:30 +0000 Subject: [PATCH 134/577] 2.5: Headers * Fix header menu spacing bug, and make it consistent for all headers. * For consistency, always put menus first in the header, then any enums to switch the type of data displayed. * Node editor header ported to python layout. Still quite a few operators missing to make the menus complete. * RNA wrapped node editor, and added use_nodes property to material and scene. --- release/ui/space_buttons.py | 7 +- release/ui/space_console.py | 27 +- release/ui/space_filebrowser.py | 2 +- release/ui/space_image.py | 15 +- release/ui/space_info.py | 17 +- release/ui/space_node.py | 121 ++++ release/ui/space_outliner.py | 7 +- release/ui/space_sequencer.py | 30 +- release/ui/space_text.py | 21 +- release/ui/space_time.py | 11 +- release/ui/space_view3d.py | 17 +- source/blender/editors/armature/poselib.c | 2 +- source/blender/editors/include/ED_node.h | 9 + source/blender/editors/include/UI_interface.h | 2 +- .../editors/interface/interface_layout.c | 24 +- .../editors/interface/interface_widgets.c | 2 +- .../editors/space_action/action_header.c | 14 +- .../editors/space_graph/graph_header.c | 12 +- source/blender/editors/space_nla/nla_header.c | 4 +- source/blender/editors/space_node/node_edit.c | 33 +- .../blender/editors/space_node/node_header.c | 670 +++--------------- .../blender/editors/space_node/node_intern.h | 5 +- .../blender/editors/space_node/node_state.c | 6 +- .../blender/editors/space_node/space_node.c | 34 +- .../blender/editors/space_text/text_header.c | 23 +- .../editors/space_view3d/view3d_header.c | 48 +- source/blender/makesrna/intern/rna_main.c | 2 +- source/blender/makesrna/intern/rna_material.c | 17 + source/blender/makesrna/intern/rna_scene.c | 24 +- source/blender/makesrna/intern/rna_space.c | 44 ++ source/blender/makesrna/intern/rna_texture.c | 6 +- source/blender/windowmanager/WM_types.h | 1 + 32 files changed, 510 insertions(+), 747 deletions(-) create mode 100644 release/ui/space_node.py diff --git a/release/ui/space_buttons.py b/release/ui/space_buttons.py index cf1c385e3dc..3cf782e615f 100644 --- a/release/ui/space_buttons.py +++ b/release/ui/space_buttons.py @@ -10,11 +10,12 @@ class Buttons_HT_header(bpy.types.Header): so = context.space_data scene = context.scene - layout.template_header() + row= layout.row(align=True) + row.template_header() if context.area.show_menus: - row = layout.row(align=True) - row.itemM("Buttons_MT_view", text="View") + sub = row.row(align=True) + sub.itemM("Buttons_MT_view", text="View") row = layout.row() row.itemR(so, "buttons_context", expand=True, text="") diff --git a/release/ui/space_console.py b/release/ui/space_console.py index 2cf41a1f88f..45cb2a856e1 100644 --- a/release/ui/space_console.py +++ b/release/ui/space_console.py @@ -12,17 +12,22 @@ class CONSOLE_HT_header(bpy.types.Header): # text = sc.text layout = self.layout - layout.template_header() + row= layout.row(align=True) + row.template_header() - row = layout.row() - row.itemR(sc, "console_type", expand=True) + if context.area.show_menus: + sub = row.row(align=True) + + if sc.console_type == 'REPORT': + sub.itemM("CONSOLE_MT_report") + else: + sub.itemM("CONSOLE_MT_console") + + layout.itemS() + layout.itemR(sc, "console_type", expand=True) if sc.console_type == 'REPORT': - - if context.area.show_menus: - row = layout.row() - row.itemM("CONSOLE_MT_report") - + row = layout.row(align=True) row.itemR(sc, "show_report_debug", text="Debug") row.itemR(sc, "show_report_info", text="Info") row.itemR(sc, "show_report_operator", text="Operators") @@ -32,12 +37,6 @@ class CONSOLE_HT_header(bpy.types.Header): row = layout.row() row.enabled = sc.show_report_operator row.itemO("console.report_replay") - - else: - if context.area.show_menus: - row = layout.row() - row.itemM("CONSOLE_MT_console") - class CONSOLE_MT_console(bpy.types.Menu): __space_type__ = "CONSOLE" diff --git a/release/ui/space_filebrowser.py b/release/ui/space_filebrowser.py index 0fecbdbfbba..51a8f3f78e8 100644 --- a/release/ui/space_filebrowser.py +++ b/release/ui/space_filebrowser.py @@ -10,7 +10,7 @@ class FILEBROWSER_HT_header(bpy.types.Header): layout = self.layout params = st.params - layout.template_header() + layout.template_header(menus=False) row = layout.row(align=True) row.itemO("file.parent", text="", icon='ICON_FILE_PARENT') diff --git a/release/ui/space_image.py b/release/ui/space_image.py index 7154bb8ae1c..090067120b1 100644 --- a/release/ui/space_image.py +++ b/release/ui/space_image.py @@ -205,23 +205,24 @@ class IMAGE_HT_header(bpy.types.Header): show_paint = sima.show_paint show_uvedit = sima.show_uvedit - layout.template_header() + row = layout.row(align=True) + row.template_header() # menus if context.area.show_menus: - row = layout.row() - row.itemM("IMAGE_MT_view") + sub = row.row(align=True) + sub.itemM("IMAGE_MT_view") if show_uvedit: - row.itemM("IMAGE_MT_select") + sub.itemM("IMAGE_MT_select") if ima and ima.dirty: - row.itemM("IMAGE_MT_image", text="Image*") + sub.itemM("IMAGE_MT_image", text="Image*") else: - row.itemM("IMAGE_MT_image", text="Image") + sub.itemM("IMAGE_MT_image", text="Image") if show_uvedit: - row.itemM("IMAGE_MT_uvs") + sub.itemM("IMAGE_MT_uvs") layout.template_ID(sima, "image", new="image.new") diff --git a/release/ui/space_info.py b/release/ui/space_info.py index e0b5c770f29..770387498a2 100644 --- a/release/ui/space_info.py +++ b/release/ui/space_info.py @@ -9,18 +9,19 @@ class INFO_HT_header(bpy.types.Header): st = context.space_data rd = context.scene.render_data - - layout.template_header() + + row = layout.row(align=True) + row.template_header() if context.area.show_menus: - row = layout.row() - row.itemM("INFO_MT_file") - row.itemM("INFO_MT_add") + sub = row.row(align=True) + sub.itemM("INFO_MT_file") + sub.itemM("INFO_MT_add") if rd.use_game_engine: - row.itemM("INFO_MT_game") + sub.itemM("INFO_MT_game") else: - row.itemM("INFO_MT_render") - row.itemM("INFO_MT_help") + sub.itemM("INFO_MT_render") + sub.itemM("INFO_MT_help") layout.template_ID(context.window, "screen", new="screen.new", unlink="screen.delete") layout.template_ID(context.screen, "scene", new="scene.new", unlink="scene.delete") diff --git a/release/ui/space_node.py b/release/ui/space_node.py new file mode 100644 index 00000000000..2e28cfc2eed --- /dev/null +++ b/release/ui/space_node.py @@ -0,0 +1,121 @@ + +import bpy + +class NODE_HT_header(bpy.types.Header): + __space_type__ = "NODE_EDITOR" + + def draw(self, context): + layout = self.layout + snode = context.space_data + + row = layout.row(align=True) + row.template_header() + + if context.area.show_menus: + sub = row.row(align=True) + sub.itemM("NODE_MT_view") + sub.itemM("NODE_MT_select") + sub.itemM("NODE_MT_add") + sub.itemM("NODE_MT_node") + + row = layout.row() + row.itemR(snode, "tree_type", text="", expand=True) + + if snode.tree_type == 'MATERIAL': + ob = snode.id_from + id = snode.id + if ob: + layout.template_ID(ob, "active_material", new="material.new") + if id: + layout.itemR(id, "use_nodes", toggle=True) + + elif snode.tree_type == 'TEXTURE': + row.itemR(snode, "texture_type", text="", expand=True) + + id = snode.id + id_from = snode.id_from + if id_from: + layout.template_ID(id_from, "active_texture", new="texture.new") + if id: + layout.itemR(id, "use_nodes", toggle=True) + + elif snode.tree_type == 'COMPOSITING': + id = snode.id + + layout.itemR(id, "use_nodes", toggle=True) + layout.itemR(id.render_data, "free_unused_nodes", text="Free Unused", toggle=True) + layout.itemR(snode, "backdrop", toggle=True) + +class NODE_MT_view(bpy.types.Menu): + __space_type__ = "NODE_EDITOR" + __label__ = "View" + + def draw(self, context): + layout = self.layout + + # layout.itemO("grease_pencil..") + # layout.itemS() + + layout.itemO("view2d.zoom_in") + layout.itemO("view2d.zoom_out") + + layout.itemS() + + layout.itemO("node.view_all") + layout.itemO("screen.screen_full_area") + +class NODE_MT_select(bpy.types.Menu): + __space_type__ = "NODE_EDITOR" + __label__ = "Select" + + def draw(self, context): + layout = self.layout + + layout.itemO("node.select_border") + + # XXX + # layout.itemS() + # layout.itemO("node.select_all") + # layout.itemO("node.select_linked_from") + # layout.itemO("node.select_linked_to") + +class NODE_MT_node(bpy.types.Menu): + __space_type__ = "NODE_EDITOR" + __label__ = "Node" + + def draw(self, context): + layout = self.layout + + layout.itemO("tfm.translate") + layout.itemO("tfm.resize") + layout.itemO("tfm.rotate") + + layout.itemS() + + layout.itemO("node.duplicate") + layout.itemO("node.delete") + + # XXX + # layout.itemS() + # layout.itemO("node.make_link") + # layout.itemS() + # layout.itemO("node.edit_group") + # layout.itemO("node.ungroup") + # layout.itemO("node.group") + # layout.itemO("node.make_link") + + layout.itemS() + + layout.itemO("node.visibility_toggle") + + # XXX + # layout.itemO("node.rename") + # layout.itemS() + # layout.itemO("node.show_cyclic_dependencies") + + +bpy.types.register(NODE_HT_header) +bpy.types.register(NODE_MT_view) +bpy.types.register(NODE_MT_select) +bpy.types.register(NODE_MT_node) + diff --git a/release/ui/space_outliner.py b/release/ui/space_outliner.py index 5815acc7e12..f55f4633a7b 100644 --- a/release/ui/space_outliner.py +++ b/release/ui/space_outliner.py @@ -9,11 +9,12 @@ class OUTLINER_HT_header(bpy.types.Header): sce = context.scene layout = self.layout - layout.template_header() + row = layout.row(align=True) + row.template_header() if context.area.show_menus: - row = layout.row(align=True) - row.itemM("OUTLINER_MT_view") + sub = row.row(align=True) + sub.itemM("OUTLINER_MT_view") row = layout.row() row.itemR(so, "display_mode", text="") diff --git a/release/ui/space_sequencer.py b/release/ui/space_sequencer.py index a29e0fad895..1edcf32d3b5 100644 --- a/release/ui/space_sequencer.py +++ b/release/ui/space_sequencer.py @@ -14,24 +14,28 @@ class SEQUENCER_HT_header(bpy.types.Header): st = context.space_data - layout.template_header() + row = layout.row(align=True) + row.template_header() if context.area.show_menus: - row = layout.row() - row.itemR(st, "display_mode", text="") - row.itemM("SEQUENCER_MT_view") + sub = row.row(align=True) + sub.itemM("SEQUENCER_MT_view") - layout.itemS() + row.itemS() if st.display_mode == 'SEQUENCER': - row.itemM("SEQUENCER_MT_select") - row.itemM("SEQUENCER_MT_marker") - row.itemM("SEQUENCER_MT_add") - row.itemM("SEQUENCER_MT_strip") - layout.itemS() - row.itemO("sequencer.reload") - else: - row.itemR(st, "display_channel", text="Channel") + sub.itemM("SEQUENCER_MT_select") + sub.itemM("SEQUENCER_MT_marker") + sub.itemM("SEQUENCER_MT_add") + sub.itemM("SEQUENCER_MT_strip") + + layout.itemR(st, "display_mode", text="") + + if st.display_mode == 'SEQUENCER': + layout.itemS() + layout.itemO("sequencer.reload") + else: + layout.itemR(st, "display_channel", text="Channel") class SEQUENCER_MT_view(bpy.types.Menu): __space_type__ = "SEQUENCE_EDITOR" diff --git a/release/ui/space_text.py b/release/ui/space_text.py index c54073c2938..61e8d3489a5 100644 --- a/release/ui/space_text.py +++ b/release/ui/space_text.py @@ -9,27 +9,28 @@ class TEXT_HT_header(bpy.types.Header): text = st.text layout = self.layout - layout.template_header() + row = layout.row(align=True) + row.template_header() if context.area.show_menus: - row = layout.row() - row.itemM("TEXT_MT_text") + sub = row.row(align=True) + sub.itemM("TEXT_MT_text") if text: - row.itemM("TEXT_MT_edit") - row.itemM("TEXT_MT_format") + sub.itemM("TEXT_MT_edit") + sub.itemM("TEXT_MT_format") if text and text.modified: row = layout.row() # row.color(redalert) row.itemO("text.resolve_conflict", text="", icon='ICON_HELP') + layout.template_ID(st, "text", new="text.new", unlink="text.unlink") + row = layout.row(align=True) row.itemR(st, "line_numbers", text="") row.itemR(st, "word_wrap", text="") row.itemR(st, "syntax_highlight", text="") - layout.template_ID(st, "text", new="text.new", unlink="text.unlink") - if text: row = layout.row() if text.filename != "": @@ -123,6 +124,10 @@ class TEXT_MT_text(bpy.types.Menu): # XXX if(BPY_is_pyconstraint(text)) # XXX uiMenuItemO(head, 0, "text.refresh_pyconstraints"); #endif + + layout.itemS() + + layout.itemO("text.properties", icon="ICON_MENU_PANEL") #ifndef DISABLE_PYTHON # XXX layout.column() @@ -219,7 +224,7 @@ class TEXT_MT_edit(bpy.types.Menu): layout.itemS() layout.itemO("text.jump") - layout.itemO("text.properties") + layout.itemO("text.properties", text="Find...") layout.itemS() diff --git a/release/ui/space_time.py b/release/ui/space_time.py index 785d11a8fc5..d1c9f9806f3 100644 --- a/release/ui/space_time.py +++ b/release/ui/space_time.py @@ -13,13 +13,14 @@ class TIME_HT_header(bpy.types.Header): tools = context.tool_settings screen = context.screen - layout.template_header() + row = layout.row(align=True) + row.template_header() if context.area.show_menus: - row = layout.row() - row.itemM("TIME_MT_view") - row.itemM("TIME_MT_frame") - row.itemM("TIME_MT_playback") + sub = row.row(align=True) + sub.itemM("TIME_MT_view") + sub.itemM("TIME_MT_frame") + sub.itemM("TIME_MT_playback") layout.itemR(scene, "use_preview_range", text="PR", toggle=True) diff --git a/release/ui/space_view3d.py b/release/ui/space_view3d.py index 1a5dd6b148c..44b1c82ff46 100644 --- a/release/ui/space_view3d.py +++ b/release/ui/space_view3d.py @@ -13,25 +13,26 @@ class VIEW3D_HT_header(bpy.types.Header): mode_string = context.mode edit_object = context.edit_object - layout.template_header() - + row = layout.row(align=True) + row.template_header() + # Menus if context.area.show_menus: - row = layout.row() + sub = row.row(align=True) - row.itemM("VIEW3D_MT_view") + sub.itemM("VIEW3D_MT_view") # Select Menu if mode_string not in ('EDIT_TEXT', 'SCULPT', 'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE', 'PARTICLE'): # XXX: Particle Mode has Select Menu. - row.itemM("VIEW3D_MT_select_%s" % mode_string) + sub.itemM("VIEW3D_MT_select_%s" % mode_string) if mode_string == 'OBJECT': - row.itemM("VIEW3D_MT_object") + sub.itemM("VIEW3D_MT_object") elif mode_string == 'SCULPT': - row.itemM("VIEW3D_MT_sculpt") + sub.itemM("VIEW3D_MT_sculpt") elif edit_object: - row.itemM("VIEW3D_MT_edit_%s" % edit_object.type) + sub.itemM("VIEW3D_MT_edit_%s" % edit_object.type) layout.template_header_3D() diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c index ef2e5188487..021bec05a3b 100644 --- a/source/blender/editors/armature/poselib.c +++ b/source/blender/editors/armature/poselib.c @@ -342,7 +342,7 @@ static int poselib_add_menu_invoke (bContext *C, wmOperator *op, wmEvent *evt) uiItemIntO(layout, "Add New (Current Frame)", 0, "POSELIB_OT_pose_add", "frame", CFRA); /* replace existing - submenu */ - uiItemMenuF(layout, "Replace Existing...", 0, poselib_add_menu_invoke__replacemenu); + uiItemMenuF(layout, "Replace Existing...", 0, poselib_add_menu_invoke__replacemenu, NULL); } uiPupMenuEnd(C, pup); diff --git a/source/blender/editors/include/ED_node.h b/source/blender/editors/include/ED_node.h index 0cd5551f17f..bf4632dc3da 100644 --- a/source/blender/editors/include/ED_node.h +++ b/source/blender/editors/include/ED_node.h @@ -28,8 +28,17 @@ #ifndef ED_NODE_H #define ED_NODE_H +struct Material; +struct Scene; +struct Tex; + /* drawnode.c */ void ED_init_node_butfuncs(void); +/* node_edit.c */ +void ED_node_shader_default(struct Material *ma); +void ED_node_composit_default(struct Scene *sce); +void ED_node_texture_default(struct Tex *tex);; + #endif /* ED_NODE_H */ diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 46da4b507a7..42280ad17c9 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -678,7 +678,7 @@ void uiItemM(uiLayout *layout, struct bContext *C, char *name, int icon, char *m void uiItemV(uiLayout *layout, char *name, int icon, int argval); /* value */ void uiItemS(uiLayout *layout); /* separator */ -void uiItemMenuF(uiLayout *layout, char *name, int icon, uiMenuCreateFunc func); +void uiItemMenuF(uiLayout *layout, char *name, int icon, uiMenuCreateFunc func, void *arg); void uiItemMenuEnumO(uiLayout *layout, char *name, int icon, char *opname, char *propname); void uiItemMenuEnumR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname); diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index dee486b6b93..fc4f7da56d2 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -215,16 +215,16 @@ static int ui_layout_vary_direction(uiLayout *layout) } /* estimated size of text + icon */ -static int ui_text_icon_width(uiLayout *layout, char *name, int icon) +static int ui_text_icon_width(uiLayout *layout, char *name, int icon, int compact) { int variable = ui_layout_vary_direction(layout) == UI_ITEM_VARY_X; if(icon && !name[0]) return UI_UNIT_X; /* icon only */ else if(icon) - return (variable)? UI_GetStringWidth(name) + 10 + UI_UNIT_X: 10*UI_UNIT_X; /* icon + text */ + return (variable)? UI_GetStringWidth(name) + (compact? 5: 10) + UI_UNIT_X: 10*UI_UNIT_X; /* icon + text */ else - return (variable)? UI_GetStringWidth(name) + 10 + UI_UNIT_X: 10*UI_UNIT_X; /* text only */ + return (variable)? UI_GetStringWidth(name) + (compact? 5: 10) + UI_UNIT_X: 10*UI_UNIT_X; /* text only */ } static void ui_item_size(uiItem *item, int *r_w, int *r_h) @@ -433,7 +433,7 @@ static void ui_item_enum_row(uiLayout *layout, uiBlock *block, PointerRNA *ptr, name= (!uiname || uiname[0])? (char*)item[a].name: ""; icon= item[a].icon; value= item[a].value; - itemw= ui_text_icon_width(block->curlayout, name, icon); + itemw= ui_text_icon_width(block->curlayout, name, icon, 0); if(icon && strcmp(name, "") != 0) uiDefIconTextButR(block, ROW, 0, icon, name, 0, 0, itemw, h, ptr, identifier, -1, 0, value, -1, -1, NULL); @@ -526,7 +526,7 @@ static void ui_item_disabled(uiLayout *layout, char *name) if(!name) name= ""; - w= ui_text_icon_width(layout, name, 0); + w= ui_text_icon_width(layout, name, 0, 0); but= uiDefBut(block, LABEL, 0, (char*)name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); but->flag |= UI_BUT_DISABLED; @@ -555,7 +555,7 @@ void uiItemFullO(uiLayout *layout, char *name, int icon, char *idname, IDPropert /* create button */ uiBlockSetCurLayout(block, layout); - w= ui_text_icon_width(layout, name, icon); + w= ui_text_icon_width(layout, name, icon, 0); if(icon && strcmp(name, "") != 0) but= uiDefIconTextButO(block, BUT, ot->idname, context, icon, (char*)name, 0, 0, w, UI_UNIT_Y, NULL); @@ -746,7 +746,7 @@ static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PropertyRNA else if(type == PROP_BOOLEAN && !name[0]) icon= ICON_DOT; - w= ui_text_icon_width(layout, name, icon); + w= ui_text_icon_width(layout, name, icon, 0); h= UI_UNIT_Y; /* increase height for arrays */ @@ -1112,7 +1112,7 @@ static void ui_item_menu(uiLayout *layout, char *name, int icon, uiMenuCreateFun if(layout->root->type == UI_LAYOUT_MENU && !icon) icon= ICON_BLANK1; - w= ui_text_icon_width(layout, name, icon); + w= ui_text_icon_width(layout, name, icon, 1); h= UI_UNIT_Y; if(layout->root->type == UI_LAYOUT_HEADER) /* ugly .. */ @@ -1170,7 +1170,7 @@ void uiItemL(uiLayout *layout, char *name, int icon) if(layout->root->type == UI_LAYOUT_MENU && !icon) icon= ICON_BLANK1; - w= ui_text_icon_width(layout, name, icon); + w= ui_text_icon_width(layout, name, icon, 0); if(icon && strcmp(name, "") != 0) but= uiDefIconTextBut(block, LABEL, 0, icon, (char*)name, 0, 0, w, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); @@ -1195,7 +1195,7 @@ void uiItemV(uiLayout *layout, char *name, int icon, int argval) if(layout->root->type == UI_LAYOUT_MENU && !icon) icon= ICON_BLANK1; - w= ui_text_icon_width(layout, name, icon); + w= ui_text_icon_width(layout, name, icon, 0); if(icon && strcmp(name, "") != 0) uiDefIconTextButF(block, BUTM, 0, icon, (char*)name, 0, 0, w, UI_UNIT_Y, retvalue, 0.0, 0.0, 0, argval, ""); @@ -1215,12 +1215,12 @@ void uiItemS(uiLayout *layout) } /* level items */ -void uiItemMenuF(uiLayout *layout, char *name, int icon, uiMenuCreateFunc func) +void uiItemMenuF(uiLayout *layout, char *name, int icon, uiMenuCreateFunc func, void *arg) { if(!func) return; - ui_item_menu(layout, name, icon, func, NULL, NULL); + ui_item_menu(layout, name, icon, func, arg, NULL); } typedef struct MenuItemLevel { diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 2e0f0897af4..a70fbab1aa4 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1949,7 +1949,7 @@ static void widget_pulldownbut(uiWidgetColors *wcol, rcti *rect, int state, int widget_init(&wtb); /* fully rounded */ - round_box_edges(&wtb, roundboxalign, rect, rad); + round_box_edges(&wtb, 15, rect, rad); widgetbase_draw(&wtb, wcol); } diff --git a/source/blender/editors/space_action/action_header.c b/source/blender/editors/space_action/action_header.c index d3929a22342..e4750bd0a37 100644 --- a/source/blender/editors/space_action/action_header.c +++ b/source/blender/editors/space_action/action_header.c @@ -153,7 +153,7 @@ static void act_channelmenu(bContext *C, uiLayout *layout, void *arg_unused) static void act_gplayermenu(bContext *C, uiLayout *layout, void *arg_unused) { - //uiItemMenuF(layout, "Transform", 0, nla_edit_transformmenu); + //uiItemMenuF(layout, "Transform", 0, nla_edit_transformmenu, NULL, NULL); //uiItemS(layout); //uiItemO(layout, NULL, 0, "NLAEDIT_OT_duplicate"); } @@ -210,9 +210,9 @@ static void act_edit_expomenu(bContext *C, uiLayout *layout, void *arg_unused) static void act_editmenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiItemMenuF(layout, "Transform", 0, act_edit_transformmenu); - uiItemMenuF(layout, "Snap", 0, act_edit_snapmenu); - uiItemMenuF(layout, "Mirror", 0, act_edit_mirrormenu); + uiItemMenuF(layout, "Transform", 0, act_edit_transformmenu, NULL); + uiItemMenuF(layout, "Snap", 0, act_edit_snapmenu, NULL); + uiItemMenuF(layout, "Mirror", 0, act_edit_mirrormenu, NULL); uiItemS(layout); @@ -225,9 +225,9 @@ static void act_editmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemS(layout); - uiItemMenuF(layout, "Handle Type", 0, act_edit_handlesmenu); - uiItemMenuF(layout, "Interpolation Mode", 0, act_edit_ipomenu); - uiItemMenuF(layout, "Extrapolation Mode", 0, act_edit_expomenu); + uiItemMenuF(layout, "Handle Type", 0, act_edit_handlesmenu, NULL); + uiItemMenuF(layout, "Interpolation Mode", 0, act_edit_ipomenu, NULL); + uiItemMenuF(layout, "Extrapolation Mode", 0, act_edit_expomenu, NULL); uiItemS(layout); diff --git a/source/blender/editors/space_graph/graph_header.c b/source/blender/editors/space_graph/graph_header.c index 2c9017db649..c4654972dcd 100644 --- a/source/blender/editors/space_graph/graph_header.c +++ b/source/blender/editors/space_graph/graph_header.c @@ -201,9 +201,9 @@ static void graph_edit_expomenu(bContext *C, uiLayout *layout, void *arg_unused) static void graph_editmenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiItemMenuF(layout, "Transform", 0, graph_edit_transformmenu); - uiItemMenuF(layout, "Snap", 0, graph_edit_snapmenu); - uiItemMenuF(layout, "Mirror", 0, graph_edit_mirrormenu); + uiItemMenuF(layout, "Transform", 0, graph_edit_transformmenu, NULL); + uiItemMenuF(layout, "Snap", 0, graph_edit_snapmenu, NULL); + uiItemMenuF(layout, "Mirror", 0, graph_edit_mirrormenu, NULL); uiItemS(layout); @@ -217,9 +217,9 @@ static void graph_editmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemS(layout); - uiItemMenuF(layout, "Handle Type", 0, graph_edit_handlesmenu); - uiItemMenuF(layout, "Interpolation Mode", 0, graph_edit_ipomenu); - uiItemMenuF(layout, "Extrapolation Mode", 0, graph_edit_expomenu); + uiItemMenuF(layout, "Handle Type", 0, graph_edit_handlesmenu, NULL); + uiItemMenuF(layout, "Interpolation Mode", 0, graph_edit_ipomenu, NULL); + uiItemMenuF(layout, "Extrapolation Mode", 0, graph_edit_expomenu, NULL); uiItemS(layout); diff --git a/source/blender/editors/space_nla/nla_header.c b/source/blender/editors/space_nla/nla_header.c index 04c2db08bda..e507efb0a30 100644 --- a/source/blender/editors/space_nla/nla_header.c +++ b/source/blender/editors/space_nla/nla_header.c @@ -151,8 +151,8 @@ static void nla_editmenu(bContext *C, uiLayout *layout, void *arg_unused) { Scene *scene= CTX_data_scene(C); - uiItemMenuF(layout, "Transform", 0, nla_edit_transformmenu); - uiItemMenuF(layout, "Snap", 0, nla_edit_snapmenu); + uiItemMenuF(layout, "Transform", 0, nla_edit_transformmenu, NULL); + uiItemMenuF(layout, "Snap", 0, nla_edit_snapmenu, NULL); uiItemS(layout); diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 20abcdf9f97..e1b612d74e1 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -485,7 +485,7 @@ static void texture_node_event(SpaceNode *snode, short event) #endif /* 0 */ /* assumes nothing being done in ntree yet, sets the default in/out node */ /* called from shading buttons or header */ -void node_shader_default(Material *ma) +void ED_node_shader_default(Material *ma) { bNode *in, *out; bNodeSocket *fromsock, *tosock; @@ -515,7 +515,7 @@ void node_shader_default(Material *ma) /* assumes nothing being done in ntree yet, sets the default in/out node */ /* called from shading buttons or header */ -void node_composit_default(Scene *sce) +void ED_node_composit_default(Scene *sce) { bNode *in, *out; bNodeSocket *fromsock, *tosock; @@ -549,7 +549,7 @@ void node_composit_default(Scene *sce) /* assumes nothing being done in ntree yet, sets the default in/out node */ /* called from shading buttons or header */ -void node_texture_default(Tex *tx) +void ED_node_texture_default(Tex *tx) { bNode *in, *out; bNodeSocket *fromsock, *tosock; @@ -591,7 +591,7 @@ void snode_set_context(SpaceNode *snode, Scene *scene) if(ob) { Material *ma= give_current_material(ob, ob->actcol); if(ma) { - snode->from= material_from(ob, ob->actcol); + snode->from= &ob->id; snode->id= &ma->id; snode->nodetree= ma->nodetree; } @@ -613,7 +613,13 @@ void snode_set_context(SpaceNode *snode, Scene *scene) if(snode->texfrom==SNODE_TEX_OBJECT) { if(ob) { tx= give_current_texture(ob, ob->actcol); - snode->from= (ID *)ob; + + if(ob->type == OB_LAMP) + snode->from= (ID*)ob->data; + else + snode->from= (ID*)give_current_material(ob, ob->actcol); + + /* from is not set fully for material nodes, should be ID + Node then */ } } else if(snode->texfrom==SNODE_TEX_WORLD) { @@ -624,21 +630,18 @@ void snode_set_context(SpaceNode *snode, Scene *scene) MTex *mtex= NULL; Brush *brush= NULL; - if(ob && ob->mode & OB_MODE_SCULPT) { + if(ob && (ob->mode & OB_MODE_SCULPT)) brush= paint_brush(&scene->toolsettings->sculpt->paint); - } else brush= paint_brush(&scene->toolsettings->imapaint.paint); - if(brush) { - if(brush && brush->texact != -1) - mtex= brush->mtex[brush->texact]; - } - - if(mtex) { - snode->from= (ID *)scene; + if(brush && brush->texact != -1) + mtex= brush->mtex[brush->texact]; + + snode->from= (ID *)brush; + + if(mtex) tx= mtex->tex; - } } if(tx) { diff --git a/source/blender/editors/space_node/node_header.c b/source/blender/editors/space_node/node_header.c index 367242d1262..2abcd2f2135 100644 --- a/source/blender/editors/space_node/node_header.c +++ b/source/blender/editors/space_node/node_header.c @@ -45,6 +45,7 @@ #include "BKE_screen.h" #include "BKE_node.h" #include "BKE_main.h" +#include "BKE_utildefines.h" #include "ED_screen.h" #include "ED_types.h" @@ -62,67 +63,9 @@ #include "node_intern.h" -/* ************************ header area region *********************** */ +/* ************************ add menu *********************** */ -static void do_node_selectmenu(bContext *C, void *arg, int event) -{ - ScrArea *curarea= CTX_wm_area(C); - SpaceNode *snode= CTX_wm_space_node(C); - - /* functions in editnode.c assume there's a tree */ - if(snode->nodetree==NULL) - return; - - switch(event) { - case 1: /* border select */ - WM_operator_name_call(C, "NODE_OT_select_border", WM_OP_INVOKE_REGION_WIN, NULL); - break; - case 2: /* select/deselect all */ - // XXX node_deselectall(snode, 1); - break; - case 3: /* select linked in */ - // XXX node_select_linked(snode, 0); - break; - case 4: /* select linked out */ - // XXX node_select_linked(snode, 1); - break; - } - - ED_area_tag_redraw(curarea); -} - -static uiBlock *node_selectmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - ScrArea *curarea= CTX_wm_area(C); - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "node_selectmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_node_selectmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Border Select|B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Linked From|L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select Linked To|Shift L", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - uiEndBlock(C, block); - - return block; -} - -void do_node_addmenu(bContext *C, void *arg, int event) +static void do_node_add(bContext *C, void *arg, int event) { SpaceNode *snode= CTX_wm_space_node(C); bNode *node; @@ -141,311 +84,125 @@ void do_node_addmenu(bContext *C, void *arg, int event) snode_handle_recalc(C, snode); } -static void node_make_addmenu(bContext *C, int nodeclass, uiBlock *block) +static void node_auto_add_menu(bContext *C, uiLayout *layout, void *arg_nodeclass) { Main *bmain= CTX_data_main(C); SpaceNode *snode= CTX_wm_space_node(C); bNodeTree *ntree; + int nodeclass= GET_INT_FROM_POINTER(arg_nodeclass); int tot= 0, a; - short yco= 0, menuwidth=120; ntree = snode->nodetree; - if(ntree) { - /* mostly taken from toolbox.c, node_add_sublevel() */ - if(ntree) { - if(nodeclass==NODE_CLASS_GROUP) { - bNodeTree *ngroup= bmain->nodetree.first; - for(; ngroup; ngroup= ngroup->id.next) - if(ngroup->type==ntree->type) - tot++; - } - else { - bNodeType *type = ntree->alltypes.first; - while(type) { - if(type->nclass == nodeclass) - tot++; - type= type->next; - } - } - } - - if(tot==0) { - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - return; - } - - if(nodeclass==NODE_CLASS_GROUP) { - bNodeTree *ngroup= bmain->nodetree.first; - for(tot=0, a=0; ngroup; ngroup= ngroup->id.next, tot++) { - if(ngroup->type==ntree->type) { - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, (ngroup->id.name+2), 0, - yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1.0f, (float)(NODE_GROUP_MENU+tot), ""); - a++; - } - } - } - else { - bNodeType *type; - int script=0; - for(a=0, type= ntree->alltypes.first; type; type=type->next) { - if( type->nclass == nodeclass && type->name) { - if(type->type == NODE_DYNAMIC) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, type->name, 0, - yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1.0f, (float)(NODE_DYNAMIC_MENU+script), ""); - script++; - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, type->name, 0, - yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1.0f, (float)(type->type), ""); - } - a++; - } - } - } - } else { - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); + + if(!ntree) { + uiItemS(layout); return; } -} -static uiBlock *node_add_inputmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - - block= uiBeginBlock(C, ar, "node_add_inputmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_node_addmenu, NULL); - - node_make_addmenu(C, NODE_CLASS_INPUT, block); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - uiEndBlock(C, block); - - return block; -} -static uiBlock *node_add_outputmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - - block= uiBeginBlock(C, ar, "node_add_outputmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_node_addmenu, NULL); - - node_make_addmenu(C, NODE_CLASS_OUTPUT, block); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - uiEndBlock(C, block); - - return block; -} -static uiBlock *node_add_colormenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - - block= uiBeginBlock(C, ar, "node_add_colormenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_node_addmenu, NULL); - - node_make_addmenu(C, NODE_CLASS_OP_COLOR, block); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - uiEndBlock(C, block); - - return block; -} -static uiBlock *node_add_vectormenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - - block= uiBeginBlock(C, ar, "node_add_vectormenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_node_addmenu, NULL); - - node_make_addmenu(C, NODE_CLASS_OP_VECTOR, block); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - uiEndBlock(C, block); - - return block; -} -static uiBlock *node_add_filtermenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - - block= uiBeginBlock(C, ar, "node_add_filtermenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_node_addmenu, NULL); - - node_make_addmenu(C, NODE_CLASS_OP_FILTER, block); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - uiEndBlock(C, block); - - return block; -} -static uiBlock *node_add_convertermenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - - block= uiBeginBlock(C, ar, "node_add_convertermenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_node_addmenu, NULL); - - node_make_addmenu(C, NODE_CLASS_CONVERTOR, block); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - uiEndBlock(C, block); - - return block; -} -static uiBlock *node_add_mattemenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - - block= uiBeginBlock(C, ar, "node_add_mattemenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_node_addmenu, NULL); - - node_make_addmenu(C, NODE_CLASS_MATTE, block); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - uiEndBlock(C, block); - - return block; -} -static uiBlock *node_add_distortmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - - block= uiBeginBlock(C, ar, "node_add_distortmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_node_addmenu, NULL); - - node_make_addmenu(C, NODE_CLASS_DISTORT, block); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - uiEndBlock(C, block); - - return block; -} -static uiBlock *node_add_patternmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - - block= uiBeginBlock(C, ar, "node_add_patternmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_node_addmenu, NULL); - - node_make_addmenu(C, NODE_CLASS_PATTERN, block); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - uiEndBlock(C, block); - - return block; -} -static uiBlock *node_add_texturemenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - - block= uiBeginBlock(C, ar, "node_add_texturemenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_node_addmenu, NULL); - - node_make_addmenu(C, NODE_CLASS_TEXTURE, block); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - uiEndBlock(C, block); - - return block; -} -static uiBlock *node_add_groupmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - - block= uiBeginBlock(C, ar, "node_add_groupmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_node_addmenu, NULL); - - node_make_addmenu(C, NODE_CLASS_GROUP, block); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - uiEndBlock(C, block); - - return block; -} - -static uiBlock *node_add_dynamicmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - - block= uiBeginBlock(C, ar, "node_add_dynamicmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_node_addmenu, NULL); - - node_make_addmenu(C, NODE_CLASS_OP_DYNAMIC, block); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - uiEndBlock(C, block); - - return block; -} - -static uiBlock *node_addmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - ScrArea *curarea= CTX_wm_area(C); - SpaceNode *snode= CTX_wm_space_node(C); - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "node_addmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_node_addmenu, NULL); - - if(snode->treetype==NTREE_SHADER) { - uiDefIconTextBlockBut(block, node_add_inputmenu, NULL, ICON_RIGHTARROW_THIN, "Input", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_outputmenu, NULL, ICON_RIGHTARROW_THIN, "Output", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_colormenu, NULL, ICON_RIGHTARROW_THIN, "Color", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_vectormenu, NULL, ICON_RIGHTARROW_THIN, "Vector", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_convertermenu, NULL, ICON_RIGHTARROW_THIN, "Convertor", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_groupmenu, NULL, ICON_RIGHTARROW_THIN, "Group", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_dynamicmenu, NULL, ICON_RIGHTARROW_THIN, "Dynamic", 0, yco-=20, 120, 19, ""); - } - else if(snode->treetype==NTREE_COMPOSIT) { - uiDefIconTextBlockBut(block, node_add_inputmenu, NULL, ICON_RIGHTARROW_THIN, "Input", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_outputmenu, NULL, ICON_RIGHTARROW_THIN, "Output", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_colormenu, NULL, ICON_RIGHTARROW_THIN, "Color", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_vectormenu, NULL, ICON_RIGHTARROW_THIN, "Vector", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_filtermenu, NULL, ICON_RIGHTARROW_THIN, "Filter", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_convertermenu, NULL, ICON_RIGHTARROW_THIN, "Convertor", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_mattemenu, NULL, ICON_RIGHTARROW_THIN, "Matte", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_distortmenu, NULL, ICON_RIGHTARROW_THIN, "Distort", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_groupmenu, NULL, ICON_RIGHTARROW_THIN, "Group", 0, yco-=20, 120, 19, ""); - - } else if(snode->treetype==NTREE_TEXTURE) { - uiDefIconTextBlockBut(block, node_add_inputmenu, NULL, ICON_RIGHTARROW_THIN, "Input", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_outputmenu, NULL, ICON_RIGHTARROW_THIN, "Output", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_colormenu, NULL, ICON_RIGHTARROW_THIN, "Color", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_patternmenu, NULL, ICON_RIGHTARROW_THIN, "Patterns", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_texturemenu, NULL, ICON_RIGHTARROW_THIN, "Textures", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_convertermenu, NULL, ICON_RIGHTARROW_THIN, "Convertor", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_distortmenu, NULL, ICON_RIGHTARROW_THIN, "Distort", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, node_add_groupmenu, NULL, ICON_RIGHTARROW_THIN, "Group", 0, yco-=20, 120, 19, ""); - } - else - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); + /* mostly taken from toolbox.c, node_add_sublevel() */ + if(nodeclass==NODE_CLASS_GROUP) { + bNodeTree *ngroup= bmain->nodetree.first; + for(; ngroup; ngroup= ngroup->id.next) + if(ngroup->type==ntree->type) + tot++; } else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); + bNodeType *type = ntree->alltypes.first; + while(type) { + if(type->nclass == nodeclass) + tot++; + type= type->next; + } + } + + if(tot==0) { + uiItemS(layout); + return; } + + uiLayoutSetFunc(layout, do_node_add, NULL); - uiTextBoundsBlock(block, 50); - - return block; + if(nodeclass==NODE_CLASS_GROUP) { + bNodeTree *ngroup= bmain->nodetree.first; + + for(tot=0, a=0; ngroup; ngroup= ngroup->id.next, tot++) { + if(ngroup->type==ntree->type) { + uiItemV(layout, ngroup->id.name+2, 0, NODE_GROUP_MENU+tot); + a++; + } + } + } + else { + bNodeType *type; + int script=0; + + for(a=0, type= ntree->alltypes.first; type; type=type->next) { + if(type->nclass == nodeclass && type->name) { + if(type->type == NODE_DYNAMIC) { + uiItemV(layout, type->name, 0, NODE_DYNAMIC_MENU+script); + script++; + } + else + uiItemV(layout, type->name, 0, type->type); + + a++; + } + } + } } +static void node_menu_add(const bContext *C, Menu *menu) +{ + uiLayout *layout= menu->layout; + SpaceNode *snode= CTX_wm_space_node(C); + + if(!snode->nodetree) + uiLayoutSetActive(layout, 0); + + if(snode->treetype==NTREE_SHADER) { + uiItemMenuF(layout, "Input", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT)); + uiItemMenuF(layout, "Output", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT)); + uiItemMenuF(layout, "Color", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR)); + uiItemMenuF(layout, "Vector", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_VECTOR)); + uiItemMenuF(layout, "Convertor", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR)); + uiItemMenuF(layout, "Group", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP)); + uiItemMenuF(layout, "Dynamic", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_DYNAMIC)); + } + else if(snode->treetype==NTREE_COMPOSIT) { + uiItemMenuF(layout, "Input", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT)); + uiItemMenuF(layout, "Output", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT)); + uiItemMenuF(layout, "Color", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR)); + uiItemMenuF(layout, "Vector", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_VECTOR)); + uiItemMenuF(layout, "Filter", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_FILTER)); + uiItemMenuF(layout, "Convertor", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR)); + uiItemMenuF(layout, "Matte", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_MATTE)); + uiItemMenuF(layout, "Distort", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_DISTORT)); + uiItemMenuF(layout, "Group", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP)); + } + else if(snode->treetype==NTREE_TEXTURE) { + uiItemMenuF(layout, "Input", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_INPUT)); + uiItemMenuF(layout, "Output", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OUTPUT)); + uiItemMenuF(layout, "Color", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_OP_COLOR)); + uiItemMenuF(layout, "Patterns", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_PATTERN)); + uiItemMenuF(layout, "Textures", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_TEXTURE)); + uiItemMenuF(layout, "Convertor", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_CONVERTOR)); + uiItemMenuF(layout, "Distort", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_DISTORT)); + uiItemMenuF(layout, "Group", 0, node_auto_add_menu, SET_INT_IN_POINTER(NODE_CLASS_GROUP)); + } +} + +void node_menus_register(ARegionType *art) +{ + MenuType *mt; + + mt= MEM_callocN(sizeof(MenuType), "spacetype node menu add"); + strcpy(mt->idname, "NODE_MT_add"); + strcpy(mt->label, "Add"); + mt->draw= node_menu_add; + BLI_addtail(&art->menutypes, mt); +} + +#if 0 static void do_node_nodemenu(bContext *C, void *arg, int event) { ScrArea *curarea= CTX_wm_area(C); @@ -571,218 +328,5 @@ static uiBlock *node_nodemenu(bContext *C, ARegion *ar, void *arg_unused) return block; } - -static void do_node_viewmenu(bContext *C, void *arg, int event) -{ -// SpaceNode *snode= CTX_wm_space_node(C); -// ARegion *ar= CTX_wm_region(C); - ScrArea *sa= CTX_wm_area(C); - - switch(event) { - case 1: /* Zoom in */ - WM_operator_name_call(C, "VIEW2D_OT_zoom_in", WM_OP_EXEC_REGION_WIN, NULL); - break; - case 2: /* View all */ - WM_operator_name_call(C, "VIEW2D_OT_zoom_out", WM_OP_EXEC_REGION_WIN, NULL); - break; - case 3: /* View all */ - WM_operator_name_call(C, "NODE_OT_view_all", WM_OP_EXEC_REGION_WIN, NULL); - break; - case 4: /* Grease Pencil */ - // XXX add_blockhandler(sa, NODES_HANDLER_GREASEPENCIL, UI_PNL_UNSTOW); - break; - } - ED_area_tag_redraw(sa); -} - -static uiBlock *node_viewmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - ScrArea *curarea= CTX_wm_area(C); - SpaceNode *snode= CTX_wm_space_node(C); - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "node_viewmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_node_viewmenu, NULL); - - if (snode->nodetree) { - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Grease Pencil...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - } - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom In|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Out|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - /* XXX if (!curarea->full) - uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - else - uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - */ - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - uiEndBlock(C, block); - - return block; -} - -static void do_node_buttons(bContext *C, void *arg, int event) -{ - // NODE_FIX_ME : instead of using "current material/texture/scene", node editor can also pin context? - // note: scene context better not gets overridden, that'll clash too much (ton) - SpaceNode *snode= CTX_wm_space_node(C); - Scene *scene= CTX_data_scene(C); - Material *ma; - Tex *tx; - - switch(event) { - case B_REDR: - ED_area_tag_redraw(CTX_wm_area(C)); - break; - case B_NODE_USEMAT: - ma= (Material *)snode->id; - if(ma) { - if(ma->use_nodes && ma->nodetree==NULL) { - node_shader_default(ma); - snode_set_context(snode, scene); - } - } - ED_area_tag_redraw(CTX_wm_area(C)); - break; - - case B_NODE_USESCENE: - if(scene->use_nodes) { - if(scene->nodetree==NULL) - node_composit_default(scene); - } - snode_set_context(snode, scene); - ED_area_tag_redraw(CTX_wm_area(C)); - break; - - case B_NODE_USETEX: - tx = (Tex *)snode->id; - if(tx) { - tx->type = 0; - if(tx->use_nodes && tx->nodetree==NULL) { - node_texture_default(tx); - snode_set_context(snode, scene); - } - } - ED_area_tag_redraw(CTX_wm_area(C)); - break; - } -} - -void node_header_buttons(const bContext *C, ARegion *ar) -{ - ScrArea *sa= CTX_wm_area(C); - SpaceNode *snode= CTX_wm_space_node(C); - Scene *scene= CTX_data_scene(C); - uiBlock *block; - short xco, yco= 3; - - block= uiBeginBlock(C, ar, "header node", UI_EMBOSS); - uiBlockSetHandleFunc(block, do_node_buttons, NULL); - - xco= ED_area_header_standardbuttons(C, block, yco); - - if((sa->flag & HEADER_NO_PULLDOWN)==0) { - int xmax; - - xmax= GetButStringLength("View"); - uiDefPulldownBut(block, node_viewmenu, NULL, - "View", xco, yco, xmax-3, 20, ""); - xco+= xmax; - - xmax= GetButStringLength("Select"); - uiDefPulldownBut(block, node_selectmenu, NULL, - "Select", xco, yco, xmax-3, 20, ""); - xco+= xmax; - - xmax= GetButStringLength("Add"); - uiDefPulldownBut(block, node_addmenu, NULL, - "Add", xco, yco, xmax-3, 20, ""); - xco+= xmax; - - xmax= GetButStringLength("Node"); - uiDefPulldownBut(block, node_nodemenu, NULL, - "Node", xco, yco, xmax-3, 20, ""); - xco+= xmax; - } - - uiBlockSetEmboss(block, UI_EMBOSS); - - uiBlockSetEmboss(block, UI_EMBOSS); - - /* main type choosing */ - uiBlockBeginAlign(block); - uiDefIconButI(block, ROW, B_REDR, ICON_MATERIAL_DATA, xco,yco,XIC,YIC-2, - &(snode->treetype), 2.0f, 0.0f, 0.0f, 0.0f, "Material Nodes"); - xco+= XIC; - uiDefIconButI(block, ROW, B_REDR, ICON_IMAGE_DATA, xco,yco,XIC,YIC-2, - &(snode->treetype), 2.0f, 1.0f, 0.0f, 0.0f, "Composite Nodes"); - xco+= XIC; - uiDefIconButI(block, ROW, B_REDR, ICON_TEXTURE_DATA, xco,yco,XIC,YIC-2, - &(snode->treetype), 2.0f, 2.0f, 0.0f, 0.0f, "Texture Nodes"); - xco+= 2*XIC; - uiBlockEndAlign(block); - - /* find and set the context */ - snode_set_context(snode, scene); - - if(snode->treetype==NTREE_SHADER) { - if(snode->from) { - /* 0, NULL -> pin */ - // XXX xco= std_libbuttons(block, xco, 0, 0, NULL, B_MATBROWSE, ID_MA, 1, snode->id, snode->from, &(snode->menunr), - // B_MATALONE, B_MATLOCAL, B_MATDELETE, B_AUTOMATNAME, B_KEEPDATA); - - if(snode->id) { - Material *ma= (Material *)snode->id; - uiDefButC(block, TOG, B_NODE_USEMAT, "Use Nodes", xco+5,yco,90,19, &ma->use_nodes, 0.0f, 0.0f, 0, 0, ""); - xco+=80; - } - } - } - else if(snode->treetype==NTREE_COMPOSIT) { - int icon; - - if(WM_jobs_test(CTX_wm_manager(C), sa)) icon= ICON_REC; else icon= ICON_BLANK1; - uiDefIconTextButS(block, TOG, B_NODE_USESCENE, icon, "Use Nodes", xco+5,yco,100,19, &scene->use_nodes, 0.0f, 0.0f, 0, 0, "Indicate this Scene will use Nodes and execute them while editing"); - xco+= 100; - uiDefButBitI(block, TOG, R_COMP_FREE, B_NOP, "Free Unused", xco+5,yco,100,19, &scene->r.scemode, 0.0f, 0.0f, 0, 0, "Free Nodes that are not used while composite"); - xco+= 100; - uiDefButBitS(block, TOG, SNODE_BACKDRAW, B_REDR, "Backdrop", xco+5,yco,90,19, &snode->flag, 0.0f, 0.0f, 0, 0, "Use active Viewer Node output as backdrop"); - xco+= 90; - } - else if(snode->treetype==NTREE_TEXTURE) { - if(snode->from) { - - // XXX xco= std_libbuttons(block, xco, 0, 0, NULL, B_TEXBROWSE, ID_TE, 1, snode->id, snode->from, &(snode->menunr), - // B_TEXALONE, B_TEXLOCAL, B_TEXDELETE, B_AUTOTEXNAME, B_KEEPDATA); - - if(snode->id) { - Tex *tx= (Tex *)snode->id; - uiDefButC(block, TOG, B_NODE_USETEX, "Use Nodes", xco+5,yco,90,19, &tx->use_nodes, 0.0f, 0.0f, 0, 0, ""); - xco+=80; - } - } - } - - UI_view2d_totRect_set(&ar->v2d, xco+XIC+100, (int)(ar->v2d.tot.ymax-ar->v2d.tot.ymin)); - - uiEndBlock(C, block); - uiDrawBlock(C, block); -} - +#endif diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h index d6680457376..5c66c902797 100644 --- a/source/blender/editors/space_node/node_intern.h +++ b/source/blender/editors/space_node/node_intern.h @@ -31,6 +31,7 @@ /* internal exports only */ struct ARegion; +struct ARegionType; struct View2D; struct bContext; struct wmWindowManager; @@ -45,6 +46,7 @@ struct wmWindowManager; /* node_header.c */ void node_header_buttons(const bContext *C, ARegion *ar); +void node_menus_register(struct ARegionType *art); /* node_draw.c */ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d); @@ -75,9 +77,6 @@ void snode_make_group_editable(SpaceNode *snode, bNode *gnode); void snode_home(ScrArea *sa, ARegion *ar, SpaceNode *snode); void node_set_active(SpaceNode *snode, bNode *node); void node_deselectall(SpaceNode *snode, int swap); -void node_shader_default(Material *ma); -void node_composit_default(Scene *sce); -void node_texture_default(Tex *tx); void snode_composite_job(const struct bContext *C, ScrArea *sa); bNode *snode_get_editgroup(SpaceNode *snode); void snode_autoconnect(SpaceNode *snode, bNode *node_to, int flag); diff --git a/source/blender/editors/space_node/node_state.c b/source/blender/editors/space_node/node_state.c index 8d805490942..dcab3dc0895 100644 --- a/source/blender/editors/space_node/node_state.c +++ b/source/blender/editors/space_node/node_state.c @@ -183,7 +183,7 @@ void NODE_OT_visibility_toggle(wmOperatorType *ot) RNA_def_int(ot->srna, "mouse_y", 0, INT_MIN, INT_MAX, "Mouse Y", "", INT_MIN, INT_MAX); } -static int node_fit_all_exec(bContext *C, wmOperator *op) +static int node_view_all_exec(bContext *C, wmOperator *op) { ScrArea *sa= CTX_wm_area(C); ARegion *ar= CTX_wm_region(C); @@ -196,11 +196,11 @@ static int node_fit_all_exec(bContext *C, wmOperator *op) void NODE_OT_view_all(wmOperatorType *ot) { /* identifiers */ - ot->name= "Fit All"; + ot->name= "View All"; ot->idname= "NODE_OT_view_all"; /* api callbacks */ - ot->exec= node_fit_all_exec; + ot->exec= node_view_all_exec; ot->poll= ED_operator_node_active; /* flags */ diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index 20873566867..cb25d29fd27 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -254,29 +254,18 @@ static void node_main_area_draw(const bContext *C, ARegion *ar) /* add handlers, stuff you only do once or on area/region changes */ static void node_header_area_init(wmWindowManager *wm, ARegion *ar) { - UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy); + ED_region_header_init(ar); } static void node_header_area_draw(const bContext *C, ARegion *ar) { - float col[3]; - - /* clear */ - if(ED_screen_area_active(C)) - UI_GetThemeColor3fv(TH_HEADER, col); - else - UI_GetThemeColor3fv(TH_HEADERDESEL, col); - - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - /* set view2d view matrix for scrolling (without scrollers) */ - UI_view2d_view_ortho(C, &ar->v2d); - - node_header_buttons(C, ar); - - /* restore view matrix? */ - UI_view2d_view_restore(C); + SpaceNode *snode= CTX_wm_space_node(C); + Scene *scene= CTX_data_scene(C); + + /* find and set the context */ + snode_set_context(snode, scene); + + ED_region_header(C, ar); } /* used for header + main area */ @@ -285,12 +274,9 @@ static void node_region_listener(ARegion *ar, wmNotifier *wmn) /* context changes */ switch(wmn->category) { case NC_SCENE: - ED_region_tag_redraw(ar); - break; case NC_MATERIAL: - ED_region_tag_redraw(ar); - break; case NC_TEXTURE: + case NC_NODE: ED_region_tag_redraw(ar); break; } @@ -357,6 +343,8 @@ void ED_spacetype_node(void) art->draw= node_header_area_draw; BLI_addhead(&st->regiontypes, art); + + node_menus_register(art); #if 0 /* regions: channels */ diff --git a/source/blender/editors/space_text/text_header.c b/source/blender/editors/space_text/text_header.c index c761587198f..0e2d2ce1698 100644 --- a/source/blender/editors/space_text/text_header.c +++ b/source/blender/editors/space_text/text_header.c @@ -186,12 +186,18 @@ ARegion *text_has_properties_region(ScrArea *sa) return arnew; } +void text_toggle_properties_region(bContext *C, ScrArea *sa, ARegion *ar) +{ + ar->flag ^= RGN_FLAG_HIDDEN; + ar->v2d.flag &= ~V2D_IS_INITIALISED; /* XXX should become hide/unhide api? */ + + ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), sa); + ED_area_tag_redraw(sa); +} + static int properties_poll(bContext *C) { - SpaceText *st= CTX_wm_space_text(C); - Text *text= CTX_data_edit_text(C); - - return (st && text); + return (CTX_wm_space_text(C) != NULL); } static int properties_exec(bContext *C, wmOperator *op) @@ -199,13 +205,8 @@ static int properties_exec(bContext *C, wmOperator *op) ScrArea *sa= CTX_wm_area(C); ARegion *ar= text_has_properties_region(sa); - if(ar) { - ar->flag ^= RGN_FLAG_HIDDEN; - ar->v2d.flag &= ~V2D_IS_INITIALISED; /* XXX should become hide/unhide api? */ - - ED_area_initialize(CTX_wm_manager(C), CTX_wm_window(C), sa); - ED_area_tag_redraw(sa); - } + if(ar) + text_toggle_properties_region(C, sa, ar); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 2a7b718a664..6c86c87302c 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -2092,7 +2092,7 @@ static void view3d_edit_meshmenu(bContext *C, uiLayout *layout, void *arg_unused uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); #endif - uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu); + uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu, NULL); uiItemS(layout); @@ -2113,10 +2113,10 @@ static void view3d_edit_meshmenu(bContext *C, uiLayout *layout, void *arg_unused uiItemS(layout); - uiItemMenuF(layout, "Vertices", 0, view3d_edit_mesh_verticesmenu); - uiItemMenuF(layout, "Edges", 0, view3d_edit_mesh_edgesmenu); - uiItemMenuF(layout, "Faces", 0, view3d_edit_mesh_facesmenu); - uiItemMenuF(layout, "Normals", 0, view3d_edit_mesh_normalsmenu); + uiItemMenuF(layout, "Vertices", 0, view3d_edit_mesh_verticesmenu, NULL); + uiItemMenuF(layout, "Edges", 0, view3d_edit_mesh_edgesmenu, NULL); + uiItemMenuF(layout, "Faces", 0, view3d_edit_mesh_facesmenu, NULL); + uiItemMenuF(layout, "Normals", 0, view3d_edit_mesh_normalsmenu, NULL); uiItemS(layout); @@ -2126,7 +2126,7 @@ static void view3d_edit_meshmenu(bContext *C, uiLayout *layout, void *arg_unused uiItemS(layout); - uiItemMenuF(layout, "Show/Hide", 0, view3d_edit_mesh_showhidemenu); + uiItemMenuF(layout, "Show/Hide", 0, view3d_edit_mesh_showhidemenu, NULL); #if 0 #ifndef DISABLE_PYTHON @@ -2180,7 +2180,7 @@ static void view3d_edit_curvemenu(bContext *C, uiLayout *layout, void *arg_unuse uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, ""); #endif - uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu); + uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu, NULL); uiItemS(layout); @@ -2199,8 +2199,8 @@ static void view3d_edit_curvemenu(bContext *C, uiLayout *layout, void *arg_unuse uiItemS(layout); - uiItemMenuF(layout, "Control Points", 0, view3d_edit_curve_controlpointsmenu); - uiItemMenuF(layout, "Segments", 0, view3d_edit_curve_segmentsmenu); + uiItemMenuF(layout, "Control Points", 0, view3d_edit_curve_controlpointsmenu, NULL); + uiItemMenuF(layout, "Segments", 0, view3d_edit_curve_segmentsmenu, NULL); uiItemS(layout); @@ -2209,7 +2209,7 @@ static void view3d_edit_curvemenu(bContext *C, uiLayout *layout, void *arg_unuse uiItemS(layout); - uiItemMenuF(layout, "Show/Hide Control Points", 0, view3d_edit_curve_showhidemenu); + uiItemMenuF(layout, "Show/Hide Control Points", 0, view3d_edit_curve_showhidemenu, NULL); } #endif @@ -2232,7 +2232,7 @@ static void view3d_edit_latticemenu(bContext *C, uiLayout *layout, void *arg_unu uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, ""); #endif - uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu); + uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu, NULL); uiItemS(layout); @@ -2287,8 +2287,8 @@ static void view3d_edit_armaturemenu(bContext *C, uiLayout *layout, void *arg_un uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, ""); #endif - uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu); - uiItemMenuF(layout, "Bone Roll", 0, view3d_edit_armature_rollmenu); + uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu, NULL); + uiItemMenuF(layout, "Bone Roll", 0, view3d_edit_armature_rollmenu, NULL); if (arm->drawtype == ARM_ENVELOPE) uiItemEnumO(layout, "Scale Envelope Distance", 0, "TFM_OT_transform", "mode", TFM_BONESIZE); @@ -2325,11 +2325,11 @@ static void view3d_edit_armaturemenu(bContext *C, uiLayout *layout, void *arg_un uiItemS(layout); - uiItemMenuF(layout, "Parent", 0, view3d_edit_armature_parentmenu); + uiItemMenuF(layout, "Parent", 0, view3d_edit_armature_parentmenu, NULL); uiItemS(layout); - uiItemMenuF(layout, "Bone Settings ", 0, view3d_edit_armature_settingsmenu); + uiItemMenuF(layout, "Bone Settings ", 0, view3d_edit_armature_settingsmenu, NULL); } #endif @@ -2430,7 +2430,7 @@ static void view3d_pose_armaturemenu(bContext *C, uiLayout *layout, void *arg_un #endif if ( (arm) && ((arm->drawtype == ARM_B_BONE) || (arm->drawtype == ARM_ENVELOPE)) ) uiItemEnumO(layout, "Scale Envelope Distance", 0, "TFM_OT_transform", "mode", TFM_BONESIZE); - uiItemMenuF(layout, "Clear Transform", 0, view3d_pose_armature_transformmenu); + uiItemMenuF(layout, "Clear Transform", 0, view3d_pose_armature_transformmenu, NULL); uiItemS(layout); @@ -2453,14 +2453,14 @@ static void view3d_pose_armaturemenu(bContext *C, uiLayout *layout, void *arg_un uiItemS(layout); - uiItemMenuF(layout, "Pose Library", 0, view3d_pose_armature_poselibmenu); - uiItemMenuF(layout, "Motion Paths", 0, view3d_pose_armature_motionpathsmenu); - uiItemMenuF(layout, "Bone Groups", 0, view3d_pose_armature_groupmenu); + uiItemMenuF(layout, "Pose Library", 0, view3d_pose_armature_poselibmenu, NULL); + uiItemMenuF(layout, "Motion Paths", 0, view3d_pose_armature_motionpathsmenu, NULL); + uiItemMenuF(layout, "Bone Groups", 0, view3d_pose_armature_groupmenu, NULL); uiItemS(layout); - uiItemMenuF(layout, "Inverse Kinematics", 0, view3d_pose_armature_ikmenu); - uiItemMenuF(layout, "Constraints", 0, view3d_pose_armature_constraintsmenu); + uiItemMenuF(layout, "Inverse Kinematics", 0, view3d_pose_armature_ikmenu, NULL); + uiItemMenuF(layout, "Constraints", 0, view3d_pose_armature_constraintsmenu, NULL); uiItemS(layout); @@ -2477,8 +2477,8 @@ static void view3d_pose_armaturemenu(bContext *C, uiLayout *layout, void *arg_un uiItemS(layout); - uiItemMenuF(layout, "Show/Hide Bones", 0, view3d_pose_armature_showhidemenu); - uiItemMenuF(layout, "Bone Settings", 0, view3d_pose_armature_settingsmenu); + uiItemMenuF(layout, "Show/Hide Bones", 0, view3d_pose_armature_showhidemenu, NULL); + uiItemMenuF(layout, "Bone Settings", 0, view3d_pose_armature_settingsmenu, NULL); #if 0 uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Attributes...|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); @@ -2776,7 +2776,7 @@ static void view3d_particlemenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemS(layout); - uiItemMenuF(layout, "Show/Hide Particles", 0, view3d_particle_showhidemenu); + uiItemMenuF(layout, "Show/Hide Particles", 0, view3d_particle_showhidemenu, NULL); } static char *view3d_modeselect_pup(Scene *scene) diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index c09b83dd682..4a24027f7e9 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -225,7 +225,7 @@ void RNA_def_main(BlenderRNA *brna) {"scenes", "Scene", "rna_Main_scene_begin", "Scenes", "Scene datablocks.", NULL, NULL}, {"objects", "Object", "rna_Main_object_begin", "Objects", "Object datablocks.", NULL, NULL}, {"materials", "Material", "rna_Main_mat_begin", "Materials", "Material datablocks.", NULL, NULL}, - {"nodetrees", "NodeTree", "rna_Main_nodetree_begin", "Node Trees", "Nodetree datablocks.", NULL, NULL}, + {"nodegroups", "NodeTree", "rna_Main_nodetree_begin", "Node Groups", "Node group datablocks.", NULL, NULL}, {"meshes", "Mesh", "rna_Main_mesh_begin", "Meshes", "Mesh datablocks.", "add_mesh", "remove_mesh"}, {"lamps", "Lamp", "rna_Main_lamp_begin", "Lamps", "Lamp datablocks.", NULL, NULL}, {"libraries", "Library", "rna_Main_library_begin", "Libraries", "Library datablocks.", NULL, NULL}, diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 6f0a19b7aa9..5ebaeb1da8d 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -41,6 +41,8 @@ #include "BKE_texture.h" +#include "ED_node.h" + static PointerRNA rna_Material_mirror_get(PointerRNA *ptr) { return rna_pointer_inherit_refine(ptr, &RNA_MaterialRaytraceMirror, ptr->id.data); @@ -196,6 +198,15 @@ static void rna_Material_use_specular_ramp_set(PointerRNA *ptr, int value) ma->ramp_spec= add_colorband(0); } +void rna_Material_use_nodes_set(PointerRNA *ptr, int value) +{ + Material *ma= (Material*)ptr->data; + + ma->use_nodes= value; + if(ma->use_nodes && ma->nodetree==NULL) + ED_node_shader_default(ma); +} + #else static void rna_def_material_mtex(BlenderRNA *brna) @@ -1379,6 +1390,12 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "nodetree"); RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node based materials."); + prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1); + RNA_def_property_boolean_funcs(prop, NULL, "rna_Material_use_nodes_set"); + RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes to render the material."); + RNA_def_property_update(prop, NC_MATERIAL, NULL); + /* common */ rna_def_animdata_common(srna); rna_def_mtex_common(srna, "rna_Material_mtex_begin", "rna_Material_active_texture_get", diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index c8be3c7afac..88796919c3e 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -62,6 +62,8 @@ EnumPropertyItem prop_mode_items[] ={ #include "BLI_threads.h" +#include "ED_node.h" + #include "RE_pipeline.h" PointerRNA rna_Scene_objects_get(CollectionPropertyIterator *iter) @@ -371,6 +373,15 @@ static void rna_SceneRenderLayer_pass_update(bContext *C, PointerRNA *ptr) ntreeCompositForceHidden(scene->nodetree, scene); } +void rna_Scene_use_nodes_set(PointerRNA *ptr, int value) +{ + Scene *scene= (Scene*)ptr->data; + + scene->use_nodes= value; + if(scene->use_nodes && scene->nodetree==NULL) + ED_node_composit_default(scene); +} + #else static void rna_def_tool_settings(BlenderRNA *brna) @@ -1663,7 +1674,12 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE); RNA_def_property_ui_text(prop, "Free Image Textures", "Free all image texture from memory after render, to save memory before compositing."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - + + prop= RNA_def_property(srna, "free_unused_nodes", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_FREE_IMAGE); + RNA_def_property_ui_text(prop, "Free Unused Nodes", "Free Nodes that are not used while compositing, to save memory."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + prop= RNA_def_property(srna, "save_buffers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "scemode", R_EXR_TILE_FILE); RNA_def_property_boolean_funcs(prop, "rna_SceneRenderData_save_buffers_get", NULL); @@ -1903,6 +1919,12 @@ void RNA_def_scene(BlenderRNA *brna) /* Nodes (Compositing) */ prop= RNA_def_property(srna, "nodetree", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Node Tree", "Compositing node tree."); + + prop= RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1); + RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_use_nodes_set"); + RNA_def_property_ui_text(prop, "Use Nodes", "Enable the compositing node tree."); + RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); /* Sequencer */ prop= RNA_def_property(srna, "sequence_editor", PROP_POINTER, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index e5332d32f13..be0707390c4 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -33,6 +33,7 @@ #include "rna_internal.h" #include "DNA_action_types.h" +#include "DNA_node_types.h" #include "DNA_object_types.h" #include "DNA_space_types.h" #include "DNA_view3d_types.h" @@ -1403,10 +1404,53 @@ static void rna_def_space_userpref(BlenderRNA *brna) static void rna_def_space_node(BlenderRNA *brna) { StructRNA *srna; + PropertyRNA *prop; + static EnumPropertyItem tree_type_items[] = { + {NTREE_SHADER, "MATERIAL", ICON_MATERIAL, "Material", "Material nodes."}, + {NTREE_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture nodes."}, + {NTREE_COMPOSIT, "COMPOSITING", ICON_RENDER_RESULT, "Compositing", "Compositing nodes."}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem texture_type_items[] = { + {SNODE_TEX_OBJECT, "OBJECT", ICON_OBJECT_DATA, "Object", "Edit texture nodes from Object."}, + {SNODE_TEX_WORLD, "WORLD", ICON_WORLD_DATA, "World", "Edit texture nodes from World."}, + {SNODE_TEX_BRUSH, "BRUSH", ICON_BRUSH_DATA, "Brush", "Edit texture nodes from Brush."}, + {0, NULL, 0, NULL, NULL}}; + srna= RNA_def_struct(brna, "SpaceNodeEditor", "Space"); RNA_def_struct_sdna(srna, "SpaceNode"); RNA_def_struct_ui_text(srna, "Space Node Editor", "Node editor space data."); + + prop= RNA_def_property(srna, "tree_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "treetype"); + RNA_def_property_enum_items(prop, tree_type_items); + RNA_def_property_ui_text(prop, "Tree Type", "Node tree type to display and edit."); + RNA_def_property_update(prop, NC_NODE, NULL); + + prop= RNA_def_property(srna, "texture_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "texfrom"); + RNA_def_property_enum_items(prop, texture_type_items); + RNA_def_property_ui_text(prop, "Texture Type", "Type of data to take texture from."); + RNA_def_property_update(prop, NC_NODE, NULL); + + prop= RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "ID", "Datablock whose nodes are being edited."); + + prop= RNA_def_property(srna, "id_from", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "from"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "ID From", "Datablock from which the edited datablock is linked."); + + prop= RNA_def_property(srna, "nodetree", PROP_POINTER, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Node Tree", "Node tree being displayed and edited."); + + prop= RNA_def_property(srna, "backdrop", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_BACKDRAW); + RNA_def_property_ui_text(prop, "Backdrop", "Use active Viewer Node output as backdrop for compositing nodes."); + RNA_def_property_update(prop, NC_NODE, NULL); } static void rna_def_space_logic(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index a5737536b7d..b7403ab1178 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -53,6 +53,7 @@ static EnumPropertyItem texture_filter_items[] = { #ifdef RNA_RUNTIME #include "BKE_texture.h" +#include "ED_node.h" StructRNA *rna_Texture_refine(struct PointerRNA *ptr) { @@ -187,9 +188,8 @@ void rna_Texture_use_nodes_set(PointerRNA *ptr, int v) tex->use_nodes = v; tex->type = 0; - if(v && tex->nodetree==NULL) { - node_texture_default(tex); - } + if(v && tex->nodetree==NULL) + ED_node_texture_default(tex); } static void rna_ImageTexture_mipmap_set(PointerRNA *ptr, int value) diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 89927003220..00e9f6a2fa2 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -133,6 +133,7 @@ typedef struct wmNotifier { #define NC_FILE (14<<24) #define NC_ANIMATION (15<<24) #define NC_CONSOLE (16<<24) +#define NC_NODE (17<<24) /* data type, 256 entries is enough, it can overlap */ #define NOTE_DATA 0x00FF0000 From eb6c5d7a7f722493f38255825b908e0f3df831f3 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Wed, 19 Aug 2009 01:03:34 +0000 Subject: [PATCH 135/577] New scons option (WITHOUT_BF_PYTHON_INSTALL) to disable copying python files from system --- tools/Blender.py | 2 +- tools/btools.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/Blender.py b/tools/Blender.py index 0d2671dbfac..789a6981558 100644 --- a/tools/Blender.py +++ b/tools/Blender.py @@ -587,7 +587,7 @@ class BlenderEnvironment(SConsEnvironment): lenv.AddPostAction(prog,Action(AppIt,strfunction=my_appit_print)) elif os.sep == '/': # any unix if lenv['WITH_BF_PYTHON']: - if not lenv['WITHOUT_BF_INSTALL']: + if not lenv['WITHOUT_BF_INSTALL'] and not lenv['WITHOUT_BF_PYTHON_INSTALL']: lenv.AddPostAction(prog,Action(PyInstall,strfunction=my_pyinst_print)) return prog diff --git a/tools/btools.py b/tools/btools.py index 0314aba25b5..3e80ac453ce 100755 --- a/tools/btools.py +++ b/tools/btools.py @@ -59,8 +59,8 @@ def validate_arguments(args, bc): 'BF_CXX', 'WITH_BF_STATICCXX', 'BF_CXX_LIB_STATIC', 'BF_TWEAK_MODE', 'BF_SPLIT_SRC', 'WITHOUT_BF_INSTALL', + 'WITHOUT_BF_PYTHON_INSTALL', 'WITH_BF_OPENMP', - 'WITHOUT_BF_INSTALL', 'BF_FANCY', 'BF_QUIET', 'BF_X264_CONFIG', 'BF_XVIDCORE_CONFIG', @@ -363,6 +363,7 @@ def read_opts(cfg, args): (BoolVariable('BF_TWEAK_MODE', 'Enable tweak mode if true', False)), (BoolVariable('BF_SPLIT_SRC', 'Split src lib into several chunks if true', False)), (BoolVariable('WITHOUT_BF_INSTALL', 'dont install if true', False)), + (BoolVariable('WITHOUT_BF_PYTHON_INSTALL', 'dont install Python modules if true', False)), (BoolVariable('BF_FANCY', 'Enable fancy output if true', True)), (BoolVariable('BF_QUIET', 'Enable silent output if true', True)), (BoolVariable('WITH_BF_BINRELOC', 'Enable relocatable binary (linux only)', False)), From 680f88017fda17582ac5b4c7e1b3afecbb56b2f8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 19 Aug 2009 01:11:18 +0000 Subject: [PATCH 136/577] updated for new transparency RNA names --- release/io/engine_render_pov.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/release/io/engine_render_pov.py b/release/io/engine_render_pov.py index 97337ebc853..65add2baacb 100644 --- a/release/io/engine_render_pov.py +++ b/release/io/engine_render_pov.py @@ -56,7 +56,7 @@ def write_pov(filename, scene=None, info_callback = None): (matrix[0][0], matrix[0][1], matrix[0][2], matrix[1][0], matrix[1][1], matrix[1][2], matrix[2][0], matrix[2][1], matrix[2][2], matrix[3][0], matrix[3][1], matrix[3][2]) ) def writeObjectMaterial(material): - if material and material.raytrace_transparency.enabled: + if material and material.transparency_method=='RAYTRACE': file.write('\tinterior { ior %.6f }\n' % material.raytrace_transparency.ior) # Other interior args @@ -114,7 +114,7 @@ def write_pov(filename, scene=None, info_callback = None): # This is written into the object ''' - if material.raytrace_transparency.enabled: + if material and material.transparency_method=='RAYTRACE': 'interior { ior %.3g} ' % material.raytrace_transparency.ior ''' @@ -248,8 +248,8 @@ def write_pov(filename, scene=None, info_callback = None): if material: diffuse_color = material.diffuse_color - if material.raytrace_transparency.enabled: trans = 1-material.raytrace_transparency.filter - else: trans = 0.0 + if material.transparency and material.transparency_method=='RAYTRACE': trans = 1-material.raytrace_transparency.filter + else: trans = 0.0 file.write( 'pigment {rgbft<%.3g, %.3g, %.3g, %.3g, %.3g>} finish {%s} }\n' % \ @@ -425,8 +425,8 @@ def write_pov(filename, scene=None, info_callback = None): material = me_materials[col[3]] material_finish = materialNames[material.name] - if material.raytrace_transparency.enabled: trans = 1-material.raytrace_transparency.filter - else: trans = 0.0 + if material.transparency and material.transparency_method=='RAYTRACE': trans = 1-material.raytrace_transparency.filter + else: trans = 0.0 else: material_finish = DEF_MAT_NAME # not working properly, From 8480ea2b0abacae00c90d37e7d99fa5e0c89eebe Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 19 Aug 2009 05:54:53 +0000 Subject: [PATCH 137/577] *small volume render code cleanups --- .../blender/render/intern/source/volumetric.c | 23 ++++--------------- 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index f112c237319..3c3827d8baf 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -63,17 +63,9 @@ extern struct Render R; /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -static int vol_backface_intersect_check(Isect *is, int ob, RayFace *face) -{ - VlakRen *vlr = (VlakRen *)face; - - /* only consider faces away, so overlapping layers - * of foward facing geometry don't cause the ray to stop */ - return (INPR(is->vec, vlr->n) < 0.0f); -} /* TODO: Box or sphere intersection types could speed things up */ -static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, Isect *isect, int intersect_type, int checkfunc) +static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, Isect *isect, int intersect_type) { float maxsize = RE_ray_tree_max_size(R.raytree); int intersected=0; @@ -132,11 +124,6 @@ float vol_get_stepsize(struct ShadeInput *shi, int context) return shi->mat->vol.stepsize; } -static float vol_get_depth_cutoff(struct ShadeInput *shi) -{ - return shi->mat->vol.depth_cutoff; -} - /* trilinear interpolation */ static void vol_get_precached_scattering(ShadeInput *shi, float *scatter_col, float *co) { @@ -335,7 +322,7 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * Isect is; /* find minimum of volume bounds, or lamp coord */ - if (vol_get_bounds(shi, co, lv, hitco, &is, VOL_BOUNDS_SS, 0)) { + if (vol_get_bounds(shi, co, lv, hitco, &is, VOL_BOUNDS_SS)) { float dist = VecLenf(co, hitco); VlakRen *vlr = (VlakRen *)is.face; @@ -421,7 +408,7 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float float tau[3], emit_col[3], scatter_col[3] = {0.0, 0.0, 0.0}; float stepvec[3], step_sta[3], step_end[3], step_mid[3]; float density = vol_get_density(shi, co); - const float depth_cutoff = vol_get_depth_cutoff(shi); + const float depth_cutoff = shi->mat->vol.depth_cutoff; /* multiply col_behind with beam transmittance over entire distance */ vol_get_attenuation(shi, tau, co, endco, density, stepsize); @@ -593,7 +580,7 @@ static void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr, int in } /* trace to find a backface, the other side bounds of the volume */ /* (ray intersect ignores front faces here) */ - else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH, 0)) { + else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH)) { VlakRen *vlr = (VlakRen *)is.face; /* if it's another face in the same material */ @@ -657,7 +644,7 @@ void shade_volume_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct } /* trace to find a backface, the other side bounds of the volume */ /* (ray intersect ignores front faces here) */ - else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH, 0)) { + else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH)) { vol_get_attenuation(shi, tau, shi->co, hitco, -1.0f, shade_stepsize); tr[0] = exp(-tau[0]); From 360235a5f4ce9b56b3790e2c294662a09b5528e4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 19 Aug 2009 07:48:56 +0000 Subject: [PATCH 138/577] cmake cleanup (remove unused includes, make some within IF checks) --- CMakeLists.txt | 2 +- blenderplayer/CMakeLists.txt | 14 ++++++-------- source/blender/editors/CMakeLists.txt | 6 +++--- source/blender/editors/screen/CMakeLists.txt | 5 ++--- source/blender/imbuf/CMakeLists.txt | 4 ++-- source/blender/nodes/CMakeLists.txt | 4 ++-- source/blender/render/CMakeLists.txt | 6 +++--- source/blender/windowmanager/CMakeLists.txt | 6 +++--- source/creator/CMakeLists.txt | 6 +++++- source/gameengine/BlenderRoutines/CMakeLists.txt | 5 +---- source/gameengine/Converter/CMakeLists.txt | 4 ---- source/gameengine/GamePlayer/common/CMakeLists.txt | 2 -- source/gameengine/GamePlayer/ghost/CMakeLists.txt | 3 --- source/gameengine/Ketsji/CMakeLists.txt | 3 --- 14 files changed, 28 insertions(+), 42 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f12d342726..00d2244511f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,7 +70,7 @@ OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OPTION(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF) OPTION(WITH_FFTW3 "Enable FFTW3 support" OFF) OPTION(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" OFF) -OPTION(WITH_CXX_GUARDEDALLOC "" OFF) +OPTION(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation" OFF) OPTION(WITH_INSTALL "Install accompanying scripts and language files needed to run blender" ON) IF(NOT WITH_GAMEENGINE AND WITH_PLAYER) diff --git a/blenderplayer/CMakeLists.txt b/blenderplayer/CMakeLists.txt index 77bc059a6a0..0407361b845 100644 --- a/blenderplayer/CMakeLists.txt +++ b/blenderplayer/CMakeLists.txt @@ -66,17 +66,12 @@ IF(UNIX) gp_common bf_string bf_ghost - bf_blenkernel - verse - bf_blenkernel + bf_blenkernel bf_blenloader bf_blenpluginapi bf_blroutines bf_converter - bf_sumo bf_ketsji - extern_solid - extern_qhull bf_bullet bf_common bf_dummy @@ -105,10 +100,13 @@ IF(UNIX) bf_dds bf_readblenfile blenkernel_blc - bf_quicktime extern_binreloc extern_glew - ) + ) + + IF(WITH_QUICKTIME) + SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} quicktime) + ENDIF(WITH_QUICKTIME) IF(WITH_CXX_GUARDEDALLOC) SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_guardedalloc_cpp) diff --git a/source/blender/editors/CMakeLists.txt b/source/blender/editors/CMakeLists.txt index 96b6fa5b7ab..c40b18ea099 100644 --- a/source/blender/editors/CMakeLists.txt +++ b/source/blender/editors/CMakeLists.txt @@ -31,10 +31,10 @@ SET(INC ../windowmanager ../../../intern/guardedalloc ../../../intern/memutil ../blenlib ../makesdna ../makesrna ../blenkernel ../include ../imbuf ../render/extern/include - ../../../intern/bsp/extern ../radiosity/extern/include + ../../../intern/bsp/extern ../../../intern/decimation/extern ../blenloader ../python ../../kernel/gen_system ../readstreamglue - ../quicktime ../../../intern/elbeem/extern + ../../../intern/elbeem/extern ../../../intern/ghost ../../../intern/opennl/extern ../../../extern/glew/include ../../../intern/smoke/extern ../../../intern/audaspace/intern ../nodes @@ -59,7 +59,7 @@ IF(WITH_OPENJPEG) ENDIF(WITH_OPENJPEG) IF(WITH_QUICKTIME) - SET(INC ${INC} ${QUICKTIME_INC}) + SET(INC ${INC} ../quicktime ${QUICKTIME_INC}) ADD_DEFINITIONS(-DWITH_QUICKTIME) ENDIF(WITH_QUICKTIME) diff --git a/source/blender/editors/screen/CMakeLists.txt b/source/blender/editors/screen/CMakeLists.txt index 6861f82ac3f..7429f45c00f 100644 --- a/source/blender/editors/screen/CMakeLists.txt +++ b/source/blender/editors/screen/CMakeLists.txt @@ -35,10 +35,9 @@ SET(INC ../../windowmanager ../../blenlib ../../makesdna ../../makesrna ../../blenkernel ../../include ../../imbuf ../../render/extern/include ../../../../intern/bsp/extern - ../../radiosity/extern/include ../../../intern/decimation/extern ../../blenloader ../../../kernel/gen_system ../../readstreamglue - ../../quicktime ../../../../intern/elbeem/extern + ../../../../intern/elbeem/extern ../../../../intern/ghost ../../../../intern/opennl/extern ../../nodes ) @@ -52,7 +51,7 @@ IF(WITH_OPENEXR) ENDIF(WITH_OPENEXR) IF(WITH_QUICKTIME) - SET(INC ${INC} ${QUICKTIME_INC}) + SET(INC ${INC} ../../quicktime ${QUICKTIME_INC}) ADD_DEFINITIONS(-DWITH_QUICKTIME) ENDIF(WITH_QUICKTIME) diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt index 391f6e9e1a2..76dd2afebdc 100644 --- a/source/blender/imbuf/CMakeLists.txt +++ b/source/blender/imbuf/CMakeLists.txt @@ -28,7 +28,7 @@ FILE(GLOB SRC intern/*.c) SET(INC . ../makesdna ../../../intern/guardedalloc ../../../intern/memutil ../blenlib - ../avi ../quicktime ../blenkernel + ../avi ../blenkernel ${JPEG_INC} ${PNG_INC} ${TIFF_INC} @@ -45,7 +45,7 @@ IF(WITH_OPENJPEG) ENDIF(WITH_OPENJPEG) IF(WITH_QUICKTIME) - SET(INC ${INC} ${QUICKTIME_INC}) + SET(INC ${INC} ../quicktime ${QUICKTIME_INC}) ADD_DEFINITIONS(-DWITH_QUICKTIME) ENDIF(WITH_QUICKTIME) diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt index ca21ba592a8..bba96adf25e 100644 --- a/source/blender/nodes/CMakeLists.txt +++ b/source/blender/nodes/CMakeLists.txt @@ -29,7 +29,7 @@ SET(INC . ../../../intern/guardedalloc ../editors/include ../blenlib ../makesdna ../render/extern/include ../../../intern/decimation/extern ../makesrna ../imbuf ../avi ../../../intern/elbeem/extern - ../../../intern/iksolver/extern ../blenloader ../quicktime + ../../../intern/iksolver/extern ../blenloader ../blenkernel ../../../extern/glew/include ../gpu ${ZLIB_INC} ) @@ -39,7 +39,7 @@ IF(WITH_OPENEXR) ENDIF(WITH_OPENEXR) IF(WITH_QUICKTIME) - SET(INC ${INC} ${QUICKTIME_INC}) + SET(INC ${INC} ../quicktime ${QUICKTIME_INC}) ADD_DEFINITIONS(-DWITH_QUICKTIME) ENDIF(WITH_QUICKTIME) diff --git a/source/blender/render/CMakeLists.txt b/source/blender/render/CMakeLists.txt index 411bd61c3ff..185662c5a42 100644 --- a/source/blender/render/CMakeLists.txt +++ b/source/blender/render/CMakeLists.txt @@ -28,8 +28,8 @@ FILE(GLOB SRC intern/source/*.c) SET(INC intern/include ../../../intern/guardedalloc ../blenlib ../makesdna - extern/include ../blenkernel ../radiosity/extern/include ../imbuf - ../quicktime ../include ../../kernel/gen_messaging ../blenloader + extern/include ../blenkernel ../imbuf + ../include ../../kernel/gen_messaging ../blenloader ../makesrna ) @@ -38,7 +38,7 @@ IF(WITH_OPENEXR) ENDIF(WITH_OPENEXR) IF(WITH_QUICKTIME) - SET(INC ${INC} ${QUICKTIME_INC}) + SET(INC ${INC} ../quicktime ${QUICKTIME_INC}) ADD_DEFINITIONS(-DWITH_QUICKTIME) ENDIF(WITH_QUICKTIME) diff --git a/source/blender/windowmanager/CMakeLists.txt b/source/blender/windowmanager/CMakeLists.txt index a268ffebffb..26d4ab20356 100644 --- a/source/blender/windowmanager/CMakeLists.txt +++ b/source/blender/windowmanager/CMakeLists.txt @@ -31,10 +31,10 @@ SET(INC . ../../../intern/guardedalloc ../../../intern/memutil ../blenlib ../makesdna ../makesrna ../blenkernel ../include ../imbuf ../render/extern/include - ../../../intern/bsp/extern ../radiosity/extern/include + ../../../intern/bsp/extern ../../../intern/decimation/extern ../blenloader ../../kernel/gen_system ../readstreamglue - ../quicktime ../../../intern/elbeem/extern + ../../../intern/elbeem/extern ../../../intern/ghost ../../../intern/opennl/extern ../../../extern/glew/include ../nodes ../gpu @@ -51,7 +51,7 @@ IF(WITH_OPENEXR) ENDIF(WITH_OPENEXR) IF(WITH_QUICKTIME) - SET(INC ${INC} ${QUICKTIME_INC}) + SET(INC ${INC} ../quicktime ${QUICKTIME_INC}) ADD_DEFINITIONS(-DWITH_QUICKTIME) ENDIF(WITH_QUICKTIME) diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index a9368e021cd..3a2cef2d038 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -337,7 +337,6 @@ IF(UNIX) bf_moto bf_python bf_gen_python - bf_quicktime extern_binreloc extern_glew extern_libopenjpeg @@ -352,6 +351,11 @@ IF(UNIX) SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_guardedalloc_cpp) ENDIF(WITH_CXX_GUARDEDALLOC) + IF(WITH_QUICKTIME) + SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_quicktime) + ENDIF(WITH_QUICKTIME) + + FOREACH(SORTLIB ${BLENDER_SORTED_LIBS}) SET(REMLIB ${SORTLIB}) FOREACH(SEARCHLIB ${BLENDER_LINK_LIBS}) diff --git a/source/gameengine/BlenderRoutines/CMakeLists.txt b/source/gameengine/BlenderRoutines/CMakeLists.txt index 704e3cef6cd..42e270d0fe7 100644 --- a/source/gameengine/BlenderRoutines/CMakeLists.txt +++ b/source/gameengine/BlenderRoutines/CMakeLists.txt @@ -27,15 +27,12 @@ SET(INC ../../../source/gameengine/Network ../../../source/gameengine/SceneGraph ../../../source/gameengine/Physics/common - ../../../source/gameengine/Physics/Bullet - ../../../source/gameengine/Physics/Sumo - ../../../source/gameengine/Physics/Sumo/Fuzzics/include + ../../../source/gameengine/Physics/Bullet ../../../source/gameengine/Network/LoopBackNetwork ../../../source/blender/misc ../../../source/blender/blenloader ../../../source/blender/gpu ../../../extern/bullet2/src - ../../../extern/solid ../../../extern/glew/include ${PYTHON_INC} ) diff --git a/source/gameengine/Converter/CMakeLists.txt b/source/gameengine/Converter/CMakeLists.txt index 6732a62a5cb..f16e9e169ab 100644 --- a/source/gameengine/Converter/CMakeLists.txt +++ b/source/gameengine/Converter/CMakeLists.txt @@ -54,16 +54,12 @@ SET(INC ../../../source/gameengine/SceneGraph ../../../source/gameengine/Physics/common ../../../source/gameengine/Physics/Bullet - ../../../source/gameengine/Physics/BlOde ../../../source/gameengine/Physics/Dummy - ../../../source/gameengine/Physics/Sumo - ../../../source/gameengine/Physics/Sumo/Fuzzics/include ../../../source/gameengine/Network/LoopBackNetwork ../../../source/blender/misc ../../../source/blender/blenloader ../../../source/blender/gpu ../../../extern/bullet2/src - ../../../extern/solid ${PYTHON_INC} ) diff --git a/source/gameengine/GamePlayer/common/CMakeLists.txt b/source/gameengine/GamePlayer/common/CMakeLists.txt index af25f4b884e..da99087c917 100644 --- a/source/gameengine/GamePlayer/common/CMakeLists.txt +++ b/source/gameengine/GamePlayer/common/CMakeLists.txt @@ -60,8 +60,6 @@ SET(INC ../../../../source/gameengine/Network ../../../../source/gameengine/SceneGraph ../../../../source/gameengine/Physics/common - ../../../../source/gameengine/Physics/Sumo - ../../../../source/gameengine/Physics/Sumo/Fuzzics/include ../../../../source/gameengine/Network/LoopBackNetwork ../../../../source/gameengine/GamePlayer/ghost ../../../../source/blender/misc diff --git a/source/gameengine/GamePlayer/ghost/CMakeLists.txt b/source/gameengine/GamePlayer/ghost/CMakeLists.txt index e07a7fb26ad..377d765af85 100644 --- a/source/gameengine/GamePlayer/ghost/CMakeLists.txt +++ b/source/gameengine/GamePlayer/ghost/CMakeLists.txt @@ -57,14 +57,11 @@ SET(INC ../../../../source/gameengine/Network ../../../../source/gameengine/SceneGraph ../../../../source/gameengine/Physics/common - ../../../../source/gameengine/Physics/Sumo - ../../../../source/gameengine/Physics/Sumo/Fuzzics/include ../../../../source/gameengine/Network/LoopBackNetwork ../../../../source/gameengine/GamePlayer/common ../../../../source/blender/misc ../../../../source/blender/blenloader ../../../../source/blender/gpu - ../../../../extern/solid ../../../../extern/glew/include ${PYTHON_INC} ) diff --git a/source/gameengine/Ketsji/CMakeLists.txt b/source/gameengine/Ketsji/CMakeLists.txt index 77bdd80721f..c91a3771b45 100644 --- a/source/gameengine/Ketsji/CMakeLists.txt +++ b/source/gameengine/Ketsji/CMakeLists.txt @@ -52,15 +52,12 @@ SET(INC ../../../source/gameengine/SceneGraph ../../../source/gameengine/Physics/common ../../../source/gameengine/Physics/Bullet - ../../../source/gameengine/Physics/Sumo - ../../../source/gameengine/Physics/Sumo/Fuzzics/include ../../../source/gameengine/Network/LoopBackNetwork ../../../intern/audaspace/intern ../../../source/blender/misc ../../../source/blender/blenloader ../../../source/blender/gpu ../../../extern/bullet2/src - ../../../extern/solid ../../../extern/glew/include ${PYTHON_INC} ) From 9b25a3bb2aea0447583a06e4bd89767cee1ee7cb Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Wed, 19 Aug 2009 09:12:21 +0000 Subject: [PATCH 139/577] 2.5 Timeline: * Removed timeline_header.c with old Buttons code. --- .../blender/editors/space_time/space_time.c | 29 -- .../blender/editors/space_time/time_header.c | 476 ------------------ 2 files changed, 505 deletions(-) delete mode 100644 source/blender/editors/space_time/time_header.c diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c index 784b151f909..f18da93c35d 100644 --- a/source/blender/editors/space_time/space_time.c +++ b/source/blender/editors/space_time/space_time.c @@ -270,42 +270,15 @@ static void time_main_area_listener(ARegion *ar, wmNotifier *wmn) /* ************************ header time area region *********************** */ -#define PY_HEADER /* add handlers, stuff you only do once or on area/region changes */ static void time_header_area_init(wmWindowManager *wm, ARegion *ar) { -#ifdef PY_HEADER ED_region_header_init(ar); -#else - UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy); -#endif } static void time_header_area_draw(const bContext *C, ARegion *ar) { -#ifdef PY_HEADER ED_region_header(C, ar); -#else - - float col[3]; - - /* clear */ - if(ED_screen_area_active(C)) - UI_GetThemeColor3fv(TH_HEADER, col); - else - UI_GetThemeColor3fv(TH_HEADERDESEL, col); - - glClearColor(col[0], col[1], col[2], 0.0); - glClear(GL_COLOR_BUFFER_BIT); - - /* set view2d view matrix for scrolling (without scrollers) */ - UI_view2d_view_ortho(C, &ar->v2d); - - time_header_buttons(C, ar); -#endif - - /* restore view matrix? */ - UI_view2d_view_restore(C); } static void time_header_area_listener(ARegion *ar, wmNotifier *wmn) @@ -382,8 +355,6 @@ static SpaceLink *time_new(const bContext *C) static void time_free(SpaceLink *sl) { } - - /* spacetype; init callback in ED_area_initialize() */ /* init is called to (re)initialize an existing editor (file read, screen changes) */ /* validate spacedata, add own area level handlers */ diff --git a/source/blender/editors/space_time/time_header.c b/source/blender/editors/space_time/time_header.c deleted file mode 100644 index 13265166d98..00000000000 --- a/source/blender/editors/space_time/time_header.c +++ /dev/null @@ -1,476 +0,0 @@ -/** - * $Id$ - * - * ***** 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) 2008 Blender Foundation. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#include -#include - -#include "DNA_space_types.h" -#include "DNA_scene_types.h" -#include "DNA_screen_types.h" -#include "DNA_windowmanager_types.h" -#include "DNA_userdef_types.h" - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" - -#include "BKE_context.h" -#include "BKE_global.h" -#include "BKE_screen.h" - -#include "ED_keyframing.h" -#include "ED_screen.h" -#include "ED_screen_types.h" -#include "ED_types.h" -#include "ED_util.h" - -#include "WM_api.h" -#include "WM_types.h" - -#include "RNA_access.h" - -#include "BIF_gl.h" -#include "BIF_glutil.h" - -#include "UI_interface.h" -#include "UI_resources.h" -#include "UI_view2d.h" - -#include "ED_markers.h" - -#include "time_intern.h" - - -/* ************************ header time area region *********************** */ - -static void do_time_viewmenu(bContext *C, void *arg, int event) -{ - ScrArea *curarea= CTX_wm_area(C); - SpaceTime *stime= CTX_wm_space_time(C); - View2D *v2d= UI_view2d_fromcontext_rwin(C); - Scene *scene= CTX_data_scene(C); - int first; - - switch(event) { - case 2: /* Play Back Animation */ - //if(!has_screenhandler(G.curscreen, SCREEN_HANDLER_ANIM)) - // start_animated_screen(stime); - break; - case 3: /* View All */ - if(v2d) { - first= scene->r.sfra; - if(first >= scene->r.efra) first= scene->r.efra; - v2d->cur.xmin=v2d->tot.xmin= (float)first-2; - v2d->cur.xmax=v2d->tot.xmax= (float)scene->r.efra+2; - - ED_area_tag_redraw(curarea); - } - break; - case 4: /* Maximize Window */ - /* using event B_FULL */ - break; - case 5: /* show time or frames */ - stime->flag ^= TIME_DRAWFRAMES; - ED_area_tag_redraw(curarea); - break; - case 6: - //nextprev_marker(1); - break; - case 7: - //nextprev_marker(-1); - break; - case 10: - //timeline_frame_to_center(); - break; - case 11: - if(v2d) { - v2d->flag ^= V2D_VIEWSYNC_SCREEN_TIME; - UI_view2d_sync(CTX_wm_screen(C), CTX_wm_area(C), v2d, V2D_LOCK_SET); - } - break; - case 12: /* only show keyframes from selected data */ - stime->flag ^= TIME_ONLYACTSEL; - ED_area_tag_redraw(curarea); - break; - } -} - -static uiBlock *time_viewmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - ScrArea *curarea= CTX_wm_area(C); - SpaceTime *stime= CTX_wm_space_time(C); - View2D *v2d= UI_view2d_fromcontext_rwin(C); - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "time_viewmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_time_viewmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation", 0, yco-=20, - menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(stime->flag & TIME_DRAWFRAMES) - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Seconds|Ctrl T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - else - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Frames|Ctrl T", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - - uiDefIconTextBut(block, BUTM, 1, (stime->flag & TIME_ONLYACTSEL)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, - "Only Selected Data Keys|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Next Marker|PageUp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Prev Marker|PageDown", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Next Key|Ctrl PageUp", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Prev Key|Ctrl PageDown", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center View|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextBut(block, BUTM, 1, (v2d->flag & V2D_VIEWSYNC_SCREEN_TIME)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT, - "Lock Time to Other Windows|", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, ""); - -// if (!curarea->full) -// uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); -// else -// uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - uiEndBlock(C, block); - - return block; -} - -static void do_time_framemenu(bContext *C, void *arg, int event) -{ - Scene *scene= CTX_data_scene(C); - - switch(event) { - case 1: /*Set as Start */ - if (scene->r.psfra) { - if (scene->r.pefra < scene->r.cfra) - scene->r.pefra= scene->r.cfra; - scene->r.psfra= scene->r.cfra; - } - else - scene->r.sfra = scene->r.cfra; - WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene); - break; - case 2: /* Set as End */ - if (scene->r.psfra) { - if (scene->r.cfra < scene->r.psfra) - scene->r.psfra= scene->r.cfra; - scene->r.pefra= scene->r.cfra; - } - else - scene->r.efra = scene->r.cfra; - WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene); - break; - case 3: /* Rename Marker */ - //rename_marker(); - break; - } -} - -static uiBlock *time_framemenu(bContext *C, ARegion *ar, void *arg_unused) -{ - ScrArea *curarea= CTX_wm_area(C); - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "time_framemenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_time_framemenu, NULL); - - uiDefIconTextButO(block, BUTM, "MARKER_OT_add", WM_OP_EXEC_REGION_WIN, ICON_BLANK1, "Add Marker", - 0, yco-=2, menuwidth, 19, ""); - uiDefIconTextButO(block, BUTM, "MARKER_OT_duplicate", WM_OP_EXEC_REGION_WIN, ICON_BLANK1, "Duplicate Marker", - 0, yco-=20, menuwidth, 19, ""); - uiDefIconTextButO(block, BUTM, "MARKER_OT_delete", WM_OP_EXEC_REGION_WIN, ICON_BLANK1, "Delete Marker", - 0, yco-=20, menuwidth, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Name Marker|Ctrl M", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - uiDefIconTextButO(block, BUTM, "MARKER_OT_move", WM_OP_INVOKE_REGION_WIN, ICON_BLANK1, "Grab/Move Marker", - 0, yco-=20, menuwidth, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set as Start|S", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set as End|E", - 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - - if(curarea->headertype==HEADERTOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - uiEndBlock(C, block); - - return block; -} - - -#define B_REDRAWALL 750 -#define B_TL_PLAY 752 -#define B_TL_RPLAY 760 -#define B_TL_STOP 756 -#define B_TL_PREVIEWON 757 - -#define B_FLIPINFOMENU 0 -#define B_NEWFRAME 0 -#define B_DIFF 0 - - -void do_time_buttons(bContext *C, void *arg, int event) -{ - Scene *scene= CTX_data_scene(C); - - switch(event) { - case B_REDRAWALL: - WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene); - break; - case B_NEWFRAME: - WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene); - break; - case B_TL_PREVIEWON: - if (scene->r.psfra) { - /* turn on preview range */ - scene->r.psfra= scene->r.sfra; - scene->r.pefra= scene->r.efra; - } - else { - /* turn off preview range */ - scene->r.psfra= 0; - scene->r.pefra= 0; - } - //BIF_undo_push("Set anim-preview range"); - WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene); - break; - } -} - - -void time_header_buttons(const bContext *C, ARegion *ar) -{ - ScrArea *sa= CTX_wm_area(C); - Scene *scene= CTX_data_scene(C); - wmTimer *animtimer= CTX_wm_screen(C)->animtimer; - uiBlock *block; - uiBut *but; - int xco, yco= 3; - char *menustr= NULL; - - block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS); - uiBlockSetHandleFunc(block, do_time_buttons, NULL); - - xco= ED_area_header_standardbuttons(C, block, yco); - - if((sa->flag & HEADER_NO_PULLDOWN)==0) { - int xmax; - - xmax= GetButStringLength("View"); - uiDefPulldownBut(block, time_viewmenu, sa, - "View", xco, yco, xmax-3, 20, ""); - xco+= xmax; - xmax= GetButStringLength("Frame"); - uiDefPulldownBut(block, time_framemenu, sa, - "Frame", xco, yco, xmax-3, 20, ""); - xco+= xmax; - } - - uiBlockSetEmboss(block, UI_EMBOSS); - - - - uiDefButI(block, TOG, B_TL_PREVIEWON,"PR", - xco,yco, XIC*2, YIC, - &scene->r.psfra,0, 1, 0, 0, - "Show settings for frame range of animation preview"); - - xco += XIC*2; - - uiBlockBeginAlign(block); - - if (scene->r.psfra) { - uiDefButI(block, NUM, B_REDRAWALL,"Start:", - xco,yco, (int)4.5*XIC, YIC, - &scene->r.psfra,MINFRAMEF, MAXFRAMEF, 0, 0, - "The start frame of the animation preview (inclusive)"); - - xco += (int)(4.5*XIC); - - uiDefButI(block, NUM, B_REDRAWALL,"End:", - xco,yco, (int)4.5*XIC,YIC, - &scene->r.pefra,(float)PSFRA, MAXFRAMEF, 0, 0, - "The end frame of the animation preview (inclusive)"); - } - else { - uiDefButI(block, NUM, B_REDRAWALL,"Start:", - xco,yco, (int)4.5*XIC, YIC, - &scene->r.sfra,MINFRAMEF, MAXFRAMEF, 0, 0, - "The start frame of the animation (inclusive)"); - - xco += (short)(4.5*XIC); - - uiDefButI(block, NUM, B_REDRAWALL,"End:", - xco,yco, (int)4.5*XIC,YIC, - &scene->r.efra,(float)SFRA, MAXFRAMEF, 0, 0, - "The end frame of the animation (inclusive)"); - } - uiBlockEndAlign(block); - - xco += (short)(4.5 * XIC); - - /* MINAFRAMEF not MINFRAMEF, since MINAFRAMEF allows to set current frame negative - * to facilitate easier keyframing in some situations - */ - uiDefButI(block, NUM, B_NEWFRAME, "", - xco,yco, (int)4.5*XIC,YIC, - &(scene->r.cfra), MINAFRAMEF, MAXFRAMEF, 0, 0, - "Displays Current Frame of animation"); - - xco += (short)(4.5 * XIC); - - uiBlockBeginAlign(block); - - but= uiDefIconButO(block, BUT, "SCREEN_OT_frame_jump", WM_OP_INVOKE_REGION_WIN, ICON_REW, xco,yco,XIC,YIC, "Skip to Start frame (Shift DownArrow)"); - RNA_boolean_set(uiButGetOperatorPtrRNA(but), "end", 0); - xco+= XIC; - - but= uiDefIconButO(block, BUT, "SCREEN_OT_keyframe_jump", WM_OP_INVOKE_REGION_WIN, ICON_PREV_KEYFRAME, xco,yco,XIC,YIC, "Skip to previous keyframe (Ctrl PageDown)"); - RNA_boolean_set(uiButGetOperatorPtrRNA(but), "next", 0); - xco+= XIC; - - if (animtimer) { - /* pause button 2*size to keep buttons in place */ - but=uiDefIconButO(block, BUT, "SCREEN_OT_animation_play", WM_OP_INVOKE_REGION_WIN, ICON_PAUSE, xco,yco,XIC*2,YIC, "Stop Playing Timeline"); - - xco+= XIC; - } - else { - but=uiDefIconButO(block, BUT, "SCREEN_OT_animation_play", WM_OP_INVOKE_REGION_WIN, ICON_PLAY_REVERSE, xco,yco,XIC,YIC, "Play Timeline in Reverse"); - RNA_boolean_set(uiButGetOperatorPtrRNA(but), "reverse", 1); - xco+= XIC; - - but=uiDefIconButO(block, BUT, "SCREEN_OT_animation_play", WM_OP_INVOKE_REGION_WIN, ICON_PLAY, xco,yco,XIC,YIC, "Play Timeline"); - RNA_boolean_set(uiButGetOperatorPtrRNA(but), "reverse", 0); - } - xco+= XIC; - - but= uiDefIconButO(block, BUT, "SCREEN_OT_keyframe_jump", WM_OP_INVOKE_REGION_WIN, ICON_NEXT_KEYFRAME, xco,yco,XIC,YIC, "Skip to next keyframe (Ctrl PageUp)"); - RNA_boolean_set(uiButGetOperatorPtrRNA(but), "next", 1); - xco+= XIC; - - but= uiDefIconButO(block, BUT, "SCREEN_OT_frame_jump", WM_OP_INVOKE_REGION_WIN, ICON_FF, xco,yco,XIC,YIC, "Skip to End frame (Shift UpArrow)"); - RNA_boolean_set(uiButGetOperatorPtrRNA(but), "end", 1); - xco+= XIC; - uiBlockEndAlign(block); - - xco+= (short)(0.5*XIC); - - uiBlockBeginAlign(block); - uiDefIconButBitS(block, TOG, AUTOKEY_ON, B_REDRAWALL, ICON_REC, - xco, yco, XIC, YIC, &(scene->toolsettings->autokey_mode), 0, 0, 0, 0, "Automatic keyframe insertion for Objects and Bones"); - xco+= 1*XIC; - if (IS_AUTOKEY_ON(scene)) { - uiDefButS(block, MENU, B_REDRAWALL, - "Auto-Keying Mode %t|Add/Replace%x3|Replace%x5", - xco, yco, (int)(4.25*XIC), YIC, &(scene->toolsettings->autokey_mode), 0, 1, 0, 0, - "Mode of automatic keyframe insertion for Objects and Bones"); - xco+= (short)(4.25*XIC); - - if (animtimer) { - uiDefButBitS(block, TOG, ANIMRECORD_FLAG_WITHNLA, B_REDRAWALL, "Layered", - xco,yco, (int)(3.5*XIC), YIC, - &(scene->toolsettings->autokey_flag),0, 1, 0, 0, - "Add a new NLA Track + Strip for every loop/pass made over the animation to allow non-destructive tweaking."); - uiBlockEndAlign(block); - - xco+= (short)(3.5*XIC); - } - - xco += XIC; - - uiBlockEndAlign(block); - } - else { - xco+= (short)(5.25*XIC); - uiBlockEndAlign(block); - } - - menustr= ANIM_build_keyingsets_menu(&scene->keyingsets, 0); - uiDefButI(block, MENU, B_DIFF, - menustr, - xco, yco, (int)5.5*XIC, YIC, &(scene->active_keyingset), 0, 1, 0, 0, - "Active Keying Set (i.e. set of channels to Insert Keyframes for)"); - MEM_freeN(menustr); - xco+= (5.5*XIC); - - /* NOTE: order of these buttons needs to be kept in sync with other occurances - * (see Outliner header for instance, also +/- stuff for filebrowser) - */ - uiBlockBeginAlign(block); - uiDefIconButO(block, BUT, "ANIM_OT_delete_keyframe", WM_OP_INVOKE_REGION_WIN, ICON_KEY_DEHLT, xco,yco,XIC,YIC, "Delete Keyframes for the Active Keying Set (Alt-I)"); - xco += XIC; - uiDefIconButO(block, BUT, "ANIM_OT_insert_keyframe", WM_OP_INVOKE_REGION_WIN, ICON_KEY_HLT, xco,yco,XIC,YIC, "Insert Keyframes for the Active Keying Set (I)"); - xco += XIC; - uiBlockEndAlign(block); - - xco+= XIC; - - uiDefIconButBitS(block, TOG, AUDIO_SYNC, B_DIFF, ICON_SPEAKER, - xco, yco, XIC, YIC, &(scene->r.audio.flag), 0, 0, 0, 0, "Play back and sync with audio from Sequence Editor"); - - - /* always as last */ - UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, (int)(ar->v2d.tot.ymax-ar->v2d.tot.ymin)); - - uiEndBlock(C, block); - uiDrawBlock(C, block); -} - - From e611c4756fa17c57855123dc2b5c2c2408b0d790 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 19 Aug 2009 09:35:22 +0000 Subject: [PATCH 140/577] 2.5: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r22291:22625 --- release/scripts/export_map.py | 2 +- source/blender/blenkernel/intern/seqeffects.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/release/scripts/export_map.py b/release/scripts/export_map.py index aca02288c7a..2262ae3b89b 100644 --- a/release/scripts/export_map.py +++ b/release/scripts/export_map.py @@ -197,7 +197,7 @@ def is_tricyl_facegroup(faces): is the face group a tri cylinder Returens a bool, true if the faces make an extruded tri solid ''' - return False + # cube must have 5 faces if len(faces) != 5: print '1' diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 2ee95ed928e..078258092f7 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -2792,6 +2792,10 @@ void sequence_effect_speed_rebuild_map(Sequence * seq, int force) if (!(force || seq->len != v->length || !v->frameMap)) { return; } + if (!seq->seq1) { /* make coverity happy and check for (CID 598) + input strip ... */ + return; + } if (!v->frameMap || v->length != seq->len) { if (v->frameMap) MEM_freeN(v->frameMap); @@ -2807,7 +2811,7 @@ void sequence_effect_speed_rebuild_map(Sequence * seq, int force) /* if there is no IPO, try to make retiming easy by stretching the strip */ // XXX old animation system - seq - if (/*!seq->ipo &&*/ seq->seq1 && seq->seq1->enddisp != seq->seq1->start + if (/*!seq->ipo &&*/ seq->seq1->enddisp != seq->seq1->start && seq->seq1->len != 0) { fallback_fac = (float) seq->seq1->len / (float) (seq->seq1->enddisp - seq->seq1->start); From c3041ae7cda20c78040e7deea17530fe5f41029d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 19 Aug 2009 10:26:43 +0000 Subject: [PATCH 141/577] - fix for BGE warnings - when C++ uses guardedalloc SYS_DeleteSystem was called after MEM_printmemlist(), making it look like there was a leak. --- intern/string/STR_String.h | 10 +++++++ .../windowmanager/intern/wm_init_exit.c | 5 ++-- .../Converter/BL_ArmatureObject.cpp | 2 +- .../gameengine/Converter/BL_ShapeDeformer.cpp | 4 +-- .../KX_BlenderScalarInterpolator.cpp | 2 +- .../Converter/KX_BlenderScalarInterpolator.h | 2 +- .../Converter/KX_BlenderSceneConverter.cpp | 2 +- source/gameengine/Converter/KX_IpoConvert.cpp | 2 +- .../gameengine/Ketsji/KX_CameraActuator.cpp | 12 -------- source/gameengine/Ketsji/KX_GameObject.cpp | 12 ++++---- source/gameengine/Ketsji/KX_IpoActuator.cpp | 28 +++++++++---------- source/gameengine/Ketsji/KX_IpoActuator.h | 14 +++++----- source/gameengine/Ketsji/KX_PythonInit.cpp | 14 +++++----- .../gameengine/Ketsji/KX_PythonInitTypes.cpp | 3 -- source/gameengine/Ketsji/KX_PythonSeq.cpp | 2 +- .../Ketsji/KX_SCA_ReplaceMeshActuator.h | 2 +- .../Physics/Bullet/CcdPhysicsController.cpp | 2 -- .../Rasterizer/RAS_IPolygonMaterial.cpp | 4 +-- source/gameengine/VideoTexture/ImageBase.cpp | 8 ++++-- 19 files changed, 62 insertions(+), 68 deletions(-) diff --git a/intern/string/STR_String.h b/intern/string/STR_String.h index 941430fd976..a5e7a0721ec 100644 --- a/intern/string/STR_String.h +++ b/intern/string/STR_String.h @@ -50,6 +50,9 @@ using namespace std; +#ifdef WITH_CXX_GUARDEDALLOC +#include "MEM_guardedalloc.h" +#endif class STR_String; @@ -191,6 +194,13 @@ protected: char *pData; // -> STR_String data int Len; // Data length int Max; // Space in data buffer + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "CXX:STR_String"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; inline STR_String operator+(rcSTR_String lhs, rcSTR_String rhs) { return STR_String(lhs.ReadPtr(), lhs.Length(), rhs.ReadPtr(), rhs.Length()); } diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c index ee826d5f57e..9a268f8be17 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.c +++ b/source/blender/windowmanager/intern/wm_init_exit.c @@ -266,6 +266,8 @@ void WM_exit(bContext *C) CTX_free(C); + SYS_DeleteSystem(SYS_GetSystem()); + if(MEM_get_memory_blocks_in_use()!=0) { printf("Error Totblock: %d\n", MEM_get_memory_blocks_in_use()); MEM_printmemlist(); @@ -282,9 +284,6 @@ void WM_exit(bContext *C) } #endif - - SYS_DeleteSystem(SYS_GetSystem()); - exit(G.afbreek==1); } diff --git a/source/gameengine/Converter/BL_ArmatureObject.cpp b/source/gameengine/Converter/BL_ArmatureObject.cpp index f8a9b1b637f..cfd90813a16 100644 --- a/source/gameengine/Converter/BL_ArmatureObject.cpp +++ b/source/gameengine/Converter/BL_ArmatureObject.cpp @@ -54,8 +54,8 @@ BL_ArmatureObject::BL_ArmatureObject( : KX_GameObject(sgReplicationInfo,callbacks), m_objArma(armature), - m_scene(scene), // maybe remove later. needed for where_is_pose m_framePose(NULL), + m_scene(scene), // maybe remove later. needed for where_is_pose m_lastframe(0.0), m_activeAct(NULL), m_activePriority(999), diff --git a/source/gameengine/Converter/BL_ShapeDeformer.cpp b/source/gameengine/Converter/BL_ShapeDeformer.cpp index d39917b0e5c..20ca7f07f2b 100644 --- a/source/gameengine/Converter/BL_ShapeDeformer.cpp +++ b/source/gameengine/Converter/BL_ShapeDeformer.cpp @@ -109,8 +109,8 @@ bool BL_ShapeDeformer::ExecuteShapeDrivers(void) { if (!m_shapeDrivers.empty() && PoseUpdated()) { vector::iterator it; - void *poin; - int type; +// void *poin; +// int type; // the shape drivers use the bone matrix as input. Must // update the matrix now diff --git a/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp b/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp index c3264a2bc37..24910422176 100644 --- a/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp +++ b/source/gameengine/Converter/KX_BlenderScalarInterpolator.cpp @@ -62,7 +62,7 @@ BL_InterpolatorList::~BL_InterpolatorList() { } } -KX_IScalarInterpolator *BL_InterpolatorList::GetScalarInterpolator(char *rna_path, int array_index) { +KX_IScalarInterpolator *BL_InterpolatorList::GetScalarInterpolator(const char *rna_path, int array_index) { for(BL_InterpolatorList::iterator i = begin(); (i != end()) ; i++ ) { FCurve *fcu= (static_cast(*i))->GetFCurve(); diff --git a/source/gameengine/Converter/KX_BlenderScalarInterpolator.h b/source/gameengine/Converter/KX_BlenderScalarInterpolator.h index eb15cee8ff9..e7fbb8083e4 100644 --- a/source/gameengine/Converter/KX_BlenderScalarInterpolator.h +++ b/source/gameengine/Converter/KX_BlenderScalarInterpolator.h @@ -64,7 +64,7 @@ public: BL_InterpolatorList(struct AnimData *adt); ~BL_InterpolatorList(); - KX_IScalarInterpolator *GetScalarInterpolator(char *rna_path, int array_index); + KX_IScalarInterpolator *GetScalarInterpolator(const char *rna_path, int array_index); #ifdef WITH_CXX_GUARDEDALLOC diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index ebabaa55e21..3220672c392 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -795,6 +795,7 @@ void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber) Object* blenderObject = gameObj->GetBlenderObject(); if (blenderObject && blenderObject->ipo) { +#if 0 const MT_Point3& position = gameObj->NodeGetWorldPosition(); //const MT_Vector3& scale = gameObj->NodeGetWorldScaling(); const MT_Matrix3x3& orn = gameObj->NodeGetWorldOrientation(); @@ -804,7 +805,6 @@ void KX_BlenderSceneConverter::WritePhysicsObjectToAnimationIpo(int frameNumber) float tmat[3][3]; // XXX animato -#if 0 Ipo* ipo = blenderObject->ipo; //create the curves, if not existing, set linear if new diff --git a/source/gameengine/Converter/KX_IpoConvert.cpp b/source/gameengine/Converter/KX_IpoConvert.cpp index d3a2e1a9ba4..848fcfcdaa0 100644 --- a/source/gameengine/Converter/KX_IpoConvert.cpp +++ b/source/gameengine/Converter/KX_IpoConvert.cpp @@ -175,7 +175,7 @@ void BL_ConvertIpos(struct Object* blenderobject,KX_GameObject* gameobj,KX_Blend KX_ObColorIpoSGController* ipocontr_obcol=NULL; for(int i=0; i<4; i++) { - if (interp = adtList->GetScalarInterpolator("color", i)) { + if ((interp = adtList->GetScalarInterpolator("color", i))) { if (!ipocontr_obcol) { ipocontr_obcol = new KX_ObColorIpoSGController(); gameobj->GetSGNode()->AddSGController(ipocontr_obcol); diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp index faf0ca50407..b5a0a63cf68 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.cpp +++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp @@ -38,9 +38,6 @@ #include "PyObjectPlus.h" -STR_String KX_CameraActuator::X_AXIS_STRING = "x"; -STR_String KX_CameraActuator::Y_AXIS_STRING = "y"; - #ifdef HAVE_CONFIG_H #include #endif @@ -353,15 +350,6 @@ CValue *KX_CameraActuator::findObject(char *obName) return NULL; } -bool KX_CameraActuator::string2axischoice(const char *axisString) -{ - bool res = true; - - res = !(axisString == Y_AXIS_STRING); - - return res; -} - /* ------------------------------------------------------------------------- */ /* Python functions */ /* ------------------------------------------------------------------------- */ diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 146b83abd17..a5217273b17 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -464,7 +464,7 @@ void KX_GameObject::AddMeshUser() double* fl = GetOpenGLMatrixPtr()->getPointer(); SG_QList::iterator mit(m_meshSlots); - RAS_MeshSlot* ms; +// RAS_MeshSlot* ms; for(mit.begin(); !mit.end(); ++mit) { (*mit)->m_OpenGLMatrix = fl; @@ -1817,10 +1817,10 @@ int KX_GameObject::pyattr_set_visible(void *self_v, const KX_PYATTRIBUTE_DEF *at PyObject* KX_GameObject::pyattr_get_worldPosition(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast(self_v); #ifdef USE_MATHUTILS return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_POS_GLOBAL); #else + KX_GameObject* self= static_cast(self_v); return PyObjectFrom(self->NodeGetWorldPosition()); #endif } @@ -1839,10 +1839,10 @@ int KX_GameObject::pyattr_set_worldPosition(void *self_v, const KX_PYATTRIBUTE_D PyObject* KX_GameObject::pyattr_get_localPosition(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast(self_v); #ifdef USE_MATHUTILS return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_POS_LOCAL); #else + KX_GameObject* self= static_cast(self_v); return PyObjectFrom(self->NodeGetLocalPosition()); #endif } @@ -1861,10 +1861,10 @@ int KX_GameObject::pyattr_set_localPosition(void *self_v, const KX_PYATTRIBUTE_D PyObject* KX_GameObject::pyattr_get_localInertia(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast(self_v); #ifdef USE_MATHUTILS return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_INERTIA_LOCAL); #else + KX_GameObject* self= static_cast(self_v); if (self->GetPhysicsController()) return PyObjectFrom(self->GetPhysicsController()->GetLocalInertia()); return Py_BuildValue("fff", 0.0f, 0.0f, 0.0f); @@ -1922,20 +1922,20 @@ int KX_GameObject::pyattr_set_localOrientation(void *self_v, const KX_PYATTRIBUT PyObject* KX_GameObject::pyattr_get_worldScaling(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast(self_v); #ifdef USE_MATHUTILS return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_SCALE_GLOBAL); #else + KX_GameObject* self= static_cast(self_v); return PyObjectFrom(self->NodeGetWorldScaling()); #endif } PyObject* KX_GameObject::pyattr_get_localScaling(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - KX_GameObject* self= static_cast(self_v); #ifdef USE_MATHUTILS return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_SCALE_LOCAL); #else + KX_GameObject* self= static_cast(self_v); return PyObjectFrom(self->NodeGetLocalScaling()); #endif } diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp index e4eaff4f401..3f241e90836 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.cpp +++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp @@ -49,13 +49,13 @@ /* Type strings */ /* ------------------------------------------------------------------------- */ -STR_String KX_IpoActuator::S_KX_ACT_IPO_PLAY_STRING = "Play"; -STR_String KX_IpoActuator::S_KX_ACT_IPO_PINGPONG_STRING = "PingPong"; -STR_String KX_IpoActuator::S_KX_ACT_IPO_FLIPPER_STRING = "Flipper"; -STR_String KX_IpoActuator::S_KX_ACT_IPO_LOOPSTOP_STRING = "LoopStop"; -STR_String KX_IpoActuator::S_KX_ACT_IPO_LOOPEND_STRING = "LoopEnd"; -STR_String KX_IpoActuator::S_KX_ACT_IPO_KEY2KEY_STRING = "Key2key"; -STR_String KX_IpoActuator::S_KX_ACT_IPO_FROM_PROP_STRING = "FromProp"; +const char *KX_IpoActuator::S_KX_ACT_IPO_PLAY_STRING = "Play"; +const char *KX_IpoActuator::S_KX_ACT_IPO_PINGPONG_STRING = "PingPong"; +const char *KX_IpoActuator::S_KX_ACT_IPO_FLIPPER_STRING = "Flipper"; +const char *KX_IpoActuator::S_KX_ACT_IPO_LOOPSTOP_STRING = "LoopStop"; +const char *KX_IpoActuator::S_KX_ACT_IPO_LOOPEND_STRING = "LoopEnd"; +const char *KX_IpoActuator::S_KX_ACT_IPO_KEY2KEY_STRING = "Key2key"; +const char *KX_IpoActuator::S_KX_ACT_IPO_FROM_PROP_STRING = "FromProp"; /* ------------------------------------------------------------------------- */ /* Native functions */ @@ -385,19 +385,19 @@ bool KX_IpoActuator::Update(double curtime, bool frame) int KX_IpoActuator::string2mode(char* modename) { IpoActType res = KX_ACT_IPO_NODEF; - if (modename == S_KX_ACT_IPO_PLAY_STRING) { + if (strcmp(modename, S_KX_ACT_IPO_PLAY_STRING)==0) { res = KX_ACT_IPO_PLAY; - } else if (modename == S_KX_ACT_IPO_PINGPONG_STRING) { + } else if (strcmp(modename, S_KX_ACT_IPO_PINGPONG_STRING)==0) { res = KX_ACT_IPO_PINGPONG; - } else if (modename == S_KX_ACT_IPO_FLIPPER_STRING) { + } else if (strcmp(modename, S_KX_ACT_IPO_FLIPPER_STRING)==0) { res = KX_ACT_IPO_FLIPPER; - } else if (modename == S_KX_ACT_IPO_LOOPSTOP_STRING) { + } else if (strcmp(modename, S_KX_ACT_IPO_LOOPSTOP_STRING)==0) { res = KX_ACT_IPO_LOOPSTOP; - } else if (modename == S_KX_ACT_IPO_LOOPEND_STRING) { + } else if (strcmp(modename, S_KX_ACT_IPO_LOOPEND_STRING)==0) { res = KX_ACT_IPO_LOOPEND; - } else if (modename == S_KX_ACT_IPO_KEY2KEY_STRING) { + } else if (strcmp(modename, S_KX_ACT_IPO_KEY2KEY_STRING)==0) { res = KX_ACT_IPO_KEY2KEY; - } else if (modename == S_KX_ACT_IPO_FROM_PROP_STRING) { + } else if (strcmp(modename, S_KX_ACT_IPO_FROM_PROP_STRING)==0) { res = KX_ACT_IPO_FROM_PROP; } diff --git a/source/gameengine/Ketsji/KX_IpoActuator.h b/source/gameengine/Ketsji/KX_IpoActuator.h index 01051ca82dc..0581d1644ee 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.h +++ b/source/gameengine/Ketsji/KX_IpoActuator.h @@ -100,13 +100,13 @@ public: KX_ACT_IPO_MAX }; - static STR_String S_KX_ACT_IPO_PLAY_STRING; - static STR_String S_KX_ACT_IPO_PINGPONG_STRING; - static STR_String S_KX_ACT_IPO_FLIPPER_STRING; - static STR_String S_KX_ACT_IPO_LOOPSTOP_STRING; - static STR_String S_KX_ACT_IPO_LOOPEND_STRING; - static STR_String S_KX_ACT_IPO_KEY2KEY_STRING; - static STR_String S_KX_ACT_IPO_FROM_PROP_STRING; + static const char *S_KX_ACT_IPO_PLAY_STRING; + static const char *S_KX_ACT_IPO_PINGPONG_STRING; + static const char *S_KX_ACT_IPO_FLIPPER_STRING; + static const char *S_KX_ACT_IPO_LOOPSTOP_STRING; + static const char *S_KX_ACT_IPO_LOOPEND_STRING; + static const char *S_KX_ACT_IPO_KEY2KEY_STRING; + static const char *S_KX_ACT_IPO_FROM_PROP_STRING; int string2mode(char* modename); diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index de3dcd0ebf8..49cf895af17 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -142,7 +142,7 @@ void KX_RasterizerDrawDebugLine(const MT_Vector3& from,const MT_Vector3& to,cons // List of methods defined in the module static PyObject* ErrorObject; -STR_String gPyGetRandomFloat_doc="getRandomFloat returns a random floating point value in the range [0..1)"; +static const char *gPyGetRandomFloat_doc="getRandomFloat returns a random floating point value in the range [0..1]"; static PyObject* gPyGetRandomFloat(PyObject*) { @@ -346,7 +346,7 @@ static PyObject* gPyGetBlendFileList(PyObject*, PyObject* args) return list; } -static STR_String gPyGetCurrentScene_doc = +static const char *gPyGetCurrentScene_doc = "getCurrentScene()\n" "Gets a reference to the current scene.\n"; static PyObject* gPyGetCurrentScene(PyObject* self) @@ -354,7 +354,7 @@ static PyObject* gPyGetCurrentScene(PyObject* self) return gp_KetsjiScene->GetProxy(); } -static STR_String gPyGetSceneList_doc = +static const char *gPyGetSceneList_doc = "getSceneList()\n" "Return a list of converted scenes.\n"; static PyObject* gPyGetSceneList(PyObject* self) @@ -479,15 +479,15 @@ static struct PyMethodDef game_methods[] = { {"sendMessage", (PyCFunction)gPySendMessage, METH_VARARGS, (const char *)gPySendMessage_doc}, {"getCurrentController", (PyCFunction) SCA_PythonController::sPyGetCurrentController, - METH_NOARGS, (const char *)SCA_PythonController::sPyGetCurrentController__doc__}, + METH_NOARGS, SCA_PythonController::sPyGetCurrentController__doc__}, {"getCurrentScene", (PyCFunction) gPyGetCurrentScene, - METH_NOARGS, (const char *)gPyGetCurrentScene_doc.Ptr()}, + METH_NOARGS, gPyGetCurrentScene_doc}, {"getSceneList", (PyCFunction) gPyGetSceneList, - METH_NOARGS, (const char *)gPyGetSceneList_doc.Ptr()}, + METH_NOARGS, (const char *)gPyGetSceneList_doc}, {"addActiveActuator",(PyCFunction) SCA_PythonController::sPyAddActiveActuator, METH_VARARGS, (const char *)SCA_PythonController::sPyAddActiveActuator__doc__}, {"getRandomFloat",(PyCFunction) gPyGetRandomFloat, - METH_NOARGS, (const char *)gPyGetRandomFloat_doc.Ptr()}, + METH_NOARGS, (const char *)gPyGetRandomFloat_doc}, {"setGravity",(PyCFunction) gPySetGravity, METH_O, (const char *)"set Gravitation"}, {"getSpectrum",(PyCFunction) gPyGetSpectrum, METH_NOARGS, (const char *)"get audio spectrum"}, {"stopDSP",(PyCFunction) gPyStopDSP, METH_VARARGS, (const char *)"stop using the audio dsp (for performance reasons)"}, diff --git a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp index 5260c0bb01a..61e563791c3 100644 --- a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp +++ b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp @@ -123,9 +123,6 @@ static void PyType_Ready_ADD(PyObject *dict, PyTypeObject *tp, PyAttributeDef *a memset(attr_getset, 0, sizeof(PyGetSetDef)); } } else { - - PyObject *item; - PyType_Ready(tp); PyDict_SetItemString(dict, tp->tp_name, reinterpret_cast(tp)); } diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp index 4fc5252de60..1098dc03b62 100644 --- a/source/gameengine/Ketsji/KX_PythonSeq.cpp +++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp @@ -375,7 +375,7 @@ PyTypeObject KX_PythonSeq_Type = { NULL, /* getattrfunc tp_getattr; */ NULL, /* setattrfunc tp_setattr; */ /* TODO, richcmp */ - NULL, /* ( cmpfunc ) KX_PythonSeq_compare, /* cmpfunc tp_compare; */ + NULL, /* ( cmpfunc ) KX_PythonSeq_compare, // cmpfunc tp_compare; */ ( reprfunc ) KX_PythonSeq_repr, /* reprfunc tp_repr; */ /* Method suites for standard classes */ diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h index ae2c0d2d6ce..1e258420836 100644 --- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h @@ -50,8 +50,8 @@ class KX_SCA_ReplaceMeshActuator : public SCA_IActuator // mesh reference (mesh to replace) RAS_MeshObject* m_mesh; SCA_IScene* m_scene; - bool m_use_phys; bool m_use_gfx; + bool m_use_phys; public: KX_SCA_ReplaceMeshActuator( diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 20e830c9dc3..12562e34583 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -1829,8 +1829,6 @@ bool CcdShapeConstructionInfo::UpdateMesh(class KX_GameObject* gameobj, class RA } for(mf= mface, i=0; i < numpolys; mf++, i++) { - unsigned int *fv = &mf->v1; - if(mf->v4) { fv_pt= quad_verts; *poly_index_pt++ = *poly_index_pt++ = index[i]; diff --git a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp index cb5c5a12397..033daabc48f 100644 --- a/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp +++ b/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp @@ -70,7 +70,6 @@ void RAS_IPolyMaterial::Initialize( RAS_IPolyMaterial::RAS_IPolyMaterial() : m_texturename("__Dummy_Texture_Name__"), m_materialname("__Dummy_Material_Name__"), - m_materialindex(0), m_tile(0), m_tilexrep(0), m_tileyrep(0), @@ -78,6 +77,7 @@ RAS_IPolyMaterial::RAS_IPolyMaterial() m_transp(0), m_alpha(false), m_zsort(false), + m_materialindex(0), m_polymatid(0), m_flag(0), m_multimode(0) @@ -100,7 +100,6 @@ RAS_IPolyMaterial::RAS_IPolyMaterial(const STR_String& texname, bool zsort) : m_texturename(texname), m_materialname(matname), - m_materialindex(materialindex), m_tile(tile), m_tilexrep(tilexrep), m_tileyrep(tileyrep), @@ -108,6 +107,7 @@ RAS_IPolyMaterial::RAS_IPolyMaterial(const STR_String& texname, m_transp(transp), m_alpha(alpha), m_zsort(zsort), + m_materialindex(materialindex), m_polymatid(m_newpolymatid++), m_flag(0), m_multimode(0) diff --git a/source/gameengine/VideoTexture/ImageBase.cpp b/source/gameengine/VideoTexture/ImageBase.cpp index 5e2841271a6..0740afed2c6 100644 --- a/source/gameengine/VideoTexture/ImageBase.cpp +++ b/source/gameengine/VideoTexture/ImageBase.cpp @@ -219,15 +219,17 @@ bool ImageBase::checkSourceSizes (void) // get size of current source short * curSize = (*it)->getSize(); // if size is available and is not empty - if (curSize[0] != 0 && curSize[1] != 0) + if (curSize[0] != 0 && curSize[1] != 0) { // if reference size is not set - if (refSize == NULL) + if (refSize == NULL) { // set current size as reference refSize = curSize; // otherwise check with current size - else if (curSize[0] != refSize[0] || curSize[1] != refSize[1]) + } else if (curSize[0] != refSize[0] || curSize[1] != refSize[1]) { // if they don't match, report it return false; + } + } } // all sizes match return true; From aace6ef551183a3d09635c3103a8e4cba4f9117a Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 19 Aug 2009 12:35:40 +0000 Subject: [PATCH 142/577] 2.5: Restored statistics in the info header. Implementation: * NC_SCENE or NC_OBJECT cause scene->stats to be cleared. * NC_INFO is sent to tag info headers for redraw. * In UI scene.statistics() creates scene->stats if it is NULLd, and then returns the string. --- release/ui/space_info.py | 5 +- source/blender/blenkernel/intern/scene.c | 4 + source/blender/blenloader/intern/readfile.c | 1 + source/blender/editors/include/ED_info.h | 32 ++ .../editors/interface/interface_widgets.c | 8 +- .../blender/editors/space_info/info_stats.c | 434 ++++++++++++++++++ .../blender/editors/space_info/space_info.c | 6 +- source/blender/makesdna/DNA_scene_types.h | 2 +- source/blender/makesrna/intern/rna_scene.c | 7 + source/blender/windowmanager/WM_types.h | 1 + .../windowmanager/intern/wm_event_system.c | 11 +- 11 files changed, 503 insertions(+), 8 deletions(-) create mode 100644 source/blender/editors/include/ED_info.h create mode 100644 source/blender/editors/space_info/info_stats.c diff --git a/release/ui/space_info.py b/release/ui/space_info.py index 770387498a2..1a3f9a321ac 100644 --- a/release/ui/space_info.py +++ b/release/ui/space_info.py @@ -8,7 +8,8 @@ class INFO_HT_header(bpy.types.Header): layout = self.layout st = context.space_data - rd = context.scene.render_data + scene = context.scene + rd = scene.render_data row = layout.row(align=True) row.template_header() @@ -33,6 +34,8 @@ class INFO_HT_header(bpy.types.Header): layout.template_operator_search() layout.template_running_jobs() + + layout.itemL(text=scene.statistics()) class INFO_MT_file(bpy.types.Menu): __space_type__ = "INFO" diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 2a8fd765386..6dd362d15a8 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -155,6 +155,7 @@ Scene *copy_scene(Main *bmain, Scene *sce, int type) scen->theDag= NULL; scen->obedit= NULL; scen->toolsettings= MEM_dupallocN(sce->toolsettings); + scen->stats= NULL; ts= scen->toolsettings; if(ts) { @@ -299,6 +300,9 @@ void free_scene(Scene *sce) ntreeFreeTree(sce->nodetree); MEM_freeN(sce->nodetree); } + + if(sce->stats) + MEM_freeN(sce->stats); } Scene *add_scene(char *name) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 779a898bd6a..db811b22460 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4134,6 +4134,7 @@ static void direct_link_scene(FileData *fd, Scene *sce) sce->theDag = NULL; sce->dagisvalid = 0; sce->obedit= NULL; + sce->stats= 0; memset(&sce->sound_handles, 0, sizeof(sce->sound_handles)); diff --git a/source/blender/editors/include/ED_info.h b/source/blender/editors/include/ED_info.h new file mode 100644 index 00000000000..d09e174d71d --- /dev/null +++ b/source/blender/editors/include/ED_info.h @@ -0,0 +1,32 @@ +/** + * $Id: + * + * ***** 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) 2009, Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef ED_INFO_H +#define ED_INFO_H + +/* info_stats.c */ +void ED_info_stats_clear(struct Scene *scene); +char *ED_info_stats_string(struct Scene *scene); + +#endif /* ED_INFO_H */ diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index a70fbab1aa4..48de2343c97 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -835,9 +835,11 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b // else transopts= ui_translate_buttons(); /* cut string in 2 parts - only for menu entries */ - if(ELEM5(but->type, SLI, NUM, TEX, NUMSLI, NUMABS)==0) { - cpoin= strchr(but->drawstr, '|'); - if(cpoin) *cpoin= 0; + if((but->block->flag & UI_BLOCK_LOOP)) { + if(ELEM5(but->type, SLI, NUM, TEX, NUMSLI, NUMABS)==0) { + cpoin= strchr(but->drawstr, '|'); + if(cpoin) *cpoin= 0; + } } glColor3ubv((unsigned char*)wcol->text); diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c new file mode 100644 index 00000000000..2d14fbc515e --- /dev/null +++ b/source/blender/editors/space_info/info_stats.c @@ -0,0 +1,434 @@ +/** + * $Id$ + * + * ***** 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. + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include + +#include "MEM_guardedalloc.h" + +#include "DNA_action_types.h" +#include "DNA_armature_types.h" +#include "DNA_curve_types.h" +#include "DNA_group_types.h" +#include "DNA_lattice_types.h" +#include "DNA_mesh_types.h" +#include "DNA_meta_types.h" +#include "DNA_object_types.h" +#include "DNA_particle_types.h" +#include "DNA_scene_types.h" + +#include "BKE_anim.h" +#include "BKE_context.h" +#include "BKE_displist.h" +#include "BKE_DerivedMesh.h" +#include "BKE_key.h" +#include "BKE_mesh.h" +#include "BKE_particle.h" +#include "BKE_utildefines.h" + +#include "ED_armature.h" +#include "ED_mesh.h" + +#include "BLI_editVert.h" + +typedef struct SceneStats { + int totvert, totvertsel; + int totedge, totedgesel; + int totface, totfacesel; + int totbone, totbonesel; + int totobj, totobjsel; + int totmesh, totlamp, totcurve; + + char infostr[512]; +} SceneStats; + +static void stats_object(Object *ob, int sel, int totob, SceneStats *stats) +{ + switch(ob->type) { + case OB_MESH: { + /* we assume derivedmesh is already built, this strictly does stats now. */ + DerivedMesh *dm= ob->derivedFinal; + int totvert, totedge, totface; + + stats->totmesh +=totob; + + if(dm) { + totvert = dm->getNumVerts(dm); + totedge = dm->getNumEdges(dm); + totface = dm->getNumFaces(dm); + + stats->totvert += totvert*totob; + stats->totedge += totedge*totob; + stats->totface += totface*totob; + + if(sel) { + stats->totvertsel += totvert; + stats->totfacesel += totface; + } + } + break; + } + case OB_LAMP: + stats->totlamp += totob; + break; + case OB_SURF: + case OB_CURVE: + case OB_FONT: { + Curve *cu= ob->data; + int tot= 0, totf= 0; + + stats->totcurve += totob; + + if(cu->disp.first) + count_displist(&cu->disp, &tot, &totf); + + tot *= totob; + totf *= totob; + + stats->totvert+= tot; + stats->totface+= totf; + + if(sel) { + stats->totvertsel += tot; + stats->totfacesel += totf; + } + break; + } + case OB_MBALL: { + int tot= 0, totf= 0; + + count_displist(&ob->disp, &tot, &totf); + + tot *= totob; + totf *= totob; + + stats->totvert += tot; + stats->totface += totf; + + if(sel) { + stats->totvertsel += tot; + stats->totfacesel += totf; + } + break; + } + } +} + +static void stats_object_edit(Object *obedit, SceneStats *stats) +{ + if(obedit->type==OB_MESH) { + /* Mesh Edit */ + EditMesh *em= BKE_mesh_get_editmesh(obedit->data); + EditVert *eve; + EditEdge *eed; + EditFace *efa; + + for(eve= em->verts.first; eve; eve=eve->next) { + stats->totvert++; + if(eve->f & SELECT) stats->totvertsel++; + } + for(eed= em->edges.first; eed; eed=eed->next) { + stats->totedge++; + if(eed->f & SELECT) stats->totedgesel++; + } + for(efa= em->faces.first; efa; efa=efa->next) { + stats->totface++; + if(efa->f & SELECT) stats->totfacesel++; + } + + EM_validate_selections(em); + } + else if(obedit->type==OB_ARMATURE){ + /* Armature Edit */ + bArmature *arm= obedit->data; + EditBone *ebo; + + for(ebo=arm->edbo->first; ebo; ebo=ebo->next){ + stats->totbone++; + + if((ebo->flag & BONE_CONNECTED) && ebo->parent) + stats->totvert--; + + if(ebo->flag & BONE_TIPSEL) + stats->totvertsel++; + if(ebo->flag & BONE_ROOTSEL) + stats->totvertsel++; + + if(ebo->flag & BONE_SELECTED) stats->totbonesel++; + + /* if this is a connected child and it's parent is being moved, remove our root */ + if((ebo->flag & BONE_CONNECTED)&& (ebo->flag & BONE_ROOTSEL) && ebo->parent && (ebo->parent->flag & BONE_TIPSEL)) + stats->totvertsel--; + + stats->totvert+=2; + } + } + else if ELEM3(obedit->type, OB_CURVE, OB_SURF, OB_FONT) { + /* Curve Edit */ + Curve *cu= obedit->data; + Nurb *nu; + BezTriple *bezt; + BPoint *bp; + int a; + + for(nu=cu->editnurb->first; nu; nu=nu->next) { + if((nu->type & 7)==CU_BEZIER) { + bezt= nu->bezt; + a= nu->pntsu; + while(a--) { + stats->totvert+=3; + if(bezt->f1) stats->totvertsel++; + if(bezt->f2) stats->totvertsel++; + if(bezt->f3) stats->totvertsel++; + bezt++; + } + } + else { + bp= nu->bp; + a= nu->pntsu*nu->pntsv; + while(a--) { + stats->totvert++; + if(bp->f1 & SELECT) stats->totvertsel++; + bp++; + } + } + } + } + else if(obedit->type==OB_MBALL) { + /* MetaBall Edit */ + MetaBall *mball= obedit->data; + MetaElem *ml; + + for(ml= mball->editelems->first; ml; ml=ml->next) { + stats->totvert++; + if(ml->flag & SELECT) stats->totvertsel++; + } + } + else if(obedit->type==OB_LATTICE) { + /* Lattice Edit */ + Lattice *lt= obedit->data; + Lattice *editlatt= lt->editlatt; + BPoint *bp; + int a; + + bp= editlatt->def; + + a= editlatt->pntsu*editlatt->pntsv*editlatt->pntsw; + while(a--) { + stats->totvert++; + if(bp->f1 & SELECT) stats->totvertsel++; + bp++; + } + } +} + +static void stats_object_pose(Object *ob, SceneStats *stats) +{ + if(ob->pose) { + bArmature *arm= ob->data; + bPoseChannel *pchan; + + for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { + stats->totbone++; + if(pchan->bone && (pchan->bone->flag & BONE_SELECTED)) + if(pchan->bone->layer & arm->layer) + stats->totbonesel++; + } + } +} + +static void stats_object_paint(Object *ob, SceneStats *stats) +{ + if(ob->type == OB_MESH) { + Mesh *me= ob->data; + + stats->totface= me->totface; + stats->totvert= me->totvert; + } +} + +static void stats_dupli_object(Base *base, Object *ob, SceneStats *stats) +{ + if(base->flag & SELECT) stats->totobjsel++; + + if(ob->transflag & OB_DUPLIPARTS) { + /* Dupli Particles */ + ParticleSystem *psys; + ParticleSettings *part; + + for(psys=ob->particlesystem.first; psys; psys=psys->next){ + part=psys->part; + + if(part->draw_as==PART_DRAW_OB && part->dup_ob){ + int tot=count_particles(psys); + stats_object(part->dup_ob, 0, tot, stats); + } + else if(part->draw_as==PART_DRAW_GR && part->dup_group){ + GroupObject *go; + int tot, totgroup=0, cur=0; + + for(go= part->dup_group->gobject.first; go; go=go->next) + totgroup++; + + for(go= part->dup_group->gobject.first; go; go=go->next) { + tot=count_particles_mod(psys,totgroup,cur); + stats_object(go->ob, 0, tot, stats); + cur++; + } + } + } + + stats_object(ob, base->flag & SELECT, 1, stats); + stats->totobj++; + } + else if(ob->parent && (ob->parent->transflag & (OB_DUPLIVERTS|OB_DUPLIFACES))) { + /* Dupli Verts/Faces */ + int tot= count_duplilist(ob->parent); + stats->totobj+=tot; + stats_object(ob, base->flag & SELECT, tot, stats); + } + else if(ob->transflag & OB_DUPLIFRAMES) { + /* Dupli Frames */ + int tot= count_duplilist(ob); + stats->totobj+=tot; + stats_object(ob, base->flag & SELECT, tot, stats); + } + else if((ob->transflag & OB_DUPLIGROUP) && ob->dup_group) { + /* Dupli Group */ + int tot= count_duplilist(ob); + stats->totobj+=tot; + stats_object(ob, base->flag & SELECT, tot, stats); + } + else { + /* No Dupli */ + stats_object(ob, base->flag & SELECT, 1, stats); + stats->totobj++; + } +} + +/* Statistics displayed in info header. Called regularly on scene changes. */ +static void stats_update(Scene *scene) +{ + SceneStats stats; + Object *ob= (scene->basact)? scene->basact->object: NULL; + Base *base; + + memset(&stats, 0, sizeof(stats)); + + if(scene->obedit) { + /* Edit Mode */ + stats_object_edit(scene->obedit, &stats); + } + else if(ob && (ob->mode & OB_MODE_POSE)) { + /* Pose Mode */ + stats_object_pose(ob, &stats); + } + else if(ob && (ob->flag & (OB_MODE_SCULPT|OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT))) { + /* Sculpt and Paint Mode */ + stats_object_paint(ob, &stats); + } + else { + /* Objects */ + for(base= scene->base.first; base; base=base->next) + if(scene->lay & base->lay) + stats_dupli_object(base, base->object, &stats); + } + + if(!scene->stats) + scene->stats= MEM_mallocN(sizeof(SceneStats), "SceneStats"); + + *(scene->stats)= stats; +} + +static void stats_string(Scene *scene) +{ + SceneStats *stats= scene->stats; + Object *ob= (scene->basact)? scene->basact->object: NULL; + uintptr_t mem_in_use, mmap_in_use; + char memstr[64]; + char *s; + + mem_in_use= MEM_get_memory_in_use(); + mmap_in_use= MEM_get_mapped_memory_in_use(); + + /* get memory statistics */ + s= memstr + sprintf(memstr, " | Mem:%.2fM", ((mem_in_use-mmap_in_use)>>10)/1024.0); + if(mmap_in_use) + sprintf(s, " (%.2fM)", ((mmap_in_use)>>10)/1024.0); + + s= stats->infostr; + + if(scene->obedit) { + if(ob_get_keyblock(scene->obedit)) + s+= sprintf(s, "(Key) "); + + if(scene->obedit->type==OB_MESH) { + if(scene->toolsettings->selectmode & SCE_SELECT_VERTEX) + s+= sprintf(s, "Ve:%d-%d | Ed:%d-%d | Fa:%d-%d", + stats->totvertsel, stats->totvert, stats->totedgesel, stats->totedge, stats->totfacesel, stats->totface); + else if(scene->toolsettings->selectmode & SCE_SELECT_EDGE) + s+= sprintf(s, "Ed:%d-%d | Fa:%d-%d", + stats->totedgesel, stats->totedge, stats->totfacesel, stats->totface); + else + s+= sprintf(s, "Fa:%d-%d", stats->totfacesel, stats->totface); + } + else if(scene->obedit->type==OB_ARMATURE) { + s+= sprintf(s, "Ve:%d-%d | Bo:%d-%d", stats->totvertsel, stats->totvert, stats->totbonesel, stats->totbone); + } + else { + s+= sprintf(s, "Ve:%d-%d", stats->totvertsel, stats->totvert); + } + + strcat(s, memstr); + } + else if(ob && (ob->mode & OB_MODE_POSE)) { + s += sprintf(s, "Bo:%d-%d %s", + stats->totbonesel, stats->totbone, memstr); + } + else { + s += sprintf(s, "Ve:%d | Fa:%d | Ob:%d-%d | La:%d%s", + stats->totvert, stats->totface, stats->totobj, stats->totobjsel, stats->totlamp, memstr); + } + + if(ob) + sprintf(s, " | %s", ob->id.name+2); +} + +void ED_info_stats_clear(Scene *scene) +{ + if(scene->stats) { + MEM_freeN(scene->stats); + scene->stats= NULL; + } +} + +char *ED_info_stats_string(Scene *scene) +{ + if(!scene->stats) + stats_update(scene); + stats_string(scene); + + return scene->stats->infostr; +} + diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index fe5bbf04af1..b6f9cbeabb5 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -1,5 +1,5 @@ /** - * $Id: + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * @@ -58,6 +58,7 @@ #include "UI_view2d.h" #include "ED_markers.h" +#include "ED_object.h" #include "info_intern.h" // own include @@ -166,6 +167,9 @@ static void info_header_listener(ARegion *ar, wmNotifier *wmn) if(wmn->data==ND_RENDER_RESULT) ED_region_tag_redraw(ar); break; + case NC_INFO: + ED_region_tag_redraw(ar); + break; } } diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 4a3d555ca33..f1a77d78b7b 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -47,6 +47,7 @@ struct Text; struct bNodeTree; struct AnimData; struct Editing; +struct SceneStats; typedef struct Base { struct Base *next, *prev; @@ -717,7 +718,6 @@ typedef struct Scene { /* Units */ struct UnitSettings unit; - } Scene; diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 88796919c3e..0301932aef3 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -62,6 +62,7 @@ EnumPropertyItem prop_mode_items[] ={ #include "BLI_threads.h" +#include "ED_info.h" #include "ED_node.h" #include "RE_pipeline.h" @@ -1823,6 +1824,7 @@ void RNA_def_scene(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; + FunctionRNA *func; /* Struct definition */ srna= RNA_def_struct(brna, "Scene", "ID"); @@ -1982,6 +1984,11 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "gm"); RNA_def_property_struct_type(prop, "SceneGameData"); RNA_def_property_ui_text(prop, "Game Data", ""); + + /* Statistics */ + func= RNA_def_function(srna, "statistics", "ED_info_stats_string"); + prop= RNA_def_string(func, "statistics", "", 0, "Statistics", ""); + RNA_def_function_return(func, prop); rna_def_tool_settings(brna); rna_def_unit_settings(brna); diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 00e9f6a2fa2..b717df8f61f 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -134,6 +134,7 @@ typedef struct wmNotifier { #define NC_ANIMATION (15<<24) #define NC_CONSOLE (16<<24) #define NC_NODE (17<<24) +#define NC_INFO (18<<24) /* data type, 256 entries is enough, it can overlap */ #define NOTE_DATA 0x00FF0000 diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index f0d9f8c0989..6c34ed6f902 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -52,6 +52,7 @@ #include "BKE_pointcache.h" #include "ED_fileselect.h" +#include "ED_info.h" #include "ED_screen.h" #include "ED_space_api.h" #include "ED_util.h" @@ -129,7 +130,7 @@ static wmNotifier *wm_notifier_next(wmWindowManager *wm) void wm_event_do_notifiers(bContext *C) { wmWindowManager *wm= CTX_wm_manager(C); - wmNotifier *note; + wmNotifier *note, *next; wmWindow *win; if(wm==NULL) @@ -141,7 +142,9 @@ void wm_event_do_notifiers(bContext *C) CTX_wm_window_set(C, win); - for(note= wm->queue.first; note; note= note->next) { + for(note= wm->queue.first; note; note= next) { + next= note->next; + if(note->category==NC_WM) { if( ELEM(note->data, ND_FILEREAD, ND_FILESAVE)) { wm->file_saved= 1; @@ -174,6 +177,10 @@ void wm_event_do_notifiers(bContext *C) do_anim= 1; } } + if(note->category == NC_SCENE || note->category == NC_OBJECT) { + ED_info_stats_clear(CTX_data_scene(C)); + WM_event_add_notifier(C, NC_INFO, NULL); + } } if(do_anim) { /* depsgraph gets called, might send more notifiers */ From 315229ea5ffb6d0519b0a5d144996760871dd3bb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 19 Aug 2009 14:04:21 +0000 Subject: [PATCH 143/577] texture enum was crashing when generating docs, removed radiosity from makefiles. --- source/blender/makesrna/intern/rna_texture.c | 2 +- source/blender/render/intern/source/Makefile | 1 - source/creator/Makefile | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index b7403ab1178..f82edee8ff1 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -142,7 +142,7 @@ static EnumPropertyItem *rna_TextureSlot_output_node_itemf(bContext *C, PointerR EnumPropertyItem *item= NULL; int totitem= 0; - if(tex) { + if(tex && C) { /* Note, tex/mtex/ntree can be invalid of C is NULL, TODO - can this give valid results when C is NULL? */ bNodeTree *ntree= tex->nodetree; if(ntree) { EnumPropertyItem tmp= {0, "", 0, "", ""}; diff --git a/source/blender/render/intern/source/Makefile b/source/blender/render/intern/source/Makefile index 3c8d0f637a3..5d4a224002e 100644 --- a/source/blender/render/intern/source/Makefile +++ b/source/blender/render/intern/source/Makefile @@ -39,7 +39,6 @@ CFLAGS += $(LEVEL_1_C_WARNINGS) # The external modules follow after. There should be a nicer way to say this. CPPFLAGS += -I../include CPPFLAGS += -I../../extern/include -CPPFLAGS += -I../../../radiosity/extern/include CPPFLAGS += -I../../../blenlib CPPFLAGS += -I../../../imbuf CPPFLAGS += -I../../../makesdna diff --git a/source/creator/Makefile b/source/creator/Makefile index fbe5d252a77..592cf913dfa 100644 --- a/source/creator/Makefile +++ b/source/creator/Makefile @@ -40,7 +40,6 @@ include nan_compile.mk CFLAGS += $(LEVEL_1_C_WARNINGS) CPPFLAGS += -I../blender/render/extern/include -CPPFLAGS += -I../blender/radiosity/extern/include # two needed for the kernel CPPFLAGS += -I../blender/imbuf From 792d526489011215db32dba424809d6e741b05c3 Mon Sep 17 00:00:00 2001 From: Robin Allen Date: Wed, 19 Aug 2009 15:45:16 +0000 Subject: [PATCH 144/577] More texnode preview fixes. Previews now have correct aspect ratio and are drawn by the renderer. --- source/blender/blenkernel/BKE_node.h | 5 +-- .../blender/editors/preview/previewrender.c | 6 ++- source/blender/editors/space_node/node_edit.c | 5 --- .../blender/editors/space_node/space_node.c | 5 ++- source/blender/nodes/intern/TEX_util.c | 44 ++++++++----------- source/blender/nodes/intern/TEX_util.h | 3 +- source/blender/render/intern/source/texture.c | 2 +- 7 files changed, 30 insertions(+), 40 deletions(-) diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 4ac95b61a5e..40afa1dba36 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -421,10 +421,9 @@ extern struct ListBase node_all_textures; /* API */ int ntreeTexTagAnimated(struct bNodeTree *ntree); -void ntreeTexUpdatePreviews( struct bNodeTree* nodetree ); -void ntreeTexExecTree(struct bNodeTree *ntree, struct TexResult *target, float *coord, float *dxt, float *dyt, char do_preview, short thread, struct Tex *tex, short which_output, int cfra); +void ntreeTexSetPreviewFlag(int); +void ntreeTexExecTree(struct bNodeTree *ntree, struct TexResult *target, float *coord, float *dxt, float *dyt, short thread, struct Tex *tex, short which_output, int cfra); void ntreeTexCheckCyclics(struct bNodeTree *ntree); -void ntreeTexAssignIndex(struct bNodeTree *ntree, struct bNode *node); char* ntreeTexOutputMenu(struct bNodeTree *ntree); diff --git a/source/blender/editors/preview/previewrender.c b/source/blender/editors/preview/previewrender.c index 8fcf65202ee..94db74c18d9 100644 --- a/source/blender/editors/preview/previewrender.c +++ b/source/blender/editors/preview/previewrender.c @@ -946,7 +946,11 @@ void ED_preview_shader_job(const bContext *C, void *owner, ID *id, ID *parent, M /* XXX ugly global still, but we can't do preview while rendering */ if(G.rendering) return; - + + if(GS(id->name) == ID_TE) { + ntreeTexSetPreviewFlag(1); + } + steve= WM_jobs_get(CTX_wm_manager(C), CTX_wm_window(C), owner); sp= MEM_callocN(sizeof(ShaderPreview), "shader preview"); diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index e1b612d74e1..bc81c25d106 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -574,7 +574,6 @@ void ED_node_texture_default(Tex *tx) nodeAddLink(tx->nodetree, in, fromsock, out, tosock); ntreeSolveOrder(tx->nodetree); /* needed for pointers */ - ntreeTexUpdatePreviews(tx->nodetree); /* XXX texture nodes should follow shader node methods (ton) */ } /* Here we set the active tree(s), even called for each redraw now, so keep it fast :) */ @@ -1111,9 +1110,6 @@ static int node_resize_modal(bContext *C, wmOperator *op, wmEvent *event) node->width= nsw->oldwidth + mx - nsw->mxstart; CLAMP(node->width, node->typeinfo->minwidth, node->typeinfo->maxwidth); } - // XXX - if(snode->nodetree->type == NTREE_TEXTURE) - ntreeTexUpdatePreviews(snode->nodetree); /* XXX texture nodes should follow shader node methods (ton) */ ED_region_tag_redraw(ar); @@ -1659,7 +1655,6 @@ bNode *node_add_node(SpaceNode *snode, Scene *scene, int type, float locx, float if(snode->nodetree->type==NTREE_TEXTURE) { ntreeTexCheckCyclics(snode->edittree); - ntreeTexUpdatePreviews(snode->edittree); /* XXX texture nodes should follow shader node methods (ton) */ } return node; diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index cb25d29fd27..2233a4db3a0 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -184,8 +184,9 @@ static void node_area_refresh(const struct bContext *C, struct ScrArea *sa) } else if(snode->treetype==NTREE_TEXTURE) { Tex *tex= (Tex *)snode->id; - if(tex->use_nodes) - ntreeTexUpdatePreviews(tex->nodetree); + if(tex->use_nodes) { + ED_preview_shader_job(C, sa, snode->id, NULL, NULL, 100, 100); + } } } } diff --git a/source/blender/nodes/intern/TEX_util.c b/source/blender/nodes/intern/TEX_util.c index a6a5877722b..2c21627dad9 100644 --- a/source/blender/nodes/intern/TEX_util.c +++ b/source/blender/nodes/intern/TEX_util.c @@ -47,6 +47,8 @@ #define PREV_RES 128 /* default preview resolution */ +int preview_flag = 0; + void tex_call_delegate(TexDelegate *dg, float *out, TexParams *params, short thread) { if(dg->node->need_exec) @@ -108,12 +110,6 @@ static void init_preview(bNode *node) if(node->preview==NULL) node->preview= MEM_callocN(sizeof(bNodePreview), "node preview"); - if(node->preview->rect) - if(node->preview->xsize!=xsize && node->preview->ysize!=ysize) { - MEM_freeN(node->preview->rect); - node->preview->rect= NULL; - } - if(node->preview->rect==NULL) { node->preview->rect= MEM_callocN(4*xsize + xsize*ysize*sizeof(float)*4, "node preview rect"); node->preview->xsize= xsize; @@ -136,6 +132,8 @@ void tex_do_preview(bNode *node, bNodeStack *ns, TexCallData *cdata) bNodePreview *preview; float coord[3] = {0, 0, 0}; TexParams params; + int resolution; + int xsize, ysize; if(!cdata->do_preview) return; @@ -146,19 +144,23 @@ void tex_do_preview(bNode *node, bNodeStack *ns, TexCallData *cdata) init_preview(node); preview = node->preview; + xsize = preview->xsize; + ysize = preview->ysize; params.dxt = 0; params.dyt = 0; params.cfra = cdata->cfra; params.coord = coord; - for(x=0; xxsize; x++) - for(y=0; yysize; y++) + resolution = (xsize < ysize) ? xsize : ysize; + + for(x=0; xxsize) * 2 - 1; - params.coord[1] = ((float) y / preview->ysize) * 2 - 1; + params.coord[0] = ((float) x / resolution) * 2 - 1; + params.coord[1] = ((float) y / resolution) * 2 - 1; - result = preview->rect + 4 * (preview->xsize*y + x); + result = preview->rect + 4 * (xsize*y + x); tex_input_rgba(result, ns, ¶ms, cdata->thread); } @@ -212,7 +214,6 @@ void ntreeTexExecTree( TexResult *texres, float *coord, float *dxt, float *dyt, - char do_preview, short thread, Tex *tex, short which_output, @@ -230,28 +231,19 @@ void ntreeTexExecTree( data.dxt = dxt; data.dyt = dyt; data.target = texres; - data.do_preview = do_preview; + data.do_preview = preview_flag; data.thread = thread; data.which_output = which_output; data.cfra= cfra; + preview_flag = 0; + ntreeExecTree(nodes, &data, thread); } -void ntreeTexUpdatePreviews(bNodeTree* nodetree) +void ntreeTexSetPreviewFlag(int doit) { - Tex *tex; - float coord[] = {0,0,0}; - TexResult dummy_texres; - - for(tex= G.main->tex.first; tex; tex= tex->id.next) - if(tex->nodetree == nodetree) break; - if(tex) { - dummy_texres.nor = 0; - - ntreeBeginExecTree(nodetree); - ntreeTexExecTree(nodetree, &dummy_texres, coord, 0, 0, 1, 0, tex, 0, 0); - } + preview_flag = doit; } char* ntreeTexOutputMenu(bNodeTree *ntree) diff --git a/source/blender/nodes/intern/TEX_util.h b/source/blender/nodes/intern/TEX_util.h index 7fff8d04651..87a9cf288d6 100644 --- a/source/blender/nodes/intern/TEX_util.h +++ b/source/blender/nodes/intern/TEX_util.h @@ -102,8 +102,7 @@ float tex_input_value(bNodeStack *in, TexParams *params, short thread); void tex_output(bNode *node, bNodeStack **in, bNodeStack *out, TexFn texfn); void tex_do_preview(bNode *node, bNodeStack *ns, TexCallData *cdata); -void ntreeTexUpdatePreviews( bNodeTree* nodetree ); -void ntreeTexExecTree(bNodeTree *nodes, TexResult *texres, float *coord, float *dxt, float *dyt, char do_preview, short thread, struct Tex *tex, short which_output, int cfra); +void ntreeTexExecTree(bNodeTree *nodes, TexResult *texres, float *coord, float *dxt, float *dyt, short thread, struct Tex *tex, short which_output, int cfra); void params_from_cdata(TexParams *out, TexCallData *in); diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index 3db78bfea93..e6d6e78e27b 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -719,7 +719,7 @@ static int evalnodes(Tex *tex, float *texvec, float *dxt, float *dyt, TexResult short rv = TEX_INT; bNodeTree *nodes = tex->nodetree; - ntreeTexExecTree(nodes, texres, texvec, dxt, dyt, 0, thread, tex, which_output, R.r.cfra); + ntreeTexExecTree(nodes, texres, texvec, dxt, dyt, thread, tex, which_output, R.r.cfra); if(texres->nor) rv |= TEX_NOR; rv |= TEX_RGB; From 8a5a7d3d280f3270ce3115bced8a3975643f7cda Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Wed, 19 Aug 2009 16:49:21 +0000 Subject: [PATCH 145/577] 2.5/Multires: * Fixed saving most recent sculpting on a multires object. Uses the same hack already in place for saving that info for undo. --- source/blender/blenloader/intern/writefile.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 62ec1b71938..ede7aacfea8 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1100,7 +1100,7 @@ static void write_defgroups(WriteData *wd, ListBase *defbase) writestruct(wd, DATA, "bDeformGroup", 1, defgroup); } -static void write_modifiers(WriteData *wd, ListBase *modbase, int write_undo) +static void write_modifiers(WriteData *wd, ListBase *modbase) { ModifierData *md; @@ -1166,13 +1166,13 @@ static void write_modifiers(WriteData *wd, ListBase *modbase, int write_undo) else if (md->type==eModifierType_Multires) { MultiresModifierData *mmd = (MultiresModifierData*) md; - if(mmd->undo_verts && write_undo) + if(mmd->undo_verts) writestruct(wd, DATA, "MVert", mmd->undo_verts_tot, mmd->undo_verts); } } } -static void write_objects(WriteData *wd, ListBase *idbase, int write_undo) +static void write_objects(WriteData *wd, ListBase *idbase) { Object *ob; @@ -1206,7 +1206,7 @@ static void write_objects(WriteData *wd, ListBase *idbase, int write_undo) writestruct(wd, DATA, "BulletSoftBody", 1, ob->bsoft); write_particlesystems(wd, &ob->particlesystem); - write_modifiers(wd, &ob->modifiers, write_undo); + write_modifiers(wd, &ob->modifiers); } ob= ob->id.next; } @@ -2320,7 +2320,7 @@ static int write_file_handle(Main *mainvar, int handle, MemFile *compare, MemFil write_groups (wd, &mainvar->group); write_armatures(wd, &mainvar->armature); write_actions (wd, &mainvar->action); - write_objects (wd, &mainvar->object, (current != NULL)); + write_objects (wd, &mainvar->object); write_materials(wd, &mainvar->mat); write_textures (wd, &mainvar->tex); write_meshs (wd, &mainvar->mesh); From c21627e31b0e82f28e35af51cec681897285ff78 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Wed, 19 Aug 2009 21:24:52 +0000 Subject: [PATCH 146/577] 2.5/Paint: * Some initial work on a new paint abstraction, PaintStroke. For now, most of the code just pulls out stroke-related stuff from sculpt mode, next step is to integrate the other paint modes to use this. It'll enable stuff like smooth stroke for all the paint modes with less code duplication. --- source/blender/editors/include/ED_view3d.h | 1 + .../editors/sculpt_paint/paint_intern.h | 15 ++ .../editors/sculpt_paint/paint_stroke.c | 224 +++++++++++++++++ .../editors/sculpt_paint/paint_vertex.c | 203 ++++++++-------- source/blender/editors/sculpt_paint/sculpt.c | 229 +++++------------- .../editors/space_view3d/view3d_view.c | 13 + 6 files changed, 415 insertions(+), 270 deletions(-) create mode 100644 source/blender/editors/sculpt_paint/paint_stroke.c diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 07aa44cadd8..fd1b7e1351d 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -70,6 +70,7 @@ float *give_cursor(struct Scene *scene, struct View3D *v3d); void initgrabz(struct RegionView3D *rv3d, float x, float y, float z); void window_to_3d(struct ARegion *ar, float *vec, short mx, short my); void window_to_3d_delta(struct ARegion *ar, float *vec, short mx, short my); +void view3d_unproject(struct bglMats *mats, float out[3], const short x, const short y, const float z); /* Depth buffer */ float read_cached_depth(struct ViewContext *vc, int x, int y); diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h index 40423e17fe4..41764a70686 100644 --- a/source/blender/editors/sculpt_paint/paint_intern.h +++ b/source/blender/editors/sculpt_paint/paint_intern.h @@ -29,13 +29,28 @@ #ifndef ED_PAINT_INTERN_H #define ED_PAINT_INTERN_H +struct bContext; struct Scene; struct Object; struct Mesh; +struct PaintStroke; +struct PointerRNA; struct ViewContext; +struct wmEvent; +struct wmOperator; struct wmOperatorType; struct ARegion; +/* paint_stroke.c */ +typedef int (*StrokeTestStart)(struct bContext *C, struct wmOperator *op, struct wmEvent *event); +typedef void (*StrokeUpdateStep)(struct bContext *C, struct PaintStroke *stroke, struct PointerRNA *itemptr); +typedef void (*StrokeDone)(struct bContext *C, struct PaintStroke *stroke); + +struct PaintStroke *paint_stroke_new(bContext *C, StrokeTestStart test_start, + StrokeUpdateStep update_step, StrokeDone done); +int paint_stroke_modal(struct bContext *C, struct wmOperator *op, struct wmEvent *event); +struct ViewContext *paint_stroke_view_context(struct PaintStroke *stroke); + /* paint_vertex.c */ void PAINT_OT_weight_paint_toggle(struct wmOperatorType *ot); void PAINT_OT_weight_paint_radial_control(struct wmOperatorType *ot); diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c new file mode 100644 index 00000000000..634b82674b5 --- /dev/null +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -0,0 +1,224 @@ +/* + * ***** 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) 2009 by Nicholas Bishop + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + * + */ + +#include "MEM_guardedalloc.h" + +#include "DNA_brush_types.h" +#include "DNA_object_types.h" +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" + +#include "RNA_access.h" + +#include "BKE_context.h" +#include "BKE_paint.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "BLI_arithb.h" + +#include "BIF_glutil.h" + +#include "ED_screen.h" +#include "ED_view3d.h" + +#include "paint_intern.h" + +#include +#include + +typedef struct PaintStroke { + /* Cached values */ + ViewContext vc; + bglMats mats; + Brush *brush; + + float last_mouse_position[2]; + + /* Set whether any stroke step has yet occured + e.g. in sculpt mode, stroke doesn't start until cursor + passes over the mesh */ + int stroke_started; + + StrokeTestStart test_start; + StrokeUpdateStep update_step; + StrokeDone done; +} PaintStroke; + +/* Put the location of the next stroke dot into the stroke RNA and apply it to the mesh */ +static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, wmEvent *event, float mouse[2]) +{ + PointerRNA itemptr; + float cur_depth, pressure = 1; + float center[3]; + PaintStroke *stroke = op->customdata; + + cur_depth = read_cached_depth(&stroke->vc, mouse[0], mouse[1]); + view3d_unproject(&stroke->mats, center, mouse[0], mouse[1], cur_depth); + + /* Tablet */ + if(event->custom == EVT_DATA_TABLET) { + wmTabletData *wmtab= event->customdata; + if(wmtab->Active != EVT_TABLET_NONE) + pressure= wmtab->Pressure; + } + + /* Add to stroke */ + RNA_collection_add(op->ptr, "stroke", &itemptr); + RNA_float_set_array(&itemptr, "location", center); + RNA_float_set_array(&itemptr, "mouse", mouse); + RNA_boolean_set(&itemptr, "flip", event->shift); + RNA_float_set(&itemptr, "pressure", pressure); + + stroke->last_mouse_position[0] = mouse[0]; + stroke->last_mouse_position[1] = mouse[1]; + + stroke->update_step(C, stroke, &itemptr); +} + +/* Returns zero if no sculpt changes should be made, non-zero otherwise */ +static int paint_smooth_stroke(PaintStroke *stroke, float output[2], wmEvent *event) +{ + output[0] = event->x; + output[1] = event->y; + + if(stroke->brush->flag & BRUSH_SMOOTH_STROKE && stroke->brush->sculpt_tool != SCULPT_TOOL_GRAB) { + float u = stroke->brush->smooth_stroke_factor, v = 1.0 - u; + float dx = stroke->last_mouse_position[0] - event->x, dy = stroke->last_mouse_position[1] - event->y; + + /* If the mouse is moving within the radius of the last move, + don't update the mouse position. This allows sharp turns. */ + if(dx*dx + dy*dy < stroke->brush->smooth_stroke_radius * stroke->brush->smooth_stroke_radius) + return 0; + + output[0] = event->x * v + stroke->last_mouse_position[0] * u; + output[1] = event->y * v + stroke->last_mouse_position[1] * u; + } + + return 1; +} + +/* Returns zero if the stroke dots should not be spaced, non-zero otherwise */ +static int paint_space_stroke_enabled(Brush *br) +{ + return (br->flag & BRUSH_SPACE) && !(br->flag & BRUSH_ANCHORED) && (br->sculpt_tool != SCULPT_TOOL_GRAB); +} + +/* For brushes with stroke spacing enabled, moves mouse in steps + towards the final mouse location. */ +static int paint_space_stroke(bContext *C, wmOperator *op, wmEvent *event, const float final_mouse[2]) +{ + PaintStroke *stroke = op->customdata; + int cnt = 0; + + if(paint_space_stroke_enabled(stroke->brush)) { + float mouse[2] = {stroke->last_mouse_position[0], stroke->last_mouse_position[1]}; + float vec[2] = {final_mouse[0] - mouse[0], final_mouse[1] - mouse[1]}; + float length, scale; + int steps = 0, i; + + /* Normalize the vector between the last stroke dot and the goal */ + length = sqrt(vec[0]*vec[0] + vec[1]*vec[1]); + + if(length > FLT_EPSILON) { + scale = stroke->brush->spacing / length; + vec[0] *= scale; + vec[1] *= scale; + + steps = (int)(length / stroke->brush->spacing); + for(i = 0; i < steps; ++i, ++cnt) { + mouse[0] += vec[0]; + mouse[1] += vec[1]; + paint_brush_stroke_add_step(C, op, event, mouse); + } + } + } + + return cnt; +} + +/**** Public API ****/ + +PaintStroke *paint_stroke_new(bContext *C, StrokeTestStart test_start, + StrokeUpdateStep update_step, StrokeDone done) +{ + PaintStroke *stroke = MEM_callocN(sizeof(PaintStroke), "PaintStroke"); + + stroke->brush = paint_brush(paint_get_active(CTX_data_scene(C))); + view3d_set_viewcontext(C, &stroke->vc); + view3d_get_transformation(&stroke->vc, stroke->vc.obact, &stroke->mats); + + stroke->test_start = test_start; + stroke->update_step = update_step; + stroke->done = done; + + return stroke; +} + +int paint_stroke_modal(bContext *C, wmOperator *op, wmEvent *event) +{ + ARegion *ar = CTX_wm_region(C); + PaintStroke *stroke = op->customdata; + float mouse[2]; + + if(!stroke->stroke_started) { + stroke->last_mouse_position[0] = event->x; + stroke->last_mouse_position[1] = event->y; + stroke->stroke_started = stroke->test_start(C, op, event); + ED_region_tag_redraw(ar); + } + + if(stroke->stroke_started) { + if(paint_smooth_stroke(stroke, mouse, event)) { + if(paint_space_stroke_enabled(stroke->brush)) { + if(!paint_space_stroke(C, op, event, mouse)) + ED_region_tag_redraw(ar); + } + else + paint_brush_stroke_add_step(C, op, event, mouse); + } + else + ED_region_tag_redraw(ar); + } + + /* TODO: fix hardcoded event here */ + if(event->type == LEFTMOUSE && event->val == 0) { + stroke->done(C, stroke); + MEM_freeN(stroke); + return OPERATOR_FINISHED; + } + else + return OPERATOR_RUNNING_MODAL; +} + +ViewContext *paint_stroke_view_context(PaintStroke *stroke) +{ + return &stroke->vc; +} + diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 1a548708ec8..05faa47e0f4 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1709,122 +1709,123 @@ static void vpaint_exit(bContext *C, wmOperator *op) op->customdata= NULL; } -static int vpaint_modal(bContext *C, wmOperator *op, wmEvent *event) +static void vpaint_dot(bContext *C, struct VPaintData *vpd, wmEvent *event) { ToolSettings *ts= CTX_data_tool_settings(C); VPaint *vp= ts->vpaint; Brush *brush = paint_brush(&vp->paint); - - switch(event->type) { - case LEFTMOUSE: - if(event->val==0) { /* release */ - vpaint_exit(C, op); - return OPERATOR_FINISHED; - } - /* pass on, first press gets painted too */ + ViewContext *vc= &vpd->vc; + Object *ob= vc->obact; + Mesh *me= ob->data; + float mat[4][4]; + int *indexar= vpd->indexar; + int totindex, index; + short mval[2]; - case MOUSEMOVE: - { - struct VPaintData *vpd= op->customdata; - ViewContext *vc= &vpd->vc; - Object *ob= vc->obact; - Mesh *me= ob->data; - float mat[4][4]; - int *indexar= vpd->indexar; - int totindex, index; - short mval[2]; + view3d_operator_needs_opengl(C); - view3d_operator_needs_opengl(C); + /* load projection matrix */ + wmMultMatrix(ob->obmat); + wmGetSingleMatrix(mat); + wmLoadMatrix(vc->rv3d->viewmat); - /* load projection matrix */ - wmMultMatrix(ob->obmat); - wmGetSingleMatrix(mat); - wmLoadMatrix(vc->rv3d->viewmat); - - mval[0]= event->x - vc->ar->winrct.xmin; - mval[1]= event->y - vc->ar->winrct.ymin; + mval[0]= event->x - vc->ar->winrct.xmin; + mval[1]= event->y - vc->ar->winrct.ymin; - /* which faces are involved */ - if(vp->flag & VP_AREA) { - totindex= sample_backbuf_area(vc, indexar, me->totface, mval[0], mval[1], brush->size); - } - else { - indexar[0]= view3d_sample_backbuf(vc, mval[0], mval[1]); - if(indexar[0]) totindex= 1; - else totindex= 0; - } + /* which faces are involved */ + if(vp->flag & VP_AREA) { + totindex= sample_backbuf_area(vc, indexar, me->totface, mval[0], mval[1], brush->size); + } + else { + indexar[0]= view3d_sample_backbuf(vc, mval[0], mval[1]); + if(indexar[0]) totindex= 1; + else totindex= 0; + } - MTC_Mat4SwapMat4(vc->rv3d->persmat, mat); + MTC_Mat4SwapMat4(vc->rv3d->persmat, mat); - if(vp->flag & VP_COLINDEX) { - for(index=0; indextotface) { - MFace *mface= ((MFace *)me->mface) + (indexar[index]-1); + if(vp->flag & VP_COLINDEX) { + for(index=0; indextotface) { + MFace *mface= ((MFace *)me->mface) + (indexar[index]-1); - if(mface->mat_nr!=ob->actcol-1) { - indexar[index]= 0; - } - } + if(mface->mat_nr!=ob->actcol-1) { + indexar[index]= 0; } - } - if((G.f & G_FACESELECT) && me->mface) { - for(index=0; indextotface) { - MFace *mface= ((MFace *)me->mface) + (indexar[index]-1); - - if((mface->flag & ME_FACE_SEL)==0) - indexar[index]= 0; - } - } - } - - for(index=0; indextotface) { - MFace *mface= ((MFace *)me->mface) + (indexar[index]-1); - unsigned int *mcol= ( (unsigned int *)me->mcol) + 4*(indexar[index]-1); - unsigned int *mcolorig= ( (unsigned int *)vp->vpaint_prev) + 4*(indexar[index]-1); - int alpha; - - if(vp->mode==VP_BLUR) { - unsigned int fcol1= mcol_blend( mcol[0], mcol[1], 128); - if(mface->v4) { - unsigned int fcol2= mcol_blend( mcol[2], mcol[3], 128); - vpd->paintcol= mcol_blend( fcol1, fcol2, 128); - } - else { - vpd->paintcol= mcol_blend( mcol[2], fcol1, 170); - } - - } - - alpha= calc_vp_alpha_dl(vp, vc, vpd->vpimat, vpd->vertexcosnos+6*mface->v1, mval); - if(alpha) vpaint_blend(vp, mcol, mcolorig, vpd->paintcol, alpha); - - alpha= calc_vp_alpha_dl(vp, vc, vpd->vpimat, vpd->vertexcosnos+6*mface->v2, mval); - if(alpha) vpaint_blend(vp, mcol+1, mcolorig+1, vpd->paintcol, alpha); - - alpha= calc_vp_alpha_dl(vp, vc, vpd->vpimat, vpd->vertexcosnos+6*mface->v3, mval); - if(alpha) vpaint_blend(vp, mcol+2, mcolorig+2, vpd->paintcol, alpha); - - if(mface->v4) { - alpha= calc_vp_alpha_dl(vp, vc, vpd->vpimat, vpd->vertexcosnos+6*mface->v4, mval); - if(alpha) vpaint_blend(vp, mcol+3, mcolorig+3, vpd->paintcol, alpha); - } - } - } - - MTC_Mat4SwapMat4(vc->rv3d->persmat, mat); - - do_shared_vertexcol(me); - - ED_region_tag_redraw(vc->ar); - - DAG_object_flush_update(vc->scene, ob, OB_RECALC_DATA); + } } + } + if((G.f & G_FACESELECT) && me->mface) { + for(index=0; indextotface) { + MFace *mface= ((MFace *)me->mface) + (indexar[index]-1); + + if((mface->flag & ME_FACE_SEL)==0) + indexar[index]= 0; + } + } + } + + for(index=0; indextotface) { + MFace *mface= ((MFace *)me->mface) + (indexar[index]-1); + unsigned int *mcol= ( (unsigned int *)me->mcol) + 4*(indexar[index]-1); + unsigned int *mcolorig= ( (unsigned int *)vp->vpaint_prev) + 4*(indexar[index]-1); + int alpha; + + if(vp->mode==VP_BLUR) { + unsigned int fcol1= mcol_blend( mcol[0], mcol[1], 128); + if(mface->v4) { + unsigned int fcol2= mcol_blend( mcol[2], mcol[3], 128); + vpd->paintcol= mcol_blend( fcol1, fcol2, 128); + } + else { + vpd->paintcol= mcol_blend( mcol[2], fcol1, 170); + } + + } + + alpha= calc_vp_alpha_dl(vp, vc, vpd->vpimat, vpd->vertexcosnos+6*mface->v1, mval); + if(alpha) vpaint_blend(vp, mcol, mcolorig, vpd->paintcol, alpha); + + alpha= calc_vp_alpha_dl(vp, vc, vpd->vpimat, vpd->vertexcosnos+6*mface->v2, mval); + if(alpha) vpaint_blend(vp, mcol+1, mcolorig+1, vpd->paintcol, alpha); + + alpha= calc_vp_alpha_dl(vp, vc, vpd->vpimat, vpd->vertexcosnos+6*mface->v3, mval); + if(alpha) vpaint_blend(vp, mcol+2, mcolorig+2, vpd->paintcol, alpha); + + if(mface->v4) { + alpha= calc_vp_alpha_dl(vp, vc, vpd->vpimat, vpd->vertexcosnos+6*mface->v4, mval); + if(alpha) vpaint_blend(vp, mcol+3, mcolorig+3, vpd->paintcol, alpha); + } + } + } + + MTC_Mat4SwapMat4(vc->rv3d->persmat, mat); + + do_shared_vertexcol(me); + + ED_region_tag_redraw(vc->ar); + + DAG_object_flush_update(vc->scene, ob, OB_RECALC_DATA); +} + +static int vpaint_modal(bContext *C, wmOperator *op, wmEvent *event) +{ + switch(event->type) { + case LEFTMOUSE: + if(event->val==0) { /* release */ + vpaint_exit(C, op); + return OPERATOR_FINISHED; + } + /* pass on, first press gets painted too */ + + case MOUSEMOVE: + vpaint_dot(C, op->customdata, event); break; } - + return OPERATOR_RUNNING_MODAL; } diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index f7f72d611dc..c01004f5b7e 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -80,6 +80,7 @@ #include "ED_space_api.h" #include "ED_util.h" #include "ED_view3d.h" +#include "paint_intern.h" #include "sculpt_intern.h" #include "RNA_access.h" @@ -144,7 +145,6 @@ typedef struct StrokeCache { int first_time; /* Beginning of stroke may do some things special */ - ViewContext vc; bglMats *mats; short (*orig_norms)[3]; /* Copy of the mesh vertices' normals */ @@ -178,19 +178,6 @@ typedef struct ProjVert { * Simple functions to get data from the GL */ -/* Uses window coordinates (x,y) and depth component z to find a point in - modelspace */ -static void unproject(bglMats *mats, float out[3], const short x, const short y, const float z) -{ - double ux, uy, uz; - - gluUnProject(x,y,z, mats->modelview, mats->projection, - (GLint *)mats->viewport, &ux, &uy, &uz ); - out[0] = ux; - out[1] = uy; - out[2] = uz; -} - /* Convert a point in model coordinates to 2D screen coordinates. */ static void projectf(bglMats *mats, const float v[3], float p[2]) { @@ -547,7 +534,7 @@ static void do_flatten_clay_brush(Sculpt *sd, SculptSession *ss, const ListBase ActiveData *node= active_verts->first; /* area_normal and cntr define the plane towards which vertices are squashed */ float area_normal[3]; - float cntr[3], cntr2[3], bstr; + float cntr[3], cntr2[3], bstr = 0; int flip = 0; calc_area_normal(sd, ss, area_normal, active_verts); @@ -1169,7 +1156,7 @@ static float unproject_brush_radius(SculptSession *ss, float offset) float brush_edge[3]; /* In anchored mode, brush size changes with mouse loc, otherwise it's fixed using the brush radius */ - unproject(ss->cache->mats, brush_edge, ss->cache->initial_mouse[0] + offset, + view3d_unproject(ss->cache->mats, brush_edge, ss->cache->initial_mouse[0] + offset, ss->cache->initial_mouse[1], ss->cache->depth); return VecLenf(ss->cache->true_location, brush_edge); @@ -1194,6 +1181,7 @@ static void sculpt_update_cache_invariants(Sculpt *sd, SculptSession *ss, bConte { StrokeCache *cache = MEM_callocN(sizeof(StrokeCache), "stroke cache"); Brush *brush = paint_brush(&sd->paint); + ViewContext *vc = paint_stroke_view_context(op->customdata); int i; ss->cache = cache; @@ -1209,10 +1197,8 @@ static void sculpt_update_cache_invariants(Sculpt *sd, SculptSession *ss, bConte /* Truly temporary data that isn't stored in properties */ - view3d_set_viewcontext(C, &cache->vc); - cache->mats = MEM_callocN(sizeof(bglMats), "sculpt bglMats"); - view3d_get_transformation(&cache->vc, cache->vc.obact, cache->mats); + view3d_get_transformation(vc, vc->obact, cache->mats); sculpt_update_mesh_elements(C); @@ -1252,7 +1238,7 @@ static void sculpt_update_cache_invariants(Sculpt *sd, SculptSession *ss, bConte } } - unproject(cache->mats, cache->true_location, cache->initial_mouse[0], cache->initial_mouse[1], cache->depth); + view3d_unproject(cache->mats, cache->true_location, cache->initial_mouse[0], cache->initial_mouse[1], cache->depth); cache->initial_radius = unproject_brush_radius(ss, brush->size); cache->rotation = 0; cache->first_time = 1; @@ -1312,7 +1298,7 @@ static void sculpt_update_cache_variants(Sculpt *sd, SculptSession *ss, PointerR /* Find the grab delta */ if(brush->sculpt_tool == SCULPT_TOOL_GRAB) { - unproject(cache->mats, grab_location, cache->mouse[0], cache->mouse[1], cache->depth); + view3d_unproject(cache->mats, grab_location, cache->mouse[0], cache->mouse[1], cache->depth); if(!cache->first_time) VecSubf(cache->grab_delta, grab_location, cache->old_grab_location); VecCopyf(cache->old_grab_location, grab_location); @@ -1325,7 +1311,6 @@ static void sculpt_brush_stroke_init_properties(bContext *C, wmOperator *op, wmE Sculpt *sd = CTX_data_tool_settings(C)->sculpt; Object *ob= CTX_data_active_object(C); ModifierData *md; - ViewContext vc; float scale[3], clip_tolerance[3] = {0,0,0}; float mouse[2]; int flag = 0; @@ -1358,13 +1343,12 @@ static void sculpt_brush_stroke_init_properties(bContext *C, wmOperator *op, wmE RNA_float_set_array(op->ptr, "initial_mouse", mouse); /* Initial screen depth under the mouse */ - view3d_set_viewcontext(C, &vc); - RNA_float_set(op->ptr, "depth", read_cached_depth(&vc, event->x, event->y)); + RNA_float_set(op->ptr, "depth", read_cached_depth(paint_stroke_view_context(op->customdata), event->x, event->y)); sculpt_update_cache_invariants(sd, ss, C, op); } -static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, wmEvent *event) +static void sculpt_brush_stroke_init(bContext *C) { Sculpt *sd = CTX_data_tool_settings(C)->sculpt; SculptSession *ss = CTX_data_active_object(C)->sculpt; @@ -1376,10 +1360,7 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, wmEvent *even changes are made to the texture. */ sculpt_update_tex(sd, ss); - /* add modal handler */ - WM_event_add_modal_handler(C, &CTX_wm_window(C)->handlers, op); - - return OPERATOR_RUNNING_MODAL; + sculpt_update_mesh_elements(C); } static void sculpt_restore_mesh(Sculpt *sd, SculptSession *ss) @@ -1435,157 +1416,67 @@ static void sculpt_flush_update(bContext *C) ED_region_tag_redraw(ar); } -/* Returns zero if no sculpt changes should be made, non-zero otherwise */ -static int sculpt_smooth_stroke(Sculpt *s, SculptSession *ss, float output[2], wmEvent *event) +static int sculpt_stroke_test_start(bContext *C, struct wmOperator *op, wmEvent *event) { - Brush *brush = paint_brush(&s->paint); - - output[0] = event->x; - output[1] = event->y; - - if(brush->flag & BRUSH_SMOOTH_STROKE && brush->sculpt_tool != SCULPT_TOOL_GRAB) { - StrokeCache *cache = ss->cache; - float u = brush->smooth_stroke_factor, v = 1.0 - u; - float dx = cache->mouse[0] - event->x, dy = cache->mouse[1] - event->y; - - /* If the mouse is moving within the radius of the last move, - don't update the mouse position. This allows sharp turns. */ - if(dx*dx + dy*dy < brush->smooth_stroke_radius * brush->smooth_stroke_radius) - return 0; - - output[0] = event->x * v + cache->mouse[0] * u; - output[1] = event->y * v + cache->mouse[1] * u; - } - - return 1; -} - -/* Returns zero if the stroke dots should not be spaced, non-zero otherwise */ -int sculpt_space_stroke_enabled(Sculpt *s) -{ - Brush *br = paint_brush(&s->paint); - return (br->flag & BRUSH_SPACE) && !(br->flag & BRUSH_ANCHORED) && (br->sculpt_tool != SCULPT_TOOL_GRAB); -} - -/* Put the location of the next sculpt stroke dot into the stroke RNA and apply it to the mesh */ -static void sculpt_brush_stroke_add_step(bContext *C, wmOperator *op, wmEvent *event, float mouse[2]) -{ - Sculpt *sd = CTX_data_tool_settings(C)->sculpt; - SculptSession *ss = CTX_data_active_object(C)->sculpt; - StrokeCache *cache = ss->cache; - PointerRNA itemptr; - float cur_depth, pressure = 1; - float center[3]; - - cur_depth = read_cached_depth(&cache->vc, mouse[0], mouse[1]); - unproject(ss->cache->mats, center, mouse[0], mouse[1], cur_depth); - - /* Tablet */ - if(event->custom == EVT_DATA_TABLET) { - wmTabletData *wmtab= event->customdata; - if(wmtab->Active != EVT_TABLET_NONE) - pressure= wmtab->Pressure; - } - - /* Add to stroke */ - RNA_collection_add(op->ptr, "stroke", &itemptr); - RNA_float_set_array(&itemptr, "location", center); - RNA_float_set_array(&itemptr, "mouse", mouse); - RNA_boolean_set(&itemptr, "flip", event->shift); - RNA_float_set(&itemptr, "pressure", pressure); - sculpt_update_cache_variants(sd, ss, &itemptr); - - sculpt_restore_mesh(sd, ss); - do_symmetrical_brush_actions(sd, ss); -} - -/* For brushes with stroke spacing enabled, moves mouse in steps - towards the final mouse location. */ -static int sculpt_space_stroke(bContext *C, wmOperator *op, wmEvent *event, Sculpt *s, SculptSession *ss, const float final_mouse[2]) -{ - StrokeCache *cache = ss->cache; - Brush *brush = paint_brush(&s->paint); - int cnt = 0; - - if(sculpt_space_stroke_enabled(s)) { - float vec[2] = {final_mouse[0] - cache->mouse[0], final_mouse[1] - cache->mouse[1]}; - float mouse[2] = {cache->mouse[0], cache->mouse[1]}; - float length, scale; - int steps = 0, i; - - /* Normalize the vector between the last stroke dot and the goal */ - length = sqrt(vec[0]*vec[0] + vec[1]*vec[1]); - - if(length > FLT_EPSILON) { - scale = brush->spacing / length; - vec[0] *= scale; - vec[1] *= scale; - - steps = (int)(length / brush->spacing); - for(i = 0; i < steps; ++i, ++cnt) { - mouse[0] += vec[0]; - mouse[1] += vec[1]; - sculpt_brush_stroke_add_step(C, op, event, mouse); - } - } - } - - return cnt; -} - -static int sculpt_brush_stroke_modal(bContext *C, wmOperator *op, wmEvent *event) -{ - Sculpt *sd = CTX_data_tool_settings(C)->sculpt; - SculptSession *ss = CTX_data_active_object(C)->sculpt; - ARegion *ar = CTX_wm_region(C); + ViewContext vc; float cur_depth; - sculpt_update_mesh_elements(C); + view3d_set_viewcontext(C, &vc); + cur_depth = read_cached_depth(&vc, event->x, event->y); + + /* Don't start the stroke until a valid depth is found */ + if(cur_depth < 1.0 - FLT_EPSILON) { + SculptSession *ss = CTX_data_active_object(C)->sculpt; - if(!ss->cache) { - ViewContext vc; - view3d_set_viewcontext(C, &vc); - cur_depth = read_cached_depth(&vc, event->x, event->y); + sculpt_brush_stroke_init_properties(C, op, event, ss); + sculptmode_update_all_projverts(ss); - /* Don't start the stroke until a valid depth is found */ - if(cur_depth < 1.0 - FLT_EPSILON) { - sculpt_brush_stroke_init_properties(C, op, event, ss); - sculptmode_update_all_projverts(ss); - } - - ED_region_tag_redraw(ar); + return 1; } + else + return 0; +} - if(ss->cache) { - float mouse[2]; +static void sculpt_stroke_update_step(bContext *C, struct PaintStroke *stroke, PointerRNA *itemptr) +{ + Sculpt *sd = CTX_data_tool_settings(C)->sculpt; + SculptSession *ss = CTX_data_active_object(C)->sculpt; - if(sculpt_smooth_stroke(sd, ss, mouse, event)) { - if(sculpt_space_stroke_enabled(sd)) { - if(!sculpt_space_stroke(C, op, event, sd, ss, mouse)) - ED_region_tag_redraw(ar); - } - else - sculpt_brush_stroke_add_step(C, op, event, mouse); + sculpt_update_cache_variants(sd, ss, itemptr); + sculpt_restore_mesh(sd, ss); + do_symmetrical_brush_actions(sd, ss); - sculpt_flush_update(C); - sculpt_post_stroke_free(ss); - } - else - ED_region_tag_redraw(ar); - } + /* Cleanup */ + sculpt_flush_update(C); // XXX: during exec, shouldn't do this every time + sculpt_post_stroke_free(ss); +} + +static void sculpt_stroke_done(bContext *C, struct PaintStroke *stroke) +{ + SculptSession *ss = CTX_data_active_object(C)->sculpt; /* Finished */ - if(event->type == LEFTMOUSE && event->val == 0) { - if(ss->cache) { - request_depth_update(ss->cache->vc.rv3d); - sculpt_cache_free(ss->cache); - ss->cache = NULL; - sculpt_undo_push(C, sd); - } + if(ss->cache) { + Sculpt *sd = CTX_data_tool_settings(C)->sculpt; - return OPERATOR_FINISHED; + request_depth_update(paint_stroke_view_context(stroke)->rv3d); + sculpt_cache_free(ss->cache); + ss->cache = NULL; + sculpt_undo_push(C, sd); } +} +static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + sculpt_brush_stroke_init(C); + + op->customdata = paint_stroke_new(C, sculpt_stroke_test_start, + sculpt_stroke_update_step, + sculpt_stroke_done); + + /* add modal handler */ + WM_event_add_modal_handler(C, &CTX_wm_window(C)->handlers, op); + return OPERATOR_RUNNING_MODAL; } @@ -1594,10 +1485,10 @@ static int sculpt_brush_stroke_exec(bContext *C, wmOperator *op) Sculpt *sd = CTX_data_tool_settings(C)->sculpt; SculptSession *ss = CTX_data_active_object(C)->sculpt; - view3d_operator_needs_opengl(C); + sculpt_brush_stroke_init(C); + sculpt_update_cache_invariants(sd, ss, C, op); sculptmode_update_all_projverts(ss); - sculpt_update_tex(sd, ss); RNA_BEGIN(op->ptr, itemptr, "stroke") { sculpt_update_cache_variants(sd, ss, &itemptr); @@ -1627,7 +1518,7 @@ static void SCULPT_OT_brush_stroke(wmOperatorType *ot) /* api callbacks */ ot->invoke= sculpt_brush_stroke_invoke; - ot->modal= sculpt_brush_stroke_modal; + ot->modal= paint_stroke_modal; ot->exec= sculpt_brush_stroke_exec; ot->poll= sculpt_poll; diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 58b7a70a128..ce7b6ba454d 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -63,6 +63,7 @@ #include "RE_pipeline.h" // make_stars #include "BIF_gl.h" +#include "BIF_glutil.h" #include "WM_api.h" #include "WM_types.h" @@ -543,6 +544,18 @@ void view3d_get_object_project_mat(RegionView3D *rv3d, Object *ob, float pmat[4] Mat4MulMat4(pmat, vmat, rv3d->winmat); } +/* Uses window coordinates (x,y) and depth component z to find a point in + modelspace */ +void view3d_unproject(bglMats *mats, float out[3], const short x, const short y, const float z) +{ + double ux, uy, uz; + + gluUnProject(x,y,z, mats->modelview, mats->projection, + (GLint *)mats->viewport, &ux, &uy, &uz ); + out[0] = ux; + out[1] = uy; + out[2] = uz; +} /* use above call to get projecting mat */ void view3d_project_float(ARegion *ar, float *vec, float *adr, float mat[4][4]) From 33adf41cac96d87d7977844a5ec36697f85c20a0 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 19 Aug 2009 21:47:47 +0000 Subject: [PATCH 147/577] * CMake fixes, mustn't have come through in the merge --- CMakeLists.txt | 202 ++++++++++++++++++++++++++++--------------------- 1 file changed, 116 insertions(+), 86 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index edbb66290d3..00d2244511f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,22 +53,25 @@ SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib) #----------------------------------------------------------------------------- # Set default config options -OPTION(WITH_PLAYER "Build Player" OFF) -OPTION(WITH_GAMEENGINE "Enable Game Engine" ON) -OPTION(WITH_BULLET "Enable Bullet (Physics Engine)" ON) -OPTION(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON) -OPTION(WITH_ELBEEM "Enable Elbeem (Fluid Simulation)" ON) -OPTION(WITH_QUICKTIME "Enable Quicktime Support" OFF) -OPTION(WITH_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON) -OPTION(WITH_DDS "Enable DDS Support" ON) -OPTION(WITH_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF) -OPTION(WITH_PYTHON "Enable Embedded Python API" ON) -OPTION(WITH_SDL "Enable SDL for sound and joystick support" ON) -OPTION(WITH_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org/)" OFF) -OPTION(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON) -OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OFF) -OPTION(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF) -OPTION(WITH_FFTW3 "Enable FFTW3 support" OFF) +OPTION(WITH_PLAYER "Build Player" OFF) +OPTION(WITH_GAMEENGINE "Enable Game Engine" ON) +OPTION(WITH_BULLET "Enable Bullet (Physics Engine)" ON) +OPTION(WITH_INTERNATIONAL "Enable I18N (International fonts and text)" ON) +OPTION(WITH_ELBEEM "Enable Elbeem (Fluid Simulation)" ON) +OPTION(WITH_QUICKTIME "Enable Quicktime Support" OFF) +OPTION(WITH_OPENEXR "Enable OpenEXR Support (http://www.openexr.com)" ON) +OPTION(WITH_DDS "Enable DDS Support" ON) +OPTION(WITH_FFMPEG "Enable FFMPeg Support (http://ffmpeg.mplayerhq.hu/)" OFF) +OPTION(WITH_PYTHON "Enable Embedded Python API" ON) +OPTION(WITH_SDL "Enable SDL for sound and joystick support" ON) +OPTION(WITH_OPENJPEG "Enable OpenJpeg Support (http://www.openjpeg.org/)" OFF) +OPTION(WITH_OPENAL "Enable OpenAL Support (http://www.openal.org)" ON) +OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OFF) +OPTION(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF) +OPTION(WITH_FFTW3 "Enable FFTW3 support" OFF) +OPTION(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" OFF) +OPTION(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation" OFF) +OPTION(WITH_INSTALL "Install accompanying scripts and language files needed to run blender" ON) IF(NOT WITH_GAMEENGINE AND WITH_PLAYER) MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE") @@ -94,13 +97,18 @@ IF(UNIX AND NOT APPLE) FIND_PACKAGE(OpenAL) IF(OPENAL_FOUND) SET(WITH_OPENAL ON) - SET(OPENAL_LIB ${OPENAL_LIBRARY}) - SET(OPENAL_INC ${OPENAL_INCLUDE_DIR}) ELSE(OPENAL_FOUND) SET(WITH_OPENAL OFF) ENDIF(OPENAL_FOUND) ENDIF(WITH_OPENAL) + IF(WITH_JACK) + SET(JACK /usr) + SET(JACK_INC ${JACK}/include/jack) + SET(JACK_LIB jack) + SET(JACK_LIBPATH ${JACK}/lib) + ENDIF(WITH_JACK) + FIND_LIBRARY(INTL_LIBRARY NAMES intl PATHS @@ -111,34 +119,34 @@ IF(UNIX AND NOT APPLE) PATHS /sw/lib ) + IF(INTL_LIBRARY AND ICONV_LIBRARY) SET(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY}) ENDIF(INTL_LIBRARY AND ICONV_LIBRARY) - - FIND_PATH(FREETYPE_INC - freetype - PATHS - /usr/local/include/freetype2 - /usr/include/freetype2 - /sw/include/freetype2 - /opt/local/include/freetype2 - /opt/csw/include/freetype2 - /opt/include/freetype2 - NO_DEFAULT_PATH - ) - SET(FREETYPE_LIB freetype) - FIND_PACKAGE(PythonLibs) - SET(PYTHON_INC "${PYTHON_INCLUDE_PATH}" CACHE STRING "") - SET(PYTHON_LIB "${PYTHON_LIBRARIES}" CACHE STRING "") - FIND_PACKAGE(PythonInterp) - SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "") + FIND_PACKAGE(Freetype) + # UNSET(FREETYPE_INCLUDE_DIRS CACHE) # cant use + + # No way to set py31. remove for now. + # FIND_PACKAGE(PythonLibs) + SET(PYTHON /usr) + SET(PYTHON_VERSION 3.1) + SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "") + # SET(PYTHON_BINARY python) # not used yet + SET(PYTHON_LIB python${PYTHON_VERSION} CACHE STRING "") + SET(PYTHON_LIBPATH ${PYTHON}/lib CACHE STRING "") + + # FIND_PACKAGE(PythonInterp) # not used yet + # SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "") + SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic") IF(WITH_SDL) FIND_PACKAGE(SDL) - SET(SDL_INC ${SDL_INCLUDE_DIR}) - SET(SDL_LIB ${SDL_LIBRARY}) + # UNSET(SDLMAIN_LIBRARY CACHE) + IF(NOT SDL_FOUND) + SET(WITH_SDL OFF) + ENDIF(NOT SDL_FOUND) ENDIF(WITH_SDL) FIND_PATH(OPENEXR_INC @@ -159,10 +167,10 @@ IF(UNIX AND NOT APPLE) SET(FFMPEG_LIBPATH ${FFMPEG}/lib) IF(WITH_FFTW3) - SET(FFTW3 /usr) - SET(FFTW3_INC ${FFTW3}/include) - SET(FFTW3_LIB fftw3) - SET(FFTW3_LIBPATH ${FFTW3}/lib) + SET(FFTW3 /usr) + SET(FFTW3_INC ${FFTW3}/include) + SET(FFTW3_LIB fftw3) + SET(FFTW3_LIBPATH ${FFTW3}/lib) ENDIF(WITH_FFTW3) SET(LIBSAMPLERATE /usr) @@ -176,7 +184,13 @@ IF(UNIX AND NOT APPLE) FIND_PACKAGE(ZLIB REQUIRED) - SET(LLIBS "-lXi -lutil -lc -lm -lpthread -lstdc++ -lX11 -ldl") + # Could use ${X11_Xinput_LIB} ${X11_X11_LIB} too + SET(LLIBS "-lXi -lutil -lc -lm -lpthread -lstdc++ -lX11") + + IF(CMAKE_SYSTEM_NAME MATCHES "Linux") + # BSD's dont use libdl.so + SET(LLIBS "${LLIBS} -ldl") + ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") IF(WITH_OPENMP) SET(LLIBS "${LLIBS} -lgomp") @@ -191,6 +205,7 @@ IF(UNIX AND NOT APPLE) # Better warnings SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wnested-externs -Wdeclaration-after-statement") + SET(CXX_WARNINGS "-Wall -Wno-invalid-offsetof -Wno-sign-compare") INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ) ENDIF(UNIX AND NOT APPLE) @@ -211,22 +226,29 @@ IF(WIN32) SET(PYTHON ${LIBDIR}/python) SET(PYTHON_VERSION 3.1) SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}") - SET(PYTHON_BINARY python) + # SET(PYTHON_BINARY python) # not used yet SET(PYTHON_LIB python31) SET(PYTHON_LIBPATH ${PYTHON}/lib) IF(CMAKE_CL_64) SET(WITH_OPENAL OFF) ELSE(CMAKE_CL_64) - #SET(WITH_OPENAL ON) - SET(OPENAL ${LIBDIR}/openal) - SET(OPENAL_INC ${OPENAL}/include) - SET(OPENAL_LIB wrap_oal) - SET(OPENAL_LIBPATH ${OPENAL}/lib) + #SET(WITH_OPENAL ON) + SET(OPENAL ${LIBDIR}/openal) + SET(OPENAL_INCLUDE_DIR ${OPENAL}/include) + SET(OPENAL_LIBRARY wrap_oal) + SET(OPENAL_LIBPATH ${OPENAL}/lib) ENDIF(CMAKE_CL_64) + IF(WITH_JACK) + SET(JACK ${LIBDIR}/jack) + SET(JACK_INC ${JACK}/include/jack) + SET(JACK_LIB jack) + SET(JACK_LIBPATH ${JACK}/lib) + ENDIF(WITH_JACK) + IF(CMAKE_CL_64) - SET(PNG_LIBRARIES libpng) + SET(PNG_LIBRARIES libpng) ELSE(CMAKE_CL_64) SET(PNG_LIBRARIES libpng_st) ENDIF(CMAKE_CL_64) @@ -234,7 +256,7 @@ IF(WIN32) SET(ZLIB ${LIBDIR}/zlib) SET(ZLIB_INC ${ZLIB}/include) - SET(ZLIB_LIBRARIES libz) + SET(ZLIB_LIBRARIES zlib) SET(ZLIB_LIBPATH ${ZLIB}/lib) SET(PTHREADS ${LIBDIR}/pthreads) @@ -248,36 +270,36 @@ IF(WIN32) SET(ICONV_LIBPATH ${ICONV}/lib) IF(WITH_FFTW3) - SET(FFTW3 ${LIBDIR}/fftw3) - SET(FFTW3_INC ${FFTW3}/include) - SET(FFTW3_LIB libfftw) - SET(FFTW3_LIBPATH ${FFTW3}/lib) + SET(FFTW3 ${LIBDIR}/fftw3) + SET(FFTW3_INC ${FFTW3}/include) + SET(FFTW3_LIB libfftw) + SET(FFTW3_LIBPATH ${FFTW3}/lib) ENDIF(WITH_FFTW3) SET(GETTEXT ${LIBDIR}/gettext) SET(GETTEXT_INC ${GETTEXT}/include) IF(CMAKE_CL_64) - SET(GETTEXT_LIB gettext) + SET(GETTEXT_LIB gettextlib) ELSE(CMAKE_CL_64) - SET(GETTEXT_LIB gnu_gettext) + SET(GETTEXT_LIB gnu_gettext) ENDIF(CMAKE_CL_64) SET(GETTEXT_LIBPATH ${GETTEXT}/lib) SET(FREETYPE ${LIBDIR}/freetype) - SET(FREETYPE_INC ${FREETYPE}/include ${FREETYPE}/include/freetype2) + SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2) SET(FREETYPE_LIBPATH ${FREETYPE}/lib) - SET(FREETYPE_LIB freetype2ST) + SET(FREETYPE_LIBRARY freetype2ST) SET(OPENEXR ${LIBDIR}/openexr) SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/IlmImf ${OPENEXR}/include/Iex ${OPENEXR}/include/Imath) SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread) IF (MSVC80) - SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005) + SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005) ELSE (MSVC80) - SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc) + SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc) ENDIF(MSVC80) IF (MSVC90) - SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008) + SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008) ENDIF(MSVC90) @@ -297,9 +319,9 @@ IF(WIN32) SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib) IF(CMAKE_CL_64) - SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 ) + SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 ) ELSE(CMAKE_CL_64) - SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm) + SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm) ENDIF(CMAKE_CL_64) SET(CMAKE_CXX_FLAGS_DEBUG "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE) @@ -317,8 +339,8 @@ IF(WIN32) ENDIF(WITH_OPENMP) SET(SDL ${LIBDIR}/sdl) - SET(SDL_INC ${SDL}/include) - SET(SDL_LIB SDL) + SET(SDL_INCLUDE_DIR ${SDL}/include) + SET(SDL_LIBRARY SDL) SET(SDL_LIBPATH ${SDL}/lib) SET(PNG "${LIBDIR}/png") @@ -335,10 +357,11 @@ IF(WIN32) SET(WINTAB_INC ${LIBDIR}/wintab/include) IF(CMAKE_CL_64) - SET(PLATFORM_LINKFLAGS "/MANIFEST:NO /MANIFESTUAC:NO /MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ") + SET(PLATFORM_LINKFLAGS "/MANIFEST:NO /MANIFESTUAC:NO /MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ") ELSE(CMAKE_CL_64) - SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ") + SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ") ENDIF(CMAKE_CL_64) + SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ") ENDIF(WIN32) @@ -353,13 +376,17 @@ IF(APPLE) FIND_PACKAGE(OpenAL) IF(OPENAL_FOUND) SET(WITH_OPENAL ON) - SET(OPENAL_LIB ${OPENAL_LIBRARY}) - SET(OPENAL_INC ${OPENAL_INCLUDE_DIR}) ELSE(OPENAL_FOUND) SET(WITH_OPENAL OFF) ENDIF(OPENAL_FOUND) ENDIF(WITH_OPENAL) + IF(WITH_JACK) + SET(JACK /usr) + SET(JACK_INC ${JACK}/include/jack) + SET(JACK_LIB jack) + SET(JACK_LIBPATH ${JACK}/lib) + ENDIF(WITH_JACK) SET(PYTHON_VERSION 3.1) @@ -368,7 +395,7 @@ IF(APPLE) SET(PYTHON ${LIBDIR}/python) SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "") - SET(PYTHON_BINARY "${PYTHON}/bin/python${PYTHON_VERSION}" CACHE STRING "") + # SET(PYTHON_BINARY "${PYTHON}/bin/python${PYTHON_VERSION}" CACHE STRING "") # not used yet SET(PYTHON_LIB python${PYTHON_VERSION}) SET(PYTHON_LIBPATH "${PYTHON}/lib/python${PYTHON_VERSION}" CACHE STRING "") # SET(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled @@ -378,7 +405,7 @@ IF(APPLE) SET(PYTHON /System/Library/Frameworks/Python.framework/Versions/) SET(PYTHON_VERSION 2.5) SET(PYTHON_INC "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}" CACHE STRING "") - SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION} CACHE STRING "") + # SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION} CACHE STRING "") # not used yet SET(PYTHON_LIB "") SET(PYTHON_LIBPATH ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config CACHE STRING "") SET(PYTHON_LINKFLAGS "-u _PyMac_Error -framework System -framework Python") @@ -391,9 +418,9 @@ IF(APPLE) IF(WITH_FFTW3) SET(FFTW3 ${LIBDIR}/fftw3) - SET(FFTW3_INC ${FFTW3}/include) - SET(FFTW3_LIB libfftw) - SET(FFTW3_LIBPATH ${FFTW3}/lib) + SET(FFTW3_INC ${FFTW3}/include) + SET(FFTW3_LIB libfftw) + SET(FFTW3_LIBPATH ${FFTW3}/lib) ENDIF(WITH_FFTW3) SET(PNG_LIBRARIES png) @@ -404,9 +431,9 @@ IF(APPLE) SET(ZLIB_LIBRARIES z) SET(FREETYPE ${LIBDIR}/freetype) - SET(FREETYPE_INC ${FREETYPE}/include ${FREETYPE}/include/freetype2) + SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2) SET(FREETYPE_LIBPATH ${FREETYPE}/lib) - SET(FREETYPE_LIB freetype) + SET(FREETYPE_LIBRARY freetype) SET(OPENEXR ${LIBDIR}/openexr) SET(OPENEXR_INC ${OPENEXR}/include/OpenEXR ${OPENEXR}/include) @@ -435,8 +462,8 @@ IF(APPLE) ENDIF(WITH_OPENMP) SET(SDL ${LIBDIR}/sdl) - SET(SDL_INC ${SDL}/include) - SET(SDL_LIB SDL) + SET(SDL_INCLUDE_DIR ${SDL}/include) + SET(SDL_LIBRARY SDL) SET(SDL_LIBPATH ${SDL}/lib) SET(PNG "${LIBDIR}/png") @@ -480,16 +507,18 @@ ENDIF(WITH_WEBPLUGIN) # Configure OpenGL. FIND_PACKAGE(OpenGL) INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR}) +# UNSET(OPENGL_LIBRARIES CACHE) # not compat with older cmake +# UNSET(OPENGL_xmesa_INCLUDE_DIR CACHE) # not compat with older cmake + #----------------------------------------------------------------------------- # Extra compile flags -IF(WITH_GAMEENGINE) - SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DGAMEBLENDER ") -ENDIF(WITH_GAMEENGINE) -IF(WITH_BULLET) - SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DWITH_BULLET ") -ENDIF(WITH_BULLET) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ${C_WARNINGS}") -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ") +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ${CXX_WARNINGS}") + +# better not define flags here but this is a debugging option thats off by default. +IF(WITH_CXX_GUARDEDALLOC) + SET(CMAKE_CXX_FLAGS " -DWITH_CXX_GUARDEDALLOC -I${CMAKE_SOURCE_DIR}/intern/guardedalloc ${CMAKE_CXX_FLAGS}") +ENDIF(WITH_CXX_GUARDEDALLOC) #----------------------------------------------------------------------------- # Libraries @@ -509,3 +538,4 @@ ADD_SUBDIRECTORY(source/creator) IF(WITH_PLAYER) ADD_SUBDIRECTORY(blenderplayer) ENDIF(WITH_PLAYER) + From fa5838c7be5a3eb64df90d5cc17f15ed997743ba Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 19 Aug 2009 21:48:09 +0000 Subject: [PATCH 148/577] * volume rendering cleanups and optimisations --- .../blender/render/intern/source/volumetric.c | 52 ++++++++++--------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 3c3827d8baf..8a714aef992 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -234,6 +234,23 @@ float vol_get_phasefunc(ShadeInput *shi, short phasefunc_type, float g, float *w } } +/* Compute attenuation, otherwise known as 'optical thickness', extinction, or tau. + * Used in the relationship Transmittance = e^(-attenuation) + */ +void vol_get_attenuation_seg(ShadeInput *shi, float *tau, float *stepvec, float *co, float density) +{ + /* input density = density at co */ + float absorb_col[3]; + const float dist = VecLength(stepvec); + + vol_get_absorption(shi, absorb_col, co); + + /* homogenous volume within the sampled distance */ + tau[0] = tau[1] = tau[2] = dist * density; + + VecMulVecf(tau, tau, absorb_col); +} + /* Compute attenuation, otherwise known as 'optical thickness', extinction, or tau. * Used in the relationship Transmittance = e^(-attenuation) */ @@ -249,18 +266,7 @@ void vol_get_attenuation(ShadeInput *shi, float *tau, float *co, float *endco, f nsteps = (int)((dist / stepsize) + 0.5); - /* trigger for recalculating density */ - if (density < -0.001f) density = vol_get_density(shi, co); - - if (nsteps == 1) { - /* homogenous volume within the sampled distance */ - tau[0] = tau[1] = tau[2] = dist * density; - - VecMulVecf(tau, tau, absorb_col); - return; - } else { - tau[0] = tau[1] = tau[2] = 0.0; - } + tau[0] = tau[1] = tau[2] = 0.0; VecSubf(step_vec, endco, co); VecMulf(step_vec, 1.0f / nsteps); @@ -402,22 +408,14 @@ outgoing radiance from behind surface * beam transmittance/attenuation static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float *endco) { float tr[3] = {1.0f, 1.0f, 1.0f}; - float radiance[3] = {0.f, 0.f, 0.f}, d_radiance[3] = {0.f, 0.f, 0.f}; + float radiance[3] = {0.f, 0.f, 0.f}, d_radiance[3] = {0.f, 0.f, 0.f}, radiance_behind[3]; float stepsize = vol_get_stepsize(shi, STEPSIZE_VIEW); int nsteps, s; float tau[3], emit_col[3], scatter_col[3] = {0.0, 0.0, 0.0}; float stepvec[3], step_sta[3], step_end[3], step_mid[3]; - float density = vol_get_density(shi, co); + float density; const float depth_cutoff = shi->mat->vol.depth_cutoff; - - /* multiply col_behind with beam transmittance over entire distance */ - vol_get_attenuation(shi, tau, co, endco, density, stepsize); - tr[0] *= exp(-tau[0]); - tr[1] *= exp(-tau[1]); - tr[2] *= exp(-tau[2]); - VecMulVecf(radiance, tr, col); - tr[0] = tr[1] = tr[2] = 1.0f; - + /* ray marching */ nsteps = (int)((VecLenf(co, endco) / stepsize) + 0.5); @@ -429,13 +427,13 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float /* get radiance from all points along the ray due to participating media */ for (s = 0; s < nsteps; s++) { - if (s > 0) density = vol_get_density(shi, step_sta); + density = vol_get_density(shi, step_sta); /* there's only any use in shading here if there's actually some density to shade! */ if (density > 0.01f) { /* transmittance component (alpha) */ - vol_get_attenuation(shi, tau, step_sta, step_end, density, stepsize); + vol_get_attenuation_seg(shi, tau, stepvec, co, density); tr[0] *= exp(-tau[0]); tr[1] *= exp(-tau[1]); tr[2] *= exp(-tau[2]); @@ -469,6 +467,10 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float if ((0.2126*tr[0] + 0.7152*tr[1] + 0.0722*tr[2]) < depth_cutoff) break; } + /* multiply original color (behind volume) with beam transmittance over entire distance */ + VecMulVecf(radiance_behind, tr, col); + VecAddf(radiance, radiance, radiance_behind); + VecCopyf(col, radiance); col[3] = 1.0f -(tr[0] + tr[1] + tr[2]) * 0.333f; } From 286c2ca80be4ae46dc220ada2fcc5bf636d5ff49 Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Thu, 20 Aug 2009 00:33:59 +0000 Subject: [PATCH 149/577] Smoke: * cache for low res (deactivating high res for now) * new way of view3d rendering of smoke (no longer 3 axes) -using 3dtexture now (introduced into gpu/intern) * introducing LZO and LZMA libs into extern (makefiles missing for now) * reducing memory usage after simulating for the frame ended (freeing temporary buffers) * splitting smoke into 2 modifier for the cache-sake (it cannot handle more than 1 cache on the same modifier-index) * no color on gui anymore * fixing non-power-of-2 resolutions (hopefully) * fixing select-deselect of domain drawing bug * fixing drawobject.c coding style (making Ton happy) ;-) HINT #1: If scons doesn't work -> cmakefiles are up-to-date, couldn't test scons (but i tried to mantain them, too) CODERS HINT #1: we really need a way to disable adding all modifiers through "Add Modifiers" dropdown! WARNING #1: before applying this commit, deactivate your SMOKE DOMAIN in your old files and save them then. You can open them then savely after that. WARNING #2: File and cache format of smoke can be changed, this is not final! --- extern/CMakeLists.txt | 3 + extern/SConscript | 4 +- extern/lzma/7zBuf.c | 36 + extern/lzma/7zBuf.h | 31 + extern/lzma/7zBuf2.c | 45 + extern/lzma/7zCrc.c | 35 + extern/lzma/7zCrc.h | 24 + extern/lzma/7zFile.c | 263 ++ extern/lzma/7zFile.h | 74 + extern/lzma/7zStream.c | 169 + extern/lzma/7zVersion.h | 7 + extern/lzma/Alloc.c | 127 + extern/lzma/Alloc.h | 32 + extern/lzma/Bcj2.c | 132 + extern/lzma/Bcj2.h | 30 + extern/lzma/Bra.c | 133 + extern/lzma/Bra.h | 60 + extern/lzma/Bra86.c | 85 + extern/lzma/BraIA64.c | 67 + extern/lzma/CMakeLists.txt | 34 + extern/lzma/CpuArch.h | 69 + extern/lzma/LzFind.c | 751 +++ extern/lzma/LzFind.h | 107 + extern/lzma/LzFindMt.c | 793 ++++ extern/lzma/LzFindMt.h | 97 + extern/lzma/LzHash.h | 54 + extern/lzma/LzmaDec.c | 1007 ++++ extern/lzma/LzmaDec.h | 223 + extern/lzma/LzmaEnc.c | 2281 +++++++++ extern/lzma/LzmaEnc.h | 72 + extern/lzma/LzmaLib.c | 46 + extern/lzma/LzmaLib.h | 135 + extern/lzma/Threads.c | 109 + extern/lzma/Threads.h | 68 + extern/lzma/Types.h | 208 + extern/lzma/history.txt | 236 + extern/lzma/lzma.txt | 594 +++ extern/lzo/CMakeLists.txt | 34 + extern/lzo/SConscript | 9 + extern/lzo/minilzo/COPYING | 340 ++ extern/lzo/minilzo/Makefile | 113 + extern/lzo/minilzo/README.LZO | 123 + extern/lzo/minilzo/lzoconf.h | 417 ++ extern/lzo/minilzo/lzodefs.h | 1807 ++++++++ extern/lzo/minilzo/minilzo.c | 4112 +++++++++++++++++ extern/lzo/minilzo/minilzo.h | 112 + intern/smoke/extern/smoke_API.h | 15 +- intern/smoke/intern/FLUID_3D.cpp | 79 +- intern/smoke/intern/FLUID_3D.h | 17 +- intern/smoke/intern/FLUID_3D_SOLVERS.cpp | 24 + intern/smoke/intern/WTURBULENCE.cpp | 481 +- intern/smoke/intern/WTURBULENCE.h | 21 +- intern/smoke/intern/smoke_API.cpp | 51 +- release/ui/buttons_physics_smoke.py | 215 +- source/blender/blenkernel/BKE_pointcache.h | 6 +- source/blender/blenkernel/BKE_smoke.h | 17 +- source/blender/blenkernel/CMakeLists.txt | 2 + source/blender/blenkernel/SConscript | 2 + source/blender/blenkernel/intern/modifier.c | 79 +- source/blender/blenkernel/intern/pointcache.c | 271 +- source/blender/blenkernel/intern/smoke.c | 1155 +++-- .../blender/blenkernel/intern/smokehighres.c | 137 + source/blender/blenlib/BLI_winstuff.h | 30 +- source/blender/blenloader/intern/readfile.c | 21 +- source/blender/blenloader/intern/writefile.c | 9 +- .../blender/editors/object/object_modifier.c | 7 + .../editors/space_buttons/buttons_context.c | 12 +- .../blender/editors/space_view3d/drawobject.c | 362 +- .../blender/editors/space_view3d/drawvolume.c | 304 ++ .../editors/space_view3d/view3d_intern.h | 3 + source/blender/gpu/GPU_draw.h | 4 + source/blender/gpu/GPU_extensions.h | 1 + source/blender/gpu/intern/gpu_draw.c | 19 + source/blender/gpu/intern/gpu_extensions.c | 72 + source/blender/makesdna/DNA_modifier_types.h | 30 +- source/blender/makesdna/DNA_smoke_types.h | 34 +- source/blender/makesrna/RNA_access.h | 1 + source/blender/makesrna/intern/rna_modifier.c | 70 +- source/blender/makesrna/intern/rna_smoke.c | 85 +- source/creator/CMakeLists.txt | 2 + 80 files changed, 17406 insertions(+), 1540 deletions(-) create mode 100644 extern/lzma/7zBuf.c create mode 100644 extern/lzma/7zBuf.h create mode 100644 extern/lzma/7zBuf2.c create mode 100644 extern/lzma/7zCrc.c create mode 100644 extern/lzma/7zCrc.h create mode 100644 extern/lzma/7zFile.c create mode 100644 extern/lzma/7zFile.h create mode 100644 extern/lzma/7zStream.c create mode 100644 extern/lzma/7zVersion.h create mode 100644 extern/lzma/Alloc.c create mode 100644 extern/lzma/Alloc.h create mode 100644 extern/lzma/Bcj2.c create mode 100644 extern/lzma/Bcj2.h create mode 100644 extern/lzma/Bra.c create mode 100644 extern/lzma/Bra.h create mode 100644 extern/lzma/Bra86.c create mode 100644 extern/lzma/BraIA64.c create mode 100644 extern/lzma/CMakeLists.txt create mode 100644 extern/lzma/CpuArch.h create mode 100644 extern/lzma/LzFind.c create mode 100644 extern/lzma/LzFind.h create mode 100644 extern/lzma/LzFindMt.c create mode 100644 extern/lzma/LzFindMt.h create mode 100644 extern/lzma/LzHash.h create mode 100644 extern/lzma/LzmaDec.c create mode 100644 extern/lzma/LzmaDec.h create mode 100644 extern/lzma/LzmaEnc.c create mode 100644 extern/lzma/LzmaEnc.h create mode 100644 extern/lzma/LzmaLib.c create mode 100644 extern/lzma/LzmaLib.h create mode 100644 extern/lzma/Threads.c create mode 100644 extern/lzma/Threads.h create mode 100644 extern/lzma/Types.h create mode 100644 extern/lzma/history.txt create mode 100644 extern/lzma/lzma.txt create mode 100644 extern/lzo/CMakeLists.txt create mode 100644 extern/lzo/SConscript create mode 100644 extern/lzo/minilzo/COPYING create mode 100644 extern/lzo/minilzo/Makefile create mode 100644 extern/lzo/minilzo/README.LZO create mode 100644 extern/lzo/minilzo/lzoconf.h create mode 100644 extern/lzo/minilzo/lzodefs.h create mode 100644 extern/lzo/minilzo/minilzo.c create mode 100644 extern/lzo/minilzo/minilzo.h create mode 100644 source/blender/blenkernel/intern/smokehighres.c create mode 100644 source/blender/editors/space_view3d/drawvolume.c diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index b6cfe3b113e..019cd9de28b 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -37,3 +37,6 @@ ADD_SUBDIRECTORY(glew) IF(WITH_OPENJPEG) ADD_SUBDIRECTORY(libopenjpeg) ENDIF(WITH_OPENJPEG) + +ADD_SUBDIRECTORY(lzo) +ADD_SUBDIRECTORY(lzma) diff --git a/extern/SConscript b/extern/SConscript index 175613c3d2b..20604d87e45 100644 --- a/extern/SConscript +++ b/extern/SConscript @@ -22,5 +22,5 @@ if env['WITH_BF_REDCODE'] and env['BF_REDCODE_LIB'] == '': if env['OURPLATFORM'] == 'linux2': SConscript(['binreloc/SConscript']); -# FFTW not needed atm - dg -# SConscript(['fftw/SConscript']) +SConscript(['lzo/SConscript']) +SConscript(['lzma/SConscript']) diff --git a/extern/lzma/7zBuf.c b/extern/lzma/7zBuf.c new file mode 100644 index 00000000000..14e7f4e2b92 --- /dev/null +++ b/extern/lzma/7zBuf.c @@ -0,0 +1,36 @@ +/* 7zBuf.c -- Byte Buffer +2008-03-28 +Igor Pavlov +Public domain */ + +#include "7zBuf.h" + +void Buf_Init(CBuf *p) +{ + p->data = 0; + p->size = 0; +} + +int Buf_Create(CBuf *p, size_t size, ISzAlloc *alloc) +{ + p->size = 0; + if (size == 0) + { + p->data = 0; + return 1; + } + p->data = (Byte *)alloc->Alloc(alloc, size); + if (p->data != 0) + { + p->size = size; + return 1; + } + return 0; +} + +void Buf_Free(CBuf *p, ISzAlloc *alloc) +{ + alloc->Free(alloc, p->data); + p->data = 0; + p->size = 0; +} diff --git a/extern/lzma/7zBuf.h b/extern/lzma/7zBuf.h new file mode 100644 index 00000000000..c5bd71879cc --- /dev/null +++ b/extern/lzma/7zBuf.h @@ -0,0 +1,31 @@ +/* 7zBuf.h -- Byte Buffer +2008-10-04 : Igor Pavlov : Public domain */ + +#ifndef __7Z_BUF_H +#define __7Z_BUF_H + +#include "Types.h" + +typedef struct +{ + Byte *data; + size_t size; +} CBuf; + +void Buf_Init(CBuf *p); +int Buf_Create(CBuf *p, size_t size, ISzAlloc *alloc); +void Buf_Free(CBuf *p, ISzAlloc *alloc); + +typedef struct +{ + Byte *data; + size_t size; + size_t pos; +} CDynBuf; + +void DynBuf_Construct(CDynBuf *p); +void DynBuf_SeekToBeg(CDynBuf *p); +int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAlloc *alloc); +void DynBuf_Free(CDynBuf *p, ISzAlloc *alloc); + +#endif diff --git a/extern/lzma/7zBuf2.c b/extern/lzma/7zBuf2.c new file mode 100644 index 00000000000..8d17e0dcf80 --- /dev/null +++ b/extern/lzma/7zBuf2.c @@ -0,0 +1,45 @@ +/* 7zBuf2.c -- Byte Buffer +2008-10-04 : Igor Pavlov : Public domain */ + +#include +#include "7zBuf.h" + +void DynBuf_Construct(CDynBuf *p) +{ + p->data = 0; + p->size = 0; + p->pos = 0; +} + +void DynBuf_SeekToBeg(CDynBuf *p) +{ + p->pos = 0; +} + +int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAlloc *alloc) +{ + if (size > p->size - p->pos) + { + size_t newSize = p->pos + size; + Byte *data; + newSize += newSize / 4; + data = (Byte *)alloc->Alloc(alloc, newSize); + if (data == 0) + return 0; + p->size = newSize; + memcpy(data, p->data, p->pos); + alloc->Free(alloc, p->data); + p->data = data; + } + memcpy(p->data + p->pos, buf, size); + p->pos += size; + return 1; +} + +void DynBuf_Free(CDynBuf *p, ISzAlloc *alloc) +{ + alloc->Free(alloc, p->data); + p->data = 0; + p->size = 0; + p->pos = 0; +} diff --git a/extern/lzma/7zCrc.c b/extern/lzma/7zCrc.c new file mode 100644 index 00000000000..71962b2c28d --- /dev/null +++ b/extern/lzma/7zCrc.c @@ -0,0 +1,35 @@ +/* 7zCrc.c -- CRC32 calculation +2008-08-05 +Igor Pavlov +Public domain */ + +#include "7zCrc.h" + +#define kCrcPoly 0xEDB88320 +UInt32 g_CrcTable[256]; + +void MY_FAST_CALL CrcGenerateTable(void) +{ + UInt32 i; + for (i = 0; i < 256; i++) + { + UInt32 r = i; + int j; + for (j = 0; j < 8; j++) + r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1)); + g_CrcTable[i] = r; + } +} + +UInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void *data, size_t size) +{ + const Byte *p = (const Byte *)data; + for (; size > 0 ; size--, p++) + v = CRC_UPDATE_BYTE(v, *p); + return v; +} + +UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size) +{ + return CrcUpdate(CRC_INIT_VAL, data, size) ^ 0xFFFFFFFF; +} diff --git a/extern/lzma/7zCrc.h b/extern/lzma/7zCrc.h new file mode 100644 index 00000000000..00dc29cee3c --- /dev/null +++ b/extern/lzma/7zCrc.h @@ -0,0 +1,24 @@ +/* 7zCrc.h -- CRC32 calculation +2008-03-13 +Igor Pavlov +Public domain */ + +#ifndef __7Z_CRC_H +#define __7Z_CRC_H + +#include + +#include "Types.h" + +extern UInt32 g_CrcTable[]; + +void MY_FAST_CALL CrcGenerateTable(void); + +#define CRC_INIT_VAL 0xFFFFFFFF +#define CRC_GET_DIGEST(crc) ((crc) ^ 0xFFFFFFFF) +#define CRC_UPDATE_BYTE(crc, b) (g_CrcTable[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8)) + +UInt32 MY_FAST_CALL CrcUpdate(UInt32 crc, const void *data, size_t size); +UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size); + +#endif diff --git a/extern/lzma/7zFile.c b/extern/lzma/7zFile.c new file mode 100644 index 00000000000..9a44c59ac0c --- /dev/null +++ b/extern/lzma/7zFile.c @@ -0,0 +1,263 @@ +/* 7zFile.c -- File IO +2008-11-22 : Igor Pavlov : Public domain */ + +#include "7zFile.h" + +#ifndef USE_WINDOWS_FILE + +#include + +#endif + +#ifdef USE_WINDOWS_FILE + +/* + ReadFile and WriteFile functions in Windows have BUG: + If you Read or Write 64MB or more (probably min_failure_size = 64MB - 32KB + 1) + from/to Network file, it returns ERROR_NO_SYSTEM_RESOURCES + (Insufficient system resources exist to complete the requested service). + Probably in some version of Windows there are problems with other sizes: + for 32 MB (maybe also for 16 MB). + And message can be "Network connection was lost" +*/ + +#define kChunkSizeMax (1 << 22) + +#endif + +void File_Construct(CSzFile *p) +{ + #ifdef USE_WINDOWS_FILE + p->handle = INVALID_HANDLE_VALUE; + #else + p->file = NULL; + #endif +} + +static WRes File_Open(CSzFile *p, const char *name, int writeMode) +{ + #ifdef USE_WINDOWS_FILE + p->handle = CreateFileA(name, + writeMode ? GENERIC_WRITE : GENERIC_READ, + FILE_SHARE_READ, NULL, + writeMode ? CREATE_ALWAYS : OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, NULL); + return (p->handle != INVALID_HANDLE_VALUE) ? 0 : GetLastError(); + #else + p->file = fopen(name, writeMode ? "wb+" : "rb"); + return (p->file != 0) ? 0 : errno; + #endif +} + +WRes InFile_Open(CSzFile *p, const char *name) { return File_Open(p, name, 0); } +WRes OutFile_Open(CSzFile *p, const char *name) { return File_Open(p, name, 1); } + +WRes File_Close(CSzFile *p) +{ + #ifdef USE_WINDOWS_FILE + if (p->handle != INVALID_HANDLE_VALUE) + { + if (!CloseHandle(p->handle)) + return GetLastError(); + p->handle = INVALID_HANDLE_VALUE; + } + #else + if (p->file != NULL) + { + int res = fclose(p->file); + if (res != 0) + return res; + p->file = NULL; + } + #endif + return 0; +} + +WRes File_Read(CSzFile *p, void *data, size_t *size) +{ + size_t originalSize = *size; + if (originalSize == 0) + return 0; + + #ifdef USE_WINDOWS_FILE + + *size = 0; + do + { + DWORD curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : (DWORD)originalSize; + DWORD processed = 0; + BOOL res = ReadFile(p->handle, data, curSize, &processed, NULL); + data = (void *)((Byte *)data + processed); + originalSize -= processed; + *size += processed; + if (!res) + return GetLastError(); + if (processed == 0) + break; + } + while (originalSize > 0); + return 0; + + #else + + *size = fread(data, 1, originalSize, p->file); + if (*size == originalSize) + return 0; + return ferror(p->file); + + #endif +} + +WRes File_Write(CSzFile *p, const void *data, size_t *size) +{ + size_t originalSize = *size; + if (originalSize == 0) + return 0; + + #ifdef USE_WINDOWS_FILE + + *size = 0; + do + { + DWORD curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : (DWORD)originalSize; + DWORD processed = 0; + BOOL res = WriteFile(p->handle, data, curSize, &processed, NULL); + data = (void *)((Byte *)data + processed); + originalSize -= processed; + *size += processed; + if (!res) + return GetLastError(); + if (processed == 0) + break; + } + while (originalSize > 0); + return 0; + + #else + + *size = fwrite(data, 1, originalSize, p->file); + if (*size == originalSize) + return 0; + return ferror(p->file); + + #endif +} + +WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin) +{ + #ifdef USE_WINDOWS_FILE + + LARGE_INTEGER value; + DWORD moveMethod; + value.LowPart = (DWORD)*pos; + value.HighPart = (LONG)((UInt64)*pos >> 16 >> 16); /* for case when UInt64 is 32-bit only */ + switch (origin) + { + case SZ_SEEK_SET: moveMethod = FILE_BEGIN; break; + case SZ_SEEK_CUR: moveMethod = FILE_CURRENT; break; + case SZ_SEEK_END: moveMethod = FILE_END; break; + default: return ERROR_INVALID_PARAMETER; + } + value.LowPart = SetFilePointer(p->handle, value.LowPart, &value.HighPart, moveMethod); + if (value.LowPart == 0xFFFFFFFF) + { + WRes res = GetLastError(); + if (res != NO_ERROR) + return res; + } + *pos = ((Int64)value.HighPart << 32) | value.LowPart; + return 0; + + #else + + int moveMethod; + int res; + switch (origin) + { + case SZ_SEEK_SET: moveMethod = SEEK_SET; break; + case SZ_SEEK_CUR: moveMethod = SEEK_CUR; break; + case SZ_SEEK_END: moveMethod = SEEK_END; break; + default: return 1; + } + res = fseek(p->file, (long)*pos, moveMethod); + *pos = ftell(p->file); + return res; + + #endif +} + +WRes File_GetLength(CSzFile *p, UInt64 *length) +{ + #ifdef USE_WINDOWS_FILE + + DWORD sizeHigh; + DWORD sizeLow = GetFileSize(p->handle, &sizeHigh); + if (sizeLow == 0xFFFFFFFF) + { + DWORD res = GetLastError(); + if (res != NO_ERROR) + return res; + } + *length = (((UInt64)sizeHigh) << 32) + sizeLow; + return 0; + + #else + + long pos = ftell(p->file); + int res = fseek(p->file, 0, SEEK_END); + *length = ftell(p->file); + fseek(p->file, pos, SEEK_SET); + return res; + + #endif +} + + +/* ---------- FileSeqInStream ---------- */ + +static SRes FileSeqInStream_Read(void *pp, void *buf, size_t *size) +{ + CFileSeqInStream *p = (CFileSeqInStream *)pp; + return File_Read(&p->file, buf, size) == 0 ? SZ_OK : SZ_ERROR_READ; +} + +void FileSeqInStream_CreateVTable(CFileSeqInStream *p) +{ + p->s.Read = FileSeqInStream_Read; +} + + +/* ---------- FileInStream ---------- */ + +static SRes FileInStream_Read(void *pp, void *buf, size_t *size) +{ + CFileInStream *p = (CFileInStream *)pp; + return (File_Read(&p->file, buf, size) == 0) ? SZ_OK : SZ_ERROR_READ; +} + +static SRes FileInStream_Seek(void *pp, Int64 *pos, ESzSeek origin) +{ + CFileInStream *p = (CFileInStream *)pp; + return File_Seek(&p->file, pos, origin); +} + +void FileInStream_CreateVTable(CFileInStream *p) +{ + p->s.Read = FileInStream_Read; + p->s.Seek = FileInStream_Seek; +} + + +/* ---------- FileOutStream ---------- */ + +static size_t FileOutStream_Write(void *pp, const void *data, size_t size) +{ + CFileOutStream *p = (CFileOutStream *)pp; + File_Write(&p->file, data, &size); + return size; +} + +void FileOutStream_CreateVTable(CFileOutStream *p) +{ + p->s.Write = FileOutStream_Write; +} diff --git a/extern/lzma/7zFile.h b/extern/lzma/7zFile.h new file mode 100644 index 00000000000..fbef6837f86 --- /dev/null +++ b/extern/lzma/7zFile.h @@ -0,0 +1,74 @@ +/* 7zFile.h -- File IO +2008-11-22 : Igor Pavlov : Public domain */ + +#ifndef __7Z_FILE_H +#define __7Z_FILE_H + +#ifdef _WIN32 +#define USE_WINDOWS_FILE +#endif + +#ifdef USE_WINDOWS_FILE +#include +#else +#include +#endif + +#include "Types.h" + + +/* ---------- File ---------- */ + +typedef struct +{ + #ifdef USE_WINDOWS_FILE + HANDLE handle; + #else + FILE *file; + #endif +} CSzFile; + +void File_Construct(CSzFile *p); +WRes InFile_Open(CSzFile *p, const char *name); +WRes OutFile_Open(CSzFile *p, const char *name); +WRes File_Close(CSzFile *p); + +/* reads max(*size, remain file's size) bytes */ +WRes File_Read(CSzFile *p, void *data, size_t *size); + +/* writes *size bytes */ +WRes File_Write(CSzFile *p, const void *data, size_t *size); + +WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin); +WRes File_GetLength(CSzFile *p, UInt64 *length); + + +/* ---------- FileInStream ---------- */ + +typedef struct +{ + ISeqInStream s; + CSzFile file; +} CFileSeqInStream; + +void FileSeqInStream_CreateVTable(CFileSeqInStream *p); + + +typedef struct +{ + ISeekInStream s; + CSzFile file; +} CFileInStream; + +void FileInStream_CreateVTable(CFileInStream *p); + + +typedef struct +{ + ISeqOutStream s; + CSzFile file; +} CFileOutStream; + +void FileOutStream_CreateVTable(CFileOutStream *p); + +#endif diff --git a/extern/lzma/7zStream.c b/extern/lzma/7zStream.c new file mode 100644 index 00000000000..86232aa3411 --- /dev/null +++ b/extern/lzma/7zStream.c @@ -0,0 +1,169 @@ +/* 7zStream.c -- 7z Stream functions +2008-11-23 : Igor Pavlov : Public domain */ + +#include + +#include "Types.h" + +SRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType) +{ + while (size != 0) + { + size_t processed = size; + RINOK(stream->Read(stream, buf, &processed)); + if (processed == 0) + return errorType; + buf = (void *)((Byte *)buf + processed); + size -= processed; + } + return SZ_OK; +} + +SRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size) +{ + return SeqInStream_Read2(stream, buf, size, SZ_ERROR_INPUT_EOF); +} + +SRes SeqInStream_ReadByte(ISeqInStream *stream, Byte *buf) +{ + size_t processed = 1; + RINOK(stream->Read(stream, buf, &processed)); + return (processed == 1) ? SZ_OK : SZ_ERROR_INPUT_EOF; +} + +SRes LookInStream_SeekTo(ILookInStream *stream, UInt64 offset) +{ + Int64 t = offset; + return stream->Seek(stream, &t, SZ_SEEK_SET); +} + +SRes LookInStream_LookRead(ILookInStream *stream, void *buf, size_t *size) +{ + void *lookBuf; + if (*size == 0) + return SZ_OK; + RINOK(stream->Look(stream, &lookBuf, size)); + memcpy(buf, lookBuf, *size); + return stream->Skip(stream, *size); +} + +SRes LookInStream_Read2(ILookInStream *stream, void *buf, size_t size, SRes errorType) +{ + while (size != 0) + { + size_t processed = size; + RINOK(stream->Read(stream, buf, &processed)); + if (processed == 0) + return errorType; + buf = (void *)((Byte *)buf + processed); + size -= processed; + } + return SZ_OK; +} + +SRes LookInStream_Read(ILookInStream *stream, void *buf, size_t size) +{ + return LookInStream_Read2(stream, buf, size, SZ_ERROR_INPUT_EOF); +} + +static SRes LookToRead_Look_Lookahead(void *pp, void **buf, size_t *size) +{ + SRes res = SZ_OK; + CLookToRead *p = (CLookToRead *)pp; + size_t size2 = p->size - p->pos; + if (size2 == 0 && *size > 0) + { + p->pos = 0; + size2 = LookToRead_BUF_SIZE; + res = p->realStream->Read(p->realStream, p->buf, &size2); + p->size = size2; + } + if (size2 < *size) + *size = size2; + *buf = p->buf + p->pos; + return res; +} + +static SRes LookToRead_Look_Exact(void *pp, void **buf, size_t *size) +{ + SRes res = SZ_OK; + CLookToRead *p = (CLookToRead *)pp; + size_t size2 = p->size - p->pos; + if (size2 == 0 && *size > 0) + { + p->pos = 0; + if (*size > LookToRead_BUF_SIZE) + *size = LookToRead_BUF_SIZE; + res = p->realStream->Read(p->realStream, p->buf, size); + size2 = p->size = *size; + } + if (size2 < *size) + *size = size2; + *buf = p->buf + p->pos; + return res; +} + +static SRes LookToRead_Skip(void *pp, size_t offset) +{ + CLookToRead *p = (CLookToRead *)pp; + p->pos += offset; + return SZ_OK; +} + +static SRes LookToRead_Read(void *pp, void *buf, size_t *size) +{ + CLookToRead *p = (CLookToRead *)pp; + size_t rem = p->size - p->pos; + if (rem == 0) + return p->realStream->Read(p->realStream, buf, size); + if (rem > *size) + rem = *size; + memcpy(buf, p->buf + p->pos, rem); + p->pos += rem; + *size = rem; + return SZ_OK; +} + +static SRes LookToRead_Seek(void *pp, Int64 *pos, ESzSeek origin) +{ + CLookToRead *p = (CLookToRead *)pp; + p->pos = p->size = 0; + return p->realStream->Seek(p->realStream, pos, origin); +} + +void LookToRead_CreateVTable(CLookToRead *p, int lookahead) +{ + p->s.Look = lookahead ? + LookToRead_Look_Lookahead : + LookToRead_Look_Exact; + p->s.Skip = LookToRead_Skip; + p->s.Read = LookToRead_Read; + p->s.Seek = LookToRead_Seek; +} + +void LookToRead_Init(CLookToRead *p) +{ + p->pos = p->size = 0; +} + +static SRes SecToLook_Read(void *pp, void *buf, size_t *size) +{ + CSecToLook *p = (CSecToLook *)pp; + return LookInStream_LookRead(p->realStream, buf, size); +} + +void SecToLook_CreateVTable(CSecToLook *p) +{ + p->s.Read = SecToLook_Read; +} + +static SRes SecToRead_Read(void *pp, void *buf, size_t *size) +{ + CSecToRead *p = (CSecToRead *)pp; + return p->realStream->Read(p->realStream, buf, size); +} + +void SecToRead_CreateVTable(CSecToRead *p) +{ + p->s.Read = SecToRead_Read; +} diff --git a/extern/lzma/7zVersion.h b/extern/lzma/7zVersion.h new file mode 100644 index 00000000000..b7eb235548f --- /dev/null +++ b/extern/lzma/7zVersion.h @@ -0,0 +1,7 @@ +#define MY_VER_MAJOR 4 +#define MY_VER_MINOR 65 +#define MY_VER_BUILD 0 +#define MY_VERSION "4.65" +#define MY_DATE "2009-02-03" +#define MY_COPYRIGHT ": Igor Pavlov : Public domain" +#define MY_VERSION_COPYRIGHT_DATE MY_VERSION " " MY_COPYRIGHT " : " MY_DATE diff --git a/extern/lzma/Alloc.c b/extern/lzma/Alloc.c new file mode 100644 index 00000000000..358a7b52650 --- /dev/null +++ b/extern/lzma/Alloc.c @@ -0,0 +1,127 @@ +/* Alloc.c -- Memory allocation functions +2008-09-24 +Igor Pavlov +Public domain */ + +#ifdef _WIN32 +#include +#endif +#include + +#include "Alloc.h" + +/* #define _SZ_ALLOC_DEBUG */ + +/* use _SZ_ALLOC_DEBUG to debug alloc/free operations */ +#ifdef _SZ_ALLOC_DEBUG +#include +int g_allocCount = 0; +int g_allocCountMid = 0; +int g_allocCountBig = 0; +#endif + +void *MyAlloc(size_t size) +{ + if (size == 0) + return 0; + #ifdef _SZ_ALLOC_DEBUG + { + void *p = malloc(size); + fprintf(stderr, "\nAlloc %10d bytes, count = %10d, addr = %8X", size, g_allocCount++, (unsigned)p); + return p; + } + #else + return malloc(size); + #endif +} + +void MyFree(void *address) +{ + #ifdef _SZ_ALLOC_DEBUG + if (address != 0) + fprintf(stderr, "\nFree; count = %10d, addr = %8X", --g_allocCount, (unsigned)address); + #endif + free(address); +} + +#ifdef _WIN32 + +void *MidAlloc(size_t size) +{ + if (size == 0) + return 0; + #ifdef _SZ_ALLOC_DEBUG + fprintf(stderr, "\nAlloc_Mid %10d bytes; count = %10d", size, g_allocCountMid++); + #endif + return VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE); +} + +void MidFree(void *address) +{ + #ifdef _SZ_ALLOC_DEBUG + if (address != 0) + fprintf(stderr, "\nFree_Mid; count = %10d", --g_allocCountMid); + #endif + if (address == 0) + return; + VirtualFree(address, 0, MEM_RELEASE); +} + +#ifndef MEM_LARGE_PAGES +#undef _7ZIP_LARGE_PAGES +#endif + +#ifdef _7ZIP_LARGE_PAGES +SIZE_T g_LargePageSize = 0; +typedef SIZE_T (WINAPI *GetLargePageMinimumP)(); +#endif + +void SetLargePageSize() +{ + #ifdef _7ZIP_LARGE_PAGES + SIZE_T size = 0; + GetLargePageMinimumP largePageMinimum = (GetLargePageMinimumP) + GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetLargePageMinimum"); + if (largePageMinimum == 0) + return; + size = largePageMinimum(); + if (size == 0 || (size & (size - 1)) != 0) + return; + g_LargePageSize = size; + #endif +} + + +void *BigAlloc(size_t size) +{ + if (size == 0) + return 0; + #ifdef _SZ_ALLOC_DEBUG + fprintf(stderr, "\nAlloc_Big %10d bytes; count = %10d", size, g_allocCountBig++); + #endif + + #ifdef _7ZIP_LARGE_PAGES + if (g_LargePageSize != 0 && g_LargePageSize <= (1 << 30) && size >= (1 << 18)) + { + void *res = VirtualAlloc(0, (size + g_LargePageSize - 1) & (~(g_LargePageSize - 1)), + MEM_COMMIT | MEM_LARGE_PAGES, PAGE_READWRITE); + if (res != 0) + return res; + } + #endif + return VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE); +} + +void BigFree(void *address) +{ + #ifdef _SZ_ALLOC_DEBUG + if (address != 0) + fprintf(stderr, "\nFree_Big; count = %10d", --g_allocCountBig); + #endif + + if (address == 0) + return; + VirtualFree(address, 0, MEM_RELEASE); +} + +#endif diff --git a/extern/lzma/Alloc.h b/extern/lzma/Alloc.h new file mode 100644 index 00000000000..ff0669cad8d --- /dev/null +++ b/extern/lzma/Alloc.h @@ -0,0 +1,32 @@ +/* Alloc.h -- Memory allocation functions +2008-03-13 +Igor Pavlov +Public domain */ + +#ifndef __COMMON_ALLOC_H +#define __COMMON_ALLOC_H + +#include + +void *MyAlloc(size_t size); +void MyFree(void *address); + +#ifdef _WIN32 + +void SetLargePageSize(); + +void *MidAlloc(size_t size); +void MidFree(void *address); +void *BigAlloc(size_t size); +void BigFree(void *address); + +#else + +#define MidAlloc(size) MyAlloc(size) +#define MidFree(address) MyFree(address) +#define BigAlloc(size) MyAlloc(size) +#define BigFree(address) MyFree(address) + +#endif + +#endif diff --git a/extern/lzma/Bcj2.c b/extern/lzma/Bcj2.c new file mode 100644 index 00000000000..20199ce5659 --- /dev/null +++ b/extern/lzma/Bcj2.c @@ -0,0 +1,132 @@ +/* Bcj2.c -- Converter for x86 code (BCJ2) +2008-10-04 : Igor Pavlov : Public domain */ + +#include "Bcj2.h" + +#ifdef _LZMA_PROB32 +#define CProb UInt32 +#else +#define CProb UInt16 +#endif + +#define IsJcc(b0, b1) ((b0) == 0x0F && ((b1) & 0xF0) == 0x80) +#define IsJ(b0, b1) ((b1 & 0xFE) == 0xE8 || IsJcc(b0, b1)) + +#define kNumTopBits 24 +#define kTopValue ((UInt32)1 << kNumTopBits) + +#define kNumBitModelTotalBits 11 +#define kBitModelTotal (1 << kNumBitModelTotalBits) +#define kNumMoveBits 5 + +#define RC_READ_BYTE (*buffer++) +#define RC_TEST { if (buffer == bufferLim) return SZ_ERROR_DATA; } +#define RC_INIT2 code = 0; range = 0xFFFFFFFF; \ + { int i; for (i = 0; i < 5; i++) { RC_TEST; code = (code << 8) | RC_READ_BYTE; }} + +#define NORMALIZE if (range < kTopValue) { RC_TEST; range <<= 8; code = (code << 8) | RC_READ_BYTE; } + +#define IF_BIT_0(p) ttt = *(p); bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound) +#define UPDATE_0(p) range = bound; *(p) = (CProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); NORMALIZE; +#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CProb)(ttt - (ttt >> kNumMoveBits)); NORMALIZE; + +int Bcj2_Decode( + const Byte *buf0, SizeT size0, + const Byte *buf1, SizeT size1, + const Byte *buf2, SizeT size2, + const Byte *buf3, SizeT size3, + Byte *outBuf, SizeT outSize) +{ + CProb p[256 + 2]; + SizeT inPos = 0, outPos = 0; + + const Byte *buffer, *bufferLim; + UInt32 range, code; + Byte prevByte = 0; + + unsigned int i; + for (i = 0; i < sizeof(p) / sizeof(p[0]); i++) + p[i] = kBitModelTotal >> 1; + + buffer = buf3; + bufferLim = buffer + size3; + RC_INIT2 + + if (outSize == 0) + return SZ_OK; + + for (;;) + { + Byte b; + CProb *prob; + UInt32 bound; + UInt32 ttt; + + SizeT limit = size0 - inPos; + if (outSize - outPos < limit) + limit = outSize - outPos; + while (limit != 0) + { + Byte b = buf0[inPos]; + outBuf[outPos++] = b; + if (IsJ(prevByte, b)) + break; + inPos++; + prevByte = b; + limit--; + } + + if (limit == 0 || outPos == outSize) + break; + + b = buf0[inPos++]; + + if (b == 0xE8) + prob = p + prevByte; + else if (b == 0xE9) + prob = p + 256; + else + prob = p + 257; + + IF_BIT_0(prob) + { + UPDATE_0(prob) + prevByte = b; + } + else + { + UInt32 dest; + const Byte *v; + UPDATE_1(prob) + if (b == 0xE8) + { + v = buf1; + if (size1 < 4) + return SZ_ERROR_DATA; + buf1 += 4; + size1 -= 4; + } + else + { + v = buf2; + if (size2 < 4) + return SZ_ERROR_DATA; + buf2 += 4; + size2 -= 4; + } + dest = (((UInt32)v[0] << 24) | ((UInt32)v[1] << 16) | + ((UInt32)v[2] << 8) | ((UInt32)v[3])) - ((UInt32)outPos + 4); + outBuf[outPos++] = (Byte)dest; + if (outPos == outSize) + break; + outBuf[outPos++] = (Byte)(dest >> 8); + if (outPos == outSize) + break; + outBuf[outPos++] = (Byte)(dest >> 16); + if (outPos == outSize) + break; + outBuf[outPos++] = prevByte = (Byte)(dest >> 24); + } + } + return (outPos == outSize) ? SZ_OK : SZ_ERROR_DATA; +} diff --git a/extern/lzma/Bcj2.h b/extern/lzma/Bcj2.h new file mode 100644 index 00000000000..32d450b3b99 --- /dev/null +++ b/extern/lzma/Bcj2.h @@ -0,0 +1,30 @@ +/* Bcj2.h -- Converter for x86 code (BCJ2) +2008-10-04 : Igor Pavlov : Public domain */ + +#ifndef __BCJ2_H +#define __BCJ2_H + +#include "Types.h" + +/* +Conditions: + outSize <= FullOutputSize, + where FullOutputSize is full size of output stream of x86_2 filter. + +If buf0 overlaps outBuf, there are two required conditions: + 1) (buf0 >= outBuf) + 2) (buf0 + size0 >= outBuf + FullOutputSize). + +Returns: + SZ_OK + SZ_ERROR_DATA - Data error +*/ + +int Bcj2_Decode( + const Byte *buf0, SizeT size0, + const Byte *buf1, SizeT size1, + const Byte *buf2, SizeT size2, + const Byte *buf3, SizeT size3, + Byte *outBuf, SizeT outSize); + +#endif diff --git a/extern/lzma/Bra.c b/extern/lzma/Bra.c new file mode 100644 index 00000000000..5e5469592db --- /dev/null +++ b/extern/lzma/Bra.c @@ -0,0 +1,133 @@ +/* Bra.c -- Converters for RISC code +2008-10-04 : Igor Pavlov : Public domain */ + +#include "Bra.h" + +SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding) +{ + SizeT i; + if (size < 4) + return 0; + size -= 4; + ip += 8; + for (i = 0; i <= size; i += 4) + { + if (data[i + 3] == 0xEB) + { + UInt32 dest; + UInt32 src = ((UInt32)data[i + 2] << 16) | ((UInt32)data[i + 1] << 8) | (data[i + 0]); + src <<= 2; + if (encoding) + dest = ip + (UInt32)i + src; + else + dest = src - (ip + (UInt32)i); + dest >>= 2; + data[i + 2] = (Byte)(dest >> 16); + data[i + 1] = (Byte)(dest >> 8); + data[i + 0] = (Byte)dest; + } + } + return i; +} + +SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding) +{ + SizeT i; + if (size < 4) + return 0; + size -= 4; + ip += 4; + for (i = 0; i <= size; i += 2) + { + if ((data[i + 1] & 0xF8) == 0xF0 && + (data[i + 3] & 0xF8) == 0xF8) + { + UInt32 dest; + UInt32 src = + (((UInt32)data[i + 1] & 0x7) << 19) | + ((UInt32)data[i + 0] << 11) | + (((UInt32)data[i + 3] & 0x7) << 8) | + (data[i + 2]); + + src <<= 1; + if (encoding) + dest = ip + (UInt32)i + src; + else + dest = src - (ip + (UInt32)i); + dest >>= 1; + + data[i + 1] = (Byte)(0xF0 | ((dest >> 19) & 0x7)); + data[i + 0] = (Byte)(dest >> 11); + data[i + 3] = (Byte)(0xF8 | ((dest >> 8) & 0x7)); + data[i + 2] = (Byte)dest; + i += 2; + } + } + return i; +} + +SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding) +{ + SizeT i; + if (size < 4) + return 0; + size -= 4; + for (i = 0; i <= size; i += 4) + { + if ((data[i] >> 2) == 0x12 && (data[i + 3] & 3) == 1) + { + UInt32 src = ((UInt32)(data[i + 0] & 3) << 24) | + ((UInt32)data[i + 1] << 16) | + ((UInt32)data[i + 2] << 8) | + ((UInt32)data[i + 3] & (~3)); + + UInt32 dest; + if (encoding) + dest = ip + (UInt32)i + src; + else + dest = src - (ip + (UInt32)i); + data[i + 0] = (Byte)(0x48 | ((dest >> 24) & 0x3)); + data[i + 1] = (Byte)(dest >> 16); + data[i + 2] = (Byte)(dest >> 8); + data[i + 3] &= 0x3; + data[i + 3] |= dest; + } + } + return i; +} + +SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding) +{ + UInt32 i; + if (size < 4) + return 0; + size -= 4; + for (i = 0; i <= size; i += 4) + { + if (data[i] == 0x40 && (data[i + 1] & 0xC0) == 0x00 || + data[i] == 0x7F && (data[i + 1] & 0xC0) == 0xC0) + { + UInt32 src = + ((UInt32)data[i + 0] << 24) | + ((UInt32)data[i + 1] << 16) | + ((UInt32)data[i + 2] << 8) | + ((UInt32)data[i + 3]); + UInt32 dest; + + src <<= 2; + if (encoding) + dest = ip + i + src; + else + dest = src - (ip + i); + dest >>= 2; + + dest = (((0 - ((dest >> 22) & 1)) << 22) & 0x3FFFFFFF) | (dest & 0x3FFFFF) | 0x40000000; + + data[i + 0] = (Byte)(dest >> 24); + data[i + 1] = (Byte)(dest >> 16); + data[i + 2] = (Byte)(dest >> 8); + data[i + 3] = (Byte)dest; + } + } + return i; +} diff --git a/extern/lzma/Bra.h b/extern/lzma/Bra.h new file mode 100644 index 00000000000..45e231e8496 --- /dev/null +++ b/extern/lzma/Bra.h @@ -0,0 +1,60 @@ +/* Bra.h -- Branch converters for executables +2008-10-04 : Igor Pavlov : Public domain */ + +#ifndef __BRA_H +#define __BRA_H + +#include "Types.h" + +/* +These functions convert relative addresses to absolute addresses +in CALL instructions to increase the compression ratio. + + In: + data - data buffer + size - size of data + ip - current virtual Instruction Pinter (IP) value + state - state variable for x86 converter + encoding - 0 (for decoding), 1 (for encoding) + + Out: + state - state variable for x86 converter + + Returns: + The number of processed bytes. If you call these functions with multiple calls, + you must start next call with first byte after block of processed bytes. + + Type Endian Alignment LookAhead + + x86 little 1 4 + ARMT little 2 2 + ARM little 4 0 + PPC big 4 0 + SPARC big 4 0 + IA64 little 16 0 + + size must be >= Alignment + LookAhead, if it's not last block. + If (size < Alignment + LookAhead), converter returns 0. + + Example: + + UInt32 ip = 0; + for () + { + ; size must be >= Alignment + LookAhead, if it's not last block + SizeT processed = Convert(data, size, ip, 1); + data += processed; + size -= processed; + ip += processed; + } +*/ + +#define x86_Convert_Init(state) { state = 0; } +SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding); +SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding); +SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding); +SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding); +SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding); +SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding); + +#endif diff --git a/extern/lzma/Bra86.c b/extern/lzma/Bra86.c new file mode 100644 index 00000000000..1ee0e709b88 --- /dev/null +++ b/extern/lzma/Bra86.c @@ -0,0 +1,85 @@ +/* Bra86.c -- Converter for x86 code (BCJ) +2008-10-04 : Igor Pavlov : Public domain */ + +#include "Bra.h" + +#define Test86MSByte(b) ((b) == 0 || (b) == 0xFF) + +const Byte kMaskToAllowedStatus[8] = {1, 1, 1, 0, 1, 0, 0, 0}; +const Byte kMaskToBitNumber[8] = {0, 1, 2, 2, 3, 3, 3, 3}; + +SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding) +{ + SizeT bufferPos = 0, prevPosT; + UInt32 prevMask = *state & 0x7; + if (size < 5) + return 0; + ip += 5; + prevPosT = (SizeT)0 - 1; + + for (;;) + { + Byte *p = data + bufferPos; + Byte *limit = data + size - 4; + for (; p < limit; p++) + if ((*p & 0xFE) == 0xE8) + break; + bufferPos = (SizeT)(p - data); + if (p >= limit) + break; + prevPosT = bufferPos - prevPosT; + if (prevPosT > 3) + prevMask = 0; + else + { + prevMask = (prevMask << ((int)prevPosT - 1)) & 0x7; + if (prevMask != 0) + { + Byte b = p[4 - kMaskToBitNumber[prevMask]]; + if (!kMaskToAllowedStatus[prevMask] || Test86MSByte(b)) + { + prevPosT = bufferPos; + prevMask = ((prevMask << 1) & 0x7) | 1; + bufferPos++; + continue; + } + } + } + prevPosT = bufferPos; + + if (Test86MSByte(p[4])) + { + UInt32 src = ((UInt32)p[4] << 24) | ((UInt32)p[3] << 16) | ((UInt32)p[2] << 8) | ((UInt32)p[1]); + UInt32 dest; + for (;;) + { + Byte b; + int index; + if (encoding) + dest = (ip + (UInt32)bufferPos) + src; + else + dest = src - (ip + (UInt32)bufferPos); + if (prevMask == 0) + break; + index = kMaskToBitNumber[prevMask] * 8; + b = (Byte)(dest >> (24 - index)); + if (!Test86MSByte(b)) + break; + src = dest ^ ((1 << (32 - index)) - 1); + } + p[4] = (Byte)(~(((dest >> 24) & 1) - 1)); + p[3] = (Byte)(dest >> 16); + p[2] = (Byte)(dest >> 8); + p[1] = (Byte)dest; + bufferPos += 5; + } + else + { + prevMask = ((prevMask << 1) & 0x7) | 1; + bufferPos++; + } + } + prevPosT = bufferPos - prevPosT; + *state = ((prevPosT > 3) ? 0 : ((prevMask << ((int)prevPosT - 1)) & 0x7)); + return bufferPos; +} diff --git a/extern/lzma/BraIA64.c b/extern/lzma/BraIA64.c new file mode 100644 index 00000000000..0b4ee85bc76 --- /dev/null +++ b/extern/lzma/BraIA64.c @@ -0,0 +1,67 @@ +/* BraIA64.c -- Converter for IA-64 code +2008-10-04 : Igor Pavlov : Public domain */ + +#include "Bra.h" + +static const Byte kBranchTable[32] = +{ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 4, 4, 6, 6, 0, 0, 7, 7, + 4, 4, 0, 0, 4, 4, 0, 0 +}; + +SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding) +{ + SizeT i; + if (size < 16) + return 0; + size -= 16; + for (i = 0; i <= size; i += 16) + { + UInt32 instrTemplate = data[i] & 0x1F; + UInt32 mask = kBranchTable[instrTemplate]; + UInt32 bitPos = 5; + int slot; + for (slot = 0; slot < 3; slot++, bitPos += 41) + { + UInt32 bytePos, bitRes; + UInt64 instruction, instNorm; + int j; + if (((mask >> slot) & 1) == 0) + continue; + bytePos = (bitPos >> 3); + bitRes = bitPos & 0x7; + instruction = 0; + for (j = 0; j < 6; j++) + instruction += (UInt64)data[i + j + bytePos] << (8 * j); + + instNorm = instruction >> bitRes; + if (((instNorm >> 37) & 0xF) == 0x5 && ((instNorm >> 9) & 0x7) == 0) + { + UInt32 src = (UInt32)((instNorm >> 13) & 0xFFFFF); + UInt32 dest; + src |= ((UInt32)(instNorm >> 36) & 1) << 20; + + src <<= 4; + + if (encoding) + dest = ip + (UInt32)i + src; + else + dest = src - (ip + (UInt32)i); + + dest >>= 4; + + instNorm &= ~((UInt64)(0x8FFFFF) << 13); + instNorm |= ((UInt64)(dest & 0xFFFFF) << 13); + instNorm |= ((UInt64)(dest & 0x100000) << (36 - 20)); + + instruction &= (1 << bitRes) - 1; + instruction |= (instNorm << bitRes); + for (j = 0; j < 6; j++) + data[i + j + bytePos] = (Byte)(instruction >> (8 * j)); + } + } + } + return i; +} diff --git a/extern/lzma/CMakeLists.txt b/extern/lzma/CMakeLists.txt new file mode 100644 index 00000000000..235cd8c7f8e --- /dev/null +++ b/extern/lzma/CMakeLists.txt @@ -0,0 +1,34 @@ +# $Id$ +# ***** 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) 2006, Blender Foundation +# All rights reserved. +# +# The Original Code is: all of this file. +# +# Contributor(s): Daniel Genrich +# +# ***** END GPL LICENSE BLOCK ***** + +SET(INC . ) + +FILE(GLOB SRC ./*.c) + + + +BLENDERLIB(bf_lzma "${SRC}" "${INC}") +#, libtype='blender', priority = 0 ) diff --git a/extern/lzma/CpuArch.h b/extern/lzma/CpuArch.h new file mode 100644 index 00000000000..7384b0c32ae --- /dev/null +++ b/extern/lzma/CpuArch.h @@ -0,0 +1,69 @@ +/* CpuArch.h +2008-08-05 +Igor Pavlov +Public domain */ + +#ifndef __CPUARCH_H +#define __CPUARCH_H + +/* +LITTLE_ENDIAN_UNALIGN means: + 1) CPU is LITTLE_ENDIAN + 2) it's allowed to make unaligned memory accesses +if LITTLE_ENDIAN_UNALIGN is not defined, it means that we don't know +about these properties of platform. +*/ + +#if defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64) || defined(__i386__) || defined(__x86_64__) +#define LITTLE_ENDIAN_UNALIGN +#endif + +#ifdef LITTLE_ENDIAN_UNALIGN + +#define GetUi16(p) (*(const UInt16 *)(p)) +#define GetUi32(p) (*(const UInt32 *)(p)) +#define GetUi64(p) (*(const UInt64 *)(p)) +#define SetUi32(p, d) *(UInt32 *)(p) = (d); + +#else + +#define GetUi16(p) (((const Byte *)(p))[0] | ((UInt16)((const Byte *)(p))[1] << 8)) + +#define GetUi32(p) ( \ + ((const Byte *)(p))[0] | \ + ((UInt32)((const Byte *)(p))[1] << 8) | \ + ((UInt32)((const Byte *)(p))[2] << 16) | \ + ((UInt32)((const Byte *)(p))[3] << 24)) + +#define GetUi64(p) (GetUi32(p) | ((UInt64)GetUi32(((const Byte *)(p)) + 4) << 32)) + +#define SetUi32(p, d) { UInt32 _x_ = (d); \ + ((Byte *)(p))[0] = (Byte)_x_; \ + ((Byte *)(p))[1] = (Byte)(_x_ >> 8); \ + ((Byte *)(p))[2] = (Byte)(_x_ >> 16); \ + ((Byte *)(p))[3] = (Byte)(_x_ >> 24); } + +#endif + +#if defined(LITTLE_ENDIAN_UNALIGN) && defined(_WIN64) && (_MSC_VER >= 1300) + +#pragma intrinsic(_byteswap_ulong) +#pragma intrinsic(_byteswap_uint64) +#define GetBe32(p) _byteswap_ulong(*(const UInt32 *)(const Byte *)(p)) +#define GetBe64(p) _byteswap_uint64(*(const UInt64 *)(const Byte *)(p)) + +#else + +#define GetBe32(p) ( \ + ((UInt32)((const Byte *)(p))[0] << 24) | \ + ((UInt32)((const Byte *)(p))[1] << 16) | \ + ((UInt32)((const Byte *)(p))[2] << 8) | \ + ((const Byte *)(p))[3] ) + +#define GetBe64(p) (((UInt64)GetBe32(p) << 32) | GetBe32(((const Byte *)(p)) + 4)) + +#endif + +#define GetBe16(p) (((UInt16)((const Byte *)(p))[0] << 8) | ((const Byte *)(p))[1]) + +#endif diff --git a/extern/lzma/LzFind.c b/extern/lzma/LzFind.c new file mode 100644 index 00000000000..34f4f09ea58 --- /dev/null +++ b/extern/lzma/LzFind.c @@ -0,0 +1,751 @@ +/* LzFind.c -- Match finder for LZ algorithms +2008-10-04 : Igor Pavlov : Public domain */ + +#include + +#include "LzFind.h" +#include "LzHash.h" + +#define kEmptyHashValue 0 +#define kMaxValForNormalize ((UInt32)0xFFFFFFFF) +#define kNormalizeStepMin (1 << 10) /* it must be power of 2 */ +#define kNormalizeMask (~(kNormalizeStepMin - 1)) +#define kMaxHistorySize ((UInt32)3 << 30) + +#define kStartMaxLen 3 + +static void LzInWindow_Free(CMatchFinder *p, ISzAlloc *alloc) +{ + if (!p->directInput) + { + alloc->Free(alloc, p->bufferBase); + p->bufferBase = 0; + } +} + +/* keepSizeBefore + keepSizeAfter + keepSizeReserv must be < 4G) */ + +static int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAlloc *alloc) +{ + UInt32 blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv; + if (p->directInput) + { + p->blockSize = blockSize; + return 1; + } + if (p->bufferBase == 0 || p->blockSize != blockSize) + { + LzInWindow_Free(p, alloc); + p->blockSize = blockSize; + p->bufferBase = (Byte *)alloc->Alloc(alloc, (size_t)blockSize); + } + return (p->bufferBase != 0); +} + +Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; } +Byte MatchFinder_GetIndexByte(CMatchFinder *p, Int32 index) { return p->buffer[index]; } + +UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; } + +void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue) +{ + p->posLimit -= subValue; + p->pos -= subValue; + p->streamPos -= subValue; +} + +static void MatchFinder_ReadBlock(CMatchFinder *p) +{ + if (p->streamEndWasReached || p->result != SZ_OK) + return; + for (;;) + { + Byte *dest = p->buffer + (p->streamPos - p->pos); + size_t size = (p->bufferBase + p->blockSize - dest); + if (size == 0) + return; + p->result = p->stream->Read(p->stream, dest, &size); + if (p->result != SZ_OK) + return; + if (size == 0) + { + p->streamEndWasReached = 1; + return; + } + p->streamPos += (UInt32)size; + if (p->streamPos - p->pos > p->keepSizeAfter) + return; + } +} + +void MatchFinder_MoveBlock(CMatchFinder *p) +{ + memmove(p->bufferBase, + p->buffer - p->keepSizeBefore, + (size_t)(p->streamPos - p->pos + p->keepSizeBefore)); + p->buffer = p->bufferBase + p->keepSizeBefore; +} + +int MatchFinder_NeedMove(CMatchFinder *p) +{ + /* if (p->streamEndWasReached) return 0; */ + return ((size_t)(p->bufferBase + p->blockSize - p->buffer) <= p->keepSizeAfter); +} + +void MatchFinder_ReadIfRequired(CMatchFinder *p) +{ + if (p->streamEndWasReached) + return; + if (p->keepSizeAfter >= p->streamPos - p->pos) + MatchFinder_ReadBlock(p); +} + +static void MatchFinder_CheckAndMoveAndRead(CMatchFinder *p) +{ + if (MatchFinder_NeedMove(p)) + MatchFinder_MoveBlock(p); + MatchFinder_ReadBlock(p); +} + +static void MatchFinder_SetDefaultSettings(CMatchFinder *p) +{ + p->cutValue = 32; + p->btMode = 1; + p->numHashBytes = 4; + /* p->skipModeBits = 0; */ + p->directInput = 0; + p->bigHash = 0; +} + +#define kCrcPoly 0xEDB88320 + +void MatchFinder_Construct(CMatchFinder *p) +{ + UInt32 i; + p->bufferBase = 0; + p->directInput = 0; + p->hash = 0; + MatchFinder_SetDefaultSettings(p); + + for (i = 0; i < 256; i++) + { + UInt32 r = i; + int j; + for (j = 0; j < 8; j++) + r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1)); + p->crc[i] = r; + } +} + +static void MatchFinder_FreeThisClassMemory(CMatchFinder *p, ISzAlloc *alloc) +{ + alloc->Free(alloc, p->hash); + p->hash = 0; +} + +void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc) +{ + MatchFinder_FreeThisClassMemory(p, alloc); + LzInWindow_Free(p, alloc); +} + +static CLzRef* AllocRefs(UInt32 num, ISzAlloc *alloc) +{ + size_t sizeInBytes = (size_t)num * sizeof(CLzRef); + if (sizeInBytes / sizeof(CLzRef) != num) + return 0; + return (CLzRef *)alloc->Alloc(alloc, sizeInBytes); +} + +int MatchFinder_Create(CMatchFinder *p, UInt32 historySize, + UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter, + ISzAlloc *alloc) +{ + UInt32 sizeReserv; + if (historySize > kMaxHistorySize) + { + MatchFinder_Free(p, alloc); + return 0; + } + sizeReserv = historySize >> 1; + if (historySize > ((UInt32)2 << 30)) + sizeReserv = historySize >> 2; + sizeReserv += (keepAddBufferBefore + matchMaxLen + keepAddBufferAfter) / 2 + (1 << 19); + + p->keepSizeBefore = historySize + keepAddBufferBefore + 1; + p->keepSizeAfter = matchMaxLen + keepAddBufferAfter; + /* we need one additional byte, since we use MoveBlock after pos++ and before dictionary using */ + if (LzInWindow_Create(p, sizeReserv, alloc)) + { + UInt32 newCyclicBufferSize = (historySize /* >> p->skipModeBits */) + 1; + UInt32 hs; + p->matchMaxLen = matchMaxLen; + { + p->fixedHashSize = 0; + if (p->numHashBytes == 2) + hs = (1 << 16) - 1; + else + { + hs = historySize - 1; + hs |= (hs >> 1); + hs |= (hs >> 2); + hs |= (hs >> 4); + hs |= (hs >> 8); + hs >>= 1; + /* hs >>= p->skipModeBits; */ + hs |= 0xFFFF; /* don't change it! It's required for Deflate */ + if (hs > (1 << 24)) + { + if (p->numHashBytes == 3) + hs = (1 << 24) - 1; + else + hs >>= 1; + } + } + p->hashMask = hs; + hs++; + if (p->numHashBytes > 2) p->fixedHashSize += kHash2Size; + if (p->numHashBytes > 3) p->fixedHashSize += kHash3Size; + if (p->numHashBytes > 4) p->fixedHashSize += kHash4Size; + hs += p->fixedHashSize; + } + + { + UInt32 prevSize = p->hashSizeSum + p->numSons; + UInt32 newSize; + p->historySize = historySize; + p->hashSizeSum = hs; + p->cyclicBufferSize = newCyclicBufferSize; + p->numSons = (p->btMode ? newCyclicBufferSize * 2 : newCyclicBufferSize); + newSize = p->hashSizeSum + p->numSons; + if (p->hash != 0 && prevSize == newSize) + return 1; + MatchFinder_FreeThisClassMemory(p, alloc); + p->hash = AllocRefs(newSize, alloc); + if (p->hash != 0) + { + p->son = p->hash + p->hashSizeSum; + return 1; + } + } + } + MatchFinder_Free(p, alloc); + return 0; +} + +static void MatchFinder_SetLimits(CMatchFinder *p) +{ + UInt32 limit = kMaxValForNormalize - p->pos; + UInt32 limit2 = p->cyclicBufferSize - p->cyclicBufferPos; + if (limit2 < limit) + limit = limit2; + limit2 = p->streamPos - p->pos; + if (limit2 <= p->keepSizeAfter) + { + if (limit2 > 0) + limit2 = 1; + } + else + limit2 -= p->keepSizeAfter; + if (limit2 < limit) + limit = limit2; + { + UInt32 lenLimit = p->streamPos - p->pos; + if (lenLimit > p->matchMaxLen) + lenLimit = p->matchMaxLen; + p->lenLimit = lenLimit; + } + p->posLimit = p->pos + limit; +} + +void MatchFinder_Init(CMatchFinder *p) +{ + UInt32 i; + for (i = 0; i < p->hashSizeSum; i++) + p->hash[i] = kEmptyHashValue; + p->cyclicBufferPos = 0; + p->buffer = p->bufferBase; + p->pos = p->streamPos = p->cyclicBufferSize; + p->result = SZ_OK; + p->streamEndWasReached = 0; + MatchFinder_ReadBlock(p); + MatchFinder_SetLimits(p); +} + +static UInt32 MatchFinder_GetSubValue(CMatchFinder *p) +{ + return (p->pos - p->historySize - 1) & kNormalizeMask; +} + +void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems) +{ + UInt32 i; + for (i = 0; i < numItems; i++) + { + UInt32 value = items[i]; + if (value <= subValue) + value = kEmptyHashValue; + else + value -= subValue; + items[i] = value; + } +} + +static void MatchFinder_Normalize(CMatchFinder *p) +{ + UInt32 subValue = MatchFinder_GetSubValue(p); + MatchFinder_Normalize3(subValue, p->hash, p->hashSizeSum + p->numSons); + MatchFinder_ReduceOffsets(p, subValue); +} + +static void MatchFinder_CheckLimits(CMatchFinder *p) +{ + if (p->pos == kMaxValForNormalize) + MatchFinder_Normalize(p); + if (!p->streamEndWasReached && p->keepSizeAfter == p->streamPos - p->pos) + MatchFinder_CheckAndMoveAndRead(p); + if (p->cyclicBufferPos == p->cyclicBufferSize) + p->cyclicBufferPos = 0; + MatchFinder_SetLimits(p); +} + +static UInt32 * Hc_GetMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, + UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue, + UInt32 *distances, UInt32 maxLen) +{ + son[_cyclicBufferPos] = curMatch; + for (;;) + { + UInt32 delta = pos - curMatch; + if (cutValue-- == 0 || delta >= _cyclicBufferSize) + return distances; + { + const Byte *pb = cur - delta; + curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)]; + if (pb[maxLen] == cur[maxLen] && *pb == *cur) + { + UInt32 len = 0; + while (++len != lenLimit) + if (pb[len] != cur[len]) + break; + if (maxLen < len) + { + *distances++ = maxLen = len; + *distances++ = delta - 1; + if (len == lenLimit) + return distances; + } + } + } + } +} + +UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, + UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue, + UInt32 *distances, UInt32 maxLen) +{ + CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1; + CLzRef *ptr1 = son + (_cyclicBufferPos << 1); + UInt32 len0 = 0, len1 = 0; + for (;;) + { + UInt32 delta = pos - curMatch; + if (cutValue-- == 0 || delta >= _cyclicBufferSize) + { + *ptr0 = *ptr1 = kEmptyHashValue; + return distances; + } + { + CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1); + const Byte *pb = cur - delta; + UInt32 len = (len0 < len1 ? len0 : len1); + if (pb[len] == cur[len]) + { + if (++len != lenLimit && pb[len] == cur[len]) + while (++len != lenLimit) + if (pb[len] != cur[len]) + break; + if (maxLen < len) + { + *distances++ = maxLen = len; + *distances++ = delta - 1; + if (len == lenLimit) + { + *ptr1 = pair[0]; + *ptr0 = pair[1]; + return distances; + } + } + } + if (pb[len] < cur[len]) + { + *ptr1 = curMatch; + ptr1 = pair + 1; + curMatch = *ptr1; + len1 = len; + } + else + { + *ptr0 = curMatch; + ptr0 = pair; + curMatch = *ptr0; + len0 = len; + } + } + } +} + +static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, + UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue) +{ + CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1; + CLzRef *ptr1 = son + (_cyclicBufferPos << 1); + UInt32 len0 = 0, len1 = 0; + for (;;) + { + UInt32 delta = pos - curMatch; + if (cutValue-- == 0 || delta >= _cyclicBufferSize) + { + *ptr0 = *ptr1 = kEmptyHashValue; + return; + } + { + CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1); + const Byte *pb = cur - delta; + UInt32 len = (len0 < len1 ? len0 : len1); + if (pb[len] == cur[len]) + { + while (++len != lenLimit) + if (pb[len] != cur[len]) + break; + { + if (len == lenLimit) + { + *ptr1 = pair[0]; + *ptr0 = pair[1]; + return; + } + } + } + if (pb[len] < cur[len]) + { + *ptr1 = curMatch; + ptr1 = pair + 1; + curMatch = *ptr1; + len1 = len; + } + else + { + *ptr0 = curMatch; + ptr0 = pair; + curMatch = *ptr0; + len0 = len; + } + } + } +} + +#define MOVE_POS \ + ++p->cyclicBufferPos; \ + p->buffer++; \ + if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p); + +#define MOVE_POS_RET MOVE_POS return offset; + +static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; } + +#define GET_MATCHES_HEADER2(minLen, ret_op) \ + UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; \ + lenLimit = p->lenLimit; { if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; }} \ + cur = p->buffer; + +#define GET_MATCHES_HEADER(minLen) GET_MATCHES_HEADER2(minLen, return 0) +#define SKIP_HEADER(minLen) GET_MATCHES_HEADER2(minLen, continue) + +#define MF_PARAMS(p) p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue + +#define GET_MATCHES_FOOTER(offset, maxLen) \ + offset = (UInt32)(GetMatchesSpec1(lenLimit, curMatch, MF_PARAMS(p), \ + distances + offset, maxLen) - distances); MOVE_POS_RET; + +#define SKIP_FOOTER \ + SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS; + +static UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + UInt32 offset; + GET_MATCHES_HEADER(2) + HASH2_CALC; + curMatch = p->hash[hashValue]; + p->hash[hashValue] = p->pos; + offset = 0; + GET_MATCHES_FOOTER(offset, 1) +} + +UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + UInt32 offset; + GET_MATCHES_HEADER(3) + HASH_ZIP_CALC; + curMatch = p->hash[hashValue]; + p->hash[hashValue] = p->pos; + offset = 0; + GET_MATCHES_FOOTER(offset, 2) +} + +static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + UInt32 hash2Value, delta2, maxLen, offset; + GET_MATCHES_HEADER(3) + + HASH3_CALC; + + delta2 = p->pos - p->hash[hash2Value]; + curMatch = p->hash[kFix3HashSize + hashValue]; + + p->hash[hash2Value] = + p->hash[kFix3HashSize + hashValue] = p->pos; + + + maxLen = 2; + offset = 0; + if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) + { + for (; maxLen != lenLimit; maxLen++) + if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) + break; + distances[0] = maxLen; + distances[1] = delta2 - 1; + offset = 2; + if (maxLen == lenLimit) + { + SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); + MOVE_POS_RET; + } + } + GET_MATCHES_FOOTER(offset, maxLen) +} + +static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset; + GET_MATCHES_HEADER(4) + + HASH4_CALC; + + delta2 = p->pos - p->hash[ hash2Value]; + delta3 = p->pos - p->hash[kFix3HashSize + hash3Value]; + curMatch = p->hash[kFix4HashSize + hashValue]; + + p->hash[ hash2Value] = + p->hash[kFix3HashSize + hash3Value] = + p->hash[kFix4HashSize + hashValue] = p->pos; + + maxLen = 1; + offset = 0; + if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) + { + distances[0] = maxLen = 2; + distances[1] = delta2 - 1; + offset = 2; + } + if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur) + { + maxLen = 3; + distances[offset + 1] = delta3 - 1; + offset += 2; + delta2 = delta3; + } + if (offset != 0) + { + for (; maxLen != lenLimit; maxLen++) + if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) + break; + distances[offset - 2] = maxLen; + if (maxLen == lenLimit) + { + SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); + MOVE_POS_RET; + } + } + if (maxLen < 3) + maxLen = 3; + GET_MATCHES_FOOTER(offset, maxLen) +} + +static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset; + GET_MATCHES_HEADER(4) + + HASH4_CALC; + + delta2 = p->pos - p->hash[ hash2Value]; + delta3 = p->pos - p->hash[kFix3HashSize + hash3Value]; + curMatch = p->hash[kFix4HashSize + hashValue]; + + p->hash[ hash2Value] = + p->hash[kFix3HashSize + hash3Value] = + p->hash[kFix4HashSize + hashValue] = p->pos; + + maxLen = 1; + offset = 0; + if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) + { + distances[0] = maxLen = 2; + distances[1] = delta2 - 1; + offset = 2; + } + if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur) + { + maxLen = 3; + distances[offset + 1] = delta3 - 1; + offset += 2; + delta2 = delta3; + } + if (offset != 0) + { + for (; maxLen != lenLimit; maxLen++) + if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) + break; + distances[offset - 2] = maxLen; + if (maxLen == lenLimit) + { + p->son[p->cyclicBufferPos] = curMatch; + MOVE_POS_RET; + } + } + if (maxLen < 3) + maxLen = 3; + offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), + distances + offset, maxLen) - (distances)); + MOVE_POS_RET +} + +UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + UInt32 offset; + GET_MATCHES_HEADER(3) + HASH_ZIP_CALC; + curMatch = p->hash[hashValue]; + p->hash[hashValue] = p->pos; + offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), + distances, 2) - (distances)); + MOVE_POS_RET +} + +static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + SKIP_HEADER(2) + HASH2_CALC; + curMatch = p->hash[hashValue]; + p->hash[hashValue] = p->pos; + SKIP_FOOTER + } + while (--num != 0); +} + +void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + SKIP_HEADER(3) + HASH_ZIP_CALC; + curMatch = p->hash[hashValue]; + p->hash[hashValue] = p->pos; + SKIP_FOOTER + } + while (--num != 0); +} + +static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + UInt32 hash2Value; + SKIP_HEADER(3) + HASH3_CALC; + curMatch = p->hash[kFix3HashSize + hashValue]; + p->hash[hash2Value] = + p->hash[kFix3HashSize + hashValue] = p->pos; + SKIP_FOOTER + } + while (--num != 0); +} + +static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + UInt32 hash2Value, hash3Value; + SKIP_HEADER(4) + HASH4_CALC; + curMatch = p->hash[kFix4HashSize + hashValue]; + p->hash[ hash2Value] = + p->hash[kFix3HashSize + hash3Value] = p->pos; + p->hash[kFix4HashSize + hashValue] = p->pos; + SKIP_FOOTER + } + while (--num != 0); +} + +static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + UInt32 hash2Value, hash3Value; + SKIP_HEADER(4) + HASH4_CALC; + curMatch = p->hash[kFix4HashSize + hashValue]; + p->hash[ hash2Value] = + p->hash[kFix3HashSize + hash3Value] = + p->hash[kFix4HashSize + hashValue] = p->pos; + p->son[p->cyclicBufferPos] = curMatch; + MOVE_POS + } + while (--num != 0); +} + +void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + SKIP_HEADER(3) + HASH_ZIP_CALC; + curMatch = p->hash[hashValue]; + p->hash[hashValue] = p->pos; + p->son[p->cyclicBufferPos] = curMatch; + MOVE_POS + } + while (--num != 0); +} + +void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable) +{ + vTable->Init = (Mf_Init_Func)MatchFinder_Init; + vTable->GetIndexByte = (Mf_GetIndexByte_Func)MatchFinder_GetIndexByte; + vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinder_GetNumAvailableBytes; + vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinder_GetPointerToCurrentPos; + if (!p->btMode) + { + vTable->GetMatches = (Mf_GetMatches_Func)Hc4_MatchFinder_GetMatches; + vTable->Skip = (Mf_Skip_Func)Hc4_MatchFinder_Skip; + } + else if (p->numHashBytes == 2) + { + vTable->GetMatches = (Mf_GetMatches_Func)Bt2_MatchFinder_GetMatches; + vTable->Skip = (Mf_Skip_Func)Bt2_MatchFinder_Skip; + } + else if (p->numHashBytes == 3) + { + vTable->GetMatches = (Mf_GetMatches_Func)Bt3_MatchFinder_GetMatches; + vTable->Skip = (Mf_Skip_Func)Bt3_MatchFinder_Skip; + } + else + { + vTable->GetMatches = (Mf_GetMatches_Func)Bt4_MatchFinder_GetMatches; + vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip; + } +} diff --git a/extern/lzma/LzFind.h b/extern/lzma/LzFind.h new file mode 100644 index 00000000000..5b9cebfdffe --- /dev/null +++ b/extern/lzma/LzFind.h @@ -0,0 +1,107 @@ +/* LzFind.h -- Match finder for LZ algorithms +2008-10-04 : Igor Pavlov : Public domain */ + +#ifndef __LZFIND_H +#define __LZFIND_H + +#include "Types.h" + +typedef UInt32 CLzRef; + +typedef struct _CMatchFinder +{ + Byte *buffer; + UInt32 pos; + UInt32 posLimit; + UInt32 streamPos; + UInt32 lenLimit; + + UInt32 cyclicBufferPos; + UInt32 cyclicBufferSize; /* it must be = (historySize + 1) */ + + UInt32 matchMaxLen; + CLzRef *hash; + CLzRef *son; + UInt32 hashMask; + UInt32 cutValue; + + Byte *bufferBase; + ISeqInStream *stream; + int streamEndWasReached; + + UInt32 blockSize; + UInt32 keepSizeBefore; + UInt32 keepSizeAfter; + + UInt32 numHashBytes; + int directInput; + int btMode; + /* int skipModeBits; */ + int bigHash; + UInt32 historySize; + UInt32 fixedHashSize; + UInt32 hashSizeSum; + UInt32 numSons; + SRes result; + UInt32 crc[256]; +} CMatchFinder; + +#define Inline_MatchFinder_GetPointerToCurrentPos(p) ((p)->buffer) +#define Inline_MatchFinder_GetIndexByte(p, index) ((p)->buffer[(Int32)(index)]) + +#define Inline_MatchFinder_GetNumAvailableBytes(p) ((p)->streamPos - (p)->pos) + +int MatchFinder_NeedMove(CMatchFinder *p); +Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p); +void MatchFinder_MoveBlock(CMatchFinder *p); +void MatchFinder_ReadIfRequired(CMatchFinder *p); + +void MatchFinder_Construct(CMatchFinder *p); + +/* Conditions: + historySize <= 3 GB + keepAddBufferBefore + matchMaxLen + keepAddBufferAfter < 511MB +*/ +int MatchFinder_Create(CMatchFinder *p, UInt32 historySize, + UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter, + ISzAlloc *alloc); +void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc); +void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems); +void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue); + +UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son, + UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue, + UInt32 *distances, UInt32 maxLen); + +/* +Conditions: + Mf_GetNumAvailableBytes_Func must be called before each Mf_GetMatchLen_Func. + Mf_GetPointerToCurrentPos_Func's result must be used only before any other function +*/ + +typedef void (*Mf_Init_Func)(void *object); +typedef Byte (*Mf_GetIndexByte_Func)(void *object, Int32 index); +typedef UInt32 (*Mf_GetNumAvailableBytes_Func)(void *object); +typedef const Byte * (*Mf_GetPointerToCurrentPos_Func)(void *object); +typedef UInt32 (*Mf_GetMatches_Func)(void *object, UInt32 *distances); +typedef void (*Mf_Skip_Func)(void *object, UInt32); + +typedef struct _IMatchFinder +{ + Mf_Init_Func Init; + Mf_GetIndexByte_Func GetIndexByte; + Mf_GetNumAvailableBytes_Func GetNumAvailableBytes; + Mf_GetPointerToCurrentPos_Func GetPointerToCurrentPos; + Mf_GetMatches_Func GetMatches; + Mf_Skip_Func Skip; +} IMatchFinder; + +void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable); + +void MatchFinder_Init(CMatchFinder *p); +UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances); +UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances); +void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num); +void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num); + +#endif diff --git a/extern/lzma/LzFindMt.c b/extern/lzma/LzFindMt.c new file mode 100644 index 00000000000..b49cd76b294 --- /dev/null +++ b/extern/lzma/LzFindMt.c @@ -0,0 +1,793 @@ +/* LzFindMt.c -- multithreaded Match finder for LZ algorithms +2008-10-04 : Igor Pavlov : Public domain */ + +#include "LzHash.h" + +#include "LzFindMt.h" + +void MtSync_Construct(CMtSync *p) +{ + p->wasCreated = False; + p->csWasInitialized = False; + p->csWasEntered = False; + Thread_Construct(&p->thread); + Event_Construct(&p->canStart); + Event_Construct(&p->wasStarted); + Event_Construct(&p->wasStopped); + Semaphore_Construct(&p->freeSemaphore); + Semaphore_Construct(&p->filledSemaphore); +} + +void MtSync_GetNextBlock(CMtSync *p) +{ + if (p->needStart) + { + p->numProcessedBlocks = 1; + p->needStart = False; + p->stopWriting = False; + p->exit = False; + Event_Reset(&p->wasStarted); + Event_Reset(&p->wasStopped); + + Event_Set(&p->canStart); + Event_Wait(&p->wasStarted); + } + else + { + CriticalSection_Leave(&p->cs); + p->csWasEntered = False; + p->numProcessedBlocks++; + Semaphore_Release1(&p->freeSemaphore); + } + Semaphore_Wait(&p->filledSemaphore); + CriticalSection_Enter(&p->cs); + p->csWasEntered = True; +} + +/* MtSync_StopWriting must be called if Writing was started */ + +void MtSync_StopWriting(CMtSync *p) +{ + UInt32 myNumBlocks = p->numProcessedBlocks; + if (!Thread_WasCreated(&p->thread) || p->needStart) + return; + p->stopWriting = True; + if (p->csWasEntered) + { + CriticalSection_Leave(&p->cs); + p->csWasEntered = False; + } + Semaphore_Release1(&p->freeSemaphore); + + Event_Wait(&p->wasStopped); + + while (myNumBlocks++ != p->numProcessedBlocks) + { + Semaphore_Wait(&p->filledSemaphore); + Semaphore_Release1(&p->freeSemaphore); + } + p->needStart = True; +} + +void MtSync_Destruct(CMtSync *p) +{ + if (Thread_WasCreated(&p->thread)) + { + MtSync_StopWriting(p); + p->exit = True; + if (p->needStart) + Event_Set(&p->canStart); + Thread_Wait(&p->thread); + Thread_Close(&p->thread); + } + if (p->csWasInitialized) + { + CriticalSection_Delete(&p->cs); + p->csWasInitialized = False; + } + + Event_Close(&p->canStart); + Event_Close(&p->wasStarted); + Event_Close(&p->wasStopped); + Semaphore_Close(&p->freeSemaphore); + Semaphore_Close(&p->filledSemaphore); + + p->wasCreated = False; +} + +#define RINOK_THREAD(x) { if ((x) != 0) return SZ_ERROR_THREAD; } + +static SRes MtSync_Create2(CMtSync *p, unsigned (MY_STD_CALL *startAddress)(void *), void *obj, UInt32 numBlocks) +{ + if (p->wasCreated) + return SZ_OK; + + RINOK_THREAD(CriticalSection_Init(&p->cs)); + p->csWasInitialized = True; + + RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->canStart)); + RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->wasStarted)); + RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->wasStopped)); + + RINOK_THREAD(Semaphore_Create(&p->freeSemaphore, numBlocks, numBlocks)); + RINOK_THREAD(Semaphore_Create(&p->filledSemaphore, 0, numBlocks)); + + p->needStart = True; + + RINOK_THREAD(Thread_Create(&p->thread, startAddress, obj)); + p->wasCreated = True; + return SZ_OK; +} + +static SRes MtSync_Create(CMtSync *p, unsigned (MY_STD_CALL *startAddress)(void *), void *obj, UInt32 numBlocks) +{ + SRes res = MtSync_Create2(p, startAddress, obj, numBlocks); + if (res != SZ_OK) + MtSync_Destruct(p); + return res; +} + +void MtSync_Init(CMtSync *p) { p->needStart = True; } + +#define kMtMaxValForNormalize 0xFFFFFFFF + +#define DEF_GetHeads2(name, v, action) \ +static void GetHeads ## name(const Byte *p, UInt32 pos, \ +UInt32 *hash, UInt32 hashMask, UInt32 *heads, UInt32 numHeads, const UInt32 *crc) \ +{ action; for (; numHeads != 0; numHeads--) { \ +const UInt32 value = (v); p++; *heads++ = pos - hash[value]; hash[value] = pos++; } } + +#define DEF_GetHeads(name, v) DEF_GetHeads2(name, v, ;) + +DEF_GetHeads2(2, (p[0] | ((UInt32)p[1] << 8)), hashMask = hashMask; crc = crc; ) +DEF_GetHeads(3, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8)) & hashMask) +DEF_GetHeads(4, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ (crc[p[3]] << 5)) & hashMask) +DEF_GetHeads(4b, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ ((UInt32)p[3] << 16)) & hashMask) +DEF_GetHeads(5, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ (crc[p[3]] << 5) ^ (crc[p[4]] << 3)) & hashMask) + +void HashThreadFunc(CMatchFinderMt *mt) +{ + CMtSync *p = &mt->hashSync; + for (;;) + { + UInt32 numProcessedBlocks = 0; + Event_Wait(&p->canStart); + Event_Set(&p->wasStarted); + for (;;) + { + if (p->exit) + return; + if (p->stopWriting) + { + p->numProcessedBlocks = numProcessedBlocks; + Event_Set(&p->wasStopped); + break; + } + + { + CMatchFinder *mf = mt->MatchFinder; + if (MatchFinder_NeedMove(mf)) + { + CriticalSection_Enter(&mt->btSync.cs); + CriticalSection_Enter(&mt->hashSync.cs); + { + const Byte *beforePtr = MatchFinder_GetPointerToCurrentPos(mf); + const Byte *afterPtr; + MatchFinder_MoveBlock(mf); + afterPtr = MatchFinder_GetPointerToCurrentPos(mf); + mt->pointerToCurPos -= beforePtr - afterPtr; + mt->buffer -= beforePtr - afterPtr; + } + CriticalSection_Leave(&mt->btSync.cs); + CriticalSection_Leave(&mt->hashSync.cs); + continue; + } + + Semaphore_Wait(&p->freeSemaphore); + + MatchFinder_ReadIfRequired(mf); + if (mf->pos > (kMtMaxValForNormalize - kMtHashBlockSize)) + { + UInt32 subValue = (mf->pos - mf->historySize - 1); + MatchFinder_ReduceOffsets(mf, subValue); + MatchFinder_Normalize3(subValue, mf->hash + mf->fixedHashSize, mf->hashMask + 1); + } + { + UInt32 *heads = mt->hashBuf + ((numProcessedBlocks++) & kMtHashNumBlocksMask) * kMtHashBlockSize; + UInt32 num = mf->streamPos - mf->pos; + heads[0] = 2; + heads[1] = num; + if (num >= mf->numHashBytes) + { + num = num - mf->numHashBytes + 1; + if (num > kMtHashBlockSize - 2) + num = kMtHashBlockSize - 2; + mt->GetHeadsFunc(mf->buffer, mf->pos, mf->hash + mf->fixedHashSize, mf->hashMask, heads + 2, num, mf->crc); + heads[0] += num; + } + mf->pos += num; + mf->buffer += num; + } + } + + Semaphore_Release1(&p->filledSemaphore); + } + } +} + +void MatchFinderMt_GetNextBlock_Hash(CMatchFinderMt *p) +{ + MtSync_GetNextBlock(&p->hashSync); + p->hashBufPosLimit = p->hashBufPos = ((p->hashSync.numProcessedBlocks - 1) & kMtHashNumBlocksMask) * kMtHashBlockSize; + p->hashBufPosLimit += p->hashBuf[p->hashBufPos++]; + p->hashNumAvail = p->hashBuf[p->hashBufPos++]; +} + +#define kEmptyHashValue 0 + +/* #define MFMT_GM_INLINE */ + +#ifdef MFMT_GM_INLINE + +#define NO_INLINE MY_FAST_CALL + +Int32 NO_INLINE GetMatchesSpecN(UInt32 lenLimit, UInt32 pos, const Byte *cur, CLzRef *son, + UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue, + UInt32 *_distances, UInt32 _maxLen, const UInt32 *hash, Int32 limit, UInt32 size, UInt32 *posRes) +{ + do + { + UInt32 *distances = _distances + 1; + UInt32 curMatch = pos - *hash++; + + CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1; + CLzRef *ptr1 = son + (_cyclicBufferPos << 1); + UInt32 len0 = 0, len1 = 0; + UInt32 cutValue = _cutValue; + UInt32 maxLen = _maxLen; + for (;;) + { + UInt32 delta = pos - curMatch; + if (cutValue-- == 0 || delta >= _cyclicBufferSize) + { + *ptr0 = *ptr1 = kEmptyHashValue; + break; + } + { + CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1); + const Byte *pb = cur - delta; + UInt32 len = (len0 < len1 ? len0 : len1); + if (pb[len] == cur[len]) + { + if (++len != lenLimit && pb[len] == cur[len]) + while (++len != lenLimit) + if (pb[len] != cur[len]) + break; + if (maxLen < len) + { + *distances++ = maxLen = len; + *distances++ = delta - 1; + if (len == lenLimit) + { + *ptr1 = pair[0]; + *ptr0 = pair[1]; + break; + } + } + } + if (pb[len] < cur[len]) + { + *ptr1 = curMatch; + ptr1 = pair + 1; + curMatch = *ptr1; + len1 = len; + } + else + { + *ptr0 = curMatch; + ptr0 = pair; + curMatch = *ptr0; + len0 = len; + } + } + } + pos++; + _cyclicBufferPos++; + cur++; + { + UInt32 num = (UInt32)(distances - _distances); + *_distances = num - 1; + _distances += num; + limit -= num; + } + } + while (limit > 0 && --size != 0); + *posRes = pos; + return limit; +} + +#endif + +void BtGetMatches(CMatchFinderMt *p, UInt32 *distances) +{ + UInt32 numProcessed = 0; + UInt32 curPos = 2; + UInt32 limit = kMtBtBlockSize - (p->matchMaxLen * 2); + distances[1] = p->hashNumAvail; + while (curPos < limit) + { + if (p->hashBufPos == p->hashBufPosLimit) + { + MatchFinderMt_GetNextBlock_Hash(p); + distances[1] = numProcessed + p->hashNumAvail; + if (p->hashNumAvail >= p->numHashBytes) + continue; + for (; p->hashNumAvail != 0; p->hashNumAvail--) + distances[curPos++] = 0; + break; + } + { + UInt32 size = p->hashBufPosLimit - p->hashBufPos; + UInt32 lenLimit = p->matchMaxLen; + UInt32 pos = p->pos; + UInt32 cyclicBufferPos = p->cyclicBufferPos; + if (lenLimit >= p->hashNumAvail) + lenLimit = p->hashNumAvail; + { + UInt32 size2 = p->hashNumAvail - lenLimit + 1; + if (size2 < size) + size = size2; + size2 = p->cyclicBufferSize - cyclicBufferPos; + if (size2 < size) + size = size2; + } + #ifndef MFMT_GM_INLINE + while (curPos < limit && size-- != 0) + { + UInt32 *startDistances = distances + curPos; + UInt32 num = (UInt32)(GetMatchesSpec1(lenLimit, pos - p->hashBuf[p->hashBufPos++], + pos, p->buffer, p->son, cyclicBufferPos, p->cyclicBufferSize, p->cutValue, + startDistances + 1, p->numHashBytes - 1) - startDistances); + *startDistances = num - 1; + curPos += num; + cyclicBufferPos++; + pos++; + p->buffer++; + } + #else + { + UInt32 posRes; + curPos = limit - GetMatchesSpecN(lenLimit, pos, p->buffer, p->son, cyclicBufferPos, p->cyclicBufferSize, p->cutValue, + distances + curPos, p->numHashBytes - 1, p->hashBuf + p->hashBufPos, (Int32)(limit - curPos) , size, &posRes); + p->hashBufPos += posRes - pos; + cyclicBufferPos += posRes - pos; + p->buffer += posRes - pos; + pos = posRes; + } + #endif + + numProcessed += pos - p->pos; + p->hashNumAvail -= pos - p->pos; + p->pos = pos; + if (cyclicBufferPos == p->cyclicBufferSize) + cyclicBufferPos = 0; + p->cyclicBufferPos = cyclicBufferPos; + } + } + distances[0] = curPos; +} + +void BtFillBlock(CMatchFinderMt *p, UInt32 globalBlockIndex) +{ + CMtSync *sync = &p->hashSync; + if (!sync->needStart) + { + CriticalSection_Enter(&sync->cs); + sync->csWasEntered = True; + } + + BtGetMatches(p, p->btBuf + (globalBlockIndex & kMtBtNumBlocksMask) * kMtBtBlockSize); + + if (p->pos > kMtMaxValForNormalize - kMtBtBlockSize) + { + UInt32 subValue = p->pos - p->cyclicBufferSize; + MatchFinder_Normalize3(subValue, p->son, p->cyclicBufferSize * 2); + p->pos -= subValue; + } + + if (!sync->needStart) + { + CriticalSection_Leave(&sync->cs); + sync->csWasEntered = False; + } +} + +void BtThreadFunc(CMatchFinderMt *mt) +{ + CMtSync *p = &mt->btSync; + for (;;) + { + UInt32 blockIndex = 0; + Event_Wait(&p->canStart); + Event_Set(&p->wasStarted); + for (;;) + { + if (p->exit) + return; + if (p->stopWriting) + { + p->numProcessedBlocks = blockIndex; + MtSync_StopWriting(&mt->hashSync); + Event_Set(&p->wasStopped); + break; + } + Semaphore_Wait(&p->freeSemaphore); + BtFillBlock(mt, blockIndex++); + Semaphore_Release1(&p->filledSemaphore); + } + } +} + +void MatchFinderMt_Construct(CMatchFinderMt *p) +{ + p->hashBuf = 0; + MtSync_Construct(&p->hashSync); + MtSync_Construct(&p->btSync); +} + +void MatchFinderMt_FreeMem(CMatchFinderMt *p, ISzAlloc *alloc) +{ + alloc->Free(alloc, p->hashBuf); + p->hashBuf = 0; +} + +void MatchFinderMt_Destruct(CMatchFinderMt *p, ISzAlloc *alloc) +{ + MtSync_Destruct(&p->hashSync); + MtSync_Destruct(&p->btSync); + MatchFinderMt_FreeMem(p, alloc); +} + +#define kHashBufferSize (kMtHashBlockSize * kMtHashNumBlocks) +#define kBtBufferSize (kMtBtBlockSize * kMtBtNumBlocks) + +static unsigned MY_STD_CALL HashThreadFunc2(void *p) { HashThreadFunc((CMatchFinderMt *)p); return 0; } +static unsigned MY_STD_CALL BtThreadFunc2(void *p) +{ + Byte allocaDummy[0x180]; + int i = 0; + for (i = 0; i < 16; i++) + allocaDummy[i] = (Byte)i; + BtThreadFunc((CMatchFinderMt *)p); + return 0; +} + +SRes MatchFinderMt_Create(CMatchFinderMt *p, UInt32 historySize, UInt32 keepAddBufferBefore, + UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ISzAlloc *alloc) +{ + CMatchFinder *mf = p->MatchFinder; + p->historySize = historySize; + if (kMtBtBlockSize <= matchMaxLen * 4) + return SZ_ERROR_PARAM; + if (p->hashBuf == 0) + { + p->hashBuf = (UInt32 *)alloc->Alloc(alloc, (kHashBufferSize + kBtBufferSize) * sizeof(UInt32)); + if (p->hashBuf == 0) + return SZ_ERROR_MEM; + p->btBuf = p->hashBuf + kHashBufferSize; + } + keepAddBufferBefore += (kHashBufferSize + kBtBufferSize); + keepAddBufferAfter += kMtHashBlockSize; + if (!MatchFinder_Create(mf, historySize, keepAddBufferBefore, matchMaxLen, keepAddBufferAfter, alloc)) + return SZ_ERROR_MEM; + + RINOK(MtSync_Create(&p->hashSync, HashThreadFunc2, p, kMtHashNumBlocks)); + RINOK(MtSync_Create(&p->btSync, BtThreadFunc2, p, kMtBtNumBlocks)); + return SZ_OK; +} + +/* Call it after ReleaseStream / SetStream */ +void MatchFinderMt_Init(CMatchFinderMt *p) +{ + CMatchFinder *mf = p->MatchFinder; + p->btBufPos = p->btBufPosLimit = 0; + p->hashBufPos = p->hashBufPosLimit = 0; + MatchFinder_Init(mf); + p->pointerToCurPos = MatchFinder_GetPointerToCurrentPos(mf); + p->btNumAvailBytes = 0; + p->lzPos = p->historySize + 1; + + p->hash = mf->hash; + p->fixedHashSize = mf->fixedHashSize; + p->crc = mf->crc; + + p->son = mf->son; + p->matchMaxLen = mf->matchMaxLen; + p->numHashBytes = mf->numHashBytes; + p->pos = mf->pos; + p->buffer = mf->buffer; + p->cyclicBufferPos = mf->cyclicBufferPos; + p->cyclicBufferSize = mf->cyclicBufferSize; + p->cutValue = mf->cutValue; +} + +/* ReleaseStream is required to finish multithreading */ +void MatchFinderMt_ReleaseStream(CMatchFinderMt *p) +{ + MtSync_StopWriting(&p->btSync); + /* p->MatchFinder->ReleaseStream(); */ +} + +void MatchFinderMt_Normalize(CMatchFinderMt *p) +{ + MatchFinder_Normalize3(p->lzPos - p->historySize - 1, p->hash, p->fixedHashSize); + p->lzPos = p->historySize + 1; +} + +void MatchFinderMt_GetNextBlock_Bt(CMatchFinderMt *p) +{ + UInt32 blockIndex; + MtSync_GetNextBlock(&p->btSync); + blockIndex = ((p->btSync.numProcessedBlocks - 1) & kMtBtNumBlocksMask); + p->btBufPosLimit = p->btBufPos = blockIndex * kMtBtBlockSize; + p->btBufPosLimit += p->btBuf[p->btBufPos++]; + p->btNumAvailBytes = p->btBuf[p->btBufPos++]; + if (p->lzPos >= kMtMaxValForNormalize - kMtBtBlockSize) + MatchFinderMt_Normalize(p); +} + +const Byte * MatchFinderMt_GetPointerToCurrentPos(CMatchFinderMt *p) +{ + return p->pointerToCurPos; +} + +#define GET_NEXT_BLOCK_IF_REQUIRED if (p->btBufPos == p->btBufPosLimit) MatchFinderMt_GetNextBlock_Bt(p); + +UInt32 MatchFinderMt_GetNumAvailableBytes(CMatchFinderMt *p) +{ + GET_NEXT_BLOCK_IF_REQUIRED; + return p->btNumAvailBytes; +} + +Byte MatchFinderMt_GetIndexByte(CMatchFinderMt *p, Int32 index) +{ + return p->pointerToCurPos[index]; +} + +UInt32 * MixMatches2(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances) +{ + UInt32 hash2Value, curMatch2; + UInt32 *hash = p->hash; + const Byte *cur = p->pointerToCurPos; + UInt32 lzPos = p->lzPos; + MT_HASH2_CALC + + curMatch2 = hash[hash2Value]; + hash[hash2Value] = lzPos; + + if (curMatch2 >= matchMinPos) + if (cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0]) + { + *distances++ = 2; + *distances++ = lzPos - curMatch2 - 1; + } + return distances; +} + +UInt32 * MixMatches3(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances) +{ + UInt32 hash2Value, hash3Value, curMatch2, curMatch3; + UInt32 *hash = p->hash; + const Byte *cur = p->pointerToCurPos; + UInt32 lzPos = p->lzPos; + MT_HASH3_CALC + + curMatch2 = hash[ hash2Value]; + curMatch3 = hash[kFix3HashSize + hash3Value]; + + hash[ hash2Value] = + hash[kFix3HashSize + hash3Value] = + lzPos; + + if (curMatch2 >= matchMinPos && cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0]) + { + distances[1] = lzPos - curMatch2 - 1; + if (cur[(ptrdiff_t)curMatch2 - lzPos + 2] == cur[2]) + { + distances[0] = 3; + return distances + 2; + } + distances[0] = 2; + distances += 2; + } + if (curMatch3 >= matchMinPos && cur[(ptrdiff_t)curMatch3 - lzPos] == cur[0]) + { + *distances++ = 3; + *distances++ = lzPos - curMatch3 - 1; + } + return distances; +} + +/* +UInt32 *MixMatches4(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances) +{ + UInt32 hash2Value, hash3Value, hash4Value, curMatch2, curMatch3, curMatch4; + UInt32 *hash = p->hash; + const Byte *cur = p->pointerToCurPos; + UInt32 lzPos = p->lzPos; + MT_HASH4_CALC + + curMatch2 = hash[ hash2Value]; + curMatch3 = hash[kFix3HashSize + hash3Value]; + curMatch4 = hash[kFix4HashSize + hash4Value]; + + hash[ hash2Value] = + hash[kFix3HashSize + hash3Value] = + hash[kFix4HashSize + hash4Value] = + lzPos; + + if (curMatch2 >= matchMinPos && cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0]) + { + distances[1] = lzPos - curMatch2 - 1; + if (cur[(ptrdiff_t)curMatch2 - lzPos + 2] == cur[2]) + { + distances[0] = (cur[(ptrdiff_t)curMatch2 - lzPos + 3] == cur[3]) ? 4 : 3; + return distances + 2; + } + distances[0] = 2; + distances += 2; + } + if (curMatch3 >= matchMinPos && cur[(ptrdiff_t)curMatch3 - lzPos] == cur[0]) + { + distances[1] = lzPos - curMatch3 - 1; + if (cur[(ptrdiff_t)curMatch3 - lzPos + 3] == cur[3]) + { + distances[0] = 4; + return distances + 2; + } + distances[0] = 3; + distances += 2; + } + + if (curMatch4 >= matchMinPos) + if ( + cur[(ptrdiff_t)curMatch4 - lzPos] == cur[0] && + cur[(ptrdiff_t)curMatch4 - lzPos + 3] == cur[3] + ) + { + *distances++ = 4; + *distances++ = lzPos - curMatch4 - 1; + } + return distances; +} +*/ + +#define INCREASE_LZ_POS p->lzPos++; p->pointerToCurPos++; + +UInt32 MatchFinderMt2_GetMatches(CMatchFinderMt *p, UInt32 *distances) +{ + const UInt32 *btBuf = p->btBuf + p->btBufPos; + UInt32 len = *btBuf++; + p->btBufPos += 1 + len; + p->btNumAvailBytes--; + { + UInt32 i; + for (i = 0; i < len; i += 2) + { + *distances++ = *btBuf++; + *distances++ = *btBuf++; + } + } + INCREASE_LZ_POS + return len; +} + +UInt32 MatchFinderMt_GetMatches(CMatchFinderMt *p, UInt32 *distances) +{ + const UInt32 *btBuf = p->btBuf + p->btBufPos; + UInt32 len = *btBuf++; + p->btBufPos += 1 + len; + + if (len == 0) + { + if (p->btNumAvailBytes-- >= 4) + len = (UInt32)(p->MixMatchesFunc(p, p->lzPos - p->historySize, distances) - (distances)); + } + else + { + /* Condition: there are matches in btBuf with length < p->numHashBytes */ + UInt32 *distances2; + p->btNumAvailBytes--; + distances2 = p->MixMatchesFunc(p, p->lzPos - btBuf[1], distances); + do + { + *distances2++ = *btBuf++; + *distances2++ = *btBuf++; + } + while ((len -= 2) != 0); + len = (UInt32)(distances2 - (distances)); + } + INCREASE_LZ_POS + return len; +} + +#define SKIP_HEADER2 do { GET_NEXT_BLOCK_IF_REQUIRED +#define SKIP_HEADER(n) SKIP_HEADER2 if (p->btNumAvailBytes-- >= (n)) { const Byte *cur = p->pointerToCurPos; UInt32 *hash = p->hash; +#define SKIP_FOOTER } INCREASE_LZ_POS p->btBufPos += p->btBuf[p->btBufPos] + 1; } while (--num != 0); + +void MatchFinderMt0_Skip(CMatchFinderMt *p, UInt32 num) +{ + SKIP_HEADER2 { p->btNumAvailBytes--; + SKIP_FOOTER +} + +void MatchFinderMt2_Skip(CMatchFinderMt *p, UInt32 num) +{ + SKIP_HEADER(2) + UInt32 hash2Value; + MT_HASH2_CALC + hash[hash2Value] = p->lzPos; + SKIP_FOOTER +} + +void MatchFinderMt3_Skip(CMatchFinderMt *p, UInt32 num) +{ + SKIP_HEADER(3) + UInt32 hash2Value, hash3Value; + MT_HASH3_CALC + hash[kFix3HashSize + hash3Value] = + hash[ hash2Value] = + p->lzPos; + SKIP_FOOTER +} + +/* +void MatchFinderMt4_Skip(CMatchFinderMt *p, UInt32 num) +{ + SKIP_HEADER(4) + UInt32 hash2Value, hash3Value, hash4Value; + MT_HASH4_CALC + hash[kFix4HashSize + hash4Value] = + hash[kFix3HashSize + hash3Value] = + hash[ hash2Value] = + p->lzPos; + SKIP_FOOTER +} +*/ + +void MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder *vTable) +{ + vTable->Init = (Mf_Init_Func)MatchFinderMt_Init; + vTable->GetIndexByte = (Mf_GetIndexByte_Func)MatchFinderMt_GetIndexByte; + vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinderMt_GetNumAvailableBytes; + vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinderMt_GetPointerToCurrentPos; + vTable->GetMatches = (Mf_GetMatches_Func)MatchFinderMt_GetMatches; + switch(p->MatchFinder->numHashBytes) + { + case 2: + p->GetHeadsFunc = GetHeads2; + p->MixMatchesFunc = (Mf_Mix_Matches)0; + vTable->Skip = (Mf_Skip_Func)MatchFinderMt0_Skip; + vTable->GetMatches = (Mf_GetMatches_Func)MatchFinderMt2_GetMatches; + break; + case 3: + p->GetHeadsFunc = GetHeads3; + p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches2; + vTable->Skip = (Mf_Skip_Func)MatchFinderMt2_Skip; + break; + default: + /* case 4: */ + p->GetHeadsFunc = p->MatchFinder->bigHash ? GetHeads4b : GetHeads4; + /* p->GetHeadsFunc = GetHeads4; */ + p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches3; + vTable->Skip = (Mf_Skip_Func)MatchFinderMt3_Skip; + break; + /* + default: + p->GetHeadsFunc = GetHeads5; + p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches4; + vTable->Skip = (Mf_Skip_Func)MatchFinderMt4_Skip; + break; + */ + } +} diff --git a/extern/lzma/LzFindMt.h b/extern/lzma/LzFindMt.h new file mode 100644 index 00000000000..2c7e462d592 --- /dev/null +++ b/extern/lzma/LzFindMt.h @@ -0,0 +1,97 @@ +/* LzFindMt.h -- multithreaded Match finder for LZ algorithms +2008-10-04 : Igor Pavlov : Public domain */ + +#ifndef __LZFINDMT_H +#define __LZFINDMT_H + +#include "Threads.h" +#include "LzFind.h" + +#define kMtHashBlockSize (1 << 13) +#define kMtHashNumBlocks (1 << 3) +#define kMtHashNumBlocksMask (kMtHashNumBlocks - 1) + +#define kMtBtBlockSize (1 << 14) +#define kMtBtNumBlocks (1 << 6) +#define kMtBtNumBlocksMask (kMtBtNumBlocks - 1) + +typedef struct _CMtSync +{ + Bool wasCreated; + Bool needStart; + Bool exit; + Bool stopWriting; + + CThread thread; + CAutoResetEvent canStart; + CAutoResetEvent wasStarted; + CAutoResetEvent wasStopped; + CSemaphore freeSemaphore; + CSemaphore filledSemaphore; + Bool csWasInitialized; + Bool csWasEntered; + CCriticalSection cs; + UInt32 numProcessedBlocks; +} CMtSync; + +typedef UInt32 * (*Mf_Mix_Matches)(void *p, UInt32 matchMinPos, UInt32 *distances); + +/* kMtCacheLineDummy must be >= size_of_CPU_cache_line */ +#define kMtCacheLineDummy 128 + +typedef void (*Mf_GetHeads)(const Byte *buffer, UInt32 pos, + UInt32 *hash, UInt32 hashMask, UInt32 *heads, UInt32 numHeads, const UInt32 *crc); + +typedef struct _CMatchFinderMt +{ + /* LZ */ + const Byte *pointerToCurPos; + UInt32 *btBuf; + UInt32 btBufPos; + UInt32 btBufPosLimit; + UInt32 lzPos; + UInt32 btNumAvailBytes; + + UInt32 *hash; + UInt32 fixedHashSize; + UInt32 historySize; + const UInt32 *crc; + + Mf_Mix_Matches MixMatchesFunc; + + /* LZ + BT */ + CMtSync btSync; + Byte btDummy[kMtCacheLineDummy]; + + /* BT */ + UInt32 *hashBuf; + UInt32 hashBufPos; + UInt32 hashBufPosLimit; + UInt32 hashNumAvail; + + CLzRef *son; + UInt32 matchMaxLen; + UInt32 numHashBytes; + UInt32 pos; + Byte *buffer; + UInt32 cyclicBufferPos; + UInt32 cyclicBufferSize; /* it must be historySize + 1 */ + UInt32 cutValue; + + /* BT + Hash */ + CMtSync hashSync; + /* Byte hashDummy[kMtCacheLineDummy]; */ + + /* Hash */ + Mf_GetHeads GetHeadsFunc; + CMatchFinder *MatchFinder; +} CMatchFinderMt; + +void MatchFinderMt_Construct(CMatchFinderMt *p); +void MatchFinderMt_Destruct(CMatchFinderMt *p, ISzAlloc *alloc); +SRes MatchFinderMt_Create(CMatchFinderMt *p, UInt32 historySize, UInt32 keepAddBufferBefore, + UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ISzAlloc *alloc); +void MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder *vTable); +void MatchFinderMt_ReleaseStream(CMatchFinderMt *p); + +#endif diff --git a/extern/lzma/LzHash.h b/extern/lzma/LzHash.h new file mode 100644 index 00000000000..9f4173e7e33 --- /dev/null +++ b/extern/lzma/LzHash.h @@ -0,0 +1,54 @@ +/* LzHash.h -- HASH functions for LZ algorithms +2008-10-04 : Igor Pavlov : Public domain */ + +#ifndef __LZHASH_H +#define __LZHASH_H + +#define kHash2Size (1 << 10) +#define kHash3Size (1 << 16) +#define kHash4Size (1 << 20) + +#define kFix3HashSize (kHash2Size) +#define kFix4HashSize (kHash2Size + kHash3Size) +#define kFix5HashSize (kHash2Size + kHash3Size + kHash4Size) + +#define HASH2_CALC hashValue = cur[0] | ((UInt32)cur[1] << 8); + +#define HASH3_CALC { \ + UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ + hash2Value = temp & (kHash2Size - 1); \ + hashValue = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; } + +#define HASH4_CALC { \ + UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ + hash2Value = temp & (kHash2Size - 1); \ + hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ + hashValue = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & p->hashMask; } + +#define HASH5_CALC { \ + UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ + hash2Value = temp & (kHash2Size - 1); \ + hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ + hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)); \ + hashValue = (hash4Value ^ (p->crc[cur[4]] << 3)) & p->hashMask; \ + hash4Value &= (kHash4Size - 1); } + +/* #define HASH_ZIP_CALC hashValue = ((cur[0] | ((UInt32)cur[1] << 8)) ^ p->crc[cur[2]]) & 0xFFFF; */ +#define HASH_ZIP_CALC hashValue = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF; + + +#define MT_HASH2_CALC \ + hash2Value = (p->crc[cur[0]] ^ cur[1]) & (kHash2Size - 1); + +#define MT_HASH3_CALC { \ + UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ + hash2Value = temp & (kHash2Size - 1); \ + hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); } + +#define MT_HASH4_CALC { \ + UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ + hash2Value = temp & (kHash2Size - 1); \ + hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ + hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & (kHash4Size - 1); } + +#endif diff --git a/extern/lzma/LzmaDec.c b/extern/lzma/LzmaDec.c new file mode 100644 index 00000000000..d87eb1914ea --- /dev/null +++ b/extern/lzma/LzmaDec.c @@ -0,0 +1,1007 @@ +/* LzmaDec.c -- LZMA Decoder +2008-11-06 : Igor Pavlov : Public domain */ + +#include "LzmaDec.h" + +#include + +#define kNumTopBits 24 +#define kTopValue ((UInt32)1 << kNumTopBits) + +#define kNumBitModelTotalBits 11 +#define kBitModelTotal (1 << kNumBitModelTotalBits) +#define kNumMoveBits 5 + +#define RC_INIT_SIZE 5 + +#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); } + +#define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound) +#define UPDATE_0(p) range = bound; *(p) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); +#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits)); +#define GET_BIT2(p, i, A0, A1) IF_BIT_0(p) \ + { UPDATE_0(p); i = (i + i); A0; } else \ + { UPDATE_1(p); i = (i + i) + 1; A1; } +#define GET_BIT(p, i) GET_BIT2(p, i, ; , ;) + +#define TREE_GET_BIT(probs, i) { GET_BIT((probs + i), i); } +#define TREE_DECODE(probs, limit, i) \ + { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; } + +/* #define _LZMA_SIZE_OPT */ + +#ifdef _LZMA_SIZE_OPT +#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i) +#else +#define TREE_6_DECODE(probs, i) \ + { i = 1; \ + TREE_GET_BIT(probs, i); \ + TREE_GET_BIT(probs, i); \ + TREE_GET_BIT(probs, i); \ + TREE_GET_BIT(probs, i); \ + TREE_GET_BIT(probs, i); \ + TREE_GET_BIT(probs, i); \ + i -= 0x40; } +#endif + +#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); } + +#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound) +#define UPDATE_0_CHECK range = bound; +#define UPDATE_1_CHECK range -= bound; code -= bound; +#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \ + { UPDATE_0_CHECK; i = (i + i); A0; } else \ + { UPDATE_1_CHECK; i = (i + i) + 1; A1; } +#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;) +#define TREE_DECODE_CHECK(probs, limit, i) \ + { i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; } + + +#define kNumPosBitsMax 4 +#define kNumPosStatesMax (1 << kNumPosBitsMax) + +#define kLenNumLowBits 3 +#define kLenNumLowSymbols (1 << kLenNumLowBits) +#define kLenNumMidBits 3 +#define kLenNumMidSymbols (1 << kLenNumMidBits) +#define kLenNumHighBits 8 +#define kLenNumHighSymbols (1 << kLenNumHighBits) + +#define LenChoice 0 +#define LenChoice2 (LenChoice + 1) +#define LenLow (LenChoice2 + 1) +#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits)) +#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits)) +#define kNumLenProbs (LenHigh + kLenNumHighSymbols) + + +#define kNumStates 12 +#define kNumLitStates 7 + +#define kStartPosModelIndex 4 +#define kEndPosModelIndex 14 +#define kNumFullDistances (1 << (kEndPosModelIndex >> 1)) + +#define kNumPosSlotBits 6 +#define kNumLenToPosStates 4 + +#define kNumAlignBits 4 +#define kAlignTableSize (1 << kNumAlignBits) + +#define kMatchMinLen 2 +#define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols) + +#define IsMatch 0 +#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax)) +#define IsRepG0 (IsRep + kNumStates) +#define IsRepG1 (IsRepG0 + kNumStates) +#define IsRepG2 (IsRepG1 + kNumStates) +#define IsRep0Long (IsRepG2 + kNumStates) +#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax)) +#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits)) +#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex) +#define LenCoder (Align + kAlignTableSize) +#define RepLenCoder (LenCoder + kNumLenProbs) +#define Literal (RepLenCoder + kNumLenProbs) + +#define LZMA_BASE_SIZE 1846 +#define LZMA_LIT_SIZE 768 + +#define LzmaProps_GetNumProbs(p) ((UInt32)LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((p)->lc + (p)->lp))) + +#if Literal != LZMA_BASE_SIZE +StopCompilingDueBUG +#endif + +static const Byte kLiteralNextStates[kNumStates * 2] = +{ + 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5, + 7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10 +}; + +#define LZMA_DIC_MIN (1 << 12) + +/* First LZMA-symbol is always decoded. +And it decodes new LZMA-symbols while (buf < bufLimit), but "buf" is without last normalization +Out: + Result: + SZ_OK - OK + SZ_ERROR_DATA - Error + p->remainLen: + < kMatchSpecLenStart : normal remain + = kMatchSpecLenStart : finished + = kMatchSpecLenStart + 1 : Flush marker + = kMatchSpecLenStart + 2 : State Init Marker +*/ + +static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte *bufLimit) +{ + CLzmaProb *probs = p->probs; + + unsigned state = p->state; + UInt32 rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3]; + unsigned pbMask = ((unsigned)1 << (p->prop.pb)) - 1; + unsigned lpMask = ((unsigned)1 << (p->prop.lp)) - 1; + unsigned lc = p->prop.lc; + + Byte *dic = p->dic; + SizeT dicBufSize = p->dicBufSize; + SizeT dicPos = p->dicPos; + + UInt32 processedPos = p->processedPos; + UInt32 checkDicSize = p->checkDicSize; + unsigned len = 0; + + const Byte *buf = p->buf; + UInt32 range = p->range; + UInt32 code = p->code; + + do + { + CLzmaProb *prob; + UInt32 bound; + unsigned ttt; + unsigned posState = processedPos & pbMask; + + prob = probs + IsMatch + (state << kNumPosBitsMax) + posState; + IF_BIT_0(prob) + { + unsigned symbol; + UPDATE_0(prob); + prob = probs + Literal; + if (checkDicSize != 0 || processedPos != 0) + prob += (LZMA_LIT_SIZE * (((processedPos & lpMask) << lc) + + (dic[(dicPos == 0 ? dicBufSize : dicPos) - 1] >> (8 - lc)))); + + if (state < kNumLitStates) + { + symbol = 1; + do { GET_BIT(prob + symbol, symbol) } while (symbol < 0x100); + } + else + { + unsigned matchByte = p->dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; + unsigned offs = 0x100; + symbol = 1; + do + { + unsigned bit; + CLzmaProb *probLit; + matchByte <<= 1; + bit = (matchByte & offs); + probLit = prob + offs + bit + symbol; + GET_BIT2(probLit, symbol, offs &= ~bit, offs &= bit) + } + while (symbol < 0x100); + } + dic[dicPos++] = (Byte)symbol; + processedPos++; + + state = kLiteralNextStates[state]; + /* if (state < 4) state = 0; else if (state < 10) state -= 3; else state -= 6; */ + continue; + } + else + { + UPDATE_1(prob); + prob = probs + IsRep + state; + IF_BIT_0(prob) + { + UPDATE_0(prob); + state += kNumStates; + prob = probs + LenCoder; + } + else + { + UPDATE_1(prob); + if (checkDicSize == 0 && processedPos == 0) + return SZ_ERROR_DATA; + prob = probs + IsRepG0 + state; + IF_BIT_0(prob) + { + UPDATE_0(prob); + prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState; + IF_BIT_0(prob) + { + UPDATE_0(prob); + dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; + dicPos++; + processedPos++; + state = state < kNumLitStates ? 9 : 11; + continue; + } + UPDATE_1(prob); + } + else + { + UInt32 distance; + UPDATE_1(prob); + prob = probs + IsRepG1 + state; + IF_BIT_0(prob) + { + UPDATE_0(prob); + distance = rep1; + } + else + { + UPDATE_1(prob); + prob = probs + IsRepG2 + state; + IF_BIT_0(prob) + { + UPDATE_0(prob); + distance = rep2; + } + else + { + UPDATE_1(prob); + distance = rep3; + rep3 = rep2; + } + rep2 = rep1; + } + rep1 = rep0; + rep0 = distance; + } + state = state < kNumLitStates ? 8 : 11; + prob = probs + RepLenCoder; + } + { + unsigned limit, offset; + CLzmaProb *probLen = prob + LenChoice; + IF_BIT_0(probLen) + { + UPDATE_0(probLen); + probLen = prob + LenLow + (posState << kLenNumLowBits); + offset = 0; + limit = (1 << kLenNumLowBits); + } + else + { + UPDATE_1(probLen); + probLen = prob + LenChoice2; + IF_BIT_0(probLen) + { + UPDATE_0(probLen); + probLen = prob + LenMid + (posState << kLenNumMidBits); + offset = kLenNumLowSymbols; + limit = (1 << kLenNumMidBits); + } + else + { + UPDATE_1(probLen); + probLen = prob + LenHigh; + offset = kLenNumLowSymbols + kLenNumMidSymbols; + limit = (1 << kLenNumHighBits); + } + } + TREE_DECODE(probLen, limit, len); + len += offset; + } + + if (state >= kNumStates) + { + UInt32 distance; + prob = probs + PosSlot + + ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << kNumPosSlotBits); + TREE_6_DECODE(prob, distance); + if (distance >= kStartPosModelIndex) + { + unsigned posSlot = (unsigned)distance; + int numDirectBits = (int)(((distance >> 1) - 1)); + distance = (2 | (distance & 1)); + if (posSlot < kEndPosModelIndex) + { + distance <<= numDirectBits; + prob = probs + SpecPos + distance - posSlot - 1; + { + UInt32 mask = 1; + unsigned i = 1; + do + { + GET_BIT2(prob + i, i, ; , distance |= mask); + mask <<= 1; + } + while (--numDirectBits != 0); + } + } + else + { + numDirectBits -= kNumAlignBits; + do + { + NORMALIZE + range >>= 1; + + { + UInt32 t; + code -= range; + t = (0 - ((UInt32)code >> 31)); /* (UInt32)((Int32)code >> 31) */ + distance = (distance << 1) + (t + 1); + code += range & t; + } + /* + distance <<= 1; + if (code >= range) + { + code -= range; + distance |= 1; + } + */ + } + while (--numDirectBits != 0); + prob = probs + Align; + distance <<= kNumAlignBits; + { + unsigned i = 1; + GET_BIT2(prob + i, i, ; , distance |= 1); + GET_BIT2(prob + i, i, ; , distance |= 2); + GET_BIT2(prob + i, i, ; , distance |= 4); + GET_BIT2(prob + i, i, ; , distance |= 8); + } + if (distance == (UInt32)0xFFFFFFFF) + { + len += kMatchSpecLenStart; + state -= kNumStates; + break; + } + } + } + rep3 = rep2; + rep2 = rep1; + rep1 = rep0; + rep0 = distance + 1; + if (checkDicSize == 0) + { + if (distance >= processedPos) + return SZ_ERROR_DATA; + } + else if (distance >= checkDicSize) + return SZ_ERROR_DATA; + state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3; + /* state = kLiteralNextStates[state]; */ + } + + len += kMatchMinLen; + + if (limit == dicPos) + return SZ_ERROR_DATA; + { + SizeT rem = limit - dicPos; + unsigned curLen = ((rem < len) ? (unsigned)rem : len); + SizeT pos = (dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0); + + processedPos += curLen; + + len -= curLen; + if (pos + curLen <= dicBufSize) + { + Byte *dest = dic + dicPos; + ptrdiff_t src = (ptrdiff_t)pos - (ptrdiff_t)dicPos; + const Byte *lim = dest + curLen; + dicPos += curLen; + do + *(dest) = (Byte)*(dest + src); + while (++dest != lim); + } + else + { + do + { + dic[dicPos++] = dic[pos]; + if (++pos == dicBufSize) + pos = 0; + } + while (--curLen != 0); + } + } + } + } + while (dicPos < limit && buf < bufLimit); + NORMALIZE; + p->buf = buf; + p->range = range; + p->code = code; + p->remainLen = len; + p->dicPos = dicPos; + p->processedPos = processedPos; + p->reps[0] = rep0; + p->reps[1] = rep1; + p->reps[2] = rep2; + p->reps[3] = rep3; + p->state = state; + + return SZ_OK; +} + +static void MY_FAST_CALL LzmaDec_WriteRem(CLzmaDec *p, SizeT limit) +{ + if (p->remainLen != 0 && p->remainLen < kMatchSpecLenStart) + { + Byte *dic = p->dic; + SizeT dicPos = p->dicPos; + SizeT dicBufSize = p->dicBufSize; + unsigned len = p->remainLen; + UInt32 rep0 = p->reps[0]; + if (limit - dicPos < len) + len = (unsigned)(limit - dicPos); + + if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len) + p->checkDicSize = p->prop.dicSize; + + p->processedPos += len; + p->remainLen -= len; + while (len-- != 0) + { + dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; + dicPos++; + } + p->dicPos = dicPos; + } +} + +static int MY_FAST_CALL LzmaDec_DecodeReal2(CLzmaDec *p, SizeT limit, const Byte *bufLimit) +{ + do + { + SizeT limit2 = limit; + if (p->checkDicSize == 0) + { + UInt32 rem = p->prop.dicSize - p->processedPos; + if (limit - p->dicPos > rem) + limit2 = p->dicPos + rem; + } + RINOK(LzmaDec_DecodeReal(p, limit2, bufLimit)); + if (p->processedPos >= p->prop.dicSize) + p->checkDicSize = p->prop.dicSize; + LzmaDec_WriteRem(p, limit); + } + while (p->dicPos < limit && p->buf < bufLimit && p->remainLen < kMatchSpecLenStart); + + if (p->remainLen > kMatchSpecLenStart) + { + p->remainLen = kMatchSpecLenStart; + } + return 0; +} + +typedef enum +{ + DUMMY_ERROR, /* unexpected end of input stream */ + DUMMY_LIT, + DUMMY_MATCH, + DUMMY_REP +} ELzmaDummy; + +static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inSize) +{ + UInt32 range = p->range; + UInt32 code = p->code; + const Byte *bufLimit = buf + inSize; + CLzmaProb *probs = p->probs; + unsigned state = p->state; + ELzmaDummy res; + + { + CLzmaProb *prob; + UInt32 bound; + unsigned ttt; + unsigned posState = (p->processedPos) & ((1 << p->prop.pb) - 1); + + prob = probs + IsMatch + (state << kNumPosBitsMax) + posState; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK + + /* if (bufLimit - buf >= 7) return DUMMY_LIT; */ + + prob = probs + Literal; + if (p->checkDicSize != 0 || p->processedPos != 0) + prob += (LZMA_LIT_SIZE * + ((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) + + (p->dic[(p->dicPos == 0 ? p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc)))); + + if (state < kNumLitStates) + { + unsigned symbol = 1; + do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100); + } + else + { + unsigned matchByte = p->dic[p->dicPos - p->reps[0] + + ((p->dicPos < p->reps[0]) ? p->dicBufSize : 0)]; + unsigned offs = 0x100; + unsigned symbol = 1; + do + { + unsigned bit; + CLzmaProb *probLit; + matchByte <<= 1; + bit = (matchByte & offs); + probLit = prob + offs + bit + symbol; + GET_BIT2_CHECK(probLit, symbol, offs &= ~bit, offs &= bit) + } + while (symbol < 0x100); + } + res = DUMMY_LIT; + } + else + { + unsigned len; + UPDATE_1_CHECK; + + prob = probs + IsRep + state; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK; + state = 0; + prob = probs + LenCoder; + res = DUMMY_MATCH; + } + else + { + UPDATE_1_CHECK; + res = DUMMY_REP; + prob = probs + IsRepG0 + state; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK; + prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK; + NORMALIZE_CHECK; + return DUMMY_REP; + } + else + { + UPDATE_1_CHECK; + } + } + else + { + UPDATE_1_CHECK; + prob = probs + IsRepG1 + state; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK; + } + else + { + UPDATE_1_CHECK; + prob = probs + IsRepG2 + state; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK; + } + else + { + UPDATE_1_CHECK; + } + } + } + state = kNumStates; + prob = probs + RepLenCoder; + } + { + unsigned limit, offset; + CLzmaProb *probLen = prob + LenChoice; + IF_BIT_0_CHECK(probLen) + { + UPDATE_0_CHECK; + probLen = prob + LenLow + (posState << kLenNumLowBits); + offset = 0; + limit = 1 << kLenNumLowBits; + } + else + { + UPDATE_1_CHECK; + probLen = prob + LenChoice2; + IF_BIT_0_CHECK(probLen) + { + UPDATE_0_CHECK; + probLen = prob + LenMid + (posState << kLenNumMidBits); + offset = kLenNumLowSymbols; + limit = 1 << kLenNumMidBits; + } + else + { + UPDATE_1_CHECK; + probLen = prob + LenHigh; + offset = kLenNumLowSymbols + kLenNumMidSymbols; + limit = 1 << kLenNumHighBits; + } + } + TREE_DECODE_CHECK(probLen, limit, len); + len += offset; + } + + if (state < 4) + { + unsigned posSlot; + prob = probs + PosSlot + + ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << + kNumPosSlotBits); + TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot); + if (posSlot >= kStartPosModelIndex) + { + int numDirectBits = ((posSlot >> 1) - 1); + + /* if (bufLimit - buf >= 8) return DUMMY_MATCH; */ + + if (posSlot < kEndPosModelIndex) + { + prob = probs + SpecPos + ((2 | (posSlot & 1)) << numDirectBits) - posSlot - 1; + } + else + { + numDirectBits -= kNumAlignBits; + do + { + NORMALIZE_CHECK + range >>= 1; + code -= range & (((code - range) >> 31) - 1); + /* if (code >= range) code -= range; */ + } + while (--numDirectBits != 0); + prob = probs + Align; + numDirectBits = kNumAlignBits; + } + { + unsigned i = 1; + do + { + GET_BIT_CHECK(prob + i, i); + } + while (--numDirectBits != 0); + } + } + } + } + } + NORMALIZE_CHECK; + return res; +} + + +static void LzmaDec_InitRc(CLzmaDec *p, const Byte *data) +{ + p->code = ((UInt32)data[1] << 24) | ((UInt32)data[2] << 16) | ((UInt32)data[3] << 8) | ((UInt32)data[4]); + p->range = 0xFFFFFFFF; + p->needFlush = 0; +} + +void LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState) +{ + p->needFlush = 1; + p->remainLen = 0; + p->tempBufSize = 0; + + if (initDic) + { + p->processedPos = 0; + p->checkDicSize = 0; + p->needInitState = 1; + } + if (initState) + p->needInitState = 1; +} + +void LzmaDec_Init(CLzmaDec *p) +{ + p->dicPos = 0; + LzmaDec_InitDicAndState(p, True, True); +} + +static void LzmaDec_InitStateReal(CLzmaDec *p) +{ + UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (p->prop.lc + p->prop.lp)); + UInt32 i; + CLzmaProb *probs = p->probs; + for (i = 0; i < numProbs; i++) + probs[i] = kBitModelTotal >> 1; + p->reps[0] = p->reps[1] = p->reps[2] = p->reps[3] = 1; + p->state = 0; + p->needInitState = 0; +} + +SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen, + ELzmaFinishMode finishMode, ELzmaStatus *status) +{ + SizeT inSize = *srcLen; + (*srcLen) = 0; + LzmaDec_WriteRem(p, dicLimit); + + *status = LZMA_STATUS_NOT_SPECIFIED; + + while (p->remainLen != kMatchSpecLenStart) + { + int checkEndMarkNow; + + if (p->needFlush != 0) + { + for (; inSize > 0 && p->tempBufSize < RC_INIT_SIZE; (*srcLen)++, inSize--) + p->tempBuf[p->tempBufSize++] = *src++; + if (p->tempBufSize < RC_INIT_SIZE) + { + *status = LZMA_STATUS_NEEDS_MORE_INPUT; + return SZ_OK; + } + if (p->tempBuf[0] != 0) + return SZ_ERROR_DATA; + + LzmaDec_InitRc(p, p->tempBuf); + p->tempBufSize = 0; + } + + checkEndMarkNow = 0; + if (p->dicPos >= dicLimit) + { + if (p->remainLen == 0 && p->code == 0) + { + *status = LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK; + return SZ_OK; + } + if (finishMode == LZMA_FINISH_ANY) + { + *status = LZMA_STATUS_NOT_FINISHED; + return SZ_OK; + } + if (p->remainLen != 0) + { + *status = LZMA_STATUS_NOT_FINISHED; + return SZ_ERROR_DATA; + } + checkEndMarkNow = 1; + } + + if (p->needInitState) + LzmaDec_InitStateReal(p); + + if (p->tempBufSize == 0) + { + SizeT processed; + const Byte *bufLimit; + if (inSize < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) + { + int dummyRes = LzmaDec_TryDummy(p, src, inSize); + if (dummyRes == DUMMY_ERROR) + { + memcpy(p->tempBuf, src, inSize); + p->tempBufSize = (unsigned)inSize; + (*srcLen) += inSize; + *status = LZMA_STATUS_NEEDS_MORE_INPUT; + return SZ_OK; + } + if (checkEndMarkNow && dummyRes != DUMMY_MATCH) + { + *status = LZMA_STATUS_NOT_FINISHED; + return SZ_ERROR_DATA; + } + bufLimit = src; + } + else + bufLimit = src + inSize - LZMA_REQUIRED_INPUT_MAX; + p->buf = src; + if (LzmaDec_DecodeReal2(p, dicLimit, bufLimit) != 0) + return SZ_ERROR_DATA; + processed = (SizeT)(p->buf - src); + (*srcLen) += processed; + src += processed; + inSize -= processed; + } + else + { + unsigned rem = p->tempBufSize, lookAhead = 0; + while (rem < LZMA_REQUIRED_INPUT_MAX && lookAhead < inSize) + p->tempBuf[rem++] = src[lookAhead++]; + p->tempBufSize = rem; + if (rem < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) + { + int dummyRes = LzmaDec_TryDummy(p, p->tempBuf, rem); + if (dummyRes == DUMMY_ERROR) + { + (*srcLen) += lookAhead; + *status = LZMA_STATUS_NEEDS_MORE_INPUT; + return SZ_OK; + } + if (checkEndMarkNow && dummyRes != DUMMY_MATCH) + { + *status = LZMA_STATUS_NOT_FINISHED; + return SZ_ERROR_DATA; + } + } + p->buf = p->tempBuf; + if (LzmaDec_DecodeReal2(p, dicLimit, p->buf) != 0) + return SZ_ERROR_DATA; + lookAhead -= (rem - (unsigned)(p->buf - p->tempBuf)); + (*srcLen) += lookAhead; + src += lookAhead; + inSize -= lookAhead; + p->tempBufSize = 0; + } + } + if (p->code == 0) + *status = LZMA_STATUS_FINISHED_WITH_MARK; + return (p->code == 0) ? SZ_OK : SZ_ERROR_DATA; +} + +SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status) +{ + SizeT outSize = *destLen; + SizeT inSize = *srcLen; + *srcLen = *destLen = 0; + for (;;) + { + SizeT inSizeCur = inSize, outSizeCur, dicPos; + ELzmaFinishMode curFinishMode; + SRes res; + if (p->dicPos == p->dicBufSize) + p->dicPos = 0; + dicPos = p->dicPos; + if (outSize > p->dicBufSize - dicPos) + { + outSizeCur = p->dicBufSize; + curFinishMode = LZMA_FINISH_ANY; + } + else + { + outSizeCur = dicPos + outSize; + curFinishMode = finishMode; + } + + res = LzmaDec_DecodeToDic(p, outSizeCur, src, &inSizeCur, curFinishMode, status); + src += inSizeCur; + inSize -= inSizeCur; + *srcLen += inSizeCur; + outSizeCur = p->dicPos - dicPos; + memcpy(dest, p->dic + dicPos, outSizeCur); + dest += outSizeCur; + outSize -= outSizeCur; + *destLen += outSizeCur; + if (res != 0) + return res; + if (outSizeCur == 0 || outSize == 0) + return SZ_OK; + } +} + +void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc) +{ + alloc->Free(alloc, p->probs); + p->probs = 0; +} + +static void LzmaDec_FreeDict(CLzmaDec *p, ISzAlloc *alloc) +{ + alloc->Free(alloc, p->dic); + p->dic = 0; +} + +void LzmaDec_Free(CLzmaDec *p, ISzAlloc *alloc) +{ + LzmaDec_FreeProbs(p, alloc); + LzmaDec_FreeDict(p, alloc); +} + +SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size) +{ + UInt32 dicSize; + Byte d; + + if (size < LZMA_PROPS_SIZE) + return SZ_ERROR_UNSUPPORTED; + else + dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | ((UInt32)data[4] << 24); + + if (dicSize < LZMA_DIC_MIN) + dicSize = LZMA_DIC_MIN; + p->dicSize = dicSize; + + d = data[0]; + if (d >= (9 * 5 * 5)) + return SZ_ERROR_UNSUPPORTED; + + p->lc = d % 9; + d /= 9; + p->pb = d / 5; + p->lp = d % 5; + + return SZ_OK; +} + +static SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAlloc *alloc) +{ + UInt32 numProbs = LzmaProps_GetNumProbs(propNew); + if (p->probs == 0 || numProbs != p->numProbs) + { + LzmaDec_FreeProbs(p, alloc); + p->probs = (CLzmaProb *)alloc->Alloc(alloc, numProbs * sizeof(CLzmaProb)); + p->numProbs = numProbs; + if (p->probs == 0) + return SZ_ERROR_MEM; + } + return SZ_OK; +} + +SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc) +{ + CLzmaProps propNew; + RINOK(LzmaProps_Decode(&propNew, props, propsSize)); + RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); + p->prop = propNew; + return SZ_OK; +} + +SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc) +{ + CLzmaProps propNew; + SizeT dicBufSize; + RINOK(LzmaProps_Decode(&propNew, props, propsSize)); + RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); + dicBufSize = propNew.dicSize; + if (p->dic == 0 || dicBufSize != p->dicBufSize) + { + LzmaDec_FreeDict(p, alloc); + p->dic = (Byte *)alloc->Alloc(alloc, dicBufSize); + if (p->dic == 0) + { + LzmaDec_FreeProbs(p, alloc); + return SZ_ERROR_MEM; + } + } + p->dicBufSize = dicBufSize; + p->prop = propNew; + return SZ_OK; +} + +SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, + const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, + ELzmaStatus *status, ISzAlloc *alloc) +{ + CLzmaDec p; + SRes res; + SizeT inSize = *srcLen; + SizeT outSize = *destLen; + *srcLen = *destLen = 0; + if (inSize < RC_INIT_SIZE) + return SZ_ERROR_INPUT_EOF; + + LzmaDec_Construct(&p); + res = LzmaDec_AllocateProbs(&p, propData, propSize, alloc); + if (res != 0) + return res; + p.dic = dest; + p.dicBufSize = outSize; + + LzmaDec_Init(&p); + + *srcLen = inSize; + res = LzmaDec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status); + + if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT) + res = SZ_ERROR_INPUT_EOF; + + (*destLen) = p.dicPos; + LzmaDec_FreeProbs(&p, alloc); + return res; +} diff --git a/extern/lzma/LzmaDec.h b/extern/lzma/LzmaDec.h new file mode 100644 index 00000000000..98cdbe94949 --- /dev/null +++ b/extern/lzma/LzmaDec.h @@ -0,0 +1,223 @@ +/* LzmaDec.h -- LZMA Decoder +2008-10-04 : Igor Pavlov : Public domain */ + +#ifndef __LZMADEC_H +#define __LZMADEC_H + +#include "Types.h" + +/* #define _LZMA_PROB32 */ +/* _LZMA_PROB32 can increase the speed on some CPUs, + but memory usage for CLzmaDec::probs will be doubled in that case */ + +#ifdef _LZMA_PROB32 +#define CLzmaProb UInt32 +#else +#define CLzmaProb UInt16 +#endif + + +/* ---------- LZMA Properties ---------- */ + +#define LZMA_PROPS_SIZE 5 + +typedef struct _CLzmaProps +{ + unsigned lc, lp, pb; + UInt32 dicSize; +} CLzmaProps; + +/* LzmaProps_Decode - decodes properties +Returns: + SZ_OK + SZ_ERROR_UNSUPPORTED - Unsupported properties +*/ + +SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size); + + +/* ---------- LZMA Decoder state ---------- */ + +/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case. + Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */ + +#define LZMA_REQUIRED_INPUT_MAX 20 + +typedef struct +{ + CLzmaProps prop; + CLzmaProb *probs; + Byte *dic; + const Byte *buf; + UInt32 range, code; + SizeT dicPos; + SizeT dicBufSize; + UInt32 processedPos; + UInt32 checkDicSize; + unsigned state; + UInt32 reps[4]; + unsigned remainLen; + int needFlush; + int needInitState; + UInt32 numProbs; + unsigned tempBufSize; + Byte tempBuf[LZMA_REQUIRED_INPUT_MAX]; +} CLzmaDec; + +#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; } + +void LzmaDec_Init(CLzmaDec *p); + +/* There are two types of LZMA streams: + 0) Stream with end mark. That end mark adds about 6 bytes to compressed size. + 1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */ + +typedef enum +{ + LZMA_FINISH_ANY, /* finish at any point */ + LZMA_FINISH_END /* block must be finished at the end */ +} ELzmaFinishMode; + +/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!! + + You must use LZMA_FINISH_END, when you know that current output buffer + covers last bytes of block. In other cases you must use LZMA_FINISH_ANY. + + If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK, + and output value of destLen will be less than output buffer size limit. + You can check status result also. + + You can use multiple checks to test data integrity after full decompression: + 1) Check Result and "status" variable. + 2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize. + 3) Check that output(srcLen) = compressedSize, if you know real compressedSize. + You must use correct finish mode in that case. */ + +typedef enum +{ + LZMA_STATUS_NOT_SPECIFIED, /* use main error code instead */ + LZMA_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */ + LZMA_STATUS_NOT_FINISHED, /* stream was not finished */ + LZMA_STATUS_NEEDS_MORE_INPUT, /* you must provide more input bytes */ + LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK /* there is probability that stream was finished without end mark */ +} ELzmaStatus; + +/* ELzmaStatus is used only as output value for function call */ + + +/* ---------- Interfaces ---------- */ + +/* There are 3 levels of interfaces: + 1) Dictionary Interface + 2) Buffer Interface + 3) One Call Interface + You can select any of these interfaces, but don't mix functions from different + groups for same object. */ + + +/* There are two variants to allocate state for Dictionary Interface: + 1) LzmaDec_Allocate / LzmaDec_Free + 2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs + You can use variant 2, if you set dictionary buffer manually. + For Buffer Interface you must always use variant 1. + +LzmaDec_Allocate* can return: + SZ_OK + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_UNSUPPORTED - Unsupported properties +*/ + +SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc); +void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc); + +SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc); +void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc); + +/* ---------- Dictionary Interface ---------- */ + +/* You can use it, if you want to eliminate the overhead for data copying from + dictionary to some other external buffer. + You must work with CLzmaDec variables directly in this interface. + + STEPS: + LzmaDec_Constr() + LzmaDec_Allocate() + for (each new stream) + { + LzmaDec_Init() + while (it needs more decompression) + { + LzmaDec_DecodeToDic() + use data from CLzmaDec::dic and update CLzmaDec::dicPos + } + } + LzmaDec_Free() +*/ + +/* LzmaDec_DecodeToDic + + The decoding to internal dictionary buffer (CLzmaDec::dic). + You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!! + +finishMode: + It has meaning only if the decoding reaches output limit (dicLimit). + LZMA_FINISH_ANY - Decode just dicLimit bytes. + LZMA_FINISH_END - Stream must be finished after dicLimit. + +Returns: + SZ_OK + status: + LZMA_STATUS_FINISHED_WITH_MARK + LZMA_STATUS_NOT_FINISHED + LZMA_STATUS_NEEDS_MORE_INPUT + LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK + SZ_ERROR_DATA - Data error +*/ + +SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, + const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); + + +/* ---------- Buffer Interface ---------- */ + +/* It's zlib-like interface. + See LzmaDec_DecodeToDic description for information about STEPS and return results, + but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need + to work with CLzmaDec variables manually. + +finishMode: + It has meaning only if the decoding reaches output limit (*destLen). + LZMA_FINISH_ANY - Decode just destLen bytes. + LZMA_FINISH_END - Stream must be finished after (*destLen). +*/ + +SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, + const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); + + +/* ---------- One Call Interface ---------- */ + +/* LzmaDecode + +finishMode: + It has meaning only if the decoding reaches output limit (*destLen). + LZMA_FINISH_ANY - Decode just destLen bytes. + LZMA_FINISH_END - Stream must be finished after (*destLen). + +Returns: + SZ_OK + status: + LZMA_STATUS_FINISHED_WITH_MARK + LZMA_STATUS_NOT_FINISHED + LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK + SZ_ERROR_DATA - Data error + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_UNSUPPORTED - Unsupported properties + SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src). +*/ + +SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, + const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, + ELzmaStatus *status, ISzAlloc *alloc); + +#endif diff --git a/extern/lzma/LzmaEnc.c b/extern/lzma/LzmaEnc.c new file mode 100644 index 00000000000..9196c43f64b --- /dev/null +++ b/extern/lzma/LzmaEnc.c @@ -0,0 +1,2281 @@ +/* LzmaEnc.c -- LZMA Encoder +2009-02-02 : Igor Pavlov : Public domain */ + +#include + +/* #define SHOW_STAT */ +/* #define SHOW_STAT2 */ + +#if defined(SHOW_STAT) || defined(SHOW_STAT2) +#include +#endif + +#include "LzmaEnc.h" + +#include "LzFind.h" +#ifdef COMPRESS_MF_MT +#include "LzFindMt.h" +#endif + +#ifdef SHOW_STAT +static int ttt = 0; +#endif + +#define kBlockSizeMax ((1 << LZMA_NUM_BLOCK_SIZE_BITS) - 1) + +#define kBlockSize (9 << 10) +#define kUnpackBlockSize (1 << 18) +#define kMatchArraySize (1 << 21) +#define kMatchRecordMaxSize ((LZMA_MATCH_LEN_MAX * 2 + 3) * LZMA_MATCH_LEN_MAX) + +#define kNumMaxDirectBits (31) + +#define kNumTopBits 24 +#define kTopValue ((UInt32)1 << kNumTopBits) + +#define kNumBitModelTotalBits 11 +#define kBitModelTotal (1 << kNumBitModelTotalBits) +#define kNumMoveBits 5 +#define kProbInitValue (kBitModelTotal >> 1) + +#define kNumMoveReducingBits 4 +#define kNumBitPriceShiftBits 4 +#define kBitPrice (1 << kNumBitPriceShiftBits) + +void LzmaEncProps_Init(CLzmaEncProps *p) +{ + p->level = 5; + p->dictSize = p->mc = 0; + p->lc = p->lp = p->pb = p->algo = p->fb = p->btMode = p->numHashBytes = p->numThreads = -1; + p->writeEndMark = 0; +} + +void LzmaEncProps_Normalize(CLzmaEncProps *p) +{ + int level = p->level; + if (level < 0) level = 5; + p->level = level; + if (p->dictSize == 0) p->dictSize = (level <= 5 ? (1 << (level * 2 + 14)) : (level == 6 ? (1 << 25) : (1 << 26))); + if (p->lc < 0) p->lc = 3; + if (p->lp < 0) p->lp = 0; + if (p->pb < 0) p->pb = 2; + if (p->algo < 0) p->algo = (level < 5 ? 0 : 1); + if (p->fb < 0) p->fb = (level < 7 ? 32 : 64); + if (p->btMode < 0) p->btMode = (p->algo == 0 ? 0 : 1); + if (p->numHashBytes < 0) p->numHashBytes = 4; + if (p->mc == 0) p->mc = (16 + (p->fb >> 1)) >> (p->btMode ? 0 : 1); + if (p->numThreads < 0) + p->numThreads = + #ifdef COMPRESS_MF_MT + ((p->btMode && p->algo) ? 2 : 1); + #else + 1; + #endif +} + +UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2) +{ + CLzmaEncProps props = *props2; + LzmaEncProps_Normalize(&props); + return props.dictSize; +} + +/* #define LZMA_LOG_BSR */ +/* Define it for Intel's CPU */ + + +#ifdef LZMA_LOG_BSR + +#define kDicLogSizeMaxCompress 30 + +#define BSR2_RET(pos, res) { unsigned long i; _BitScanReverse(&i, (pos)); res = (i + i) + ((pos >> (i - 1)) & 1); } + +UInt32 GetPosSlot1(UInt32 pos) +{ + UInt32 res; + BSR2_RET(pos, res); + return res; +} +#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); } +#define GetPosSlot(pos, res) { if (pos < 2) res = pos; else BSR2_RET(pos, res); } + +#else + +#define kNumLogBits (9 + (int)sizeof(size_t) / 2) +#define kDicLogSizeMaxCompress ((kNumLogBits - 1) * 2 + 7) + +void LzmaEnc_FastPosInit(Byte *g_FastPos) +{ + int c = 2, slotFast; + g_FastPos[0] = 0; + g_FastPos[1] = 1; + + for (slotFast = 2; slotFast < kNumLogBits * 2; slotFast++) + { + UInt32 k = (1 << ((slotFast >> 1) - 1)); + UInt32 j; + for (j = 0; j < k; j++, c++) + g_FastPos[c] = (Byte)slotFast; + } +} + +#define BSR2_RET(pos, res) { UInt32 i = 6 + ((kNumLogBits - 1) & \ + (0 - (((((UInt32)1 << (kNumLogBits + 6)) - 1) - pos) >> 31))); \ + res = p->g_FastPos[pos >> i] + (i * 2); } +/* +#define BSR2_RET(pos, res) { res = (pos < (1 << (kNumLogBits + 6))) ? \ + p->g_FastPos[pos >> 6] + 12 : \ + p->g_FastPos[pos >> (6 + kNumLogBits - 1)] + (6 + (kNumLogBits - 1)) * 2; } +*/ + +#define GetPosSlot1(pos) p->g_FastPos[pos] +#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); } +#define GetPosSlot(pos, res) { if (pos < kNumFullDistances) res = p->g_FastPos[pos]; else BSR2_RET(pos, res); } + +#endif + + +#define LZMA_NUM_REPS 4 + +typedef unsigned CState; + +typedef struct _COptimal +{ + UInt32 price; + + CState state; + int prev1IsChar; + int prev2; + + UInt32 posPrev2; + UInt32 backPrev2; + + UInt32 posPrev; + UInt32 backPrev; + UInt32 backs[LZMA_NUM_REPS]; +} COptimal; + +#define kNumOpts (1 << 12) + +#define kNumLenToPosStates 4 +#define kNumPosSlotBits 6 +#define kDicLogSizeMin 0 +#define kDicLogSizeMax 32 +#define kDistTableSizeMax (kDicLogSizeMax * 2) + + +#define kNumAlignBits 4 +#define kAlignTableSize (1 << kNumAlignBits) +#define kAlignMask (kAlignTableSize - 1) + +#define kStartPosModelIndex 4 +#define kEndPosModelIndex 14 +#define kNumPosModels (kEndPosModelIndex - kStartPosModelIndex) + +#define kNumFullDistances (1 << (kEndPosModelIndex / 2)) + +#ifdef _LZMA_PROB32 +#define CLzmaProb UInt32 +#else +#define CLzmaProb UInt16 +#endif + +#define LZMA_PB_MAX 4 +#define LZMA_LC_MAX 8 +#define LZMA_LP_MAX 4 + +#define LZMA_NUM_PB_STATES_MAX (1 << LZMA_PB_MAX) + + +#define kLenNumLowBits 3 +#define kLenNumLowSymbols (1 << kLenNumLowBits) +#define kLenNumMidBits 3 +#define kLenNumMidSymbols (1 << kLenNumMidBits) +#define kLenNumHighBits 8 +#define kLenNumHighSymbols (1 << kLenNumHighBits) + +#define kLenNumSymbolsTotal (kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols) + +#define LZMA_MATCH_LEN_MIN 2 +#define LZMA_MATCH_LEN_MAX (LZMA_MATCH_LEN_MIN + kLenNumSymbolsTotal - 1) + +#define kNumStates 12 + +typedef struct +{ + CLzmaProb choice; + CLzmaProb choice2; + CLzmaProb low[LZMA_NUM_PB_STATES_MAX << kLenNumLowBits]; + CLzmaProb mid[LZMA_NUM_PB_STATES_MAX << kLenNumMidBits]; + CLzmaProb high[kLenNumHighSymbols]; +} CLenEnc; + +typedef struct +{ + CLenEnc p; + UInt32 prices[LZMA_NUM_PB_STATES_MAX][kLenNumSymbolsTotal]; + UInt32 tableSize; + UInt32 counters[LZMA_NUM_PB_STATES_MAX]; +} CLenPriceEnc; + +typedef struct _CRangeEnc +{ + UInt32 range; + Byte cache; + UInt64 low; + UInt64 cacheSize; + Byte *buf; + Byte *bufLim; + Byte *bufBase; + ISeqOutStream *outStream; + UInt64 processed; + SRes res; +} CRangeEnc; + +typedef struct _CSeqInStreamBuf +{ + ISeqInStream funcTable; + const Byte *data; + SizeT rem; +} CSeqInStreamBuf; + +static SRes MyRead(void *pp, void *data, size_t *size) +{ + size_t curSize = *size; + CSeqInStreamBuf *p = (CSeqInStreamBuf *)pp; + if (p->rem < curSize) + curSize = p->rem; + memcpy(data, p->data, curSize); + p->rem -= curSize; + p->data += curSize; + *size = curSize; + return SZ_OK; +} + +typedef struct +{ + CLzmaProb *litProbs; + + CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX]; + CLzmaProb isRep[kNumStates]; + CLzmaProb isRepG0[kNumStates]; + CLzmaProb isRepG1[kNumStates]; + CLzmaProb isRepG2[kNumStates]; + CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX]; + + CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits]; + CLzmaProb posEncoders[kNumFullDistances - kEndPosModelIndex]; + CLzmaProb posAlignEncoder[1 << kNumAlignBits]; + + CLenPriceEnc lenEnc; + CLenPriceEnc repLenEnc; + + UInt32 reps[LZMA_NUM_REPS]; + UInt32 state; +} CSaveState; + +typedef struct _CLzmaEnc +{ + IMatchFinder matchFinder; + void *matchFinderObj; + + #ifdef COMPRESS_MF_MT + Bool mtMode; + CMatchFinderMt matchFinderMt; + #endif + + CMatchFinder matchFinderBase; + + #ifdef COMPRESS_MF_MT + Byte pad[128]; + #endif + + UInt32 optimumEndIndex; + UInt32 optimumCurrentIndex; + + UInt32 longestMatchLength; + UInt32 numPairs; + UInt32 numAvail; + COptimal opt[kNumOpts]; + + #ifndef LZMA_LOG_BSR + Byte g_FastPos[1 << kNumLogBits]; + #endif + + UInt32 ProbPrices[kBitModelTotal >> kNumMoveReducingBits]; + UInt32 matches[LZMA_MATCH_LEN_MAX * 2 + 2 + 1]; + UInt32 numFastBytes; + UInt32 additionalOffset; + UInt32 reps[LZMA_NUM_REPS]; + UInt32 state; + + UInt32 posSlotPrices[kNumLenToPosStates][kDistTableSizeMax]; + UInt32 distancesPrices[kNumLenToPosStates][kNumFullDistances]; + UInt32 alignPrices[kAlignTableSize]; + UInt32 alignPriceCount; + + UInt32 distTableSize; + + unsigned lc, lp, pb; + unsigned lpMask, pbMask; + + CLzmaProb *litProbs; + + CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX]; + CLzmaProb isRep[kNumStates]; + CLzmaProb isRepG0[kNumStates]; + CLzmaProb isRepG1[kNumStates]; + CLzmaProb isRepG2[kNumStates]; + CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX]; + + CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits]; + CLzmaProb posEncoders[kNumFullDistances - kEndPosModelIndex]; + CLzmaProb posAlignEncoder[1 << kNumAlignBits]; + + CLenPriceEnc lenEnc; + CLenPriceEnc repLenEnc; + + unsigned lclp; + + Bool fastMode; + + CRangeEnc rc; + + Bool writeEndMark; + UInt64 nowPos64; + UInt32 matchPriceCount; + Bool finished; + Bool multiThread; + + SRes result; + UInt32 dictSize; + UInt32 matchFinderCycles; + + ISeqInStream *inStream; + CSeqInStreamBuf seqBufInStream; + + CSaveState saveState; +} CLzmaEnc; + +void LzmaEnc_SaveState(CLzmaEncHandle pp) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + CSaveState *dest = &p->saveState; + int i; + dest->lenEnc = p->lenEnc; + dest->repLenEnc = p->repLenEnc; + dest->state = p->state; + + for (i = 0; i < kNumStates; i++) + { + memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i])); + memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i])); + } + for (i = 0; i < kNumLenToPosStates; i++) + memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i])); + memcpy(dest->isRep, p->isRep, sizeof(p->isRep)); + memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0)); + memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1)); + memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2)); + memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders)); + memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder)); + memcpy(dest->reps, p->reps, sizeof(p->reps)); + memcpy(dest->litProbs, p->litProbs, (0x300 << p->lclp) * sizeof(CLzmaProb)); +} + +void LzmaEnc_RestoreState(CLzmaEncHandle pp) +{ + CLzmaEnc *dest = (CLzmaEnc *)pp; + const CSaveState *p = &dest->saveState; + int i; + dest->lenEnc = p->lenEnc; + dest->repLenEnc = p->repLenEnc; + dest->state = p->state; + + for (i = 0; i < kNumStates; i++) + { + memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i])); + memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i])); + } + for (i = 0; i < kNumLenToPosStates; i++) + memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i])); + memcpy(dest->isRep, p->isRep, sizeof(p->isRep)); + memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0)); + memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1)); + memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2)); + memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders)); + memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder)); + memcpy(dest->reps, p->reps, sizeof(p->reps)); + memcpy(dest->litProbs, p->litProbs, (0x300 << dest->lclp) * sizeof(CLzmaProb)); +} + +SRes LzmaEnc_SetProps(CLzmaEncHandle pp, const CLzmaEncProps *props2) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + CLzmaEncProps props = *props2; + LzmaEncProps_Normalize(&props); + + if (props.lc > LZMA_LC_MAX || props.lp > LZMA_LP_MAX || props.pb > LZMA_PB_MAX || + props.dictSize > (1 << kDicLogSizeMaxCompress) || props.dictSize > (1 << 30)) + return SZ_ERROR_PARAM; + p->dictSize = props.dictSize; + p->matchFinderCycles = props.mc; + { + unsigned fb = props.fb; + if (fb < 5) + fb = 5; + if (fb > LZMA_MATCH_LEN_MAX) + fb = LZMA_MATCH_LEN_MAX; + p->numFastBytes = fb; + } + p->lc = props.lc; + p->lp = props.lp; + p->pb = props.pb; + p->fastMode = (props.algo == 0); + p->matchFinderBase.btMode = props.btMode; + { + UInt32 numHashBytes = 4; + if (props.btMode) + { + if (props.numHashBytes < 2) + numHashBytes = 2; + else if (props.numHashBytes < 4) + numHashBytes = props.numHashBytes; + } + p->matchFinderBase.numHashBytes = numHashBytes; + } + + p->matchFinderBase.cutValue = props.mc; + + p->writeEndMark = props.writeEndMark; + + #ifdef COMPRESS_MF_MT + /* + if (newMultiThread != _multiThread) + { + ReleaseMatchFinder(); + _multiThread = newMultiThread; + } + */ + p->multiThread = (props.numThreads > 1); + #endif + + return SZ_OK; +} + +static const int kLiteralNextStates[kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5}; +static const int kMatchNextStates[kNumStates] = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10}; +static const int kRepNextStates[kNumStates] = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11}; +static const int kShortRepNextStates[kNumStates]= {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11}; + +#define IsCharState(s) ((s) < 7) + +#define GetLenToPosState(len) (((len) < kNumLenToPosStates + 1) ? (len) - 2 : kNumLenToPosStates - 1) + +#define kInfinityPrice (1 << 30) + +static void RangeEnc_Construct(CRangeEnc *p) +{ + p->outStream = 0; + p->bufBase = 0; +} + +#define RangeEnc_GetProcessed(p) ((p)->processed + ((p)->buf - (p)->bufBase) + (p)->cacheSize) + +#define RC_BUF_SIZE (1 << 16) +static int RangeEnc_Alloc(CRangeEnc *p, ISzAlloc *alloc) +{ + if (p->bufBase == 0) + { + p->bufBase = (Byte *)alloc->Alloc(alloc, RC_BUF_SIZE); + if (p->bufBase == 0) + return 0; + p->bufLim = p->bufBase + RC_BUF_SIZE; + } + return 1; +} + +static void RangeEnc_Free(CRangeEnc *p, ISzAlloc *alloc) +{ + alloc->Free(alloc, p->bufBase); + p->bufBase = 0; +} + +static void RangeEnc_Init(CRangeEnc *p) +{ + /* Stream.Init(); */ + p->low = 0; + p->range = 0xFFFFFFFF; + p->cacheSize = 1; + p->cache = 0; + + p->buf = p->bufBase; + + p->processed = 0; + p->res = SZ_OK; +} + +static void RangeEnc_FlushStream(CRangeEnc *p) +{ + size_t num; + if (p->res != SZ_OK) + return; + num = p->buf - p->bufBase; + if (num != p->outStream->Write(p->outStream, p->bufBase, num)) + p->res = SZ_ERROR_WRITE; + p->processed += num; + p->buf = p->bufBase; +} + +static void MY_FAST_CALL RangeEnc_ShiftLow(CRangeEnc *p) +{ + if ((UInt32)p->low < (UInt32)0xFF000000 || (int)(p->low >> 32) != 0) + { + Byte temp = p->cache; + do + { + Byte *buf = p->buf; + *buf++ = (Byte)(temp + (Byte)(p->low >> 32)); + p->buf = buf; + if (buf == p->bufLim) + RangeEnc_FlushStream(p); + temp = 0xFF; + } + while (--p->cacheSize != 0); + p->cache = (Byte)((UInt32)p->low >> 24); + } + p->cacheSize++; + p->low = (UInt32)p->low << 8; +} + +static void RangeEnc_FlushData(CRangeEnc *p) +{ + int i; + for (i = 0; i < 5; i++) + RangeEnc_ShiftLow(p); +} + +static void RangeEnc_EncodeDirectBits(CRangeEnc *p, UInt32 value, int numBits) +{ + do + { + p->range >>= 1; + p->low += p->range & (0 - ((value >> --numBits) & 1)); + if (p->range < kTopValue) + { + p->range <<= 8; + RangeEnc_ShiftLow(p); + } + } + while (numBits != 0); +} + +static void RangeEnc_EncodeBit(CRangeEnc *p, CLzmaProb *prob, UInt32 symbol) +{ + UInt32 ttt = *prob; + UInt32 newBound = (p->range >> kNumBitModelTotalBits) * ttt; + if (symbol == 0) + { + p->range = newBound; + ttt += (kBitModelTotal - ttt) >> kNumMoveBits; + } + else + { + p->low += newBound; + p->range -= newBound; + ttt -= ttt >> kNumMoveBits; + } + *prob = (CLzmaProb)ttt; + if (p->range < kTopValue) + { + p->range <<= 8; + RangeEnc_ShiftLow(p); + } +} + +static void LitEnc_Encode(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol) +{ + symbol |= 0x100; + do + { + RangeEnc_EncodeBit(p, probs + (symbol >> 8), (symbol >> 7) & 1); + symbol <<= 1; + } + while (symbol < 0x10000); +} + +static void LitEnc_EncodeMatched(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol, UInt32 matchByte) +{ + UInt32 offs = 0x100; + symbol |= 0x100; + do + { + matchByte <<= 1; + RangeEnc_EncodeBit(p, probs + (offs + (matchByte & offs) + (symbol >> 8)), (symbol >> 7) & 1); + symbol <<= 1; + offs &= ~(matchByte ^ symbol); + } + while (symbol < 0x10000); +} + +void LzmaEnc_InitPriceTables(UInt32 *ProbPrices) +{ + UInt32 i; + for (i = (1 << kNumMoveReducingBits) / 2; i < kBitModelTotal; i += (1 << kNumMoveReducingBits)) + { + const int kCyclesBits = kNumBitPriceShiftBits; + UInt32 w = i; + UInt32 bitCount = 0; + int j; + for (j = 0; j < kCyclesBits; j++) + { + w = w * w; + bitCount <<= 1; + while (w >= ((UInt32)1 << 16)) + { + w >>= 1; + bitCount++; + } + } + ProbPrices[i >> kNumMoveReducingBits] = ((kNumBitModelTotalBits << kCyclesBits) - 15 - bitCount); + } +} + + +#define GET_PRICE(prob, symbol) \ + p->ProbPrices[((prob) ^ (((-(int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits]; + +#define GET_PRICEa(prob, symbol) \ + ProbPrices[((prob) ^ ((-((int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits]; + +#define GET_PRICE_0(prob) p->ProbPrices[(prob) >> kNumMoveReducingBits] +#define GET_PRICE_1(prob) p->ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits] + +#define GET_PRICE_0a(prob) ProbPrices[(prob) >> kNumMoveReducingBits] +#define GET_PRICE_1a(prob) ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits] + +static UInt32 LitEnc_GetPrice(const CLzmaProb *probs, UInt32 symbol, UInt32 *ProbPrices) +{ + UInt32 price = 0; + symbol |= 0x100; + do + { + price += GET_PRICEa(probs[symbol >> 8], (symbol >> 7) & 1); + symbol <<= 1; + } + while (symbol < 0x10000); + return price; +} + +static UInt32 LitEnc_GetPriceMatched(const CLzmaProb *probs, UInt32 symbol, UInt32 matchByte, UInt32 *ProbPrices) +{ + UInt32 price = 0; + UInt32 offs = 0x100; + symbol |= 0x100; + do + { + matchByte <<= 1; + price += GET_PRICEa(probs[offs + (matchByte & offs) + (symbol >> 8)], (symbol >> 7) & 1); + symbol <<= 1; + offs &= ~(matchByte ^ symbol); + } + while (symbol < 0x10000); + return price; +} + + +static void RcTree_Encode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol) +{ + UInt32 m = 1; + int i; + for (i = numBitLevels; i != 0;) + { + UInt32 bit; + i--; + bit = (symbol >> i) & 1; + RangeEnc_EncodeBit(rc, probs + m, bit); + m = (m << 1) | bit; + } +} + +static void RcTree_ReverseEncode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol) +{ + UInt32 m = 1; + int i; + for (i = 0; i < numBitLevels; i++) + { + UInt32 bit = symbol & 1; + RangeEnc_EncodeBit(rc, probs + m, bit); + m = (m << 1) | bit; + symbol >>= 1; + } +} + +static UInt32 RcTree_GetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices) +{ + UInt32 price = 0; + symbol |= (1 << numBitLevels); + while (symbol != 1) + { + price += GET_PRICEa(probs[symbol >> 1], symbol & 1); + symbol >>= 1; + } + return price; +} + +static UInt32 RcTree_ReverseGetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices) +{ + UInt32 price = 0; + UInt32 m = 1; + int i; + for (i = numBitLevels; i != 0; i--) + { + UInt32 bit = symbol & 1; + symbol >>= 1; + price += GET_PRICEa(probs[m], bit); + m = (m << 1) | bit; + } + return price; +} + + +static void LenEnc_Init(CLenEnc *p) +{ + unsigned i; + p->choice = p->choice2 = kProbInitValue; + for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << kLenNumLowBits); i++) + p->low[i] = kProbInitValue; + for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << kLenNumMidBits); i++) + p->mid[i] = kProbInitValue; + for (i = 0; i < kLenNumHighSymbols; i++) + p->high[i] = kProbInitValue; +} + +static void LenEnc_Encode(CLenEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState) +{ + if (symbol < kLenNumLowSymbols) + { + RangeEnc_EncodeBit(rc, &p->choice, 0); + RcTree_Encode(rc, p->low + (posState << kLenNumLowBits), kLenNumLowBits, symbol); + } + else + { + RangeEnc_EncodeBit(rc, &p->choice, 1); + if (symbol < kLenNumLowSymbols + kLenNumMidSymbols) + { + RangeEnc_EncodeBit(rc, &p->choice2, 0); + RcTree_Encode(rc, p->mid + (posState << kLenNumMidBits), kLenNumMidBits, symbol - kLenNumLowSymbols); + } + else + { + RangeEnc_EncodeBit(rc, &p->choice2, 1); + RcTree_Encode(rc, p->high, kLenNumHighBits, symbol - kLenNumLowSymbols - kLenNumMidSymbols); + } + } +} + +static void LenEnc_SetPrices(CLenEnc *p, UInt32 posState, UInt32 numSymbols, UInt32 *prices, UInt32 *ProbPrices) +{ + UInt32 a0 = GET_PRICE_0a(p->choice); + UInt32 a1 = GET_PRICE_1a(p->choice); + UInt32 b0 = a1 + GET_PRICE_0a(p->choice2); + UInt32 b1 = a1 + GET_PRICE_1a(p->choice2); + UInt32 i = 0; + for (i = 0; i < kLenNumLowSymbols; i++) + { + if (i >= numSymbols) + return; + prices[i] = a0 + RcTree_GetPrice(p->low + (posState << kLenNumLowBits), kLenNumLowBits, i, ProbPrices); + } + for (; i < kLenNumLowSymbols + kLenNumMidSymbols; i++) + { + if (i >= numSymbols) + return; + prices[i] = b0 + RcTree_GetPrice(p->mid + (posState << kLenNumMidBits), kLenNumMidBits, i - kLenNumLowSymbols, ProbPrices); + } + for (; i < numSymbols; i++) + prices[i] = b1 + RcTree_GetPrice(p->high, kLenNumHighBits, i - kLenNumLowSymbols - kLenNumMidSymbols, ProbPrices); +} + +static void MY_FAST_CALL LenPriceEnc_UpdateTable(CLenPriceEnc *p, UInt32 posState, UInt32 *ProbPrices) +{ + LenEnc_SetPrices(&p->p, posState, p->tableSize, p->prices[posState], ProbPrices); + p->counters[posState] = p->tableSize; +} + +static void LenPriceEnc_UpdateTables(CLenPriceEnc *p, UInt32 numPosStates, UInt32 *ProbPrices) +{ + UInt32 posState; + for (posState = 0; posState < numPosStates; posState++) + LenPriceEnc_UpdateTable(p, posState, ProbPrices); +} + +static void LenEnc_Encode2(CLenPriceEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState, Bool updatePrice, UInt32 *ProbPrices) +{ + LenEnc_Encode(&p->p, rc, symbol, posState); + if (updatePrice) + if (--p->counters[posState] == 0) + LenPriceEnc_UpdateTable(p, posState, ProbPrices); +} + + + + +static void MovePos(CLzmaEnc *p, UInt32 num) +{ + #ifdef SHOW_STAT + ttt += num; + printf("\n MovePos %d", num); + #endif + if (num != 0) + { + p->additionalOffset += num; + p->matchFinder.Skip(p->matchFinderObj, num); + } +} + +static UInt32 ReadMatchDistances(CLzmaEnc *p, UInt32 *numDistancePairsRes) +{ + UInt32 lenRes = 0, numPairs; + p->numAvail = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); + numPairs = p->matchFinder.GetMatches(p->matchFinderObj, p->matches); + #ifdef SHOW_STAT + printf("\n i = %d numPairs = %d ", ttt, numPairs / 2); + ttt++; + { + UInt32 i; + for (i = 0; i < numPairs; i += 2) + printf("%2d %6d | ", p->matches[i], p->matches[i + 1]); + } + #endif + if (numPairs > 0) + { + lenRes = p->matches[numPairs - 2]; + if (lenRes == p->numFastBytes) + { + const Byte *pby = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; + UInt32 distance = p->matches[numPairs - 1] + 1; + UInt32 numAvail = p->numAvail; + if (numAvail > LZMA_MATCH_LEN_MAX) + numAvail = LZMA_MATCH_LEN_MAX; + { + const Byte *pby2 = pby - distance; + for (; lenRes < numAvail && pby[lenRes] == pby2[lenRes]; lenRes++); + } + } + } + p->additionalOffset++; + *numDistancePairsRes = numPairs; + return lenRes; +} + + +#define MakeAsChar(p) (p)->backPrev = (UInt32)(-1); (p)->prev1IsChar = False; +#define MakeAsShortRep(p) (p)->backPrev = 0; (p)->prev1IsChar = False; +#define IsShortRep(p) ((p)->backPrev == 0) + +static UInt32 GetRepLen1Price(CLzmaEnc *p, UInt32 state, UInt32 posState) +{ + return + GET_PRICE_0(p->isRepG0[state]) + + GET_PRICE_0(p->isRep0Long[state][posState]); +} + +static UInt32 GetPureRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 state, UInt32 posState) +{ + UInt32 price; + if (repIndex == 0) + { + price = GET_PRICE_0(p->isRepG0[state]); + price += GET_PRICE_1(p->isRep0Long[state][posState]); + } + else + { + price = GET_PRICE_1(p->isRepG0[state]); + if (repIndex == 1) + price += GET_PRICE_0(p->isRepG1[state]); + else + { + price += GET_PRICE_1(p->isRepG1[state]); + price += GET_PRICE(p->isRepG2[state], repIndex - 2); + } + } + return price; +} + +static UInt32 GetRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 len, UInt32 state, UInt32 posState) +{ + return p->repLenEnc.prices[posState][len - LZMA_MATCH_LEN_MIN] + + GetPureRepPrice(p, repIndex, state, posState); +} + +static UInt32 Backward(CLzmaEnc *p, UInt32 *backRes, UInt32 cur) +{ + UInt32 posMem = p->opt[cur].posPrev; + UInt32 backMem = p->opt[cur].backPrev; + p->optimumEndIndex = cur; + do + { + if (p->opt[cur].prev1IsChar) + { + MakeAsChar(&p->opt[posMem]) + p->opt[posMem].posPrev = posMem - 1; + if (p->opt[cur].prev2) + { + p->opt[posMem - 1].prev1IsChar = False; + p->opt[posMem - 1].posPrev = p->opt[cur].posPrev2; + p->opt[posMem - 1].backPrev = p->opt[cur].backPrev2; + } + } + { + UInt32 posPrev = posMem; + UInt32 backCur = backMem; + + backMem = p->opt[posPrev].backPrev; + posMem = p->opt[posPrev].posPrev; + + p->opt[posPrev].backPrev = backCur; + p->opt[posPrev].posPrev = cur; + cur = posPrev; + } + } + while (cur != 0); + *backRes = p->opt[0].backPrev; + p->optimumCurrentIndex = p->opt[0].posPrev; + return p->optimumCurrentIndex; +} + +#define LIT_PROBS(pos, prevByte) (p->litProbs + ((((pos) & p->lpMask) << p->lc) + ((prevByte) >> (8 - p->lc))) * 0x300) + +static UInt32 GetOptimum(CLzmaEnc *p, UInt32 position, UInt32 *backRes) +{ + UInt32 numAvail, mainLen, numPairs, repMaxIndex, i, posState, lenEnd, len, cur; + UInt32 matchPrice, repMatchPrice, normalMatchPrice; + UInt32 reps[LZMA_NUM_REPS], repLens[LZMA_NUM_REPS]; + UInt32 *matches; + const Byte *data; + Byte curByte, matchByte; + if (p->optimumEndIndex != p->optimumCurrentIndex) + { + const COptimal *opt = &p->opt[p->optimumCurrentIndex]; + UInt32 lenRes = opt->posPrev - p->optimumCurrentIndex; + *backRes = opt->backPrev; + p->optimumCurrentIndex = opt->posPrev; + return lenRes; + } + p->optimumCurrentIndex = p->optimumEndIndex = 0; + + if (p->additionalOffset == 0) + mainLen = ReadMatchDistances(p, &numPairs); + else + { + mainLen = p->longestMatchLength; + numPairs = p->numPairs; + } + + numAvail = p->numAvail; + if (numAvail < 2) + { + *backRes = (UInt32)(-1); + return 1; + } + if (numAvail > LZMA_MATCH_LEN_MAX) + numAvail = LZMA_MATCH_LEN_MAX; + + data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; + repMaxIndex = 0; + for (i = 0; i < LZMA_NUM_REPS; i++) + { + UInt32 lenTest; + const Byte *data2; + reps[i] = p->reps[i]; + data2 = data - (reps[i] + 1); + if (data[0] != data2[0] || data[1] != data2[1]) + { + repLens[i] = 0; + continue; + } + for (lenTest = 2; lenTest < numAvail && data[lenTest] == data2[lenTest]; lenTest++); + repLens[i] = lenTest; + if (lenTest > repLens[repMaxIndex]) + repMaxIndex = i; + } + if (repLens[repMaxIndex] >= p->numFastBytes) + { + UInt32 lenRes; + *backRes = repMaxIndex; + lenRes = repLens[repMaxIndex]; + MovePos(p, lenRes - 1); + return lenRes; + } + + matches = p->matches; + if (mainLen >= p->numFastBytes) + { + *backRes = matches[numPairs - 1] + LZMA_NUM_REPS; + MovePos(p, mainLen - 1); + return mainLen; + } + curByte = *data; + matchByte = *(data - (reps[0] + 1)); + + if (mainLen < 2 && curByte != matchByte && repLens[repMaxIndex] < 2) + { + *backRes = (UInt32)-1; + return 1; + } + + p->opt[0].state = (CState)p->state; + + posState = (position & p->pbMask); + + { + const CLzmaProb *probs = LIT_PROBS(position, *(data - 1)); + p->opt[1].price = GET_PRICE_0(p->isMatch[p->state][posState]) + + (!IsCharState(p->state) ? + LitEnc_GetPriceMatched(probs, curByte, matchByte, p->ProbPrices) : + LitEnc_GetPrice(probs, curByte, p->ProbPrices)); + } + + MakeAsChar(&p->opt[1]); + + matchPrice = GET_PRICE_1(p->isMatch[p->state][posState]); + repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[p->state]); + + if (matchByte == curByte) + { + UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, p->state, posState); + if (shortRepPrice < p->opt[1].price) + { + p->opt[1].price = shortRepPrice; + MakeAsShortRep(&p->opt[1]); + } + } + lenEnd = ((mainLen >= repLens[repMaxIndex]) ? mainLen : repLens[repMaxIndex]); + + if (lenEnd < 2) + { + *backRes = p->opt[1].backPrev; + return 1; + } + + p->opt[1].posPrev = 0; + for (i = 0; i < LZMA_NUM_REPS; i++) + p->opt[0].backs[i] = reps[i]; + + len = lenEnd; + do + p->opt[len--].price = kInfinityPrice; + while (len >= 2); + + for (i = 0; i < LZMA_NUM_REPS; i++) + { + UInt32 repLen = repLens[i]; + UInt32 price; + if (repLen < 2) + continue; + price = repMatchPrice + GetPureRepPrice(p, i, p->state, posState); + do + { + UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][repLen - 2]; + COptimal *opt = &p->opt[repLen]; + if (curAndLenPrice < opt->price) + { + opt->price = curAndLenPrice; + opt->posPrev = 0; + opt->backPrev = i; + opt->prev1IsChar = False; + } + } + while (--repLen >= 2); + } + + normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[p->state]); + + len = ((repLens[0] >= 2) ? repLens[0] + 1 : 2); + if (len <= mainLen) + { + UInt32 offs = 0; + while (len > matches[offs]) + offs += 2; + for (; ; len++) + { + COptimal *opt; + UInt32 distance = matches[offs + 1]; + + UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][len - LZMA_MATCH_LEN_MIN]; + UInt32 lenToPosState = GetLenToPosState(len); + if (distance < kNumFullDistances) + curAndLenPrice += p->distancesPrices[lenToPosState][distance]; + else + { + UInt32 slot; + GetPosSlot2(distance, slot); + curAndLenPrice += p->alignPrices[distance & kAlignMask] + p->posSlotPrices[lenToPosState][slot]; + } + opt = &p->opt[len]; + if (curAndLenPrice < opt->price) + { + opt->price = curAndLenPrice; + opt->posPrev = 0; + opt->backPrev = distance + LZMA_NUM_REPS; + opt->prev1IsChar = False; + } + if (len == matches[offs]) + { + offs += 2; + if (offs == numPairs) + break; + } + } + } + + cur = 0; + + #ifdef SHOW_STAT2 + if (position >= 0) + { + unsigned i; + printf("\n pos = %4X", position); + for (i = cur; i <= lenEnd; i++) + printf("\nprice[%4X] = %d", position - cur + i, p->opt[i].price); + } + #endif + + for (;;) + { + UInt32 numAvailFull, newLen, numPairs, posPrev, state, posState, startLen; + UInt32 curPrice, curAnd1Price, matchPrice, repMatchPrice; + Bool nextIsChar; + Byte curByte, matchByte; + const Byte *data; + COptimal *curOpt; + COptimal *nextOpt; + + cur++; + if (cur == lenEnd) + return Backward(p, backRes, cur); + + newLen = ReadMatchDistances(p, &numPairs); + if (newLen >= p->numFastBytes) + { + p->numPairs = numPairs; + p->longestMatchLength = newLen; + return Backward(p, backRes, cur); + } + position++; + curOpt = &p->opt[cur]; + posPrev = curOpt->posPrev; + if (curOpt->prev1IsChar) + { + posPrev--; + if (curOpt->prev2) + { + state = p->opt[curOpt->posPrev2].state; + if (curOpt->backPrev2 < LZMA_NUM_REPS) + state = kRepNextStates[state]; + else + state = kMatchNextStates[state]; + } + else + state = p->opt[posPrev].state; + state = kLiteralNextStates[state]; + } + else + state = p->opt[posPrev].state; + if (posPrev == cur - 1) + { + if (IsShortRep(curOpt)) + state = kShortRepNextStates[state]; + else + state = kLiteralNextStates[state]; + } + else + { + UInt32 pos; + const COptimal *prevOpt; + if (curOpt->prev1IsChar && curOpt->prev2) + { + posPrev = curOpt->posPrev2; + pos = curOpt->backPrev2; + state = kRepNextStates[state]; + } + else + { + pos = curOpt->backPrev; + if (pos < LZMA_NUM_REPS) + state = kRepNextStates[state]; + else + state = kMatchNextStates[state]; + } + prevOpt = &p->opt[posPrev]; + if (pos < LZMA_NUM_REPS) + { + UInt32 i; + reps[0] = prevOpt->backs[pos]; + for (i = 1; i <= pos; i++) + reps[i] = prevOpt->backs[i - 1]; + for (; i < LZMA_NUM_REPS; i++) + reps[i] = prevOpt->backs[i]; + } + else + { + UInt32 i; + reps[0] = (pos - LZMA_NUM_REPS); + for (i = 1; i < LZMA_NUM_REPS; i++) + reps[i] = prevOpt->backs[i - 1]; + } + } + curOpt->state = (CState)state; + + curOpt->backs[0] = reps[0]; + curOpt->backs[1] = reps[1]; + curOpt->backs[2] = reps[2]; + curOpt->backs[3] = reps[3]; + + curPrice = curOpt->price; + nextIsChar = False; + data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; + curByte = *data; + matchByte = *(data - (reps[0] + 1)); + + posState = (position & p->pbMask); + + curAnd1Price = curPrice + GET_PRICE_0(p->isMatch[state][posState]); + { + const CLzmaProb *probs = LIT_PROBS(position, *(data - 1)); + curAnd1Price += + (!IsCharState(state) ? + LitEnc_GetPriceMatched(probs, curByte, matchByte, p->ProbPrices) : + LitEnc_GetPrice(probs, curByte, p->ProbPrices)); + } + + nextOpt = &p->opt[cur + 1]; + + if (curAnd1Price < nextOpt->price) + { + nextOpt->price = curAnd1Price; + nextOpt->posPrev = cur; + MakeAsChar(nextOpt); + nextIsChar = True; + } + + matchPrice = curPrice + GET_PRICE_1(p->isMatch[state][posState]); + repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[state]); + + if (matchByte == curByte && !(nextOpt->posPrev < cur && nextOpt->backPrev == 0)) + { + UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, state, posState); + if (shortRepPrice <= nextOpt->price) + { + nextOpt->price = shortRepPrice; + nextOpt->posPrev = cur; + MakeAsShortRep(nextOpt); + nextIsChar = True; + } + } + numAvailFull = p->numAvail; + { + UInt32 temp = kNumOpts - 1 - cur; + if (temp < numAvailFull) + numAvailFull = temp; + } + + if (numAvailFull < 2) + continue; + numAvail = (numAvailFull <= p->numFastBytes ? numAvailFull : p->numFastBytes); + + if (!nextIsChar && matchByte != curByte) /* speed optimization */ + { + /* try Literal + rep0 */ + UInt32 temp; + UInt32 lenTest2; + const Byte *data2 = data - (reps[0] + 1); + UInt32 limit = p->numFastBytes + 1; + if (limit > numAvailFull) + limit = numAvailFull; + + for (temp = 1; temp < limit && data[temp] == data2[temp]; temp++); + lenTest2 = temp - 1; + if (lenTest2 >= 2) + { + UInt32 state2 = kLiteralNextStates[state]; + UInt32 posStateNext = (position + 1) & p->pbMask; + UInt32 nextRepMatchPrice = curAnd1Price + + GET_PRICE_1(p->isMatch[state2][posStateNext]) + + GET_PRICE_1(p->isRep[state2]); + /* for (; lenTest2 >= 2; lenTest2--) */ + { + UInt32 curAndLenPrice; + COptimal *opt; + UInt32 offset = cur + 1 + lenTest2; + while (lenEnd < offset) + p->opt[++lenEnd].price = kInfinityPrice; + curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); + opt = &p->opt[offset]; + if (curAndLenPrice < opt->price) + { + opt->price = curAndLenPrice; + opt->posPrev = cur + 1; + opt->backPrev = 0; + opt->prev1IsChar = True; + opt->prev2 = False; + } + } + } + } + + startLen = 2; /* speed optimization */ + { + UInt32 repIndex; + for (repIndex = 0; repIndex < LZMA_NUM_REPS; repIndex++) + { + UInt32 lenTest; + UInt32 lenTestTemp; + UInt32 price; + const Byte *data2 = data - (reps[repIndex] + 1); + if (data[0] != data2[0] || data[1] != data2[1]) + continue; + for (lenTest = 2; lenTest < numAvail && data[lenTest] == data2[lenTest]; lenTest++); + while (lenEnd < cur + lenTest) + p->opt[++lenEnd].price = kInfinityPrice; + lenTestTemp = lenTest; + price = repMatchPrice + GetPureRepPrice(p, repIndex, state, posState); + do + { + UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][lenTest - 2]; + COptimal *opt = &p->opt[cur + lenTest]; + if (curAndLenPrice < opt->price) + { + opt->price = curAndLenPrice; + opt->posPrev = cur; + opt->backPrev = repIndex; + opt->prev1IsChar = False; + } + } + while (--lenTest >= 2); + lenTest = lenTestTemp; + + if (repIndex == 0) + startLen = lenTest + 1; + + /* if (_maxMode) */ + { + UInt32 lenTest2 = lenTest + 1; + UInt32 limit = lenTest2 + p->numFastBytes; + UInt32 nextRepMatchPrice; + if (limit > numAvailFull) + limit = numAvailFull; + for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++); + lenTest2 -= lenTest + 1; + if (lenTest2 >= 2) + { + UInt32 state2 = kRepNextStates[state]; + UInt32 posStateNext = (position + lenTest) & p->pbMask; + UInt32 curAndLenCharPrice = + price + p->repLenEnc.prices[posState][lenTest - 2] + + GET_PRICE_0(p->isMatch[state2][posStateNext]) + + LitEnc_GetPriceMatched(LIT_PROBS(position + lenTest, data[lenTest - 1]), + data[lenTest], data2[lenTest], p->ProbPrices); + state2 = kLiteralNextStates[state2]; + posStateNext = (position + lenTest + 1) & p->pbMask; + nextRepMatchPrice = curAndLenCharPrice + + GET_PRICE_1(p->isMatch[state2][posStateNext]) + + GET_PRICE_1(p->isRep[state2]); + + /* for (; lenTest2 >= 2; lenTest2--) */ + { + UInt32 curAndLenPrice; + COptimal *opt; + UInt32 offset = cur + lenTest + 1 + lenTest2; + while (lenEnd < offset) + p->opt[++lenEnd].price = kInfinityPrice; + curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); + opt = &p->opt[offset]; + if (curAndLenPrice < opt->price) + { + opt->price = curAndLenPrice; + opt->posPrev = cur + lenTest + 1; + opt->backPrev = 0; + opt->prev1IsChar = True; + opt->prev2 = True; + opt->posPrev2 = cur; + opt->backPrev2 = repIndex; + } + } + } + } + } + } + /* for (UInt32 lenTest = 2; lenTest <= newLen; lenTest++) */ + if (newLen > numAvail) + { + newLen = numAvail; + for (numPairs = 0; newLen > matches[numPairs]; numPairs += 2); + matches[numPairs] = newLen; + numPairs += 2; + } + if (newLen >= startLen) + { + UInt32 normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[state]); + UInt32 offs, curBack, posSlot; + UInt32 lenTest; + while (lenEnd < cur + newLen) + p->opt[++lenEnd].price = kInfinityPrice; + + offs = 0; + while (startLen > matches[offs]) + offs += 2; + curBack = matches[offs + 1]; + GetPosSlot2(curBack, posSlot); + for (lenTest = /*2*/ startLen; ; lenTest++) + { + UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][lenTest - LZMA_MATCH_LEN_MIN]; + UInt32 lenToPosState = GetLenToPosState(lenTest); + COptimal *opt; + if (curBack < kNumFullDistances) + curAndLenPrice += p->distancesPrices[lenToPosState][curBack]; + else + curAndLenPrice += p->posSlotPrices[lenToPosState][posSlot] + p->alignPrices[curBack & kAlignMask]; + + opt = &p->opt[cur + lenTest]; + if (curAndLenPrice < opt->price) + { + opt->price = curAndLenPrice; + opt->posPrev = cur; + opt->backPrev = curBack + LZMA_NUM_REPS; + opt->prev1IsChar = False; + } + + if (/*_maxMode && */lenTest == matches[offs]) + { + /* Try Match + Literal + Rep0 */ + const Byte *data2 = data - (curBack + 1); + UInt32 lenTest2 = lenTest + 1; + UInt32 limit = lenTest2 + p->numFastBytes; + UInt32 nextRepMatchPrice; + if (limit > numAvailFull) + limit = numAvailFull; + for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++); + lenTest2 -= lenTest + 1; + if (lenTest2 >= 2) + { + UInt32 state2 = kMatchNextStates[state]; + UInt32 posStateNext = (position + lenTest) & p->pbMask; + UInt32 curAndLenCharPrice = curAndLenPrice + + GET_PRICE_0(p->isMatch[state2][posStateNext]) + + LitEnc_GetPriceMatched(LIT_PROBS(position + lenTest, data[lenTest - 1]), + data[lenTest], data2[lenTest], p->ProbPrices); + state2 = kLiteralNextStates[state2]; + posStateNext = (posStateNext + 1) & p->pbMask; + nextRepMatchPrice = curAndLenCharPrice + + GET_PRICE_1(p->isMatch[state2][posStateNext]) + + GET_PRICE_1(p->isRep[state2]); + + /* for (; lenTest2 >= 2; lenTest2--) */ + { + UInt32 offset = cur + lenTest + 1 + lenTest2; + UInt32 curAndLenPrice; + COptimal *opt; + while (lenEnd < offset) + p->opt[++lenEnd].price = kInfinityPrice; + curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); + opt = &p->opt[offset]; + if (curAndLenPrice < opt->price) + { + opt->price = curAndLenPrice; + opt->posPrev = cur + lenTest + 1; + opt->backPrev = 0; + opt->prev1IsChar = True; + opt->prev2 = True; + opt->posPrev2 = cur; + opt->backPrev2 = curBack + LZMA_NUM_REPS; + } + } + } + offs += 2; + if (offs == numPairs) + break; + curBack = matches[offs + 1]; + if (curBack >= kNumFullDistances) + GetPosSlot2(curBack, posSlot); + } + } + } + } +} + +#define ChangePair(smallDist, bigDist) (((bigDist) >> 7) > (smallDist)) + +static UInt32 GetOptimumFast(CLzmaEnc *p, UInt32 *backRes) +{ + UInt32 numAvail, mainLen, mainDist, numPairs, repIndex, repLen, i; + const Byte *data; + const UInt32 *matches; + + if (p->additionalOffset == 0) + mainLen = ReadMatchDistances(p, &numPairs); + else + { + mainLen = p->longestMatchLength; + numPairs = p->numPairs; + } + + numAvail = p->numAvail; + *backRes = (UInt32)-1; + if (numAvail < 2) + return 1; + if (numAvail > LZMA_MATCH_LEN_MAX) + numAvail = LZMA_MATCH_LEN_MAX; + data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; + + repLen = repIndex = 0; + for (i = 0; i < LZMA_NUM_REPS; i++) + { + UInt32 len; + const Byte *data2 = data - (p->reps[i] + 1); + if (data[0] != data2[0] || data[1] != data2[1]) + continue; + for (len = 2; len < numAvail && data[len] == data2[len]; len++); + if (len >= p->numFastBytes) + { + *backRes = i; + MovePos(p, len - 1); + return len; + } + if (len > repLen) + { + repIndex = i; + repLen = len; + } + } + + matches = p->matches; + if (mainLen >= p->numFastBytes) + { + *backRes = matches[numPairs - 1] + LZMA_NUM_REPS; + MovePos(p, mainLen - 1); + return mainLen; + } + + mainDist = 0; /* for GCC */ + if (mainLen >= 2) + { + mainDist = matches[numPairs - 1]; + while (numPairs > 2 && mainLen == matches[numPairs - 4] + 1) + { + if (!ChangePair(matches[numPairs - 3], mainDist)) + break; + numPairs -= 2; + mainLen = matches[numPairs - 2]; + mainDist = matches[numPairs - 1]; + } + if (mainLen == 2 && mainDist >= 0x80) + mainLen = 1; + } + + if (repLen >= 2 && ( + (repLen + 1 >= mainLen) || + (repLen + 2 >= mainLen && mainDist >= (1 << 9)) || + (repLen + 3 >= mainLen && mainDist >= (1 << 15)))) + { + *backRes = repIndex; + MovePos(p, repLen - 1); + return repLen; + } + + if (mainLen < 2 || numAvail <= 2) + return 1; + + p->longestMatchLength = ReadMatchDistances(p, &p->numPairs); + if (p->longestMatchLength >= 2) + { + UInt32 newDistance = matches[p->numPairs - 1]; + if ((p->longestMatchLength >= mainLen && newDistance < mainDist) || + (p->longestMatchLength == mainLen + 1 && !ChangePair(mainDist, newDistance)) || + (p->longestMatchLength > mainLen + 1) || + (p->longestMatchLength + 1 >= mainLen && mainLen >= 3 && ChangePair(newDistance, mainDist))) + return 1; + } + + data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; + for (i = 0; i < LZMA_NUM_REPS; i++) + { + UInt32 len, limit; + const Byte *data2 = data - (p->reps[i] + 1); + if (data[0] != data2[0] || data[1] != data2[1]) + continue; + limit = mainLen - 1; + for (len = 2; len < limit && data[len] == data2[len]; len++); + if (len >= limit) + return 1; + } + *backRes = mainDist + LZMA_NUM_REPS; + MovePos(p, mainLen - 2); + return mainLen; +} + +static void WriteEndMarker(CLzmaEnc *p, UInt32 posState) +{ + UInt32 len; + RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1); + RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0); + p->state = kMatchNextStates[p->state]; + len = LZMA_MATCH_LEN_MIN; + LenEnc_Encode2(&p->lenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); + RcTree_Encode(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], kNumPosSlotBits, (1 << kNumPosSlotBits) - 1); + RangeEnc_EncodeDirectBits(&p->rc, (((UInt32)1 << 30) - 1) >> kNumAlignBits, 30 - kNumAlignBits); + RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, kAlignMask); +} + +static SRes CheckErrors(CLzmaEnc *p) +{ + if (p->result != SZ_OK) + return p->result; + if (p->rc.res != SZ_OK) + p->result = SZ_ERROR_WRITE; + if (p->matchFinderBase.result != SZ_OK) + p->result = SZ_ERROR_READ; + if (p->result != SZ_OK) + p->finished = True; + return p->result; +} + +static SRes Flush(CLzmaEnc *p, UInt32 nowPos) +{ + /* ReleaseMFStream(); */ + p->finished = True; + if (p->writeEndMark) + WriteEndMarker(p, nowPos & p->pbMask); + RangeEnc_FlushData(&p->rc); + RangeEnc_FlushStream(&p->rc); + return CheckErrors(p); +} + +static void FillAlignPrices(CLzmaEnc *p) +{ + UInt32 i; + for (i = 0; i < kAlignTableSize; i++) + p->alignPrices[i] = RcTree_ReverseGetPrice(p->posAlignEncoder, kNumAlignBits, i, p->ProbPrices); + p->alignPriceCount = 0; +} + +static void FillDistancesPrices(CLzmaEnc *p) +{ + UInt32 tempPrices[kNumFullDistances]; + UInt32 i, lenToPosState; + for (i = kStartPosModelIndex; i < kNumFullDistances; i++) + { + UInt32 posSlot = GetPosSlot1(i); + UInt32 footerBits = ((posSlot >> 1) - 1); + UInt32 base = ((2 | (posSlot & 1)) << footerBits); + tempPrices[i] = RcTree_ReverseGetPrice(p->posEncoders + base - posSlot - 1, footerBits, i - base, p->ProbPrices); + } + + for (lenToPosState = 0; lenToPosState < kNumLenToPosStates; lenToPosState++) + { + UInt32 posSlot; + const CLzmaProb *encoder = p->posSlotEncoder[lenToPosState]; + UInt32 *posSlotPrices = p->posSlotPrices[lenToPosState]; + for (posSlot = 0; posSlot < p->distTableSize; posSlot++) + posSlotPrices[posSlot] = RcTree_GetPrice(encoder, kNumPosSlotBits, posSlot, p->ProbPrices); + for (posSlot = kEndPosModelIndex; posSlot < p->distTableSize; posSlot++) + posSlotPrices[posSlot] += ((((posSlot >> 1) - 1) - kNumAlignBits) << kNumBitPriceShiftBits); + + { + UInt32 *distancesPrices = p->distancesPrices[lenToPosState]; + UInt32 i; + for (i = 0; i < kStartPosModelIndex; i++) + distancesPrices[i] = posSlotPrices[i]; + for (; i < kNumFullDistances; i++) + distancesPrices[i] = posSlotPrices[GetPosSlot1(i)] + tempPrices[i]; + } + } + p->matchPriceCount = 0; +} + +void LzmaEnc_Construct(CLzmaEnc *p) +{ + RangeEnc_Construct(&p->rc); + MatchFinder_Construct(&p->matchFinderBase); + #ifdef COMPRESS_MF_MT + MatchFinderMt_Construct(&p->matchFinderMt); + p->matchFinderMt.MatchFinder = &p->matchFinderBase; + #endif + + { + CLzmaEncProps props; + LzmaEncProps_Init(&props); + LzmaEnc_SetProps(p, &props); + } + + #ifndef LZMA_LOG_BSR + LzmaEnc_FastPosInit(p->g_FastPos); + #endif + + LzmaEnc_InitPriceTables(p->ProbPrices); + p->litProbs = 0; + p->saveState.litProbs = 0; +} + +CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc) +{ + void *p; + p = alloc->Alloc(alloc, sizeof(CLzmaEnc)); + if (p != 0) + LzmaEnc_Construct((CLzmaEnc *)p); + return p; +} + +void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAlloc *alloc) +{ + alloc->Free(alloc, p->litProbs); + alloc->Free(alloc, p->saveState.litProbs); + p->litProbs = 0; + p->saveState.litProbs = 0; +} + +void LzmaEnc_Destruct(CLzmaEnc *p, ISzAlloc *alloc, ISzAlloc *allocBig) +{ + #ifdef COMPRESS_MF_MT + MatchFinderMt_Destruct(&p->matchFinderMt, allocBig); + #endif + MatchFinder_Free(&p->matchFinderBase, allocBig); + LzmaEnc_FreeLits(p, alloc); + RangeEnc_Free(&p->rc, alloc); +} + +void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig) +{ + LzmaEnc_Destruct((CLzmaEnc *)p, alloc, allocBig); + alloc->Free(alloc, p); +} + +static SRes LzmaEnc_CodeOneBlock(CLzmaEnc *p, Bool useLimits, UInt32 maxPackSize, UInt32 maxUnpackSize) +{ + UInt32 nowPos32, startPos32; + if (p->inStream != 0) + { + p->matchFinderBase.stream = p->inStream; + p->matchFinder.Init(p->matchFinderObj); + p->inStream = 0; + } + + if (p->finished) + return p->result; + RINOK(CheckErrors(p)); + + nowPos32 = (UInt32)p->nowPos64; + startPos32 = nowPos32; + + if (p->nowPos64 == 0) + { + UInt32 numPairs; + Byte curByte; + if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0) + return Flush(p, nowPos32); + ReadMatchDistances(p, &numPairs); + RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][0], 0); + p->state = kLiteralNextStates[p->state]; + curByte = p->matchFinder.GetIndexByte(p->matchFinderObj, 0 - p->additionalOffset); + LitEnc_Encode(&p->rc, p->litProbs, curByte); + p->additionalOffset--; + nowPos32++; + } + + if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) != 0) + for (;;) + { + UInt32 pos, len, posState; + + if (p->fastMode) + len = GetOptimumFast(p, &pos); + else + len = GetOptimum(p, nowPos32, &pos); + + #ifdef SHOW_STAT2 + printf("\n pos = %4X, len = %d pos = %d", nowPos32, len, pos); + #endif + + posState = nowPos32 & p->pbMask; + if (len == 1 && pos == (UInt32)-1) + { + Byte curByte; + CLzmaProb *probs; + const Byte *data; + + RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 0); + data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset; + curByte = *data; + probs = LIT_PROBS(nowPos32, *(data - 1)); + if (IsCharState(p->state)) + LitEnc_Encode(&p->rc, probs, curByte); + else + LitEnc_EncodeMatched(&p->rc, probs, curByte, *(data - p->reps[0] - 1)); + p->state = kLiteralNextStates[p->state]; + } + else + { + RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1); + if (pos < LZMA_NUM_REPS) + { + RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 1); + if (pos == 0) + { + RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 0); + RangeEnc_EncodeBit(&p->rc, &p->isRep0Long[p->state][posState], ((len == 1) ? 0 : 1)); + } + else + { + UInt32 distance = p->reps[pos]; + RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 1); + if (pos == 1) + RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 0); + else + { + RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 1); + RangeEnc_EncodeBit(&p->rc, &p->isRepG2[p->state], pos - 2); + if (pos == 3) + p->reps[3] = p->reps[2]; + p->reps[2] = p->reps[1]; + } + p->reps[1] = p->reps[0]; + p->reps[0] = distance; + } + if (len == 1) + p->state = kShortRepNextStates[p->state]; + else + { + LenEnc_Encode2(&p->repLenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); + p->state = kRepNextStates[p->state]; + } + } + else + { + UInt32 posSlot; + RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0); + p->state = kMatchNextStates[p->state]; + LenEnc_Encode2(&p->lenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); + pos -= LZMA_NUM_REPS; + GetPosSlot(pos, posSlot); + RcTree_Encode(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], kNumPosSlotBits, posSlot); + + if (posSlot >= kStartPosModelIndex) + { + UInt32 footerBits = ((posSlot >> 1) - 1); + UInt32 base = ((2 | (posSlot & 1)) << footerBits); + UInt32 posReduced = pos - base; + + if (posSlot < kEndPosModelIndex) + RcTree_ReverseEncode(&p->rc, p->posEncoders + base - posSlot - 1, footerBits, posReduced); + else + { + RangeEnc_EncodeDirectBits(&p->rc, posReduced >> kNumAlignBits, footerBits - kNumAlignBits); + RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, posReduced & kAlignMask); + p->alignPriceCount++; + } + } + p->reps[3] = p->reps[2]; + p->reps[2] = p->reps[1]; + p->reps[1] = p->reps[0]; + p->reps[0] = pos; + p->matchPriceCount++; + } + } + p->additionalOffset -= len; + nowPos32 += len; + if (p->additionalOffset == 0) + { + UInt32 processed; + if (!p->fastMode) + { + if (p->matchPriceCount >= (1 << 7)) + FillDistancesPrices(p); + if (p->alignPriceCount >= kAlignTableSize) + FillAlignPrices(p); + } + if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0) + break; + processed = nowPos32 - startPos32; + if (useLimits) + { + if (processed + kNumOpts + 300 >= maxUnpackSize || + RangeEnc_GetProcessed(&p->rc) + kNumOpts * 2 >= maxPackSize) + break; + } + else if (processed >= (1 << 15)) + { + p->nowPos64 += nowPos32 - startPos32; + return CheckErrors(p); + } + } + } + p->nowPos64 += nowPos32 - startPos32; + return Flush(p, nowPos32); +} + +#define kBigHashDicLimit ((UInt32)1 << 24) + +static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) +{ + UInt32 beforeSize = kNumOpts; + Bool btMode; + if (!RangeEnc_Alloc(&p->rc, alloc)) + return SZ_ERROR_MEM; + btMode = (p->matchFinderBase.btMode != 0); + #ifdef COMPRESS_MF_MT + p->mtMode = (p->multiThread && !p->fastMode && btMode); + #endif + + { + unsigned lclp = p->lc + p->lp; + if (p->litProbs == 0 || p->saveState.litProbs == 0 || p->lclp != lclp) + { + LzmaEnc_FreeLits(p, alloc); + p->litProbs = (CLzmaProb *)alloc->Alloc(alloc, (0x300 << lclp) * sizeof(CLzmaProb)); + p->saveState.litProbs = (CLzmaProb *)alloc->Alloc(alloc, (0x300 << lclp) * sizeof(CLzmaProb)); + if (p->litProbs == 0 || p->saveState.litProbs == 0) + { + LzmaEnc_FreeLits(p, alloc); + return SZ_ERROR_MEM; + } + p->lclp = lclp; + } + } + + p->matchFinderBase.bigHash = (p->dictSize > kBigHashDicLimit); + + if (beforeSize + p->dictSize < keepWindowSize) + beforeSize = keepWindowSize - p->dictSize; + + #ifdef COMPRESS_MF_MT + if (p->mtMode) + { + RINOK(MatchFinderMt_Create(&p->matchFinderMt, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig)); + p->matchFinderObj = &p->matchFinderMt; + MatchFinderMt_CreateVTable(&p->matchFinderMt, &p->matchFinder); + } + else + #endif + { + if (!MatchFinder_Create(&p->matchFinderBase, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig)) + return SZ_ERROR_MEM; + p->matchFinderObj = &p->matchFinderBase; + MatchFinder_CreateVTable(&p->matchFinderBase, &p->matchFinder); + } + return SZ_OK; +} + +void LzmaEnc_Init(CLzmaEnc *p) +{ + UInt32 i; + p->state = 0; + for (i = 0 ; i < LZMA_NUM_REPS; i++) + p->reps[i] = 0; + + RangeEnc_Init(&p->rc); + + + for (i = 0; i < kNumStates; i++) + { + UInt32 j; + for (j = 0; j < LZMA_NUM_PB_STATES_MAX; j++) + { + p->isMatch[i][j] = kProbInitValue; + p->isRep0Long[i][j] = kProbInitValue; + } + p->isRep[i] = kProbInitValue; + p->isRepG0[i] = kProbInitValue; + p->isRepG1[i] = kProbInitValue; + p->isRepG2[i] = kProbInitValue; + } + + { + UInt32 num = 0x300 << (p->lp + p->lc); + for (i = 0; i < num; i++) + p->litProbs[i] = kProbInitValue; + } + + { + for (i = 0; i < kNumLenToPosStates; i++) + { + CLzmaProb *probs = p->posSlotEncoder[i]; + UInt32 j; + for (j = 0; j < (1 << kNumPosSlotBits); j++) + probs[j] = kProbInitValue; + } + } + { + for (i = 0; i < kNumFullDistances - kEndPosModelIndex; i++) + p->posEncoders[i] = kProbInitValue; + } + + LenEnc_Init(&p->lenEnc.p); + LenEnc_Init(&p->repLenEnc.p); + + for (i = 0; i < (1 << kNumAlignBits); i++) + p->posAlignEncoder[i] = kProbInitValue; + + p->optimumEndIndex = 0; + p->optimumCurrentIndex = 0; + p->additionalOffset = 0; + + p->pbMask = (1 << p->pb) - 1; + p->lpMask = (1 << p->lp) - 1; +} + +void LzmaEnc_InitPrices(CLzmaEnc *p) +{ + if (!p->fastMode) + { + FillDistancesPrices(p); + FillAlignPrices(p); + } + + p->lenEnc.tableSize = + p->repLenEnc.tableSize = + p->numFastBytes + 1 - LZMA_MATCH_LEN_MIN; + LenPriceEnc_UpdateTables(&p->lenEnc, 1 << p->pb, p->ProbPrices); + LenPriceEnc_UpdateTables(&p->repLenEnc, 1 << p->pb, p->ProbPrices); +} + +static SRes LzmaEnc_AllocAndInit(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) +{ + UInt32 i; + for (i = 0; i < (UInt32)kDicLogSizeMaxCompress; i++) + if (p->dictSize <= ((UInt32)1 << i)) + break; + p->distTableSize = i * 2; + + p->finished = False; + p->result = SZ_OK; + RINOK(LzmaEnc_Alloc(p, keepWindowSize, alloc, allocBig)); + LzmaEnc_Init(p); + LzmaEnc_InitPrices(p); + p->nowPos64 = 0; + return SZ_OK; +} + +static SRes LzmaEnc_Prepare(CLzmaEncHandle pp, ISeqInStream *inStream, ISeqOutStream *outStream, + ISzAlloc *alloc, ISzAlloc *allocBig) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + p->inStream = inStream; + p->rc.outStream = outStream; + return LzmaEnc_AllocAndInit(p, 0, alloc, allocBig); +} + +SRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle pp, + ISeqInStream *inStream, UInt32 keepWindowSize, + ISzAlloc *alloc, ISzAlloc *allocBig) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + p->inStream = inStream; + return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig); +} + +static void LzmaEnc_SetInputBuf(CLzmaEnc *p, const Byte *src, SizeT srcLen) +{ + p->seqBufInStream.funcTable.Read = MyRead; + p->seqBufInStream.data = src; + p->seqBufInStream.rem = srcLen; +} + +SRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen, + UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + LzmaEnc_SetInputBuf(p, src, srcLen); + p->inStream = &p->seqBufInStream.funcTable; + return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig); +} + +void LzmaEnc_Finish(CLzmaEncHandle pp) +{ + #ifdef COMPRESS_MF_MT + CLzmaEnc *p = (CLzmaEnc *)pp; + if (p->mtMode) + MatchFinderMt_ReleaseStream(&p->matchFinderMt); + #else + pp = pp; + #endif +} + +typedef struct _CSeqOutStreamBuf +{ + ISeqOutStream funcTable; + Byte *data; + SizeT rem; + Bool overflow; +} CSeqOutStreamBuf; + +static size_t MyWrite(void *pp, const void *data, size_t size) +{ + CSeqOutStreamBuf *p = (CSeqOutStreamBuf *)pp; + if (p->rem < size) + { + size = p->rem; + p->overflow = True; + } + memcpy(p->data, data, size); + p->rem -= size; + p->data += size; + return size; +} + + +UInt32 LzmaEnc_GetNumAvailableBytes(CLzmaEncHandle pp) +{ + const CLzmaEnc *p = (CLzmaEnc *)pp; + return p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); +} + +const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp) +{ + const CLzmaEnc *p = (CLzmaEnc *)pp; + return p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset; +} + +SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, Bool reInit, + Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + UInt64 nowPos64; + SRes res; + CSeqOutStreamBuf outStream; + + outStream.funcTable.Write = MyWrite; + outStream.data = dest; + outStream.rem = *destLen; + outStream.overflow = False; + + p->writeEndMark = False; + p->finished = False; + p->result = SZ_OK; + + if (reInit) + LzmaEnc_Init(p); + LzmaEnc_InitPrices(p); + nowPos64 = p->nowPos64; + RangeEnc_Init(&p->rc); + p->rc.outStream = &outStream.funcTable; + + res = LzmaEnc_CodeOneBlock(p, True, desiredPackSize, *unpackSize); + + *unpackSize = (UInt32)(p->nowPos64 - nowPos64); + *destLen -= outStream.rem; + if (outStream.overflow) + return SZ_ERROR_OUTPUT_EOF; + + return res; +} + +SRes LzmaEnc_Encode(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress, + ISzAlloc *alloc, ISzAlloc *allocBig) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + SRes res = SZ_OK; + + #ifdef COMPRESS_MF_MT + Byte allocaDummy[0x300]; + int i = 0; + for (i = 0; i < 16; i++) + allocaDummy[i] = (Byte)i; + #endif + + RINOK(LzmaEnc_Prepare(pp, inStream, outStream, alloc, allocBig)); + + for (;;) + { + res = LzmaEnc_CodeOneBlock(p, False, 0, 0); + if (res != SZ_OK || p->finished != 0) + break; + if (progress != 0) + { + res = progress->Progress(progress, p->nowPos64, RangeEnc_GetProcessed(&p->rc)); + if (res != SZ_OK) + { + res = SZ_ERROR_PROGRESS; + break; + } + } + } + LzmaEnc_Finish(pp); + return res; +} + +SRes LzmaEnc_WriteProperties(CLzmaEncHandle pp, Byte *props, SizeT *size) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + int i; + UInt32 dictSize = p->dictSize; + if (*size < LZMA_PROPS_SIZE) + return SZ_ERROR_PARAM; + *size = LZMA_PROPS_SIZE; + props[0] = (Byte)((p->pb * 5 + p->lp) * 9 + p->lc); + + for (i = 11; i <= 30; i++) + { + if (dictSize <= ((UInt32)2 << i)) + { + dictSize = (2 << i); + break; + } + if (dictSize <= ((UInt32)3 << i)) + { + dictSize = (3 << i); + break; + } + } + + for (i = 0; i < 4; i++) + props[1 + i] = (Byte)(dictSize >> (8 * i)); + return SZ_OK; +} + +SRes LzmaEnc_MemEncode(CLzmaEncHandle pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, + int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig) +{ + SRes res; + CLzmaEnc *p = (CLzmaEnc *)pp; + + CSeqOutStreamBuf outStream; + + LzmaEnc_SetInputBuf(p, src, srcLen); + + outStream.funcTable.Write = MyWrite; + outStream.data = dest; + outStream.rem = *destLen; + outStream.overflow = False; + + p->writeEndMark = writeEndMark; + res = LzmaEnc_Encode(pp, &outStream.funcTable, &p->seqBufInStream.funcTable, + progress, alloc, allocBig); + + *destLen -= outStream.rem; + if (outStream.overflow) + return SZ_ERROR_OUTPUT_EOF; + return res; +} + +SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, + const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, + ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig) +{ + CLzmaEnc *p = (CLzmaEnc *)LzmaEnc_Create(alloc); + SRes res; + if (p == 0) + return SZ_ERROR_MEM; + + res = LzmaEnc_SetProps(p, props); + if (res == SZ_OK) + { + res = LzmaEnc_WriteProperties(p, propsEncoded, propsSize); + if (res == SZ_OK) + res = LzmaEnc_MemEncode(p, dest, destLen, src, srcLen, + writeEndMark, progress, alloc, allocBig); + } + + LzmaEnc_Destroy(p, alloc, allocBig); + return res; +} diff --git a/extern/lzma/LzmaEnc.h b/extern/lzma/LzmaEnc.h new file mode 100644 index 00000000000..bfbc7d2b9c3 --- /dev/null +++ b/extern/lzma/LzmaEnc.h @@ -0,0 +1,72 @@ +/* LzmaEnc.h -- LZMA Encoder +2008-10-04 : Igor Pavlov : Public domain */ + +#ifndef __LZMAENC_H +#define __LZMAENC_H + +#include "Types.h" + +#define LZMA_PROPS_SIZE 5 + +typedef struct _CLzmaEncProps +{ + int level; /* 0 <= level <= 9 */ + UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version + (1 << 12) <= dictSize <= (1 << 30) for 64-bit version + default = (1 << 24) */ + int lc; /* 0 <= lc <= 8, default = 3 */ + int lp; /* 0 <= lp <= 4, default = 0 */ + int pb; /* 0 <= pb <= 4, default = 2 */ + int algo; /* 0 - fast, 1 - normal, default = 1 */ + int fb; /* 5 <= fb <= 273, default = 32 */ + int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */ + int numHashBytes; /* 2, 3 or 4, default = 4 */ + UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */ + unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */ + int numThreads; /* 1 or 2, default = 2 */ +} CLzmaEncProps; + +void LzmaEncProps_Init(CLzmaEncProps *p); +void LzmaEncProps_Normalize(CLzmaEncProps *p); +UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2); + + +/* ---------- CLzmaEncHandle Interface ---------- */ + +/* LzmaEnc_* functions can return the following exit codes: +Returns: + SZ_OK - OK + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_PARAM - Incorrect paramater in props + SZ_ERROR_WRITE - Write callback error. + SZ_ERROR_PROGRESS - some break from progress callback + SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) +*/ + +typedef void * CLzmaEncHandle; + +CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc); +void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig); +SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props); +SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size); +SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream, + ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); +SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, + int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); + +/* ---------- One Call Interface ---------- */ + +/* LzmaEncode +Return code: + SZ_OK - OK + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_PARAM - Incorrect paramater + SZ_ERROR_OUTPUT_EOF - output buffer overflow + SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) +*/ + +SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, + const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, + ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); + +#endif diff --git a/extern/lzma/LzmaLib.c b/extern/lzma/LzmaLib.c new file mode 100644 index 00000000000..02a511857c9 --- /dev/null +++ b/extern/lzma/LzmaLib.c @@ -0,0 +1,46 @@ +/* LzmaLib.c -- LZMA library wrapper +2008-08-05 +Igor Pavlov +Public domain */ + +#include "LzmaEnc.h" +#include "LzmaDec.h" +#include "Alloc.h" +#include "LzmaLib.h" + +static void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); } +static void SzFree(void *p, void *address) { p = p; MyFree(address); } +static ISzAlloc g_Alloc = { SzAlloc, SzFree }; + +MY_STDAPI LzmaCompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen, + unsigned char *outProps, size_t *outPropsSize, + int level, /* 0 <= level <= 9, default = 5 */ + unsigned dictSize, /* use (1 << N) or (3 << N). 4 KB < dictSize <= 128 MB */ + int lc, /* 0 <= lc <= 8, default = 3 */ + int lp, /* 0 <= lp <= 4, default = 0 */ + int pb, /* 0 <= pb <= 4, default = 2 */ + int fb, /* 5 <= fb <= 273, default = 32 */ + int numThreads /* 1 or 2, default = 2 */ +) +{ + CLzmaEncProps props; + LzmaEncProps_Init(&props); + props.level = level; + props.dictSize = dictSize; + props.lc = lc; + props.lp = lp; + props.pb = pb; + props.fb = fb; + props.numThreads = numThreads; + + return LzmaEncode(dest, destLen, src, srcLen, &props, outProps, outPropsSize, 0, + NULL, &g_Alloc, &g_Alloc); +} + + +MY_STDAPI LzmaUncompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t *srcLen, + const unsigned char *props, size_t propsSize) +{ + ELzmaStatus status; + return LzmaDecode(dest, destLen, src, srcLen, props, (unsigned)propsSize, LZMA_FINISH_ANY, &status, &g_Alloc); +} diff --git a/extern/lzma/LzmaLib.h b/extern/lzma/LzmaLib.h new file mode 100644 index 00000000000..5c9eeec73ca --- /dev/null +++ b/extern/lzma/LzmaLib.h @@ -0,0 +1,135 @@ +/* LzmaLib.h -- LZMA library interface +2008-08-05 +Igor Pavlov +Public domain */ + +#ifndef __LZMALIB_H +#define __LZMALIB_H + +#include "Types.h" + +#ifdef __cplusplus + #define MY_EXTERN_C extern "C" +#else + #define MY_EXTERN_C extern +#endif + +#define MY_STDAPI MY_EXTERN_C int MY_STD_CALL + +#define LZMA_PROPS_SIZE 5 + +/* +RAM requirements for LZMA: + for compression: (dictSize * 11.5 + 6 MB) + state_size + for decompression: dictSize + state_size + state_size = (4 + (1.5 << (lc + lp))) KB + by default (lc=3, lp=0), state_size = 16 KB. + +LZMA properties (5 bytes) format + Offset Size Description + 0 1 lc, lp and pb in encoded form. + 1 4 dictSize (little endian). +*/ + +/* +LzmaCompress +------------ + +outPropsSize - + In: the pointer to the size of outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5. + Out: the pointer to the size of written properties in outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5. + + LZMA Encoder will use defult values for any parameter, if it is + -1 for any from: level, loc, lp, pb, fb, numThreads + 0 for dictSize + +level - compression level: 0 <= level <= 9; + + level dictSize algo fb + 0: 16 KB 0 32 + 1: 64 KB 0 32 + 2: 256 KB 0 32 + 3: 1 MB 0 32 + 4: 4 MB 0 32 + 5: 16 MB 1 32 + 6: 32 MB 1 32 + 7+: 64 MB 1 64 + + The default value for "level" is 5. + + algo = 0 means fast method + algo = 1 means normal method + +dictSize - The dictionary size in bytes. The maximum value is + 128 MB = (1 << 27) bytes for 32-bit version + 1 GB = (1 << 30) bytes for 64-bit version + The default value is 16 MB = (1 << 24) bytes. + It's recommended to use the dictionary that is larger than 4 KB and + that can be calculated as (1 << N) or (3 << N) sizes. + +lc - The number of literal context bits (high bits of previous literal). + It can be in the range from 0 to 8. The default value is 3. + Sometimes lc=4 gives the gain for big files. + +lp - The number of literal pos bits (low bits of current position for literals). + It can be in the range from 0 to 4. The default value is 0. + The lp switch is intended for periodical data when the period is equal to 2^lp. + For example, for 32-bit (4 bytes) periodical data you can use lp=2. Often it's + better to set lc=0, if you change lp switch. + +pb - The number of pos bits (low bits of current position). + It can be in the range from 0 to 4. The default value is 2. + The pb switch is intended for periodical data when the period is equal 2^pb. + +fb - Word size (the number of fast bytes). + It can be in the range from 5 to 273. The default value is 32. + Usually, a big number gives a little bit better compression ratio and + slower compression process. + +numThreads - The number of thereads. 1 or 2. The default value is 2. + Fast mode (algo = 0) can use only 1 thread. + +Out: + destLen - processed output size +Returns: + SZ_OK - OK + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_PARAM - Incorrect paramater + SZ_ERROR_OUTPUT_EOF - output buffer overflow + SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) +*/ + +MY_STDAPI LzmaCompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen, + unsigned char *outProps, size_t *outPropsSize, /* *outPropsSize must be = 5 */ + int level, /* 0 <= level <= 9, default = 5 */ + unsigned dictSize, /* default = (1 << 24) */ + int lc, /* 0 <= lc <= 8, default = 3 */ + int lp, /* 0 <= lp <= 4, default = 0 */ + int pb, /* 0 <= pb <= 4, default = 2 */ + int fb, /* 5 <= fb <= 273, default = 32 */ + int numThreads /* 1 or 2, default = 2 */ + ); + +/* +LzmaUncompress +-------------- +In: + dest - output data + destLen - output data size + src - input data + srcLen - input data size +Out: + destLen - processed output size + srcLen - processed input size +Returns: + SZ_OK - OK + SZ_ERROR_DATA - Data error + SZ_ERROR_MEM - Memory allocation arror + SZ_ERROR_UNSUPPORTED - Unsupported properties + SZ_ERROR_INPUT_EOF - it needs more bytes in input buffer (src) +*/ + +MY_STDAPI LzmaUncompress(unsigned char *dest, size_t *destLen, const unsigned char *src, SizeT *srcLen, + const unsigned char *props, size_t propsSize); + +#endif diff --git a/extern/lzma/Threads.c b/extern/lzma/Threads.c new file mode 100644 index 00000000000..4fdd69b0d5c --- /dev/null +++ b/extern/lzma/Threads.c @@ -0,0 +1,109 @@ +/* Threads.c -- multithreading library +2008-08-05 +Igor Pavlov +Public domain */ + +#include "Threads.h" +#include + +static WRes GetError() +{ + DWORD res = GetLastError(); + return (res) ? (WRes)(res) : 1; +} + +WRes HandleToWRes(HANDLE h) { return (h != 0) ? 0 : GetError(); } +WRes BOOLToWRes(BOOL v) { return v ? 0 : GetError(); } + +static WRes MyCloseHandle(HANDLE *h) +{ + if (*h != NULL) + if (!CloseHandle(*h)) + return GetError(); + *h = NULL; + return 0; +} + +WRes Thread_Create(CThread *thread, THREAD_FUNC_RET_TYPE (THREAD_FUNC_CALL_TYPE *startAddress)(void *), LPVOID parameter) +{ + unsigned threadId; /* Windows Me/98/95: threadId parameter may not be NULL in _beginthreadex/CreateThread functions */ + thread->handle = + /* CreateThread(0, 0, startAddress, parameter, 0, &threadId); */ + (HANDLE)_beginthreadex(NULL, 0, startAddress, parameter, 0, &threadId); + /* maybe we must use errno here, but probably GetLastError() is also OK. */ + return HandleToWRes(thread->handle); +} + +WRes WaitObject(HANDLE h) +{ + return (WRes)WaitForSingleObject(h, INFINITE); +} + +WRes Thread_Wait(CThread *thread) +{ + if (thread->handle == NULL) + return 1; + return WaitObject(thread->handle); +} + +WRes Thread_Close(CThread *thread) +{ + return MyCloseHandle(&thread->handle); +} + +WRes Event_Create(CEvent *p, BOOL manualReset, int initialSignaled) +{ + p->handle = CreateEvent(NULL, manualReset, (initialSignaled ? TRUE : FALSE), NULL); + return HandleToWRes(p->handle); +} + +WRes ManualResetEvent_Create(CManualResetEvent *p, int initialSignaled) + { return Event_Create(p, TRUE, initialSignaled); } +WRes ManualResetEvent_CreateNotSignaled(CManualResetEvent *p) + { return ManualResetEvent_Create(p, 0); } + +WRes AutoResetEvent_Create(CAutoResetEvent *p, int initialSignaled) + { return Event_Create(p, FALSE, initialSignaled); } +WRes AutoResetEvent_CreateNotSignaled(CAutoResetEvent *p) + { return AutoResetEvent_Create(p, 0); } + +WRes Event_Set(CEvent *p) { return BOOLToWRes(SetEvent(p->handle)); } +WRes Event_Reset(CEvent *p) { return BOOLToWRes(ResetEvent(p->handle)); } +WRes Event_Wait(CEvent *p) { return WaitObject(p->handle); } +WRes Event_Close(CEvent *p) { return MyCloseHandle(&p->handle); } + + +WRes Semaphore_Create(CSemaphore *p, UInt32 initiallyCount, UInt32 maxCount) +{ + p->handle = CreateSemaphore(NULL, (LONG)initiallyCount, (LONG)maxCount, NULL); + return HandleToWRes(p->handle); +} + +WRes Semaphore_Release(CSemaphore *p, LONG releaseCount, LONG *previousCount) +{ + return BOOLToWRes(ReleaseSemaphore(p->handle, releaseCount, previousCount)); +} +WRes Semaphore_ReleaseN(CSemaphore *p, UInt32 releaseCount) +{ + return Semaphore_Release(p, (LONG)releaseCount, NULL); +} +WRes Semaphore_Release1(CSemaphore *p) +{ + return Semaphore_ReleaseN(p, 1); +} + +WRes Semaphore_Wait(CSemaphore *p) { return WaitObject(p->handle); } +WRes Semaphore_Close(CSemaphore *p) { return MyCloseHandle(&p->handle); } + +WRes CriticalSection_Init(CCriticalSection *p) +{ + /* InitializeCriticalSection can raise only STATUS_NO_MEMORY exception */ + __try + { + InitializeCriticalSection(p); + /* InitializeCriticalSectionAndSpinCount(p, 0); */ + } + __except (EXCEPTION_EXECUTE_HANDLER) { return 1; } + return 0; +} + diff --git a/extern/lzma/Threads.h b/extern/lzma/Threads.h new file mode 100644 index 00000000000..a823e57858a --- /dev/null +++ b/extern/lzma/Threads.h @@ -0,0 +1,68 @@ +/* Threads.h -- multithreading library +2008-11-22 : Igor Pavlov : Public domain */ + +#ifndef __7Z_THRESDS_H +#define __7Z_THRESDS_H + +#include "Types.h" + +typedef struct _CThread +{ + HANDLE handle; +} CThread; + +#define Thread_Construct(thread) (thread)->handle = NULL +#define Thread_WasCreated(thread) ((thread)->handle != NULL) + +typedef unsigned THREAD_FUNC_RET_TYPE; +#define THREAD_FUNC_CALL_TYPE MY_STD_CALL +#define THREAD_FUNC_DECL THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE + +WRes Thread_Create(CThread *thread, THREAD_FUNC_RET_TYPE (THREAD_FUNC_CALL_TYPE *startAddress)(void *), LPVOID parameter); +WRes Thread_Wait(CThread *thread); +WRes Thread_Close(CThread *thread); + +typedef struct _CEvent +{ + HANDLE handle; +} CEvent; + +typedef CEvent CAutoResetEvent; +typedef CEvent CManualResetEvent; + +#define Event_Construct(event) (event)->handle = NULL +#define Event_IsCreated(event) ((event)->handle != NULL) + +WRes ManualResetEvent_Create(CManualResetEvent *event, int initialSignaled); +WRes ManualResetEvent_CreateNotSignaled(CManualResetEvent *event); +WRes AutoResetEvent_Create(CAutoResetEvent *event, int initialSignaled); +WRes AutoResetEvent_CreateNotSignaled(CAutoResetEvent *event); +WRes Event_Set(CEvent *event); +WRes Event_Reset(CEvent *event); +WRes Event_Wait(CEvent *event); +WRes Event_Close(CEvent *event); + + +typedef struct _CSemaphore +{ + HANDLE handle; +} CSemaphore; + +#define Semaphore_Construct(p) (p)->handle = NULL + +WRes Semaphore_Create(CSemaphore *p, UInt32 initiallyCount, UInt32 maxCount); +WRes Semaphore_ReleaseN(CSemaphore *p, UInt32 num); +WRes Semaphore_Release1(CSemaphore *p); +WRes Semaphore_Wait(CSemaphore *p); +WRes Semaphore_Close(CSemaphore *p); + + +typedef CRITICAL_SECTION CCriticalSection; + +WRes CriticalSection_Init(CCriticalSection *p); +#define CriticalSection_Delete(p) DeleteCriticalSection(p) +#define CriticalSection_Enter(p) EnterCriticalSection(p) +#define CriticalSection_Leave(p) LeaveCriticalSection(p) + +#endif + diff --git a/extern/lzma/Types.h b/extern/lzma/Types.h new file mode 100644 index 00000000000..1af5cfc4d86 --- /dev/null +++ b/extern/lzma/Types.h @@ -0,0 +1,208 @@ +/* Types.h -- Basic types +2008-11-23 : Igor Pavlov : Public domain */ + +#ifndef __7Z_TYPES_H +#define __7Z_TYPES_H + +#include + +#ifdef _WIN32 +#include +#endif + +#define SZ_OK 0 + +#define SZ_ERROR_DATA 1 +#define SZ_ERROR_MEM 2 +#define SZ_ERROR_CRC 3 +#define SZ_ERROR_UNSUPPORTED 4 +#define SZ_ERROR_PARAM 5 +#define SZ_ERROR_INPUT_EOF 6 +#define SZ_ERROR_OUTPUT_EOF 7 +#define SZ_ERROR_READ 8 +#define SZ_ERROR_WRITE 9 +#define SZ_ERROR_PROGRESS 10 +#define SZ_ERROR_FAIL 11 +#define SZ_ERROR_THREAD 12 + +#define SZ_ERROR_ARCHIVE 16 +#define SZ_ERROR_NO_ARCHIVE 17 + +typedef int SRes; + +#ifdef _WIN32 +typedef DWORD WRes; +#else +typedef int WRes; +#endif + +#ifndef RINOK +#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; } +#endif + +typedef unsigned char Byte; +typedef short Int16; +typedef unsigned short UInt16; + +#ifdef _LZMA_UINT32_IS_ULONG +typedef long Int32; +typedef unsigned long UInt32; +#else +typedef int Int32; +typedef unsigned int UInt32; +#endif + +#ifdef _SZ_NO_INT_64 + +/* define _SZ_NO_INT_64, if your compiler doesn't support 64-bit integers. + NOTES: Some code will work incorrectly in that case! */ + +typedef long Int64; +typedef unsigned long UInt64; + +#else + +#if defined(_MSC_VER) || defined(__BORLANDC__) +typedef __int64 Int64; +typedef unsigned __int64 UInt64; +#else +typedef long long int Int64; +typedef unsigned long long int UInt64; +#endif + +#endif + +#ifdef _LZMA_NO_SYSTEM_SIZE_T +typedef UInt32 SizeT; +#else +typedef size_t SizeT; +#endif + +typedef int Bool; +#define True 1 +#define False 0 + + +#ifdef _MSC_VER + +#if _MSC_VER >= 1300 +#define MY_NO_INLINE __declspec(noinline) +#else +#define MY_NO_INLINE +#endif + +#define MY_CDECL __cdecl +#define MY_STD_CALL __stdcall +#define MY_FAST_CALL MY_NO_INLINE __fastcall + +#else + +#define MY_CDECL +#define MY_STD_CALL +#define MY_FAST_CALL + +#endif + + +/* The following interfaces use first parameter as pointer to structure */ + +typedef struct +{ + SRes (*Read)(void *p, void *buf, size_t *size); + /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream. + (output(*size) < input(*size)) is allowed */ +} ISeqInStream; + +/* it can return SZ_ERROR_INPUT_EOF */ +SRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size); +SRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType); +SRes SeqInStream_ReadByte(ISeqInStream *stream, Byte *buf); + +typedef struct +{ + size_t (*Write)(void *p, const void *buf, size_t size); + /* Returns: result - the number of actually written bytes. + (result < size) means error */ +} ISeqOutStream; + +typedef enum +{ + SZ_SEEK_SET = 0, + SZ_SEEK_CUR = 1, + SZ_SEEK_END = 2 +} ESzSeek; + +typedef struct +{ + SRes (*Read)(void *p, void *buf, size_t *size); /* same as ISeqInStream::Read */ + SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin); +} ISeekInStream; + +typedef struct +{ + SRes (*Look)(void *p, void **buf, size_t *size); + /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream. + (output(*size) > input(*size)) is not allowed + (output(*size) < input(*size)) is allowed */ + SRes (*Skip)(void *p, size_t offset); + /* offset must be <= output(*size) of Look */ + + SRes (*Read)(void *p, void *buf, size_t *size); + /* reads directly (without buffer). It's same as ISeqInStream::Read */ + SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin); +} ILookInStream; + +SRes LookInStream_LookRead(ILookInStream *stream, void *buf, size_t *size); +SRes LookInStream_SeekTo(ILookInStream *stream, UInt64 offset); + +/* reads via ILookInStream::Read */ +SRes LookInStream_Read2(ILookInStream *stream, void *buf, size_t size, SRes errorType); +SRes LookInStream_Read(ILookInStream *stream, void *buf, size_t size); + +#define LookToRead_BUF_SIZE (1 << 14) + +typedef struct +{ + ILookInStream s; + ISeekInStream *realStream; + size_t pos; + size_t size; + Byte buf[LookToRead_BUF_SIZE]; +} CLookToRead; + +void LookToRead_CreateVTable(CLookToRead *p, int lookahead); +void LookToRead_Init(CLookToRead *p); + +typedef struct +{ + ISeqInStream s; + ILookInStream *realStream; +} CSecToLook; + +void SecToLook_CreateVTable(CSecToLook *p); + +typedef struct +{ + ISeqInStream s; + ILookInStream *realStream; +} CSecToRead; + +void SecToRead_CreateVTable(CSecToRead *p); + +typedef struct +{ + SRes (*Progress)(void *p, UInt64 inSize, UInt64 outSize); + /* Returns: result. (result != SZ_OK) means break. + Value (UInt64)(Int64)-1 for size means unknown value. */ +} ICompressProgress; + +typedef struct +{ + void *(*Alloc)(void *p, size_t size); + void (*Free)(void *p, void *address); /* address can be 0 */ +} ISzAlloc; + +#define IAlloc_Alloc(p, size) (p)->Alloc((p), size) +#define IAlloc_Free(p, a) (p)->Free((p), a) + +#endif diff --git a/extern/lzma/history.txt b/extern/lzma/history.txt new file mode 100644 index 00000000000..014186717da --- /dev/null +++ b/extern/lzma/history.txt @@ -0,0 +1,236 @@ +HISTORY of the LZMA SDK +----------------------- + +4.65 2009-02-03 +------------------------- +- Some minor fixes + + +4.63 2008-12-31 +------------------------- +- Some minor fixes + + +4.61 beta 2008-11-23 +------------------------- +- The bug in ANSI-C LZMA Decoder was fixed: + If encoded stream was corrupted, decoder could access memory + outside of allocated range. +- Some changes in ANSI-C 7z Decoder interfaces. +- LZMA SDK is placed in the public domain. + + +4.60 beta 2008-08-19 +------------------------- +- Some minor fixes. + + +4.59 beta 2008-08-13 +------------------------- +- The bug was fixed: + LZMA Encoder in fast compression mode could access memory outside of + allocated range in some rare cases. + + +4.58 beta 2008-05-05 +------------------------- +- ANSI-C LZMA Decoder was rewritten for speed optimizations. +- ANSI-C LZMA Encoder was included to LZMA SDK. +- C++ LZMA code now is just wrapper over ANSI-C code. + + +4.57 2007-12-12 +------------------------- +- Speed optimizations in Ñ++ LZMA Decoder. +- Small changes for more compatibility with some C/C++ compilers. + + +4.49 beta 2007-07-05 +------------------------- +- .7z ANSI-C Decoder: + - now it supports BCJ and BCJ2 filters + - now it supports files larger than 4 GB. + - now it supports "Last Write Time" field for files. +- C++ code for .7z archives compressing/decompressing from 7-zip + was included to LZMA SDK. + + +4.43 2006-06-04 +------------------------- +- Small changes for more compatibility with some C/C++ compilers. + + +4.42 2006-05-15 +------------------------- +- Small changes in .h files in ANSI-C version. + + +4.39 beta 2006-04-14 +------------------------- +- The bug in versions 4.33b:4.38b was fixed: + C++ version of LZMA encoder could not correctly compress + files larger than 2 GB with HC4 match finder (-mfhc4). + + +4.37 beta 2005-04-06 +------------------------- +- Fixes in C++ code: code could no be compiled if _NO_EXCEPTIONS was defined. + + +4.35 beta 2005-03-02 +------------------------- +- The bug was fixed in C++ version of LZMA Decoder: + If encoded stream was corrupted, decoder could access memory + outside of allocated range. + + +4.34 beta 2006-02-27 +------------------------- +- Compressing speed and memory requirements for compressing were increased +- LZMA now can use only these match finders: HC4, BT2, BT3, BT4 + + +4.32 2005-12-09 +------------------------- +- Java version of LZMA SDK was included + + +4.30 2005-11-20 +------------------------- +- Compression ratio was improved in -a2 mode +- Speed optimizations for compressing in -a2 mode +- -fb switch now supports values up to 273 +- The bug in 7z_C (7zIn.c) was fixed: + It used Alloc/Free functions from different memory pools. + So if program used two memory pools, it worked incorrectly. +- 7z_C: .7z format supporting was improved +- LZMA# SDK (C#.NET version) was included + + +4.27 (Updated) 2005-09-21 +------------------------- +- Some GUIDs/interfaces in C++ were changed. + IStream.h: + ISequentialInStream::Read now works as old ReadPart + ISequentialOutStream::Write now works as old WritePart + + +4.27 2005-08-07 +------------------------- +- The bug in LzmaDecodeSize.c was fixed: + if _LZMA_IN_CB and _LZMA_OUT_READ were defined, + decompressing worked incorrectly. + + +4.26 2005-08-05 +------------------------- +- Fixes in 7z_C code and LzmaTest.c: + previous versions could work incorrectly, + if malloc(0) returns 0 + + +4.23 2005-06-29 +------------------------- +- Small fixes in C++ code + + +4.22 2005-06-10 +------------------------- +- Small fixes + + +4.21 2005-06-08 +------------------------- +- Interfaces for ANSI-C LZMA Decoder (LzmaDecode.c) were changed +- New additional version of ANSI-C LZMA Decoder with zlib-like interface: + - LzmaStateDecode.h + - LzmaStateDecode.c + - LzmaStateTest.c +- ANSI-C LZMA Decoder now can decompress files larger than 4 GB + + +4.17 2005-04-18 +------------------------- +- New example for RAM->RAM compressing/decompressing: + LZMA + BCJ (filter for x86 code): + - LzmaRam.h + - LzmaRam.cpp + - LzmaRamDecode.h + - LzmaRamDecode.c + - -f86 switch for lzma.exe + + +4.16 2005-03-29 +------------------------- +- The bug was fixed in LzmaDecode.c (ANSI-C LZMA Decoder): + If _LZMA_OUT_READ was defined, and if encoded stream was corrupted, + decoder could access memory outside of allocated range. +- Speed optimization of ANSI-C LZMA Decoder (now it's about 20% faster). + Old version of LZMA Decoder now is in file LzmaDecodeSize.c. + LzmaDecodeSize.c can provide slightly smaller code than LzmaDecode.c +- Small speed optimization in LZMA C++ code +- filter for SPARC's code was added +- Simplified version of .7z ANSI-C Decoder was included + + +4.06 2004-09-05 +------------------------- +- The bug in v4.05 was fixed: + LZMA-Encoder didn't release output stream in some cases. + + +4.05 2004-08-25 +------------------------- +- Source code of filters for x86, IA-64, ARM, ARM-Thumb + and PowerPC code was included to SDK +- Some internal minor changes + + +4.04 2004-07-28 +------------------------- +- More compatibility with some C++ compilers + + +4.03 2004-06-18 +------------------------- +- "Benchmark" command was added. It measures compressing + and decompressing speed and shows rating values. + Also it checks hardware errors. + + +4.02 2004-06-10 +------------------------- +- C++ LZMA Encoder/Decoder code now is more portable + and it can be compiled by GCC on Linux. + + +4.01 2004-02-15 +------------------------- +- Some detection of data corruption was enabled. + LzmaDecode.c / RangeDecoderReadByte + ..... + { + rd->ExtraBytes = 1; + return 0xFF; + } + + +4.00 2004-02-13 +------------------------- +- Original version of LZMA SDK + + + +HISTORY of the LZMA +------------------- + 2001-2008: Improvements to LZMA compressing/decompressing code, + keeping compatibility with original LZMA format + 1996-2001: Development of LZMA compression format + + Some milestones: + + 2001-08-30: LZMA compression was added to 7-Zip + 1999-01-02: First version of 7-Zip was released + + +End of document diff --git a/extern/lzma/lzma.txt b/extern/lzma/lzma.txt new file mode 100644 index 00000000000..715792d6c17 --- /dev/null +++ b/extern/lzma/lzma.txt @@ -0,0 +1,594 @@ +LZMA SDK 4.65 +------------- + +LZMA SDK provides the documentation, samples, header files, libraries, +and tools you need to develop applications that use LZMA compression. + +LZMA is default and general compression method of 7z format +in 7-Zip compression program (www.7-zip.org). LZMA provides high +compression ratio and very fast decompression. + +LZMA is an improved version of famous LZ77 compression algorithm. +It was improved in way of maximum increasing of compression ratio, +keeping high decompression speed and low memory requirements for +decompressing. + + + +LICENSE +------- + +LZMA SDK is written and placed in the public domain by Igor Pavlov. + + +LZMA SDK Contents +----------------- + +LZMA SDK includes: + + - ANSI-C/C++/C#/Java source code for LZMA compressing and decompressing + - Compiled file->file LZMA compressing/decompressing program for Windows system + + +UNIX/Linux version +------------------ +To compile C++ version of file->file LZMA encoding, go to directory +C++/7zip/Compress/LZMA_Alone +and call make to recompile it: + make -f makefile.gcc clean all + +In some UNIX/Linux versions you must compile LZMA with static libraries. +To compile with static libraries, you can use +LIB = -lm -static + + +Files +--------------------- +lzma.txt - LZMA SDK description (this file) +7zFormat.txt - 7z Format description +7zC.txt - 7z ANSI-C Decoder description +methods.txt - Compression method IDs for .7z +lzma.exe - Compiled file->file LZMA encoder/decoder for Windows +history.txt - history of the LZMA SDK + + +Source code structure +--------------------- + +C/ - C files + 7zCrc*.* - CRC code + Alloc.* - Memory allocation functions + Bra*.* - Filters for x86, IA-64, ARM, ARM-Thumb, PowerPC and SPARC code + LzFind.* - Match finder for LZ (LZMA) encoders + LzFindMt.* - Match finder for LZ (LZMA) encoders for multithreading encoding + LzHash.h - Additional file for LZ match finder + LzmaDec.* - LZMA decoding + LzmaEnc.* - LZMA encoding + LzmaLib.* - LZMA Library for DLL calling + Types.h - Basic types for another .c files + Threads.* - The code for multithreading. + + LzmaLib - LZMA Library (.DLL for Windows) + + LzmaUtil - LZMA Utility (file->file LZMA encoder/decoder). + + Archive - files related to archiving + 7z - 7z ANSI-C Decoder + +CPP/ -- CPP files + + Common - common files for C++ projects + Windows - common files for Windows related code + + 7zip - files related to 7-Zip Project + + Common - common files for 7-Zip + + Compress - files related to compression/decompression + + Copy - Copy coder + RangeCoder - Range Coder (special code of compression/decompression) + LZMA - LZMA compression/decompression on C++ + LZMA_Alone - file->file LZMA compression/decompression + Branch - Filters for x86, IA-64, ARM, ARM-Thumb, PowerPC and SPARC code + + Archive - files related to archiving + + Common - common files for archive handling + 7z - 7z C++ Encoder/Decoder + + Bundles - Modules that are bundles of other modules + + Alone7z - 7zr.exe: Standalone version of 7z.exe that supports only 7z/LZMA/BCJ/BCJ2 + Format7zR - 7zr.dll: Reduced version of 7za.dll: extracting/compressing to 7z/LZMA/BCJ/BCJ2 + Format7zExtractR - 7zxr.dll: Reduced version of 7zxa.dll: extracting from 7z/LZMA/BCJ/BCJ2. + + UI - User Interface files + + Client7z - Test application for 7za.dll, 7zr.dll, 7zxr.dll + Common - Common UI files + Console - Code for console archiver + + + +CS/ - C# files + 7zip + Common - some common files for 7-Zip + Compress - files related to compression/decompression + LZ - files related to LZ (Lempel-Ziv) compression algorithm + LZMA - LZMA compression/decompression + LzmaAlone - file->file LZMA compression/decompression + RangeCoder - Range Coder (special code of compression/decompression) + +Java/ - Java files + SevenZip + Compression - files related to compression/decompression + LZ - files related to LZ (Lempel-Ziv) compression algorithm + LZMA - LZMA compression/decompression + RangeCoder - Range Coder (special code of compression/decompression) + + +C/C++ source code of LZMA SDK is part of 7-Zip project. +7-Zip source code can be downloaded from 7-Zip's SourceForge page: + + http://sourceforge.net/projects/sevenzip/ + + + +LZMA features +------------- + - Variable dictionary size (up to 1 GB) + - Estimated compressing speed: about 2 MB/s on 2 GHz CPU + - Estimated decompressing speed: + - 20-30 MB/s on 2 GHz Core 2 or AMD Athlon 64 + - 1-2 MB/s on 200 MHz ARM, MIPS, PowerPC or other simple RISC + - Small memory requirements for decompressing (16 KB + DictionarySize) + - Small code size for decompressing: 5-8 KB + +LZMA decoder uses only integer operations and can be +implemented in any modern 32-bit CPU (or on 16-bit CPU with some conditions). + +Some critical operations that affect the speed of LZMA decompression: + 1) 32*16 bit integer multiply + 2) Misspredicted branches (penalty mostly depends from pipeline length) + 3) 32-bit shift and arithmetic operations + +The speed of LZMA decompressing mostly depends from CPU speed. +Memory speed has no big meaning. But if your CPU has small data cache, +overall weight of memory speed will slightly increase. + + +How To Use +---------- + +Using LZMA encoder/decoder executable +-------------------------------------- + +Usage: LZMA inputFile outputFile [...] + + e: encode file + + d: decode file + + b: Benchmark. There are two tests: compressing and decompressing + with LZMA method. Benchmark shows rating in MIPS (million + instructions per second). Rating value is calculated from + measured speed and it is normalized with Intel's Core 2 results. + Also Benchmark checks possible hardware errors (RAM + errors in most cases). Benchmark uses these settings: + (-a1, -d21, -fb32, -mfbt4). You can change only -d parameter. + Also you can change the number of iterations. Example for 30 iterations: + LZMA b 30 + Default number of iterations is 10. + + + + + -a{N}: set compression mode 0 = fast, 1 = normal + default: 1 (normal) + + d{N}: Sets Dictionary size - [0, 30], default: 23 (8MB) + The maximum value for dictionary size is 1 GB = 2^30 bytes. + Dictionary size is calculated as DictionarySize = 2^N bytes. + For decompressing file compressed by LZMA method with dictionary + size D = 2^N you need about D bytes of memory (RAM). + + -fb{N}: set number of fast bytes - [5, 273], default: 128 + Usually big number gives a little bit better compression ratio + and slower compression process. + + -lc{N}: set number of literal context bits - [0, 8], default: 3 + Sometimes lc=4 gives gain for big files. + + -lp{N}: set number of literal pos bits - [0, 4], default: 0 + lp switch is intended for periodical data when period is + equal 2^N. For example, for 32-bit (4 bytes) + periodical data you can use lp=2. Often it's better to set lc0, + if you change lp switch. + + -pb{N}: set number of pos bits - [0, 4], default: 2 + pb switch is intended for periodical data + when period is equal 2^N. + + -mf{MF_ID}: set Match Finder. Default: bt4. + Algorithms from hc* group doesn't provide good compression + ratio, but they often works pretty fast in combination with + fast mode (-a0). + + Memory requirements depend from dictionary size + (parameter "d" in table below). + + MF_ID Memory Description + + bt2 d * 9.5 + 4MB Binary Tree with 2 bytes hashing. + bt3 d * 11.5 + 4MB Binary Tree with 3 bytes hashing. + bt4 d * 11.5 + 4MB Binary Tree with 4 bytes hashing. + hc4 d * 7.5 + 4MB Hash Chain with 4 bytes hashing. + + -eos: write End Of Stream marker. By default LZMA doesn't write + eos marker, since LZMA decoder knows uncompressed size + stored in .lzma file header. + + -si: Read data from stdin (it will write End Of Stream marker). + -so: Write data to stdout + + +Examples: + +1) LZMA e file.bin file.lzma -d16 -lc0 + +compresses file.bin to file.lzma with 64 KB dictionary (2^16=64K) +and 0 literal context bits. -lc0 allows to reduce memory requirements +for decompression. + + +2) LZMA e file.bin file.lzma -lc0 -lp2 + +compresses file.bin to file.lzma with settings suitable +for 32-bit periodical data (for example, ARM or MIPS code). + +3) LZMA d file.lzma file.bin + +decompresses file.lzma to file.bin. + + +Compression ratio hints +----------------------- + +Recommendations +--------------- + +To increase the compression ratio for LZMA compressing it's desirable +to have aligned data (if it's possible) and also it's desirable to locate +data in such order, where code is grouped in one place and data is +grouped in other place (it's better than such mixing: code, data, code, +data, ...). + + +Filters +------- +You can increase the compression ratio for some data types, using +special filters before compressing. For example, it's possible to +increase the compression ratio on 5-10% for code for those CPU ISAs: +x86, IA-64, ARM, ARM-Thumb, PowerPC, SPARC. + +You can find C source code of such filters in C/Bra*.* files + +You can check the compression ratio gain of these filters with such +7-Zip commands (example for ARM code): +No filter: + 7z a a1.7z a.bin -m0=lzma + +With filter for little-endian ARM code: + 7z a a2.7z a.bin -m0=arm -m1=lzma + +It works in such manner: +Compressing = Filter_encoding + LZMA_encoding +Decompressing = LZMA_decoding + Filter_decoding + +Compressing and decompressing speed of such filters is very high, +so it will not increase decompressing time too much. +Moreover, it reduces decompression time for LZMA_decoding, +since compression ratio with filtering is higher. + +These filters convert CALL (calling procedure) instructions +from relative offsets to absolute addresses, so such data becomes more +compressible. + +For some ISAs (for example, for MIPS) it's impossible to get gain from such filter. + + +LZMA compressed file format +--------------------------- +Offset Size Description + 0 1 Special LZMA properties (lc,lp, pb in encoded form) + 1 4 Dictionary size (little endian) + 5 8 Uncompressed size (little endian). -1 means unknown size + 13 Compressed data + + +ANSI-C LZMA Decoder +~~~~~~~~~~~~~~~~~~~ + +Please note that interfaces for ANSI-C code were changed in LZMA SDK 4.58. +If you want to use old interfaces you can download previous version of LZMA SDK +from sourceforge.net site. + +To use ANSI-C LZMA Decoder you need the following files: +1) LzmaDec.h + LzmaDec.c + Types.h +LzmaUtil/LzmaUtil.c is example application that uses these files. + + +Memory requirements for LZMA decoding +------------------------------------- + +Stack usage of LZMA decoding function for local variables is not +larger than 200-400 bytes. + +LZMA Decoder uses dictionary buffer and internal state structure. +Internal state structure consumes + state_size = (4 + (1.5 << (lc + lp))) KB +by default (lc=3, lp=0), state_size = 16 KB. + + +How To decompress data +---------------------- + +LZMA Decoder (ANSI-C version) now supports 2 interfaces: +1) Single-call Decompressing +2) Multi-call State Decompressing (zlib-like interface) + +You must use external allocator: +Example: +void *SzAlloc(void *p, size_t size) { p = p; return malloc(size); } +void SzFree(void *p, void *address) { p = p; free(address); } +ISzAlloc alloc = { SzAlloc, SzFree }; + +You can use p = p; operator to disable compiler warnings. + + +Single-call Decompressing +------------------------- +When to use: RAM->RAM decompressing +Compile files: LzmaDec.h + LzmaDec.c + Types.h +Compile defines: no defines +Memory Requirements: + - Input buffer: compressed size + - Output buffer: uncompressed size + - LZMA Internal Structures: state_size (16 KB for default settings) + +Interface: + int LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, + const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, + ELzmaStatus *status, ISzAlloc *alloc); + In: + dest - output data + destLen - output data size + src - input data + srcLen - input data size + propData - LZMA properties (5 bytes) + propSize - size of propData buffer (5 bytes) + finishMode - It has meaning only if the decoding reaches output limit (*destLen). + LZMA_FINISH_ANY - Decode just destLen bytes. + LZMA_FINISH_END - Stream must be finished after (*destLen). + You can use LZMA_FINISH_END, when you know that + current output buffer covers last bytes of stream. + alloc - Memory allocator. + + Out: + destLen - processed output size + srcLen - processed input size + + Output: + SZ_OK + status: + LZMA_STATUS_FINISHED_WITH_MARK + LZMA_STATUS_NOT_FINISHED + LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK + SZ_ERROR_DATA - Data error + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_UNSUPPORTED - Unsupported properties + SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src). + + If LZMA decoder sees end_marker before reaching output limit, it returns OK result, + and output value of destLen will be less than output buffer size limit. + + You can use multiple checks to test data integrity after full decompression: + 1) Check Result and "status" variable. + 2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize. + 3) Check that output(srcLen) = compressedSize, if you know real compressedSize. + You must use correct finish mode in that case. */ + + +Multi-call State Decompressing (zlib-like interface) +---------------------------------------------------- + +When to use: file->file decompressing +Compile files: LzmaDec.h + LzmaDec.c + Types.h + +Memory Requirements: + - Buffer for input stream: any size (for example, 16 KB) + - Buffer for output stream: any size (for example, 16 KB) + - LZMA Internal Structures: state_size (16 KB for default settings) + - LZMA dictionary (dictionary size is encoded in LZMA properties header) + +1) read LZMA properties (5 bytes) and uncompressed size (8 bytes, little-endian) to header: + unsigned char header[LZMA_PROPS_SIZE + 8]; + ReadFile(inFile, header, sizeof(header) + +2) Allocate CLzmaDec structures (state + dictionary) using LZMA properties + + CLzmaDec state; + LzmaDec_Constr(&state); + res = LzmaDec_Allocate(&state, header, LZMA_PROPS_SIZE, &g_Alloc); + if (res != SZ_OK) + return res; + +3) Init LzmaDec structure before any new LZMA stream. And call LzmaDec_DecodeToBuf in loop + + LzmaDec_Init(&state); + for (;;) + { + ... + int res = LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, + const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode); + ... + } + + +4) Free all allocated structures + LzmaDec_Free(&state, &g_Alloc); + +For full code example, look at C/LzmaUtil/LzmaUtil.c code. + + +How To compress data +-------------------- + +Compile files: LzmaEnc.h + LzmaEnc.c + Types.h + +LzFind.c + LzFind.h + LzFindMt.c + LzFindMt.h + LzHash.h + +Memory Requirements: + - (dictSize * 11.5 + 6 MB) + state_size + +Lzma Encoder can use two memory allocators: +1) alloc - for small arrays. +2) allocBig - for big arrays. + +For example, you can use Large RAM Pages (2 MB) in allocBig allocator for +better compression speed. Note that Windows has bad implementation for +Large RAM Pages. +It's OK to use same allocator for alloc and allocBig. + + +Single-call Compression with callbacks +-------------------------------------- + +Check C/LzmaUtil/LzmaUtil.c as example, + +When to use: file->file decompressing + +1) you must implement callback structures for interfaces: +ISeqInStream +ISeqOutStream +ICompressProgress +ISzAlloc + +static void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); } +static void SzFree(void *p, void *address) { p = p; MyFree(address); } +static ISzAlloc g_Alloc = { SzAlloc, SzFree }; + + CFileSeqInStream inStream; + CFileSeqOutStream outStream; + + inStream.funcTable.Read = MyRead; + inStream.file = inFile; + outStream.funcTable.Write = MyWrite; + outStream.file = outFile; + + +2) Create CLzmaEncHandle object; + + CLzmaEncHandle enc; + + enc = LzmaEnc_Create(&g_Alloc); + if (enc == 0) + return SZ_ERROR_MEM; + + +3) initialize CLzmaEncProps properties; + + LzmaEncProps_Init(&props); + + Then you can change some properties in that structure. + +4) Send LZMA properties to LZMA Encoder + + res = LzmaEnc_SetProps(enc, &props); + +5) Write encoded properties to header + + Byte header[LZMA_PROPS_SIZE + 8]; + size_t headerSize = LZMA_PROPS_SIZE; + UInt64 fileSize; + int i; + + res = LzmaEnc_WriteProperties(enc, header, &headerSize); + fileSize = MyGetFileLength(inFile); + for (i = 0; i < 8; i++) + header[headerSize++] = (Byte)(fileSize >> (8 * i)); + MyWriteFileAndCheck(outFile, header, headerSize) + +6) Call encoding function: + res = LzmaEnc_Encode(enc, &outStream.funcTable, &inStream.funcTable, + NULL, &g_Alloc, &g_Alloc); + +7) Destroy LZMA Encoder Object + LzmaEnc_Destroy(enc, &g_Alloc, &g_Alloc); + + +If callback function return some error code, LzmaEnc_Encode also returns that code. + + +Single-call RAM->RAM Compression +-------------------------------- + +Single-call RAM->RAM Compression is similar to Compression with callbacks, +but you provide pointers to buffers instead of pointers to stream callbacks: + +HRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, + CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, + ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); + +Return code: + SZ_OK - OK + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_PARAM - Incorrect paramater + SZ_ERROR_OUTPUT_EOF - output buffer overflow + SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) + + + +LZMA Defines +------------ + +_LZMA_SIZE_OPT - Enable some optimizations in LZMA Decoder to get smaller executable code. + +_LZMA_PROB32 - It can increase the speed on some 32-bit CPUs, but memory usage for + some structures will be doubled in that case. + +_LZMA_UINT32_IS_ULONG - Define it if int is 16-bit on your compiler and long is 32-bit. + +_LZMA_NO_SYSTEM_SIZE_T - Define it if you don't want to use size_t type. + + +C++ LZMA Encoder/Decoder +~~~~~~~~~~~~~~~~~~~~~~~~ +C++ LZMA code use COM-like interfaces. So if you want to use it, +you can study basics of COM/OLE. +C++ LZMA code is just wrapper over ANSI-C code. + + +C++ Notes +~~~~~~~~~~~~~~~~~~~~~~~~ +If you use some C++ code folders in 7-Zip (for example, C++ code for .7z handling), +you must check that you correctly work with "new" operator. +7-Zip can be compiled with MSVC 6.0 that doesn't throw "exception" from "new" operator. +So 7-Zip uses "CPP\Common\NewHandler.cpp" that redefines "new" operator: +operator new(size_t size) +{ + void *p = ::malloc(size); + if (p == 0) + throw CNewException(); + return p; +} +If you use MSCV that throws exception for "new" operator, you can compile without +"NewHandler.cpp". So standard exception will be used. Actually some code of +7-Zip catches any exception in internal code and converts it to HRESULT code. +So you don't need to catch CNewException, if you call COM interfaces of 7-Zip. + +--- + +http://www.7-zip.org +http://www.7-zip.org/sdk.html +http://www.7-zip.org/support.html diff --git a/extern/lzo/CMakeLists.txt b/extern/lzo/CMakeLists.txt new file mode 100644 index 00000000000..b640cf658da --- /dev/null +++ b/extern/lzo/CMakeLists.txt @@ -0,0 +1,34 @@ +# $Id$ +# ***** 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) 2006, Blender Foundation +# All rights reserved. +# +# The Original Code is: all of this file. +# +# Contributor(s): Daniel Genrich +# +# ***** END GPL LICENSE BLOCK ***** + +SET(INC include) + +FILE(GLOB SRC minilzo/*.c) + + + +BLENDERLIB(bf_minilzo "${SRC}" "${INC}") +#, libtype='blender', priority = 0 ) diff --git a/extern/lzo/SConscript b/extern/lzo/SConscript new file mode 100644 index 00000000000..81bedad25d8 --- /dev/null +++ b/extern/lzo/SConscript @@ -0,0 +1,9 @@ +#!/usr/bin/python +Import ('env') + +sources = env.Glob('minilzo/*.c') + +defs = '' +incs = ' include ' + +env.BlenderLib ('bf_minilzo', sources, Split(incs), Split(defs), libtype=['intern'], priority=[40] ) diff --git a/extern/lzo/minilzo/COPYING b/extern/lzo/minilzo/COPYING new file mode 100644 index 00000000000..5ee49f42e91 --- /dev/null +++ b/extern/lzo/minilzo/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + 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 + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/extern/lzo/minilzo/Makefile b/extern/lzo/minilzo/Makefile new file mode 100644 index 00000000000..a6ee373e8bc --- /dev/null +++ b/extern/lzo/minilzo/Makefile @@ -0,0 +1,113 @@ +# +# a very simple Makefile for miniLZO +# +# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +# + +PROGRAM = testmini +SOURCES = testmini.c minilzo.c + +default: + @echo "Please choose one of the following targets:" + @echo " gcc: gcc" + @echo " unix: hpux hpux9" + @echo " win32: win32-bc win32-cygwin win32-dm win32-lccwin32" + @echo " win32-intelc win32-mingw win32-vc win32-watcomc" + @echo " dos16: dos16-bc dos16-mc dos16-wc" + @echo " dos32: dos32-djgpp2 dos32-wc" + + +# Make sure that minilzo.h, lzoconf.h and lzodefs.h are in the +# current dircectory. Otherwise you may want to adjust CPPFLAGS. +##CPPFLAGS = -I../include/lzo -I. + +GCC_CFLAGS = -s -Wall -O2 -fomit-frame-pointer + + +# +# gcc (generic) +# + +gcc: + gcc $(CPPFLAGS) $(GCC_CFLAGS) -o $(PROGRAM) $(SOURCES) + +cc: + cc $(CPPFLAGS) -o $(PROGRAM) $(SOURCES) + + +# +# UNIX +# + +hpux: + cc -Ae $(CPPFLAGS) -o $(PROGRAM) $(SOURCES) + +hpux9: + cc -Aa -D_HPUX_SOURCE $(CPPFLAGS) -o $(PROGRAM) $(SOURCES) + + +# +# Windows (32-bit) +# + +win32-borlandc win32-bc: + bcc32 -O2 -d -w -w-aus $(CPPFLAGS) $(SOURCES) + +win32-cygwin32 win32-cygwin: + gcc -mcygwin $(CPPFLAGS) $(GCC_CFLAGS) -o $(PROGRAM).exe $(SOURCES) + +win32-digitalmars win32-dm: + dmc -mn -o -w- $(CPPFLAGS) $(SOURCES) + +win32-intelc win32-ic: + icl -nologo -MD -W3 -O2 -GF $(CPPFLAGS) $(SOURCES) + +win32-lccwin32: + @echo "NOTE: need lcc 2002-07-25 or newer, older versions have bugs" + lc -A -unused -O $(CPPFLAGS) $(SOURCES) + +win32-mingw32 win32-mingw: + gcc -mno-cygwin $(CPPFLAGS) $(GCC_CFLAGS) -o $(PROGRAM).exe $(SOURCES) + +win32-visualc win32-vc: + cl -nologo -MD -W3 -O2 -GF $(CPPFLAGS) $(SOURCES) + +win32-watcomc win32-wc: + wcl386 -bt=nt -zq -mf -5r -zc -w5 -oneatx $(CPPFLAGS) $(SOURCES) + + +# +# DOS (16-bit) +# + +dos16-borlandc dos16-bc: + bcc -ml -w -d -O -4 $(CPPFLAGS) $(SOURCES) + +dos16-microsoftc dos16-msc dos16-mc: + cl -nologo -f- -AL -O -G2 -W3 $(CPPFLAGS) $(SOURCES) + +dos16-watcomc dos16-wc: + wcl -zq -ml -bt=dos -l=dos -ox -w5 $(CPPFLAGS) $(SOURCES) + + +# +# DOS (32-bit) +# + +dos32-djgpp2 dos32-dj2: + gcc $(CPPFLAGS) $(GCC_CFLAGS) -o $(PROGRAM).exe $(SOURCES) + +dos32-watcomc dos32-wc: + wcl386 -zq -mf -bt=dos -l=dos4g -5r -ox -zc $(CPPFLAGS) $(SOURCES) + + +# +# other targets +# + +clean: + rm -f $(PROGRAM) $(PROGRAM).exe $(PROGRAM).map $(PROGRAM).tds + rm -f *.err *.o *.obj + +.PHONY: default clean + diff --git a/extern/lzo/minilzo/README.LZO b/extern/lzo/minilzo/README.LZO new file mode 100644 index 00000000000..3700f28e310 --- /dev/null +++ b/extern/lzo/minilzo/README.LZO @@ -0,0 +1,123 @@ + + ============================================================================ + miniLZO -- mini subset of the LZO real-time data compression library + ============================================================================ + + Author : Markus Franz Xaver Johannes Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + Version : 2.03 + Date : 30 Apr 2008 + + I've created miniLZO for projects where it is inconvenient to + include (or require) the full LZO source code just because you + want to add a little bit of data compression to your application. + + miniLZO implements the LZO1X-1 compressor and both the standard and + safe LZO1X decompressor. Apart from fast compression it also useful + for situations where you want to use pre-compressed data files (which + must have been compressed with LZO1X-999). + + miniLZO consists of one C source file and three header files: + minilzo.c + minilzo.h, lzoconf.h, lzodefs.h + + To use miniLZO just copy these files into your source directory, add + minilzo.c to your Makefile and #include minilzo.h from your program. + Note: you also must distribute this file (`README.LZO') with your project. + + minilzo.o compiles to about 6 kB (using gcc or Visual C on a i386), and + the sources are about 30 kB when packed with zip - so there's no more + excuse that your application doesn't support data compression :-) + + For more information, documentation, example programs and other support + files (like Makefiles and build scripts) please download the full LZO + package from + http://www.oberhumer.com/opensource/lzo/ + + Have fun, + Markus + + + P.S. minilzo.c is generated automatically from the LZO sources and + therefore functionality is completely identical + + + Appendix A: building miniLZO + ---------------------------- + miniLZO is written such a way that it should compile and run + out-of-the-box on most machines. + + If you are running on a very unusual architecture and lzo_init() fails then + you should first recompile with `-DLZO_DEBUG' to see what causes the failure. + The most probable case is something like `sizeof(char *) != sizeof(long)'. + After identifying the problem you can compile by adding some defines + like `-DSIZEOF_CHAR_P=8' to your Makefile. + + The best solution is (of course) using Autoconf - if your project uses + Autoconf anyway just add `-DMINILZO_HAVE_CONFIG_H' to your compiler + flags when compiling minilzo.c. See the LZO distribution for an example + how to set up configure.in. + + + Appendix B: list of public functions available in miniLZO + --------------------------------------------------------- + Library initialization + lzo_init() + + Compression + lzo1x_1_compress() + + Decompression + lzo1x_decompress() + lzo1x_decompress_safe() + + Checksum functions + lzo_adler32() + + Version functions + lzo_version() + lzo_version_string() + lzo_version_date() + + Portable (but slow) string functions + lzo_memcmp() + lzo_memcpy() + lzo_memmove() + lzo_memset() + + + Appendix C: suggested macros for `configure.in' when using Autoconf + ------------------------------------------------------------------- + Checks for typedefs and structures + AC_CHECK_TYPE(ptrdiff_t,long) + AC_TYPE_SIZE_T + AC_CHECK_SIZEOF(short) + AC_CHECK_SIZEOF(int) + AC_CHECK_SIZEOF(long) + AC_CHECK_SIZEOF(long long) + AC_CHECK_SIZEOF(__int64) + AC_CHECK_SIZEOF(void *) + AC_CHECK_SIZEOF(size_t) + AC_CHECK_SIZEOF(ptrdiff_t) + + Checks for compiler characteristics + AC_C_CONST + + Checks for library functions + AC_CHECK_FUNCS(memcmp memcpy memmove memset) + + + Appendix D: Copyright + --------------------- + LZO and miniLZO are Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, + 2003, 2004, 2005, 2006, 2007, 2008 Markus Franz Xaver Johannes Oberhumer + + LZO and miniLZO are distributed under the terms of the GNU General + Public License (GPL). See the file COPYING. + + Special licenses for commercial and other applications which + are not willing to accept the GNU General Public License + are available by contacting the author. + + diff --git a/extern/lzo/minilzo/lzoconf.h b/extern/lzo/minilzo/lzoconf.h new file mode 100644 index 00000000000..cc437f1ebfe --- /dev/null +++ b/extern/lzo/minilzo/lzoconf.h @@ -0,0 +1,417 @@ +/* lzoconf.h -- configuration for the LZO real-time data compression library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library 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. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __LZOCONF_H_INCLUDED +#define __LZOCONF_H_INCLUDED + +#define LZO_VERSION 0x2030 +#define LZO_VERSION_STRING "2.03" +#define LZO_VERSION_DATE "Apr 30 2008" + +/* internal Autoconf configuration file - only used when building LZO */ +#if defined(LZO_HAVE_CONFIG_H) +# include +#endif +#include +#include + + +/*********************************************************************** +// LZO requires a conforming +************************************************************************/ + +#if !defined(CHAR_BIT) || (CHAR_BIT != 8) +# error "invalid CHAR_BIT" +#endif +#if !defined(UCHAR_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX) +# error "check your compiler installation" +#endif +#if (USHRT_MAX < 1) || (UINT_MAX < 1) || (ULONG_MAX < 1) +# error "your limits.h macros are broken" +#endif + +/* get OS and architecture defines */ +#ifndef __LZODEFS_H_INCLUDED +#include "lzodefs.h" +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +/*********************************************************************** +// some core defines +************************************************************************/ + +#if !defined(LZO_UINT32_C) +# if (UINT_MAX < LZO_0xffffffffL) +# define LZO_UINT32_C(c) c ## UL +# else +# define LZO_UINT32_C(c) ((c) + 0U) +# endif +#endif + +/* memory checkers */ +#if !defined(__LZO_CHECKER) +# if defined(__BOUNDS_CHECKING_ON) +# define __LZO_CHECKER 1 +# elif defined(__CHECKER__) +# define __LZO_CHECKER 1 +# elif defined(__INSURE__) +# define __LZO_CHECKER 1 +# elif defined(__PURIFY__) +# define __LZO_CHECKER 1 +# endif +#endif + + +/*********************************************************************** +// integral and pointer types +************************************************************************/ + +/* lzo_uint should match size_t */ +#if !defined(LZO_UINT_MAX) +# if defined(LZO_ABI_LLP64) /* WIN64 */ +# if defined(LZO_OS_WIN64) + typedef unsigned __int64 lzo_uint; + typedef __int64 lzo_int; +# else + typedef unsigned long long lzo_uint; + typedef long long lzo_int; +# endif +# define LZO_UINT_MAX 0xffffffffffffffffull +# define LZO_INT_MAX 9223372036854775807LL +# define LZO_INT_MIN (-1LL - LZO_INT_MAX) +# elif defined(LZO_ABI_IP32L64) /* MIPS R5900 */ + typedef unsigned int lzo_uint; + typedef int lzo_int; +# define LZO_UINT_MAX UINT_MAX +# define LZO_INT_MAX INT_MAX +# define LZO_INT_MIN INT_MIN +# elif (ULONG_MAX >= LZO_0xffffffffL) + typedef unsigned long lzo_uint; + typedef long lzo_int; +# define LZO_UINT_MAX ULONG_MAX +# define LZO_INT_MAX LONG_MAX +# define LZO_INT_MIN LONG_MIN +# else +# error "lzo_uint" +# endif +#endif + +/* Integral types with 32 bits or more. */ +#if !defined(LZO_UINT32_MAX) +# if (UINT_MAX >= LZO_0xffffffffL) + typedef unsigned int lzo_uint32; + typedef int lzo_int32; +# define LZO_UINT32_MAX UINT_MAX +# define LZO_INT32_MAX INT_MAX +# define LZO_INT32_MIN INT_MIN +# elif (ULONG_MAX >= LZO_0xffffffffL) + typedef unsigned long lzo_uint32; + typedef long lzo_int32; +# define LZO_UINT32_MAX ULONG_MAX +# define LZO_INT32_MAX LONG_MAX +# define LZO_INT32_MIN LONG_MIN +# else +# error "lzo_uint32" +# endif +#endif + +/* The larger type of lzo_uint and lzo_uint32. */ +#if (LZO_UINT_MAX >= LZO_UINT32_MAX) +# define lzo_xint lzo_uint +#else +# define lzo_xint lzo_uint32 +#endif + +/* Memory model that allows to access memory at offsets of lzo_uint. */ +#if !defined(__LZO_MMODEL) +# if (LZO_UINT_MAX <= UINT_MAX) +# define __LZO_MMODEL +# elif defined(LZO_HAVE_MM_HUGE_PTR) +# define __LZO_MMODEL_HUGE 1 +# define __LZO_MMODEL __huge +# else +# define __LZO_MMODEL +# endif +#endif + +/* no typedef here because of const-pointer issues */ +#define lzo_bytep unsigned char __LZO_MMODEL * +#define lzo_charp char __LZO_MMODEL * +#define lzo_voidp void __LZO_MMODEL * +#define lzo_shortp short __LZO_MMODEL * +#define lzo_ushortp unsigned short __LZO_MMODEL * +#define lzo_uint32p lzo_uint32 __LZO_MMODEL * +#define lzo_int32p lzo_int32 __LZO_MMODEL * +#define lzo_uintp lzo_uint __LZO_MMODEL * +#define lzo_intp lzo_int __LZO_MMODEL * +#define lzo_xintp lzo_xint __LZO_MMODEL * +#define lzo_voidpp lzo_voidp __LZO_MMODEL * +#define lzo_bytepp lzo_bytep __LZO_MMODEL * +/* deprecated - use `lzo_bytep' instead of `lzo_byte *' */ +#define lzo_byte unsigned char __LZO_MMODEL + +typedef int lzo_bool; + + +/*********************************************************************** +// function types +************************************************************************/ + +/* name mangling */ +#if !defined(__LZO_EXTERN_C) +# ifdef __cplusplus +# define __LZO_EXTERN_C extern "C" +# else +# define __LZO_EXTERN_C extern +# endif +#endif + +/* calling convention */ +#if !defined(__LZO_CDECL) +# define __LZO_CDECL __lzo_cdecl +#endif + +/* DLL export information */ +#if !defined(__LZO_EXPORT1) +# define __LZO_EXPORT1 +#endif +#if !defined(__LZO_EXPORT2) +# define __LZO_EXPORT2 +#endif + +/* __cdecl calling convention for public C and assembly functions */ +#if !defined(LZO_PUBLIC) +# define LZO_PUBLIC(_rettype) __LZO_EXPORT1 _rettype __LZO_EXPORT2 __LZO_CDECL +#endif +#if !defined(LZO_EXTERN) +# define LZO_EXTERN(_rettype) __LZO_EXTERN_C LZO_PUBLIC(_rettype) +#endif +#if !defined(LZO_PRIVATE) +# define LZO_PRIVATE(_rettype) static _rettype __LZO_CDECL +#endif + +/* function types */ +typedef int +(__LZO_CDECL *lzo_compress_t) ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + +typedef int +(__LZO_CDECL *lzo_decompress_t) ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + +typedef int +(__LZO_CDECL *lzo_optimize_t) ( lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + +typedef int +(__LZO_CDECL *lzo_compress_dict_t)(const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem, + const lzo_bytep dict, lzo_uint dict_len ); + +typedef int +(__LZO_CDECL *lzo_decompress_dict_t)(const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem, + const lzo_bytep dict, lzo_uint dict_len ); + + +/* Callback interface. Currently only the progress indicator ("nprogress") + * is used, but this may change in a future release. */ + +struct lzo_callback_t; +typedef struct lzo_callback_t lzo_callback_t; +#define lzo_callback_p lzo_callback_t __LZO_MMODEL * + +/* malloc & free function types */ +typedef lzo_voidp (__LZO_CDECL *lzo_alloc_func_t) + (lzo_callback_p self, lzo_uint items, lzo_uint size); +typedef void (__LZO_CDECL *lzo_free_func_t) + (lzo_callback_p self, lzo_voidp ptr); + +/* a progress indicator callback function */ +typedef void (__LZO_CDECL *lzo_progress_func_t) + (lzo_callback_p, lzo_uint, lzo_uint, int); + +struct lzo_callback_t +{ + /* custom allocators (set to 0 to disable) */ + lzo_alloc_func_t nalloc; /* [not used right now] */ + lzo_free_func_t nfree; /* [not used right now] */ + + /* a progress indicator callback function (set to 0 to disable) */ + lzo_progress_func_t nprogress; + + /* NOTE: the first parameter "self" of the nalloc/nfree/nprogress + * callbacks points back to this struct, so you are free to store + * some extra info in the following variables. */ + lzo_voidp user1; + lzo_xint user2; + lzo_xint user3; +}; + + +/*********************************************************************** +// error codes and prototypes +************************************************************************/ + +/* Error codes for the compression/decompression functions. Negative + * values are errors, positive values will be used for special but + * normal events. + */ +#define LZO_E_OK 0 +#define LZO_E_ERROR (-1) +#define LZO_E_OUT_OF_MEMORY (-2) /* [not used right now] */ +#define LZO_E_NOT_COMPRESSIBLE (-3) /* [not used right now] */ +#define LZO_E_INPUT_OVERRUN (-4) +#define LZO_E_OUTPUT_OVERRUN (-5) +#define LZO_E_LOOKBEHIND_OVERRUN (-6) +#define LZO_E_EOF_NOT_FOUND (-7) +#define LZO_E_INPUT_NOT_CONSUMED (-8) +#define LZO_E_NOT_YET_IMPLEMENTED (-9) /* [not used right now] */ + + +#ifndef lzo_sizeof_dict_t +# define lzo_sizeof_dict_t ((unsigned)sizeof(lzo_bytep)) +#endif + +/* lzo_init() should be the first function you call. + * Check the return code ! + * + * lzo_init() is a macro to allow checking that the library and the + * compiler's view of various types are consistent. + */ +#define lzo_init() __lzo_init_v2(LZO_VERSION,(int)sizeof(short),(int)sizeof(int),\ + (int)sizeof(long),(int)sizeof(lzo_uint32),(int)sizeof(lzo_uint),\ + (int)lzo_sizeof_dict_t,(int)sizeof(char *),(int)sizeof(lzo_voidp),\ + (int)sizeof(lzo_callback_t)) +LZO_EXTERN(int) __lzo_init_v2(unsigned,int,int,int,int,int,int,int,int,int); + +/* version functions (useful for shared libraries) */ +LZO_EXTERN(unsigned) lzo_version(void); +LZO_EXTERN(const char *) lzo_version_string(void); +LZO_EXTERN(const char *) lzo_version_date(void); +LZO_EXTERN(const lzo_charp) _lzo_version_string(void); +LZO_EXTERN(const lzo_charp) _lzo_version_date(void); + +/* string functions */ +LZO_EXTERN(int) +lzo_memcmp(const lzo_voidp _s1, const lzo_voidp _s2, lzo_uint _len); +LZO_EXTERN(lzo_voidp) +lzo_memcpy(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len); +LZO_EXTERN(lzo_voidp) +lzo_memmove(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len); +LZO_EXTERN(lzo_voidp) +lzo_memset(lzo_voidp _s, int _c, lzo_uint _len); + +/* checksum functions */ +LZO_EXTERN(lzo_uint32) +lzo_adler32(lzo_uint32 _adler, const lzo_bytep _buf, lzo_uint _len); +LZO_EXTERN(lzo_uint32) +lzo_crc32(lzo_uint32 _c, const lzo_bytep _buf, lzo_uint _len); +LZO_EXTERN(const lzo_uint32p) +lzo_get_crc32_table(void); + +/* misc. */ +LZO_EXTERN(int) _lzo_config_check(void); +typedef union { lzo_bytep p; lzo_uint u; } __lzo_pu_u; +typedef union { lzo_bytep p; lzo_uint32 u32; } __lzo_pu32_u; +typedef union { void *vp; lzo_bytep bp; lzo_uint32 u32; long l; } lzo_align_t; + +/* align a char pointer on a boundary that is a multiple of `size' */ +LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp _ptr, lzo_uint _size); +#define LZO_PTR_ALIGN_UP(_ptr,_size) \ + ((_ptr) + (lzo_uint) __lzo_align_gap((const lzo_voidp)(_ptr),(lzo_uint)(_size))) + + +/*********************************************************************** +// deprecated macros - only for backward compatibility with LZO v1.xx +************************************************************************/ + +#if defined(LZO_CFG_COMPAT) + +#define __LZOCONF_H 1 + +#if defined(LZO_ARCH_I086) +# define __LZO_i386 1 +#elif defined(LZO_ARCH_I386) +# define __LZO_i386 1 +#endif + +#if defined(LZO_OS_DOS16) +# define __LZO_DOS 1 +# define __LZO_DOS16 1 +#elif defined(LZO_OS_DOS32) +# define __LZO_DOS 1 +#elif defined(LZO_OS_WIN16) +# define __LZO_WIN 1 +# define __LZO_WIN16 1 +#elif defined(LZO_OS_WIN32) +# define __LZO_WIN 1 +#endif + +#define __LZO_CMODEL +#define __LZO_DMODEL +#define __LZO_ENTRY __LZO_CDECL +#define LZO_EXTERN_CDECL LZO_EXTERN +#define LZO_ALIGN LZO_PTR_ALIGN_UP + +#define lzo_compress_asm_t lzo_compress_t +#define lzo_decompress_asm_t lzo_decompress_t + +#endif /* LZO_CFG_COMPAT */ + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + + +/* vim:set ts=4 et: */ diff --git a/extern/lzo/minilzo/lzodefs.h b/extern/lzo/minilzo/lzodefs.h new file mode 100644 index 00000000000..180563723e5 --- /dev/null +++ b/extern/lzo/minilzo/lzodefs.h @@ -0,0 +1,1807 @@ +/* lzodefs.h -- architecture, OS and compiler specific defines + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library 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. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __LZODEFS_H_INCLUDED +#define __LZODEFS_H_INCLUDED 1 + +#if defined(__CYGWIN32__) && !defined(__CYGWIN__) +# define __CYGWIN__ __CYGWIN32__ +#endif +#if defined(__IBMCPP__) && !defined(__IBMC__) +# define __IBMC__ __IBMCPP__ +#endif +#if defined(__ICL) && defined(_WIN32) && !defined(__INTEL_COMPILER) +# define __INTEL_COMPILER __ICL +#endif +#if 1 && defined(__INTERIX) && defined(__GNUC__) && !defined(_ALL_SOURCE) +# define _ALL_SOURCE 1 +#endif +#if defined(__mips__) && defined(__R5900__) +# if !defined(__LONG_MAX__) +# define __LONG_MAX__ 9223372036854775807L +# endif +#endif +#if defined(__INTEL_COMPILER) && defined(__linux__) +# pragma warning(disable: 193) +#endif +#if defined(__KEIL__) && defined(__C166__) +# pragma warning disable = 322 +#elif 0 && defined(__C251__) +# pragma warning disable = 322 +#endif +#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__) +# if (_MSC_VER >= 1300) +# pragma warning(disable: 4668) +# endif +#endif +#if 0 && defined(__WATCOMC__) +# if (__WATCOMC__ >= 1050) && (__WATCOMC__ < 1060) +# pragma warning 203 9 +# endif +#endif +#if defined(__BORLANDC__) && defined(__MSDOS__) && !defined(__FLAT__) +# pragma option -h +#endif +#if 0 +#define LZO_0xffffL 0xfffful +#define LZO_0xffffffffL 0xfffffffful +#else +#define LZO_0xffffL 65535ul +#define LZO_0xffffffffL 4294967295ul +#endif +#if (LZO_0xffffL == LZO_0xffffffffL) +# error "your preprocessor is broken 1" +#endif +#if (16ul * 16384ul != 262144ul) +# error "your preprocessor is broken 2" +#endif +#if 0 +#if (32767 >= 4294967295ul) +# error "your preprocessor is broken 3" +#endif +#if (65535u >= 4294967295ul) +# error "your preprocessor is broken 4" +#endif +#endif +#if (UINT_MAX == LZO_0xffffL) +#if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__) +# if !defined(MSDOS) +# define MSDOS 1 +# endif +# if !defined(_MSDOS) +# define _MSDOS 1 +# endif +#elif 0 && defined(__VERSION) && defined(MB_LEN_MAX) +# if (__VERSION == 520) && (MB_LEN_MAX == 1) +# if !defined(__AZTEC_C__) +# define __AZTEC_C__ __VERSION +# endif +# if !defined(__DOS__) +# define __DOS__ 1 +# endif +# endif +#endif +#endif +#if defined(_MSC_VER) && defined(M_I86HM) && (UINT_MAX == LZO_0xffffL) +# define ptrdiff_t long +# define _PTRDIFF_T_DEFINED +#endif +#if (UINT_MAX == LZO_0xffffL) +# undef __LZO_RENAME_A +# undef __LZO_RENAME_B +# if defined(__AZTEC_C__) && defined(__DOS__) +# define __LZO_RENAME_A 1 +# elif defined(_MSC_VER) && defined(MSDOS) +# if (_MSC_VER < 600) +# define __LZO_RENAME_A 1 +# elif (_MSC_VER < 700) +# define __LZO_RENAME_B 1 +# endif +# elif defined(__TSC__) && defined(__OS2__) +# define __LZO_RENAME_A 1 +# elif defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0410) +# define __LZO_RENAME_A 1 +# elif defined(__PACIFIC__) && defined(DOS) +# if !defined(__far) +# define __far far +# endif +# if !defined(__near) +# define __near near +# endif +# endif +# if defined(__LZO_RENAME_A) +# if !defined(__cdecl) +# define __cdecl cdecl +# endif +# if !defined(__far) +# define __far far +# endif +# if !defined(__huge) +# define __huge huge +# endif +# if !defined(__near) +# define __near near +# endif +# if !defined(__pascal) +# define __pascal pascal +# endif +# if !defined(__huge) +# define __huge huge +# endif +# elif defined(__LZO_RENAME_B) +# if !defined(__cdecl) +# define __cdecl _cdecl +# endif +# if !defined(__far) +# define __far _far +# endif +# if !defined(__huge) +# define __huge _huge +# endif +# if !defined(__near) +# define __near _near +# endif +# if !defined(__pascal) +# define __pascal _pascal +# endif +# elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__) +# if !defined(__cdecl) +# define __cdecl cdecl +# endif +# if !defined(__pascal) +# define __pascal pascal +# endif +# endif +# undef __LZO_RENAME_A +# undef __LZO_RENAME_B +#endif +#if (UINT_MAX == LZO_0xffffL) +#if defined(__AZTEC_C__) && defined(__DOS__) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +#elif defined(_MSC_VER) && defined(MSDOS) +# if (_MSC_VER < 600) +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +# endif +# if (_MSC_VER < 700) +# define LZO_BROKEN_INTEGRAL_PROMOTION 1 +# define LZO_BROKEN_SIZEOF 1 +# endif +#elif defined(__PACIFIC__) && defined(DOS) +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +#elif defined(__TURBOC__) && defined(__MSDOS__) +# if (__TURBOC__ < 0x0150) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +# define LZO_BROKEN_INTEGRAL_PROMOTION 1 +# endif +# if (__TURBOC__ < 0x0200) +# define LZO_BROKEN_SIZEOF 1 +# endif +# if (__TURBOC__ < 0x0400) && defined(__cplusplus) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +# endif +#elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +# define LZO_BROKEN_SIZEOF 1 +#endif +#endif +#if defined(__WATCOMC__) && (__WATCOMC__ < 900) +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +#endif +#if defined(_CRAY) && defined(_CRAY1) +# define LZO_BROKEN_SIGNED_RIGHT_SHIFT 1 +#endif +#define LZO_PP_STRINGIZE(x) #x +#define LZO_PP_MACRO_EXPAND(x) LZO_PP_STRINGIZE(x) +#define LZO_PP_CONCAT2(a,b) a ## b +#define LZO_PP_CONCAT3(a,b,c) a ## b ## c +#define LZO_PP_CONCAT4(a,b,c,d) a ## b ## c ## d +#define LZO_PP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e +#define LZO_PP_ECONCAT2(a,b) LZO_PP_CONCAT2(a,b) +#define LZO_PP_ECONCAT3(a,b,c) LZO_PP_CONCAT3(a,b,c) +#define LZO_PP_ECONCAT4(a,b,c,d) LZO_PP_CONCAT4(a,b,c,d) +#define LZO_PP_ECONCAT5(a,b,c,d,e) LZO_PP_CONCAT5(a,b,c,d,e) +#if 1 +#define LZO_CPP_STRINGIZE(x) #x +#define LZO_CPP_MACRO_EXPAND(x) LZO_CPP_STRINGIZE(x) +#define LZO_CPP_CONCAT2(a,b) a ## b +#define LZO_CPP_CONCAT3(a,b,c) a ## b ## c +#define LZO_CPP_CONCAT4(a,b,c,d) a ## b ## c ## d +#define LZO_CPP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e +#define LZO_CPP_ECONCAT2(a,b) LZO_CPP_CONCAT2(a,b) +#define LZO_CPP_ECONCAT3(a,b,c) LZO_CPP_CONCAT3(a,b,c) +#define LZO_CPP_ECONCAT4(a,b,c,d) LZO_CPP_CONCAT4(a,b,c,d) +#define LZO_CPP_ECONCAT5(a,b,c,d,e) LZO_CPP_CONCAT5(a,b,c,d,e) +#endif +#define __LZO_MASK_GEN(o,b) (((((o) << ((b)-1)) - (o)) << 1) + (o)) +#if 1 && defined(__cplusplus) +# if !defined(__STDC_CONSTANT_MACROS) +# define __STDC_CONSTANT_MACROS 1 +# endif +# if !defined(__STDC_LIMIT_MACROS) +# define __STDC_LIMIT_MACROS 1 +# endif +#endif +#if defined(__cplusplus) +# define LZO_EXTERN_C extern "C" +#else +# define LZO_EXTERN_C extern +#endif +#if !defined(__LZO_OS_OVERRIDE) +#if defined(LZO_OS_FREESTANDING) +# define LZO_INFO_OS "freestanding" +#elif defined(LZO_OS_EMBEDDED) +# define LZO_INFO_OS "embedded" +#elif 1 && defined(__IAR_SYSTEMS_ICC__) +# define LZO_OS_EMBEDDED 1 +# define LZO_INFO_OS "embedded" +#elif defined(__CYGWIN__) && defined(__GNUC__) +# define LZO_OS_CYGWIN 1 +# define LZO_INFO_OS "cygwin" +#elif defined(__EMX__) && defined(__GNUC__) +# define LZO_OS_EMX 1 +# define LZO_INFO_OS "emx" +#elif defined(__BEOS__) +# define LZO_OS_BEOS 1 +# define LZO_INFO_OS "beos" +#elif defined(__Lynx__) +# define LZO_OS_LYNXOS 1 +# define LZO_INFO_OS "lynxos" +#elif defined(__OS400__) +# define LZO_OS_OS400 1 +# define LZO_INFO_OS "os400" +#elif defined(__QNX__) +# define LZO_OS_QNX 1 +# define LZO_INFO_OS "qnx" +#elif defined(__BORLANDC__) && defined(__DPMI32__) && (__BORLANDC__ >= 0x0460) +# define LZO_OS_DOS32 1 +# define LZO_INFO_OS "dos32" +#elif defined(__BORLANDC__) && defined(__DPMI16__) +# define LZO_OS_DOS16 1 +# define LZO_INFO_OS "dos16" +#elif defined(__ZTC__) && defined(DOS386) +# define LZO_OS_DOS32 1 +# define LZO_INFO_OS "dos32" +#elif defined(__OS2__) || defined(__OS2V2__) +# if (UINT_MAX == LZO_0xffffL) +# define LZO_OS_OS216 1 +# define LZO_INFO_OS "os216" +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_OS_OS2 1 +# define LZO_INFO_OS "os2" +# else +# error "check your limits.h header" +# endif +#elif defined(__WIN64__) || defined(_WIN64) || defined(WIN64) +# define LZO_OS_WIN64 1 +# define LZO_INFO_OS "win64" +#elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__WINDOWS_386__) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +#elif defined(__MWERKS__) && defined(__INTEL__) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +#elif defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows) +# if (UINT_MAX == LZO_0xffffL) +# define LZO_OS_WIN16 1 +# define LZO_INFO_OS "win16" +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +# else +# error "check your limits.h header" +# endif +#elif defined(__DOS__) || defined(__MSDOS__) || defined(_MSDOS) || defined(MSDOS) || (defined(__PACIFIC__) && defined(DOS)) +# if (UINT_MAX == LZO_0xffffL) +# define LZO_OS_DOS16 1 +# define LZO_INFO_OS "dos16" +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_OS_DOS32 1 +# define LZO_INFO_OS "dos32" +# else +# error "check your limits.h header" +# endif +#elif defined(__WATCOMC__) +# if defined(__NT__) && (UINT_MAX == LZO_0xffffL) +# define LZO_OS_DOS16 1 +# define LZO_INFO_OS "dos16" +# elif defined(__NT__) && (__WATCOMC__ < 1100) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +# elif defined(__linux__) || defined(__LINUX__) +# define LZO_OS_POSIX 1 +# define LZO_INFO_OS "posix" +# else +# error "please specify a target using the -bt compiler option" +# endif +#elif defined(__palmos__) +# define LZO_OS_PALMOS 1 +# define LZO_INFO_OS "palmos" +#elif defined(__TOS__) || defined(__atarist__) +# define LZO_OS_TOS 1 +# define LZO_INFO_OS "tos" +#elif defined(macintosh) && !defined(__ppc__) +# define LZO_OS_MACCLASSIC 1 +# define LZO_INFO_OS "macclassic" +#elif defined(__VMS) +# define LZO_OS_VMS 1 +# define LZO_INFO_OS "vms" +#elif ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) +# define LZO_OS_CONSOLE 1 +# define LZO_OS_CONSOLE_PS2 1 +# define LZO_INFO_OS "console" +# define LZO_INFO_OS_CONSOLE "ps2" +#elif (defined(__mips__) && defined(__psp__)) +# define LZO_OS_CONSOLE 1 +# define LZO_OS_CONSOLE_PSP 1 +# define LZO_INFO_OS "console" +# define LZO_INFO_OS_CONSOLE "psp" +#else +# define LZO_OS_POSIX 1 +# define LZO_INFO_OS "posix" +#endif +#if (LZO_OS_POSIX) +# if defined(_AIX) || defined(__AIX__) || defined(__aix__) +# define LZO_OS_POSIX_AIX 1 +# define LZO_INFO_OS_POSIX "aix" +# elif defined(__FreeBSD__) +# define LZO_OS_POSIX_FREEBSD 1 +# define LZO_INFO_OS_POSIX "freebsd" +# elif defined(__hpux__) || defined(__hpux) +# define LZO_OS_POSIX_HPUX 1 +# define LZO_INFO_OS_POSIX "hpux" +# elif defined(__INTERIX) +# define LZO_OS_POSIX_INTERIX 1 +# define LZO_INFO_OS_POSIX "interix" +# elif defined(__IRIX__) || defined(__irix__) +# define LZO_OS_POSIX_IRIX 1 +# define LZO_INFO_OS_POSIX "irix" +# elif defined(__linux__) || defined(__linux) || defined(__LINUX__) +# define LZO_OS_POSIX_LINUX 1 +# define LZO_INFO_OS_POSIX "linux" +# elif defined(__APPLE__) || defined(__MACOS__) +# define LZO_OS_POSIX_MACOSX 1 +# define LZO_INFO_OS_POSIX "macosx" +# elif defined(__minix__) || defined(__minix) +# define LZO_OS_POSIX_MINIX 1 +# define LZO_INFO_OS_POSIX "minix" +# elif defined(__NetBSD__) +# define LZO_OS_POSIX_NETBSD 1 +# define LZO_INFO_OS_POSIX "netbsd" +# elif defined(__OpenBSD__) +# define LZO_OS_POSIX_OPENBSD 1 +# define LZO_INFO_OS_POSIX "openbsd" +# elif defined(__osf__) +# define LZO_OS_POSIX_OSF 1 +# define LZO_INFO_OS_POSIX "osf" +# elif defined(__solaris__) || defined(__sun) +# if defined(__SVR4) || defined(__svr4__) +# define LZO_OS_POSIX_SOLARIS 1 +# define LZO_INFO_OS_POSIX "solaris" +# else +# define LZO_OS_POSIX_SUNOS 1 +# define LZO_INFO_OS_POSIX "sunos" +# endif +# elif defined(__ultrix__) || defined(__ultrix) +# define LZO_OS_POSIX_ULTRIX 1 +# define LZO_INFO_OS_POSIX "ultrix" +# elif defined(_UNICOS) +# define LZO_OS_POSIX_UNICOS 1 +# define LZO_INFO_OS_POSIX "unicos" +# else +# define LZO_OS_POSIX_UNKNOWN 1 +# define LZO_INFO_OS_POSIX "unknown" +# endif +#endif +#endif +#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +# if (UINT_MAX != LZO_0xffffL) +# error "this should not happen" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "this should not happen" +# endif +#endif +#if (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_WIN32 || LZO_OS_WIN64) +# if (UINT_MAX != LZO_0xffffffffL) +# error "this should not happen" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "this should not happen" +# endif +#endif +#if defined(CIL) && defined(_GNUCC) && defined(__GNUC__) +# define LZO_CC_CILLY 1 +# define LZO_INFO_CC "Cilly" +# if defined(__CILLY__) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__CILLY__) +# else +# define LZO_INFO_CCVER "unknown" +# endif +#elif 0 && defined(SDCC) && defined(__VERSION__) && !defined(__GNUC__) +# define LZO_CC_SDCC 1 +# define LZO_INFO_CC "sdcc" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(SDCC) +#elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__) +# define LZO_CC_PATHSCALE (__PATHCC__ * 0x10000L + __PATHCC_MINOR__ * 0x100 + __PATHCC_PATCHLEVEL__) +# define LZO_INFO_CC "Pathscale C" +# define LZO_INFO_CCVER __PATHSCALE__ +#elif defined(__INTEL_COMPILER) +# define LZO_CC_INTELC 1 +# define LZO_INFO_CC "Intel C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__INTEL_COMPILER) +# if defined(_WIN32) || defined(_WIN64) +# define LZO_CC_SYNTAX_MSC 1 +# else +# define LZO_CC_SYNTAX_GNUC 1 +# endif +#elif defined(__POCC__) && defined(_WIN32) +# define LZO_CC_PELLESC 1 +# define LZO_INFO_CC "Pelles C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__POCC__) +#elif defined(__llvm__) && defined(__GNUC__) && defined(__VERSION__) +# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) +# define LZO_CC_LLVM (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__) +# else +# define LZO_CC_LLVM (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100) +# endif +# define LZO_INFO_CC "llvm-gcc" +# define LZO_INFO_CCVER __VERSION__ +#elif defined(__GNUC__) && defined(__VERSION__) +# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) +# define LZO_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__) +# elif defined(__GNUC_MINOR__) +# define LZO_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100) +# else +# define LZO_CC_GNUC (__GNUC__ * 0x10000L) +# endif +# define LZO_INFO_CC "gcc" +# define LZO_INFO_CCVER __VERSION__ +#elif defined(__ACK__) && defined(_ACK) +# define LZO_CC_ACK 1 +# define LZO_INFO_CC "Amsterdam Compiler Kit C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__AZTEC_C__) +# define LZO_CC_AZTECC 1 +# define LZO_INFO_CC "Aztec C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__AZTEC_C__) +#elif defined(__BORLANDC__) +# define LZO_CC_BORLANDC 1 +# define LZO_INFO_CC "Borland C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__BORLANDC__) +#elif defined(_CRAYC) && defined(_RELEASE) +# define LZO_CC_CRAYC 1 +# define LZO_INFO_CC "Cray C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_RELEASE) +#elif defined(__DMC__) && defined(__SC__) +# define LZO_CC_DMC 1 +# define LZO_INFO_CC "Digital Mars C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DMC__) +#elif defined(__DECC) +# define LZO_CC_DECC 1 +# define LZO_INFO_CC "DEC C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DECC) +#elif defined(__HIGHC__) +# define LZO_CC_HIGHC 1 +# define LZO_INFO_CC "MetaWare High C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__IAR_SYSTEMS_ICC__) +# define LZO_CC_IARC 1 +# define LZO_INFO_CC "IAR C" +# if defined(__VER__) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__VER__) +# else +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__IBMC__) +# define LZO_CC_IBMC 1 +# define LZO_INFO_CC "IBM C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMC__) +#elif defined(__KEIL__) && defined(__C166__) +# define LZO_CC_KEILC 1 +# define LZO_INFO_CC "Keil C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__C166__) +#elif defined(__LCC__) && defined(_WIN32) && defined(__LCCOPTIMLEVEL) +# define LZO_CC_LCCWIN32 1 +# define LZO_INFO_CC "lcc-win32" +# define LZO_INFO_CCVER "unknown" +#elif defined(__LCC__) +# define LZO_CC_LCC 1 +# define LZO_INFO_CC "lcc" +# if defined(__LCC_VERSION__) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__LCC_VERSION__) +# else +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(_MSC_VER) +# define LZO_CC_MSC 1 +# define LZO_INFO_CC "Microsoft C" +# if defined(_MSC_FULL_VER) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER) +# else +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) +# endif +#elif defined(__MWERKS__) +# define LZO_CC_MWERKS 1 +# define LZO_INFO_CC "Metrowerks C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__MWERKS__) +#elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386) +# define LZO_CC_NDPC 1 +# define LZO_INFO_CC "Microway NDP C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__PACIFIC__) +# define LZO_CC_PACIFICC 1 +# define LZO_INFO_CC "Pacific C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PACIFIC__) +#elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__)) +# define LZO_CC_PGI 1 +# define LZO_INFO_CC "Portland Group PGI C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__PUREC__) && defined(__TOS__) +# define LZO_CC_PUREC 1 +# define LZO_INFO_CC "Pure C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PUREC__) +#elif defined(__SC__) && defined(__ZTC__) +# define LZO_CC_SYMANTECC 1 +# define LZO_INFO_CC "Symantec C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SC__) +#elif defined(__SUNPRO_C) +# define LZO_INFO_CC "SunPro C" +# if ((__SUNPRO_C)+0 > 0) +# define LZO_CC_SUNPROC __SUNPRO_C +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_C) +# else +# define LZO_CC_SUNPROC 1 +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__SUNPRO_CC) +# define LZO_INFO_CC "SunPro C" +# if ((__SUNPRO_CC)+0 > 0) +# define LZO_CC_SUNPROC __SUNPRO_CC +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_CC) +# else +# define LZO_CC_SUNPROC 1 +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__TINYC__) +# define LZO_CC_TINYC 1 +# define LZO_INFO_CC "Tiny C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TINYC__) +#elif defined(__TSC__) +# define LZO_CC_TOPSPEEDC 1 +# define LZO_INFO_CC "TopSpeed C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TSC__) +#elif defined(__WATCOMC__) +# define LZO_CC_WATCOMC 1 +# define LZO_INFO_CC "Watcom C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__WATCOMC__) +#elif defined(__TURBOC__) +# define LZO_CC_TURBOC 1 +# define LZO_INFO_CC "Turbo C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TURBOC__) +#elif defined(__ZTC__) +# define LZO_CC_ZORTECHC 1 +# define LZO_INFO_CC "Zortech C" +# if (__ZTC__ == 0x310) +# define LZO_INFO_CCVER "0x310" +# else +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ZTC__) +# endif +#else +# define LZO_CC_UNKNOWN 1 +# define LZO_INFO_CC "unknown" +# define LZO_INFO_CCVER "unknown" +#endif +#if 0 && (LZO_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER) +# error "LZO_CC_MSC: _MSC_FULL_VER is not defined" +#endif +#if !defined(__LZO_ARCH_OVERRIDE) && !defined(LZO_ARCH_GENERIC) && defined(_CRAY) +# if (UINT_MAX > LZO_0xffffffffL) && defined(_CRAY) +# if defined(_CRAYMPP) || defined(_CRAYT3D) || defined(_CRAYT3E) +# define LZO_ARCH_CRAY_MPP 1 +# elif defined(_CRAY1) +# define LZO_ARCH_CRAY_PVP 1 +# endif +# endif +#endif +#if !defined(__LZO_ARCH_OVERRIDE) +#if defined(LZO_ARCH_GENERIC) +# define LZO_INFO_ARCH "generic" +#elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +# define LZO_ARCH_I086 1 +# define LZO_ARCH_IA16 1 +# define LZO_INFO_ARCH "i086" +#elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA) +# define LZO_ARCH_ALPHA 1 +# define LZO_INFO_ARCH "alpha" +#elif (LZO_ARCH_CRAY_MPP) && (defined(_CRAYT3D) || defined(_CRAYT3E)) +# define LZO_ARCH_ALPHA 1 +# define LZO_INFO_ARCH "alpha" +#elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64) +# define LZO_ARCH_AMD64 1 +# define LZO_INFO_ARCH "amd64" +#elif defined(__thumb__) || (defined(_M_ARM) && defined(_M_THUMB)) +# define LZO_ARCH_ARM 1 +# define LZO_ARCH_ARM_THUMB 1 +# define LZO_INFO_ARCH "arm_thumb" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__) +# define LZO_ARCH_ARM 1 +# if defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 1) +# define LZO_ARCH_ARM_THUMB 1 +# define LZO_INFO_ARCH "arm_thumb" +# elif defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 2) +# define LZO_INFO_ARCH "arm" +# else +# define LZO_INFO_ARCH "arm" +# endif +#elif defined(__arm__) || defined(_M_ARM) +# define LZO_ARCH_ARM 1 +# define LZO_INFO_ARCH "arm" +#elif (UINT_MAX <= LZO_0xffffL) && defined(__AVR__) +# define LZO_ARCH_AVR 1 +# define LZO_INFO_ARCH "avr" +#elif defined(__bfin__) +# define LZO_ARCH_BLACKFIN 1 +# define LZO_INFO_ARCH "blackfin" +#elif (UINT_MAX == LZO_0xffffL) && defined(__C166__) +# define LZO_ARCH_C166 1 +# define LZO_INFO_ARCH "c166" +#elif defined(__cris__) +# define LZO_ARCH_CRIS 1 +# define LZO_INFO_ARCH "cris" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCEZ80__) +# define LZO_ARCH_EZ80 1 +# define LZO_INFO_ARCH "ez80" +#elif defined(__H8300__) || defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) +# define LZO_ARCH_H8300 1 +# define LZO_INFO_ARCH "h8300" +#elif defined(__hppa__) || defined(__hppa) +# define LZO_ARCH_HPPA 1 +# define LZO_INFO_ARCH "hppa" +#elif defined(__386__) || defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(_M_I386) +# define LZO_ARCH_I386 1 +# define LZO_ARCH_IA32 1 +# define LZO_INFO_ARCH "i386" +#elif (LZO_CC_ZORTECHC && defined(__I86__)) +# define LZO_ARCH_I386 1 +# define LZO_ARCH_IA32 1 +# define LZO_INFO_ARCH "i386" +#elif (LZO_OS_DOS32 && LZO_CC_HIGHC) && defined(_I386) +# define LZO_ARCH_I386 1 +# define LZO_ARCH_IA32 1 +# define LZO_INFO_ARCH "i386" +#elif defined(__ia64__) || defined(__ia64) || defined(_M_IA64) +# define LZO_ARCH_IA64 1 +# define LZO_INFO_ARCH "ia64" +#elif (UINT_MAX == LZO_0xffffL) && defined(__m32c__) +# define LZO_ARCH_M16C 1 +# define LZO_INFO_ARCH "m16c" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCM16C__) +# define LZO_ARCH_M16C 1 +# define LZO_INFO_ARCH "m16c" +#elif defined(__m32r__) +# define LZO_ARCH_M32R 1 +# define LZO_INFO_ARCH "m32r" +#elif (LZO_OS_TOS) || defined(__m68k__) || defined(__m68000__) || defined(__mc68000__) || defined(__mc68020__) || defined(_M_M68K) +# define LZO_ARCH_M68K 1 +# define LZO_INFO_ARCH "m68k" +#elif (UINT_MAX == LZO_0xffffL) && defined(__C251__) +# define LZO_ARCH_MCS251 1 +# define LZO_INFO_ARCH "mcs251" +#elif (UINT_MAX == LZO_0xffffL) && defined(__C51__) +# define LZO_ARCH_MCS51 1 +# define LZO_INFO_ARCH "mcs51" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC8051__) +# define LZO_ARCH_MCS51 1 +# define LZO_INFO_ARCH "mcs51" +#elif defined(__mips__) || defined(__mips) || defined(_MIPS_ARCH) || defined(_M_MRX000) +# define LZO_ARCH_MIPS 1 +# define LZO_INFO_ARCH "mips" +#elif (UINT_MAX == LZO_0xffffL) && defined(__MSP430__) +# define LZO_ARCH_MSP430 1 +# define LZO_INFO_ARCH "msp430" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC430__) +# define LZO_ARCH_MSP430 1 +# define LZO_INFO_ARCH "msp430" +#elif defined(__powerpc__) || defined(__powerpc) || defined(__ppc__) || defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || defined(_ARCH_PWR) +# define LZO_ARCH_POWERPC 1 +# define LZO_INFO_ARCH "powerpc" +#elif defined(__s390__) || defined(__s390) || defined(__s390x__) || defined(__s390x) +# define LZO_ARCH_S390 1 +# define LZO_INFO_ARCH "s390" +#elif defined(__sh__) || defined(_M_SH) +# define LZO_ARCH_SH 1 +# define LZO_INFO_ARCH "sh" +#elif defined(__sparc__) || defined(__sparc) || defined(__sparcv8) +# define LZO_ARCH_SPARC 1 +# define LZO_INFO_ARCH "sparc" +#elif defined(__SPU__) +# define LZO_ARCH_SPU 1 +# define LZO_INFO_ARCH "spu" +#elif (UINT_MAX == LZO_0xffffL) && defined(__z80) +# define LZO_ARCH_Z80 1 +# define LZO_INFO_ARCH "z80" +#elif (LZO_ARCH_CRAY_PVP) +# if defined(_CRAYSV1) +# define LZO_ARCH_CRAY_SV1 1 +# define LZO_INFO_ARCH "cray_sv1" +# elif (_ADDR64) +# define LZO_ARCH_CRAY_T90 1 +# define LZO_INFO_ARCH "cray_t90" +# elif (_ADDR32) +# define LZO_ARCH_CRAY_YMP 1 +# define LZO_INFO_ARCH "cray_ymp" +# else +# define LZO_ARCH_CRAY_XMP 1 +# define LZO_INFO_ARCH "cray_xmp" +# endif +#else +# define LZO_ARCH_UNKNOWN 1 +# define LZO_INFO_ARCH "unknown" +#endif +#endif +#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_DOS32 || LZO_OS_OS2) +# error "FIXME - missing define for CPU architecture" +#endif +#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN32) +# error "FIXME - missing WIN32 define for CPU architecture" +#endif +#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN64) +# error "FIXME - missing WIN64 define for CPU architecture" +#endif +#if (LZO_OS_OS216 || LZO_OS_WIN16) +# define LZO_ARCH_I086PM 1 +# define LZO_ARCH_IA16PM 1 +#elif 1 && (LZO_OS_DOS16 && defined(BLX286)) +# define LZO_ARCH_I086PM 1 +# define LZO_ARCH_IA16PM 1 +#elif 1 && (LZO_OS_DOS16 && defined(DOSX286)) +# define LZO_ARCH_I086PM 1 +# define LZO_ARCH_IA16PM 1 +#elif 1 && (LZO_OS_DOS16 && LZO_CC_BORLANDC && defined(__DPMI16__)) +# define LZO_ARCH_I086PM 1 +# define LZO_ARCH_IA16PM 1 +#endif +#if defined(LZO_ARCH_ARM_THUMB) && !defined(LZO_ARCH_ARM) +# error "this should not happen" +#endif +#if defined(LZO_ARCH_I086PM) && !defined(LZO_ARCH_I086) +# error "this should not happen" +#endif +#if (LZO_ARCH_I086) +# if (UINT_MAX != LZO_0xffffL) +# error "this should not happen" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "this should not happen" +# endif +#endif +#if (LZO_ARCH_I386) +# if (UINT_MAX != LZO_0xffffL) && defined(__i386_int16__) +# error "this should not happen" +# endif +# if (UINT_MAX != LZO_0xffffffffL) && !defined(__i386_int16__) +# error "this should not happen" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "this should not happen" +# endif +#endif +#if !defined(__LZO_MM_OVERRIDE) +#if (LZO_ARCH_I086) +#if (UINT_MAX != LZO_0xffffL) +# error "this should not happen" +#endif +#if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM) +# define LZO_MM_TINY 1 +#elif defined(__HUGE__) || defined(_HUGE_) || defined(M_I86HM) || defined(_M_I86HM) +# define LZO_MM_HUGE 1 +#elif defined(__SMALL__) || defined(M_I86SM) || defined(_M_I86SM) || defined(SMALL_MODEL) +# define LZO_MM_SMALL 1 +#elif defined(__MEDIUM__) || defined(M_I86MM) || defined(_M_I86MM) +# define LZO_MM_MEDIUM 1 +#elif defined(__COMPACT__) || defined(M_I86CM) || defined(_M_I86CM) +# define LZO_MM_COMPACT 1 +#elif defined(__LARGE__) || defined(M_I86LM) || defined(_M_I86LM) || defined(LARGE_MODEL) +# define LZO_MM_LARGE 1 +#elif (LZO_CC_AZTECC) +# if defined(_LARGE_CODE) && defined(_LARGE_DATA) +# define LZO_MM_LARGE 1 +# elif defined(_LARGE_CODE) +# define LZO_MM_MEDIUM 1 +# elif defined(_LARGE_DATA) +# define LZO_MM_COMPACT 1 +# else +# define LZO_MM_SMALL 1 +# endif +#elif (LZO_CC_ZORTECHC && defined(__VCM__)) +# define LZO_MM_LARGE 1 +#else +# error "unknown memory model" +#endif +#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +#define LZO_HAVE_MM_HUGE_PTR 1 +#define LZO_HAVE_MM_HUGE_ARRAY 1 +#if (LZO_MM_TINY) +# undef LZO_HAVE_MM_HUGE_ARRAY +#endif +#if (LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_ZORTECHC) +# undef LZO_HAVE_MM_HUGE_PTR +# undef LZO_HAVE_MM_HUGE_ARRAY +#elif (LZO_CC_DMC || LZO_CC_SYMANTECC) +# undef LZO_HAVE_MM_HUGE_ARRAY +#elif (LZO_CC_MSC && defined(_QC)) +# undef LZO_HAVE_MM_HUGE_ARRAY +# if (_MSC_VER < 600) +# undef LZO_HAVE_MM_HUGE_PTR +# endif +#elif (LZO_CC_TURBOC && (__TURBOC__ < 0x0295)) +# undef LZO_HAVE_MM_HUGE_ARRAY +#endif +#if (LZO_ARCH_I086PM) && !defined(LZO_HAVE_MM_HUGE_PTR) +# if (LZO_OS_DOS16) +# error "this should not happen" +# elif (LZO_CC_ZORTECHC) +# else +# error "this should not happen" +# endif +#endif +#ifdef __cplusplus +extern "C" { +#endif +#if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0200)) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (LZO_CC_MSC || LZO_CC_TOPSPEEDC) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (LZO_CC_TURBOC && (__TURBOC__ >= 0x0295)) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif ((LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_TURBOC) && LZO_OS_DOS16) +# define LZO_MM_AHSHIFT 12 +#elif (LZO_CC_WATCOMC) + extern unsigned char _HShift; +# define LZO_MM_AHSHIFT ((unsigned) _HShift) +#else +# error "FIXME - implement LZO_MM_AHSHIFT" +#endif +#ifdef __cplusplus +} +#endif +#endif +#elif (LZO_ARCH_C166) +#if !defined(__MODEL__) +# error "FIXME - C166 __MODEL__" +#elif ((__MODEL__) == 0) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 1) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define LZO_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define LZO_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define LZO_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define LZO_MM_XSMALL 1 +#else +# error "FIXME - C166 __MODEL__" +#endif +#elif (LZO_ARCH_MCS251) +#if !defined(__MODEL__) +# error "FIXME - MCS251 __MODEL__" +#elif ((__MODEL__) == 0) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define LZO_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define LZO_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define LZO_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define LZO_MM_XSMALL 1 +#else +# error "FIXME - MCS251 __MODEL__" +#endif +#elif (LZO_ARCH_MCS51) +#if !defined(__MODEL__) +# error "FIXME - MCS51 __MODEL__" +#elif ((__MODEL__) == 1) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define LZO_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define LZO_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define LZO_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define LZO_MM_XSMALL 1 +#else +# error "FIXME - MCS51 __MODEL__" +#endif +#elif (LZO_ARCH_CRAY_PVP) +# define LZO_MM_PVP 1 +#else +# define LZO_MM_FLAT 1 +#endif +#if (LZO_MM_COMPACT) +# define LZO_INFO_MM "compact" +#elif (LZO_MM_FLAT) +# define LZO_INFO_MM "flat" +#elif (LZO_MM_HUGE) +# define LZO_INFO_MM "huge" +#elif (LZO_MM_LARGE) +# define LZO_INFO_MM "large" +#elif (LZO_MM_MEDIUM) +# define LZO_INFO_MM "medium" +#elif (LZO_MM_PVP) +# define LZO_INFO_MM "pvp" +#elif (LZO_MM_SMALL) +# define LZO_INFO_MM "small" +#elif (LZO_MM_TINY) +# define LZO_INFO_MM "tiny" +#else +# error "unknown memory model" +#endif +#endif +#if defined(SIZEOF_SHORT) +# define LZO_SIZEOF_SHORT (SIZEOF_SHORT) +#endif +#if defined(SIZEOF_INT) +# define LZO_SIZEOF_INT (SIZEOF_INT) +#endif +#if defined(SIZEOF_LONG) +# define LZO_SIZEOF_LONG (SIZEOF_LONG) +#endif +#if defined(SIZEOF_LONG_LONG) +# define LZO_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG) +#endif +#if defined(SIZEOF___INT16) +# define LZO_SIZEOF___INT16 (SIZEOF___INT16) +#endif +#if defined(SIZEOF___INT32) +# define LZO_SIZEOF___INT32 (SIZEOF___INT32) +#endif +#if defined(SIZEOF___INT64) +# define LZO_SIZEOF___INT64 (SIZEOF___INT64) +#endif +#if defined(SIZEOF_VOID_P) +# define LZO_SIZEOF_VOID_P (SIZEOF_VOID_P) +#endif +#if defined(SIZEOF_SIZE_T) +# define LZO_SIZEOF_SIZE_T (SIZEOF_SIZE_T) +#endif +#if defined(SIZEOF_PTRDIFF_T) +# define LZO_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T) +#endif +#define __LZO_LSR(x,b) (((x)+0ul) >> (b)) +#if !defined(LZO_SIZEOF_SHORT) +# if (LZO_ARCH_CRAY_PVP) +# define LZO_SIZEOF_SHORT 8 +# elif (USHRT_MAX == LZO_0xffffL) +# define LZO_SIZEOF_SHORT 2 +# elif (__LZO_LSR(USHRT_MAX,7) == 1) +# define LZO_SIZEOF_SHORT 1 +# elif (__LZO_LSR(USHRT_MAX,15) == 1) +# define LZO_SIZEOF_SHORT 2 +# elif (__LZO_LSR(USHRT_MAX,31) == 1) +# define LZO_SIZEOF_SHORT 4 +# elif (__LZO_LSR(USHRT_MAX,63) == 1) +# define LZO_SIZEOF_SHORT 8 +# elif (__LZO_LSR(USHRT_MAX,127) == 1) +# define LZO_SIZEOF_SHORT 16 +# else +# error "LZO_SIZEOF_SHORT" +# endif +#endif +#if !defined(LZO_SIZEOF_INT) +# if (LZO_ARCH_CRAY_PVP) +# define LZO_SIZEOF_INT 8 +# elif (UINT_MAX == LZO_0xffffL) +# define LZO_SIZEOF_INT 2 +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_SIZEOF_INT 4 +# elif (__LZO_LSR(UINT_MAX,7) == 1) +# define LZO_SIZEOF_INT 1 +# elif (__LZO_LSR(UINT_MAX,15) == 1) +# define LZO_SIZEOF_INT 2 +# elif (__LZO_LSR(UINT_MAX,31) == 1) +# define LZO_SIZEOF_INT 4 +# elif (__LZO_LSR(UINT_MAX,63) == 1) +# define LZO_SIZEOF_INT 8 +# elif (__LZO_LSR(UINT_MAX,127) == 1) +# define LZO_SIZEOF_INT 16 +# else +# error "LZO_SIZEOF_INT" +# endif +#endif +#if !defined(LZO_SIZEOF_LONG) +# if (ULONG_MAX == LZO_0xffffffffL) +# define LZO_SIZEOF_LONG 4 +# elif (__LZO_LSR(ULONG_MAX,7) == 1) +# define LZO_SIZEOF_LONG 1 +# elif (__LZO_LSR(ULONG_MAX,15) == 1) +# define LZO_SIZEOF_LONG 2 +# elif (__LZO_LSR(ULONG_MAX,31) == 1) +# define LZO_SIZEOF_LONG 4 +# elif (__LZO_LSR(ULONG_MAX,63) == 1) +# define LZO_SIZEOF_LONG 8 +# elif (__LZO_LSR(ULONG_MAX,127) == 1) +# define LZO_SIZEOF_LONG 16 +# else +# error "LZO_SIZEOF_LONG" +# endif +#endif +#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) +#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) +# if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__) +# if (LZO_CC_GNUC >= 0x030300ul) +# if ((__LONG_MAX__)+0 == (__LONG_LONG_MAX__)+0) +# define LZO_SIZEOF_LONG_LONG LZO_SIZEOF_LONG +# elif (__LZO_LSR(__LONG_LONG_MAX__,30) == 1) +# define LZO_SIZEOF_LONG_LONG 4 +# endif +# endif +# endif +#endif +#endif +#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) +#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) +#if (LZO_ARCH_I086 && LZO_CC_DMC) +#elif (LZO_CC_CILLY) && defined(__GNUC__) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_SIZEOF_LONG_LONG 8 +#elif ((LZO_OS_WIN32 || LZO_OS_WIN64 || defined(_WIN32)) && LZO_CC_MSC && (_MSC_VER >= 1400)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_OS_WIN64 || defined(_WIN64)) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_ARCH_I386 && (LZO_CC_DMC)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_SYMANTECC && (__SC__ >= 0x700))) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_INTELC && defined(__linux__))) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_MWERKS || LZO_CC_PELLESC || LZO_CC_PGI || LZO_CC_SUNPROC)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_INTELC || LZO_CC_MSC)) +# define LZO_SIZEOF___INT64 8 +#elif ((LZO_OS_WIN32 || defined(_WIN32)) && (LZO_CC_MSC)) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_ARCH_I386 && (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0520))) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_ARCH_I386 && (LZO_CC_WATCOMC && (__WATCOMC__ >= 1100))) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS == 64)) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_CC_SDCC) && (LZO_SIZEOF_INT == 2) +#elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +# define LZO_SIZEOF_LONG_LONG 8 +#endif +#endif +#endif +#if defined(__cplusplus) && defined(LZO_CC_GNUC) +# if (LZO_CC_GNUC < 0x020800ul) +# undef LZO_SIZEOF_LONG_LONG +# endif +#endif +#if defined(LZO_CFG_NO_LONG_LONG) || defined(__NO_LONG_LONG) +# undef LZO_SIZEOF_LONG_LONG +#endif +#if !defined(LZO_SIZEOF_VOID_P) +#if (LZO_ARCH_I086) +# define __LZO_WORDSIZE 2 +# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM) +# define LZO_SIZEOF_VOID_P 2 +# elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE) +# define LZO_SIZEOF_VOID_P 4 +# else +# error "LZO_MM" +# endif +#elif (LZO_ARCH_AVR || LZO_ARCH_Z80) +# define __LZO_WORDSIZE 1 +# define LZO_SIZEOF_VOID_P 2 +#elif (LZO_ARCH_C166 || LZO_ARCH_MCS51 || LZO_ARCH_MCS251 || LZO_ARCH_MSP430) +# define LZO_SIZEOF_VOID_P 2 +#elif (LZO_ARCH_H8300) +# if defined(__NORMAL_MODE__) +# define __LZO_WORDSIZE 4 +# define LZO_SIZEOF_VOID_P 2 +# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) +# define __LZO_WORDSIZE 4 +# define LZO_SIZEOF_VOID_P 4 +# else +# define __LZO_WORDSIZE 2 +# define LZO_SIZEOF_VOID_P 2 +# endif +# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_SIZEOF_INT == 4) +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_INT +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_INT +# endif +#elif (LZO_ARCH_M16C) +# define __LZO_WORDSIZE 2 +# if defined(__m32c_cpu__) || defined(__m32cm_cpu__) +# define LZO_SIZEOF_VOID_P 4 +# else +# define LZO_SIZEOF_VOID_P 2 +# endif +#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) +# define __LZO_WORDSIZE 8 +# define LZO_SIZEOF_VOID_P 4 +#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64) +# define __LZO_WORDSIZE 8 +# define LZO_SIZEOF_VOID_P 8 +#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) +# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +#elif (LZO_OS_OS400 || defined(__OS400__)) +# define __LZO_WORDSIZE LZO_SIZEOF_LONG +# define LZO_SIZEOF_VOID_P 16 +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) +# define LZO_SIZEOF_VOID_P 8 +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +#elif (LZO_ARCH_SPU) +# if 0 +# define __LZO_WORDSIZE 16 +# endif +# define LZO_SIZEOF_VOID_P 4 +#else +# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG +#endif +#endif +#if !defined(LZO_WORDSIZE) +# if defined(__LZO_WORDSIZE) +# define LZO_WORDSIZE __LZO_WORDSIZE +# else +# define LZO_WORDSIZE LZO_SIZEOF_VOID_P +# endif +#endif +#if !defined(LZO_SIZEOF_SIZE_T) +#if (LZO_ARCH_I086 || LZO_ARCH_M16C) +# define LZO_SIZEOF_SIZE_T 2 +#else +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_VOID_P +#endif +#endif +#if !defined(LZO_SIZEOF_PTRDIFF_T) +#if (LZO_ARCH_I086) +# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM || LZO_MM_HUGE) +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_VOID_P +# elif (LZO_MM_COMPACT || LZO_MM_LARGE) +# if (LZO_CC_BORLANDC || LZO_CC_TURBOC) +# define LZO_SIZEOF_PTRDIFF_T 4 +# else +# define LZO_SIZEOF_PTRDIFF_T 2 +# endif +# else +# error "LZO_MM" +# endif +#else +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_SIZE_T +#endif +#endif +#if defined(LZO_ABI_NEUTRAL_ENDIAN) +# undef LZO_ABI_BIG_ENDIAN +# undef LZO_ABI_LITTLE_ENDIAN +#elif !defined(LZO_ABI_BIG_ENDIAN) && !defined(LZO_ABI_LITTLE_ENDIAN) +#if (LZO_ARCH_ALPHA) && (LZO_ARCH_CRAY_MPP) +# define LZO_ABI_BIG_ENDIAN 1 +#elif (LZO_ARCH_ALPHA || LZO_ARCH_AMD64 || LZO_ARCH_BLACKFIN || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif (LZO_ARCH_M68K || LZO_ARCH_S390) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__) +# if (__LITTLE_ENDIAN__ == 1) +# define LZO_ABI_LITTLE_ENDIAN 1 +# else +# define LZO_ABI_BIG_ENDIAN 1 +# endif +#elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEB__) && !defined(__ARMEL__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#endif +#endif +#if defined(LZO_ABI_BIG_ENDIAN) && defined(LZO_ABI_LITTLE_ENDIAN) +# error "this should not happen" +#endif +#if defined(LZO_ABI_BIG_ENDIAN) +# define LZO_INFO_ABI_ENDIAN "be" +#elif defined(LZO_ABI_LITTLE_ENDIAN) +# define LZO_INFO_ABI_ENDIAN "le" +#elif defined(LZO_ABI_NEUTRAL_ENDIAN) +# define LZO_INFO_ABI_ENDIAN "neutral" +#endif +#if (LZO_SIZEOF_INT == 1 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) +# define LZO_ABI_I8LP16 1 +# define LZO_INFO_ABI_PM "i8lp16" +#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) +# define LZO_ABI_ILP16 1 +# define LZO_INFO_ABI_PM "ilp16" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4) +# define LZO_ABI_ILP32 1 +# define LZO_INFO_ABI_PM "ilp32" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 8 && LZO_SIZEOF_SIZE_T == 8) +# define LZO_ABI_LLP64 1 +# define LZO_INFO_ABI_PM "llp64" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) +# define LZO_ABI_LP64 1 +# define LZO_INFO_ABI_PM "lp64" +#elif (LZO_SIZEOF_INT == 8 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) +# define LZO_ABI_ILP64 1 +# define LZO_INFO_ABI_PM "ilp64" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 4) +# define LZO_ABI_IP32L64 1 +# define LZO_INFO_ABI_PM "ip32l64" +#endif +#if !defined(__LZO_LIBC_OVERRIDE) +#if defined(LZO_LIBC_NAKED) +# define LZO_INFO_LIBC "naked" +#elif defined(LZO_LIBC_FREESTANDING) +# define LZO_INFO_LIBC "freestanding" +#elif defined(LZO_LIBC_MOSTLY_FREESTANDING) +# define LZO_INFO_LIBC "mfreestanding" +#elif defined(LZO_LIBC_ISOC90) +# define LZO_INFO_LIBC "isoc90" +#elif defined(LZO_LIBC_ISOC99) +# define LZO_INFO_LIBC "isoc99" +#elif defined(__dietlibc__) +# define LZO_LIBC_DIETLIBC 1 +# define LZO_INFO_LIBC "dietlibc" +#elif defined(_NEWLIB_VERSION) +# define LZO_LIBC_NEWLIB 1 +# define LZO_INFO_LIBC "newlib" +#elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__) +# if defined(__UCLIBC_SUBLEVEL__) +# define LZO_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + __UCLIBC_MINOR__ * 0x100 + __UCLIBC_SUBLEVEL__) +# else +# define LZO_LIBC_UCLIBC 0x00090bL +# endif +# define LZO_INFO_LIBC "uclibc" +#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) +# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + __GLIBC_MINOR__ * 0x100) +# define LZO_INFO_LIBC "glibc" +#elif (LZO_CC_MWERKS) && defined(__MSL__) +# define LZO_LIBC_MSL __MSL__ +# define LZO_INFO_LIBC "msl" +#elif 1 && defined(__IAR_SYSTEMS_ICC__) +# define LZO_LIBC_ISOC90 1 +# define LZO_INFO_LIBC "isoc90" +#else +# define LZO_LIBC_DEFAULT 1 +# define LZO_INFO_LIBC "default" +#endif +#endif +#if !defined(__lzo_gnuc_extension__) +#if (LZO_CC_GNUC >= 0x020800ul) +# define __lzo_gnuc_extension__ __extension__ +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_gnuc_extension__ __extension__ +#else +# define __lzo_gnuc_extension__ +#endif +#endif +#if !defined(__lzo_ua_volatile) +# define __lzo_ua_volatile volatile +#endif +#if !defined(__lzo_alignof) +#if (LZO_CC_CILLY || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +# define __lzo_alignof(e) __alignof__(e) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 700)) +# define __lzo_alignof(e) __alignof__(e) +#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) +# define __lzo_alignof(e) __alignof(e) +#endif +#endif +#if defined(__lzo_alignof) +# define __lzo_HAVE_alignof 1 +#endif +#if !defined(__lzo_constructor) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_constructor __attribute__((__constructor__,__used__)) +#elif (LZO_CC_GNUC >= 0x020700ul) +# define __lzo_constructor __attribute__((__constructor__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_constructor __attribute__((__constructor__)) +#endif +#endif +#if defined(__lzo_constructor) +# define __lzo_HAVE_constructor 1 +#endif +#if !defined(__lzo_destructor) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_destructor __attribute__((__destructor__,__used__)) +#elif (LZO_CC_GNUC >= 0x020700ul) +# define __lzo_destructor __attribute__((__destructor__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_destructor __attribute__((__destructor__)) +#endif +#endif +#if defined(__lzo_destructor) +# define __lzo_HAVE_destructor 1 +#endif +#if defined(__lzo_HAVE_destructor) && !defined(__lzo_HAVE_constructor) +# error "this should not happen" +#endif +#if !defined(__lzo_inline) +#if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295)) +#elif defined(__cplusplus) +# define __lzo_inline inline +#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550)) +# define __lzo_inline __inline +#elif (LZO_CC_CILLY || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +# define __lzo_inline __inline__ +#elif (LZO_CC_DMC) +# define __lzo_inline __inline +#elif (LZO_CC_INTELC) +# define __lzo_inline __inline +#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x2405)) +# define __lzo_inline __inline +#elif (LZO_CC_MSC && (_MSC_VER >= 900)) +# define __lzo_inline __inline +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +# define __lzo_inline inline +#endif +#endif +#if defined(__lzo_inline) +# define __lzo_HAVE_inline 1 +#else +# define __lzo_inline +#endif +#if !defined(__lzo_forceinline) +#if (LZO_CC_GNUC >= 0x030200ul) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) +# define __lzo_forceinline __forceinline +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) +# define __lzo_forceinline __forceinline +#endif +#endif +#if defined(__lzo_forceinline) +# define __lzo_HAVE_forceinline 1 +#else +# define __lzo_forceinline +#endif +#if !defined(__lzo_noinline) +#if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul) +# define __lzo_noinline __attribute__((__noinline__,__used__)) +#elif (LZO_CC_GNUC >= 0x030200ul) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_MSC) +# define __lzo_noinline __declspec(noinline) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) +# define __lzo_noinline __declspec(noinline) +#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x3200) && (LZO_OS_WIN32 || LZO_OS_WIN64)) +# if defined(__cplusplus) +# else +# define __lzo_noinline __declspec(noinline) +# endif +#endif +#endif +#if defined(__lzo_noinline) +# define __lzo_HAVE_noinline 1 +#else +# define __lzo_noinline +#endif +#if (defined(__lzo_HAVE_forceinline) || defined(__lzo_HAVE_noinline)) && !defined(__lzo_HAVE_inline) +# error "this should not happen" +#endif +#if !defined(__lzo_noreturn) +#if (LZO_CC_GNUC >= 0x020700ul) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) +# define __lzo_noreturn __declspec(noreturn) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) +# define __lzo_noreturn __declspec(noreturn) +#endif +#endif +#if defined(__lzo_noreturn) +# define __lzo_HAVE_noreturn 1 +#else +# define __lzo_noreturn +#endif +#if !defined(__lzo_nothrow) +#if (LZO_CC_GNUC >= 0x030300ul) +# define __lzo_nothrow __attribute__((__nothrow__)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) && defined(__cplusplus) +# define __lzo_nothrow __declspec(nothrow) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC) +# define __lzo_nothrow __attribute__((__nothrow__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_nothrow __attribute__((__nothrow__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus) +# define __lzo_nothrow __declspec(nothrow) +#endif +#endif +#if defined(__lzo_nothrow) +# define __lzo_HAVE_nothrow 1 +#else +# define __lzo_nothrow +#endif +#if !defined(__lzo_restrict) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_LLVM) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_MSC && (_MSC_VER >= 1400)) +# define __lzo_restrict __restrict +#endif +#endif +#if defined(__lzo_restrict) +# define __lzo_HAVE_restrict 1 +#else +# define __lzo_restrict +#endif +#if !defined(__lzo_likely) && !defined(__lzo_unlikely) +#if (LZO_CC_GNUC >= 0x030200ul) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800)) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#endif +#endif +#if defined(__lzo_likely) +# define __lzo_HAVE_likely 1 +#else +# define __lzo_likely(e) (e) +#endif +#if defined(__lzo_unlikely) +# define __lzo_HAVE_unlikely 1 +#else +# define __lzo_unlikely(e) (e) +#endif +#if !defined(LZO_UNUSED) +# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) +# define LZO_UNUSED(var) ((void) &var) +# elif (LZO_CC_BORLANDC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PELLESC || LZO_CC_TURBOC) +# define LZO_UNUSED(var) if (&var) ; else +# elif (LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_UNUSED(var) ((void) var) +# elif (LZO_CC_MSC && (_MSC_VER < 900)) +# define LZO_UNUSED(var) if (&var) ; else +# elif (LZO_CC_KEILC) +# define LZO_UNUSED(var) {extern int __lzo_unused[1-2*!(sizeof(var)>0)];} +# elif (LZO_CC_PACIFICC) +# define LZO_UNUSED(var) ((void) sizeof(var)) +# elif (LZO_CC_WATCOMC) && defined(__cplusplus) +# define LZO_UNUSED(var) ((void) var) +# else +# define LZO_UNUSED(var) ((void) &var) +# endif +#endif +#if !defined(LZO_UNUSED_FUNC) +# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) +# define LZO_UNUSED_FUNC(func) ((void) func) +# elif (LZO_CC_BORLANDC || LZO_CC_NDPC || LZO_CC_TURBOC) +# define LZO_UNUSED_FUNC(func) if (func) ; else +# elif (LZO_CC_LLVM) +# define LZO_UNUSED_FUNC(func) ((void) &func) +# elif (LZO_CC_MSC && (_MSC_VER < 900)) +# define LZO_UNUSED_FUNC(func) if (func) ; else +# elif (LZO_CC_MSC) +# define LZO_UNUSED_FUNC(func) ((void) &func) +# elif (LZO_CC_KEILC || LZO_CC_PELLESC) +# define LZO_UNUSED_FUNC(func) {extern int __lzo_unused[1-2*!(sizeof((int)func)>0)];} +# else +# define LZO_UNUSED_FUNC(func) ((void) func) +# endif +#endif +#if !defined(LZO_UNUSED_LABEL) +# if (LZO_CC_WATCOMC) && defined(__cplusplus) +# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l +# elif (LZO_CC_INTELC || LZO_CC_WATCOMC) +# define LZO_UNUSED_LABEL(l) if (0) goto l +# else +# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l +# endif +#endif +#if !defined(LZO_DEFINE_UNINITIALIZED_VAR) +# if 0 +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var +# elif 0 && (LZO_CC_GNUC) +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var +# else +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init +# endif +#endif +#if !defined(LZO_COMPILE_TIME_ASSERT_HEADER) +# if (LZO_CC_AZTECC || LZO_CC_ZORTECHC) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)]; +# elif (LZO_CC_DMC || LZO_CC_SYMANTECC) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1u-2*!(e)]; +# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)]; +# else +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-2*!(e)]; +# endif +#endif +#if !defined(LZO_COMPILE_TIME_ASSERT) +# if (LZO_CC_AZTECC) +# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-!(e)];} +# elif (LZO_CC_DMC || LZO_CC_PACIFICC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) +# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# elif (LZO_CC_MSC && (_MSC_VER < 900)) +# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) +# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# else +# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-2*!(e)];} +# endif +#endif +#if (LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64) +# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC) +# elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) +# define __lzo_cdecl __cdecl +# define __lzo_cdecl_atexit +# define __lzo_cdecl_main __cdecl +# if (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) +# define __lzo_cdecl_qsort __pascal +# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) +# define __lzo_cdecl_qsort _stdcall +# else +# define __lzo_cdecl_qsort __cdecl +# endif +# elif (LZO_CC_WATCOMC) +# define __lzo_cdecl __cdecl +# else +# define __lzo_cdecl __cdecl +# define __lzo_cdecl_atexit __cdecl +# define __lzo_cdecl_main __cdecl +# define __lzo_cdecl_qsort __cdecl +# endif +# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC || LZO_CC_WATCOMC) +# elif (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) +# define __lzo_cdecl_sighandler __pascal +# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) +# define __lzo_cdecl_sighandler _stdcall +# elif (LZO_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE) +# define __lzo_cdecl_sighandler __clrcall +# elif (LZO_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700)) +# if defined(_DLL) +# define __lzo_cdecl_sighandler _far _cdecl _loadds +# elif defined(_MT) +# define __lzo_cdecl_sighandler _far _cdecl +# else +# define __lzo_cdecl_sighandler _cdecl +# endif +# else +# define __lzo_cdecl_sighandler __cdecl +# endif +#elif (LZO_ARCH_I386) && (LZO_CC_WATCOMC) +# define __lzo_cdecl __cdecl +#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC)) +# define __lzo_cdecl cdecl +#endif +#if !defined(__lzo_cdecl) +# define __lzo_cdecl +#endif +#if !defined(__lzo_cdecl_atexit) +# define __lzo_cdecl_atexit +#endif +#if !defined(__lzo_cdecl_main) +# define __lzo_cdecl_main +#endif +#if !defined(__lzo_cdecl_qsort) +# define __lzo_cdecl_qsort +#endif +#if !defined(__lzo_cdecl_sighandler) +# define __lzo_cdecl_sighandler +#endif +#if !defined(__lzo_cdecl_va) +# define __lzo_cdecl_va __lzo_cdecl +#endif +#if !defined(LZO_CFG_NO_WINDOWS_H) +#if (LZO_OS_CYGWIN || (LZO_OS_EMX && defined(__RSXNT__)) || LZO_OS_WIN32 || LZO_OS_WIN64) +# if (LZO_CC_WATCOMC && (__WATCOMC__ < 1000)) +# elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__) +# elif ((LZO_OS_CYGWIN || defined(__MINGW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x025f00ul))) +# else +# define LZO_HAVE_WINDOWS_H 1 +# endif +#endif +#endif +#if (LZO_ARCH_ALPHA) +# define LZO_OPT_AVOID_UINT_INDEX 1 +# define LZO_OPT_AVOID_SHORT 1 +# define LZO_OPT_AVOID_USHORT 1 +#elif (LZO_ARCH_AMD64) +# define LZO_OPT_AVOID_INT_INDEX 1 +# define LZO_OPT_AVOID_UINT_INDEX 1 +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +# define LZO_OPT_UNALIGNED64 1 +#elif (LZO_ARCH_ARM && LZO_ARCH_ARM_THUMB) +#elif (LZO_ARCH_ARM) +# define LZO_OPT_AVOID_SHORT 1 +# define LZO_OPT_AVOID_USHORT 1 +#elif (LZO_ARCH_CRIS) +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +#elif (LZO_ARCH_I386) +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +#elif (LZO_ARCH_IA64) +# define LZO_OPT_AVOID_INT_INDEX 1 +# define LZO_OPT_AVOID_UINT_INDEX 1 +# define LZO_OPT_PREFER_POSTINC 1 +#elif (LZO_ARCH_M68K) +# define LZO_OPT_PREFER_POSTINC 1 +# define LZO_OPT_PREFER_PREDEC 1 +# if defined(__mc68020__) && !defined(__mcoldfire__) +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +# endif +#elif (LZO_ARCH_MIPS) +# define LZO_OPT_AVOID_UINT_INDEX 1 +#elif (LZO_ARCH_POWERPC) +# define LZO_OPT_PREFER_PREINC 1 +# define LZO_OPT_PREFER_PREDEC 1 +# if defined(LZO_ABI_BIG_ENDIAN) +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +# endif +#elif (LZO_ARCH_S390) +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +# if (LZO_SIZEOF_SIZE_T == 8) +# define LZO_OPT_UNALIGNED64 1 +# endif +#elif (LZO_ARCH_SH) +# define LZO_OPT_PREFER_POSTINC 1 +# define LZO_OPT_PREFER_PREDEC 1 +#endif +#if !defined(LZO_CFG_NO_INLINE_ASM) +#if defined(LZO_CC_LLVM) +# define LZO_CFG_NO_INLINE_ASM 1 +#endif +#endif +#if !defined(LZO_CFG_NO_UNALIGNED) +#if defined(LZO_ABI_NEUTRAL_ENDIAN) || defined(LZO_ARCH_GENERIC) +# define LZO_CFG_NO_UNALIGNED 1 +#endif +#endif +#if defined(LZO_CFG_NO_UNALIGNED) +# undef LZO_OPT_UNALIGNED16 +# undef LZO_OPT_UNALIGNED32 +# undef LZO_OPT_UNALIGNED64 +#endif +#if defined(LZO_CFG_NO_INLINE_ASM) +#elif (LZO_ARCH_I386 && (LZO_OS_DOS32 || LZO_OS_WIN32) && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) +# define LZO_ASM_SYNTAX_MSC 1 +#elif (LZO_OS_WIN64 && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) +#elif (LZO_ARCH_I386 && (LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) +# define LZO_ASM_SYNTAX_GNUC 1 +#elif (LZO_ARCH_AMD64 && (LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) +# define LZO_ASM_SYNTAX_GNUC 1 +#endif +#if (LZO_ASM_SYNTAX_GNUC) +#if (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul)) +# define __LZO_ASM_CLOBBER "ax" +#elif (LZO_CC_INTELC) +# define __LZO_ASM_CLOBBER "memory" +#else +# define __LZO_ASM_CLOBBER "cc", "memory" +#endif +#endif +#if defined(__LZO_INFOSTR_MM) +#elif (LZO_MM_FLAT) && (defined(__LZO_INFOSTR_PM) || defined(LZO_INFO_ABI_PM)) +# define __LZO_INFOSTR_MM "" +#elif defined(LZO_INFO_MM) +# define __LZO_INFOSTR_MM "." LZO_INFO_MM +#else +# define __LZO_INFOSTR_MM "" +#endif +#if defined(__LZO_INFOSTR_PM) +#elif defined(LZO_INFO_ABI_PM) +# define __LZO_INFOSTR_PM "." LZO_INFO_ABI_PM +#else +# define __LZO_INFOSTR_PM "" +#endif +#if defined(__LZO_INFOSTR_ENDIAN) +#elif defined(LZO_INFO_ABI_ENDIAN) +# define __LZO_INFOSTR_ENDIAN "." LZO_INFO_ABI_ENDIAN +#else +# define __LZO_INFOSTR_ENDIAN "" +#endif +#if defined(__LZO_INFOSTR_OSNAME) +#elif defined(LZO_INFO_OS_CONSOLE) +# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_CONSOLE +#elif defined(LZO_INFO_OS_POSIX) +# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_POSIX +#else +# define __LZO_INFOSTR_OSNAME LZO_INFO_OS +#endif +#if defined(__LZO_INFOSTR_LIBC) +#elif defined(LZO_INFO_LIBC) +# define __LZO_INFOSTR_LIBC "." LZO_INFO_LIBC +#else +# define __LZO_INFOSTR_LIBC "" +#endif +#if defined(__LZO_INFOSTR_CCVER) +#elif defined(LZO_INFO_CCVER) +# define __LZO_INFOSTR_CCVER " " LZO_INFO_CCVER +#else +# define __LZO_INFOSTR_CCVER "" +#endif +#define LZO_INFO_STRING \ + LZO_INFO_ARCH __LZO_INFOSTR_MM __LZO_INFOSTR_PM __LZO_INFOSTR_ENDIAN \ + " " __LZO_INFOSTR_OSNAME __LZO_INFOSTR_LIBC " " LZO_INFO_CC __LZO_INFOSTR_CCVER + +#endif /* already included */ + +/* vim:set ts=4 et: */ diff --git a/extern/lzo/minilzo/minilzo.c b/extern/lzo/minilzo/minilzo.c new file mode 100644 index 00000000000..6a62b31b94a --- /dev/null +++ b/extern/lzo/minilzo/minilzo.c @@ -0,0 +1,4112 @@ +/* minilzo.c -- mini subset of the LZO real-time data compression library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library 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. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + +/* + * NOTE: + * the full LZO package can be found at + * http://www.oberhumer.com/opensource/lzo/ + */ + +#define __LZO_IN_MINILZO +#define LZO_BUILD + +#if defined(LZO_CFG_FREESTANDING) +# undef MINILZO_HAVE_CONFIG_H +# define LZO_LIBC_FREESTANDING 1 +# define LZO_OS_FREESTANDING 1 +#endif + +#ifdef MINILZO_HAVE_CONFIG_H +# include +#endif +#include +#include +#if defined(MINILZO_CFG_USE_INTERNAL_LZODEFS) + +#ifndef __LZODEFS_H_INCLUDED +#define __LZODEFS_H_INCLUDED 1 + +#if defined(__CYGWIN32__) && !defined(__CYGWIN__) +# define __CYGWIN__ __CYGWIN32__ +#endif +#if defined(__IBMCPP__) && !defined(__IBMC__) +# define __IBMC__ __IBMCPP__ +#endif +#if defined(__ICL) && defined(_WIN32) && !defined(__INTEL_COMPILER) +# define __INTEL_COMPILER __ICL +#endif +#if 1 && defined(__INTERIX) && defined(__GNUC__) && !defined(_ALL_SOURCE) +# define _ALL_SOURCE 1 +#endif +#if defined(__mips__) && defined(__R5900__) +# if !defined(__LONG_MAX__) +# define __LONG_MAX__ 9223372036854775807L +# endif +#endif +#if defined(__INTEL_COMPILER) && defined(__linux__) +# pragma warning(disable: 193) +#endif +#if defined(__KEIL__) && defined(__C166__) +# pragma warning disable = 322 +#elif 0 && defined(__C251__) +# pragma warning disable = 322 +#endif +#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__) +# if (_MSC_VER >= 1300) +# pragma warning(disable: 4668) +# endif +#endif +#if 0 && defined(__WATCOMC__) +# if (__WATCOMC__ >= 1050) && (__WATCOMC__ < 1060) +# pragma warning 203 9 +# endif +#endif +#if defined(__BORLANDC__) && defined(__MSDOS__) && !defined(__FLAT__) +# pragma option -h +#endif +#if 0 +#define LZO_0xffffL 0xfffful +#define LZO_0xffffffffL 0xfffffffful +#else +#define LZO_0xffffL 65535ul +#define LZO_0xffffffffL 4294967295ul +#endif +#if (LZO_0xffffL == LZO_0xffffffffL) +# error "your preprocessor is broken 1" +#endif +#if (16ul * 16384ul != 262144ul) +# error "your preprocessor is broken 2" +#endif +#if 0 +#if (32767 >= 4294967295ul) +# error "your preprocessor is broken 3" +#endif +#if (65535u >= 4294967295ul) +# error "your preprocessor is broken 4" +#endif +#endif +#if (UINT_MAX == LZO_0xffffL) +#if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__) +# if !defined(MSDOS) +# define MSDOS 1 +# endif +# if !defined(_MSDOS) +# define _MSDOS 1 +# endif +#elif 0 && defined(__VERSION) && defined(MB_LEN_MAX) +# if (__VERSION == 520) && (MB_LEN_MAX == 1) +# if !defined(__AZTEC_C__) +# define __AZTEC_C__ __VERSION +# endif +# if !defined(__DOS__) +# define __DOS__ 1 +# endif +# endif +#endif +#endif +#if defined(_MSC_VER) && defined(M_I86HM) && (UINT_MAX == LZO_0xffffL) +# define ptrdiff_t long +# define _PTRDIFF_T_DEFINED +#endif +#if (UINT_MAX == LZO_0xffffL) +# undef __LZO_RENAME_A +# undef __LZO_RENAME_B +# if defined(__AZTEC_C__) && defined(__DOS__) +# define __LZO_RENAME_A 1 +# elif defined(_MSC_VER) && defined(MSDOS) +# if (_MSC_VER < 600) +# define __LZO_RENAME_A 1 +# elif (_MSC_VER < 700) +# define __LZO_RENAME_B 1 +# endif +# elif defined(__TSC__) && defined(__OS2__) +# define __LZO_RENAME_A 1 +# elif defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0410) +# define __LZO_RENAME_A 1 +# elif defined(__PACIFIC__) && defined(DOS) +# if !defined(__far) +# define __far far +# endif +# if !defined(__near) +# define __near near +# endif +# endif +# if defined(__LZO_RENAME_A) +# if !defined(__cdecl) +# define __cdecl cdecl +# endif +# if !defined(__far) +# define __far far +# endif +# if !defined(__huge) +# define __huge huge +# endif +# if !defined(__near) +# define __near near +# endif +# if !defined(__pascal) +# define __pascal pascal +# endif +# if !defined(__huge) +# define __huge huge +# endif +# elif defined(__LZO_RENAME_B) +# if !defined(__cdecl) +# define __cdecl _cdecl +# endif +# if !defined(__far) +# define __far _far +# endif +# if !defined(__huge) +# define __huge _huge +# endif +# if !defined(__near) +# define __near _near +# endif +# if !defined(__pascal) +# define __pascal _pascal +# endif +# elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__) +# if !defined(__cdecl) +# define __cdecl cdecl +# endif +# if !defined(__pascal) +# define __pascal pascal +# endif +# endif +# undef __LZO_RENAME_A +# undef __LZO_RENAME_B +#endif +#if (UINT_MAX == LZO_0xffffL) +#if defined(__AZTEC_C__) && defined(__DOS__) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +#elif defined(_MSC_VER) && defined(MSDOS) +# if (_MSC_VER < 600) +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +# endif +# if (_MSC_VER < 700) +# define LZO_BROKEN_INTEGRAL_PROMOTION 1 +# define LZO_BROKEN_SIZEOF 1 +# endif +#elif defined(__PACIFIC__) && defined(DOS) +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +#elif defined(__TURBOC__) && defined(__MSDOS__) +# if (__TURBOC__ < 0x0150) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +# define LZO_BROKEN_INTEGRAL_PROMOTION 1 +# endif +# if (__TURBOC__ < 0x0200) +# define LZO_BROKEN_SIZEOF 1 +# endif +# if (__TURBOC__ < 0x0400) && defined(__cplusplus) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +# endif +#elif (defined(__PUREC__) || defined(__TURBOC__)) && defined(__TOS__) +# define LZO_BROKEN_CDECL_ALT_SYNTAX 1 +# define LZO_BROKEN_SIZEOF 1 +#endif +#endif +#if defined(__WATCOMC__) && (__WATCOMC__ < 900) +# define LZO_BROKEN_INTEGRAL_CONSTANTS 1 +#endif +#if defined(_CRAY) && defined(_CRAY1) +# define LZO_BROKEN_SIGNED_RIGHT_SHIFT 1 +#endif +#define LZO_PP_STRINGIZE(x) #x +#define LZO_PP_MACRO_EXPAND(x) LZO_PP_STRINGIZE(x) +#define LZO_PP_CONCAT2(a,b) a ## b +#define LZO_PP_CONCAT3(a,b,c) a ## b ## c +#define LZO_PP_CONCAT4(a,b,c,d) a ## b ## c ## d +#define LZO_PP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e +#define LZO_PP_ECONCAT2(a,b) LZO_PP_CONCAT2(a,b) +#define LZO_PP_ECONCAT3(a,b,c) LZO_PP_CONCAT3(a,b,c) +#define LZO_PP_ECONCAT4(a,b,c,d) LZO_PP_CONCAT4(a,b,c,d) +#define LZO_PP_ECONCAT5(a,b,c,d,e) LZO_PP_CONCAT5(a,b,c,d,e) +#if 1 +#define LZO_CPP_STRINGIZE(x) #x +#define LZO_CPP_MACRO_EXPAND(x) LZO_CPP_STRINGIZE(x) +#define LZO_CPP_CONCAT2(a,b) a ## b +#define LZO_CPP_CONCAT3(a,b,c) a ## b ## c +#define LZO_CPP_CONCAT4(a,b,c,d) a ## b ## c ## d +#define LZO_CPP_CONCAT5(a,b,c,d,e) a ## b ## c ## d ## e +#define LZO_CPP_ECONCAT2(a,b) LZO_CPP_CONCAT2(a,b) +#define LZO_CPP_ECONCAT3(a,b,c) LZO_CPP_CONCAT3(a,b,c) +#define LZO_CPP_ECONCAT4(a,b,c,d) LZO_CPP_CONCAT4(a,b,c,d) +#define LZO_CPP_ECONCAT5(a,b,c,d,e) LZO_CPP_CONCAT5(a,b,c,d,e) +#endif +#define __LZO_MASK_GEN(o,b) (((((o) << ((b)-1)) - (o)) << 1) + (o)) +#if 1 && defined(__cplusplus) +# if !defined(__STDC_CONSTANT_MACROS) +# define __STDC_CONSTANT_MACROS 1 +# endif +# if !defined(__STDC_LIMIT_MACROS) +# define __STDC_LIMIT_MACROS 1 +# endif +#endif +#if defined(__cplusplus) +# define LZO_EXTERN_C extern "C" +#else +# define LZO_EXTERN_C extern +#endif +#if !defined(__LZO_OS_OVERRIDE) +#if defined(LZO_OS_FREESTANDING) +# define LZO_INFO_OS "freestanding" +#elif defined(LZO_OS_EMBEDDED) +# define LZO_INFO_OS "embedded" +#elif 1 && defined(__IAR_SYSTEMS_ICC__) +# define LZO_OS_EMBEDDED 1 +# define LZO_INFO_OS "embedded" +#elif defined(__CYGWIN__) && defined(__GNUC__) +# define LZO_OS_CYGWIN 1 +# define LZO_INFO_OS "cygwin" +#elif defined(__EMX__) && defined(__GNUC__) +# define LZO_OS_EMX 1 +# define LZO_INFO_OS "emx" +#elif defined(__BEOS__) +# define LZO_OS_BEOS 1 +# define LZO_INFO_OS "beos" +#elif defined(__Lynx__) +# define LZO_OS_LYNXOS 1 +# define LZO_INFO_OS "lynxos" +#elif defined(__OS400__) +# define LZO_OS_OS400 1 +# define LZO_INFO_OS "os400" +#elif defined(__QNX__) +# define LZO_OS_QNX 1 +# define LZO_INFO_OS "qnx" +#elif defined(__BORLANDC__) && defined(__DPMI32__) && (__BORLANDC__ >= 0x0460) +# define LZO_OS_DOS32 1 +# define LZO_INFO_OS "dos32" +#elif defined(__BORLANDC__) && defined(__DPMI16__) +# define LZO_OS_DOS16 1 +# define LZO_INFO_OS "dos16" +#elif defined(__ZTC__) && defined(DOS386) +# define LZO_OS_DOS32 1 +# define LZO_INFO_OS "dos32" +#elif defined(__OS2__) || defined(__OS2V2__) +# if (UINT_MAX == LZO_0xffffL) +# define LZO_OS_OS216 1 +# define LZO_INFO_OS "os216" +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_OS_OS2 1 +# define LZO_INFO_OS "os2" +# else +# error "check your limits.h header" +# endif +#elif defined(__WIN64__) || defined(_WIN64) || defined(WIN64) +# define LZO_OS_WIN64 1 +# define LZO_INFO_OS "win64" +#elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32) || defined(__WINDOWS_386__) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +#elif defined(__MWERKS__) && defined(__INTEL__) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +#elif defined(__WINDOWS__) || defined(_WINDOWS) || defined(_Windows) +# if (UINT_MAX == LZO_0xffffL) +# define LZO_OS_WIN16 1 +# define LZO_INFO_OS "win16" +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +# else +# error "check your limits.h header" +# endif +#elif defined(__DOS__) || defined(__MSDOS__) || defined(_MSDOS) || defined(MSDOS) || (defined(__PACIFIC__) && defined(DOS)) +# if (UINT_MAX == LZO_0xffffL) +# define LZO_OS_DOS16 1 +# define LZO_INFO_OS "dos16" +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_OS_DOS32 1 +# define LZO_INFO_OS "dos32" +# else +# error "check your limits.h header" +# endif +#elif defined(__WATCOMC__) +# if defined(__NT__) && (UINT_MAX == LZO_0xffffL) +# define LZO_OS_DOS16 1 +# define LZO_INFO_OS "dos16" +# elif defined(__NT__) && (__WATCOMC__ < 1100) +# define LZO_OS_WIN32 1 +# define LZO_INFO_OS "win32" +# elif defined(__linux__) || defined(__LINUX__) +# define LZO_OS_POSIX 1 +# define LZO_INFO_OS "posix" +# else +# error "please specify a target using the -bt compiler option" +# endif +#elif defined(__palmos__) +# define LZO_OS_PALMOS 1 +# define LZO_INFO_OS "palmos" +#elif defined(__TOS__) || defined(__atarist__) +# define LZO_OS_TOS 1 +# define LZO_INFO_OS "tos" +#elif defined(macintosh) && !defined(__ppc__) +# define LZO_OS_MACCLASSIC 1 +# define LZO_INFO_OS "macclassic" +#elif defined(__VMS) +# define LZO_OS_VMS 1 +# define LZO_INFO_OS "vms" +#elif ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) +# define LZO_OS_CONSOLE 1 +# define LZO_OS_CONSOLE_PS2 1 +# define LZO_INFO_OS "console" +# define LZO_INFO_OS_CONSOLE "ps2" +#elif (defined(__mips__) && defined(__psp__)) +# define LZO_OS_CONSOLE 1 +# define LZO_OS_CONSOLE_PSP 1 +# define LZO_INFO_OS "console" +# define LZO_INFO_OS_CONSOLE "psp" +#else +# define LZO_OS_POSIX 1 +# define LZO_INFO_OS "posix" +#endif +#if (LZO_OS_POSIX) +# if defined(_AIX) || defined(__AIX__) || defined(__aix__) +# define LZO_OS_POSIX_AIX 1 +# define LZO_INFO_OS_POSIX "aix" +# elif defined(__FreeBSD__) +# define LZO_OS_POSIX_FREEBSD 1 +# define LZO_INFO_OS_POSIX "freebsd" +# elif defined(__hpux__) || defined(__hpux) +# define LZO_OS_POSIX_HPUX 1 +# define LZO_INFO_OS_POSIX "hpux" +# elif defined(__INTERIX) +# define LZO_OS_POSIX_INTERIX 1 +# define LZO_INFO_OS_POSIX "interix" +# elif defined(__IRIX__) || defined(__irix__) +# define LZO_OS_POSIX_IRIX 1 +# define LZO_INFO_OS_POSIX "irix" +# elif defined(__linux__) || defined(__linux) || defined(__LINUX__) +# define LZO_OS_POSIX_LINUX 1 +# define LZO_INFO_OS_POSIX "linux" +# elif defined(__APPLE__) || defined(__MACOS__) +# define LZO_OS_POSIX_MACOSX 1 +# define LZO_INFO_OS_POSIX "macosx" +# elif defined(__minix__) || defined(__minix) +# define LZO_OS_POSIX_MINIX 1 +# define LZO_INFO_OS_POSIX "minix" +# elif defined(__NetBSD__) +# define LZO_OS_POSIX_NETBSD 1 +# define LZO_INFO_OS_POSIX "netbsd" +# elif defined(__OpenBSD__) +# define LZO_OS_POSIX_OPENBSD 1 +# define LZO_INFO_OS_POSIX "openbsd" +# elif defined(__osf__) +# define LZO_OS_POSIX_OSF 1 +# define LZO_INFO_OS_POSIX "osf" +# elif defined(__solaris__) || defined(__sun) +# if defined(__SVR4) || defined(__svr4__) +# define LZO_OS_POSIX_SOLARIS 1 +# define LZO_INFO_OS_POSIX "solaris" +# else +# define LZO_OS_POSIX_SUNOS 1 +# define LZO_INFO_OS_POSIX "sunos" +# endif +# elif defined(__ultrix__) || defined(__ultrix) +# define LZO_OS_POSIX_ULTRIX 1 +# define LZO_INFO_OS_POSIX "ultrix" +# elif defined(_UNICOS) +# define LZO_OS_POSIX_UNICOS 1 +# define LZO_INFO_OS_POSIX "unicos" +# else +# define LZO_OS_POSIX_UNKNOWN 1 +# define LZO_INFO_OS_POSIX "unknown" +# endif +#endif +#endif +#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +# if (UINT_MAX != LZO_0xffffL) +# error "this should not happen" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "this should not happen" +# endif +#endif +#if (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_WIN32 || LZO_OS_WIN64) +# if (UINT_MAX != LZO_0xffffffffL) +# error "this should not happen" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "this should not happen" +# endif +#endif +#if defined(CIL) && defined(_GNUCC) && defined(__GNUC__) +# define LZO_CC_CILLY 1 +# define LZO_INFO_CC "Cilly" +# if defined(__CILLY__) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__CILLY__) +# else +# define LZO_INFO_CCVER "unknown" +# endif +#elif 0 && defined(SDCC) && defined(__VERSION__) && !defined(__GNUC__) +# define LZO_CC_SDCC 1 +# define LZO_INFO_CC "sdcc" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(SDCC) +#elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__) +# define LZO_CC_PATHSCALE (__PATHCC__ * 0x10000L + __PATHCC_MINOR__ * 0x100 + __PATHCC_PATCHLEVEL__) +# define LZO_INFO_CC "Pathscale C" +# define LZO_INFO_CCVER __PATHSCALE__ +#elif defined(__INTEL_COMPILER) +# define LZO_CC_INTELC 1 +# define LZO_INFO_CC "Intel C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__INTEL_COMPILER) +# if defined(_WIN32) || defined(_WIN64) +# define LZO_CC_SYNTAX_MSC 1 +# else +# define LZO_CC_SYNTAX_GNUC 1 +# endif +#elif defined(__POCC__) && defined(_WIN32) +# define LZO_CC_PELLESC 1 +# define LZO_INFO_CC "Pelles C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__POCC__) +#elif defined(__llvm__) && defined(__GNUC__) && defined(__VERSION__) +# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) +# define LZO_CC_LLVM (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__) +# else +# define LZO_CC_LLVM (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100) +# endif +# define LZO_INFO_CC "llvm-gcc" +# define LZO_INFO_CCVER __VERSION__ +#elif defined(__GNUC__) && defined(__VERSION__) +# if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) +# define LZO_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__) +# elif defined(__GNUC_MINOR__) +# define LZO_CC_GNUC (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100) +# else +# define LZO_CC_GNUC (__GNUC__ * 0x10000L) +# endif +# define LZO_INFO_CC "gcc" +# define LZO_INFO_CCVER __VERSION__ +#elif defined(__ACK__) && defined(_ACK) +# define LZO_CC_ACK 1 +# define LZO_INFO_CC "Amsterdam Compiler Kit C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__AZTEC_C__) +# define LZO_CC_AZTECC 1 +# define LZO_INFO_CC "Aztec C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__AZTEC_C__) +#elif defined(__BORLANDC__) +# define LZO_CC_BORLANDC 1 +# define LZO_INFO_CC "Borland C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__BORLANDC__) +#elif defined(_CRAYC) && defined(_RELEASE) +# define LZO_CC_CRAYC 1 +# define LZO_INFO_CC "Cray C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_RELEASE) +#elif defined(__DMC__) && defined(__SC__) +# define LZO_CC_DMC 1 +# define LZO_INFO_CC "Digital Mars C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DMC__) +#elif defined(__DECC) +# define LZO_CC_DECC 1 +# define LZO_INFO_CC "DEC C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__DECC) +#elif defined(__HIGHC__) +# define LZO_CC_HIGHC 1 +# define LZO_INFO_CC "MetaWare High C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__IAR_SYSTEMS_ICC__) +# define LZO_CC_IARC 1 +# define LZO_INFO_CC "IAR C" +# if defined(__VER__) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__VER__) +# else +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__IBMC__) +# define LZO_CC_IBMC 1 +# define LZO_INFO_CC "IBM C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__IBMC__) +#elif defined(__KEIL__) && defined(__C166__) +# define LZO_CC_KEILC 1 +# define LZO_INFO_CC "Keil C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__C166__) +#elif defined(__LCC__) && defined(_WIN32) && defined(__LCCOPTIMLEVEL) +# define LZO_CC_LCCWIN32 1 +# define LZO_INFO_CC "lcc-win32" +# define LZO_INFO_CCVER "unknown" +#elif defined(__LCC__) +# define LZO_CC_LCC 1 +# define LZO_INFO_CC "lcc" +# if defined(__LCC_VERSION__) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__LCC_VERSION__) +# else +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(_MSC_VER) +# define LZO_CC_MSC 1 +# define LZO_INFO_CC "Microsoft C" +# if defined(_MSC_FULL_VER) +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER) +# else +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(_MSC_VER) +# endif +#elif defined(__MWERKS__) +# define LZO_CC_MWERKS 1 +# define LZO_INFO_CC "Metrowerks C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__MWERKS__) +#elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386) +# define LZO_CC_NDPC 1 +# define LZO_INFO_CC "Microway NDP C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__PACIFIC__) +# define LZO_CC_PACIFICC 1 +# define LZO_INFO_CC "Pacific C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PACIFIC__) +#elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__)) +# define LZO_CC_PGI 1 +# define LZO_INFO_CC "Portland Group PGI C" +# define LZO_INFO_CCVER "unknown" +#elif defined(__PUREC__) && defined(__TOS__) +# define LZO_CC_PUREC 1 +# define LZO_INFO_CC "Pure C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__PUREC__) +#elif defined(__SC__) && defined(__ZTC__) +# define LZO_CC_SYMANTECC 1 +# define LZO_INFO_CC "Symantec C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SC__) +#elif defined(__SUNPRO_C) +# define LZO_INFO_CC "SunPro C" +# if ((__SUNPRO_C)+0 > 0) +# define LZO_CC_SUNPROC __SUNPRO_C +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_C) +# else +# define LZO_CC_SUNPROC 1 +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__SUNPRO_CC) +# define LZO_INFO_CC "SunPro C" +# if ((__SUNPRO_CC)+0 > 0) +# define LZO_CC_SUNPROC __SUNPRO_CC +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__SUNPRO_CC) +# else +# define LZO_CC_SUNPROC 1 +# define LZO_INFO_CCVER "unknown" +# endif +#elif defined(__TINYC__) +# define LZO_CC_TINYC 1 +# define LZO_INFO_CC "Tiny C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TINYC__) +#elif defined(__TSC__) +# define LZO_CC_TOPSPEEDC 1 +# define LZO_INFO_CC "TopSpeed C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TSC__) +#elif defined(__WATCOMC__) +# define LZO_CC_WATCOMC 1 +# define LZO_INFO_CC "Watcom C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__WATCOMC__) +#elif defined(__TURBOC__) +# define LZO_CC_TURBOC 1 +# define LZO_INFO_CC "Turbo C" +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__TURBOC__) +#elif defined(__ZTC__) +# define LZO_CC_ZORTECHC 1 +# define LZO_INFO_CC "Zortech C" +# if (__ZTC__ == 0x310) +# define LZO_INFO_CCVER "0x310" +# else +# define LZO_INFO_CCVER LZO_PP_MACRO_EXPAND(__ZTC__) +# endif +#else +# define LZO_CC_UNKNOWN 1 +# define LZO_INFO_CC "unknown" +# define LZO_INFO_CCVER "unknown" +#endif +#if 0 && (LZO_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER) +# error "LZO_CC_MSC: _MSC_FULL_VER is not defined" +#endif +#if !defined(__LZO_ARCH_OVERRIDE) && !defined(LZO_ARCH_GENERIC) && defined(_CRAY) +# if (UINT_MAX > LZO_0xffffffffL) && defined(_CRAY) +# if defined(_CRAYMPP) || defined(_CRAYT3D) || defined(_CRAYT3E) +# define LZO_ARCH_CRAY_MPP 1 +# elif defined(_CRAY1) +# define LZO_ARCH_CRAY_PVP 1 +# endif +# endif +#endif +#if !defined(__LZO_ARCH_OVERRIDE) +#if defined(LZO_ARCH_GENERIC) +# define LZO_INFO_ARCH "generic" +#elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +# define LZO_ARCH_I086 1 +# define LZO_ARCH_IA16 1 +# define LZO_INFO_ARCH "i086" +#elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA) +# define LZO_ARCH_ALPHA 1 +# define LZO_INFO_ARCH "alpha" +#elif (LZO_ARCH_CRAY_MPP) && (defined(_CRAYT3D) || defined(_CRAYT3E)) +# define LZO_ARCH_ALPHA 1 +# define LZO_INFO_ARCH "alpha" +#elif defined(__amd64__) || defined(__x86_64__) || defined(_M_AMD64) +# define LZO_ARCH_AMD64 1 +# define LZO_INFO_ARCH "amd64" +#elif defined(__thumb__) || (defined(_M_ARM) && defined(_M_THUMB)) +# define LZO_ARCH_ARM 1 +# define LZO_ARCH_ARM_THUMB 1 +# define LZO_INFO_ARCH "arm_thumb" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__) +# define LZO_ARCH_ARM 1 +# if defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 1) +# define LZO_ARCH_ARM_THUMB 1 +# define LZO_INFO_ARCH "arm_thumb" +# elif defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 2) +# define LZO_INFO_ARCH "arm" +# else +# define LZO_INFO_ARCH "arm" +# endif +#elif defined(__arm__) || defined(_M_ARM) +# define LZO_ARCH_ARM 1 +# define LZO_INFO_ARCH "arm" +#elif (UINT_MAX <= LZO_0xffffL) && defined(__AVR__) +# define LZO_ARCH_AVR 1 +# define LZO_INFO_ARCH "avr" +#elif defined(__bfin__) +# define LZO_ARCH_BLACKFIN 1 +# define LZO_INFO_ARCH "blackfin" +#elif (UINT_MAX == LZO_0xffffL) && defined(__C166__) +# define LZO_ARCH_C166 1 +# define LZO_INFO_ARCH "c166" +#elif defined(__cris__) +# define LZO_ARCH_CRIS 1 +# define LZO_INFO_ARCH "cris" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCEZ80__) +# define LZO_ARCH_EZ80 1 +# define LZO_INFO_ARCH "ez80" +#elif defined(__H8300__) || defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) +# define LZO_ARCH_H8300 1 +# define LZO_INFO_ARCH "h8300" +#elif defined(__hppa__) || defined(__hppa) +# define LZO_ARCH_HPPA 1 +# define LZO_INFO_ARCH "hppa" +#elif defined(__386__) || defined(__i386__) || defined(__i386) || defined(_M_IX86) || defined(_M_I386) +# define LZO_ARCH_I386 1 +# define LZO_ARCH_IA32 1 +# define LZO_INFO_ARCH "i386" +#elif (LZO_CC_ZORTECHC && defined(__I86__)) +# define LZO_ARCH_I386 1 +# define LZO_ARCH_IA32 1 +# define LZO_INFO_ARCH "i386" +#elif (LZO_OS_DOS32 && LZO_CC_HIGHC) && defined(_I386) +# define LZO_ARCH_I386 1 +# define LZO_ARCH_IA32 1 +# define LZO_INFO_ARCH "i386" +#elif defined(__ia64__) || defined(__ia64) || defined(_M_IA64) +# define LZO_ARCH_IA64 1 +# define LZO_INFO_ARCH "ia64" +#elif (UINT_MAX == LZO_0xffffL) && defined(__m32c__) +# define LZO_ARCH_M16C 1 +# define LZO_INFO_ARCH "m16c" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCM16C__) +# define LZO_ARCH_M16C 1 +# define LZO_INFO_ARCH "m16c" +#elif defined(__m32r__) +# define LZO_ARCH_M32R 1 +# define LZO_INFO_ARCH "m32r" +#elif (LZO_OS_TOS) || defined(__m68k__) || defined(__m68000__) || defined(__mc68000__) || defined(__mc68020__) || defined(_M_M68K) +# define LZO_ARCH_M68K 1 +# define LZO_INFO_ARCH "m68k" +#elif (UINT_MAX == LZO_0xffffL) && defined(__C251__) +# define LZO_ARCH_MCS251 1 +# define LZO_INFO_ARCH "mcs251" +#elif (UINT_MAX == LZO_0xffffL) && defined(__C51__) +# define LZO_ARCH_MCS51 1 +# define LZO_INFO_ARCH "mcs51" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC8051__) +# define LZO_ARCH_MCS51 1 +# define LZO_INFO_ARCH "mcs51" +#elif defined(__mips__) || defined(__mips) || defined(_MIPS_ARCH) || defined(_M_MRX000) +# define LZO_ARCH_MIPS 1 +# define LZO_INFO_ARCH "mips" +#elif (UINT_MAX == LZO_0xffffL) && defined(__MSP430__) +# define LZO_ARCH_MSP430 1 +# define LZO_INFO_ARCH "msp430" +#elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICC430__) +# define LZO_ARCH_MSP430 1 +# define LZO_INFO_ARCH "msp430" +#elif defined(__powerpc__) || defined(__powerpc) || defined(__ppc__) || defined(__PPC__) || defined(_M_PPC) || defined(_ARCH_PPC) || defined(_ARCH_PWR) +# define LZO_ARCH_POWERPC 1 +# define LZO_INFO_ARCH "powerpc" +#elif defined(__s390__) || defined(__s390) || defined(__s390x__) || defined(__s390x) +# define LZO_ARCH_S390 1 +# define LZO_INFO_ARCH "s390" +#elif defined(__sh__) || defined(_M_SH) +# define LZO_ARCH_SH 1 +# define LZO_INFO_ARCH "sh" +#elif defined(__sparc__) || defined(__sparc) || defined(__sparcv8) +# define LZO_ARCH_SPARC 1 +# define LZO_INFO_ARCH "sparc" +#elif defined(__SPU__) +# define LZO_ARCH_SPU 1 +# define LZO_INFO_ARCH "spu" +#elif (UINT_MAX == LZO_0xffffL) && defined(__z80) +# define LZO_ARCH_Z80 1 +# define LZO_INFO_ARCH "z80" +#elif (LZO_ARCH_CRAY_PVP) +# if defined(_CRAYSV1) +# define LZO_ARCH_CRAY_SV1 1 +# define LZO_INFO_ARCH "cray_sv1" +# elif (_ADDR64) +# define LZO_ARCH_CRAY_T90 1 +# define LZO_INFO_ARCH "cray_t90" +# elif (_ADDR32) +# define LZO_ARCH_CRAY_YMP 1 +# define LZO_INFO_ARCH "cray_ymp" +# else +# define LZO_ARCH_CRAY_XMP 1 +# define LZO_INFO_ARCH "cray_xmp" +# endif +#else +# define LZO_ARCH_UNKNOWN 1 +# define LZO_INFO_ARCH "unknown" +#endif +#endif +#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_DOS32 || LZO_OS_OS2) +# error "FIXME - missing define for CPU architecture" +#endif +#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN32) +# error "FIXME - missing WIN32 define for CPU architecture" +#endif +#if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN64) +# error "FIXME - missing WIN64 define for CPU architecture" +#endif +#if (LZO_OS_OS216 || LZO_OS_WIN16) +# define LZO_ARCH_I086PM 1 +# define LZO_ARCH_IA16PM 1 +#elif 1 && (LZO_OS_DOS16 && defined(BLX286)) +# define LZO_ARCH_I086PM 1 +# define LZO_ARCH_IA16PM 1 +#elif 1 && (LZO_OS_DOS16 && defined(DOSX286)) +# define LZO_ARCH_I086PM 1 +# define LZO_ARCH_IA16PM 1 +#elif 1 && (LZO_OS_DOS16 && LZO_CC_BORLANDC && defined(__DPMI16__)) +# define LZO_ARCH_I086PM 1 +# define LZO_ARCH_IA16PM 1 +#endif +#if defined(LZO_ARCH_ARM_THUMB) && !defined(LZO_ARCH_ARM) +# error "this should not happen" +#endif +#if defined(LZO_ARCH_I086PM) && !defined(LZO_ARCH_I086) +# error "this should not happen" +#endif +#if (LZO_ARCH_I086) +# if (UINT_MAX != LZO_0xffffL) +# error "this should not happen" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "this should not happen" +# endif +#endif +#if (LZO_ARCH_I386) +# if (UINT_MAX != LZO_0xffffL) && defined(__i386_int16__) +# error "this should not happen" +# endif +# if (UINT_MAX != LZO_0xffffffffL) && !defined(__i386_int16__) +# error "this should not happen" +# endif +# if (ULONG_MAX != LZO_0xffffffffL) +# error "this should not happen" +# endif +#endif +#if !defined(__LZO_MM_OVERRIDE) +#if (LZO_ARCH_I086) +#if (UINT_MAX != LZO_0xffffL) +# error "this should not happen" +#endif +#if defined(__TINY__) || defined(M_I86TM) || defined(_M_I86TM) +# define LZO_MM_TINY 1 +#elif defined(__HUGE__) || defined(_HUGE_) || defined(M_I86HM) || defined(_M_I86HM) +# define LZO_MM_HUGE 1 +#elif defined(__SMALL__) || defined(M_I86SM) || defined(_M_I86SM) || defined(SMALL_MODEL) +# define LZO_MM_SMALL 1 +#elif defined(__MEDIUM__) || defined(M_I86MM) || defined(_M_I86MM) +# define LZO_MM_MEDIUM 1 +#elif defined(__COMPACT__) || defined(M_I86CM) || defined(_M_I86CM) +# define LZO_MM_COMPACT 1 +#elif defined(__LARGE__) || defined(M_I86LM) || defined(_M_I86LM) || defined(LARGE_MODEL) +# define LZO_MM_LARGE 1 +#elif (LZO_CC_AZTECC) +# if defined(_LARGE_CODE) && defined(_LARGE_DATA) +# define LZO_MM_LARGE 1 +# elif defined(_LARGE_CODE) +# define LZO_MM_MEDIUM 1 +# elif defined(_LARGE_DATA) +# define LZO_MM_COMPACT 1 +# else +# define LZO_MM_SMALL 1 +# endif +#elif (LZO_CC_ZORTECHC && defined(__VCM__)) +# define LZO_MM_LARGE 1 +#else +# error "unknown memory model" +#endif +#if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +#define LZO_HAVE_MM_HUGE_PTR 1 +#define LZO_HAVE_MM_HUGE_ARRAY 1 +#if (LZO_MM_TINY) +# undef LZO_HAVE_MM_HUGE_ARRAY +#endif +#if (LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_ZORTECHC) +# undef LZO_HAVE_MM_HUGE_PTR +# undef LZO_HAVE_MM_HUGE_ARRAY +#elif (LZO_CC_DMC || LZO_CC_SYMANTECC) +# undef LZO_HAVE_MM_HUGE_ARRAY +#elif (LZO_CC_MSC && defined(_QC)) +# undef LZO_HAVE_MM_HUGE_ARRAY +# if (_MSC_VER < 600) +# undef LZO_HAVE_MM_HUGE_PTR +# endif +#elif (LZO_CC_TURBOC && (__TURBOC__ < 0x0295)) +# undef LZO_HAVE_MM_HUGE_ARRAY +#endif +#if (LZO_ARCH_I086PM) && !defined(LZO_HAVE_MM_HUGE_PTR) +# if (LZO_OS_DOS16) +# error "this should not happen" +# elif (LZO_CC_ZORTECHC) +# else +# error "this should not happen" +# endif +#endif +#ifdef __cplusplus +extern "C" { +#endif +#if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0200)) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (LZO_CC_MSC || LZO_CC_TOPSPEEDC) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif (LZO_CC_TURBOC && (__TURBOC__ >= 0x0295)) + extern void __near __cdecl _AHSHIFT(void); +# define LZO_MM_AHSHIFT ((unsigned) _AHSHIFT) +#elif ((LZO_CC_AZTECC || LZO_CC_PACIFICC || LZO_CC_TURBOC) && LZO_OS_DOS16) +# define LZO_MM_AHSHIFT 12 +#elif (LZO_CC_WATCOMC) + extern unsigned char _HShift; +# define LZO_MM_AHSHIFT ((unsigned) _HShift) +#else +# error "FIXME - implement LZO_MM_AHSHIFT" +#endif +#ifdef __cplusplus +} +#endif +#endif +#elif (LZO_ARCH_C166) +#if !defined(__MODEL__) +# error "FIXME - C166 __MODEL__" +#elif ((__MODEL__) == 0) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 1) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define LZO_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define LZO_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define LZO_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define LZO_MM_XSMALL 1 +#else +# error "FIXME - C166 __MODEL__" +#endif +#elif (LZO_ARCH_MCS251) +#if !defined(__MODEL__) +# error "FIXME - MCS251 __MODEL__" +#elif ((__MODEL__) == 0) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define LZO_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define LZO_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define LZO_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define LZO_MM_XSMALL 1 +#else +# error "FIXME - MCS251 __MODEL__" +#endif +#elif (LZO_ARCH_MCS51) +#if !defined(__MODEL__) +# error "FIXME - MCS51 __MODEL__" +#elif ((__MODEL__) == 1) +# define LZO_MM_SMALL 1 +#elif ((__MODEL__) == 2) +# define LZO_MM_LARGE 1 +#elif ((__MODEL__) == 3) +# define LZO_MM_TINY 1 +#elif ((__MODEL__) == 4) +# define LZO_MM_XTINY 1 +#elif ((__MODEL__) == 5) +# define LZO_MM_XSMALL 1 +#else +# error "FIXME - MCS51 __MODEL__" +#endif +#elif (LZO_ARCH_CRAY_PVP) +# define LZO_MM_PVP 1 +#else +# define LZO_MM_FLAT 1 +#endif +#if (LZO_MM_COMPACT) +# define LZO_INFO_MM "compact" +#elif (LZO_MM_FLAT) +# define LZO_INFO_MM "flat" +#elif (LZO_MM_HUGE) +# define LZO_INFO_MM "huge" +#elif (LZO_MM_LARGE) +# define LZO_INFO_MM "large" +#elif (LZO_MM_MEDIUM) +# define LZO_INFO_MM "medium" +#elif (LZO_MM_PVP) +# define LZO_INFO_MM "pvp" +#elif (LZO_MM_SMALL) +# define LZO_INFO_MM "small" +#elif (LZO_MM_TINY) +# define LZO_INFO_MM "tiny" +#else +# error "unknown memory model" +#endif +#endif +#if defined(SIZEOF_SHORT) +# define LZO_SIZEOF_SHORT (SIZEOF_SHORT) +#endif +#if defined(SIZEOF_INT) +# define LZO_SIZEOF_INT (SIZEOF_INT) +#endif +#if defined(SIZEOF_LONG) +# define LZO_SIZEOF_LONG (SIZEOF_LONG) +#endif +#if defined(SIZEOF_LONG_LONG) +# define LZO_SIZEOF_LONG_LONG (SIZEOF_LONG_LONG) +#endif +#if defined(SIZEOF___INT16) +# define LZO_SIZEOF___INT16 (SIZEOF___INT16) +#endif +#if defined(SIZEOF___INT32) +# define LZO_SIZEOF___INT32 (SIZEOF___INT32) +#endif +#if defined(SIZEOF___INT64) +# define LZO_SIZEOF___INT64 (SIZEOF___INT64) +#endif +#if defined(SIZEOF_VOID_P) +# define LZO_SIZEOF_VOID_P (SIZEOF_VOID_P) +#endif +#if defined(SIZEOF_SIZE_T) +# define LZO_SIZEOF_SIZE_T (SIZEOF_SIZE_T) +#endif +#if defined(SIZEOF_PTRDIFF_T) +# define LZO_SIZEOF_PTRDIFF_T (SIZEOF_PTRDIFF_T) +#endif +#define __LZO_LSR(x,b) (((x)+0ul) >> (b)) +#if !defined(LZO_SIZEOF_SHORT) +# if (LZO_ARCH_CRAY_PVP) +# define LZO_SIZEOF_SHORT 8 +# elif (USHRT_MAX == LZO_0xffffL) +# define LZO_SIZEOF_SHORT 2 +# elif (__LZO_LSR(USHRT_MAX,7) == 1) +# define LZO_SIZEOF_SHORT 1 +# elif (__LZO_LSR(USHRT_MAX,15) == 1) +# define LZO_SIZEOF_SHORT 2 +# elif (__LZO_LSR(USHRT_MAX,31) == 1) +# define LZO_SIZEOF_SHORT 4 +# elif (__LZO_LSR(USHRT_MAX,63) == 1) +# define LZO_SIZEOF_SHORT 8 +# elif (__LZO_LSR(USHRT_MAX,127) == 1) +# define LZO_SIZEOF_SHORT 16 +# else +# error "LZO_SIZEOF_SHORT" +# endif +#endif +#if !defined(LZO_SIZEOF_INT) +# if (LZO_ARCH_CRAY_PVP) +# define LZO_SIZEOF_INT 8 +# elif (UINT_MAX == LZO_0xffffL) +# define LZO_SIZEOF_INT 2 +# elif (UINT_MAX == LZO_0xffffffffL) +# define LZO_SIZEOF_INT 4 +# elif (__LZO_LSR(UINT_MAX,7) == 1) +# define LZO_SIZEOF_INT 1 +# elif (__LZO_LSR(UINT_MAX,15) == 1) +# define LZO_SIZEOF_INT 2 +# elif (__LZO_LSR(UINT_MAX,31) == 1) +# define LZO_SIZEOF_INT 4 +# elif (__LZO_LSR(UINT_MAX,63) == 1) +# define LZO_SIZEOF_INT 8 +# elif (__LZO_LSR(UINT_MAX,127) == 1) +# define LZO_SIZEOF_INT 16 +# else +# error "LZO_SIZEOF_INT" +# endif +#endif +#if !defined(LZO_SIZEOF_LONG) +# if (ULONG_MAX == LZO_0xffffffffL) +# define LZO_SIZEOF_LONG 4 +# elif (__LZO_LSR(ULONG_MAX,7) == 1) +# define LZO_SIZEOF_LONG 1 +# elif (__LZO_LSR(ULONG_MAX,15) == 1) +# define LZO_SIZEOF_LONG 2 +# elif (__LZO_LSR(ULONG_MAX,31) == 1) +# define LZO_SIZEOF_LONG 4 +# elif (__LZO_LSR(ULONG_MAX,63) == 1) +# define LZO_SIZEOF_LONG 8 +# elif (__LZO_LSR(ULONG_MAX,127) == 1) +# define LZO_SIZEOF_LONG 16 +# else +# error "LZO_SIZEOF_LONG" +# endif +#endif +#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) +#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) +# if defined(__LONG_MAX__) && defined(__LONG_LONG_MAX__) +# if (LZO_CC_GNUC >= 0x030300ul) +# if ((__LONG_MAX__)+0 == (__LONG_LONG_MAX__)+0) +# define LZO_SIZEOF_LONG_LONG LZO_SIZEOF_LONG +# elif (__LZO_LSR(__LONG_LONG_MAX__,30) == 1) +# define LZO_SIZEOF_LONG_LONG 4 +# endif +# endif +# endif +#endif +#endif +#if !defined(LZO_SIZEOF_LONG_LONG) && !defined(LZO_SIZEOF___INT64) +#if (LZO_SIZEOF_LONG > 0 && LZO_SIZEOF_LONG < 8) +#if (LZO_ARCH_I086 && LZO_CC_DMC) +#elif (LZO_CC_CILLY) && defined(__GNUC__) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_SIZEOF_LONG_LONG 8 +#elif ((LZO_OS_WIN32 || LZO_OS_WIN64 || defined(_WIN32)) && LZO_CC_MSC && (_MSC_VER >= 1400)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_OS_WIN64 || defined(_WIN64)) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_ARCH_I386 && (LZO_CC_DMC)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_SYMANTECC && (__SC__ >= 0x700))) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_INTELC && defined(__linux__))) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_MWERKS || LZO_CC_PELLESC || LZO_CC_PGI || LZO_CC_SUNPROC)) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_ARCH_I386 && (LZO_CC_INTELC || LZO_CC_MSC)) +# define LZO_SIZEOF___INT64 8 +#elif ((LZO_OS_WIN32 || defined(_WIN32)) && (LZO_CC_MSC)) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_ARCH_I386 && (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0520))) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_ARCH_I386 && (LZO_CC_WATCOMC && (__WATCOMC__ >= 1100))) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_CC_WATCOMC && defined(_INTEGRAL_MAX_BITS) && (_INTEGRAL_MAX_BITS == 64)) +# define LZO_SIZEOF___INT64 8 +#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) +# define LZO_SIZEOF_LONG_LONG 8 +#elif (LZO_CC_SDCC) && (LZO_SIZEOF_INT == 2) +#elif 1 && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +# define LZO_SIZEOF_LONG_LONG 8 +#endif +#endif +#endif +#if defined(__cplusplus) && defined(LZO_CC_GNUC) +# if (LZO_CC_GNUC < 0x020800ul) +# undef LZO_SIZEOF_LONG_LONG +# endif +#endif +#if defined(LZO_CFG_NO_LONG_LONG) || defined(__NO_LONG_LONG) +# undef LZO_SIZEOF_LONG_LONG +#endif +#if !defined(LZO_SIZEOF_VOID_P) +#if (LZO_ARCH_I086) +# define __LZO_WORDSIZE 2 +# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM) +# define LZO_SIZEOF_VOID_P 2 +# elif (LZO_MM_COMPACT || LZO_MM_LARGE || LZO_MM_HUGE) +# define LZO_SIZEOF_VOID_P 4 +# else +# error "LZO_MM" +# endif +#elif (LZO_ARCH_AVR || LZO_ARCH_Z80) +# define __LZO_WORDSIZE 1 +# define LZO_SIZEOF_VOID_P 2 +#elif (LZO_ARCH_C166 || LZO_ARCH_MCS51 || LZO_ARCH_MCS251 || LZO_ARCH_MSP430) +# define LZO_SIZEOF_VOID_P 2 +#elif (LZO_ARCH_H8300) +# if defined(__NORMAL_MODE__) +# define __LZO_WORDSIZE 4 +# define LZO_SIZEOF_VOID_P 2 +# elif defined(__H8300H__) || defined(__H8300S__) || defined(__H8300SX__) +# define __LZO_WORDSIZE 4 +# define LZO_SIZEOF_VOID_P 4 +# else +# define __LZO_WORDSIZE 2 +# define LZO_SIZEOF_VOID_P 2 +# endif +# if (LZO_CC_GNUC && (LZO_CC_GNUC < 0x040000ul)) && (LZO_SIZEOF_INT == 4) +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_INT +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_INT +# endif +#elif (LZO_ARCH_M16C) +# define __LZO_WORDSIZE 2 +# if defined(__m32c_cpu__) || defined(__m32cm_cpu__) +# define LZO_SIZEOF_VOID_P 4 +# else +# define LZO_SIZEOF_VOID_P 2 +# endif +#elif (LZO_SIZEOF_LONG == 8) && ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)) +# define __LZO_WORDSIZE 8 +# define LZO_SIZEOF_VOID_P 4 +#elif defined(__LLP64__) || defined(__LLP64) || defined(_LLP64) || defined(_WIN64) +# define __LZO_WORDSIZE 8 +# define LZO_SIZEOF_VOID_P 8 +#elif (LZO_OS_OS400 || defined(__OS400__)) && defined(__LLP64_IFC__) +# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +#elif (LZO_OS_OS400 || defined(__OS400__)) +# define __LZO_WORDSIZE LZO_SIZEOF_LONG +# define LZO_SIZEOF_VOID_P 16 +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +#elif (defined(__vms) || defined(__VMS)) && (__INITIAL_POINTER_SIZE+0 == 64) +# define LZO_SIZEOF_VOID_P 8 +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_LONG +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_LONG +#elif (LZO_ARCH_SPU) +# if 0 +# define __LZO_WORDSIZE 16 +# endif +# define LZO_SIZEOF_VOID_P 4 +#else +# define LZO_SIZEOF_VOID_P LZO_SIZEOF_LONG +#endif +#endif +#if !defined(LZO_WORDSIZE) +# if defined(__LZO_WORDSIZE) +# define LZO_WORDSIZE __LZO_WORDSIZE +# else +# define LZO_WORDSIZE LZO_SIZEOF_VOID_P +# endif +#endif +#if !defined(LZO_SIZEOF_SIZE_T) +#if (LZO_ARCH_I086 || LZO_ARCH_M16C) +# define LZO_SIZEOF_SIZE_T 2 +#else +# define LZO_SIZEOF_SIZE_T LZO_SIZEOF_VOID_P +#endif +#endif +#if !defined(LZO_SIZEOF_PTRDIFF_T) +#if (LZO_ARCH_I086) +# if (LZO_MM_TINY || LZO_MM_SMALL || LZO_MM_MEDIUM || LZO_MM_HUGE) +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_VOID_P +# elif (LZO_MM_COMPACT || LZO_MM_LARGE) +# if (LZO_CC_BORLANDC || LZO_CC_TURBOC) +# define LZO_SIZEOF_PTRDIFF_T 4 +# else +# define LZO_SIZEOF_PTRDIFF_T 2 +# endif +# else +# error "LZO_MM" +# endif +#else +# define LZO_SIZEOF_PTRDIFF_T LZO_SIZEOF_SIZE_T +#endif +#endif +#if defined(LZO_ABI_NEUTRAL_ENDIAN) +# undef LZO_ABI_BIG_ENDIAN +# undef LZO_ABI_LITTLE_ENDIAN +#elif !defined(LZO_ABI_BIG_ENDIAN) && !defined(LZO_ABI_LITTLE_ENDIAN) +#if (LZO_ARCH_ALPHA) && (LZO_ARCH_CRAY_MPP) +# define LZO_ABI_BIG_ENDIAN 1 +#elif (LZO_ARCH_ALPHA || LZO_ARCH_AMD64 || LZO_ARCH_BLACKFIN || LZO_ARCH_CRIS || LZO_ARCH_I086 || LZO_ARCH_I386 || LZO_ARCH_MSP430) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif (LZO_ARCH_M68K || LZO_ARCH_S390) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && defined(__IAR_SYSTEMS_ICC__) && defined(__LITTLE_ENDIAN__) +# if (__LITTLE_ENDIAN__ == 1) +# define LZO_ABI_LITTLE_ENDIAN 1 +# else +# define LZO_ABI_BIG_ENDIAN 1 +# endif +#elif 1 && defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEB__) && !defined(__ARMEL__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && (LZO_ARCH_ARM) && defined(__ARMEL__) && !defined(__ARMEB__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEB__) && !defined(__MIPSEL__) +# define LZO_ABI_BIG_ENDIAN 1 +#elif 1 && (LZO_ARCH_MIPS) && defined(__MIPSEL__) && !defined(__MIPSEB__) +# define LZO_ABI_LITTLE_ENDIAN 1 +#endif +#endif +#if defined(LZO_ABI_BIG_ENDIAN) && defined(LZO_ABI_LITTLE_ENDIAN) +# error "this should not happen" +#endif +#if defined(LZO_ABI_BIG_ENDIAN) +# define LZO_INFO_ABI_ENDIAN "be" +#elif defined(LZO_ABI_LITTLE_ENDIAN) +# define LZO_INFO_ABI_ENDIAN "le" +#elif defined(LZO_ABI_NEUTRAL_ENDIAN) +# define LZO_INFO_ABI_ENDIAN "neutral" +#endif +#if (LZO_SIZEOF_INT == 1 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) +# define LZO_ABI_I8LP16 1 +# define LZO_INFO_ABI_PM "i8lp16" +#elif (LZO_SIZEOF_INT == 2 && LZO_SIZEOF_LONG == 2 && LZO_SIZEOF_VOID_P == 2) +# define LZO_ABI_ILP16 1 +# define LZO_INFO_ABI_PM "ilp16" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 4) +# define LZO_ABI_ILP32 1 +# define LZO_INFO_ABI_PM "ilp32" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 4 && LZO_SIZEOF_VOID_P == 8 && LZO_SIZEOF_SIZE_T == 8) +# define LZO_ABI_LLP64 1 +# define LZO_INFO_ABI_PM "llp64" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) +# define LZO_ABI_LP64 1 +# define LZO_INFO_ABI_PM "lp64" +#elif (LZO_SIZEOF_INT == 8 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 8) +# define LZO_ABI_ILP64 1 +# define LZO_INFO_ABI_PM "ilp64" +#elif (LZO_SIZEOF_INT == 4 && LZO_SIZEOF_LONG == 8 && LZO_SIZEOF_VOID_P == 4) +# define LZO_ABI_IP32L64 1 +# define LZO_INFO_ABI_PM "ip32l64" +#endif +#if !defined(__LZO_LIBC_OVERRIDE) +#if defined(LZO_LIBC_NAKED) +# define LZO_INFO_LIBC "naked" +#elif defined(LZO_LIBC_FREESTANDING) +# define LZO_INFO_LIBC "freestanding" +#elif defined(LZO_LIBC_MOSTLY_FREESTANDING) +# define LZO_INFO_LIBC "mfreestanding" +#elif defined(LZO_LIBC_ISOC90) +# define LZO_INFO_LIBC "isoc90" +#elif defined(LZO_LIBC_ISOC99) +# define LZO_INFO_LIBC "isoc99" +#elif defined(__dietlibc__) +# define LZO_LIBC_DIETLIBC 1 +# define LZO_INFO_LIBC "dietlibc" +#elif defined(_NEWLIB_VERSION) +# define LZO_LIBC_NEWLIB 1 +# define LZO_INFO_LIBC "newlib" +#elif defined(__UCLIBC__) && defined(__UCLIBC_MAJOR__) && defined(__UCLIBC_MINOR__) +# if defined(__UCLIBC_SUBLEVEL__) +# define LZO_LIBC_UCLIBC (__UCLIBC_MAJOR__ * 0x10000L + __UCLIBC_MINOR__ * 0x100 + __UCLIBC_SUBLEVEL__) +# else +# define LZO_LIBC_UCLIBC 0x00090bL +# endif +# define LZO_INFO_LIBC "uclibc" +#elif defined(__GLIBC__) && defined(__GLIBC_MINOR__) +# define LZO_LIBC_GLIBC (__GLIBC__ * 0x10000L + __GLIBC_MINOR__ * 0x100) +# define LZO_INFO_LIBC "glibc" +#elif (LZO_CC_MWERKS) && defined(__MSL__) +# define LZO_LIBC_MSL __MSL__ +# define LZO_INFO_LIBC "msl" +#elif 1 && defined(__IAR_SYSTEMS_ICC__) +# define LZO_LIBC_ISOC90 1 +# define LZO_INFO_LIBC "isoc90" +#else +# define LZO_LIBC_DEFAULT 1 +# define LZO_INFO_LIBC "default" +#endif +#endif +#if !defined(__lzo_gnuc_extension__) +#if (LZO_CC_GNUC >= 0x020800ul) +# define __lzo_gnuc_extension__ __extension__ +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_gnuc_extension__ __extension__ +#else +# define __lzo_gnuc_extension__ +#endif +#endif +#if !defined(__lzo_ua_volatile) +# define __lzo_ua_volatile volatile +#endif +#if !defined(__lzo_alignof) +#if (LZO_CC_CILLY || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +# define __lzo_alignof(e) __alignof__(e) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 700)) +# define __lzo_alignof(e) __alignof__(e) +#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) +# define __lzo_alignof(e) __alignof(e) +#endif +#endif +#if defined(__lzo_alignof) +# define __lzo_HAVE_alignof 1 +#endif +#if !defined(__lzo_constructor) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_constructor __attribute__((__constructor__,__used__)) +#elif (LZO_CC_GNUC >= 0x020700ul) +# define __lzo_constructor __attribute__((__constructor__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_constructor __attribute__((__constructor__)) +#endif +#endif +#if defined(__lzo_constructor) +# define __lzo_HAVE_constructor 1 +#endif +#if !defined(__lzo_destructor) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_destructor __attribute__((__destructor__,__used__)) +#elif (LZO_CC_GNUC >= 0x020700ul) +# define __lzo_destructor __attribute__((__destructor__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_destructor __attribute__((__destructor__)) +#endif +#endif +#if defined(__lzo_destructor) +# define __lzo_HAVE_destructor 1 +#endif +#if defined(__lzo_HAVE_destructor) && !defined(__lzo_HAVE_constructor) +# error "this should not happen" +#endif +#if !defined(__lzo_inline) +#if (LZO_CC_TURBOC && (__TURBOC__ <= 0x0295)) +#elif defined(__cplusplus) +# define __lzo_inline inline +#elif (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0550)) +# define __lzo_inline __inline +#elif (LZO_CC_CILLY || LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE || LZO_CC_PGI) +# define __lzo_inline __inline__ +#elif (LZO_CC_DMC) +# define __lzo_inline __inline +#elif (LZO_CC_INTELC) +# define __lzo_inline __inline +#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x2405)) +# define __lzo_inline __inline +#elif (LZO_CC_MSC && (_MSC_VER >= 900)) +# define __lzo_inline __inline +#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +# define __lzo_inline inline +#endif +#endif +#if defined(__lzo_inline) +# define __lzo_HAVE_inline 1 +#else +# define __lzo_inline +#endif +#if !defined(__lzo_forceinline) +#if (LZO_CC_GNUC >= 0x030200ul) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) +# define __lzo_forceinline __forceinline +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_forceinline __inline__ __attribute__((__always_inline__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) +# define __lzo_forceinline __forceinline +#endif +#endif +#if defined(__lzo_forceinline) +# define __lzo_HAVE_forceinline 1 +#else +# define __lzo_forceinline +#endif +#if !defined(__lzo_noinline) +#if 1 && (LZO_ARCH_I386) && (LZO_CC_GNUC >= 0x040000ul) && (LZO_CC_GNUC < 0x040003ul) +# define __lzo_noinline __attribute__((__noinline__,__used__)) +#elif (LZO_CC_GNUC >= 0x030200ul) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_MSC) +# define __lzo_noinline __declspec(noinline) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_noinline __attribute__((__noinline__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1300)) +# define __lzo_noinline __declspec(noinline) +#elif (LZO_CC_MWERKS && (__MWERKS__ >= 0x3200) && (LZO_OS_WIN32 || LZO_OS_WIN64)) +# if defined(__cplusplus) +# else +# define __lzo_noinline __declspec(noinline) +# endif +#endif +#endif +#if defined(__lzo_noinline) +# define __lzo_HAVE_noinline 1 +#else +# define __lzo_noinline +#endif +#if (defined(__lzo_HAVE_forceinline) || defined(__lzo_HAVE_noinline)) && !defined(__lzo_HAVE_inline) +# error "this should not happen" +#endif +#if !defined(__lzo_noreturn) +#if (LZO_CC_GNUC >= 0x020700ul) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) +# define __lzo_noreturn __declspec(noreturn) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_noreturn __attribute__((__noreturn__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) +# define __lzo_noreturn __declspec(noreturn) +#endif +#endif +#if defined(__lzo_noreturn) +# define __lzo_HAVE_noreturn 1 +#else +# define __lzo_noreturn +#endif +#if !defined(__lzo_nothrow) +#if (LZO_CC_GNUC >= 0x030300ul) +# define __lzo_nothrow __attribute__((__nothrow__)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 450) && LZO_CC_SYNTAX_MSC) && defined(__cplusplus) +# define __lzo_nothrow __declspec(nothrow) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800) && LZO_CC_SYNTAX_GNUC) +# define __lzo_nothrow __attribute__((__nothrow__)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_nothrow __attribute__((__nothrow__)) +#elif (LZO_CC_MSC && (_MSC_VER >= 1200)) && defined(__cplusplus) +# define __lzo_nothrow __declspec(nothrow) +#endif +#endif +#if defined(__lzo_nothrow) +# define __lzo_HAVE_nothrow 1 +#else +# define __lzo_nothrow +#endif +#if !defined(__lzo_restrict) +#if (LZO_CC_GNUC >= 0x030400ul) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 600) && LZO_CC_SYNTAX_GNUC) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_LLVM) +# define __lzo_restrict __restrict__ +#elif (LZO_CC_MSC && (_MSC_VER >= 1400)) +# define __lzo_restrict __restrict +#endif +#endif +#if defined(__lzo_restrict) +# define __lzo_HAVE_restrict 1 +#else +# define __lzo_restrict +#endif +#if !defined(__lzo_likely) && !defined(__lzo_unlikely) +#if (LZO_CC_GNUC >= 0x030200ul) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#elif (LZO_CC_INTELC && (__INTEL_COMPILER >= 800)) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#elif (LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define __lzo_likely(e) (__builtin_expect(!!(e),1)) +# define __lzo_unlikely(e) (__builtin_expect(!!(e),0)) +#endif +#endif +#if defined(__lzo_likely) +# define __lzo_HAVE_likely 1 +#else +# define __lzo_likely(e) (e) +#endif +#if defined(__lzo_unlikely) +# define __lzo_HAVE_unlikely 1 +#else +# define __lzo_unlikely(e) (e) +#endif +#if !defined(LZO_UNUSED) +# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) +# define LZO_UNUSED(var) ((void) &var) +# elif (LZO_CC_BORLANDC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PELLESC || LZO_CC_TURBOC) +# define LZO_UNUSED(var) if (&var) ; else +# elif (LZO_CC_GNUC || LZO_CC_LLVM || LZO_CC_PATHSCALE) +# define LZO_UNUSED(var) ((void) var) +# elif (LZO_CC_MSC && (_MSC_VER < 900)) +# define LZO_UNUSED(var) if (&var) ; else +# elif (LZO_CC_KEILC) +# define LZO_UNUSED(var) {extern int __lzo_unused[1-2*!(sizeof(var)>0)];} +# elif (LZO_CC_PACIFICC) +# define LZO_UNUSED(var) ((void) sizeof(var)) +# elif (LZO_CC_WATCOMC) && defined(__cplusplus) +# define LZO_UNUSED(var) ((void) var) +# else +# define LZO_UNUSED(var) ((void) &var) +# endif +#endif +#if !defined(LZO_UNUSED_FUNC) +# if (LZO_CC_BORLANDC && (__BORLANDC__ >= 0x0600)) +# define LZO_UNUSED_FUNC(func) ((void) func) +# elif (LZO_CC_BORLANDC || LZO_CC_NDPC || LZO_CC_TURBOC) +# define LZO_UNUSED_FUNC(func) if (func) ; else +# elif (LZO_CC_LLVM) +# define LZO_UNUSED_FUNC(func) ((void) &func) +# elif (LZO_CC_MSC && (_MSC_VER < 900)) +# define LZO_UNUSED_FUNC(func) if (func) ; else +# elif (LZO_CC_MSC) +# define LZO_UNUSED_FUNC(func) ((void) &func) +# elif (LZO_CC_KEILC || LZO_CC_PELLESC) +# define LZO_UNUSED_FUNC(func) {extern int __lzo_unused[1-2*!(sizeof((int)func)>0)];} +# else +# define LZO_UNUSED_FUNC(func) ((void) func) +# endif +#endif +#if !defined(LZO_UNUSED_LABEL) +# if (LZO_CC_WATCOMC) && defined(__cplusplus) +# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l +# elif (LZO_CC_INTELC || LZO_CC_WATCOMC) +# define LZO_UNUSED_LABEL(l) if (0) goto l +# else +# define LZO_UNUSED_LABEL(l) switch(0) case 1:goto l +# endif +#endif +#if !defined(LZO_DEFINE_UNINITIALIZED_VAR) +# if 0 +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var +# elif 0 && (LZO_CC_GNUC) +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = var +# else +# define LZO_DEFINE_UNINITIALIZED_VAR(type,var,init) type var = init +# endif +#endif +#if !defined(LZO_COMPILE_TIME_ASSERT_HEADER) +# if (LZO_CC_AZTECC || LZO_CC_ZORTECHC) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)]; +# elif (LZO_CC_DMC || LZO_CC_SYMANTECC) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1u-2*!(e)]; +# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-!(e)]; +# else +# define LZO_COMPILE_TIME_ASSERT_HEADER(e) extern int __lzo_cta[1-2*!(e)]; +# endif +#endif +#if !defined(LZO_COMPILE_TIME_ASSERT) +# if (LZO_CC_AZTECC) +# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-!(e)];} +# elif (LZO_CC_DMC || LZO_CC_PACIFICC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) +# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# elif (LZO_CC_MSC && (_MSC_VER < 900)) +# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# elif (LZO_CC_TURBOC && (__TURBOC__ == 0x0295)) +# define LZO_COMPILE_TIME_ASSERT(e) switch(0) case 1:case !(e):break; +# else +# define LZO_COMPILE_TIME_ASSERT(e) {typedef int __lzo_cta_t[1-2*!(e)];} +# endif +#endif +#if (LZO_ARCH_I086 || LZO_ARCH_I386) && (LZO_OS_DOS16 || LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_OS216 || LZO_OS_WIN16 || LZO_OS_WIN32 || LZO_OS_WIN64) +# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC) +# elif (LZO_CC_DMC || LZO_CC_SYMANTECC || LZO_CC_ZORTECHC) +# define __lzo_cdecl __cdecl +# define __lzo_cdecl_atexit +# define __lzo_cdecl_main __cdecl +# if (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) +# define __lzo_cdecl_qsort __pascal +# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) +# define __lzo_cdecl_qsort _stdcall +# else +# define __lzo_cdecl_qsort __cdecl +# endif +# elif (LZO_CC_WATCOMC) +# define __lzo_cdecl __cdecl +# else +# define __lzo_cdecl __cdecl +# define __lzo_cdecl_atexit __cdecl +# define __lzo_cdecl_main __cdecl +# define __lzo_cdecl_qsort __cdecl +# endif +# if (LZO_CC_GNUC || LZO_CC_HIGHC || LZO_CC_NDPC || LZO_CC_PACIFICC || LZO_CC_WATCOMC) +# elif (LZO_OS_OS2 && (LZO_CC_DMC || LZO_CC_SYMANTECC)) +# define __lzo_cdecl_sighandler __pascal +# elif (LZO_OS_OS2 && (LZO_CC_ZORTECHC)) +# define __lzo_cdecl_sighandler _stdcall +# elif (LZO_CC_MSC && (_MSC_VER >= 1400)) && defined(_M_CEE_PURE) +# define __lzo_cdecl_sighandler __clrcall +# elif (LZO_CC_MSC && (_MSC_VER >= 600 && _MSC_VER < 700)) +# if defined(_DLL) +# define __lzo_cdecl_sighandler _far _cdecl _loadds +# elif defined(_MT) +# define __lzo_cdecl_sighandler _far _cdecl +# else +# define __lzo_cdecl_sighandler _cdecl +# endif +# else +# define __lzo_cdecl_sighandler __cdecl +# endif +#elif (LZO_ARCH_I386) && (LZO_CC_WATCOMC) +# define __lzo_cdecl __cdecl +#elif (LZO_ARCH_M68K && LZO_OS_TOS && (LZO_CC_PUREC || LZO_CC_TURBOC)) +# define __lzo_cdecl cdecl +#endif +#if !defined(__lzo_cdecl) +# define __lzo_cdecl +#endif +#if !defined(__lzo_cdecl_atexit) +# define __lzo_cdecl_atexit +#endif +#if !defined(__lzo_cdecl_main) +# define __lzo_cdecl_main +#endif +#if !defined(__lzo_cdecl_qsort) +# define __lzo_cdecl_qsort +#endif +#if !defined(__lzo_cdecl_sighandler) +# define __lzo_cdecl_sighandler +#endif +#if !defined(__lzo_cdecl_va) +# define __lzo_cdecl_va __lzo_cdecl +#endif +#if !defined(LZO_CFG_NO_WINDOWS_H) +#if (LZO_OS_CYGWIN || (LZO_OS_EMX && defined(__RSXNT__)) || LZO_OS_WIN32 || LZO_OS_WIN64) +# if (LZO_CC_WATCOMC && (__WATCOMC__ < 1000)) +# elif (LZO_OS_WIN32 && LZO_CC_GNUC) && defined(__PW32__) +# elif ((LZO_OS_CYGWIN || defined(__MINGW32__)) && (LZO_CC_GNUC && (LZO_CC_GNUC < 0x025f00ul))) +# else +# define LZO_HAVE_WINDOWS_H 1 +# endif +#endif +#endif +#if (LZO_ARCH_ALPHA) +# define LZO_OPT_AVOID_UINT_INDEX 1 +# define LZO_OPT_AVOID_SHORT 1 +# define LZO_OPT_AVOID_USHORT 1 +#elif (LZO_ARCH_AMD64) +# define LZO_OPT_AVOID_INT_INDEX 1 +# define LZO_OPT_AVOID_UINT_INDEX 1 +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +# define LZO_OPT_UNALIGNED64 1 +#elif (LZO_ARCH_ARM && LZO_ARCH_ARM_THUMB) +#elif (LZO_ARCH_ARM) +# define LZO_OPT_AVOID_SHORT 1 +# define LZO_OPT_AVOID_USHORT 1 +#elif (LZO_ARCH_CRIS) +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +#elif (LZO_ARCH_I386) +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +#elif (LZO_ARCH_IA64) +# define LZO_OPT_AVOID_INT_INDEX 1 +# define LZO_OPT_AVOID_UINT_INDEX 1 +# define LZO_OPT_PREFER_POSTINC 1 +#elif (LZO_ARCH_M68K) +# define LZO_OPT_PREFER_POSTINC 1 +# define LZO_OPT_PREFER_PREDEC 1 +# if defined(__mc68020__) && !defined(__mcoldfire__) +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +# endif +#elif (LZO_ARCH_MIPS) +# define LZO_OPT_AVOID_UINT_INDEX 1 +#elif (LZO_ARCH_POWERPC) +# define LZO_OPT_PREFER_PREINC 1 +# define LZO_OPT_PREFER_PREDEC 1 +# if defined(LZO_ABI_BIG_ENDIAN) +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +# endif +#elif (LZO_ARCH_S390) +# define LZO_OPT_UNALIGNED16 1 +# define LZO_OPT_UNALIGNED32 1 +# if (LZO_SIZEOF_SIZE_T == 8) +# define LZO_OPT_UNALIGNED64 1 +# endif +#elif (LZO_ARCH_SH) +# define LZO_OPT_PREFER_POSTINC 1 +# define LZO_OPT_PREFER_PREDEC 1 +#endif +#if !defined(LZO_CFG_NO_INLINE_ASM) +#if defined(LZO_CC_LLVM) +# define LZO_CFG_NO_INLINE_ASM 1 +#endif +#endif +#if !defined(LZO_CFG_NO_UNALIGNED) +#if defined(LZO_ABI_NEUTRAL_ENDIAN) || defined(LZO_ARCH_GENERIC) +# define LZO_CFG_NO_UNALIGNED 1 +#endif +#endif +#if defined(LZO_CFG_NO_UNALIGNED) +# undef LZO_OPT_UNALIGNED16 +# undef LZO_OPT_UNALIGNED32 +# undef LZO_OPT_UNALIGNED64 +#endif +#if defined(LZO_CFG_NO_INLINE_ASM) +#elif (LZO_ARCH_I386 && (LZO_OS_DOS32 || LZO_OS_WIN32) && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) +# define LZO_ASM_SYNTAX_MSC 1 +#elif (LZO_OS_WIN64 && (LZO_CC_DMC || LZO_CC_INTELC || LZO_CC_MSC || LZO_CC_PELLESC)) +#elif (LZO_ARCH_I386 && (LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) +# define LZO_ASM_SYNTAX_GNUC 1 +#elif (LZO_ARCH_AMD64 && (LZO_CC_GNUC || LZO_CC_INTELC || LZO_CC_PATHSCALE)) +# define LZO_ASM_SYNTAX_GNUC 1 +#endif +#if (LZO_ASM_SYNTAX_GNUC) +#if (LZO_ARCH_I386 && LZO_CC_GNUC && (LZO_CC_GNUC < 0x020000ul)) +# define __LZO_ASM_CLOBBER "ax" +#elif (LZO_CC_INTELC) +# define __LZO_ASM_CLOBBER "memory" +#else +# define __LZO_ASM_CLOBBER "cc", "memory" +#endif +#endif +#if defined(__LZO_INFOSTR_MM) +#elif (LZO_MM_FLAT) && (defined(__LZO_INFOSTR_PM) || defined(LZO_INFO_ABI_PM)) +# define __LZO_INFOSTR_MM "" +#elif defined(LZO_INFO_MM) +# define __LZO_INFOSTR_MM "." LZO_INFO_MM +#else +# define __LZO_INFOSTR_MM "" +#endif +#if defined(__LZO_INFOSTR_PM) +#elif defined(LZO_INFO_ABI_PM) +# define __LZO_INFOSTR_PM "." LZO_INFO_ABI_PM +#else +# define __LZO_INFOSTR_PM "" +#endif +#if defined(__LZO_INFOSTR_ENDIAN) +#elif defined(LZO_INFO_ABI_ENDIAN) +# define __LZO_INFOSTR_ENDIAN "." LZO_INFO_ABI_ENDIAN +#else +# define __LZO_INFOSTR_ENDIAN "" +#endif +#if defined(__LZO_INFOSTR_OSNAME) +#elif defined(LZO_INFO_OS_CONSOLE) +# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_CONSOLE +#elif defined(LZO_INFO_OS_POSIX) +# define __LZO_INFOSTR_OSNAME LZO_INFO_OS "." LZO_INFO_OS_POSIX +#else +# define __LZO_INFOSTR_OSNAME LZO_INFO_OS +#endif +#if defined(__LZO_INFOSTR_LIBC) +#elif defined(LZO_INFO_LIBC) +# define __LZO_INFOSTR_LIBC "." LZO_INFO_LIBC +#else +# define __LZO_INFOSTR_LIBC "" +#endif +#if defined(__LZO_INFOSTR_CCVER) +#elif defined(LZO_INFO_CCVER) +# define __LZO_INFOSTR_CCVER " " LZO_INFO_CCVER +#else +# define __LZO_INFOSTR_CCVER "" +#endif +#define LZO_INFO_STRING \ + LZO_INFO_ARCH __LZO_INFOSTR_MM __LZO_INFOSTR_PM __LZO_INFOSTR_ENDIAN \ + " " __LZO_INFOSTR_OSNAME __LZO_INFOSTR_LIBC " " LZO_INFO_CC __LZO_INFOSTR_CCVER + +#endif + +#endif + +#undef LZO_HAVE_CONFIG_H +#include "minilzo.h" + +#if !defined(MINILZO_VERSION) || (MINILZO_VERSION != 0x2030) +# error "version mismatch in miniLZO source files" +#endif + +#ifdef MINILZO_HAVE_CONFIG_H +# define LZO_HAVE_CONFIG_H +#endif + +#ifndef __LZO_CONF_H +#define __LZO_CONF_H + +#if !defined(__LZO_IN_MINILZO) +#if defined(LZO_CFG_FREESTANDING) +# define LZO_LIBC_FREESTANDING 1 +# define LZO_OS_FREESTANDING 1 +# define ACC_LIBC_FREESTANDING 1 +# define ACC_OS_FREESTANDING 1 +#endif +#if defined(LZO_CFG_NO_UNALIGNED) +# define ACC_CFG_NO_UNALIGNED 1 +#endif +#if defined(LZO_ARCH_GENERIC) +# define ACC_ARCH_GENERIC 1 +#endif +#if defined(LZO_ABI_NEUTRAL_ENDIAN) +# define ACC_ABI_NEUTRAL_ENDIAN 1 +#endif +#if defined(LZO_HAVE_CONFIG_H) +# define ACC_CONFIG_NO_HEADER 1 +#endif +#if defined(LZO_CFG_EXTRA_CONFIG_HEADER) +# include LZO_CFG_EXTRA_CONFIG_HEADER +#endif +#if defined(__LZOCONF_H) || defined(__LZOCONF_H_INCLUDED) +# error "include this file first" +#endif +#include "lzo/lzoconf.h" +#endif + +#if (LZO_VERSION < 0x02000) || !defined(__LZOCONF_H_INCLUDED) +# error "version mismatch" +#endif + +#if (LZO_CC_BORLANDC && LZO_ARCH_I086) +# pragma option -h +#endif + +#if (LZO_CC_MSC && (_MSC_VER >= 1000)) +# pragma warning(disable: 4127 4701) +#endif +#if (LZO_CC_MSC && (_MSC_VER >= 1300)) +# pragma warning(disable: 4820) +# pragma warning(disable: 4514 4710 4711) +#endif + +#if (LZO_CC_SUNPROC) +# pragma error_messages(off,E_END_OF_LOOP_CODE_NOT_REACHED) +# pragma error_messages(off,E_LOOP_NOT_ENTERED_AT_TOP) +#endif + +#if defined(__LZO_MMODEL_HUGE) && (!LZO_HAVE_MM_HUGE_PTR) +# error "this should not happen - check defines for __huge" +#endif + +#if defined(__LZO_IN_MINILZO) || defined(LZO_CFG_FREESTANDING) +#elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16) +# define ACC_WANT_ACC_INCD_H 1 +# define ACC_WANT_ACC_INCE_H 1 +# define ACC_WANT_ACC_INCI_H 1 +#elif 1 +# include +#else +# define ACC_WANT_ACC_INCD_H 1 +#endif + +#if (LZO_ARCH_I086) +# define ACC_MM_AHSHIFT LZO_MM_AHSHIFT +# define ACC_PTR_FP_OFF(x) (((const unsigned __far*)&(x))[0]) +# define ACC_PTR_FP_SEG(x) (((const unsigned __far*)&(x))[1]) +# define ACC_PTR_MK_FP(s,o) ((void __far*)(((unsigned long)(s)<<16)+(unsigned)(o))) +#endif + +#if !defined(lzo_uintptr_t) +# if defined(__LZO_MMODEL_HUGE) +# define lzo_uintptr_t unsigned long +# elif 1 && defined(LZO_OS_OS400) && (LZO_SIZEOF_VOID_P == 16) +# define __LZO_UINTPTR_T_IS_POINTER 1 + typedef char* lzo_uintptr_t; +# define lzo_uintptr_t lzo_uintptr_t +# elif (LZO_SIZEOF_SIZE_T == LZO_SIZEOF_VOID_P) +# define lzo_uintptr_t size_t +# elif (LZO_SIZEOF_LONG == LZO_SIZEOF_VOID_P) +# define lzo_uintptr_t unsigned long +# elif (LZO_SIZEOF_INT == LZO_SIZEOF_VOID_P) +# define lzo_uintptr_t unsigned int +# elif (LZO_SIZEOF_LONG_LONG == LZO_SIZEOF_VOID_P) +# define lzo_uintptr_t unsigned long long +# else +# define lzo_uintptr_t size_t +# endif +#endif +LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp)) + +#if 1 && !defined(LZO_CFG_FREESTANDING) +#if 1 && !defined(HAVE_STRING_H) +#define HAVE_STRING_H 1 +#endif +#if 1 && !defined(HAVE_MEMCMP) +#define HAVE_MEMCMP 1 +#endif +#if 1 && !defined(HAVE_MEMCPY) +#define HAVE_MEMCPY 1 +#endif +#if 1 && !defined(HAVE_MEMMOVE) +#define HAVE_MEMMOVE 1 +#endif +#if 1 && !defined(HAVE_MEMSET) +#define HAVE_MEMSET 1 +#endif +#endif + +#if 1 && defined(HAVE_STRING_H) +#include +#endif + +#if defined(LZO_CFG_FREESTANDING) +# undef HAVE_MEMCMP +# undef HAVE_MEMCPY +# undef HAVE_MEMMOVE +# undef HAVE_MEMSET +#endif + +#if !defined(HAVE_MEMCMP) +# undef memcmp +# define memcmp(a,b,c) lzo_memcmp(a,b,c) +#elif !defined(__LZO_MMODEL_HUGE) +# define lzo_memcmp(a,b,c) memcmp(a,b,c) +#endif +#if !defined(HAVE_MEMCPY) +# undef memcpy +# define memcpy(a,b,c) lzo_memcpy(a,b,c) +#elif !defined(__LZO_MMODEL_HUGE) +# define lzo_memcpy(a,b,c) memcpy(a,b,c) +#endif +#if !defined(HAVE_MEMMOVE) +# undef memmove +# define memmove(a,b,c) lzo_memmove(a,b,c) +#elif !defined(__LZO_MMODEL_HUGE) +# define lzo_memmove(a,b,c) memmove(a,b,c) +#endif +#if !defined(HAVE_MEMSET) +# undef memset +# define memset(a,b,c) lzo_memset(a,b,c) +#elif !defined(__LZO_MMODEL_HUGE) +# define lzo_memset(a,b,c) memset(a,b,c) +#endif + +#undef NDEBUG +#if defined(LZO_CFG_FREESTANDING) +# undef LZO_DEBUG +# define NDEBUG 1 +# undef assert +# define assert(e) ((void)0) +#else +# if !defined(LZO_DEBUG) +# define NDEBUG 1 +# endif +# include +#endif + +#if 0 && defined(__BOUNDS_CHECKING_ON) +# include +#else +# define BOUNDS_CHECKING_OFF_DURING(stmt) stmt +# define BOUNDS_CHECKING_OFF_IN_EXPR(expr) (expr) +#endif + +#if !defined(__lzo_inline) +# define __lzo_inline +#endif +#if !defined(__lzo_forceinline) +# define __lzo_forceinline +#endif +#if !defined(__lzo_noinline) +# define __lzo_noinline +#endif + +#if 1 +# define LZO_BYTE(x) ((unsigned char) (x)) +#else +# define LZO_BYTE(x) ((unsigned char) ((x) & 0xff)) +#endif + +#define LZO_MAX(a,b) ((a) >= (b) ? (a) : (b)) +#define LZO_MIN(a,b) ((a) <= (b) ? (a) : (b)) +#define LZO_MAX3(a,b,c) ((a) >= (b) ? LZO_MAX(a,c) : LZO_MAX(b,c)) +#define LZO_MIN3(a,b,c) ((a) <= (b) ? LZO_MIN(a,c) : LZO_MIN(b,c)) + +#define lzo_sizeof(type) ((lzo_uint) (sizeof(type))) + +#define LZO_HIGH(array) ((lzo_uint) (sizeof(array)/sizeof(*(array)))) + +#define LZO_SIZE(bits) (1u << (bits)) +#define LZO_MASK(bits) (LZO_SIZE(bits) - 1) + +#define LZO_LSIZE(bits) (1ul << (bits)) +#define LZO_LMASK(bits) (LZO_LSIZE(bits) - 1) + +#define LZO_USIZE(bits) ((lzo_uint) 1 << (bits)) +#define LZO_UMASK(bits) (LZO_USIZE(bits) - 1) + +#if !defined(DMUL) +#if 0 + +# define DMUL(a,b) ((lzo_xint) ((lzo_uint32)(a) * (lzo_uint32)(b))) +#else +# define DMUL(a,b) ((lzo_xint) ((a) * (b))) +#endif +#endif + +#if 1 && !defined(LZO_CFG_NO_UNALIGNED) +#if 1 && (LZO_ARCH_AMD64 || LZO_ARCH_I386) +# if (LZO_SIZEOF_SHORT == 2) +# define LZO_UNALIGNED_OK_2 +# endif +# if (LZO_SIZEOF_INT == 4) +# define LZO_UNALIGNED_OK_4 +# endif +#endif +#endif + +#if defined(LZO_UNALIGNED_OK_2) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(short) == 2) +#endif +#if defined(LZO_UNALIGNED_OK_4) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32) == 4) +#elif defined(LZO_ALIGNED_OK_4) + LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint32) == 4) +#endif + +#define MEMCPY8_DS(dest,src,len) \ + lzo_memcpy(dest,src,len); dest += len; src += len + +#define BZERO8_PTR(s,l,n) \ + lzo_memset((lzo_voidp)(s),0,(lzo_uint)(l)*(n)) + +#define MEMCPY_DS(dest,src,len) \ + do *dest++ = *src++; while (--len > 0) + +__LZO_EXTERN_C int __lzo_init_done; +__LZO_EXTERN_C const char __lzo_copyright[]; +LZO_EXTERN(const lzo_bytep) lzo_copyright(void); + +#ifndef __LZO_PTR_H +#define __LZO_PTR_H + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(lzo_uintptr_t) +# if defined(__LZO_MMODEL_HUGE) +# define lzo_uintptr_t unsigned long +# else +# define lzo_uintptr_t acc_uintptr_t +# ifdef __ACC_INTPTR_T_IS_POINTER +# define __LZO_UINTPTR_T_IS_POINTER 1 +# endif +# endif +#endif + +#if (LZO_ARCH_I086) +#define PTR(a) ((lzo_bytep) (a)) +#define PTR_ALIGNED_4(a) ((ACC_PTR_FP_OFF(a) & 3) == 0) +#define PTR_ALIGNED2_4(a,b) (((ACC_PTR_FP_OFF(a) | ACC_PTR_FP_OFF(b)) & 3) == 0) +#elif (LZO_MM_PVP) +#define PTR(a) ((lzo_bytep) (a)) +#define PTR_ALIGNED_8(a) ((((lzo_uintptr_t)(a)) >> 61) == 0) +#define PTR_ALIGNED2_8(a,b) ((((lzo_uintptr_t)(a)|(lzo_uintptr_t)(b)) >> 61) == 0) +#else +#define PTR(a) ((lzo_uintptr_t) (a)) +#define PTR_LINEAR(a) PTR(a) +#define PTR_ALIGNED_4(a) ((PTR_LINEAR(a) & 3) == 0) +#define PTR_ALIGNED_8(a) ((PTR_LINEAR(a) & 7) == 0) +#define PTR_ALIGNED2_4(a,b) (((PTR_LINEAR(a) | PTR_LINEAR(b)) & 3) == 0) +#define PTR_ALIGNED2_8(a,b) (((PTR_LINEAR(a) | PTR_LINEAR(b)) & 7) == 0) +#endif + +#define PTR_LT(a,b) (PTR(a) < PTR(b)) +#define PTR_GE(a,b) (PTR(a) >= PTR(b)) +#define PTR_DIFF(a,b) (PTR(a) - PTR(b)) +#define pd(a,b) ((lzo_uint) ((a)-(b))) + +LZO_EXTERN(lzo_uintptr_t) +__lzo_ptr_linear(const lzo_voidp ptr); + +typedef union +{ + char a_char; + unsigned char a_uchar; + short a_short; + unsigned short a_ushort; + int a_int; + unsigned int a_uint; + long a_long; + unsigned long a_ulong; + lzo_int a_lzo_int; + lzo_uint a_lzo_uint; + lzo_int32 a_lzo_int32; + lzo_uint32 a_lzo_uint32; + ptrdiff_t a_ptrdiff_t; + lzo_uintptr_t a_lzo_uintptr_t; + lzo_voidp a_lzo_voidp; + void * a_void_p; + lzo_bytep a_lzo_bytep; + lzo_bytepp a_lzo_bytepp; + lzo_uintp a_lzo_uintp; + lzo_uint * a_lzo_uint_p; + lzo_uint32p a_lzo_uint32p; + lzo_uint32 * a_lzo_uint32_p; + unsigned char * a_uchar_p; + char * a_char_p; +} +lzo_full_align_t; + +#ifdef __cplusplus +} +#endif + +#endif + +#define LZO_DETERMINISTIC + +#define LZO_DICT_USE_PTR +#if 0 && (LZO_ARCH_I086) +# undef LZO_DICT_USE_PTR +#endif + +#if defined(LZO_DICT_USE_PTR) +# define lzo_dict_t const lzo_bytep +# define lzo_dict_p lzo_dict_t __LZO_MMODEL * +#else +# define lzo_dict_t lzo_uint +# define lzo_dict_p lzo_dict_t __LZO_MMODEL * +#endif + +#endif + +#if !defined(MINILZO_CFG_SKIP_LZO_PTR) + +LZO_PUBLIC(lzo_uintptr_t) +__lzo_ptr_linear(const lzo_voidp ptr) +{ + lzo_uintptr_t p; + +#if (LZO_ARCH_I086) + p = (((lzo_uintptr_t)(ACC_PTR_FP_SEG(ptr))) << (16 - ACC_MM_AHSHIFT)) + (ACC_PTR_FP_OFF(ptr)); +#elif (LZO_MM_PVP) + p = (lzo_uintptr_t) (ptr); + p = (p << 3) | (p >> 61); +#else + p = (lzo_uintptr_t) PTR_LINEAR(ptr); +#endif + + return p; +} + +LZO_PUBLIC(unsigned) +__lzo_align_gap(const lzo_voidp ptr, lzo_uint size) +{ +#if defined(__LZO_UINTPTR_T_IS_POINTER) + size_t n = (size_t) ptr; + n = (((n + size - 1) / size) * size) - n; +#else + lzo_uintptr_t p, n; + p = __lzo_ptr_linear(ptr); + n = (((p + size - 1) / size) * size) - p; +#endif + + assert(size > 0); + assert((long)n >= 0); + assert(n <= size); + return (unsigned)n; +} + +#endif + +/* If you use the LZO library in a product, I would appreciate that you + * keep this copyright string in the executable of your product. + */ + +const char __lzo_copyright[] = +#if !defined(__LZO_IN_MINLZO) + LZO_VERSION_STRING; +#else + "\r\n\n" + "LZO data compression library.\n" + "$Copyright: LZO (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Markus Franz Xaver Johannes Oberhumer\n" + "\n" + "http://www.oberhumer.com $\n\n" + "$Id: LZO version: v" LZO_VERSION_STRING ", " LZO_VERSION_DATE " $\n" + "$Built: " __DATE__ " " __TIME__ " $\n" + "$Info: " LZO_INFO_STRING " $\n"; +#endif + +LZO_PUBLIC(const lzo_bytep) +lzo_copyright(void) +{ +#if (LZO_OS_DOS16 && LZO_CC_TURBOC) + return (lzo_voidp) __lzo_copyright; +#else + return (const lzo_bytep) __lzo_copyright; +#endif +} + +LZO_PUBLIC(unsigned) +lzo_version(void) +{ + return LZO_VERSION; +} + +LZO_PUBLIC(const char *) +lzo_version_string(void) +{ + return LZO_VERSION_STRING; +} + +LZO_PUBLIC(const char *) +lzo_version_date(void) +{ + return LZO_VERSION_DATE; +} + +LZO_PUBLIC(const lzo_charp) +_lzo_version_string(void) +{ + return LZO_VERSION_STRING; +} + +LZO_PUBLIC(const lzo_charp) +_lzo_version_date(void) +{ + return LZO_VERSION_DATE; +} + +#define LZO_BASE 65521u +#define LZO_NMAX 5552 + +#define LZO_DO1(buf,i) s1 += buf[i]; s2 += s1 +#define LZO_DO2(buf,i) LZO_DO1(buf,i); LZO_DO1(buf,i+1); +#define LZO_DO4(buf,i) LZO_DO2(buf,i); LZO_DO2(buf,i+2); +#define LZO_DO8(buf,i) LZO_DO4(buf,i); LZO_DO4(buf,i+4); +#define LZO_DO16(buf,i) LZO_DO8(buf,i); LZO_DO8(buf,i+8); + +LZO_PUBLIC(lzo_uint32) +lzo_adler32(lzo_uint32 adler, const lzo_bytep buf, lzo_uint len) +{ + lzo_uint32 s1 = adler & 0xffff; + lzo_uint32 s2 = (adler >> 16) & 0xffff; + unsigned k; + + if (buf == NULL) + return 1; + + while (len > 0) + { + k = len < LZO_NMAX ? (unsigned) len : LZO_NMAX; + len -= k; + if (k >= 16) do + { + LZO_DO16(buf,0); + buf += 16; + k -= 16; + } while (k >= 16); + if (k != 0) do + { + s1 += *buf++; + s2 += s1; + } while (--k > 0); + s1 %= LZO_BASE; + s2 %= LZO_BASE; + } + return (s2 << 16) | s1; +} + +#undef LZO_DO1 +#undef LZO_DO2 +#undef LZO_DO4 +#undef LZO_DO8 +#undef LZO_DO16 + +#if !defined(MINILZO_CFG_SKIP_LZO_STRING) +#undef lzo_memcmp +#undef lzo_memcpy +#undef lzo_memmove +#undef lzo_memset +#if !defined(__LZO_MMODEL_HUGE) +# undef LZO_HAVE_MM_HUGE_PTR +#endif +#define lzo_hsize_t lzo_uint +#define lzo_hvoid_p lzo_voidp +#define lzo_hbyte_p lzo_bytep +#define LZOLIB_PUBLIC(r,f) LZO_PUBLIC(r) f +#define lzo_hmemcmp lzo_memcmp +#define lzo_hmemcpy lzo_memcpy +#define lzo_hmemmove lzo_memmove +#define lzo_hmemset lzo_memset +#define __LZOLIB_HMEMCPY_CH_INCLUDED 1 +#if !defined(LZOLIB_PUBLIC) +# define LZOLIB_PUBLIC(r,f) r __LZOLIB_FUNCNAME(f) +#endif +LZOLIB_PUBLIC(int, lzo_hmemcmp) (const lzo_hvoid_p s1, const lzo_hvoid_p s2, lzo_hsize_t len) +{ +#if (LZO_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMCMP) + const lzo_hbyte_p p1 = (const lzo_hbyte_p) s1; + const lzo_hbyte_p p2 = (const lzo_hbyte_p) s2; + if __lzo_likely(len > 0) do + { + int d = *p1 - *p2; + if (d != 0) + return d; + p1++; p2++; + } while __lzo_likely(--len > 0); + return 0; +#else + return memcmp(s1, s2, len); +#endif +} +LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemcpy) (lzo_hvoid_p dest, const lzo_hvoid_p src, lzo_hsize_t len) +{ +#if (LZO_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMCPY) + lzo_hbyte_p p1 = (lzo_hbyte_p) dest; + const lzo_hbyte_p p2 = (const lzo_hbyte_p) src; + if (!(len > 0) || p1 == p2) + return dest; + do + *p1++ = *p2++; + while __lzo_likely(--len > 0); + return dest; +#else + return memcpy(dest, src, len); +#endif +} +LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemmove) (lzo_hvoid_p dest, const lzo_hvoid_p src, lzo_hsize_t len) +{ +#if (LZO_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMMOVE) + lzo_hbyte_p p1 = (lzo_hbyte_p) dest; + const lzo_hbyte_p p2 = (const lzo_hbyte_p) src; + if (!(len > 0) || p1 == p2) + return dest; + if (p1 < p2) + { + do + *p1++ = *p2++; + while __lzo_likely(--len > 0); + } + else + { + p1 += len; + p2 += len; + do + *--p1 = *--p2; + while __lzo_likely(--len > 0); + } + return dest; +#else + return memmove(dest, src, len); +#endif +} +LZOLIB_PUBLIC(lzo_hvoid_p, lzo_hmemset) (lzo_hvoid_p s, int c, lzo_hsize_t len) +{ +#if (LZO_HAVE_MM_HUGE_PTR) || !defined(HAVE_MEMSET) + lzo_hbyte_p p = (lzo_hbyte_p) s; + if __lzo_likely(len > 0) do + *p++ = (unsigned char) c; + while __lzo_likely(--len > 0); + return s; +#else + return memset(s, c, len); +#endif +} +#undef LZOLIB_PUBLIC +#endif + +#if !defined(__LZO_IN_MINILZO) + +#define ACC_WANT_ACC_CHK_CH 1 +#undef ACCCHK_ASSERT + + ACCCHK_ASSERT_IS_SIGNED_T(lzo_int) + ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uint) + + ACCCHK_ASSERT_IS_SIGNED_T(lzo_int32) + ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uint32) + ACCCHK_ASSERT((LZO_UINT32_C(1) << (int)(8*sizeof(LZO_UINT32_C(1))-1)) > 0) + ACCCHK_ASSERT(sizeof(lzo_uint32) >= 4) + +#if !defined(__LZO_UINTPTR_T_IS_POINTER) + ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_uintptr_t) +#endif + ACCCHK_ASSERT(sizeof(lzo_uintptr_t) >= sizeof(lzo_voidp)) + + ACCCHK_ASSERT_IS_UNSIGNED_T(lzo_xint) + ACCCHK_ASSERT(sizeof(lzo_xint) >= sizeof(lzo_uint32)) + ACCCHK_ASSERT(sizeof(lzo_xint) >= sizeof(lzo_uint)) + ACCCHK_ASSERT(sizeof(lzo_xint) == sizeof(lzo_uint32) || sizeof(lzo_xint) == sizeof(lzo_uint)) + +#endif +#undef ACCCHK_ASSERT + +LZO_PUBLIC(int) +_lzo_config_check(void) +{ + lzo_bool r = 1; + union { unsigned char c[2*sizeof(lzo_xint)]; lzo_xint l[2]; } u; + lzo_uintptr_t p; + +#if !defined(LZO_CFG_NO_CONFIG_CHECK) +#if defined(LZO_ABI_BIG_ENDIAN) + u.l[0] = u.l[1] = 0; u.c[sizeof(lzo_xint) - 1] = 128; + r &= (u.l[0] == 128); +#endif +#if defined(LZO_ABI_LITTLE_ENDIAN) + u.l[0] = u.l[1] = 0; u.c[0] = 128; + r &= (u.l[0] == 128); +#endif +#if defined(LZO_UNALIGNED_OK_2) + p = (lzo_uintptr_t) (const lzo_voidp) &u.c[0]; + u.l[0] = u.l[1] = 0; + r &= ((* (const lzo_ushortp) (p+1)) == 0); +#endif +#if defined(LZO_UNALIGNED_OK_4) + p = (lzo_uintptr_t) (const lzo_voidp) &u.c[0]; + u.l[0] = u.l[1] = 0; + r &= ((* (const lzo_uint32p) (p+1)) == 0); +#endif +#endif + + LZO_UNUSED(u); LZO_UNUSED(p); + return r == 1 ? LZO_E_OK : LZO_E_ERROR; +} + +int __lzo_init_done = 0; + +LZO_PUBLIC(int) +__lzo_init_v2(unsigned v, int s1, int s2, int s3, int s4, int s5, + int s6, int s7, int s8, int s9) +{ + int r; + +#if defined(__LZO_IN_MINILZO) +#elif (LZO_CC_MSC && ((_MSC_VER) < 700)) +#else +#define ACC_WANT_ACC_CHK_CH 1 +#undef ACCCHK_ASSERT +#define ACCCHK_ASSERT(expr) LZO_COMPILE_TIME_ASSERT(expr) +#endif +#undef ACCCHK_ASSERT + + __lzo_init_done = 1; + + if (v == 0) + return LZO_E_ERROR; + + r = (s1 == -1 || s1 == (int) sizeof(short)) && + (s2 == -1 || s2 == (int) sizeof(int)) && + (s3 == -1 || s3 == (int) sizeof(long)) && + (s4 == -1 || s4 == (int) sizeof(lzo_uint32)) && + (s5 == -1 || s5 == (int) sizeof(lzo_uint)) && + (s6 == -1 || s6 == (int) lzo_sizeof_dict_t) && + (s7 == -1 || s7 == (int) sizeof(char *)) && + (s8 == -1 || s8 == (int) sizeof(lzo_voidp)) && + (s9 == -1 || s9 == (int) sizeof(lzo_callback_t)); + if (!r) + return LZO_E_ERROR; + + r = _lzo_config_check(); + if (r != LZO_E_OK) + return r; + + return r; +} + +#if !defined(__LZO_IN_MINILZO) + +#if (LZO_OS_WIN16 && LZO_CC_WATCOMC) && defined(__SW_BD) + +#if 0 +BOOL FAR PASCAL LibMain ( HANDLE hInstance, WORD wDataSegment, + WORD wHeapSize, LPSTR lpszCmdLine ) +#else +int __far __pascal LibMain ( int a, short b, short c, long d ) +#endif +{ + LZO_UNUSED(a); LZO_UNUSED(b); LZO_UNUSED(c); LZO_UNUSED(d); + return 1; +} + +#endif + +#endif + +#define do_compress _lzo1x_1_do_compress + +#if !defined(MINILZO_CFG_SKIP_LZO1X_1_COMPRESS) + +#define LZO_NEED_DICT_H +#define D_BITS 14 +#define D_INDEX1(d,p) d = DM(DMUL(0x21,DX3(p,5,5,6)) >> 5) +#define D_INDEX2(d,p) d = (d & (D_MASK & 0x7ff)) ^ (D_HIGH | 0x1f) + +#ifndef __LZO_CONFIG1X_H +#define __LZO_CONFIG1X_H + +#if !defined(LZO1X) && !defined(LZO1Y) && !defined(LZO1Z) +# define LZO1X +#endif + +#if !defined(__LZO_IN_MINILZO) +#include "lzo/lzo1x.h" +#endif + +#define LZO_EOF_CODE +#undef LZO_DETERMINISTIC + +#define M1_MAX_OFFSET 0x0400 +#ifndef M2_MAX_OFFSET +#define M2_MAX_OFFSET 0x0800 +#endif +#define M3_MAX_OFFSET 0x4000 +#define M4_MAX_OFFSET 0xbfff + +#define MX_MAX_OFFSET (M1_MAX_OFFSET + M2_MAX_OFFSET) + +#define M1_MIN_LEN 2 +#define M1_MAX_LEN 2 +#define M2_MIN_LEN 3 +#ifndef M2_MAX_LEN +#define M2_MAX_LEN 8 +#endif +#define M3_MIN_LEN 3 +#define M3_MAX_LEN 33 +#define M4_MIN_LEN 3 +#define M4_MAX_LEN 9 + +#define M1_MARKER 0 +#define M2_MARKER 64 +#define M3_MARKER 32 +#define M4_MARKER 16 + +#ifndef MIN_LOOKAHEAD +#define MIN_LOOKAHEAD (M2_MAX_LEN + 1) +#endif + +#if defined(LZO_NEED_DICT_H) + +#ifndef LZO_HASH +#define LZO_HASH LZO_HASH_LZO_INCREMENTAL_B +#endif +#define DL_MIN_LEN M2_MIN_LEN + +#ifndef __LZO_DICT_H +#define __LZO_DICT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(D_BITS) && defined(DBITS) +# define D_BITS DBITS +#endif +#if !defined(D_BITS) +# error "D_BITS is not defined" +#endif +#if (D_BITS < 16) +# define D_SIZE LZO_SIZE(D_BITS) +# define D_MASK LZO_MASK(D_BITS) +#else +# define D_SIZE LZO_USIZE(D_BITS) +# define D_MASK LZO_UMASK(D_BITS) +#endif +#define D_HIGH ((D_MASK >> 1) + 1) + +#if !defined(DD_BITS) +# define DD_BITS 0 +#endif +#define DD_SIZE LZO_SIZE(DD_BITS) +#define DD_MASK LZO_MASK(DD_BITS) + +#if !defined(DL_BITS) +# define DL_BITS (D_BITS - DD_BITS) +#endif +#if (DL_BITS < 16) +# define DL_SIZE LZO_SIZE(DL_BITS) +# define DL_MASK LZO_MASK(DL_BITS) +#else +# define DL_SIZE LZO_USIZE(DL_BITS) +# define DL_MASK LZO_UMASK(DL_BITS) +#endif + +#if (D_BITS != DL_BITS + DD_BITS) +# error "D_BITS does not match" +#endif +#if (D_BITS < 8 || D_BITS > 18) +# error "invalid D_BITS" +#endif +#if (DL_BITS < 8 || DL_BITS > 20) +# error "invalid DL_BITS" +#endif +#if (DD_BITS < 0 || DD_BITS > 6) +# error "invalid DD_BITS" +#endif + +#if !defined(DL_MIN_LEN) +# define DL_MIN_LEN 3 +#endif +#if !defined(DL_SHIFT) +# define DL_SHIFT ((DL_BITS + (DL_MIN_LEN - 1)) / DL_MIN_LEN) +#endif + +#define LZO_HASH_GZIP 1 +#define LZO_HASH_GZIP_INCREMENTAL 2 +#define LZO_HASH_LZO_INCREMENTAL_A 3 +#define LZO_HASH_LZO_INCREMENTAL_B 4 + +#if !defined(LZO_HASH) +# error "choose a hashing strategy" +#endif + +#undef DM +#undef DX + +#if (DL_MIN_LEN == 3) +# define _DV2_A(p,shift1,shift2) \ + (((( (lzo_xint)((p)[0]) << shift1) ^ (p)[1]) << shift2) ^ (p)[2]) +# define _DV2_B(p,shift1,shift2) \ + (((( (lzo_xint)((p)[2]) << shift1) ^ (p)[1]) << shift2) ^ (p)[0]) +# define _DV3_B(p,shift1,shift2,shift3) \ + ((_DV2_B((p)+1,shift1,shift2) << (shift3)) ^ (p)[0]) +#elif (DL_MIN_LEN == 2) +# define _DV2_A(p,shift1,shift2) \ + (( (lzo_xint)(p[0]) << shift1) ^ p[1]) +# define _DV2_B(p,shift1,shift2) \ + (( (lzo_xint)(p[1]) << shift1) ^ p[2]) +#else +# error "invalid DL_MIN_LEN" +#endif +#define _DV_A(p,shift) _DV2_A(p,shift,shift) +#define _DV_B(p,shift) _DV2_B(p,shift,shift) +#define DA2(p,s1,s2) \ + (((((lzo_xint)((p)[2]) << (s2)) + (p)[1]) << (s1)) + (p)[0]) +#define DS2(p,s1,s2) \ + (((((lzo_xint)((p)[2]) << (s2)) - (p)[1]) << (s1)) - (p)[0]) +#define DX2(p,s1,s2) \ + (((((lzo_xint)((p)[2]) << (s2)) ^ (p)[1]) << (s1)) ^ (p)[0]) +#define DA3(p,s1,s2,s3) ((DA2((p)+1,s2,s3) << (s1)) + (p)[0]) +#define DS3(p,s1,s2,s3) ((DS2((p)+1,s2,s3) << (s1)) - (p)[0]) +#define DX3(p,s1,s2,s3) ((DX2((p)+1,s2,s3) << (s1)) ^ (p)[0]) +#define DMS(v,s) ((lzo_uint) (((v) & (D_MASK >> (s))) << (s))) +#define DM(v) DMS(v,0) + +#if (LZO_HASH == LZO_HASH_GZIP) +# define _DINDEX(dv,p) (_DV_A((p),DL_SHIFT)) + +#elif (LZO_HASH == LZO_HASH_GZIP_INCREMENTAL) +# define __LZO_HASH_INCREMENTAL +# define DVAL_FIRST(dv,p) dv = _DV_A((p),DL_SHIFT) +# define DVAL_NEXT(dv,p) dv = (((dv) << DL_SHIFT) ^ p[2]) +# define _DINDEX(dv,p) (dv) +# define DVAL_LOOKAHEAD DL_MIN_LEN + +#elif (LZO_HASH == LZO_HASH_LZO_INCREMENTAL_A) +# define __LZO_HASH_INCREMENTAL +# define DVAL_FIRST(dv,p) dv = _DV_A((p),5) +# define DVAL_NEXT(dv,p) \ + dv ^= (lzo_xint)(p[-1]) << (2*5); dv = (((dv) << 5) ^ p[2]) +# define _DINDEX(dv,p) ((DMUL(0x9f5f,dv)) >> 5) +# define DVAL_LOOKAHEAD DL_MIN_LEN + +#elif (LZO_HASH == LZO_HASH_LZO_INCREMENTAL_B) +# define __LZO_HASH_INCREMENTAL +# define DVAL_FIRST(dv,p) dv = _DV_B((p),5) +# define DVAL_NEXT(dv,p) \ + dv ^= p[-1]; dv = (((dv) >> 5) ^ ((lzo_xint)(p[2]) << (2*5))) +# define _DINDEX(dv,p) ((DMUL(0x9f5f,dv)) >> 5) +# define DVAL_LOOKAHEAD DL_MIN_LEN + +#else +# error "choose a hashing strategy" +#endif + +#ifndef DINDEX +#define DINDEX(dv,p) ((lzo_uint)((_DINDEX(dv,p)) & DL_MASK) << DD_BITS) +#endif +#if !defined(DINDEX1) && defined(D_INDEX1) +#define DINDEX1 D_INDEX1 +#endif +#if !defined(DINDEX2) && defined(D_INDEX2) +#define DINDEX2 D_INDEX2 +#endif + +#if !defined(__LZO_HASH_INCREMENTAL) +# define DVAL_FIRST(dv,p) ((void) 0) +# define DVAL_NEXT(dv,p) ((void) 0) +# define DVAL_LOOKAHEAD 0 +#endif + +#if !defined(DVAL_ASSERT) +#if defined(__LZO_HASH_INCREMENTAL) && !defined(NDEBUG) +static void DVAL_ASSERT(lzo_xint dv, const lzo_bytep p) +{ + lzo_xint df; + DVAL_FIRST(df,(p)); + assert(DINDEX(dv,p) == DINDEX(df,p)); +} +#else +# define DVAL_ASSERT(dv,p) ((void) 0) +#endif +#endif + +#if defined(LZO_DICT_USE_PTR) +# define DENTRY(p,in) (p) +# define GINDEX(m_pos,m_off,dict,dindex,in) m_pos = dict[dindex] +#else +# define DENTRY(p,in) ((lzo_uint) ((p)-(in))) +# define GINDEX(m_pos,m_off,dict,dindex,in) m_off = dict[dindex] +#endif + +#if (DD_BITS == 0) + +# define UPDATE_D(dict,drun,dv,p,in) dict[ DINDEX(dv,p) ] = DENTRY(p,in) +# define UPDATE_I(dict,drun,index,p,in) dict[index] = DENTRY(p,in) +# define UPDATE_P(ptr,drun,p,in) (ptr)[0] = DENTRY(p,in) + +#else + +# define UPDATE_D(dict,drun,dv,p,in) \ + dict[ DINDEX(dv,p) + drun++ ] = DENTRY(p,in); drun &= DD_MASK +# define UPDATE_I(dict,drun,index,p,in) \ + dict[ (index) + drun++ ] = DENTRY(p,in); drun &= DD_MASK +# define UPDATE_P(ptr,drun,p,in) \ + (ptr) [ drun++ ] = DENTRY(p,in); drun &= DD_MASK + +#endif + +#if defined(LZO_DICT_USE_PTR) + +#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \ + (m_pos == NULL || (m_off = pd(ip, m_pos)) > max_offset) + +#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \ + (BOUNDS_CHECKING_OFF_IN_EXPR(( \ + m_pos = ip - (lzo_uint) PTR_DIFF(ip,m_pos), \ + PTR_LT(m_pos,in) || \ + (m_off = (lzo_uint) PTR_DIFF(ip,m_pos)) <= 0 || \ + m_off > max_offset ))) + +#else + +#define LZO_CHECK_MPOS_DET(m_pos,m_off,in,ip,max_offset) \ + (m_off == 0 || \ + ((m_off = pd(ip, in) - m_off) > max_offset) || \ + (m_pos = (ip) - (m_off), 0) ) + +#define LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,max_offset) \ + (pd(ip, in) <= m_off || \ + ((m_off = pd(ip, in) - m_off) > max_offset) || \ + (m_pos = (ip) - (m_off), 0) ) + +#endif + +#if defined(LZO_DETERMINISTIC) +# define LZO_CHECK_MPOS LZO_CHECK_MPOS_DET +#else +# define LZO_CHECK_MPOS LZO_CHECK_MPOS_NON_DET +#endif + +#ifdef __cplusplus +} +#endif + +#endif + +#endif + +#endif + +#define DO_COMPRESS lzo1x_1_compress + +static __lzo_noinline lzo_uint +do_compress ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + register const lzo_bytep ip; + lzo_bytep op; + const lzo_bytep const in_end = in + in_len; + const lzo_bytep const ip_end = in + in_len - M2_MAX_LEN - 5; + const lzo_bytep ii; + lzo_dict_p const dict = (lzo_dict_p) wrkmem; + + op = out; + ip = in; + ii = ip; + + ip += 4; + for (;;) + { + register const lzo_bytep m_pos; + lzo_uint m_off; + lzo_uint m_len; + lzo_uint dindex; + + DINDEX1(dindex,ip); + GINDEX(m_pos,m_off,dict,dindex,in); + if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M4_MAX_OFFSET)) + goto literal; +#if 1 + if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3]) + goto try_match; + DINDEX2(dindex,ip); +#endif + GINDEX(m_pos,m_off,dict,dindex,in); + if (LZO_CHECK_MPOS_NON_DET(m_pos,m_off,in,ip,M4_MAX_OFFSET)) + goto literal; + if (m_off <= M2_MAX_OFFSET || m_pos[3] == ip[3]) + goto try_match; + goto literal; + +try_match: +#if 1 && defined(LZO_UNALIGNED_OK_2) + if (* (const lzo_ushortp) m_pos != * (const lzo_ushortp) ip) +#else + if (m_pos[0] != ip[0] || m_pos[1] != ip[1]) +#endif + { + } + else + { + if __lzo_likely(m_pos[2] == ip[2]) + { +#if 0 + if (m_off <= M2_MAX_OFFSET) + goto match; + if (lit <= 3) + goto match; + if (lit == 3) + { + assert(op - 2 > out); op[-2] |= LZO_BYTE(3); + *op++ = *ii++; *op++ = *ii++; *op++ = *ii++; + goto code_match; + } + if (m_pos[3] == ip[3]) +#endif + goto match; + } + else + { +#if 0 +#if 0 + if (m_off <= M1_MAX_OFFSET && lit > 0 && lit <= 3) +#else + if (m_off <= M1_MAX_OFFSET && lit == 3) +#endif + { + register lzo_uint t; + + t = lit; + assert(op - 2 > out); op[-2] |= LZO_BYTE(t); + do *op++ = *ii++; while (--t > 0); + assert(ii == ip); + m_off -= 1; + *op++ = LZO_BYTE(M1_MARKER | ((m_off & 3) << 2)); + *op++ = LZO_BYTE(m_off >> 2); + ip += 2; + goto match_done; + } +#endif + } + } + +literal: + UPDATE_I(dict,0,dindex,ip,in); + ++ip; + if __lzo_unlikely(ip >= ip_end) + break; + continue; + +match: + UPDATE_I(dict,0,dindex,ip,in); + if (pd(ip,ii) > 0) + { + register lzo_uint t = pd(ip,ii); + + if (t <= 3) + { + assert(op - 2 > out); + op[-2] |= LZO_BYTE(t); + } + else if (t <= 18) + *op++ = LZO_BYTE(t - 3); + else + { + register lzo_uint tt = t - 18; + + *op++ = 0; + while (tt > 255) + { + tt -= 255; + *op++ = 0; + } + assert(tt > 0); + *op++ = LZO_BYTE(tt); + } + do *op++ = *ii++; while (--t > 0); + } + + assert(ii == ip); + ip += 3; + if (m_pos[3] != *ip++ || m_pos[4] != *ip++ || m_pos[5] != *ip++ || + m_pos[6] != *ip++ || m_pos[7] != *ip++ || m_pos[8] != *ip++ +#ifdef LZO1Y + || m_pos[ 9] != *ip++ || m_pos[10] != *ip++ || m_pos[11] != *ip++ + || m_pos[12] != *ip++ || m_pos[13] != *ip++ || m_pos[14] != *ip++ +#endif + ) + { + --ip; + m_len = pd(ip, ii); + assert(m_len >= 3); assert(m_len <= M2_MAX_LEN); + + if (m_off <= M2_MAX_OFFSET) + { + m_off -= 1; +#if defined(LZO1X) + *op++ = LZO_BYTE(((m_len - 1) << 5) | ((m_off & 7) << 2)); + *op++ = LZO_BYTE(m_off >> 3); +#elif defined(LZO1Y) + *op++ = LZO_BYTE(((m_len + 1) << 4) | ((m_off & 3) << 2)); + *op++ = LZO_BYTE(m_off >> 2); +#endif + } + else if (m_off <= M3_MAX_OFFSET) + { + m_off -= 1; + *op++ = LZO_BYTE(M3_MARKER | (m_len - 2)); + goto m3_m4_offset; + } + else +#if defined(LZO1X) + { + m_off -= 0x4000; + assert(m_off > 0); assert(m_off <= 0x7fff); + *op++ = LZO_BYTE(M4_MARKER | + ((m_off & 0x4000) >> 11) | (m_len - 2)); + goto m3_m4_offset; + } +#elif defined(LZO1Y) + goto m4_match; +#endif + } + else + { + { + const lzo_bytep end = in_end; + const lzo_bytep m = m_pos + M2_MAX_LEN + 1; + while (ip < end && *m == *ip) + m++, ip++; + m_len = pd(ip, ii); + } + assert(m_len > M2_MAX_LEN); + + if (m_off <= M3_MAX_OFFSET) + { + m_off -= 1; + if (m_len <= 33) + *op++ = LZO_BYTE(M3_MARKER | (m_len - 2)); + else + { + m_len -= 33; + *op++ = M3_MARKER | 0; + goto m3_m4_len; + } + } + else + { +#if defined(LZO1Y) +m4_match: +#endif + m_off -= 0x4000; + assert(m_off > 0); assert(m_off <= 0x7fff); + if (m_len <= M4_MAX_LEN) + *op++ = LZO_BYTE(M4_MARKER | + ((m_off & 0x4000) >> 11) | (m_len - 2)); + else + { + m_len -= M4_MAX_LEN; + *op++ = LZO_BYTE(M4_MARKER | ((m_off & 0x4000) >> 11)); +m3_m4_len: + while (m_len > 255) + { + m_len -= 255; + *op++ = 0; + } + assert(m_len > 0); + *op++ = LZO_BYTE(m_len); + } + } + +m3_m4_offset: + *op++ = LZO_BYTE((m_off & 63) << 2); + *op++ = LZO_BYTE(m_off >> 6); + } + +#if 0 +match_done: +#endif + ii = ip; + if __lzo_unlikely(ip >= ip_end) + break; + } + + *out_len = pd(op, out); + return pd(in_end,ii); +} + +LZO_PUBLIC(int) +DO_COMPRESS ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +{ + lzo_bytep op = out; + lzo_uint t; + + if __lzo_unlikely(in_len <= M2_MAX_LEN + 5) + t = in_len; + else + { + t = do_compress(in,in_len,op,out_len,wrkmem); + op += *out_len; + } + + if (t > 0) + { + const lzo_bytep ii = in + in_len - t; + + if (op == out && t <= 238) + *op++ = LZO_BYTE(17 + t); + else if (t <= 3) + op[-2] |= LZO_BYTE(t); + else if (t <= 18) + *op++ = LZO_BYTE(t - 3); + else + { + lzo_uint tt = t - 18; + + *op++ = 0; + while (tt > 255) + { + tt -= 255; + *op++ = 0; + } + assert(tt > 0); + *op++ = LZO_BYTE(tt); + } + do *op++ = *ii++; while (--t > 0); + } + + *op++ = M4_MARKER | 1; + *op++ = 0; + *op++ = 0; + + *out_len = pd(op, out); + return LZO_E_OK; +} + +#endif + +#undef do_compress +#undef DO_COMPRESS +#undef LZO_HASH + +#undef LZO_TEST_OVERRUN +#undef DO_DECOMPRESS +#define DO_DECOMPRESS lzo1x_decompress + +#if !defined(MINILZO_CFG_SKIP_LZO1X_DECOMPRESS) + +#if defined(LZO_TEST_OVERRUN) +# if !defined(LZO_TEST_OVERRUN_INPUT) +# define LZO_TEST_OVERRUN_INPUT 2 +# endif +# if !defined(LZO_TEST_OVERRUN_OUTPUT) +# define LZO_TEST_OVERRUN_OUTPUT 2 +# endif +# if !defined(LZO_TEST_OVERRUN_LOOKBEHIND) +# define LZO_TEST_OVERRUN_LOOKBEHIND +# endif +#endif + +#undef TEST_IP +#undef TEST_OP +#undef TEST_LB +#undef TEST_LBO +#undef NEED_IP +#undef NEED_OP +#undef HAVE_TEST_IP +#undef HAVE_TEST_OP +#undef HAVE_NEED_IP +#undef HAVE_NEED_OP +#undef HAVE_ANY_IP +#undef HAVE_ANY_OP + +#if defined(LZO_TEST_OVERRUN_INPUT) +# if (LZO_TEST_OVERRUN_INPUT >= 1) +# define TEST_IP (ip < ip_end) +# endif +# if (LZO_TEST_OVERRUN_INPUT >= 2) +# define NEED_IP(x) \ + if ((lzo_uint)(ip_end - ip) < (lzo_uint)(x)) goto input_overrun +# endif +#endif + +#if defined(LZO_TEST_OVERRUN_OUTPUT) +# if (LZO_TEST_OVERRUN_OUTPUT >= 1) +# define TEST_OP (op <= op_end) +# endif +# if (LZO_TEST_OVERRUN_OUTPUT >= 2) +# undef TEST_OP +# define NEED_OP(x) \ + if ((lzo_uint)(op_end - op) < (lzo_uint)(x)) goto output_overrun +# endif +#endif + +#if defined(LZO_TEST_OVERRUN_LOOKBEHIND) +# define TEST_LB(m_pos) if (m_pos < out || m_pos >= op) goto lookbehind_overrun +# define TEST_LBO(m_pos,o) if (m_pos < out || m_pos >= op - (o)) goto lookbehind_overrun +#else +# define TEST_LB(m_pos) ((void) 0) +# define TEST_LBO(m_pos,o) ((void) 0) +#endif + +#if !defined(LZO_EOF_CODE) && !defined(TEST_IP) +# define TEST_IP (ip < ip_end) +#endif + +#if defined(TEST_IP) +# define HAVE_TEST_IP +#else +# define TEST_IP 1 +#endif +#if defined(TEST_OP) +# define HAVE_TEST_OP +#else +# define TEST_OP 1 +#endif + +#if defined(NEED_IP) +# define HAVE_NEED_IP +#else +# define NEED_IP(x) ((void) 0) +#endif +#if defined(NEED_OP) +# define HAVE_NEED_OP +#else +# define NEED_OP(x) ((void) 0) +#endif + +#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP) +# define HAVE_ANY_IP +#endif +#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP) +# define HAVE_ANY_OP +#endif + +#undef __COPY4 +#define __COPY4(dst,src) * (lzo_uint32p)(dst) = * (const lzo_uint32p)(src) + +#undef COPY4 +#if defined(LZO_UNALIGNED_OK_4) +# define COPY4(dst,src) __COPY4(dst,src) +#elif defined(LZO_ALIGNED_OK_4) +# define COPY4(dst,src) __COPY4((lzo_uintptr_t)(dst),(lzo_uintptr_t)(src)) +#endif + +#if defined(DO_DECOMPRESS) +LZO_PUBLIC(int) +DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +#endif +{ + register lzo_bytep op; + register const lzo_bytep ip; + register lzo_uint t; +#if defined(COPY_DICT) + lzo_uint m_off; + const lzo_bytep dict_end; +#else + register const lzo_bytep m_pos; +#endif + + const lzo_bytep const ip_end = in + in_len; +#if defined(HAVE_ANY_OP) + lzo_bytep const op_end = out + *out_len; +#endif +#if defined(LZO1Z) + lzo_uint last_m_off = 0; +#endif + + LZO_UNUSED(wrkmem); + +#if defined(COPY_DICT) + if (dict) + { + if (dict_len > M4_MAX_OFFSET) + { + dict += dict_len - M4_MAX_OFFSET; + dict_len = M4_MAX_OFFSET; + } + dict_end = dict + dict_len; + } + else + { + dict_len = 0; + dict_end = NULL; + } +#endif + + *out_len = 0; + + op = out; + ip = in; + + if (*ip > 17) + { + t = *ip++ - 17; + if (t < 4) + goto match_next; + assert(t > 0); NEED_OP(t); NEED_IP(t+1); + do *op++ = *ip++; while (--t > 0); + goto first_literal_run; + } + + while (TEST_IP && TEST_OP) + { + t = *ip++; + if (t >= 16) + goto match; + if (t == 0) + { + NEED_IP(1); + while (*ip == 0) + { + t += 255; + ip++; + NEED_IP(1); + } + t += 15 + *ip++; + } + assert(t > 0); NEED_OP(t+3); NEED_IP(t+4); +#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4) +#if !defined(LZO_UNALIGNED_OK_4) + if (PTR_ALIGNED2_4(op,ip)) + { +#endif + COPY4(op,ip); + op += 4; ip += 4; + if (--t > 0) + { + if (t >= 4) + { + do { + COPY4(op,ip); + op += 4; ip += 4; t -= 4; + } while (t >= 4); + if (t > 0) do *op++ = *ip++; while (--t > 0); + } + else + do *op++ = *ip++; while (--t > 0); + } +#if !defined(LZO_UNALIGNED_OK_4) + } + else +#endif +#endif +#if !defined(LZO_UNALIGNED_OK_4) + { + *op++ = *ip++; *op++ = *ip++; *op++ = *ip++; + do *op++ = *ip++; while (--t > 0); + } +#endif + +first_literal_run: + + t = *ip++; + if (t >= 16) + goto match; +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2); + last_m_off = m_off; +#else + m_off = (1 + M2_MAX_OFFSET) + (t >> 2) + (*ip++ << 2); +#endif + NEED_OP(3); + t = 3; COPY_DICT(t,m_off) +#else +#if defined(LZO1Z) + t = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2); + m_pos = op - t; + last_m_off = t; +#else + m_pos = op - (1 + M2_MAX_OFFSET); + m_pos -= t >> 2; + m_pos -= *ip++ << 2; +#endif + TEST_LB(m_pos); NEED_OP(3); + *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos; +#endif + goto match_done; + + do { +match: + if (t >= 64) + { +#if defined(COPY_DICT) +#if defined(LZO1X) + m_off = 1 + ((t >> 2) & 7) + (*ip++ << 3); + t = (t >> 5) - 1; +#elif defined(LZO1Y) + m_off = 1 + ((t >> 2) & 3) + (*ip++ << 2); + t = (t >> 4) - 3; +#elif defined(LZO1Z) + m_off = t & 0x1f; + if (m_off >= 0x1c) + m_off = last_m_off; + else + { + m_off = 1 + (m_off << 6) + (*ip++ >> 2); + last_m_off = m_off; + } + t = (t >> 5) - 1; +#endif +#else +#if defined(LZO1X) + m_pos = op - 1; + m_pos -= (t >> 2) & 7; + m_pos -= *ip++ << 3; + t = (t >> 5) - 1; +#elif defined(LZO1Y) + m_pos = op - 1; + m_pos -= (t >> 2) & 3; + m_pos -= *ip++ << 2; + t = (t >> 4) - 3; +#elif defined(LZO1Z) + { + lzo_uint off = t & 0x1f; + m_pos = op; + if (off >= 0x1c) + { + assert(last_m_off > 0); + m_pos -= last_m_off; + } + else + { + off = 1 + (off << 6) + (*ip++ >> 2); + m_pos -= off; + last_m_off = off; + } + } + t = (t >> 5) - 1; +#endif + TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1); + goto copy_match; +#endif + } + else if (t >= 32) + { + t &= 31; + if (t == 0) + { + NEED_IP(1); + while (*ip == 0) + { + t += 255; + ip++; + NEED_IP(1); + } + t += 31 + *ip++; + } +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off = 1 + (ip[0] << 6) + (ip[1] >> 2); + last_m_off = m_off; +#else + m_off = 1 + (ip[0] >> 2) + (ip[1] << 6); +#endif +#else +#if defined(LZO1Z) + { + lzo_uint off = 1 + (ip[0] << 6) + (ip[1] >> 2); + m_pos = op - off; + last_m_off = off; + } +#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN) + m_pos = op - 1; + m_pos -= (* (const lzo_ushortp) ip) >> 2; +#else + m_pos = op - 1; + m_pos -= (ip[0] >> 2) + (ip[1] << 6); +#endif +#endif + ip += 2; + } + else if (t >= 16) + { +#if defined(COPY_DICT) + m_off = (t & 8) << 11; +#else + m_pos = op; + m_pos -= (t & 8) << 11; +#endif + t &= 7; + if (t == 0) + { + NEED_IP(1); + while (*ip == 0) + { + t += 255; + ip++; + NEED_IP(1); + } + t += 7 + *ip++; + } +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off += (ip[0] << 6) + (ip[1] >> 2); +#else + m_off += (ip[0] >> 2) + (ip[1] << 6); +#endif + ip += 2; + if (m_off == 0) + goto eof_found; + m_off += 0x4000; +#if defined(LZO1Z) + last_m_off = m_off; +#endif +#else +#if defined(LZO1Z) + m_pos -= (ip[0] << 6) + (ip[1] >> 2); +#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN) + m_pos -= (* (const lzo_ushortp) ip) >> 2; +#else + m_pos -= (ip[0] >> 2) + (ip[1] << 6); +#endif + ip += 2; + if (m_pos == op) + goto eof_found; + m_pos -= 0x4000; +#if defined(LZO1Z) + last_m_off = pd((const lzo_bytep)op, m_pos); +#endif +#endif + } + else + { +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off = 1 + (t << 6) + (*ip++ >> 2); + last_m_off = m_off; +#else + m_off = 1 + (t >> 2) + (*ip++ << 2); +#endif + NEED_OP(2); + t = 2; COPY_DICT(t,m_off) +#else +#if defined(LZO1Z) + t = 1 + (t << 6) + (*ip++ >> 2); + m_pos = op - t; + last_m_off = t; +#else + m_pos = op - 1; + m_pos -= t >> 2; + m_pos -= *ip++ << 2; +#endif + TEST_LB(m_pos); NEED_OP(2); + *op++ = *m_pos++; *op++ = *m_pos; +#endif + goto match_done; + } + +#if defined(COPY_DICT) + + NEED_OP(t+3-1); + t += 3-1; COPY_DICT(t,m_off) + +#else + + TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1); +#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4) +#if !defined(LZO_UNALIGNED_OK_4) + if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op,m_pos)) + { + assert((op - m_pos) >= 4); +#else + if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4) + { +#endif + COPY4(op,m_pos); + op += 4; m_pos += 4; t -= 4 - (3 - 1); + do { + COPY4(op,m_pos); + op += 4; m_pos += 4; t -= 4; + } while (t >= 4); + if (t > 0) do *op++ = *m_pos++; while (--t > 0); + } + else +#endif + { +copy_match: + *op++ = *m_pos++; *op++ = *m_pos++; + do *op++ = *m_pos++; while (--t > 0); + } + +#endif + +match_done: +#if defined(LZO1Z) + t = ip[-1] & 3; +#else + t = ip[-2] & 3; +#endif + if (t == 0) + break; + +match_next: + assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+1); +#if 0 + do *op++ = *ip++; while (--t > 0); +#else + *op++ = *ip++; + if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } } +#endif + t = *ip++; + } while (TEST_IP && TEST_OP); + } + +#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP) + *out_len = pd(op, out); + return LZO_E_EOF_NOT_FOUND; +#endif + +eof_found: + assert(t == 1); + *out_len = pd(op, out); + return (ip == ip_end ? LZO_E_OK : + (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN)); + +#if defined(HAVE_NEED_IP) +input_overrun: + *out_len = pd(op, out); + return LZO_E_INPUT_OVERRUN; +#endif + +#if defined(HAVE_NEED_OP) +output_overrun: + *out_len = pd(op, out); + return LZO_E_OUTPUT_OVERRUN; +#endif + +#if defined(LZO_TEST_OVERRUN_LOOKBEHIND) +lookbehind_overrun: + *out_len = pd(op, out); + return LZO_E_LOOKBEHIND_OVERRUN; +#endif +} + +#endif + +#define LZO_TEST_OVERRUN +#undef DO_DECOMPRESS +#define DO_DECOMPRESS lzo1x_decompress_safe + +#if !defined(MINILZO_CFG_SKIP_LZO1X_DECOMPRESS_SAFE) + +#if defined(LZO_TEST_OVERRUN) +# if !defined(LZO_TEST_OVERRUN_INPUT) +# define LZO_TEST_OVERRUN_INPUT 2 +# endif +# if !defined(LZO_TEST_OVERRUN_OUTPUT) +# define LZO_TEST_OVERRUN_OUTPUT 2 +# endif +# if !defined(LZO_TEST_OVERRUN_LOOKBEHIND) +# define LZO_TEST_OVERRUN_LOOKBEHIND +# endif +#endif + +#undef TEST_IP +#undef TEST_OP +#undef TEST_LB +#undef TEST_LBO +#undef NEED_IP +#undef NEED_OP +#undef HAVE_TEST_IP +#undef HAVE_TEST_OP +#undef HAVE_NEED_IP +#undef HAVE_NEED_OP +#undef HAVE_ANY_IP +#undef HAVE_ANY_OP + +#if defined(LZO_TEST_OVERRUN_INPUT) +# if (LZO_TEST_OVERRUN_INPUT >= 1) +# define TEST_IP (ip < ip_end) +# endif +# if (LZO_TEST_OVERRUN_INPUT >= 2) +# define NEED_IP(x) \ + if ((lzo_uint)(ip_end - ip) < (lzo_uint)(x)) goto input_overrun +# endif +#endif + +#if defined(LZO_TEST_OVERRUN_OUTPUT) +# if (LZO_TEST_OVERRUN_OUTPUT >= 1) +# define TEST_OP (op <= op_end) +# endif +# if (LZO_TEST_OVERRUN_OUTPUT >= 2) +# undef TEST_OP +# define NEED_OP(x) \ + if ((lzo_uint)(op_end - op) < (lzo_uint)(x)) goto output_overrun +# endif +#endif + +#if defined(LZO_TEST_OVERRUN_LOOKBEHIND) +# define TEST_LB(m_pos) if (m_pos < out || m_pos >= op) goto lookbehind_overrun +# define TEST_LBO(m_pos,o) if (m_pos < out || m_pos >= op - (o)) goto lookbehind_overrun +#else +# define TEST_LB(m_pos) ((void) 0) +# define TEST_LBO(m_pos,o) ((void) 0) +#endif + +#if !defined(LZO_EOF_CODE) && !defined(TEST_IP) +# define TEST_IP (ip < ip_end) +#endif + +#if defined(TEST_IP) +# define HAVE_TEST_IP +#else +# define TEST_IP 1 +#endif +#if defined(TEST_OP) +# define HAVE_TEST_OP +#else +# define TEST_OP 1 +#endif + +#if defined(NEED_IP) +# define HAVE_NEED_IP +#else +# define NEED_IP(x) ((void) 0) +#endif +#if defined(NEED_OP) +# define HAVE_NEED_OP +#else +# define NEED_OP(x) ((void) 0) +#endif + +#if defined(HAVE_TEST_IP) || defined(HAVE_NEED_IP) +# define HAVE_ANY_IP +#endif +#if defined(HAVE_TEST_OP) || defined(HAVE_NEED_OP) +# define HAVE_ANY_OP +#endif + +#undef __COPY4 +#define __COPY4(dst,src) * (lzo_uint32p)(dst) = * (const lzo_uint32p)(src) + +#undef COPY4 +#if defined(LZO_UNALIGNED_OK_4) +# define COPY4(dst,src) __COPY4(dst,src) +#elif defined(LZO_ALIGNED_OK_4) +# define COPY4(dst,src) __COPY4((lzo_uintptr_t)(dst),(lzo_uintptr_t)(src)) +#endif + +#if defined(DO_DECOMPRESS) +LZO_PUBLIC(int) +DO_DECOMPRESS ( const lzo_bytep in , lzo_uint in_len, + lzo_bytep out, lzo_uintp out_len, + lzo_voidp wrkmem ) +#endif +{ + register lzo_bytep op; + register const lzo_bytep ip; + register lzo_uint t; +#if defined(COPY_DICT) + lzo_uint m_off; + const lzo_bytep dict_end; +#else + register const lzo_bytep m_pos; +#endif + + const lzo_bytep const ip_end = in + in_len; +#if defined(HAVE_ANY_OP) + lzo_bytep const op_end = out + *out_len; +#endif +#if defined(LZO1Z) + lzo_uint last_m_off = 0; +#endif + + LZO_UNUSED(wrkmem); + +#if defined(COPY_DICT) + if (dict) + { + if (dict_len > M4_MAX_OFFSET) + { + dict += dict_len - M4_MAX_OFFSET; + dict_len = M4_MAX_OFFSET; + } + dict_end = dict + dict_len; + } + else + { + dict_len = 0; + dict_end = NULL; + } +#endif + + *out_len = 0; + + op = out; + ip = in; + + if (*ip > 17) + { + t = *ip++ - 17; + if (t < 4) + goto match_next; + assert(t > 0); NEED_OP(t); NEED_IP(t+1); + do *op++ = *ip++; while (--t > 0); + goto first_literal_run; + } + + while (TEST_IP && TEST_OP) + { + t = *ip++; + if (t >= 16) + goto match; + if (t == 0) + { + NEED_IP(1); + while (*ip == 0) + { + t += 255; + ip++; + NEED_IP(1); + } + t += 15 + *ip++; + } + assert(t > 0); NEED_OP(t+3); NEED_IP(t+4); +#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4) +#if !defined(LZO_UNALIGNED_OK_4) + if (PTR_ALIGNED2_4(op,ip)) + { +#endif + COPY4(op,ip); + op += 4; ip += 4; + if (--t > 0) + { + if (t >= 4) + { + do { + COPY4(op,ip); + op += 4; ip += 4; t -= 4; + } while (t >= 4); + if (t > 0) do *op++ = *ip++; while (--t > 0); + } + else + do *op++ = *ip++; while (--t > 0); + } +#if !defined(LZO_UNALIGNED_OK_4) + } + else +#endif +#endif +#if !defined(LZO_UNALIGNED_OK_4) + { + *op++ = *ip++; *op++ = *ip++; *op++ = *ip++; + do *op++ = *ip++; while (--t > 0); + } +#endif + +first_literal_run: + + t = *ip++; + if (t >= 16) + goto match; +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2); + last_m_off = m_off; +#else + m_off = (1 + M2_MAX_OFFSET) + (t >> 2) + (*ip++ << 2); +#endif + NEED_OP(3); + t = 3; COPY_DICT(t,m_off) +#else +#if defined(LZO1Z) + t = (1 + M2_MAX_OFFSET) + (t << 6) + (*ip++ >> 2); + m_pos = op - t; + last_m_off = t; +#else + m_pos = op - (1 + M2_MAX_OFFSET); + m_pos -= t >> 2; + m_pos -= *ip++ << 2; +#endif + TEST_LB(m_pos); NEED_OP(3); + *op++ = *m_pos++; *op++ = *m_pos++; *op++ = *m_pos; +#endif + goto match_done; + + do { +match: + if (t >= 64) + { +#if defined(COPY_DICT) +#if defined(LZO1X) + m_off = 1 + ((t >> 2) & 7) + (*ip++ << 3); + t = (t >> 5) - 1; +#elif defined(LZO1Y) + m_off = 1 + ((t >> 2) & 3) + (*ip++ << 2); + t = (t >> 4) - 3; +#elif defined(LZO1Z) + m_off = t & 0x1f; + if (m_off >= 0x1c) + m_off = last_m_off; + else + { + m_off = 1 + (m_off << 6) + (*ip++ >> 2); + last_m_off = m_off; + } + t = (t >> 5) - 1; +#endif +#else +#if defined(LZO1X) + m_pos = op - 1; + m_pos -= (t >> 2) & 7; + m_pos -= *ip++ << 3; + t = (t >> 5) - 1; +#elif defined(LZO1Y) + m_pos = op - 1; + m_pos -= (t >> 2) & 3; + m_pos -= *ip++ << 2; + t = (t >> 4) - 3; +#elif defined(LZO1Z) + { + lzo_uint off = t & 0x1f; + m_pos = op; + if (off >= 0x1c) + { + assert(last_m_off > 0); + m_pos -= last_m_off; + } + else + { + off = 1 + (off << 6) + (*ip++ >> 2); + m_pos -= off; + last_m_off = off; + } + } + t = (t >> 5) - 1; +#endif + TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1); + goto copy_match; +#endif + } + else if (t >= 32) + { + t &= 31; + if (t == 0) + { + NEED_IP(1); + while (*ip == 0) + { + t += 255; + ip++; + NEED_IP(1); + } + t += 31 + *ip++; + } +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off = 1 + (ip[0] << 6) + (ip[1] >> 2); + last_m_off = m_off; +#else + m_off = 1 + (ip[0] >> 2) + (ip[1] << 6); +#endif +#else +#if defined(LZO1Z) + { + lzo_uint off = 1 + (ip[0] << 6) + (ip[1] >> 2); + m_pos = op - off; + last_m_off = off; + } +#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN) + m_pos = op - 1; + m_pos -= (* (const lzo_ushortp) ip) >> 2; +#else + m_pos = op - 1; + m_pos -= (ip[0] >> 2) + (ip[1] << 6); +#endif +#endif + ip += 2; + } + else if (t >= 16) + { +#if defined(COPY_DICT) + m_off = (t & 8) << 11; +#else + m_pos = op; + m_pos -= (t & 8) << 11; +#endif + t &= 7; + if (t == 0) + { + NEED_IP(1); + while (*ip == 0) + { + t += 255; + ip++; + NEED_IP(1); + } + t += 7 + *ip++; + } +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off += (ip[0] << 6) + (ip[1] >> 2); +#else + m_off += (ip[0] >> 2) + (ip[1] << 6); +#endif + ip += 2; + if (m_off == 0) + goto eof_found; + m_off += 0x4000; +#if defined(LZO1Z) + last_m_off = m_off; +#endif +#else +#if defined(LZO1Z) + m_pos -= (ip[0] << 6) + (ip[1] >> 2); +#elif defined(LZO_UNALIGNED_OK_2) && defined(LZO_ABI_LITTLE_ENDIAN) + m_pos -= (* (const lzo_ushortp) ip) >> 2; +#else + m_pos -= (ip[0] >> 2) + (ip[1] << 6); +#endif + ip += 2; + if (m_pos == op) + goto eof_found; + m_pos -= 0x4000; +#if defined(LZO1Z) + last_m_off = pd((const lzo_bytep)op, m_pos); +#endif +#endif + } + else + { +#if defined(COPY_DICT) +#if defined(LZO1Z) + m_off = 1 + (t << 6) + (*ip++ >> 2); + last_m_off = m_off; +#else + m_off = 1 + (t >> 2) + (*ip++ << 2); +#endif + NEED_OP(2); + t = 2; COPY_DICT(t,m_off) +#else +#if defined(LZO1Z) + t = 1 + (t << 6) + (*ip++ >> 2); + m_pos = op - t; + last_m_off = t; +#else + m_pos = op - 1; + m_pos -= t >> 2; + m_pos -= *ip++ << 2; +#endif + TEST_LB(m_pos); NEED_OP(2); + *op++ = *m_pos++; *op++ = *m_pos; +#endif + goto match_done; + } + +#if defined(COPY_DICT) + + NEED_OP(t+3-1); + t += 3-1; COPY_DICT(t,m_off) + +#else + + TEST_LB(m_pos); assert(t > 0); NEED_OP(t+3-1); +#if defined(LZO_UNALIGNED_OK_4) || defined(LZO_ALIGNED_OK_4) +#if !defined(LZO_UNALIGNED_OK_4) + if (t >= 2 * 4 - (3 - 1) && PTR_ALIGNED2_4(op,m_pos)) + { + assert((op - m_pos) >= 4); +#else + if (t >= 2 * 4 - (3 - 1) && (op - m_pos) >= 4) + { +#endif + COPY4(op,m_pos); + op += 4; m_pos += 4; t -= 4 - (3 - 1); + do { + COPY4(op,m_pos); + op += 4; m_pos += 4; t -= 4; + } while (t >= 4); + if (t > 0) do *op++ = *m_pos++; while (--t > 0); + } + else +#endif + { +copy_match: + *op++ = *m_pos++; *op++ = *m_pos++; + do *op++ = *m_pos++; while (--t > 0); + } + +#endif + +match_done: +#if defined(LZO1Z) + t = ip[-1] & 3; +#else + t = ip[-2] & 3; +#endif + if (t == 0) + break; + +match_next: + assert(t > 0); assert(t < 4); NEED_OP(t); NEED_IP(t+1); +#if 0 + do *op++ = *ip++; while (--t > 0); +#else + *op++ = *ip++; + if (t > 1) { *op++ = *ip++; if (t > 2) { *op++ = *ip++; } } +#endif + t = *ip++; + } while (TEST_IP && TEST_OP); + } + +#if defined(HAVE_TEST_IP) || defined(HAVE_TEST_OP) + *out_len = pd(op, out); + return LZO_E_EOF_NOT_FOUND; +#endif + +eof_found: + assert(t == 1); + *out_len = pd(op, out); + return (ip == ip_end ? LZO_E_OK : + (ip < ip_end ? LZO_E_INPUT_NOT_CONSUMED : LZO_E_INPUT_OVERRUN)); + +#if defined(HAVE_NEED_IP) +input_overrun: + *out_len = pd(op, out); + return LZO_E_INPUT_OVERRUN; +#endif + +#if defined(HAVE_NEED_OP) +output_overrun: + *out_len = pd(op, out); + return LZO_E_OUTPUT_OVERRUN; +#endif + +#if defined(LZO_TEST_OVERRUN_LOOKBEHIND) +lookbehind_overrun: + *out_len = pd(op, out); + return LZO_E_LOOKBEHIND_OVERRUN; +#endif +} + +#endif + +/***** End of minilzo.c *****/ + diff --git a/extern/lzo/minilzo/minilzo.h b/extern/lzo/minilzo/minilzo.h new file mode 100644 index 00000000000..93916bc89b2 --- /dev/null +++ b/extern/lzo/minilzo/minilzo.h @@ -0,0 +1,112 @@ +/* minilzo.h -- mini subset of the LZO real-time data compression library + + This file is part of the LZO real-time data compression library. + + Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer + Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer + All Rights Reserved. + + The LZO library 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. + + The LZO library 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 the LZO library; see the file COPYING. + If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Markus F.X.J. Oberhumer + + http://www.oberhumer.com/opensource/lzo/ + */ + +/* + * NOTE: + * the full LZO package can be found at + * http://www.oberhumer.com/opensource/lzo/ + */ + + +#ifndef __MINILZO_H +#define __MINILZO_H + +#define MINILZO_VERSION 0x2030 + +#ifdef __LZOCONF_H +# error "you cannot use both LZO and miniLZO" +#endif + +#undef LZO_HAVE_CONFIG_H +#include "lzoconf.h" + +#if !defined(LZO_VERSION) || (LZO_VERSION != MINILZO_VERSION) +# error "version mismatch in header files" +#endif + + +#ifdef __cplusplus +extern "C" { +#endif + + +/*********************************************************************** +// +************************************************************************/ + +/* Memory required for the wrkmem parameter. + * When the required size is 0, you can also pass a NULL pointer. + */ + +#define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS +#define LZO1X_1_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t)) +#define LZO1X_MEM_DECOMPRESS (0) + + +/* compression */ +LZO_EXTERN(int) +lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem ); + +/* decompression */ +LZO_EXTERN(int) +lzo1x_decompress ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + +/* safe decompression with overrun testing */ +LZO_EXTERN(int) +lzo1x_decompress_safe ( const lzo_bytep src, lzo_uint src_len, + lzo_bytep dst, lzo_uintp dst_len, + lzo_voidp wrkmem /* NOT USED */ ); + + +#define LZO_OUT_LEN(size) ((size) + (size) / 16 + 64 + 3) + +#define LZO_HEAP_ALLOC(var,size) \ + lzo_align_t __LZO_MMODEL var [ ((size) + (sizeof(lzo_align_t) - 1)) / sizeof(lzo_align_t) ] + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* already included */ + diff --git a/intern/smoke/extern/smoke_API.h b/intern/smoke/extern/smoke_API.h index f0dba3cc7a4..b21ce473202 100644 --- a/intern/smoke/extern/smoke_API.h +++ b/intern/smoke/extern/smoke_API.h @@ -20,7 +20,7 @@ * The Original Code is Copyright (C) 2009 by Daniel Genrich * All rights reserved. * - * Contributor(s): None + * Contributor(s): Daniel Genrich * * ***** END GPL LICENSE BLOCK ***** */ @@ -32,6 +32,10 @@ extern "C" { #endif +// export +void smoke_export(struct FLUID_3D *fluid, float *dt, float *dx, float **dens, float **densold, float **heat, float **heatold, float **vx, float **vy, float **vz, float **vxold, float **vyold, float **vzold, unsigned char **obstacles); + +// low res struct FLUID_3D *smoke_init(int *res, float *p0, float dt); void smoke_free(struct FLUID_3D *fluid); @@ -57,11 +61,14 @@ void smoke_turbulence_free(struct WTURBULENCE *wt); void smoke_turbulence_step(struct WTURBULENCE *wt, struct FLUID_3D *fluid); float *smoke_turbulence_get_density(struct WTURBULENCE *wt); -void smoke_turbulence_get_res(struct WTURBULENCE *wt, int *res); +void smoke_turbulence_get_res(struct WTURBULENCE *wt, unsigned int *res); void smoke_turbulence_set_noise(struct WTURBULENCE *wt, int type); -void smoke_initWaveletBlenderRNA(struct WTURBULENCE *wt, float *strength); +void smoke_turbulence_initBlenderRNA(struct WTURBULENCE *wt, float *strength); -void smoke_dissolve_wavelet(struct WTURBULENCE *wt, int speed, int log); +void smoke_turbulence_dissolve(struct WTURBULENCE *wt, int speed, int log); + +// export +void smoke_turbulence_export(struct WTURBULENCE *wt, float **dens, float **densold, float **tcu, float **tcv, float **tcw); #ifdef __cplusplus } diff --git a/intern/smoke/intern/FLUID_3D.cpp b/intern/smoke/intern/FLUID_3D.cpp index ff66f29143c..89dd893198b 100644 --- a/intern/smoke/intern/FLUID_3D.cpp +++ b/intern/smoke/intern/FLUID_3D.cpp @@ -75,8 +75,6 @@ FLUID_3D::FLUID_3D(int *res, float *p0, float dt) : // allocate arrays _totalCells = _xRes * _yRes * _zRes; _slabSize = _xRes * _yRes; - _divergence = new float[_totalCells]; - _pressure = new float[_totalCells]; _xVelocity = new float[_totalCells]; _yVelocity = new float[_totalCells]; _zVelocity = new float[_totalCells]; @@ -86,20 +84,11 @@ FLUID_3D::FLUID_3D(int *res, float *p0, float dt) : _xForce = new float[_totalCells]; _yForce = new float[_totalCells]; _zForce = new float[_totalCells]; - _vorticity = new float[_totalCells]; _density = new float[_totalCells]; _densityOld = new float[_totalCells]; _heat = new float[_totalCells]; _heatOld = new float[_totalCells]; - _residual = new float[_totalCells]; - _direction = new float[_totalCells]; - _q = new float[_totalCells]; - _obstacles = new unsigned char[_totalCells]; - _xVorticity = new float[_totalCells]; - _yVorticity = new float[_totalCells]; - _zVorticity = new float[_totalCells]; - _h = new float[_totalCells]; - _Precond = new float[_totalCells]; + _obstacles = new unsigned char[_totalCells]; // set 0 at end of step // DG TODO: check if alloc went fine @@ -109,8 +98,6 @@ FLUID_3D::FLUID_3D(int *res, float *p0, float dt) : _densityOld[x] = 0.0f; _heat[x] = 0.0f; _heatOld[x] = 0.0f; - _divergence[x] = 0.0f; - _pressure[x] = 0.0f; _xVelocity[x] = 0.0f; _yVelocity[x] = 0.0f; _zVelocity[x] = 0.0f; @@ -120,19 +107,11 @@ FLUID_3D::FLUID_3D(int *res, float *p0, float dt) : _xForce[x] = 0.0f; _yForce[x] = 0.0f; _zForce[x] = 0.0f; - _xVorticity[x] = 0.0f; - _yVorticity[x] = 0.0f; - _zVorticity[x] = 0.0f; - _residual[x] = 0.0f; - _q[x] = 0.0f; - _direction[x] = 0.0f; - _h[x] = 0.0f; - _Precond[x] = 0.0f; _obstacles[x] = false; } // set side obstacles - int index; + size_t index; for (int y = 0; y < _yRes; y++) // z for (int x = 0; x < _xRes; x++) { @@ -177,8 +156,6 @@ FLUID_3D::FLUID_3D(int *res, float *p0, float dt) : FLUID_3D::~FLUID_3D() { - if (_divergence) delete[] _divergence; - if (_pressure) delete[] _pressure; if (_xVelocity) delete[] _xVelocity; if (_yVelocity) delete[] _yVelocity; if (_zVelocity) delete[] _zVelocity; @@ -188,23 +165,14 @@ FLUID_3D::~FLUID_3D() if (_xForce) delete[] _xForce; if (_yForce) delete[] _yForce; if (_zForce) delete[] _zForce; - if (_residual) delete[] _residual; - if (_direction) delete[] _direction; - if (_q) delete[] _q; if (_density) delete[] _density; if (_densityOld) delete[] _densityOld; if (_heat) delete[] _heat; if (_heatOld) delete[] _heatOld; - if (_xVorticity) delete[] _xVorticity; - if (_yVorticity) delete[] _yVorticity; - if (_zVorticity) delete[] _zVorticity; - if (_vorticity) delete[] _vorticity; - if (_h) delete[] _h; - if (_Precond) delete[] _Precond; if (_obstacles) delete[] _obstacles; // if (_wTurbulence) delete _wTurbulence; - printf("deleted fluid\n"); + // printf("deleted fluid\n"); } // init direct access functions from blender @@ -263,6 +231,8 @@ void FLUID_3D::step() */ _totalTime += _dt; _totalSteps++; + + memset(_obstacles, 0, sizeof(unsigned char)*_xRes*_yRes*_zRes); } ////////////////////////////////////////////////////////////////////// @@ -300,7 +270,7 @@ void FLUID_3D::artificialDamping(float* field) { ////////////////////////////////////////////////////////////////////// void FLUID_3D::copyBorderAll(float* field) { - int index; + size_t index; for (int y = 0; y < _yRes; y++) for (int x = 0; x < _xRes; x++) { @@ -367,9 +337,16 @@ void FLUID_3D::addForce() ////////////////////////////////////////////////////////////////////// void FLUID_3D::project() { - int index, x, y, z; + int x, y, z; + size_t index; - setObstacleBoundaries(); + float *_pressure = new float[_totalCells]; + float *_divergence = new float[_totalCells]; + + memset(_pressure, 0, sizeof(float)*_totalCells); + memset(_divergence, 0, sizeof(float)*_totalCells); + + setObstacleBoundaries(_pressure); // copy out the boundaries if(DOMAIN_BC_LEFT == 0) setNeumannX(_xVelocity, _res); @@ -414,7 +391,7 @@ void FLUID_3D::project() // solve Poisson equation solvePressurePre(_pressure, _divergence, _obstacles); - setObstaclePressure(); + setObstaclePressure(_pressure); // project out solution float invDx = 1.0f / _dx; @@ -430,6 +407,9 @@ void FLUID_3D::project() _zVelocity[index] -= 0.5f * (_pressure[index + _slabSize] - _pressure[index - _slabSize]) * invDx; } } + + if (_pressure) delete[] _pressure; + if (_divergence) delete[] _divergence; } ////////////////////////////////////////////////////////////////////// @@ -465,7 +445,7 @@ void FLUID_3D::addObstacle(OBSTACLE* obstacle) ////////////////////////////////////////////////////////////////////// // calculate the obstacle directional types ////////////////////////////////////////////////////////////////////// -void FLUID_3D::setObstaclePressure() +void FLUID_3D::setObstaclePressure(float *_pressure) { // tag remaining obstacle blocks for (int z = 1, index = _slabSize + _xRes + 1; @@ -539,7 +519,7 @@ void FLUID_3D::setObstaclePressure() } } -void FLUID_3D::setObstacleBoundaries() +void FLUID_3D::setObstacleBoundaries(float *_pressure) { // cull degenerate obstacles , move to addObstacle? for (int z = 1, index = _slabSize + _xRes + 1; @@ -600,6 +580,18 @@ void FLUID_3D::addVorticity() int x,y,z,index; if(_vorticityEps<=0.) return; + float *_xVorticity, *_yVorticity, *_zVorticity, *_vorticity; + + _xVorticity = new float[_totalCells]; + _yVorticity = new float[_totalCells]; + _zVorticity = new float[_totalCells]; + _vorticity = new float[_totalCells]; + + memset(_xVorticity, 0, sizeof(float)*_totalCells); + memset(_yVorticity, 0, sizeof(float)*_totalCells); + memset(_zVorticity, 0, sizeof(float)*_totalCells); + memset(_vorticity, 0, sizeof(float)*_totalCells); + // calculate vorticity float gridSize = 0.5f / _dx; index = _slabSize + _xRes + 1; @@ -662,6 +654,11 @@ void FLUID_3D::addVorticity() _zForce[index] += (N[0] * _yVorticity[index] - N[1] * _xVorticity[index]) * _dx * eps; } } + + if (_xVorticity) delete[] _xVorticity; + if (_yVorticity) delete[] _yVorticity; + if (_zVorticity) delete[] _zVorticity; + if (_vorticity) delete[] _vorticity; } ////////////////////////////////////////////////////////////////////// diff --git a/intern/smoke/intern/FLUID_3D.h b/intern/smoke/intern/FLUID_3D.h index 78a4cf076e3..9d9e7318204 100644 --- a/intern/smoke/intern/FLUID_3D.h +++ b/intern/smoke/intern/FLUID_3D.h @@ -64,7 +64,7 @@ class FLUID_3D // dimensions int _xRes, _yRes, _zRes, _maxRes; Vec3Int _res; - int _totalCells; + size_t _totalCells; int _slabSize; float _dx; float _p0[3]; @@ -81,7 +81,6 @@ class FLUID_3D float* _densityOld; float* _heat; float* _heatOld; - float* _pressure; float* _xVelocity; float* _yVelocity; float* _zVelocity; @@ -91,19 +90,9 @@ class FLUID_3D float* _xForce; float* _yForce; float* _zForce; - float* _divergence; - float* _xVorticity; - float* _yVorticity; - float* _zVorticity; - float* _vorticity; - float* _h; - float* _Precond; unsigned char* _obstacles; // CG fields - float* _residual; - float* _direction; - float* _q; int _iterations; // simulation constants @@ -134,8 +123,8 @@ class FLUID_3D void solveHeat(float* field, float* b, unsigned char* skip); // handle obstacle boundaries - void setObstacleBoundaries(); - void setObstaclePressure(); + void setObstacleBoundaries(float *_pressure); + void setObstaclePressure(float *_pressure); public: // advection, accessed e.g. by WTURBULENCE class diff --git a/intern/smoke/intern/FLUID_3D_SOLVERS.cpp b/intern/smoke/intern/FLUID_3D_SOLVERS.cpp index a35beaa05d7..7d078d86d61 100644 --- a/intern/smoke/intern/FLUID_3D_SOLVERS.cpp +++ b/intern/smoke/intern/FLUID_3D_SOLVERS.cpp @@ -28,10 +28,17 @@ void FLUID_3D::solvePressurePre(float* field, float* b, unsigned char* skip) { int x, y, z; size_t index; + float *_q, *_Precond, *_h, *_residual, *_direction; // i = 0 int i = 0; + _residual = new float[_totalCells]; // set 0 + _direction = new float[_totalCells]; // set 0 + _q = new float[_totalCells]; // set 0 + _h = new float[_totalCells]; // set 0 + _Precond = new float[_totalCells]; // set 0 + memset(_residual, 0, sizeof(float)*_xRes*_yRes*_zRes); memset(_q, 0, sizeof(float)*_xRes*_yRes*_zRes); memset(_direction, 0, sizeof(float)*_xRes*_yRes*_zRes); @@ -191,11 +198,18 @@ void FLUID_3D::solvePressurePre(float* field, float* b, unsigned char* skip) i++; } // cout << i << " iterations converged to " << sqrt(maxR) << endl; + + if (_h) delete[] _h; + if (_Precond) delete[] _Precond; + if (_residual) delete[] _residual; + if (_direction) delete[] _direction; + if (_q) delete[] _q; } ////////////////////////////////////////////////////////////////////// // solve the poisson equation with CG ////////////////////////////////////////////////////////////////////// +#if 0 void FLUID_3D::solvePressure(float* field, float* b, unsigned char* skip) { int x, y, z; @@ -344,6 +358,7 @@ void FLUID_3D::solvePressure(float* field, float* b, unsigned char* skip) } // cout << i << " iterations converged to " << maxR << endl; } +#endif ////////////////////////////////////////////////////////////////////// // solve the heat equation with CG @@ -353,10 +368,15 @@ void FLUID_3D::solveHeat(float* field, float* b, unsigned char* skip) int x, y, z; size_t index; const float heatConst = _dt * _heatDiffusion / (_dx * _dx); + float *_q, *_residual, *_direction; // i = 0 int i = 0; + _residual = new float[_totalCells]; // set 0 + _direction = new float[_totalCells]; // set 0 + _q = new float[_totalCells]; // set 0 + memset(_residual, 0, sizeof(float)*_xRes*_yRes*_zRes); memset(_q, 0, sizeof(float)*_xRes*_yRes*_zRes); memset(_direction, 0, sizeof(float)*_xRes*_yRes*_zRes); @@ -496,5 +516,9 @@ void FLUID_3D::solveHeat(float* field, float* b, unsigned char* skip) i++; } // cout << i << " iterations converged to " << maxR << endl; + + if (_residual) delete[] _residual; + if (_direction) delete[] _direction; + if (_q) delete[] _q; } diff --git a/intern/smoke/intern/WTURBULENCE.cpp b/intern/smoke/intern/WTURBULENCE.cpp index db7a1b55afa..dd092d4f0cc 100644 --- a/intern/smoke/intern/WTURBULENCE.cpp +++ b/intern/smoke/intern/WTURBULENCE.cpp @@ -81,25 +81,9 @@ WTURBULENCE::WTURBULENCE(int xResSm, int yResSm, int zResSm, int amplify, int no _densityBig = new float[_totalCellsBig]; _densityBigOld = new float[_totalCellsBig]; - // allocate high resolution velocity field. Note that this is only - // necessary because we use MacCormack advection. For semi-Lagrangian - // advection, these arrays are not necessary. - _tempBig1 = _tempBig2 = - _bigUx = _bigUy = _bigUz = NULL; - _tempBig1 = new float[_totalCellsBig]; - _tempBig2 = new float[_totalCellsBig]; - _bigUx = new float[_totalCellsBig]; - _bigUy = new float[_totalCellsBig]; - _bigUz = new float[_totalCellsBig]; - for(int i = 0; i < _totalCellsBig; i++) { _densityBig[i] = - _densityBigOld[i] = - _bigUx[i] = - _bigUy[i] = - _bigUz[i] = - _tempBig1[i] = - _tempBig2[i] = 0.; + _densityBigOld[i] = 0.; } // allocate & init texture coordinates @@ -154,12 +138,6 @@ WTURBULENCE::~WTURBULENCE() { delete[] _densityBig; delete[] _densityBigOld; - delete[] _bigUx; - delete[] _bigUy; - delete[] _bigUz; - delete[] _tempBig1; - delete[] _tempBig2; - delete[] _tcU; delete[] _tcV; delete[] _tcW; @@ -315,7 +293,7 @@ static float minDz(int x, int y, int z, float* input, Vec3Int res) // handle texture coordinates (advection, reset, eigenvalues), // Beware -- uses big density maccormack as temporary arrays ////////////////////////////////////////////////////////////////////// -void WTURBULENCE::advectTextureCoordinates (float dtOrg, float* xvel, float* yvel, float* zvel) { +void WTURBULENCE::advectTextureCoordinates (float dtOrg, float* xvel, float* yvel, float* zvel, float *_tempBig1, float *_tempBig2) { // advection SWAP_POINTERS(_tcTemp, _tcU); FLUID_3D::copyBorderX(_tcTemp, _resSm); @@ -602,12 +580,32 @@ Vec3 WTURBULENCE::WVelocityWithJacobian(Vec3 orgPos, float* xUnwarped, float* yU ////////////////////////////////////////////////////////////////////// void WTURBULENCE::stepTurbulenceReadable(float dtOrg, float* xvel, float* yvel, float* zvel, unsigned char *obstacles) { + // big velocity macCormack fields + float* _bigUx; + float* _bigUy; + float* _bigUz; + + // temp arrays for BFECC and MacCormack - they have more convenient + // names in the actual implementations + float* _tempBig1; + float* _tempBig2; + + // allocate high resolution velocity field. Note that this is only + // necessary because we use MacCormack advection. For semi-Lagrangian + // advection, these arrays are not necessary. + _tempBig1 = new float[_totalCellsBig]; + _tempBig2 = new float[_totalCellsBig]; + // enlarge timestep to match grid const float dt = dtOrg * _amplify; const float invAmp = 1.0f / _amplify; + _bigUx = new float[_totalCellsBig]; + _bigUy = new float[_totalCellsBig]; + _bigUz = new float[_totalCellsBig]; + // prepare textures - advectTextureCoordinates(dtOrg, xvel,yvel,zvel); + advectTextureCoordinates(dtOrg, xvel,yvel,zvel, _tempBig1, _tempBig2); // compute eigenvalues of the texture coordinates computeEigenvalues(); @@ -744,6 +742,13 @@ void WTURBULENCE::stepTurbulenceReadable(float dtOrg, float* xvel, float* yvel, IMAGE::dumpPBRT(_totalStepsBig, pbrtPrefix, _densityBig, _resBig[0],_resBig[1],_resBig[2]); */ _totalStepsBig++; + + delete[] _bigUx; + delete[] _bigUy; + delete[] _bigUz; + + delete[] _tempBig1; + delete[] _tempBig2; } ////////////////////////////////////////////////////////////////////// @@ -752,225 +757,257 @@ void WTURBULENCE::stepTurbulenceReadable(float dtOrg, float* xvel, float* yvel, ////////////////////////////////////////////////////////////////////// void WTURBULENCE::stepTurbulenceFull(float dtOrg, float* xvel, float* yvel, float* zvel, unsigned char *obstacles) { - // enlarge timestep to match grid - const float dt = dtOrg * _amplify; - const float invAmp = 1.0f / _amplify; + // big velocity macCormack fields + float* _bigUx; + float* _bigUy; + float* _bigUz; - // prepare textures - advectTextureCoordinates(dtOrg, xvel,yvel,zvel); + // temp arrays for BFECC and MacCormack - they have more convenient + // names in the actual implementations + float* _tempBig1; + float* _tempBig2; - // do wavelet decomposition of energy - computeEnergy(xvel, yvel, zvel, obstacles); - decomposeEnergy(); + // allocate high resolution velocity field. Note that this is only + // necessary because we use MacCormack advection. For semi-Lagrangian + // advection, these arrays are not necessary. + _tempBig1 = new float[_totalCellsBig]; + _tempBig2 = new float[_totalCellsBig]; - // zero out coefficients inside of the obstacle - for (int x = 0; x < _totalCellsSm; x++) - if (obstacles[x]) _energy[x] = 0.f; + // enlarge timestep to match grid + const float dt = dtOrg * _amplify; + const float invAmp = 1.0f / _amplify; - // parallel region setup - float maxVelMagThreads[8] = { -1., -1., -1., -1., -1., -1., -1., -1. }; -#if PARALLEL==1 -#pragma omp parallel -#endif - { float maxVelMag1 = 0.; -#if PARALLEL==1 - const int id = omp_get_thread_num(); /*, num = omp_get_num_threads(); */ -#endif + _bigUx = new float[_totalCellsBig]; + _bigUy = new float[_totalCellsBig]; + _bigUz = new float[_totalCellsBig]; - // vector noise main loop -#if PARALLEL==1 -#pragma omp for schedule(static) -#endif - for (int zSmall = 0; zSmall < _zResSm; zSmall++) - for (int ySmall = 0; ySmall < _yResSm; ySmall++) - for (int xSmall = 0; xSmall < _xResSm; xSmall++) - { - const int indexSmall = xSmall + ySmall * _xResSm + zSmall * _slabSizeSm; + // prepare textures + advectTextureCoordinates(dtOrg, xvel,yvel,zvel, _tempBig1, _tempBig2); - // compute jacobian - float jacobian[3][3] = { - { minDx(xSmall, ySmall, zSmall, _tcU, _resSm), minDx(xSmall, ySmall, zSmall, _tcV, _resSm), minDx(xSmall, ySmall, zSmall, _tcW, _resSm) } , - { minDy(xSmall, ySmall, zSmall, _tcU, _resSm), minDy(xSmall, ySmall, zSmall, _tcV, _resSm), minDy(xSmall, ySmall, zSmall, _tcW, _resSm) } , - { minDz(xSmall, ySmall, zSmall, _tcU, _resSm), minDz(xSmall, ySmall, zSmall, _tcV, _resSm), minDz(xSmall, ySmall, zSmall, _tcW, _resSm) } - }; + // do wavelet decomposition of energy + computeEnergy(xvel, yvel, zvel, obstacles); + decomposeEnergy(); - // get LU factorization of texture jacobian and apply - // it to unit vectors - JAMA::LU LU = computeLU3x3(jacobian); - float xUnwarped[] = {1.0f, 0.0f, 0.0f}; - float yUnwarped[] = {0.0f, 1.0f, 0.0f}; - float zUnwarped[] = {0.0f, 0.0f, 1.0f}; - float xWarped[] = {1.0f, 0.0f, 0.0f}; - float yWarped[] = {0.0f, 1.0f, 0.0f}; - float zWarped[] = {0.0f, 0.0f, 1.0f}; - bool nonSingular = LU.isNonsingular(); -#if 0 - // UNUSED - float eigMax = 10.0f; - float eigMin = 0.1f; -#endif - if (nonSingular) - { - solveLU3x3(LU, xUnwarped, xWarped); - solveLU3x3(LU, yUnwarped, yWarped); - solveLU3x3(LU, zUnwarped, zWarped); + // zero out coefficients inside of the obstacle + for (int x = 0; x < _totalCellsSm; x++) + if (obstacles[x]) _energy[x] = 0.f; - // compute the eigenvalues while we have the Jacobian available - Vec3 eigenvalues = Vec3(1.); - computeEigenvalues3x3( &eigenvalues[0], jacobian); - _eigMax[indexSmall] = MAX3V(eigenvalues); - _eigMin[indexSmall] = MIN3V(eigenvalues); - } - - // make sure to skip one on the beginning and end - int xStart = (xSmall == 0) ? 1 : 0; - int xEnd = (xSmall == _xResSm - 1) ? _amplify - 1 : _amplify; - int yStart = (ySmall == 0) ? 1 : 0; - int yEnd = (ySmall == _yResSm - 1) ? _amplify - 1 : _amplify; - int zStart = (zSmall == 0) ? 1 : 0; - int zEnd = (zSmall == _zResSm - 1) ? _amplify - 1 : _amplify; - - for (int zBig = zStart; zBig < zEnd; zBig++) - for (int yBig = yStart; yBig < yEnd; yBig++) - for (int xBig = xStart; xBig < xEnd; xBig++) - { - const int x = xSmall * _amplify + xBig; - const int y = ySmall * _amplify + yBig; - const int z = zSmall * _amplify + zBig; - - // get unit position for both fine and coarse grid - const Vec3 pos = Vec3(x,y,z); - const Vec3 posSm = pos * invAmp; - - // get grid index for both fine and coarse grid - const int index = x + y *_xResBig + z *_slabSizeBig; - - // get a linearly interpolated velocity and texcoords - // from the coarse grid - Vec3 vel = INTERPOLATE::lerp3dVec( xvel,yvel,zvel, - posSm[0], posSm[1], posSm[2], _xResSm,_yResSm,_zResSm); - Vec3 uvw = INTERPOLATE::lerp3dVec( _tcU,_tcV,_tcW, - posSm[0], posSm[1], posSm[2], _xResSm,_yResSm,_zResSm); + // parallel region setup + float maxVelMagThreads[8] = { -1., -1., -1., -1., -1., -1., -1., -1. }; - // multiply the texture coordinate by _resSm so that turbulence - // synthesis begins at the first octave that the coarse grid - // cannot capture - Vec3 texCoord = Vec3(uvw[0] * _resSm[0], - uvw[1] * _resSm[1], - uvw[2] * _resSm[2]); + #if PARALLEL==1 + #pragma omp parallel + #endif + { float maxVelMag1 = 0.; + #if PARALLEL==1 + const int id = omp_get_thread_num(); /*, num = omp_get_num_threads(); */ + #endif - // retrieve wavelet energy at highest frequency - float energy = INTERPOLATE::lerp3d( - _highFreqEnergy, posSm[0],posSm[1],posSm[2], _xResSm, _yResSm, _zResSm); + // vector noise main loop + #if PARALLEL==1 + #pragma omp for schedule(static) + #endif + for (int zSmall = 0; zSmall < _zResSm; zSmall++) + for (int ySmall = 0; ySmall < _yResSm; ySmall++) + for (int xSmall = 0; xSmall < _xResSm; xSmall++) + { + const int indexSmall = xSmall + ySmall * _xResSm + zSmall * _slabSizeSm; - // base amplitude for octave 0 - float coefficient = sqrtf(2.0f * fabs(energy)); - const float amplitude = *_strength * fabs(0.5 * coefficient) * persistence; + // compute jacobian + float jacobian[3][3] = { + { minDx(xSmall, ySmall, zSmall, _tcU, _resSm), minDx(xSmall, ySmall, zSmall, _tcV, _resSm), minDx(xSmall, ySmall, zSmall, _tcW, _resSm) } , + { minDy(xSmall, ySmall, zSmall, _tcU, _resSm), minDy(xSmall, ySmall, zSmall, _tcV, _resSm), minDy(xSmall, ySmall, zSmall, _tcW, _resSm) } , + { minDz(xSmall, ySmall, zSmall, _tcU, _resSm), minDz(xSmall, ySmall, zSmall, _tcV, _resSm), minDz(xSmall, ySmall, zSmall, _tcW, _resSm) } + }; - // add noise to velocity, but only if the turbulence is - // sufficiently undeformed, and the energy is large enough - // to make a difference - const bool addNoise = _eigMax[indexSmall] < 2. && - _eigMin[indexSmall] > 0.5; - if (addNoise && amplitude > _cullingThreshold) { - // base amplitude for octave 0 - float amplitudeScaled = amplitude; + // get LU factorization of texture jacobian and apply + // it to unit vectors + JAMA::LU LU = computeLU3x3(jacobian); + float xUnwarped[] = {1.0f, 0.0f, 0.0f}; + float yUnwarped[] = {0.0f, 1.0f, 0.0f}; + float zUnwarped[] = {0.0f, 0.0f, 1.0f}; + float xWarped[] = {1.0f, 0.0f, 0.0f}; + float yWarped[] = {0.0f, 1.0f, 0.0f}; + float zWarped[] = {0.0f, 0.0f, 1.0f}; + bool nonSingular = LU.isNonsingular(); - for (int octave = 0; octave < _octaves; octave++) - { - // multiply the vector noise times the maximum allowed - // noise amplitude at this octave, and add it to the total - vel += WVelocityWithJacobian(texCoord, &xUnwarped[0], &yUnwarped[0], &zUnwarped[0]) * amplitudeScaled; + #if 0 + // UNUSED + float eigMax = 10.0f; + float eigMin = 0.1f; + #endif - // scale coefficient for next octave - amplitudeScaled *= persistence; - texCoord *= 2.0f; - } - } + if (nonSingular) + { + solveLU3x3(LU, xUnwarped, xWarped); + solveLU3x3(LU, yUnwarped, yWarped); + solveLU3x3(LU, zUnwarped, zWarped); - // Store velocity + turbulence in big grid for maccormack step - // - // If you wanted to save memory, you would instead perform a - // semi-Lagrangian backtrace for the current grid cell here. Then - // you could just throw the velocity away. - _bigUx[index] = vel[0]; - _bigUy[index] = vel[1]; - _bigUz[index] = vel[2]; + // compute the eigenvalues while we have the Jacobian available + Vec3 eigenvalues = Vec3(1.); + computeEigenvalues3x3( &eigenvalues[0], jacobian); + _eigMax[indexSmall] = MAX3V(eigenvalues); + _eigMin[indexSmall] = MIN3V(eigenvalues); + } - // compute the velocity magnitude for substepping later - const float velMag = _bigUx[index] * _bigUx[index] + - _bigUy[index] * _bigUy[index] + - _bigUz[index] * _bigUz[index]; - if (velMag > maxVelMag1) maxVelMag1 = velMag; + // make sure to skip one on the beginning and end + int xStart = (xSmall == 0) ? 1 : 0; + int xEnd = (xSmall == _xResSm - 1) ? _amplify - 1 : _amplify; + int yStart = (ySmall == 0) ? 1 : 0; + int yEnd = (ySmall == _yResSm - 1) ? _amplify - 1 : _amplify; + int zStart = (zSmall == 0) ? 1 : 0; + int zEnd = (zSmall == _zResSm - 1) ? _amplify - 1 : _amplify; + + for (int zBig = zStart; zBig < zEnd; zBig++) + for (int yBig = yStart; yBig < yEnd; yBig++) + for (int xBig = xStart; xBig < xEnd; xBig++) + { + const int x = xSmall * _amplify + xBig; + const int y = ySmall * _amplify + yBig; + const int z = zSmall * _amplify + zBig; - // zero out velocity inside obstacles - float obsCheck = INTERPOLATE::lerp3dToFloat( - obstacles, posSm[0], posSm[1], posSm[2], _xResSm, _yResSm, _zResSm); - if (obsCheck > 0.95) - _bigUx[index] = _bigUy[index] = _bigUz[index] = 0.; - } // xyz + // get unit position for both fine and coarse grid + const Vec3 pos = Vec3(x,y,z); + const Vec3 posSm = pos * invAmp; -#if PARALLEL==1 - maxVelMagThreads[id] = maxVelMag1; -#else - maxVelMagThreads[0] = maxVelMag1; -#endif - } - } // omp - - // compute maximum over threads - float maxVelMag = maxVelMagThreads[0]; -#if PARALLEL==1 - for (int i = 1; i < 8; i++) - if (maxVelMag < maxVelMagThreads[i]) - maxVelMag = maxVelMagThreads[i]; -#endif + // get grid index for both fine and coarse grid + const int index = x + y *_xResBig + z *_slabSizeBig; - // prepare density for an advection - SWAP_POINTERS(_densityBig, _densityBigOld); + // get a linearly interpolated velocity and texcoords + // from the coarse grid + Vec3 vel = INTERPOLATE::lerp3dVec( xvel,yvel,zvel, + posSm[0], posSm[1], posSm[2], _xResSm,_yResSm,_zResSm); + Vec3 uvw = INTERPOLATE::lerp3dVec( _tcU,_tcV,_tcW, + posSm[0], posSm[1], posSm[2], _xResSm,_yResSm,_zResSm); - // based on the maximum velocity present, see if we need to substep, - // but cap the maximum number of substeps to 5 - const int maxSubSteps = 25; - const int maxVel = 5; - maxVelMag = sqrt(maxVelMag) * dt; - int totalSubsteps = (int)(maxVelMag / (float)maxVel); - totalSubsteps = (totalSubsteps < 1) ? 1 : totalSubsteps; - // printf("totalSubsteps: %d\n", totalSubsteps); - totalSubsteps = (totalSubsteps > maxSubSteps) ? maxSubSteps : totalSubsteps; - const float dtSubdiv = dt / (float)totalSubsteps; + // multiply the texture coordinate by _resSm so that turbulence + // synthesis begins at the first octave that the coarse grid + // cannot capture + Vec3 texCoord = Vec3(uvw[0] * _resSm[0], + uvw[1] * _resSm[1], + uvw[2] * _resSm[2]); - // set boundaries of big velocity grid - FLUID_3D::setZeroX(_bigUx, _resBig); - FLUID_3D::setZeroY(_bigUy, _resBig); - FLUID_3D::setZeroZ(_bigUz, _resBig); + // retrieve wavelet energy at highest frequency + float energy = INTERPOLATE::lerp3d( + _highFreqEnergy, posSm[0],posSm[1],posSm[2], _xResSm, _yResSm, _zResSm); - // do the MacCormack advection, with substepping if necessary - for(int substep = 0; substep < totalSubsteps; substep++) - { - FLUID_3D::advectFieldMacCormack(dtSubdiv, _bigUx, _bigUy, _bigUz, - _densityBigOld, _densityBig, _tempBig1, _tempBig2, _resBig, NULL); + // base amplitude for octave 0 + float coefficient = sqrtf(2.0f * fabs(energy)); + const float amplitude = *_strength * fabs(0.5 * coefficient) * persistence; - if (substep < totalSubsteps - 1) - SWAP_POINTERS(_densityBig, _densityBigOld); - } // substep - - // wipe the density borders - FLUID_3D::setZeroBorder(_densityBig, _resBig); - - // reset texture coordinates now in preparation for next timestep - // Shouldn't do this before generating the noise because then the - // eigenvalues stored do not reflect the underlying texture coordinates - resetTextureCoordinates(); - - // output files - // string prefix = string("./amplified.preview/density_bigxy_"); - // FLUID_3D::writeImageSliceXY(_densityBig, _resBig, _resBig[2]/2, prefix, _totalStepsBig, 1.0f); - //string df3prefix = string("./df3/density_big_"); - //IMAGE::dumpDF3(_totalStepsBig, df3prefix, _densityBig, _resBig[0],_resBig[1],_resBig[2]); - // string pbrtPrefix = string("./pbrt/density_big_"); - // IMAGE::dumpPBRT(_totalStepsBig, pbrtPrefix, _densityBig, _resBig[0],_resBig[1],_resBig[2]); - - _totalStepsBig++; + // add noise to velocity, but only if the turbulence is + // sufficiently undeformed, and the energy is large enough + // to make a difference + const bool addNoise = _eigMax[indexSmall] < 2. && + _eigMin[indexSmall] > 0.5; + + if (addNoise && amplitude > _cullingThreshold) { + // base amplitude for octave 0 + float amplitudeScaled = amplitude; + + for (int octave = 0; octave < _octaves; octave++) + { + // multiply the vector noise times the maximum allowed + // noise amplitude at this octave, and add it to the total + vel += WVelocityWithJacobian(texCoord, &xUnwarped[0], &yUnwarped[0], &zUnwarped[0]) * amplitudeScaled; + + // scale coefficient for next octave + amplitudeScaled *= persistence; + texCoord *= 2.0f; + } + } + + // Store velocity + turbulence in big grid for maccormack step + // + // If you wanted to save memory, you would instead perform a + // semi-Lagrangian backtrace for the current grid cell here. Then + // you could just throw the velocity away. + _bigUx[index] = vel[0]; + _bigUy[index] = vel[1]; + _bigUz[index] = vel[2]; + + // compute the velocity magnitude for substepping later + const float velMag = _bigUx[index] * _bigUx[index] + + _bigUy[index] * _bigUy[index] + + _bigUz[index] * _bigUz[index]; + if (velMag > maxVelMag1) maxVelMag1 = velMag; + + // zero out velocity inside obstacles + float obsCheck = INTERPOLATE::lerp3dToFloat( + obstacles, posSm[0], posSm[1], posSm[2], _xResSm, _yResSm, _zResSm); + + if (obsCheck > 0.95) + _bigUx[index] = _bigUy[index] = _bigUz[index] = 0.; + } // xyz + + #if PARALLEL==1 + maxVelMagThreads[id] = maxVelMag1; + #else + maxVelMagThreads[0] = maxVelMag1; + #endif + } + } // omp + + // compute maximum over threads + float maxVelMag = maxVelMagThreads[0]; + #if PARALLEL==1 + for (int i = 1; i < 8; i++) + if (maxVelMag < maxVelMagThreads[i]) + maxVelMag = maxVelMagThreads[i]; + #endif + + // prepare density for an advection + SWAP_POINTERS(_densityBig, _densityBigOld); + + // based on the maximum velocity present, see if we need to substep, + // but cap the maximum number of substeps to 5 + const int maxSubSteps = 25; + const int maxVel = 5; + maxVelMag = sqrt(maxVelMag) * dt; + int totalSubsteps = (int)(maxVelMag / (float)maxVel); + totalSubsteps = (totalSubsteps < 1) ? 1 : totalSubsteps; + // printf("totalSubsteps: %d\n", totalSubsteps); + totalSubsteps = (totalSubsteps > maxSubSteps) ? maxSubSteps : totalSubsteps; + const float dtSubdiv = dt / (float)totalSubsteps; + + // set boundaries of big velocity grid + FLUID_3D::setZeroX(_bigUx, _resBig); + FLUID_3D::setZeroY(_bigUy, _resBig); + FLUID_3D::setZeroZ(_bigUz, _resBig); + + // do the MacCormack advection, with substepping if necessary + for(int substep = 0; substep < totalSubsteps; substep++) + { + FLUID_3D::advectFieldMacCormack(dtSubdiv, _bigUx, _bigUy, _bigUz, + _densityBigOld, _densityBig, _tempBig1, _tempBig2, _resBig, NULL); + + if (substep < totalSubsteps - 1) + SWAP_POINTERS(_densityBig, _densityBigOld); + } // substep + + // wipe the density borders + FLUID_3D::setZeroBorder(_densityBig, _resBig); + + // reset texture coordinates now in preparation for next timestep + // Shouldn't do this before generating the noise because then the + // eigenvalues stored do not reflect the underlying texture coordinates + resetTextureCoordinates(); + + // output files + // string prefix = string("./amplified.preview/density_bigxy_"); + // FLUID_3D::writeImageSliceXY(_densityBig, _resBig, _resBig[2]/2, prefix, _totalStepsBig, 1.0f); + //string df3prefix = string("./df3/density_big_"); + //IMAGE::dumpDF3(_totalStepsBig, df3prefix, _densityBig, _resBig[0],_resBig[1],_resBig[2]); + // string pbrtPrefix = string("./pbrt/density_big_"); + // IMAGE::dumpPBRT(_totalStepsBig, pbrtPrefix, _densityBig, _resBig[0],_resBig[1],_resBig[2]); + + _totalStepsBig++; + + delete[] _bigUx; + delete[] _bigUy; + delete[] _bigUz; + + delete[] _tempBig1; + delete[] _tempBig2; } diff --git a/intern/smoke/intern/WTURBULENCE.h b/intern/smoke/intern/WTURBULENCE.h index d4e6b0c6a17..c21e002ad48 100644 --- a/intern/smoke/intern/WTURBULENCE.h +++ b/intern/smoke/intern/WTURBULENCE.h @@ -49,7 +49,7 @@ class WTURBULENCE void stepTurbulenceFull(float dt, float* xvel, float* yvel, float* zvel, unsigned char *obstacles); // texcoord functions - void advectTextureCoordinates(float dtOrg, float* xvel, float* yvel, float* zvel); + void advectTextureCoordinates (float dtOrg, float* xvel, float* yvel, float* zvel, float *_tempBig1, float *_tempBig2); void resetTextureCoordinates(); void computeEnergy(float* xvel, float* yvel, float* zvel, unsigned char *obstacles); @@ -73,7 +73,7 @@ class WTURBULENCE // is accessed on through rna gui float *_strength; - protected: + // protected: // enlargement factor from original velocity field / simulation // _Big = _amplify * _Sm int _amplify; @@ -111,26 +111,17 @@ class WTURBULENCE float* _densityBig; float* _densityBigOld; - // big velocity macCormack fields - float* _bigUx; - float* _bigUy; - float* _bigUz; - // temp arrays for BFECC and MacCormack - they have more convenient - // names in the actual implementations - float* _tempBig1; - float* _tempBig2; - // texture coordinates for noise float* _tcU; float* _tcV; float* _tcW; float* _tcTemp; - float* _eigMin; - float* _eigMax; + float* _eigMin; // no save -dg + float* _eigMax; // no save -dg // wavelet decomposition of velocity energies - float* _energy; + float* _energy; // no save -dg // noise data float* _noiseTile; @@ -140,7 +131,7 @@ class WTURBULENCE int _totalStepsBig; // highest frequency component of wavelet decomposition - float* _highFreqEnergy; + float* _highFreqEnergy; // no save -dg void computeEigenvalues(); void decomposeEnergy(); diff --git a/intern/smoke/intern/smoke_API.cpp b/intern/smoke/intern/smoke_API.cpp index 2e95a576eaf..5a016b51bbe 100644 --- a/intern/smoke/intern/smoke_API.cpp +++ b/intern/smoke/intern/smoke_API.cpp @@ -20,7 +20,7 @@ * The Original Code is Copyright (C) 2009 by Daniel Genrich * All rights reserved. * - * Contributor(s): None + * Contributor(s): Daniel Genrich * * ***** END GPL LICENSE BLOCK ***** */ @@ -137,7 +137,7 @@ extern "C" void smoke_dissolve(FLUID_3D *fluid, int speed, int log) } } -extern "C" void smoke_dissolve_wavelet(WTURBULENCE *wt, int speed, int log) +extern "C" void smoke_turbulence_dissolve(WTURBULENCE *wt, int speed, int log) { float *density = wt->getDensityBig(); Vec3Int r = wt->getResBig(); @@ -172,7 +172,7 @@ extern "C" void smoke_dissolve_wavelet(WTURBULENCE *wt, int speed, int log) } } -extern "C" void smoke_initWaveletBlenderRNA(WTURBULENCE *wt, float *strength) +extern "C" void smoke_turbulence_initBlenderRNA(WTURBULENCE *wt, float *strength) { wt->initBlenderRNA(strength); } @@ -181,6 +181,36 @@ template < class T > inline T ABS( T a ) { return (0 < a) ? a : -a ; } +extern "C" void smoke_export(FLUID_3D *fluid, float *dt, float *dx, float **dens, float **densold, float **heat, float **heatold, float **vx, float **vy, float **vz, float **vxold, float **vyold, float **vzold, unsigned char **obstacles) +{ + *dens = fluid->_density; + *densold = fluid->_densityOld; + *heat = fluid->_heat; + *heatold = fluid->_heatOld; + *vx = fluid->_xVelocity; + *vy = fluid->_yVelocity; + *vz = fluid->_zVelocity; + *vxold = fluid->_xVelocityOld; + *vyold = fluid->_yVelocityOld; + *vzold = fluid->_zVelocityOld; + *obstacles = fluid->_obstacles; + dt = &(fluid->_dt); + dx = &(fluid->_dx); + +} + +extern "C" void smoke_turbulence_export(WTURBULENCE *wt, float **dens, float **densold, float **tcu, float **tcv, float **tcw) +{ + if(!wt) + return; + + *dens = wt->_densityBig; + *densold = wt->_densityBigOld; + *tcu = wt->_tcU; + *tcv = wt->_tcV; + *tcw = wt->_tcW; +} + extern "C" float *smoke_get_density(FLUID_3D *fluid) { return fluid->_density; @@ -193,17 +223,17 @@ extern "C" float *smoke_get_heat(FLUID_3D *fluid) extern "C" float *smoke_get_velocity_x(FLUID_3D *fluid) { - return fluid->_xVorticity; + return fluid->_xVelocity; } extern "C" float *smoke_get_velocity_y(FLUID_3D *fluid) { - return fluid->_yVorticity; + return fluid->_yVelocity; } extern "C" float *smoke_get_velocity_z(FLUID_3D *fluid) { - return fluid->_zVorticity; + return fluid->_zVelocity; } extern "C" float *smoke_turbulence_get_density(WTURBULENCE *wt) @@ -211,14 +241,13 @@ extern "C" float *smoke_turbulence_get_density(WTURBULENCE *wt) return wt ? wt->getDensityBig() : NULL; } -extern "C" void smoke_turbulence_get_res(WTURBULENCE *wt, int *res) +extern "C" void smoke_turbulence_get_res(WTURBULENCE *wt, unsigned int *res) { if(wt) { - Vec3Int r = wt->getResBig(); - res[0] = r[0]; - res[1] = r[1]; - res[2] = r[2]; + res[0] = wt->_resBig[0]; + res[1] = wt->_resBig[1]; + res[2] = wt->_resBig[2]; } } diff --git a/release/ui/buttons_physics_smoke.py b/release/ui/buttons_physics_smoke.py index 7e2395216c0..d187e4c5901 100644 --- a/release/ui/buttons_physics_smoke.py +++ b/release/ui/buttons_physics_smoke.py @@ -1,6 +1,11 @@ import bpy +def smoke_panel_enabled_low(smd): + if smd.smoke_type == 'TYPE_DOMAIN': + return smd.domain.point_cache.baked==False + return True + class PhysicButtonsPanel(bpy.types.Panel): __space_type__ = "PROPERTIES" __region_type__ = "WINDOW" @@ -38,6 +43,8 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel): split.itemL() if md: + + # layout.enabled = smoke_panel_enabled(md) layout.itemR(md, "smoke_type", expand=True) if md.smoke_type == 'TYPE_DOMAIN': @@ -49,13 +56,6 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel): col = split.column() col.itemL(text="Resolution:") col.itemR(domain, "maxres", text="Divisions") - - col.itemL(text="Display:") - col.itemR(domain, "visibility", text="Resolution") - col.itemR(domain, "color", slider=True) - sub = col.column() - sub.active = domain.highres - sub.itemR(domain, "viewhighres") col = split.column() col.itemL(text="Behavior:") @@ -88,43 +88,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel): #elif md.smoke_type == 'TYPE_COLL': # layout.itemS() - -class PHYSICS_PT_smoke_highres(PhysicButtonsPanel): - __label__ = "Smoke High Resolution" - __default_closed__ = True - - def poll(self, context): - md = context.smoke - if md: - return (md.smoke_type == 'TYPE_DOMAIN') - - return False - - def draw_header(self, context): - layout = self.layout - - high = context.smoke.domain_settings - - layout.itemR(high, "highres", text="") - - def draw(self, context): - layout = self.layout - - high = context.smoke.domain_settings - - layout.active = high.highres - - split = layout.split() - - col = split.column() - col.itemL(text="Resolution:") - col.itemR(high, "amplify", text="Divisions") - - sub = split.column() - sub.itemL(text="Noise Method:") - sub.row().itemR(high, "noise_type", text="") - sub.itemR(high, "strength") - + class PHYSICS_PT_smoke_groups(PhysicButtonsPanel): __label__ = "Smoke Groups" __default_closed__ = True @@ -153,7 +117,168 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel): col = split.column() col.itemL(text="Collision Group:") col.itemR(group, "coll_group", text="") + +class PHYSICS_PT_smoke_cache(PhysicButtonsPanel): + __label__ = "Smoke Cache" + __default_closed__ = True + + def poll(self, context): + md = context.smoke + if md: + return (md.smoke_type == 'TYPE_DOMAIN') + + return False + + def draw(self, context): + layout = self.layout + + md = context.smoke + + if md.smoke_type == 'TYPE_DOMAIN': + + domain = md.domain_settings + cache = domain.point_cache + + layout.set_context_pointer("PointCache", cache) + + row = layout.row() + row.template_list(cache, "point_cache_list", cache, "active_point_cache_index") + col = row.column(align=True) + col.itemO("ptcache.add_new", icon="ICON_ZOOMIN", text="") + col.itemO("ptcache.remove", icon="ICON_ZOOMOUT", text="") + + row = layout.row() + row.itemR(cache, "name") + + row = layout.row() + row.itemR(cache, "start_frame") + row.itemR(cache, "end_frame") + + row = layout.row() + + if cache.baked == True: + row.itemO("ptcache.free_bake", text="Free Bake") + else: + row.item_booleanO("ptcache.bake", "bake", True, text="Bake") + + subrow = row.row() + subrow.enabled = cache.frames_skipped or cache.outdated + subrow.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame") + + row = layout.row() + #row.enabled = smoke_panel_enabled(psys) + row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake") + + row = layout.row() + #row.enabled = smoke_panel_enabled(psys) + + layout.itemL(text=cache.info) + + layout.itemS() + + row = layout.row() + row.itemO("ptcache.bake_all", "bake", True, text="Bake All Dynamics") + row.itemO("ptcache.free_bake_all", text="Free All Bakes") + layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame") + +class PHYSICS_PT_smoke_highres(PhysicButtonsPanel): + __label__ = "Smoke High Resolution" + __default_closed__ = True + + def poll(self, context): + md = context.smoke + if md: + return (md.smoke_type == 'TYPE_DOMAIN') + + return False + + def draw_header(self, context): + layout = self.layout + + high = context.smoke.domain_settings + + layout.itemR(high, "highres", text="") + + def draw(self, context): + layout = self.layout + + md = context.smoke_hr + + if md: + + split = layout.split() + + col = split.column() + col.itemL(text="Resolution:") + col.itemR(md, "amplify", text="Divisions") + + sub = split.column() + sub.itemL(text="Noise Method:") + sub.row().itemR(md, "noise_type", text="") + sub.itemR(md, "strength") + sub.itemR(md, "show_highres") + +class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel): + __label__ = "Smoke Cache" + __default_closed__ = True + + def poll(self, context): + return (context.smoke_hr != None) + + def draw(self, context): + layout = self.layout + + md = context.smoke_hr + + if md: + + cache = md.point_cache + + layout.set_context_pointer("PointCache", cache) + + row = layout.row() + row.template_list(cache, "point_cache_list", cache, "active_point_cache_index") + col = row.column(align=True) + col.itemO("ptcache.add_new", icon="ICON_ZOOMIN", text="") + col.itemO("ptcache.remove", icon="ICON_ZOOMOUT", text="") + + row = layout.row() + row.itemR(cache, "name") + + row = layout.row() + row.itemR(cache, "start_frame") + row.itemR(cache, "end_frame") + + row = layout.row() + + if cache.baked == True: + row.itemO("ptcache.free_bake", text="Free Bake") + else: + row.item_booleanO("ptcache.bake", "bake", True, text="Bake") + + subrow = row.row() + subrow.enabled = cache.frames_skipped or cache.outdated + subrow.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame") + + row = layout.row() + #row.enabled = smoke_panel_enabled(psys) + row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake") + + row = layout.row() + #row.enabled = smoke_panel_enabled(psys) + + layout.itemL(text=cache.info) + + layout.itemS() + + row = layout.row() + row.itemO("ptcache.bake_all", "bake", True, text="Bake All Dynamics") + row.itemO("ptcache.free_bake_all", text="Free All Bakes") + layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame") + bpy.types.register(PHYSICS_PT_smoke) -bpy.types.register(PHYSICS_PT_smoke_highres) +bpy.types.register(PHYSICS_PT_smoke_cache) bpy.types.register(PHYSICS_PT_smoke_groups) +#bpy.types.register(PHYSICS_PT_smoke_highres) +#bpy.types.register(PHYSICS_PT_smoke_cache_highres) diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h index 5d9dddfe30d..531487549da 100644 --- a/source/blender/blenkernel/BKE_pointcache.h +++ b/source/blender/blenkernel/BKE_pointcache.h @@ -60,8 +60,8 @@ #define PTCACHE_TYPE_SOFTBODY 0 #define PTCACHE_TYPE_PARTICLES 1 #define PTCACHE_TYPE_CLOTH 2 -#define PTCACHE_TYPE_SMOKE_DOMAIN_LOW 3 -#define PTCACHE_TYPE_SMOKE_DOMAIN_HIGH 4 +#define PTCACHE_TYPE_SMOKE_DOMAIN 3 +#define PTCACHE_TYPE_SMOKE_HIGHRES 4 /* PTCache read return code */ #define PTCACHE_READ_EXACT 1 @@ -158,7 +158,7 @@ void BKE_ptcache_make_particle_key(struct ParticleKey *key, int index, void **da void BKE_ptcache_id_from_softbody(PTCacheID *pid, struct Object *ob, struct SoftBody *sb); void BKE_ptcache_id_from_particles(PTCacheID *pid, struct Object *ob, struct ParticleSystem *psys); void BKE_ptcache_id_from_cloth(PTCacheID *pid, struct Object *ob, struct ClothModifierData *clmd); -void BKE_ptcache_id_from_smoke(PTCacheID *pid, struct Object *ob, struct SmokeModifierData *smd, int num); +void BKE_ptcache_id_from_smoke(PTCacheID *pid, struct Object *ob, struct SmokeModifierData *smd); void BKE_ptcache_ids_from_object(struct ListBase *lb, struct Object *ob); diff --git a/source/blender/blenkernel/BKE_smoke.h b/source/blender/blenkernel/BKE_smoke.h index 8dc38640e9a..bd8581112f8 100644 --- a/source/blender/blenkernel/BKE_smoke.h +++ b/source/blender/blenkernel/BKE_smoke.h @@ -32,24 +32,17 @@ #ifndef BKE_SMOKE_H_ #define BKE_SMOKE_H_ +typedef int (*bresenham_callback) (float *input, int res[3], int *pixel, float *tRay); + void smokeModifier_do(struct SmokeModifierData *smd, struct Scene *scene, struct Object *ob, struct DerivedMesh *dm, int useRenderParams, int isFinalCalc); void smokeModifier_free (struct SmokeModifierData *smd); void smokeModifier_reset(struct SmokeModifierData *smd); void smokeModifier_createType(struct SmokeModifierData *smd); -void smoke_set_tray(struct SmokeModifierData *smd, size_t index, float transparency); -float smoke_get_tray(struct SmokeModifierData *smd, size_t index); -float smoke_get_tvox(struct SmokeModifierData *smd, size_t index); -void smoke_set_tvox(struct SmokeModifierData *smd, size_t index, float tvox); +// high res modifier +void smokeHRModifier_do(struct SmokeHRModifierData *shrmd, struct Scene *scene, struct Object *ob, int useRenderParams, int isFinalCalc); +void smokeHRModifier_free(struct SmokeHRModifierData *shrmd); -void smoke_set_bigtray(struct SmokeModifierData *smd, size_t index, float transparency); -float smoke_get_bigtray(struct SmokeModifierData *smd, size_t index); -float smoke_get_bigtvox(struct SmokeModifierData *smd, size_t index); -void smoke_set_bigtvox(struct SmokeModifierData *smd, size_t index, float tvox); - -long long smoke_get_mem_req(int xres, int yres, int zres, int amplify); -void smoke_prepare_View(struct SmokeModifierData *smd, float *light); -void smoke_prepare_bigView(struct SmokeModifierData *smd, float *light); #endif /* BKE_SMOKE_H_ */ diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index 8d1df98c5b4..17079205423 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -34,6 +34,8 @@ SET(INC ../nodes ../../../extern/glew/include ../gpu ../makesrna ../../../intern/smoke/extern ../../../intern/bsp/extern ../blenfont ../../../intern/audaspace/intern + ../../../extern/lzo/minilzo + ../../../extern/lzma ${ZLIB_INC} ) diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript index fdc7782a0b1..0c7922de6ff 100644 --- a/source/blender/blenkernel/SConscript +++ b/source/blender/blenkernel/SConscript @@ -11,6 +11,8 @@ incs += ' #/extern/bullet2/src' incs += ' #/intern/opennl/extern #/intern/bsp/extern' incs += ' ../gpu #/extern/glew/include' incs += ' #/intern/smoke/extern' +incs += ' #/extern/lzo/minilzo' +incs += ' #/extern/lzma' incs += ' #/intern/audaspace/intern' incs += ' ' + env['BF_OPENGL_INC'] diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 53d1baa5c9c..1e2560bf809 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -5801,26 +5801,6 @@ static void smokeModifier_initData(ModifierData *md) smd->coll = NULL; smd->type = 0; smd->time = -1; - - /* - smd->fluid = NULL; - smd->maxres = 48; - smd->amplify = 4; - smd->omega = 0.5; - smd->time = 0; - smd->flags = 0; - smd->noise = MOD_SMOKE_NOISEWAVE; - smd->visibility = 1; - - // init 3dview buffer - smd->tvox = NULL; - smd->tray = NULL; - smd->tvoxbig = NULL; - smd->traybig = NULL; - smd->viewsettings = 0; - smd->bind = NULL; - smd->max_textures = 0; - */ } static void smokeModifier_freeData(ModifierData *md) @@ -5884,6 +5864,50 @@ static void smokeModifier_updateDepgraph( */ } + +/* Smoke High Resolution */ + +static void smokeHRModifier_initData(ModifierData *md) +{ + SmokeHRModifierData *shrmd = (SmokeHRModifierData*) md; + + shrmd->wt = NULL; + shrmd->time = -1; + shrmd->strength = 2.0f; + shrmd->amplify = 1; + shrmd->noise = MOD_SMOKE_NOISEWAVE; + shrmd->point_cache = BKE_ptcache_add(&shrmd->ptcaches); + shrmd->point_cache->flag |= PTCACHE_DISK_CACHE; + shrmd->point_cache->step = 1; +} + +static void smokeHRModifier_freeData(ModifierData *md) +{ + SmokeHRModifierData *shrmd = (SmokeHRModifierData*) md; + + smokeHRModifier_free (shrmd); +} + +static void smokeHRModifier_deformVerts( + ModifierData *md, Object *ob, DerivedMesh *derivedData, + float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) +{ + SmokeHRModifierData *shrmd = (SmokeHRModifierData*) md; + smokeHRModifier_do(shrmd, md->scene, ob, useRenderParams, isFinalCalc); +} + +static int smokeHRModifier_dependsOnTime(ModifierData *md) +{ + return 1; +} + +static void smokeHRModifier_updateDepgraph( + ModifierData *md, DagForest *forest, Scene *scene, Object *ob, + DagNode *obNode) +{ + ; +} + /* Cloth */ static void clothModifier_initData(ModifierData *md) @@ -8580,10 +8604,23 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type) mti->type = eModifierTypeType_OnlyDeform; mti->initData = smokeModifier_initData; mti->freeData = smokeModifier_freeData; - mti->flags = eModifierTypeFlag_AcceptsMesh; + mti->flags = eModifierTypeFlag_AcceptsMesh + | eModifierTypeFlag_UsesPointCache + | eModifierTypeFlag_Single; mti->deformVerts = smokeModifier_deformVerts; mti->dependsOnTime = smokeModifier_dependsOnTime; mti->updateDepgraph = smokeModifier_updateDepgraph; + + mti = INIT_TYPE(SmokeHR); + mti->type = eModifierTypeType_OnlyDeform; + mti->initData = smokeHRModifier_initData; + mti->freeData = smokeHRModifier_freeData; + mti->flags = eModifierTypeFlag_AcceptsMesh + | eModifierTypeFlag_UsesPointCache + | eModifierTypeFlag_Single; + mti->deformVerts = smokeHRModifier_deformVerts; + mti->dependsOnTime = smokeHRModifier_dependsOnTime; + mti->updateDepgraph = smokeHRModifier_updateDepgraph; mti = INIT_TYPE(Cloth); mti->type = eModifierTypeType_Nonconstructive; diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 09170d92866..ca27bde039b 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -59,7 +59,12 @@ #include "BLI_blenlib.h" +/* both in intern */ #include "smoke_API.h" +#include "minilzo.h" + +#include "LzmaLib.h" + /* needed for directory lookup */ #ifndef WIN32 @@ -469,43 +474,116 @@ void BKE_ptcache_id_from_particles(PTCacheID *pid, Object *ob, ParticleSystem *p pid->info_types= (1<domain; - if(sds->fluid) - { + if(sds->fluid) { return sds->res[0]*sds->res[1]*sds->res[2]; } else return 0; } +static int ptcache_totpoint_smoke_turbulence(void *smoke_v) +{ + SmokeHRModifierData *shrmd= (SmokeHRModifierData *)smoke_v; + + if(shrmd->wt) { + /* + unsigned int res[3]; + + smoke_turbulence_get_res(sds->wt, res); + return res[0]*res[1]*res[2]; + */ + return 0; + } + else + return 0; +} + // forward decleration static int ptcache_file_write(PTCacheFile *pf, void *f, size_t tot, int size); +static int ptcache_compress_write(PTCacheFile *pf, unsigned char *in, unsigned int in_len, unsigned char *out, int mode) +{ + int r; + unsigned char compressed; + LZO_HEAP_ALLOC(wrkmem, LZO1X_MEM_COMPRESS); + unsigned int out_len = LZO_OUT_LEN(in_len); + unsigned char *props = MEM_callocN(16*sizeof(char), "tmp"); + size_t sizeOfIt = 5; + + if(mode == 1) { + r = lzo1x_1_compress(in, (lzo_uint)in_len, out, (lzo_uint *)&out_len, wrkmem); + if (!(r == LZO_E_OK) || (out_len >= in_len)) + compressed = 0; + else + compressed = 1; + } + else if(mode == 2) { + + r = LzmaCompress(out, (size_t *)&out_len, in, in_len,//assume sizeof(char)==1.... + props, &sizeOfIt, 5, 1 << 24, 3, 0, 2, 32, 2); + + if(!(r == SZ_OK) || (out_len >= in_len)) + compressed = 0; + else + compressed = 2; + } + + ptcache_file_write(pf, &compressed, 1, sizeof(unsigned char)); + if(compressed) { + ptcache_file_write(pf, &out_len, 1, sizeof(unsigned int)); + ptcache_file_write(pf, out, out_len, sizeof(unsigned char)); + } + else + ptcache_file_write(pf, in, in_len, sizeof(unsigned char)); + + if(compressed == 2) + { + ptcache_file_write(pf, &sizeOfIt, 1, sizeof(unsigned int)); + ptcache_file_write(pf, props, sizeOfIt, sizeof(unsigned char)); + } + + MEM_freeN(props); + + return r; +} + static int ptcache_write_smoke(PTCacheFile *pf, void *smoke_v) { SmokeModifierData *smd= (SmokeModifierData *)smoke_v; SmokeDomainSettings *sds = smd->domain; - if(sds->fluid) - { + if(sds->fluid) { size_t res = sds->res[0]*sds->res[1]*sds->res[2]; - float *dens, *densold, *heat, *heatold, *vx, *vy, *vz; - - smoke_export(sds->fluid, &dens, &densold, &heat, &heatold, &vx, &vy, &vz); - - ptcache_file_write(pf, dens, res, sizeof(float)); - ptcache_file_write(pf, densold, res, sizeof(float)); - ptcache_file_write(pf, heat, res, sizeof(float)); - ptcache_file_write(pf, heatold, res, sizeof(float)); - ptcache_file_write(pf, vx, res, sizeof(float)); - ptcache_file_write(pf, vy, res, sizeof(float)); - ptcache_file_write(pf, vz, res, sizeof(float)); + float dt, dx, *dens, *densold, *heat, *heatold, *vx, *vy, *vz, *vxold, *vyold, *vzold; + unsigned char *obstacles; + unsigned int in_len = sizeof(float)*(unsigned int)res; + unsigned char *out = (unsigned char *)MEM_callocN(LZO_OUT_LEN(in_len)*4, "pointcache_lzo_buffer"); + int mode = res >= 1000000 ? 2 : 1; + + smoke_export(sds->fluid, &dt, &dx, &dens, &densold, &heat, &heatold, &vx, &vy, &vz, &vxold, &vyold, &vzold, &obstacles); + + ptcache_compress_write(pf, (unsigned char *)sds->view3d, in_len*4, out, mode); + ptcache_compress_write(pf, (unsigned char *)dens, in_len, out, mode); + ptcache_compress_write(pf, (unsigned char *)densold, in_len, out, mode); + ptcache_compress_write(pf, (unsigned char *)heat, in_len, out, mode); + ptcache_compress_write(pf, (unsigned char *)heatold, in_len, out, mode); + ptcache_compress_write(pf, (unsigned char *)vx, in_len, out, mode); + ptcache_compress_write(pf, (unsigned char *)vy, in_len, out, mode); + ptcache_compress_write(pf, (unsigned char *)vz, in_len, out, mode); + ptcache_compress_write(pf, (unsigned char *)vxold, in_len, out, mode); + ptcache_compress_write(pf, (unsigned char *)vyold, in_len, out, mode); + ptcache_compress_write(pf, (unsigned char *)vzold, in_len, out, mode); + ptcache_compress_write(pf, (unsigned char *)obstacles, (unsigned int)res, out, mode); + ptcache_file_write(pf, &dt, 1, sizeof(float)); + ptcache_file_write(pf, &dx, 1, sizeof(float)); + + MEM_freeN(out); return 1; } @@ -513,32 +591,134 @@ static int ptcache_write_smoke(PTCacheFile *pf, void *smoke_v) return 0; } +static int ptcache_write_smoke_turbulence(PTCacheFile *pf, void *smoke_v) +{ + SmokeModifierData *smd= (SmokeModifierData *)smoke_v; + SmokeDomainSettings *sds = smd->domain; + /* + if(sds->wt) { + unsigned int res_big[3]; + size_t res = sds->res[0]*sds->res[1]*sds->res[2]; + float *dens, *densold, *tcu, *tcv, *tcw; + unsigned int in_len = sizeof(float)*(unsigned int)res; + unsigned int in_len_big = sizeof(float) * (unsigned int)res_big; + unsigned char *out; + int mode; + + smoke_turbulence_get_res(sds->wt, res_big); + mode = res_big[0]*res_big[1]*res_big[2] >= 1000000 ? 2 : 1; + + smoke_turbulence_export(sds->wt, &dens, &densold, &tcu, &tcv, &tcw); + + out = (unsigned char *)MEM_callocN(LZO_OUT_LEN(in_len_big), "pointcache_lzo_buffer"); + + ptcache_compress_write(pf, (unsigned char *)dens, in_len_big, out, mode); + ptcache_compress_write(pf, (unsigned char *)densold, in_len_big, out, mode); + + MEM_freeN(out); + out = (unsigned char *)MEM_callocN(LZO_OUT_LEN(in_len), "pointcache_lzo_buffer"); + ptcache_compress_write(pf, (unsigned char *)tcu, in_len, out, mode); + ptcache_compress_write(pf, (unsigned char *)tcv, in_len, out, mode); + ptcache_compress_write(pf, (unsigned char *)tcw, in_len, out, mode); + MEM_freeN(out); + + return 1; + } +*/ + return 0; +} + // forward decleration static int ptcache_file_read(PTCacheFile *pf, void *f, size_t tot, int size); +static int ptcache_compress_read(PTCacheFile *pf, unsigned char *result, unsigned int len) +{ + int r; + unsigned char compressed = 0; + unsigned int in_len; + unsigned int out_len = len; + unsigned char *in; + unsigned char *props = MEM_callocN(16*sizeof(char), "tmp"); + size_t sizeOfIt = 5; + + ptcache_file_read(pf, &compressed, 1, sizeof(unsigned char)); + if(compressed) { + ptcache_file_read(pf, &in_len, 1, sizeof(unsigned int)); + in = (unsigned char *)MEM_callocN(sizeof(unsigned char)*in_len, "pointcache_compressed_buffer"); + ptcache_file_read(pf, in, in_len, sizeof(unsigned char)); + + if(compressed == 1) + r = lzo1x_decompress(in, (lzo_uint)in_len, result, (lzo_uint *)&out_len, NULL); + else if(compressed == 2) + { + size_t leni = in_len, leno = out_len; + ptcache_file_read(pf, &sizeOfIt, 1, sizeof(unsigned int)); + ptcache_file_read(pf, props, sizeOfIt, sizeof(unsigned char)); + r = LzmaUncompress(result, &leno, in, &leni, props, sizeOfIt); + } + + MEM_freeN(in); + } + else { + ptcache_file_read(pf, result, len, sizeof(unsigned char)); + } + + MEM_freeN(props); + + return r; +} + static void ptcache_read_smoke(PTCacheFile *pf, void *smoke_v) { SmokeModifierData *smd= (SmokeModifierData *)smoke_v; SmokeDomainSettings *sds = smd->domain; - if(sds->fluid) - { + if(sds->fluid) { size_t res = sds->res[0]*sds->res[1]*sds->res[2]; - float *dens, *densold, *heat, *heatold, *vx, *vy, *vz; + float dt, dx, *dens, *densold, *heat, *heatold, *vx, *vy, *vz, *vxold, *vyold, *vzold; + unsigned char *obstacles; + unsigned int out_len = (unsigned int)res * sizeof(float); - smoke_export(sds->fluid, &dens, &densold, &heat, &heatold, &vx, &vy, &vz); + smoke_export(sds->fluid, &dt, &dx, &dens, &densold, &heat, &heatold, &vx, &vy, &vz, &vxold, &vyold, &vzold, &obstacles); - ptcache_file_read(pf, dens, res, sizeof(float)); - ptcache_file_read(pf, densold, res, sizeof(float)); - ptcache_file_read(pf, heat, res, sizeof(float)); - ptcache_file_read(pf, heatold, res, sizeof(float)); - ptcache_file_read(pf, vx, res, sizeof(float)); - ptcache_file_read(pf, vy, res, sizeof(float)); - ptcache_file_read(pf, vz, res, sizeof(float)); - + ptcache_compress_read(pf, (unsigned char *)sds->view3d, out_len*4); + ptcache_compress_read(pf, (unsigned char*)dens, out_len); + ptcache_compress_read(pf, (unsigned char*)densold, out_len); + ptcache_compress_read(pf, (unsigned char*)heat, out_len); + ptcache_compress_read(pf, (unsigned char*)heatold, out_len); + ptcache_compress_read(pf, (unsigned char*)vx, out_len); + ptcache_compress_read(pf, (unsigned char*)vy, out_len); + ptcache_compress_read(pf, (unsigned char*)vz, out_len); + ptcache_compress_read(pf, (unsigned char*)vxold, out_len); + ptcache_compress_read(pf, (unsigned char*)vyold, out_len); + ptcache_compress_read(pf, (unsigned char*)vzold, out_len); + ptcache_compress_read(pf, (unsigned char*)obstacles, (unsigned int)res); + ptcache_file_read(pf, &dt, 1, sizeof(float)); + ptcache_file_read(pf, &dx, 1, sizeof(float)); } } -void BKE_ptcache_id_from_smoke(PTCacheID *pid, struct Object *ob, struct SmokeModifierData *smd, int num) + +static void ptcache_read_smoke_turbulence(PTCacheFile *pf, void *smoke_v) +{ + SmokeModifierData *smd= (SmokeModifierData *)smoke_v; + SmokeDomainSettings *sds = smd->domain; + /* + if(sds->fluid) { + unsigned int res[3]; + float *dens, *densold, *tcu, *tcv, *tcw; + unsigned int out_len = sizeof(float)*(unsigned int)res; + + smoke_turbulence_get_res(sds->wt, res); + + smoke_turbulence_export(sds->wt, &dens, &densold, &tcu, &tcv, &tcw); + + ptcache_compress_read(pf, (unsigned char*)dens, out_len); + + } + */ +} + +void BKE_ptcache_id_from_smoke(PTCacheID *pid, struct Object *ob, struct SmokeModifierData *smd) { SmokeDomainSettings *sds = smd->domain; @@ -547,24 +727,21 @@ void BKE_ptcache_id_from_smoke(PTCacheID *pid, struct Object *ob, struct SmokeMo pid->ob= ob; pid->calldata= smd; - // if(num == 0) - pid->type= PTCACHE_TYPE_SMOKE_DOMAIN_LOW; - // else if(num == 1) - // pid->type= PTCACHE_TYPE_SMOKE_DOMAIN_HIGH; - + pid->type= PTCACHE_TYPE_SMOKE_DOMAIN; pid->stack_index= modifiers_indexInObject(ob, (ModifierData *)smd); pid->cache= sds->point_cache; pid->cache_ptr= &sds->point_cache; pid->ptcaches= &sds->ptcaches; - pid->totpoint= pid->totwrite= ptcache_totpoint_smoke; pid->write_elem= NULL; pid->read_elem= NULL; + pid->read_stream = ptcache_read_smoke; pid->write_stream = ptcache_write_smoke; + pid->interpolate_elem= NULL; pid->write_header= ptcache_write_basic_header; @@ -573,7 +750,6 @@ void BKE_ptcache_id_from_smoke(PTCacheID *pid, struct Object *ob, struct SmokeMo pid->data_types= (1<info_types= 0; } -#endif // XXX smoke poitcache stuff breaks compiling void BKE_ptcache_id_from_cloth(PTCacheID *pid, Object *ob, ClothModifierData *clmd) { @@ -633,18 +809,15 @@ void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob) BKE_ptcache_id_from_cloth(pid, ob, (ClothModifierData*)md); BLI_addtail(lb, pid); } - /* - // enabled on next commit if(md->type == eModifierType_Smoke) { SmokeModifierData *smd = (SmokeModifierData *)md; if(smd->type & MOD_SMOKE_TYPE_DOMAIN) { pid= MEM_callocN(sizeof(PTCacheID), "PTCacheID"); - BKE_ptcache_id_from_smoke(pid, ob, (SmokeModifierData*)md, 0); + BKE_ptcache_id_from_smoke(pid, ob, (SmokeModifierData*)md); BLI_addtail(lb, pid); } } - */ } } @@ -1140,13 +1313,13 @@ int BKE_ptcache_read_cache(PTCacheID *pid, float cfra, float frs_sec) if(use_old) { if(pid->read_elem && ptcache_file_read(pf, (void*)old_data1, 1, old_elemsize)) pid->read_elem(i, pid->calldata, NULL, frs_sec, cfra, old_data1); - else + else if(pid->read_elem) { error = 1; break; } } else { if(pid->read_elem && (pm || ptcache_file_read_data(pf))) pid->read_elem(*index, pid->calldata, pm ? pm->cur : pf->cur, frs_sec, cfra1 ? (float)cfra1 : (float)cfrai, NULL); - else + else if(pid->read_elem) { error = 1; break; } } @@ -1185,7 +1358,7 @@ int BKE_ptcache_read_cache(PTCacheID *pid, float cfra, float frs_sec) else { error = 1; break; } } - else + else if(pid->read_elem) { error = 1; break; } } else { @@ -1197,7 +1370,7 @@ int BKE_ptcache_read_cache(PTCacheID *pid, float cfra, float frs_sec) else { error = 1; break; } } - else + else if(pid->read_elem) { error = 1; break; } } @@ -1639,8 +1812,11 @@ int BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode) sbFreeSimulation(pid->calldata); else if(pid->type == PTCACHE_TYPE_PARTICLES) psys_reset(pid->calldata, PSYS_RESET_DEPSGRAPH); - else if(pid->type == PTCACHE_TYPE_SMOKE_DOMAIN_LOW) + else if(pid->type == PTCACHE_TYPE_SMOKE_DOMAIN) + { smokeModifier_reset(pid->calldata); + printf("reset PTCACHE_TYPE_SMOKE_DOMAIN\n"); + } } if(clear) BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0); @@ -1689,17 +1865,14 @@ int BKE_ptcache_object_reset(Scene *scene, Object *ob, int mode) BKE_ptcache_id_from_cloth(&pid, ob, (ClothModifierData*)md); reset |= BKE_ptcache_id_reset(scene, &pid, mode); } - /* - // enabled on next commit if(md->type == eModifierType_Smoke) { SmokeModifierData *smd = (SmokeModifierData *)md; if(smd->type & MOD_SMOKE_TYPE_DOMAIN) { - BKE_ptcache_id_from_smoke(&pid, ob, (SmokeModifierData*)md, 0); + BKE_ptcache_id_from_smoke(&pid, ob, (SmokeModifierData*)md); reset |= BKE_ptcache_id_reset(scene, &pid, mode); } } - */ } return reset; diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 22ea41276ff..6449ae10eee 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -54,10 +54,13 @@ #include "BKE_DerivedMesh.h" #include "BKE_modifier.h" #include "BKE_particle.h" +#include "BKE_pointcache.h" +#include "BKE_smoke.h" #include "BKE_utildefines.h" #include "DNA_customdata_types.h" #include "DNA_group_types.h" +#include "DNA_lamp_types.h" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" #include "DNA_modifier_types.h" @@ -120,9 +123,9 @@ struct DerivedMesh; struct SmokeModifierData; // forward declerations -static void get_cell(struct SmokeModifierData *smd, float *pos, int *cell, int correct); -static void get_bigcell(struct SmokeModifierData *smd, float *pos, int *cell, int correct); +void get_cell(float *p0, int res[3], float dx, float *pos, int *cell, int correct); void calcTriangleDivs(Object *ob, MVert *verts, int numverts, MFace *tris, int numfaces, int numtris, int **tridivs, float cell_len); +void smoke_prepare_View(SmokeModifierData *smd, float framenr, float *light, int have_light); #define TRI_UVOFFSET (1./4.) @@ -205,17 +208,18 @@ int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, Derive // TODO: put in failsafe if res<=0 - dg // printf("res[0]: %d, res[1]: %d, res[2]: %d\n", smd->domain->res[0], smd->domain->res[1], smd->domain->res[2]); - // dt max is 0.1 smd->domain->fluid = smoke_init(smd->domain->res, smd->domain->p0, 0.1); - smd->domain->wt = smoke_turbulence_init(smd->domain->res, (smd->domain->flags & MOD_SMOKE_HIGHRES) ? (smd->domain->amplify + 1) : 0, smd->domain->noise); smd->time = scene->r.cfra; smd->domain->firstframe = smd->time; - - smoke_initBlenderRNA(smd->domain->fluid, &(smd->domain->alpha), &(smd->domain->beta)); - if(smd->domain->wt) - smoke_initWaveletBlenderRNA(smd->domain->wt, &(smd->domain->strength)); + if(!smd->domain->view3d) + { + // TVox is for transparency + smd->domain->view3d = MEM_callocN(sizeof(float)*smd->domain->res[0]*smd->domain->res[1]*smd->domain->res[2]*4, "Smoke_tVox"); + } + + smoke_initBlenderRNA(smd->domain->fluid, &(smd->domain->alpha), &(smd->domain->beta)); return 1; } @@ -256,7 +260,8 @@ int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, Derive SmokeCollSettings *scs = smd->coll; MVert *mvert = dm->getVertArray(dm); MFace *mface = dm->getFaceArray(dm); - size_t i = 0, divs = 0; + size_t i = 0; + int divs = 0; int *tridivs = NULL; float cell_len = 1.0 / 50.0; // for res = 50 size_t newdivs = 0; @@ -507,27 +512,14 @@ void smokeModifier_freeDomain(SmokeModifierData *smd) if(smd->domain) { // free visualisation buffers - if(smd->domain->bind) - { - glDeleteTextures(smd->domain->max_textures, (GLuint *)smd->domain->bind); - MEM_freeN(smd->domain->bind); - } - smd->domain->max_textures = 0; // unnecessary but let's be sure - - if(smd->domain->tray) - MEM_freeN(smd->domain->tray); - if(smd->domain->tvox) - MEM_freeN(smd->domain->tvox); - if(smd->domain->traybig) - MEM_freeN(smd->domain->traybig); - if(smd->domain->tvoxbig) - MEM_freeN(smd->domain->tvoxbig); - + if(smd->domain->view3d) + MEM_freeN(smd->domain->view3d); + if(smd->domain->fluid) smoke_free(smd->domain->fluid); - if(smd->domain->wt) - smoke_turbulence_free(smd->domain->wt); + BKE_ptcache_free_list(&smd->domain->ptcaches); + smd->domain->point_cache = NULL; MEM_freeN(smd->domain); smd->domain = NULL; @@ -582,44 +574,24 @@ void smokeModifier_reset(struct SmokeModifierData *smd) { if(smd->domain) { - // free visualisation buffers - if(smd->domain->bind) - { - glDeleteTextures(smd->domain->max_textures, (GLuint *)smd->domain->bind); - MEM_freeN(smd->domain->bind); - smd->domain->bind = NULL; - } - smd->domain->max_textures = 0; - if(smd->domain->viewsettings < MOD_SMOKE_VIEW_USEBIG) - smd->domain->viewsettings = 0; - else - smd->domain->viewsettings = MOD_SMOKE_VIEW_USEBIG; + if(smd->domain->view3d) + MEM_freeN(smd->domain->view3d); + smd->domain->view3d = NULL; - if(smd->domain->tray) - MEM_freeN(smd->domain->tray); - if(smd->domain->tvox) - MEM_freeN(smd->domain->tvox); - if(smd->domain->traybig) - MEM_freeN(smd->domain->traybig); - if(smd->domain->tvoxbig) - MEM_freeN(smd->domain->tvoxbig); - - smd->domain->tvox = NULL; - smd->domain->tray = NULL; - smd->domain->tvoxbig = NULL; - smd->domain->traybig = NULL; + smd->domain->tex = NULL; if(smd->domain->fluid) { smoke_free(smd->domain->fluid); smd->domain->fluid = NULL; } - - if(smd->domain->wt) - { - smoke_turbulence_free(smd->domain->wt); - smd->domain->wt = NULL; - } + + smd->domain->point_cache->flag &= ~PTCACHE_SIMULATION_VALID; + smd->domain->point_cache->flag |= PTCACHE_OUTDATED; + smd->domain->point_cache->simframe= 0; + smd->domain->point_cache->last_exact= 0; + + printf("reset_domain\n"); } else if(smd->flow) { @@ -677,31 +649,24 @@ void smokeModifier_createType(struct SmokeModifierData *smd) smd->domain->smd = smd; + smd->domain->point_cache = BKE_ptcache_add(&smd->domain->ptcaches); + smd->domain->point_cache->flag |= PTCACHE_DISK_CACHE; + smd->domain->point_cache->step = 1; + /* set some standard values */ smd->domain->fluid = NULL; - smd->domain->wt = NULL; smd->domain->eff_group = NULL; smd->domain->fluid_group = NULL; smd->domain->coll_group = NULL; smd->domain->maxres = 32; - smd->domain->amplify = 1; - smd->domain->omega = 1.0; smd->domain->alpha = -0.001; smd->domain->beta = 0.1; smd->domain->flags = MOD_SMOKE_DISSOLVE_LOG; - smd->domain->strength = 2.0; - smd->domain->noise = MOD_SMOKE_NOISEWAVE; - smd->domain->visibility = 1; smd->domain->diss_speed = 5; // init 3dview buffer - smd->domain->tvox = NULL; - smd->domain->tray = NULL; - smd->domain->tvoxbig = NULL; - smd->domain->traybig = NULL; - smd->domain->viewsettings = 0; - smd->domain->bind = NULL; - smd->domain->max_textures = 0; + smd->domain->view3d = NULL; + smd->domain->tex = NULL; } else if(smd->type & MOD_SMOKE_TYPE_FLOW) { @@ -736,15 +701,15 @@ void smokeModifier_createType(struct SmokeModifierData *smd) } // forward declaration -void smoke_calc_transparency(struct SmokeModifierData *smd, float *light, int big); +void smoke_simulate_domain(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedMesh *dm); void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedMesh *dm, int useRenderParams, int isFinalCalc) { - if(scene->r.cfra >= smd->time) - smokeModifier_init(smd, ob, scene, dm); - if((smd->type & MOD_SMOKE_TYPE_FLOW)) { + if(scene->r.cfra >= smd->time) + smokeModifier_init(smd, ob, scene, dm); + if(scene->r.cfra > smd->time) { // XXX TODO @@ -764,6 +729,9 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM } else if(smd->type & MOD_SMOKE_TYPE_COLL) { + if(scene->r.cfra >= smd->time) + smokeModifier_init(smd, ob, scene, dm); + if(scene->r.cfra > smd->time) { // XXX TODO @@ -786,459 +754,484 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM } else if(smd->type & MOD_SMOKE_TYPE_DOMAIN) { + PointCache *cache; + PTCacheID pid; + float timescale; + int cache_result = 0; + int startframe, endframe, framenr; SmokeDomainSettings *sds = smd->domain; + float light[3] = {0.0,0.0,0.0}; + int have_lamp = 0; + + printf("smd->type & MOD_SMOKE_TYPE_DOMAIN\n"); + + framenr = scene->r.cfra; + + cache = sds->point_cache; + + BKE_ptcache_id_from_smoke(&pid, ob, smd); + BKE_ptcache_id_time(&pid, scene, framenr, &startframe, &endframe, ×cale); + + /* handle continuous simulation with the play button */ + if(BKE_ptcache_get_continue_physics()) + { + cache->flag &= ~PTCACHE_SIMULATION_VALID; + cache->simframe= 0; + cache->last_exact= 0; + + smokeModifier_init(smd, ob, scene, dm); + + smoke_simulate_domain(smd, scene, ob, dm); + + return; + } - if(scene->r.cfra > smd->time) + if(framenr < startframe) { - GroupObject *go = NULL; - Base *base = NULL; - - tstart(); - - if(sds->flags & MOD_SMOKE_DISSOLVE) - { - smoke_dissolve(sds->fluid, sds->diss_speed, sds->flags & MOD_SMOKE_DISSOLVE_LOG); - - if(sds->wt) - smoke_dissolve_wavelet(sds->wt, sds->diss_speed, sds->flags & MOD_SMOKE_DISSOLVE_LOG); - } + cache->flag &= ~PTCACHE_SIMULATION_VALID; + cache->simframe= 0; + cache->last_exact= 0; - /* reset view for new frame */ - if(sds->viewsettings < MOD_SMOKE_VIEW_USEBIG) - sds->viewsettings = 0; - else - sds->viewsettings = MOD_SMOKE_VIEW_USEBIG; - - // do flows and fluids - if(1) - { - Object *otherobj = NULL; - ModifierData *md = NULL; - - if(sds->fluid_group) // we use groups since we have 2 domains - go = sds->fluid_group->gobject.first; - else - base = scene->base.first; - - while(base || go) - { - otherobj = NULL; - - if(sds->fluid_group) - { - if(go->ob) - otherobj = go->ob; - } - else - otherobj = base->object; - - if(!otherobj) - { - if(sds->fluid_group) - go = go->next; - else - base= base->next; - - continue; - } - - md = modifiers_findByType(otherobj, eModifierType_Smoke); - - // check for active smoke modifier - if(md && md->mode & (eModifierMode_Realtime | eModifierMode_Render)) - { - SmokeModifierData *smd2 = (SmokeModifierData *)md; - - // check for initialized smoke object - if((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow) - { - // we got nice flow object - SmokeFlowSettings *sfs = smd2->flow; - - if(sfs->psys && sfs->psys->part && sfs->psys->part->type==PART_EMITTER) // is particle system selected - { - ParticleSystem *psys = sfs->psys; - ParticleSettings *part=psys->part; - ParticleData *pa = NULL; - int p = 0; - float *density = smoke_get_density(sds->fluid); - float *bigdensity = smoke_turbulence_get_density(sds->wt); - float *heat = smoke_get_heat(sds->fluid); - float *velocity_x = smoke_get_velocity_x(sds->fluid); - float *velocity_y = smoke_get_velocity_y(sds->fluid); - float *velocity_z = smoke_get_velocity_z(sds->fluid); - unsigned char *obstacle = smoke_get_obstacle(sds->fluid); - int bigres[3]; - - printf("found flow psys\n"); - - // mostly copied from particle code - for(p=0, pa=psys->particles; ptotpart; p++, pa++) - { - int cell[3]; - size_t i = 0; - size_t index = 0; - int badcell = 0; - - if(pa->alive == PARS_KILLED) continue; - else if(pa->alive == PARS_UNBORN && (part->flag & PART_UNBORN)==0) continue; - else if(pa->alive == PARS_DEAD && (part->flag & PART_DIED)==0) continue; - else if(pa->flag & (PARS_UNEXIST+PARS_NO_DISP)) continue; - - // VECCOPY(pos, pa->state.co); - // Mat4MulVecfl (ob->imat, pos); - - // 1. get corresponding cell - get_cell(smd, pa->state.co, cell, 0); - - // check if cell is valid (in the domain boundary) - for(i = 0; i < 3; i++) - { - if((cell[i] > sds->res[i] - 1) || (cell[i] < 0)) - { - badcell = 1; - break; - } - } - - if(badcell) - continue; - - // 2. set cell values (heat, density and velocity) - index = smoke_get_index(cell[0], sds->res[0], cell[1], sds->res[1], cell[2]); - - if(!(sfs->type & MOD_SMOKE_FLOW_TYPE_OUTFLOW) && !(obstacle[index] & 2)) // this is inflow - { - // heat[index] += sfs->temp * 0.1; - // density[index] += sfs->density * 0.1; - - heat[index] = sfs->temp; - density[index] = sfs->density; - - /* - velocity_x[index] = pa->state.vel[0]; - velocity_y[index] = pa->state.vel[1]; - velocity_z[index] = pa->state.vel[2]; - */ - obstacle[index] |= 2; - - // we need different handling for the high-res feature - if(bigdensity) - { - // init all surrounding cells according to amplification, too - int i, j, k; - - smoke_turbulence_get_res(smd->domain->wt, bigres); - - for(i = 0; i < smd->domain->amplify + 1; i++) - for(j = 0; j < smd->domain->amplify + 1; j++) - for(k = 0; k < smd->domain->amplify + 1; k++) - { - index = smoke_get_index((smd->domain->amplify + 1)* cell[0] + i, bigres[0], (smd->domain->amplify + 1)* cell[1] + j, bigres[1], (smd->domain->amplify + 1)* cell[2] + k); - bigdensity[index] = sfs->density; - } - } - } - else if(sfs->type & MOD_SMOKE_FLOW_TYPE_OUTFLOW) // outflow - { - heat[index] = 0.f; - density[index] = 0.f; - velocity_x[index] = 0.f; - velocity_y[index] = 0.f; - velocity_z[index] = 0.f; - - // we need different handling for the high-res feature - if(bigdensity) - { - // init all surrounding cells according to amplification, too - int i, j, k; - - smoke_turbulence_get_res(smd->domain->wt, bigres); - - for(i = 0; i < smd->domain->amplify + 1; i++) - for(j = 0; j < smd->domain->amplify + 1; j++) - for(k = 0; k < smd->domain->amplify + 1; k++) - { - index = smoke_get_index((smd->domain->amplify + 1)* cell[0] + i, bigres[0], (smd->domain->amplify + 1)* cell[1] + j, bigres[1], (smd->domain->amplify + 1)* cell[2] + k); - bigdensity[index] = 0.f; - } - } - } - } - } - else - { - /* - for() - { - // no psys - BVHTreeNearest nearest; - - nearest.index = -1; - nearest.dist = FLT_MAX; - - BLI_bvhtree_find_nearest(sfs->bvh->tree, pco, &nearest, sfs->bvh->nearest_callback, sfs->bvh); - }*/ - } - } - } - - if(sds->fluid_group) - go = go->next; - else - base= base->next; - } - } - - // do effectors - /* - if(sds->eff_group) - { - for(go = sds->eff_group->gobject.first; go; go = go->next) - { - if(go->ob) - { - if(ob->pd) - { - - } - } - } - } - */ - - // do collisions - if(1) - { - Object *otherobj = NULL; - ModifierData *md = NULL; - - if(sds->coll_group) // we use groups since we have 2 domains - go = sds->coll_group->gobject.first; - else - base = scene->base.first; - - while(base || go) - { - otherobj = NULL; - - if(sds->coll_group) - { - if(go->ob) - otherobj = go->ob; - } - else - otherobj = base->object; - - if(!otherobj) - { - if(sds->coll_group) - go = go->next; - else - base= base->next; - - continue; - } - - md = modifiers_findByType(otherobj, eModifierType_Smoke); - - // check for active smoke modifier - if(md && md->mode & (eModifierMode_Realtime | eModifierMode_Render)) - { - SmokeModifierData *smd2 = (SmokeModifierData *)md; - - if((smd2->type & MOD_SMOKE_TYPE_COLL) && smd2->coll) - { - // we got nice collision object - SmokeCollSettings *scs = smd2->coll; - size_t i, j; - unsigned char *obstacles = smoke_get_obstacle(smd->domain->fluid); - - for(i = 0; i < scs->numpoints; i++) - { - int badcell = 0; - size_t index = 0; - int cell[3]; - - // 1. get corresponding cell - get_cell(smd, &scs->points[3 * i], cell, 0); - - // check if cell is valid (in the domain boundary) - for(j = 0; j < 3; j++) - if((cell[j] > sds->res[j] - 1) || (cell[j] < 0)) - { - badcell = 1; - break; - } - - if(badcell) - continue; - - // 2. set cell values (heat, density and velocity) - index = smoke_get_index(cell[0], sds->res[0], cell[1], sds->res[1], cell[2]); - - // printf("cell[0]: %d, cell[1]: %d, cell[2]: %d\n", cell[0], cell[1], cell[2]); - // printf("res[0]: %d, res[1]: %d, res[2]: %d, index: %d\n\n", sds->res[0], sds->res[1], sds->res[2], index); - - obstacles[index] = 1; - - // for moving gobstacles - /* - const LbmFloat maxVelVal = 0.1666; - const LbmFloat maxusqr = maxVelVal*maxVelVal*3. *1.5; - - LbmVec objvel = vec2L((mMOIVertices[n]-mMOIVerticesOld[n]) /dvec); { - const LbmFloat usqr = (objvel[0]*objvel[0]+objvel[1]*objvel[1]+objvel[2]*objvel[2])*1.5; - USQRMAXCHECK(usqr, objvel[0],objvel[1],objvel[2], mMaxVlen, mMxvx,mMxvy,mMxvz); - if(usqr>maxusqr) { - // cutoff at maxVelVal - for(int jj=0; jj<3; jj++) { - if(objvel[jj]>0.) objvel[jj] = maxVelVal; - if(objvel[jj]<0.) objvel[jj] = -maxVelVal; - } - } } - - const LbmFloat dp=dot(objvel, vec2L((*pNormals)[n]) ); - const LbmVec oldov=objvel; // debug - objvel = vec2L((*pNormals)[n]) *dp; - */ - } - } - } - - if(sds->coll_group) - go = go->next; - else - base= base->next; - } - } - - // set new time - smd->time = scene->r.cfra; - - // simulate the actual smoke (c++ code in intern/smoke) - smoke_step(sds->fluid, smd->time); - if(sds->wt) - smoke_turbulence_step(sds->wt, sds->fluid); - - tend(); - printf ( "Frame: %d, Time: %f\n", (int)smd->time, ( float ) tval() ); - } - else if(scene->r.cfra < smd->time) - { // we got back in time, reset smoke in this case (TODO: use cache later) - smd->time = scene->r.cfra; - smokeModifier_reset(smd); + // smd->time = scene->r.cfra; + // smokeModifier_reset(smd); + + return; } + else if(framenr > endframe) + { + framenr = endframe; + } + + if(!(cache->flag & PTCACHE_SIMULATION_VALID)) + { + // printf("reseting\n"); + BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED); + } + + smokeModifier_init(smd, ob, scene, dm); + + /* try to read from cache */ + cache_result = BKE_ptcache_read_cache(&pid, (float)framenr, scene->r.frs_sec); + printf("cache_result: %d\n", cache_result); + + if(cache_result == PTCACHE_READ_EXACT) + { + SmokeDomainSettings *sds = smd->domain; + + cache->flag |= PTCACHE_SIMULATION_VALID; + cache->simframe= framenr; + sds->v3dnum = framenr; + + // printf("PTCACHE_READ_EXACT\n"); + return; + } + else if(cache_result==PTCACHE_READ_OLD) + { + BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_FREE); + + // printf("PTCACHE_READ_OLD\n"); + + cache->flag |= PTCACHE_SIMULATION_VALID; + } + else if(ob->id.lib || (cache->flag & PTCACHE_BAKED)) + { + /* if baked and nothing in cache, do nothing */ + cache->flag &= ~PTCACHE_SIMULATION_VALID; + cache->simframe= 0; + cache->last_exact= 0; + + // printf("PTCACHE_BAKED\n"); + return; + } + else if((cache_result==0) && (startframe!=framenr) && !(cache->flag & PTCACHE_SIMULATION_VALID)) + { + cache->flag &= ~PTCACHE_SIMULATION_VALID; + cache->simframe= 0; + cache->last_exact= 0; + + return; + } + + /* do simulation */ + + // low res + cache->flag |= PTCACHE_SIMULATION_VALID; + cache->simframe= framenr; + + smoke_simulate_domain(smd, scene, ob, dm); + + { + // float light[3] = {0.0,0.0,0.0}; // TODO: take real LAMP coordinates - dg + Base *base_tmp = NULL; + + for(base_tmp = scene->base.first; base_tmp; base_tmp= base_tmp->next) + { + if(base_tmp->object->type == OB_LAMP) + { + Lamp *la = (Lamp *)base_tmp->object->data; + + if(la->type == LA_LOCAL) + { + VECCOPY(light, base_tmp->object->obmat[3]); + have_lamp = 1; + break; + } + } + } + } + + smoke_prepare_View(smd, (float)framenr, light, have_lamp); + + BKE_ptcache_write_cache(&pid, framenr); + + printf("Writing cache_low\n"); + + + tend(); + printf ( "Frame: %d, Time: %f\n", (int)smd->time, ( float ) tval() ); } } +void smoke_simulate_domain(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedMesh *dm) +{ + GroupObject *go = NULL; + Base *base = NULL; + SmokeDomainSettings *sds = smd->domain; + + tstart(); + + if(sds->flags & MOD_SMOKE_DISSOLVE) + smoke_dissolve(sds->fluid, sds->diss_speed, sds->flags & MOD_SMOKE_DISSOLVE_LOG); + + // do flows and fluids + if(1) + { + Object *otherobj = NULL; + ModifierData *md = NULL; + + if(sds->fluid_group) // we use groups since we have 2 domains + go = sds->fluid_group->gobject.first; + else + base = scene->base.first; + + while(base || go) + { + otherobj = NULL; + + if(sds->fluid_group) + { + if(go->ob) + otherobj = go->ob; + } + else + otherobj = base->object; + + if(!otherobj) + { + if(sds->fluid_group) + go = go->next; + else + base= base->next; + + continue; + } + + md = modifiers_findByType(otherobj, eModifierType_Smoke); + + // check for active smoke modifier + if(md && md->mode & (eModifierMode_Realtime | eModifierMode_Render)) + { + SmokeModifierData *smd2 = (SmokeModifierData *)md; + + // check for initialized smoke object + if((smd2->type & MOD_SMOKE_TYPE_FLOW) && smd2->flow) + { + // we got nice flow object + SmokeFlowSettings *sfs = smd2->flow; + + if(sfs->psys && sfs->psys->part && sfs->psys->part->type==PART_EMITTER) // is particle system selected + { + ParticleSystem *psys = sfs->psys; + ParticleSettings *part=psys->part; + ParticleData *pa = NULL; + int p = 0; + float *density = smoke_get_density(sds->fluid); + // float *bigdensity = smoke_turbulence_get_density(sds->wt); + float *heat = smoke_get_heat(sds->fluid); + float *velocity_x = smoke_get_velocity_x(sds->fluid); + float *velocity_y = smoke_get_velocity_y(sds->fluid); + float *velocity_z = smoke_get_velocity_z(sds->fluid); + unsigned char *obstacle = smoke_get_obstacle(sds->fluid); + + // debug printf("found flow psys\n"); + + // mostly copied from particle code + for(p=0, pa=psys->particles; ptotpart; p++, pa++) + { + int cell[3]; + size_t i = 0; + size_t index = 0; + int badcell = 0; + + if(pa->alive == PARS_KILLED) continue; + else if(pa->alive == PARS_UNBORN && (part->flag & PART_UNBORN)==0) continue; + else if(pa->alive == PARS_DEAD && (part->flag & PART_DIED)==0) continue; + else if(pa->flag & (PARS_UNEXIST+PARS_NO_DISP)) continue; + + // VECCOPY(pos, pa->state.co); + // Mat4MulVecfl (ob->imat, pos); + + // 1. get corresponding cell + get_cell(sds->p0, sds->res, sds->dx, pa->state.co, cell, 0); + + // check if cell is valid (in the domain boundary) + for(i = 0; i < 3; i++) + { + if((cell[i] > sds->res[i] - 1) || (cell[i] < 0)) + { + badcell = 1; + break; + } + } + + if(badcell) + continue; + + // 2. set cell values (heat, density and velocity) + index = smoke_get_index(cell[0], sds->res[0], cell[1], sds->res[1], cell[2]); + + if(!(sfs->type & MOD_SMOKE_FLOW_TYPE_OUTFLOW) && !(obstacle[index] & 2)) // this is inflow + { + // heat[index] += sfs->temp * 0.1; + // density[index] += sfs->density * 0.1; + + heat[index] = sfs->temp; + density[index] = sfs->density; + + /* + velocity_x[index] = pa->state.vel[0]; + velocity_y[index] = pa->state.vel[1]; + velocity_z[index] = pa->state.vel[2]; + */ + obstacle[index] |= 2; + } + else if(sfs->type & MOD_SMOKE_FLOW_TYPE_OUTFLOW) // outflow + { + heat[index] = 0.f; + density[index] = 0.f; + velocity_x[index] = 0.f; + velocity_y[index] = 0.f; + velocity_z[index] = 0.f; + } + } + } + else + { + /* + for() + { + // no psys + BVHTreeNearest nearest; + + nearest.index = -1; + nearest.dist = FLT_MAX; + + BLI_bvhtree_find_nearest(sfs->bvh->tree, pco, &nearest, sfs->bvh->nearest_callback, sfs->bvh); + }*/ + } + } + } + + if(sds->fluid_group) + go = go->next; + else + base= base->next; + } + } + + // do effectors + /* + if(sds->eff_group) + { + for(go = sds->eff_group->gobject.first; go; go = go->next) + { + if(go->ob) + { + if(ob->pd) + { + + } + } + } + } + */ + + // do collisions + if(1) + { + Object *otherobj = NULL; + ModifierData *md = NULL; + + if(sds->coll_group) // we use groups since we have 2 domains + go = sds->coll_group->gobject.first; + else + base = scene->base.first; + + while(base || go) + { + otherobj = NULL; + + if(sds->coll_group) + { + if(go->ob) + otherobj = go->ob; + } + else + otherobj = base->object; + + if(!otherobj) + { + if(sds->coll_group) + go = go->next; + else + base= base->next; + + continue; + } + + md = modifiers_findByType(otherobj, eModifierType_Smoke); + + // check for active smoke modifier + if(md && md->mode & (eModifierMode_Realtime | eModifierMode_Render)) + { + SmokeModifierData *smd2 = (SmokeModifierData *)md; + + if((smd2->type & MOD_SMOKE_TYPE_COLL) && smd2->coll) + { + // we got nice collision object + SmokeCollSettings *scs = smd2->coll; + size_t i, j; + unsigned char *obstacles = smoke_get_obstacle(smd->domain->fluid); + + for(i = 0; i < scs->numpoints; i++) + { + int badcell = 0; + size_t index = 0; + int cell[3]; + + // 1. get corresponding cell + get_cell(sds->p0, sds->res, sds->dx, &scs->points[3 * i], cell, 0); + + // check if cell is valid (in the domain boundary) + for(j = 0; j < 3; j++) + if((cell[j] > sds->res[j] - 1) || (cell[j] < 0)) + { + badcell = 1; + break; + } + + if(badcell) + continue; + + // 2. set cell values (heat, density and velocity) + index = smoke_get_index(cell[0], sds->res[0], cell[1], sds->res[1], cell[2]); + + // printf("cell[0]: %d, cell[1]: %d, cell[2]: %d\n", cell[0], cell[1], cell[2]); + // printf("res[0]: %d, res[1]: %d, res[2]: %d, index: %d\n\n", sds->res[0], sds->res[1], sds->res[2], index); + + obstacles[index] = 1; + + // for moving gobstacles + /* + const LbmFloat maxVelVal = 0.1666; + const LbmFloat maxusqr = maxVelVal*maxVelVal*3. *1.5; + + LbmVec objvel = vec2L((mMOIVertices[n]-mMOIVerticesOld[n]) /dvec); { + const LbmFloat usqr = (objvel[0]*objvel[0]+objvel[1]*objvel[1]+objvel[2]*objvel[2])*1.5; + USQRMAXCHECK(usqr, objvel[0],objvel[1],objvel[2], mMaxVlen, mMxvx,mMxvy,mMxvz); + if(usqr>maxusqr) { + // cutoff at maxVelVal + for(int jj=0; jj<3; jj++) { + if(objvel[jj]>0.) objvel[jj] = maxVelVal; + if(objvel[jj]<0.) objvel[jj] = -maxVelVal; + } + } } + + const LbmFloat dp=dot(objvel, vec2L((*pNormals)[n]) ); + const LbmVec oldov=objvel; // debug + objvel = vec2L((*pNormals)[n]) *dp; + */ + } + } + } + + if(sds->coll_group) + go = go->next; + else + base= base->next; + } + } + + // set new time + smd->time = scene->r.cfra; + + // simulate the actual smoke (c++ code in intern/smoke) + smoke_step(sds->fluid, smd->time); +} + +static int calc_voxel_transp(float *input, int res[3], int *pixel, float *tRay) +{ + const size_t index = smoke_get_index(pixel[0], res[0], pixel[1], res[1], pixel[2]); + + // T_ray *= T_vox + *tRay *= input[index*4]; + + return *tRay; +} + +// forward decleration +void smoke_calc_transparency(float *result, float *p0, float *p1, int res[3], float dx, float *light, bresenham_callback cb); + // update necessary information for 3dview -void smoke_prepare_View(SmokeModifierData *smd, float *light) +void smoke_prepare_View(SmokeModifierData *smd, float framenr, float *light, int have_light) { float *density = NULL; int x, y, z; - - if(!smd->domain->tray) - { - // TRay is for self shadowing - smd->domain->tray = MEM_callocN(sizeof(float)*smd->domain->res[0]*smd->domain->res[1]*smd->domain->res[2], "Smoke_tRay"); - } - if(!smd->domain->tvox) - { - // TVox is for tranaparency - smd->domain->tvox = MEM_callocN(sizeof(float)*smd->domain->res[0]*smd->domain->res[1]*smd->domain->res[2], "Smoke_tVox"); - } + size_t cells, i; + SmokeDomainSettings *sds = smd->domain; // update 3dview density = smoke_get_density(smd->domain->fluid); for(x = 0; x < smd->domain->res[0]; x++) - for(y = 0; y < smd->domain->res[1]; y++) - for(z = 0; z < smd->domain->res[2]; z++) - { - size_t index; + for(y = 0; y < smd->domain->res[1]; y++) + for(z = 0; z < smd->domain->res[2]; z++) + { + size_t index; - index = smoke_get_index(x, smd->domain->res[0], y, smd->domain->res[1], z); - // Transparency computation - // formula taken from "Visual Simulation of Smoke" / Fedkiw et al. pg. 4 - // T_vox = exp(-C_ext * h) - // C_ext/sigma_t = density * C_ext - smoke_set_tvox(smd, index, exp(-density[index] * 7.0 * smd->domain->dx)); - } - smoke_calc_transparency(smd, light, 0); -} + index = smoke_get_index(x, smd->domain->res[0], y, smd->domain->res[1], z); + // Transparency computation + // formula taken from "Visual Simulation of Smoke" / Fedkiw et al. pg. 4 + // T_vox = exp(-C_ext * h) + // C_ext/sigma_t = density * C_ext + smd->domain->view3d[index * 4] = smd->domain->view3d[index * 4 + 1] = + smd->domain->view3d[index * 4 + 2] = exp(-density[index] * 7.0 * smd->domain->dx); + smd->domain->view3d[index * 4 + 3] = 1.0 - smd->domain->view3d[index * 4]; + + } -// update necessary information for 3dview ("high res" option) -void smoke_prepare_bigView(SmokeModifierData *smd, float *light) -{ - float *density = NULL; - size_t i = 0; - int bigres[3]; - - smoke_turbulence_get_res(smd->domain->wt, bigres); - - if(!smd->domain->traybig) + if(have_light) { - // TRay is for self shadowing - smd->domain->traybig = MEM_callocN(sizeof(float)*bigres[0]*bigres[1]*bigres[2], "Smoke_tRayBig"); + smoke_calc_transparency(sds->view3d, sds->p0, sds->p1, sds->res, sds->dx, light, calc_voxel_transp); + + cells = smd->domain->res[0]*smd->domain->res[1]*smd->domain->res[2]; + for(i = 0; i < cells; i++) + { + smd->domain->view3d[i * 4] = smd->domain->view3d[i * 4 + 1] = + smd->domain->view3d[i * 4 + 2] = smd->domain->view3d[i * 4 + 1] * smd->domain->view3d[i * 4 + 0]; + } } - if(!smd->domain->tvoxbig) - { - // TVox is for tranaparency - smd->domain->tvoxbig = MEM_callocN(sizeof(float)*bigres[0]*bigres[1]*bigres[2], "Smoke_tVoxBig"); - } - - density = smoke_turbulence_get_density(smd->domain->wt); - for (i = 0; i < bigres[0] * bigres[1] * bigres[2]; i++) - { - // Transparency computation - // formula taken from "Visual Simulation of Smoke" / Fedkiw et al. pg. 4 - // T_vox = exp(-C_ext * h) - // C_ext/sigma_t = density * C_ext - smoke_set_bigtvox(smd, i, exp(-density[i] * 7.0 * smd->domain->dx / (smd->domain->amplify + 1)) ); - } - smoke_calc_transparency(smd, light, 1); -} - - -float smoke_get_tvox(SmokeModifierData *smd, size_t index) -{ - return smd->domain->tvox[index]; -} - -void smoke_set_tvox(SmokeModifierData *smd, size_t index, float tvox) -{ - smd->domain->tvox[index] = tvox; -} - -float smoke_get_tray(SmokeModifierData *smd, size_t index) -{ - return smd->domain->tray[index]; -} - -void smoke_set_tray(SmokeModifierData *smd, size_t index, float transparency) -{ - smd->domain->tray[index] = transparency; -} - -float smoke_get_bigtvox(SmokeModifierData *smd, size_t index) -{ - return smd->domain->tvoxbig[index]; -} - -void smoke_set_bigtvox(SmokeModifierData *smd, size_t index, float tvox) -{ - smd->domain->tvoxbig[index] = tvox; -} - -float smoke_get_bigtray(SmokeModifierData *smd, size_t index) -{ - return smd->domain->traybig[index]; -} - -void smoke_set_bigtray(SmokeModifierData *smd, size_t index, float transparency) -{ - smd->domain->traybig[index] = transparency; + smd->domain->v3dnum = framenr; } long long smoke_get_mem_req(int xres, int yres, int zres, int amplify) @@ -1259,34 +1252,7 @@ long long smoke_get_mem_req(int xres, int yres, int zres, int amplify) return totalMB; } - -static void calc_voxel_transp(SmokeModifierData *smd, int *pixel, float *tRay) -{ - // printf("Pixel(%d, %d, %d)\n", pixel[0], pixel[1], pixel[2]); - const size_t index = smoke_get_index(pixel[0], smd->domain->res[0], pixel[1], smd->domain->res[1], pixel[2]); - - // T_ray *= T_vox - *tRay *= smoke_get_tvox(smd, index); -} - -static void calc_voxel_transp_big(SmokeModifierData *smd, int *pixel, float *tRay) -{ - int bigres[3]; - size_t index; - - smoke_turbulence_get_res(smd->domain->wt, bigres); - index = smoke_get_index(pixel[0], bigres[0], pixel[1], bigres[1], pixel[2]); - - /* - if(index > bigres[0]*bigres[1]*bigres[2]) - printf("pixel[0]: %d, [1]: %d, [2]: %d\n", pixel[0], pixel[1], pixel[2]); - */ - - // T_ray *= T_vox - *tRay *= smoke_get_bigtvox(smd, index); -} - -static void bresenham_linie_3D(SmokeModifierData *smd, int x1, int y1, int z1, int x2, int y2, int z2, float *tRay, int big) +static void bresenham_linie_3D(int x1, int y1, int z1, int x2, int y2, int z2, float *tRay, bresenham_callback cb, float *input, int res[3]) { int dx, dy, dz, i, l, m, n, x_inc, y_inc, z_inc, err_1, err_2, dx2, dy2, dz2; int pixel[3]; @@ -1313,11 +1279,7 @@ static void bresenham_linie_3D(SmokeModifierData *smd, int x1, int y1, int z1, i err_1 = dy2 - l; err_2 = dz2 - l; for (i = 0; i < l; i++) { - if(!big) - calc_voxel_transp(smd, pixel, tRay); - else - calc_voxel_transp_big(smd, pixel, tRay); - if(*tRay < 0.0f) + if(cb(input, res, pixel, tRay) < 0.0) return; if (err_1 > 0) { pixel[1] += y_inc; @@ -1335,11 +1297,7 @@ static void bresenham_linie_3D(SmokeModifierData *smd, int x1, int y1, int z1, i err_1 = dx2 - m; err_2 = dz2 - m; for (i = 0; i < m; i++) { - if(!big) - calc_voxel_transp(smd, pixel, tRay); - else - calc_voxel_transp_big(smd, pixel, tRay); - if(*tRay < 0.0f) + if(cb(input, res, pixel, tRay) < 0.0f) return; if (err_1 > 0) { pixel[0] += x_inc; @@ -1357,11 +1315,7 @@ static void bresenham_linie_3D(SmokeModifierData *smd, int x1, int y1, int z1, i err_1 = dy2 - n; err_2 = dx2 - n; for (i = 0; i < n; i++) { - if(!big) - calc_voxel_transp(smd, pixel, tRay); - else - calc_voxel_transp_big(smd, pixel, tRay); - if(*tRay < 0.0f) + if(cb(input, res, pixel, tRay) < 0.0f) return; if (err_1 > 0) { pixel[1] += y_inc; @@ -1376,41 +1330,15 @@ static void bresenham_linie_3D(SmokeModifierData *smd, int x1, int y1, int z1, i pixel[2] += z_inc; } } - if(!big) - calc_voxel_transp(smd, pixel, tRay); - else - calc_voxel_transp_big(smd, pixel, tRay); + cb(input, res, pixel, tRay); } -static void get_cell(struct SmokeModifierData *smd, float *pos, int *cell, int correct) +static void get_cell(float *p0, int res[3], float dx, float *pos, int *cell, int correct) { float tmp[3]; - VECSUB(tmp, pos, smd->domain->p0); - VecMulf(tmp, 1.0 / smd->domain->dx); - - if(correct) - { - cell[0] = MIN2(smd->domain->res[0] - 1, MAX2(0, (int)floor(tmp[0]))); - cell[1] = MIN2(smd->domain->res[1] - 1, MAX2(0, (int)floor(tmp[1]))); - cell[2] = MIN2(smd->domain->res[2] - 1, MAX2(0, (int)floor(tmp[2]))); - } - else - { - cell[0] = (int)floor(tmp[0]); - cell[1] = (int)floor(tmp[1]); - cell[2] = (int)floor(tmp[2]); - } -} -static void get_bigcell(struct SmokeModifierData *smd, float *pos, int *cell, int correct) -{ - float tmp[3]; - int res[3]; - smoke_turbulence_get_res(smd->domain->wt, res); - - VECSUB(tmp, pos, smd->domain->p0); - - VecMulf(tmp, (smd->domain->amplify + 1)/ smd->domain->dx ); + VECSUB(tmp, pos, p0); + VecMulf(tmp, 1.0 / dx); if(correct) { @@ -1426,43 +1354,23 @@ static void get_bigcell(struct SmokeModifierData *smd, float *pos, int *cell, in } } - -void smoke_calc_transparency(struct SmokeModifierData *smd, float *light, int big) +void smoke_calc_transparency(float *result, float *p0, float *p1, int res[3], float dx, float *light, bresenham_callback cb) { int x, y, z; float bv[6]; - int res[3]; float bigfactor = 1.0; // x - bv[0] = smd->domain->p0[0]; - bv[1] = smd->domain->p1[0]; + bv[0] = p0[0]; + bv[1] = p1[0]; // y - bv[2] = smd->domain->p0[1]; - bv[3] = smd->domain->p1[1]; + bv[2] = p0[1]; + bv[3] = p1[1]; // z - bv[4] = smd->domain->p0[2]; - bv[5] = smd->domain->p1[2]; -/* - printf("bv[0]: %f, [1]: %f, [2]: %f, [3]: %f, [4]: %f, [5]: %f\n", bv[0], bv[1], bv[2], bv[3], bv[4], bv[5]); + bv[4] = p0[2]; + bv[5] = p1[2]; - printf("p0[0]: %f, p0[1]: %f, p0[2]: %f\n", smd->domain->p0[0], smd->domain->p0[1], smd->domain->p0[2]); - printf("p1[0]: %f, p1[1]: %f, p1[2]: %f\n", smd->domain->p1[0], smd->domain->p1[1], smd->domain->p1[2]); - printf("dx: %f, amp: %d\n", smd->domain->dx, smd->domain->amplify); -*/ - if(!big) - { - res[0] = smd->domain->res[0]; - res[1] = smd->domain->res[1]; - res[2] = smd->domain->res[2]; - } - else - { - smoke_turbulence_get_res(smd->domain->wt, res); - bigfactor = 1.0 / (smd->domain->amplify + 1); - } - -#pragma omp parallel for schedule(static) private(y, z) shared(big, smd, light, res, bigfactor) +// #pragma omp parallel for schedule(static) private(y, z) for(x = 0; x < res[0]; x++) for(y = 0; y < res[1]; y++) for(z = 0; z < res[2]; z++) @@ -1475,41 +1383,26 @@ void smoke_calc_transparency(struct SmokeModifierData *smd, float *light, int bi index = smoke_get_index(x, res[0], y, res[1], z); - // voxelCenter = m_voxelarray[i].GetCenter(); - voxelCenter[0] = smd->domain->p0[0] + smd->domain->dx * bigfactor * x + smd->domain->dx * bigfactor * 0.5; - voxelCenter[1] = smd->domain->p0[1] + smd->domain->dx * bigfactor * y + smd->domain->dx * bigfactor * 0.5; - voxelCenter[2] = smd->domain->p0[2] + smd->domain->dx * bigfactor * z + smd->domain->dx * bigfactor * 0.5; - - // printf("vc[0]: %f, vc[1]: %f, vc[2]: %f\n", voxelCenter[0], voxelCenter[1], voxelCenter[2]); - // printf("light[0]: %f, light[1]: %f, light[2]: %f\n", light[0], light[1], light[2]); + voxelCenter[0] = p0[0] + dx * x + dx * 0.5; + voxelCenter[1] = p0[1] + dx * y + dx * 0.5; + voxelCenter[2] = p0[2] + dx * z + dx * 0.5; // get starting position (in voxel coords) if(BLI_bvhtree_bb_raycast(bv, light, voxelCenter, pos) > FLT_EPSILON) { // we're ouside - // printf("out: pos[0]: %f, pos[1]: %f, pos[2]: %f\n", pos[0], pos[1], pos[2]); - if(!big) - get_cell(smd, pos, cell, 1); - else - get_bigcell(smd, pos, cell, 1); + get_cell(p0, res, dx, pos, cell, 1); } else { - // printf("in: pos[0]: %f, pos[1]: %f, pos[2]: %f\n", light[0], light[1], light[2]); // we're inside - if(!big) - get_cell(smd, light, cell, 1); - else - get_bigcell(smd, light, cell, 1); + get_cell(p0, res, dx, light, cell, 1); } - // printf("cell - [0]: %d, [1]: %d, [2]: %d\n", cell[0], cell[1], cell[2]); - bresenham_linie_3D(smd, cell[0], cell[1], cell[2], x, y, z, &tRay, big); + bresenham_linie_3D(cell[0], cell[1], cell[2], x, y, z, &tRay, cb, result, res); - if(!big) - smoke_set_tray(smd, index, tRay); - else - smoke_set_bigtray(smd, index, tRay); + // convention -> from a RGBA float array, use G value for tRay + result[index*4 + 1] = tRay; } } diff --git a/source/blender/blenkernel/intern/smokehighres.c b/source/blender/blenkernel/intern/smokehighres.c new file mode 100644 index 00000000000..6a2e0549158 --- /dev/null +++ b/source/blender/blenkernel/intern/smokehighres.c @@ -0,0 +1,137 @@ +/** + * smokehighres.c + * + * $Id$ + * + * ***** 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) Blender Foundation. + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): Daniel Genrich + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/* Part of the code copied from elbeem fluid library, copyright by Nils Thuerey */ + +#include "DNA_scene_types.h" +#include "DNA_listBase.h" +#include "DNA_modifier_types.h" +#include "DNA_object_types.h" +#include "DNA_smoke_types.h" + +#include "BKE_modifier.h" +#include "BKE_smoke.h" +#include "BKE_pointcache.h" + +#include "smoke_API.h" + +// we need different handling for the high-res feature +/* +if(bigdensity) +{ + // init all surrounding cells according to amplification, too + int i, j, k; + + smoke_turbulence_get_res(smd->domain->wt, bigres); + + for(i = 0; i < smd->domain->amplify + 1; i++) + for(j = 0; j < smd->domain->amplify + 1; j++) + for(k = 0; k < smd->domain->amplify + 1; k++) + { + index = smoke_get_index((smd->domain->amplify + 1)* cell[0] + i, bigres[0], (smd->domain->amplify + 1)* cell[1] + j, bigres[1], (smd->domain->amplify + 1)* cell[2] + k); + bigdensity[index] = sfs->density; + } +} +*/ + +static void smokeHRinit(SmokeHRModifierData *shrmd, SmokeDomainSettings *sds) +{ + if(!shrmd->wt) + { + shrmd->wt = smoke_turbulence_init(sds->res, shrmd->amplify + 1, shrmd->noise); + smoke_turbulence_initBlenderRNA(shrmd->wt, &shrmd->strength); + } +} + +void smokeHRModifier_free(SmokeHRModifierData *shrmd) +{ + if(shrmd->wt) + smoke_turbulence_free(shrmd->wt); + + BKE_ptcache_free_list(&shrmd->ptcaches); + shrmd->point_cache = NULL; +} + +void smokeHRModifier_do(SmokeHRModifierData *shrmd, Scene *scene, Object *ob, int useRenderParams, int isFinalCalc) +{ + ModifierData *md = NULL; + SmokeModifierData *smd = NULL; + SmokeDomainSettings *sds = NULL; + + // find underlaying smoke domain + smd = (SmokeModifierData *)modifiers_findByType(ob, eModifierType_Smoke); + if(!(smd && smd->type == MOD_SMOKE_TYPE_DOMAIN)) + return; + + sds = smd->domain; + + smokeHRinit(shrmd, sds); + + // smoke_turbulence_dissolve(shrmd->wt, sds->diss_speed, sds->flags & MOD_SMOKE_DISSOLVE_LOG); + + // smoke_turbulence_step(shrmd->wt, sds->fluid); +} + + +// update necessary information for 3dview ("high res" option) +void smoke_prepare_bigView(SmokeHRModifierData *shrmd, float *light) +{ + float *density = NULL; + size_t i = 0; + int bigres[3]; +/* + smoke_turbulence_get_res(shrmd->wt, bigres); + + if(!smd->domain->traybig) + { + // TRay is for self shadowing + smd->domain->traybig = MEM_callocN(sizeof(float)*bigres[0]*bigres[1]*bigres[2], "Smoke_tRayBig"); + } + if(!smd->domain->tvoxbig) + { + // TVox is for tranaparency + smd->domain->tvoxbig = MEM_callocN(sizeof(float)*bigres[0]*bigres[1]*bigres[2], "Smoke_tVoxBig"); + } + + density = smoke_turbulence_get_density(smd->domain->wt); + for (i = 0; i < bigres[0] * bigres[1] * bigres[2]; i++) + { + // Transparency computation + // formula taken from "Visual Simulation of Smoke" / Fedkiw et al. pg. 4 + // T_vox = exp(-C_ext * h) + // C_ext/sigma_t = density * C_ext + smoke_set_bigtvox(smd, i, exp(-density[i] * 7.0 * smd->domain->dx / (smd->domain->amplify + 1)) ); + } + smoke_calc_transparency(smd, light, 1); + */ +} + + diff --git a/source/blender/blenlib/BLI_winstuff.h b/source/blender/blenlib/BLI_winstuff.h index 3e1b73e51be..fad45f1b6c3 100644 --- a/source/blender/blenlib/BLI_winstuff.h +++ b/source/blender/blenlib/BLI_winstuff.h @@ -65,20 +65,22 @@ extern "C" { #endif -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif -#ifndef M_PI_2 -#define M_PI_2 1.57079632679489661923 -#endif -#ifndef M_SQRT2 -#define M_SQRT2 1.41421356237309504880 -#endif -#ifndef M_SQRT1_2 -#define M_SQRT1_2 0.70710678118654752440 -#endif -#ifndef M_1_PI -#define M_1_PI 0.318309886183790671538 +# ifndef _WIN64 + #ifndef M_PI + #define M_PI 3.14159265358979323846 + #endif + #ifndef M_PI_2 + #define M_PI_2 1.57079632679489661923 + #endif + #ifndef M_SQRT2 + #define M_SQRT2 1.41421356237309504880 + #endif + #ifndef M_SQRT1_2 + #define M_SQRT1_2 0.70710678118654752440 + #endif + #ifndef M_1_PI + #define M_1_PI 0.318309886183790671538 + #endif #endif #define MAXPATHLEN MAX_PATH diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index db811b22460..71994b97521 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3669,8 +3669,6 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb) else if (md->type==eModifierType_Smoke) { SmokeModifierData *smd = (SmokeModifierData*) md; - smd->point_cache = NULL; - if(smd->type==MOD_SMOKE_TYPE_DOMAIN) { smd->flow = NULL; @@ -3679,23 +3677,10 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb) smd->domain->smd = smd; smd->domain->fluid = NULL; - smd->domain->wt = NULL; - smd->domain->tvox = NULL; - smd->domain->tray = NULL; - smd->domain->tvoxbig = NULL; - smd->domain->traybig = NULL; - smd->domain->bind = NULL; - smd->domain->max_textures= 0; + smd->domain->view3d = NULL; + smd->domain->tex = NULL; - // do_versions trick - if(smd->domain->strength < 1.0) - smd->domain->strength = 2.0; - - // reset 3dview - if(smd->domain->viewsettings < MOD_SMOKE_VIEW_USEBIG) - smd->domain->viewsettings = 0; - else - smd->domain->viewsettings = MOD_SMOKE_VIEW_USEBIG; + direct_link_pointcache_list(fd, &smd->domain->ptcaches, &smd->domain->point_cache); } else if(smd->type==MOD_SMOKE_TYPE_FLOW) { diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index ede7aacfea8..31fe0c01900 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1126,14 +1126,17 @@ static void write_modifiers(WriteData *wd, ListBase *modbase) else if(md->type==eModifierType_Smoke) { SmokeModifierData *smd = (SmokeModifierData*) md; - if(smd->type==MOD_SMOKE_TYPE_DOMAIN) + if(smd->type & MOD_SMOKE_TYPE_DOMAIN) writestruct(wd, DATA, "SmokeDomainSettings", 1, smd->domain); - else if(smd->type==MOD_SMOKE_TYPE_FLOW) + else if(smd->type & MOD_SMOKE_TYPE_FLOW) writestruct(wd, DATA, "SmokeFlowSettings", 1, smd->flow); /* - else if(smd->type==MOD_SMOKE_TYPE_COLL) + else if(smd->type & MOD_SMOKE_TYPE_COLL) writestruct(wd, DATA, "SmokeCollSettings", 1, smd->coll); */ + + if((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) + write_pointcaches(wd, &smd->domain->ptcaches); } else if(md->type==eModifierType_Fluidsim) { FluidsimModifierData *fluidmd = (FluidsimModifierData*) md; diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 9983e24f2c9..16900d6d894 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -161,6 +161,13 @@ int ED_object_modifier_remove(ReportList *reports, Scene *scene, Object *ob, Mod DAG_scene_sort(scene); } + else if(md->type == eModifierType_Smoke) { + ModifierData *tmd = modifiers_findByType(ob, eModifierType_SmokeHR); + if(tmd) { + BLI_remlink(&ob->modifiers, tmd); + modifier_free(tmd); + } + } BLI_remlink(&ob->modifiers, md); modifier_free(md); diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 530500cfafa..994bb0010d8 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -553,7 +553,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r "world", "object", "mesh", "armature", "lattice", "curve", "meta_ball", "lamp", "camera", "material", "material_slot", "texture", "texture_slot", "bone", "edit_bone", "particle_system", - "cloth", "soft_body", "fluid", "smoke", "collision", "brush", NULL}; + "cloth", "soft_body", "fluid", "smoke", "smoke_hr", "collision", "brush", NULL}; CTX_data_dir_set(result, dir); return 1; @@ -697,6 +697,16 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r return 1; } } + else if(CTX_data_equals(member, "smoke_hr")) { + PointerRNA *ptr= get_pointer_type(path, &RNA_Object); + + if(ptr && ptr->data) { + Object *ob= ptr->data; + ModifierData *md= modifiers_findByType(ob, eModifierType_SmokeHR); + CTX_data_pointer_set(result, &ob->id, &RNA_SmokeHRModifier, md); + return 1; + } + } else if(CTX_data_equals(member, "collision")) { PointerRNA *ptr= get_pointer_type(path, &RNA_Object); diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 466b55ba862..55565c83f5e 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -5309,356 +5309,20 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) } /* draw code for smoke */ - if((md = modifiers_findByType(ob, eModifierType_Smoke))) - { - SmokeModifierData *smd = (SmokeModifierData *)md; - - // draw collision objects - if((smd->type & MOD_SMOKE_TYPE_COLL) && smd->coll) - { - /*SmokeCollSettings *scs = smd->coll; - if(scs->points) - { - size_t i; - - wmLoadMatrix(rv3d->viewmat); - - if(col || (ob->flag & SELECT)) cpack(0xFFFFFF); - glDepthMask(GL_FALSE); - glEnable(GL_BLEND); - - - // glPointSize(3.0); - bglBegin(GL_POINTS); - - for(i = 0; i < scs->numpoints; i++) - { - bglVertex3fv(&scs->points[3*i]); - } - - bglEnd(); - glPointSize(1.0); - - wmMultMatrix(ob->obmat); - glDisable(GL_BLEND); - glDepthMask(GL_TRUE); - if(col) cpack(col); - + if(((SmokeHRModifierData *)(md = modifiers_findByType(ob, eModifierType_SmokeHR)) && (((SmokeHRModifierData *)md)->flags & MOD_SMOKE_SHOWHIGHRES))) { + // GPU_create_smoke(smd); + // draw_volume(scene, ar, v3d, base, smd->domain->tex, smd->domain->res); + // GPU_free_smoke(smd); + } + else { + md = modifiers_findByType(ob, eModifierType_Smoke); + if (md) { + SmokeModifierData *smd = (SmokeModifierData *)md; + if(smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain) { + GPU_create_smoke(smd); + draw_volume(scene, ar, v3d, base, smd->domain->tex, smd->domain->res); + GPU_free_smoke(smd); } - */ - } - - // only draw domains - if(smd->domain && smd->domain->fluid) - { - int x, y, z, i; - float viewnormal[3]; - int mainaxis[3] = {0,0,0}; - float align = 0, signed_align = 0; - int max_textures = 0, counter_textures = 0; - float *buffer = NULL; - int res[3]; - float bigfactor = 1.0; - int big = (smd->domain->flags & MOD_SMOKE_HIGHRES) && (smd->domain->viewsettings & MOD_SMOKE_VIEW_USEBIG); - int new = 0; - int have_lamp = 0; - - // GUI sent redraw event - if(smd->domain->flags & MOD_SMOKE_VIEW_REDRAWNICE) - { - new = 1; - smd->domain->flags &= ~MOD_SMOKE_VIEW_REDRAWNICE; - } - - if(!big) - { - res[0] = smd->domain->res[0]; - res[1] = smd->domain->res[1]; - res[2] = smd->domain->res[2]; - } - else - { - smoke_turbulence_get_res(smd->domain->wt, res); - bigfactor = 1.0 / (smd->domain->amplify + 1); - } - - wmLoadMatrix(rv3d->viewmat); - - if(col || (ob->flag & SELECT)) cpack(0xFFFFFF); /* for visibility, also while wpaint */ - glDepthMask(GL_FALSE); - glEnable(GL_BLEND); - - // get view vector - VECCOPY(viewnormal, rv3d->viewinv[2]); - Normalize(viewnormal); - for(i = 0; i < 3; i++) - { - if(ABS(viewnormal[i]) > align) - { - mainaxis[0] = i; - align = ABS(viewnormal[i]); - signed_align = viewnormal[i]; - } - } - mainaxis[1] = (mainaxis[0] + 1) % 3; - mainaxis[2] = (mainaxis[0] + 2) % 3; - - if(!smd->domain->bind) - { - smd->domain->bind = MEM_callocN(sizeof(GLuint)*256, "Smoke_bind"); - if(big) - smd->domain->viewsettings |= MOD_SMOKE_VIEW_CHANGETOBIG; - new = 3; - } - - // check if view axis / mode has been changed - if(smd->domain->viewsettings) - { - if(big) - { - if(!(smd->domain->viewsettings & MOD_SMOKE_VIEW_BIG)) - new = 2; - else if(!(smd->domain->viewsettings & MOD_SMOKE_VIEW_CHANGETOBIG)) - new = 1; - - smd->domain->viewsettings |= MOD_SMOKE_VIEW_CHANGETOBIG; - } - else - { - if(!(smd->domain->viewsettings & MOD_SMOKE_VIEW_SMALL)) - new = 2; - else if(smd->domain->viewsettings & MOD_SMOKE_VIEW_CHANGETOBIG) - new = 1; - - smd->domain->viewsettings &= ~MOD_SMOKE_VIEW_CHANGETOBIG; - } - - if(!new) - { - if((mainaxis[0] == 0) && !(smd->domain->viewsettings & MOD_SMOKE_VIEW_X)) - new = 1; - else if((mainaxis[0] == 1) && !(smd->domain->viewsettings & MOD_SMOKE_VIEW_Y)) - new = 1; - else if((mainaxis[0] == 2) && !(smd->domain->viewsettings & MOD_SMOKE_VIEW_Z)) - new = 1; - - // printf("check axis\n"); - } - } - else - new = 3; - - if(new > 1) - { - float light[3] = {0.0,0.0,0.0}; // TODO: take real LAMP coordinates - dg - Base *base_tmp = NULL; - - for(base_tmp = scene->base.first; base_tmp; base_tmp= base_tmp->next) - { - if(base_tmp->object->type == OB_LAMP) - { - Lamp *la = (Lamp *)base_tmp->object->data; - - if(la->type == LA_LOCAL) - { - VECCOPY(light, base_tmp->object->obmat[3]); - have_lamp = 1; - break; - } - } - } - - if(!big && !(smd->domain->viewsettings & MOD_SMOKE_VIEW_SMALL)) - { - smoke_prepare_View(smd, light); - // printf("prepared View!\n"); - } - else if(big && !(smd->domain->viewsettings & MOD_SMOKE_VIEW_BIG)) - { - smoke_prepare_bigView(smd, light); - // printf("prepared bigView!\n"); - } - } - - // printf("big: %d, new: %d\n", big, new); - - // only create buffer if we need to create new textures - if(new) - buffer = MEM_mallocN(sizeof(float)*res[mainaxis[1]]*res[mainaxis[2]]*4, "SmokeDrawBuffer"); - - if(buffer || smd->domain->viewsettings) - { - int mod_texture = 0; - - // printf("if(buffer || smd->domain->viewsettings)\n"); - - max_textures = (res[mainaxis[0]] > 256) ? 256 : res[mainaxis[0]]; - - if(!smd->domain->viewsettings) // new frame or new start - { - smd->domain->max_textures = max_textures; - glGenTextures(smd->domain->max_textures, (GLuint *)smd->domain->bind); - new = 1; - // printf("glGenTextures\n"); - } - else - { - if(new) - { - // printf("glDeleteTextures\n"); - glDeleteTextures(smd->domain->max_textures, (GLuint *)smd->domain->bind); - smd->domain->max_textures = max_textures; - glGenTextures(smd->domain->max_textures, (GLuint *)smd->domain->bind); - } - } - - mod_texture = MAX3(1, smd->domain->visibility, (int)(res[mainaxis[0]] / smd->domain->max_textures )); - - // align order of billboards to be front or backview (e.g. +x or -x axis) - if(signed_align < 0) - { - z = res[mainaxis[0]] - 1; - } - else - { - z = 0; - } - - for (; signed_align > 0 ? (z < res[mainaxis[0]]) : (z >= 0); signed_align > 0 ? z++ : z--) // 2 - { - float quad[4][3]; - - if(new) - { - for (y = 0; y < res[mainaxis[1]]; y++) // 1 - { - for (x = 0; x < res[mainaxis[2]]; x++) // 0 - { - size_t index; - size_t image_index; - float tray, tvox; - - image_index = smoke_get_index2d(y, res[mainaxis[1]], x); - - if(mainaxis[0] == 0) - { - // mainaxis[1] == 1, mainaxis[2] == 2 - index = smoke_get_index(z, res[mainaxis[0]], y, res[mainaxis[1]], x); - } - else if(mainaxis[0] == 1) - { - // mainaxis[1] == 2, mainaxis[2] == 0 - index = smoke_get_index(x, res[mainaxis[2]], z, res[mainaxis[0]], y); - } - else // mainaxis[0] == 2 - { - // mainaxis[1] == 0, mainaxis[2] == 1 - index = smoke_get_index(y, res[mainaxis[1]], x, res[mainaxis[2]], z); - } - - if(!big) - { - tvox = smoke_get_tvox(smd, index); - tray = smoke_get_tray(smd, index); - } - else - { - tvox = smoke_get_bigtvox(smd, index); - tray = smoke_get_bigtray(smd, index); - } - - if(!have_lamp) - tray = 1.0; - - // fill buffer with luminance and alpha - // 1 - T_vox - buffer[image_index*4 + 3] = 1.0 - tvox; // 0 = transparent => d.h. tvox = 1 - - // L_vox = Omega * L_light * (1 - T_vox) * T_ray - buffer[image_index*4] = buffer[image_index*4 + 1] = buffer[image_index*4 + 2] = smd->domain->omega * 1.0 * tvox * tray; - } - } - } - glBindTexture(GL_TEXTURE_2D, smd->domain->bind[counter_textures]); - glEnable(GL_TEXTURE_2D); - - if(new) - { - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, res[mainaxis[1]], res[mainaxis[2]], 0, GL_RGBA, GL_FLOAT, buffer); - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); // Linear Filtering - glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); // Linear Filtering - } - - if((z % mod_texture) == 0 ) - { - // botttom left - quad[3][mainaxis[0]] = smd->domain->p0[mainaxis[0]] + z * smd->domain->dx * bigfactor + smd->domain->dx * bigfactor * 0.5; - quad[3][mainaxis[1]] = smd->domain->p0[mainaxis[1]] + smd->domain->dx * bigfactor * 0.5; - quad[3][mainaxis[2]] = smd->domain->p0[mainaxis[2]] + smd->domain->dx * bigfactor * 0.5; - - // top right - quad[1][mainaxis[0]] = smd->domain->p0[mainaxis[0]] + z * smd->domain->dx * bigfactor + smd->domain->dx * bigfactor * 0.5; - quad[1][mainaxis[1]] = smd->domain->p0[mainaxis[1]] + (res[mainaxis[1]] - 1) * smd->domain->dx * bigfactor + smd->domain->dx * bigfactor * 0.5; - quad[1][mainaxis[2]] = smd->domain->p0[mainaxis[2]] + (res[mainaxis[2]] - 1) * smd->domain->dx * bigfactor + smd->domain->dx * bigfactor * 0.5; - - // top left - quad[2][mainaxis[0]] = smd->domain->p0[mainaxis[0]] + z * smd->domain->dx * bigfactor + smd->domain->dx * bigfactor * 0.5; - quad[2][mainaxis[1]] = smd->domain->p0[mainaxis[1]] + smd->domain->dx * bigfactor * 0.5; - quad[2][mainaxis[2]] = smd->domain->p0[mainaxis[2]] + (res[mainaxis[2]] - 1) * smd->domain->dx * bigfactor + smd->domain->dx * bigfactor * 0.5; - - // bottom right - quad[0][mainaxis[0]] = smd->domain->p0[mainaxis[0]] + z * smd->domain->dx * bigfactor + smd->domain->dx * bigfactor * 0.5; - quad[0][mainaxis[1]] = smd->domain->p0[mainaxis[1]] + (res[mainaxis[1]] - 1) * smd->domain->dx * bigfactor + smd->domain->dx * bigfactor * 0.5; - quad[0][mainaxis[2]] = smd->domain->p0[mainaxis[2]] + smd->domain->dx * bigfactor * 0.5; - - glBegin(GL_QUADS); // Start Drawing Quads - - glTexCoord2f(1.0f, 0.0f); - glVertex3fv(quad[0]); // Left And Up 1 Unit (Top Left) - glTexCoord2f(1.0f, 1.0f); - glVertex3fv(quad[1]); // Right And Up 1 Unit (Top Right) - glTexCoord2f(0.0f, 1.0f); - glVertex3fv(quad[2]); // Right And Down One Unit (Bottom Right) - glTexCoord2f(0.0f, 0.0f); - glVertex3fv(quad[3]); // Left And Down One Unit (Bottom Left) - - glEnd(); - } - counter_textures++; - } - } - if(buffer) - { - MEM_freeN(buffer); - buffer = NULL; - } - - // set correct flag for viewsettings - if(1) - { - // do not clear BIG/SMALL flag - smd->domain->viewsettings &= ~MOD_SMOKE_VIEW_X; - smd->domain->viewsettings &= ~MOD_SMOKE_VIEW_Y; - smd->domain->viewsettings &= ~MOD_SMOKE_VIEW_Z; - - // set what caches we have - if(big) - smd->domain->viewsettings |= MOD_SMOKE_VIEW_BIG; - else - smd->domain->viewsettings |= MOD_SMOKE_VIEW_SMALL; - - if(mainaxis[0] == 0) - smd->domain->viewsettings |= MOD_SMOKE_VIEW_X; - else if(mainaxis[0] == 1) - smd->domain->viewsettings |= MOD_SMOKE_VIEW_Y; - else if(mainaxis[0] == 2) - smd->domain->viewsettings |= MOD_SMOKE_VIEW_Z; - } - - wmMultMatrix(ob->obmat); - glDisable(GL_BLEND); - glDepthMask(GL_TRUE); - if(col) cpack(col); } } diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c new file mode 100644 index 00000000000..221003360f4 --- /dev/null +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -0,0 +1,304 @@ +/** + * $Id$ + * + * ***** 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. + * + * Contributor(s): Daniel Genrich + * + * ***** END GPL LICENSE BLOCK ***** + */ + + +#include +#include + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include "MEM_guardedalloc.h" + +#include "IMB_imbuf.h" + + +#include "MTC_matrixops.h" + +#include "DNA_armature_types.h" +#include "DNA_boid_types.h" +#include "DNA_camera_types.h" +#include "DNA_curve_types.h" +#include "DNA_constraint_types.h" // for drawing constraint +#include "DNA_effect_types.h" +#include "DNA_lamp_types.h" +#include "DNA_lattice_types.h" +#include "DNA_material_types.h" +#include "DNA_mesh_types.h" +#include "DNA_meshdata_types.h" +#include "DNA_meta_types.h" +#include "DNA_modifier_types.h" +#include "DNA_object_types.h" +#include "DNA_object_force.h" +#include "DNA_object_fluidsim.h" +#include "DNA_particle_types.h" +#include "DNA_space_types.h" +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_smoke_types.h" +#include "DNA_userdef_types.h" +#include "DNA_view3d_types.h" +#include "DNA_world_types.h" + +#include "BLI_blenlib.h" +#include "BLI_arithb.h" +#include "BLI_editVert.h" +#include "BLI_edgehash.h" +#include "BLI_rand.h" + +#include "BKE_anim.h" //for the where_on_path function +#include "BKE_curve.h" +#include "BKE_constraint.h" // for the get_constraint_target function +#include "BKE_DerivedMesh.h" +#include "BKE_deform.h" +#include "BKE_displist.h" +#include "BKE_effect.h" +#include "BKE_font.h" +#include "BKE_global.h" +#include "BKE_image.h" +#include "BKE_key.h" +#include "BKE_lattice.h" +#include "BKE_mesh.h" +#include "BKE_material.h" +#include "BKE_mball.h" +#include "BKE_modifier.h" +#include "BKE_object.h" +#include "BKE_paint.h" +#include "BKE_particle.h" +#include "BKE_property.h" +#include "BKE_smoke.h" +#include "BKE_unit.h" +#include "BKE_utildefines.h" +#include "smoke_API.h" + +#include "BIF_gl.h" +#include "BIF_glutil.h" + +#include "GPU_draw.h" +#include "GPU_material.h" +#include "GPU_extensions.h" + +#include "ED_mesh.h" +#include "ED_particle.h" +#include "ED_screen.h" +#include "ED_types.h" +#include "ED_util.h" + +#include "UI_resources.h" +#include "UI_interface_icons.h" + +#include "WM_api.h" +#include "BLF_api.h" + +#include "GPU_extensions.h" + +#include "view3d_intern.h" // own include + +struct GPUTexture; + +/* draw slices of smoke is adapted from c++ code authored by: Johannes Schmid and Ingemar Rask, 2006, johnny@grob.org */ +static float cv[][3] = { + {1.0f, 1.0f, 1.0f}, {-1.0f, 1.0f, 1.0f}, {-1.0f, -1.0f, 1.0f}, {1.0f, -1.0f, 1.0f}, + {1.0f, 1.0f, -1.0f}, {-1.0f, 1.0f, -1.0f}, {-1.0f, -1.0f, -1.0f}, {1.0f, -1.0f, -1.0f} +}; + +// edges have the form edges[n][0][xyz] + t*edges[n][1][xyz] +static float edges[12][2][3] = { + {{1.0f, 1.0f, -1.0f}, {0.0f, 0.0f, 1.0f}}, + {{-1.0f, 1.0f, -1.0f}, {0.0f, 0.0f, 1.0f}}, + {{-1.0f, -1.0f, -1.0f}, {0.0f, 0.0f, 1.0f}}, + {{1.0f, -1.0f, -1.0f}, {0.0f, 0.0f, 1.0f}}, + + {{1.0f, -1.0f, 1.0f}, {0.0f, 1.0f, 0.0f}}, + {{-1.0f, -1.0f, 1.0f}, {0.0f, 1.0f, 0.0f}}, + {{-1.0f, -1.0f, -1.0f}, {0.0f, 1.0f, 0.0f}}, + {{1.0f, -1.0f, -1.0f}, {0.0f, 1.0f, 0.0f}}, + + {{-1.0f, 1.0f, 1.0f}, {1.0f, 0.0f, 0.0f}}, + {{-1.0f, -1.0f, 1.0f}, {1.0f, 0.0f, 0.0f}}, + {{-1.0f, -1.0f, -1.0f}, {1.0f, 0.0f, 0.0f}}, + {{-1.0f, 1.0f, -1.0f}, {1.0f, 0.0f, 0.0f}} +}; + +int intersect_edges(float *points, float a, float b, float c, float d) +{ + int i; + float t; + int numpoints = 0; + + for (i=0; i<12; i++) { + t = -(a*edges[i][0][0] + b*edges[i][0][1] + c*edges[i][0][2] + d) + / (a*edges[i][1][0] + b*edges[i][1][1] + c*edges[i][1][2]); + if ((t>0)&&(t<2)) { + points[numpoints * 3 + 0] = edges[i][0][0] + edges[i][1][0]*t; + points[numpoints * 3 + 1] = edges[i][0][1] + edges[i][1][1]*t; + points[numpoints * 3 + 2] = edges[i][0][2] + edges[i][1][2]*t; + numpoints++; + } + } + return numpoints; +} + +static int convex(float *p0, float *up, float *a, float *b) +{ + // Vec3 va = a-p0, vb = b-p0; + float va[3], vb[3], tmp[3]; + VECSUB(va, a, p0); + VECSUB(vb, b, p0); + Crossf(tmp, va, vb); + return INPR(up, tmp) >= 0; +} + +// copied from gpu_extension.c +static int is_pow2(int n) +{ + return ((n)&(n-1))==0; +} + +static int larger_pow2(int n) +{ + if (is_pow2(n)) + return n; + + while(!is_pow2(n)) + n= n&(n-1); + + return n*2; +} + +void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture *tex, int res[3]) +{ + Object *ob = base->object; + RegionView3D *rv3d= ar->regiondata; + + float viewnormal[3]; + // int res[3]; + int i, j, n; + float d, d0, dd; + float *points = NULL; + int numpoints = 0; + float cor[3] = {1.,1.,1.}; + + /* + res[0] = smd->domain->res[0]; + res[1] = smd->domain->res[1]; + res[2] = smd->domain->res[2]; + */ + + wmLoadMatrix(rv3d->viewmat); + + glDepthMask(GL_FALSE); + glEnable(GL_TEXTURE_3D); + glDisable(GL_DEPTH_TEST); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + // get view vector + VECCOPY(viewnormal, rv3d->viewinv[2]); + Normalize(viewnormal); + + // find cube vertex that is closest to the viewer + for (i=0; i<8; i++) { + float x,y,z; + + x = cv[i][0] + viewnormal[0]; + y = cv[i][1] + viewnormal[1]; + z = cv[i][2] + viewnormal[2]; + + if ((x>=-1.0f)&&(x<=1.0f) + &&(y>=-1.0f)&&(y<=1.0f) + &&(z>=-1.0f)&&(z<=1.0f)) { + break; + } + } + + GPU_texture_bind(tex, 0); + + cor[0] = (float)res[0]/(float)larger_pow2(res[0]); + cor[1] = (float)res[1]/(float)larger_pow2(res[1]); + cor[2] = (float)res[2]/(float)larger_pow2(res[2]); + + // our slices are defined by the plane equation a*x + b*y +c*z + d = 0 + // (a,b,c), the plane normal, are given by viewdir + // d is the parameter along the view direction. the first d is given by + // inserting previously found vertex into the plane equation + d0 = -(viewnormal[0]*cv[i][0] + viewnormal[1]*cv[i][1] + viewnormal[2]*cv[i][2]); + dd = 2.0*d0/64.0f; + n = 0; + + // printf("d0: %f, dd: %f\n", d0, dd); + + points = MEM_callocN(sizeof(float)*12*3, "smoke_points_preview"); + + for (d = d0; d > -d0; d -= dd) { + float p0[3]; + // intersect_edges returns the intersection points of all cube edges with + // the given plane that lie within the cube + numpoints = intersect_edges(points, viewnormal[0], viewnormal[1], viewnormal[2], d); + + if (numpoints > 2) { + VECCOPY(p0, points); + + // sort points to get a convex polygon + for(i = 1; i < numpoints - 1; i++) + { + for(j = i + 1; j < numpoints; j++) + { + if(convex(p0, viewnormal, &points[j * 3], &points[i * 3])) + { + float tmp2[3]; + VECCOPY(tmp2, &points[i * 3]); + VECCOPY(&points[i * 3], &points[j * 3]); + VECCOPY(&points[j * 3], tmp2); + } + } + } + + glBegin(GL_POLYGON); + for (i = 0; i < numpoints; i++) { + glColor3f(1.0, 1.0, 1.0); + glTexCoord3d((points[i * 3 + 0] + 1.0)*cor[0]/2.0, (points[i * 3 + 1] + 1)*cor[1]/2.0, (points[i * 3 + 2] + 1.0)*cor[2]/2.0); + glVertex3f(points[i * 3 + 0], points[i * 3 + 1], points[i * 3 + 2]); + } + glEnd(); + } + n++; + } + + GPU_texture_unbind(tex); + + MEM_freeN(points); + + wmMultMatrix(ob->obmat); + + glDisable(GL_TEXTURE_3D); + glDisable(GL_BLEND); + glEnable(GL_DEPTH_TEST); + glDepthMask(GL_TRUE); +} + diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index acd1c62bc17..e5e85cf9d16 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -156,6 +156,9 @@ void VIEW3D_OT_snap_menu(struct wmOperatorType *ot); ARegion *view3d_has_buttons_region(ScrArea *sa); ARegion *view3d_has_tools_region(ScrArea *sa); +/* draw_volume.c */ +void draw_volume(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, struct Base *base, struct GPUTexture *tex, int res[3]); + #endif /* ED_VIEW3D_INTERN_H */ diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h index 82ff51dc5ce..1c6b8399422 100644 --- a/source/blender/gpu/GPU_draw.h +++ b/source/blender/gpu/GPU_draw.h @@ -112,6 +112,10 @@ int GPU_verify_image(struct Image *ima, int tftile, int tfmode, int compare, int void GPU_free_image(struct Image *ima); void GPU_free_images(void); +/* smoke drawing functions */ +void GPU_free_smoke(struct SmokeModifierData *smd); +void GPU_create_smoke(struct SmokeModifierData *smd); + #ifdef __cplusplus } #endif diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h index eba585e8838..e00cab79ce0 100644 --- a/source/blender/gpu/GPU_extensions.h +++ b/source/blender/gpu/GPU_extensions.h @@ -73,6 +73,7 @@ int GPU_print_error(char *str); GPUTexture *GPU_texture_create_1D(int w, float *pixels); GPUTexture *GPU_texture_create_2D(int w, int h, float *pixels); +GPUTexture *GPU_texture_create_3D(int w, int h, int depth, float *fpixels); GPUTexture *GPU_texture_create_depth(int w, int h); GPUTexture *GPU_texture_from_blender(struct Image *ima, struct ImageUser *iuser, double time, int mipmap); diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index e7846a23905..a81c7e03455 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -38,9 +38,11 @@ #include "DNA_lamp_types.h" #include "DNA_material_types.h" #include "DNA_meshdata_types.h" +#include "DNA_modifier_types.h" #include "DNA_node_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" +#include "DNA_smoke_types.h" #include "DNA_userdef_types.h" #include "DNA_view3d_types.h" @@ -744,6 +746,23 @@ int GPU_update_image_time(Image *ima, double time) return inc; } + +void GPU_free_smoke(SmokeModifierData *smd) +{ + if(smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain) + { + if(smd->domain->tex) + GPU_texture_free(smd->domain->tex); + smd->domain->tex = NULL; + } +} + +void GPU_create_smoke(SmokeModifierData *smd) +{ + if(smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain && !smd->domain->tex) + smd->domain->tex = GPU_texture_create_3D(smd->domain->res[0], smd->domain->res[1], smd->domain->res[2], smd->domain->view3d); +} + void GPU_free_image(Image *ima) { /* free regular image binding */ diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index 467b2c4a7f4..0b6640b9e27 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -312,6 +312,78 @@ static GPUTexture *GPU_texture_create_nD(int w, int h, int n, float *fpixels, in return tex; } + +GPUTexture *GPU_texture_create_3D(int w, int h, int depth, float *fpixels) +{ + GPUTexture *tex; + GLenum type, format, internalformat; + void *pixels = NULL; + + tex = MEM_callocN(sizeof(GPUTexture), "GPUTexture"); + tex->w = w; + tex->h = h; + tex->depth = depth; + tex->number = -1; + tex->refcount = 1; + tex->target = GL_TEXTURE_3D; + + glGenTextures(1, &tex->bindcode); + + if (!tex->bindcode) { + fprintf(stderr, "GPUTexture: texture create failed: %d\n", + (int)glGetError()); + GPU_texture_free(tex); + return NULL; + } + + // if (!GLEW_ARB_texture_non_power_of_two) + { + tex->w = larger_pow2(tex->w); + tex->h = larger_pow2(tex->h); + tex->depth = larger_pow2(tex->depth); + } + + tex->number = 0; + glBindTexture(tex->target, tex->bindcode); + + type = GL_UNSIGNED_BYTE; + format = GL_RGBA; + internalformat = GL_RGBA8; + + if (fpixels) + pixels = GPU_texture_convert_pixels(w*h*depth, fpixels); + + glTexImage3D(tex->target, 0, internalformat, tex->w, tex->h, tex->depth, 0, format, type, 0); + + if (fpixels) { + glTexSubImage3D(tex->target, 0, 0, 0, 0, w, h, depth, format, type, pixels); + + /* + if (tex->w > w) + GPU_glTexSubImageEmpty(tex->target, format, w, 0, tex->w-w, tex->h); + if (tex->h > h) + GPU_glTexSubImageEmpty(tex->target, format, 0, h, w, tex->h-h); + */ + } + + // glTexImage3D(tex->target, 0, GL_RGBA, w, h, depth, 0, GL_RGBA, GL_FLOAT, fpixels); + + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S,GL_CLAMP_TO_BORDER); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T,GL_CLAMP_TO_BORDER); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R,GL_CLAMP_TO_BORDER); + + + if (pixels) + MEM_freeN(pixels); + + if (tex) + GPU_texture_unbind(tex); + + return tex; +} + GPUTexture *GPU_texture_from_blender(Image *ima, ImageUser *iuser, double time, int mipmap) { GPUTexture *tex; diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 9d1707599b9..33499574012 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -42,6 +42,7 @@ typedef enum ModifierType { eModifierType_Multires, eModifierType_Surface, eModifierType_Smoke, + eModifierType_SmokeHR, NUM_MODIFIER_TYPES } ModifierType; @@ -252,9 +253,36 @@ typedef struct SmokeModifierData { struct SmokeCollSettings *coll; /* collision objects */ float time; int type; /* domain, inflow, outflow, ... */ - struct PointCache *point_cache; /* definition is in DNA_object_force.h */ } SmokeModifierData; + +/* noise */ +#define MOD_SMOKE_NOISEWAVE (1<<0) +#define MOD_SMOKE_NOISEFFT (1<<1) +#define MOD_SMOKE_NOISECURL (1<<2) + +/* flags */ +#define MOD_SMOKE_SHOWHIGHRES (1<<0) /* show high resolution */ + +typedef struct SmokeHRModifierData { + ModifierData modifier; + + struct WTURBULENCE *wt; // WTURBULENCE object, if active + struct PointCache *point_cache; /* definition is in DNA_object_force.h */ + struct ListBase ptcaches; + struct GPUTexture *tex; + float *view3d; /* voxel data for display */ + unsigned int v3dnum; /* number of frame in view3d buffer */ + float time; + float strength; + int res[3]; + int maxres; + short noise; /* noise type: wave, curl, anisotropic */ + short pad; + int amplify; + int flags; +} SmokeHRModifierData; + typedef struct DisplaceModifierData { ModifierData modifier; diff --git a/source/blender/makesdna/DNA_smoke_types.h b/source/blender/makesdna/DNA_smoke_types.h index c7f49d3ddd2..2d8b21b86de 100644 --- a/source/blender/makesdna/DNA_smoke_types.h +++ b/source/blender/makesdna/DNA_smoke_types.h @@ -30,24 +30,12 @@ #define DNA_SMOKE_TYPES_H /* flags */ -#define MOD_SMOKE_HIGHRES (1<<1) /* compute high resolution */ +#define MOD_SMOKE_HIGHRES (1<<1) /* enable high resolution */ #define MOD_SMOKE_DISSOLVE (1<<2) /* let smoke dissolve */ #define MOD_SMOKE_DISSOLVE_LOG (1<<3) /* using 1/x for dissolve */ -/* noise */ -#define MOD_SMOKE_NOISEWAVE (1<<0) -#define MOD_SMOKE_NOISEFFT (1<<1) -#define MOD_SMOKE_NOISECURL (1<<2) /* viewsettings */ -#define MOD_SMOKE_VIEW_X (1<<0) -#define MOD_SMOKE_VIEW_Y (1<<1) -#define MOD_SMOKE_VIEW_Z (1<<2) -#define MOD_SMOKE_VIEW_SMALL (1<<3) -#define MOD_SMOKE_VIEW_BIG (1<<4) -#define MOD_SMOKE_VIEW_CHANGETOBIG (1<<5) -#define MOD_SMOKE_VIEW_REDRAWNICE (1<<6) -#define MOD_SMOKE_VIEW_REDRAWALL (1<<7) -#define MOD_SMOKE_VIEW_USEBIG (1<<8) +/* nothing so far */ typedef struct SmokeDomainSettings { struct SmokeModifierData *smd; /* for fast RNA access */ @@ -55,33 +43,27 @@ typedef struct SmokeDomainSettings { struct Group *fluid_group; struct Group *eff_group; // effector group for e.g. wind force struct Group *coll_group; // collision objects group - unsigned int *bind; - float *tvox; - float *tray; - float *tvoxbig; - float *traybig; + struct GPUTexture *tex; + float *view3d; /* voxel data for display */ + unsigned int v3dnum; /* number of frame in view3d buffer */ float p0[3]; /* start point of BB */ float p1[3]; /* end point of BB */ float dx; /* edge length of one cell */ float firstframe; float lastframe; - float omega; /* smoke color - from 0 to 1 */ float temp; /* fluid temperature */ float tempAmb; /* ambient temperature */ float alpha; float beta; int res[3]; /* domain resolution */ - int amplify; /* wavelet amplification */ int maxres; /* longest axis on the BB gets this resolution assigned */ int flags; /* show up-res or low res, etc */ - int visibility; /* how many billboards to show (every 2nd, 3rd, 4th,..) */ int viewsettings; - int max_textures; - short noise; /* noise type: wave, curl, anisotropic */ short diss_percent; + short pad; int diss_speed;/* in frames */ - float strength; - struct WTURBULENCE *wt; // WTURBULENCE object, if active + struct PointCache *point_cache; /* definition is in DNA_object_force.h */ + struct ListBase ptcaches; } SmokeDomainSettings; diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index e08bc734242..e4fe92317d4 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -387,6 +387,7 @@ extern StructRNA RNA_SmokeCollSettings; extern StructRNA RNA_SmokeDomainSettings; extern StructRNA RNA_SmokeFlowSettings; extern StructRNA RNA_SmokeModifier; +extern StructRNA RNA_SmokeHRModifier; extern StructRNA RNA_SmoothModifier; extern StructRNA RNA_SoftBodyModifier; extern StructRNA RNA_SoftBodySettings; diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 837158b9ec8..f2c8e404a52 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -68,6 +68,7 @@ EnumPropertyItem modifier_type_items[] ={ {eModifierType_Shrinkwrap, "SHRINKWRAP", ICON_MOD_SHRINKWRAP, "Shrinkwrap", ""}, {eModifierType_SimpleDeform, "SIMPLE_DEFORM", ICON_MOD_SIMPLEDEFORM, "Simple Deform", ""}, {eModifierType_Smoke, "SMOKE", 0, "Smoke", ""}, + {eModifierType_SmokeHR, "SMOKE_HR", 0, "SmokeHR", ""}, {eModifierType_Smooth, "SMOOTH", ICON_MOD_SMOOTH, "Smooth", ""}, {eModifierType_Softbody, "SOFT_BODY", ICON_MOD_SOFT, "Soft Body", ""}, {eModifierType_Subsurf, "SUBSURF", ICON_MOD_SUBSURF, "Subdivision Surface", ""}, @@ -156,6 +157,8 @@ static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr) return &RNA_SurfaceModifier; case eModifierType_Smoke: return &RNA_SmokeModifier; + case eModifierType_SmokeHR: + return &RNA_SmokeHRModifier; default: return &RNA_Modifier; } @@ -181,19 +184,30 @@ static void rna_Smoke_set_type(bContext *C, PointerRNA *ptr) { SmokeModifierData *smd= (SmokeModifierData *)ptr->data; Object *ob= (Object*)ptr->id.data; + + // nothing changed + if((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) + return; smokeModifier_free(smd); // XXX TODO: completely free all 3 pointers smokeModifier_createType(smd); // create regarding of selected type - // particle_system_slot_add_exec(C, NULL); - // particle_system_slot_remove_exec(C, NULL); - if(smd->type == MOD_SMOKE_TYPE_DOMAIN) + if(smd->type & MOD_SMOKE_TYPE_DOMAIN) ob->dt = OB_WIRE; // update dependancy since a domain - other type switch could have happened rna_Modifier_dependency_update(C, ptr); } +static void rna_SmokeHR_reset(bContext *C, PointerRNA *ptr) +{ + // SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data; + + // smokeModifier_reset(settings->smd); + + // rna_Smoke_update(C, ptr); +} + static void rna_ExplodeModifier_vgroup_get(PointerRNA *ptr, char *value) { ExplodeModifierData *emd= (ExplodeModifierData*)ptr->data; @@ -1499,6 +1513,55 @@ static void rna_def_modifier_cloth(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Point Cache", ""); } +static void rna_def_modifier_smoke_highresolution(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem prop_noise_type_items[] = { + {MOD_SMOKE_NOISEWAVE, "NOISEWAVE", 0, "Wavelet", ""}, +#if FFTW3 == 1 + {MOD_SMOKE_NOISEFFT, "NOISEFFT", 0, "FFT", ""}, +#endif + /* {MOD_SMOKE_NOISECURL, "NOISECURL", 0, "Curl", ""}, */ + {0, NULL, 0, NULL, NULL}}; + + srna= RNA_def_struct(brna, "SmokeHRModifier", "Modifier"); + RNA_def_struct_ui_text(srna, "Smoke High Resolution Modifier", "Smoke high resolution simulation modifier."); + RNA_def_struct_sdna(srna, "SmokeHRModifierData"); + + prop= RNA_def_property(srna, "show_highres", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_SHOWHIGHRES); + RNA_def_property_ui_text(prop, "High res", "Show high resolution (using amplification)."); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + + prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "noise"); + RNA_def_property_enum_items(prop, prop_noise_type_items); + RNA_def_property_ui_text(prop, "Noise Method", "Noise method which is used for creating the high resolution"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_SmokeHR_reset"); + + prop= RNA_def_property(srna, "amplify", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "amplify"); + RNA_def_property_range(prop, 1, 10); + RNA_def_property_ui_range(prop, 1, 10, 1, 0); + RNA_def_property_ui_text(prop, "Amplification", "Enhance the resolution of smoke by this factor using noise."); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_SmokeHR_reset"); + + prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "strength"); + RNA_def_property_range(prop, 1.0, 10.0); + RNA_def_property_ui_range(prop, 1.0, 10.0, 1, 2); + RNA_def_property_ui_text(prop, "Strength", "Strength of wavelet noise"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_SmokeHR_reset"); + + prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NEVER_NULL); + RNA_def_property_pointer_sdna(prop, NULL, "point_cache"); + RNA_def_property_struct_type(prop, "PointCache"); + RNA_def_property_ui_text(prop, "Point Cache", ""); + +} + static void rna_def_modifier_smoke(BlenderRNA *brna) { StructRNA *srna; @@ -1915,6 +1978,7 @@ void RNA_def_modifier(BlenderRNA *brna) rna_def_modifier_multires(brna); rna_def_modifier_surface(brna); rna_def_modifier_smoke(brna); + rna_def_modifier_smoke_highresolution(brna); } #endif diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c index 6f1babb495a..a119eefa62c 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -78,11 +78,28 @@ static void rna_Smoke_reset_dependancy(bContext *C, PointerRNA *ptr) rna_Smoke_dependency_update(C, ptr); } +static void rna_Smoke_enable_HR(bContext *C, PointerRNA *ptr) +{ + SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data; + Object *ob = (Object*)ptr->id.data; + + if(settings->flags & MOD_SMOKE_HIGHRES) + BLI_addtail(&ob->modifiers, modifier_new(eModifierType_SmokeHR)); + else + { + ModifierData *tmd = modifiers_findByType(ob, eModifierType_SmokeHR); + if(tmd) { + BLI_remlink(&ob->modifiers, tmd); + modifier_free(tmd); + } + } +} + static void rna_Smoke_redraw(bContext *C, PointerRNA *ptr) { SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data; - settings->flags |= MOD_SMOKE_VIEW_REDRAWNICE; + // settings->flags |= MOD_SMOKE_VIEW_REDRAWNICE; } static char *rna_SmokeDomainSettings_path(PointerRNA *ptr) @@ -116,14 +133,6 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - static EnumPropertyItem prop_noise_type_items[] = { - {MOD_SMOKE_NOISEWAVE, "NOISEWAVE", 0, "Wavelet", ""}, -#if FFTW3 == 1 - {MOD_SMOKE_NOISEFFT, "NOISEFFT", 0, "FFT", ""}, -#endif - /* {MOD_SMOKE_NOISECURL, "NOISECURL", 0, "Curl", ""}, */ - {0, NULL, 0, NULL, NULL}}; - srna = RNA_def_struct(brna, "SmokeDomainSettings", NULL); RNA_def_struct_ui_text(srna, "Domain Settings", "Smoke domain settings."); RNA_def_struct_sdna(srna, "SmokeDomainSettings"); @@ -136,56 +145,19 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Max Res", "Maximal resolution used in the fluid domain."); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); - prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "omega"); - RNA_def_property_range(prop, 0.02, 1.0); - RNA_def_property_ui_range(prop, 0.02, 1.0, 0.02, 2); - RNA_def_property_ui_text(prop, "Color", "Smoke color (0 = black, 1 = white)."); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Smoke_redraw"); - - prop= RNA_def_property(srna, "amplify", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "amplify"); - RNA_def_property_range(prop, 1, 10); - RNA_def_property_ui_range(prop, 1, 10, 1, 0); - RNA_def_property_ui_text(prop, "Amplification", "Enhance the resolution of smoke by this factor using noise."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); - - prop= RNA_def_property(srna, "highres", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGHRES); - RNA_def_property_ui_text(prop, "High res", "Enable high resolution (using amplification)."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); - - prop= RNA_def_property(srna, "viewhighres", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "viewsettings", MOD_SMOKE_VIEW_USEBIG); - RNA_def_property_ui_text(prop, "Show High Resolution", "Show high resolution (using amplification)."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_redraw"); - - prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "noise"); - RNA_def_property_enum_items(prop, prop_noise_type_items); - RNA_def_property_ui_text(prop, "Noise Method", "Noise method which is used for creating the high resolution"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); - - prop= RNA_def_property(srna, "visibility", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "visibility"); - RNA_def_property_range(prop, 1, 15); - RNA_def_property_ui_range(prop, 1, 15, 1, 0); - RNA_def_property_ui_text(prop, "Display", "How much of the resolution should be shown during preview (every 2nd, 3rd, etc)."); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Smoke_redraw"); - prop= RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "alpha"); RNA_def_property_range(prop, -5.0, 5.0); RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5); RNA_def_property_ui_text(prop, "Gravity", "Higher value results in sinking smoke"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL); prop= RNA_def_property(srna, "beta", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "beta"); RNA_def_property_range(prop, -5.0, 5.0); RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5); RNA_def_property_ui_text(prop, "Heat", "Higher value results in faster rising smoke."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL); prop= RNA_def_property(srna, "coll_group", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "coll_group"); @@ -208,13 +180,6 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Effector Group", "Limit effectors to this group."); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy"); - prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "strength"); - RNA_def_property_range(prop, 1.0, 10.0); - RNA_def_property_ui_range(prop, 1.0, 10.0, 1, 2); - RNA_def_property_ui_text(prop, "Strength", "Strength of wavelet noise"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); - prop= RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "diss_speed"); RNA_def_property_range(prop, 1.0, 100.0); @@ -222,6 +187,11 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Dissolve Speed", "Dissolve Speed"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL); + prop= RNA_def_property(srna, "highres", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGHRES); + RNA_def_property_ui_text(prop, "High Resolution Smoke", "Enable high resolution smoke"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_enable_HR"); + prop= RNA_def_property(srna, "dissolve_smoke", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE); RNA_def_property_ui_text(prop, "Dissolve Smoke", "Enable smoke to disappear over time."); @@ -231,6 +201,11 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE_LOG); RNA_def_property_ui_text(prop, "Logarithmic dissolve", "Using 1/x "); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL); + + prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NEVER_NULL); + RNA_def_property_pointer_sdna(prop, NULL, "point_cache"); + RNA_def_property_struct_type(prop, "PointCache"); + RNA_def_property_ui_text(prop, "Point Cache", ""); } static void rna_def_smoke_flow_settings(BlenderRNA *brna) diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 3a2cef2d038..3b95c409b30 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -319,6 +319,8 @@ IF(UNIX) bf_dummy bf_bullet bf_smoke + bf_minilzo + bf_lzma bf_common bf_ketsji bf_logic From 89658db5761516d4c07a2b975e3e6e290cd67cea Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Thu, 20 Aug 2009 00:37:27 +0000 Subject: [PATCH 150/577] Fix Smoke #1: * compile error reported by nudelZ (static/nonstatic) --- source/blender/blenkernel/intern/smoke.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 6449ae10eee..9be60a0a975 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -123,7 +123,7 @@ struct DerivedMesh; struct SmokeModifierData; // forward declerations -void get_cell(float *p0, int res[3], float dx, float *pos, int *cell, int correct); +static void get_cell(float *p0, int res[3], float dx, float *pos, int *cell, int correct); void calcTriangleDivs(Object *ob, MVert *verts, int numverts, MFace *tris, int numfaces, int numtris, int **tridivs, float cell_len); void smoke_prepare_View(SmokeModifierData *smd, float framenr, float *light, int have_light); From 858dbbe232cce6a8e1d13a98385122ff236b146e Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Thu, 20 Aug 2009 00:42:57 +0000 Subject: [PATCH 151/577] Fix Smoke: *totally forgot scons file for lzma --- extern/lzma/SConscript | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 extern/lzma/SConscript diff --git a/extern/lzma/SConscript b/extern/lzma/SConscript new file mode 100644 index 00000000000..015cdfe339f --- /dev/null +++ b/extern/lzma/SConscript @@ -0,0 +1,9 @@ +#!/usr/bin/python +Import ('env') + +sources = env.Glob('./*.c') + +defs = '' +incs = ' . ' + +env.BlenderLib ('bf_lzma', sources, Split(incs), Split(defs), libtype=['intern'], priority=[40] ) From 147bcc92b618701c4906ff99b09da07a5b13a9a4 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 20 Aug 2009 00:54:40 +0000 Subject: [PATCH 152/577] * Library path fixes for win64 --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 00d2244511f..9db25115099 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -256,7 +256,11 @@ IF(WIN32) SET(ZLIB ${LIBDIR}/zlib) SET(ZLIB_INC ${ZLIB}/include) - SET(ZLIB_LIBRARIES zlib) + IF(CMAKE_CL_64) + SET(ZLIB_LIBRARIES libz) + ELSE(CMAKE_CL_64) + SET(ZLIB_LIBRARIES zlib) + ENDIF(CMAKE_CL_64) SET(ZLIB_LIBPATH ${ZLIB}/lib) SET(PTHREADS ${LIBDIR}/pthreads) @@ -279,7 +283,7 @@ IF(WIN32) SET(GETTEXT ${LIBDIR}/gettext) SET(GETTEXT_INC ${GETTEXT}/include) IF(CMAKE_CL_64) - SET(GETTEXT_LIB gettextlib) + SET(GETTEXT_LIB gettext) ELSE(CMAKE_CL_64) SET(GETTEXT_LIB gnu_gettext) ENDIF(CMAKE_CL_64) From e56c32073d8b4855e9a6b83d281b80d4b0a2aa4d Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Thu, 20 Aug 2009 01:02:34 +0000 Subject: [PATCH 153/577] LZMA: Deleting unused bad files (bad for gcc) --- extern/lzma/7zBuf.c | 36 -- extern/lzma/7zBuf.h | 31 -- extern/lzma/7zBuf2.c | 45 --- extern/lzma/7zCrc.c | 35 -- extern/lzma/7zCrc.h | 24 -- extern/lzma/7zFile.c | 263 ------------- extern/lzma/7zFile.h | 74 ---- extern/lzma/7zStream.c | 169 --------- extern/lzma/7zVersion.h | 7 - extern/lzma/Bcj2.c | 132 ------- extern/lzma/Bcj2.h | 30 -- extern/lzma/Bra.c | 133 ------- extern/lzma/Bra.h | 60 --- extern/lzma/Bra86.c | 85 ----- extern/lzma/BraIA64.c | 67 ---- extern/lzma/CpuArch.h | 69 ---- extern/lzma/LzFindMt.c | 793 ---------------------------------------- extern/lzma/LzFindMt.h | 97 ----- extern/lzma/Threads.c | 109 ------ extern/lzma/Threads.h | 68 ---- 20 files changed, 2327 deletions(-) delete mode 100644 extern/lzma/7zBuf.c delete mode 100644 extern/lzma/7zBuf.h delete mode 100644 extern/lzma/7zBuf2.c delete mode 100644 extern/lzma/7zCrc.c delete mode 100644 extern/lzma/7zCrc.h delete mode 100644 extern/lzma/7zFile.c delete mode 100644 extern/lzma/7zFile.h delete mode 100644 extern/lzma/7zStream.c delete mode 100644 extern/lzma/7zVersion.h delete mode 100644 extern/lzma/Bcj2.c delete mode 100644 extern/lzma/Bcj2.h delete mode 100644 extern/lzma/Bra.c delete mode 100644 extern/lzma/Bra.h delete mode 100644 extern/lzma/Bra86.c delete mode 100644 extern/lzma/BraIA64.c delete mode 100644 extern/lzma/CpuArch.h delete mode 100644 extern/lzma/LzFindMt.c delete mode 100644 extern/lzma/LzFindMt.h delete mode 100644 extern/lzma/Threads.c delete mode 100644 extern/lzma/Threads.h diff --git a/extern/lzma/7zBuf.c b/extern/lzma/7zBuf.c deleted file mode 100644 index 14e7f4e2b92..00000000000 --- a/extern/lzma/7zBuf.c +++ /dev/null @@ -1,36 +0,0 @@ -/* 7zBuf.c -- Byte Buffer -2008-03-28 -Igor Pavlov -Public domain */ - -#include "7zBuf.h" - -void Buf_Init(CBuf *p) -{ - p->data = 0; - p->size = 0; -} - -int Buf_Create(CBuf *p, size_t size, ISzAlloc *alloc) -{ - p->size = 0; - if (size == 0) - { - p->data = 0; - return 1; - } - p->data = (Byte *)alloc->Alloc(alloc, size); - if (p->data != 0) - { - p->size = size; - return 1; - } - return 0; -} - -void Buf_Free(CBuf *p, ISzAlloc *alloc) -{ - alloc->Free(alloc, p->data); - p->data = 0; - p->size = 0; -} diff --git a/extern/lzma/7zBuf.h b/extern/lzma/7zBuf.h deleted file mode 100644 index c5bd71879cc..00000000000 --- a/extern/lzma/7zBuf.h +++ /dev/null @@ -1,31 +0,0 @@ -/* 7zBuf.h -- Byte Buffer -2008-10-04 : Igor Pavlov : Public domain */ - -#ifndef __7Z_BUF_H -#define __7Z_BUF_H - -#include "Types.h" - -typedef struct -{ - Byte *data; - size_t size; -} CBuf; - -void Buf_Init(CBuf *p); -int Buf_Create(CBuf *p, size_t size, ISzAlloc *alloc); -void Buf_Free(CBuf *p, ISzAlloc *alloc); - -typedef struct -{ - Byte *data; - size_t size; - size_t pos; -} CDynBuf; - -void DynBuf_Construct(CDynBuf *p); -void DynBuf_SeekToBeg(CDynBuf *p); -int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAlloc *alloc); -void DynBuf_Free(CDynBuf *p, ISzAlloc *alloc); - -#endif diff --git a/extern/lzma/7zBuf2.c b/extern/lzma/7zBuf2.c deleted file mode 100644 index 8d17e0dcf80..00000000000 --- a/extern/lzma/7zBuf2.c +++ /dev/null @@ -1,45 +0,0 @@ -/* 7zBuf2.c -- Byte Buffer -2008-10-04 : Igor Pavlov : Public domain */ - -#include -#include "7zBuf.h" - -void DynBuf_Construct(CDynBuf *p) -{ - p->data = 0; - p->size = 0; - p->pos = 0; -} - -void DynBuf_SeekToBeg(CDynBuf *p) -{ - p->pos = 0; -} - -int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAlloc *alloc) -{ - if (size > p->size - p->pos) - { - size_t newSize = p->pos + size; - Byte *data; - newSize += newSize / 4; - data = (Byte *)alloc->Alloc(alloc, newSize); - if (data == 0) - return 0; - p->size = newSize; - memcpy(data, p->data, p->pos); - alloc->Free(alloc, p->data); - p->data = data; - } - memcpy(p->data + p->pos, buf, size); - p->pos += size; - return 1; -} - -void DynBuf_Free(CDynBuf *p, ISzAlloc *alloc) -{ - alloc->Free(alloc, p->data); - p->data = 0; - p->size = 0; - p->pos = 0; -} diff --git a/extern/lzma/7zCrc.c b/extern/lzma/7zCrc.c deleted file mode 100644 index 71962b2c28d..00000000000 --- a/extern/lzma/7zCrc.c +++ /dev/null @@ -1,35 +0,0 @@ -/* 7zCrc.c -- CRC32 calculation -2008-08-05 -Igor Pavlov -Public domain */ - -#include "7zCrc.h" - -#define kCrcPoly 0xEDB88320 -UInt32 g_CrcTable[256]; - -void MY_FAST_CALL CrcGenerateTable(void) -{ - UInt32 i; - for (i = 0; i < 256; i++) - { - UInt32 r = i; - int j; - for (j = 0; j < 8; j++) - r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1)); - g_CrcTable[i] = r; - } -} - -UInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void *data, size_t size) -{ - const Byte *p = (const Byte *)data; - for (; size > 0 ; size--, p++) - v = CRC_UPDATE_BYTE(v, *p); - return v; -} - -UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size) -{ - return CrcUpdate(CRC_INIT_VAL, data, size) ^ 0xFFFFFFFF; -} diff --git a/extern/lzma/7zCrc.h b/extern/lzma/7zCrc.h deleted file mode 100644 index 00dc29cee3c..00000000000 --- a/extern/lzma/7zCrc.h +++ /dev/null @@ -1,24 +0,0 @@ -/* 7zCrc.h -- CRC32 calculation -2008-03-13 -Igor Pavlov -Public domain */ - -#ifndef __7Z_CRC_H -#define __7Z_CRC_H - -#include - -#include "Types.h" - -extern UInt32 g_CrcTable[]; - -void MY_FAST_CALL CrcGenerateTable(void); - -#define CRC_INIT_VAL 0xFFFFFFFF -#define CRC_GET_DIGEST(crc) ((crc) ^ 0xFFFFFFFF) -#define CRC_UPDATE_BYTE(crc, b) (g_CrcTable[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8)) - -UInt32 MY_FAST_CALL CrcUpdate(UInt32 crc, const void *data, size_t size); -UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size); - -#endif diff --git a/extern/lzma/7zFile.c b/extern/lzma/7zFile.c deleted file mode 100644 index 9a44c59ac0c..00000000000 --- a/extern/lzma/7zFile.c +++ /dev/null @@ -1,263 +0,0 @@ -/* 7zFile.c -- File IO -2008-11-22 : Igor Pavlov : Public domain */ - -#include "7zFile.h" - -#ifndef USE_WINDOWS_FILE - -#include - -#endif - -#ifdef USE_WINDOWS_FILE - -/* - ReadFile and WriteFile functions in Windows have BUG: - If you Read or Write 64MB or more (probably min_failure_size = 64MB - 32KB + 1) - from/to Network file, it returns ERROR_NO_SYSTEM_RESOURCES - (Insufficient system resources exist to complete the requested service). - Probably in some version of Windows there are problems with other sizes: - for 32 MB (maybe also for 16 MB). - And message can be "Network connection was lost" -*/ - -#define kChunkSizeMax (1 << 22) - -#endif - -void File_Construct(CSzFile *p) -{ - #ifdef USE_WINDOWS_FILE - p->handle = INVALID_HANDLE_VALUE; - #else - p->file = NULL; - #endif -} - -static WRes File_Open(CSzFile *p, const char *name, int writeMode) -{ - #ifdef USE_WINDOWS_FILE - p->handle = CreateFileA(name, - writeMode ? GENERIC_WRITE : GENERIC_READ, - FILE_SHARE_READ, NULL, - writeMode ? CREATE_ALWAYS : OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, NULL); - return (p->handle != INVALID_HANDLE_VALUE) ? 0 : GetLastError(); - #else - p->file = fopen(name, writeMode ? "wb+" : "rb"); - return (p->file != 0) ? 0 : errno; - #endif -} - -WRes InFile_Open(CSzFile *p, const char *name) { return File_Open(p, name, 0); } -WRes OutFile_Open(CSzFile *p, const char *name) { return File_Open(p, name, 1); } - -WRes File_Close(CSzFile *p) -{ - #ifdef USE_WINDOWS_FILE - if (p->handle != INVALID_HANDLE_VALUE) - { - if (!CloseHandle(p->handle)) - return GetLastError(); - p->handle = INVALID_HANDLE_VALUE; - } - #else - if (p->file != NULL) - { - int res = fclose(p->file); - if (res != 0) - return res; - p->file = NULL; - } - #endif - return 0; -} - -WRes File_Read(CSzFile *p, void *data, size_t *size) -{ - size_t originalSize = *size; - if (originalSize == 0) - return 0; - - #ifdef USE_WINDOWS_FILE - - *size = 0; - do - { - DWORD curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : (DWORD)originalSize; - DWORD processed = 0; - BOOL res = ReadFile(p->handle, data, curSize, &processed, NULL); - data = (void *)((Byte *)data + processed); - originalSize -= processed; - *size += processed; - if (!res) - return GetLastError(); - if (processed == 0) - break; - } - while (originalSize > 0); - return 0; - - #else - - *size = fread(data, 1, originalSize, p->file); - if (*size == originalSize) - return 0; - return ferror(p->file); - - #endif -} - -WRes File_Write(CSzFile *p, const void *data, size_t *size) -{ - size_t originalSize = *size; - if (originalSize == 0) - return 0; - - #ifdef USE_WINDOWS_FILE - - *size = 0; - do - { - DWORD curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : (DWORD)originalSize; - DWORD processed = 0; - BOOL res = WriteFile(p->handle, data, curSize, &processed, NULL); - data = (void *)((Byte *)data + processed); - originalSize -= processed; - *size += processed; - if (!res) - return GetLastError(); - if (processed == 0) - break; - } - while (originalSize > 0); - return 0; - - #else - - *size = fwrite(data, 1, originalSize, p->file); - if (*size == originalSize) - return 0; - return ferror(p->file); - - #endif -} - -WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin) -{ - #ifdef USE_WINDOWS_FILE - - LARGE_INTEGER value; - DWORD moveMethod; - value.LowPart = (DWORD)*pos; - value.HighPart = (LONG)((UInt64)*pos >> 16 >> 16); /* for case when UInt64 is 32-bit only */ - switch (origin) - { - case SZ_SEEK_SET: moveMethod = FILE_BEGIN; break; - case SZ_SEEK_CUR: moveMethod = FILE_CURRENT; break; - case SZ_SEEK_END: moveMethod = FILE_END; break; - default: return ERROR_INVALID_PARAMETER; - } - value.LowPart = SetFilePointer(p->handle, value.LowPart, &value.HighPart, moveMethod); - if (value.LowPart == 0xFFFFFFFF) - { - WRes res = GetLastError(); - if (res != NO_ERROR) - return res; - } - *pos = ((Int64)value.HighPart << 32) | value.LowPart; - return 0; - - #else - - int moveMethod; - int res; - switch (origin) - { - case SZ_SEEK_SET: moveMethod = SEEK_SET; break; - case SZ_SEEK_CUR: moveMethod = SEEK_CUR; break; - case SZ_SEEK_END: moveMethod = SEEK_END; break; - default: return 1; - } - res = fseek(p->file, (long)*pos, moveMethod); - *pos = ftell(p->file); - return res; - - #endif -} - -WRes File_GetLength(CSzFile *p, UInt64 *length) -{ - #ifdef USE_WINDOWS_FILE - - DWORD sizeHigh; - DWORD sizeLow = GetFileSize(p->handle, &sizeHigh); - if (sizeLow == 0xFFFFFFFF) - { - DWORD res = GetLastError(); - if (res != NO_ERROR) - return res; - } - *length = (((UInt64)sizeHigh) << 32) + sizeLow; - return 0; - - #else - - long pos = ftell(p->file); - int res = fseek(p->file, 0, SEEK_END); - *length = ftell(p->file); - fseek(p->file, pos, SEEK_SET); - return res; - - #endif -} - - -/* ---------- FileSeqInStream ---------- */ - -static SRes FileSeqInStream_Read(void *pp, void *buf, size_t *size) -{ - CFileSeqInStream *p = (CFileSeqInStream *)pp; - return File_Read(&p->file, buf, size) == 0 ? SZ_OK : SZ_ERROR_READ; -} - -void FileSeqInStream_CreateVTable(CFileSeqInStream *p) -{ - p->s.Read = FileSeqInStream_Read; -} - - -/* ---------- FileInStream ---------- */ - -static SRes FileInStream_Read(void *pp, void *buf, size_t *size) -{ - CFileInStream *p = (CFileInStream *)pp; - return (File_Read(&p->file, buf, size) == 0) ? SZ_OK : SZ_ERROR_READ; -} - -static SRes FileInStream_Seek(void *pp, Int64 *pos, ESzSeek origin) -{ - CFileInStream *p = (CFileInStream *)pp; - return File_Seek(&p->file, pos, origin); -} - -void FileInStream_CreateVTable(CFileInStream *p) -{ - p->s.Read = FileInStream_Read; - p->s.Seek = FileInStream_Seek; -} - - -/* ---------- FileOutStream ---------- */ - -static size_t FileOutStream_Write(void *pp, const void *data, size_t size) -{ - CFileOutStream *p = (CFileOutStream *)pp; - File_Write(&p->file, data, &size); - return size; -} - -void FileOutStream_CreateVTable(CFileOutStream *p) -{ - p->s.Write = FileOutStream_Write; -} diff --git a/extern/lzma/7zFile.h b/extern/lzma/7zFile.h deleted file mode 100644 index fbef6837f86..00000000000 --- a/extern/lzma/7zFile.h +++ /dev/null @@ -1,74 +0,0 @@ -/* 7zFile.h -- File IO -2008-11-22 : Igor Pavlov : Public domain */ - -#ifndef __7Z_FILE_H -#define __7Z_FILE_H - -#ifdef _WIN32 -#define USE_WINDOWS_FILE -#endif - -#ifdef USE_WINDOWS_FILE -#include -#else -#include -#endif - -#include "Types.h" - - -/* ---------- File ---------- */ - -typedef struct -{ - #ifdef USE_WINDOWS_FILE - HANDLE handle; - #else - FILE *file; - #endif -} CSzFile; - -void File_Construct(CSzFile *p); -WRes InFile_Open(CSzFile *p, const char *name); -WRes OutFile_Open(CSzFile *p, const char *name); -WRes File_Close(CSzFile *p); - -/* reads max(*size, remain file's size) bytes */ -WRes File_Read(CSzFile *p, void *data, size_t *size); - -/* writes *size bytes */ -WRes File_Write(CSzFile *p, const void *data, size_t *size); - -WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin); -WRes File_GetLength(CSzFile *p, UInt64 *length); - - -/* ---------- FileInStream ---------- */ - -typedef struct -{ - ISeqInStream s; - CSzFile file; -} CFileSeqInStream; - -void FileSeqInStream_CreateVTable(CFileSeqInStream *p); - - -typedef struct -{ - ISeekInStream s; - CSzFile file; -} CFileInStream; - -void FileInStream_CreateVTable(CFileInStream *p); - - -typedef struct -{ - ISeqOutStream s; - CSzFile file; -} CFileOutStream; - -void FileOutStream_CreateVTable(CFileOutStream *p); - -#endif diff --git a/extern/lzma/7zStream.c b/extern/lzma/7zStream.c deleted file mode 100644 index 86232aa3411..00000000000 --- a/extern/lzma/7zStream.c +++ /dev/null @@ -1,169 +0,0 @@ -/* 7zStream.c -- 7z Stream functions -2008-11-23 : Igor Pavlov : Public domain */ - -#include - -#include "Types.h" - -SRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType) -{ - while (size != 0) - { - size_t processed = size; - RINOK(stream->Read(stream, buf, &processed)); - if (processed == 0) - return errorType; - buf = (void *)((Byte *)buf + processed); - size -= processed; - } - return SZ_OK; -} - -SRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size) -{ - return SeqInStream_Read2(stream, buf, size, SZ_ERROR_INPUT_EOF); -} - -SRes SeqInStream_ReadByte(ISeqInStream *stream, Byte *buf) -{ - size_t processed = 1; - RINOK(stream->Read(stream, buf, &processed)); - return (processed == 1) ? SZ_OK : SZ_ERROR_INPUT_EOF; -} - -SRes LookInStream_SeekTo(ILookInStream *stream, UInt64 offset) -{ - Int64 t = offset; - return stream->Seek(stream, &t, SZ_SEEK_SET); -} - -SRes LookInStream_LookRead(ILookInStream *stream, void *buf, size_t *size) -{ - void *lookBuf; - if (*size == 0) - return SZ_OK; - RINOK(stream->Look(stream, &lookBuf, size)); - memcpy(buf, lookBuf, *size); - return stream->Skip(stream, *size); -} - -SRes LookInStream_Read2(ILookInStream *stream, void *buf, size_t size, SRes errorType) -{ - while (size != 0) - { - size_t processed = size; - RINOK(stream->Read(stream, buf, &processed)); - if (processed == 0) - return errorType; - buf = (void *)((Byte *)buf + processed); - size -= processed; - } - return SZ_OK; -} - -SRes LookInStream_Read(ILookInStream *stream, void *buf, size_t size) -{ - return LookInStream_Read2(stream, buf, size, SZ_ERROR_INPUT_EOF); -} - -static SRes LookToRead_Look_Lookahead(void *pp, void **buf, size_t *size) -{ - SRes res = SZ_OK; - CLookToRead *p = (CLookToRead *)pp; - size_t size2 = p->size - p->pos; - if (size2 == 0 && *size > 0) - { - p->pos = 0; - size2 = LookToRead_BUF_SIZE; - res = p->realStream->Read(p->realStream, p->buf, &size2); - p->size = size2; - } - if (size2 < *size) - *size = size2; - *buf = p->buf + p->pos; - return res; -} - -static SRes LookToRead_Look_Exact(void *pp, void **buf, size_t *size) -{ - SRes res = SZ_OK; - CLookToRead *p = (CLookToRead *)pp; - size_t size2 = p->size - p->pos; - if (size2 == 0 && *size > 0) - { - p->pos = 0; - if (*size > LookToRead_BUF_SIZE) - *size = LookToRead_BUF_SIZE; - res = p->realStream->Read(p->realStream, p->buf, size); - size2 = p->size = *size; - } - if (size2 < *size) - *size = size2; - *buf = p->buf + p->pos; - return res; -} - -static SRes LookToRead_Skip(void *pp, size_t offset) -{ - CLookToRead *p = (CLookToRead *)pp; - p->pos += offset; - return SZ_OK; -} - -static SRes LookToRead_Read(void *pp, void *buf, size_t *size) -{ - CLookToRead *p = (CLookToRead *)pp; - size_t rem = p->size - p->pos; - if (rem == 0) - return p->realStream->Read(p->realStream, buf, size); - if (rem > *size) - rem = *size; - memcpy(buf, p->buf + p->pos, rem); - p->pos += rem; - *size = rem; - return SZ_OK; -} - -static SRes LookToRead_Seek(void *pp, Int64 *pos, ESzSeek origin) -{ - CLookToRead *p = (CLookToRead *)pp; - p->pos = p->size = 0; - return p->realStream->Seek(p->realStream, pos, origin); -} - -void LookToRead_CreateVTable(CLookToRead *p, int lookahead) -{ - p->s.Look = lookahead ? - LookToRead_Look_Lookahead : - LookToRead_Look_Exact; - p->s.Skip = LookToRead_Skip; - p->s.Read = LookToRead_Read; - p->s.Seek = LookToRead_Seek; -} - -void LookToRead_Init(CLookToRead *p) -{ - p->pos = p->size = 0; -} - -static SRes SecToLook_Read(void *pp, void *buf, size_t *size) -{ - CSecToLook *p = (CSecToLook *)pp; - return LookInStream_LookRead(p->realStream, buf, size); -} - -void SecToLook_CreateVTable(CSecToLook *p) -{ - p->s.Read = SecToLook_Read; -} - -static SRes SecToRead_Read(void *pp, void *buf, size_t *size) -{ - CSecToRead *p = (CSecToRead *)pp; - return p->realStream->Read(p->realStream, buf, size); -} - -void SecToRead_CreateVTable(CSecToRead *p) -{ - p->s.Read = SecToRead_Read; -} diff --git a/extern/lzma/7zVersion.h b/extern/lzma/7zVersion.h deleted file mode 100644 index b7eb235548f..00000000000 --- a/extern/lzma/7zVersion.h +++ /dev/null @@ -1,7 +0,0 @@ -#define MY_VER_MAJOR 4 -#define MY_VER_MINOR 65 -#define MY_VER_BUILD 0 -#define MY_VERSION "4.65" -#define MY_DATE "2009-02-03" -#define MY_COPYRIGHT ": Igor Pavlov : Public domain" -#define MY_VERSION_COPYRIGHT_DATE MY_VERSION " " MY_COPYRIGHT " : " MY_DATE diff --git a/extern/lzma/Bcj2.c b/extern/lzma/Bcj2.c deleted file mode 100644 index 20199ce5659..00000000000 --- a/extern/lzma/Bcj2.c +++ /dev/null @@ -1,132 +0,0 @@ -/* Bcj2.c -- Converter for x86 code (BCJ2) -2008-10-04 : Igor Pavlov : Public domain */ - -#include "Bcj2.h" - -#ifdef _LZMA_PROB32 -#define CProb UInt32 -#else -#define CProb UInt16 -#endif - -#define IsJcc(b0, b1) ((b0) == 0x0F && ((b1) & 0xF0) == 0x80) -#define IsJ(b0, b1) ((b1 & 0xFE) == 0xE8 || IsJcc(b0, b1)) - -#define kNumTopBits 24 -#define kTopValue ((UInt32)1 << kNumTopBits) - -#define kNumBitModelTotalBits 11 -#define kBitModelTotal (1 << kNumBitModelTotalBits) -#define kNumMoveBits 5 - -#define RC_READ_BYTE (*buffer++) -#define RC_TEST { if (buffer == bufferLim) return SZ_ERROR_DATA; } -#define RC_INIT2 code = 0; range = 0xFFFFFFFF; \ - { int i; for (i = 0; i < 5; i++) { RC_TEST; code = (code << 8) | RC_READ_BYTE; }} - -#define NORMALIZE if (range < kTopValue) { RC_TEST; range <<= 8; code = (code << 8) | RC_READ_BYTE; } - -#define IF_BIT_0(p) ttt = *(p); bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound) -#define UPDATE_0(p) range = bound; *(p) = (CProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); NORMALIZE; -#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CProb)(ttt - (ttt >> kNumMoveBits)); NORMALIZE; - -int Bcj2_Decode( - const Byte *buf0, SizeT size0, - const Byte *buf1, SizeT size1, - const Byte *buf2, SizeT size2, - const Byte *buf3, SizeT size3, - Byte *outBuf, SizeT outSize) -{ - CProb p[256 + 2]; - SizeT inPos = 0, outPos = 0; - - const Byte *buffer, *bufferLim; - UInt32 range, code; - Byte prevByte = 0; - - unsigned int i; - for (i = 0; i < sizeof(p) / sizeof(p[0]); i++) - p[i] = kBitModelTotal >> 1; - - buffer = buf3; - bufferLim = buffer + size3; - RC_INIT2 - - if (outSize == 0) - return SZ_OK; - - for (;;) - { - Byte b; - CProb *prob; - UInt32 bound; - UInt32 ttt; - - SizeT limit = size0 - inPos; - if (outSize - outPos < limit) - limit = outSize - outPos; - while (limit != 0) - { - Byte b = buf0[inPos]; - outBuf[outPos++] = b; - if (IsJ(prevByte, b)) - break; - inPos++; - prevByte = b; - limit--; - } - - if (limit == 0 || outPos == outSize) - break; - - b = buf0[inPos++]; - - if (b == 0xE8) - prob = p + prevByte; - else if (b == 0xE9) - prob = p + 256; - else - prob = p + 257; - - IF_BIT_0(prob) - { - UPDATE_0(prob) - prevByte = b; - } - else - { - UInt32 dest; - const Byte *v; - UPDATE_1(prob) - if (b == 0xE8) - { - v = buf1; - if (size1 < 4) - return SZ_ERROR_DATA; - buf1 += 4; - size1 -= 4; - } - else - { - v = buf2; - if (size2 < 4) - return SZ_ERROR_DATA; - buf2 += 4; - size2 -= 4; - } - dest = (((UInt32)v[0] << 24) | ((UInt32)v[1] << 16) | - ((UInt32)v[2] << 8) | ((UInt32)v[3])) - ((UInt32)outPos + 4); - outBuf[outPos++] = (Byte)dest; - if (outPos == outSize) - break; - outBuf[outPos++] = (Byte)(dest >> 8); - if (outPos == outSize) - break; - outBuf[outPos++] = (Byte)(dest >> 16); - if (outPos == outSize) - break; - outBuf[outPos++] = prevByte = (Byte)(dest >> 24); - } - } - return (outPos == outSize) ? SZ_OK : SZ_ERROR_DATA; -} diff --git a/extern/lzma/Bcj2.h b/extern/lzma/Bcj2.h deleted file mode 100644 index 32d450b3b99..00000000000 --- a/extern/lzma/Bcj2.h +++ /dev/null @@ -1,30 +0,0 @@ -/* Bcj2.h -- Converter for x86 code (BCJ2) -2008-10-04 : Igor Pavlov : Public domain */ - -#ifndef __BCJ2_H -#define __BCJ2_H - -#include "Types.h" - -/* -Conditions: - outSize <= FullOutputSize, - where FullOutputSize is full size of output stream of x86_2 filter. - -If buf0 overlaps outBuf, there are two required conditions: - 1) (buf0 >= outBuf) - 2) (buf0 + size0 >= outBuf + FullOutputSize). - -Returns: - SZ_OK - SZ_ERROR_DATA - Data error -*/ - -int Bcj2_Decode( - const Byte *buf0, SizeT size0, - const Byte *buf1, SizeT size1, - const Byte *buf2, SizeT size2, - const Byte *buf3, SizeT size3, - Byte *outBuf, SizeT outSize); - -#endif diff --git a/extern/lzma/Bra.c b/extern/lzma/Bra.c deleted file mode 100644 index 5e5469592db..00000000000 --- a/extern/lzma/Bra.c +++ /dev/null @@ -1,133 +0,0 @@ -/* Bra.c -- Converters for RISC code -2008-10-04 : Igor Pavlov : Public domain */ - -#include "Bra.h" - -SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding) -{ - SizeT i; - if (size < 4) - return 0; - size -= 4; - ip += 8; - for (i = 0; i <= size; i += 4) - { - if (data[i + 3] == 0xEB) - { - UInt32 dest; - UInt32 src = ((UInt32)data[i + 2] << 16) | ((UInt32)data[i + 1] << 8) | (data[i + 0]); - src <<= 2; - if (encoding) - dest = ip + (UInt32)i + src; - else - dest = src - (ip + (UInt32)i); - dest >>= 2; - data[i + 2] = (Byte)(dest >> 16); - data[i + 1] = (Byte)(dest >> 8); - data[i + 0] = (Byte)dest; - } - } - return i; -} - -SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding) -{ - SizeT i; - if (size < 4) - return 0; - size -= 4; - ip += 4; - for (i = 0; i <= size; i += 2) - { - if ((data[i + 1] & 0xF8) == 0xF0 && - (data[i + 3] & 0xF8) == 0xF8) - { - UInt32 dest; - UInt32 src = - (((UInt32)data[i + 1] & 0x7) << 19) | - ((UInt32)data[i + 0] << 11) | - (((UInt32)data[i + 3] & 0x7) << 8) | - (data[i + 2]); - - src <<= 1; - if (encoding) - dest = ip + (UInt32)i + src; - else - dest = src - (ip + (UInt32)i); - dest >>= 1; - - data[i + 1] = (Byte)(0xF0 | ((dest >> 19) & 0x7)); - data[i + 0] = (Byte)(dest >> 11); - data[i + 3] = (Byte)(0xF8 | ((dest >> 8) & 0x7)); - data[i + 2] = (Byte)dest; - i += 2; - } - } - return i; -} - -SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding) -{ - SizeT i; - if (size < 4) - return 0; - size -= 4; - for (i = 0; i <= size; i += 4) - { - if ((data[i] >> 2) == 0x12 && (data[i + 3] & 3) == 1) - { - UInt32 src = ((UInt32)(data[i + 0] & 3) << 24) | - ((UInt32)data[i + 1] << 16) | - ((UInt32)data[i + 2] << 8) | - ((UInt32)data[i + 3] & (~3)); - - UInt32 dest; - if (encoding) - dest = ip + (UInt32)i + src; - else - dest = src - (ip + (UInt32)i); - data[i + 0] = (Byte)(0x48 | ((dest >> 24) & 0x3)); - data[i + 1] = (Byte)(dest >> 16); - data[i + 2] = (Byte)(dest >> 8); - data[i + 3] &= 0x3; - data[i + 3] |= dest; - } - } - return i; -} - -SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding) -{ - UInt32 i; - if (size < 4) - return 0; - size -= 4; - for (i = 0; i <= size; i += 4) - { - if (data[i] == 0x40 && (data[i + 1] & 0xC0) == 0x00 || - data[i] == 0x7F && (data[i + 1] & 0xC0) == 0xC0) - { - UInt32 src = - ((UInt32)data[i + 0] << 24) | - ((UInt32)data[i + 1] << 16) | - ((UInt32)data[i + 2] << 8) | - ((UInt32)data[i + 3]); - UInt32 dest; - - src <<= 2; - if (encoding) - dest = ip + i + src; - else - dest = src - (ip + i); - dest >>= 2; - - dest = (((0 - ((dest >> 22) & 1)) << 22) & 0x3FFFFFFF) | (dest & 0x3FFFFF) | 0x40000000; - - data[i + 0] = (Byte)(dest >> 24); - data[i + 1] = (Byte)(dest >> 16); - data[i + 2] = (Byte)(dest >> 8); - data[i + 3] = (Byte)dest; - } - } - return i; -} diff --git a/extern/lzma/Bra.h b/extern/lzma/Bra.h deleted file mode 100644 index 45e231e8496..00000000000 --- a/extern/lzma/Bra.h +++ /dev/null @@ -1,60 +0,0 @@ -/* Bra.h -- Branch converters for executables -2008-10-04 : Igor Pavlov : Public domain */ - -#ifndef __BRA_H -#define __BRA_H - -#include "Types.h" - -/* -These functions convert relative addresses to absolute addresses -in CALL instructions to increase the compression ratio. - - In: - data - data buffer - size - size of data - ip - current virtual Instruction Pinter (IP) value - state - state variable for x86 converter - encoding - 0 (for decoding), 1 (for encoding) - - Out: - state - state variable for x86 converter - - Returns: - The number of processed bytes. If you call these functions with multiple calls, - you must start next call with first byte after block of processed bytes. - - Type Endian Alignment LookAhead - - x86 little 1 4 - ARMT little 2 2 - ARM little 4 0 - PPC big 4 0 - SPARC big 4 0 - IA64 little 16 0 - - size must be >= Alignment + LookAhead, if it's not last block. - If (size < Alignment + LookAhead), converter returns 0. - - Example: - - UInt32 ip = 0; - for () - { - ; size must be >= Alignment + LookAhead, if it's not last block - SizeT processed = Convert(data, size, ip, 1); - data += processed; - size -= processed; - ip += processed; - } -*/ - -#define x86_Convert_Init(state) { state = 0; } -SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding); -SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding); -SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding); -SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding); -SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding); -SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding); - -#endif diff --git a/extern/lzma/Bra86.c b/extern/lzma/Bra86.c deleted file mode 100644 index 1ee0e709b88..00000000000 --- a/extern/lzma/Bra86.c +++ /dev/null @@ -1,85 +0,0 @@ -/* Bra86.c -- Converter for x86 code (BCJ) -2008-10-04 : Igor Pavlov : Public domain */ - -#include "Bra.h" - -#define Test86MSByte(b) ((b) == 0 || (b) == 0xFF) - -const Byte kMaskToAllowedStatus[8] = {1, 1, 1, 0, 1, 0, 0, 0}; -const Byte kMaskToBitNumber[8] = {0, 1, 2, 2, 3, 3, 3, 3}; - -SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding) -{ - SizeT bufferPos = 0, prevPosT; - UInt32 prevMask = *state & 0x7; - if (size < 5) - return 0; - ip += 5; - prevPosT = (SizeT)0 - 1; - - for (;;) - { - Byte *p = data + bufferPos; - Byte *limit = data + size - 4; - for (; p < limit; p++) - if ((*p & 0xFE) == 0xE8) - break; - bufferPos = (SizeT)(p - data); - if (p >= limit) - break; - prevPosT = bufferPos - prevPosT; - if (prevPosT > 3) - prevMask = 0; - else - { - prevMask = (prevMask << ((int)prevPosT - 1)) & 0x7; - if (prevMask != 0) - { - Byte b = p[4 - kMaskToBitNumber[prevMask]]; - if (!kMaskToAllowedStatus[prevMask] || Test86MSByte(b)) - { - prevPosT = bufferPos; - prevMask = ((prevMask << 1) & 0x7) | 1; - bufferPos++; - continue; - } - } - } - prevPosT = bufferPos; - - if (Test86MSByte(p[4])) - { - UInt32 src = ((UInt32)p[4] << 24) | ((UInt32)p[3] << 16) | ((UInt32)p[2] << 8) | ((UInt32)p[1]); - UInt32 dest; - for (;;) - { - Byte b; - int index; - if (encoding) - dest = (ip + (UInt32)bufferPos) + src; - else - dest = src - (ip + (UInt32)bufferPos); - if (prevMask == 0) - break; - index = kMaskToBitNumber[prevMask] * 8; - b = (Byte)(dest >> (24 - index)); - if (!Test86MSByte(b)) - break; - src = dest ^ ((1 << (32 - index)) - 1); - } - p[4] = (Byte)(~(((dest >> 24) & 1) - 1)); - p[3] = (Byte)(dest >> 16); - p[2] = (Byte)(dest >> 8); - p[1] = (Byte)dest; - bufferPos += 5; - } - else - { - prevMask = ((prevMask << 1) & 0x7) | 1; - bufferPos++; - } - } - prevPosT = bufferPos - prevPosT; - *state = ((prevPosT > 3) ? 0 : ((prevMask << ((int)prevPosT - 1)) & 0x7)); - return bufferPos; -} diff --git a/extern/lzma/BraIA64.c b/extern/lzma/BraIA64.c deleted file mode 100644 index 0b4ee85bc76..00000000000 --- a/extern/lzma/BraIA64.c +++ /dev/null @@ -1,67 +0,0 @@ -/* BraIA64.c -- Converter for IA-64 code -2008-10-04 : Igor Pavlov : Public domain */ - -#include "Bra.h" - -static const Byte kBranchTable[32] = -{ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 4, 4, 6, 6, 0, 0, 7, 7, - 4, 4, 0, 0, 4, 4, 0, 0 -}; - -SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding) -{ - SizeT i; - if (size < 16) - return 0; - size -= 16; - for (i = 0; i <= size; i += 16) - { - UInt32 instrTemplate = data[i] & 0x1F; - UInt32 mask = kBranchTable[instrTemplate]; - UInt32 bitPos = 5; - int slot; - for (slot = 0; slot < 3; slot++, bitPos += 41) - { - UInt32 bytePos, bitRes; - UInt64 instruction, instNorm; - int j; - if (((mask >> slot) & 1) == 0) - continue; - bytePos = (bitPos >> 3); - bitRes = bitPos & 0x7; - instruction = 0; - for (j = 0; j < 6; j++) - instruction += (UInt64)data[i + j + bytePos] << (8 * j); - - instNorm = instruction >> bitRes; - if (((instNorm >> 37) & 0xF) == 0x5 && ((instNorm >> 9) & 0x7) == 0) - { - UInt32 src = (UInt32)((instNorm >> 13) & 0xFFFFF); - UInt32 dest; - src |= ((UInt32)(instNorm >> 36) & 1) << 20; - - src <<= 4; - - if (encoding) - dest = ip + (UInt32)i + src; - else - dest = src - (ip + (UInt32)i); - - dest >>= 4; - - instNorm &= ~((UInt64)(0x8FFFFF) << 13); - instNorm |= ((UInt64)(dest & 0xFFFFF) << 13); - instNorm |= ((UInt64)(dest & 0x100000) << (36 - 20)); - - instruction &= (1 << bitRes) - 1; - instruction |= (instNorm << bitRes); - for (j = 0; j < 6; j++) - data[i + j + bytePos] = (Byte)(instruction >> (8 * j)); - } - } - } - return i; -} diff --git a/extern/lzma/CpuArch.h b/extern/lzma/CpuArch.h deleted file mode 100644 index 7384b0c32ae..00000000000 --- a/extern/lzma/CpuArch.h +++ /dev/null @@ -1,69 +0,0 @@ -/* CpuArch.h -2008-08-05 -Igor Pavlov -Public domain */ - -#ifndef __CPUARCH_H -#define __CPUARCH_H - -/* -LITTLE_ENDIAN_UNALIGN means: - 1) CPU is LITTLE_ENDIAN - 2) it's allowed to make unaligned memory accesses -if LITTLE_ENDIAN_UNALIGN is not defined, it means that we don't know -about these properties of platform. -*/ - -#if defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64) || defined(__i386__) || defined(__x86_64__) -#define LITTLE_ENDIAN_UNALIGN -#endif - -#ifdef LITTLE_ENDIAN_UNALIGN - -#define GetUi16(p) (*(const UInt16 *)(p)) -#define GetUi32(p) (*(const UInt32 *)(p)) -#define GetUi64(p) (*(const UInt64 *)(p)) -#define SetUi32(p, d) *(UInt32 *)(p) = (d); - -#else - -#define GetUi16(p) (((const Byte *)(p))[0] | ((UInt16)((const Byte *)(p))[1] << 8)) - -#define GetUi32(p) ( \ - ((const Byte *)(p))[0] | \ - ((UInt32)((const Byte *)(p))[1] << 8) | \ - ((UInt32)((const Byte *)(p))[2] << 16) | \ - ((UInt32)((const Byte *)(p))[3] << 24)) - -#define GetUi64(p) (GetUi32(p) | ((UInt64)GetUi32(((const Byte *)(p)) + 4) << 32)) - -#define SetUi32(p, d) { UInt32 _x_ = (d); \ - ((Byte *)(p))[0] = (Byte)_x_; \ - ((Byte *)(p))[1] = (Byte)(_x_ >> 8); \ - ((Byte *)(p))[2] = (Byte)(_x_ >> 16); \ - ((Byte *)(p))[3] = (Byte)(_x_ >> 24); } - -#endif - -#if defined(LITTLE_ENDIAN_UNALIGN) && defined(_WIN64) && (_MSC_VER >= 1300) - -#pragma intrinsic(_byteswap_ulong) -#pragma intrinsic(_byteswap_uint64) -#define GetBe32(p) _byteswap_ulong(*(const UInt32 *)(const Byte *)(p)) -#define GetBe64(p) _byteswap_uint64(*(const UInt64 *)(const Byte *)(p)) - -#else - -#define GetBe32(p) ( \ - ((UInt32)((const Byte *)(p))[0] << 24) | \ - ((UInt32)((const Byte *)(p))[1] << 16) | \ - ((UInt32)((const Byte *)(p))[2] << 8) | \ - ((const Byte *)(p))[3] ) - -#define GetBe64(p) (((UInt64)GetBe32(p) << 32) | GetBe32(((const Byte *)(p)) + 4)) - -#endif - -#define GetBe16(p) (((UInt16)((const Byte *)(p))[0] << 8) | ((const Byte *)(p))[1]) - -#endif diff --git a/extern/lzma/LzFindMt.c b/extern/lzma/LzFindMt.c deleted file mode 100644 index b49cd76b294..00000000000 --- a/extern/lzma/LzFindMt.c +++ /dev/null @@ -1,793 +0,0 @@ -/* LzFindMt.c -- multithreaded Match finder for LZ algorithms -2008-10-04 : Igor Pavlov : Public domain */ - -#include "LzHash.h" - -#include "LzFindMt.h" - -void MtSync_Construct(CMtSync *p) -{ - p->wasCreated = False; - p->csWasInitialized = False; - p->csWasEntered = False; - Thread_Construct(&p->thread); - Event_Construct(&p->canStart); - Event_Construct(&p->wasStarted); - Event_Construct(&p->wasStopped); - Semaphore_Construct(&p->freeSemaphore); - Semaphore_Construct(&p->filledSemaphore); -} - -void MtSync_GetNextBlock(CMtSync *p) -{ - if (p->needStart) - { - p->numProcessedBlocks = 1; - p->needStart = False; - p->stopWriting = False; - p->exit = False; - Event_Reset(&p->wasStarted); - Event_Reset(&p->wasStopped); - - Event_Set(&p->canStart); - Event_Wait(&p->wasStarted); - } - else - { - CriticalSection_Leave(&p->cs); - p->csWasEntered = False; - p->numProcessedBlocks++; - Semaphore_Release1(&p->freeSemaphore); - } - Semaphore_Wait(&p->filledSemaphore); - CriticalSection_Enter(&p->cs); - p->csWasEntered = True; -} - -/* MtSync_StopWriting must be called if Writing was started */ - -void MtSync_StopWriting(CMtSync *p) -{ - UInt32 myNumBlocks = p->numProcessedBlocks; - if (!Thread_WasCreated(&p->thread) || p->needStart) - return; - p->stopWriting = True; - if (p->csWasEntered) - { - CriticalSection_Leave(&p->cs); - p->csWasEntered = False; - } - Semaphore_Release1(&p->freeSemaphore); - - Event_Wait(&p->wasStopped); - - while (myNumBlocks++ != p->numProcessedBlocks) - { - Semaphore_Wait(&p->filledSemaphore); - Semaphore_Release1(&p->freeSemaphore); - } - p->needStart = True; -} - -void MtSync_Destruct(CMtSync *p) -{ - if (Thread_WasCreated(&p->thread)) - { - MtSync_StopWriting(p); - p->exit = True; - if (p->needStart) - Event_Set(&p->canStart); - Thread_Wait(&p->thread); - Thread_Close(&p->thread); - } - if (p->csWasInitialized) - { - CriticalSection_Delete(&p->cs); - p->csWasInitialized = False; - } - - Event_Close(&p->canStart); - Event_Close(&p->wasStarted); - Event_Close(&p->wasStopped); - Semaphore_Close(&p->freeSemaphore); - Semaphore_Close(&p->filledSemaphore); - - p->wasCreated = False; -} - -#define RINOK_THREAD(x) { if ((x) != 0) return SZ_ERROR_THREAD; } - -static SRes MtSync_Create2(CMtSync *p, unsigned (MY_STD_CALL *startAddress)(void *), void *obj, UInt32 numBlocks) -{ - if (p->wasCreated) - return SZ_OK; - - RINOK_THREAD(CriticalSection_Init(&p->cs)); - p->csWasInitialized = True; - - RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->canStart)); - RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->wasStarted)); - RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->wasStopped)); - - RINOK_THREAD(Semaphore_Create(&p->freeSemaphore, numBlocks, numBlocks)); - RINOK_THREAD(Semaphore_Create(&p->filledSemaphore, 0, numBlocks)); - - p->needStart = True; - - RINOK_THREAD(Thread_Create(&p->thread, startAddress, obj)); - p->wasCreated = True; - return SZ_OK; -} - -static SRes MtSync_Create(CMtSync *p, unsigned (MY_STD_CALL *startAddress)(void *), void *obj, UInt32 numBlocks) -{ - SRes res = MtSync_Create2(p, startAddress, obj, numBlocks); - if (res != SZ_OK) - MtSync_Destruct(p); - return res; -} - -void MtSync_Init(CMtSync *p) { p->needStart = True; } - -#define kMtMaxValForNormalize 0xFFFFFFFF - -#define DEF_GetHeads2(name, v, action) \ -static void GetHeads ## name(const Byte *p, UInt32 pos, \ -UInt32 *hash, UInt32 hashMask, UInt32 *heads, UInt32 numHeads, const UInt32 *crc) \ -{ action; for (; numHeads != 0; numHeads--) { \ -const UInt32 value = (v); p++; *heads++ = pos - hash[value]; hash[value] = pos++; } } - -#define DEF_GetHeads(name, v) DEF_GetHeads2(name, v, ;) - -DEF_GetHeads2(2, (p[0] | ((UInt32)p[1] << 8)), hashMask = hashMask; crc = crc; ) -DEF_GetHeads(3, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8)) & hashMask) -DEF_GetHeads(4, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ (crc[p[3]] << 5)) & hashMask) -DEF_GetHeads(4b, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ ((UInt32)p[3] << 16)) & hashMask) -DEF_GetHeads(5, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ (crc[p[3]] << 5) ^ (crc[p[4]] << 3)) & hashMask) - -void HashThreadFunc(CMatchFinderMt *mt) -{ - CMtSync *p = &mt->hashSync; - for (;;) - { - UInt32 numProcessedBlocks = 0; - Event_Wait(&p->canStart); - Event_Set(&p->wasStarted); - for (;;) - { - if (p->exit) - return; - if (p->stopWriting) - { - p->numProcessedBlocks = numProcessedBlocks; - Event_Set(&p->wasStopped); - break; - } - - { - CMatchFinder *mf = mt->MatchFinder; - if (MatchFinder_NeedMove(mf)) - { - CriticalSection_Enter(&mt->btSync.cs); - CriticalSection_Enter(&mt->hashSync.cs); - { - const Byte *beforePtr = MatchFinder_GetPointerToCurrentPos(mf); - const Byte *afterPtr; - MatchFinder_MoveBlock(mf); - afterPtr = MatchFinder_GetPointerToCurrentPos(mf); - mt->pointerToCurPos -= beforePtr - afterPtr; - mt->buffer -= beforePtr - afterPtr; - } - CriticalSection_Leave(&mt->btSync.cs); - CriticalSection_Leave(&mt->hashSync.cs); - continue; - } - - Semaphore_Wait(&p->freeSemaphore); - - MatchFinder_ReadIfRequired(mf); - if (mf->pos > (kMtMaxValForNormalize - kMtHashBlockSize)) - { - UInt32 subValue = (mf->pos - mf->historySize - 1); - MatchFinder_ReduceOffsets(mf, subValue); - MatchFinder_Normalize3(subValue, mf->hash + mf->fixedHashSize, mf->hashMask + 1); - } - { - UInt32 *heads = mt->hashBuf + ((numProcessedBlocks++) & kMtHashNumBlocksMask) * kMtHashBlockSize; - UInt32 num = mf->streamPos - mf->pos; - heads[0] = 2; - heads[1] = num; - if (num >= mf->numHashBytes) - { - num = num - mf->numHashBytes + 1; - if (num > kMtHashBlockSize - 2) - num = kMtHashBlockSize - 2; - mt->GetHeadsFunc(mf->buffer, mf->pos, mf->hash + mf->fixedHashSize, mf->hashMask, heads + 2, num, mf->crc); - heads[0] += num; - } - mf->pos += num; - mf->buffer += num; - } - } - - Semaphore_Release1(&p->filledSemaphore); - } - } -} - -void MatchFinderMt_GetNextBlock_Hash(CMatchFinderMt *p) -{ - MtSync_GetNextBlock(&p->hashSync); - p->hashBufPosLimit = p->hashBufPos = ((p->hashSync.numProcessedBlocks - 1) & kMtHashNumBlocksMask) * kMtHashBlockSize; - p->hashBufPosLimit += p->hashBuf[p->hashBufPos++]; - p->hashNumAvail = p->hashBuf[p->hashBufPos++]; -} - -#define kEmptyHashValue 0 - -/* #define MFMT_GM_INLINE */ - -#ifdef MFMT_GM_INLINE - -#define NO_INLINE MY_FAST_CALL - -Int32 NO_INLINE GetMatchesSpecN(UInt32 lenLimit, UInt32 pos, const Byte *cur, CLzRef *son, - UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue, - UInt32 *_distances, UInt32 _maxLen, const UInt32 *hash, Int32 limit, UInt32 size, UInt32 *posRes) -{ - do - { - UInt32 *distances = _distances + 1; - UInt32 curMatch = pos - *hash++; - - CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1; - CLzRef *ptr1 = son + (_cyclicBufferPos << 1); - UInt32 len0 = 0, len1 = 0; - UInt32 cutValue = _cutValue; - UInt32 maxLen = _maxLen; - for (;;) - { - UInt32 delta = pos - curMatch; - if (cutValue-- == 0 || delta >= _cyclicBufferSize) - { - *ptr0 = *ptr1 = kEmptyHashValue; - break; - } - { - CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1); - const Byte *pb = cur - delta; - UInt32 len = (len0 < len1 ? len0 : len1); - if (pb[len] == cur[len]) - { - if (++len != lenLimit && pb[len] == cur[len]) - while (++len != lenLimit) - if (pb[len] != cur[len]) - break; - if (maxLen < len) - { - *distances++ = maxLen = len; - *distances++ = delta - 1; - if (len == lenLimit) - { - *ptr1 = pair[0]; - *ptr0 = pair[1]; - break; - } - } - } - if (pb[len] < cur[len]) - { - *ptr1 = curMatch; - ptr1 = pair + 1; - curMatch = *ptr1; - len1 = len; - } - else - { - *ptr0 = curMatch; - ptr0 = pair; - curMatch = *ptr0; - len0 = len; - } - } - } - pos++; - _cyclicBufferPos++; - cur++; - { - UInt32 num = (UInt32)(distances - _distances); - *_distances = num - 1; - _distances += num; - limit -= num; - } - } - while (limit > 0 && --size != 0); - *posRes = pos; - return limit; -} - -#endif - -void BtGetMatches(CMatchFinderMt *p, UInt32 *distances) -{ - UInt32 numProcessed = 0; - UInt32 curPos = 2; - UInt32 limit = kMtBtBlockSize - (p->matchMaxLen * 2); - distances[1] = p->hashNumAvail; - while (curPos < limit) - { - if (p->hashBufPos == p->hashBufPosLimit) - { - MatchFinderMt_GetNextBlock_Hash(p); - distances[1] = numProcessed + p->hashNumAvail; - if (p->hashNumAvail >= p->numHashBytes) - continue; - for (; p->hashNumAvail != 0; p->hashNumAvail--) - distances[curPos++] = 0; - break; - } - { - UInt32 size = p->hashBufPosLimit - p->hashBufPos; - UInt32 lenLimit = p->matchMaxLen; - UInt32 pos = p->pos; - UInt32 cyclicBufferPos = p->cyclicBufferPos; - if (lenLimit >= p->hashNumAvail) - lenLimit = p->hashNumAvail; - { - UInt32 size2 = p->hashNumAvail - lenLimit + 1; - if (size2 < size) - size = size2; - size2 = p->cyclicBufferSize - cyclicBufferPos; - if (size2 < size) - size = size2; - } - #ifndef MFMT_GM_INLINE - while (curPos < limit && size-- != 0) - { - UInt32 *startDistances = distances + curPos; - UInt32 num = (UInt32)(GetMatchesSpec1(lenLimit, pos - p->hashBuf[p->hashBufPos++], - pos, p->buffer, p->son, cyclicBufferPos, p->cyclicBufferSize, p->cutValue, - startDistances + 1, p->numHashBytes - 1) - startDistances); - *startDistances = num - 1; - curPos += num; - cyclicBufferPos++; - pos++; - p->buffer++; - } - #else - { - UInt32 posRes; - curPos = limit - GetMatchesSpecN(lenLimit, pos, p->buffer, p->son, cyclicBufferPos, p->cyclicBufferSize, p->cutValue, - distances + curPos, p->numHashBytes - 1, p->hashBuf + p->hashBufPos, (Int32)(limit - curPos) , size, &posRes); - p->hashBufPos += posRes - pos; - cyclicBufferPos += posRes - pos; - p->buffer += posRes - pos; - pos = posRes; - } - #endif - - numProcessed += pos - p->pos; - p->hashNumAvail -= pos - p->pos; - p->pos = pos; - if (cyclicBufferPos == p->cyclicBufferSize) - cyclicBufferPos = 0; - p->cyclicBufferPos = cyclicBufferPos; - } - } - distances[0] = curPos; -} - -void BtFillBlock(CMatchFinderMt *p, UInt32 globalBlockIndex) -{ - CMtSync *sync = &p->hashSync; - if (!sync->needStart) - { - CriticalSection_Enter(&sync->cs); - sync->csWasEntered = True; - } - - BtGetMatches(p, p->btBuf + (globalBlockIndex & kMtBtNumBlocksMask) * kMtBtBlockSize); - - if (p->pos > kMtMaxValForNormalize - kMtBtBlockSize) - { - UInt32 subValue = p->pos - p->cyclicBufferSize; - MatchFinder_Normalize3(subValue, p->son, p->cyclicBufferSize * 2); - p->pos -= subValue; - } - - if (!sync->needStart) - { - CriticalSection_Leave(&sync->cs); - sync->csWasEntered = False; - } -} - -void BtThreadFunc(CMatchFinderMt *mt) -{ - CMtSync *p = &mt->btSync; - for (;;) - { - UInt32 blockIndex = 0; - Event_Wait(&p->canStart); - Event_Set(&p->wasStarted); - for (;;) - { - if (p->exit) - return; - if (p->stopWriting) - { - p->numProcessedBlocks = blockIndex; - MtSync_StopWriting(&mt->hashSync); - Event_Set(&p->wasStopped); - break; - } - Semaphore_Wait(&p->freeSemaphore); - BtFillBlock(mt, blockIndex++); - Semaphore_Release1(&p->filledSemaphore); - } - } -} - -void MatchFinderMt_Construct(CMatchFinderMt *p) -{ - p->hashBuf = 0; - MtSync_Construct(&p->hashSync); - MtSync_Construct(&p->btSync); -} - -void MatchFinderMt_FreeMem(CMatchFinderMt *p, ISzAlloc *alloc) -{ - alloc->Free(alloc, p->hashBuf); - p->hashBuf = 0; -} - -void MatchFinderMt_Destruct(CMatchFinderMt *p, ISzAlloc *alloc) -{ - MtSync_Destruct(&p->hashSync); - MtSync_Destruct(&p->btSync); - MatchFinderMt_FreeMem(p, alloc); -} - -#define kHashBufferSize (kMtHashBlockSize * kMtHashNumBlocks) -#define kBtBufferSize (kMtBtBlockSize * kMtBtNumBlocks) - -static unsigned MY_STD_CALL HashThreadFunc2(void *p) { HashThreadFunc((CMatchFinderMt *)p); return 0; } -static unsigned MY_STD_CALL BtThreadFunc2(void *p) -{ - Byte allocaDummy[0x180]; - int i = 0; - for (i = 0; i < 16; i++) - allocaDummy[i] = (Byte)i; - BtThreadFunc((CMatchFinderMt *)p); - return 0; -} - -SRes MatchFinderMt_Create(CMatchFinderMt *p, UInt32 historySize, UInt32 keepAddBufferBefore, - UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ISzAlloc *alloc) -{ - CMatchFinder *mf = p->MatchFinder; - p->historySize = historySize; - if (kMtBtBlockSize <= matchMaxLen * 4) - return SZ_ERROR_PARAM; - if (p->hashBuf == 0) - { - p->hashBuf = (UInt32 *)alloc->Alloc(alloc, (kHashBufferSize + kBtBufferSize) * sizeof(UInt32)); - if (p->hashBuf == 0) - return SZ_ERROR_MEM; - p->btBuf = p->hashBuf + kHashBufferSize; - } - keepAddBufferBefore += (kHashBufferSize + kBtBufferSize); - keepAddBufferAfter += kMtHashBlockSize; - if (!MatchFinder_Create(mf, historySize, keepAddBufferBefore, matchMaxLen, keepAddBufferAfter, alloc)) - return SZ_ERROR_MEM; - - RINOK(MtSync_Create(&p->hashSync, HashThreadFunc2, p, kMtHashNumBlocks)); - RINOK(MtSync_Create(&p->btSync, BtThreadFunc2, p, kMtBtNumBlocks)); - return SZ_OK; -} - -/* Call it after ReleaseStream / SetStream */ -void MatchFinderMt_Init(CMatchFinderMt *p) -{ - CMatchFinder *mf = p->MatchFinder; - p->btBufPos = p->btBufPosLimit = 0; - p->hashBufPos = p->hashBufPosLimit = 0; - MatchFinder_Init(mf); - p->pointerToCurPos = MatchFinder_GetPointerToCurrentPos(mf); - p->btNumAvailBytes = 0; - p->lzPos = p->historySize + 1; - - p->hash = mf->hash; - p->fixedHashSize = mf->fixedHashSize; - p->crc = mf->crc; - - p->son = mf->son; - p->matchMaxLen = mf->matchMaxLen; - p->numHashBytes = mf->numHashBytes; - p->pos = mf->pos; - p->buffer = mf->buffer; - p->cyclicBufferPos = mf->cyclicBufferPos; - p->cyclicBufferSize = mf->cyclicBufferSize; - p->cutValue = mf->cutValue; -} - -/* ReleaseStream is required to finish multithreading */ -void MatchFinderMt_ReleaseStream(CMatchFinderMt *p) -{ - MtSync_StopWriting(&p->btSync); - /* p->MatchFinder->ReleaseStream(); */ -} - -void MatchFinderMt_Normalize(CMatchFinderMt *p) -{ - MatchFinder_Normalize3(p->lzPos - p->historySize - 1, p->hash, p->fixedHashSize); - p->lzPos = p->historySize + 1; -} - -void MatchFinderMt_GetNextBlock_Bt(CMatchFinderMt *p) -{ - UInt32 blockIndex; - MtSync_GetNextBlock(&p->btSync); - blockIndex = ((p->btSync.numProcessedBlocks - 1) & kMtBtNumBlocksMask); - p->btBufPosLimit = p->btBufPos = blockIndex * kMtBtBlockSize; - p->btBufPosLimit += p->btBuf[p->btBufPos++]; - p->btNumAvailBytes = p->btBuf[p->btBufPos++]; - if (p->lzPos >= kMtMaxValForNormalize - kMtBtBlockSize) - MatchFinderMt_Normalize(p); -} - -const Byte * MatchFinderMt_GetPointerToCurrentPos(CMatchFinderMt *p) -{ - return p->pointerToCurPos; -} - -#define GET_NEXT_BLOCK_IF_REQUIRED if (p->btBufPos == p->btBufPosLimit) MatchFinderMt_GetNextBlock_Bt(p); - -UInt32 MatchFinderMt_GetNumAvailableBytes(CMatchFinderMt *p) -{ - GET_NEXT_BLOCK_IF_REQUIRED; - return p->btNumAvailBytes; -} - -Byte MatchFinderMt_GetIndexByte(CMatchFinderMt *p, Int32 index) -{ - return p->pointerToCurPos[index]; -} - -UInt32 * MixMatches2(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances) -{ - UInt32 hash2Value, curMatch2; - UInt32 *hash = p->hash; - const Byte *cur = p->pointerToCurPos; - UInt32 lzPos = p->lzPos; - MT_HASH2_CALC - - curMatch2 = hash[hash2Value]; - hash[hash2Value] = lzPos; - - if (curMatch2 >= matchMinPos) - if (cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0]) - { - *distances++ = 2; - *distances++ = lzPos - curMatch2 - 1; - } - return distances; -} - -UInt32 * MixMatches3(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances) -{ - UInt32 hash2Value, hash3Value, curMatch2, curMatch3; - UInt32 *hash = p->hash; - const Byte *cur = p->pointerToCurPos; - UInt32 lzPos = p->lzPos; - MT_HASH3_CALC - - curMatch2 = hash[ hash2Value]; - curMatch3 = hash[kFix3HashSize + hash3Value]; - - hash[ hash2Value] = - hash[kFix3HashSize + hash3Value] = - lzPos; - - if (curMatch2 >= matchMinPos && cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0]) - { - distances[1] = lzPos - curMatch2 - 1; - if (cur[(ptrdiff_t)curMatch2 - lzPos + 2] == cur[2]) - { - distances[0] = 3; - return distances + 2; - } - distances[0] = 2; - distances += 2; - } - if (curMatch3 >= matchMinPos && cur[(ptrdiff_t)curMatch3 - lzPos] == cur[0]) - { - *distances++ = 3; - *distances++ = lzPos - curMatch3 - 1; - } - return distances; -} - -/* -UInt32 *MixMatches4(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances) -{ - UInt32 hash2Value, hash3Value, hash4Value, curMatch2, curMatch3, curMatch4; - UInt32 *hash = p->hash; - const Byte *cur = p->pointerToCurPos; - UInt32 lzPos = p->lzPos; - MT_HASH4_CALC - - curMatch2 = hash[ hash2Value]; - curMatch3 = hash[kFix3HashSize + hash3Value]; - curMatch4 = hash[kFix4HashSize + hash4Value]; - - hash[ hash2Value] = - hash[kFix3HashSize + hash3Value] = - hash[kFix4HashSize + hash4Value] = - lzPos; - - if (curMatch2 >= matchMinPos && cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0]) - { - distances[1] = lzPos - curMatch2 - 1; - if (cur[(ptrdiff_t)curMatch2 - lzPos + 2] == cur[2]) - { - distances[0] = (cur[(ptrdiff_t)curMatch2 - lzPos + 3] == cur[3]) ? 4 : 3; - return distances + 2; - } - distances[0] = 2; - distances += 2; - } - if (curMatch3 >= matchMinPos && cur[(ptrdiff_t)curMatch3 - lzPos] == cur[0]) - { - distances[1] = lzPos - curMatch3 - 1; - if (cur[(ptrdiff_t)curMatch3 - lzPos + 3] == cur[3]) - { - distances[0] = 4; - return distances + 2; - } - distances[0] = 3; - distances += 2; - } - - if (curMatch4 >= matchMinPos) - if ( - cur[(ptrdiff_t)curMatch4 - lzPos] == cur[0] && - cur[(ptrdiff_t)curMatch4 - lzPos + 3] == cur[3] - ) - { - *distances++ = 4; - *distances++ = lzPos - curMatch4 - 1; - } - return distances; -} -*/ - -#define INCREASE_LZ_POS p->lzPos++; p->pointerToCurPos++; - -UInt32 MatchFinderMt2_GetMatches(CMatchFinderMt *p, UInt32 *distances) -{ - const UInt32 *btBuf = p->btBuf + p->btBufPos; - UInt32 len = *btBuf++; - p->btBufPos += 1 + len; - p->btNumAvailBytes--; - { - UInt32 i; - for (i = 0; i < len; i += 2) - { - *distances++ = *btBuf++; - *distances++ = *btBuf++; - } - } - INCREASE_LZ_POS - return len; -} - -UInt32 MatchFinderMt_GetMatches(CMatchFinderMt *p, UInt32 *distances) -{ - const UInt32 *btBuf = p->btBuf + p->btBufPos; - UInt32 len = *btBuf++; - p->btBufPos += 1 + len; - - if (len == 0) - { - if (p->btNumAvailBytes-- >= 4) - len = (UInt32)(p->MixMatchesFunc(p, p->lzPos - p->historySize, distances) - (distances)); - } - else - { - /* Condition: there are matches in btBuf with length < p->numHashBytes */ - UInt32 *distances2; - p->btNumAvailBytes--; - distances2 = p->MixMatchesFunc(p, p->lzPos - btBuf[1], distances); - do - { - *distances2++ = *btBuf++; - *distances2++ = *btBuf++; - } - while ((len -= 2) != 0); - len = (UInt32)(distances2 - (distances)); - } - INCREASE_LZ_POS - return len; -} - -#define SKIP_HEADER2 do { GET_NEXT_BLOCK_IF_REQUIRED -#define SKIP_HEADER(n) SKIP_HEADER2 if (p->btNumAvailBytes-- >= (n)) { const Byte *cur = p->pointerToCurPos; UInt32 *hash = p->hash; -#define SKIP_FOOTER } INCREASE_LZ_POS p->btBufPos += p->btBuf[p->btBufPos] + 1; } while (--num != 0); - -void MatchFinderMt0_Skip(CMatchFinderMt *p, UInt32 num) -{ - SKIP_HEADER2 { p->btNumAvailBytes--; - SKIP_FOOTER -} - -void MatchFinderMt2_Skip(CMatchFinderMt *p, UInt32 num) -{ - SKIP_HEADER(2) - UInt32 hash2Value; - MT_HASH2_CALC - hash[hash2Value] = p->lzPos; - SKIP_FOOTER -} - -void MatchFinderMt3_Skip(CMatchFinderMt *p, UInt32 num) -{ - SKIP_HEADER(3) - UInt32 hash2Value, hash3Value; - MT_HASH3_CALC - hash[kFix3HashSize + hash3Value] = - hash[ hash2Value] = - p->lzPos; - SKIP_FOOTER -} - -/* -void MatchFinderMt4_Skip(CMatchFinderMt *p, UInt32 num) -{ - SKIP_HEADER(4) - UInt32 hash2Value, hash3Value, hash4Value; - MT_HASH4_CALC - hash[kFix4HashSize + hash4Value] = - hash[kFix3HashSize + hash3Value] = - hash[ hash2Value] = - p->lzPos; - SKIP_FOOTER -} -*/ - -void MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder *vTable) -{ - vTable->Init = (Mf_Init_Func)MatchFinderMt_Init; - vTable->GetIndexByte = (Mf_GetIndexByte_Func)MatchFinderMt_GetIndexByte; - vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinderMt_GetNumAvailableBytes; - vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinderMt_GetPointerToCurrentPos; - vTable->GetMatches = (Mf_GetMatches_Func)MatchFinderMt_GetMatches; - switch(p->MatchFinder->numHashBytes) - { - case 2: - p->GetHeadsFunc = GetHeads2; - p->MixMatchesFunc = (Mf_Mix_Matches)0; - vTable->Skip = (Mf_Skip_Func)MatchFinderMt0_Skip; - vTable->GetMatches = (Mf_GetMatches_Func)MatchFinderMt2_GetMatches; - break; - case 3: - p->GetHeadsFunc = GetHeads3; - p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches2; - vTable->Skip = (Mf_Skip_Func)MatchFinderMt2_Skip; - break; - default: - /* case 4: */ - p->GetHeadsFunc = p->MatchFinder->bigHash ? GetHeads4b : GetHeads4; - /* p->GetHeadsFunc = GetHeads4; */ - p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches3; - vTable->Skip = (Mf_Skip_Func)MatchFinderMt3_Skip; - break; - /* - default: - p->GetHeadsFunc = GetHeads5; - p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches4; - vTable->Skip = (Mf_Skip_Func)MatchFinderMt4_Skip; - break; - */ - } -} diff --git a/extern/lzma/LzFindMt.h b/extern/lzma/LzFindMt.h deleted file mode 100644 index 2c7e462d592..00000000000 --- a/extern/lzma/LzFindMt.h +++ /dev/null @@ -1,97 +0,0 @@ -/* LzFindMt.h -- multithreaded Match finder for LZ algorithms -2008-10-04 : Igor Pavlov : Public domain */ - -#ifndef __LZFINDMT_H -#define __LZFINDMT_H - -#include "Threads.h" -#include "LzFind.h" - -#define kMtHashBlockSize (1 << 13) -#define kMtHashNumBlocks (1 << 3) -#define kMtHashNumBlocksMask (kMtHashNumBlocks - 1) - -#define kMtBtBlockSize (1 << 14) -#define kMtBtNumBlocks (1 << 6) -#define kMtBtNumBlocksMask (kMtBtNumBlocks - 1) - -typedef struct _CMtSync -{ - Bool wasCreated; - Bool needStart; - Bool exit; - Bool stopWriting; - - CThread thread; - CAutoResetEvent canStart; - CAutoResetEvent wasStarted; - CAutoResetEvent wasStopped; - CSemaphore freeSemaphore; - CSemaphore filledSemaphore; - Bool csWasInitialized; - Bool csWasEntered; - CCriticalSection cs; - UInt32 numProcessedBlocks; -} CMtSync; - -typedef UInt32 * (*Mf_Mix_Matches)(void *p, UInt32 matchMinPos, UInt32 *distances); - -/* kMtCacheLineDummy must be >= size_of_CPU_cache_line */ -#define kMtCacheLineDummy 128 - -typedef void (*Mf_GetHeads)(const Byte *buffer, UInt32 pos, - UInt32 *hash, UInt32 hashMask, UInt32 *heads, UInt32 numHeads, const UInt32 *crc); - -typedef struct _CMatchFinderMt -{ - /* LZ */ - const Byte *pointerToCurPos; - UInt32 *btBuf; - UInt32 btBufPos; - UInt32 btBufPosLimit; - UInt32 lzPos; - UInt32 btNumAvailBytes; - - UInt32 *hash; - UInt32 fixedHashSize; - UInt32 historySize; - const UInt32 *crc; - - Mf_Mix_Matches MixMatchesFunc; - - /* LZ + BT */ - CMtSync btSync; - Byte btDummy[kMtCacheLineDummy]; - - /* BT */ - UInt32 *hashBuf; - UInt32 hashBufPos; - UInt32 hashBufPosLimit; - UInt32 hashNumAvail; - - CLzRef *son; - UInt32 matchMaxLen; - UInt32 numHashBytes; - UInt32 pos; - Byte *buffer; - UInt32 cyclicBufferPos; - UInt32 cyclicBufferSize; /* it must be historySize + 1 */ - UInt32 cutValue; - - /* BT + Hash */ - CMtSync hashSync; - /* Byte hashDummy[kMtCacheLineDummy]; */ - - /* Hash */ - Mf_GetHeads GetHeadsFunc; - CMatchFinder *MatchFinder; -} CMatchFinderMt; - -void MatchFinderMt_Construct(CMatchFinderMt *p); -void MatchFinderMt_Destruct(CMatchFinderMt *p, ISzAlloc *alloc); -SRes MatchFinderMt_Create(CMatchFinderMt *p, UInt32 historySize, UInt32 keepAddBufferBefore, - UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ISzAlloc *alloc); -void MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder *vTable); -void MatchFinderMt_ReleaseStream(CMatchFinderMt *p); - -#endif diff --git a/extern/lzma/Threads.c b/extern/lzma/Threads.c deleted file mode 100644 index 4fdd69b0d5c..00000000000 --- a/extern/lzma/Threads.c +++ /dev/null @@ -1,109 +0,0 @@ -/* Threads.c -- multithreading library -2008-08-05 -Igor Pavlov -Public domain */ - -#include "Threads.h" -#include - -static WRes GetError() -{ - DWORD res = GetLastError(); - return (res) ? (WRes)(res) : 1; -} - -WRes HandleToWRes(HANDLE h) { return (h != 0) ? 0 : GetError(); } -WRes BOOLToWRes(BOOL v) { return v ? 0 : GetError(); } - -static WRes MyCloseHandle(HANDLE *h) -{ - if (*h != NULL) - if (!CloseHandle(*h)) - return GetError(); - *h = NULL; - return 0; -} - -WRes Thread_Create(CThread *thread, THREAD_FUNC_RET_TYPE (THREAD_FUNC_CALL_TYPE *startAddress)(void *), LPVOID parameter) -{ - unsigned threadId; /* Windows Me/98/95: threadId parameter may not be NULL in _beginthreadex/CreateThread functions */ - thread->handle = - /* CreateThread(0, 0, startAddress, parameter, 0, &threadId); */ - (HANDLE)_beginthreadex(NULL, 0, startAddress, parameter, 0, &threadId); - /* maybe we must use errno here, but probably GetLastError() is also OK. */ - return HandleToWRes(thread->handle); -} - -WRes WaitObject(HANDLE h) -{ - return (WRes)WaitForSingleObject(h, INFINITE); -} - -WRes Thread_Wait(CThread *thread) -{ - if (thread->handle == NULL) - return 1; - return WaitObject(thread->handle); -} - -WRes Thread_Close(CThread *thread) -{ - return MyCloseHandle(&thread->handle); -} - -WRes Event_Create(CEvent *p, BOOL manualReset, int initialSignaled) -{ - p->handle = CreateEvent(NULL, manualReset, (initialSignaled ? TRUE : FALSE), NULL); - return HandleToWRes(p->handle); -} - -WRes ManualResetEvent_Create(CManualResetEvent *p, int initialSignaled) - { return Event_Create(p, TRUE, initialSignaled); } -WRes ManualResetEvent_CreateNotSignaled(CManualResetEvent *p) - { return ManualResetEvent_Create(p, 0); } - -WRes AutoResetEvent_Create(CAutoResetEvent *p, int initialSignaled) - { return Event_Create(p, FALSE, initialSignaled); } -WRes AutoResetEvent_CreateNotSignaled(CAutoResetEvent *p) - { return AutoResetEvent_Create(p, 0); } - -WRes Event_Set(CEvent *p) { return BOOLToWRes(SetEvent(p->handle)); } -WRes Event_Reset(CEvent *p) { return BOOLToWRes(ResetEvent(p->handle)); } -WRes Event_Wait(CEvent *p) { return WaitObject(p->handle); } -WRes Event_Close(CEvent *p) { return MyCloseHandle(&p->handle); } - - -WRes Semaphore_Create(CSemaphore *p, UInt32 initiallyCount, UInt32 maxCount) -{ - p->handle = CreateSemaphore(NULL, (LONG)initiallyCount, (LONG)maxCount, NULL); - return HandleToWRes(p->handle); -} - -WRes Semaphore_Release(CSemaphore *p, LONG releaseCount, LONG *previousCount) -{ - return BOOLToWRes(ReleaseSemaphore(p->handle, releaseCount, previousCount)); -} -WRes Semaphore_ReleaseN(CSemaphore *p, UInt32 releaseCount) -{ - return Semaphore_Release(p, (LONG)releaseCount, NULL); -} -WRes Semaphore_Release1(CSemaphore *p) -{ - return Semaphore_ReleaseN(p, 1); -} - -WRes Semaphore_Wait(CSemaphore *p) { return WaitObject(p->handle); } -WRes Semaphore_Close(CSemaphore *p) { return MyCloseHandle(&p->handle); } - -WRes CriticalSection_Init(CCriticalSection *p) -{ - /* InitializeCriticalSection can raise only STATUS_NO_MEMORY exception */ - __try - { - InitializeCriticalSection(p); - /* InitializeCriticalSectionAndSpinCount(p, 0); */ - } - __except (EXCEPTION_EXECUTE_HANDLER) { return 1; } - return 0; -} - diff --git a/extern/lzma/Threads.h b/extern/lzma/Threads.h deleted file mode 100644 index a823e57858a..00000000000 --- a/extern/lzma/Threads.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Threads.h -- multithreading library -2008-11-22 : Igor Pavlov : Public domain */ - -#ifndef __7Z_THRESDS_H -#define __7Z_THRESDS_H - -#include "Types.h" - -typedef struct _CThread -{ - HANDLE handle; -} CThread; - -#define Thread_Construct(thread) (thread)->handle = NULL -#define Thread_WasCreated(thread) ((thread)->handle != NULL) - -typedef unsigned THREAD_FUNC_RET_TYPE; -#define THREAD_FUNC_CALL_TYPE MY_STD_CALL -#define THREAD_FUNC_DECL THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE - -WRes Thread_Create(CThread *thread, THREAD_FUNC_RET_TYPE (THREAD_FUNC_CALL_TYPE *startAddress)(void *), LPVOID parameter); -WRes Thread_Wait(CThread *thread); -WRes Thread_Close(CThread *thread); - -typedef struct _CEvent -{ - HANDLE handle; -} CEvent; - -typedef CEvent CAutoResetEvent; -typedef CEvent CManualResetEvent; - -#define Event_Construct(event) (event)->handle = NULL -#define Event_IsCreated(event) ((event)->handle != NULL) - -WRes ManualResetEvent_Create(CManualResetEvent *event, int initialSignaled); -WRes ManualResetEvent_CreateNotSignaled(CManualResetEvent *event); -WRes AutoResetEvent_Create(CAutoResetEvent *event, int initialSignaled); -WRes AutoResetEvent_CreateNotSignaled(CAutoResetEvent *event); -WRes Event_Set(CEvent *event); -WRes Event_Reset(CEvent *event); -WRes Event_Wait(CEvent *event); -WRes Event_Close(CEvent *event); - - -typedef struct _CSemaphore -{ - HANDLE handle; -} CSemaphore; - -#define Semaphore_Construct(p) (p)->handle = NULL - -WRes Semaphore_Create(CSemaphore *p, UInt32 initiallyCount, UInt32 maxCount); -WRes Semaphore_ReleaseN(CSemaphore *p, UInt32 num); -WRes Semaphore_Release1(CSemaphore *p); -WRes Semaphore_Wait(CSemaphore *p); -WRes Semaphore_Close(CSemaphore *p); - - -typedef CRITICAL_SECTION CCriticalSection; - -WRes CriticalSection_Init(CCriticalSection *p); -#define CriticalSection_Delete(p) DeleteCriticalSection(p) -#define CriticalSection_Enter(p) EnterCriticalSection(p) -#define CriticalSection_Leave(p) LeaveCriticalSection(p) - -#endif - From 2878eed1c125d07bcfc893eb04d1307c6aa19e3a Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Thu, 20 Aug 2009 01:22:07 +0000 Subject: [PATCH 154/577] Fix Smoke: * Making it less verbose --- source/blender/blenkernel/intern/smoke.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 9be60a0a975..7af67364bc5 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -591,7 +591,7 @@ void smokeModifier_reset(struct SmokeModifierData *smd) smd->domain->point_cache->simframe= 0; smd->domain->point_cache->last_exact= 0; - printf("reset_domain\n"); + // printf("reset_domain\n"); } else if(smd->flow) { @@ -763,7 +763,7 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM float light[3] = {0.0,0.0,0.0}; int have_lamp = 0; - printf("smd->type & MOD_SMOKE_TYPE_DOMAIN\n"); + // printf("smd->type & MOD_SMOKE_TYPE_DOMAIN\n"); framenr = scene->r.cfra; @@ -813,7 +813,7 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM /* try to read from cache */ cache_result = BKE_ptcache_read_cache(&pid, (float)framenr, scene->r.frs_sec); - printf("cache_result: %d\n", cache_result); + // printf("cache_result: %d\n", cache_result); if(cache_result == PTCACHE_READ_EXACT) { @@ -885,7 +885,7 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM BKE_ptcache_write_cache(&pid, framenr); - printf("Writing cache_low\n"); + // printf("Writing cache_low\n"); tend(); From 7dfc1317acc63aea67d4ebd5db8d64c5bef4b8c8 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Thu, 20 Aug 2009 05:13:07 +0000 Subject: [PATCH 155/577] 2.5/Paint: * Converted vertex paint to use the new stroke system. Now supports the same smooth stroke and stroke spacing as sculpt mode. * Refactored the paint cursor a bit, just sculpt for now but other modes soon. * A couple warning fixes --- release/ui/space_view3d_toolbar.py | 2 +- source/blender/blenkernel/BKE_paint.h | 2 +- source/blender/blenkernel/intern/paint.c | 13 +- source/blender/editors/object/object_edit.c | 40 ++++-- .../editors/sculpt_paint/paint_image.c | 2 +- .../editors/sculpt_paint/paint_intern.h | 4 + .../blender/editors/sculpt_paint/paint_ops.c | 6 - .../editors/sculpt_paint/paint_stroke.c | 76 +++++++++++ .../editors/sculpt_paint/paint_vertex.c | 127 +++++++++--------- source/blender/editors/sculpt_paint/sculpt.c | 60 ++------- source/blender/gpu/GPU_draw.h | 1 + source/blender/makesdna/DNA_scene_types.h | 8 +- source/blender/makesrna/intern/rna_space.c | 2 +- source/blender/windowmanager/WM_types.h | 5 + .../windowmanager/intern/wm_operators.c | 2 +- 15 files changed, 207 insertions(+), 143 deletions(-) diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py index 1b4c1e25c34..5d882866e96 100644 --- a/release/ui/space_view3d_toolbar.py +++ b/release/ui/space_view3d_toolbar.py @@ -429,7 +429,7 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel): def poll(self, context): settings = self.paint_settings(context) - return (settings and settings.brush and context.sculpt_object) + return (settings and settings.brush and (context.sculpt_object or context.vertex_paint_object)) def draw(self, context): settings = self.paint_settings(context) diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index 67b260b2348..45d2e24c7f6 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -33,7 +33,7 @@ struct Object; struct Paint; struct Scene; -void paint_init(struct Paint *p, const char *brush_name); +void paint_init(struct Paint *p, const char *col); void free_paint(struct Paint *p); void copy_paint(struct Paint *orig, struct Paint *new); diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 80016f23d7c..f0893e058fa 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -154,14 +154,23 @@ int paint_facesel_test(Object *ob) } -void paint_init(Paint *p, const char *name) +void paint_init(Paint *p, const char *col) { Brush *brush; /* If there's no brush, create one */ brush = paint_brush(p); - brush_check_exists(&brush, name); + brush_check_exists(&brush, "Brush"); paint_brush_set(p, brush); + + if(col) + memcpy(p->paint_cursor_col, col, 3); + else { + p->paint_cursor_col[0] = 255; + p->paint_cursor_col[1] = 255; + p->paint_cursor_col[2] = 255; + } + p->paint_cursor_col[3] = 128; } void free_paint(Paint *paint) diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index f8d969d2462..39fd6433548 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -7073,6 +7073,25 @@ static EnumPropertyItem *object_mode_set_itemsf(bContext *C, PointerRNA *ptr, in return item; } +static const char *object_mode_op_string(int mode) +{ + if(mode == OB_MODE_EDIT) + return "OBJECT_OT_editmode_toggle"; + if(mode == OB_MODE_SCULPT) + return "SCULPT_OT_sculptmode_toggle"; + if(mode == OB_MODE_VERTEX_PAINT) + return "PAINT_OT_vertex_paint_toggle"; + if(mode == OB_MODE_WEIGHT_PAINT) + return "PAINT_OT_weight_paint_toggle"; + if(mode == OB_MODE_TEXTURE_PAINT) + return "PAINT_OT_texture_paint_toggle"; + if(mode == OB_MODE_PARTICLE_EDIT) + return "PARTICLE_OT_particle_edit_toggle"; + if(mode == OB_MODE_POSE) + return "OBJECT_OT_posemode_toggle"; + return NULL; +} + static int object_mode_set_exec(bContext *C, wmOperator *op) { Object *ob= CTX_data_active_object(C); @@ -7081,20 +7100,13 @@ static int object_mode_set_exec(bContext *C, wmOperator *op) if(!ob) return OPERATOR_CANCELLED; - if((mode == OB_MODE_EDIT) == !(ob->mode & OB_MODE_EDIT)) - WM_operator_name_call(C, "OBJECT_OT_editmode_toggle", WM_OP_EXEC_REGION_WIN, NULL); - if((mode == OB_MODE_SCULPT) == !(ob->mode & OB_MODE_SCULPT)) - WM_operator_name_call(C, "SCULPT_OT_sculptmode_toggle", WM_OP_EXEC_REGION_WIN, NULL); - if((mode == OB_MODE_VERTEX_PAINT) == !(ob->mode & OB_MODE_VERTEX_PAINT)) - WM_operator_name_call(C, "PAINT_OT_vertex_paint_toggle", WM_OP_EXEC_REGION_WIN, NULL); - if((mode == OB_MODE_WEIGHT_PAINT) == !(ob->mode & OB_MODE_WEIGHT_PAINT)) - WM_operator_name_call(C, "PAINT_OT_weight_paint_toggle", WM_OP_EXEC_REGION_WIN, NULL); - if((mode == OB_MODE_TEXTURE_PAINT) == !(ob->mode & OB_MODE_TEXTURE_PAINT)) - WM_operator_name_call(C, "PAINT_OT_texture_paint_toggle", WM_OP_EXEC_REGION_WIN, NULL); - if((mode == OB_MODE_PARTICLE_EDIT) == !(ob->mode & OB_MODE_PARTICLE_EDIT)) - WM_operator_name_call(C, "PARTICLE_OT_particle_edit_toggle", WM_OP_EXEC_REGION_WIN, NULL); - if((mode == OB_MODE_POSE) == !(ob->mode & OB_MODE_POSE)) - WM_operator_name_call(C, "OBJECT_OT_posemode_toggle", WM_OP_EXEC_REGION_WIN, NULL); + /* Exit off current mode */ + if(ob->mode != OB_MODE_OBJECT) + WM_operator_name_call(C, object_mode_op_string(ob->mode), WM_OP_EXEC_REGION_WIN, NULL); + + /* Enter new mode */ + if(mode != OB_MODE_OBJECT) + WM_operator_name_call(C, object_mode_op_string(mode), WM_OP_EXEC_REGION_WIN, NULL); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 465aa281e25..8a8041abbff 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -5174,7 +5174,7 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op) me->mtface= CustomData_add_layer(&me->fdata, CD_MTFACE, CD_DEFAULT, NULL, me->totface); - paint_init(&scene->toolsettings->imapaint.paint, "Brush"); + paint_init(&scene->toolsettings->imapaint.paint, NULL); if(U.glreslimit != 0) GPU_free_images(); diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h index 41764a70686..c6c93026c44 100644 --- a/source/blender/editors/sculpt_paint/paint_intern.h +++ b/source/blender/editors/sculpt_paint/paint_intern.h @@ -50,6 +50,10 @@ struct PaintStroke *paint_stroke_new(bContext *C, StrokeTestStart test_start, StrokeUpdateStep update_step, StrokeDone done); int paint_stroke_modal(struct bContext *C, struct wmOperator *op, struct wmEvent *event); struct ViewContext *paint_stroke_view_context(struct PaintStroke *stroke); +void *paint_stroke_mode_data(struct PaintStroke *stroke); +void paint_stroke_set_mode_data(struct PaintStroke *stroke, void *mode_data); +int paint_poll(bContext *C); +void paint_cursor_start(struct bContext *C, int (*poll)(struct bContext *C)); /* paint_vertex.c */ void PAINT_OT_weight_paint_toggle(struct wmOperatorType *ot); diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index 63a6591d057..1ea612c0aa5 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -77,12 +77,6 @@ void BRUSH_OT_add(wmOperatorType *ot) RNA_def_enum(ot->srna, "type", brush_type_items, OB_MODE_VERTEX_PAINT, "Type", "Which paint mode to create the brush for."); } -/* Paint operators */ -static int paint_poll(bContext *C) -{ - return !!paint_get_active(CTX_data_scene(C)); -} - /**************************** registration **********************************/ void ED_operatortypes_paint(void) diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 634b82674b5..1167e011c86 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -43,6 +43,7 @@ #include "BLI_arithb.h" +#include "BIF_gl.h" #include "BIF_glutil.h" #include "ED_screen.h" @@ -54,6 +55,9 @@ #include typedef struct PaintStroke { + void *mode_data; + void *smooth_stroke_cursor; + /* Cached values */ ViewContext vc; bglMats mats; @@ -71,6 +75,42 @@ typedef struct PaintStroke { StrokeDone done; } PaintStroke; +/*** Cursor ***/ +static void paint_draw_smooth_stroke(bContext *C, int x, int y, void *customdata) +{ + Brush *brush = paint_brush(paint_get_active(CTX_data_scene(C))); + PaintStroke *stroke = customdata; + + glColor4ubv(paint_get_active(CTX_data_scene(C))->paint_cursor_col); + glEnable(GL_LINE_SMOOTH); + glEnable(GL_BLEND); + + if(stroke && brush && (brush->flag & BRUSH_SMOOTH_STROKE)) { + ARegion *ar = CTX_wm_region(C); + sdrawline(x, y, (int)stroke->last_mouse_position[0] - ar->winrct.xmin, + (int)stroke->last_mouse_position[1] - ar->winrct.ymin); + } + + glDisable(GL_BLEND); + glDisable(GL_LINE_SMOOTH); +} + +static void paint_draw_cursor(bContext *C, int x, int y, void *customdata) +{ + Brush *brush = paint_brush(paint_get_active(CTX_data_scene(C))); + + glColor4ubv(paint_get_active(CTX_data_scene(C))->paint_cursor_col); + glEnable(GL_LINE_SMOOTH); + glEnable(GL_BLEND); + + glTranslatef((float)x, (float)y, 0.0f); + glutil_draw_lined_arc(0.0, M_PI*2.0, brush->size, 40); + glTranslatef((float)-x, (float)-y, 0.0f); + + glDisable(GL_BLEND); + glDisable(GL_LINE_SMOOTH); +} + /* Put the location of the next stroke dot into the stroke RNA and apply it to the mesh */ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, wmEvent *event, float mouse[2]) { @@ -191,6 +231,11 @@ int paint_stroke_modal(bContext *C, wmOperator *op, wmEvent *event) stroke->last_mouse_position[0] = event->x; stroke->last_mouse_position[1] = event->y; stroke->stroke_started = stroke->test_start(C, op, event); + + if(stroke->stroke_started) + stroke->smooth_stroke_cursor = + WM_paint_cursor_activate(CTX_wm_manager(C), paint_poll, paint_draw_smooth_stroke, stroke); + ED_region_tag_redraw(ar); } @@ -209,6 +254,9 @@ int paint_stroke_modal(bContext *C, wmOperator *op, wmEvent *event) /* TODO: fix hardcoded event here */ if(event->type == LEFTMOUSE && event->val == 0) { + if(stroke->smooth_stroke_cursor) + WM_paint_cursor_end(CTX_wm_manager(C), stroke->smooth_stroke_cursor); + stroke->done(C, stroke); MEM_freeN(stroke); return OPERATOR_FINISHED; @@ -222,3 +270,31 @@ ViewContext *paint_stroke_view_context(PaintStroke *stroke) return &stroke->vc; } +void *paint_stroke_mode_data(struct PaintStroke *stroke) +{ + return stroke->mode_data; +} + +void paint_stroke_set_mode_data(PaintStroke *stroke, void *mode_data) +{ + stroke->mode_data = mode_data; +} + +int paint_poll(bContext *C) +{ + Paint *p = paint_get_active(CTX_data_scene(C)); + Object *ob = CTX_data_active_object(C); + + return p && ob && paint_brush(p) && + CTX_wm_area(C)->spacetype == SPACE_VIEW3D && + CTX_wm_region(C)->regiontype == RGN_TYPE_WINDOW; +} + +void paint_cursor_start(bContext *C, int (*poll)(bContext *C)) +{ + Paint *p = paint_get_active(CTX_data_scene(C)); + + if(p && !p->paint_cursor) + p->paint_cursor = WM_paint_cursor_activate(CTX_wm_manager(C), poll, paint_draw_cursor, NULL); +} + diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 05faa47e0f4..19f0293c1b8 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -62,6 +62,7 @@ #include "DNA_userdef_types.h" #include "RNA_access.h" +#include "RNA_define.h" #include "BKE_armature.h" #include "BKE_brush.h" @@ -91,6 +92,8 @@ #include "ED_util.h" #include "ED_view3d.h" +#include "paint_intern.h" + /* vp->mode */ #define VP_MIX 0 #define VP_ADD 1 @@ -807,7 +810,7 @@ static int sample_backbuf_area(ViewContext *vc, int *indexar, int totface, int x return tot; } -static int calc_vp_alpha_dl(VPaint *vp, ViewContext *vc, float vpimat[][3], float *vert_nor, short *mval) +static int calc_vp_alpha_dl(VPaint *vp, ViewContext *vc, float vpimat[][3], float *vert_nor, float *mval) { Brush *brush = paint_brush(&vp->paint); float fac, dx, dy; @@ -1124,7 +1127,7 @@ static int set_wpaint(bContext *C, wmOperator *op) /* toggle */ if(wp==NULL) wp= scene->toolsettings->wpaint= new_vpaint(1); - paint_init(&wp->paint, "Brush"); + paint_init(&wp->paint, NULL); toggle_paint_cursor(C, 1); @@ -1329,7 +1332,7 @@ static int wpaint_modal(bContext *C, wmOperator *op, wmEvent *event) float paintweight= ts->vgroup_weight; int *indexar= wpd->indexar; int totindex, index, alpha, totw; - short mval[2]; + float mval[2]; view3d_operator_needs_opengl(C); @@ -1634,7 +1637,7 @@ static int set_vpaint(bContext *C, wmOperator *op) /* toggle */ toggle_paint_cursor(C, 0); - paint_init(&vp->paint, "Brush"); + paint_init(&vp->paint, NULL); } if (me) @@ -1693,25 +1696,47 @@ struct VPaintData { float vpimat[3][3]; }; -static void vpaint_exit(bContext *C, wmOperator *op) +static int vpaint_stroke_test_start(bContext *C, struct wmOperator *op, wmEvent *event) { ToolSettings *ts= CTX_data_tool_settings(C); - struct VPaintData *vpd= op->customdata; + struct PaintStroke *stroke = op->customdata; + VPaint *vp= ts->vpaint; + struct VPaintData *vpd; + Object *ob= CTX_data_active_object(C); + Mesh *me; + float mat[4][4], imat[4][4]; + + /* context checks could be a poll() */ + me= get_mesh(ob); + if(me==NULL || me->totface==0) return OPERATOR_PASS_THROUGH; - if(vpd->vertexcosnos) - MEM_freeN(vpd->vertexcosnos); - MEM_freeN(vpd->indexar); + if(me->mcol==NULL) make_vertexcol(CTX_data_scene(C), 0); + if(me->mcol==NULL) return OPERATOR_CANCELLED; - /* frees prev buffer */ - copy_vpaint_prev(ts->vpaint, NULL, 0); + /* make mode data storage */ + vpd= MEM_callocN(sizeof(struct VPaintData), "VPaintData"); + paint_stroke_set_mode_data(stroke, vpd); + view3d_set_viewcontext(C, &vpd->vc); - MEM_freeN(vpd); - op->customdata= NULL; + vpd->vertexcosnos= mesh_get_mapped_verts_nors(vpd->vc.scene, ob); + vpd->indexar= get_indexarray(); + vpd->paintcol= vpaint_get_current_col(vp); + + /* for filtering */ + copy_vpaint_prev(vp, (unsigned int *)me->mcol, me->totface); + + /* some old cruft to sort out later */ + Mat4MulMat4(mat, ob->obmat, vpd->vc.rv3d->viewmat); + Mat4Invert(imat, mat); + Mat3CpyMat4(vpd->vpimat, imat); + + return 1; } -static void vpaint_dot(bContext *C, struct VPaintData *vpd, wmEvent *event) +static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, PointerRNA *itemptr) { ToolSettings *ts= CTX_data_tool_settings(C); + struct VPaintData *vpd = paint_stroke_mode_data(stroke); VPaint *vp= ts->vpaint; Brush *brush = paint_brush(&vp->paint); ViewContext *vc= &vpd->vc; @@ -1720,7 +1745,9 @@ static void vpaint_dot(bContext *C, struct VPaintData *vpd, wmEvent *event) float mat[4][4]; int *indexar= vpd->indexar; int totindex, index; - short mval[2]; + float mval[2]; + + RNA_float_get_array(itemptr, "mouse", mval); view3d_operator_needs_opengl(C); @@ -1728,10 +1755,11 @@ static void vpaint_dot(bContext *C, struct VPaintData *vpd, wmEvent *event) wmMultMatrix(ob->obmat); wmGetSingleMatrix(mat); wmLoadMatrix(vc->rv3d->viewmat); + + mval[0]-= vc->ar->winrct.xmin; + mval[1]-= vc->ar->winrct.ymin; + - mval[0]= event->x - vc->ar->winrct.xmin; - mval[1]= event->y - vc->ar->winrct.ymin; - /* which faces are involved */ if(vp->flag & VP_AREA) { totindex= sample_backbuf_area(vc, indexar, me->totface, mval[0], mval[1], brush->size); @@ -1811,58 +1839,27 @@ static void vpaint_dot(bContext *C, struct VPaintData *vpd, wmEvent *event) DAG_object_flush_update(vc->scene, ob, OB_RECALC_DATA); } -static int vpaint_modal(bContext *C, wmOperator *op, wmEvent *event) +static void vpaint_stroke_done(bContext *C, struct PaintStroke *stroke) { - switch(event->type) { - case LEFTMOUSE: - if(event->val==0) { /* release */ - vpaint_exit(C, op); - return OPERATOR_FINISHED; - } - /* pass on, first press gets painted too */ - - case MOUSEMOVE: - vpaint_dot(C, op->customdata, event); - break; - } + ToolSettings *ts= CTX_data_tool_settings(C); + struct VPaintData *vpd= paint_stroke_mode_data(stroke); - return OPERATOR_RUNNING_MODAL; + if(vpd->vertexcosnos) + MEM_freeN(vpd->vertexcosnos); + MEM_freeN(vpd->indexar); + + /* frees prev buffer */ + copy_vpaint_prev(ts->vpaint, NULL, 0); + + MEM_freeN(vpd); } static int vpaint_invoke(bContext *C, wmOperator *op, wmEvent *event) { - ToolSettings *ts= CTX_data_tool_settings(C); - VPaint *vp= ts->vpaint; - struct VPaintData *vpd; - Object *ob= CTX_data_active_object(C); - Mesh *me; - float mat[4][4], imat[4][4]; - /* context checks could be a poll() */ - me= get_mesh(ob); - if(me==NULL || me->totface==0) return OPERATOR_PASS_THROUGH; - - if(me->mcol==NULL) make_vertexcol(CTX_data_scene(C), 0); - if(me->mcol==NULL) return OPERATOR_CANCELLED; - - /* make customdata storage */ - op->customdata= vpd= MEM_callocN(sizeof(struct VPaintData), "VPaintData"); - view3d_set_viewcontext(C, &vpd->vc); - - vpd->vertexcosnos= mesh_get_mapped_verts_nors(vpd->vc.scene, ob); - vpd->indexar= get_indexarray(); - vpd->paintcol= vpaint_get_current_col(vp); - - /* for filtering */ - copy_vpaint_prev(vp, (unsigned int *)me->mcol, me->totface); - - /* some old cruft to sort out later */ - Mat4MulMat4(mat, ob->obmat, vpd->vc.rv3d->viewmat); - Mat4Invert(imat, mat); - Mat3CpyMat4(vpd->vpimat, imat); - - /* do paint once for click only paint */ - vpaint_modal(C, op, event); + op->customdata = paint_stroke_new(C, vpaint_stroke_test_start, + vpaint_stroke_update_step, + vpaint_stroke_done); /* add modal handler */ WM_event_add_modal_handler(C, &CTX_wm_window(C)->handlers, op); @@ -1878,11 +1875,13 @@ void PAINT_OT_vertex_paint(wmOperatorType *ot) /* api callbacks */ ot->invoke= vpaint_invoke; - ot->modal= vpaint_modal; + ot->modal= paint_stroke_modal; /* ot->exec= vpaint_exec; <-- needs stroke property */ ot->poll= vp_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; + + RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", ""); } diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index c01004f5b7e..94703dbe4ff 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -1042,47 +1042,7 @@ static int sculpt_mode_poll(bContext *C) static int sculpt_poll(bContext *C) { - return sculpt_mode_poll(C) && paint_brush(&CTX_data_tool_settings(C)->sculpt->paint) && - CTX_wm_area(C)->spacetype == SPACE_VIEW3D && - CTX_wm_region(C)->regiontype == RGN_TYPE_WINDOW; -} - -/*** Sculpt Cursor ***/ -static void draw_paint_cursor(bContext *C, int x, int y, void *customdata) -{ - Sculpt *sd= CTX_data_tool_settings(C)->sculpt; - SculptSession *ss= CTX_data_active_object(C)->sculpt; - Brush *brush = paint_brush(&sd->paint); - - glColor4ub(255, 100, 100, 128); - glEnable( GL_LINE_SMOOTH ); - glEnable(GL_BLEND); - - glTranslatef((float)x, (float)y, 0.0f); - glutil_draw_lined_arc(0.0, M_PI*2.0, brush->size, 40); - glTranslatef((float)-x, (float)-y, 0.0f); - - if(ss && ss->cache && brush && (brush->flag & BRUSH_SMOOTH_STROKE)) { - ARegion *ar = CTX_wm_region(C); - sdrawline(x, y, (int)ss->cache->mouse[0] - ar->winrct.xmin, (int)ss->cache->mouse[1] - ar->winrct.ymin); - } - - glDisable(GL_BLEND); - glDisable( GL_LINE_SMOOTH ); -} - -static void toggle_paint_cursor(bContext *C) -{ - Sculpt *s = CTX_data_scene(C)->toolsettings->sculpt; - - if(s->cursor) { - WM_paint_cursor_end(CTX_wm_manager(C), s->cursor); - s->cursor = NULL; - } - else { - s->cursor = - WM_paint_cursor_activate(CTX_wm_manager(C), sculpt_poll, draw_paint_cursor, NULL); - } + return sculpt_mode_poll(C) && paint_poll(C); } static void sculpt_undo_push(bContext *C, Sculpt *sd) @@ -1112,8 +1072,11 @@ static void sculpt_undo_push(bContext *C, Sculpt *sd) /**** Radial control ****/ static int sculpt_radial_control_invoke(bContext *C, wmOperator *op, wmEvent *event) { - Brush *brush = paint_brush(&CTX_data_tool_settings(C)->sculpt->paint); - toggle_paint_cursor(C); + Paint *p = paint_get_active(CTX_data_scene(C)); + Brush *brush = paint_brush(p); + + WM_paint_cursor_end(CTX_wm_manager(C), p->paint_cursor); + p->paint_cursor = NULL; brush_radial_control_invoke(op, brush, 1); return WM_radial_control_invoke(C, op, event); } @@ -1122,7 +1085,7 @@ static int sculpt_radial_control_modal(bContext *C, wmOperator *op, wmEvent *eve { int ret = WM_radial_control_modal(C, op, event); if(ret != OPERATOR_RUNNING_MODAL) - toggle_paint_cursor(C); + paint_cursor_start(C, sculpt_poll); return ret; } @@ -1592,6 +1555,8 @@ static int sculpt_toggle_mode(bContext *C, wmOperator *op) free_sculptsession(&ob->sculpt); } else { + const char col[3] = {255, 100, 100}; + /* Enter sculptmode */ ob->mode |= OB_MODE_SCULPT; @@ -1605,10 +1570,9 @@ static int sculpt_toggle_mode(bContext *C, wmOperator *op) free_sculptsession(&ob->sculpt); ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session"); - if(!ts->sculpt->cursor) - toggle_paint_cursor(C); - - paint_init(&ts->sculpt->paint, "Brush"); + paint_init(&ts->sculpt->paint, col); + + paint_cursor_start(C, sculpt_poll); WM_event_add_notifier(C, NC_SCENE|ND_MODE, CTX_data_scene(C)); } diff --git a/source/blender/gpu/GPU_draw.h b/source/blender/gpu/GPU_draw.h index 1c6b8399422..00d0e3131e5 100644 --- a/source/blender/gpu/GPU_draw.h +++ b/source/blender/gpu/GPU_draw.h @@ -43,6 +43,7 @@ struct Object; struct Scene; struct View3D; struct RegionView3D; +struct SmokeModifierData; /* OpenGL drawing functions related to shading. These are also * shared with the game engine, where there were previously diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index f1a77d78b7b..9161157f597 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -455,8 +455,11 @@ typedef struct Paint { Brush **brushes; int active_brush_index, brush_count; - /* WM handle */ + /* WM Paint cursor */ void *paint_cursor; + unsigned char paint_cursor_col[4]; + + int pad; } Paint; typedef struct ImagePaintSettings { @@ -498,9 +501,6 @@ typedef struct TransformOrientation { typedef struct Sculpt { Paint paint; - - /* WM handle */ - void *cursor; /* For rotating around a pivot point */ float pivot[3]; diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index be0707390c4..fb71b297683 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -151,7 +151,7 @@ static void rna_SpaceImageEditor_paint_update(bContext *C, PointerRNA *ptr) Scene *scene= CTX_data_scene(C); if(scene) - paint_init(&scene->toolsettings->imapaint.paint, "Brush"); + paint_init(&scene->toolsettings->imapaint.paint, NULL); } static int rna_SpaceImageEditor_show_render_get(PointerRNA *ptr) diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index b717df8f61f..c400b6c9b20 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -287,6 +287,11 @@ typedef struct wmTimer { } wmTimer; +/* **************** Paint Cursor ******************* */ + +typedef void (*wmPaintCursorDraw)(struct bContext *C, int, int, void *customdata); + + /* ****************** Messages ********************* */ enum { diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 2e813bac37d..304da25017b 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1067,7 +1067,7 @@ static void WM_OT_exit_blender(wmOperatorType *ot) */ void *WM_paint_cursor_activate(wmWindowManager *wm, int (*poll)(bContext *C), - void (*draw)(bContext *C, int, int, void *customdata), void *customdata) + wmPaintCursorDraw draw, void *customdata) { wmPaintCursor *pc= MEM_callocN(sizeof(wmPaintCursor), "paint cursor"); From 210ef4c07c0f8fe602068bfc797ef8dd588a6204 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Thu, 20 Aug 2009 05:44:32 +0000 Subject: [PATCH 156/577] 2.5/Sculpt: * Fixed sculpt brush stroke exec (F4 operator) * Made a generic paint stroke exec --- .../blender/editors/sculpt_paint/paint_intern.h | 1 + .../blender/editors/sculpt_paint/paint_stroke.c | 15 +++++++++++++++ source/blender/editors/sculpt_paint/sculpt.c | 14 ++++---------- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h index c6c93026c44..a0187566c43 100644 --- a/source/blender/editors/sculpt_paint/paint_intern.h +++ b/source/blender/editors/sculpt_paint/paint_intern.h @@ -49,6 +49,7 @@ typedef void (*StrokeDone)(struct bContext *C, struct PaintStroke *stroke); struct PaintStroke *paint_stroke_new(bContext *C, StrokeTestStart test_start, StrokeUpdateStep update_step, StrokeDone done); int paint_stroke_modal(struct bContext *C, struct wmOperator *op, struct wmEvent *event); +int paint_stroke_exec(struct bContext *C, struct wmOperator *op); struct ViewContext *paint_stroke_view_context(struct PaintStroke *stroke); void *paint_stroke_mode_data(struct PaintStroke *stroke); void paint_stroke_set_mode_data(struct PaintStroke *stroke, void *mode_data); diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 1167e011c86..715399af888 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -265,6 +265,21 @@ int paint_stroke_modal(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } +int paint_stroke_exec(bContext *C, wmOperator *op) +{ + PaintStroke *stroke = op->customdata; + + RNA_BEGIN(op->ptr, itemptr, "stroke") { + stroke->update_step(C, stroke, &itemptr); + } + RNA_END; + + MEM_freeN(stroke); + op->customdata = NULL; + + return OPERATOR_FINISHED; +} + ViewContext *paint_stroke_view_context(PaintStroke *stroke) { return &stroke->vc; diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 94703dbe4ff..e0206210799 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -1410,7 +1410,7 @@ static void sculpt_stroke_update_step(bContext *C, struct PaintStroke *stroke, P do_symmetrical_brush_actions(sd, ss); /* Cleanup */ - sculpt_flush_update(C); // XXX: during exec, shouldn't do this every time + sculpt_flush_update(C); sculpt_post_stroke_free(ss); } @@ -1448,20 +1448,14 @@ static int sculpt_brush_stroke_exec(bContext *C, wmOperator *op) Sculpt *sd = CTX_data_tool_settings(C)->sculpt; SculptSession *ss = CTX_data_active_object(C)->sculpt; + op->customdata = paint_stroke_new(C, sculpt_stroke_test_start, sculpt_stroke_update_step, sculpt_stroke_done); + sculpt_brush_stroke_init(C); sculpt_update_cache_invariants(sd, ss, C, op); sculptmode_update_all_projverts(ss); - RNA_BEGIN(op->ptr, itemptr, "stroke") { - sculpt_update_cache_variants(sd, ss, &itemptr); - - sculpt_restore_mesh(sd, ss); - do_symmetrical_brush_actions(sd, ss); - - sculpt_post_stroke_free(ss); - } - RNA_END; + paint_stroke_exec(C, op); sculpt_flush_update(C); sculpt_cache_free(ss->cache); From d8cd7a22e815afd49dfb96197ed3ecd670dc8f11 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 20 Aug 2009 08:18:54 +0000 Subject: [PATCH 157/577] * a few more small cleanups --- source/blender/render/intern/include/texture.h | 1 + source/blender/render/intern/include/volumetric.h | 2 +- source/blender/render/intern/source/pointdensity.c | 4 +--- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/source/blender/render/intern/include/texture.h b/source/blender/render/intern/include/texture.h index c254b768292..78d6a912af1 100644 --- a/source/blender/render/intern/include/texture.h +++ b/source/blender/render/intern/include/texture.h @@ -56,6 +56,7 @@ void do_halo_tex(struct HaloRen *har, float xn, float yn, float *colf); void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, float *blend, int skyflag, short thread); void do_material_tex(struct ShadeInput *shi); void do_lamp_tex(LampRen *la, float *lavec, struct ShadeInput *shi, float *colf, int effect); +void do_volume_tex(struct ShadeInput *shi, float *xyz, int mapto_flag, float *col, float *val); void init_render_textures(Render *re); void end_render_textures(void); diff --git a/source/blender/render/intern/include/volumetric.h b/source/blender/render/intern/include/volumetric.h index 40d79e8d173..543e179bc88 100644 --- a/source/blender/render/intern/include/volumetric.h +++ b/source/blender/render/intern/include/volumetric.h @@ -28,7 +28,7 @@ float vol_get_stepsize(struct ShadeInput *shi, int context); float vol_get_density(struct ShadeInput *shi, float *co); -void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsize, float density); +void vol_get_scattering(ShadeInput *shi, float *scatter_col, float *co, float stepsize, float density); void shade_volume_outside(ShadeInput *shi, ShadeResult *shr); void shade_volume_inside(ShadeInput *shi, ShadeResult *shr); diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index 9a9e3de7247..fbc39b61257 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -227,10 +227,8 @@ static void cache_pointdensity(Render *re, Tex *tex) } if (pd->source == TEX_PD_PSYS) { - ParticleSystem *psys; Object *ob = pd->object; - int i; - + if (!ob) return; if (!pd->psys) return; From e75bf81ac683cccb244c4be57b81d217d9f675db Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Thu, 20 Aug 2009 08:59:09 +0000 Subject: [PATCH 158/577] Smoke: * Fix OpenGL drawing resulting (at least on windows) in missing panels when switching fullscreen + back --- .../blender/editors/space_view3d/drawvolume.c | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c index 221003360f4..1fd17951e8a 100644 --- a/source/blender/editors/space_view3d/drawvolume.c +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -203,17 +203,14 @@ void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture float *points = NULL; int numpoints = 0; float cor[3] = {1.,1.,1.}; + int gl_depth = 0, gl_blend = 0; - /* - res[0] = smd->domain->res[0]; - res[1] = smd->domain->res[1]; - res[2] = smd->domain->res[2]; - */ + glGetBooleanv(GL_BLEND, (GLboolean *)&gl_blend); + glGetBooleanv(GL_DEPTH_TEST, (GLboolean *)&gl_depth); wmLoadMatrix(rv3d->viewmat); glDepthMask(GL_FALSE); - glEnable(GL_TEXTURE_3D); glDisable(GL_DEPTH_TEST); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); @@ -296,9 +293,12 @@ void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture wmMultMatrix(ob->obmat); - glDisable(GL_TEXTURE_3D); - glDisable(GL_BLEND); - glEnable(GL_DEPTH_TEST); - glDepthMask(GL_TRUE); + if(gl_blend) + glDisable(GL_BLEND); + if(gl_depth) + { + glEnable(GL_DEPTH_TEST); + glDepthMask(GL_TRUE); + } } From bc4806579b3b8504ba09854f127d2a65f3dad405 Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Thu, 20 Aug 2009 09:00:23 +0000 Subject: [PATCH 159/577] Smoke: * Fixing my fix for opengl GL_BLEND --- source/blender/editors/space_view3d/drawvolume.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c index 1fd17951e8a..325997ebf4d 100644 --- a/source/blender/editors/space_view3d/drawvolume.c +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -293,7 +293,7 @@ void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture wmMultMatrix(ob->obmat); - if(gl_blend) + if(!gl_blend) glDisable(GL_BLEND); if(gl_depth) { From 9f764ae36dbdf571778ec6fc8823ec7e721a2baf Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Thu, 20 Aug 2009 09:13:57 +0000 Subject: [PATCH 160/577] Smoke: * Fix for OpenGL domain scaling/rotating/translating reported by Wahooney --- source/blender/editors/space_view3d/drawvolume.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c index 325997ebf4d..53f193382bd 100644 --- a/source/blender/editors/space_view3d/drawvolume.c +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -209,6 +209,7 @@ void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture glGetBooleanv(GL_DEPTH_TEST, (GLboolean *)&gl_depth); wmLoadMatrix(rv3d->viewmat); + wmMultMatrix(ob->obmat); glDepthMask(GL_FALSE); glDisable(GL_DEPTH_TEST); @@ -291,8 +292,6 @@ void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture MEM_freeN(points); - wmMultMatrix(ob->obmat); - if(!gl_blend) glDisable(GL_BLEND); if(gl_depth) From 6dbadb23ce26967608710412e9e74396e624c597 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Thu, 20 Aug 2009 09:18:55 +0000 Subject: [PATCH 161/577] update MSVC project files. --- extern/lzma/make/msvc_9_0/lzma.vcproj | 385 ++++++++++++++++++ extern/lzo/make/msvc_9_0/lzo.vcproj | 353 ++++++++++++++++ intern/audaspace/jack/AUD_JackDevice.cpp | 4 + intern/audaspace/jack/AUD_JackDevice.h | 4 + .../audaspace/make/msvc_9_0/audaspace.vcproj | 19 + intern/ghost/intern/GHOST_System.cpp | 4 +- projectfiles_vc9/blender/blender.sln | 53 +++ .../blender/blenkernel/BKE_blenkernel.vcproj | 24 +- .../blender/editors/ED_editors.vcproj | 36 +- 9 files changed, 870 insertions(+), 12 deletions(-) create mode 100644 extern/lzma/make/msvc_9_0/lzma.vcproj create mode 100644 extern/lzo/make/msvc_9_0/lzo.vcproj diff --git a/extern/lzma/make/msvc_9_0/lzma.vcproj b/extern/lzma/make/msvc_9_0/lzma.vcproj new file mode 100644 index 00000000000..ec0676f6ca6 --- /dev/null +++ b/extern/lzma/make/msvc_9_0/lzma.vcproj @@ -0,0 +1,385 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extern/lzo/make/msvc_9_0/lzo.vcproj b/extern/lzo/make/msvc_9_0/lzo.vcproj new file mode 100644 index 00000000000..80516ef964e --- /dev/null +++ b/extern/lzo/make/msvc_9_0/lzo.vcproj @@ -0,0 +1,353 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/intern/audaspace/jack/AUD_JackDevice.cpp b/intern/audaspace/jack/AUD_JackDevice.cpp index 445e68e1a9a..1f2c6faa511 100644 --- a/intern/audaspace/jack/AUD_JackDevice.cpp +++ b/intern/audaspace/jack/AUD_JackDevice.cpp @@ -31,6 +31,8 @@ #include #include +#ifdef WITH_JACK + // AUD_XXX this is not realtime suitable! int AUD_JackDevice::jack_mix(jack_nframes_t length, void *data) { @@ -147,3 +149,5 @@ void AUD_JackDevice::playing(bool playing) { // Do nothing. } + +#endif diff --git a/intern/audaspace/jack/AUD_JackDevice.h b/intern/audaspace/jack/AUD_JackDevice.h index 0b09e20b354..e6d332e1160 100644 --- a/intern/audaspace/jack/AUD_JackDevice.h +++ b/intern/audaspace/jack/AUD_JackDevice.h @@ -26,6 +26,8 @@ #ifndef AUD_JACKDEVICE #define AUD_JACKDEVICE +#ifdef WITH_JACK + #include "AUD_SoftwareDevice.h" class AUD_Buffer; @@ -88,4 +90,6 @@ public: virtual ~AUD_JackDevice(); }; +#endif //WITH_JACK + #endif //AUD_JACKDEVICE diff --git a/intern/audaspace/make/msvc_9_0/audaspace.vcproj b/intern/audaspace/make/msvc_9_0/audaspace.vcproj index 2bb97502c4e..a4d775a415c 100644 --- a/intern/audaspace/make/msvc_9_0/audaspace.vcproj +++ b/intern/audaspace/make/msvc_9_0/audaspace.vcproj @@ -717,6 +717,25 @@ > + + + + + + + + + diff --git a/intern/ghost/intern/GHOST_System.cpp b/intern/ghost/intern/GHOST_System.cpp index 603452cfcbd..229744e2000 100644 --- a/intern/ghost/intern/GHOST_System.cpp +++ b/intern/ghost/intern/GHOST_System.cpp @@ -289,9 +289,9 @@ GHOST_TSuccess GHOST_System::init() #endif #ifdef GHOST_DEBUG - m_eventPrinter = new GHOST_EventPrinter(); if (m_eventManager) { - m_eventManager->addConsumer(m_eventPrinter); + m_eventPrinter = new GHOST_EventPrinter(); + //m_eventManager->addConsumer(m_eventPrinter); } #endif // GHOST_DEBUG diff --git a/projectfiles_vc9/blender/blender.sln b/projectfiles_vc9/blender/blender.sln index 602105dc501..1bd132ea223 100644 --- a/projectfiles_vc9/blender/blender.sln +++ b/projectfiles_vc9/blender/blender.sln @@ -10,6 +10,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blender", "blender.vcproj", {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8} = {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8} {D1A9312F-4557-4982-A0F4-4D08508235F4} = {D1A9312F-4557-4982-A0F4-4D08508235F4} {884D8731-654C-4C7F-9A75-8F37A305BE1E} = {884D8731-654C-4C7F-9A75-8F37A305BE1E} + {79D0B232-208C-F208-DA71-79B4AC088602} = {79D0B232-208C-F208-DA71-79B4AC088602} {E645CC32-4823-463E-82F0-46ADDE664018} = {E645CC32-4823-463E-82F0-46ADDE664018} {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284} = {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284} {51FB3D48-2467-4BFA-A321-D848252B437E} = {51FB3D48-2467-4BFA-A321-D848252B437E} @@ -24,6 +25,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blender", "blender.vcproj", {415BFD6E-64CF-422B-AF88-C07F040A7292} = {415BFD6E-64CF-422B-AF88-C07F040A7292} {106AE171-0083-41D6-A949-20DB0E8DC251} = {106AE171-0083-41D6-A949-20DB0E8DC251} {670EC17A-0548-4BBF-A27B-636C7C188139} = {670EC17A-0548-4BBF-A27B-636C7C188139} + {8BFA4082-773B-D100-BC24-659083BA023F} = {8BFA4082-773B-D100-BC24-659083BA023F} {4C3AB78A-52CA-4276-A041-39776E52D8C8} = {4C3AB78A-52CA-4276-A041-39776E52D8C8} {6B801390-5F95-4F07-81A7-97FBA046AACC} = {6B801390-5F95-4F07-81A7-97FBA046AACC} {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94} = {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94} @@ -84,6 +86,7 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DNA_makesdna", "makesdna\DNA_makesdna.vcproj", "{E013786A-9575-4F34-81B2-33290357EE87}" ProjectSection(ProjectDependencies) = postProject {31628053-825D-4C06-8A21-D13883489718} = {31628053-825D-4C06-8A21-D13883489718} + {1CC733F1-6AB5-4904-8F63-C08C46B79DD9} = {1CC733F1-6AB5-4904-8F63-C08C46B79DD9} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EXP_expressions", "..\gameengine\expression\EXP_expressions.vcproj", "{EADC3C5A-6C51-4F03-8038-1553E7D7F740}" @@ -220,7 +223,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EXT_glew", "..\..\extern\gl EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EXT_build_install_all", "..\..\extern\make\msvc_9_0\build_install_all.vcproj", "{9C71A793-C177-4CAB-8EC5-923D500B39F8}" ProjectSection(ProjectDependencies) = postProject + {79D0B232-208C-F208-DA71-79B4AC088602} = {79D0B232-208C-F208-DA71-79B4AC088602} {FFD3C64A-30E2-4BC7-BC8F-51818C320400} = {FFD3C64A-30E2-4BC7-BC8F-51818C320400} + {8BFA4082-773B-D100-BC24-659083BA023F} = {8BFA4082-773B-D100-BC24-659083BA023F} + {BAC615B0-F1AF-418B-8D23-A10FD8870D6A} = {BAC615B0-F1AF-418B-8D23-A10FD8870D6A} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_boolop", "..\..\intern\boolop\make\msvc_9_0\boolop.vcproj", "{EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}" @@ -242,6 +248,9 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_elbeem", "..\..\intern\elbeem\make\msvc_9_0\elbeem.vcproj", "{A90C4918-4B21-4277-93BD-AF65F30951D9}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_ghost", "..\..\intern\ghost\make\msvc_9_0\ghost.vcproj", "{76D90B92-ECC7-409C-9F98-A8814B90F3C0}" + ProjectSection(ProjectDependencies) = postProject + {B789C2F3-279E-4A85-8F0A-7F7AC068E598} = {B789C2F3-279E-4A85-8F0A-7F7AC068E598} + EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_guardedalloc", "..\..\intern\guardedalloc\make\msvc_9_0\guardedalloc.vcproj", "{1CC733F1-6AB5-4904-8F63-C08C46B79DD9}" EndProject @@ -301,6 +310,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_smoke", "..\..\intern\s EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_audaspace", "..\..\intern\audaspace\make\msvc_9_0\audaspace.vcproj", "{87032FD2-9BA0-6B43-BE33-8902BA8F9172}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EXT_lzma", "..\..\extern\lzma\make\msvc_9_0\lzma.vcproj", "{79D0B232-208C-F208-DA71-79B4AC088602}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EXT_lzo", "..\..\extern\lzo\make\msvc_9_0\lzo.vcproj", "{8BFA4082-773B-D100-BC24-659083BA023F}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution 3D Plugin Debug|Win32 = 3D Plugin Debug|Win32 @@ -1443,6 +1456,46 @@ Global {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32 {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32 {87032FD2-9BA0-6B43-BE33-8902BA8F9172}.Release|Win32.Build.0 = 3DPlugin Release|Win32 + {79D0B232-208C-F208-DA71-79B4AC088602}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32 + {79D0B232-208C-F208-DA71-79B4AC088602}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32 + {79D0B232-208C-F208-DA71-79B4AC088602}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32 + {79D0B232-208C-F208-DA71-79B4AC088602}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32 + {79D0B232-208C-F208-DA71-79B4AC088602}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Release|Win32 + {79D0B232-208C-F208-DA71-79B4AC088602}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Release|Win32 + {79D0B232-208C-F208-DA71-79B4AC088602}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32 + {79D0B232-208C-F208-DA71-79B4AC088602}.3DPlugin Release|Win32.Build.0 = 3D Plugin Release|Win32 + {79D0B232-208C-F208-DA71-79B4AC088602}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32 + {79D0B232-208C-F208-DA71-79B4AC088602}.Blender Debug|Win32.Build.0 = Blender Debug|Win32 + {79D0B232-208C-F208-DA71-79B4AC088602}.Blender Release|Win32.ActiveCfg = Blender Release|Win32 + {79D0B232-208C-F208-DA71-79B4AC088602}.Blender Release|Win32.Build.0 = Blender Release|Win32 + {79D0B232-208C-F208-DA71-79B4AC088602}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Release|Win32 + {79D0B232-208C-F208-DA71-79B4AC088602}.BlenderPlayer Debug|Win32.Build.0 = Blender Release|Win32 + {79D0B232-208C-F208-DA71-79B4AC088602}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32 + {79D0B232-208C-F208-DA71-79B4AC088602}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32 + {79D0B232-208C-F208-DA71-79B4AC088602}.Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32 + {79D0B232-208C-F208-DA71-79B4AC088602}.Debug|Win32.Build.0 = 3D Plugin Debug|Win32 + {79D0B232-208C-F208-DA71-79B4AC088602}.Release|Win32.ActiveCfg = 3D Plugin Release|Win32 + {79D0B232-208C-F208-DA71-79B4AC088602}.Release|Win32.Build.0 = 3D Plugin Release|Win32 + {8BFA4082-773B-D100-BC24-659083BA023F}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32 + {8BFA4082-773B-D100-BC24-659083BA023F}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32 + {8BFA4082-773B-D100-BC24-659083BA023F}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32 + {8BFA4082-773B-D100-BC24-659083BA023F}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32 + {8BFA4082-773B-D100-BC24-659083BA023F}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Release|Win32 + {8BFA4082-773B-D100-BC24-659083BA023F}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Release|Win32 + {8BFA4082-773B-D100-BC24-659083BA023F}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32 + {8BFA4082-773B-D100-BC24-659083BA023F}.3DPlugin Release|Win32.Build.0 = 3D Plugin Release|Win32 + {8BFA4082-773B-D100-BC24-659083BA023F}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32 + {8BFA4082-773B-D100-BC24-659083BA023F}.Blender Debug|Win32.Build.0 = Blender Debug|Win32 + {8BFA4082-773B-D100-BC24-659083BA023F}.Blender Release|Win32.ActiveCfg = Blender Release|Win32 + {8BFA4082-773B-D100-BC24-659083BA023F}.Blender Release|Win32.Build.0 = Blender Release|Win32 + {8BFA4082-773B-D100-BC24-659083BA023F}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Release|Win32 + {8BFA4082-773B-D100-BC24-659083BA023F}.BlenderPlayer Debug|Win32.Build.0 = Blender Release|Win32 + {8BFA4082-773B-D100-BC24-659083BA023F}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32 + {8BFA4082-773B-D100-BC24-659083BA023F}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32 + {8BFA4082-773B-D100-BC24-659083BA023F}.Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32 + {8BFA4082-773B-D100-BC24-659083BA023F}.Debug|Win32.Build.0 = 3D Plugin Debug|Win32 + {8BFA4082-773B-D100-BC24-659083BA023F}.Release|Win32.ActiveCfg = 3D Plugin Release|Win32 + {8BFA4082-773B-D100-BC24-659083BA023F}.Release|Win32.Build.0 = 3D Plugin Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj b/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj index 7ba3aac65f0..7f0867cc7b6 100644 --- a/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj +++ b/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj @@ -43,7 +43,7 @@ + + @@ -757,6 +761,10 @@ RelativePath="..\..\..\source\blender\blenkernel\intern\smoke.c" > + + @@ -1018,6 +1026,10 @@ RelativePath="..\..\..\source\blender\blenkernel\BKE_packedFile.h" > + + diff --git a/projectfiles_vc9/blender/editors/ED_editors.vcproj b/projectfiles_vc9/blender/editors/ED_editors.vcproj index 174ceb5ca99..0482fa9067a 100644 --- a/projectfiles_vc9/blender/editors/ED_editors.vcproj +++ b/projectfiles_vc9/blender/editors/ED_editors.vcproj @@ -217,6 +217,10 @@ RelativePath="..\..\..\source\blender\editors\include\ED_image.h" > + + @@ -458,6 +462,10 @@ RelativePath="..\..\..\source\blender\editors\space_view3d\drawobject.c" > + + @@ -510,10 +518,6 @@ RelativePath="..\..\..\source\blender\editors\space_time\space_time.c" > - - @@ -806,6 +810,10 @@ RelativePath="..\..\..\source\blender\editors\space_info\info_ops.c" > + + @@ -1274,6 +1282,10 @@ RelativePath="..\..\..\source\blender\editors\sculpt_paint\paint_ops.c" > + + @@ -1467,6 +1479,22 @@ > + + + + + + + + From 1e0bd0752244961366ae0f5416c8c0cc57556e7c Mon Sep 17 00:00:00 2001 From: William Reynish Date: Thu, 20 Aug 2009 11:38:09 +0000 Subject: [PATCH 162/577] Swapped some icons in the node editor. The Render Layers menu was using wrong icon, for example. --- release/ui/space_node.py | 10 +++++----- source/blender/editors/space_node/drawnode.c | 6 +++--- source/blender/makesrna/intern/rna_space.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/release/ui/space_node.py b/release/ui/space_node.py index 2e28cfc2eed..fd5dd9e6ee7 100644 --- a/release/ui/space_node.py +++ b/release/ui/space_node.py @@ -27,7 +27,7 @@ class NODE_HT_header(bpy.types.Header): if ob: layout.template_ID(ob, "active_material", new="material.new") if id: - layout.itemR(id, "use_nodes", toggle=True) + layout.itemR(id, "use_nodes") elif snode.tree_type == 'TEXTURE': row.itemR(snode, "texture_type", text="", expand=True) @@ -37,14 +37,14 @@ class NODE_HT_header(bpy.types.Header): if id_from: layout.template_ID(id_from, "active_texture", new="texture.new") if id: - layout.itemR(id, "use_nodes", toggle=True) + layout.itemR(id, "use_nodes") elif snode.tree_type == 'COMPOSITING': id = snode.id - layout.itemR(id, "use_nodes", toggle=True) - layout.itemR(id.render_data, "free_unused_nodes", text="Free Unused", toggle=True) - layout.itemR(snode, "backdrop", toggle=True) + layout.itemR(id, "use_nodes") + layout.itemR(id.render_data, "free_unused_nodes", text="Free Unused") + layout.itemR(snode, "backdrop") class NODE_MT_view(bpy.types.Menu): __space_type__ = "NODE_EDITOR" diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 50cf193f37b..1fb8cb3452b 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -253,7 +253,7 @@ static int node_buts_mix_rgb(uiBlock *block, bNodeTree *ntree, bNode *node, rctf uiButSetFunc(bt, node_but_title_cb, node, bt); /* Alpha option, composite */ if(a_but) - uiDefButS(block, TOG, B_NODE_EXEC, "A", + uiDefIconButS(block, TOG, B_NODE_EXEC, ICON_IMAGE_RGB_ALPHA, (short)butr->xmax-20, (short)butr->ymin, 20, 20, &node->custom2, 0, 0, 0, 0, "Include Alpha of 2nd input in this operation"); } @@ -1077,7 +1077,7 @@ static int node_composit_buts_renderlayers(uiBlock *block, bNodeTree *ntree, bNo /* browse button layer */ strp= scene_layer_menu(node->id?(Scene *)node->id:scene); if(node->id) - bt= uiDefIconTextButS(block, MENU, B_NODE_EXEC, ICON_SCENE_DATA, strp, + bt= uiDefIconTextButS(block, MENU, B_NODE_EXEC, ICON_RENDERLAYERS, strp, butr->xmin+20, butr->ymin, (butr->xmax-butr->xmin)-40, 19, &node->custom1, 0, 0, 0, 0, "Choose Render Layer"); else @@ -1473,7 +1473,7 @@ static int node_composit_buts_vecblur(uiBlock *block, bNodeTree *ntree, bNode *n uiDefButS(block, NUM, B_NODE_EXEC, "MaxSpeed:", butr->xmin, dy+38, dx, 19, &nbd->maxspeed, 0, 1024, 0, 0, "If not zero, maximum speed in pixels"); - uiDefButF(block, NUM, B_NODE_EXEC, "BlurFac:", + uiDefButF(block, NUM, B_NODE_EXEC, "Blur:", butr->xmin, dy+19, dx, 19, &nbd->fac, 0.0f, 2.0f, 10, 2, "Scaling factor for motion vectors, actually 'shutter speed' in frames"); uiDefButS(block, TOG, B_NODE_EXEC, "Curved", diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index fb71b297683..d220c707143 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1409,7 +1409,7 @@ static void rna_def_space_node(BlenderRNA *brna) static EnumPropertyItem tree_type_items[] = { {NTREE_SHADER, "MATERIAL", ICON_MATERIAL, "Material", "Material nodes."}, {NTREE_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture nodes."}, - {NTREE_COMPOSIT, "COMPOSITING", ICON_RENDER_RESULT, "Compositing", "Compositing nodes."}, + {NTREE_COMPOSIT, "COMPOSITING", ICON_RENDERLAYERS, "Compositing", "Compositing nodes."}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem texture_type_items[] = { From 8df1d6d13af4509fbf1378e26e400c282c8a0fde Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 20 Aug 2009 13:45:04 +0000 Subject: [PATCH 163/577] * cleaning and simplification --- release/ui/buttons_material.py | 5 +- .../blender/render/intern/source/volumetric.c | 101 +++++++----------- 2 files changed, 44 insertions(+), 62 deletions(-) diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py index ca84cc88853..67ba4d326ba 100644 --- a/release/ui/buttons_material.py +++ b/release/ui/buttons_material.py @@ -73,6 +73,9 @@ class MATERIAL_PT_shading(MaterialButtonsPanel): __label__ = "Shading" COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME']) + def poll(self, context): + return (context.material.type in ('SURFACE', 'WIRE', 'HALO')) + def draw(self, context): layout = self.layout @@ -83,7 +86,7 @@ class MATERIAL_PT_shading(MaterialButtonsPanel): if mat: - if mat.type in ['SURFACE', 'WIRE']: + if mat.type in ('SURFACE', 'WIRE'): split = layout.split() col = split.column() diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 8a714aef992..7943d9ae526 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -52,6 +52,7 @@ #include "shading.h" #include "texture.h" #include "volumetric.h" +#include "volume_precache.h" #if defined( _MSC_VER ) && !defined( __cplusplus ) # define inline __inline @@ -68,7 +69,6 @@ extern struct Render R; static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, Isect *isect, int intersect_type) { float maxsize = RE_ray_tree_max_size(R.raytree); - int intersected=0; /* TODO: use object's bounding box to calculate max size */ VECCOPY(isect->start, co); @@ -85,17 +85,11 @@ static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, if (intersect_type == VOL_BOUNDS_DEPTH) isect->faceorig= (RayFace*)shi->vlr; else if (intersect_type == VOL_BOUNDS_SS) isect->faceorig= NULL; - intersected = RE_ray_tree_intersect(R.raytree, isect); - - if(intersected) + if(RE_ray_tree_intersect(R.raytree, isect)) { - float isvec[3]; - - VECCOPY(isvec, isect->vec); - hitco[0] = isect->start[0] + isect->labda*isvec[0]; - hitco[1] = isect->start[1] + isect->labda*isvec[1]; - hitco[2] = isect->start[2] + isect->labda*isvec[2]; - + hitco[0] = isect->start[0] + isect->labda*isect->vec[0]; + hitco[1] = isect->start[1] + isect->labda*isect->vec[1]; + hitco[2] = isect->start[2] + isect->labda*isect->vec[2]; return 1; } else { return 0; @@ -237,26 +231,31 @@ float vol_get_phasefunc(ShadeInput *shi, short phasefunc_type, float g, float *w /* Compute attenuation, otherwise known as 'optical thickness', extinction, or tau. * Used in the relationship Transmittance = e^(-attenuation) */ -void vol_get_attenuation_seg(ShadeInput *shi, float *tau, float *stepvec, float *co, float density) +void vol_get_attenuation_seg(ShadeInput *shi, float *transmission, float stepsize, float *co, float density) { /* input density = density at co */ + float tau[3] = {0.f, 0.f, 0.f}; float absorb_col[3]; - const float dist = VecLength(stepvec); - + vol_get_absorption(shi, absorb_col, co); /* homogenous volume within the sampled distance */ - tau[0] = tau[1] = tau[2] = dist * density; - - VecMulVecf(tau, tau, absorb_col); + tau[0] = stepsize * density * absorb_col[0]; + tau[1] = stepsize * density * absorb_col[1]; + tau[2] = stepsize * density * absorb_col[2]; + + transmission[0] *= exp(-tau[0]); + transmission[1] *= exp(-tau[1]); + transmission[2] *= exp(-tau[2]); } /* Compute attenuation, otherwise known as 'optical thickness', extinction, or tau. * Used in the relationship Transmittance = e^(-attenuation) */ -void vol_get_attenuation(ShadeInput *shi, float *tau, float *co, float *endco, float density, float stepsize) +void vol_get_attenuation(ShadeInput *shi, float *transmission, float *co, float *endco, float density, float stepsize) { /* input density = density at co */ + float tau[3] = {0.f, 0.f, 0.f}; float absorb_col[3]; int s, nsteps; float step_vec[3], step_sta[3], step_end[3]; @@ -266,8 +265,6 @@ void vol_get_attenuation(ShadeInput *shi, float *tau, float *co, float *endco, f nsteps = (int)((dist / stepsize) + 0.5); - tau[0] = tau[1] = tau[2] = 0.0; - VecSubf(step_vec, endco, co); VecMulf(step_vec, 1.0f / nsteps); @@ -288,12 +285,16 @@ void vol_get_attenuation(ShadeInput *shi, float *tau, float *co, float *endco, f } } VecMulVecf(tau, tau, absorb_col); + + transmission[0] *= exp(-tau[0]); + transmission[1] *= exp(-tau[1]); + transmission[2] *= exp(-tau[2]); } void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float *lacol, float stepsize, float density) { float visifac, lv[3], lampdist; - float tau[3], tr[3]={1.0,1.0,1.0}; + float tr[3]={1.0,1.0,1.0}; float hitco[3], *atten_co; float p; float scatter_fac; @@ -303,12 +304,9 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * if ((lar->lay & shi->lay)==0) return; if (lar->energy == 0.0) return; - visifac= lamp_get_visibility(lar, co, lv, &lampdist); - if(visifac==0.0f) return; - - lacol[0] = lar->r; - lacol[1] = lar->g; - lacol[2] = lar->b; + if ((visifac= lamp_get_visibility(lar, co, lv, &lampdist)) == 0.f) return; + + VecCopyf(lacol, &lar->r); if(lar->mode & LA_TEXTURE) { shi->osatex= 0; @@ -345,10 +343,7 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * } else atten_co = hitco; - vol_get_attenuation(shi, tau, co, atten_co, density, shade_stepsize); - tr[0] = exp(-tau[0]); - tr[1] = exp(-tau[1]); - tr[2] = exp(-tau[2]); + vol_get_attenuation(shi, tr, co, atten_co, density, shade_stepsize); VecMulVecf(lacol, lacol, tr); } @@ -364,12 +359,13 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * } /* single scattering only for now */ -void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsize, float density) +void vol_get_scattering(ShadeInput *shi, float *scatter_col, float *co, float stepsize, float density) { ListBase *lights; GroupObject *go; LampRen *lar; - float col[3] = {0.f, 0.f, 0.f}; + + scatter_col[0] = scatter_col[1] = scatter_col[2] = 0.f; lights= get_lights(shi); for(go=lights->first; go; go= go->next) @@ -379,11 +375,9 @@ void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float stepsi if (lar) { vol_shade_one_lamp(shi, co, lar, lacol, stepsize, density); - VecAddf(col, col, lacol); + VecAddf(scatter_col, scatter_col, lacol); } } - - VECCOPY(scatter, col); } @@ -408,10 +402,10 @@ outgoing radiance from behind surface * beam transmittance/attenuation static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float *endco) { float tr[3] = {1.0f, 1.0f, 1.0f}; - float radiance[3] = {0.f, 0.f, 0.f}, d_radiance[3] = {0.f, 0.f, 0.f}, radiance_behind[3]; + float radiance[3] = {0.f, 0.f, 0.f}, d_radiance[3] = {0.f, 0.f, 0.f}; float stepsize = vol_get_stepsize(shi, STEPSIZE_VIEW); int nsteps, s; - float tau[3], emit_col[3], scatter_col[3] = {0.0, 0.0, 0.0}; + float emit_col[3], scatter_col[3] = {0.0, 0.0, 0.0}; float stepvec[3], step_sta[3], step_end[3], step_mid[3]; float density; const float depth_cutoff = shi->mat->vol.depth_cutoff; @@ -433,11 +427,8 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float if (density > 0.01f) { /* transmittance component (alpha) */ - vol_get_attenuation_seg(shi, tau, stepvec, co, density); - tr[0] *= exp(-tau[0]); - tr[1] *= exp(-tau[1]); - tr[2] *= exp(-tau[2]); - + vol_get_attenuation_seg(shi, tr, stepsize, co, density); + step_mid[0] = step_sta[0] + (stepvec[0] * 0.5); step_mid[1] = step_sta[1] + (stepvec[1] * 0.5); step_mid[2] = step_sta[2] + (stepvec[2] * 0.5); @@ -449,7 +440,7 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float vol_get_precached_scattering(shi, scatter_col, step_mid); } else vol_get_scattering(shi, scatter_col, step_mid, stepsize, density); - + VecMulf(scatter_col, density); VecAddf(d_radiance, emit_col, scatter_col); @@ -468,10 +459,10 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float } /* multiply original color (behind volume) with beam transmittance over entire distance */ - VecMulVecf(radiance_behind, tr, col); - VecAddf(radiance, radiance, radiance_behind); + VecMulVecf(col, tr, col); + VecAddf(col, col, radiance); - VecCopyf(col, radiance); + /* alpha - transmission */ col[3] = 1.0f -(tr[0] + tr[1] + tr[2]) * 0.333f; } @@ -633,11 +624,7 @@ void shade_volume_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct * then we're inside the volume already. */ if (shi->flippednor) { - vol_get_attenuation(shi, tau, last_is->start, shi->co, -1.0f, shade_stepsize); - tr[0] = exp(-tau[0]); - tr[1] = exp(-tau[1]); - tr[2] = exp(-tau[2]); - + vol_get_attenuation(shi, tr, last_is->start, shi->co, -1.0f, shade_stepsize); VecCopyf(shr->combined, tr); @@ -648,10 +635,7 @@ void shade_volume_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct /* (ray intersect ignores front faces here) */ else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH)) { - vol_get_attenuation(shi, tau, shi->co, hitco, -1.0f, shade_stepsize); - tr[0] = exp(-tau[0]); - tr[1] = exp(-tau[1]); - tr[2] = exp(-tau[2]); + vol_get_attenuation(shi, tr, shi->co, hitco, -1.0f, shade_stepsize); VecCopyf(shr->combined, tr); @@ -685,11 +669,6 @@ void shade_volume_inside(ShadeInput *shi, ShadeResult *shr) if (BLI_countlist(&R.render_volumes_inside) == 0) return; mat_backup = shi->mat; - -// for (m=R.render_volumes_inside.first; m; m=m->next) { -// printf("matinside: ma: %s \n", m->ma->id.name+2); -// } - m = R.render_volumes_inside.first; shi->mat = m->ma; From a54af8e3baa8b3b3698f4196f61a0b5453df6954 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Thu, 20 Aug 2009 15:25:12 +0000 Subject: [PATCH 164/577] 2.5 weight paint: * Refactored weight paint to use the new stroke code, now does smooth stroke and stroke spacing. Note: weight paint is failing to free it's MocNodes in 2.5, someone might want to look into that --- release/ui/space_view3d_toolbar.py | 4 +- .../editors/sculpt_paint/paint_vertex.c | 406 +++++++++--------- 2 files changed, 203 insertions(+), 207 deletions(-) diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py index 5d882866e96..5f42ff1d8b8 100644 --- a/release/ui/space_view3d_toolbar.py +++ b/release/ui/space_view3d_toolbar.py @@ -429,7 +429,9 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel): def poll(self, context): settings = self.paint_settings(context) - return (settings and settings.brush and (context.sculpt_object or context.vertex_paint_object)) + return (settings and settings.brush and (context.sculpt_object or + context.vertex_paint_object or + context.weight_paint_object)) def draw(self, context): settings = self.paint_settings(context) diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 19f0293c1b8..0d8213b28d6 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1273,207 +1273,10 @@ struct WPaintData { float wpimat[3][3]; }; -static void wpaint_exit(bContext *C, wmOperator *op) -{ - ToolSettings *ts= CTX_data_tool_settings(C); - Object *ob= CTX_data_active_object(C); - struct WPaintData *wpd= op->customdata; - - if(wpd->vertexcosnos) - MEM_freeN(wpd->vertexcosnos); - MEM_freeN(wpd->indexar); - - /* frees prev buffer */ - copy_wpaint_prev(ts->wpaint, NULL, 0); - - /* and particles too */ - if(ob->particlesystem.first) { - ParticleSystem *psys; - int i; - - for(psys= ob->particlesystem.first; psys; psys= psys->next) { - for(i=0; ivgroup[i]==ob->actdef) { - psys->recalc |= PSYS_RECALC_RESET; - break; - } - } - } - } - - DAG_object_flush_update(CTX_data_scene(C), ob, OB_RECALC_DATA); - - MEM_freeN(wpd); - op->customdata= NULL; -} - - -static int wpaint_modal(bContext *C, wmOperator *op, wmEvent *event) -{ - ToolSettings *ts= CTX_data_tool_settings(C); - VPaint *wp= ts->wpaint; - Brush *brush = paint_brush(&wp->paint); - - switch(event->type) { - case LEFTMOUSE: - if(event->val==0) { /* release */ - wpaint_exit(C, op); - return OPERATOR_FINISHED; - } - /* pass on, first press gets painted too */ - - case MOUSEMOVE: - { - struct WPaintData *wpd= op->customdata; - ViewContext *vc= &wpd->vc; - Object *ob= vc->obact; - Mesh *me= ob->data; - float mat[4][4]; - float paintweight= ts->vgroup_weight; - int *indexar= wpd->indexar; - int totindex, index, alpha, totw; - float mval[2]; - - view3d_operator_needs_opengl(C); - - /* load projection matrix */ - wmMultMatrix(ob->obmat); - wmGetSingleMatrix(mat); - wmLoadMatrix(wpd->vc.rv3d->viewmat); - - MTC_Mat4SwapMat4(wpd->vc.rv3d->persmat, mat); - - mval[0]= event->x - vc->ar->winrct.xmin; - mval[1]= event->y - vc->ar->winrct.ymin; - - /* which faces are involved */ - if(wp->flag & VP_AREA) { - totindex= sample_backbuf_area(vc, indexar, me->totface, mval[0], mval[1], brush->size); - } - else { - indexar[0]= view3d_sample_backbuf(vc, mval[0], mval[1]); - if(indexar[0]) totindex= 1; - else totindex= 0; - } - - if(wp->flag & VP_COLINDEX) { - for(index=0; indextotface) { - MFace *mface= ((MFace *)me->mface) + (indexar[index]-1); - - if(mface->mat_nr!=ob->actcol-1) { - indexar[index]= 0; - } - } - } - } - - if((G.f & G_FACESELECT) && me->mface) { - for(index=0; indextotface) { - MFace *mface= ((MFace *)me->mface) + (indexar[index]-1); - - if((mface->flag & ME_FACE_SEL)==0) { - indexar[index]= 0; - } - } - } - } - - /* make sure each vertex gets treated only once */ - /* and calculate filter weight */ - totw= 0; - if(wp->mode==VP_BLUR) - paintweight= 0.0f; - else - paintweight= ts->vgroup_weight; - - for(index=0; indextotface) { - MFace *mface= me->mface + (indexar[index]-1); - - (me->dvert+mface->v1)->flag= 1; - (me->dvert+mface->v2)->flag= 1; - (me->dvert+mface->v3)->flag= 1; - if(mface->v4) (me->dvert+mface->v4)->flag= 1; - - if(wp->mode==VP_BLUR) { - MDeformWeight *dw, *(*dw_func)(MDeformVert *, int) = verify_defweight; - - if(wp->flag & VP_ONLYVGROUP) - dw_func= get_defweight; - - dw= dw_func(me->dvert+mface->v1, ob->actdef-1); - if(dw) {paintweight+= dw->weight; totw++;} - dw= dw_func(me->dvert+mface->v2, ob->actdef-1); - if(dw) {paintweight+= dw->weight; totw++;} - dw= dw_func(me->dvert+mface->v3, ob->actdef-1); - if(dw) {paintweight+= dw->weight; totw++;} - if(mface->v4) { - dw= dw_func(me->dvert+mface->v4, ob->actdef-1); - if(dw) {paintweight+= dw->weight; totw++;} - } - } - } - } - - if(wp->mode==VP_BLUR) - paintweight/= (float)totw; - - for(index=0; indextotface) { - MFace *mface= me->mface + (indexar[index]-1); - - if((me->dvert+mface->v1)->flag) { - alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v1, mval); - if(alpha) { - do_weight_paint_vertex(wp, ob, mface->v1, alpha, paintweight, wpd->vgroup_mirror); - } - (me->dvert+mface->v1)->flag= 0; - } - - if((me->dvert+mface->v2)->flag) { - alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v2, mval); - if(alpha) { - do_weight_paint_vertex(wp, ob, mface->v2, alpha, paintweight, wpd->vgroup_mirror); - } - (me->dvert+mface->v2)->flag= 0; - } - - if((me->dvert+mface->v3)->flag) { - alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v3, mval); - if(alpha) { - do_weight_paint_vertex(wp, ob, mface->v3, alpha, paintweight, wpd->vgroup_mirror); - } - (me->dvert+mface->v3)->flag= 0; - } - - if((me->dvert+mface->v4)->flag) { - if(mface->v4) { - alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v4, mval); - if(alpha) { - do_weight_paint_vertex(wp, ob, mface->v4, alpha, paintweight, wpd->vgroup_mirror); - } - (me->dvert+mface->v4)->flag= 0; - } - } - } - } - - MTC_Mat4SwapMat4(vc->rv3d->persmat, mat); - - DAG_object_flush_update(vc->scene, ob, OB_RECALC_DATA); - ED_region_tag_redraw(vc->ar); - } - } - - return OPERATOR_RUNNING_MODAL; -} - -static int wpaint_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *event) { Scene *scene= CTX_data_scene(C); + struct PaintStroke *stroke = op->customdata; ToolSettings *ts= CTX_data_tool_settings(C); VPaint *wp= ts->wpaint; Object *ob= CTX_data_active_object(C); @@ -1482,7 +1285,6 @@ static int wpaint_invoke(bContext *C, wmOperator *op, wmEvent *event) float mat[4][4], imat[4][4]; if(scene->obedit) return OPERATOR_CANCELLED; - // XXX if(multires_level1_test()) return; me= get_mesh(ob); if(me==NULL || me->totface==0) return OPERATOR_PASS_THROUGH; @@ -1491,8 +1293,9 @@ static int wpaint_invoke(bContext *C, wmOperator *op, wmEvent *event) if (!me->dvert) create_dverts(&me->id); - /* make customdata storage */ - op->customdata= wpd= MEM_callocN(sizeof(struct WPaintData), "WPaintData"); + /* make mode data storage */ + wpd= MEM_callocN(sizeof(struct WPaintData), "WPaintData"); + paint_stroke_set_mode_data(stroke, wpd); view3d_set_viewcontext(C, &wpd->vc); wpd->vgroup_mirror= -1; @@ -1564,8 +1367,198 @@ static int wpaint_invoke(bContext *C, wmOperator *op, wmEvent *event) } } - /* do paint once for click only paint */ - wpaint_modal(C, op, event); + return 1; +} + +static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, PointerRNA *itemptr) +{ + ToolSettings *ts= CTX_data_tool_settings(C); + VPaint *wp= ts->wpaint; + Brush *brush = paint_brush(&wp->paint); + struct WPaintData *wpd= paint_stroke_mode_data(stroke); + ViewContext *vc= &wpd->vc; + Object *ob= vc->obact; + Mesh *me= ob->data; + float mat[4][4]; + float paintweight= ts->vgroup_weight; + int *indexar= wpd->indexar; + int totindex, index, alpha, totw; + float mval[2]; + + view3d_operator_needs_opengl(C); + + /* load projection matrix */ + wmMultMatrix(ob->obmat); + wmGetSingleMatrix(mat); + wmLoadMatrix(wpd->vc.rv3d->viewmat); + + RNA_float_get_array(itemptr, "mouse", mval); + mval[0]-= vc->ar->winrct.xmin; + mval[1]-= vc->ar->winrct.ymin; + + MTC_Mat4SwapMat4(wpd->vc.rv3d->persmat, mat); + + /* which faces are involved */ + if(wp->flag & VP_AREA) { + totindex= sample_backbuf_area(vc, indexar, me->totface, mval[0], mval[1], brush->size); + } + else { + indexar[0]= view3d_sample_backbuf(vc, mval[0], mval[1]); + if(indexar[0]) totindex= 1; + else totindex= 0; + } + + if(wp->flag & VP_COLINDEX) { + for(index=0; indextotface) { + MFace *mface= ((MFace *)me->mface) + (indexar[index]-1); + + if(mface->mat_nr!=ob->actcol-1) { + indexar[index]= 0; + } + } + } + } + + if((G.f & G_FACESELECT) && me->mface) { + for(index=0; indextotface) { + MFace *mface= ((MFace *)me->mface) + (indexar[index]-1); + + if((mface->flag & ME_FACE_SEL)==0) { + indexar[index]= 0; + } + } + } + } + + /* make sure each vertex gets treated only once */ + /* and calculate filter weight */ + totw= 0; + if(wp->mode==VP_BLUR) + paintweight= 0.0f; + else + paintweight= ts->vgroup_weight; + + for(index=0; indextotface) { + MFace *mface= me->mface + (indexar[index]-1); + + (me->dvert+mface->v1)->flag= 1; + (me->dvert+mface->v2)->flag= 1; + (me->dvert+mface->v3)->flag= 1; + if(mface->v4) (me->dvert+mface->v4)->flag= 1; + + if(wp->mode==VP_BLUR) { + MDeformWeight *dw, *(*dw_func)(MDeformVert *, int) = verify_defweight; + + if(wp->flag & VP_ONLYVGROUP) + dw_func= get_defweight; + + dw= dw_func(me->dvert+mface->v1, ob->actdef-1); + if(dw) {paintweight+= dw->weight; totw++;} + dw= dw_func(me->dvert+mface->v2, ob->actdef-1); + if(dw) {paintweight+= dw->weight; totw++;} + dw= dw_func(me->dvert+mface->v3, ob->actdef-1); + if(dw) {paintweight+= dw->weight; totw++;} + if(mface->v4) { + dw= dw_func(me->dvert+mface->v4, ob->actdef-1); + if(dw) {paintweight+= dw->weight; totw++;} + } + } + } + } + + if(wp->mode==VP_BLUR) + paintweight/= (float)totw; + + for(index=0; indextotface) { + MFace *mface= me->mface + (indexar[index]-1); + + if((me->dvert+mface->v1)->flag) { + alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v1, mval); + if(alpha) { + do_weight_paint_vertex(wp, ob, mface->v1, alpha, paintweight, wpd->vgroup_mirror); + } + (me->dvert+mface->v1)->flag= 0; + } + + if((me->dvert+mface->v2)->flag) { + alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v2, mval); + if(alpha) { + do_weight_paint_vertex(wp, ob, mface->v2, alpha, paintweight, wpd->vgroup_mirror); + } + (me->dvert+mface->v2)->flag= 0; + } + + if((me->dvert+mface->v3)->flag) { + alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v3, mval); + if(alpha) { + do_weight_paint_vertex(wp, ob, mface->v3, alpha, paintweight, wpd->vgroup_mirror); + } + (me->dvert+mface->v3)->flag= 0; + } + + if((me->dvert+mface->v4)->flag) { + if(mface->v4) { + alpha= calc_vp_alpha_dl(wp, vc, wpd->wpimat, wpd->vertexcosnos+6*mface->v4, mval); + if(alpha) { + do_weight_paint_vertex(wp, ob, mface->v4, alpha, paintweight, wpd->vgroup_mirror); + } + (me->dvert+mface->v4)->flag= 0; + } + } + } + } + + MTC_Mat4SwapMat4(vc->rv3d->persmat, mat); + + DAG_object_flush_update(vc->scene, ob, OB_RECALC_DATA); + ED_region_tag_redraw(vc->ar); +} + +static void wpaint_stroke_done(bContext *C, struct PaintStroke *stroke) +{ + ToolSettings *ts= CTX_data_tool_settings(C); + Object *ob= CTX_data_active_object(C); + struct WPaintData *wpd= paint_stroke_mode_data(stroke); + + if(wpd->vertexcosnos) + MEM_freeN(wpd->vertexcosnos); + MEM_freeN(wpd->indexar); + + /* frees prev buffer */ + copy_wpaint_prev(ts->wpaint, NULL, 0); + + /* and particles too */ + if(ob->particlesystem.first) { + ParticleSystem *psys; + int i; + + for(psys= ob->particlesystem.first; psys; psys= psys->next) { + for(i=0; ivgroup[i]==ob->actdef) { + psys->recalc |= PSYS_RECALC_RESET; + break; + } + } + } + } + + DAG_object_flush_update(CTX_data_scene(C), ob, OB_RECALC_DATA); + + MEM_freeN(wpd); +} + + +static int wpaint_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + + op->customdata = paint_stroke_new(C, wpaint_stroke_test_start, + wpaint_stroke_update_step, + wpaint_stroke_done); /* add modal handler */ WM_event_add_modal_handler(C, &CTX_wm_window(C)->handlers, op); @@ -1582,13 +1575,14 @@ void PAINT_OT_weight_paint(wmOperatorType *ot) /* api callbacks */ ot->invoke= wpaint_invoke; - ot->modal= wpaint_modal; + ot->modal= paint_stroke_modal; /* ot->exec= vpaint_exec; <-- needs stroke property */ ot->poll= wp_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; - + + RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", ""); } /* ************ set / clear vertex paint mode ********** */ From ff27281f2e235ca5c7b776b390f0deb00799c97a Mon Sep 17 00:00:00 2001 From: William Reynish Date: Thu, 20 Aug 2009 15:58:28 +0000 Subject: [PATCH 165/577] changed layout of PovRay radiosity panel to be more consistent with other render panels --- release/io/engine_render_pov.py | 40 +++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/release/io/engine_render_pov.py b/release/io/engine_render_pov.py index 65add2baacb..539f705a6ee 100644 --- a/release/io/engine_render_pov.py +++ b/release/io/engine_render_pov.py @@ -821,21 +821,37 @@ class SCENE_PT_povray_radiosity(RenderButtonsPanel): col = split.column() - col.itemR(scene, "pov_radio_count") - col.itemR(scene, "pov_radio_recursion_limit") - col.itemR(scene, "pov_radio_error_bound") + col.itemR(scene, "pov_radio_count", text="Rays") + col.itemR(scene, "pov_radio_recursion_limit", text="Recursions") + col = split.column() + col.itemR(scene, "pov_radio_error_bound", text="Error") - col.itemR(scene, "pov_radio_display_advanced") + layout.itemR(scene, "pov_radio_display_advanced") if scene.pov_radio_display_advanced: - col.itemR(scene, "pov_radio_adc_bailout") + split = layout.split() + + col = split.column() + col.itemR(scene, "pov_radio_adc_bailout", slider=True) + col.itemR(scene, "pov_radio_gray_threshold", slider=True) + col.itemR(scene, "pov_radio_low_error_factor", slider=True) + + + + col = split.column() col.itemR(scene, "pov_radio_brightness") - col.itemR(scene, "pov_radio_gray_threshold") - col.itemR(scene, "pov_radio_low_error_factor") - col.itemR(scene, "pov_radio_minimum_reuse") - col.itemR(scene, "pov_radio_media") + col.itemR(scene, "pov_radio_minimum_reuse", text="Min Reuse") col.itemR(scene, "pov_radio_nearest_count") + + + split = layout.split() + + col = split.column() + col.itemL(text="Estimation Influence:") + col.itemR(scene, "pov_radio_media") col.itemR(scene, "pov_radio_normal") + + col = split.column() col.itemR(scene, "pov_radio_always_sample") @@ -885,17 +901,17 @@ FloatProperty( attr="pov_radio_error_bound", FloatProperty( attr="pov_radio_gray_threshold", name="Gray Threshold", description="one of the two main speed/quality tuning values, lower values are more accurate.", - min=0.0, max=1.0, default= 0.0) + min=0.0, max=1.0, soft_min=0, soft_max=1, default= 0.0) FloatProperty( attr="pov_radio_low_error_factor", name="Low Error Factor", description="If you calculate just enough samples, but no more, you will get an image which has slightly blotchy lighting.", - min=0.0, max=1.0, default= 0.5) + min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default= 0.5) # max_sample - not available yet BoolProperty( attr="pov_radio_media", - name="Use Media", + name="Media", description="Radiosity estimation can be affected by media.", default= False) From 4df4b17ed65331b39d77c319f98b7114c0f2ead0 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Thu, 20 Aug 2009 16:00:17 +0000 Subject: [PATCH 166/577] 2.5 Paint: * Weight paint and vertex paint now use the same cursor setup as sculpt --- source/blender/blenkernel/BKE_paint.h | 7 +- source/blender/blenkernel/intern/paint.c | 15 ++-- .../editors/sculpt_paint/paint_vertex.c | 86 ++++--------------- source/blender/editors/sculpt_paint/sculpt.c | 4 +- source/blender/makesrna/intern/rna_space.c | 2 +- 5 files changed, 31 insertions(+), 83 deletions(-) diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index 45d2e24c7f6..4337d275776 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -33,7 +33,12 @@ struct Object; struct Paint; struct Scene; -void paint_init(struct Paint *p, const char *col); +extern const char PAINT_CURSOR_SCULPT[3]; +extern const char PAINT_CURSOR_VERTEX_PAINT[3]; +extern const char PAINT_CURSOR_WEIGHT_PAINT[3]; +extern const char PAINT_CURSOR_TEXTURE_PAINT[3]; + +void paint_init(struct Paint *p, const char col[3]); void free_paint(struct Paint *p); void copy_paint(struct Paint *orig, struct Paint *new); diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index f0893e058fa..7c5b2b82b4b 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -39,6 +39,11 @@ #include #include +const char PAINT_CURSOR_SCULPT[3] = {255, 100, 100}; +const char PAINT_CURSOR_VERTEX_PAINT[3] = {255, 255, 255}; +const char PAINT_CURSOR_WEIGHT_PAINT[3] = {200, 200, 255}; +const char PAINT_CURSOR_TEXTURE_PAINT[3] = {255, 255, 255}; + Paint *paint_get_active(Scene *sce) { if(sce && sce->basact && sce->basact->object) { @@ -154,7 +159,7 @@ int paint_facesel_test(Object *ob) } -void paint_init(Paint *p, const char *col) +void paint_init(Paint *p, const char col[3]) { Brush *brush; @@ -163,13 +168,7 @@ void paint_init(Paint *p, const char *col) brush_check_exists(&brush, "Brush"); paint_brush_set(p, brush); - if(col) - memcpy(p->paint_cursor_col, col, 3); - else { - p->paint_cursor_col[0] = 255; - p->paint_cursor_col[1] = 255; - p->paint_cursor_col[2] = 255; - } + memcpy(p->paint_cursor_col, col, 3); p->paint_cursor_col[3] = 128; } diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 0d8213b28d6..704773795e8 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -142,56 +142,6 @@ static int wp_poll(bContext *C) return 0; } - -/* Cursors */ -static void vp_drawcursor(bContext *C, int x, int y, void *customdata) -{ - Brush *brush = paint_brush(&CTX_data_tool_settings(C)->vpaint->paint); - - glTranslatef((float)x, (float)y, 0.0f); - - glColor4ub(255, 255, 255, 128); - glEnable( GL_LINE_SMOOTH ); - glEnable(GL_BLEND); - glutil_draw_lined_arc(0.0, M_PI*2.0, brush->size, 40); - glDisable(GL_BLEND); - glDisable( GL_LINE_SMOOTH ); - - glTranslatef((float)-x, (float)-y, 0.0f); -} - -static void wp_drawcursor(bContext *C, int x, int y, void *customdata) -{ - Brush *brush = paint_brush(&CTX_data_tool_settings(C)->wpaint->paint); - - glTranslatef((float)x, (float)y, 0.0f); - - glColor4ub(200, 200, 255, 128); - glEnable( GL_LINE_SMOOTH ); - glEnable(GL_BLEND); - glutil_draw_lined_arc(0.0, M_PI*2.0, brush->size, 40); - glDisable(GL_BLEND); - glDisable( GL_LINE_SMOOTH ); - - glTranslatef((float)-x, (float)-y, 0.0f); -} - -static void toggle_paint_cursor(bContext *C, int wpaint) -{ - ToolSettings *ts = CTX_data_scene(C)->toolsettings; - VPaint *vp = wpaint ? ts->wpaint : ts->vpaint; - - if(vp->paintcursor) { - WM_paint_cursor_end(CTX_wm_manager(C), vp->paintcursor); - vp->paintcursor = NULL; - } - else { - vp->paintcursor = wpaint ? - WM_paint_cursor_activate(CTX_wm_manager(C), wp_poll, wp_drawcursor, NULL) : - WM_paint_cursor_activate(CTX_wm_manager(C), vp_poll, vp_drawcursor, NULL); - } -} - static VPaint *new_vpaint(int wpaint) { VPaint *vp= MEM_callocN(sizeof(VPaint), "VPaint"); @@ -1127,9 +1077,8 @@ static int set_wpaint(bContext *C, wmOperator *op) /* toggle */ if(wp==NULL) wp= scene->toolsettings->wpaint= new_vpaint(1); - paint_init(&wp->paint, NULL); - - toggle_paint_cursor(C, 1); + paint_init(&wp->paint, PAINT_CURSOR_WEIGHT_PAINT); + paint_cursor_start(C, wp_poll); mesh_octree_table(ob, NULL, NULL, 's'); @@ -1145,9 +1094,6 @@ static int set_wpaint(bContext *C, wmOperator *op) /* toggle */ } } else { - if(wp) - toggle_paint_cursor(C, 1); - mesh_octree_table(ob, NULL, NULL, 'e'); } @@ -1188,9 +1134,11 @@ void PAINT_OT_weight_paint_toggle(wmOperatorType *ot) static int vpaint_radial_control_invoke(bContext *C, wmOperator *op, wmEvent *event) { - Brush *brush = paint_brush(&CTX_data_scene(C)->toolsettings->vpaint->paint); - - toggle_paint_cursor(C, 0); + Paint *p = paint_get_active(CTX_data_scene(C)); + Brush *brush = paint_brush(p); + + WM_paint_cursor_end(CTX_wm_manager(C), p->paint_cursor); + p->paint_cursor = NULL; brush_radial_control_invoke(op, brush, 1); return WM_radial_control_invoke(C, op, event); } @@ -1199,7 +1147,7 @@ static int vpaint_radial_control_modal(bContext *C, wmOperator *op, wmEvent *eve { int ret = WM_radial_control_modal(C, op, event); if(ret != OPERATOR_RUNNING_MODAL) - toggle_paint_cursor(C, 0); + paint_cursor_start(C, vp_poll); return ret; } @@ -1211,8 +1159,11 @@ static int vpaint_radial_control_exec(bContext *C, wmOperator *op) static int wpaint_radial_control_invoke(bContext *C, wmOperator *op, wmEvent *event) { - Brush *brush = paint_brush(&CTX_data_scene(C)->toolsettings->wpaint->paint); - toggle_paint_cursor(C, 1); + Paint *p = paint_get_active(CTX_data_scene(C)); + Brush *brush = paint_brush(p); + + WM_paint_cursor_end(CTX_wm_manager(C), p->paint_cursor); + p->paint_cursor = NULL; brush_radial_control_invoke(op, brush, 1); return WM_radial_control_invoke(C, op, event); } @@ -1221,7 +1172,7 @@ static int wpaint_radial_control_modal(bContext *C, wmOperator *op, wmEvent *eve { int ret = WM_radial_control_modal(C, op, event); if(ret != OPERATOR_RUNNING_MODAL) - toggle_paint_cursor(C, 1); + paint_cursor_start(C, wp_poll); return ret; } @@ -1614,11 +1565,6 @@ static int set_vpaint(bContext *C, wmOperator *op) /* toggle */ if(ob->mode & OB_MODE_VERTEX_PAINT) { ob->mode &= ~OB_MODE_VERTEX_PAINT; - - if(vp) { - toggle_paint_cursor(C, 0); - vp->paintcursor= NULL; - } } else { ob->mode |= OB_MODE_VERTEX_PAINT; @@ -1629,9 +1575,9 @@ static int set_vpaint(bContext *C, wmOperator *op) /* toggle */ if(vp==NULL) vp= scene->toolsettings->vpaint= new_vpaint(0); - toggle_paint_cursor(C, 0); + paint_cursor_start(C, vp_poll); - paint_init(&vp->paint, NULL); + paint_init(&vp->paint, PAINT_CURSOR_VERTEX_PAINT); } if (me) diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index e0206210799..76c5c3504da 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -1549,8 +1549,6 @@ static int sculpt_toggle_mode(bContext *C, wmOperator *op) free_sculptsession(&ob->sculpt); } else { - const char col[3] = {255, 100, 100}; - /* Enter sculptmode */ ob->mode |= OB_MODE_SCULPT; @@ -1564,7 +1562,7 @@ static int sculpt_toggle_mode(bContext *C, wmOperator *op) free_sculptsession(&ob->sculpt); ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session"); - paint_init(&ts->sculpt->paint, col); + paint_init(&ts->sculpt->paint, PAINT_CURSOR_SCULPT); paint_cursor_start(C, sculpt_poll); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index d220c707143..8e8c9a9837c 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -151,7 +151,7 @@ static void rna_SpaceImageEditor_paint_update(bContext *C, PointerRNA *ptr) Scene *scene= CTX_data_scene(C); if(scene) - paint_init(&scene->toolsettings->imapaint.paint, NULL); + paint_init(&scene->toolsettings->imapaint.paint, PAINT_CURSOR_TEXTURE_PAINT); } static int rna_SpaceImageEditor_show_render_get(PointerRNA *ptr) From ec6b14bb073fdd207b9cd2f93c8db4a8cfd9aaf3 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Thu, 20 Aug 2009 16:43:55 +0000 Subject: [PATCH 167/577] 2.5 texture paint: * Little bugfix, was passing an invalid pointer --- source/blender/editors/sculpt_paint/paint_image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 8a8041abbff..2dcd7a64947 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -5174,7 +5174,7 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op) me->mtface= CustomData_add_layer(&me->fdata, CD_MTFACE, CD_DEFAULT, NULL, me->totface); - paint_init(&scene->toolsettings->imapaint.paint, NULL); + paint_init(&scene->toolsettings->imapaint.paint, PAINT_CURSOR_TEXTURE_PAINT); if(U.glreslimit != 0) GPU_free_images(); From fda97809bc6521e746e56341d5c7e7f19864d52c Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Thu, 20 Aug 2009 17:37:38 +0000 Subject: [PATCH 168/577] 2.5 Multires: * Fixed a memory corruption bug when deleting a multiresmodifier, was hanging on to a bad pointer. Reported on IRC by lusque --- source/blender/blenkernel/BKE_multires.h | 5 +-- .../blender/blenkernel/intern/cdderivedmesh.c | 36 ++++++++++++------- source/blender/blenkernel/intern/modifier.c | 3 +- source/blender/blenkernel/intern/multires.c | 21 ++++++----- source/blender/blenloader/intern/readfile.c | 2 +- 5 files changed, 41 insertions(+), 26 deletions(-) diff --git a/source/blender/blenkernel/BKE_multires.h b/source/blender/blenkernel/BKE_multires.h index 6558212519f..e7c7d92c955 100644 --- a/source/blender/blenkernel/BKE_multires.h +++ b/source/blender/blenkernel/BKE_multires.h @@ -35,10 +35,11 @@ struct Object; typedef struct MultiresSubsurf { struct MultiresModifierData *mmd; - struct Mesh *me; + struct Object *ob; } MultiresSubsurf; /* MultiresDM */ +struct Object *MultiresDM_get_object(struct DerivedMesh *dm); struct Mesh *MultiresDM_get_mesh(struct DerivedMesh *dm); struct DerivedMesh *MultiresDM_new(struct MultiresSubsurf *, struct DerivedMesh*, int, int, int); void *MultiresDM_get_vertnorm(struct DerivedMesh *); @@ -59,7 +60,7 @@ void multires_mark_as_modified(struct Object *ob); void multires_force_update(struct Object *ob); struct DerivedMesh *multires_dm_create_from_derived(struct MultiresModifierData*, struct DerivedMesh*, - struct Mesh *, int, int); + struct Object *, int, int); struct MultiresModifierData *find_multires_modifier(struct Object *ob); int multiresModifier_switch_level(struct Object *, const int); diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index 706eece108c..4829be21ed8 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -1297,7 +1297,7 @@ typedef struct MultiresDM { IndexNode *vert_face_map_mem, *vert_edge_map_mem; int *face_offsets; - Mesh *me; + Object *ob; int modified; void (*update)(DerivedMesh*); @@ -1308,15 +1308,19 @@ static void MultiresDM_release(DerivedMesh *dm) MultiresDM *mrdm = (MultiresDM*)dm; int mvert_layer; + /* Check that mmd still exists */ + if(BLI_findindex(&mrdm->ob->modifiers, mrdm->mmd) < 0) + mrdm->mmd = NULL; + /* Before freeing, need to update the displacement map */ - if(dm->needsFree && mrdm->modified) + if(dm->needsFree && mrdm->modified && mrdm->mmd) mrdm->update(dm); /* If the MVert data is being used as the sculpt undo store, don't free it */ mvert_layer = CustomData_get_layer_index(&dm->vertData, CD_MVERT); if(mvert_layer != -1) { CustomDataLayer *cd = &dm->vertData.layers[mvert_layer]; - if(cd->data == mrdm->mmd->undo_verts) + if(mrdm->mmd && cd->data == mrdm->mmd->undo_verts) cd->flag |= CD_FLAG_NOFREE; } @@ -1348,7 +1352,7 @@ DerivedMesh *MultiresDM_new(MultiresSubsurf *ms, DerivedMesh *orig, int numVerts dm = &mrdm->cddm.dm; mrdm->mmd = ms->mmd; - mrdm->me = ms->me; + mrdm->ob = ms->ob; if(dm) { MDisps *disps; @@ -1391,7 +1395,12 @@ DerivedMesh *MultiresDM_new(MultiresSubsurf *ms, DerivedMesh *orig, int numVerts Mesh *MultiresDM_get_mesh(DerivedMesh *dm) { - return ((MultiresDM*)dm)->me; + return get_mesh(((MultiresDM*)dm)->ob); +} + +Object *MultiresDM_get_object(DerivedMesh *dm) +{ + return ((MultiresDM*)dm)->ob; } void *MultiresDM_get_orco(DerivedMesh *dm) @@ -1428,10 +1437,11 @@ void MultiresDM_set_update(DerivedMesh *dm, void (*update)(DerivedMesh*)) ListBase *MultiresDM_get_vert_face_map(DerivedMesh *dm) { MultiresDM *mrdm = (MultiresDM*)dm; + Mesh *me = mrdm->ob->data; if(!mrdm->vert_face_map) - create_vert_face_map(&mrdm->vert_face_map, &mrdm->vert_face_map_mem, mrdm->me->mface, - mrdm->me->totvert, mrdm->me->totface); + create_vert_face_map(&mrdm->vert_face_map, &mrdm->vert_face_map_mem, me->mface, + me->totvert, me->totface); return mrdm->vert_face_map; } @@ -1439,10 +1449,11 @@ ListBase *MultiresDM_get_vert_face_map(DerivedMesh *dm) ListBase *MultiresDM_get_vert_edge_map(DerivedMesh *dm) { MultiresDM *mrdm = (MultiresDM*)dm; + Mesh *me = mrdm->ob->data; if(!mrdm->vert_edge_map) - create_vert_edge_map(&mrdm->vert_edge_map, &mrdm->vert_edge_map_mem, mrdm->me->medge, - mrdm->me->totvert, mrdm->me->totedge); + create_vert_edge_map(&mrdm->vert_edge_map, &mrdm->vert_edge_map_mem, me->medge, + me->totvert, me->totedge); return mrdm->vert_edge_map; } @@ -1450,6 +1461,7 @@ ListBase *MultiresDM_get_vert_edge_map(DerivedMesh *dm) int *MultiresDM_get_face_offsets(DerivedMesh *dm) { MultiresDM *mrdm = (MultiresDM*)dm; + Mesh *me = mrdm->ob->data; int i, accum = 0; if(!mrdm->face_offsets) { @@ -1457,11 +1469,11 @@ int *MultiresDM_get_face_offsets(DerivedMesh *dm) int area = len * len; int t = 1 + len * 3 + area * 3, q = t + len + area; - mrdm->face_offsets = MEM_callocN(sizeof(int) * mrdm->me->totface, "mrdm face offsets"); - for(i = 0; i < mrdm->me->totface; ++i) { + mrdm->face_offsets = MEM_callocN(sizeof(int) * me->totface, "mrdm face offsets"); + for(i = 0; i < me->totface; ++i) { mrdm->face_offsets[i] = accum; - accum += (mrdm->me->mface[i].v4 ? q : t); + accum += (me->mface[i].v4 ? q : t); } } diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 1e2560bf809..4d567245ce1 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -8102,14 +8102,13 @@ static DerivedMesh *multiresModifier_applyModifier(ModifierData *md, Object *ob, int useRenderParams, int isFinalCalc) { MultiresModifierData *mmd = (MultiresModifierData*)md; - Mesh *me = get_mesh(ob); DerivedMesh *final; /* TODO: for now just skip a level1 mesh */ if(mmd->lvl == 1) return dm; - final = multires_dm_create_from_derived(mmd, dm, me, useRenderParams, isFinalCalc); + final = multires_dm_create_from_derived(mmd, dm, ob, useRenderParams, isFinalCalc); if(mmd->undo_signal && mmd->undo_verts && mmd->undo_verts_tot == final->getNumVerts(final)) { int i; MVert *dst = CDDM_get_verts(final); diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index e91f318adad..09a6c27a88c 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -204,10 +204,11 @@ static void VecAddUf(float a[3], float b[3]) a[2] += b[2]; } -static void multires_subdisp(DerivedMesh *orig, Mesh *me, DerivedMesh *final, int lvl, int totlvl, +static void multires_subdisp(DerivedMesh *orig, Object *ob, DerivedMesh *final, int lvl, int totlvl, int totsubvert, int totsubedge, int totsubface, int addverts) { DerivedMesh *mrdm; + Mesh *me = ob->data; MultiresModifierData mmd_sub; MVert *mvs = CDDM_get_verts(final); MVert *mvd, *mvd_f1, *mvs_f1, *mvd_f3, *mvd_f4; @@ -222,7 +223,7 @@ static void multires_subdisp(DerivedMesh *orig, Mesh *me, DerivedMesh *final, in memset(&mmd_sub, 0, sizeof(MultiresModifierData)); mmd_sub.lvl = mmd_sub.totlvl = totlvl; - mrdm = multires_dm_create_from_derived(&mmd_sub, orig, me, 0, 0); + mrdm = multires_dm_create_from_derived(&mmd_sub, orig, ob, 0, 0); mvd = CDDM_get_verts(mrdm); /* Need to map from ccg to mrdm */ @@ -395,7 +396,7 @@ static void multires_subdisp(DerivedMesh *orig, Mesh *me, DerivedMesh *final, in } } - final->needsFree = 1; + final->needsFree = 1; final->release(final); mrdm->needsFree = 1; MultiresDM_mark_as_modified(mrdm); @@ -468,7 +469,7 @@ void multiresModifier_subdivide(MultiresModifierData *mmd, Object *ob, int dista orig = CDDM_from_mesh(me, NULL); memset(&mmd_sub, 0, sizeof(MultiresModifierData)); mmd_sub.lvl = mmd_sub.totlvl = mmd->lvl; - mrdm = multires_dm_create_from_derived(&mmd_sub, orig, me, 0, 0); + mrdm = multires_dm_create_from_derived(&mmd_sub, orig, ob, 0, 0); totsubvert = mrdm->getNumVerts(mrdm); totsubedge = mrdm->getNumEdges(mrdm); totsubface = mrdm->getNumFaces(mrdm); @@ -497,7 +498,7 @@ void multiresModifier_subdivide(MultiresModifierData *mmd, Object *ob, int dista orig = CDDM_from_mesh(me, NULL); - multires_subdisp(orig, me, final, mmd->lvl, mmd->totlvl, totsubvert, totsubedge, totsubface, 0); + multires_subdisp(orig, ob, final, mmd->lvl, mmd->totlvl, totsubvert, totsubedge, totsubface, 0); orig->needsFree = 1; orig->release(orig); @@ -1166,9 +1167,11 @@ static void multiresModifier_disp_run(DerivedMesh *dm, MVert *subco, int invert) static void multiresModifier_update(DerivedMesh *dm) { + Object *ob; Mesh *me; MDisps *mdisps; + ob = MultiresDM_get_object(dm); me = MultiresDM_get_mesh(dm); mdisps = CustomData_get_layer(&me->fdata, CD_MDISPS); @@ -1189,7 +1192,7 @@ static void multiresModifier_update(DerivedMesh *dm) (includes older displacements but not new sculpts) */ mmd.totlvl = totlvl; mmd.lvl = lvl; - subco_dm = multires_dm_create_from_derived(&mmd, orig, me, 0, 0); + subco_dm = multires_dm_create_from_derived(&mmd, orig, ob, 0, 0); cur_lvl_orig_verts = CDDM_get_verts(subco_dm); /* Subtract the original vertex cos from the new vertex cos */ @@ -1199,7 +1202,7 @@ static void multiresModifier_update(DerivedMesh *dm) final = multires_subdisp_pre(dm, totlvl - lvl, 0); - multires_subdisp(orig, me, final, lvl, totlvl, dm->getNumVerts(dm), dm->getNumEdges(dm), + multires_subdisp(orig, ob, final, lvl, totlvl, dm->getNumVerts(dm), dm->getNumEdges(dm), dm->getNumFaces(dm), 1); subco_dm->release(subco_dm); @@ -1226,7 +1229,7 @@ void multires_force_update(Object *ob) } } -struct DerivedMesh *multires_dm_create_from_derived(MultiresModifierData *mmd, DerivedMesh *dm, Mesh *me, +struct DerivedMesh *multires_dm_create_from_derived(MultiresModifierData *mmd, DerivedMesh *dm, Object *ob, int useRenderParams, int isFinalCalc) { SubsurfModifierData smd; @@ -1235,7 +1238,7 @@ struct DerivedMesh *multires_dm_create_from_derived(MultiresModifierData *mmd, D int i; ms.mmd = mmd; - ms.me = me; + ms.ob = ob; memset(&smd, 0, sizeof(SubsurfModifierData)); smd.levels = smd.renderLevels = mmd->lvl - 1; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 71994b97521..58b439e4cb4 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9416,7 +9416,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) mmd->lvl = mmd->totlvl; orig = CDDM_from_mesh(me, NULL); - dm = multires_dm_create_from_derived(mmd, orig, me, 0, 0); + dm = multires_dm_create_from_derived(mmd, orig, ob, 0, 0); multires_load_old(dm, me->mr); From f6dcd9376b2d2d0e0b126f6e12a7d83d21d81783 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Thu, 20 Aug 2009 17:59:37 +0000 Subject: [PATCH 169/577] 2.5 Texture RNA: Distorted Noise: "Distortion" Flag was swapped with "Basis". Reported by schuh in IRC. Thanks. --- source/blender/makesrna/intern/rna_texture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index f82edee8ff1..69298fbb8a4 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -1286,13 +1286,13 @@ static void rna_def_texture_distorted_noise(BlenderRNA *brna) RNA_def_property_update(prop, NC_TEXTURE, NULL); prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "noisebasis"); + RNA_def_property_enum_sdna(prop, NULL, "noisebasis2"); RNA_def_property_enum_items(prop, prop_noise_basis_items); RNA_def_property_ui_text(prop, "Noise Basis", "Sets the noise basis used for turbulence"); RNA_def_property_update(prop, NC_TEXTURE, NULL); prop= RNA_def_property(srna, "noise_distortion", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "noisebasis2"); + RNA_def_property_enum_sdna(prop, NULL, "noisebasis"); RNA_def_property_enum_items(prop, prop_noise_basis_items); RNA_def_property_ui_text(prop, "Noise Distortion", "Sets the noise basis for the distortion"); RNA_def_property_update(prop, NC_TEXTURE, NULL); From 1772a0a62f86268f01540d4a3692c2bb4c7e6432 Mon Sep 17 00:00:00 2001 From: Diego Borghetti Date: Thu, 20 Aug 2009 18:34:14 +0000 Subject: [PATCH 170/577] Add unsigned char buffer to BLF_draw_buffer and update makefiles for lzo and lzma. I rename the original makefile of lzo (Makefile.bak) and a new one. Also four new option for user-def.mk: WITH_LZO, default true WITH_LZMA, default true NAN_LZO, default extern/lzo NAN_LZMA, default extern/lzma It's easy add support for system libs (using lzo and lzma from OS) but I don't know if it have much sense. Note that I can't test the "unsigned char" buffer because the OGL animation is not working (right ?), but is the same code that for float also the new Makefile work fine here (Linux), but maybe need some tweak on other OS. --- extern/Makefile | 8 ++ extern/lzma/Makefile | 46 ++++++++ extern/lzo/minilzo/Makefile | 131 +++++----------------- source/Makefile | 3 + source/blender/blenfont/intern/blf_font.c | 93 +++++++++------ source/blender/blenkernel/intern/Makefile | 5 + source/nan_definitions.mk | 5 +- 7 files changed, 156 insertions(+), 135 deletions(-) create mode 100644 extern/lzma/Makefile diff --git a/extern/Makefile b/extern/Makefile index 61499da8743..1bebf1e1994 100644 --- a/extern/Makefile +++ b/extern/Makefile @@ -54,6 +54,14 @@ ifeq ($(WITH_OPENJPEG), true) DIRS += libopenjpeg endif +ifeq ($(WITH_LZO), true) + DIRS += lzo/minilzo +endif + +ifeq ($(WITH_LZMA), true) + DIRS += lzma +endif + TARGET = solid all:: diff --git a/extern/lzma/Makefile b/extern/lzma/Makefile new file mode 100644 index 00000000000..11d70dc7847 --- /dev/null +++ b/extern/lzma/Makefile @@ -0,0 +1,46 @@ +# +# $Id$ +# +# ***** BEGIN GPL/BL DUAL 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. The Blender +# Foundation also sells licenses for use in proprietary software under +# the Blender License. See http://www.blender.org/BL/ for information +# about this. +# +# 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): +# +# ***** END GPL/BL DUAL LICENSE BLOCK ***** +# +# + +LIBNAME = lzma +DIR = $(OCGDIR)/extern/$(LIBNAME) + +include nan_compile.mk + +install: $(ALL_OR_DEBUG) + @[ -d $(NAN_LZMA) ] || mkdir -p $(NAN_LZMA) + @[ -d $(NAN_LZMA)/lib/$(DEBUG_DIR) ] || mkdir -p $(NAN_LZMA)/lib/$(DEBUG_DIR) + @$(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)lib$(LIBNAME).a $(NAN_LZMA)/lib/$(DEBUG_DIR) +ifeq ($(OS),darwin) + ranlib $(NAN_LZMA)/lib/$(DEBUG_DIR)lib$(LIBNAME).a +endif + @$(NANBLENDERHOME)/intern/tools/cpifdiff.sh *.h $(NAN_LZMA) diff --git a/extern/lzo/minilzo/Makefile b/extern/lzo/minilzo/Makefile index a6ee373e8bc..8f3d5042579 100644 --- a/extern/lzo/minilzo/Makefile +++ b/extern/lzo/minilzo/Makefile @@ -1,113 +1,40 @@ # -# a very simple Makefile for miniLZO +# $Id: # -# Copyright (C) 1996-2008 Markus F.X.J. Oberhumer +# ***** BEGIN GPL LICENSE BLOCK ***** # - -PROGRAM = testmini -SOURCES = testmini.c minilzo.c - -default: - @echo "Please choose one of the following targets:" - @echo " gcc: gcc" - @echo " unix: hpux hpux9" - @echo " win32: win32-bc win32-cygwin win32-dm win32-lccwin32" - @echo " win32-intelc win32-mingw win32-vc win32-watcomc" - @echo " dos16: dos16-bc dos16-mc dos16-wc" - @echo " dos32: dos32-djgpp2 dos32-wc" - - -# Make sure that minilzo.h, lzoconf.h and lzodefs.h are in the -# current dircectory. Otherwise you may want to adjust CPPFLAGS. -##CPPFLAGS = -I../include/lzo -I. - -GCC_CFLAGS = -s -Wall -O2 -fomit-frame-pointer - - +# 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. # -# gcc (generic) +# 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. # - -gcc: - gcc $(CPPFLAGS) $(GCC_CFLAGS) -o $(PROGRAM) $(SOURCES) - -cc: - cc $(CPPFLAGS) -o $(PROGRAM) $(SOURCES) - - +# 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. # -# UNIX +# The Original Code is Copyright (C) 2009 Blender Foundation +# All rights reserved. # - -hpux: - cc -Ae $(CPPFLAGS) -o $(PROGRAM) $(SOURCES) - -hpux9: - cc -Aa -D_HPUX_SOURCE $(CPPFLAGS) -o $(PROGRAM) $(SOURCES) - - -# -# Windows (32-bit) +# Contributor(s): none yet. # +# ***** END GPL LICENSE BLOCK ***** -win32-borlandc win32-bc: - bcc32 -O2 -d -w -w-aus $(CPPFLAGS) $(SOURCES) +LIBNAME = minilzo +DIR = $(OCGDIR)/extern/$(LIBNAME) -win32-cygwin32 win32-cygwin: - gcc -mcygwin $(CPPFLAGS) $(GCC_CFLAGS) -o $(PROGRAM).exe $(SOURCES) - -win32-digitalmars win32-dm: - dmc -mn -o -w- $(CPPFLAGS) $(SOURCES) - -win32-intelc win32-ic: - icl -nologo -MD -W3 -O2 -GF $(CPPFLAGS) $(SOURCES) - -win32-lccwin32: - @echo "NOTE: need lcc 2002-07-25 or newer, older versions have bugs" - lc -A -unused -O $(CPPFLAGS) $(SOURCES) - -win32-mingw32 win32-mingw: - gcc -mno-cygwin $(CPPFLAGS) $(GCC_CFLAGS) -o $(PROGRAM).exe $(SOURCES) - -win32-visualc win32-vc: - cl -nologo -MD -W3 -O2 -GF $(CPPFLAGS) $(SOURCES) - -win32-watcomc win32-wc: - wcl386 -bt=nt -zq -mf -5r -zc -w5 -oneatx $(CPPFLAGS) $(SOURCES) - - -# -# DOS (16-bit) -# - -dos16-borlandc dos16-bc: - bcc -ml -w -d -O -4 $(CPPFLAGS) $(SOURCES) - -dos16-microsoftc dos16-msc dos16-mc: - cl -nologo -f- -AL -O -G2 -W3 $(CPPFLAGS) $(SOURCES) - -dos16-watcomc dos16-wc: - wcl -zq -ml -bt=dos -l=dos -ox -w5 $(CPPFLAGS) $(SOURCES) - - -# -# DOS (32-bit) -# - -dos32-djgpp2 dos32-dj2: - gcc $(CPPFLAGS) $(GCC_CFLAGS) -o $(PROGRAM).exe $(SOURCES) - -dos32-watcomc dos32-wc: - wcl386 -zq -mf -bt=dos -l=dos4g -5r -ox -zc $(CPPFLAGS) $(SOURCES) - - -# -# other targets -# - -clean: - rm -f $(PROGRAM) $(PROGRAM).exe $(PROGRAM).map $(PROGRAM).tds - rm -f *.err *.o *.obj - -.PHONY: default clean +include nan_compile.mk +install: $(ALL_OR_DEBUG) + @[ -d $(NAN_LZO) ] || mkdir -p $(NAN_LZO) + @[ -d $(NAN_LZO)/minilzo ] || mkdir -p $(NAN_LZO)/minilzo + @[ -d $(NAN_LZO)/lib/$(DEBUG_DIR) ] || mkdir -p $(NAN_LZO)/lib/$(DEBUG_DIR) + @$(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)lib$(LIBNAME).a $(NAN_LZO)/lib/$(DEBUG_DIR) +ifeq ($(OS),darwin) + ranlib $(NAN_LZO)/lib/$(DEBUG_DIR)lib$(LIBNAME).a +endif + @$(NANBLENDERHOME)/intern/tools/cpifdiff.sh *.h $(NAN_LZO)/minilzo diff --git a/source/Makefile b/source/Makefile index cd2e7cf75ba..8e9f66bbe42 100644 --- a/source/Makefile +++ b/source/Makefile @@ -110,6 +110,9 @@ COMLIB += $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaudaspace.a COMLIB += $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_src.a COMLIB += $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_fx.a COMLIB += $(NAN_SAMPLERATE)/lib/$(DEBUG_DIR)libsamplerate.a +COMLIB += $(NAN_LZO)/lib/$(DEBUG_DIR)libminilzo.a +COMLIB += $(NAN_LZMA)/lib/$(DEBUG_DIR)liblzma.a +COMLIB += $(NAN_SMOKE)/lib/$(DEBUG_DIR)/libsmoke.a ifneq ($(NAN_NO_KETSJI),true) COMLIB += $(OCGDIR)/gameengine/bloutines/$(DEBUG_DIR)libbloutines.a diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 432c3b5f854..2cd72809579 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -151,7 +151,7 @@ void blf_font_draw(FontBLF *font, char *str) void blf_font_buffer(FontBLF *font, char *str) { - unsigned char *data; + unsigned char *data, *cbuf; unsigned int c; GlyphBLF *g, *g_prev; FT_Vector delta; @@ -197,30 +197,27 @@ void blf_font_buffer(FontBLF *font, char *str) pen_x += delta.x >> 6; } - if (font->b_fbuf) { - chx= pen_x + ((int)g->pos_x); - - diff= g->height - ((int)g->pos_y); - - if (diff > 0) { - if (g->pitch < 0) - pen_y += diff; - else - pen_y -= diff; - } - else if (diff < 0) { - if (g->pitch < 0) - pen_y -= diff; - else - pen_y += diff; - } - - + chx= pen_x + ((int)g->pos_x); + diff= g->height - ((int)g->pos_y); + if (diff > 0) { if (g->pitch < 0) - chy= pen_y - ((int)g->pos_y); + pen_y += diff; else - chy= pen_y + ((int)g->pos_y); + pen_y -= diff; + } + else if (diff < 0) { + if (g->pitch < 0) + pen_y -= diff; + else + pen_y += diff; + } + if (g->pitch < 0) + chy= pen_y - ((int)g->pos_y); + else + chy= pen_y + ((int)g->pos_y); + + if (font->b_fbuf) { if (chx >= 0 && chx < font->bw && pen_y >= 0 && pen_y < font->bh) { if (g->pitch < 0) yb= 0; @@ -251,20 +248,52 @@ void blf_font_buffer(FontBLF *font, char *str) yb--; } } + } - if (diff > 0) { + if (font->b_cbuf) { + if (chx >= 0 && chx < font->bw && pen_y >= 0 && pen_y < font->bh) { if (g->pitch < 0) - pen_x -= diff; + yb= 0; else - pen_y += diff; - } - else if (diff < 0) { - if (g->pitch < 0) - pen_x += diff; - else - pen_y -= diff; - } + yb= g->height-1; + for (y= 0; y < g->height; y++) { + for (x= 0; x < g->width; x++) { + cbuf= font->b_cbuf + font->bch * ((chx + x) + ((pen_y + y)*font->bw)); + data= g->bitmap + x + (yb * g->pitch); + a= data[0]; + + if (a == 256) { + cbuf[0]= font->b_col[0]; + cbuf[1]= font->b_col[1]; + cbuf[2]= font->b_col[2]; + } + else { + cbuf[0]= (font->b_col[0]*a) + (cbuf[0] * (256-a)); + cbuf[1]= (font->b_col[1]*a) + (cbuf[1] * (256-a)); + cbuf[2]= (font->b_col[2]*a) + (cbuf[2] * (256-a)); + } + } + + if (g->pitch < 0) + yb++; + else + yb--; + } + } + } + + if (diff > 0) { + if (g->pitch < 0) + pen_x -= diff; + else + pen_y += diff; + } + else if (diff < 0) { + if (g->pitch < 0) + pen_x += diff; + else + pen_y -= diff; } pen_x += g->advance; diff --git a/source/blender/blenkernel/intern/Makefile b/source/blender/blenkernel/intern/Makefile index d6d41d6579e..6c2edc9e25f 100644 --- a/source/blender/blenkernel/intern/Makefile +++ b/source/blender/blenkernel/intern/Makefile @@ -90,6 +90,10 @@ CPPFLAGS += -I$(NAN_BULLET2)/include CPPFLAGS += -I$(NAN_FREETYPE)/include CPPFLAGS += -I$(NAN_FREETYPE)/include/freetype2 +# lzo and lzma, for pointcache +CPPFLAGS += -I$(NAN_LZO)/minilzo +CPPFLAGS += -I$(NAN_LZMA) + ifeq ($(WITH_FFMPEG),true) CPPFLAGS += -DWITH_FFMPEG CPPFLAGS += $(NAN_FFMPEGCFLAGS) @@ -111,3 +115,4 @@ ifeq ($(WITH_QUICKTIME), true) CPPFLAGS += -I../../quicktime CPPFLAGS += -DWITH_QUICKTIME endif + diff --git a/source/nan_definitions.mk b/source/nan_definitions.mk index b3f36dd3b5c..7fab61d5247 100644 --- a/source/nan_definitions.mk +++ b/source/nan_definitions.mk @@ -113,7 +113,10 @@ ifndef CONFIG_GUESS export WITH_OPENEXR ?= true export WITH_DDS ?= true export WITH_OPENJPEG ?= true - + export WITH_LZO ?= true + export WITH_LZMA ?= true + export NAN_LZO ?= $(LCGDIR)/lzo + export NAN_LZMA ?= $(LCGDIR)/lzma ifeq ($(NAN_USE_FFMPEG_CONFIG), true) export NAN_FFMPEG ?= $(shell ffmpeg-config --prefix) From c1100361e20ad174aea83160e2072427d12d4fd3 Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Thu, 20 Aug 2009 18:39:25 +0000 Subject: [PATCH 171/577] 2.5 filebrowser * code cleanup: remove duplication in drawing, join list and preview drawing --- .../blender/editors/include/ED_fileselect.h | 1 + source/blender/editors/space_file/file_draw.c | 229 ++++++++---------- source/blender/editors/space_file/filesel.c | 1 + .../blender/editors/space_file/space_file.c | 7 +- 4 files changed, 98 insertions(+), 140 deletions(-) diff --git a/source/blender/editors/include/ED_fileselect.h b/source/blender/editors/include/ED_fileselect.h index c56807ad09a..57ab6a5f8f6 100644 --- a/source/blender/editors/include/ED_fileselect.h +++ b/source/blender/editors/include/ED_fileselect.h @@ -65,6 +65,7 @@ typedef struct FileLayout short height; short flag; short dirty; + short textheight; float column_widths[MAX_FILE_COLUMN]; } FileLayout; diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 5a07c6a7550..00024ffa961 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -353,59 +353,9 @@ void file_calc_previews(const bContext *C, ARegion *ar) UI_view2d_totRect_set(v2d, sfile->layout->width, sfile->layout->height); } -void file_draw_previews(const bContext *C, ARegion *ar) +static void file_draw_preview(short sx, short sy, ImBuf *imb, FileLayout *layout, short dropshadow) { - SpaceFile *sfile= CTX_wm_space_file(C); - FileSelectParams* params= ED_fileselect_get_params(sfile); - FileLayout* layout= ED_fileselect_get_layout(sfile, ar); - View2D *v2d= &ar->v2d; - struct FileList* files = sfile->files; - int numfiles; - struct direntry *file; - short sx, sy; - ImBuf* imb=0; - int i; - int colorid = 0; - int offset; - int is_icon; - - if (!files) return; - - filelist_imgsize(files,sfile->layout->prv_w,sfile->layout->prv_h); - numfiles = filelist_numfiles(files); - - sx = v2d->cur.xmin + layout->tile_border_x; - sy = v2d->cur.ymax - layout->tile_border_y; - - offset = ED_fileselect_layout_offset(layout, 0, 0); - if (offset<0) offset=0; - for (i=offset; (i < numfiles) && (i < (offset+(layout->rows+2)*layout->columns)); ++i) - { - ED_fileselect_layout_tilepos(layout, i, &sx, &sy); - sx += v2d->tot.xmin+2; - sy = v2d->tot.ymax - sy; - file = filelist_file(files, i); - - if (file->flags & ACTIVE) { - colorid = TH_HILITE; - draw_tile(sx - 1, sy, sfile->layout->tile_w + 1, sfile->layout->tile_h, colorid,0); - } else if (params->active_file == i) { - colorid = TH_ACTIVE; - draw_tile(sx - 1, sy, sfile->layout->tile_w + 1, sfile->layout->tile_h, colorid,0); - } - - if ( (file->flags & IMAGEFILE) /* || (file->flags & MOVIEFILE) */) - { - filelist_loadimage(files, i); - } - is_icon = 0; - imb = filelist_getimage(files, i); - if (!imb) { - imb = filelist_geticon(files,i); - is_icon = 1; - } - - if (imb) { + if (imb) { float fx, fy; float dx, dy; short xco, yco; @@ -433,15 +383,15 @@ void file_draw_previews(const bContext *C, ARegion *ar) ey = (short)scaledy; fx = ((float)layout->prv_w - (float)ex)/2.0f; fy = ((float)layout->prv_h - (float)ey)/2.0f; - dx = (fx + 0.5f + sfile->layout->prv_border_x); - dy = (fy + 0.5f - sfile->layout->prv_border_y); + dx = (fx + 0.5f + layout->prv_border_x); + dy = (fy + 0.5f - layout->prv_border_y); xco = (float)sx + dx; - yco = (float)sy - sfile->layout->prv_h + dy; + yco = (float)sy - layout->prv_h + dy; glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); /* shadow */ - if (!is_icon && (file->flags & IMAGEFILE)) + if (dropshadow) uiDrawBoxShadow(220, xco, yco, xco + ex, yco + ey); glEnable(GL_BLEND); @@ -451,7 +401,7 @@ void file_draw_previews(const bContext *C, ARegion *ar) glaDrawPixelsTexScaled(xco, yco, imb->x, imb->y, GL_UNSIGNED_BYTE, imb->rect, scale, scale); /* border */ - if (!is_icon && (file->flags & IMAGEFILE)) { + if (dropshadow) { glColor4f(0.0f, 0.0f, 0.0f, 0.4f); fdrawbox(xco, yco, xco + ex, yco + ey); } @@ -459,41 +409,6 @@ void file_draw_previews(const bContext *C, ARegion *ar) glDisable(GL_BLEND); imb = 0; } - - /* shadow */ - UI_ThemeColorShade(TH_BACK, -20); - - - if (S_ISDIR(file->type)) { - glColor4f(1.0f, 1.0f, 0.9f, 1.0f); - } - else if (file->flags & IMAGEFILE) { - UI_ThemeColor(TH_SEQ_IMAGE); - } - else if (file->flags & MOVIEFILE) { - UI_ThemeColor(TH_SEQ_MOVIE); - } - else if (file->flags & BLENDERFILE) { - UI_ThemeColor(TH_SEQ_SCENE); - } - else { - if (params->active_file == i) { - UI_ThemeColor(TH_GRID); /* grid used for active text */ - } else if (file->flags & ACTIVE) { - UI_ThemeColor(TH_TEXT_HI); - } else { - UI_ThemeColor(TH_TEXT); - } - } - - file_draw_string(sx + layout->prv_border_x, sy+4, file->relname, layout->tile_w, layout->tile_h, FILE_SHORTEN_END); - - if (!sfile->loadimage_timer) - sfile->loadimage_timer= WM_event_add_window_timer(CTX_wm_window(C), TIMER1, 1.0/30.0); /* max 30 frames/sec. */ - - } - - uiSetRoundBox(0); } static void renamebutton_cb(bContext *C, void *arg1, char *oldname) @@ -523,6 +438,39 @@ static void renamebutton_cb(bContext *C, void *arg1, char *oldname) } } + +static void draw_background(FileLayout *layout, View2D *v2d) +{ + int i; + short sy; + + /* alternating flat shade background */ + for (i=0; (i <= layout->rows); i+=2) + { + sy = v2d->cur.ymax - i*(layout->tile_h+2*layout->tile_border_y) - layout->tile_border_y; + + UI_ThemeColorShade(TH_BACK, -7); + glRectf(v2d->cur.xmin, sy, v2d->cur.xmax, sy+layout->tile_h+2*layout->tile_border_y); + + } +} + +static void draw_dividers(FileLayout *layout, View2D *v2d) +{ + short sx; + + /* vertical column dividers */ + sx = v2d->tot.xmin; + while (sx < v2d->cur.xmax) { + sx += (layout->tile_w+2*layout->tile_border_x); + + UI_ThemeColorShade(TH_BACK, 30); + sdrawline(sx+1, v2d->cur.ymax - layout->tile_border_y , sx+1, v2d->cur.ymin); + UI_ThemeColorShade(TH_BACK, -30); + sdrawline(sx, v2d->cur.ymax - layout->tile_border_y , sx, v2d->cur.ymin); + } +} + void file_draw_list(const bContext *C, ARegion *ar) { SpaceFile *sfile= CTX_wm_space_file(C); @@ -531,6 +479,7 @@ void file_draw_list(const bContext *C, ARegion *ar) View2D *v2d= &ar->v2d; struct FileList* files = sfile->files; struct direntry *file; + ImBuf *imb; int numfiles; int numfiles_layout; int colorid = 0; @@ -538,6 +487,7 @@ void file_draw_list(const bContext *C, ARegion *ar) int offset; int i; float sw, spos; + short is_icon; numfiles = filelist_numfiles(files); @@ -547,26 +497,11 @@ void file_draw_list(const bContext *C, ARegion *ar) offset = ED_fileselect_layout_offset(layout, 0, 0); if (offset<0) offset=0; - /* alternating flat shade background */ - for (i=0; (i <= layout->rows); i+=2) - { - sx = v2d->cur.xmin; - sy = v2d->cur.ymax - i*(layout->tile_h+2*layout->tile_border_y) - layout->tile_border_y; + if (params->display != FILE_IMGDISPLAY) { - UI_ThemeColorShade(TH_BACK, -7); - glRectf(v2d->cur.xmin, sy, v2d->cur.xmax, sy+layout->tile_h+2*layout->tile_border_y); - - } + draw_background(layout, v2d); - /* vertical column dividers */ - sx = v2d->tot.xmin; - while (sx < ar->v2d.cur.xmax) { - sx += (sfile->layout->tile_w+2*sfile->layout->tile_border_x); - - UI_ThemeColorShade(TH_BACK, 30); - sdrawline(sx+1, ar->v2d.cur.ymax - layout->tile_border_y , sx+1, ar->v2d.cur.ymin); - UI_ThemeColorShade(TH_BACK, -30); - sdrawline(sx, ar->v2d.cur.ymax - layout->tile_border_y , sx, ar->v2d.cur.ymin); + draw_dividers(layout, v2d); } sx = ar->v2d.cur.xmin + layout->tile_border_x; @@ -594,16 +529,33 @@ void file_draw_list(const bContext *C, ARegion *ar) } spos = sx; - file_draw_icon(spos, sy-3, get_file_icon(file), ICON_DEFAULT_WIDTH, ICON_DEFAULT_WIDTH); - spos += ICON_DEFAULT_WIDTH + 4; - + + if ( FILE_IMGDISPLAY == params->display ) { + if ( (file->flags & IMAGEFILE) /* || (file->flags & MOVIEFILE) */) { + filelist_loadimage(files, i); + } + is_icon = 0; + imb = filelist_getimage(files, i); + if (!imb) { + imb = filelist_geticon(files,i); + is_icon = 1; + } + + file_draw_preview(sx, sy, imb, layout, !is_icon && (file->flags & IMAGEFILE)); + + } else { + file_draw_icon(spos, sy-3, get_file_icon(file), ICON_DEFAULT_WIDTH, ICON_DEFAULT_WIDTH); + spos += ICON_DEFAULT_WIDTH + 4; + } + UI_ThemeColor4(TH_TEXT); - + sw = file_string_width(file->relname); if (file->flags & EDITING) { + short but_width = (FILE_IMGDISPLAY == params->display) ? layout->tile_w : layout->column_widths[COLUMN_NAME]; uiBlock *block = uiBeginBlock(C, ar, "FileName", UI_EMBOSS); uiBut *but = uiDefBut(block, TEX, 1, "", spos, sy-layout->tile_h-3, - layout->column_widths[COLUMN_NAME], layout->tile_h, file->relname, 1.0f, (float)FILE_MAX,0,0,""); + but_width, layout->textheight*2, file->relname, 1.0f, (float)FILE_MAX,0,0,""); uiButSetRenameFunc(but, renamebutton_cb, file); if ( 0 == uiButActiveOnly(C, block, but)) { file->flags &= ~EDITING; @@ -611,36 +563,42 @@ void file_draw_list(const bContext *C, ARegion *ar) uiEndBlock(C, block); uiDrawBlock(C, block); } else { - file_draw_string(spos, sy, file->relname, sw, layout->tile_h, FILE_SHORTEN_END); + float name_width = (FILE_IMGDISPLAY == params->display) ? layout->tile_w : sw; + file_draw_string(spos, sy, file->relname, name_width, layout->tile_h, FILE_SHORTEN_END); } - spos += layout->column_widths[COLUMN_NAME] + 12; - if (params->display == FILE_SHOWSHORT) { + + uiSetRoundBox(0); + + if (params->display == FILE_SHORTDISPLAY) { + spos += layout->column_widths[COLUMN_NAME] + 12; if (!(file->type & S_IFDIR)) { sw = file_string_width(file->size); spos += layout->column_widths[COLUMN_SIZE] + 12 - sw; file_draw_string(spos, sy, file->size, sw+1, layout->tile_h, FILE_SHORTEN_END); } - } else { -#if 0 // XXX TODO: add this for non-windows systems + } else if (params->display == FILE_LONGDISPLAY) { + spos += layout->column_widths[COLUMN_NAME] + 12; + +#ifndef WIN32 /* rwx rwx rwx */ spos += 20; - sw = UI_GetStringWidth(file->mode1); - file_draw_string(spos, sy, file->mode1, sw, layout->tile_h); - - spos += 30; - sw = UI_GetStringWidth(file->mode2); - file_draw_string(spos, sy, file->mode2, sw, layout->tile_h); + sw = file_string_width(file->mode1); + file_draw_string(spos, sy, file->mode1, sw, layout->tile_h, FILE_SHORTEN_END); + spos += layout->column_widths[COLUMN_MODE1] + 12; - spos += 30; - sw = UI_GetStringWidth(file->mode3); - file_draw_string(spos, sy, file->mode3, sw, layout->tile_h); - - spos += 30; - sw = UI_GetStringWidth(file->owner); - file_draw_string(spos, sy, file->owner, sw, layout->tile_h); + sw = file_string_width(file->mode2); + file_draw_string(spos, sy, file->mode2, sw, layout->tile_h, FILE_SHORTEN_END); + spos += layout->column_widths[COLUMN_MODE2] + 12; + + sw = file_string_width(file->mode3); + file_draw_string(spos, sy, file->mode3, sw, layout->tile_h, FILE_SHORTEN_END); + spos += layout->column_widths[COLUMN_MODE3] + 12; + + sw = file_string_width(file->owner); + file_draw_string(spos, sy, file->owner, sw, layout->tile_h, FILE_SHORTEN_END); + spos += layout->column_widths[COLUMN_OWNER] + 12; #endif - sw = file_string_width(file->date); file_draw_string(spos, sy, file->date, sw, layout->tile_h, FILE_SHORTEN_END); spos += layout->column_widths[COLUMN_DATE] + 12; @@ -656,6 +614,9 @@ void file_draw_list(const bContext *C, ARegion *ar) } } } + + if (!sfile->loadimage_timer) + sfile->loadimage_timer= WM_event_add_window_timer(CTX_wm_window(C), TIMER1, 1.0/30.0); /* max 30 frames/sec. */ } diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 8ee7d3515b5..f300505933f 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -287,6 +287,7 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, struct ARegion *ar) numfiles = filelist_numfiles(sfile->files); textheight = file_font_pointsize(); layout = sfile->layout; + layout->textheight = textheight; if (params->display == FILE_IMGDISPLAY) { layout->prv_w = 96; diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index ea640eab090..22ad03f3523 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -310,12 +310,7 @@ static void file_main_area_draw(const bContext *C, ARegion *ar) file_hilight_set(sfile, ar, event->x, event->y); } - if (params->display == FILE_IMGDISPLAY) { - file_draw_previews(C, ar); - } else { - file_draw_list(C, ar); - } - + file_draw_list(C, ar); /* reset view matrix */ UI_view2d_view_restore(C); From 86e38ef6f7d9d1970826b8b5e944b189d0065fd9 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Thu, 20 Aug 2009 19:46:53 +0000 Subject: [PATCH 172/577] 2.5 Paint: * Evil backbuf drawing strikes again. In paint modes, it was causing the tool panel to flash black, bad glScissor. --- source/blender/editors/include/ED_screen.h | 1 + source/blender/editors/screen/area.c | 2 +- source/blender/editors/space_view3d/view3d_draw.c | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 6cb7593e07d..22a3e737277 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -58,6 +58,7 @@ void ED_region_panels_init(struct wmWindowManager *wm, struct ARegion *ar); void ED_region_panels(const struct bContext *C, struct ARegion *ar, int vertical, char *context, int contextnr); void ED_region_header_init(struct ARegion *ar); void ED_region_header(const struct bContext *C, struct ARegion *ar); +void region_scissor_winrct(struct ARegion *ar, struct rcti *winrct); /* spaces */ void ED_spacetypes_init(void); diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index ea1541a4e02..320574fe8b3 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -249,7 +249,7 @@ void ED_area_overdraw(bContext *C) } /* get scissor rect, checking overlapping regions */ -static void region_scissor_winrct(ARegion *ar, rcti *winrct) +void region_scissor_winrct(ARegion *ar, rcti *winrct) { *winrct= ar->winrct; diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 3140ae76d4b..905657910b8 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1092,6 +1092,7 @@ void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d) { RegionView3D *rv3d= ar->regiondata; struct Base *base = scene->basact; + rcti winrct; /*for 2.43 release, don't use glext and just define the constant. this to avoid possibly breaking platforms before release.*/ @@ -1137,6 +1138,9 @@ void backdrawview3d(Scene *scene, ARegion *ar, View3D *v3d) glDisable(GL_DITHER); + region_scissor_winrct(ar, &winrct); + glScissor(winrct.xmin, winrct.ymin, winrct.xmax - winrct.xmin, winrct.ymax - winrct.ymin); + glClearColor(0.0, 0.0, 0.0, 0.0); if(v3d->zbuf) { glEnable(GL_DEPTH_TEST); From 23d9b6bcec742307498d927738c8837458a212c1 Mon Sep 17 00:00:00 2001 From: Diego Borghetti Date: Thu, 20 Aug 2009 21:09:48 +0000 Subject: [PATCH 173/577] View3D: shift+c center the view but no the cursor like 2.4x Probably missing because is not inside view3d_home, it's in the main winqreadview3dspace function. --- source/blender/editors/space_view3d/view3d_edit.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 5ef64274e72..a7ea19e49f9 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -857,6 +857,7 @@ static int viewhome_exec(bContext *C, wmOperator *op) /* was view3d_home() in 2. RegionView3D *rv3d= CTX_wm_region_view3d(C); Scene *scene= CTX_data_scene(C); Base *base; + float *curs; int center= RNA_boolean_get(op->ptr, "center"); @@ -866,6 +867,10 @@ static int viewhome_exec(bContext *C, wmOperator *op) /* was view3d_home() in 2. if(center) { min[0]= min[1]= min[2]= 0.0f; max[0]= max[1]= max[2]= 0.0f; + + /* in 2.4x this also move the cursor to (0, 0, 0) (with shift+c). */ + curs= give_cursor(scene, v3d); + curs[0]= curs[1]= curs[2]= 0.0; } else { INIT_MINMAX(min, max); From 2881393fbb42cca81ee4d36895fc248a22c54823 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Fri, 21 Aug 2009 00:46:36 +0000 Subject: [PATCH 174/577] 2.5 Paint: * Added airbrush and airbrush rate options to paint stroke. Works for sculpt, vertex paint, and weight paint. --- release/ui/space_view3d_toolbar.py | 5 +++++ .../blender/editors/sculpt_paint/paint_stroke.c | 17 ++++++++++++++++- .../blender/editors/sculpt_paint/paint_vertex.c | 4 ++++ source/blender/editors/sculpt_paint/sculpt.c | 2 ++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py index 5f42ff1d8b8..35df4dc8b54 100644 --- a/release/ui/space_view3d_toolbar.py +++ b/release/ui/space_view3d_toolbar.py @@ -449,6 +449,11 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel): col.active = brush.space col.itemR(brush, "spacing", text="Distance", slider=True) + layout.itemR(brush, "airbrush") + col = layout.column() + col.active = brush.airbrush + col.itemR(brush, "rate", slider=True) + class VIEW3D_PT_tools_brush_curve(PaintPanel): __label__ = "Curve" diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index 715399af888..bd9ea50e0f8 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -43,6 +43,8 @@ #include "BLI_arithb.h" +#include "PIL_time.h" + #include "BIF_gl.h" #include "BIF_glutil.h" @@ -57,6 +59,7 @@ typedef struct PaintStroke { void *mode_data; void *smooth_stroke_cursor; + wmTimer *timer; /* Cached values */ ViewContext vc; @@ -227,15 +230,22 @@ int paint_stroke_modal(bContext *C, wmOperator *op, wmEvent *event) PaintStroke *stroke = op->customdata; float mouse[2]; + if(event->type == TIMER && (event->customdata != stroke->timer)) + return OPERATOR_RUNNING_MODAL; + if(!stroke->stroke_started) { stroke->last_mouse_position[0] = event->x; stroke->last_mouse_position[1] = event->y; stroke->stroke_started = stroke->test_start(C, op, event); - if(stroke->stroke_started) + if(stroke->stroke_started) { stroke->smooth_stroke_cursor = WM_paint_cursor_activate(CTX_wm_manager(C), paint_poll, paint_draw_smooth_stroke, stroke); + if(stroke->brush->flag & BRUSH_AIRBRUSH) + stroke->timer = WM_event_add_window_timer(CTX_wm_window(C), TIMER, stroke->brush->rate); + } + ED_region_tag_redraw(ar); } @@ -254,9 +264,14 @@ int paint_stroke_modal(bContext *C, wmOperator *op, wmEvent *event) /* TODO: fix hardcoded event here */ if(event->type == LEFTMOUSE && event->val == 0) { + /* Exit stroke, free data */ + if(stroke->smooth_stroke_cursor) WM_paint_cursor_end(CTX_wm_manager(C), stroke->smooth_stroke_cursor); + if(stroke->timer) + WM_event_remove_window_timer(CTX_wm_window(C), stroke->timer); + stroke->done(C, stroke); MEM_freeN(stroke); return OPERATOR_FINISHED; diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 704773795e8..bc2ac480657 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1513,6 +1513,8 @@ static int wpaint_invoke(bContext *C, wmOperator *op, wmEvent *event) /* add modal handler */ WM_event_add_modal_handler(C, &CTX_wm_window(C)->handlers, op); + + op->type->modal(C, op, event); return OPERATOR_RUNNING_MODAL; } @@ -1803,6 +1805,8 @@ static int vpaint_invoke(bContext *C, wmOperator *op, wmEvent *event) /* add modal handler */ WM_event_add_modal_handler(C, &CTX_wm_window(C)->handlers, op); + + op->type->modal(C, op, event); return OPERATOR_RUNNING_MODAL; } diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 76c5c3504da..adaba804799 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -1439,6 +1439,8 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, wmEvent *even /* add modal handler */ WM_event_add_modal_handler(C, &CTX_wm_window(C)->handlers, op); + + op->type->modal(C, op, event); return OPERATOR_RUNNING_MODAL; } From 1be67b60fd08f640b56db23e08ad0469318f26b3 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 21 Aug 2009 02:51:56 +0000 Subject: [PATCH 175/577] 2.5: Modifiers & Menus * Popup menus now remember the last clicked item again. * Modifier and File Format menus are now organized in multiple columns with categories. * Hook, explode, uv project modifiers have all their buttons again with the relevant operators implemented. * Modifiers that can't be added by the user, or don't work on curves for example, are not in the menu anymore. * Fix search menu overlapping buttons when near the bottom of the screen. * Fix uv layers search menu not working in some modifiers. * Cleanup popup menu code a bit, layout engine is used in more cases now instead of ugly position calculation code. --- release/ui/buttons_data_mesh.py | 4 +- release/ui/buttons_data_modifier.py | 63 +- release/ui/buttons_material.py | 2 +- release/ui/space_image.py | 2 +- source/blender/blenkernel/BKE_modifier.h | 5 +- source/blender/blenkernel/intern/modifier.c | 5 +- source/blender/editors/include/UI_interface.h | 4 +- source/blender/editors/interface/interface.c | 25 +- .../editors/interface/interface_handlers.c | 21 +- .../editors/interface/interface_intern.h | 14 +- .../editors/interface/interface_layout.c | 62 +- .../editors/interface/interface_regions.c | 840 +++++------------- .../editors/interface/interface_templates.c | 4 +- source/blender/editors/object/object_edit.c | 9 +- source/blender/editors/object/object_intern.h | 11 +- .../blender/editors/object/object_modifier.c | 302 +++++-- source/blender/editors/object/object_ops.c | 7 +- source/blender/editors/screen/area.c | 5 - .../editors/space_view3d/view3d_header.c | 5 - source/blender/makesdna/DNA_modifier_types.h | 4 +- source/blender/makesrna/intern/rna_define.c | 10 +- source/blender/makesrna/intern/rna_modifier.c | 89 +- source/blender/makesrna/intern/rna_scene.c | 8 +- .../windowmanager/intern/wm_operators.c | 2 - 24 files changed, 708 insertions(+), 795 deletions(-) diff --git a/release/ui/buttons_data_mesh.py b/release/ui/buttons_data_mesh.py index b681218a8fe..c7663be1923 100644 --- a/release/ui/buttons_data_mesh.py +++ b/release/ui/buttons_data_mesh.py @@ -105,7 +105,7 @@ class DATA_PT_vertex_groups(DataButtonsPanel): row = layout.row() row.itemR(group, "name") - if context.edit_object: + if ob.mode == 'EDIT': row = layout.row() sub = row.row(align=True) @@ -180,7 +180,7 @@ class DATA_PT_shape_keys(DataButtonsPanel): layout.itemR(kb, "name") - if context.edit_object: + if ob.mode == 'EDIT': layout.enabled = False class DATA_PT_uv_texture(DataButtonsPanel): diff --git a/release/ui/buttons_data_modifier.py b/release/ui/buttons_data_modifier.py index 436baa540d4..cc50256f216 100644 --- a/release/ui/buttons_data_modifier.py +++ b/release/ui/buttons_data_modifier.py @@ -170,7 +170,7 @@ class DATA_PT_modifiers(DataButtonsPanel): if md.texture_coordinates == 'OBJECT': layout.itemR(md, "texture_coordinate_object", text="Object") elif md.texture_coordinates == 'UV' and ob.type == 'MESH': - layout.item_pointerR(md, "uv_layer", ob.data, "uv_layers") + layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures") def EDGE_SPLIT(self, layout, ob, md): split = layout.split() @@ -187,21 +187,36 @@ class DATA_PT_modifiers(DataButtonsPanel): def EXPLODE(self, layout, ob, md): layout.item_pointerR(md, "vertex_group", ob, "vertex_groups") layout.itemR(md, "protect") - layout.itemR(md, "split_edges") - layout.itemR(md, "unborn") - layout.itemR(md, "alive") - layout.itemR(md, "dead") - # Missing: "Refresh" and "Clear Vertex Group" Operator + + flow = layout.column_flow(2) + flow.itemR(md, "split_edges") + flow.itemR(md, "unborn") + flow.itemR(md, "alive") + flow.itemR(md, "dead") + + layout.itemO("object.explode_refresh", text="Refresh"); def FLUID_SIMULATION(self, layout, ob, md): layout.itemL(text="See Fluid panel.") def HOOK(self, layout, ob, md): - layout.itemR(md, "falloff") - layout.itemR(md, "force", slider=True) layout.itemR(md, "object") layout.item_pointerR(md, "vertex_group", ob, "vertex_groups") - # Missing: "Reset" and "Recenter" Operator + + split = layout.split() + split.itemR(md, "falloff") + split.itemR(md, "force", slider=True) + + layout.itemS() + + row = layout.row() + row.itemO("object.hook_reset", text="Reset") + row.itemO("object.hook_recenter", text="Recenter") + + if ob.mode == 'EDIT': + row = layout.row() + row.itemO("object.hook_select", text="Select") + row.itemO("object.hook_assign", text="Assign") def LATTICE(self, layout, ob, md): layout.itemR(md, "object") @@ -222,7 +237,7 @@ class DATA_PT_modifiers(DataButtonsPanel): layout.itemS() - layout.itemO("object.modifier_mdef_bind", text="Bind") + layout.itemO("object.meshdeform_bind", text="Bind") row = layout.row() row.itemR(md, "precision") row.itemR(md, "dynamic") @@ -346,16 +361,26 @@ class DATA_PT_modifiers(DataButtonsPanel): def UV_PROJECT(self, layout, ob, md): if ob.type == 'MESH': - layout.item_pointerR(md, "uv_layer", ob.data, "uv_layers") - #layout.itemR(md, "projectors") + layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures") layout.itemR(md, "image") layout.itemR(md, "override_image") - layout.itemL(text="Aspect Ratio:") - col = layout.column(align=True) - col.itemR(md, "horizontal_aspect_ratio", text="Horizontal") - col.itemR(md, "vertical_aspect_ratio", text="Vertical") - - #"Projectors" don't work. + + split = layout.split() + + col = split.column() + col.itemL(text="Aspect Ratio:") + + sub = col.column(align=True) + sub.itemR(md, "horizontal_aspect_ratio", text="Horizontal") + sub.itemR(md, "vertical_aspect_ratio", text="Vertical") + + col = split.column() + col.itemL(text="Projectors:") + + sub = col.column(align=True) + sub.itemR(md, "num_projectors", text="Number") + for proj in md.projectors: + sub.itemR(proj, "object", text="") def WAVE(self, layout, ob, md): split = layout.split() @@ -387,7 +412,7 @@ class DATA_PT_modifiers(DataButtonsPanel): layout.itemR(md, "texture") layout.itemR(md, "texture_coordinates") if md.texture_coordinates == 'MAP_UV' and ob.type == 'MESH': - layout.item_pointerR(md, "uv_layer", ob.data, "uv_layers") + layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures") elif md.texture_coordinates == 'OBJECT': layout.itemR(md, "texture_coordinates_object") diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py index b971a678926..ed3888ee4d8 100644 --- a/release/ui/buttons_material.py +++ b/release/ui/buttons_material.py @@ -48,7 +48,7 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel): col.itemO("object.material_slot_add", icon="ICON_ZOOMIN", text="") col.itemO("object.material_slot_remove", icon="ICON_ZOOMOUT", text="") - if context.edit_object: + if ob.mode == 'EDIT': row = layout.row(align=True) row.itemO("object.material_slot_assign", text="Assign") row.itemO("object.material_slot_select", text="Select") diff --git a/release/ui/space_image.py b/release/ui/space_image.py index 090067120b1..888b46e060e 100644 --- a/release/ui/space_image.py +++ b/release/ui/space_image.py @@ -247,7 +247,7 @@ class IMAGE_HT_header(bpy.types.Header): """ mesh = context.edit_object.data - row.item_pointerR(mesh, "active_uv_layer", mesh, "uv_layers") + row.item_pointerR(mesh, "active_uv_layer", mesh, "uv_textures") """ if ima: diff --git a/source/blender/blenkernel/BKE_modifier.h b/source/blender/blenkernel/BKE_modifier.h index b65d77751e2..27c75126026 100644 --- a/source/blender/blenkernel/BKE_modifier.h +++ b/source/blender/blenkernel/BKE_modifier.h @@ -90,7 +90,10 @@ typedef enum { eModifierTypeFlag_UsesPointCache = (1<<6), /* For physics modifiers, max one per type */ - eModifierTypeFlag_Single = (1<<7) + eModifierTypeFlag_Single = (1<<7), + + /* Some modifier can't be added manually by user */ + eModifierTypeFlag_NoUserAdd = (1<<8) } ModifierTypeFlag; typedef void (*ObjectWalkFunc)(void *userData, struct Object *ob, struct Object **obpoin); diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 4d567245ce1..37cf427b897 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -8616,7 +8616,8 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type) mti->freeData = smokeHRModifier_freeData; mti->flags = eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_UsesPointCache - | eModifierTypeFlag_Single; + | eModifierTypeFlag_Single + | eModifierTypeFlag_NoUserAdd; mti->deformVerts = smokeHRModifier_deformVerts; mti->dependsOnTime = smokeHRModifier_dependsOnTime; mti->updateDepgraph = smokeHRModifier_updateDepgraph; @@ -8647,7 +8648,7 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type) mti = INIT_TYPE(Surface); mti->type = eModifierTypeType_OnlyDeform; mti->initData = surfaceModifier_initData; - mti->flags = eModifierTypeFlag_AcceptsMesh; + mti->flags = eModifierTypeFlag_AcceptsMesh|eModifierTypeFlag_NoUserAdd; mti->dependsOnTime = surfaceModifier_dependsOnTime; mti->freeData = surfaceModifier_freeData; mti->deformVerts = surfaceModifier_deformVerts; diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 42280ad17c9..5bf59b06bc4 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -100,6 +100,8 @@ typedef struct uiLayout uiLayout; #define UI_BLOCK_KEEP_OPEN 256 #define UI_BLOCK_POPUP 512 #define UI_BLOCK_OUT_1 1024 +#define UI_BLOCK_NO_FLIP 2048 +#define UI_BLOCK_POPUP_MEMORY 4096 /* uiPopupBlockHandle->menuretval */ #define UI_RETURN_CANCEL 1 /* cancel all menus cascading */ @@ -254,8 +256,6 @@ void uiPupMenuNotice(struct bContext *C, char *str, ...); void uiPupMenuError(struct bContext *C, char *str, ...); void uiPupMenuReports(struct bContext *C, struct ReportList *reports); -void uiPupMenuSetActive(int val); - /* Popup Blocks * * Functions used to create popup blocks. These are like popup menus diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 92a3a4cf841..9bd6c2577ff 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -225,6 +225,7 @@ static void ui_text_bounds_block(uiBlock *block, float offset) uiStyle *style= U.uistyles.first; // XXX pass on as arg uiBut *bt; int i = 0, j, x1addval= offset, nextcol; + int lastcol= 0, col= 0; uiStyleFontSet(&style->widget); @@ -237,18 +238,26 @@ static void ui_text_bounds_block(uiBlock *block, float offset) if(j > i) i = j; } + + if(bt->next && bt->x1 < bt->next->x1) + lastcol++; } /* cope with multi collumns */ bt= block->buttons.first; while(bt) { - if(bt->next && bt->x1 < bt->next->x1) + if(bt->next && bt->x1 < bt->next->x1) { nextcol= 1; + col++; + } else nextcol= 0; bt->x1 = x1addval; bt->x2 = bt->x1 + i + block->bounds; + if(col == lastcol) + bt->x2= MAX2(bt->x2, offset + block->minbounds); + ui_check_but(bt); // clips text again if(nextcol) @@ -281,7 +290,7 @@ void ui_bounds_block(uiBlock *block) if(bt->x2 > block->maxx) block->maxx= bt->x2; if(bt->y2 > block->maxy) block->maxy= bt->y2; - + bt= bt->next; } @@ -291,6 +300,8 @@ void ui_bounds_block(uiBlock *block) block->maxy += block->bounds; } + block->maxx= block->minx + MAX2(block->maxx - block->minx, block->minbounds); + /* hardcoded exception... but that one is annoying with larger safety */ bt= block->buttons.first; if(bt && strncmp(bt->str, "ERROR", 5)==0) xof= 10; @@ -2286,8 +2297,12 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1, dynstr= BLI_dynstr_new(); BLI_dynstr_appendf(dynstr, "%s%%t", RNA_property_ui_name(prop)); for(i=0; iflag & UI_BLOCK_NO_FLIP) + return; for(but= block->buttons.first; but; but= but->next) { if(but->flag & UI_BUT_ALIGN) return; diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index e3518b446ba..b69e8319956 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1720,6 +1720,7 @@ static void ui_blockopen_begin(bContext *C, uiBut *but, uiHandleButtonData *data uiBlockCreateFunc func= NULL; uiBlockHandleCreateFunc handlefunc= NULL; uiMenuCreateFunc menufunc= NULL; + char *menustr= NULL; void *arg= NULL; switch(but->type) { @@ -1744,16 +1745,15 @@ static void ui_blockopen_begin(bContext *C, uiBut *but, uiHandleButtonData *data data->value= data->origvalue; but->editval= &data->value; - handlefunc= ui_block_func_MENU; - arg= but; + menustr= but->str; } break; case ICONROW: - handlefunc= ui_block_func_ICONROW; + menufunc= ui_block_func_ICONROW; arg= but; break; case ICONTEXTROW: - handlefunc= ui_block_func_ICONTEXTROW; + menufunc= ui_block_func_ICONTEXTROW; arg= but; break; case COL: @@ -1771,8 +1771,8 @@ static void ui_blockopen_begin(bContext *C, uiBut *but, uiHandleButtonData *data if(but->block->handle) data->menu->popup= but->block->handle->popup; } - else if(menufunc) { - data->menu= ui_popup_menu_create(C, data->region, but, menufunc, arg); + else if(menufunc || menustr) { + data->menu= ui_popup_menu_create(C, data->region, but, menufunc, arg, menustr); if(but->block->handle) data->menu->popup= but->block->handle->popup; } @@ -3729,10 +3729,15 @@ static void button_activate_exit(bContext *C, uiHandleButtonData *data, uiBut *b } } - /* autokey & undo push */ - if(!data->cancel) + if(!data->cancel) { + /* autokey & undo push */ ui_apply_autokey_undo(C, but); + /* popup menu memory */ + if(block->flag & UI_BLOCK_POPUP_MEMORY) + ui_popup_menu_memory(block, but); + } + /* disable tooltips until mousemove + last active flag */ for(block=data->region->uiblocks.first; block; block=block->next) { for(bt=block->buttons.first; bt; bt=bt->next) diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 9ef5d65b69f..806b40b8646 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -287,7 +287,8 @@ struct uiBlock { char *lockstr; float xofs, yofs; // offset to parent button - int bounds, dobounds, mx, my; // for doing delayed + int dobounds, mx, my; // for doing delayed + int bounds, minbounds; // for doing delayed int endblock; // uiEndBlock done? rctf safety; // pulldowns, to detect outside, can differ per case how it is created @@ -297,6 +298,7 @@ struct uiBlock { int tooltipdisabled; // to avoid tooltip after click int active; // to keep blocks while drawing and free them afterwards + int puphash; // popup menu hash for memory void *evil_C; // XXX hack for dynamic operator enums }; @@ -372,14 +374,15 @@ struct uiPopupBlockHandle { float retvec[3]; }; -uiBlock *ui_block_func_MENU(struct bContext *C, uiPopupBlockHandle *handle, void *arg_but); -uiBlock *ui_block_func_ICONROW(struct bContext *C, uiPopupBlockHandle *handle, void *arg_but); -uiBlock *ui_block_func_ICONTEXTROW(struct bContext *C, uiPopupBlockHandle *handle, void *arg_but); uiBlock *ui_block_func_COL(struct bContext *C, uiPopupBlockHandle *handle, void *arg_but); +void ui_block_func_ICONROW(struct bContext *C, uiLayout *layout, void *arg_but); +void ui_block_func_ICONTEXTROW(struct bContext *C, uiLayout *layout, void *arg_but); struct ARegion *ui_tooltip_create(struct bContext *C, struct ARegion *butregion, uiBut *but); void ui_tooltip_free(struct bContext *C, struct ARegion *ar); +uiBut *ui_popup_menu_memory(uiBlock *block, uiBut *but); + /* searchbox for string button */ ARegion *ui_searchbox_create(struct bContext *C, struct ARegion *butregion, uiBut *but); int ui_searchbox_inside(struct ARegion *ar, int x, int y); @@ -394,7 +397,8 @@ typedef uiBlock* (*uiBlockHandleCreateFunc)(struct bContext *C, struct uiPopupBl uiPopupBlockHandle *ui_popup_block_create(struct bContext *C, struct ARegion *butregion, uiBut *but, uiBlockCreateFunc create_func, uiBlockHandleCreateFunc handle_create_func, void *arg); uiPopupBlockHandle *ui_popup_menu_create(struct bContext *C, struct ARegion *butregion, uiBut *but, - uiMenuCreateFunc create_func, void *arg); + uiMenuCreateFunc create_func, void *arg, char *str); + void ui_popup_block_free(struct bContext *C, uiPopupBlockHandle *handle); void ui_set_name_menu(uiBut *but, int value); diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index fc4f7da56d2..ab27f8fb0f6 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -619,6 +619,8 @@ void uiItemsEnumO(uiLayout *layout, char *opname, char *propname) wmOperatorType *ot= WM_operatortype_find(opname, 0); PointerRNA ptr; PropertyRNA *prop; + uiBut *bt; + uiBlock *block= layout->root->block; if(!ot || !ot->srna) { ui_item_disabled(layout, opname); @@ -631,14 +633,31 @@ void uiItemsEnumO(uiLayout *layout, char *opname, char *propname) if(prop && RNA_property_type(prop) == PROP_ENUM) { EnumPropertyItem *item; int totitem, i, free; + uiLayout *split= uiLayoutSplit(layout, 0); + uiLayout *column= uiLayoutColumn(split, 0); - RNA_property_enum_items(layout->root->block->evil_C, &ptr, prop, &item, &totitem, &free); + RNA_property_enum_items(block->evil_C, &ptr, prop, &item, &totitem, &free); - for(i=0; iflag |= UI_BLOCK_NO_FLIP; + } + + uiItemL(column, (char*)item[i].name, 0); + bt= block->buttons.last; + bt->flag= UI_TEXT_LEFT; + } + else + uiItemS(column); + } + } if(free) MEM_freeN(item); @@ -924,6 +943,8 @@ void uiItemEnumR_string(uiLayout *layout, char *name, int icon, struct PointerRN void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname) { PropertyRNA *prop; + uiBlock *block= layout->root->block; + uiBut *bt; prop= RNA_struct_find_property(ptr, propname); @@ -935,14 +956,31 @@ void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname) if(RNA_property_type(prop) == PROP_ENUM) { EnumPropertyItem *item; int totitem, i, free; + uiLayout *split= uiLayoutSplit(layout, 0); + uiLayout *column= uiLayoutColumn(split, 0); - RNA_property_enum_items(layout->root->block->evil_C, ptr, prop, &item, &totitem, &free); + RNA_property_enum_items(block->evil_C, ptr, prop, &item, &totitem, &free); - for(i=0; iflag |= UI_BLOCK_NO_FLIP; + } + + uiItemL(column, (char*)item[i].name, 0); + bt= block->buttons.last; + bt->flag= UI_TEXT_LEFT; + } + else + uiItemS(column); + } + } if(free) MEM_freeN(item); diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index bf921715524..e83dca5a500 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -38,6 +38,7 @@ #include "BLI_arithb.h" #include "BLI_blenlib.h" #include "BLI_dynstr.h" +#include "BLI_ghash.h" #include "BKE_context.h" #include "BKE_icons.h" @@ -75,13 +76,14 @@ /*********************** Menu Data Parsing ********************* */ -typedef struct { +typedef struct MenuEntry { char *str; int retval; int icon; + int sepr; } MenuEntry; -typedef struct { +typedef struct MenuData { char *instr; char *title; int titleicon; @@ -111,7 +113,7 @@ static void menudata_set_title(MenuData *md, char *title, int titleicon) md->titleicon= titleicon; } -static void menudata_add_item(MenuData *md, char *str, int retval, int icon) +static void menudata_add_item(MenuData *md, char *str, int retval, int icon, int sepr) { if (md->nitems==md->itemssize) { int nsize= md->itemssize?(md->itemssize<<1):1; @@ -129,6 +131,7 @@ static void menudata_add_item(MenuData *md, char *str, int retval, int icon) md->items[md->nitems].str= str; md->items[md->nitems].retval= retval; md->items[md->nitems].icon= icon; + md->items[md->nitems].sepr= sepr; md->nitems++; } @@ -142,12 +145,13 @@ void menudata_free(MenuData *md) /** * Parse menu description strings, string is of the - * form "[sss%t|]{(sss[%xNN]|), (%l|)}", ssss%t indicates the + * form "[sss%t|]{(sss[%xNN]|), (%l|), (sss%l|)}", ssss%t indicates the * menu title, sss or sss%xNN indicates an option, * if %xNN is given then NN is the return value if * that option is selected otherwise the return value * is the index of the option (starting with 1). %l - * indicates a seperator. + * indicates a seperator, sss%l indicates a label and + * new column. * * @param str String to be parsed. * @retval new menudata structure, free with menudata_free() @@ -157,7 +161,7 @@ MenuData *decompose_menu_string(char *str) char *instr= BLI_strdup(str); MenuData *md= menudata_new(instr); char *nitem= NULL, *s= instr; - int nicon=0, nretval= 1, nitem_is_title= 0; + int nicon=0, nretval= 1, nitem_is_title= 0, nitem_is_sepr= 0; while (1) { char c= *s; @@ -174,7 +178,10 @@ MenuData *decompose_menu_string(char *str) *s= '\0'; s++; } else if (s[1]=='l') { - nitem= "%l"; + nitem_is_sepr= 1; + if(!nitem) nitem= ""; + + *s= '\0'; s++; } else if (s[1]=='i') { nicon= atoi(s+2); @@ -186,15 +193,18 @@ MenuData *decompose_menu_string(char *str) if (nitem) { *s= '\0'; - if (nitem_is_title) { + if(nitem_is_title) { menudata_set_title(md, nitem, nicon); nitem_is_title= 0; - } else { + } + else if(nitem_is_sepr) { /* prevent separator to get a value */ - if(nitem[0]=='%' && nitem[1]=='l') - menudata_add_item(md, nitem, -1, nicon); - else - menudata_add_item(md, nitem, nretval, nicon); + menudata_add_item(md, nitem, -1, nicon, 1); + nretval= md->nitems+1; + nitem_is_sepr= 0; + } + else { + menudata_add_item(md, nitem, nretval, nicon, 0); nretval= md->nitems+1; } @@ -827,6 +837,8 @@ static void ui_searchbox_region_free(ARegion *ar) ar->regiondata= NULL; } +static void ui_block_position(wmWindow *window, ARegion *butregion, uiBut *but, uiBlock *block); + ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but) { uiStyle *style= U.uistyles.first; // XXX pass on as arg @@ -847,7 +859,7 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but) /* create searchbox data */ data= MEM_callocN(sizeof(uiSearchboxData), "uiSearchboxData"); - + /* set font, get bb */ data->fstyle= style->widget; /* copy struct */ data->fstyle.align= UI_STYLE_TEXT_CENTER; @@ -929,10 +941,14 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but) } } if(y1 < 0) { - y1 += 36; - y2 += 36; + int newy1; + UI_view2d_to_region_no_clip(&butregion->v2d, 0, but->y2 + ofsy, 0, &newy1); + newy1 += butregion->winrct.ymin; + + y2= y2-y1 + newy1; + y1= newy1; } - + /* widget rect, in region coords */ data->bbox.xmin= MENU_SHADOW_SIDE; data->bbox.xmax= x2-x1 + MENU_SHADOW_SIDE; @@ -1310,24 +1326,21 @@ void ui_popup_block_free(bContext *C, uiPopupBlockHandle *handle) /***************************** Menu Button ***************************/ -uiBlock *ui_block_func_MENU(bContext *C, uiPopupBlockHandle *handle, void *arg_but) +static void ui_block_func_MENUSTR(bContext *C, uiLayout *layout, void *arg_str) { - uiBut *but= arg_but; - uiBlock *block; + uiBlock *block= uiLayoutGetBlock(layout); + uiPopupBlockHandle *handle= block->handle; + uiLayout *split, *column; uiBut *bt; MenuData *md; - ListBase lb; - float aspect; - int width, height, boxh, columns, rows, startx, starty, x1, y1, xmax, a; - - /* create the block */ - block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP); - block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT; + MenuEntry *entry; + char *instr= arg_str; + int columns, rows, a, b; /* compute menu data */ - md= decompose_menu_string(but->str); + md= decompose_menu_string(instr); - /* columns and row calculation */ + /* columns and row estimation */ columns= (md->nitems+20)/20; if(columns<1) columns= 1; @@ -1339,180 +1352,114 @@ uiBlock *ui_block_func_MENU(bContext *C, uiPopupBlockHandle *handle, void *arg_b rows= 1; while(rows*columnsnitems) rows++; - - /* prevent scaling up of pupmenu */ - aspect= but->block->aspect; - if(aspect < 1.0f) - aspect = 1.0f; - /* size and location */ - if(md->title) - width= 1.5*aspect*strlen(md->title)+UI_GetStringWidth(md->title); - else - width= 0; - - for(a=0; anitems; a++) { - xmax= aspect*UI_GetStringWidth(md->items[a].str); - if(md->items[a].icon) - xmax += 20*aspect; - if(xmax>width) - width= xmax; - } - - width+= 10; - if(width < (but->x2 - but->x1)) - width = (but->x2 - but->x1); - if(width<50) - width=50; - - boxh= MENU_BUTTON_HEIGHT; - - height= rows*boxh; - if(md->title) - height+= boxh; - - /* here we go! */ - startx= but->x1; - starty= but->y1; - + /* create title */ if(md->title) { - uiBut *bt; - - if (md->titleicon) { - bt= uiDefIconTextBut(block, LABEL, 0, md->titleicon, md->title, startx, (short)(starty+rows*boxh), (short)width, (short)boxh, NULL, 0.0, 0.0, 0, 0, ""); - } else { - bt= uiDefBut(block, LABEL, 0, md->title, startx, (short)(starty+rows*boxh), (short)width, (short)boxh, NULL, 0.0, 0.0, 0, 0, ""); + if(md->titleicon) { + uiItemL(layout, md->title, md->titleicon); + } + else { + uiItemL(layout, md->title, 0); + bt= block->buttons.last; bt->flag= UI_TEXT_LEFT; } } - for(a=0; anitems; a++) { - - x1= startx + width*((int)(md->nitems-a-1)/rows); - y1= starty - boxh*(rows - ((md->nitems - a - 1)%rows)) + (rows*boxh); + /* inconsistent, but menus with labels do not look good flipped */ + for(a=0, b=0; anitems; a++, b++) { + entry= &md->items[a]; - if (strcmp(md->items[md->nitems-a-1].str, "%l")==0) { - bt= uiDefBut(block, SEPR, B_NOP, "", x1, y1,(short)(width-(rows>1)), (short)(boxh-1), NULL, 0.0, 0.0, 0, 0, ""); + if(entry->sepr && entry->str[0]) + block->flag |= UI_BLOCK_NO_FLIP; + } + + /* create items */ + split= uiLayoutSplit(layout, 0); + + for(a=0, b=0; anitems; a++, b++) { + if(block->flag & UI_BLOCK_NO_FLIP) + entry= &md->items[a]; + else + entry= &md->items[md->nitems-a-1]; + + /* new column on N rows or on separation label */ + if((b % rows == 0) || (entry->sepr && entry->str[0])) { + column= uiLayoutColumn(split, 0); + b= 0; } - else if(md->items[md->nitems-a-1].icon) { - bt= uiDefIconTextButF(block, BUTM|FLO, B_NOP, md->items[md->nitems-a-1].icon ,md->items[md->nitems-a-1].str, x1, y1,(short)(width-(rows>1)), (short)(boxh-1), &handle->retvalue, (float) md->items[md->nitems-a-1].retval, 0.0, 0, 0, ""); + + if(entry->sepr) { + uiItemL(column, entry->str, entry->icon); + bt= block->buttons.last; + bt->flag= UI_TEXT_LEFT; + } + else if(entry->icon) { + uiDefIconTextButF(block, BUTM|FLO, B_NOP, entry->icon, entry->str, 0, 0, + UI_UNIT_X*5, UI_UNIT_Y, &handle->retvalue, (float) entry->retval, 0.0, 0, 0, ""); } else { - bt= uiDefButF(block, BUTM|FLO, B_NOP, md->items[md->nitems-a-1].str, x1, y1,(short)(width-(rows>1)), (short)(boxh-1), &handle->retvalue, (float) md->items[md->nitems-a-1].retval, 0.0, 0, 0, ""); + uiDefButF(block, BUTM|FLO, B_NOP, entry->str, 0, 0, + UI_UNIT_X*5, UI_UNIT_X, &handle->retvalue, (float) entry->retval, 0.0, 0, 0, ""); } } menudata_free(md); - - /* the code up here has flipped locations, because of change of preferred order */ - /* thats why we have to switch list order too, to make arrowkeys work */ - - lb.first= lb.last= NULL; - bt= block->buttons.first; - while(bt) { - uiBut *next= bt->next; - BLI_remlink(&block->buttons, bt); - BLI_addhead(&lb, bt); - bt= next; - } - block->buttons= lb; - - block->direction= UI_TOP; - uiEndBlock(C, block); - - return block; } -uiBlock *ui_block_func_ICONROW(bContext *C, uiPopupBlockHandle *handle, void *arg_but) +void ui_block_func_ICONROW(bContext *C, uiLayout *layout, void *arg_but) { + uiBlock *block= uiLayoutGetBlock(layout); + uiPopupBlockHandle *handle= block->handle; uiBut *but= arg_but; - uiBlock *block; int a; - block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP); - block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT; - - for(a=(int)but->hardmin; a<=(int)but->hardmax; a++) { - uiDefIconButF(block, BUTM|FLO, B_NOP, but->icon+(a-but->hardmin), 0, (short)(18*a), (short)(but->x2-but->x1-4), 18, &handle->retvalue, (float)a, 0.0, 0, 0, ""); - } - - block->direction= UI_TOP; - - uiEndBlock(C, block); - - return block; + for(a=(int)but->hardmin; a<=(int)but->hardmax; a++) + uiDefIconButF(block, BUTM|FLO, B_NOP, but->icon+(a-but->hardmin), 0, 0, UI_UNIT_X*5, UI_UNIT_Y, + &handle->retvalue, (float)a, 0.0, 0, 0, ""); } -uiBlock *ui_block_func_ICONTEXTROW(bContext *C, uiPopupBlockHandle *handle, void *arg_but) +void ui_block_func_ICONTEXTROW(bContext *C, uiLayout *layout, void *arg_but) { - uiBut *but= arg_but; - uiBlock *block; + uiBlock *block= uiLayoutGetBlock(layout); + uiPopupBlockHandle *handle= block->handle; + uiBut *but= arg_but, *bt; MenuData *md; - int width, xmax, ypos, a; - - block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP); - block->flag= UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT; + MenuEntry *entry; + int a; md= decompose_menu_string(but->str); - /* size and location */ - /* expand menu width to fit labels */ - if(md->title) - width= 2*strlen(md->title)+UI_GetStringWidth(md->title); - else - width= 0; - - for(a=0; anitems; a++) { - xmax= UI_GetStringWidth(md->items[a].str); - if(xmax>width) width= xmax; + /* title */ + if(md->title) { + bt= uiDefBut(block, LABEL, 0, md->title, 0, 0, UI_UNIT_X*5, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); + bt->flag= UI_TEXT_LEFT; } - width+= 30; - if (width<50) width=50; - - ypos = 1; - /* loop through the menu options and draw them out with icons & text labels */ for(a=0; anitems; a++) { + entry= &md->items[md->nitems-a-1]; - /* add a space if there's a separator (%l) */ - if (strcmp(md->items[a].str, "%l")==0) { - ypos +=3; - } - else { - uiDefIconTextButF(block, BUTM|FLO, B_NOP, (short)((but->icon)+(md->items[a].retval-but->hardmin)), md->items[a].str, 0, ypos,(short)width, 19, &handle->retvalue, (float) md->items[a].retval, 0.0, 0, 0, ""); - ypos += 20; - } + if(entry->sepr) + uiItemS(layout); + else + uiDefIconTextButF(block, BUTM|FLO, B_NOP, (short)((but->icon)+(entry->retval-but->hardmin)), entry->str, + 0, 0, UI_UNIT_X*5, UI_UNIT_Y, &handle->retvalue, (float) entry->retval, 0.0, 0, 0, ""); } - - if(md->title) { - uiBut *bt; - bt= uiDefBut(block, LABEL, 0, md->title, 0, ypos, (short)width, 19, NULL, 0.0, 0.0, 0, 0, ""); - bt->flag= UI_TEXT_LEFT; - } - menudata_free(md); - - block->direction= UI_TOP; - - uiBoundsBlock(block, 3); - uiEndBlock(C, block); - - return block; } +#if 0 static void ui_warp_pointer(short x, short y) { /* XXX 2.50 which function to use for this? */ -#if 0 /* OSX has very poor mousewarp support, it sends events; this causes a menu being pressed immediately ... */ #ifndef __APPLE__ warp_pointer(x, y); #endif -#endif } +#endif /********************* Color Button ****************/ @@ -2158,406 +2105,115 @@ void uiBlockColorbandButtons(uiBlock *block, ColorBand *coba, rctf *butr, int ev } -/* ******************** PUPmenu ****************** */ +/************************ Popup Menu Memory ****************************/ -static int pupmenu_set= 0; - -void uiPupMenuSetActive(int val) +static int ui_popup_menu_hash(char *str) { - pupmenu_set= val; + return BLI_ghashutil_strhash(str); } -/* value== -1 read, otherwise set */ -static int pupmenu_memory(char *str, int value) +/* but == NULL read, otherwise set */ +uiBut *ui_popup_menu_memory(uiBlock *block, uiBut *but) { static char mem[256], first=1; - int val=0, nr=0; + int hash= block->puphash; if(first) { - memset(mem, 0, 256); + /* init */ + memset(mem, -1, sizeof(mem)); first= 0; } - while(str[nr]) { - val+= str[nr]; - nr++; - } - if(value >= 0) mem[ val & 255 ]= value; - else return mem[ val & 255 ]; - - return 0; + if(but) { + /* set */ + mem[hash & 255 ]= BLI_findindex(&block->buttons, but); + return NULL; + } + else { + /* get */ + return BLI_findlink(&block->buttons, mem[hash & 255]); + } } -#define PUP_LABELH 6 - -typedef struct uiPupMenuInfo { - char *instr; - int mx, my; - int startx, starty; - int maxrow; -} uiPupMenuInfo; - -uiBlock *ui_block_func_PUPMENU(bContext *C, uiPopupBlockHandle *handle, void *arg_info) -{ - uiBlock *block; - uiPupMenuInfo *info; - int columns, rows, mousemove[2]= {0, 0}, mousewarp= 0; - int width, height, xmax, ymax, maxrow; - int a, startx, starty, endx, endy, x1, y1; - int lastselected; - MenuData *md; - - info= arg_info; - maxrow= info->maxrow; - height= 0; - - /* block stuff first, need to know the font */ - block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP); - uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_NUMSELECT); - block->direction= UI_DOWN; - - md= decompose_menu_string(info->instr); - - rows= md->nitems; - if(rows<1) - rows= 1; - - columns= 1; - - /* size and location, title slightly bigger for bold */ - if(md->title) { - width= 2*strlen(md->title)+UI_GetStringWidth(md->title); - width /= columns; - } - else width= 0; - - for(a=0; anitems; a++) { - xmax= UI_GetStringWidth(md->items[a].str); - if(xmax>width) width= xmax; - - if(strcmp(md->items[a].str, "%l")==0) height+= PUP_LABELH; - else height+= MENU_BUTTON_HEIGHT; - } - - width+= 10; - if (width<50) width=50; - - wm_window_get_size(CTX_wm_window(C), &xmax, &ymax); - - /* set first item */ - lastselected= 0; - if(pupmenu_set) { - lastselected= pupmenu_set-1; - pupmenu_set= 0; - } - else if(md->nitems>1) { - lastselected= pupmenu_memory(info->instr, -1); - } - - startx= info->mx-(0.8*(width)); - starty= info->my-height+MENU_BUTTON_HEIGHT/2; - if(lastselected>=0 && lastselectednitems) { - for(a=0; anitems; a++) { - if(a==lastselected) break; - if( strcmp(md->items[a].str, "%l")==0) starty+= PUP_LABELH; - else starty+=MENU_BUTTON_HEIGHT; - } - - //starty= info->my-height+MENU_BUTTON_HEIGHT/2+lastselected*MENU_BUTTON_HEIGHT; - } - - if(startx<10) { - startx= 10; - } - if(starty<10) { - mousemove[1]= 10-starty; - starty= 10; - } - - endx= startx+width*columns; - endy= starty+height; - - if(endx>xmax) { - endx= xmax-10; - startx= endx-width*columns; - } - if(endy>ymax-20) { - mousemove[1]= ymax-endy-20; - endy= ymax-20; - starty= endy-height; - } - - if(mousemove[0] || mousemove[1]) { - ui_warp_pointer(info->mx+mousemove[0], info->my+mousemove[1]); - mousemove[0]= info->mx; - mousemove[1]= info->my; - mousewarp= 1; - } - - /* here we go! */ - if(md->title) { - uiBut *bt; - char titlestr[256]; - - if(md->titleicon) { - width+= 20; - sprintf(titlestr, " %s", md->title); - uiDefIconTextBut(block, LABEL, 0, md->titleicon, titlestr, startx, (short)(starty+height), width, MENU_BUTTON_HEIGHT, NULL, 0.0, 0.0, 0, 0, ""); - } - else { - bt= uiDefBut(block, LABEL, 0, md->title, startx, (short)(starty+height), columns*width, MENU_BUTTON_HEIGHT, NULL, 0.0, 0.0, 0, 0, ""); - bt->flag= UI_TEXT_LEFT; - } - - //uiDefBut(block, SEPR, 0, "", startx, (short)(starty+height)-MENU_SEPR_HEIGHT, width, MENU_SEPR_HEIGHT, NULL, 0.0, 0.0, 0, 0, ""); - } - - x1= startx + width*((int)a/rows); - y1= starty + height - MENU_BUTTON_HEIGHT; // - MENU_SEPR_HEIGHT; - - for(a=0; anitems; a++) { - char *name= md->items[a].str; - int icon = md->items[a].icon; - - if(strcmp(name, "%l")==0) { - uiDefBut(block, SEPR, B_NOP, "", x1, y1, width, PUP_LABELH, NULL, 0, 0.0, 0, 0, ""); - y1 -= PUP_LABELH; - } - else if (icon) { - uiDefIconButF(block, BUTM, B_NOP, icon, x1, y1, width+16, MENU_BUTTON_HEIGHT-1, &handle->retvalue, (float) md->items[a].retval, 0.0, 0, 0, ""); - y1 -= MENU_BUTTON_HEIGHT; - } - else { - uiDefButF(block, BUTM, B_NOP, name, x1, y1, width, MENU_BUTTON_HEIGHT-1, &handle->retvalue, (float) md->items[a].retval, 0.0, 0, 0, ""); - y1 -= MENU_BUTTON_HEIGHT; - } - } - - uiBoundsBlock(block, 1); - uiEndBlock(C, block); - - menudata_free(md); - - /* XXX 2.5 need to store last selected */ -#if 0 - /* calculate last selected */ - if(event & ui_return_ok) { - lastselected= 0; - for(a=0; anitems; a++) { - if(val==md->items[a].retval) lastselected= a; - } - - pupmenu_memory(info->instr, lastselected); - } -#endif - - /* XXX 2.5 need to warp back */ -#if 0 - if(mousemove[1] && (event & ui_return_out)==0) - ui_warp_pointer(mousemove[0], mousemove[1]); - return val; -#endif - - return block; -} - -uiBlock *ui_block_func_PUPMENUCOL(bContext *C, uiPopupBlockHandle *handle, void *arg_info) -{ - uiBlock *block; - uiPupMenuInfo *info; - int columns, rows, mousemove[2]= {0, 0}, mousewarp; - int width, height, xmax, ymax, maxrow; - int a, startx, starty, endx, endy, x1, y1; - float fvalue; - MenuData *md; - - info= arg_info; - maxrow= info->maxrow; - height= 0; - - /* block stuff first, need to know the font */ - block= uiBeginBlock(C, handle->region, "menu", UI_EMBOSSP); - uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_RET_1|UI_BLOCK_NUMSELECT); - block->direction= UI_DOWN; - - md= decompose_menu_string(info->instr); - - /* columns and row calculation */ - columns= (md->nitems+maxrow)/maxrow; - if (columns<1) columns= 1; - - if(columns > 8) { - maxrow += 5; - columns= (md->nitems+maxrow)/maxrow; - } - - rows= (int) md->nitems/columns; - if (rows<1) rows= 1; - - while (rows*columns<(md->nitems+columns) ) rows++; - - /* size and location, title slightly bigger for bold */ - if(md->title) { - width= 2*strlen(md->title)+UI_GetStringWidth(md->title); - width /= columns; - } - else width= 0; - - for(a=0; anitems; a++) { - xmax= UI_GetStringWidth(md->items[a].str); - if(xmax>width) width= xmax; - } - - width+= 10; - if (width<50) width=50; - - height= rows*MENU_BUTTON_HEIGHT; - if (md->title) height+= MENU_BUTTON_HEIGHT; - - wm_window_get_size(CTX_wm_window(C), &xmax, &ymax); - - /* find active item */ - fvalue= handle->retvalue; - for(a=0; anitems; a++) { - if( md->items[a].retval== (int)fvalue ) break; - } - - /* no active item? */ - if(a==md->nitems) { - if(md->title) a= -1; - else a= 0; - } - - if(a>0) - startx = info->mx-width/2 - ((int)(a)/rows)*width; - else - startx= info->mx-width/2; - starty = info->my-height + MENU_BUTTON_HEIGHT/2 + ((a)%rows)*MENU_BUTTON_HEIGHT; - - if (md->title) starty+= MENU_BUTTON_HEIGHT; - - if(startx<10) { - mousemove[0]= 10-startx; - startx= 10; - } - if(starty<10) { - mousemove[1]= 10-starty; - starty= 10; - } - - endx= startx+width*columns; - endy= starty+height; - - if(endx>xmax) { - mousemove[0]= xmax-endx-10; - endx= xmax-10; - startx= endx-width*columns; - } - if(endy>ymax) { - mousemove[1]= ymax-endy-10; - endy= ymax-10; - starty= endy-height; - } - - if(mousemove[0] || mousemove[1]) { - ui_warp_pointer(info->mx+mousemove[0], info->my+mousemove[1]); - mousemove[0]= info->mx; - mousemove[1]= info->my; - mousewarp= 1; - } - - /* here we go! */ - if(md->title) { - uiBut *bt; - - if(md->titleicon) { - } - else { - bt= uiDefBut(block, LABEL, 0, md->title, startx, (short)(starty+rows*MENU_BUTTON_HEIGHT), columns*width, MENU_BUTTON_HEIGHT, NULL, 0.0, 0.0, 0, 0, ""); - bt->flag= UI_TEXT_LEFT; - } - } - - for(a=0; anitems; a++) { - char *name= md->items[a].str; - int icon = md->items[a].icon; - - x1= startx + width*((int)a/rows); - y1= starty - MENU_BUTTON_HEIGHT*(a%rows) + (rows-1)*MENU_BUTTON_HEIGHT; - - if(strcmp(name, "%l")==0) { - uiDefBut(block, SEPR, B_NOP, "", x1, y1, width, PUP_LABELH, NULL, 0, 0.0, 0, 0, ""); - y1 -= PUP_LABELH; - } - else if (icon) { - uiDefIconButF(block, BUTM, B_NOP, icon, x1, y1, width+16, MENU_BUTTON_HEIGHT-1, &handle->retvalue, (float) md->items[a].retval, 0.0, 0, 0, ""); - y1 -= MENU_BUTTON_HEIGHT; - } - else { - uiDefButF(block, BUTM, B_NOP, name, x1, y1, width, MENU_BUTTON_HEIGHT-1, &handle->retvalue, (float) md->items[a].retval, 0.0, 0, 0, ""); - y1 -= MENU_BUTTON_HEIGHT; - } - } - - uiBoundsBlock(block, 1); - uiEndBlock(C, block); - - menudata_free(md); - - /* XXX 2.5 need to warp back */ -#if 0 - if((event & UI_RETURN_OUT)==0) - ui_warp_pointer(mousemove[0], mousemove[1]); -#endif - - return block; -} - -/************************** Menu Definitions ***************************/ - -/* prototype */ -static uiBlock *ui_block_func_MENU_ITEM(bContext *C, uiPopupBlockHandle *handle, void *arg_info); +/******************** Popup Menu with callback or string **********************/ struct uiPopupMenu { uiBlock *block; uiLayout *layout; + uiBut *but; + + int mx, my, popup, slideout; + int startx, starty, maxrow; + + uiMenuCreateFunc menu_func; + void *menu_arg; }; -typedef struct uiMenuInfo { - uiPopupMenu *pup; - int mx, my, popup, slideout; - int startx, starty; -} uiMenuInfo; - -/************************ Menu Definitions to uiBlocks ***********************/ - -static uiBlock *ui_block_func_MENU_ITEM(bContext *C, uiPopupBlockHandle *handle, void *arg_info) +static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, void *arg_pup) { uiBlock *block; - uiMenuInfo *info= arg_info; - uiPopupMenu *pup; + uiBut *bt; ScrArea *sa; ARegion *ar; - - pup= info->pup; + uiPopupMenu *pup= arg_pup; + int offset, direction, minwidth, flip; + + if(pup->menu_func) { + pup->block->handle= handle; + pup->menu_func(C, pup->layout, pup->menu_arg); + pup->block->handle= NULL; + } + + if(pup->but) { + /* minimum width to enforece */ + minwidth= pup->but->x2 - pup->but->x1; + + if(pup->but->type == PULLDOWN || pup->but->menu_create_func) { + direction= UI_DOWN; + flip= 1; + } + else { + direction= UI_TOP; + flip= 0; + } + } + else { + minwidth= 50; + direction= UI_DOWN; + flip= 1; + } + block= pup->block; - /* block stuff first, need to know the font */ - uiBlockSetRegion(block, handle->region); - block->direction= UI_DOWN; + /* in some cases we create the block before the region, + so we set it delayed here if necessary */ + if(BLI_findindex(&handle->region->uiblocks, block) == -1) + uiBlockSetRegion(block, handle->region); + + block->direction= direction; uiBlockLayoutResolve(C, block, NULL, NULL); - if(info->popup) { + if(pup->popup) { uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT|UI_BLOCK_RET_1); - uiBlockSetDirection(block, UI_DOWN); + uiBlockSetDirection(block, direction); - /* here we set an offset for the mouse position */ - uiMenuPopupBoundsBlock(block, 1, 0, 1.5*MENU_BUTTON_HEIGHT); + /* offset the mouse position, possibly based on earlier selection */ + offset= 1.5*MENU_BUTTON_HEIGHT; + + if(block->flag & UI_BLOCK_POPUP_MEMORY) { + bt= ui_popup_menu_memory(block, NULL); + + if(bt) + offset= -bt->y1 - 0.5f*MENU_BUTTON_HEIGHT; + } + + block->minbounds= minwidth; + uiMenuPopupBoundsBlock(block, 1, 20, offset); } else { /* for a header menu we set the direction automatic */ - if(!info->slideout) { + if(!pup->slideout && flip) { sa= CTX_wm_area(C); ar= CTX_wm_region(C); @@ -2569,59 +2225,77 @@ static uiBlock *ui_block_func_MENU_ITEM(bContext *C, uiPopupBlockHandle *handle, } } - uiTextBoundsBlock(block, 50); + block->minbounds= minwidth; + uiTextBoundsBlock(block, 40); } /* if menu slides out of other menu, override direction */ - if(info->slideout) + if(pup->slideout) uiBlockSetDirection(block, UI_RIGHT); uiEndBlock(C, block); - - return block; + + return pup->block; } -uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut *but, uiMenuCreateFunc menu_func, void *arg) +uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut *but, uiMenuCreateFunc menu_func, void *arg, char *str) { + wmWindow *window= CTX_wm_window(C); uiStyle *style= U.uistyles.first; uiPopupBlockHandle *handle; uiPopupMenu *pup; - uiMenuInfo info; pup= MEM_callocN(sizeof(uiPopupMenu), "menu dummy"); - pup->block= uiBeginBlock(C, NULL, "ui_popup_menu_create", UI_EMBOSSP); + pup->block= uiBeginBlock(C, NULL, "ui_button_menu_create", UI_EMBOSSP); pup->layout= uiBlockLayout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, style); + pup->slideout= (but && (but->block->flag & UI_BLOCK_LOOP)); + pup->but= but; uiLayoutSetOperatorContext(pup->layout, WM_OP_INVOKE_REGION_WIN); - /* create in advance so we can let buttons point to retval already */ - pup->block->handle= MEM_callocN(sizeof(uiPopupBlockHandle), "uiPopupBlockHandle"); + if(!but) { + /* no button to start from, means we are a popup */ + pup->mx= window->eventstate->x; + pup->my= window->eventstate->y; + pup->popup= 1; + } - menu_func(C, pup->layout, arg); + if(str) { + /* menu is created from a string */ + pup->menu_func= ui_block_func_MENUSTR; + pup->menu_arg= str; + } + else { + /* menu is created from a callback */ + pup->menu_func= menu_func; + pup->menu_arg= arg; + } - memset(&info, 0, sizeof(info)); - info.pup= pup; - info.slideout= (but && (but->block->flag & UI_BLOCK_LOOP)); - - handle= ui_popup_block_create(C, butregion, but, NULL, ui_block_func_MENU_ITEM, &info); + handle= ui_popup_block_create(C, butregion, but, NULL, ui_block_func_POPUP, pup); + + if(!but) { + handle->popup= 1; + + UI_add_popup_handlers(C, &window->handlers, handle); + WM_event_add_mousemove(C); + } MEM_freeN(pup); return handle; } -/*************************** Menu Creating API **************************/ - - -/*************************** Popup Menu API **************************/ +/******************** Popup Menu API with begin and end ***********************/ /* only return handler, and set optional title */ uiPopupMenu *uiPupMenuBegin(bContext *C, const char *title, int icon) { uiStyle *style= U.uistyles.first; - uiPopupMenu *pup= MEM_callocN(sizeof(uiPopupMenu), "menu start"); + uiPopupMenu *pup= MEM_callocN(sizeof(uiPopupMenu), "popup menu"); uiBut *but; pup->block= uiBeginBlock(C, NULL, "uiPupMenuBegin", UI_EMBOSSP); + pup->block->flag |= UI_BLOCK_POPUP_MEMORY; + pup->block->puphash= ui_popup_menu_hash((char*)title); pup->layout= uiBlockLayout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, style); uiLayoutSetOperatorContext(pup->layout, WM_OP_EXEC_REGION_WIN); @@ -2640,8 +2314,6 @@ uiPopupMenu *uiPupMenuBegin(bContext *C, const char *title, int icon) but= uiDefBut(pup->block, LABEL, 0, (char*)title, 0, 0, 200, MENU_BUTTON_HEIGHT, NULL, 0.0, 0.0, 0, 0, ""); but->flag= UI_TEXT_LEFT; } - - //uiDefBut(block, SEPR, 0, "", startx, (short)(starty+height)-MENU_SEPR_HEIGHT, width, MENU_SEPR_HEIGHT, NULL, 0.0, 0.0, 0, 0, ""); } return pup; @@ -2651,16 +2323,13 @@ uiPopupMenu *uiPupMenuBegin(bContext *C, const char *title, int icon) void uiPupMenuEnd(bContext *C, uiPopupMenu *pup) { wmWindow *window= CTX_wm_window(C); - uiMenuInfo info; uiPopupBlockHandle *menu; - memset(&info, 0, sizeof(info)); - info.popup= 1; - info.mx= window->eventstate->x; - info.my= window->eventstate->y; - info.pup= pup; + pup->popup= 1; + pup->mx= window->eventstate->x; + pup->my= window->eventstate->y; - menu= ui_popup_block_create(C, NULL, NULL, NULL, ui_block_func_MENU_ITEM, &info); + menu= ui_popup_block_create(C, NULL, NULL, NULL, ui_block_func_POPUP, pup); menu->popup= 1; UI_add_popup_handlers(C, &window->handlers, menu); @@ -2674,32 +2343,7 @@ uiLayout *uiPupMenuLayout(uiPopupMenu *pup) return pup->layout; } -/* ************** standard pupmenus *************** */ - -/* this one can called with operatortype name and operators */ -static uiPopupBlockHandle *ui_pup_menu(bContext *C, int maxrow, uiMenuHandleFunc func, void *arg, char *str, ...) -{ - wmWindow *window= CTX_wm_window(C); - uiPupMenuInfo info; - uiPopupBlockHandle *menu; - - memset(&info, 0, sizeof(info)); - info.mx= window->eventstate->x; - info.my= window->eventstate->y; - info.maxrow= maxrow; - info.instr= str; - - menu= ui_popup_block_create(C, NULL, NULL, NULL, ui_block_func_PUPMENU, &info); - menu->popup= 1; - - UI_add_popup_handlers(C, &window->handlers, menu); - WM_event_add_mousemove(C); - - menu->popup_func= func; - menu->popup_arg= arg; - - return menu; -} +/*************************** Standard Popup Menus ****************************/ static void operator_name_cb(bContext *C, void *arg, int retval) { @@ -2709,17 +2353,6 @@ static void operator_name_cb(bContext *C, void *arg, int retval) WM_operator_name_call(C, opname, WM_OP_EXEC_DEFAULT, NULL); } -static void vconfirm_opname(bContext *C, char *opname, char *title, char *itemfmt, va_list ap) -{ - char *s, buf[512]; - - s= buf; - if (title) s+= sprintf(s, "%s%%t|", title); - vsprintf(s, itemfmt, ap); - - ui_pup_menu(C, 0, operator_name_cb, opname, buf); -} - static void operator_cb(bContext *C, void *arg, int retval) { wmOperator *op= arg; @@ -2735,6 +2368,21 @@ static void confirm_cancel_operator(void *opv) WM_operator_free(opv); } +static void vconfirm_opname(bContext *C, char *opname, char *title, char *itemfmt, va_list ap) +{ + uiPopupBlockHandle *handle; + char *s, buf[512]; + + s= buf; + if (title) s+= sprintf(s, "%s%%t|", title); + vsprintf(s, itemfmt, ap); + + handle= ui_popup_menu_create(C, NULL, NULL, NULL, NULL, buf); + + handle->popup_func= operator_name_cb; + handle->popup_arg= opname; +} + static void confirm_operator(bContext *C, wmOperator *op, char *title, char *item) { uiPopupBlockHandle *handle; @@ -2743,11 +2391,13 @@ static void confirm_operator(bContext *C, wmOperator *op, char *title, char *ite s= buf; if (title) s+= sprintf(s, "%s%%t|%s", title, item); - handle= ui_pup_menu(C, 0, operator_cb, op, buf); + handle= ui_popup_menu_create(C, NULL, NULL, NULL, NULL, buf); + + handle->popup_func= operator_cb; + handle->popup_arg= op; handle->cancel_func= confirm_cancel_operator; } - void uiPupMenuOkee(bContext *C, char *opname, char *str, ...) { va_list ap; @@ -2760,7 +2410,6 @@ void uiPupMenuOkee(bContext *C, char *opname, char *str, ...) va_end(ap); } - void uiPupMenuSaveOver(bContext *C, wmOperator *op, char *filename) { size_t len= strlen(filename); @@ -2776,7 +2425,7 @@ void uiPupMenuSaveOver(bContext *C, wmOperator *op, char *filename) if(BLI_exists(filename)==0) operator_cb(C, op, 1); else - confirm_operator(C, op, "Save over", filename); + confirm_operator(C, op, "Save Over", filename); } void uiPupMenuNotice(bContext *C, char *str, ...) @@ -2826,7 +2475,7 @@ void uiPupMenuReports(bContext *C, ReportList *reports) } str= BLI_dynstr_get_cstring(ds); - ui_pup_menu(C, 0, NULL, NULL, str); + ui_popup_menu_create(C, NULL, NULL, NULL, NULL, str); MEM_freeN(str); BLI_dynstr_free(ds); @@ -2870,3 +2519,4 @@ void uiPupBlockOperator(bContext *C, uiBlockCreateFunc func, wmOperator *op, int UI_add_popup_handlers(C, &window->handlers, handle); WM_event_add_mousemove(C); } + diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 0557512cc2a..e7c99f10a66 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -237,11 +237,11 @@ static void template_ID(bContext *C, uiBlock *block, TemplateID *template, Struc int w= idptr.data?UI_UNIT_X:UI_UNIT_X*6; if(newop) { - but= uiDefIconTextButO(block, BUT, newop, WM_OP_INVOKE_REGION_WIN, ICON_ZOOMIN, "Add New", 0, 0, w, UI_UNIT_Y, NULL); + but= uiDefIconTextButO(block, BUT, newop, WM_OP_INVOKE_REGION_WIN, ICON_ZOOMIN, (idptr.data)? "": "Add New", 0, 0, w, UI_UNIT_Y, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW)); } else { - but= uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, "Add New", 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); + but= uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, (idptr.data)? "": "Add New", 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW)); } } diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 39fd6433548..2fb9835f833 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1150,7 +1150,7 @@ void ED_object_apply_obmat(Object *ob) } -int hook_getIndexArray(Object *obedit, int *tot, int **indexar, char *name, float *cent_r) +int object_hook_index_array(Object *obedit, int *tot, int **indexar, char *name, float *cent_r) { *indexar= NULL; *tot= 0; @@ -1232,9 +1232,8 @@ static void select_editcurve_hook(Object *obedit, HookModifierData *hmd) } } -void obedit_hook_select(Object *ob, HookModifierData *hmd) +void object_hook_select(Object *ob, HookModifierData *hmd) { - if(ob->type==OB_MESH) select_editmesh_hook(ob, hmd); else if(ob->type==OB_LATTICE) select_editlattice_hook(ob, hmd); else if(ob->type==OB_CURVE) select_editcurve_hook(ob, hmd); @@ -1318,7 +1317,7 @@ void add_hook(Scene *scene, View3D *v3d, int mode) int tot, ok, *indexar; char name[32]; - ok = hook_getIndexArray(obedit, &tot, &indexar, name, cent); + ok = object_hook_index_array(obedit, &tot, &indexar, name, cent); if(ok==0) { error("Requires selected vertices or active Vertex Group"); @@ -1381,7 +1380,7 @@ void add_hook(Scene *scene, View3D *v3d, int mode) modifier_free(md); } else if(mode==5) { /* select */ - obedit_hook_select(obedit, hmd); + object_hook_select(obedit, hmd); } else if(mode==6) { /* clear offset */ where_is_object(scene, ob); /* ob is hook->parent */ diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index e47087a3c27..2f164102be2 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -34,6 +34,7 @@ struct Lattice; struct Curve; struct Object; struct Mesh; +struct HookModifierData; /* internal exports only */ @@ -80,6 +81,9 @@ void OBJECT_OT_armature_add(struct wmOperatorType *ot); /* only used as menu */ void OBJECT_OT_primitive_add(struct wmOperatorType *ot); +int object_hook_index_array(Object *obedit, int *tot, int **indexar, char *name, float *cent_r); +void object_hook_select(Object *obedit, struct HookModifierData *hmd); + /* editlattice.c */ void free_editLatt(Object *ob); void make_editLatt(Object *obedit); @@ -104,7 +108,12 @@ void OBJECT_OT_modifier_apply(struct wmOperatorType *ot); void OBJECT_OT_modifier_convert(struct wmOperatorType *ot); void OBJECT_OT_modifier_copy(struct wmOperatorType *ot); void OBJECT_OT_multires_subdivide(struct wmOperatorType *ot); -void OBJECT_OT_modifier_mdef_bind(struct wmOperatorType *ot); +void OBJECT_OT_meshdeform_bind(struct wmOperatorType *ot); +void OBJECT_OT_hook_reset(struct wmOperatorType *ot); +void OBJECT_OT_hook_recenter(struct wmOperatorType *ot); +void OBJECT_OT_hook_select(struct wmOperatorType *ot); +void OBJECT_OT_hook_assign(struct wmOperatorType *ot); +void OBJECT_OT_explode_refresh(struct wmOperatorType *ot); /* editconstraint.c */ void OBJECT_OT_constraint_add(struct wmOperatorType *ot); diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 16900d6d894..32a1297aaf4 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -39,6 +39,7 @@ #include "DNA_object_force.h" #include "DNA_scene_types.h" +#include "BLI_arithb.h" #include "BLI_listbase.h" #include "BKE_curve.h" @@ -410,6 +411,11 @@ int ED_object_modifier_copy(ReportList *reports, Object *ob, ModifierData *md) /***************************** OPERATORS ****************************/ +static int modifier_poll(bContext *C) +{ + return (CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier).data != NULL); +} + /************************ add modifier operator *********************/ static int modifier_add_exec(bContext *C, wmOperator *op) @@ -426,8 +432,46 @@ static int modifier_add_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } +static EnumPropertyItem *modifier_add_itemf(bContext *C, PointerRNA *ptr, int *free) +{ + EnumPropertyItem *item= NULL, *md_item; + ModifierTypeInfo *mti; + Object *ob; + int totitem= 0, a; + + if(!C) /* needed for docs */ + return modifier_type_items; + + ob= CTX_data_active_object(C); + + for(a=0; modifier_type_items[a].identifier; a++) { + md_item= &modifier_type_items[a]; + + if(md_item->identifier[0]) { + mti= modifierType_getInfo(md_item->value); + + if(mti->flags & eModifierTypeFlag_NoUserAdd) + continue; + + if(!((mti->flags & eModifierTypeFlag_AcceptsCVs) || + (ob->type==OB_MESH && (mti->flags & eModifierTypeFlag_AcceptsMesh)))) + continue; + } + + RNA_enum_item_add(&item, &totitem, md_item); + } + + RNA_enum_item_end(&item, &totitem); + + *free= 1; + + return item; +} + void OBJECT_OT_modifier_add(wmOperatorType *ot) { + PropertyRNA *prop; + /* identifiers */ ot->name= "Add Modifier"; ot->description = "Add a modifier to the active object."; @@ -436,14 +480,14 @@ void OBJECT_OT_modifier_add(wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_menu_invoke; ot->exec= modifier_add_exec; - ot->poll= ED_operator_object_active; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - /* XXX only some types should be here */ - RNA_def_enum(ot->srna, "type", modifier_type_items, 0, "Type", ""); + /* properties */ + prop= RNA_def_enum(ot->srna, "type", modifier_type_items, eModifierType_Subsurf, "Type", ""); + RNA_def_enum_funcs(prop, modifier_add_itemf); } /************************ remove modifier operator *********************/ @@ -455,7 +499,7 @@ static int modifier_remove_exec(bContext *C, wmOperator *op) Object *ob= ptr.id.data; ModifierData *md= ptr.data; - if(!ob || !md || !ED_object_modifier_remove(op->reports, scene, ob, md)) + if(!ED_object_modifier_remove(op->reports, scene, ob, md)) return OPERATOR_CANCELLED; WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); @@ -471,6 +515,7 @@ void OBJECT_OT_modifier_remove(wmOperatorType *ot) ot->poll= ED_operator_object_active; ot->exec= modifier_remove_exec; + ot->poll= modifier_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -485,7 +530,7 @@ static int modifier_move_up_exec(bContext *C, wmOperator *op) Object *ob= ptr.id.data; ModifierData *md= ptr.data; - if(!ob || !md || !ED_object_modifier_move_up(op->reports, ob, md)) + if(!ED_object_modifier_move_up(op->reports, ob, md)) return OPERATOR_CANCELLED; DAG_object_flush_update(scene, ob, OB_RECALC_DATA); @@ -502,6 +547,7 @@ void OBJECT_OT_modifier_move_up(wmOperatorType *ot) ot->poll= ED_operator_object_active; ot->exec= modifier_move_up_exec; + ot->poll= modifier_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -533,6 +579,7 @@ void OBJECT_OT_modifier_move_down(wmOperatorType *ot) ot->poll= ED_operator_object_active; ot->exec= modifier_move_down_exec; + ot->poll= modifier_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -564,6 +611,7 @@ void OBJECT_OT_modifier_apply(wmOperatorType *ot) ot->poll= ED_operator_object_active; ot->exec= modifier_apply_exec; + ot->poll= modifier_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -595,6 +643,7 @@ void OBJECT_OT_modifier_convert(wmOperatorType *ot) ot->poll= ED_operator_object_active; ot->exec= modifier_convert_exec; + ot->poll= modifier_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -626,6 +675,7 @@ void OBJECT_OT_modifier_copy(wmOperatorType *ot) ot->poll= ED_operator_object_active; ot->exec= modifier_copy_exec; + ot->poll= modifier_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -639,17 +689,15 @@ static int multires_subdivide_exec(bContext *C, wmOperator *op) Object *ob= ptr.id.data; MultiresModifierData *mmd= ptr.data; - if(mmd) { - multiresModifier_subdivide(mmd, ob, 1, 0, mmd->simple); - WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); - } + multiresModifier_subdivide(mmd, ob, 1, 0, mmd->simple); + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); return OPERATOR_FINISHED; } static int multires_subdivide_poll(bContext *C) { - return NULL != CTX_data_active_object(C) && NULL == CTX_data_edit_object(C); + return (CTX_data_pointer_get_type(C, "modifier", &RNA_MultiresModifier).data != NULL); } void OBJECT_OT_multires_subdivide(wmOperatorType *ot) @@ -667,12 +715,12 @@ void OBJECT_OT_multires_subdivide(wmOperatorType *ot) /************************ mdef bind operator *********************/ -static int modifier_mdef_bind_poll(bContext *C) +static int meshdeform_poll(bContext *C) { return CTX_data_pointer_get_type(C, "modifier", &RNA_MeshDeformModifier).data != NULL; } -static int modifier_mdef_bind_exec(bContext *C, wmOperator *op) +static int meshdeform_bind_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); PointerRNA ptr= CTX_data_pointer_get(C, "modifier"); @@ -723,41 +771,22 @@ static int modifier_mdef_bind_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } -void OBJECT_OT_modifier_mdef_bind(wmOperatorType *ot) +void OBJECT_OT_meshdeform_bind(wmOperatorType *ot) { /* identifiers */ ot->name= "Mesh Deform Bind"; ot->description = "Bind mesh to cage in mesh deform modifier."; - ot->idname= "OBJECT_OT_modifier_mdef_bind"; + ot->idname= "OBJECT_OT_meshdeform_bind"; /* api callbacks */ - ot->poll= modifier_mdef_bind_poll; - ot->exec= modifier_mdef_bind_exec; + ot->poll= meshdeform_poll; + ot->exec= meshdeform_bind_exec; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } #if 0 -static void modifiers_add(void *ob_v, int type) -{ - Object *ob = ob_v; - ModifierTypeInfo *mti = modifierType_getInfo(type); - - if (mti->flags&eModifierTypeFlag_RequiresOriginalData) { - ModifierData *md = ob->modifiers.first; - - while (md && modifierType_getInfo(md->type)->type==eModifierTypeType_OnlyDeform) { - md = md->next; - } - - BLI_insertlinkbefore(&ob->modifiers, md, modifier_new(type)); - } else { - BLI_addtail(&ob->modifiers, modifier_new(type)); - } - ED_undo_push("Add modifier"); -} - typedef struct MenuEntry { char *name; int ID; @@ -809,89 +838,176 @@ static uiBlock *modifiers_add_menu(void *ob_v) } #endif -#if 0 -static void modifiers_clearHookOffset(bContext *C, void *ob_v, void *md_v) +/******************** hook operators ************************/ + +static int hook_poll(bContext *C) { - Object *ob = ob_v; - ModifierData *md = md_v; - HookModifierData *hmd = (HookModifierData*) md; - - if (hmd->object) { + return CTX_data_pointer_get_type(C, "modifier", &RNA_HookModifier).data != NULL; +} + +static int hook_reset_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_HookModifier); + Object *ob= ptr.id.data; + HookModifierData *hmd= ptr.data; + + if(hmd->object) { Mat4Invert(hmd->object->imat, hmd->object->obmat); Mat4MulSerie(hmd->parentinv, hmd->object->imat, ob->obmat, NULL, NULL, NULL, NULL, NULL, NULL); - ED_undo_push(C, "Clear hook offset"); } -} -static void modifiers_cursorHookCenter(bContext *C, void *ob_v, void *md_v) -{ - /* XXX - Object *ob = ob_v; - ModifierData *md = md_v; - HookModifierData *hmd = (HookModifierData*) md; - - if(G.vd) { - float *curs = give_cursor(); - float bmat[3][3], imat[3][3]; - - where_is_object(ob); + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); - Mat3CpyMat4(bmat, ob->obmat); - Mat3Inv(imat, bmat); - - curs= give_cursor(); - hmd->cent[0]= curs[0]-ob->obmat[3][0]; - hmd->cent[1]= curs[1]-ob->obmat[3][1]; - hmd->cent[2]= curs[2]-ob->obmat[3][2]; - Mat3MulVecfl(imat, hmd->cent); - - ED_undo_push(C, "Hook cursor center"); - }*/ + return OPERATOR_FINISHED; } -static void modifiers_selectHook(bContext *C, void *ob_v, void *md_v) +void OBJECT_OT_hook_reset(wmOperatorType *ot) { - /* XXX ModifierData *md = md_v; - HookModifierData *hmd = (HookModifierData*) md; + ot->name= "Hook Reset"; + ot->description= "Recalculate and and clear offset transformation."; + ot->idname= "OBJECT_OT_hook_reset"; - hook_select(hmd);*/ + ot->exec= hook_reset_exec; + ot->poll= hook_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -static void modifiers_reassignHook(bContext *C, void *ob_v, void *md_v) +static int hook_recenter_exec(bContext *C, wmOperator *op) { - /* XXX ModifierData *md = md_v; - HookModifierData *hmd = (HookModifierData*) md; + Scene *scene= CTX_data_scene(C); + PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_HookModifier); + Object *ob= ptr.id.data; + HookModifierData *hmd= ptr.data; + float bmat[3][3], imat[3][3]; + + Mat3CpyMat4(bmat, ob->obmat); + Mat3Inv(imat, bmat); + + VECSUB(hmd->cent, scene->cursor, ob->obmat[3]); + Mat3MulVecfl(imat, hmd->cent); + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_hook_recenter(wmOperatorType *ot) +{ + ot->name= "Hook Recenter"; + ot->description= "Set hook center to cursor position."; + ot->idname= "OBJECT_OT_hook_recenter"; + + ot->exec= hook_recenter_exec; + ot->poll= hook_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int hook_select_exec(bContext *C, wmOperator *op) +{ + PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_HookModifier); + Object *ob= ptr.id.data; + HookModifierData *hmd= ptr.data; + + object_hook_select(ob, hmd); + + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_hook_select(wmOperatorType *ot) +{ + ot->name= "Hook Select"; + ot->description= "Selects effected vertices on mesh."; + ot->idname= "OBJECT_OT_hook_select"; + + ot->exec= hook_select_exec; + ot->poll= hook_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int hook_assign_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_HookModifier); + Object *ob= ptr.id.data; + HookModifierData *hmd= ptr.data; float cent[3]; - int *indexar, tot, ok; char name[32]; + int *indexar, tot; - ok= hook_getIndexArray(&tot, &indexar, name, cent); + if(!object_hook_index_array(ob, &tot, &indexar, name, cent)) { + BKE_report(op->reports, RPT_WARNING, "Requires selected vertices or active vertex group"); + return OPERATOR_CANCELLED; + } - if (!ok) { - uiPupMenuError(C, "Requires selected vertices or active Vertex Group"); - } else { - if (hmd->indexar) { - MEM_freeN(hmd->indexar); - } + if(hmd->indexar) + MEM_freeN(hmd->indexar); - VECCOPY(hmd->cent, cent); - hmd->indexar = indexar; - hmd->totindex = tot; - }*/ + VECCOPY(hmd->cent, cent); + hmd->indexar= indexar; + hmd->totindex= tot; + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); + + return OPERATOR_FINISHED; } -void modifiers_explodeFacepa(bContext *C, void *arg1, void *arg2) +void OBJECT_OT_hook_assign(wmOperatorType *ot) { - ExplodeModifierData *emd=arg1; + ot->name= "Hook Assign"; + ot->description= "Reassigns selected vertices to hook."; + ot->idname= "OBJECT_OT_hook_assign"; + + ot->exec= hook_assign_exec; + ot->poll= hook_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/****************** explode refresh operator *********************/ + +static int explode_refresh_poll(bContext *C) +{ + return CTX_data_pointer_get_type(C, "modifier", &RNA_ExplodeModifier).data != NULL; +} + +static int explode_refresh_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_ExplodeModifier); + Object *ob= ptr.id.data; + ExplodeModifierData *emd= ptr.data; emd->flag |= eExplodeFlag_CalcFaces; + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); + + return OPERATOR_FINISHED; } -void modifiers_explodeDelVg(bContext *C, void *arg1, void *arg2) +void OBJECT_OT_explode_refresh(wmOperatorType *ot) { - ExplodeModifierData *emd=arg1; - emd->vgroup = 0; + ot->name= "Explode Refresh"; + ot->description= "Refresh data in the Explode modifier."; + ot->idname= "OBJECT_OT_explode_refresh"; + + ot->exec= explode_refresh_exec; + ot->poll= explode_refresh_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -#endif - diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index f2e048284f4..6f1a3b5f6cb 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -118,7 +118,12 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_modifier_convert); WM_operatortype_append(OBJECT_OT_modifier_copy); WM_operatortype_append(OBJECT_OT_multires_subdivide); - WM_operatortype_append(OBJECT_OT_modifier_mdef_bind); + WM_operatortype_append(OBJECT_OT_meshdeform_bind); + WM_operatortype_append(OBJECT_OT_hook_reset); + WM_operatortype_append(OBJECT_OT_hook_recenter); + WM_operatortype_append(OBJECT_OT_hook_select); + WM_operatortype_append(OBJECT_OT_hook_assign); + WM_operatortype_append(OBJECT_OT_explode_refresh); WM_operatortype_append(OBJECT_OT_constraint_add); WM_operatortype_append(OBJECT_OT_constraint_add_with_targets); diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 320574fe8b3..f714a291bd7 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1044,7 +1044,6 @@ static char *windowtype_pup(void) "Window type:%t" "|3D View %x1" - "|%l" "|%l" "|Timeline %x15" @@ -1052,7 +1051,6 @@ static char *windowtype_pup(void) "|DopeSheet %x12" "|NLA Editor %x13" - "|%l" "|%l" "|UV/Image Editor %x6" @@ -1062,7 +1060,6 @@ static char *windowtype_pup(void) "|Node Editor %x16" "|Logic Editor %x17" - "|%l" "|%l" "|Properties %x4" @@ -1070,12 +1067,10 @@ static char *windowtype_pup(void) "|User Preferences %x19" "|Info%x7" - "|%l" "|%l" "|File Browser %x5" - "|%l" "|%l" "|Console %x18" diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 6c86c87302c..3487efc4218 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -3442,10 +3442,5 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) } } - - /* do not do view2d totrect set here, it's now a template */ - - uiEndBlock(C, block); - uiDrawBlock(C, block); } diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 33499574012..912d11dcc8c 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -318,7 +318,7 @@ typedef struct UVProjectModifierData { ModifierData modifier; /* the objects which do the projecting */ - struct Object *projectors[10]; + struct Object *projectors[10]; /* MOD_UVPROJECT_MAX */ struct Image *image; /* the image to project */ int flags; int num_projectors; @@ -669,4 +669,6 @@ typedef struct SimpleDeformModifierData { coordinates or global coordinates of origin */ #define MOD_SIMPLEDEFORM_ORIGIN_LOCAL (1<<0) +#define MOD_UVPROJECT_MAX 10 + #endif diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 9bdbc8baed7..3b0db949350 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -1173,8 +1173,14 @@ void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item defaultfound= 1; } - if(!defaultfound) - eprop->defaultvalue= item[0].value; + if(!defaultfound) { + for(i=0; item[i].identifier; i++) { + if(item[i].identifier[0]) { + eprop->defaultvalue= item[i].value; + break; + } + } + } break; } diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index f2c8e404a52..c080b88feaf 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -43,41 +43,43 @@ #include "WM_types.h" EnumPropertyItem modifier_type_items[] ={ - {eModifierType_Armature, "ARMATURE", ICON_MOD_ARMATURE, "Armature", ""}, + {0, "", 0, "Generate", ""}, {eModifierType_Array, "ARRAY", ICON_MOD_ARRAY, "Array", ""}, {eModifierType_Bevel, "BEVEL", ICON_MOD_BEVEL, "Bevel", ""}, {eModifierType_Boolean, "BOOLEAN", ICON_MOD_BOOLEAN, "Boolean", ""}, {eModifierType_Build, "BUILD", ICON_MOD_BUILD, "Build", ""}, - {eModifierType_Cast, "CAST", ICON_MOD_CAST, "Cast", ""}, - {eModifierType_Cloth, "CLOTH", ICON_MOD_CLOTH, "Cloth", ""}, - {eModifierType_Collision, "COLLISION", ICON_MOD_PHYSICS, "Collision", ""}, - {eModifierType_Curve, "CURVE", ICON_MOD_CURVE, "Curve", ""}, {eModifierType_Decimate, "DECIMATE", ICON_MOD_DECIM, "Decimate", ""}, - {eModifierType_Displace, "DISPLACE", ICON_MOD_DISPLACE, "Displace", ""}, {eModifierType_EdgeSplit, "EDGE_SPLIT", ICON_MOD_EDGESPLIT, "Edge Split", ""}, - {eModifierType_Explode, "EXPLODE", ICON_MOD_EXPLODE, "Explode", ""}, - {eModifierType_Fluidsim, "FLUID_SIMULATION", ICON_MOD_FLUIDSIM, "Fluid Simulation", ""}, - {eModifierType_Hook, "HOOK", ICON_HOOK, "Hook", ""}, - {eModifierType_Lattice, "LATTICE", ICON_MOD_LATTICE, "Lattice", ""}, {eModifierType_Mask, "MASK", ICON_MOD_MASK, "Mask", ""}, - {eModifierType_MeshDeform, "MESH_DEFORM", ICON_MOD_MESHDEFORM, "Mesh Deform", ""}, {eModifierType_Mirror, "MIRROR", ICON_MOD_MIRROR, "Mirror", ""}, {eModifierType_Multires, "MULTIRES", ICON_MOD_MULTIRES, "Multiresolution", ""}, - {eModifierType_ParticleInstance, "PARTICLE_INSTANCE", ICON_MOD_PARTICLES, "Particle Instance", ""}, - {eModifierType_ParticleSystem, "PARTICLE_SYSTEM", ICON_MOD_PARTICLES, "Particle System", ""}, + {eModifierType_Subsurf, "SUBSURF", ICON_MOD_SUBSURF, "Subdivision Surface", ""}, + {eModifierType_UVProject, "UV_PROJECT", ICON_MOD_UVPROJECT, "UV Project", ""}, + {0, "", 0, "Deformers", ""}, + {eModifierType_Armature, "ARMATURE", ICON_MOD_ARMATURE, "Armature", ""}, + {eModifierType_Cast, "CAST", ICON_MOD_CAST, "Cast", ""}, + {eModifierType_Curve, "CURVE", ICON_MOD_CURVE, "Curve", ""}, + {eModifierType_Displace, "DISPLACE", ICON_MOD_DISPLACE, "Displace", ""}, + {eModifierType_Hook, "HOOK", ICON_HOOK, "Hook", ""}, + {eModifierType_Lattice, "LATTICE", ICON_MOD_LATTICE, "Lattice", ""}, + {eModifierType_MeshDeform, "MESH_DEFORM", ICON_MOD_MESHDEFORM, "Mesh Deform", ""}, {eModifierType_Shrinkwrap, "SHRINKWRAP", ICON_MOD_SHRINKWRAP, "Shrinkwrap", ""}, {eModifierType_SimpleDeform, "SIMPLE_DEFORM", ICON_MOD_SIMPLEDEFORM, "Simple Deform", ""}, + {eModifierType_Smooth, "SMOOTH", ICON_MOD_SMOOTH, "Smooth", ""}, + {eModifierType_Wave, "WAVE", ICON_MOD_WAVE, "Wave", ""}, + {0, "", 0, "Physics", ""}, + {eModifierType_Cloth, "CLOTH", ICON_MOD_CLOTH, "Cloth", ""}, + {eModifierType_Collision, "COLLISION", ICON_MOD_PHYSICS, "Collision", ""}, + {eModifierType_Explode, "EXPLODE", ICON_MOD_EXPLODE, "Explode", ""}, + {eModifierType_Fluidsim, "FLUID_SIMULATION", ICON_MOD_FLUIDSIM, "Fluid Simulation", ""}, + {eModifierType_ParticleInstance, "PARTICLE_INSTANCE", ICON_MOD_PARTICLES, "Particle Instance", ""}, + {eModifierType_ParticleSystem, "PARTICLE_SYSTEM", ICON_MOD_PARTICLES, "Particle System", ""}, {eModifierType_Smoke, "SMOKE", 0, "Smoke", ""}, {eModifierType_SmokeHR, "SMOKE_HR", 0, "SmokeHR", ""}, - {eModifierType_Smooth, "SMOOTH", ICON_MOD_SMOOTH, "Smooth", ""}, {eModifierType_Softbody, "SOFT_BODY", ICON_MOD_SOFT, "Soft Body", ""}, - {eModifierType_Subsurf, "SUBSURF", ICON_MOD_SUBSURF, "Subdivision Surface", ""}, {eModifierType_Surface, "SURFACE", ICON_MOD_PHYSICS, "Surface", ""}, - {eModifierType_UVProject, "UV_PROJECT", ICON_MOD_UVPROJECT, "UV Project", ""}, - {eModifierType_Wave, "WAVE", ICON_MOD_WAVE, "Wave", ""}, {0, NULL, 0, NULL, NULL}}; - #ifdef RNA_RUNTIME #include "BKE_context.h" @@ -87,7 +89,7 @@ EnumPropertyItem modifier_type_items[] ={ static void rna_UVProject_projectors_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { UVProjectModifierData *uvp= (UVProjectModifierData*)ptr->data; - rna_iterator_array_begin(iter, (void*)uvp->projectors, sizeof(Object*), 10, 0, NULL); + rna_iterator_array_begin(iter, (void*)uvp->projectors, sizeof(Object*), uvp->num_projectors, 0, NULL); } static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr) @@ -410,6 +412,34 @@ static PointerRNA rna_CollisionModifier_settings_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, &RNA_CollisionSettings, ob->pd); } +static PointerRNA rna_UVProjector_object_get(PointerRNA *ptr) +{ + Object **ob= (Object**)ptr->data; + return rna_pointer_inherit_refine(ptr, &RNA_Object, *ob); +} + +static void rna_UVProjector_object_set(PointerRNA *ptr, PointerRNA value) +{ + Object **ob= (Object**)ptr->data; + + if(*ob) + id_us_min((ID*)*ob); + if(value.data) + id_us_plus((ID*)value.data); + + *ob= value.data; +} + +static void rna_UVProjectModifier_num_projectors_set(PointerRNA *ptr, int value) +{ + UVProjectModifierData *md= (UVProjectModifierData*)ptr->data; + int a; + + md->num_projectors= CLAMPIS(value, 1, MOD_UVPROJECT_MAX); + for(a=md->num_projectors; aprojectors[a]= NULL; +} + #else static void rna_def_property_subdivision_common(StructRNA *srna, const char type[]) @@ -1150,7 +1180,7 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna) PropertyRNA *prop; srna= RNA_def_struct(brna, "UVProjectModifier", "Modifier"); - RNA_def_struct_ui_text(srna, "UVProject Modifier", "UV projection modifier to sets UVs from a projector."); + RNA_def_struct_ui_text(srna, "UV Project Modifier", "UV projection modifier to sets UVs from a projector."); RNA_def_struct_sdna(srna, "UVProjectModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_UVPROJECT); @@ -1160,9 +1190,15 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_UVProjectModifier_uvlayer_set"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + prop= RNA_def_property(srna, "num_projectors", PROP_INT, PROP_NONE); + RNA_def_property_ui_text(prop, "Number of Projectors", "Number of projectors to use."); + RNA_def_property_int_funcs(prop, NULL, "rna_UVProjectModifier_num_projectors_set", NULL); + RNA_def_property_range(prop, 1, MOD_UVPROJECT_MAX); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + prop= RNA_def_property(srna, "projectors", PROP_COLLECTION, PROP_NONE); - RNA_def_property_struct_type(prop, "Object"); - RNA_def_property_collection_funcs(prop, "rna_UVProject_projectors_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_dereference_get", 0, 0, 0, 0, 0); + RNA_def_property_struct_type(prop, "UVProjector"); + RNA_def_property_collection_funcs(prop, "rna_UVProject_projectors_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0, 0, 0); RNA_def_property_ui_text(prop, "Projectors", ""); prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); @@ -1188,6 +1224,15 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_UVPROJECT_OVERRIDEIMAGE); RNA_def_property_ui_text(prop, "Override Image", "Override faces' current images with the given image."); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + + srna= RNA_def_struct(brna, "UVProjector", NULL); + RNA_def_struct_ui_text(srna, "UVProjector", "UV projector used by the UV project modifier."); + + prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "Object"); + RNA_def_property_pointer_funcs(prop, "rna_UVProjector_object_get", "rna_UVProjector_object_set", NULL); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Object", "Object to use as projector transform."); } static void rna_def_modifier_smooth(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 0301932aef3..40e3efc9e46 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1144,27 +1144,28 @@ static void rna_def_scene_render_data(BlenderRNA *brna) static EnumPropertyItem image_type_items[] = { + {0, "", 0, "Image", NULL}, {R_PNG, "PNG", 0, "PNG", ""}, {R_JPEG90, "JPEG", 0, "JPEG", ""}, #ifdef WITH_OPENJPEG {R_JP2, "JPEG2000", 0, "JPEG 2000", ""}, #endif - {R_TIFF, "TIFF", 0, "TIFF", ""}, // XXX only with G.have_libtiff {R_BMP, "BMP", 0, "BMP", ""}, {R_TARGA, "TARGA", 0, "Targa", ""}, {R_RAWTGA, "RAWTARGA", 0, "Targa Raw", ""}, //{R_DDS, "DDS", 0, "DDS", ""}, // XXX not yet implemented {R_HAMX, "HAMX", 0, "HamX", ""}, {R_IRIS, "IRIS", 0, "Iris", ""}, - {0, "", 0, NULL, NULL}, + {0, "", 0, " ", NULL}, #ifdef WITH_OPENEXR {R_OPENEXR, "OPENEXR", 0, "OpenEXR", ""}, {R_MULTILAYER, "MULTILAYER", 0, "MultiLayer", ""}, #endif + {R_TIFF, "TIFF", 0, "TIFF", ""}, // XXX only with G.have_libtiff {R_RADHDR, "RADHDR", 0, "Radiance HDR", ""}, {R_CINEON, "CINEON", 0, "Cineon", ""}, {R_DPX, "DPX", 0, "DPX", ""}, - {0, "", 0, NULL, NULL}, + {0, "", 0, "Movie", NULL}, {R_AVIRAW, "AVIRAW", 0, "AVI Raw", ""}, {R_AVIJPEG, "AVIJPEG", 0, "AVI JPEG", ""}, #ifdef _WIN32 @@ -1187,7 +1188,6 @@ static void rna_def_scene_render_data(BlenderRNA *brna) #endif {R_FFMPEG, "FFMPEG", 0, "FFMpeg", ""}, #endif - {0, "", 0, NULL, NULL}, {R_FRAMESERVER, "FRAMESERVER", 0, "Frame Server", ""}, {0, NULL, 0, NULL, NULL}}; diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 304da25017b..ab8dfeabe4f 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -741,7 +741,6 @@ static void WM_OT_window_duplicate(wmOperatorType *ot) ot->name= "Duplicate Window"; ot->idname= "WM_OT_window_duplicate"; - ot->invoke= WM_operator_confirm; ot->exec= wm_window_duplicate_op; ot->poll= WM_operator_winactive; } @@ -1035,7 +1034,6 @@ static void WM_OT_window_fullscreen_toggle(wmOperatorType *ot) ot->name= "Toggle Fullscreen"; ot->idname= "WM_OT_window_fullscreen_toggle"; - ot->invoke= WM_operator_confirm; ot->exec= wm_window_fullscreen_toggle_op; ot->poll= WM_operator_winactive; } From 442ba39d49d9453f84791989c9149692b70ddad5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 21 Aug 2009 03:06:36 +0000 Subject: [PATCH 176/577] fix for own bug added since 2.49a, 2.49a tries to remove the object from the conversion list every time. Now remove from the conversion list directly without being apart of the remove object function. --- source/gameengine/Converter/BL_BlenderDataConversion.cpp | 3 +++ source/gameengine/Converter/KX_BlenderSceneConverter.cpp | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 5b03bbbbc4e..d2e6bbb43f7 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -2422,8 +2422,11 @@ void BL_ConvertBlenderObjects(struct Main* maggie, obj->Release(); } childrenlist->Release(); + // now destroy recursively + converter->UnregisterGameObject(childobj); // removing objects during conversion make sure this runs too kxscene->RemoveObject(childobj); + continue; } diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index 59c073c2b1f..4f47ce7a036 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -492,10 +492,11 @@ void KX_BlenderSceneConverter::RegisterGameObject( m_map_blender_to_gameobject.insert(CHashedPtr(for_blenderobject),gameobject); } +/* only need to run this during conversion since + * m_map_blender_to_gameobject is freed after conversion */ void KX_BlenderSceneConverter::UnregisterGameObject( KX_GameObject *gameobject) { -#if 0 struct Object *bobp= gameobject->GetBlenderObject(); if (bobp) { CHashedPtr bptr(bobp); @@ -507,7 +508,6 @@ void KX_BlenderSceneConverter::UnregisterGameObject( m_map_blender_to_gameobject.remove(bptr); } } -#endif } KX_GameObject *KX_BlenderSceneConverter::FindGameObject( From 589ea76833778a37fe0ec93cc28de1102d9793b5 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Fri, 21 Aug 2009 06:23:38 +0000 Subject: [PATCH 177/577] 2.5/Paint: * Updated texture paint UI for stroke settings. * Removed duplicate brush blend types, just use the ones defined in imbuf instead --- release/ui/space_view3d_toolbar.py | 38 ++++++++----------- .../editors/sculpt_paint/paint_image.c | 2 +- source/blender/makesdna/DNA_brush_types.h | 10 ----- source/blender/makesrna/intern/rna_brush.c | 18 +++++---- 4 files changed, 27 insertions(+), 41 deletions(-) diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py index 35df4dc8b54..d0f07c70657 100644 --- a/release/ui/space_view3d_toolbar.py +++ b/release/ui/space_view3d_toolbar.py @@ -369,7 +369,7 @@ class VIEW3D_PT_tools_brush(PaintPanel): col = layout.column() col.itemR(brush, "color", text="") - + row = col.row(align=True) row.itemR(brush, "size", slider=True) row.itemR(brush, "size_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") @@ -382,18 +382,7 @@ class VIEW3D_PT_tools_brush(PaintPanel): row.itemR(brush, "falloff", slider=True) row.itemR(brush, "falloff_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") - row = col.row(align=True) - row.itemR(brush, "space", text="") - rowsub = row.row(align=True) - rowsub.active = brush.space - rowsub.itemR(brush, "spacing", text="Spacing", slider=True) - rowsub.itemR(brush, "spacing_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") - - col = layout.column() - col.itemR(brush, "airbrush") - sub = col.column() - sub.active = brush.airbrush - sub.itemR(brush, "rate") + col.itemR(brush, "blend") # Weight Paint Mode # @@ -431,23 +420,28 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel): settings = self.paint_settings(context) return (settings and settings.brush and (context.sculpt_object or context.vertex_paint_object or - context.weight_paint_object)) + context.weight_paint_object or + context.texture_paint_object)) def draw(self, context): settings = self.paint_settings(context) brush = settings.brush + texture_paint = context.texture_paint_object layout = self.layout - layout.itemR(brush, "smooth_stroke") - col = layout.column() - col.active = brush.smooth_stroke - col.itemR(brush, "smooth_stroke_radius", text="Radius", slider=True) - col.itemR(brush, "smooth_stroke_factor", text="Factor", slider=True) + if not texture_paint: + layout.itemR(brush, "smooth_stroke") + col = layout.column() + col.active = brush.smooth_stroke + col.itemR(brush, "smooth_stroke_radius", text="Radius", slider=True) + col.itemR(brush, "smooth_stroke_factor", text="Factor", slider=True) layout.itemR(brush, "space") - col = layout.column() - col.active = brush.space - col.itemR(brush, "spacing", text="Distance", slider=True) + row = layout.row(align=True) + row.active = brush.space + row.itemR(brush, "spacing", text="Distance", slider=True) + if texture_paint: + row.itemR(brush, "spacing_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") layout.itemR(brush, "airbrush") col = layout.column() diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 2dcd7a64947..afd8336c2a9 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -4719,7 +4719,7 @@ static void paint_apply_event(bContext *C, wmOperator *op, wmEvent *event) tablet= (wmtab->Active != EVT_TABLET_NONE); pressure= wmtab->Pressure; if(wmtab->Active == EVT_TABLET_ERASER) - pop->s.blend= BRUSH_BLEND_ERASE_ALPHA; + pop->s.blend= IMB_BLEND_ERASE_ALPHA; } else pressure= 1.0f; diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h index 52ea298c110..a3a1a342584 100644 --- a/source/blender/makesdna/DNA_brush_types.h +++ b/source/blender/makesdna/DNA_brush_types.h @@ -86,16 +86,6 @@ typedef struct Brush { #define BRUSH_SMOOTH_STROKE 2048 #define BRUSH_PERSISTENT 4096 -/* Brush.blend */ -#define BRUSH_BLEND_MIX 0 -#define BRUSH_BLEND_ADD 1 -#define BRUSH_BLEND_SUB 2 -#define BRUSH_BLEND_MUL 3 -#define BRUSH_BLEND_LIGHTEN 4 -#define BRUSH_BLEND_DARKEN 5 -#define BRUSH_BLEND_ERASE_ALPHA 6 -#define BRUSH_BLEND_ADD_ALPHA 7 - /* Brush.sculpt_tool */ #define SCULPT_TOOL_DRAW 1 #define SCULPT_TOOL_SMOOTH 2 diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 03b5a44f52b..9c453ac44df 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -32,6 +32,8 @@ #include "DNA_brush_types.h" #include "DNA_texture_types.h" +#include "IMB_imbuf.h" + EnumPropertyItem brush_sculpt_tool_items[] = { {SCULPT_TOOL_DRAW, "DRAW", 0, "Draw", ""}, {SCULPT_TOOL_SMOOTH, "SMOOTH", 0, "Smooth", ""}, @@ -93,14 +95,14 @@ void rna_def_brush(BlenderRNA *brna) PropertyRNA *prop; static EnumPropertyItem prop_blend_items[] = { - {BRUSH_BLEND_MIX, "MIX", 0, "Mix", "Use mix blending mode while painting."}, - {BRUSH_BLEND_ADD, "ADD", 0, "Add", "Use add blending mode while painting."}, - {BRUSH_BLEND_SUB, "SUB", 0, "Subtract", "Use subtract blending mode while painting."}, - {BRUSH_BLEND_MUL, "MUL", 0, "Multiply", "Use multiply blending mode while painting."}, - {BRUSH_BLEND_LIGHTEN, "LIGHTEN", 0, "Lighten", "Use lighten blending mode while painting."}, - {BRUSH_BLEND_DARKEN, "DARKEN", 0, "Darken", "Use darken blending mode while painting."}, - {BRUSH_BLEND_ERASE_ALPHA, "ERASE_ALPHA", 0, "Erase Alpha", "Erase alpha while painting."}, - {BRUSH_BLEND_ADD_ALPHA, "ADD_ALPHA", 0, "Add Alpha", "Add alpha while painting."}, + {IMB_BLEND_MIX, "MIX", 0, "Mix", "Use mix blending mode while painting."}, + {IMB_BLEND_ADD, "ADD", 0, "Add", "Use add blending mode while painting."}, + {IMB_BLEND_SUB, "SUB", 0, "Subtract", "Use subtract blending mode while painting."}, + {IMB_BLEND_MUL, "MUL", 0, "Multiply", "Use multiply blending mode while painting."}, + {IMB_BLEND_LIGHTEN, "LIGHTEN", 0, "Lighten", "Use lighten blending mode while painting."}, + {IMB_BLEND_DARKEN, "DARKEN", 0, "Darken", "Use darken blending mode while painting."}, + {IMB_BLEND_ERASE_ALPHA, "ERASE_ALPHA", 0, "Erase Alpha", "Erase alpha while painting."}, + {IMB_BLEND_ADD_ALPHA, "ADD_ALPHA", 0, "Add Alpha", "Add alpha while painting."}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "Brush", "ID"); From 46fb2d37e347b6ecbd0097aa662cd2fdc4b65f33 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 21 Aug 2009 07:19:06 +0000 Subject: [PATCH 178/577] have texture paint use the curve rather then the falloff setting (falloff gave ugly center area of 100% opacity) --- release/ui/space_view3d_toolbar.py | 4 ---- source/blender/blenkernel/BKE_brush.h | 1 - source/blender/blenkernel/intern/brush.c | 17 ----------------- .../blender/editors/sculpt_paint/paint_image.c | 7 ++++--- source/blender/windowmanager/intern/Makefile | 1 - 5 files changed, 4 insertions(+), 26 deletions(-) diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py index d0f07c70657..254fb3fd560 100644 --- a/release/ui/space_view3d_toolbar.py +++ b/release/ui/space_view3d_toolbar.py @@ -378,10 +378,6 @@ class VIEW3D_PT_tools_brush(PaintPanel): row.itemR(brush, "strength", slider=True) row.itemR(brush, "strength_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") - row = col.row(align=True) - row.itemR(brush, "falloff", slider=True) - row.itemR(brush, "falloff_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") - col.itemR(brush, "blend") # Weight Paint Mode # diff --git a/source/blender/blenkernel/BKE_brush.h b/source/blender/blenkernel/BKE_brush.h index 6ec988e111e..4d24a2433b3 100644 --- a/source/blender/blenkernel/BKE_brush.h +++ b/source/blender/blenkernel/BKE_brush.h @@ -64,7 +64,6 @@ float brush_curve_strength(struct Brush *br, float p, const float len); /* sampling */ float brush_sample_falloff(struct Brush *brush, float dist); -float brush_sample_falloff_noalpha(struct Brush *brush, float dist); void brush_sample_tex(struct Brush *brush, float *xy, float *rgba); void brush_imbuf_new(struct Brush *brush, short flt, short texfalloff, int size, struct ImBuf **imbuf); diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index a7b5a16d924..bce4e1120be 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -409,23 +409,6 @@ float brush_sample_falloff(Brush *brush, float dist) return 0.0f; } -float brush_sample_falloff_noalpha(Brush *brush, float dist) -{ - float outer, inner; - - outer = brush->size >> 1; - inner = outer*brush->innerradius; - - if (dist <= inner) { - return 1.0f; - } - else if ((dist < outer) && (inner < outer)) { - return 1.0f - sqrt((dist - inner)/(outer - inner)); - } - else - return 0.0f; -} - void brush_sample_tex(Brush *brush, float *xy, float *rgba) { MTex *mtex= brush->mtex[brush->texact]; diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index afd8336c2a9..d082e17cda3 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -3707,7 +3707,7 @@ static void *do_projectpaint_thread(void *ph_v) ProjPaintImage *last_projIma= NULL; ImagePaintPartialRedraw *last_partial_redraw_cell; - float rgba[4], alpha, dist_nosqrt; + float rgba[4], alpha, dist_nosqrt, dist; float brush_size_sqared; float falloff; @@ -3721,6 +3721,7 @@ static void *do_projectpaint_thread(void *ph_v) float co[2]; float mask = 1.0f; /* airbrush wont use mask */ unsigned short mask_short; + float size_half = ((float)ps->brush->size) * 0.5f; LinkNode *smearPixels = NULL; LinkNode *smearPixels_f = NULL; @@ -3755,8 +3756,8 @@ static void *do_projectpaint_thread(void *ph_v) dist_nosqrt = Vec2Lenf_nosqrt(projPixel->projCoSS, pos); /*if (dist < s->brush->size) {*/ /* correct but uses a sqrtf */ - if (dist_nosqrt < brush_size_sqared) { - falloff = brush_sample_falloff_noalpha(ps->brush, sqrtf(dist_nosqrt)); + if (dist_nosqrt < brush_size_sqared && (dist=sqrtf(dist_nosqrt)) < size_half) { + falloff = brush_curve_strength(ps->brush, dist, size_half); if (falloff > 0.0f) { if (ps->is_texbrush) { brush_sample_tex(ps->brush, projPixel->projCoSS, rgba); diff --git a/source/blender/windowmanager/intern/Makefile b/source/blender/windowmanager/intern/Makefile index 823423cc28b..f4d65975d43 100644 --- a/source/blender/windowmanager/intern/Makefile +++ b/source/blender/windowmanager/intern/Makefile @@ -58,7 +58,6 @@ CPPFLAGS += -I../../imbuf CPPFLAGS += -I../../blenloader CPPFLAGS += -I../../gpu CPPFLAGS += -I../../render/extern/include -CPPFLAGS += -I../../radiosity/extern/include CPPFLAGS += -I../../../kernel/gen_system CPPFLAGS += -I../../blenfont From 9125fe55fbe18d0fafdf388ce69f9bd29657da2f Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 21 Aug 2009 10:47:27 +0000 Subject: [PATCH 179/577] Hook Modifier - Bone Targets Made Hook Modifier be able to use bone targets. However, I haven't been able to verify that everything will work perfectly, since just creating a new Hook Modifier and assigning targets doesn't set hmd->indexar correctly. --- release/ui/buttons_data_modifier.py | 6 ++++- source/blender/blenkernel/intern/action.c | 5 ++-- source/blender/blenkernel/intern/modifier.c | 27 ++++++++++++++----- source/blender/editors/object/object_edit.c | 4 +++ .../blender/editors/object/object_modifier.c | 19 +++++++++++-- source/blender/makesdna/DNA_modifier_types.h | 2 ++ source/blender/makesrna/intern/rna_modifier.c | 5 ++++ 7 files changed, 56 insertions(+), 12 deletions(-) diff --git a/release/ui/buttons_data_modifier.py b/release/ui/buttons_data_modifier.py index cc50256f216..f5af26f8746 100644 --- a/release/ui/buttons_data_modifier.py +++ b/release/ui/buttons_data_modifier.py @@ -200,7 +200,11 @@ class DATA_PT_modifiers(DataButtonsPanel): layout.itemL(text="See Fluid panel.") def HOOK(self, layout, ob, md): - layout.itemR(md, "object") + col = layout.column() + col.itemR(md, "object") + if md.object and md.object.type == "ARMATURE": + layout.item_pointerR(md, "subtarget", md.object.data, "bones", text="Bone") + layout.item_pointerR(md, "vertex_group", ob, "vertex_groups") split = layout.split() diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index f4d4eb1cc9c..6a39139d250 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -410,8 +410,9 @@ bActionGroup *action_groups_find_named (bAction *act, const char name[]) bPoseChannel *get_pose_channel(const bPose *pose, const char *name) { bPoseChannel *chan; - - if (pose==NULL) return NULL; + + if (ELEM(NULL, pose, name) || (name[0] == 0)) + return NULL; for (chan=pose->chanbase.first; chan; chan=chan->next) { if (chan->name[0] == name[0]) { diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 37cf427b897..501638aba0d 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -5598,6 +5598,7 @@ static void hookModifier_copyData(ModifierData *md, ModifierData *target) thmd->indexar = MEM_dupallocN(hmd->indexar); memcpy(thmd->parentinv, hmd->parentinv, sizeof(hmd->parentinv)); strncpy(thmd->name, hmd->name, 32); + strncpy(thmd->subtarget, hmd->subtarget, 32); } CustomDataMask hookModifier_requiredDataMask(Object *ob, ModifierData *md) @@ -5642,9 +5643,11 @@ static void hookModifier_updateDepgraph(ModifierData *md, DagForest *forest, Sce if (hmd->object) { DagNode *curNode = dag_get_node(forest, hmd->object); - - dag_add_relation(forest, curNode, obNode, DAG_RL_OB_DATA, - "Hook Modifier"); + + if (hmd->subtarget[0]) + dag_add_relation(forest, curNode, obNode, DAG_RL_OB_DATA|DAG_RL_DATA_DATA, "Hook Modifier"); + else + dag_add_relation(forest, curNode, obNode, DAG_RL_OB_DATA, "Hook Modifier"); } } @@ -5653,12 +5656,22 @@ static void hookModifier_deformVerts( float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) { HookModifierData *hmd = (HookModifierData*) md; - float vec[3], mat[4][4]; + bPoseChannel *pchan= get_pose_channel(hmd->object->pose, hmd->subtarget); + float vec[3], mat[4][4], dmat[4][4], imat[4][4]; int i; DerivedMesh *dm = derivedData; - - Mat4Invert(ob->imat, ob->obmat); - Mat4MulSerie(mat, ob->imat, hmd->object->obmat, hmd->parentinv, + + /* get world-space matrix of target, corrected for the space the verts are in */ + if (hmd->subtarget[0] && pchan) { + /* bone target if there's a matching pose-channel */ + Mat4MulMat4(dmat, pchan->pose_mat, hmd->object->obmat); + } + else { + /* just object target */ + Mat4CpyMat4(dmat, hmd->object->obmat); + } + Mat4Invert(imat, dmat); + Mat4MulSerie(mat, imat, dmat, hmd->parentinv, NULL, NULL, NULL, NULL, NULL); /* vertex indices? */ diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 2fb9835f833..e1b8858937c 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -979,6 +979,9 @@ static void select_editmesh_hook(Object *ob, HookModifierData *hmd) EditVert *eve; int index=0, nr=0; + if (hmd->indexar == NULL) + return; + for(eve= em->verts.first; eve; eve= eve->next, nr++) { if(nr==hmd->indexar[index]) { eve->f |= SELECT; @@ -1361,6 +1364,7 @@ void add_hook(Scene *scene, View3D *v3d, int mode) hmd->totindex= tot; BLI_strncpy(hmd->name, name, 32); + // TODO: need to take into account bone targets here too now... if(mode==1 || mode==2) { /* matrix calculus */ /* vert x (obmat x hook->imat) x hook->obmat x ob->imat */ diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 32a1297aaf4..3785e17f67c 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -31,6 +31,7 @@ #include "MEM_guardedalloc.h" +#include "DNA_action_types.h" #include "DNA_curve_types.h" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" @@ -42,6 +43,7 @@ #include "BLI_arithb.h" #include "BLI_listbase.h" +#include "BKE_action.h" #include "BKE_curve.h" #include "BKE_context.h" #include "BKE_depsgraph.h" @@ -853,8 +855,21 @@ static int hook_reset_exec(bContext *C, wmOperator *op) HookModifierData *hmd= ptr.data; if(hmd->object) { - Mat4Invert(hmd->object->imat, hmd->object->obmat); - Mat4MulSerie(hmd->parentinv, hmd->object->imat, ob->obmat, NULL, NULL, NULL, NULL, NULL, NULL); + bPoseChannel *pchan= get_pose_channel(hmd->object->pose, hmd->subtarget); + + if(hmd->subtarget[0] && pchan) { + float imat[4][4], mat[4][4]; + + /* calculate the world-space matrix for the pose-channel target first, then carry on as usual */ + Mat4MulMat4(mat, pchan->pose_mat, hmd->object->obmat); + + Mat4Invert(imat, mat); + Mat4MulSerie(hmd->parentinv, imat, mat, NULL, NULL, NULL, NULL, NULL, NULL); + } + else { + Mat4Invert(hmd->object->imat, hmd->object->obmat); + Mat4MulSerie(hmd->parentinv, hmd->object->imat, ob->obmat, NULL, NULL, NULL, NULL, NULL, NULL); + } } DAG_object_flush_update(scene, ob, OB_RECALC_DATA); diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 912d11dcc8c..a4587c34e89 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -426,6 +426,8 @@ typedef struct HookModifierData { ModifierData modifier; struct Object *object; + char subtarget[32]; /* optional name of bone target */ + float parentinv[4][4]; /* matrix making current transform unmodified */ float cent[3]; /* visualization of hook */ float falloff; /* if not zero, falloff is distance where influence zero */ diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index c080b88feaf..bfd93a4218b 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -912,6 +912,11 @@ static void rna_def_modifier_hook(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Object", "Parent Object for hook, also recalculates and clears offset"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + + prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "subtarget"); + RNA_def_property_ui_text(prop, "Sub-Target", "Name of Parent Bone for hook (if applicable), also recalculates and clears offset"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); From df61b5f9fd2d92777a9bd00cb7f5f94b130e8c42 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 21 Aug 2009 11:04:33 +0000 Subject: [PATCH 180/577] 2.5 - 2 Bugfixes * Alt-S in Object Mode would crash. Was caused by modal-keymaps for Pose Mode not being cleared when not in Pose Mode. Also fixed what appears to have been a copy+paste error for Armature Sketching keymaps. * Active KeyingSet menu in TimeLine header is now properly editable. Was using the wrong type of layout call to do this. --- release/ui/space_time.py | 2 +- source/blender/editors/space_view3d/drawobject.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/release/ui/space_time.py b/release/ui/space_time.py index d1c9f9806f3..17deb4c550f 100644 --- a/release/ui/space_time.py +++ b/release/ui/space_time.py @@ -63,7 +63,7 @@ class TIME_HT_header(bpy.types.Header): layout.itemS() row = layout.row(align=True) - row.itemR(scene, "active_keying_set", text="") + row.item_pointerR(scene, "active_keying_set", scene, "keying_sets", text="") row.itemO("anim.insert_keyframe", text="", icon="ICON_KEY_HLT") row.itemO("anim.delete_keyframe", text="", icon="ICON_KEY_DEHLT") diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 55565c83f5e..9fc9bf94cd7 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -5023,6 +5023,9 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) /* patch? children objects with a timeoffs change the parents. How to solve! */ /* if( ((int)ob->ctime) != F_(scene->r.cfra)) where_is_object(scene, ob); */ + + /* draw paths... */ + // TODO... /* multiply view with object matrix */ wmMultMatrix(ob->obmat); From d9283fc0cc9efc6b7aac8a5fc44c4790bdfba3c7 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 21 Aug 2009 11:22:38 +0000 Subject: [PATCH 181/577] Ack... committed wrong file before (fortunately it was just a harmless comment added) --- source/blender/editors/space_view3d/space_view3d.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 8b719dd2d80..3dd65a6f796 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -280,7 +280,7 @@ static void view3d_modal_keymaps(wmWindowManager *wm, ARegion *ar, int stype) /* copy last mode, then we can re-init the region maps */ rv3d->lastmode= stype; - + keymap= WM_keymap_listbase(wm, "Object Mode", 0, 0); if(ELEM(stype, 0, NS_MODE_OBJECT)) WM_event_add_keymap_handler(&ar->handlers, keymap); @@ -304,6 +304,12 @@ static void view3d_modal_keymaps(wmWindowManager *wm, ARegion *ar, int stype) WM_event_add_keymap_handler(&ar->handlers, keymap); else WM_event_remove_keymap_handler(&ar->handlers, keymap); + + keymap= WM_keymap_listbase(wm, "Pose", 0, 0); + if(stype==NS_MODE_POSE) + WM_event_add_keymap_handler(&ar->handlers, keymap); + else + WM_event_remove_keymap_handler(&ar->handlers, keymap); keymap= WM_keymap_listbase(wm, "Metaball", 0, 0); if(stype==NS_EDITMODE_MBALL) @@ -319,7 +325,7 @@ static void view3d_modal_keymaps(wmWindowManager *wm, ARegion *ar, int stype) /* armature sketching needs to take over mouse */ keymap= WM_keymap_listbase(wm, "Armature_Sketch", 0, 0); - if(stype==NS_EDITMODE_TEXT) + if(stype==NS_EDITMODE_ARMATURE) WM_event_add_keymap_handler_priority(&ar->handlers, keymap, 10); else WM_event_remove_keymap_handler(&ar->handlers, keymap); From 27797a45ee6cbc987350269e6827197f47daf036 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Fri, 21 Aug 2009 11:52:20 +0000 Subject: [PATCH 182/577] 2.5: * Deleted Help scripts, there are now operators in space_info.py. * Some code cleanup. --- release/scripts/help_getting_started.py | 50 ------------------------- release/scripts/help_manual.py | 48 ------------------------ release/scripts/help_release_notes.py | 47 ----------------------- release/scripts/help_tutorials.py | 47 ----------------------- release/scripts/help_web_blender.py | 48 ------------------------ release/scripts/help_web_devcomm.py | 47 ----------------------- release/scripts/help_web_eshop.py | 47 ----------------------- release/scripts/help_web_usercomm.py | 47 ----------------------- release/ui/space_filebrowser.py | 5 +-- release/ui/space_info.py | 20 +++++----- 10 files changed, 12 insertions(+), 394 deletions(-) delete mode 100644 release/scripts/help_getting_started.py delete mode 100644 release/scripts/help_manual.py delete mode 100644 release/scripts/help_release_notes.py delete mode 100644 release/scripts/help_tutorials.py delete mode 100644 release/scripts/help_web_blender.py delete mode 100644 release/scripts/help_web_devcomm.py delete mode 100644 release/scripts/help_web_eshop.py delete mode 100644 release/scripts/help_web_usercomm.py diff --git a/release/scripts/help_getting_started.py b/release/scripts/help_getting_started.py deleted file mode 100644 index 77dda2cf88f..00000000000 --- a/release/scripts/help_getting_started.py +++ /dev/null @@ -1,50 +0,0 @@ -#!BPY -""" -Name: 'Getting Started' -Blender: 248 -Group: 'Help' -Tooltip: 'Help for new users' -""" - -__author__ = "Matt Ebb" -__url__ = ("blender", "blenderartists.org") -__version__ = "1.0.1" -__bpydoc__ = """\ -This script opens the user's default web browser at www.blender.org's -"Getting Started" page. -""" - -# $Id$ -# -# -------------------------------------------------------------------------- -# Getting Started Help Menu Item -# -------------------------------------------------------------------------- -# ***** 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. -# -# ***** END GPL LICENCE BLOCK ***** -# -------------------------------------------------------------------------- - -import Blender -try: import webbrowser -except: webbrowser = None - -if webbrowser: - webbrowser.open('http://www.blender.org/education-help/tutorials/getting-started/') -else: - Blender.Draw.PupMenu("Error%t|This script requires a full python installation") - - diff --git a/release/scripts/help_manual.py b/release/scripts/help_manual.py deleted file mode 100644 index 27900040eb4..00000000000 --- a/release/scripts/help_manual.py +++ /dev/null @@ -1,48 +0,0 @@ -#!BPY -""" -Name: 'Manual' -Blender: 248 -Group: 'Help' -Tooltip: 'The Blender Wiki manual' -""" - -__author__ = "Matt Ebb" -__url__ = ("blender", "blenderartists.org") -__version__ = "1.0.1" -__bpydoc__ = """\ -This script opens the user's default web browser at www.blender.org's -"Manual" page. -""" - -# -------------------------------------------------------------------------- -# Manual Help Menu Item -# -------------------------------------------------------------------------- -# ***** 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. -# -# ***** END GPL LICENCE BLOCK ***** -# -------------------------------------------------------------------------- - -import Blender -try: import webbrowser -except: webbrowser = None - -if webbrowser: - webbrowser.open('http://wiki.blender.org/index.php/Manual') -else: - Blender.Draw.PupMenu("Error%t|This script requires a full python installation") - - diff --git a/release/scripts/help_release_notes.py b/release/scripts/help_release_notes.py deleted file mode 100644 index 870f2391487..00000000000 --- a/release/scripts/help_release_notes.py +++ /dev/null @@ -1,47 +0,0 @@ -#!BPY -""" -Name: 'Release Logs' -Blender: 248 -Group: 'Help' -Tooltip: 'Information about the changes in this version of Blender' -""" - -__author__ = "Matt Ebb" -__url__ = ("blender", "blenderartists.org") -__version__ = "1.0.1" -__bpydoc__ = """\ -This script opens the user's default web browser at www.blender.org's -"Release Logs" page. -""" - -# -------------------------------------------------------------------------- -# Release Notes Help Menu Item -# -------------------------------------------------------------------------- -# ***** 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. -# -# ***** END GPL LICENCE BLOCK ***** -# -------------------------------------------------------------------------- - -import Blender -try: import webbrowser -except: webbrowser = None - -if webbrowser: - webbrowser.open('http://www.blender.org/development/release-logs/') -else: - Blender.Draw.PupMenu("Error%t|This script requires a full python installation") - diff --git a/release/scripts/help_tutorials.py b/release/scripts/help_tutorials.py deleted file mode 100644 index e0cef1abdbf..00000000000 --- a/release/scripts/help_tutorials.py +++ /dev/null @@ -1,47 +0,0 @@ -#!BPY - -""" -Name: 'Tutorials' -Blender: 248 -Group: 'Help' -Tooltip: 'Tutorials for learning to use Blender' -""" - -__author__ = "Matt Ebb" -__url__ = ("blender", "blenderartists.org") -__version__ = "1.0.1" -__bpydoc__ = """\ -This script opens the user's default web browser at www.blender.org's -"Tutorials" page. -""" - -# -------------------------------------------------------------------------- -# Tutorials Help Menu Item -# -------------------------------------------------------------------------- -# ***** 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. -# -# ***** END GPL LICENCE BLOCK ***** -# -------------------------------------------------------------------------- - -import Blender -try: import webbrowser -except: webbrowser = None - -if webbrowser: - webbrowser.open('http://www.blender.org/education-help/tutorials/') -else: - Blender.Draw.PupMenu("Error%t|This script requires a full python installation") diff --git a/release/scripts/help_web_blender.py b/release/scripts/help_web_blender.py deleted file mode 100644 index 2a0f90844ae..00000000000 --- a/release/scripts/help_web_blender.py +++ /dev/null @@ -1,48 +0,0 @@ -#!BPY - -""" -Name: 'Blender Website' -Blender: 248 -Group: 'HelpWebsites' -Tooltip: 'The official Blender website' -""" - -__author__ = "Matt Ebb" -__url__ = ("blender", "blenderartists.org") -__version__ = "1.0.1" -__bpydoc__ = """\ -This script opens the user's default web browser at Blender's main site, -www.blender.org. -""" - - -# -------------------------------------------------------------------------- -# Blender Website Help Menu -> Websites Item -# -------------------------------------------------------------------------- -# ***** 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. -# -# ***** END GPL LICENCE BLOCK ***** -# -------------------------------------------------------------------------- - -import Blender -try: import webbrowser -except: webbrowser = None - -if webbrowser: - webbrowser.open('http://www.blender.org/') -else: - Blender.Draw.PupMenu("Error%t|This script requires a full python installation") diff --git a/release/scripts/help_web_devcomm.py b/release/scripts/help_web_devcomm.py deleted file mode 100644 index 46fa2487a89..00000000000 --- a/release/scripts/help_web_devcomm.py +++ /dev/null @@ -1,47 +0,0 @@ -#!BPY - -""" -Name: 'Developer Community' -Blender: 248 -Group: 'HelpWebsites' -Tooltip: 'Get involved with Blender development' -""" - -__author__ = "Matt Ebb" -__url__ = ("blender", "blenderartists.org") -__version__ = "1.0.1" -__bpydoc__ = """\ -This script opens the user's default web browser at www.blender.org's -"Get Involved" page. -""" - -# -------------------------------------------------------------------------- -# Blender Website Help Menu -> Websites Item -# -------------------------------------------------------------------------- -# ***** 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. -# -# ***** END GPL LICENCE BLOCK ***** -# -------------------------------------------------------------------------- - -import Blender -try: import webbrowser -except: webbrowser = None - -if webbrowser: - webbrowser.open('http://www.blender.org/community/get-involved/') -else: - Blender.Draw.PupMenu("Error%t|This script requires a full python installation") diff --git a/release/scripts/help_web_eshop.py b/release/scripts/help_web_eshop.py deleted file mode 100644 index e40795b3a0d..00000000000 --- a/release/scripts/help_web_eshop.py +++ /dev/null @@ -1,47 +0,0 @@ -#!BPY - -""" -Name: 'Blender E-Shop' -Blender: 248 -Group: 'HelpWebsites' -Tooltip: 'Buy official Blender resources and merchandise online' -""" - -__author__ = "Matt Ebb" -__url__ = ("blender", "blenderartists.org") -__version__ = "1.0.1" -__bpydoc__ = """\ -This script opens the user's default web browser at www.blender.org's -"E-Shop" section. -""" - -# -------------------------------------------------------------------------- -# Blender Website Help Menu -> Websites Item -# -------------------------------------------------------------------------- -# ***** 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. -# -# ***** END GPL LICENCE BLOCK ***** -# -------------------------------------------------------------------------- - -import Blender -try: import webbrowser -except: webbrowser = None - -if webbrowser: - webbrowser.open('http://www.blender3d.org/e-shop') -else: - Blender.Draw.PupMenu("Error%t|This script requires a full python installation") diff --git a/release/scripts/help_web_usercomm.py b/release/scripts/help_web_usercomm.py deleted file mode 100644 index dda5e42f34e..00000000000 --- a/release/scripts/help_web_usercomm.py +++ /dev/null @@ -1,47 +0,0 @@ -#!BPY - -""" -Name: 'User Community' -Blender: 248 -Group: 'HelpWebsites' -Tooltip: 'Get involved with other Blender users' -""" - -__author__ = "Matt Ebb" -__url__ = ("blender", "blenderartists.org") -__version__ = "1.0.1" -__bpydoc__ = """\ -This script opens the user's default web browser at www.blender.org's -"User Community" page. -""" - -# -------------------------------------------------------------------------- -# Blender Website Help Menu -> Websites Item -# -------------------------------------------------------------------------- -# ***** 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. -# -# ***** END GPL LICENCE BLOCK ***** -# -------------------------------------------------------------------------- - -import Blender -try: import webbrowser -except: webbrowser = None - -if webbrowser: - webbrowser.open('http://www.blender.org/community/user-community/') -else: - Blender.Draw.PupMenu("Error%t|This script requires a full python installation") diff --git a/release/ui/space_filebrowser.py b/release/ui/space_filebrowser.py index 51a8f3f78e8..a37b89e8db4 100644 --- a/release/ui/space_filebrowser.py +++ b/release/ui/space_filebrowser.py @@ -1,15 +1,15 @@ import bpy - class FILEBROWSER_HT_header(bpy.types.Header): __space_type__ = "FILE_BROWSER" def draw(self, context): - st = context.space_data layout = self.layout + st = context.space_data params = st.params + layout.template_header(menus=False) row = layout.row(align=True) @@ -39,5 +39,4 @@ class FILEBROWSER_HT_header(bpy.types.Header): row.active = params.do_filter - bpy.types.register(FILEBROWSER_HT_header) diff --git a/release/ui/space_info.py b/release/ui/space_info.py index 1a3f9a321ac..83eb2c75a2c 100644 --- a/release/ui/space_info.py +++ b/release/ui/space_info.py @@ -115,22 +115,22 @@ class INFO_MT_add(bpy.types.Menu): layout.operator_context = "EXEC_SCREEN" - layout.item_menu_enumO( "OBJECT_OT_mesh_add", "type", text="Mesh", icon='ICON_OUTLINER_OB_MESH') - layout.item_menu_enumO( "OBJECT_OT_curve_add", "type", text="Curve", icon='ICON_OUTLINER_OB_CURVE') - layout.item_menu_enumO( "OBJECT_OT_surface_add", "type", text="Surface", icon='ICON_OUTLINER_OB_SURFACE') - layout.item_menu_enumO( "OBJECT_OT_metaball_add", "type", 'META', icon='ICON_OUTLINER_OB_META') - layout.itemO("OBJECT_OT_text_add", text="Text", icon='ICON_OUTLINER_OB_FONT') + layout.item_menu_enumO( "object.mesh_add", "type", text="Mesh", icon='ICON_OUTLINER_OB_MESH') + layout.item_menu_enumO( "object.curve_add", "type", text="Curve", icon='ICON_OUTLINER_OB_CURVE') + layout.item_menu_enumO( "object.surface_add", "type", text="Surface", icon='ICON_OUTLINER_OB_SURFACE') + layout.item_menu_enumO( "object.metaball_add", "type", 'META', icon='ICON_OUTLINER_OB_META') + layout.itemO("object.text_add", text="Text", icon='ICON_OUTLINER_OB_FONT') layout.itemS() - layout.itemO("OBJECT_OT_armature_add", text="Armature", icon='ICON_OUTLINER_OB_ARMATURE') - layout.item_enumO("OBJECT_OT_object_add", "type", 'LATTICE', icon='ICON_OUTLINER_OB_LATTICE') - layout.item_enumO("OBJECT_OT_object_add", "type", 'EMPTY', icon='ICON_OUTLINER_OB_EMPTY') + layout.itemO("object.armature_add", text="Armature", icon='ICON_OUTLINER_OB_ARMATURE') + layout.item_enumO("object.object_add", "type", 'LATTICE', icon='ICON_OUTLINER_OB_LATTICE') + layout.item_enumO("object.object_add", "type", 'EMPTY', icon='ICON_OUTLINER_OB_EMPTY') layout.itemS() - layout.item_enumO("OBJECT_OT_object_add", "type", 'CAMERA', icon='ICON_OUTLINER_OB_CAMERA') - layout.item_enumO("OBJECT_OT_object_add", "type", 'LAMP', icon='ICON_OUTLINER_OB_LAMP') + layout.item_enumO("object.object_add", "type", 'CAMERA', icon='ICON_OUTLINER_OB_CAMERA') + layout.item_enumO("object.object_add", "type", 'LAMP', icon='ICON_OUTLINER_OB_LAMP') class INFO_MT_game(bpy.types.Menu): __space_type__ = "INFO" From 93dd95b6c2c9ed69916060aa438c13ba1ee6431f Mon Sep 17 00:00:00 2001 From: Jens Ole Wund Date: Fri, 21 Aug 2009 12:49:21 +0000 Subject: [PATCH 183/577] bug fix #18982 non mesh objects missing initializers --- source/blender/blenkernel/intern/softbody.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 25eb999cc4f..01fa3b544ff 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -867,7 +867,8 @@ static void renew_softbody(Object *ob, int totpoint, int totspring) bp->frozen = 1.0f; bp->colball = 0.0f; bp->flag = 0; - + bp->springweight = 1.0f; + bp->mass = sb->nodemass; } } } From 1c614f6cf63fb65622b855123d8db76898d3c9ca Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 21 Aug 2009 12:57:47 +0000 Subject: [PATCH 184/577] 2.5: layout.itemO now returns OperatorProperties to be filled in, when passing properties=True as argument. Other changes: * uiItemR, uiItemFullR, uiItemFullO now accept a flag argument rather than multiple different "boolean" arguments, but still exposed as booleans to python. * Fix RNA to support setting PROP_RNAPTR for return values. --- release/ui/space_view3d.py | 20 ++++-- .../blender/editors/animation/fmodifier_ui.c | 52 +++++++------- source/blender/editors/include/UI_interface.h | 15 +++-- .../editors/interface/interface_layout.c | 49 +++++++++----- .../editors/interface/interface_templates.c | 16 ++--- .../editors/interface/interface_utils.c | 2 +- source/blender/editors/object/object_edit.c | 20 ++---- .../editors/space_action/action_header.c | 6 +- .../blender/editors/space_file/file_panels.c | 2 +- .../editors/space_graph/graph_header.c | 6 +- .../blender/editors/space_nla/nla_buttons.c | 50 +++++++------- source/blender/editors/space_nla/nla_header.c | 4 +- .../editors/space_view3d/view3d_header.c | 67 ++----------------- .../editors/space_view3d/view3d_toolbar.c | 2 +- source/blender/makesrna/intern/makesrna.c | 12 +++- source/blender/makesrna/intern/rna_ui_api.c | 29 ++++++-- 16 files changed, 170 insertions(+), 182 deletions(-) diff --git a/release/ui/space_view3d.py b/release/ui/space_view3d.py index 44b1c82ff46..0b08b213cd4 100644 --- a/release/ui/space_view3d.py +++ b/release/ui/space_view3d.py @@ -157,7 +157,13 @@ class VIEW3D_MT_select_POSE(bpy.types.Menu): layout.itemS() - layout.view3d_select_posemenu() + props = layout.itemO("pose.select_hierarchy", properties=True, text="Extend Parent") + props.extend = True + props.direction = 'PARENT' + + props = layout.itemO("pose.select_hierarchy", properties=True, text="Extend Child") + props.extend = True + props.direction = 'CHILD' class VIEW3D_MT_select_PARTICLE(bpy.types.Menu): __space_type__ = "VIEW_3D" @@ -327,12 +333,18 @@ class VIEW3D_MT_select_EDIT_ARMATURE(bpy.types.Menu): layout.itemS() - layout.item_enumO("armature.select_hierarchy", "direction", 'PARENT') - layout.item_enumO("armature.select_hierarchy", "direction", 'CHILD') + layout.item_enumO("armature.select_hierarchy", "direction", 'PARENT', text="Parent") + layout.item_enumO("armature.select_hierarchy", "direction", 'CHILD', text="Child") layout.itemS() - layout.view3d_select_armaturemenu() + props = layout.itemO("armature.select_hierarchy", properties=True, text="Extend Parent") + props.extend = True + props.direction = 'PARENT' + + props = layout.itemO("armature.select_hierarchy", properties=True, text="Extend Child") + props.extend = True + props.direction = 'CHILD' class VIEW3D_MT_select_FACE(bpy.types.Menu):# XXX no matching enum __space_type__ = "VIEW_3D" diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index 7a618f4d222..4aff26105f3 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -258,14 +258,14 @@ static void draw_modifier__fn_generator(uiLayout *layout, ID *id, FModifier *fcm /* add the settings */ col= uiLayoutColumn(layout, 1); - uiItemR(col, "", 0, &ptr, "type", 0, 0, 0); - uiItemR(col, NULL, 0, &ptr, "additive", 0, 0, 1); + uiItemR(col, "", 0, &ptr, "type", 0); + uiItemR(col, NULL, 0, &ptr, "additive", UI_ITEM_R_TOGGLE); col= uiLayoutColumn(layout, 0); // no grouping for now - uiItemR(col, NULL, 0, &ptr, "amplitude", 0, 0, 0); - uiItemR(col, NULL, 0, &ptr, "phase_multiplier", 0, 0, 0); - uiItemR(col, NULL, 0, &ptr, "phase_offset", 0, 0, 0); - uiItemR(col, NULL, 0, &ptr, "value_offset", 0, 0, 0); + uiItemR(col, NULL, 0, &ptr, "amplitude", 0); + uiItemR(col, NULL, 0, &ptr, "phase_multiplier", 0); + uiItemR(col, NULL, 0, &ptr, "phase_offset", 0); + uiItemR(col, NULL, 0, &ptr, "value_offset", 0); } /* --------------- */ @@ -287,14 +287,14 @@ static void draw_modifier__cycles(uiLayout *layout, ID *id, FModifier *fcm, shor /* before range */ col= uiLayoutColumn(split, 1); uiItemL(col, "Before:", 0); - uiItemR(col, "", 0, &ptr, "before_mode", 0, 0, 0); - uiItemR(col, NULL, 0, &ptr, "before_cycles", 0, 0, 0); + uiItemR(col, "", 0, &ptr, "before_mode", 0); + uiItemR(col, NULL, 0, &ptr, "before_cycles", 0); /* after range */ col= uiLayoutColumn(split, 1); uiItemL(col, "After:", 0); - uiItemR(col, "", 0, &ptr, "after_mode", 0, 0, 0); - uiItemR(col, NULL, 0, &ptr, "after_cycles", 0, 0, 0); + uiItemR(col, "", 0, &ptr, "after_mode", 0); + uiItemR(col, NULL, 0, &ptr, "after_cycles", 0); } /* --------------- */ @@ -309,20 +309,20 @@ static void draw_modifier__noise(uiLayout *layout, ID *id, FModifier *fcm, short RNA_pointer_create(id, &RNA_FModifierNoise, fcm, &ptr); /* blending mode */ - uiItemR(layout, NULL, 0, &ptr, "modification", 0, 0, 0); + uiItemR(layout, NULL, 0, &ptr, "modification", 0); /* split into 2 columns */ split= uiLayoutSplit(layout, 0.5f); /* col 1 */ col= uiLayoutColumn(split, 0); - uiItemR(col, NULL, 0, &ptr, "size", 0, 0, 0); - uiItemR(col, NULL, 0, &ptr, "strength", 0, 0, 0); + uiItemR(col, NULL, 0, &ptr, "size", 0); + uiItemR(col, NULL, 0, &ptr, "strength", 0); /* col 2 */ col= uiLayoutColumn(split, 0); - uiItemR(col, NULL, 0, &ptr, "phase", 0, 0, 0); - uiItemR(col, NULL, 0, &ptr, "depth", 0, 0, 0); + uiItemR(col, NULL, 0, &ptr, "phase", 0); + uiItemR(col, NULL, 0, &ptr, "depth", 0); } /* --------------- */ @@ -503,11 +503,11 @@ static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, sh /* general settings */ col= uiLayoutColumn(layout, 1); uiItemL(col, "Envelope:", 0); - uiItemR(col, NULL, 0, &ptr, "reference_value", 0, 0, 0); + uiItemR(col, NULL, 0, &ptr, "reference_value", 0); row= uiLayoutRow(col, 1); - uiItemR(row, "Min", 0, &ptr, "default_minimum", 0, 0, 0); - uiItemR(row, "Max", 0, &ptr, "default_maximum", 0, 0, 0); + uiItemR(row, "Min", 0, &ptr, "default_minimum", 0); + uiItemR(row, "Max", 0, &ptr, "default_maximum", 0); /* control points header */ // TODO: move this control-point control stuff to using the new special widgets for lists @@ -559,13 +559,13 @@ static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, shor /* x-minimum */ col= uiLayoutColumn(split, 1); - uiItemR(col, NULL, 0, &ptr, "use_minimum_x", 0, 0, 0); - uiItemR(col, NULL, 0, &ptr, "minimum_x", 0, 0, 0); + uiItemR(col, NULL, 0, &ptr, "use_minimum_x", 0); + uiItemR(col, NULL, 0, &ptr, "minimum_x", 0); /* y-minimum*/ col= uiLayoutColumn(split, 1); - uiItemR(col, NULL, 0, &ptr, "use_minimum_y", 0, 0, 0); - uiItemR(col, NULL, 0, &ptr, "minimum_y", 0, 0, 0); + uiItemR(col, NULL, 0, &ptr, "use_minimum_y", 0); + uiItemR(col, NULL, 0, &ptr, "minimum_y", 0); } /* row 2: minimum */ @@ -577,13 +577,13 @@ static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, shor /* x-minimum */ col= uiLayoutColumn(split, 1); - uiItemR(col, NULL, 0, &ptr, "use_maximum_x", 0, 0, 0); - uiItemR(col, NULL, 0, &ptr, "maximum_x", 0, 0, 0); + uiItemR(col, NULL, 0, &ptr, "use_maximum_x", 0); + uiItemR(col, NULL, 0, &ptr, "maximum_x", 0); /* y-minimum*/ col= uiLayoutColumn(split, 1); - uiItemR(col, NULL, 0, &ptr, "use_maximum_y", 0, 0, 0); - uiItemR(col, NULL, 0, &ptr, "maximum_y", 0, 0, 0); + uiItemR(col, NULL, 0, &ptr, "use_maximum_y", 0); + uiItemR(col, NULL, 0, &ptr, "maximum_y", 0); } } diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 5bf59b06bc4..5f93743493a 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -585,16 +585,21 @@ void UI_exit(void); #define UI_LAYOUT_ALIGN_CENTER 2 #define UI_LAYOUT_ALIGN_RIGHT 3 +#define UI_ITEM_O_RETURN_PROPS 1 +#define UI_ITEM_R_EXPAND 2 +#define UI_ITEM_R_SLIDER 4 +#define UI_ITEM_R_TOGGLE 8 + uiLayout *uiBlockLayout(uiBlock *block, int dir, int type, int x, int y, int size, int em, struct uiStyle *style); void uiBlockSetCurLayout(uiBlock *block, uiLayout *layout); void uiBlockLayoutResolve(const struct bContext *C, uiBlock *block, int *x, int *y); uiBlock *uiLayoutGetBlock(uiLayout *layout); -void uiLayoutSetOperatorContext(uiLayout *layout, int opcontext); void uiLayoutSetFunc(uiLayout *layout, uiMenuHandleFunc handlefunc, void *argv); void uiLayoutSetContextPointer(uiLayout *layout, char *name, struct PointerRNA *ptr); +void uiLayoutSetOperatorContext(uiLayout *layout, int opcontext); void uiLayoutSetActive(uiLayout *layout, int active); void uiLayoutSetEnabled(uiLayout *layout, int enabled); void uiLayoutSetRedAlert(uiLayout *layout, int redalert); @@ -641,8 +646,6 @@ void uiTemplateRunningJobs(uiLayout *layout, struct bContext *C); void uiTemplateOperatorSearch(uiLayout *layout); void uiTemplateHeader3D(uiLayout *layout, struct bContext *C); void uiTemplate_view3d_select_metaballmenu(uiLayout *layout, struct bContext *C); -void uiTemplate_view3d_select_armaturemenu(uiLayout *layout, struct bContext *C); -void uiTemplate_view3d_select_posemenu(uiLayout *layout, struct bContext *C); void uiTemplate_view3d_select_faceselmenu(uiLayout *layout, struct bContext *C); void uiTemplateTextureImage(uiLayout *layout, struct bContext *C, struct Tex *tex); @@ -664,10 +667,10 @@ void uiItemBooleanO(uiLayout *layout, char *name, int icon, char *opname, char * void uiItemIntO(uiLayout *layout, char *name, int icon, char *opname, char *propname, int value); void uiItemFloatO(uiLayout *layout, char *name, int icon, char *opname, char *propname, float value); void uiItemStringO(uiLayout *layout, char *name, int icon, char *opname, char *propname, char *value); -void uiItemFullO(uiLayout *layout, char *name, int icon, char *idname, struct IDProperty *properties, int context); +PointerRNA uiItemFullO(uiLayout *layout, char *name, int icon, char *idname, struct IDProperty *properties, int context, int flag); -void uiItemR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, int expand, int slider, int toggle); -void uiItemFullR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int expand, int slider, int toggle); +void uiItemR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, int flag); +void uiItemFullR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag); void uiItemEnumR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, int value); void uiItemEnumR_string(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, char *value); void uiItemsEnumR(uiLayout *layout, struct PointerRNA *ptr, char *propname); diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index ab27f8fb0f6..8676fe62a3a 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -535,7 +535,7 @@ static void ui_item_disabled(uiLayout *layout, char *name) } /* operator items */ -void uiItemFullO(uiLayout *layout, char *name, int icon, char *idname, IDProperty *properties, int context) +PointerRNA uiItemFullO(uiLayout *layout, char *name, int icon, char *idname, IDProperty *properties, int context, int flag) { uiBlock *block= layout->root->block; wmOperatorType *ot= WM_operatortype_find(idname, 0); @@ -544,7 +544,7 @@ void uiItemFullO(uiLayout *layout, char *name, int icon, char *idname, IDPropert if(!ot) { ui_item_disabled(layout, idname); - return; + return PointerRNA_NULL; } if(!name) @@ -565,10 +565,21 @@ void uiItemFullO(uiLayout *layout, char *name, int icon, char *idname, IDPropert but= uiDefButO(block, BUT, ot->idname, context, (char*)name, 0, 0, w, UI_UNIT_Y, NULL); /* assign properties */ - if(properties) { + if(properties || (flag & UI_ITEM_O_RETURN_PROPS)) { PointerRNA *opptr= uiButGetOperatorPtrRNA(but); - opptr->data= properties; + + if(properties) { + opptr->data= properties; + } + else { + IDPropertyTemplate val = {0}; + opptr->data= IDP_New(IDP_GROUP, val, "wmOperatorProperties"); + } + + return *opptr; } + + return PointerRNA_NULL; } static char *ui_menu_enumpropname(uiLayout *layout, char *opname, char *propname, int retval) @@ -611,7 +622,7 @@ void uiItemEnumO(uiLayout *layout, char *name, int icon, char *opname, char *pro if(!name) name= ui_menu_enumpropname(layout, opname, propname, value); - uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext); + uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext, 0); } void uiItemsEnumO(uiLayout *layout, char *opname, char *propname) @@ -699,7 +710,7 @@ void uiItemEnumO_string(uiLayout *layout, char *name, int icon, char *opname, ch if(!name) name= ui_menu_enumpropname(layout, opname, propname, value); - uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext); + uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext, 0); } void uiItemBooleanO(uiLayout *layout, char *name, int icon, char *opname, char *propname, int value) @@ -709,7 +720,7 @@ void uiItemBooleanO(uiLayout *layout, char *name, int icon, char *opname, char * WM_operator_properties_create(&ptr, opname); RNA_boolean_set(&ptr, propname, value); - uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext); + uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext, 0); } void uiItemIntO(uiLayout *layout, char *name, int icon, char *opname, char *propname, int value) @@ -719,7 +730,7 @@ void uiItemIntO(uiLayout *layout, char *name, int icon, char *opname, char *prop WM_operator_properties_create(&ptr, opname); RNA_int_set(&ptr, propname, value); - uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext); + uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext, 0); } void uiItemFloatO(uiLayout *layout, char *name, int icon, char *opname, char *propname, float value) @@ -729,7 +740,7 @@ void uiItemFloatO(uiLayout *layout, char *name, int icon, char *opname, char *pr WM_operator_properties_create(&ptr, opname); RNA_float_set(&ptr, propname, value); - uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext); + uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext, 0); } void uiItemStringO(uiLayout *layout, char *name, int icon, char *opname, char *propname, char *value) @@ -739,12 +750,12 @@ void uiItemStringO(uiLayout *layout, char *name, int icon, char *opname, char *p WM_operator_properties_create(&ptr, opname); RNA_string_set(&ptr, propname, value); - uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext); + uiItemFullO(layout, name, icon, opname, ptr.data, layout->root->opcontext, 0); } void uiItemO(uiLayout *layout, char *name, int icon, char *opname) { - uiItemFullO(layout, name, icon, opname, NULL, layout->root->opcontext); + uiItemFullO(layout, name, icon, opname, NULL, layout->root->opcontext, 0); } /* RNA property items */ @@ -793,13 +804,13 @@ static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PropertyRNA *r_h= h; } -void uiItemFullR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int index, int value, int expand, int slider, int toggle) +void uiItemFullR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int index, int value, int flag) { uiBlock *block= layout->root->block; uiBut *but; PropertyType type; char namestr[UI_MAX_NAME_STR]; - int len, w, h; + int len, w, h, slider, toggle, expand; if(!ptr->data || !prop) return; @@ -830,6 +841,10 @@ void uiItemFullR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, Proper icon= (RNA_property_enum_get(ptr, prop) == value)? ICON_CHECKBOX_HLT: ICON_CHECKBOX_DEHLT; } + slider= (flag & UI_ITEM_R_SLIDER); + toggle= (flag & UI_ITEM_R_TOGGLE); + expand= (flag & UI_ITEM_R_EXPAND); + /* get size */ ui_item_rna_size(layout, name, icon, prop, index, &w, &h); @@ -867,7 +882,7 @@ void uiItemFullR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, Proper } } -void uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, char *propname, int expand, int slider, int toggle) +void uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, char *propname, int flag) { PropertyRNA *prop; @@ -882,7 +897,7 @@ void uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, char *prop return; } - uiItemFullR(layout, name, icon, ptr, prop, RNA_NO_INDEX, 0, expand, slider, toggle); + uiItemFullR(layout, name, icon, ptr, prop, RNA_NO_INDEX, 0, flag); } void uiItemEnumR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, int value) @@ -900,7 +915,7 @@ void uiItemEnumR(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, return; } - uiItemFullR(layout, name, icon, ptr, prop, RNA_ENUM_VALUE, value, 0, 0, 0); + uiItemFullR(layout, name, icon, ptr, prop, RNA_ENUM_VALUE, value, 0); } void uiItemEnumR_string(uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, char *value) @@ -931,7 +946,7 @@ void uiItemEnumR_string(uiLayout *layout, char *name, int icon, struct PointerRN for(a=0; item[a].identifier; a++) { if(item[a].value == ivalue) { - uiItemFullR(layout, (char*)item[a].name, item[a].icon, ptr, prop, RNA_ENUM_VALUE, ivalue, 0, 0, 0); + uiItemFullR(layout, (char*)item[a].name, item[a].icon, ptr, prop, RNA_ENUM_VALUE, ivalue, 0); break; } } diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index e7c99f10a66..56badedaded 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -428,15 +428,15 @@ static uiLayout *draw_modifier(uiLayout *layout, Object *ob, ModifierData *md, i else { /* real modifier */ uiBlockBeginAlign(block); - uiItemR(row, "", 0, &ptr, "name", 0, 0, 0); + uiItemR(row, "", 0, &ptr, "name", 0); /* Softbody not allowed in this situation, enforce! */ if(((md->type!=eModifierType_Softbody && md->type!=eModifierType_Collision) || !(ob->pd && ob->pd->deflect)) && (md->type!=eModifierType_Surface)) { - uiItemR(row, "", ICON_SCENE, &ptr, "render", 0, 0, 0); - uiItemR(row, "", ICON_RESTRICT_VIEW_OFF, &ptr, "realtime", 0, 0, 0); + uiItemR(row, "", ICON_SCENE, &ptr, "render", 0); + uiItemR(row, "", ICON_RESTRICT_VIEW_OFF, &ptr, "realtime", 0); if(mti->flags & eModifierTypeFlag_SupportsEditmode) - uiItemR(row, "", ICON_EDITMODE_HLT, &ptr, "editmode", 0, 0, 0); + uiItemR(row, "", ICON_EDITMODE_HLT, &ptr, "editmode", 0); } @@ -1224,9 +1224,9 @@ void uiTemplateTriColorSet(uiLayout *layout, PointerRNA *ptr, char *propname) /* nselected, selected, active color swatches */ csPtr= RNA_property_pointer_get(ptr, prop); - uiItemR(row, "", 0, &csPtr, "normal", 0, 0, 0); - uiItemR(row, "", 0, &csPtr, "selected", 0, 0, 0); - uiItemR(row, "", 0, &csPtr, "active", 0, 0, 0); + uiItemR(row, "", 0, &csPtr, "normal", 0); + uiItemR(row, "", 0, &csPtr, "selected", 0); + uiItemR(row, "", 0, &csPtr, "active", 0); } /********************* Layer Buttons Template ************************/ @@ -1278,7 +1278,7 @@ void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, char *propname) /* add layers as toggle buts */ for (col= 0; (col < cols) && (layer < layers); col++, layer++) { int icon=0; // XXX - add some way of setting this... - uiItemFullR(uRow, "", icon, ptr, prop, layer, 0, 0, 0, 1); + uiItemFullR(uRow, "", icon, ptr, prop, layer, 0, UI_ITEM_R_TOGGLE); } } } diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 4201850f5e4..b5cfbe19466 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -175,7 +175,7 @@ void uiDefAutoButsRNA(const bContext *C, uiLayout *layout, PointerRNA *ptr, int if(strcmp(name, "Axis")==0) { uiDefButR(uiLayoutGetBlock(col), BUT_NORMAL, 0, name, 0, 0, 100, 100, ptr, "axis", -1, 0, 0, -1, -1, NULL); } - else uiItemFullR(col, "", 0, ptr, prop, -1, 0, 0, 0, 0); + else uiItemFullR(col, "", 0, ptr, prop, -1, 0, 0); } RNA_STRUCT_END; } diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index e1b8858937c..47eaf1757ac 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -2759,13 +2759,10 @@ static void proxy_group_objects_menu (bContext *C, wmOperator *op, Object *ob, G if (go->ob) { PointerRNA props_ptr; - /* create operator properties, and assign the relevant pointers to that, - * and add a menu entry which uses these props - */ - WM_operator_properties_create(&props_ptr, op->idname); - RNA_string_set(&props_ptr, "object", go->ob->id.name+2); - RNA_string_set(&props_ptr, "group_object", go->ob->id.name+2); - uiItemFullO(layout, go->ob->id.name+2, 0, op->idname, props_ptr.data, WM_OP_EXEC_REGION_WIN); + /* create operator menu item with relevant properties filled in */ + props_ptr= uiItemFullO(layout, go->ob->id.name+2, 0, op->idname, NULL, WM_OP_EXEC_REGION_WIN, UI_ITEM_O_RETURN_PROPS); + RNA_string_set(&props_ptr, "object", go->ob->id.name+2); + RNA_string_set(&props_ptr, "group_object", go->ob->id.name+2); } } @@ -2793,12 +2790,9 @@ static int make_proxy_invoke (bContext *C, wmOperator *op, wmEvent *evt) uiLayout *layout= uiPupMenuLayout(pup); PointerRNA props_ptr; - /* create operator properties, and assign the relevant pointers to that, - * and add a menu entry which uses these props - */ - WM_operator_properties_create(&props_ptr, op->idname); - RNA_string_set(&props_ptr, "object", ob->id.name+2); - uiItemFullO(layout, op->type->name, 0, op->idname, props_ptr.data, WM_OP_EXEC_REGION_WIN); + /* create operator menu item with relevant properties filled in */ + props_ptr= uiItemFullO(layout, op->type->name, 0, op->idname, props_ptr.data, WM_OP_EXEC_REGION_WIN, UI_ITEM_O_RETURN_PROPS); + RNA_string_set(&props_ptr, "object", ob->id.name+2); /* present the menu and be done... */ uiPupMenuEnd(C, pup); diff --git a/source/blender/editors/space_action/action_header.c b/source/blender/editors/space_action/action_header.c index e4750bd0a37..375136d199e 100644 --- a/source/blender/editors/space_action/action_header.c +++ b/source/blender/editors/space_action/action_header.c @@ -88,9 +88,9 @@ static void act_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) //uiItemS(layout); - uiItemR(layout, NULL, 0, &spaceptr, "show_cframe_indicator", 0, 0, 0); - uiItemR(layout, NULL, 0, &spaceptr, "show_sliders", 0, 0, 0); - uiItemR(layout, NULL, 0, &spaceptr, "automerge_keyframes", 0, 0, 0); + uiItemR(layout, NULL, 0, &spaceptr, "show_cframe_indicator", 0); + uiItemR(layout, NULL, 0, &spaceptr, "show_sliders", 0); + uiItemR(layout, NULL, 0, &spaceptr, "automerge_keyframes", 0); if (sact->flag & SACTION_DRAWTIME) uiItemO(layout, "Show Frames", 0, "ANIM_OT_time_toggle"); diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index 30598d39d58..c48b3529389 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -184,7 +184,7 @@ static void file_panel_operator(const bContext *C, Panel *pa) if(strncmp(RNA_property_identifier(prop), "filter", 6) == 0) continue; - uiItemFullR(pa->layout, NULL, 0, op->ptr, prop, -1, 0, 0, 0, 0); + uiItemFullR(pa->layout, NULL, 0, op->ptr, prop, -1, 0, 0); empty= 0; } RNA_STRUCT_END; diff --git a/source/blender/editors/space_graph/graph_header.c b/source/blender/editors/space_graph/graph_header.c index c4654972dcd..fc02cadb475 100644 --- a/source/blender/editors/space_graph/graph_header.c +++ b/source/blender/editors/space_graph/graph_header.c @@ -80,15 +80,15 @@ static void graph_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemS(layout); - uiItemR(layout, NULL, 0, &spaceptr, "show_cframe_indicator", 0, 0, 0); + uiItemR(layout, NULL, 0, &spaceptr, "show_cframe_indicator", 0); if (sipo->flag & SIPO_NOHANDLES) uiItemO(layout, "Show Handles", ICON_CHECKBOX_DEHLT, "GRAPH_OT_handles_view_toggle"); else uiItemO(layout, "Show Handles", ICON_CHECKBOX_HLT, "GRAPH_OT_handles_view_toggle"); - uiItemR(layout, NULL, 0, &spaceptr, "only_selected_curves_handles", 0, 0, 0); - uiItemR(layout, NULL, 0, &spaceptr, "automerge_keyframes", 0, 0, 0); + uiItemR(layout, NULL, 0, &spaceptr, "only_selected_curves_handles", 0); + uiItemR(layout, NULL, 0, &spaceptr, "automerge_keyframes", 0); if (sipo->flag & SIPO_DRAWTIME) uiItemO(layout, "Show Frames", 0, "ANIM_OT_time_toggle"); diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index 7184737e0ba..2ffca5185f2 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -210,19 +210,19 @@ static void nla_panel_animdata (const bContext *C, Panel *pa) /* Active Action Properties ------------------------------------- */ /* action */ row= uiLayoutRow(layout, 1); - uiItemR(row, NULL, 0, &adt_ptr, "action", 0, 0, 0); + uiItemR(row, NULL, 0, &adt_ptr, "action", 0); /* extrapolation */ row= uiLayoutRow(layout, 1); - uiItemR(row, NULL, 0, &adt_ptr, "action_extrapolation", 0, 0, 0); + uiItemR(row, NULL, 0, &adt_ptr, "action_extrapolation", 0); /* blending */ row= uiLayoutRow(layout, 1); - uiItemR(row, NULL, 0, &adt_ptr, "action_blending", 0, 0, 0); + uiItemR(row, NULL, 0, &adt_ptr, "action_blending", 0); /* influence */ row= uiLayoutRow(layout, 1); - uiItemR(row, NULL, 0, &adt_ptr, "action_influence", 0, 0, 0); + uiItemR(row, NULL, 0, &adt_ptr, "action_influence", 0); } /* active NLA-Track */ @@ -242,7 +242,7 @@ static void nla_panel_track (const bContext *C, Panel *pa) /* Info - Active NLA-Context:Track ---------------------- */ row= uiLayoutRow(layout, 1); - uiItemR(row, NULL, ICON_NLA, &nlt_ptr, "name", 0, 0, 0); + uiItemR(row, NULL, ICON_NLA, &nlt_ptr, "name", 0); } /* generic settings for active NLA-Strip */ @@ -262,41 +262,41 @@ static void nla_panel_properties(const bContext *C, Panel *pa) /* Strip Properties ------------------------------------- */ /* strip type */ row= uiLayoutColumn(layout, 1); - uiItemR(row, NULL, ICON_NLA, &strip_ptr, "name", 0, 0, 0); // XXX icon? - uiItemR(row, NULL, 0, &strip_ptr, "type", 0, 0, 0); + uiItemR(row, NULL, ICON_NLA, &strip_ptr, "name", 0); // XXX icon? + uiItemR(row, NULL, 0, &strip_ptr, "type", 0); /* strip extents */ column= uiLayoutColumn(layout, 1); uiItemL(column, "Strip Extents:", 0); - uiItemR(column, NULL, 0, &strip_ptr, "start_frame", 0, 0, 0); - uiItemR(column, NULL, 0, &strip_ptr, "end_frame", 0, 0, 0); + uiItemR(column, NULL, 0, &strip_ptr, "start_frame", 0); + uiItemR(column, NULL, 0, &strip_ptr, "end_frame", 0); /* extrapolation */ row= uiLayoutRow(layout, 1); - uiItemR(row, NULL, 0, &strip_ptr, "extrapolation", 0, 0, 0); + uiItemR(row, NULL, 0, &strip_ptr, "extrapolation", 0); /* blending */ row= uiLayoutRow(layout, 1); - uiItemR(row, NULL, 0, &strip_ptr, "blending", 0, 0, 0); + uiItemR(row, NULL, 0, &strip_ptr, "blending", 0); /* blend in/out + autoblending * - blend in/out can only be set when autoblending is off */ column= uiLayoutColumn(layout, 1); uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "animated_influence")==0); - uiItemR(column, NULL, 0, &strip_ptr, "auto_blending", 0, 0, 0); // XXX as toggle? + uiItemR(column, NULL, 0, &strip_ptr, "auto_blending", 0); // XXX as toggle? subcol= uiLayoutColumn(column, 1); uiLayoutSetActive(subcol, RNA_boolean_get(&strip_ptr, "auto_blending")==0); - uiItemR(subcol, NULL, 0, &strip_ptr, "blend_in", 0, 0, 0); - uiItemR(subcol, NULL, 0, &strip_ptr, "blend_out", 0, 0, 0); + uiItemR(subcol, NULL, 0, &strip_ptr, "blend_in", 0); + uiItemR(subcol, NULL, 0, &strip_ptr, "blend_out", 0); /* settings */ column= uiLayoutColumn(layout, 1); uiLayoutSetActive(column, !(RNA_boolean_get(&strip_ptr, "animated_influence") || RNA_boolean_get(&strip_ptr, "animated_time"))); uiItemL(column, "Playback Settings:", 0); - uiItemR(column, NULL, 0, &strip_ptr, "muted", 0, 0, 0); - uiItemR(column, NULL, 0, &strip_ptr, "reversed", 0, 0, 0); + uiItemR(column, NULL, 0, &strip_ptr, "muted", 0); + uiItemR(column, NULL, 0, &strip_ptr, "reversed", 0); } @@ -318,21 +318,21 @@ static void nla_panel_actclip(const bContext *C, Panel *pa) /* Strip Properties ------------------------------------- */ /* action pointer */ row= uiLayoutRow(layout, 1); - uiItemR(row, NULL, ICON_ACTION, &strip_ptr, "action", 0, 0, 0); + uiItemR(row, NULL, ICON_ACTION, &strip_ptr, "action", 0); /* action extents */ // XXX custom names were used here (to avoid the prefixes)... probably not necessary in future? column= uiLayoutColumn(layout, 1); uiItemL(column, "Action Extents:", 0); - uiItemR(column, "Start Frame", 0, &strip_ptr, "action_start_frame", 0, 0, 0); - uiItemR(column, "End Frame", 0, &strip_ptr, "action_end_frame", 0, 0, 0); + uiItemR(column, "Start Frame", 0, &strip_ptr, "action_start_frame", 0); + uiItemR(column, "End Frame", 0, &strip_ptr, "action_end_frame", 0); /* action usage */ column= uiLayoutColumn(layout, 1); uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "animated_time")==0); uiItemL(column, "Playback Settings:", 0); - uiItemR(column, NULL, 0, &strip_ptr, "scale", 0, 0, 0); - uiItemR(column, NULL, 0, &strip_ptr, "repeat", 0, 0, 0); + uiItemR(column, NULL, 0, &strip_ptr, "scale", 0); + uiItemR(column, NULL, 0, &strip_ptr, "repeat", 0); } /* evaluation settings for active NLA-Strip */ @@ -351,19 +351,19 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa) uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); column= uiLayoutColumn(layout, 1); - uiItemR(column, NULL, 0, &strip_ptr, "animated_influence", 0, 0, 0); + uiItemR(column, NULL, 0, &strip_ptr, "animated_influence", 0); subcolumn= uiLayoutColumn(column, 1); uiLayoutSetEnabled(subcolumn, RNA_boolean_get(&strip_ptr, "animated_influence")); - uiItemR(subcolumn, NULL, 0, &strip_ptr, "influence", 0, 0, 0); + uiItemR(subcolumn, NULL, 0, &strip_ptr, "influence", 0); column= uiLayoutColumn(layout, 1); - uiItemR(column, NULL, 0, &strip_ptr, "animated_time", 0, 0, 0); + uiItemR(column, NULL, 0, &strip_ptr, "animated_time", 0); subcolumn= uiLayoutColumn(column, 1); uiLayoutSetEnabled(subcolumn, RNA_boolean_get(&strip_ptr, "animated_time")); - uiItemR(subcolumn, NULL, 0, &strip_ptr, "strip_time", 0, 0, 0); + uiItemR(subcolumn, NULL, 0, &strip_ptr, "strip_time", 0); } /* F-Modifiers for active NLA-Strip */ diff --git a/source/blender/editors/space_nla/nla_header.c b/source/blender/editors/space_nla/nla_header.c index e507efb0a30..0d3bf2cb6b1 100644 --- a/source/blender/editors/space_nla/nla_header.c +++ b/source/blender/editors/space_nla/nla_header.c @@ -94,14 +94,14 @@ static void nla_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemS(layout); - uiItemR(layout, NULL, 0, &spaceptr, "show_cframe_indicator", 0, 0, 0); + uiItemR(layout, NULL, 0, &spaceptr, "show_cframe_indicator", 0); if (snla->flag & SNLA_DRAWTIME) uiItemO(layout, "Show Frames", 0, "ANIM_OT_time_toggle"); else uiItemO(layout, "Show Seconds", 0, "ANIM_OT_time_toggle"); - uiItemR(layout, NULL, 0, &spaceptr, "show_strip_curves", 0, 0, 0); + uiItemR(layout, NULL, 0, &spaceptr, "show_strip_curves", 0); uiItemS(layout); diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 3487efc4218..9fa1b222868 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -949,65 +949,6 @@ void uiTemplate_view3d_select_metaballmenu(uiLayout *layout, bContext *C) view3d_select_metaballmenu(C, layout, arg_unused); } -static void view3d_select_armaturemenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - PointerRNA ptr; - - /* this part of the menu has been moved to python */ - /*uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border"); - - uiItemS(layout); - - uiItemO(layout, "Select/Deselect All", 0, "ARMATURE_OT_select_all_toggle"); - uiItemO(layout, "Inverse", 0, "ARMATURE_OT_select_inverse"); - - uiItemS(layout); - - uiItemEnumO(layout, "Parent", 0, "ARMATURE_OT_select_hierarchy", "direction", BONE_SELECT_PARENT); - uiItemEnumO(layout, "Child", 0, "ARMATURE_OT_select_hierarchy", "direction", BONE_SELECT_CHILD); - - uiItemS(layout);*/ - - WM_operator_properties_create(&ptr, "ARMATURE_OT_select_hierarchy"); - RNA_boolean_set(&ptr, "extend", 1); - RNA_enum_set(&ptr, "direction", BONE_SELECT_PARENT); - uiItemFullO(layout, "Extend Parent", 0, "ARMATURE_OT_select_hierarchy", ptr.data, WM_OP_EXEC_REGION_WIN); - - WM_operator_properties_create(&ptr, "ARMATURE_OT_select_hierarchy"); - RNA_boolean_set(&ptr, "extend", 1); - RNA_enum_set(&ptr, "direction", BONE_SELECT_CHILD); - uiItemFullO(layout, "Extend Child", 0, "ARMATURE_OT_select_hierarchy", ptr.data, WM_OP_EXEC_REGION_WIN); -} - -/* wrapper for python layouts */ -void uiTemplate_view3d_select_armaturemenu(uiLayout *layout, bContext *C) -{ - void *arg_unused = NULL; - view3d_select_armaturemenu(C, layout, arg_unused); -} - -static void view3d_select_posemenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - PointerRNA ptr; - - WM_operator_properties_create(&ptr, "POSE_OT_select_hierarchy"); - RNA_boolean_set(&ptr, "extend", 1); - RNA_enum_set(&ptr, "direction", BONE_SELECT_PARENT); - uiItemFullO(layout, "Extend Parent", 0, "POSE_OT_select_hierarchy", ptr.data, WM_OP_EXEC_REGION_WIN); - - WM_operator_properties_create(&ptr, "POSE_OT_select_hierarchy"); - RNA_boolean_set(&ptr, "extend", 1); - RNA_enum_set(&ptr, "direction", BONE_SELECT_CHILD); - uiItemFullO(layout, "Extend Child", 0, "POSE_OT_select_hierarchy", ptr.data, WM_OP_EXEC_REGION_WIN); -} - -/* wrapper for python layouts */ -void uiTemplate_view3d_select_posemenu(uiLayout *layout, bContext *C) -{ - void *arg_unused = NULL; - view3d_select_posemenu(C, layout, arg_unused); -} - void do_view3d_select_faceselmenu(bContext *C, void *arg, int event) { #if 0 @@ -2120,8 +2061,8 @@ static void view3d_edit_meshmenu(bContext *C, uiLayout *layout, void *arg_unused uiItemS(layout); - uiItemR(layout, NULL, 0, &tsptr, "automerge_editing", 0, 0, 0); - uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0, 0, 0); // |O + uiItemR(layout, NULL, 0, &tsptr, "automerge_editing", 0); + uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0); // |O uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); // |Shift O uiItemS(layout); @@ -2204,7 +2145,7 @@ static void view3d_edit_curvemenu(bContext *C, uiLayout *layout, void *arg_unuse uiItemS(layout); - uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0, 0, 0); // |O + uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0); // |O uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); // |Shift O uiItemS(layout); @@ -2245,7 +2186,7 @@ static void view3d_edit_latticemenu(bContext *C, uiLayout *layout, void *arg_unu uiItemS(layout); - uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0, 0, 0); // |O + uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0); // |O uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); // |Shift O } #endif diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index 32378a915bd..c87dd0b7948 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -270,7 +270,7 @@ static void view3d_panel_tool_shelf(const bContext *C, Panel *pa) for(ct= st->toolshelf.first; ct; ct= ct->next) { if(0==strncmp(context, ct->context, OP_MAX_TYPENAME)) { col= uiLayoutColumn(pa->layout, 1); - uiItemFullO(col, NULL, 0, ct->opname, NULL, WM_OP_INVOKE_REGION_WIN); + uiItemFullO(col, NULL, 0, ct->opname, NULL, WM_OP_INVOKE_REGION_WIN, 0); } } } diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 05eac06de7f..83178f32d5f 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -1198,7 +1198,13 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA dparm= dfunc->cont.properties.first; for(; dparm; dparm= dparm->next) { - ptrstr= (dparm->prop->type == PROP_POINTER || dparm->prop->arraylength > 0)? "*" : ""; + if(dparm->prop->arraylength > 0) + ptrstr= "*"; + else if(dparm->prop==func->ret) + ptrstr= ((dparm->prop->type == PROP_POINTER) && !(dparm->prop->flag & PROP_RNAPTR))? "*": ""; + else + ptrstr= (dparm->prop->type == PROP_POINTER)? "*": ""; + fprintf(f, "\t%s%s %s%s;\n", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), ptrstr, dparm->prop->identifier); } @@ -1274,7 +1280,7 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA if(func->ret) { dparm= rna_find_parameter_def(func->ret); - ptrstr= dparm->prop->type == PROP_POINTER || dparm->prop->arraylength > 0 ? "*" : ""; + ptrstr= (((dparm->prop->type == PROP_POINTER) && !(dparm->prop->flag & PROP_RNAPTR)) || (dparm->prop->arraylength > 0))? "*": ""; fprintf(f, "\t*((%s%s%s*)_retdata)= %s;\n", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), ptrstr, func->ret->identifier); } } @@ -1516,7 +1522,7 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA if(dparm->prop==func->ret) { if(dparm->prop->arraylength) fprintf(f, "XXX no array return types yet"); /* XXX not supported */ - else if(dparm->prop->type == PROP_POINTER) + else if(dparm->prop->type == PROP_POINTER && !(dparm->prop->flag & PROP_RNAPTR)) fprintf(f, "%s%s *", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop)); else fprintf(f, "%s%s ", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop)); diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 82694098e69..587ff57a0b5 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -37,6 +37,23 @@ #ifdef RNA_RUNTIME +static void rna_uiItemR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, char *propname, int expand, int slider, int toggle) +{ + int flag= 0; + + flag |= (slider)? UI_ITEM_R_SLIDER: 0; + flag |= (expand)? UI_ITEM_R_EXPAND: 0; + flag |= (toggle)? UI_ITEM_R_TOGGLE: 0; + + uiItemR(layout, name, icon, ptr, propname, flag); +} + +static PointerRNA rna_uiItemO(uiLayout *layout, char *name, int icon, char *opname, int properties) +{ + int flag= (properties)? UI_ITEM_O_RETURN_PROPS: 0; + return uiItemFullO(layout, name, icon, opname, NULL, uiLayoutGetOperatorContext(layout), flag); +} + #else #define DEF_ICON(name) {name, #name, 0, #name, ""}, @@ -122,7 +139,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_float(func, "percentage", 0.0f, 0.0f, 1.0f, "Percentage", "Percentage of width to split at.", 0.0f, 1.0f); /* items */ - func= RNA_def_function(srna, "itemR", "uiItemR"); + func= RNA_def_function(srna, "itemR", "rna_uiItemR"); api_ui_item_common(func); api_ui_item_rna_common(func); RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail."); @@ -150,8 +167,12 @@ void RNA_api_ui_layout(StructRNA *srna) parm= RNA_def_string(func, "search_property", "", 0, "", "Identifier of search collection property."); RNA_def_property_flag(parm, PROP_REQUIRED); - func= RNA_def_function(srna, "itemO", "uiItemO"); + func= RNA_def_function(srna, "itemO", "rna_uiItemO"); api_ui_item_op_common(func); + parm= RNA_def_boolean(func, "properties", 0, "Properties", "Return operator properties to fill in manually."); + parm= RNA_def_pointer(func, "return_properties", "OperatorProperties", "", "Operator properties to fill in, return when 'properties' is set to true."); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); + RNA_def_function_return(func, parm); func= RNA_def_function(srna, "item_enumO", "uiItemEnumO_string"); api_ui_item_op_common(func); @@ -292,10 +313,6 @@ void RNA_api_ui_layout(StructRNA *srna) func= RNA_def_function(srna, "view3d_select_metaballmenu", "uiTemplate_view3d_select_metaballmenu"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); - func= RNA_def_function(srna, "view3d_select_armaturemenu", "uiTemplate_view3d_select_armaturemenu"); - RNA_def_function_flag(func, FUNC_USE_CONTEXT); - func= RNA_def_function(srna, "view3d_select_posemenu", "uiTemplate_view3d_select_posemenu"); - RNA_def_function_flag(func, FUNC_USE_CONTEXT); func= RNA_def_function(srna, "view3d_select_faceselmenu", "uiTemplate_view3d_select_faceselmenu"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); From f2e7ca0de39ef3ff83feb05e6bae949e12a9fb7b Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 21 Aug 2009 14:33:53 +0000 Subject: [PATCH 185/577] 2.5: Load UI is now an operator property, and a user preference to define what the default is, just like file compression for saving. --- release/ui/space_userpref.py | 1 + source/blender/makesdna/DNA_userdef_types.h | 1 + source/blender/makesrna/intern/rna_userdef.c | 4 ++++ .../blender/windowmanager/intern/wm_operators.c | 16 ++++++++++++++++ 4 files changed, 22 insertions(+) diff --git a/release/ui/space_userpref.py b/release/ui/space_userpref.py index 95054efcb25..bd963c65cd0 100644 --- a/release/ui/space_userpref.py +++ b/release/ui/space_userpref.py @@ -359,6 +359,7 @@ class USERPREF_PT_filepaths(bpy.types.Panel): sub2.itemL(text="Save & Load:") sub2.itemR(paths, "use_relative_paths") sub2.itemR(paths, "compress_file") + sub2.itemR(paths, "load_ui") sub2.itemL(text="Auto Save:") sub2.itemR(paths, "save_version") sub2.itemR(paths, "recent_files") diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index c2314e1e3a2..100f55ffe33 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -369,6 +369,7 @@ extern UserDef U; /* from blenkernel blender.c */ #define USER_RELPATHS (1 << 20) #define USER_DRAGIMMEDIATE (1 << 21) #define USER_DONT_DOSCRIPTLINKS (1 << 22) +#define USER_FILENOUI (1 << 23) /* viewzom */ #define USER_ZOOM_CONT 0 diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index d1245528100..b74dc6f757b 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2199,6 +2199,10 @@ static void rna_def_userdef_filepaths(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_FILECOMPRESS); RNA_def_property_ui_text(prop, "Compress File", "Enable file compression when saving .blend files."); + prop= RNA_def_property(srna, "load_ui", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", USER_FILENOUI); + RNA_def_property_ui_text(prop, "Load UI", "Load user interface setup when loading .blend files."); + prop= RNA_def_property(srna, "fonts_directory", PROP_STRING, PROP_DIRPATH); RNA_def_property_string_sdna(prop, NULL, "fontdir"); RNA_def_property_ui_text(prop, "Fonts Directory", "The default directory to search for loading fonts."); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index ab8dfeabe4f..87a145ceee2 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -868,10 +868,17 @@ static void untitled(char *name) } } +static void load_set_load_ui(wmOperator *op) +{ + if(!RNA_property_is_set(op->ptr, "load_ui")) + RNA_boolean_set(op->ptr, "load_ui", !(U.flag & USER_FILENOUI)); +} static int wm_open_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *event) { RNA_string_set(op->ptr, "filename", G.sce); + load_set_load_ui(op); + WM_event_add_fileselect(C, op); return OPERATOR_RUNNING_MODAL; @@ -880,7 +887,14 @@ static int wm_open_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *event) static int wm_open_mainfile_exec(bContext *C, wmOperator *op) { char filename[FILE_MAX]; + RNA_string_get(op->ptr, "filename", filename); + load_set_load_ui(op); + + if(RNA_boolean_get(op->ptr, "load_ui")) + G.fileflags &= ~G_FILE_NO_UI; + else + G.fileflags |= G_FILE_NO_UI; // XXX wm in context is not set correctly after WM_read_file -> crash // do it before for now, but is this correct with multiple windows? @@ -901,6 +915,8 @@ static void WM_OT_open_mainfile(wmOperatorType *ot) ot->poll= WM_operator_winactive; WM_operator_properties_filesel(ot, FOLDERFILE|BLENDERFILE); + + RNA_def_boolean(ot->srna, "load_ui", 1, "Load UI", "Load user interface setup in the .blend file."); } static int wm_recover_last_session_exec(bContext *C, wmOperator *op) From bc41c845f355c0e4fed427bfa3ab7fc5f7e96660 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 21 Aug 2009 16:28:49 +0000 Subject: [PATCH 186/577] 2.5: Animation playback without sync option was slightly slower than expected time, even when it could keep up. Changed the WM timer logic a bit to always target the next frame time exactly, --- source/blender/windowmanager/WM_types.h | 2 ++ source/blender/windowmanager/intern/wm_window.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index c400b6c9b20..42ee6e926fc 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -283,6 +283,8 @@ typedef struct wmTimer { double delta; /* time since previous step in seconds */ double ltime; /* internal, last time timer was activated */ + double ntime; /* internal, next time we want to activate the timer */ + double stime; /* internal, when the timer started */ int sleep; /* internal, put timers to sleep when needed */ } wmTimer; diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index d6bde9a468c..27a1b076a28 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -26,6 +26,7 @@ * ***** END GPL LICENSE BLOCK ***** */ +#include #include #include #include @@ -690,12 +691,13 @@ static int wm_window_timer(const bContext *C) wmTimer *wt; for(wt= win->timers.first; wt; wt= wt->next) { if(wt->sleep==0) { - if(wt->timestep < time - wt->ltime) { + if(time > wt->ntime) { wmEvent event= *(win->eventstate); wt->delta= time - wt->ltime; wt->duration += wt->delta; wt->ltime= time; + wt->ntime= wt->stime + wt->timestep*ceil(wt->duration/wt->timestep); event.type= wt->event_type; event.custom= EVT_DATA_TIMER; @@ -790,6 +792,8 @@ wmTimer *WM_event_add_window_timer(wmWindow *win, int event_type, double timeste wt->event_type= event_type; wt->ltime= PIL_check_seconds_timer(); + wt->ntime= wt->ltime + timestep; + wt->stime= wt->ltime; wt->timestep= timestep; BLI_addtail(&win->timers, wt); From 5280c2884b3395376eec8c9b6f7521375b88f51c Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Fri, 21 Aug 2009 17:35:35 +0000 Subject: [PATCH 187/577] 2.5 Object mode: * Made object mode an enum, shows better in the debugger * Added a toggle mode to the set object mode operator * Toggling a mode on and off goes back to the previous mode, not just object mode * Changed the vertex mode and weight mode shortcuts to call the toggle mode operator --- source/blender/editors/object/object_edit.c | 27 ++++++++++++++----- .../blender/editors/space_view3d/view3d_ops.c | 8 ++++-- source/blender/makesdna/DNA_object_types.h | 26 +++++++++--------- 3 files changed, 40 insertions(+), 21 deletions(-) diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 47eaf1757ac..8ac12a5e3a4 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -7092,18 +7092,31 @@ static const char *object_mode_op_string(int mode) static int object_mode_set_exec(bContext *C, wmOperator *op) { Object *ob= CTX_data_active_object(C); - int mode = RNA_enum_get(op->ptr, "mode"); + ObjectMode mode = RNA_enum_get(op->ptr, "mode"); + ObjectMode restore_mode = ob->mode; + int toggle = RNA_boolean_get(op->ptr, "toggle"); if(!ob) return OPERATOR_CANCELLED; - /* Exit off current mode */ - if(ob->mode != OB_MODE_OBJECT) + /* Exit current mode if it's not the mode we're setting */ + if(ob->mode != OB_MODE_OBJECT && ob->mode != mode) WM_operator_name_call(C, object_mode_op_string(ob->mode), WM_OP_EXEC_REGION_WIN, NULL); - /* Enter new mode */ - if(mode != OB_MODE_OBJECT) - WM_operator_name_call(C, object_mode_op_string(mode), WM_OP_EXEC_REGION_WIN, NULL); + if(mode != OB_MODE_OBJECT) { + /* Enter new mode */ + if(ob->mode != mode || toggle) + WM_operator_name_call(C, object_mode_op_string(mode), WM_OP_EXEC_REGION_WIN, NULL); + + if(toggle) { + if(ob->mode == mode) + /* For toggling, store old mode so we know what to go back to */ + ob->restore_mode = restore_mode; + else if(ob->restore_mode != OB_MODE_OBJECT && ob->restore_mode != mode) { + WM_operator_name_call(C, object_mode_op_string(ob->restore_mode), WM_OP_EXEC_REGION_WIN, NULL); + } + } + } return OPERATOR_FINISHED; } @@ -7127,6 +7140,8 @@ void OBJECT_OT_mode_set(wmOperatorType *ot) prop= RNA_def_enum(ot->srna, "mode", object_mode_items, 0, "Mode", ""); RNA_def_enum_funcs(prop, object_mode_set_itemsf); + + RNA_def_boolean(ot->srna, "toggle", 0, "Toggle", ""); } diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 112847272e5..b0eabae3f5d 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -106,8 +106,12 @@ void view3d_keymap(wmWindowManager *wm) ListBase *keymap= WM_keymap_listbase(wm, "View3D Generic", SPACE_VIEW3D, 0); wmKeymapItem *km; - WM_keymap_add_item(keymap, "PAINT_OT_vertex_paint_toggle", VKEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "PAINT_OT_weight_paint_toggle", TABKEY, KM_PRESS, KM_CTRL, 0); + km = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", VKEY, KM_PRESS, 0, 0); + RNA_enum_set(km->ptr, "mode", OB_MODE_VERTEX_PAINT); + RNA_boolean_set(km->ptr, "toggle", 1); + km = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, KM_CTRL, 0); + RNA_enum_set(km->ptr, "mode", OB_MODE_WEIGHT_PAINT); + RNA_boolean_set(km->ptr, "toggle", 1); WM_keymap_add_item(keymap, "VIEW3D_OT_properties", NKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW3D_OT_toolbar", TKEY, KM_PRESS, 0, 0); diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 5c821b532fb..be43ae7f99d 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -116,8 +116,8 @@ typedef struct Object { ListBase defbase; ListBase modifiers; /* list of ModifierData structures */ - /* For now just a flag for sculpt mode, eventually we make the other modes local too */ - int mode, pad2; + int mode; /* Local object mode */ + int restore_mode; /* Keep track of what mode to return to after toggling a mode */ /* materials */ struct Material **mat; /* material slots */ @@ -234,7 +234,7 @@ typedef struct Object { unsigned int state; /* bit masks of game controllers that are active */ unsigned int init_state; /* bit masks of initial state as recorded by the users */ - int restore_mode; /* Keep track of what mode to return to after edit mode exits */ + int pad2; ListBase gpulamp; /* runtime, for lamps only */ } Object; @@ -511,16 +511,16 @@ extern Object workob; #define OB_LOCK_SCALE 448 /* ob->mode */ -#define OB_MODE_OBJECT 0 -#define OB_MODE_EDIT 1 -#define OB_MODE_SCULPT 2 -#define OB_MODE_VERTEX_PAINT 4 -#define OB_MODE_WEIGHT_PAINT 8 -#define OB_MODE_TEXTURE_PAINT 16 -#define OB_MODE_PARTICLE_EDIT 32 -#define OB_MODE_POSE 64 - -/* ob->softflag in DNA_object_force.h */ +typedef enum ObjectMode { + OB_MODE_OBJECT = 0, + OB_MODE_EDIT = 1, + OB_MODE_SCULPT = 2, + OB_MODE_VERTEX_PAINT = 4, + OB_MODE_WEIGHT_PAINT = 8, + OB_MODE_TEXTURE_PAINT = 16, + OB_MODE_PARTICLE_EDIT = 32, + OB_MODE_POSE = 64 +} ObjectMode; #ifdef __cplusplus } From fc5df351b30445e697f27aa815d956cc3e9c58ea Mon Sep 17 00:00:00 2001 From: William Reynish Date: Fri, 21 Aug 2009 17:53:27 +0000 Subject: [PATCH 188/577] Material buttons tweaks -Made Mirror and Transparency panels more consistent. -Improved greying out, and better communicated the fact that alpha settings do work even if Ztransp/Ray Transp are not enabled. The results of low alpha and no Ztransp/Ray Transp look weird though - is this supposed to be supported? -Added Flare panel for halo. -Improved SSS panel. --- release/ui/buttons_material.py | 114 ++++++++++++++++++++++----------- 1 file changed, 77 insertions(+), 37 deletions(-) diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py index ed3888ee4d8..73d28d6964c 100644 --- a/release/ui/buttons_material.py +++ b/release/ui/buttons_material.py @@ -87,10 +87,12 @@ class MATERIAL_PT_shading(MaterialButtonsPanel): split = layout.split() col = split.column() - col.active = not mat.shadeless - col.itemR(mat, "ambient") - col.itemR(mat, "emit") - col.itemR(mat, "translucency") + sub = col.column() + sub.active = not mat.shadeless + sub.itemR(mat, "emit") + sub.itemR(mat, "ambient") + sub = col.column() + sub.itemR(mat, "translucency") col = split.column() col.itemR(mat, "shadeless") @@ -119,7 +121,7 @@ class MATERIAL_PT_strand(MaterialButtonsPanel): split = layout.split() - col = split.column() + col = split.column(align=True) col.itemL(text="Size:") col.itemR(tan, "start_size", text="Root") col.itemR(tan, "end_size", text="Tip") @@ -128,11 +130,13 @@ class MATERIAL_PT_strand(MaterialButtonsPanel): sub = col.column() sub.active = (not mat.shadeless) sub.itemR(tan, "tangent_shading") + col.itemR(tan, "shape") col = split.column() - col.itemR(tan, "shape") + col.itemL(text="Shading:") col.itemR(tan, "width_fade") col.itemR(tan, "uv_layer") + col.itemS() sub = col.column() sub.active = (not mat.shadeless) sub.itemR(tan, "surface_diffuse") @@ -343,7 +347,9 @@ class MATERIAL_PT_sss(MaterialButtonsPanel): def draw_header(self, context): layout = self.layout sss = context.material.subsurface_scattering - + mat = context.material + + layout.active = (not mat.shadeless) layout.itemR(sss, "enabled", text="") def draw(self, context): @@ -357,21 +363,22 @@ class MATERIAL_PT_sss(MaterialButtonsPanel): split = layout.split() split.active = (not mat.shadeless) - col = split.column(align=True) + col = split.column() + col.itemR(sss, "ior") + col.itemR(sss, "scale") col.itemR(sss, "color", text="") - col.itemL(text="Blend:") - col.itemR(sss, "color_factor", text="Color") - col.itemR(sss, "texture_factor", text="Texture") - col.itemL(text="Scattering Weight:") - col.itemR(sss, "front") - col.itemR(sss, "back") + col.itemR(sss, "radius", text="RGB Radius") col = split.column() sub = col.column(align=True) - sub.itemR(sss, "ior") - sub.itemR(sss, "scale") - col.itemR(sss, "radius", text="RGB Radius") - col.itemR(sss, "error_tolerance") + sub.itemL(text="Blend:") + sub.itemR(sss, "color_factor", text="Color") + sub.itemR(sss, "texture_factor", text="Texture") + sub.itemL(text="Scattering Weight:") + sub.itemR(sss, "front") + sub.itemR(sss, "back") + col.itemS() + col.itemR(sss, "error_tolerance", text="Error") class MATERIAL_PT_mirror(MaterialButtonsPanel): __label__ = "Mirror" @@ -402,20 +409,26 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel): col = split.column() col.itemR(raym, "reflect", text="Reflectivity") col.itemR(mat, "mirror_color", text="") - col.itemL(text="Fresnel:") - col.itemR(raym, "fresnel", text="Amount") + + + col = split.column() + col.itemR(raym, "fresnel") sub = col.column() sub.active = raym.fresnel > 0 sub.itemR(raym, "fresnel_factor", text="Blend") + + split = layout.split() + + col = split.column() col.itemS() + col.itemR(raym, "distance", text="Max Dist") + col.itemR(raym, "depth") col.itemS() sub = col.split(percentage=0.4) sub.itemL(text="Fade To:") sub.itemR(raym, "fade_to", text="") col = split.column() - col.itemR(raym, "depth") - col.itemR(raym, "distance", text="Max Dist") col.itemL(text="Gloss:") col.itemR(raym, "gloss", text="Amount") sub = col.column() @@ -453,25 +466,24 @@ class MATERIAL_PT_transp(MaterialButtonsPanel): split = layout.split() col = split.column() - col.itemL(text="Transparency:") row = col.row() row.itemR(mat, "alpha") - row.active = mat.transparency row = col.row() - row.itemR(mat, "specular_alpha", text="Specular") row.active = mat.transparency and (not mat.shadeless) + row.itemR(mat, "specular_alpha", text="Specular") + col = split.column() - col.active = mat.transparency and (not mat.shadeless) - col.itemL(text="Fresnel:") - col.itemR(rayt, "fresnel", text="Amount") + col.active = (not mat.shadeless) + col.itemR(rayt, "fresnel") sub = col.column() sub.active = rayt.fresnel > 0 sub.itemR(rayt, "fresnel_factor", text="Blend") if mat.transparency_method == 'RAYTRACE': + layout.itemS() split = layout.split() - split.active = mat.transparency and (not mat.shadeless) + split.active = mat.transparency col = split.column() col.itemR(rayt, "ior") @@ -522,23 +534,50 @@ class MATERIAL_PT_halo(MaterialButtonsPanel): sub.active = halo.ring sub.itemR(halo, "rings") sub.itemR(mat, "mirror_color", text="") + col.itemS() col.itemR(halo, "lines") sub = col.column() sub.active = halo.lines sub.itemR(halo, "line_number", text="Lines") sub.itemR(mat, "specular_color", text="") + col.itemS() col.itemR(halo, "star") sub = col.column() sub.active = halo.star sub.itemR(halo, "star_tips") - col.itemR(halo, "flare_mode") - sub = col.column() - sub.active = halo.flare_mode - sub.itemR(halo, "flare_size", text="Size") - sub.itemR(halo, "flare_subsize", text="Subsize") - sub.itemR(halo, "flare_boost", text="Boost") - sub.itemR(halo, "flare_seed", text="Seed") - sub.itemR(halo, "flares_sub", text="Sub") + +class MATERIAL_PT_flare(MaterialButtonsPanel): + __label__= "Flare" + COMPAT_ENGINES = set(['BLENDER_RENDER']) + + def poll(self, context): + mat = context.material + return mat and (mat.type == 'HALO') and (context.scene.render_data.engine in self.COMPAT_ENGINES) + + def draw_header(self, context): + layout = self.layout + + mat = context.material + halo = mat.halo + layout.itemR(halo, "flare_mode", text="") + + def draw(self, context): + layout = self.layout + + mat = context.material + halo = mat.halo + + layout.active = halo.flare_mode + + split = layout.split() + + col = split.column() + col.itemR(halo, "flare_size", text="Size") + col.itemR(halo, "flare_boost", text="Boost") + col.itemR(halo, "flare_seed", text="Seed") + col = split.column() + col.itemR(halo, "flares_sub", text="Subflares") + col.itemR(halo, "flare_subsize", text="Subsize") bpy.types.register(MATERIAL_PT_context_material) bpy.types.register(MATERIAL_PT_preview) @@ -549,6 +588,7 @@ bpy.types.register(MATERIAL_PT_transp) bpy.types.register(MATERIAL_PT_mirror) bpy.types.register(MATERIAL_PT_sss) bpy.types.register(MATERIAL_PT_halo) +bpy.types.register(MATERIAL_PT_flare) bpy.types.register(MATERIAL_PT_physics) bpy.types.register(MATERIAL_PT_strand) bpy.types.register(MATERIAL_PT_options) From b6548c21c209516f9ec60e3a403274f20566680d Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Fri, 21 Aug 2009 18:15:50 +0000 Subject: [PATCH 189/577] 2.5/Multires: * Fixed multires subdivision of a sculpted object. Accidentally broke this when I fixed removing a multires modifier. --- source/blender/blenkernel/BKE_multires.h | 3 ++- source/blender/blenkernel/intern/cdderivedmesh.c | 15 +++++++++------ source/blender/blenkernel/intern/modifier.c | 2 +- source/blender/blenkernel/intern/multires.c | 9 +++++---- source/blender/blenloader/intern/readfile.c | 2 +- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/source/blender/blenkernel/BKE_multires.h b/source/blender/blenkernel/BKE_multires.h index e7c7d92c955..a331479cad1 100644 --- a/source/blender/blenkernel/BKE_multires.h +++ b/source/blender/blenkernel/BKE_multires.h @@ -36,6 +36,7 @@ struct Object; typedef struct MultiresSubsurf { struct MultiresModifierData *mmd; struct Object *ob; + int local_mmd; } MultiresSubsurf; /* MultiresDM */ @@ -59,7 +60,7 @@ void multires_mark_as_modified(struct Object *ob); void multires_force_update(struct Object *ob); -struct DerivedMesh *multires_dm_create_from_derived(struct MultiresModifierData*, struct DerivedMesh*, +struct DerivedMesh *multires_dm_create_from_derived(struct MultiresModifierData*, int local_mmd, struct DerivedMesh*, struct Object *, int, int); struct MultiresModifierData *find_multires_modifier(struct Object *ob); diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index 4829be21ed8..b20da0962a7 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -1288,6 +1288,7 @@ typedef struct MultiresDM { CDDerivedMesh cddm; MultiresModifierData *mmd; + int local_mmd; int lvl, totlvl; float (*orco)[3]; @@ -1308,13 +1309,14 @@ static void MultiresDM_release(DerivedMesh *dm) MultiresDM *mrdm = (MultiresDM*)dm; int mvert_layer; - /* Check that mmd still exists */ - if(BLI_findindex(&mrdm->ob->modifiers, mrdm->mmd) < 0) - mrdm->mmd = NULL; - /* Before freeing, need to update the displacement map */ - if(dm->needsFree && mrdm->modified && mrdm->mmd) - mrdm->update(dm); + if(dm->needsFree && mrdm->modified) { + /* Check that mmd still exists */ + if(!mrdm->local_mmd && BLI_findindex(&mrdm->ob->modifiers, mrdm->mmd) < 0) + mrdm->mmd = NULL; + if(mrdm->mmd) + mrdm->update(dm); + } /* If the MVert data is being used as the sculpt undo store, don't free it */ mvert_layer = CustomData_get_layer_index(&dm->vertData, CD_MVERT); @@ -1353,6 +1355,7 @@ DerivedMesh *MultiresDM_new(MultiresSubsurf *ms, DerivedMesh *orig, int numVerts mrdm->mmd = ms->mmd; mrdm->ob = ms->ob; + mrdm->local_mmd = ms->local_mmd; if(dm) { MDisps *disps; diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 501638aba0d..6da2c94fab8 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -8121,7 +8121,7 @@ static DerivedMesh *multiresModifier_applyModifier(ModifierData *md, Object *ob, if(mmd->lvl == 1) return dm; - final = multires_dm_create_from_derived(mmd, dm, ob, useRenderParams, isFinalCalc); + final = multires_dm_create_from_derived(mmd, 0, dm, ob, useRenderParams, isFinalCalc); if(mmd->undo_signal && mmd->undo_verts && mmd->undo_verts_tot == final->getNumVerts(final)) { int i; MVert *dst = CDDM_get_verts(final); diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index 09a6c27a88c..0f3ab5be16e 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -223,7 +223,7 @@ static void multires_subdisp(DerivedMesh *orig, Object *ob, DerivedMesh *final, memset(&mmd_sub, 0, sizeof(MultiresModifierData)); mmd_sub.lvl = mmd_sub.totlvl = totlvl; - mrdm = multires_dm_create_from_derived(&mmd_sub, orig, ob, 0, 0); + mrdm = multires_dm_create_from_derived(&mmd_sub, 1, orig, ob, 0, 0); mvd = CDDM_get_verts(mrdm); /* Need to map from ccg to mrdm */ @@ -469,7 +469,7 @@ void multiresModifier_subdivide(MultiresModifierData *mmd, Object *ob, int dista orig = CDDM_from_mesh(me, NULL); memset(&mmd_sub, 0, sizeof(MultiresModifierData)); mmd_sub.lvl = mmd_sub.totlvl = mmd->lvl; - mrdm = multires_dm_create_from_derived(&mmd_sub, orig, ob, 0, 0); + mrdm = multires_dm_create_from_derived(&mmd_sub, 1, orig, ob, 0, 0); totsubvert = mrdm->getNumVerts(mrdm); totsubedge = mrdm->getNumEdges(mrdm); totsubface = mrdm->getNumFaces(mrdm); @@ -1192,7 +1192,7 @@ static void multiresModifier_update(DerivedMesh *dm) (includes older displacements but not new sculpts) */ mmd.totlvl = totlvl; mmd.lvl = lvl; - subco_dm = multires_dm_create_from_derived(&mmd, orig, ob, 0, 0); + subco_dm = multires_dm_create_from_derived(&mmd, 1, orig, ob, 0, 0); cur_lvl_orig_verts = CDDM_get_verts(subco_dm); /* Subtract the original vertex cos from the new vertex cos */ @@ -1229,7 +1229,7 @@ void multires_force_update(Object *ob) } } -struct DerivedMesh *multires_dm_create_from_derived(MultiresModifierData *mmd, DerivedMesh *dm, Object *ob, +struct DerivedMesh *multires_dm_create_from_derived(MultiresModifierData *mmd, int local_mmd, DerivedMesh *dm, Object *ob, int useRenderParams, int isFinalCalc) { SubsurfModifierData smd; @@ -1239,6 +1239,7 @@ struct DerivedMesh *multires_dm_create_from_derived(MultiresModifierData *mmd, D ms.mmd = mmd; ms.ob = ob; + ms.local_mmd = local_mmd; memset(&smd, 0, sizeof(SubsurfModifierData)); smd.levels = smd.renderLevels = mmd->lvl - 1; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 58b439e4cb4..72aba02f723 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9416,7 +9416,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) mmd->lvl = mmd->totlvl; orig = CDDM_from_mesh(me, NULL); - dm = multires_dm_create_from_derived(mmd, orig, ob, 0, 0); + dm = multires_dm_create_from_derived(mmd, 0, orig, ob, 0, 0); multires_load_old(dm, me->mr); From 647fd95c7fc25170ec2f1c75137f4e6f39c66651 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Fri, 21 Aug 2009 18:35:40 +0000 Subject: [PATCH 190/577] 2.5 Multires: * Fixed doing a simple subdivide, rather than Catmull-Clark. Note that the first subdivision will still appear to be CC rather than simple, this is a bug we just have to live with for now. --- source/blender/blenkernel/intern/multires.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index 0f3ab5be16e..9ba5769843f 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -469,6 +469,7 @@ void multiresModifier_subdivide(MultiresModifierData *mmd, Object *ob, int dista orig = CDDM_from_mesh(me, NULL); memset(&mmd_sub, 0, sizeof(MultiresModifierData)); mmd_sub.lvl = mmd_sub.totlvl = mmd->lvl; + mmd_sub.simple = simple; mrdm = multires_dm_create_from_derived(&mmd_sub, 1, orig, ob, 0, 0); totsubvert = mrdm->getNumVerts(mrdm); totsubedge = mrdm->getNumEdges(mrdm); From f248b25152db25c03c9e296ed965b6925924829a Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Fri, 21 Aug 2009 19:39:28 +0000 Subject: [PATCH 191/577] Audio file loading backend libsndfile! --- CMake/macros.cmake | 6 + CMakeLists.txt | 22 ++ intern/audaspace/CMakeLists.txt | 8 +- intern/audaspace/ffmpeg/AUD_FFMPEGFactory.cpp | 49 +--- intern/audaspace/ffmpeg/AUD_FFMPEGFactory.h | 9 +- intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp | 9 +- intern/audaspace/ffmpeg/AUD_FFMPEGReader.h | 10 +- intern/audaspace/intern/AUD_C-API.cpp | 14 +- intern/audaspace/intern/AUD_FileFactory.cpp | 95 +++++++ intern/audaspace/intern/AUD_FileFactory.h | 71 ++++++ .../audaspace/sndfile/AUD_SndFileFactory.cpp | 67 +++++ intern/audaspace/sndfile/AUD_SndFileFactory.h | 71 ++++++ .../audaspace/sndfile/AUD_SndFileReader.cpp | 233 ++++++++++++++++++ intern/audaspace/sndfile/AUD_SndFileReader.h | 131 ++++++++++ 14 files changed, 735 insertions(+), 60 deletions(-) create mode 100644 intern/audaspace/intern/AUD_FileFactory.cpp create mode 100644 intern/audaspace/intern/AUD_FileFactory.h create mode 100644 intern/audaspace/sndfile/AUD_SndFileFactory.cpp create mode 100644 intern/audaspace/sndfile/AUD_SndFileFactory.h create mode 100644 intern/audaspace/sndfile/AUD_SndFileReader.cpp create mode 100644 intern/audaspace/sndfile/AUD_SndFileReader.h diff --git a/CMake/macros.cmake b/CMake/macros.cmake index 9ba33dfb158..6a337505c00 100644 --- a/CMake/macros.cmake +++ b/CMake/macros.cmake @@ -70,6 +70,9 @@ MACRO(SETUP_LIBDIRS) IF(WITH_JACK) LINK_DIRECTORIES(${JACK_LIBPATH}) ENDIF(WITH_JACK) + IF(WITH_SNDFILE) + LINK_DIRECTORIES(${SNDFILE_LIBPATH}) + ENDIF(WITH_SNDFILE) IF(WITH_FFTW3) LINK_DIRECTORIES(${FFTW3_LIBPATH}) ENDIF(WITH_FFTW3) @@ -118,6 +121,9 @@ MACRO(SETUP_LIBLINKS IF(WITH_JACK) TARGET_LINK_LIBRARIES(${target} ${JACK_LIB}) ENDIF(WITH_JACK) + IF(WITH_SNDFILE) + TARGET_LINK_LIBRARIES(${target} ${SNDFILE_LIB}) + ENDIF(WITH_SNDFILE) IF(WITH_SDL) TARGET_LINK_LIBRARIES(${target} ${SDL_LIBRARY}) ENDIF(WITH_SDL) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9db25115099..749284def28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,7 @@ OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)" OPTION(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF) OPTION(WITH_FFTW3 "Enable FFTW3 support" OFF) OPTION(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" OFF) +OPTION(WITH_SNDFILE "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF) OPTION(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation" OFF) OPTION(WITH_INSTALL "Install accompanying scripts and language files needed to run blender" ON) @@ -109,6 +110,13 @@ IF(UNIX AND NOT APPLE) SET(JACK_LIBPATH ${JACK}/lib) ENDIF(WITH_JACK) + IF(WITH_SNDFILE) + SET(SNDFILE /usr) + SET(SNDFILE_INC ${SNDFILE}/include) + SET(SNDFILE_LIB sndfile) + SET(SNDFILE_LIBPATH ${SNDFILE}/lib) + ENDIF(WITH_SNDFILE) + FIND_LIBRARY(INTL_LIBRARY NAMES intl PATHS @@ -247,6 +255,13 @@ IF(WIN32) SET(JACK_LIBPATH ${JACK}/lib) ENDIF(WITH_JACK) + IF(WITH_SNDFILE) + SET(SNDFILE ${LIBDIR}/sndfile) + SET(SNDFILE_INC ${SNDFILE}/include) + SET(SNDFILE_LIB sndfile) + SET(SNDFILE_LIBPATH ${SNDFILE}/lib) + ENDIF(WITH_SNDFILE) + IF(CMAKE_CL_64) SET(PNG_LIBRARIES libpng) ELSE(CMAKE_CL_64) @@ -392,6 +407,13 @@ IF(APPLE) SET(JACK_LIBPATH ${JACK}/lib) ENDIF(WITH_JACK) + IF(WITH_SNDFILE) + SET(SNDFILE /usr) + SET(SNDFILE_INC ${SNDFILE}/include) + SET(SNDFILE_LIB sndfile) + SET(SNDFILE_LIBPATH ${SNDFILE}/lib) + ENDIF(WITH_SNDFILE) + SET(PYTHON_VERSION 3.1) IF(PYTHON_VERSION MATCHES 3.1) diff --git a/intern/audaspace/CMakeLists.txt b/intern/audaspace/CMakeLists.txt index 940a4b2bedc..1b48de3190b 100644 --- a/intern/audaspace/CMakeLists.txt +++ b/intern/audaspace/CMakeLists.txt @@ -53,6 +53,12 @@ IF(WITH_JACK) ADD_DEFINITIONS(-DWITH_JACK) ENDIF(WITH_JACK) -SET(SRC ${SRC} ${FFMPEGSRC} ${SDLSRC} ${OPENALSRC} ${JACKSRC}) +IF(WITH_SNDFILE) + SET(INC ${INC} sndfile ${SNDFILE_INC}) + FILE(GLOB SNDFILESRC sndfile/*.cpp) + ADD_DEFINITIONS(-DWITH_SNDFILE) +ENDIF(WITH_SNDFILE) + +SET(SRC ${SRC} ${FFMPEGSRC} ${SNDFILESRC} ${SDLSRC} ${OPENALSRC} ${JACKSRC}) BLENDERLIB(bf_audaspace "${SRC}" "${INC}") diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.cpp b/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.cpp index 5f9006b0ec0..f67c819ff10 100644 --- a/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.cpp +++ b/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.cpp @@ -25,31 +25,24 @@ #include "AUD_FFMPEGFactory.h" #include "AUD_FFMPEGReader.h" -#include "AUD_Space.h" - -extern "C" { -#include -} +#include "AUD_Buffer.h" AUD_FFMPEGFactory::AUD_FFMPEGFactory(const char* filename) { - if(filename != 0) + if(filename != NULL) { m_filename = new char[strlen(filename)+1]; AUD_NEW("string") strcpy(m_filename, filename); } else - m_filename = 0; - m_buffer = 0; - m_size = 0; + m_filename = NULL; } AUD_FFMPEGFactory::AUD_FFMPEGFactory(unsigned char* buffer, int size) { - m_filename = 0; - m_buffer = (unsigned char*)av_malloc(size); AUD_NEW("buffer") - m_size = size; - memcpy(m_buffer, buffer, size); + m_filename = NULL; + m_buffer = AUD_Reference(new AUD_Buffer(size)); + memcpy(m_buffer.get()->getBuffer(), buffer, size); } AUD_FFMPEGFactory::~AUD_FFMPEGFactory() @@ -58,31 +51,15 @@ AUD_FFMPEGFactory::~AUD_FFMPEGFactory() { delete[] m_filename; AUD_DELETE("string") } - if(m_buffer) - { - av_free(m_buffer); AUD_DELETE("buffer") - } } AUD_IReader* AUD_FFMPEGFactory::createReader() { - try - { - AUD_IReader* reader; - if(m_filename) - reader = new AUD_FFMPEGReader(m_filename); - else - reader = new AUD_FFMPEGReader(m_buffer, m_size); - AUD_NEW("reader") - return reader; - } - catch(AUD_Exception e) - { - // return 0 if ffmpeg cannot read the file - if(e.error == AUD_ERROR_FFMPEG) - return 0; - // but throw an exception if the file doesn't exist - else - throw; - } + AUD_IReader* reader; + if(m_filename) + reader = new AUD_FFMPEGReader(m_filename); + else + reader = new AUD_FFMPEGReader(m_buffer); + AUD_NEW("reader") + return reader; } diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.h b/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.h index 0a9fcc22c8b..22560303a73 100644 --- a/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.h +++ b/intern/audaspace/ffmpeg/AUD_FFMPEGFactory.h @@ -27,6 +27,8 @@ #define AUD_FFMPEGFACTORY #include "AUD_IFactory.h" +#include "AUD_Reference.h" +class AUD_Buffer; /** * This factory reads a sound file via ffmpeg. @@ -44,12 +46,7 @@ private: /** * The buffer to read from. */ - unsigned char* m_buffer; - - /** - * The size of the buffer. - */ - int m_size; + AUD_Reference m_buffer; public: /** diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp index b79375c2dc5..de0e47300f8 100644 --- a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp +++ b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp @@ -158,21 +158,22 @@ AUD_FFMPEGReader::AUD_FFMPEGReader(const char* filename) AUD_NEW("buffer") } -AUD_FFMPEGReader::AUD_FFMPEGReader(unsigned char* buffer, int size) +AUD_FFMPEGReader::AUD_FFMPEGReader(AUD_Reference buffer) { m_position = 0; m_pkgbuf_left = 0; m_byteiocontext = (ByteIOContext*)av_mallocz(sizeof(ByteIOContext)); AUD_NEW("byteiocontext") + m_membuffer = buffer; - if(init_put_byte(m_byteiocontext, buffer, size, 0, + if(init_put_byte(m_byteiocontext, buffer.get()->getBuffer(), buffer.get()->getSize(), 0, NULL, NULL, NULL, NULL) != 0) AUD_THROW(AUD_ERROR_FILE); AVProbeData probe_data; probe_data.filename = ""; - probe_data.buf = buffer; - probe_data.buf_size = size; + probe_data.buf = buffer.get()->getBuffer(); + probe_data.buf_size = buffer.get()->getSize(); AVInputFormat* fmt = av_probe_input_format(&probe_data, 1); // open stream diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.h b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.h index 645f5f356f0..6e303934f36 100644 --- a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.h +++ b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.h @@ -27,7 +27,9 @@ #define AUD_FFMPEGREADER #include "AUD_IReader.h" +#include "AUD_Reference.h" class AUD_Buffer; + struct AVCodecContext; extern "C" { #include @@ -89,6 +91,11 @@ private: */ int m_stream; + /** + * The memory file to read from, only saved to keep the buffer alive. + */ + AUD_Reference m_membuffer; + /** * Decodes a packet into the given buffer. * \param packet The AVPacket to decode. @@ -109,11 +116,10 @@ public: /** * Creates a new reader. * \param buffer The buffer to read from. - * \param size The size of the buffer. * \exception AUD_Exception Thrown if the buffer specified cannot be read * with ffmpeg. */ - AUD_FFMPEGReader(unsigned char* buffer, int size); + AUD_FFMPEGReader(AUD_Reference buffer); /** * Destroys the reader and closes the file. diff --git a/intern/audaspace/intern/AUD_C-API.cpp b/intern/audaspace/intern/AUD_C-API.cpp index d2c8e94c949..9481e2139e8 100644 --- a/intern/audaspace/intern/AUD_C-API.cpp +++ b/intern/audaspace/intern/AUD_C-API.cpp @@ -25,6 +25,7 @@ #include "AUD_NULLDevice.h" #include "AUD_I3DDevice.h" +#include "AUD_FileFactory.h" #include "AUD_StreamBufferFactory.h" #include "AUD_DelayFactory.h" #include "AUD_LimiterFactory.h" @@ -48,7 +49,6 @@ #endif #ifdef WITH_FFMPEG -#include "AUD_FFMPEGFactory.h" extern "C" { #include } @@ -187,21 +187,13 @@ AUD_SoundInfo AUD_getInfo(AUD_Sound* sound) AUD_Sound* AUD_load(const char* filename) { assert(filename); -#ifdef WITH_FFMPEG - return new AUD_FFMPEGFactory(filename); -#else - return NULL; -#endif + return new AUD_FileFactory(filename); } AUD_Sound* AUD_loadBuffer(unsigned char* buffer, int size) { assert(buffer); -#ifdef WITH_FFMPEG - return new AUD_FFMPEGFactory(buffer, size); -#else - return NULL; -#endif + return new AUD_FileFactory(buffer, size); } AUD_Sound* AUD_bufferSound(AUD_Sound* sound) diff --git a/intern/audaspace/intern/AUD_FileFactory.cpp b/intern/audaspace/intern/AUD_FileFactory.cpp new file mode 100644 index 00000000000..a1f81f49061 --- /dev/null +++ b/intern/audaspace/intern/AUD_FileFactory.cpp @@ -0,0 +1,95 @@ +/* + * $Id: AUD_FFMPEGFactory.cpp 22328 2009-08-09 23:23:19Z gsrb3d $ + * + * ***** BEGIN LGPL LICENSE BLOCK ***** + * + * Copyright 2009 Jörg Hermann Müller + * + * This file is part of AudaSpace. + * + * AudaSpace is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AudaSpace 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with AudaSpace. If not, see . + * + * ***** END LGPL LICENSE BLOCK ***** + */ + +#include "AUD_FileFactory.h" +#include "AUD_Buffer.h" + +#include + +#ifdef WITH_FFMPEG +#include "AUD_FFMPEGReader.h" +#endif +#ifdef WITH_SNDFILE +#include "AUD_SndFileReader.h" +#endif + +AUD_FileFactory::AUD_FileFactory(const char* filename) +{ + if(filename != NULL) + { + m_filename = new char[strlen(filename)+1]; AUD_NEW("string") + strcpy(m_filename, filename); + } + else + m_filename = NULL; +} + +AUD_FileFactory::AUD_FileFactory(unsigned char* buffer, int size) +{ + m_filename = NULL; + m_buffer = AUD_Reference(new AUD_Buffer(size)); + memcpy(m_buffer.get()->getBuffer(), buffer, size); +} + +AUD_FileFactory::~AUD_FileFactory() +{ + if(m_filename) + { + delete[] m_filename; AUD_DELETE("string") + } +} + +AUD_IReader* AUD_FileFactory::createReader() +{ + AUD_IReader* reader = 0; + +#ifdef WITH_SNDFILE + try + { + if(m_filename) + reader = new AUD_SndFileReader(m_filename); + else + reader = new AUD_SndFileReader(m_buffer); + AUD_NEW("reader") + return reader; + } + catch(AUD_Exception e) {} +#endif + +#ifdef WITH_FFMPEG + try + { + if(m_filename) + reader = new AUD_FFMPEGReader(m_filename); + else + reader = new AUD_FFMPEGReader(m_buffer); + AUD_NEW("reader") + return reader; + } + catch(AUD_Exception e) {} +#endif + + return reader; +} diff --git a/intern/audaspace/intern/AUD_FileFactory.h b/intern/audaspace/intern/AUD_FileFactory.h new file mode 100644 index 00000000000..8badb4429df --- /dev/null +++ b/intern/audaspace/intern/AUD_FileFactory.h @@ -0,0 +1,71 @@ +/* + * $Id: AUD_FFMPEGFactory.h 22328 2009-08-09 23:23:19Z gsrb3d $ + * + * ***** BEGIN LGPL LICENSE BLOCK ***** + * + * Copyright 2009 Jörg Hermann Müller + * + * This file is part of AudaSpace. + * + * AudaSpace is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AudaSpace 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with AudaSpace. If not, see . + * + * ***** END LGPL LICENSE BLOCK ***** + */ + +#ifndef AUD_FILEFACTORY +#define AUD_FILEFACTORY + +#include "AUD_IFactory.h" +#include "AUD_Reference.h" +class AUD_Buffer; + +/** + * This factory tries to read a sound file via all available file readers. + */ +class AUD_FileFactory : public AUD_IFactory +{ +private: + /** + * The filename of the sound source file. + */ + char* m_filename; + + /** + * The buffer to read from. + */ + AUD_Reference m_buffer; + +public: + /** + * Creates a new factory. + * \param filename The sound file path. + */ + AUD_FileFactory(const char* filename); + + /** + * Creates a new factory. + * \param buffer The buffer to read from. + * \param size The size of the buffer. + */ + AUD_FileFactory(unsigned char* buffer, int size); + + /** + * Destroys the factory. + */ + ~AUD_FileFactory(); + + virtual AUD_IReader* createReader(); +}; + +#endif //AUD_FILEFACTORY diff --git a/intern/audaspace/sndfile/AUD_SndFileFactory.cpp b/intern/audaspace/sndfile/AUD_SndFileFactory.cpp new file mode 100644 index 00000000000..d3c5ea8a273 --- /dev/null +++ b/intern/audaspace/sndfile/AUD_SndFileFactory.cpp @@ -0,0 +1,67 @@ +/* + * $Id: AUD_FFMPEGFactory.cpp 22328 2009-08-09 23:23:19Z gsrb3d $ + * + * ***** BEGIN LGPL LICENSE BLOCK ***** + * + * Copyright 2009 Jörg Hermann Müller + * + * This file is part of AudaSpace. + * + * AudaSpace is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AudaSpace 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with AudaSpace. If not, see . + * + * ***** END LGPL LICENSE BLOCK ***** + */ + +#include "AUD_SndFileFactory.h" +#include "AUD_SndFileReader.h" +#include "AUD_Buffer.h" + +#include + +AUD_SndFileFactory::AUD_SndFileFactory(const char* filename) +{ + if(filename != NULL) + { + m_filename = new char[strlen(filename)+1]; AUD_NEW("string") + strcpy(m_filename, filename); + } + else + m_filename = NULL; +} + +AUD_SndFileFactory::AUD_SndFileFactory(unsigned char* buffer, int size) +{ + m_filename = NULL; + m_buffer = AUD_Reference(new AUD_Buffer(size)); + memcpy(m_buffer.get()->getBuffer(), buffer, size); +} + +AUD_SndFileFactory::~AUD_SndFileFactory() +{ + if(m_filename) + { + delete[] m_filename; AUD_DELETE("string") + } +} + +AUD_IReader* AUD_SndFileFactory::createReader() +{ + AUD_IReader* reader; + if(m_filename) + reader = new AUD_SndFileReader(m_filename); + else + reader = new AUD_SndFileReader(m_buffer); + AUD_NEW("reader") + return reader; +} diff --git a/intern/audaspace/sndfile/AUD_SndFileFactory.h b/intern/audaspace/sndfile/AUD_SndFileFactory.h new file mode 100644 index 00000000000..6e265a63abe --- /dev/null +++ b/intern/audaspace/sndfile/AUD_SndFileFactory.h @@ -0,0 +1,71 @@ +/* + * $Id: AUD_FFMPEGFactory.h 22328 2009-08-09 23:23:19Z gsrb3d $ + * + * ***** BEGIN LGPL LICENSE BLOCK ***** + * + * Copyright 2009 Jörg Hermann Müller + * + * This file is part of AudaSpace. + * + * AudaSpace is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AudaSpace 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with AudaSpace. If not, see . + * + * ***** END LGPL LICENSE BLOCK ***** + */ + +#ifndef AUD_SNDFILEFACTORY +#define AUD_SNDFILEFACTORY + +#include "AUD_IFactory.h" +#include "AUD_Reference.h" +class AUD_Buffer; + +/** + * This factory reads a sound file via libsndfile. + */ +class AUD_SndFileFactory : public AUD_IFactory +{ +private: + /** + * The filename of the sound source file. + */ + char* m_filename; + + /** + * The buffer to read from. + */ + AUD_Reference m_buffer; + +public: + /** + * Creates a new factory. + * \param filename The sound file path. + */ + AUD_SndFileFactory(const char* filename); + + /** + * Creates a new factory. + * \param buffer The buffer to read from. + * \param size The size of the buffer. + */ + AUD_SndFileFactory(unsigned char* buffer, int size); + + /** + * Destroys the factory. + */ + ~AUD_SndFileFactory(); + + virtual AUD_IReader* createReader(); +}; + +#endif //AUD_SNDFILEFACTORY diff --git a/intern/audaspace/sndfile/AUD_SndFileReader.cpp b/intern/audaspace/sndfile/AUD_SndFileReader.cpp new file mode 100644 index 00000000000..8daef573d37 --- /dev/null +++ b/intern/audaspace/sndfile/AUD_SndFileReader.cpp @@ -0,0 +1,233 @@ +/* + * $Id: AUD_FFMPEGReader.cpp 22328 2009-08-09 23:23:19Z gsrb3d $ + * + * ***** BEGIN LGPL LICENSE BLOCK ***** + * + * Copyright 2009 Jörg Hermann Müller + * + * This file is part of AudaSpace. + * + * AudaSpace is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AudaSpace 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with AudaSpace. If not, see . + * + * ***** END LGPL LICENSE BLOCK ***** + */ + +#include "AUD_SndFileReader.h" +#include "AUD_Buffer.h" + +#include + +// This function transforms a SampleFormat to our own sample format +static inline AUD_SampleFormat SNDFILE_TO_AUD(int fmt) +{ + switch(fmt & SF_FORMAT_SUBMASK) + { + // only read s16, s32 and double as they are + case SF_FORMAT_PCM_16: + return AUD_FORMAT_S16; + case SF_FORMAT_PCM_32: + return AUD_FORMAT_S32; + case SF_FORMAT_DOUBLE: + return AUD_FORMAT_FLOAT64; + // read all other formats as floats + default: + return AUD_FORMAT_FLOAT32; + } +} + +sf_count_t AUD_SndFileReader::vio_get_filelen(void *user_data) +{ + AUD_SndFileReader* reader = (AUD_SndFileReader*)user_data; + return reader->m_membuffer.get()->getSize(); +} + +sf_count_t AUD_SndFileReader::vio_seek(sf_count_t offset, int whence, void *user_data) +{ + AUD_SndFileReader* reader = (AUD_SndFileReader*)user_data; + + switch(whence) + { + case SEEK_SET: + reader->m_memoffset = offset; + break; + case SEEK_CUR: + reader->m_memoffset = reader->m_memoffset + offset; + break; + case SEEK_END: + reader->m_memoffset = reader->m_membuffer.get()->getSize() + offset; + break; + } + + return reader->m_memoffset; +} + +sf_count_t AUD_SndFileReader::vio_read(void *ptr, sf_count_t count, void *user_data) +{ + AUD_SndFileReader* reader = (AUD_SndFileReader*)user_data; + + if(reader->m_memoffset + count > reader->m_membuffer.get()->getSize()) + count = reader->m_membuffer.get()->getSize() - reader->m_memoffset; + + memcpy(ptr, reader->m_membuffer.get()->getBuffer() + reader->m_memoffset, count); + reader->m_memoffset += count; + + return count; +} + +sf_count_t AUD_SndFileReader::vio_tell(void *user_data) +{ + AUD_SndFileReader* reader = (AUD_SndFileReader*)user_data; + + return reader->m_memoffset; +} + +AUD_SndFileReader::AUD_SndFileReader(const char* filename) +{ + SF_INFO sfinfo; + + sfinfo.format = 0; + m_sndfile = sf_open(filename, SFM_READ, &sfinfo); + + if(!m_sndfile) + AUD_THROW(AUD_ERROR_FILE); + + m_specs.channels = (AUD_Channels) sfinfo.channels; + m_specs.format = SNDFILE_TO_AUD(sfinfo.format); + m_specs.rate = (AUD_SampleRate) sfinfo.samplerate; + m_length = sfinfo.frames; + m_seekable = sfinfo.seekable; + m_position = 0; + + switch(m_specs.format) + { + case AUD_FORMAT_S16: + m_read = (sf_read_f) sf_readf_short; + break; + case AUD_FORMAT_S32: + m_read = (sf_read_f) sf_readf_int; + break; + case AUD_FORMAT_FLOAT64: + m_read = (sf_read_f) sf_readf_double; + break; + default: + m_read = (sf_read_f) sf_readf_float; + } + + m_buffer = new AUD_Buffer(); AUD_NEW("buffer") +} + +AUD_SndFileReader::AUD_SndFileReader(AUD_Reference buffer) +{ + m_membuffer = buffer; + m_memoffset = 0; + + m_vio.get_filelen = vio_get_filelen; + m_vio.read = vio_read; + m_vio.seek = vio_seek; + m_vio.tell = vio_tell; + m_vio.write = NULL; + + SF_INFO sfinfo; + + sfinfo.format = 0; + m_sndfile = sf_open_virtual(&m_vio, SFM_READ, &sfinfo, this); + + if(!m_sndfile) + AUD_THROW(AUD_ERROR_FILE); + + m_specs.channels = (AUD_Channels) sfinfo.channels; + m_specs.format = SNDFILE_TO_AUD(sfinfo.format); + m_specs.rate = (AUD_SampleRate) sfinfo.samplerate; + m_length = sfinfo.frames; + m_seekable = sfinfo.seekable; + m_position = 0; + + switch(m_specs.format) + { + case AUD_FORMAT_S16: + m_read = (sf_read_f) sf_readf_short; + break; + case AUD_FORMAT_S32: + m_read = (sf_read_f) sf_readf_int; + break; + case AUD_FORMAT_FLOAT64: + m_read = (sf_read_f) sf_readf_double; + break; + default: + m_read = (sf_read_f) sf_readf_float; + } + + m_buffer = new AUD_Buffer(); AUD_NEW("buffer") +} + +AUD_SndFileReader::~AUD_SndFileReader() +{ + sf_close(m_sndfile); + + delete m_buffer; AUD_DELETE("buffer") +} + +bool AUD_SndFileReader::isSeekable() +{ + return m_seekable; +} + +void AUD_SndFileReader::seek(int position) +{ + if(m_seekable) + { + position = sf_seek(m_sndfile, position, SEEK_SET); + m_position = position; + } +} + +int AUD_SndFileReader::getLength() +{ + return m_length; +} + +int AUD_SndFileReader::getPosition() +{ + return m_position; +} + +AUD_Specs AUD_SndFileReader::getSpecs() +{ + return m_specs; +} + +AUD_ReaderType AUD_SndFileReader::getType() +{ + return AUD_TYPE_STREAM; +} + +bool AUD_SndFileReader::notify(AUD_Message &message) +{ + return false; +} + +void AUD_SndFileReader::read(int & length, sample_t* & buffer) +{ + int sample_size = AUD_SAMPLE_SIZE(m_specs); + + // resize output buffer if necessary + if(m_buffer->getSize() < length*sample_size) + m_buffer->resize(length*sample_size); + + buffer = m_buffer->getBuffer(); + + length = m_read(m_sndfile, buffer, length); + + m_position += length; +} diff --git a/intern/audaspace/sndfile/AUD_SndFileReader.h b/intern/audaspace/sndfile/AUD_SndFileReader.h new file mode 100644 index 00000000000..f55c36b47e8 --- /dev/null +++ b/intern/audaspace/sndfile/AUD_SndFileReader.h @@ -0,0 +1,131 @@ +/* + * $Id: AUD_FFMPEGReader.h 22328 2009-08-09 23:23:19Z gsrb3d $ + * + * ***** BEGIN LGPL LICENSE BLOCK ***** + * + * Copyright 2009 Jörg Hermann Müller + * + * This file is part of AudaSpace. + * + * AudaSpace is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * AudaSpace 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with AudaSpace. If not, see . + * + * ***** END LGPL LICENSE BLOCK ***** + */ + +#ifndef AUD_SNDFILEREADER +#define AUD_SNDFILEREADER + +#include "AUD_IReader.h" +#include "AUD_Reference.h" +class AUD_Buffer; + +#include + +typedef sf_count_t (*sf_read_f)(SNDFILE *sndfile, void *ptr, sf_count_t frames); + +/** + * This class reads a sound file via libsndfile. + */ +class AUD_SndFileReader : public AUD_IReader +{ +private: + /** + * The current position in samples. + */ + int m_position; + + /** + * The sample count in the file. + */ + int m_length; + + /** + * Whether the file is seekable. + */ + bool m_seekable; + + /** + * The specification of the audio data. + */ + AUD_Specs m_specs; + + /** + * The playback buffer. + */ + AUD_Buffer* m_buffer; + + /** + * The sndfile. + */ + SNDFILE* m_sndfile; + + /** + * The reading function. + */ + sf_read_f m_read; + + /** + * The virtual IO structure for memory file reading. + */ + SF_VIRTUAL_IO m_vio; + + /** + * The pointer to the memory file. + */ + AUD_Reference m_membuffer; + + /** + * The current reading pointer of the memory file. + */ + int m_memoffset; + + // Functions for libsndfile virtual IO functionality + static sf_count_t vio_get_filelen(void *user_data); + static sf_count_t vio_seek(sf_count_t offset, int whence, void *user_data); + static sf_count_t vio_read(void *ptr, sf_count_t count, void *user_data); + static sf_count_t vio_tell(void *user_data); + +public: + /** + * Creates a new reader. + * \param filename The path to the file to be read. + * \exception AUD_Exception Thrown if the file specified does not exist or + * cannot be read with libsndfile. + */ + AUD_SndFileReader(const char* filename); + + /** + * Creates a new reader. + * \param buffer The buffer to read from. + * \exception AUD_Exception Thrown if the buffer specified cannot be read + * with libsndfile. + */ + AUD_SndFileReader(AUD_Reference buffer); + + /** + * Destroys the reader and closes the file. + */ + virtual ~AUD_SndFileReader(); + + virtual bool isSeekable(); + virtual void seek(int position); + virtual int getLength(); + virtual int getPosition(); + virtual AUD_Specs getSpecs(); + virtual AUD_ReaderType getType(); + virtual bool notify(AUD_Message &message); + virtual void read(int & length, sample_t* & buffer); +}; + +#endif //AUD_SNDFILEREADER From d82935a327203e41da7913b75ab9981d61cdc927 Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Fri, 21 Aug 2009 22:06:19 +0000 Subject: [PATCH 192/577] SVN maintenance. --- intern/audaspace/intern/AUD_FileFactory.cpp | 2 +- intern/audaspace/intern/AUD_FileFactory.h | 2 +- intern/audaspace/sndfile/AUD_SndFileFactory.cpp | 2 +- intern/audaspace/sndfile/AUD_SndFileFactory.h | 2 +- intern/audaspace/sndfile/AUD_SndFileReader.cpp | 2 +- intern/audaspace/sndfile/AUD_SndFileReader.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/intern/audaspace/intern/AUD_FileFactory.cpp b/intern/audaspace/intern/AUD_FileFactory.cpp index a1f81f49061..b63390803b1 100644 --- a/intern/audaspace/intern/AUD_FileFactory.cpp +++ b/intern/audaspace/intern/AUD_FileFactory.cpp @@ -1,5 +1,5 @@ /* - * $Id: AUD_FFMPEGFactory.cpp 22328 2009-08-09 23:23:19Z gsrb3d $ + * $Id$ * * ***** BEGIN LGPL LICENSE BLOCK ***** * diff --git a/intern/audaspace/intern/AUD_FileFactory.h b/intern/audaspace/intern/AUD_FileFactory.h index 8badb4429df..6ab8f280534 100644 --- a/intern/audaspace/intern/AUD_FileFactory.h +++ b/intern/audaspace/intern/AUD_FileFactory.h @@ -1,5 +1,5 @@ /* - * $Id: AUD_FFMPEGFactory.h 22328 2009-08-09 23:23:19Z gsrb3d $ + * $Id$ * * ***** BEGIN LGPL LICENSE BLOCK ***** * diff --git a/intern/audaspace/sndfile/AUD_SndFileFactory.cpp b/intern/audaspace/sndfile/AUD_SndFileFactory.cpp index d3c5ea8a273..bac6dc321f4 100644 --- a/intern/audaspace/sndfile/AUD_SndFileFactory.cpp +++ b/intern/audaspace/sndfile/AUD_SndFileFactory.cpp @@ -1,5 +1,5 @@ /* - * $Id: AUD_FFMPEGFactory.cpp 22328 2009-08-09 23:23:19Z gsrb3d $ + * $Id$ * * ***** BEGIN LGPL LICENSE BLOCK ***** * diff --git a/intern/audaspace/sndfile/AUD_SndFileFactory.h b/intern/audaspace/sndfile/AUD_SndFileFactory.h index 6e265a63abe..98187ff1590 100644 --- a/intern/audaspace/sndfile/AUD_SndFileFactory.h +++ b/intern/audaspace/sndfile/AUD_SndFileFactory.h @@ -1,5 +1,5 @@ /* - * $Id: AUD_FFMPEGFactory.h 22328 2009-08-09 23:23:19Z gsrb3d $ + * $Id$ * * ***** BEGIN LGPL LICENSE BLOCK ***** * diff --git a/intern/audaspace/sndfile/AUD_SndFileReader.cpp b/intern/audaspace/sndfile/AUD_SndFileReader.cpp index 8daef573d37..485818552bb 100644 --- a/intern/audaspace/sndfile/AUD_SndFileReader.cpp +++ b/intern/audaspace/sndfile/AUD_SndFileReader.cpp @@ -1,5 +1,5 @@ /* - * $Id: AUD_FFMPEGReader.cpp 22328 2009-08-09 23:23:19Z gsrb3d $ + * $Id$ * * ***** BEGIN LGPL LICENSE BLOCK ***** * diff --git a/intern/audaspace/sndfile/AUD_SndFileReader.h b/intern/audaspace/sndfile/AUD_SndFileReader.h index f55c36b47e8..da890ef53ca 100644 --- a/intern/audaspace/sndfile/AUD_SndFileReader.h +++ b/intern/audaspace/sndfile/AUD_SndFileReader.h @@ -1,5 +1,5 @@ /* - * $Id: AUD_FFMPEGReader.h 22328 2009-08-09 23:23:19Z gsrb3d $ + * $Id$ * * ***** BEGIN LGPL LICENSE BLOCK ***** * From 9202aaa2dc4b4bf70621c06bc82a5d836a4afc14 Mon Sep 17 00:00:00 2001 From: Diego Borghetti Date: Fri, 21 Aug 2009 22:56:26 +0000 Subject: [PATCH 193/577] Update Makefiles for audaspace. This add support for: sdl, ffmpeg, openal, jack and sndfile. We have new options: WITH_OPENAL, default false WITH_JACK, default false WITH_SNDFILE, default false and with this: NAN_OPENAL, default /usr NAN_JACK, default /usr NAN_JACKCFLAGS, default -I$(NAN_JACK)/include/jack NAN_JACKLIBS, default $(NAN_JACK)/lib/libjack.a NAN_SNDFILE, default /usr NAN_SNDFILECFLAGS, default -I$(NAN_SNDFILE)/include NAN_SNDFILELIBS, default $(NAN_SNDFILE)/lib/libsndfile. Also add two new option on source/Makefile for jack and sndfile libs, but only for linux, so let me know for other OS. --- intern/audaspace/Makefile | 50 +++++++++++++++++++++++++++++-- intern/audaspace/OpenAL/Makefile | 39 ++++++++++++++++++++++++ intern/audaspace/SDL/Makefile | 2 +- intern/audaspace/ffmpeg/Makefile | 2 +- intern/audaspace/intern/Makefile | 25 ++++++++++++++++ intern/audaspace/jack/Makefile | 4 +++ intern/audaspace/sndfile/Makefile | 40 +++++++++++++++++++++++++ source/Makefile | 36 ++++++++++++++++++---- source/nan_definitions.mk | 22 ++++++++++++-- 9 files changed, 207 insertions(+), 13 deletions(-) create mode 100644 intern/audaspace/OpenAL/Makefile create mode 100644 intern/audaspace/sndfile/Makefile diff --git a/intern/audaspace/Makefile b/intern/audaspace/Makefile index 2d66dcf67fa..474f53f0e0f 100644 --- a/intern/audaspace/Makefile +++ b/intern/audaspace/Makefile @@ -44,19 +44,63 @@ ifeq ($(WITH_FFMPEG),true) DIRS += ffmpeg endif +ifeq ($(WITH_OPENAL),true) + DIRS += OpenAL +endif + +ifeq ($(WITH_JACK),true) + DIRS += jack +endif + +ifeq ($(WITH_SNDFILE),true) + DIRS += sndfile +endif + include nan_subdirs.mk install: $(ALL_OR_DEBUG) @[ -d $(NAN_AUDASPACE) ] || mkdir $(NAN_AUDASPACE) @[ -d $(NAN_AUDASPACE)/include ] || mkdir $(NAN_AUDASPACE)/include @[ -d $(NAN_AUDASPACE)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_AUDASPACE)/lib/$(DEBUG_DIR) - @../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libaudaspace.a $(DIR)/$(DEBUG_DIR)libaud_fx.a $(DIR)/$(DEBUG_DIR)libaud_src.a $(NAN_AUDASPACE)/lib/$(DEBUG_DIR) + @../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libaudaspace.a $(DIR)/$(DEBUG_DIR)libaud_sdl.a $(DIR)/$(DEBUG_DIR)libaud_fx.a $(DIR)/$(DEBUG_DIR)libaud_src.a $(NAN_AUDASPACE)/lib/$(DEBUG_DIR) + +ifeq ($(WITH_FFMPEG),true) + @../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libaud_ffmpeg.a $(NAN_AUDASPACE)/lib/$(DEBUG_DIR) +endif + +ifeq ($(WITH_OPENAL),true) + @../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libaud_openal.a $(NAN_AUDASPACE)/lib/$(DEBUG_DIR) +endif + +ifeq ($(WITH_JACK),true) + @../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libaud_jack.a $(NAN_AUDASPACE)/lib/$(DEBUG_DIR) +endif + +ifeq ($(WITH_SNDFILE),true) + @../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libaud_sndfile.a $(NAN_AUDASPACE)/lib/$(DEBUG_DIR) +endif ifeq ($(OS),darwin) ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaudaspace.a ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_src.a ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_fx.a + ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_sdl.a + +ifeq ($(WITH_FFMPEG),true) + ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_ffmpeg.a +endif + +ifeq ($(WITH_OPENAL),true) + ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_openal.a +endif + +ifeq ($(WITH_JACK),true) + ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_jack.a +endif + +ifeq ($(WITH_SNDFILE),true) + ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_sndfile.a +endif + endif @../tools/cpifdiff.sh intern/*.h $(NAN_AUDASPACE)/include/ - - diff --git a/intern/audaspace/OpenAL/Makefile b/intern/audaspace/OpenAL/Makefile new file mode 100644 index 00000000000..4cf9f66b06c --- /dev/null +++ b/intern/audaspace/OpenAL/Makefile @@ -0,0 +1,39 @@ +# +# $Id$ +# +# ***** 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 = aud_openal +DIR = $(OCGDIR)/intern/audaspace + +include nan_compile.mk + +CCFLAGS += $(LEVEL_1_CPP_WARNINGS) + +CPPFLAGS += -I../intern +CPPFLAGS += -I. diff --git a/intern/audaspace/SDL/Makefile b/intern/audaspace/SDL/Makefile index e36b2de41fe..02a4068f3dc 100644 --- a/intern/audaspace/SDL/Makefile +++ b/intern/audaspace/SDL/Makefile @@ -29,7 +29,7 @@ # LIBNAME = aud_sdl -DIR = $(OCGDIR)/intern/$(LIBNAME) +DIR = $(OCGDIR)/intern/audaspace include nan_compile.mk diff --git a/intern/audaspace/ffmpeg/Makefile b/intern/audaspace/ffmpeg/Makefile index 0bfe6494559..492ac83f532 100644 --- a/intern/audaspace/ffmpeg/Makefile +++ b/intern/audaspace/ffmpeg/Makefile @@ -29,7 +29,7 @@ # LIBNAME = aud_ffmpeg -DIR = $(OCGDIR)/intern/$(LIBNAME) +DIR = $(OCGDIR)/intern/audaspace include nan_compile.mk diff --git a/intern/audaspace/intern/Makefile b/intern/audaspace/intern/Makefile index 2dcc7798f1c..a99f44c54d7 100644 --- a/intern/audaspace/intern/Makefile +++ b/intern/audaspace/intern/Makefile @@ -35,6 +35,31 @@ include nan_compile.mk CCFLAGS += $(LEVEL_1_CPP_WARNINGS) +ifeq ($(WITH_SDL),true) + CPPFLAGS += -DWITH_SDL + CPPFLAGS += $(NAN_SDLCFLAGS) +endif + +ifeq ($(WITH_OPENAL),true) + CPPFLAGS += -DWITH_OPENAL + CPPFLAGS += -I../OpenAL +endif + +ifeq ($(WITH_JACK),true) + CPPFLAGS += -DWITH_JACK + CPPFLAGS += -I$(NAN_JACKCFLAGS) + CPPFLAGS += -I../jack +endif + +ifeq ($(WITH_FFMPEG),true) + CPPFLAGS += -DWITH_FFMPEG + CPPFLAGS += $(NAN_FFMPEGCFLAGS) +endif + +ifeq ($(WITH_SNDFILE),true) + CPPFLAGS += -DWITH_SNDFILE +endif + CPPFLAGS += -I$(LCGDIR)/samplerate/include/ CPPFLAGS += -I../ffmpeg CPPFLAGS += -I../FX diff --git a/intern/audaspace/jack/Makefile b/intern/audaspace/jack/Makefile index a6cc9119c6d..23cadf559c0 100644 --- a/intern/audaspace/jack/Makefile +++ b/intern/audaspace/jack/Makefile @@ -35,6 +35,10 @@ include nan_compile.mk CCFLAGS += $(LEVEL_1_CPP_WARNINGS) +# If we are here, jack is enable. +CPPFLAGS += -DWITH_JACK +CPPFLAGS += $(NAN_JACKCFLAGS) + CPPFLAGS += -I../intern CPPFLAGS += -I.. CPPFLAGS += -I. diff --git a/intern/audaspace/sndfile/Makefile b/intern/audaspace/sndfile/Makefile new file mode 100644 index 00000000000..1cf0b2683fb --- /dev/null +++ b/intern/audaspace/sndfile/Makefile @@ -0,0 +1,40 @@ +# +# $Id$ +# +# ***** 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): +# +# ***** END GPL LICENSE BLOCK ***** +# +# + +LIBNAME = aud_sndfile +DIR = $(OCGDIR)/intern/audaspace + +include nan_compile.mk + +CCFLAGS += $(LEVEL_1_CPP_WARNINGS) + +CPPFLAGS += -I../intern +CPPFLAGS += -I.. +CPPFLAGS += -I. diff --git a/source/Makefile b/source/Makefile index 8e9f66bbe42..93bd2e23903 100644 --- a/source/Makefile +++ b/source/Makefile @@ -109,11 +109,28 @@ COMLIB += $(OCGDIR)/blender/blenfont/$(DEBUG_DIR)libblenfont.a COMLIB += $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaudaspace.a COMLIB += $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_src.a COMLIB += $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_fx.a +COMLIB += $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_sdl.a COMLIB += $(NAN_SAMPLERATE)/lib/$(DEBUG_DIR)libsamplerate.a COMLIB += $(NAN_LZO)/lib/$(DEBUG_DIR)libminilzo.a COMLIB += $(NAN_LZMA)/lib/$(DEBUG_DIR)liblzma.a COMLIB += $(NAN_SMOKE)/lib/$(DEBUG_DIR)/libsmoke.a +ifeq ($(WITH_FFMPEG),true) + COMLIB += $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_ffmpeg.a +endif + +ifeq ($(WITH_OPENAL),true) + COMLIB += $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_openal.a +endif + +ifeq ($(WITH_JACK),true) + COMLIB += $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_jack.a +endif + +ifeq ($(WITH_SNDFILE),true) + COMLIB += $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_sndfile.a +endif + ifneq ($(NAN_NO_KETSJI),true) COMLIB += $(OCGDIR)/gameengine/bloutines/$(DEBUG_DIR)libbloutines.a COMLIB += $(OCGDIR)/gameengine/blconverter/$(DEBUG_DIR)libblconverter.a @@ -356,12 +373,7 @@ ifeq ($(OS),solaris) SPLIB += $(NAN_ZLIB)/lib/libz.a endif -# OpenAL libs are already compiled as shared code! - -# Some kooky logic going on here ... -ifeq ($(NAN_NO_OPENAL), true) -# NAN_SND_LIBS = -else +ifeq ($(WITH_OPENAL),true) ifeq ($(OS),$(findstring $(OS), "freebsd linux windows")) ifeq ($(CPU),$(findstring $(CPU), "i386 powerpc x86_64 parisc64")) NAN_SND_LIBS += $(NAN_OPENAL)/lib/libopenal.a @@ -381,6 +393,18 @@ else endif endif +ifeq ($(WITH_JACK),true) + ifeq ($(OS),$(findstring $(OS), "linux")) + NAN_SND_LIBS += $(NAN_JACKLIBS) + endif +endif + +ifeq ($(WITH_SNDFILE),true) + ifeq ($(OS),$(findstring $(OS), "linux")) + NAN_SND_LIBS += $(NAN_SNDFILELIBS) + endif +endif + ifeq ($(OS),windows) # Might need to change this to $(NAN_MOZILLA_LIB)/nspr4.lib diff --git a/source/nan_definitions.mk b/source/nan_definitions.mk index 7fab61d5247..50a606496f5 100644 --- a/source/nan_definitions.mk +++ b/source/nan_definitions.mk @@ -117,6 +117,25 @@ ifndef CONFIG_GUESS export WITH_LZMA ?= true export NAN_LZO ?= $(LCGDIR)/lzo export NAN_LZMA ?= $(LCGDIR)/lzma + export WITH_OPENAL ?= false + export WITH_JACK ?= false + export WITH_SNDFILE ?= false + + ifeq ($(WITH_OPENAL), true) + export NAN_OPENAL ?= /usr + endif + + ifeq ($(WITH_JACK), true) + export NAN_JACK ?= /usr + export NAN_JACKCFLAGS ?= -I$(NAN_JACK)/include/jack + export NAN_JACKLIBS ?= $(NAN_JACK)/lib/libjack.a + endif + + ifeq ($(WITH_SNDFILE),true) + export NAN_SNDFILE ?= /usr + export NAN_SNDFILECFLAGS ?= -I$(NAN_SNDFILE)/include + export NAN_SNDFILELIBS ?= $(NAN_SNDFILE)/lib/libsndfile.a + endif ifeq ($(NAN_USE_FFMPEG_CONFIG), true) export NAN_FFMPEG ?= $(shell ffmpeg-config --prefix) @@ -175,7 +194,7 @@ ifndef CONFIG_GUESS export NAN_NO_KETSJI=false ifeq ($(CPU), i386) - export NAN_NO_OPENAL=true + export WITH_OPENAL=false endif # Location of MOZILLA/Netscape header files... @@ -535,5 +554,4 @@ endif # CONFIG_GUESS # Don't want to build the gameengine? ifeq ($(NAN_NO_KETSJI), true) export NAN_JUST_BLENDERDYNAMIC=true - export NAN_NO_OPENAL=true endif From 2355130c3a6c698eaccf279d2b626809e95a48d6 Mon Sep 17 00:00:00 2001 From: William Reynish Date: Sat, 22 Aug 2009 00:19:24 +0000 Subject: [PATCH 194/577] Added standard hotkeys for standard features like copying, cutting, pasting, saving, loading. Saving/Loading: Save - Ctrl S / Cmd S Save As - Ctrl+Shift S / Cmd+Shift S Open - Ctrl O / Cmd O Open Recent - Ctrl+Shift O / Cmd+Shift O New File - Ctrl N / Cmd N Text: Copy- Ctrl+C / Cmd+C Cut- Ctrl+C / Cmd+C Paste- Ctrl+V / Cmd+V Select text- Ctrl+A / Cmd+A Misc: Repeat Last Op - Ctrl+R / Cmd+R Render - Ctrl+Return / Cmd+Return Render Animation- Shift+Ctrl+Return / Shift+Cmd+Return User Preferences - Ctrl+Comma / Cmd+Comma Changed the important search menu to Space key. Old hotkeys are still preserved, at least for now. --- source/blender/editors/curve/curve_ops.c | 5 +++- source/blender/editors/screen/screen_ops.c | 14 +++++++++-- .../blender/editors/space_text/space_text.c | 8 +++++++ .../windowmanager/intern/wm_operators.c | 24 +++++++++++++------ 4 files changed, 41 insertions(+), 10 deletions(-) diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c index 6006c7e656b..d3bcdcb69bb 100644 --- a/source/blender/editors/curve/curve_ops.c +++ b/source/blender/editors/curve/curve_ops.c @@ -202,8 +202,11 @@ void ED_keymap_curve(wmWindowManager *wm) RNA_int_set(WM_keymap_add_item(keymap, "FONT_OT_change_character", DOWNARROWKEY, KM_PRESS, KM_ALT, 0)->ptr, "delta", -1); WM_keymap_add_item(keymap, "FONT_OT_text_copy", CKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "FONT_OT_text_copy", CKEY, KM_PRESS, KM_OSKEY, 0); WM_keymap_add_item(keymap, "FONT_OT_text_cut", XKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "FONT_OT_text_paste", PKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "FONT_OT_text_cut", XKEY, KM_PRESS, KM_OSKEY, 0); + WM_keymap_add_item(keymap, "FONT_OT_text_paste", VKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "FONT_OT_text_paste", VKEY, KM_PRESS, KM_OSKEY, 0); WM_keymap_add_item(keymap, "FONT_OT_line_break", RETKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FONT_OT_text_insert", KM_TEXTINPUT, KM_ANY, KM_ANY, 0); // last! diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index fab4de50568..380390cf543 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -3298,6 +3298,7 @@ void ED_keymap_screen(wmWindowManager *wm) /* Screen General ------------------------------------------------ */ keymap= WM_keymap_listbase(wm, "Screen", 0, 0); + /* standard timers */ WM_keymap_add_item(keymap, "SCREEN_OT_animation_step", TIMER0, KM_ANY, KM_ANY, 0); @@ -3326,7 +3327,9 @@ void ED_keymap_screen(wmWindowManager *wm) WM_keymap_add_item(keymap, "SCREEN_OT_region_foursplit", SKEY, KM_PRESS, KM_CTRL|KM_ALT|KM_SHIFT, 0); WM_keymap_verify_item(keymap, "SCREEN_OT_repeat_history", F3KEY, KM_PRESS, 0, 0); - WM_keymap_verify_item(keymap, "SCREEN_OT_repeat_last", F4KEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "SCREEN_OT_repeat_last", RKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "SCREEN_OT_repeat_last", RKEY, KM_PRESS, KM_OSKEY, 0); + WM_keymap_add_item(keymap, "SCREEN_OT_repeat_last", F4KEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "SCREEN_OT_region_flip", F5KEY, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "SCREEN_OT_redo_last", F6KEY, KM_PRESS, 0, 0); @@ -3345,11 +3348,17 @@ void ED_keymap_screen(wmWindowManager *wm) /* render */ WM_keymap_add_item(keymap, "SCREEN_OT_render", F12KEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_OSKEY, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_render", F12KEY, KM_PRESS, KM_CTRL, 0)->ptr, "animation", 1); + RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0)->ptr, "animation", 1); + RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_OSKEY|KM_SHIFT, 0)->ptr, "animation", 1); WM_keymap_add_item(keymap, "SCREEN_OT_render_view_cancel", ESCKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "SCREEN_OT_render_view_show", F11KEY, KM_PRESS, 0, 0); /* user prefs */ + WM_keymap_add_item(keymap, "SCREEN_OT_userpref_show", COMMAKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "SCREEN_OT_userpref_show", COMMAKEY, KM_PRESS, KM_OSKEY, 0); WM_keymap_add_item(keymap, "SCREEN_OT_userpref_show", UKEY, KM_PRESS, KM_ALT, 0); /* Anim Playback ------------------------------------------------ */ @@ -3362,7 +3371,8 @@ void ED_keymap_screen(wmWindowManager *wm) RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_offset", RIGHTARROWKEY, KM_PRESS, 0, 0)->ptr, "delta", 1); WM_keymap_add_item(keymap, "SCREEN_OT_frame_jump", DOWNARROWKEY, KM_PRESS, KM_SHIFT, 0); - RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_jump", UPARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "end", 1); + RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_jump", RIGHTARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "end", 1); + RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_jump", LEFTARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "end", 0); WM_keymap_add_item(keymap, "SCREEN_OT_keyframe_jump", PAGEUPKEY, KM_PRESS, KM_CTRL, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_keyframe_jump", PAGEDOWNKEY, KM_PRESS, KM_CTRL, 0)->ptr, "next", 0); diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index a9c0d3ff76b..4394fbfe1f5 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -210,21 +210,28 @@ static void text_keymap(struct wmWindowManager *wm) WM_keymap_add_item(keymap, "TEXT_OT_open", OKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "TEXT_OT_reload", RKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "TEXT_OT_save", SKEY, KM_PRESS, KM_ALT, 0); + WM_keymap_add_item(keymap, "TEXT_OT_save", SKEY, KM_PRESS, KM_ALT|KM_OSKEY, 0); + WM_keymap_add_item(keymap, "TEXT_OT_save_as", SKEY, KM_PRESS, KM_ALT|KM_SHIFT|KM_CTRL, 0); + WM_keymap_add_item(keymap, "TEXT_OT_save_as", SKEY, KM_PRESS, KM_ALT|KM_SHIFT|KM_OSKEY, 0); WM_keymap_add_item(keymap, "TEXT_OT_run_script", PKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "TEXT_OT_cut", XKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "TEXT_OT_cut", XKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "TEXT_OT_cut", XKEY, KM_PRESS, KM_OSKEY, 0); WM_keymap_add_item(keymap, "TEXT_OT_copy", CKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "TEXT_OT_copy", CKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "TEXT_OT_copy", CKEY, KM_PRESS, KM_OSKEY, 0); WM_keymap_add_item(keymap, "TEXT_OT_paste", VKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "TEXT_OT_paste", VKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "TEXT_OT_paste", VKEY, KM_PRESS, KM_OSKEY, 0); if(U.uiflag & USER_MMB_PASTE) // XXX not dynamic RNA_boolean_set(WM_keymap_add_item(keymap, "TEXT_OT_paste", MIDDLEMOUSE, KM_PRESS, 0, 0)->ptr, "selection", 1); WM_keymap_add_item(keymap, "TEXT_OT_jump", JKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "TEXT_OT_find", FKEY, KM_PRESS, KM_ALT, 0); + WM_keymap_add_item(keymap, "TEXT_OT_find", FKEY, KM_PRESS, KM_OSKEY, 0); WM_keymap_add_item(keymap, "TEXT_OT_properties", FKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "TEXT_OT_properties", FKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "TEXT_OT_replace", HKEY, KM_PRESS, KM_ALT, 0); @@ -233,6 +240,7 @@ static void text_keymap(struct wmWindowManager *wm) WM_keymap_add_item(keymap, "TEXT_OT_to_3d_object", MKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "TEXT_OT_select_all", AKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "TEXT_OT_select_all", AKEY, KM_PRESS, KM_OSKEY, 0); WM_keymap_add_item(keymap, "TEXT_OT_indent", TABKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "TEXT_OT_unindent", TABKEY, KM_PRESS, KM_SHIFT, 0); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 87a145ceee2..22c7b6ae277 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1908,19 +1908,29 @@ void wm_window_keymap(wmWindowManager *wm) /* note, this doesn't replace existing keymap items */ WM_keymap_verify_item(keymap, "WM_OT_window_duplicate", WKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); - WM_keymap_verify_item(keymap, "WM_OT_read_homefile", XKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_verify_item(keymap, "WM_OT_save_homefile", UKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_verify_item(keymap, "WM_OT_open_recentfile", OKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_verify_item(keymap, "WM_OT_open_mainfile", F1KEY, KM_PRESS, 0, 0); - WM_keymap_verify_item(keymap, "WM_OT_save_mainfile", WKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_verify_item(keymap, "WM_OT_save_as_mainfile", F2KEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "WM_OT_read_homefile", NKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "WM_OT_read_homefile", NKEY, KM_PRESS, KM_OSKEY, 0); + WM_keymap_add_item(keymap, "WM_OT_read_homefile", XKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "WM_OT_save_homefile", UKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "WM_OT_save_homefile", UKEY, KM_PRESS, KM_OSKEY, 0); + WM_keymap_add_item(keymap, "WM_OT_open_recentfile", OKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0); + WM_keymap_add_item(keymap, "WM_OT_open_recentfile", OKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0); + WM_keymap_add_item(keymap, "WM_OT_open_mainfile", OKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "WM_OT_open_mainfile", OKEY, KM_PRESS, KM_OSKEY, 0); + WM_keymap_add_item(keymap, "WM_OT_open_mainfile", F1KEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "WM_OT_save_mainfile", SKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "WM_OT_save_mainfile", SKEY, KM_PRESS, KM_OSKEY, 0); + WM_keymap_add_item(keymap, "WM_OT_save_mainfile", WKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0); + WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0); + WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", F2KEY, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "WM_OT_window_fullscreen_toggle", F11KEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_verify_item(keymap, "WM_OT_exit_blender", QKEY, KM_PRESS, KM_CTRL, 0); /* debug/testing */ WM_keymap_verify_item(keymap, "WM_OT_ten_timer", TKEY, KM_PRESS, KM_ALT|KM_CTRL, 0); WM_keymap_verify_item(keymap, "WM_OT_debug_menu", DKEY, KM_PRESS, KM_ALT|KM_CTRL, 0); - WM_keymap_verify_item(keymap, "WM_OT_search_menu", SPACEKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_verify_item(keymap, "WM_OT_search_menu", SPACEKEY, KM_PRESS, 0, 0); } From 095ec3a6e9357e6ce14fd200396ea221ac88e3b6 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sat, 22 Aug 2009 01:01:53 +0000 Subject: [PATCH 195/577] 2.5/Multires: * Disabled multires subdivide button in editmode (again) SVN weirdness: I already did this in r22447. Somehow it got changed back -- but I can't find any log of it getting reverted, either in my email or on p.b.o. This is extremely weird! --- source/blender/editors/object/object_modifier.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 3785e17f67c..1b20f90360a 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -699,7 +699,8 @@ static int multires_subdivide_exec(bContext *C, wmOperator *op) static int multires_subdivide_poll(bContext *C) { - return (CTX_data_pointer_get_type(C, "modifier", &RNA_MultiresModifier).data != NULL); + return (CTX_data_pointer_get_type(C, "modifier", &RNA_MultiresModifier).data != NULL) && + CTX_data_edit_object(C) == NULL; } void OBJECT_OT_multires_subdivide(wmOperatorType *ot) From 0be1e72dca48a6709c2ae8b3805387d4ef5bcdcb Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sat, 22 Aug 2009 02:27:37 +0000 Subject: [PATCH 196/577] 2.5/Vertex paint: * Added operator for filling vertex colors with the brush color * Pythonized the vertex paint menu --- release/ui/space_view3d.py | 28 ++++++-- .../editors/sculpt_paint/paint_intern.h | 3 + .../blender/editors/sculpt_paint/paint_ops.c | 27 +++++++ .../editors/sculpt_paint/paint_vertex.c | 42 +++-------- .../editors/space_view3d/view3d_header.c | 70 ------------------- 5 files changed, 65 insertions(+), 105 deletions(-) diff --git a/release/ui/space_view3d.py b/release/ui/space_view3d.py index 0b08b213cd4..ae04c8875ce 100644 --- a/release/ui/space_view3d.py +++ b/release/ui/space_view3d.py @@ -12,6 +12,7 @@ class VIEW3D_HT_header(bpy.types.Header): view = context.space_data mode_string = context.mode edit_object = context.edit_object + object = context.active_object row = layout.row(align=True) row.template_header() @@ -26,12 +27,14 @@ class VIEW3D_HT_header(bpy.types.Header): if mode_string not in ('EDIT_TEXT', 'SCULPT', 'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE', 'PARTICLE'): # XXX: Particle Mode has Select Menu. sub.itemM("VIEW3D_MT_select_%s" % mode_string) - - if mode_string == 'OBJECT': + + if object.mode == 'OBJECT': sub.itemM("VIEW3D_MT_object") - elif mode_string == 'SCULPT': + elif object.mode == 'SCULPT': sub.itemM("VIEW3D_MT_sculpt") - elif edit_object: + elif object.mode == 'VERTEX_PAINT': + sub.itemM("VIEW3D_MT_vertex_paint") + elif object.mode: sub.itemM("VIEW3D_MT_edit_%s" % edit_object.type) layout.template_header_3D() @@ -480,6 +483,21 @@ class VIEW3D_MT_object_show(bpy.types.Menu): layout.itemO("object.restrictview_set") layout.item_booleanO("object.restrictview_set", "unselected", True, text="Hide Unselected") +# ********** Vertex paint menu ********** + +class VIEW3D_MT_vertex_paint(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Paint" + + def draw(self, context): + layout = self.layout + + sculpt = context.tool_settings.sculpt + + layout.itemO("paint.vertex_color_set") + props = layout.itemO("paint.vertex_color_set", text="Set Selected Vertex Colors", properties=True) + props.selected = True + # ********** Sculpt menu ********** class VIEW3D_MT_sculpt(bpy.types.Menu): @@ -1076,6 +1094,8 @@ bpy.types.register(VIEW3D_MT_object_show) bpy.types.register(VIEW3D_MT_sculpt) # Sculpt Menu +bpy.types.register(VIEW3D_MT_vertex_paint) + bpy.types.register(VIEW3D_MT_edit_snap) # Edit Menus bpy.types.register(VIEW3D_MT_edit_MESH) diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h index a0187566c43..ba1b57a1bef 100644 --- a/source/blender/editors/sculpt_paint/paint_intern.h +++ b/source/blender/editors/sculpt_paint/paint_intern.h @@ -57,6 +57,9 @@ int paint_poll(bContext *C); void paint_cursor_start(struct bContext *C, int (*poll)(struct bContext *C)); /* paint_vertex.c */ +int vertex_paint_mode_poll(bContext *C); +void clear_vpaint(Scene *scene, int selected); + void PAINT_OT_weight_paint_toggle(struct wmOperatorType *ot); void PAINT_OT_weight_paint_radial_control(struct wmOperatorType *ot); void PAINT_OT_weight_paint(struct wmOperatorType *ot); diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index 1ea612c0aa5..c38b36007e9 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -77,6 +77,32 @@ void BRUSH_OT_add(wmOperatorType *ot) RNA_def_enum(ot->srna, "type", brush_type_items, OB_MODE_VERTEX_PAINT, "Type", "Which paint mode to create the brush for."); } +static int vertex_color_set_exec(bContext *C, wmOperator *op) +{ + int selected = RNA_boolean_get(op->ptr, "selected"); + Scene *scene = CTX_data_scene(C); + + clear_vpaint(scene, selected); + + return OPERATOR_FINISHED; +} + +void PAINT_OT_vertex_color_set(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Set Vertex Colors"; + ot->idname= "PAINT_OT_vertex_color_set"; + + /* api callbacks */ + ot->exec= vertex_color_set_exec; + ot->poll= vertex_paint_mode_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + RNA_def_boolean(ot->srna, "selected", 0, "Type", "Only color selected faces."); +} + /**************************** registration **********************************/ void ED_operatortypes_paint(void) @@ -103,5 +129,6 @@ void ED_operatortypes_paint(void) WM_operatortype_append(PAINT_OT_vertex_paint_radial_control); WM_operatortype_append(PAINT_OT_vertex_paint_toggle); WM_operatortype_append(PAINT_OT_vertex_paint); + WM_operatortype_append(PAINT_OT_vertex_color_set); } diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index bc2ac480657..ee3d9e5baa1 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -110,11 +110,18 @@ static void error() {} /* polling - retrieve whether cursor should be set or operator should be done */ -static int vp_poll(bContext *C) + +/* Returns true if vertex paint mode is active */ +int vertex_paint_mode_poll(bContext *C) { Object *ob = CTX_data_active_object(C); - if(ob && ob->mode & OB_MODE_VERTEX_PAINT && + return ob && ob->mode == OB_MODE_VERTEX_PAINT; +} + +static int vp_poll(bContext *C) +{ + if(vertex_paint_mode_poll(C) && paint_brush(&CTX_data_tool_settings(C)->vpaint->paint)) { ScrArea *sa= CTX_wm_area(C); if(sa->spacetype==SPACE_VIEW3D) { @@ -323,34 +330,7 @@ static void copy_wpaint_prev (VPaint *wp, MDeformVert *dverts, int dcount) } -void clear_vpaint(Scene *scene) -{ - Mesh *me; - Object *ob; - unsigned int *to, paintcol; - int a; - - ob= OBACT; - me= get_mesh(ob); - if(!ob || ob->id.lib) return; - - if(!(ob->mode & OB_MODE_VERTEX_PAINT)) return; - - if(me==0 || me->mcol==0 || me->totface==0) return; - - paintcol= vpaint_get_current_col(scene->toolsettings->vpaint); - - to= (unsigned int *)me->mcol; - a= 4*me->totface; - while(a--) { - *to= paintcol; - to++; - } - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - -} - -void clear_vpaint_selectedfaces(Scene *scene) +void clear_vpaint(Scene *scene, int selected) { Mesh *me; MFace *mf; @@ -370,7 +350,7 @@ void clear_vpaint_selectedfaces(Scene *scene) mf = me->mface; mcol = (unsigned int*)me->mcol; for (i = 0; i < me->totface; i++, mf++, mcol+=4) { - if (mf->flag & ME_FACE_SEL) { + if (!selected || mf->flag & ME_FACE_SEL) { mcol[0] = paintcol; mcol[1] = paintcol; mcol[2] = paintcol; diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 9fa1b222868..73cd65cafcd 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -2426,71 +2426,6 @@ static void view3d_pose_armaturemenu(bContext *C, uiLayout *layout, void *arg_un #endif } - -/* vertex paint menu */ -static void do_view3d_vpaintmenu(bContext *C, void *arg, int event) -{ -#if 0 - /* events >= 3 are registered bpython scripts */ -#ifndef DISABLE_PYTHON - if (event >= 3) BPY_menu_do_python(PYMENU_VERTEXPAINT, event - 3); -#endif - switch(event) { - case 0: /* undo vertex painting */ - BIF_undo(); - break; - case 1: /* set vertex colors/weight */ - if(paint_facesel_test(CTX_data_active_object(C))) - clear_vpaint_selectedfaces(); - else /* we know were in vertex paint mode */ - clear_vpaint(); - break; - case 2: - make_vertexcol(1); - break; - } -#endif -} - -static uiBlock *view3d_vpaintmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - short yco= 0, menuwidth=120; -#ifndef DISABLE_PYTHON -// XXX BPyMenu *pym; -// int i=0; -#endif - - block= uiBeginBlock(C, ar, "view3d_paintmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_vpaintmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Vertex Painting|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Vertex Colors|Shift K", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Shaded Vertex Colors", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - -#ifndef DISABLE_PYTHON - /* note that we account for the 3 previous entries with i+3: - even if the last item isnt displayed, it dosent matter */ -// for (pym = BPyMenuTable[PYMENU_VERTEXPAINT]; pym; pym = pym->next, i++) { -// uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, -// menuwidth, 19, NULL, 0.0, 0.0, 1, i+3, -// pym->tooltip?pym->tooltip:pym->filename); -// } -#endif - - if(ar->alignment==RGN_ALIGN_TOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - return block; -} - - /* texture paint menu (placeholder, no items yet??) */ static void do_view3d_tpaintmenu(bContext *C, void *arg, int event) { @@ -3050,11 +2985,6 @@ static void view3d_header_pulldowns(const bContext *C, uiBlock *block, Object *o uiDefPulldownBut(block, view3d_wpaintmenu, NULL, "Paint", xco,yco, xmax-3, 20, ""); xco+= xmax; } - else if (ob && ob->mode & OB_MODE_VERTEX_PAINT) { - xmax= GetButStringLength("Paint"); - uiDefPulldownBut(block, view3d_vpaintmenu, NULL, "Paint", xco,yco, xmax-3, 20, ""); - xco+= xmax; - } else if (ob && ob->mode & OB_MODE_TEXTURE_PAINT) { xmax= GetButStringLength("Paint"); uiDefPulldownBut(block, view3d_tpaintmenu, NULL, "Paint", xco,yco, xmax-3, 20, ""); From 98272a0138454311ada78f3a8b4e90e6f61aebc9 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 22 Aug 2009 02:53:14 +0000 Subject: [PATCH 197/577] 2.5 - Code shuffling Moved WeightPaint/VertexPaint toggling hotkeys to the same place that the ones for PoseMode/EditMode are defined. This means that the hotkey for toggling PoseMode works again (instead of being overwritten by WeightPaint). --- source/blender/editors/object/object_ops.c | 9 +++++++++ source/blender/editors/space_view3d/view3d_ops.c | 7 ------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 6f1a3b5f6cb..239b162c14f 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -167,10 +167,19 @@ void ED_operatortypes_object(void) void ED_keymap_object(wmWindowManager *wm) { ListBase *keymap= WM_keymap_listbase(wm, "Object Non-modal", 0, 0); + wmKeymapItem *kmi; /* Note: this keymap works disregarding mode */ WM_keymap_add_item(keymap, "OBJECT_OT_editmode_toggle", TABKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "OBJECT_OT_posemode_toggle", TABKEY, KM_PRESS, KM_CTRL, 0); + + kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", VKEY, KM_PRESS, 0, 0); + RNA_enum_set(kmi->ptr, "mode", OB_MODE_VERTEX_PAINT); + RNA_boolean_set(kmi->ptr, "toggle", 1); + kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, KM_CTRL, 0); + RNA_enum_set(kmi->ptr, "mode", OB_MODE_WEIGHT_PAINT); + RNA_boolean_set(kmi->ptr, "toggle", 1); + WM_keymap_add_item(keymap, "OBJECT_OT_center_set", CKEY, KM_PRESS, KM_ALT|KM_SHIFT|KM_CTRL, 0); /* Note: this keymap gets disabled in non-objectmode, */ diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index b0eabae3f5d..929272bc066 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -106,13 +106,6 @@ void view3d_keymap(wmWindowManager *wm) ListBase *keymap= WM_keymap_listbase(wm, "View3D Generic", SPACE_VIEW3D, 0); wmKeymapItem *km; - km = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", VKEY, KM_PRESS, 0, 0); - RNA_enum_set(km->ptr, "mode", OB_MODE_VERTEX_PAINT); - RNA_boolean_set(km->ptr, "toggle", 1); - km = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, KM_CTRL, 0); - RNA_enum_set(km->ptr, "mode", OB_MODE_WEIGHT_PAINT); - RNA_boolean_set(km->ptr, "toggle", 1); - WM_keymap_add_item(keymap, "VIEW3D_OT_properties", NKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "VIEW3D_OT_toolbar", TKEY, KM_PRESS, 0, 0); From 17e3b09e88ad48c1659f2c586c33a725a3bd601f Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 22 Aug 2009 03:10:52 +0000 Subject: [PATCH 198/577] 2.5 - Timeline now updates correctly after keyframes have been edited --- source/blender/editors/space_time/space_time.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c index f18da93c35d..ce6846a4489 100644 --- a/source/blender/editors/space_time/space_time.c +++ b/source/blender/editors/space_time/space_time.c @@ -260,11 +260,15 @@ static void time_main_area_listener(ARegion *ar, wmNotifier *wmn) { /* context changes */ switch(wmn->category) { + case NC_ANIMATION: + ED_region_tag_redraw(ar); + break; case NC_SCENE: /* any scene change for now */ ED_region_tag_redraw(ar); break; + } } From d4407115faaf89061eed36cb69664f071db3fa31 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 22 Aug 2009 04:11:17 +0000 Subject: [PATCH 199/577] Hook Modifier Bugfixes: Fixed some typos made in previous commit. Hook Modifier should now work correctly again (and also for newly added Hook relationships) Notes: * To add a hook, you currently need to perform the following steps 1) add modifier from menu (no operator in EditMode) 2) specify the object (and/or bone to use as the hook target) 3a) in EditMode, select the vertices you wish to be affected by the hook, and press 'Assign' 3b) alternatively, fill in the vertex-group field for the Vertex Group which contains the vertices to be affected 4) press 'Reset' (to make sure hook will behave correctly) 5) optionally, also press 'Recenter' if the hook position isn't right... * BUG ALERT (Brecht/Ton): it is impossible to clear the vertexgroup/bone fields once you have assigned some value. Doing backspace+enter (or any other variation) will always result in the first item in the search menu being used. --- source/blender/blenkernel/intern/modifier.c | 9 +++-- source/blender/editors/object/object_edit.c | 40 ++++++++++--------- .../blender/editors/object/object_modifier.c | 2 +- 3 files changed, 27 insertions(+), 24 deletions(-) diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 6da2c94fab8..1cb163a4de7 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -5657,7 +5657,7 @@ static void hookModifier_deformVerts( { HookModifierData *hmd = (HookModifierData*) md; bPoseChannel *pchan= get_pose_channel(hmd->object->pose, hmd->subtarget); - float vec[3], mat[4][4], dmat[4][4], imat[4][4]; + float vec[3], mat[4][4], dmat[4][4]; int i; DerivedMesh *dm = derivedData; @@ -5670,8 +5670,8 @@ static void hookModifier_deformVerts( /* just object target */ Mat4CpyMat4(dmat, hmd->object->obmat); } - Mat4Invert(imat, dmat); - Mat4MulSerie(mat, imat, dmat, hmd->parentinv, + Mat4Invert(ob->imat, ob->obmat); + Mat4MulSerie(mat, ob->imat, dmat, hmd->parentinv, NULL, NULL, NULL, NULL, NULL); /* vertex indices? */ @@ -5728,7 +5728,8 @@ static void hookModifier_deformVerts( } } } - } else { /* vertex group hook */ + } + else if(hmd->name[0]) { /* vertex group hook */ bDeformGroup *curdef; Mesh *me = ob->data; int index = 0; diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 8ac12a5e3a4..3d2ddba3757 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1384,9 +1384,11 @@ void add_hook(Scene *scene, View3D *v3d, int mode) modifier_free(md); } else if(mode==5) { /* select */ + // FIXME: this is now OBJECT_OT_hook_select object_hook_select(obedit, hmd); } else if(mode==6) { /* clear offset */ + // FIXME: this is now OBJECT_OT_hook_reset operator where_is_object(scene, ob); /* ob is hook->parent */ Mat4Invert(ob->imat, ob->obmat); @@ -1398,25 +1400,6 @@ void add_hook(Scene *scene, View3D *v3d, int mode) DAG_scene_sort(scene); } - -/* use this when the loc/size/rot of the parent has changed but the children should stay in the same place - * apply-size-rot or object center for eg */ -static void ignore_parent_tx(Scene *scene, Object *ob ) -{ - Object workob; - Object *ob_child; - - /* a change was made, adjust the children to compensate */ - for (ob_child=G.main->object.first; ob_child; ob_child=ob_child->id.next) { - if (ob_child->parent == ob) { - ED_object_apply_obmat(ob_child); - what_does_parent(scene, ob_child, &workob); - Mat4Invert(ob_child->parentinv, workob.obmat); - } - } -} - - void add_hook_menu(Scene *scene, View3D *v3d) { Object *obedit= scene->obedit; // XXX get from context @@ -1435,6 +1418,25 @@ void add_hook_menu(Scene *scene, View3D *v3d) add_hook(scene, v3d, mode); } + + +/* use this when the loc/size/rot of the parent has changed but the children should stay in the same place + * apply-size-rot or object center for eg */ +static void ignore_parent_tx(Scene *scene, Object *ob ) +{ + Object workob; + Object *ob_child; + + /* a change was made, adjust the children to compensate */ + for (ob_child=G.main->object.first; ob_child; ob_child=ob_child->id.next) { + if (ob_child->parent == ob) { + ED_object_apply_obmat(ob_child); + what_does_parent(scene, ob_child, &workob); + Mat4Invert(ob_child->parentinv, workob.obmat); + } + } +} + /* ******************** clear parent operator ******************* */ static EnumPropertyItem prop_clear_parent_types[] = { diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 1b20f90360a..ec46cea8e84 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -865,7 +865,7 @@ static int hook_reset_exec(bContext *C, wmOperator *op) Mat4MulMat4(mat, pchan->pose_mat, hmd->object->obmat); Mat4Invert(imat, mat); - Mat4MulSerie(hmd->parentinv, imat, mat, NULL, NULL, NULL, NULL, NULL, NULL); + Mat4MulSerie(hmd->parentinv, imat, ob->obmat, NULL, NULL, NULL, NULL, NULL, NULL); } else { Mat4Invert(hmd->object->imat, hmd->object->obmat); From b20f4e46c686f9c9fb0043eb3b95f639773d4a41 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 22 Aug 2009 05:46:03 +0000 Subject: [PATCH 200/577] remove -Wnested-externs warning for CMake/unix, since this is used a lot, if we want to remove it can be re-enabled. fix view3d python errors with no object/edit object. --- CMakeLists.txt | 14 +++++++++++++- release/ui/space_view3d.py | 19 +++++++++++-------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 749284def28..8ef4296e266 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,6 +72,7 @@ OPTION(WITH_FFTW3 "Enable FFTW3 support" OFF) OPTION(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" OFF) OPTION(WITH_SNDFILE "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF) OPTION(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation" OFF) +# OPTION(WITH_BUILDINFO "Include extra build details" ON) OPTION(WITH_INSTALL "Install accompanying scripts and language files needed to run blender" ON) IF(NOT WITH_GAMEENGINE AND WITH_PLAYER) @@ -212,7 +213,7 @@ IF(UNIX AND NOT APPLE) SET(PLATFORM_LINKFLAGS "-pthread") # Better warnings - SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wnested-externs -Wdeclaration-after-statement") + SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wdeclaration-after-statement") SET(CXX_WARNINGS "-Wall -Wno-invalid-offsetof -Wno-sign-compare") INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ) @@ -511,6 +512,17 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux") SET(BINRELOC_INC ${BINRELOC}/include) ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") + +# TODO - buildinfo +# IF(UNIX) +# IF(WITH_BUILDINFO) +# EXEC_PROGRAM("date \"+%Y-%m-%d\"" OUTPUT_VARIABLE BUILD_DATE) +# EXEC_PROGRAM("date \"+%H:%M:%S\"" OUTPUT_VARIABLE BUILD_TIME) +# EXEC_PROGRAM("svnversion ${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE BUILD_REV) +# SET(BUILD_TYPE ${CMAKE_BUILD_TYPE}) +# ENDIF(WITH_BUILDINFO) +# ENDIF(UNIX) + #----------------------------------------------------------------------------- # Common. diff --git a/release/ui/space_view3d.py b/release/ui/space_view3d.py index ae04c8875ce..f9e185f44f2 100644 --- a/release/ui/space_view3d.py +++ b/release/ui/space_view3d.py @@ -27,15 +27,18 @@ class VIEW3D_HT_header(bpy.types.Header): if mode_string not in ('EDIT_TEXT', 'SCULPT', 'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE', 'PARTICLE'): # XXX: Particle Mode has Select Menu. sub.itemM("VIEW3D_MT_select_%s" % mode_string) - - if object.mode == 'OBJECT': - sub.itemM("VIEW3D_MT_object") - elif object.mode == 'SCULPT': - sub.itemM("VIEW3D_MT_sculpt") - elif object.mode == 'VERTEX_PAINT': - sub.itemM("VIEW3D_MT_vertex_paint") - elif object.mode: + + if edit_object: sub.itemM("VIEW3D_MT_edit_%s" % edit_object.type) + elif object: + ob_mode_string = object.mode + + if ob_mode_string == 'OBJECT': + sub.itemM("VIEW3D_MT_object") + elif ob_mode_string == 'SCULPT': + sub.itemM("VIEW3D_MT_sculpt") + elif ob_mode_string == 'VERTEX_PAINT': + sub.itemM("VIEW3D_MT_vertex_paint") layout.template_header_3D() From 9e3ac3c1f2cbd44cbb821d266400d70320ac6ccc Mon Sep 17 00:00:00 2001 From: William Reynish Date: Sat, 22 Aug 2009 08:06:54 +0000 Subject: [PATCH 201/577] Added extra padding for OS X at the top of the screen when opening user prefs. The window header was still getting clipped slightly behind the menu bar. --- source/blender/windowmanager/intern/wm_window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 27a1b076a28..d70516ef02e 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -91,7 +91,7 @@ static void wm_window_check_position(rcti *rect) wm_get_screensize(&width, &height); #ifdef __APPLE__ - height -= 42; + height -= 70; #endif if(rect->xmin < 0) { From 977a50ad77b8c31329a6fb6117741c83a984a763 Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Sat, 22 Aug 2009 08:35:39 +0000 Subject: [PATCH 202/577] 2.5 MSVC projectfiles maintenance * AUD_filefactory added. * imbuf added to RNA include dirs. --- intern/audaspace/make/msvc_9_0/audaspace.vcproj | 15 ++++++++------- .../blender/makesrna/RNA_makesrna.vcproj | 12 ++++++------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/intern/audaspace/make/msvc_9_0/audaspace.vcproj b/intern/audaspace/make/msvc_9_0/audaspace.vcproj index a4d775a415c..67ab4d44d72 100644 --- a/intern/audaspace/make/msvc_9_0/audaspace.vcproj +++ b/intern/audaspace/make/msvc_9_0/audaspace.vcproj @@ -380,6 +380,14 @@ RelativePath="..\..\intern\AUD_ConverterReader.h" > + + + + @@ -723,13 +731,6 @@ - - - Date: Sat, 22 Aug 2009 08:48:01 +0000 Subject: [PATCH 203/577] use '' for enums rather then "" --- release/io/engine_render_pov.py | 4 +- release/ui/buttons_data_armature.py | 8 +- release/ui/buttons_data_bone.py | 6 +- release/ui/buttons_data_camera.py | 4 +- release/ui/buttons_data_curve.py | 8 +- release/ui/buttons_data_empty.py | 4 +- release/ui/buttons_data_lamp.py | 4 +- release/ui/buttons_data_lattice.py | 4 +- release/ui/buttons_data_mesh.py | 28 +++---- release/ui/buttons_data_metaball.py | 4 +- release/ui/buttons_data_modifier.py | 6 +- release/ui/buttons_data_text.py | 4 +- release/ui/buttons_game.py | 12 +-- release/ui/buttons_material.py | 8 +- release/ui/buttons_object.py | 8 +- release/ui/buttons_object_constraint.py | 8 +- release/ui/buttons_particle.py | 40 +++++----- release/ui/buttons_physics_cloth.py | 8 +- release/ui/buttons_physics_field.py | 14 ++-- release/ui/buttons_physics_fluid.py | 4 +- release/ui/buttons_physics_smoke.py | 12 +-- release/ui/buttons_physics_softbody.py | 8 +- release/ui/buttons_scene.py | 18 ++--- release/ui/buttons_texture.py | 4 +- release/ui/buttons_world.py | 4 +- release/ui/space_buttons.py | 4 +- release/ui/space_console.py | 6 +- release/ui/space_filebrowser.py | 2 +- release/ui/space_image.py | 40 +++++----- release/ui/space_info.py | 18 ++--- release/ui/space_logic.py | 4 +- release/ui/space_node.py | 8 +- release/ui/space_outliner.py | 4 +- release/ui/space_sequencer.py | 22 ++--- release/ui/space_text.py | 26 +++--- release/ui/space_time.py | 12 +-- release/ui/space_userpref.py | 18 ++--- release/ui/space_view3d.py | 102 ++++++++++++------------ release/ui/space_view3d_toolbar.py | 8 +- 39 files changed, 253 insertions(+), 253 deletions(-) diff --git a/release/io/engine_render_pov.py b/release/io/engine_render_pov.py index 539f705a6ee..51aa26f7fb9 100644 --- a/release/io/engine_render_pov.py +++ b/release/io/engine_render_pov.py @@ -791,8 +791,8 @@ for member in dir(buttons_material): del buttons_material class RenderButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "scene" # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here diff --git a/release/ui/buttons_data_armature.py b/release/ui/buttons_data_armature.py index 9b640776a9e..3a1de0d5f0b 100644 --- a/release/ui/buttons_data_armature.py +++ b/release/ui/buttons_data_armature.py @@ -2,8 +2,8 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "data" def poll(self, context): @@ -90,8 +90,8 @@ class DATA_PT_bone_groups(DataButtonsPanel): col = row.column(align=True) col.active = (ob.proxy == None) - col.itemO("pose.group_add", icon="ICON_ZOOMIN", text="") - col.itemO("pose.group_remove", icon="ICON_ZOOMOUT", text="") + col.itemO("pose.group_add", icon='ICON_ZOOMIN', text="") + col.itemO("pose.group_remove", icon='ICON_ZOOMOUT', text="") group = pose.active_bone_group if group: diff --git a/release/ui/buttons_data_bone.py b/release/ui/buttons_data_bone.py index 1eb09377892..17c9c2d89d9 100644 --- a/release/ui/buttons_data_bone.py +++ b/release/ui/buttons_data_bone.py @@ -2,8 +2,8 @@ import bpy class BoneButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "bone" def poll(self, context): @@ -20,7 +20,7 @@ class BONE_PT_context_bone(BoneButtonsPanel): bone = context.edit_bone row = layout.row() - row.itemL(text="", icon="ICON_BONE_DATA") + row.itemL(text="", icon='ICON_BONE_DATA') row.itemR(bone, "name", text="") class BONE_PT_transform(BoneButtonsPanel): diff --git a/release/ui/buttons_data_camera.py b/release/ui/buttons_data_camera.py index f2fa4207ec8..0480897d641 100644 --- a/release/ui/buttons_data_camera.py +++ b/release/ui/buttons_data_camera.py @@ -2,8 +2,8 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "data" def poll(self, context): diff --git a/release/ui/buttons_data_curve.py b/release/ui/buttons_data_curve.py index 35d557afe32..92e414ba2f3 100644 --- a/release/ui/buttons_data_curve.py +++ b/release/ui/buttons_data_curve.py @@ -2,8 +2,8 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "data" def poll(self, context): @@ -80,13 +80,13 @@ class DATA_PT_geometry_curve(DataButtonsPanel): sub.itemL(text="Modification:") sub.itemR(curve, "width") sub.itemR(curve, "extrude") - sub.itemR(curve, "taper_object", icon="ICON_OUTLINER_OB_CURVE") + sub.itemR(curve, "taper_object", icon='ICON_OUTLINER_OB_CURVE') sub = split.column() sub.itemL(text="Bevel:") sub.itemR(curve, "bevel_depth", text="Depth") sub.itemR(curve, "bevel_resolution", text="Resolution") - sub.itemR(curve, "bevel_object", icon="ICON_OUTLINER_OB_CURVE") + sub.itemR(curve, "bevel_object", icon='ICON_OUTLINER_OB_CURVE') class DATA_PT_pathanim(DataButtonsPanel): __label__ = "Path Animation" diff --git a/release/ui/buttons_data_empty.py b/release/ui/buttons_data_empty.py index 2a2f51ed292..98c9b88e9f5 100644 --- a/release/ui/buttons_data_empty.py +++ b/release/ui/buttons_data_empty.py @@ -2,8 +2,8 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "data" def poll(self, context): diff --git a/release/ui/buttons_data_lamp.py b/release/ui/buttons_data_lamp.py index a00bb23d5b5..c1873d934c4 100644 --- a/release/ui/buttons_data_lamp.py +++ b/release/ui/buttons_data_lamp.py @@ -2,8 +2,8 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "data" def poll(self, context): diff --git a/release/ui/buttons_data_lattice.py b/release/ui/buttons_data_lattice.py index 5d8a07c7d44..5535f973b27 100644 --- a/release/ui/buttons_data_lattice.py +++ b/release/ui/buttons_data_lattice.py @@ -2,8 +2,8 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "data" def poll(self, context): diff --git a/release/ui/buttons_data_mesh.py b/release/ui/buttons_data_mesh.py index c7663be1923..c1311b32180 100644 --- a/release/ui/buttons_data_mesh.py +++ b/release/ui/buttons_data_mesh.py @@ -2,8 +2,8 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "data" def poll(self, context): @@ -93,12 +93,12 @@ class DATA_PT_vertex_groups(DataButtonsPanel): row.template_list(ob, "vertex_groups", ob, "active_vertex_group_index") col = row.column(align=True) - col.itemO("object.vertex_group_add", icon="ICON_ZOOMIN", text="") - col.itemO("object.vertex_group_remove", icon="ICON_ZOOMOUT", text="") + col.itemO("object.vertex_group_add", icon='ICON_ZOOMIN', text="") + col.itemO("object.vertex_group_remove", icon='ICON_ZOOMOUT', text="") - col.itemO("object.vertex_group_copy", icon="ICON_BLANK1", text="") + col.itemO("object.vertex_group_copy", icon='ICON_BLANK1', text="") if ob.data.users > 1: - col.itemO("object.vertex_group_copy_to_linked", icon="ICON_BLANK1", text="") + col.itemO("object.vertex_group_copy_to_linked", icon='ICON_BLANK1', text="") group = ob.active_vertex_group if group: @@ -137,15 +137,15 @@ class DATA_PT_shape_keys(DataButtonsPanel): col = row.column() subcol = col.column(align=True) - subcol.itemO("object.shape_key_add", icon="ICON_ZOOMIN", text="") - subcol.itemO("object.shape_key_remove", icon="ICON_ZOOMOUT", text="") + subcol.itemO("object.shape_key_add", icon='ICON_ZOOMIN', text="") + subcol.itemO("object.shape_key_remove", icon='ICON_ZOOMOUT', text="") if kb: col.itemS() subcol = col.column(align=True) - subcol.itemR(ob, "shape_key_lock", icon="ICON_UNPINNED", text="") - subcol.itemR(kb, "mute", icon="ICON_MUTE_IPO_ON", text="") + subcol.itemR(ob, "shape_key_lock", icon='ICON_UNPINNED', text="") + subcol.itemR(kb, "mute", icon='ICON_MUTE_IPO_ON', text="") if key.relative: row = layout.row() @@ -197,8 +197,8 @@ class DATA_PT_uv_texture(DataButtonsPanel): col.template_list(me, "uv_textures", me, "active_uv_texture_index", rows=2) col = row.column(align=True) - col.itemO("mesh.uv_texture_add", icon="ICON_ZOOMIN", text="") - col.itemO("mesh.uv_texture_remove", icon="ICON_ZOOMOUT", text="") + col.itemO("mesh.uv_texture_add", icon='ICON_ZOOMIN', text="") + col.itemO("mesh.uv_texture_remove", icon='ICON_ZOOMOUT', text="") lay = me.active_uv_texture if lay: @@ -218,8 +218,8 @@ class DATA_PT_vertex_colors(DataButtonsPanel): col.template_list(me, "vertex_colors", me, "active_vertex_color_index", rows=2) col = row.column(align=True) - col.itemO("mesh.vertex_color_add", icon="ICON_ZOOMIN", text="") - col.itemO("mesh.vertex_color_remove", icon="ICON_ZOOMOUT", text="") + col.itemO("mesh.vertex_color_add", icon='ICON_ZOOMIN', text="") + col.itemO("mesh.vertex_color_remove", icon='ICON_ZOOMOUT', text="") lay = me.active_vertex_color if lay: diff --git a/release/ui/buttons_data_metaball.py b/release/ui/buttons_data_metaball.py index e31c3d7fcd0..88c0066c67f 100644 --- a/release/ui/buttons_data_metaball.py +++ b/release/ui/buttons_data_metaball.py @@ -1,8 +1,8 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "data" def poll(self, context): diff --git a/release/ui/buttons_data_modifier.py b/release/ui/buttons_data_modifier.py index f5af26f8746..9b2481b0195 100644 --- a/release/ui/buttons_data_modifier.py +++ b/release/ui/buttons_data_modifier.py @@ -2,8 +2,8 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "modifier" class DATA_PT_modifiers(DataButtonsPanel): @@ -202,7 +202,7 @@ class DATA_PT_modifiers(DataButtonsPanel): def HOOK(self, layout, ob, md): col = layout.column() col.itemR(md, "object") - if md.object and md.object.type == "ARMATURE": + if md.object and md.object.type == 'ARMATURE': layout.item_pointerR(md, "subtarget", md.object.data, "bones", text="Bone") layout.item_pointerR(md, "vertex_group", ob, "vertex_groups") diff --git a/release/ui/buttons_data_text.py b/release/ui/buttons_data_text.py index 754d6fcda39..62d4d0a4d21 100644 --- a/release/ui/buttons_data_text.py +++ b/release/ui/buttons_data_text.py @@ -2,8 +2,8 @@ import bpy class DataButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "data" def poll(self, context): diff --git a/release/ui/buttons_game.py b/release/ui/buttons_game.py index 7334b453e91..e28e3fda2c6 100644 --- a/release/ui/buttons_game.py +++ b/release/ui/buttons_game.py @@ -2,8 +2,8 @@ import bpy class PhysicsButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "physics" def poll(self, context): @@ -171,8 +171,8 @@ bpy.types.register(PHYSICS_PT_game_physics) bpy.types.register(PHYSICS_PT_game_collision_bounds) class SceneButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "scene" def poll(self, context): @@ -322,8 +322,8 @@ bpy.types.register(SCENE_PT_game_shading) bpy.types.register(SCENE_PT_game_performance) class WorldButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "world" def poll(self, context): diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py index 73d28d6964c..eaba26c7e51 100644 --- a/release/ui/buttons_material.py +++ b/release/ui/buttons_material.py @@ -2,8 +2,8 @@ import bpy class MaterialButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "material" # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here @@ -45,8 +45,8 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel): row.template_list(ob, "materials", ob, "active_material_index", rows=2) col = row.column(align=True) - col.itemO("object.material_slot_add", icon="ICON_ZOOMIN", text="") - col.itemO("object.material_slot_remove", icon="ICON_ZOOMOUT", text="") + col.itemO("object.material_slot_add", icon='ICON_ZOOMIN', text="") + col.itemO("object.material_slot_remove", icon='ICON_ZOOMOUT', text="") if ob.mode == 'EDIT': row = layout.row(align=True) diff --git a/release/ui/buttons_object.py b/release/ui/buttons_object.py index 6b6d583e2ca..af2c7cfb58a 100644 --- a/release/ui/buttons_object.py +++ b/release/ui/buttons_object.py @@ -2,8 +2,8 @@ import bpy class ObjectButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "object" class OBJECT_PT_context_object(ObjectButtonsPanel): @@ -15,7 +15,7 @@ class OBJECT_PT_context_object(ObjectButtonsPanel): ob = context.object row = layout.row() - row.itemL(text="", icon="ICON_OBJECT_DATA") + row.itemL(text="", icon='ICON_OBJECT_DATA') row.itemR(ob, "name", text="") class OBJECT_PT_transform(ObjectButtonsPanel): @@ -79,7 +79,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel): row = col.box().row() row.itemR(group, "name", text="") - row.itemO("object.group_remove", text="", icon="VICON_X") + row.itemO("object.group_remove", text="", icon='VICON_X') split = col.box().split() split.column().itemR(group, "layer", text="Dupli") diff --git a/release/ui/buttons_object_constraint.py b/release/ui/buttons_object_constraint.py index c67d6e40cfb..cdc18e3545c 100644 --- a/release/ui/buttons_object_constraint.py +++ b/release/ui/buttons_object_constraint.py @@ -2,8 +2,8 @@ import bpy class ConstraintButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "constraint" def draw_constraint(self, con): @@ -39,7 +39,7 @@ class ConstraintButtonsPanel(bpy.types.Panel): layout.itemR(con, "target") # XXX limiting settings for only 'curves' or some type of object if con.target and subtargets: - if con.target.type == "ARMATURE": + if con.target.type == 'ARMATURE': layout.item_pointerR(con, "subtarget", con.target.data, "bones", text="Bone") if con.type == 'COPY_LOCATION': @@ -478,7 +478,7 @@ class ConstraintButtonsPanel(bpy.types.Panel): layout.itemR(con, "distance") layout.itemR(con, "shrinkwrap_type") - if con.shrinkwrap_type == "PROJECT": + if con.shrinkwrap_type == 'PROJECT': row = layout.row(align=True) row.itemR(con, "axis_x") row.itemR(con, "axis_y") diff --git a/release/ui/buttons_particle.py b/release/ui/buttons_particle.py index 8bc84b734bf..0454f2a4023 100644 --- a/release/ui/buttons_particle.py +++ b/release/ui/buttons_particle.py @@ -11,8 +11,8 @@ def particle_panel_poll(context): return psys.settings.type in ('EMITTER', 'REACTOR', 'HAIR') class ParticleButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "particle" def poll(self, context): @@ -35,8 +35,8 @@ class PARTICLE_PT_particles(ParticleButtonsPanel): row.template_list(ob, "particle_systems", ob, "active_particle_system_index", rows=2) col = row.column(align=True) - col.itemO("object.particle_system_add", icon="ICON_ZOOMIN", text="") - col.itemO("object.particle_system_remove", icon="ICON_ZOOMOUT", text="") + col.itemO("object.particle_system_add", icon='ICON_ZOOMIN', text="") + col.itemO("object.particle_system_remove", icon='ICON_ZOOMOUT', text="") if psys: part = psys.settings @@ -156,8 +156,8 @@ class PARTICLE_PT_cache(ParticleButtonsPanel): row = layout.row() row.template_list(cache, "point_cache_list", cache, "active_point_cache_index", rows=2 ) col = row.column(align=True) - col.itemO("ptcache.add_new", icon="ICON_ZOOMIN", text="") - col.itemO("ptcache.remove", icon="ICON_ZOOMOUT", text="") + col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="") + col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="") row = layout.row() row.itemL(text="File Name:") @@ -400,12 +400,12 @@ class PARTICLE_PT_physics(ParticleButtonsPanel): col = row.column() subrow = col.row() subcol = subrow.column(align=True) - subcol.itemO("particle.new_target", icon="ICON_ZOOMIN", text="") - subcol.itemO("particle.remove_target", icon="ICON_ZOOMOUT", text="") + subcol.itemO("particle.new_target", icon='ICON_ZOOMIN', text="") + subcol.itemO("particle.remove_target", icon='ICON_ZOOMOUT', text="") subrow = col.row() subcol = subrow.column(align=True) - subcol.itemO("particle.target_move_up", icon="VICON_MOVE_UP", text="") - subcol.itemO("particle.target_move_down", icon="VICON_MOVE_DOWN", text="") + subcol.itemO("particle.target_move_up", icon='VICON_MOVE_UP', text="") + subcol.itemO("particle.target_move_down", icon='VICON_MOVE_DOWN', text="") key = psys.active_particle_target if key: @@ -450,11 +450,11 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel): #row.template_list(boids, "states", boids, "active_boid_state_index", compact="True") #col = row.row() #subrow = col.row(align=True) - #subrow.itemO("boid.boidstate_add", icon="ICON_ZOOMIN", text="") - #subrow.itemO("boid.boidstate_del", icon="ICON_ZOOMOUT", text="") + #subrow.itemO("boid.boidstate_add", icon='ICON_ZOOMIN', text="") + #subrow.itemO("boid.boidstate_del", icon='ICON_ZOOMOUT', text="") #subrow = row.row(align=True) - #subrow.itemO("boid.boidstate_move_up", icon="VICON_MOVE_UP", text="") - #subrow.itemO("boid.boidstate_move_down", icon="VICON_MOVE_DOWN", text="") + #subrow.itemO("boid.boidstate_move_up", icon='VICON_MOVE_UP', text="") + #subrow.itemO("boid.boidstate_move_down", icon='VICON_MOVE_DOWN', text="") state = boids.active_boid_state @@ -473,12 +473,12 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel): col = row.column() subrow = col.row() subcol = subrow.column(align=True) - subcol.item_menu_enumO("boid.boidrule_add", "type", icon="ICON_ZOOMIN", text="") - subcol.itemO("boid.boidrule_del", icon="ICON_ZOOMOUT", text="") + subcol.item_menu_enumO("boid.boidrule_add", "type", icon='ICON_ZOOMIN', text="") + subcol.itemO("boid.boidrule_del", icon='ICON_ZOOMOUT', text="") subrow = col.row() subcol = subrow.column(align=True) - subcol.itemO("boid.boidrule_move_up", icon="VICON_MOVE_UP", text="") - subcol.itemO("boid.boidrule_move_down", icon="VICON_MOVE_DOWN", text="") + subcol.itemO("boid.boidrule_move_up", icon='VICON_MOVE_UP', text="") + subcol.itemO("boid.boidrule_move_down", icon='VICON_MOVE_DOWN', text="") rule = state.active_boid_rule @@ -486,8 +486,8 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel): row = layout.row() row.itemR(rule, "name", text="") #somebody make nice icons for boids here please! -jahka - row.itemR(rule, "in_air", icon="VICON_MOVE_UP", text="") - row.itemR(rule, "on_land", icon="VICON_MOVE_DOWN", text="") + row.itemR(rule, "in_air", icon='VICON_MOVE_UP', text="") + row.itemR(rule, "on_land", icon='VICON_MOVE_DOWN', text="") row = layout.row() diff --git a/release/ui/buttons_physics_cloth.py b/release/ui/buttons_physics_cloth.py index f34077c758a..6c499625685 100644 --- a/release/ui/buttons_physics_cloth.py +++ b/release/ui/buttons_physics_cloth.py @@ -2,8 +2,8 @@ import bpy class PhysicButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "physics" def poll(self, context): @@ -93,8 +93,8 @@ class PHYSICS_PT_cloth_cache(PhysicButtonsPanel): row = layout.row() row.template_list(cache, "point_cache_list", cache, "active_point_cache_index") col = row.column(align=True) - col.itemO("ptcache.add_new", icon="ICON_ZOOMIN", text="") - col.itemO("ptcache.remove", icon="ICON_ZOOMOUT", text="") + col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="") + col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="") row = layout.row() row.itemR(cache, "name") diff --git a/release/ui/buttons_physics_field.py b/release/ui/buttons_physics_field.py index fb29dd92833..3c68327ba79 100644 --- a/release/ui/buttons_physics_field.py +++ b/release/ui/buttons_physics_field.py @@ -2,8 +2,8 @@ import bpy class PhysicButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "physics" def poll(self, context): @@ -146,15 +146,15 @@ class PHYSICS_PT_field(PhysicButtonsPanel): sub.active = field.use_radial_max sub.itemR(field, "radial_maximum", text="Distance") - #if ob.type in "CURVE": - #if field.type == "GUIDE": + #if ob.type in 'CURVE': + #if field.type == 'GUIDE': #colsub = col.column(align=True) - #if field.type != "NONE": + #if field.type != 'NONE': #layout.itemR(field, "strength") - #if field.type in ("HARMONIC", "SPHERICAL", "CHARGE", "LENNARDj"): - #if ob.type in ("MESH", "SURFACE", "FONT", "CURVE"): + #if field.type in ('HARMONIC', 'SPHERICAL', 'CHARGE', "LENNARDj"): + #if ob.type in ('MESH', 'SURFACE', 'FONT', 'CURVE'): #layout.itemR(field, "surface") class PHYSICS_PT_collision(PhysicButtonsPanel): diff --git a/release/ui/buttons_physics_fluid.py b/release/ui/buttons_physics_fluid.py index 304d419b388..1d0a64c517a 100644 --- a/release/ui/buttons_physics_fluid.py +++ b/release/ui/buttons_physics_fluid.py @@ -2,8 +2,8 @@ import bpy class PhysicButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "physics" def poll(self, context): diff --git a/release/ui/buttons_physics_smoke.py b/release/ui/buttons_physics_smoke.py index d187e4c5901..5e1ec227080 100644 --- a/release/ui/buttons_physics_smoke.py +++ b/release/ui/buttons_physics_smoke.py @@ -7,8 +7,8 @@ def smoke_panel_enabled_low(smd): return True class PhysicButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "physics" def poll(self, context): @@ -144,8 +144,8 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel): row = layout.row() row.template_list(cache, "point_cache_list", cache, "active_point_cache_index") col = row.column(align=True) - col.itemO("ptcache.add_new", icon="ICON_ZOOMIN", text="") - col.itemO("ptcache.remove", icon="ICON_ZOOMOUT", text="") + col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="") + col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="") row = layout.row() row.itemR(cache, "name") @@ -239,8 +239,8 @@ class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel): row = layout.row() row.template_list(cache, "point_cache_list", cache, "active_point_cache_index") col = row.column(align=True) - col.itemO("ptcache.add_new", icon="ICON_ZOOMIN", text="") - col.itemO("ptcache.remove", icon="ICON_ZOOMOUT", text="") + col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="") + col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="") row = layout.row() row.itemR(cache, "name") diff --git a/release/ui/buttons_physics_softbody.py b/release/ui/buttons_physics_softbody.py index 2613f9e8032..35c0c498436 100644 --- a/release/ui/buttons_physics_softbody.py +++ b/release/ui/buttons_physics_softbody.py @@ -2,8 +2,8 @@ import bpy class PhysicButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "physics" def poll(self, context): @@ -68,8 +68,8 @@ class PHYSICS_PT_softbody_cache(PhysicButtonsPanel): row = layout.row() row.template_list(cache, "point_cache_list", cache, "active_point_cache_index") col = row.column(align=True) - col.itemO("ptcache.add_new", icon="ICON_ZOOMIN", text="") - col.itemO("ptcache.remove", icon="ICON_ZOOMOUT", text="") + col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="") + col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="") row = layout.row() row.itemR(cache, "name") diff --git a/release/ui/buttons_scene.py b/release/ui/buttons_scene.py index e9ee97468e8..08eee7ef43a 100644 --- a/release/ui/buttons_scene.py +++ b/release/ui/buttons_scene.py @@ -2,8 +2,8 @@ import bpy class RenderButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "scene" # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here @@ -41,8 +41,8 @@ class SCENE_PT_layers(RenderButtonsPanel): row.template_list(rd, "layers", rd, "active_layer_index", rows=2) col = row.column(align=True) - col.itemO("scene.render_layer_add", icon="ICON_ZOOMIN", text="") - col.itemO("scene.render_layer_remove", icon="ICON_ZOOMOUT", text="") + col.itemO("scene.render_layer_add", icon='ICON_ZOOMIN', text="") + col.itemO("scene.render_layer_remove", icon='ICON_ZOOMOUT', text="") rl = rd.layers[rd.active_layer_index] @@ -103,19 +103,19 @@ class SCENE_PT_layers(RenderButtonsPanel): col.itemR(rl, "pass_diffuse") row = col.row() row.itemR(rl, "pass_specular") - row.itemR(rl, "pass_specular_exclude", text="", icon="ICON_X") + row.itemR(rl, "pass_specular_exclude", text="", icon='ICON_X') row = col.row() row.itemR(rl, "pass_shadow") - row.itemR(rl, "pass_shadow_exclude", text="", icon="ICON_X") + row.itemR(rl, "pass_shadow_exclude", text="", icon='ICON_X') row = col.row() row.itemR(rl, "pass_ao") - row.itemR(rl, "pass_ao_exclude", text="", icon="ICON_X") + row.itemR(rl, "pass_ao_exclude", text="", icon='ICON_X') row = col.row() row.itemR(rl, "pass_reflection") - row.itemR(rl, "pass_reflection_exclude", text="", icon="ICON_X") + row.itemR(rl, "pass_reflection_exclude", text="", icon='ICON_X') row = col.row() row.itemR(rl, "pass_refraction") - row.itemR(rl, "pass_refraction_exclude", text="", icon="ICON_X") + row.itemR(rl, "pass_refraction_exclude", text="", icon='ICON_X') class SCENE_PT_shading(RenderButtonsPanel): __label__ = "Shading" diff --git a/release/ui/buttons_texture.py b/release/ui/buttons_texture.py index 29e43981fd2..20b3c7bca3e 100644 --- a/release/ui/buttons_texture.py +++ b/release/ui/buttons_texture.py @@ -2,8 +2,8 @@ import bpy class TextureButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "texture" def poll(self, context): diff --git a/release/ui/buttons_world.py b/release/ui/buttons_world.py index 599f45d160b..342adfaf4af 100644 --- a/release/ui/buttons_world.py +++ b/release/ui/buttons_world.py @@ -2,8 +2,8 @@ import bpy class WorldButtonsPanel(bpy.types.Panel): - __space_type__ = "PROPERTIES" - __region_type__ = "WINDOW" + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' __context__ = "world" # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here diff --git a/release/ui/space_buttons.py b/release/ui/space_buttons.py index 3cf782e615f..aa89c06ea08 100644 --- a/release/ui/space_buttons.py +++ b/release/ui/space_buttons.py @@ -2,7 +2,7 @@ import bpy class Buttons_HT_header(bpy.types.Header): - __space_type__ = "PROPERTIES" + __space_type__ = 'PROPERTIES' def draw(self, context): layout = self.layout @@ -22,7 +22,7 @@ class Buttons_HT_header(bpy.types.Header): row.itemR(scene, "current_frame") class Buttons_MT_view(bpy.types.Menu): - __space_type__ = "PROPERTIES" + __space_type__ = 'PROPERTIES' __label__ = "View" def draw(self, context): diff --git a/release/ui/space_console.py b/release/ui/space_console.py index 45cb2a856e1..f1038b5616a 100644 --- a/release/ui/space_console.py +++ b/release/ui/space_console.py @@ -5,7 +5,7 @@ import bpy_ops # XXX - should not need to do this del bpy_ops class CONSOLE_HT_header(bpy.types.Header): - __space_type__ = "CONSOLE" + __space_type__ = 'CONSOLE' def draw(self, context): sc = context.space_data @@ -39,7 +39,7 @@ class CONSOLE_HT_header(bpy.types.Header): row.itemO("console.report_replay") class CONSOLE_MT_console(bpy.types.Menu): - __space_type__ = "CONSOLE" + __space_type__ = 'CONSOLE' __label__ = "Console" def draw(self, context): @@ -52,7 +52,7 @@ class CONSOLE_MT_console(bpy.types.Menu): layout.itemO("console.paste") class CONSOLE_MT_report(bpy.types.Menu): - __space_type__ = "CONSOLE" + __space_type__ = 'CONSOLE' __label__ = "Report" def draw(self, context): diff --git a/release/ui/space_filebrowser.py b/release/ui/space_filebrowser.py index a37b89e8db4..f1ea5555787 100644 --- a/release/ui/space_filebrowser.py +++ b/release/ui/space_filebrowser.py @@ -2,7 +2,7 @@ import bpy class FILEBROWSER_HT_header(bpy.types.Header): - __space_type__ = "FILE_BROWSER" + __space_type__ = 'FILE_BROWSER' def draw(self, context): layout = self.layout diff --git a/release/ui/space_image.py b/release/ui/space_image.py index 888b46e060e..aa43b14b974 100644 --- a/release/ui/space_image.py +++ b/release/ui/space_image.py @@ -2,7 +2,7 @@ import bpy class IMAGE_MT_view(bpy.types.Menu): - __space_type__ = "IMAGE_EDITOR" + __space_type__ = 'IMAGE_EDITOR' __label__ = "View" def draw(self, context): @@ -13,7 +13,7 @@ class IMAGE_MT_view(bpy.types.Menu): show_uvedit = sima.show_uvedit - layout.itemO("image.properties", icon="ICON_MENU_PANEL") + layout.itemO("image.properties", icon='ICON_MENU_PANEL') layout.itemS() @@ -43,7 +43,7 @@ class IMAGE_MT_view(bpy.types.Menu): layout.itemO("screen.screen_full_area") class IMAGE_MT_select(bpy.types.Menu): - __space_type__ = "IMAGE_EDITOR" + __space_type__ = 'IMAGE_EDITOR' __label__ = "Select" def draw(self, context): @@ -64,7 +64,7 @@ class IMAGE_MT_select(bpy.types.Menu): layout.itemO("uv.select_linked") class IMAGE_MT_image(bpy.types.Menu): - __space_type__ = "IMAGE_EDITOR" + __space_type__ = 'IMAGE_EDITOR' __label__ = "Image" def draw(self, context): @@ -85,7 +85,7 @@ class IMAGE_MT_image(bpy.types.Menu): layout.itemO("image.save") layout.itemO("image.save_as") - if ima.source == "SEQUENCE": + if ima.source == 'SEQUENCE': layout.itemO("image.save_sequence") if not show_render: @@ -99,7 +99,7 @@ class IMAGE_MT_image(bpy.types.Menu): # only for dirty && specific image types, perhaps # this could be done in operator poll too if ima.dirty: - if ima.source in ("FILE", "GENERATED") and ima.type != "MULTILAYER": + if ima.source in ('FILE', 'GENERATED') and ima.type != 'MULTILAYER': layout.item_booleanO("image.pack", "as_png", True, text="Pack As PNG") layout.itemS() @@ -107,7 +107,7 @@ class IMAGE_MT_image(bpy.types.Menu): layout.itemR(sima, "image_painting") class IMAGE_MT_uvs_showhide(bpy.types.Menu): - __space_type__ = "IMAGE_EDITOR" + __space_type__ = 'IMAGE_EDITOR' __label__ = "Show/Hide Faces" def draw(self, context): @@ -118,7 +118,7 @@ class IMAGE_MT_uvs_showhide(bpy.types.Menu): layout.item_booleanO("uv.hide", "unselected", True) class IMAGE_MT_uvs_transform(bpy.types.Menu): - __space_type__ = "IMAGE_EDITOR" + __space_type__ = 'IMAGE_EDITOR' __label__ = "Transform" def draw(self, context): @@ -129,7 +129,7 @@ class IMAGE_MT_uvs_transform(bpy.types.Menu): layout.item_enumO("tfm.transform", "mode", 'RESIZE') class IMAGE_MT_uvs_mirror(bpy.types.Menu): - __space_type__ = "IMAGE_EDITOR" + __space_type__ = 'IMAGE_EDITOR' __label__ = "Mirror" def draw(self, context): @@ -139,7 +139,7 @@ class IMAGE_MT_uvs_mirror(bpy.types.Menu): layout.item_enumO("uv.mirror", "axis", 'MIRROR_Y') # "Y Axis", M, class IMAGE_MT_uvs_weldalign(bpy.types.Menu): - __space_type__ = "IMAGE_EDITOR" + __space_type__ = 'IMAGE_EDITOR' __label__ = "Weld/Align" def draw(self, context): @@ -150,7 +150,7 @@ class IMAGE_MT_uvs_weldalign(bpy.types.Menu): class IMAGE_MT_uvs(bpy.types.Menu): - __space_type__ = "IMAGE_EDITOR" + __space_type__ = 'IMAGE_EDITOR' __label__ = "UVs" def draw(self, context): @@ -192,7 +192,7 @@ class IMAGE_MT_uvs(bpy.types.Menu): layout.itemM("IMAGE_MT_uvs_showhide") class IMAGE_HT_header(bpy.types.Header): - __space_type__ = "IMAGE_EDITOR" + __space_type__ = 'IMAGE_EDITOR' def draw(self, context): sima = context.space_data @@ -262,17 +262,17 @@ class IMAGE_HT_header(bpy.types.Header): row.itemR(sima, "draw_channels", text="", expand=True) row = layout.row(align=True) - if ima.type == "COMPOSITE": - row.itemO("image.record_composite", icon="ICON_REC") - if ima.type == "COMPOSITE" and ima.source in ("MOVIE", "SEQUENCE"): - row.itemO("image.play_composite", icon="ICON_PLAY") + if ima.type == 'COMPOSITE': + row.itemO("image.record_composite", icon='ICON_REC') + if ima.type == 'COMPOSITE' and ima.source in ('MOVIE', 'SEQUENCE'): + row.itemO("image.play_composite", icon='ICON_PLAY') if show_uvedit or sima.image_painting: layout.itemR(sima, "update_automatically", text="") class IMAGE_PT_game_properties(bpy.types.Panel): - __space_type__ = "IMAGE_EDITOR" - __region_type__ = "UI" + __space_type__ = 'IMAGE_EDITOR' + __region_type__ = 'UI' __label__ = "Game Properties" def poll(self, context): @@ -315,8 +315,8 @@ class IMAGE_PT_game_properties(bpy.types.Panel): subrow.active = ima.tiles or ima.animated class IMAGE_PT_view_properties(bpy.types.Panel): - __space_type__ = "IMAGE_EDITOR" - __region_type__ = "UI" + __space_type__ = 'IMAGE_EDITOR' + __region_type__ = 'UI' __label__ = "View Properties" def poll(self, context): diff --git a/release/ui/space_info.py b/release/ui/space_info.py index 83eb2c75a2c..4188209e393 100644 --- a/release/ui/space_info.py +++ b/release/ui/space_info.py @@ -2,7 +2,7 @@ import bpy class INFO_HT_header(bpy.types.Header): - __space_type__ = "INFO" + __space_type__ = 'INFO' def draw(self, context): layout = self.layout @@ -38,7 +38,7 @@ class INFO_HT_header(bpy.types.Header): layout.itemL(text=scene.statistics()) class INFO_MT_file(bpy.types.Menu): - __space_type__ = "INFO" + __space_type__ = 'INFO' __label__ = "File" def draw(self, context): @@ -74,14 +74,14 @@ class INFO_MT_file(bpy.types.Menu): layout.itemO("wm.exit_blender", text="Quit") class INFO_MT_file_import(bpy.types.Menu): - __space_type__ = "INFO" + __space_type__ = 'INFO' __label__ = "Import" def draw(self, context): layout = self.layout class INFO_MT_file_export(bpy.types.Menu): - __space_type__ = "INFO" + __space_type__ = 'INFO' __label__ = "Export" def draw(self, context): @@ -90,7 +90,7 @@ class INFO_MT_file_export(bpy.types.Menu): layout.itemO("export.ply", text="PLY") class INFO_MT_file_external_data(bpy.types.Menu): - __space_type__ = "INFO" + __space_type__ = 'INFO' __label__ = "External Data" def draw(self, context): @@ -107,7 +107,7 @@ class INFO_MT_file_external_data(bpy.types.Menu): layout.itemO("file.find_missing_files") class INFO_MT_add(bpy.types.Menu): - __space_type__ = "INFO" + __space_type__ = 'INFO' __label__ = "Add" def draw(self, context): @@ -133,7 +133,7 @@ class INFO_MT_add(bpy.types.Menu): layout.item_enumO("object.object_add", "type", 'LAMP', icon='ICON_OUTLINER_OB_LAMP') class INFO_MT_game(bpy.types.Menu): - __space_type__ = "INFO" + __space_type__ = 'INFO' __label__ = "Game" def draw(self, context): @@ -151,7 +151,7 @@ class INFO_MT_game(bpy.types.Menu): layout.itemR(gs, "deprecation_warnings") class INFO_MT_render(bpy.types.Menu): - __space_type__ = "INFO" + __space_type__ = 'INFO' __label__ = "Render" def draw(self, context): @@ -167,7 +167,7 @@ class INFO_MT_render(bpy.types.Menu): layout.itemO("screen.render_view_show") class INFO_MT_help(bpy.types.Menu): - __space_type__ = "INFO" + __space_type__ = 'INFO' __label__ = "Help" def draw(self, context): diff --git a/release/ui/space_logic.py b/release/ui/space_logic.py index 728e5e6307b..68ddceb8534 100644 --- a/release/ui/space_logic.py +++ b/release/ui/space_logic.py @@ -1,8 +1,8 @@ import bpy class LOGIC_PT_properties(bpy.types.Panel): - __space_type__ = "LOGIC_EDITOR" - __region_type__ = "UI" + __space_type__ = 'LOGIC_EDITOR' + __region_type__ = 'UI' __label__ = "Properties" def poll(self, context): diff --git a/release/ui/space_node.py b/release/ui/space_node.py index fd5dd9e6ee7..875aca7fd82 100644 --- a/release/ui/space_node.py +++ b/release/ui/space_node.py @@ -2,7 +2,7 @@ import bpy class NODE_HT_header(bpy.types.Header): - __space_type__ = "NODE_EDITOR" + __space_type__ = 'NODE_EDITOR' def draw(self, context): layout = self.layout @@ -47,7 +47,7 @@ class NODE_HT_header(bpy.types.Header): layout.itemR(snode, "backdrop") class NODE_MT_view(bpy.types.Menu): - __space_type__ = "NODE_EDITOR" + __space_type__ = 'NODE_EDITOR' __label__ = "View" def draw(self, context): @@ -65,7 +65,7 @@ class NODE_MT_view(bpy.types.Menu): layout.itemO("screen.screen_full_area") class NODE_MT_select(bpy.types.Menu): - __space_type__ = "NODE_EDITOR" + __space_type__ = 'NODE_EDITOR' __label__ = "Select" def draw(self, context): @@ -80,7 +80,7 @@ class NODE_MT_select(bpy.types.Menu): # layout.itemO("node.select_linked_to") class NODE_MT_node(bpy.types.Menu): - __space_type__ = "NODE_EDITOR" + __space_type__ = 'NODE_EDITOR' __label__ = "Node" def draw(self, context): diff --git a/release/ui/space_outliner.py b/release/ui/space_outliner.py index f55f4633a7b..522b620e29d 100644 --- a/release/ui/space_outliner.py +++ b/release/ui/space_outliner.py @@ -2,7 +2,7 @@ import bpy class OUTLINER_HT_header(bpy.types.Header): - __space_type__ = "OUTLINER" + __space_type__ = 'OUTLINER' def draw(self, context): so = context.space_data @@ -36,7 +36,7 @@ class OUTLINER_HT_header(bpy.types.Header): class OUTLINER_MT_view(bpy.types.Menu): - __space_type__ = "OUTLINER" + __space_type__ = 'OUTLINER' __label__ = "View" def draw(self, context): diff --git a/release/ui/space_sequencer.py b/release/ui/space_sequencer.py index 1edcf32d3b5..1498c37d761 100644 --- a/release/ui/space_sequencer.py +++ b/release/ui/space_sequencer.py @@ -7,7 +7,7 @@ def act_strip(context): # Header class SEQUENCER_HT_header(bpy.types.Header): - __space_type__ = "SEQUENCE_EDITOR" + __space_type__ = 'SEQUENCE_EDITOR' def draw(self, context): layout = self.layout @@ -38,7 +38,7 @@ class SEQUENCER_HT_header(bpy.types.Header): layout.itemR(st, "display_channel", text="Channel") class SEQUENCER_MT_view(bpy.types.Menu): - __space_type__ = "SEQUENCE_EDITOR" + __space_type__ = 'SEQUENCE_EDITOR' __label__ = "View" def draw(self, context): @@ -106,7 +106,7 @@ class SEQUENCER_MT_view(bpy.types.Menu): """ class SEQUENCER_MT_select(bpy.types.Menu): - __space_type__ = "SEQUENCE_EDITOR" + __space_type__ = 'SEQUENCE_EDITOR' __label__ = "Select" def draw(self, context): @@ -127,7 +127,7 @@ class SEQUENCER_MT_select(bpy.types.Menu): layout.itemO("sequencer.select_inverse") class SEQUENCER_MT_marker(bpy.types.Menu): - __space_type__ = "SEQUENCE_EDITOR" + __space_type__ = 'SEQUENCE_EDITOR' __label__ = "Marker (TODO)" def draw(self, context): @@ -146,7 +146,7 @@ class SEQUENCER_MT_marker(bpy.types.Menu): #layout.itemO("sequencer.sound_strip_add", text="Transform Markers") # toggle, will be rna - (sseq->flag & SEQ_MARKER_TRANS) class SEQUENCER_MT_add(bpy.types.Menu): - __space_type__ = "SEQUENCE_EDITOR" + __space_type__ = 'SEQUENCE_EDITOR' __label__ = "Add" def draw(self, context): @@ -163,7 +163,7 @@ class SEQUENCER_MT_add(bpy.types.Menu): layout.itemM("SEQUENCER_MT_add_effect") class SEQUENCER_MT_add_effect(bpy.types.Menu): - __space_type__ = "SEQUENCE_EDITOR" + __space_type__ = 'SEQUENCE_EDITOR' __label__ = "Effect Strip..." def draw(self, context): @@ -187,7 +187,7 @@ class SEQUENCER_MT_add_effect(bpy.types.Menu): layout.item_enumO("sequencer.effect_strip_add", 'type', 'SPEED') class SEQUENCER_MT_strip(bpy.types.Menu): - __space_type__ = "SEQUENCE_EDITOR" + __space_type__ = 'SEQUENCE_EDITOR' __label__ = "Strip" def draw(self, context): @@ -254,15 +254,15 @@ class SEQUENCER_MT_strip(bpy.types.Menu): # Panels class SequencerButtonsPanel(bpy.types.Panel): - __space_type__ = "SEQUENCE_EDITOR" - __region_type__ = "UI" + __space_type__ = 'SEQUENCE_EDITOR' + __region_type__ = 'UI' def poll(self, context): return context.space_data.display_mode == 'SEQUENCER' and act_strip(context) != None class SequencerButtonsPanel_Output(bpy.types.Panel): - __space_type__ = "SEQUENCE_EDITOR" - __region_type__ = "UI" + __space_type__ = 'SEQUENCE_EDITOR' + __region_type__ = 'UI' def poll(self, context): return context.space_data.display_mode != 'SEQUENCER' diff --git a/release/ui/space_text.py b/release/ui/space_text.py index 61e8d3489a5..7b7ec176b72 100644 --- a/release/ui/space_text.py +++ b/release/ui/space_text.py @@ -2,7 +2,7 @@ import bpy class TEXT_HT_header(bpy.types.Header): - __space_type__ = "TEXT_EDITOR" + __space_type__ = 'TEXT_EDITOR' def draw(self, context): st = context.space_data @@ -45,8 +45,8 @@ class TEXT_HT_header(bpy.types.Header): row.itemL(text="Text: Internal") class TEXT_PT_properties(bpy.types.Panel): - __space_type__ = "TEXT_EDITOR" - __region_type__ = "UI" + __space_type__ = 'TEXT_EDITOR' + __region_type__ = 'UI' __label__ = "Properties" def draw(self, context): @@ -64,8 +64,8 @@ class TEXT_PT_properties(bpy.types.Panel): flow.itemR(st, "tab_width") class TEXT_PT_find(bpy.types.Panel): - __space_type__ = "TEXT_EDITOR" - __region_type__ = "UI" + __space_type__ = 'TEXT_EDITOR' + __region_type__ = 'UI' __label__ = "Find" def draw(self, context): @@ -95,7 +95,7 @@ class TEXT_PT_find(bpy.types.Panel): row.itemR(st, "find_all", text="All") class TEXT_MT_text(bpy.types.Menu): - __space_type__ = "TEXT_EDITOR" + __space_type__ = 'TEXT_EDITOR' __label__ = "Text" def draw(self, context): @@ -127,7 +127,7 @@ class TEXT_MT_text(bpy.types.Menu): layout.itemS() - layout.itemO("text.properties", icon="ICON_MENU_PANEL") + layout.itemO("text.properties", icon='ICON_MENU_PANEL') #ifndef DISABLE_PYTHON # XXX layout.column() @@ -136,7 +136,7 @@ class TEXT_MT_text(bpy.types.Menu): #endif class TEXT_MT_edit_view(bpy.types.Menu): - __space_type__ = "TEXT_EDITOR" + __space_type__ = 'TEXT_EDITOR' __label__ = "View" def draw(self, context): @@ -146,7 +146,7 @@ class TEXT_MT_edit_view(bpy.types.Menu): layout.item_enumO("text.move", "type", 'FILE_BOTTOM', text="Bottom of File") class TEXT_MT_edit_select(bpy.types.Menu): - __space_type__ = "TEXT_EDITOR" + __space_type__ = 'TEXT_EDITOR' __label__ = "Select" def draw(self, context): @@ -156,7 +156,7 @@ class TEXT_MT_edit_select(bpy.types.Menu): layout.itemO("text.select_line") class TEXT_MT_edit_markers(bpy.types.Menu): - __space_type__ = "TEXT_EDITOR" + __space_type__ = 'TEXT_EDITOR' __label__ = "Markers" def draw(self, context): @@ -167,7 +167,7 @@ class TEXT_MT_edit_markers(bpy.types.Menu): layout.itemO("text.previous_marker") class TEXT_MT_format(bpy.types.Menu): - __space_type__ = "TEXT_EDITOR" + __space_type__ = 'TEXT_EDITOR' __label__ = "Format" def draw(self, context): @@ -186,7 +186,7 @@ class TEXT_MT_format(bpy.types.Menu): layout.item_menu_enumO("text.convert_whitespace", "type") class TEXT_MT_edit_to3d(bpy.types.Menu): - __space_type__ = "TEXT_EDITOR" + __space_type__ = 'TEXT_EDITOR' __label__ = "Text To 3D Object" def draw(self, context): @@ -196,7 +196,7 @@ class TEXT_MT_edit_to3d(bpy.types.Menu): layout.item_booleanO("text.to_3d_object", "split_lines", True, text="One Object Per Line"); class TEXT_MT_edit(bpy.types.Menu): - __space_type__ = "TEXT_EDITOR" + __space_type__ = 'TEXT_EDITOR' __label__ = "Edit" def poll(self, context): diff --git a/release/ui/space_time.py b/release/ui/space_time.py index 17deb4c550f..bfa4d5b6485 100644 --- a/release/ui/space_time.py +++ b/release/ui/space_time.py @@ -2,7 +2,7 @@ import bpy class TIME_HT_header(bpy.types.Header): - __space_type__ = "TIMELINE" + __space_type__ = 'TIMELINE' def draw(self, context): layout = self.layout @@ -64,11 +64,11 @@ class TIME_HT_header(bpy.types.Header): row = layout.row(align=True) row.item_pointerR(scene, "active_keying_set", scene, "keying_sets", text="") - row.itemO("anim.insert_keyframe", text="", icon="ICON_KEY_HLT") - row.itemO("anim.delete_keyframe", text="", icon="ICON_KEY_DEHLT") + row.itemO("anim.insert_keyframe", text="", icon='ICON_KEY_HLT') + row.itemO("anim.delete_keyframe", text="", icon='ICON_KEY_DEHLT') class TIME_MT_view(bpy.types.Menu): - __space_type__ = "TIMELINE" + __space_type__ = 'TIMELINE' __label__ = "View" def draw(self, context): @@ -83,7 +83,7 @@ class TIME_MT_view(bpy.types.Menu): layout.itemR(st, "only_selected") class TIME_MT_frame(bpy.types.Menu): - __space_type__ = "TIMELINE" + __space_type__ = 'TIMELINE' __label__ = "Frame" def draw(self, context): @@ -101,7 +101,7 @@ class TIME_MT_frame(bpy.types.Menu): layout.itemO("time.end_frame_set") class TIME_MT_playback(bpy.types.Menu): - __space_type__ = "TIMELINE" + __space_type__ = 'TIMELINE' __label__ = "Playback" def draw(self, context): diff --git a/release/ui/space_userpref.py b/release/ui/space_userpref.py index bd963c65cd0..acd3d3eb44b 100644 --- a/release/ui/space_userpref.py +++ b/release/ui/space_userpref.py @@ -2,21 +2,21 @@ import bpy class USERPREF_HT_header(bpy.types.Header): - __space_type__ = "USER_PREFERENCES" + __space_type__ = 'USER_PREFERENCES' def draw(self, context): layout = self.layout layout.template_header(menus=False) class USERPREF_MT_view(bpy.types.Menu): - __space_type__ = "USER_PREFERENCES" + __space_type__ = 'USER_PREFERENCES' __label__ = "View" def draw(self, context): layout = self.layout class USERPREF_PT_tabs(bpy.types.Panel): - __space_type__ = "USER_PREFERENCES" + __space_type__ = 'USER_PREFERENCES' __show_header__ = False def draw(self, context): @@ -27,7 +27,7 @@ class USERPREF_PT_tabs(bpy.types.Panel): layout.itemR(userpref, "active_section", expand=True) class USERPREF_PT_view(bpy.types.Panel): - __space_type__ = "USER_PREFERENCES" + __space_type__ = 'USER_PREFERENCES' __label__ = "View" __show_header__ = False @@ -130,7 +130,7 @@ class USERPREF_PT_view(bpy.types.Panel): sub1.itemR(view, "open_right_mouse_delay", text="Hold RMB") class USERPREF_PT_edit(bpy.types.Panel): - __space_type__ = "USER_PREFERENCES" + __space_type__ = 'USER_PREFERENCES' __label__ = "Edit" __show_header__ = False @@ -227,7 +227,7 @@ class USERPREF_PT_edit(bpy.types.Panel): sub1.itemR(edit, "duplicate_action", text="Action") class USERPREF_PT_system(bpy.types.Panel): - __space_type__ = "USER_PREFERENCES" + __space_type__ = 'USER_PREFERENCES' __label__ = "System" __show_header__ = False @@ -308,7 +308,7 @@ class USERPREF_PT_system(bpy.types.Panel): sub1.itemR(system, "texture_collection_rate", text="Collection Rate") class USERPREF_PT_filepaths(bpy.types.Panel): - __space_type__ = "USER_PREFERENCES" + __space_type__ = 'USER_PREFERENCES' __label__ = "File Paths" __show_header__ = False @@ -370,7 +370,7 @@ class USERPREF_PT_filepaths(bpy.types.Panel): sub3.itemR(paths, "auto_save_time") class USERPREF_PT_language(bpy.types.Panel): - __space_type__ = "USER_PREFERENCES" + __space_type__ = 'USER_PREFERENCES' __label__ = "Language" __show_header__ = False @@ -394,7 +394,7 @@ class USERPREF_PT_language(bpy.types.Panel): col.itemR(lan, "use_textured_fonts") class USERPREF_PT_bottombar(bpy.types.Panel): - __space_type__ = "USER_PREFERENCES" + __space_type__ = 'USER_PREFERENCES' __label__ = " " __show_header__ = False diff --git a/release/ui/space_view3d.py b/release/ui/space_view3d.py index f9e185f44f2..8f37b34e3b4 100644 --- a/release/ui/space_view3d.py +++ b/release/ui/space_view3d.py @@ -4,7 +4,7 @@ import bpy # ********** Header ********** class VIEW3D_HT_header(bpy.types.Header): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' def draw(self, context): layout = self.layout @@ -47,14 +47,14 @@ class VIEW3D_HT_header(bpy.types.Header): # ********** View menus ********** class VIEW3D_MT_view(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "View" def draw(self, context): layout = self.layout - layout.itemO("view3d.properties", icon="ICON_MENU_PANEL") - layout.itemO("view3d.toolbar", icon="ICON_MENU_PANEL") + layout.itemO("view3d.properties", icon='ICON_MENU_PANEL') + layout.itemO("view3d.toolbar", icon='ICON_MENU_PANEL') layout.itemS() @@ -101,7 +101,7 @@ class VIEW3D_MT_view(bpy.types.Menu): layout.itemO("screen.screen_full_area", text="Toggle Full Screen") class VIEW3D_MT_view_navigation(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Navigation" def draw(self, context): @@ -124,7 +124,7 @@ class VIEW3D_MT_view_navigation(bpy.types.Menu): # ********** Select menus, suffix from context.mode ********** class VIEW3D_MT_select_OBJECT(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Select" def draw(self, context): @@ -142,7 +142,7 @@ class VIEW3D_MT_select_OBJECT(bpy.types.Menu): layout.itemO("object.select_grouped", text="Select Grouped") class VIEW3D_MT_select_POSE(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Select" def draw(self, context): @@ -172,7 +172,7 @@ class VIEW3D_MT_select_POSE(bpy.types.Menu): props.direction = 'CHILD' class VIEW3D_MT_select_PARTICLE(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Select" def draw(self, context): @@ -194,7 +194,7 @@ class VIEW3D_MT_select_PARTICLE(bpy.types.Menu): layout.itemO("particle.select_less") class VIEW3D_MT_select_EDIT_MESH(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Select" def draw(self, context): @@ -238,7 +238,7 @@ class VIEW3D_MT_select_EDIT_MESH(bpy.types.Menu): layout.itemO("mesh.region_to_loop") class VIEW3D_MT_select_EDIT_CURVE(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Select" def draw(self, context): @@ -267,7 +267,7 @@ class VIEW3D_MT_select_EDIT_CURVE(bpy.types.Menu): layout.itemO("curve.select_less") class VIEW3D_MT_select_EDIT_SURFACE(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Select" def draw(self, context): @@ -293,7 +293,7 @@ class VIEW3D_MT_select_EDIT_SURFACE(bpy.types.Menu): layout.itemO("curve.select_less") class VIEW3D_MT_select_EDIT_METABALL(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Select" def draw(self, context): @@ -311,7 +311,7 @@ class VIEW3D_MT_select_EDIT_METABALL(bpy.types.Menu): layout.itemL(text="Random") class VIEW3D_MT_select_EDIT_LATTICE(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Select" def draw(self, context): @@ -324,7 +324,7 @@ class VIEW3D_MT_select_EDIT_LATTICE(bpy.types.Menu): layout.itemO("lattice.select_all_toggle", text="Select/Deselect All") class VIEW3D_MT_select_EDIT_ARMATURE(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Select" def draw(self, context): @@ -353,7 +353,7 @@ class VIEW3D_MT_select_EDIT_ARMATURE(bpy.types.Menu): props.direction = 'CHILD' class VIEW3D_MT_select_FACE(bpy.types.Menu):# XXX no matching enum - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Select" def draw(self, context): @@ -364,7 +364,7 @@ class VIEW3D_MT_select_FACE(bpy.types.Menu):# XXX no matching enum # ********** Object menu ********** class VIEW3D_MT_object(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __context__ = "objectmode" __label__ = "Object" @@ -402,7 +402,7 @@ class VIEW3D_MT_object(bpy.types.Menu): layout.itemM("VIEW3D_MT_object_show") class VIEW3D_MT_object_clear(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Clear" def draw(self, context): @@ -414,7 +414,7 @@ class VIEW3D_MT_object_clear(bpy.types.Menu): layout.itemO("object.origin_clear") class VIEW3D_MT_object_snap(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Snap" def draw(self, context): @@ -431,7 +431,7 @@ class VIEW3D_MT_object_snap(bpy.types.Menu): layout.itemO("view3d.snap_cursor_to_active") class VIEW3D_MT_object_parent(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Parent" def draw(self, context): @@ -441,7 +441,7 @@ class VIEW3D_MT_object_parent(bpy.types.Menu): layout.itemO("object.parent_clear") class VIEW3D_MT_object_track(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Track" def draw(self, context): @@ -451,7 +451,7 @@ class VIEW3D_MT_object_track(bpy.types.Menu): layout.itemO("object.track_clear") class VIEW3D_MT_object_group(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Group" def draw(self, context): @@ -466,7 +466,7 @@ class VIEW3D_MT_object_group(bpy.types.Menu): layout.itemO("group.objects_remove_active") class VIEW3D_MT_object_constraints(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Constraints" def draw(self, context): @@ -476,7 +476,7 @@ class VIEW3D_MT_object_constraints(bpy.types.Menu): layout.itemO("object.constraints_clear") class VIEW3D_MT_object_show(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Show/Hide" def draw(self, context): @@ -489,7 +489,7 @@ class VIEW3D_MT_object_show(bpy.types.Menu): # ********** Vertex paint menu ********** class VIEW3D_MT_vertex_paint(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Paint" def draw(self, context): @@ -504,7 +504,7 @@ class VIEW3D_MT_vertex_paint(bpy.types.Menu): # ********** Sculpt menu ********** class VIEW3D_MT_sculpt(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Sculpt" def draw(self, context): @@ -540,7 +540,7 @@ class VIEW3D_MT_sculpt(bpy.types.Menu): # ********** Edit Menus, suffix from ob.type ********** class VIEW3D_MT_edit_snap(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Snap" def draw(self, context): @@ -558,7 +558,7 @@ class VIEW3D_MT_edit_snap(bpy.types.Menu): # Edit MESH class VIEW3D_MT_edit_MESH(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Mesh" def draw(self, context): @@ -601,7 +601,7 @@ class VIEW3D_MT_edit_MESH(bpy.types.Menu): layout.itemM("VIEW3D_MT_edit_MESH_showhide") class VIEW3D_MT_edit_MESH_vertices(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Vertices" def draw(self, context): @@ -618,7 +618,7 @@ class VIEW3D_MT_edit_MESH_vertices(bpy.types.Menu): layout.itemO("mesh.remove_doubles") class VIEW3D_MT_edit_MESH_edges(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Edges" def draw(self, context): @@ -644,7 +644,7 @@ class VIEW3D_MT_edit_MESH_edges(bpy.types.Menu): layout.item_enumO("mesh.edge_rotate", "direction", 'CCW', text="Rotate Edge CCW") class VIEW3D_MT_edit_MESH_faces(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Faces" def draw(self, context): @@ -666,7 +666,7 @@ class VIEW3D_MT_edit_MESH_faces(bpy.types.Menu): layout.itemO("mesh.faces_shade_flat") class VIEW3D_MT_edit_MESH_normals(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Normals" def draw(self, context): @@ -680,7 +680,7 @@ class VIEW3D_MT_edit_MESH_normals(bpy.types.Menu): layout.itemO("mesh.flip_normals") class VIEW3D_MT_edit_MESH_showhide(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Show/Hide" def draw(self, context): @@ -724,13 +724,13 @@ def draw_CURVE(self, context): layout.itemM("VIEW3D_MT_edit_CURVE_showhide") class VIEW3D_MT_edit_CURVE(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Curve" draw = draw_CURVE class VIEW3D_MT_edit_CURVE_ctrlpoints(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Control Points" def draw(self, context): @@ -748,7 +748,7 @@ class VIEW3D_MT_edit_CURVE_ctrlpoints(bpy.types.Menu): layout.item_menu_enumO("curve.handle_type_set", "type") class VIEW3D_MT_edit_CURVE_segments(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Segments" def draw(self, context): @@ -758,7 +758,7 @@ class VIEW3D_MT_edit_CURVE_segments(bpy.types.Menu): layout.itemO("curve.switch_direction") class VIEW3D_MT_edit_CURVE_showhide(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Show/Hide" def draw(self, context): @@ -770,14 +770,14 @@ class VIEW3D_MT_edit_CURVE_showhide(bpy.types.Menu): # Edit SURFACE class VIEW3D_MT_edit_SURFACE(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Surface" draw = draw_CURVE # Edit TEXT class VIEW3D_MT_edit_TEXT(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Text" def draw(self, context): @@ -790,7 +790,7 @@ class VIEW3D_MT_edit_TEXT(bpy.types.Menu): layout.itemM("VIEW3D_MT_edit_TEXT_chars") class VIEW3D_MT_edit_TEXT_chars(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Special Characters" def draw(self, context): @@ -825,7 +825,7 @@ class VIEW3D_MT_edit_TEXT_chars(bpy.types.Menu): # Edit META class VIEW3D_MT_edit_META(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Metaball" def draw(self, context): @@ -855,7 +855,7 @@ class VIEW3D_MT_edit_META(bpy.types.Menu): layout.itemM("VIEW3D_MT_edit_META_showhide") class VIEW3D_MT_edit_META_showhide(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Show/Hide" def draw(self, context): @@ -867,7 +867,7 @@ class VIEW3D_MT_edit_META_showhide(bpy.types.Menu): # Edit LATTICE class VIEW3D_MT_edit_LATTICE(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Lattice" def draw(self, context): @@ -888,7 +888,7 @@ class VIEW3D_MT_edit_LATTICE(bpy.types.Menu): # Edit ARMATURE class VIEW3D_MT_edit_ARMATURE(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Armature" def draw(self, context): @@ -944,7 +944,7 @@ class VIEW3D_MT_edit_ARMATURE(bpy.types.Menu): layout.item_menu_enumO("armature.flags_set", "mode", text="Bone Settings") class VIEW3D_MT_edit_ARMATURE_parent(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Parent" def draw(self, context): @@ -954,7 +954,7 @@ class VIEW3D_MT_edit_ARMATURE_parent(bpy.types.Menu): layout.itemO("armature.parent_clear") class VIEW3D_MT_edit_ARMATURE_roll(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Bone Roll" def draw(self, context): @@ -970,8 +970,8 @@ class VIEW3D_MT_edit_ARMATURE_roll(bpy.types.Menu): # ********** Panel ********** class VIEW3D_PT_3dview_properties(bpy.types.Panel): - __space_type__ = "VIEW_3D" - __region_type__ = "UI" + __space_type__ = 'VIEW_3D' + __region_type__ = 'UI' __label__ = "View" def poll(self, context): @@ -1002,8 +1002,8 @@ class VIEW3D_PT_3dview_properties(bpy.types.Panel): layout.column().itemR(scene, "cursor_location", text="3D Cursor:") class VIEW3D_PT_3dview_display(bpy.types.Panel): - __space_type__ = "VIEW_3D" - __region_type__ = "UI" + __space_type__ = 'VIEW_3D' + __region_type__ = 'UI' __label__ = "Display" def poll(self, context): @@ -1034,8 +1034,8 @@ class VIEW3D_PT_3dview_display(bpy.types.Panel): col.itemR(view, "box_clip") class VIEW3D_PT_background_image(bpy.types.Panel): - __space_type__ = "VIEW_3D" - __region_type__ = "UI" + __space_type__ = 'VIEW_3D' + __region_type__ = 'UI' __label__ = "Background Image" __default_closed__ = True diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py index 254fb3fd560..bbca43279a7 100644 --- a/release/ui/space_view3d_toolbar.py +++ b/release/ui/space_view3d_toolbar.py @@ -2,8 +2,8 @@ import bpy class View3DPanel(bpy.types.Panel): - __space_type__ = "VIEW_3D" - __region_type__ = "TOOLS" + __space_type__ = 'VIEW_3D' + __region_type__ = 'TOOLS' # ********** default tools for objectmode **************** @@ -262,8 +262,8 @@ class VIEW3D_PT_tools_posemode(View3DPanel): # ********** default tools for paint modes **************** class PaintPanel(bpy.types.Panel): - __space_type__ = "VIEW_3D" - __region_type__ = "TOOLS" + __space_type__ = 'VIEW_3D' + __region_type__ = 'TOOLS' def paint_settings(self, context): ts = context.tool_settings From 2aa2512a43781f6ac8937c152398e9de731aef07 Mon Sep 17 00:00:00 2001 From: William Reynish Date: Sat, 22 Aug 2009 09:21:08 +0000 Subject: [PATCH 204/577] Tiny User Prefs tweaks. Also put the Save As Default button in header so it stays put. --- release/ui/space_userpref.py | 40 +++++++++++++++++------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/release/ui/space_userpref.py b/release/ui/space_userpref.py index acd3d3eb44b..82ed857c7ea 100644 --- a/release/ui/space_userpref.py +++ b/release/ui/space_userpref.py @@ -7,6 +7,11 @@ class USERPREF_HT_header(bpy.types.Header): def draw(self, context): layout = self.layout layout.template_header(menus=False) + + userpref = context.user_preferences + + layout.operator_context = "EXEC_AREA" + layout.itemO("wm.save_homefile", text="Save As Default") class USERPREF_MT_view(bpy.types.Menu): __space_type__ = 'USER_PREFERENCES' @@ -59,11 +64,11 @@ class USERPREF_PT_view(bpy.types.Panel): sub1.itemS() sub1.itemS() sub1.itemS() - sub1.itemR(view, "show_mini_axis") + sub1.itemR(view, "show_mini_axis", text="Display Mini Axis") sub2 = sub1.column() sub2.enabled = view.show_mini_axis - sub2.itemR(view, "mini_axis_size") - sub2.itemR(view, "mini_axis_brightness") + sub2.itemR(view, "mini_axis_size", text="Size") + sub2.itemR(view, "mini_axis_brightness", text="Brightness") col = split.column() sub = col.split(percentage=0.85) @@ -360,6 +365,8 @@ class USERPREF_PT_filepaths(bpy.types.Panel): sub2.itemR(paths, "use_relative_paths") sub2.itemR(paths, "compress_file") sub2.itemR(paths, "load_ui") + sub2.itemS() + sub2.itemS() sub2.itemL(text="Auto Save:") sub2.itemR(paths, "save_version") sub2.itemR(paths, "recent_files") @@ -367,7 +374,7 @@ class USERPREF_PT_filepaths(bpy.types.Panel): sub2.itemR(paths, "auto_save_temporary_files") sub3 = sub2.column() sub3.enabled = paths.auto_save_temporary_files - sub3.itemR(paths, "auto_save_time") + sub3.itemR(paths, "auto_save_time", text="Timer (mins)") class USERPREF_PT_language(bpy.types.Panel): __space_type__ = 'USER_PREFERENCES' @@ -388,24 +395,16 @@ class USERPREF_PT_language(bpy.types.Panel): col = split.column() col.itemR(lan, "language") - col.itemR(lan, "translate_tooltips") - col.itemR(lan, "translate_buttons") - col.itemR(lan, "translate_toolbox") + col.itemL(text="Translate:") + col.itemR(lan, "translate_tooltips", text="Tooltips") + col.itemR(lan, "translate_buttons", text="Labels") + col.itemR(lan, "translate_toolbox", text="Toolbox") + col.itemS() + col.itemS() col.itemR(lan, "use_textured_fonts") -class USERPREF_PT_bottombar(bpy.types.Panel): - __space_type__ = 'USER_PREFERENCES' - __label__ = " " - __show_header__ = False - - def draw(self, context): - layout = self.layout - userpref = context.user_preferences - - split = layout.split(percentage=0.8) - split.itemL(text="") - layout.operator_context = "EXEC_AREA" - split.itemO("wm.save_homefile", text="Save As Default") + col = split.column() + bpy.types.register(USERPREF_HT_header) bpy.types.register(USERPREF_MT_view) @@ -415,5 +414,4 @@ bpy.types.register(USERPREF_PT_edit) bpy.types.register(USERPREF_PT_system) bpy.types.register(USERPREF_PT_filepaths) bpy.types.register(USERPREF_PT_language) -bpy.types.register(USERPREF_PT_bottombar) From a4f3f5c23c4201bc885310aa17226d2ee3922a2a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 22 Aug 2009 10:51:21 +0000 Subject: [PATCH 205/577] - BGE, Some sensors, stored the event manager in 2 places (became confusing to do changes in this area) - Change compiler warnings for linux/scons/C++ --- config/linux2-config.py | 3 +- .../GameLogic/SCA_JoystickSensor.cpp | 33 +++++++++---------- .../gameengine/GameLogic/SCA_JoystickSensor.h | 1 - .../gameengine/GameLogic/SCA_MouseSensor.cpp | 5 ++- source/gameengine/GameLogic/SCA_MouseSensor.h | 1 - .../KXNetwork/KX_NetworkMessageSensor.cpp | 1 - .../KXNetwork/KX_NetworkMessageSensor.h | 1 - source/gameengine/Ketsji/KX_TouchSensor.cpp | 3 +- source/gameengine/Ketsji/KX_TouchSensor.h | 1 - 9 files changed, 21 insertions(+), 28 deletions(-) diff --git a/config/linux2-config.py b/config/linux2-config.py index b0ff0b89d3d..3e84070fabb 100644 --- a/config/linux2-config.py +++ b/config/linux2-config.py @@ -190,8 +190,9 @@ REL_CCFLAGS = ['-O2'] ##ARFLAGSQUIET = ru ## C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement'] - CC_WARN = ['-Wall'] +CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare'] + ##FIX_STUBS_WARNINGS = -Wno-unused diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp index 336529667d7..81aa3020f49 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp @@ -49,7 +49,6 @@ SCA_JoystickSensor::SCA_JoystickSensor(class SCA_JoystickManager* eventmgr, int hat, int hatf, bool allevents, PyTypeObject* T ) :SCA_ISensor(gameobj,eventmgr,T), - m_pJoystickMgr(eventmgr), m_axis(axis), m_axisf(axisf), m_button(button), @@ -104,7 +103,7 @@ bool SCA_JoystickSensor::IsPositiveTrigger() bool SCA_JoystickSensor::Evaluate() { - SCA_Joystick *js = m_pJoystickMgr->GetJoystickDevice(m_joyindex); + SCA_Joystick *js = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex); bool result = false; bool reset = m_reset && m_level; @@ -404,7 +403,7 @@ const char SCA_JoystickSensor::GetAxisValue_doc[] = "\tReturns a list of the values for the current state of each axis.\n"; PyObject* SCA_JoystickSensor::PyGetAxisValue( ) { ShowDeprecationWarning("getAxisValue()", "the axisPosition property"); - SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex); + SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex); int axis_index= joy->GetNumberOfAxes(); PyObject *list= PyList_New(axis_index); @@ -479,7 +478,7 @@ const char SCA_JoystickSensor::GetButtonActiveList_doc[] = "getButtonActiveList\n" "\tReturns a list containing the indicies of the button currently pressed.\n"; PyObject* SCA_JoystickSensor::PyGetButtonActiveList( ) { - SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex); + SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex); PyObject *ls = PyList_New(0); PyObject *value; int i; @@ -501,7 +500,7 @@ const char SCA_JoystickSensor::GetButtonStatus_doc[] = "getButtonStatus(buttonIndex)\n" "\tReturns a bool of the current pressed state of the specified button.\n"; PyObject* SCA_JoystickSensor::PyGetButtonStatus( PyObject* args ) { - SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex); + SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex); int index; if(!PyArg_ParseTuple(args, "i:getButtonStatus", &index)){ @@ -547,7 +546,7 @@ const char SCA_JoystickSensor::NumberOfAxes_doc[] = "\tReturns the number of axes .\n"; PyObject* SCA_JoystickSensor::PyNumberOfAxes( ) { ShowDeprecationWarning("getNumAxes()", "the numAxis property"); - SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex); + SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex); // when the joystick is null their is 0 exis still. dumb but scripters should use isConnected() return PyInt_FromLong( joy ? joy->GetNumberOfAxes() : 0 ); } @@ -558,7 +557,7 @@ const char SCA_JoystickSensor::NumberOfButtons_doc[] = "\tReturns the number of buttons .\n"; PyObject* SCA_JoystickSensor::PyNumberOfButtons( ) { ShowDeprecationWarning("getNumButtons()", "the numButtons property"); - SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex); + SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex); return PyInt_FromLong( joy ? joy->GetNumberOfButtons() : 0 ); } @@ -568,7 +567,7 @@ const char SCA_JoystickSensor::NumberOfHats_doc[] = "\tReturns the number of hats .\n"; PyObject* SCA_JoystickSensor::PyNumberOfHats( ) { ShowDeprecationWarning("getNumHats()", "the numHats property"); - SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex); + SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex); return PyInt_FromLong( joy ? joy->GetNumberOfHats() : 0 ); } @@ -577,7 +576,7 @@ const char SCA_JoystickSensor::Connected_doc[] = "\tReturns True if a joystick is connected at this joysticks index.\n"; PyObject* SCA_JoystickSensor::PyConnected( ) { ShowDeprecationWarning("getConnected()", "the connected property"); - SCA_Joystick *joy = m_pJoystickMgr->GetJoystickDevice(m_joyindex); + SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex); return PyBool_FromLong( joy ? joy->Connected() : 0 ); } @@ -585,7 +584,7 @@ PyObject* SCA_JoystickSensor::PyConnected( ) { PyObject* SCA_JoystickSensor::pyattr_get_axis_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_JoystickSensor* self= static_cast(self_v); - SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex); + SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); int axis_index= joy->GetNumberOfAxes(); PyObject *list= PyList_New(axis_index); @@ -600,7 +599,7 @@ PyObject* SCA_JoystickSensor::pyattr_get_axis_values(void *self_v, const KX_PYAT PyObject* SCA_JoystickSensor::pyattr_get_axis_single(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_JoystickSensor* self= static_cast(self_v); - SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex); + SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); if(self->m_joymode != KX_JOYSENSORMODE_AXIS_SINGLE) { PyErr_SetString(PyExc_TypeError, "val = sensor.axisSingle: Joystick Sensor, not 'Single Axis' type"); @@ -613,7 +612,7 @@ PyObject* SCA_JoystickSensor::pyattr_get_axis_single(void *self_v, const KX_PYAT PyObject* SCA_JoystickSensor::pyattr_get_hat_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_JoystickSensor* self= static_cast(self_v); - SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex); + SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); int hat_index= joy->GetNumberOfHats(); PyObject *list= PyList_New(hat_index); @@ -628,7 +627,7 @@ PyObject* SCA_JoystickSensor::pyattr_get_hat_values(void *self_v, const KX_PYATT PyObject* SCA_JoystickSensor::pyattr_get_hat_single(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_JoystickSensor* self= static_cast(self_v); - SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex); + SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); return PyInt_FromLong(joy->GetHat(self->m_hat-1)); } @@ -636,27 +635,27 @@ PyObject* SCA_JoystickSensor::pyattr_get_hat_single(void *self_v, const KX_PYATT PyObject* SCA_JoystickSensor::pyattr_get_num_axis(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_JoystickSensor* self= static_cast(self_v); - SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex); + SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); return PyInt_FromLong( joy ? joy->GetNumberOfAxes() : 0 ); } PyObject* SCA_JoystickSensor::pyattr_get_num_buttons(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_JoystickSensor* self= static_cast(self_v); - SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex); + SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); return PyInt_FromLong( joy ? joy->GetNumberOfButtons() : 0 ); } PyObject* SCA_JoystickSensor::pyattr_get_num_hats(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_JoystickSensor* self= static_cast(self_v); - SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex); + SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); return PyInt_FromLong( joy ? joy->GetNumberOfHats() : 0 ); } PyObject* SCA_JoystickSensor::pyattr_get_connected(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_JoystickSensor* self= static_cast(self_v); - SCA_Joystick *joy = self->m_pJoystickMgr->GetJoystickDevice(self->m_joyindex); + SCA_Joystick *joy = ((SCA_JoystickManager *)self->m_eventmgr)->GetJoystickDevice(self->m_joyindex); return PyBool_FromLong( joy ? joy->Connected() : 0 ); } diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.h b/source/gameengine/GameLogic/SCA_JoystickSensor.h index e6a1d2eef32..f5ff25c73dc 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.h +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.h @@ -35,7 +35,6 @@ class SCA_JoystickSensor :public SCA_ISensor { Py_Header; - class SCA_JoystickManager* m_pJoystickMgr; /** * Axis 1-JOYAXIS_MAX, MUST be followed by m_axisf diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.cpp b/source/gameengine/GameLogic/SCA_MouseSensor.cpp index c5e1c3c0441..1a0a3939d54 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.cpp +++ b/source/gameengine/GameLogic/SCA_MouseSensor.cpp @@ -52,7 +52,6 @@ SCA_MouseSensor::SCA_MouseSensor(SCA_MouseManager* eventmgr, SCA_IObject* gameobj, PyTypeObject* T) : SCA_ISensor(gameobj,eventmgr, T), - m_pMouseMgr(eventmgr), m_x(startx), m_y(starty) { @@ -148,7 +147,7 @@ bool SCA_MouseSensor::Evaluate() { bool result = false; bool reset = m_reset && m_level; - SCA_IInputDevice* mousedev = m_pMouseMgr->GetInputDevice(); + SCA_IInputDevice* mousedev = ((SCA_MouseManager *)m_eventmgr)->GetInputDevice(); m_reset = false; switch (m_mousemode) { @@ -283,7 +282,7 @@ KX_PYMETHODDEF_DOC_O(SCA_MouseSensor, getButtonStatus, return NULL; } - SCA_IInputDevice* mousedev = m_pMouseMgr->GetInputDevice(); + SCA_IInputDevice* mousedev = ((SCA_MouseManager *)m_eventmgr)->GetInputDevice(); const SCA_InputEvent& event = mousedev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) button); return PyInt_FromLong(event.m_status); } diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.h b/source/gameengine/GameLogic/SCA_MouseSensor.h index 6d6302b514a..14d3ace5408 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.h +++ b/source/gameengine/GameLogic/SCA_MouseSensor.h @@ -39,7 +39,6 @@ class SCA_MouseSensor : public SCA_ISensor { Py_Header; - class SCA_MouseManager* m_pMouseMgr; /** * Use SCA_IInputDevice values to encode the mouse mode for now. diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp index 8ddcd87b66f..014670dd76d 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp @@ -54,7 +54,6 @@ KX_NetworkMessageSensor::KX_NetworkMessageSensor( PyTypeObject* T ) : SCA_ISensor(gameobj,eventmgr,T), - m_Networkeventmgr(eventmgr), m_NetworkScene(NetworkScene), m_subject(subject), m_frame_message_count (0), diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h index 53183f33826..dd207230e0c 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h @@ -39,7 +39,6 @@ class KX_NetworkMessageSensor : public SCA_ISensor { // note: Py_Header MUST BE the first listed here Py_Header; - KX_NetworkEventManager *m_Networkeventmgr; NG_NetworkScene *m_NetworkScene; // The subject we filter on. diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index c06acd4a873..5b23a9d0e3e 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -101,8 +101,7 @@ KX_TouchSensor::KX_TouchSensor(SCA_EventManager* eventmgr,KX_GameObject* gameobj :SCA_ISensor(gameobj,eventmgr,T), m_touchedpropname(touchedpropname), m_bFindMaterial(bFindMaterial), -m_bTouchPulse(bTouchPulse), -m_eventmgr(eventmgr) +m_bTouchPulse(bTouchPulse) /*m_sumoObj(sumoObj),*/ { // KX_TouchEventManager* touchmgr = (KX_TouchEventManager*) eventmgr; diff --git a/source/gameengine/Ketsji/KX_TouchSensor.h b/source/gameengine/Ketsji/KX_TouchSensor.h index 476c63e89db..7ec8d1277aa 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.h +++ b/source/gameengine/Ketsji/KX_TouchSensor.h @@ -58,7 +58,6 @@ protected: STR_String m_touchedpropname; bool m_bFindMaterial; bool m_bTouchPulse; /* changes in the colliding objects trigger pulses */ - class SCA_EventManager* m_eventmgr; class PHY_IPhysicsController* m_physCtrl; From 580d38336481bcd9a149bd2e2dc9f0faaf872f49 Mon Sep 17 00:00:00 2001 From: William Reynish Date: Sat, 22 Aug 2009 11:51:26 +0000 Subject: [PATCH 206/577] Moved mesh display options to the 3D view n-key area, next to other display options. The DNA/RNA for these options should be changed to reflect this. --- release/ui/buttons_data_mesh.py | 31 ----------------------------- release/ui/space_view3d.py | 35 +++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 31 deletions(-) diff --git a/release/ui/buttons_data_mesh.py b/release/ui/buttons_data_mesh.py index c1311b32180..f91d706ead7 100644 --- a/release/ui/buttons_data_mesh.py +++ b/release/ui/buttons_data_mesh.py @@ -48,36 +48,6 @@ class DATA_PT_normals(DataButtonsPanel): col.itemR(mesh, "vertex_normal_flip") col.itemR(mesh, "double_sided") -class DATA_PT_meshdraw(DataButtonsPanel): - __label__ = "Draw" - - def draw(self, context): - layout = self.layout - - mesh = context.mesh - - layout.itemL(text="Edit Mode only, WIP") - - split = layout.split() - - col = split.column() - col.itemR(mesh, "draw_edges", text="Edges") - col.itemR(mesh, "draw_faces", text="Faces") - col.itemR(mesh, "draw_creases", text="Creases") - col.itemR(mesh, "draw_bevel_weights", text="Bevel Weights") - col.itemR(mesh, "draw_seams", text="Seams") - col.itemR(mesh, "draw_sharp", text="Sharp") - - col = split.column() - col.itemR(mesh, "draw_normals", text="Face Normals") - col.itemR(mesh, "draw_vertex_normals", text="Vertex Normals") - - col.itemS() - - col.itemR(mesh, "draw_edge_lenght") - col.itemR(mesh, "draw_edge_angle") - col.itemR(mesh, "draw_face_area") - class DATA_PT_vertex_groups(DataButtonsPanel): __label__ = "Vertex Groups" @@ -227,7 +197,6 @@ class DATA_PT_vertex_colors(DataButtonsPanel): bpy.types.register(DATA_PT_context_mesh) bpy.types.register(DATA_PT_normals) -bpy.types.register(DATA_PT_meshdraw) bpy.types.register(DATA_PT_vertex_groups) bpy.types.register(DATA_PT_shape_keys) bpy.types.register(DATA_PT_uv_texture) diff --git a/release/ui/space_view3d.py b/release/ui/space_view3d.py index 8f37b34e3b4..8e5bc100af1 100644 --- a/release/ui/space_view3d.py +++ b/release/ui/space_view3d.py @@ -1032,6 +1032,40 @@ class VIEW3D_PT_3dview_display(bpy.types.Panel): col.itemR(view, "lock_rotation") col.itemR(view, "box_preview") col.itemR(view, "box_clip") + +class VIEW3D_PT_3dview_meshdisplay(bpy.types.Panel): + __space_type__ = 'VIEW_3D' + __region_type__ = 'UI' + __label__ = "Mesh Display" + + def poll(self, context): + editmesh = context.mode == 'EDIT_MESH' + return (editmesh) + + def draw(self, context): + layout = self.layout + + mesh = context.active_object.data + + col = layout.column() + col.itemL(text="Overlays:") + col.itemR(mesh, "draw_edges", text="Edges") + col.itemR(mesh, "draw_faces", text="Faces") + col.itemR(mesh, "draw_creases", text="Creases") + col.itemR(mesh, "draw_bevel_weights", text="Bevel Weights") + col.itemR(mesh, "draw_seams", text="Seams") + col.itemR(mesh, "draw_sharp", text="Sharp") + + col.itemS() + col.itemL(text="Normals:") + col.itemR(mesh, "draw_normals", text="Face") + col.itemR(mesh, "draw_vertex_normals", text="Vertex") + + col.itemS() + col.itemL(text="Numerics:") + col.itemR(mesh, "draw_edge_lenght") + col.itemR(mesh, "draw_edge_angle") + col.itemR(mesh, "draw_face_area") class VIEW3D_PT_background_image(bpy.types.Panel): __space_type__ = 'VIEW_3D' @@ -1129,4 +1163,5 @@ bpy.types.register(VIEW3D_MT_edit_ARMATURE_roll) bpy.types.register(VIEW3D_PT_3dview_properties) # Panels bpy.types.register(VIEW3D_PT_3dview_display) +bpy.types.register(VIEW3D_PT_3dview_meshdisplay) bpy.types.register(VIEW3D_PT_background_image) From f08a4c9719ac3d745dfcbae3acc3ca48c38777ad Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 22 Aug 2009 14:19:27 +0000 Subject: [PATCH 207/577] missed this in last commit. keyboard event manager was stored twice. --- .../gameengine/GameLogic/SCA_KeyboardSensor.cpp | 15 +++++++-------- source/gameengine/GameLogic/SCA_KeyboardSensor.h | 2 -- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index f8ee8ed8b41..a5581f0d987 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -51,7 +51,6 @@ SCA_KeyboardSensor::SCA_KeyboardSensor(SCA_KeyboardManager* keybdmgr, SCA_IObject* gameobj, PyTypeObject* T ) :SCA_ISensor(gameobj,keybdmgr,T), - m_pKeyboardMgr(keybdmgr), m_hotkey(hotkey), m_qual(qual), m_qual2(qual2), @@ -126,7 +125,7 @@ bool SCA_KeyboardSensor::Evaluate() bool qual_change = false; short int m_val_orig = m_val; - SCA_IInputDevice* inputdev = m_pKeyboardMgr->GetInputDevice(); + SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)m_eventmgr)->GetInputDevice(); // cerr << "SCA_KeyboardSensor::Eval event, sensing for "<< m_hotkey << " at device " << inputdev << "\n"; /* See if we need to do logging: togPropState exists and is @@ -361,7 +360,7 @@ void SCA_KeyboardSensor::AddToTargetProp(int keyIndex) */ bool SCA_KeyboardSensor::IsShifted(void) { - SCA_IInputDevice* inputdev = m_pKeyboardMgr->GetInputDevice(); + SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)m_eventmgr)->GetInputDevice(); if ( (inputdev->GetEventValue(SCA_IInputDevice::KX_RIGHTSHIFTKEY).m_status == SCA_InputEvent::KX_ACTIVE) @@ -380,7 +379,7 @@ bool SCA_KeyboardSensor::IsShifted(void) void SCA_KeyboardSensor::LogKeystrokes(void) { - SCA_IInputDevice* inputdev = m_pKeyboardMgr->GetInputDevice(); + SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)m_eventmgr)->GetInputDevice(); int num = inputdev->GetNumActiveEvents(); /* weird loop, this one... */ @@ -515,7 +514,7 @@ PyObject* SCA_KeyboardSensor::PyGetPressedKeys() { ShowDeprecationWarning("getPressedKeys()", "events"); - SCA_IInputDevice* inputdev = m_pKeyboardMgr->GetInputDevice(); + SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)m_eventmgr)->GetInputDevice(); int num = inputdev->GetNumJustEvents(); PyObject* resultlist = PyList_New(num); @@ -556,7 +555,7 @@ PyObject* SCA_KeyboardSensor::PyGetCurrentlyPressedKeys() { ShowDeprecationWarning("getCurrentlyPressedKeys()", "events"); - SCA_IInputDevice* inputdev = m_pKeyboardMgr->GetInputDevice(); + SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)m_eventmgr)->GetInputDevice(); int num = inputdev->GetNumActiveEvents(); PyObject* resultlist = PyList_New(num); @@ -605,7 +604,7 @@ KX_PYMETHODDEF_DOC_O(SCA_KeyboardSensor, getKeyStatus, return NULL; } - SCA_IInputDevice* inputdev = m_pKeyboardMgr->GetInputDevice(); + SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)m_eventmgr)->GetInputDevice(); const SCA_InputEvent & inevent = inputdev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) keycode); return PyInt_FromLong(inevent.m_status); } @@ -691,7 +690,7 @@ PyObject* SCA_KeyboardSensor::pyattr_get_events(void *self_v, const KX_PYATTRIBU { SCA_KeyboardSensor* self= static_cast(self_v); - SCA_IInputDevice* inputdev = self->m_pKeyboardMgr->GetInputDevice(); + SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)self->m_eventmgr)->GetInputDevice(); PyObject* resultlist = PyList_New(0); diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.h b/source/gameengine/GameLogic/SCA_KeyboardSensor.h index 033225cd9be..13fcc21ab7b 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.h +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.h @@ -43,8 +43,6 @@ class SCA_KeyboardSensor : public SCA_ISensor { Py_Header; - class SCA_KeyboardManager* m_pKeyboardMgr; - /** * the key this sensor is sensing for From 98e9ddbf5b2b9dcf8a6a2440126f928d4394a5f4 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sat, 22 Aug 2009 16:54:18 +0000 Subject: [PATCH 208/577] Bugfixing. --- intern/audaspace/jack/AUD_JackDevice.cpp | 4 ---- intern/audaspace/jack/AUD_JackDevice.h | 3 --- source/blender/blenkernel/intern/blender.c | 3 +-- source/blender/blenkernel/intern/sound.c | 8 ++------ source/creator/creator.c | 1 - 5 files changed, 3 insertions(+), 16 deletions(-) diff --git a/intern/audaspace/jack/AUD_JackDevice.cpp b/intern/audaspace/jack/AUD_JackDevice.cpp index 1f2c6faa511..445e68e1a9a 100644 --- a/intern/audaspace/jack/AUD_JackDevice.cpp +++ b/intern/audaspace/jack/AUD_JackDevice.cpp @@ -31,8 +31,6 @@ #include #include -#ifdef WITH_JACK - // AUD_XXX this is not realtime suitable! int AUD_JackDevice::jack_mix(jack_nframes_t length, void *data) { @@ -149,5 +147,3 @@ void AUD_JackDevice::playing(bool playing) { // Do nothing. } - -#endif diff --git a/intern/audaspace/jack/AUD_JackDevice.h b/intern/audaspace/jack/AUD_JackDevice.h index e6d332e1160..f0c887a2f43 100644 --- a/intern/audaspace/jack/AUD_JackDevice.h +++ b/intern/audaspace/jack/AUD_JackDevice.h @@ -26,7 +26,6 @@ #ifndef AUD_JACKDEVICE #define AUD_JACKDEVICE -#ifdef WITH_JACK #include "AUD_SoftwareDevice.h" class AUD_Buffer; @@ -90,6 +89,4 @@ public: virtual ~AUD_JackDevice(); }; -#endif //WITH_JACK - #endif //AUD_JACKDEVICE diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 746dc6c59cc..f261b020717 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -626,8 +626,7 @@ void BKE_write_undo(bContext *C, char *name) } } -/* 1= an undo, -1 is a redo. we have to make sure 'curundo' remains at current situation - * Note, ALWAYS call sound_initialize_sounds after BKE_undo_step() */ +/* 1= an undo, -1 is a redo. we have to make sure 'curundo' remains at current situation */ void BKE_undo_step(bContext *C, int step) { diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index a3275792a85..74ab41ff577 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -319,8 +319,6 @@ void sound_stop_all(struct bContext *C) } } -#define SOUND_PLAYBACK_LAMBDA 1.0 - void sound_update_playing(struct bContext *C) { SoundHandle *handle; @@ -366,12 +364,10 @@ void sound_update_playing(struct bContext *C) action = 3; else { - float diff = AUD_getPosition(handle->handle) - (cfra - handle->startframe) / fps; -// AUD_XXX float diff = AUD_getPosition(handle->handle) * fps - cfra + handle->startframe + float diff = AUD_getPosition(handle->handle) * fps - cfra + handle->startframe; if(diff < 0.0) diff = -diff; - if(diff > SOUND_PLAYBACK_LAMBDA) -// AUD_XXX if(diff > 5.0f) + if(diff > 1.0f) { action = 2; } diff --git a/source/creator/creator.c b/source/creator/creator.c index 5ecd95ecc21..41b27b1c915 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -821,7 +821,6 @@ int main(int argc, char **argv) if (G.background) { int retval = BKE_read_file(C, argv[a], NULL, NULL); -// XXX sound_initialize_sounds(); /*we successfully loaded a blend file, get sure that pointcache works */ From 215f80361cfeb294aed9e93cb6899d18c28d8bbf Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 22 Aug 2009 17:06:10 +0000 Subject: [PATCH 209/577] bpy's __rna__ attribute doesnt work as it should, since the parent classes __rna__ overrides the subtypes. For now have pyrna_struct_as_srna look in the dict first for __rna__ before using PyDict_GetItemString. Somehow __rna__ is not calling the pyrna_struct_getattro function, python find it first. The only relyable way to get the rna from python currently is. bpy.types.SomeType.__dict__['__rna__'] --- source/blender/python/intern/bpy_rna.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index bece114d8bd..31648037346 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -2655,8 +2655,17 @@ PyObject *BPY_rna_props( void ) static StructRNA *pyrna_struct_as_srna(PyObject *self) { - BPy_StructRNA *py_srna= (BPy_StructRNA*)PyObject_GetAttrString(self, "__rna__"); + BPy_StructRNA *py_srna; StructRNA *srna; + + /* ack, PyObject_GetAttrString wont look up this types tp_dict first :/ */ + if(PyType_Check(self)) { + py_srna = (BPy_StructRNA *)PyDict_GetItemString(((PyTypeObject *)self)->tp_dict, "__rna__"); + Py_XINCREF(py_srna); + } + + if(py_srna==NULL) + py_srna = (BPy_StructRNA*)PyObject_GetAttrString(self, "__rna__"); if(py_srna==NULL) { PyErr_SetString(PyExc_SystemError, "internal error, self had no __rna__ attribute, should never happen."); From 4ca76ac543b2dff8e3c7bf796203d07033703983 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 22 Aug 2009 17:11:36 +0000 Subject: [PATCH 210/577] [#19229] 1 line fix resolves - segmentation Fault from Martin Frances (martinfrances) Added a scene check when appending objects so you can append data without a scene. --- source/blender/blenloader/intern/readfile.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 72aba02f723..77b51d950b9 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3093,7 +3093,7 @@ static void direct_link_particlesystems(FileData *fd, ListBase *particles) psys->flag &= ~PSYS_KEYED; } - if(psys->particles->boid) { + if(psys->particles && psys->particles->boid) { pa = psys->particles; pa->boid = newdataadr(fd, pa->boid); for(a=1,pa++; atotpart; a++, pa++) @@ -10804,14 +10804,16 @@ static Library* library_append(Main *mainvar, Scene *scene, char* file, char *di fix_relpaths_library(G.sce, mainvar); /* make all relative paths, relative to the open blend file */ /* give a base to loose objects. If group append, do it for objects too */ - if(idcode==ID_GR) { - if (flag & FILE_LINK) { - give_base_to_objects(mainvar, scene, NULL, 0); + if(scene) { + if(idcode==ID_GR) { + if (flag & FILE_LINK) { + give_base_to_objects(mainvar, scene, NULL, 0); + } else { + give_base_to_objects(mainvar, scene, curlib, 1); + } } else { - give_base_to_objects(mainvar, scene, curlib, 1); - } - } else { - give_base_to_objects(mainvar, scene, NULL, 0); + give_base_to_objects(mainvar, scene, NULL, 0); + } } /* has been removed... erm, why? s..ton) */ /* 20040907: looks like they are give base already in append_named_part(); -Nathan L */ From 9cd19fd210d95d4442b47b05e7d550560bc17db8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 22 Aug 2009 17:19:31 +0000 Subject: [PATCH 211/577] [#19226] (2.5) blender uses deprecated 'strstream' STL class, causes warnings with gcc thanks to Mauro Toffanin (equilibrium) This is the only place where strstream were used. --- source/gameengine/VideoTexture/Exception.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/gameengine/VideoTexture/Exception.cpp b/source/gameengine/VideoTexture/Exception.cpp index 8704d49f2a7..35d335b5981 100644 --- a/source/gameengine/VideoTexture/Exception.cpp +++ b/source/gameengine/VideoTexture/Exception.cpp @@ -21,7 +21,7 @@ http://www.gnu.org/copyleft/lesser.txt. */ -#include +#include #include #include @@ -170,11 +170,11 @@ void Exception::setXptDesc (void) // length of result code const size_t rsltSize = 11; // delimit description - const char delimRslt[] = ": "; + //const char delimRslt[] = ": "; // set text of description char rsltTxt[rsltSize]; - std::ostrstream os(rsltTxt, rsltSize); - os << std::hex << m_hRslt << delimRslt << '\0'; + std::ostringstream os; + os << std::hex << m_hRslt << ": " << '\0'; // copy result to description m_desc.insert(0, rsltTxt); // copy exception description to last exception string From 45bb3293b418745d515f237b8d39308f0a574000 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 22 Aug 2009 17:30:47 +0000 Subject: [PATCH 212/577] 2.5: Python subclasses can now define RNA properties by making a __props__ list in the class, same as for operators. --- source/blender/python/intern/bpy_rna.c | 54 ++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 3 deletions(-) diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 31648037346..70ff8e48084 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -2940,12 +2940,12 @@ static StructRNA *pointer_type_from_py(PyObject *value) srna= srna_from_self(value); if(!srna) { - PyErr_SetString(PyExc_SystemError, "expected an RNA type derived from IDPropertyGroup (1)"); + PyErr_SetString(PyExc_SystemError, "expected an RNA type derived from IDPropertyGroup"); return NULL; } if(!RNA_struct_is_a(srna, &RNA_IDPropertyGroup)) { - PyErr_SetString(PyExc_SystemError, "expected an RNA type derived from IDPropertyGroup (3)"); + PyErr_SetString(PyExc_SystemError, "expected an RNA type derived from IDPropertyGroup"); return NULL; } @@ -3022,6 +3022,52 @@ PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw) return NULL; } +static int deferred_register_props(PyObject *py_class, StructRNA *srna) +{ + PyObject *props, *dummy_args, *item; + int i; + + props= PyObject_GetAttrString(py_class, "__props__"); + + if(!props) { + PyErr_Clear(); + return 1; + } + + dummy_args = PyTuple_New(0); + + for(i=0; i Date: Sat, 22 Aug 2009 17:50:10 +0000 Subject: [PATCH 213/577] use class __props__ for povray settings. --- release/io/engine_render_pov.py | 156 ++++++++++++++++---------------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/release/io/engine_render_pov.py b/release/io/engine_render_pov.py index 51aa26f7fb9..f89bdd05e06 100644 --- a/release/io/engine_render_pov.py +++ b/release/io/engine_render_pov.py @@ -801,9 +801,87 @@ class RenderButtonsPanel(bpy.types.Panel): return (rd.use_game_engine==False) and (rd.engine in self.COMPAT_ENGINES) # Radiosity panel, use in the scene for now. +FloatProperty= bpy.types.Scene.FloatProperty +IntProperty= bpy.types.Scene.IntProperty +BoolProperty= bpy.types.Scene.BoolProperty + class SCENE_PT_povray_radiosity(RenderButtonsPanel): __label__ = "Radiosity" COMPAT_ENGINES = set(['POVRAY_RENDER']) + + __props__ = [ \ + # Not a real pov option, just to know if we should write + BoolProperty( attr="pov_radio_enable", + name="Enable Radiosity", + description="Enable povrays radiosity calculation.", + default= False), + BoolProperty( attr="pov_radio_display_advanced", + name="Advanced Options", + description="Show advanced options.", + default= False), + + # Real pov options + FloatProperty( attr="pov_radio_adc_bailout", + name="ADC Bailout", + description="The adc_bailout for radiosity rays. Use adc_bailout = 0.01 / brightest_ambient_object for good results.", + min=0.0, max=1000.0, soft_min=0.0, soft_max=1.0, default= 0.01), + + BoolProperty( attr="pov_radio_always_sample", + name="Always Sample", + description="Only use the data from the pretrace step and not gather any new samples during the final radiosity pass..", + default= True), + + FloatProperty( attr="pov_radio_brightness", + name="Brightness", + description="Ammount objects are brightened before being returned upwards to the rest of the system.", + min=0.0, max=1000.0, soft_min=0.0, soft_max=10.0, default= 1.0), + + IntProperty( attr="pov_radio_count", + name="Ray Count", + description="number of rays that are sent out whenever a new radiosity value has to be calculated.", + min=1, max=1600, default= 35), + + FloatProperty( attr="pov_radio_error_bound", + name="Error Bound", + description="one of the two main speed/quality tuning values, lower values are more accurate.", + min=0.0, max=1000.0, soft_min=0.1, soft_max=10.0, default= 1.8), + + FloatProperty( attr="pov_radio_gray_threshold", + name="Gray Threshold", + description="one of the two main speed/quality tuning values, lower values are more accurate.", + min=0.0, max=1.0, soft_min=0, soft_max=1, default= 0.0), + + FloatProperty( attr="pov_radio_low_error_factor", + name="Low Error Factor", + description="If you calculate just enough samples, but no more, you will get an image which has slightly blotchy lighting.", + min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default= 0.5), + + # max_sample - not available yet + BoolProperty( attr="pov_radio_media", + name="Media", + description="Radiosity estimation can be affected by media.", + default= False), + + FloatProperty( attr="pov_radio_minimum_reuse", + name="Minimum Reuse", + description="Fraction of the screen width which sets the minimum radius of reuse for each sample point (At values higher than 2% expect errors).", + min=0.0, max=1.0, soft_min=0.1, soft_max=0.1, default= 0.015), + + IntProperty( attr="pov_radio_nearest_count", + name="Nearest Count", + description="Number of old ambient values blended together to create a new interpolated value.", + min=1, max=20, default= 5), + + BoolProperty( attr="pov_radio_normal", + name="Normals", + description="Radiosity estimation can be affected by normals.", + default= False), + + IntProperty( attr="pov_radio_recursion_limit", + name="Recursion Limit", + description="how many recursion levels are used to calculate the diffuse inter-reflection.", + min=1, max=20, default= 3), + ] def draw_header(self, context): layout = self.layout @@ -856,81 +934,3 @@ class SCENE_PT_povray_radiosity(RenderButtonsPanel): bpy.types.register(SCENE_PT_povray_radiosity) - - -FloatProperty= bpy.types.Scene.FloatProperty -IntProperty= bpy.types.Scene.IntProperty -BoolProperty= bpy.types.Scene.BoolProperty - -# Not a real pov option, just to know if we should write -BoolProperty( attr="pov_radio_enable", - name="Enable Radiosity", - description="Enable povrays radiosity calculation.", - default= False) -BoolProperty( attr="pov_radio_display_advanced", - name="Advanced Options", - description="Show advanced options.", - default= False) - -# Real pov options -FloatProperty( attr="pov_radio_adc_bailout", - name="ADC Bailout", - description="The adc_bailout for radiosity rays. Use adc_bailout = 0.01 / brightest_ambient_object for good results.", - min=0.0, max=1000.0, soft_min=0.0, soft_max=1.0, default= 0.01) - -BoolProperty( attr="pov_radio_always_sample", - name="Always Sample", - description="Only use the data from the pretrace step and not gather any new samples during the final radiosity pass..", - default= True) - -FloatProperty( attr="pov_radio_brightness", - name="Brightness", - description="Ammount objects are brightened before being returned upwards to the rest of the system.", - min=0.0, max=1000.0, soft_min=0.0, soft_max=10.0, default= 1.0) - -IntProperty( attr="pov_radio_count", - name="Ray Count", - description="number of rays that are sent out whenever a new radiosity value has to be calculated.", - min=1, max=1600, default= 35) - -FloatProperty( attr="pov_radio_error_bound", - name="Error Bound", - description="one of the two main speed/quality tuning values, lower values are more accurate.", - min=0.0, max=1000.0, soft_min=0.1, soft_max=10.0, default= 1.8) - -FloatProperty( attr="pov_radio_gray_threshold", - name="Gray Threshold", - description="one of the two main speed/quality tuning values, lower values are more accurate.", - min=0.0, max=1.0, soft_min=0, soft_max=1, default= 0.0) - -FloatProperty( attr="pov_radio_low_error_factor", - name="Low Error Factor", - description="If you calculate just enough samples, but no more, you will get an image which has slightly blotchy lighting.", - min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default= 0.5) - -# max_sample - not available yet - -BoolProperty( attr="pov_radio_media", - name="Media", - description="Radiosity estimation can be affected by media.", - default= False) - -FloatProperty( attr="pov_radio_minimum_reuse", - name="Minimum Reuse", - description="Fraction of the screen width which sets the minimum radius of reuse for each sample point (At values higher than 2% expect errors).", - min=0.0, max=1.0, soft_min=0.1, soft_max=0.1, default= 0.015) - -IntProperty( attr="pov_radio_nearest_count", - name="Nearest Count", - description="Number of old ambient values blended together to create a new interpolated value.", - min=1, max=20, default= 5) - -BoolProperty( attr="pov_radio_normal", - name="Normals", - description="Radiosity estimation can be affected by normals.", - default= False) - -IntProperty( attr="pov_radio_recursion_limit", - name="Recursion Limit", - description="how many recursion levels are used to calculate the diffuse inter-reflection.", - min=1, max=20, default= 3) From 46aac7b4fc5456daf8faabd7e6f2e65832c96268 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sun, 23 Aug 2009 02:54:30 +0000 Subject: [PATCH 214/577] * Volume rendering - z transparency This solves one of the last remaining hurdles for volume rendering. Previously it always used ray tracing to shade other objects inside or behind the volume. This meant that said objects would look aliased, unless you used Full OSA on the volume (which is slow!). As well as this, it meant that you didn't get a good alpha channel out of the volume to use for compositing, similar to ray refracting materials. This commit enables z transparency for volume materials. Although it can be potentially less physically correct, in most situations there's no difference, and you get the benefit of nice sampling for other objects and an alpha channel for compositing too. --- release/ui/buttons_material.py | 22 ++ source/blender/makesdna/DNA_material_types.h | 1 - source/blender/makesrna/intern/rna_material.c | 5 - .../render/intern/source/convertblender.c | 7 +- .../blender/render/intern/source/shadeinput.c | 10 +- .../blender/render/intern/source/volumetric.c | 318 +++++++++--------- 6 files changed, 196 insertions(+), 167 deletions(-) diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py index 67ba4d326ba..3aec2517bf1 100644 --- a/release/ui/buttons_material.py +++ b/release/ui/buttons_material.py @@ -568,6 +568,27 @@ class MATERIAL_PT_volume_scattering(MaterialButtonsPanel): col.itemR(vol, "phase_function", text="") if vol.phase_function in ('SCHLICK', 'HENYEY-GREENSTEIN'): col.itemR(vol, "asymmetry") + +class MATERIAL_PT_volume_transp(MaterialButtonsPanel): + __label__= "Transparency" + COMPAT_ENGINES = set(['BLENDER_RENDER']) + + def poll(self, context): + mat = context.material + return mat and (mat.type == 'VOLUME') and (context.scene.render_data.engine in self.COMPAT_ENGINES) + + def draw_header(self, context): + layout = self.layout + + def draw(self, context): + layout = self.layout + + mat = context.material + rayt = context.material.raytrace_transparency + + row= layout.row() + row.itemR(mat, "transparency_method", expand=True) + row.active = mat.transparency and (not mat.shadeless) class MATERIAL_PT_volume_integration(MaterialButtonsPanel): __label__ = "Integration" @@ -660,6 +681,7 @@ bpy.types.register(MATERIAL_PT_mirror) bpy.types.register(MATERIAL_PT_sss) bpy.types.register(MATERIAL_PT_volume_shading) bpy.types.register(MATERIAL_PT_volume_scattering) +bpy.types.register(MATERIAL_PT_volume_transp) bpy.types.register(MATERIAL_PT_volume_integration) bpy.types.register(MATERIAL_PT_halo) bpy.types.register(MATERIAL_PT_physics) diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index b4fdb07b520..f268c117065 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -377,7 +377,6 @@ typedef struct Material { #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 diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 0c5fc70fabd..cde65f46e5c 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -1017,11 +1017,6 @@ static void rna_def_material_volume(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Emission Color", ""); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL); - prop= RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "shadeflag", MA_VOL_USEALPHA); /* use bitflags */ - RNA_def_property_ui_text(prop, "Use Alpha", "Temp method for getting a usable alpha channel"); - RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "phase_function", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "phasefunc_type"); RNA_def_property_enum_items(prop, prop_phasefunction_items); diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index f91e48ea287..e486daf2585 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -920,6 +920,7 @@ static Material *give_render_material(Render *re, Object *ob, int nr) if(re->r.mode & R_SPEED) ma->texco |= NEED_UV; + if(ma->material_type == MA_TYPE_VOLUME) ma->mode |= MA_TRANSP; if((ma->mode & MA_TRANSP) && (ma->mode & MA_ZTRANSP)) re->flag |= R_ZTRA; @@ -3005,13 +3006,12 @@ static void init_camera_inside_volumes(Render *re) } } - { + /* debug { MatInside *m; for (m=re->render_volumes_inside.first; m; m=m->next) { printf("matinside: ma: %s \n", m->ma->id.name+2); } - - } + }*/ } static void add_volume(Render *re, ObjectRen *obr, Material *ma) @@ -3862,6 +3862,7 @@ static void set_fullsample_flag(Render *re, ObjectRen *obr) vlr->flag |= R_FULL_OSA; else if(trace) { if(mode & MA_SHLESS); + else if(vlr->mat->material_type == MA_TYPE_VOLUME); else if((mode & MA_RAYMIRROR) || ((mode & MA_TRANSP) && (mode & MA_RAYTRANSP))) /* for blurry reflect/refract, better to take more samples * inside the raytrace than as OSA samples */ diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index 1a97440cec3..7887392f1d2 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -216,15 +216,17 @@ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr) } else alpha= 1.0f; + /* add mist and premul color */ if(shr->alpha!=1.0f || alpha!=1.0f) { float fac= alpha*(shr->alpha); shr->combined[3]= fac; - shr->combined[0]*= fac; - shr->combined[1]*= fac; - shr->combined[2]*= fac; + + if (shi->mat->material_type!= MA_TYPE_VOLUME) + VecMulf(shr->combined, fac); } - else shr->combined[3]= 1.0f; + else + shr->combined[3]= 1.0f; /* add z */ shr->z= -shi->co[2]; diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 7943d9ae526..cf66d580944 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -65,12 +65,20 @@ extern struct Render R; /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -/* TODO: Box or sphere intersection types could speed things up */ +/* tracing */ + static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, Isect *isect, int intersect_type) { float maxsize = RE_ray_tree_max_size(R.raytree); - - /* TODO: use object's bounding box to calculate max size */ + + /* XXX TODO - get raytrace max distance from object instance's bounding box */ + /* need to account for scaling only, but keep coords in camera space... + * below code is WIP and doesn't work! + VecSubf(bb_dim, shi->obi->obr->boundbox[1], shi->obi->obr->boundbox[2]); + Mat3MulVecfl(shi->obi->nmat, bb_dim); + maxsize = VecLength(bb_dim); + */ + VECCOPY(isect->start, co); isect->end[0] = co[0] + vec[0] * maxsize; isect->end[1] = co[1] + vec[1] * maxsize; @@ -96,6 +104,68 @@ static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, } } +static void shade_intersection(ShadeInput *shi, float *col, Isect *is) +{ + ShadeInput shi_new; + ShadeResult shr_new; + + memset(&shi_new, 0, sizeof(ShadeInput)); + + shi_new.mask= shi->mask; + shi_new.osatex= shi->osatex; + shi_new.thread= shi->thread; + shi_new.depth = shi->depth + 1; + shi_new.volume_depth= shi->volume_depth + 1; + shi_new.xs= shi->xs; + shi_new.ys= shi->ys; + shi_new.lay= shi->lay; + shi_new.passflag= SCE_PASS_COMBINED; /* result of tracing needs no pass info */ + shi_new.combinedflag= 0xFFFFFF; /* ray trace does all options */ + shi_new.light_override= shi->light_override; + shi_new.mat_override= shi->mat_override; + + VECCOPY(shi_new.camera_co, is->start); + + memset(&shr_new, 0, sizeof(ShadeResult)); + + /* hardcoded limit of 100 for now - prevents problems in weird geometry */ + if (shi->volume_depth < 100) { + shade_ray(is, &shi_new, &shr_new); + } + + VecCopyf(col, shr_new.combined); + col[3] = shr_new.alpha; +} + +static void vol_trace_behind(ShadeInput *shi, VlakRen *vlr, float *co, float *col) +{ + Isect isect; + float maxsize = RE_ray_tree_max_size(R.raytree); + + VECCOPY(isect.start, co); + isect.end[0] = isect.start[0] + shi->view[0] * maxsize; + isect.end[1] = isect.start[1] + shi->view[1] * maxsize; + isect.end[2] = isect.start[2] + shi->view[2] * maxsize; + + isect.faceorig= (RayFace *)vlr; + + isect.mode= RE_RAY_MIRROR; + isect.oborig= RAY_OBJECT_SET(&R, shi->obi); + isect.face_last= NULL; + isect.ob_last= 0; + isect.lay= -1; + + /* check to see if there's anything behind the volume, otherwise shade the sky */ + if(RE_ray_tree_intersect(R.raytree, &isect)) { + shade_intersection(shi, col, &isect); + } else { + shadeSkyView(col, co, shi->view, NULL, shi->thread); + shadeSunView(col, shi->view); + } +} + +/* input shader data */ + float vol_get_stepsize(struct ShadeInput *shi, int context) { if (shi->mat->vol.stepsize_type == MA_VOL_STEP_RANDOMIZED) { @@ -280,7 +350,7 @@ void vol_get_attenuation(ShadeInput *shi, float *transmission, float *co, float tau[2] += stepsize * density; if (s < nsteps-1) { - VECCOPY(step_sta, step_end); + VecCopyf(step_sta, step_end); VecAddf(step_end, step_end, step_vec); } } @@ -319,9 +389,6 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * VECCOPY(lv, lar->vec); VecMulf(lv, -1.0f); - p = vol_get_phasefunc(shi, shi->mat->vol.phasefunc_type, shi->mat->vol.phasefunc_g, shi->view, lv); - VecMulf(lacol, p); - if (shi->mat->vol.shade_type != MA_VOL_SHADE_NONE) { Isect is; @@ -337,6 +404,7 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * } if (ELEM(lar->type, LA_SUN, LA_HEMI)) + /* infinite lights, can never be inside volume */ atten_co = hitco; else if ( lampdist < dist ) { atten_co = lar->co; @@ -354,6 +422,9 @@ void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float * } } + p = vol_get_phasefunc(shi, shi->mat->vol.phasefunc_type, shi->mat->vol.phasefunc_g, shi->view, lv); + VecMulf(lacol, p); + scatter_fac = vol_get_scattering_fac(shi, co); VecMulf(lacol, scatter_fac); } @@ -390,14 +461,6 @@ outgoing radiance from behind surface * beam transmittance/attenuation + added radiance from all points along the ray due to participating media --> radiance for each segment = (radiance added by scattering + radiance added by emission) * beam transmittance/attenuation - --- To find transmittance: - compute optical thickness with tau (perhaps involving monte carlo integration) - transmittance = exp(-tau) - --- To find radiance from segments along the way: - find radiance for one step: - - loop over lights and weight by phase function */ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float *endco) { @@ -462,150 +525,102 @@ static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float VecMulVecf(col, tr, col); VecAddf(col, col, radiance); - /* alpha - transmission */ - col[3] = 1.0f -(tr[0] + tr[1] + tr[2]) * 0.333f; -} - -static void shade_intersection(ShadeInput *shi, float *col, Isect *is) -{ - ShadeInput shi_new; - ShadeResult shr_new; - - memset(&shi_new, 0, sizeof(ShadeInput)); - - shi_new.mask= shi->mask; - shi_new.osatex= shi->osatex; - shi_new.thread= shi->thread; - shi_new.depth = shi->depth + 1; - shi_new.volume_depth= shi->volume_depth + 1; - shi_new.xs= shi->xs; - shi_new.ys= shi->ys; - shi_new.lay= shi->lay; - shi_new.passflag= SCE_PASS_COMBINED; /* result of tracing needs no pass info */ - shi_new.combinedflag= 0xFFFFFF; /* ray trace does all options */ - shi_new.light_override= shi->light_override; - shi_new.mat_override= shi->mat_override; - - VECCOPY(shi_new.camera_co, is->start); - - memset(&shr_new, 0, sizeof(ShadeResult)); - - /* hardcoded limit of 100 for now - prevents problems in weird geometry */ - if (shi->volume_depth < 100) { - shade_ray(is, &shi_new, &shr_new); - } - - col[0] = shr_new.combined[0]; - col[1] = shr_new.combined[1]; - col[2] = shr_new.combined[2]; - col[3] = shr_new.alpha; -} - -static void vol_trace_behind(ShadeInput *shi, VlakRen *vlr, float *co, float *col) -{ - Isect isect; - float maxsize = RE_ray_tree_max_size(R.raytree); - - VECCOPY(isect.start, co); - isect.end[0] = isect.start[0] + shi->view[0] * maxsize; - isect.end[1] = isect.start[1] + shi->view[1] * maxsize; - isect.end[2] = isect.start[2] + shi->view[2] * maxsize; - - isect.faceorig= (RayFace *)vlr; - - isect.mode= RE_RAY_MIRROR; - isect.oborig= RAY_OBJECT_SET(&R, shi->obi); - isect.face_last= NULL; - isect.ob_last= 0; - isect.lay= -1; - - /* check to see if there's anything behind the volume, otherwise shade the sky */ - if(RE_ray_tree_intersect(R.raytree, &isect)) { - shade_intersection(shi, col, &isect); - } else { - shadeSkyView(col, co, shi->view, NULL, shi->thread); - shadeSunView(col, shi->view); - } + /* alpha <-- transmission luminance */ + col[3] = 1.0f -(0.2126*tr[0] + 0.7152*tr[1] + 0.0722*tr[2]); } /* the main entry point for volume shading */ static void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr, int inside_volume) { float hitco[3], col[4] = {0.f,0.f,0.f,0.f}; + float *startco, *endco; int trace_behind = 1; + const int ztransp= ((shi->depth==0) && (shi->mat->mode & MA_TRANSP) && (shi->mat->mode & MA_ZTRANSP)); Isect is; /* check for shading an internal face a volume object directly */ - if (inside_volume == VOL_SHADE_INSIDE) { + if (inside_volume == VOL_SHADE_INSIDE) trace_behind = 0; - } - if (inside_volume == VOL_SHADE_OUTSIDE) { + else if (inside_volume == VOL_SHADE_OUTSIDE) { if (shi->flippednor) inside_volume = VOL_SHADE_INSIDE; } - - if (inside_volume == VOL_SHADE_INSIDE) { + + if (ztransp && inside_volume == VOL_SHADE_INSIDE) { + MatInside *mi; + int render_this=0; - if (trace_behind) { - /* trace behind the volume object */ - vol_trace_behind(shi, shi->vlr, shi->co, col); - } else { - /* we're tracing through the volume between the camera - * and a solid surface, so use that pre-shaded radiance */ - QUATCOPY(col, shr->combined); + /* don't render the backfaces of ztransp volume materials. + + * volume shading renders the internal volume from between the + * near view intersection of the solid volume to the + * intersection on the other side, as part of the shading of + * the front face. + + * Because ztransp renders both front and back faces independently + * this will double up, so here we prevent rendering the backface as well, + * which would otherwise render the volume in between the camera and the backface + * --matt */ + + for (mi=R.render_volumes_inside.first; mi; mi=mi->next) { + /* weak... */ + if (mi->ma == shi->mat) render_this=1; + } + if (!render_this) return; + } + + + if (inside_volume == VOL_SHADE_INSIDE) + { + startco = shi->camera_co; + endco = shi->co; + + if (!ztransp) { + if (trace_behind) { + /* trace behind the volume object */ + vol_trace_behind(shi, shi->vlr, endco, col); + } else { + /* we're tracing through the volume between the camera + * and a solid surface, so use that pre-shaded radiance */ + QUATCOPY(col, shr->combined); + } } /* shade volume from 'camera' to 1st hit point */ - volumeintegrate(shi, col, shi->camera_co, shi->co); - - VecCopyf(shr->combined, col); - - if (shi->mat->vol.shadeflag & MA_VOL_USEALPHA) { - if (col[3] > 1.0f) - col[3] = 1.0f; - } - else - col[3] = 1.0f; - shr->combined[3] = col[3]; - shr->alpha = col[3]; - - VECCOPY(shr->diff, shr->combined); + volumeintegrate(shi, col, startco, endco); } /* trace to find a backface, the other side bounds of the volume */ /* (ray intersect ignores front faces here) */ - else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH)) { + else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH)) + { VlakRen *vlr = (VlakRen *)is.face; - /* if it's another face in the same material */ - if (vlr->mat == shi->mat) { - /* trace behind the 2nd (raytrace) hit point */ - vol_trace_behind(shi, (VlakRen *)is.face, hitco, col); - } else { - shade_intersection(shi, col, &is); + startco = shi->co; + endco = hitco; + + if (!ztransp) { + /* if it's another face in the same material */ + if (vlr->mat == shi->mat) { + /* trace behind the 2nd (raytrace) hit point */ + vol_trace_behind(shi, (VlakRen *)is.face, endco, col); + } else { + shade_intersection(shi, col, &is); + } } - + /* shade volume from 1st hit point to 2nd hit point */ - volumeintegrate(shi, col, shi->co, hitco); - - VecCopyf(shr->combined, col); - - if (shi->mat->vol.shadeflag & MA_VOL_USEALPHA) { - if (col[3] > 1.0f) - col[3] = 1.0f; - } - else - col[3] = 1.0f; - shr->combined[3] = col[3]; - shr->alpha = col[3]; - - VECCOPY(shr->diff, shr->combined); - } - else { - shr->combined[0] = 0.0f; - shr->combined[1] = 0.0f; - shr->combined[2] = 0.0f; - shr->combined[3] = shr->alpha = 1.0f; + volumeintegrate(shi, col, startco, endco); } + + if (ztransp) + col[3] = col[3]>1.f?1.f:col[3]; + else + col[3] = 1.f; + + VecCopyf(shr->combined, col); + shr->alpha = col[3]; + + VECCOPY(shr->diff, shr->combined); } /* Traces a shadow through the object, @@ -614,41 +629,37 @@ void shade_volume_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct { float hitco[3]; float tr[3] = {1.0,1.0,1.0}; - float tau[3] = {0.0,0.0,0.0}; Isect is; float shade_stepsize = vol_get_stepsize(shi, STEPSIZE_SHADE); + float *startco, *endco; + float density=0.f; memset(shr, 0, sizeof(ShadeResult)); /* if 1st hit normal is facing away from the camera, * then we're inside the volume already. */ if (shi->flippednor) { - - vol_get_attenuation(shi, tr, last_is->start, shi->co, -1.0f, shade_stepsize); - - VecCopyf(shr->combined, tr); - - shr->combined[3] = 1.0f -(tr[0] + tr[1] + tr[2]) * 0.333f; - shr->alpha = shr->combined[3]; + startco = last_is->start; + endco = shi->co; } /* trace to find a backface, the other side bounds of the volume */ /* (ray intersect ignores front faces here) */ else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH)) { - - vol_get_attenuation(shi, tr, shi->co, hitco, -1.0f, shade_stepsize); - - VecCopyf(shr->combined, tr); - - shr->combined[3] = 1.0f -(tr[0] + tr[1] + tr[2]) * 0.333f; - shr->alpha = shr->combined[3]; - + startco = shi->co; + endco = hitco; } else { - shr->combined[0] = 0.0f; - shr->combined[1] = 0.0f; - shr->combined[2] = 0.0f; - shr->combined[3] = shr->alpha = 0.0f; + shr->combined[0] = shr->combined[1] = shr->combined[2] = 0.f; + shr->alpha = shr->combined[3] = 1.f; + return; } + + density = vol_get_density(shi, startco); + vol_get_attenuation(shi, tr, startco, endco, density, shade_stepsize); + + VecCopyf(shr->combined, tr); + shr->combined[3] = 1.0f -(0.2126*tr[0] + 0.7152*tr[1] + 0.0722*tr[2]); + shr->alpha = shr->combined[3]; } @@ -656,7 +667,6 @@ void shade_volume_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct void shade_volume_outside(ShadeInput *shi, ShadeResult *shr) { memset(shr, 0, sizeof(ShadeResult)); - volume_trace(shi, shr, VOL_SHADE_OUTSIDE); } From f82ce68a9eda382fead176398b624f28b5c9945c Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sun, 23 Aug 2009 02:59:18 +0000 Subject: [PATCH 215/577] * enable ztransp transparency type for new materials by default. --- source/blender/blenkernel/intern/material.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 50db2bfe706..62ec12349aa 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -170,7 +170,7 @@ void init_material(Material *ma) ma->sss_front= 1.0f; ma->sss_back= 1.0f; - ma->mode= MA_TRACEBLE|MA_SHADBUF|MA_SHADOW|MA_RAYBIAS|MA_TANGENT_STR; + ma->mode= MA_TRACEBLE|MA_SHADBUF|MA_SHADOW|MA_RAYBIAS|MA_TANGENT_STR|MA_ZTRANSP; ma->preview = NULL; } From 4a4a3b4989355c699b72a8dc15df09fd47621528 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 23 Aug 2009 06:17:59 +0000 Subject: [PATCH 216/577] Option for MouseFocus sensor. only used when 'Mouse over any' type is set. Previously the only way to detect if the mouse moved over a different object was to enable true-level-triggering and have a python script detect the change. When the Pulse option is set, focusing on a different object pulses true. Python attribute is focusSensor.usePulseFocus. This is similar to the collision sensors pulse option where changes in the set of collision objects generates an event too. Found this functionality missing when trying to make a logic demo that used mouse-over with overlapping objects. --- source/blender/makesdna/DNA_sensor_types.h | 3 +++ source/blender/src/buttons_logic.c | 8 +++++++- source/gameengine/Converter/KX_ConvertSensors.cpp | 1 + source/gameengine/Ketsji/KX_MouseFocusSensor.cpp | 12 ++++++++++-- source/gameengine/Ketsji/KX_MouseFocusSensor.h | 9 ++++++++- source/gameengine/PyDoc/GameTypes.py | 4 +++- 6 files changed, 32 insertions(+), 5 deletions(-) diff --git a/source/blender/makesdna/DNA_sensor_types.h b/source/blender/makesdna/DNA_sensor_types.h index 8b29ce1338d..cc998de7eec 100644 --- a/source/blender/makesdna/DNA_sensor_types.h +++ b/source/blender/makesdna/DNA_sensor_types.h @@ -178,6 +178,9 @@ typedef struct bJoystickSensor { /* bMouseSensor->type: uses blender event defines */ +/* bMouseSensor->flag: only pulse for now */ +#define SENS_MOUSE_FOCUS_PULSE 1 + /* propertysensor->type */ #define SENS_PROP_EQUAL 0 #define SENS_PROP_NEQUAL 1 diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index a57bcf5d7df..0412aa72b37 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -1367,10 +1367,16 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short * proper compatibility with older .blend files. */ str= "Type %t|Left button %x1|Middle button %x2|" "Right button %x4|Wheel Up %x5|Wheel Down %x6|Movement %x8|Mouse over %x16|Mouse over any%x32"; - uiDefButS(block, MENU, B_REDR, str, xco+10, yco-44, width-20, 19, + uiDefButS(block, MENU, B_REDR, str, xco+10, yco-44, (width*0.8f)-20, 19, &ms->type, 0, 31, 0, 0, "Specify the type of event this mouse sensor should trigger on"); + if(ms->type==32) { + uiDefButBitS(block, TOG, SENS_MOUSE_FOCUS_PULSE, B_REDR, "Pulse",(short)(xco + 10) + (width*0.8f)-20,(short)(yco - 44), + (short)(0.20 * (width-20)), 19, &ms->flag, 0.0, 0.0, 0, 0, + "Moving the mouse over a different object generates a pulse"); + } + yco-= ysize; break; } diff --git a/source/gameengine/Converter/KX_ConvertSensors.cpp b/source/gameengine/Converter/KX_ConvertSensors.cpp index 31a3cfbd1ac..a628881058a 100644 --- a/source/gameengine/Converter/KX_ConvertSensors.cpp +++ b/source/gameengine/Converter/KX_ConvertSensors.cpp @@ -522,6 +522,7 @@ void BL_ConvertSensors(struct Object* blenderobject, starty, keytype, trackfocus, + (bmouse->flag & SENS_MOUSE_FOCUS_PULSE) ? true:false, kxscene, kxengine, gameobj); diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp index fde10a493db..1880fcfb6f0 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp @@ -61,12 +61,14 @@ KX_MouseFocusSensor::KX_MouseFocusSensor(SCA_MouseManager* eventmgr, int starty, short int mousemode, int focusmode, + bool bTouchPulse, KX_Scene* kxscene, KX_KetsjiEngine *kxengine, SCA_IObject* gameobj, PyTypeObject* T) : SCA_MouseSensor(eventmgr, startx, starty, mousemode, gameobj, T), m_focusmode(focusmode), + m_bTouchPulse(bTouchPulse), m_kxscene(kxscene), m_kxengine(kxengine) { @@ -78,6 +80,7 @@ void KX_MouseFocusSensor::Init() m_mouse_over_in_previous_frame = (m_invert)?true:false; m_positive_event = false; m_hitObject = 0; + m_hitObject_Last = NULL; m_reset = true; m_hitPosition.setValue(0,0,0); @@ -108,7 +111,10 @@ bool KX_MouseFocusSensor::Evaluate() m_positive_event = true; if (!m_mouse_over_in_previous_frame) { result = true; - } + } + else if(m_bTouchPulse && (m_hitObject != m_hitObject_Last)) { + result = true; + } } if (reset) { // force an event @@ -124,7 +130,8 @@ bool KX_MouseFocusSensor::Evaluate() } m_mouse_over_in_previous_frame = obHasFocus; - + m_hitObject_Last = (void *)m_hitObject; + return result; } @@ -390,6 +397,7 @@ PyAttributeDef KX_MouseFocusSensor::Attributes[] = { KX_PYATTRIBUTE_RO_FUNCTION("hitObject", KX_MouseFocusSensor, pyattr_get_hit_object), KX_PYATTRIBUTE_RO_FUNCTION("hitPosition", KX_MouseFocusSensor, pyattr_get_hit_position), KX_PYATTRIBUTE_RO_FUNCTION("hitNormal", KX_MouseFocusSensor, pyattr_get_hit_normal), + KX_PYATTRIBUTE_BOOL_RW("usePulseFocus", KX_MouseFocusSensor,m_bTouchPulse), { NULL } //Sentinel }; diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.h b/source/gameengine/Ketsji/KX_MouseFocusSensor.h index 29d674eb305..e1f8d9246e3 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.h +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.h @@ -49,11 +49,12 @@ class KX_MouseFocusSensor : public SCA_MouseSensor public: - KX_MouseFocusSensor(class SCA_MouseManager* keybdmgr, + KX_MouseFocusSensor(class SCA_MouseManager* eventmgr, int startx, int starty, short int mousemode, int focusmode, + bool bTouchPulse, KX_Scene* kxscene, KX_KetsjiEngine* kxengine, SCA_IObject* gameobj, @@ -110,6 +111,7 @@ class KX_MouseFocusSensor : public SCA_MouseSensor /* --------------------------------------------------------------------- */ SCA_IObject* m_hitObject; + void* m_hitObject_Last; /* only use for comparison, never access */ private: /** @@ -122,6 +124,11 @@ class KX_MouseFocusSensor : public SCA_MouseSensor */ bool m_mouse_over_in_previous_frame; + /** + * Flags whether changes in hit object should trigger a pulse + */ + bool m_bTouchPulse; + /** * Flags whether the previous test evaluated positive. */ diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index b1d1ce71173..71a0c8c1a47 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -2472,6 +2472,8 @@ class KX_MouseFocusSensor(SCA_MouseSensor): @type hitPosition: list (vector of 3 floats) @ivar hitNormal: the worldspace normal from the face at point of intersection. @type hitNormal: list (normalized vector of 3 floats) + @ivar usePulseFocus: When enabled, moving the mouse over a different object generates a pulse. (only used when the 'Mouse Over Any' sensor option is set) + @type usePulseFocus: bool """ #{ Deprecated def getHitNormal(): @@ -2533,7 +2535,7 @@ class KX_TouchSensor(SCA_ISensor): @ivar useMaterial: Determines if the sensor is looking for a property or material. KX_True = Find material; KX_False = Find property @type useMaterial: boolean - @ivar usePulseCollision: The last collided object. + @ivar usePulseCollision: When enabled, changes to the set of colliding objects generate a pulse. @type usePulseCollision: bool @ivar hitObject: The last collided object. (read-only) @type hitObject: L{KX_GameObject} or None From 2ed155b98a52108a39133185b145ceee0d21ebf8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 23 Aug 2009 07:33:29 +0000 Subject: [PATCH 217/577] spacebar for the search menu was overriding space in the text editor --- source/blender/windowmanager/intern/wm_operators.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 22c7b6ae277..6ecbc172c37 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -720,6 +720,7 @@ int wm_search_menu_poll(bContext *C) { if(CTX_wm_window(C)==NULL) return 0; if(CTX_wm_area(C) && CTX_wm_area(C)->spacetype==SPACE_CONSOLE) return 0; // XXX - so we can use the shortcut in the console + if(CTX_wm_area(C) && CTX_wm_area(C)->spacetype==SPACE_TEXT) return 0; // XXX - so we can use the spacebar in the text editor return 1; } From 834f509c5a9f3b76a5edfb15717bdd4ba3fd8b80 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 23 Aug 2009 12:50:08 +0000 Subject: [PATCH 218/577] missed this in last commit. --- release/io/engine_render_pov.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/release/io/engine_render_pov.py b/release/io/engine_render_pov.py index f89bdd05e06..e2f7ae5d454 100644 --- a/release/io/engine_render_pov.py +++ b/release/io/engine_render_pov.py @@ -801,9 +801,9 @@ class RenderButtonsPanel(bpy.types.Panel): return (rd.use_game_engine==False) and (rd.engine in self.COMPAT_ENGINES) # Radiosity panel, use in the scene for now. -FloatProperty= bpy.types.Scene.FloatProperty -IntProperty= bpy.types.Scene.IntProperty -BoolProperty= bpy.types.Scene.BoolProperty +FloatProperty= bpy.props.FloatProperty +IntProperty= bpy.props.IntProperty +BoolProperty= bpy.props.BoolProperty class SCENE_PT_povray_radiosity(RenderButtonsPanel): __label__ = "Radiosity" From 19b81733cc28fdd3ec90bbb146933d4b8760a357 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 23 Aug 2009 12:53:55 +0000 Subject: [PATCH 219/577] 2.5 - Custom Shape and Bone Groups can be viewed/set on Bones again. --- release/ui/buttons_data_bone.py | 20 ++- source/blender/makesrna/intern/rna_pose.c | 180 ++++++++++++++++------ 2 files changed, 149 insertions(+), 51 deletions(-) diff --git a/release/ui/buttons_data_bone.py b/release/ui/buttons_data_bone.py index 17c9c2d89d9..cfdaabadf79 100644 --- a/release/ui/buttons_data_bone.py +++ b/release/ui/buttons_data_bone.py @@ -74,10 +74,13 @@ class BONE_PT_bone(BoneButtonsPanel): def draw(self, context): layout = self.layout + ob = context.object bone = context.bone arm = context.armature if not bone: bone = context.edit_bone + else: + pchan = ob.pose.pose_channels[context.bone.name] split = layout.split() @@ -87,14 +90,14 @@ class BONE_PT_bone(BoneButtonsPanel): col.itemR(bone, "parent", text="") else: col.item_pointerR(bone, "parent", arm, "edit_bones", text="") - + row = col.row() row.active = bone.parent != None row.itemR(bone, "connected") - + col.itemL(text="Layers:") col.template_layers(bone, "layer") - + col = split.column() col.itemL(text="Inherit:") col.itemR(bone, "hinge", text="Rotation") @@ -102,6 +105,17 @@ class BONE_PT_bone(BoneButtonsPanel): col.itemL(text="Display:") col.itemR(bone, "draw_wire", text="Wireframe") col.itemR(bone, "hidden", text="Hide") + + if ob and pchan: + split = layout.split() + + col = split.column() + col.itemL(text="Bone Group:") + col.item_pointerR(pchan, "bone_group", ob.pose, "bone_groups", text="") + + col = split.column() + col.itemL(text="Custom Shape:") + col.itemR(pchan, "custom_shape", text="") class BONE_PT_inverse_kinematics(BoneButtonsPanel): __label__ = "Inverse Kinematics" diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 6cf4722494f..bfebc5ee49f 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -151,12 +151,72 @@ static int rna_PoseChannel_has_ik_get(PointerRNA *ptr) return ED_pose_channel_in_IK_chain(ob, pchan); } +static PointerRNA rna_PoseChannel_bone_group_get(PointerRNA *ptr) +{ + Object *ob= (Object*)ptr->id.data; + bPose *pose= (ob) ? ob->pose : NULL; + bPoseChannel *pchan= (bPoseChannel*)ptr->data; + bActionGroup *grp; + + if (pose) + grp= BLI_findlink(&pose->agroups, pchan->agrp_index-1); + else + grp= NULL; + + return rna_pointer_inherit_refine(ptr, &RNA_BoneGroup, grp); +} + +static void rna_PoseChannel_bone_group_set(PointerRNA *ptr, PointerRNA value) +{ + Object *ob= (Object*)ptr->id.data; + bPose *pose= (ob) ? ob->pose : NULL; + bPoseChannel *pchan= (bPoseChannel*)ptr->data; + + if (pose) + pchan->agrp_index= BLI_findindex(&pose->agroups, value.data) + 1; + else + pchan->agrp_index= 0; +} + +static int rna_PoseChannel_bone_group_index_get(PointerRNA *ptr) +{ + bPoseChannel *pchan= (bPoseChannel*)ptr->data; + return MAX2(pchan->agrp_index-1, 0); +} + +static void rna_PoseChannel_bone_group_index_set(PointerRNA *ptr, int value) +{ + bPoseChannel *pchan= (bPoseChannel*)ptr->data; + pchan->agrp_index= value+1; +} + +static void rna_PoseChannel_bone_group_index_range(PointerRNA *ptr, int *min, int *max) +{ + Object *ob= (Object*)ptr->id.data; + bPose *pose= (ob) ? ob->pose : NULL; + + *min= 0; + + if (pose) { + *max= BLI_countlist(&pose->agroups)-1; + *max= MAX2(0, *max); + } + else + *max= 0; +} + static PointerRNA rna_Pose_active_bone_group_get(PointerRNA *ptr) { bPose *pose= (bPose*)ptr->data; return rna_pointer_inherit_refine(ptr, &RNA_BoneGroup, BLI_findlink(&pose->agroups, pose->active_group-1)); } +static void rna_Pose_active_bone_group_set(PointerRNA *ptr, PointerRNA value) +{ + bPose *pose= (bPose*)ptr->data; + pose->active_group= BLI_findindex(&pose->agroups, value.data) + 1; +} + static int rna_Pose_active_bone_group_index_get(PointerRNA *ptr) { bPose *pose= (bPose*)ptr->data; @@ -304,60 +364,23 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Pose Channel", "Channel defining pose data for a bone in a Pose."); RNA_def_struct_path_func(srna, "rna_PoseChannel_path"); RNA_def_struct_idproperties_func(srna, "rna_PoseChannel_idproperties"); - + + /* Bone Constraints */ prop= RNA_def_property(srna, "constraints", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "Constraint"); RNA_def_property_ui_text(prop, "Constraints", "Constraints that act on this PoseChannel."); + /* Name + Selection Status */ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_PoseChannel_name_set"); RNA_def_property_ui_text(prop, "Name", ""); RNA_def_struct_name_property(srna, prop); - - prop= RNA_def_property(srna, "has_ik", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_funcs(prop, "rna_PoseChannel_has_ik_get", NULL); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Has IK", "Is part of an IK chain."); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); - - prop= RNA_def_property(srna, "ik_dof_x", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_XDOF); - RNA_def_property_ui_text(prop, "IK X DoF", "Allow movement around the X axis."); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); - - prop= RNA_def_property(srna, "ik_dof_y", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_YDOF); - RNA_def_property_ui_text(prop, "IK Y DoF", "Allow movement around the Y axis."); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); - - prop= RNA_def_property(srna, "ik_dof_z", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_ZDOF); - RNA_def_property_ui_text(prop, "IK Z DoF", "Allow movement around the Z axis."); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); - - prop= RNA_def_property(srna, "ik_limit_x", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_XLIMIT); - RNA_def_property_ui_text(prop, "IK X Limit", "Limit movement around the X axis."); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); - - prop= RNA_def_property(srna, "ik_limit_y", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_YLIMIT); - RNA_def_property_ui_text(prop, "IK Y Limit", "Limit movement around the Y axis."); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); - - prop= RNA_def_property(srna, "ik_limit_z", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_ZLIMIT); - RNA_def_property_ui_text(prop, "IK Z Limit", "Limit movement around the Z axis."); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "selectflag", BONE_SELECTED); RNA_def_property_ui_text(prop, "Selected", ""); - - prop= RNA_def_property(srna, "bone_group_index", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "agrp_index"); - RNA_def_property_ui_text(prop, "Bone Group Index", "Bone Group this pose channel belongs to (0=no group)."); + /* Baked Bone Path cache data s*/ prop= RNA_def_property(srna, "path_start_frame", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "pathsf"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -369,7 +392,8 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Bone Paths Calculation End Frame", "End frame of range of frames to use for Bone Path calculations."); RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); - + + /* Relationships to other bones */ prop= RNA_def_property(srna, "bone", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "Bone"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -384,7 +408,8 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_struct_type(prop, "PoseChannel"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Child", "Child of this pose channel."); - + + /* Transformation settings */ prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "loc"); RNA_def_property_ui_text(prop, "Location", ""); @@ -429,6 +454,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Constraint Inverse Matrix", "4x4 matrix, defines transform from final position to unconstrained position."); */ + /* Head/Tail Coordinates (in Pose Space) - Automatically calculated... */ prop= RNA_def_property(srna, "pose_head", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Pose Head Position", "Location of head of the channel's bone."); @@ -436,7 +462,44 @@ static void rna_def_pose_channel(BlenderRNA *brna) prop= RNA_def_property(srna, "pose_tail", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Pose Tail Position", "Location of tail of the channel's bone."); + + /* IK Settings */ + prop= RNA_def_property(srna, "has_ik", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_PoseChannel_has_ik_get", NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Has IK", "Is part of an IK chain."); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + prop= RNA_def_property(srna, "ik_dof_x", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_XDOF); + RNA_def_property_ui_text(prop, "IK X DoF", "Allow movement around the X axis."); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + + prop= RNA_def_property(srna, "ik_dof_y", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_YDOF); + RNA_def_property_ui_text(prop, "IK Y DoF", "Allow movement around the Y axis."); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + + prop= RNA_def_property(srna, "ik_dof_z", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "ikflag", BONE_IK_NO_ZDOF); + RNA_def_property_ui_text(prop, "IK Z DoF", "Allow movement around the Z axis."); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + + prop= RNA_def_property(srna, "ik_limit_x", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_XLIMIT); + RNA_def_property_ui_text(prop, "IK X Limit", "Limit movement around the X axis."); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + + prop= RNA_def_property(srna, "ik_limit_y", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_YLIMIT); + RNA_def_property_ui_text(prop, "IK Y Limit", "Limit movement around the Y axis."); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + + prop= RNA_def_property(srna, "ik_limit_z", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "ikflag", BONE_IK_ZLIMIT); + RNA_def_property_ui_text(prop, "IK Z Limit", "Limit movement around the Z axis."); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); + prop= RNA_def_property(srna, "ik_min_x", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "limitmin[0]"); RNA_def_property_range(prop, -180.0f, 0.0f); @@ -496,11 +559,31 @@ static void rna_def_pose_channel(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f,1.0f); RNA_def_property_ui_text(prop, "IK Stretch", "Allow scaling of the bone for IK."); RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); - - prop= RNA_def_property(srna, "custom", PROP_POINTER, PROP_NONE); + + /* custom bone shapes */ + prop= RNA_def_property(srna, "custom_shape", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "custom"); + RNA_def_property_struct_type(prop, "Object"); + RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Custom Object", "Object that defines custom draw type for this bone."); - RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); - + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + + /* bone groups */ + prop= RNA_def_property(srna, "bone_group_index", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "agrp_index"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_int_funcs(prop, "rna_PoseChannel_bone_group_index_get", "rna_PoseChannel_bone_group_index_set", "rna_PoseChannel_bone_group_index_range"); + RNA_def_property_ui_text(prop, "Bone Group Index", "Bone Group this pose channel belongs to (0=no group)."); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + + prop= RNA_def_property(srna, "bone_group", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "BoneGroup"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_pointer_funcs(prop, "rna_PoseChannel_bone_group_get", "rna_PoseChannel_bone_group_set", NULL); + RNA_def_property_ui_text(prop, "Bone Group", "Bone Group this pose channel belongs to"); + RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); + + /* transform locks */ prop= RNA_def_property(srna, "lock_location", PROP_BOOLEAN, PROP_XYZ); RNA_def_property_boolean_sdna(prop, NULL, "protectflag", OB_LOCK_LOCX); RNA_def_property_array(prop, 3); @@ -541,8 +624,9 @@ static void rna_def_pose(BlenderRNA *brna) prop= RNA_def_property(srna, "active_bone_group", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "BoneGroup"); + RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_pointer_funcs(prop, "rna_Pose_active_bone_group_get", "rna_Pose_active_bone_group_set", NULL); - RNA_def_property_ui_text(prop, "Active Bone Group", "Bone groups of the pose."); + RNA_def_property_ui_text(prop, "Active Bone Group", "Active bone group for this pose."); RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); prop= RNA_def_property(srna, "active_bone_group_index", PROP_INT, PROP_NONE); From 971435f2a1332f897be00ce9ced3e7721d20994b Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sun, 23 Aug 2009 13:15:10 +0000 Subject: [PATCH 220/577] * Compile fix after merge - disabled high-res smoke rendering in voxeldata texture. Will re-enable when the modifier situation has been worked out. --- source/blender/render/intern/source/voxeldata.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c index 81fd1a408e1..ff076579788 100644 --- a/source/blender/render/intern/source/voxeldata.c +++ b/source/blender/render/intern/source/voxeldata.c @@ -166,11 +166,12 @@ void init_frame_smoke(Render *re, VoxelData *vd, Tex *tex) SmokeModifierData *smd = (SmokeModifierData *)md; if(smd->domain && smd->domain->fluid) { - int big = (smd->domain->flags & MOD_SMOKE_HIGHRES); + //int big = (smd->domain->flags & MOD_SMOKE_HIGHRES); + int big=0; if (big) { - smoke_turbulence_get_res(smd->domain->wt, vd->resol); - vd->dataset = smoke_turbulence_get_density(smd->domain->wt); + //smoke_turbulence_get_res(smd->domain->wt, vd->resol); + //vd->dataset = smoke_turbulence_get_density(smd->domain->wt); } else { VECCOPY(vd->resol, smd->domain->res); vd->dataset = smoke_get_density(smd->domain->fluid); From 2c5cbd4c7c9d2cd3ee8bb25f1bfdced6781b58fd Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sun, 23 Aug 2009 17:03:06 +0000 Subject: [PATCH 221/577] 2.5/Sculpt: * Deleted unused file --- .../editors/sculpt_paint/sculpt_stroke.c | 274 ------------------ 1 file changed, 274 deletions(-) delete mode 100644 source/blender/editors/sculpt_paint/sculpt_stroke.c diff --git a/source/blender/editors/sculpt_paint/sculpt_stroke.c b/source/blender/editors/sculpt_paint/sculpt_stroke.c deleted file mode 100644 index 554ff580358..00000000000 --- a/source/blender/editors/sculpt_paint/sculpt_stroke.c +++ /dev/null @@ -1,274 +0,0 @@ -/* - * $Id$ - * - * ***** 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) 2007 by Nicholas Bishop - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - * - * Storage and manipulation of sculptmode brush strokes. - * - */ - -#include "MEM_guardedalloc.h" - -#include "DNA_listBase.h" -#include "DNA_scene_types.h" - -#include "BKE_sculpt.h" -#include "BLI_blenlib.h" -#include "BIF_gl.h" - -#include "sculpt_intern.h" - -#include - -/* Temporary storage of input stroke control points */ -typedef struct StrokePoint { - struct StrokePoint *next, *prev; - short x, y; -} StrokePoint; -typedef struct SculptStroke { - short (*loc)[2]; - int max; - int index; - float length; - ListBase final; - StrokePoint *final_mem; - float offset; -} SculptStroke; - -SculptStroke *sculpt_stroke_new(const int max) -{ - SculptStroke *stroke = MEM_callocN(sizeof(SculptStroke), "SculptStroke"); - stroke->loc = MEM_callocN(sizeof(short) * 4 * max, "SculptStroke.loc"); - stroke->max = max; - stroke->index = -1; - return stroke; -} - -void sculpt_stroke_free(SculptStroke *stroke) -{ - if(stroke) { - if(stroke->loc) MEM_freeN(stroke->loc); - if(stroke->final_mem) MEM_freeN(stroke->final_mem); - - MEM_freeN(stroke); - } -} - -void sculpt_stroke_add_point(SculptStroke *stroke, const short x, const short y) -{ - const int next = stroke->index + 1; - - if(stroke->index == -1) { - stroke->loc[0][0] = x; - stroke->loc[0][1] = y; - stroke->index = 0; - } - else if(next < stroke->max) { - const int dx = x - stroke->loc[stroke->index][0]; - const int dy = y - stroke->loc[stroke->index][1]; - stroke->loc[next][0] = x; - stroke->loc[next][1] = y; - stroke->length += sqrt(dx*dx + dy*dy); - stroke->index = next; - } -} - -static void sculpt_stroke_smooth(SculptStroke *stroke) -{ - /* Apply smoothing (exclude the first and last points)*/ - StrokePoint *p = stroke->final.first; - if(p && p->next && p->next->next) { - for(p = p->next->next; p && p->next && p->next->next; p = p->next) { - p->x = p->prev->prev->x*0.1 + p->prev->x*0.2 + p->x*0.4 + p->next->x*0.2 + p->next->next->x*0.1; - p->y = p->prev->prev->y*0.1 + p->prev->y*0.2 + p->y*0.4 + p->next->y*0.2 + p->next->next->y*0.1; - } - } -} - -static void sculpt_stroke_create_final(SculptStroke *stroke) -{ - if(stroke) { - StrokePoint *p, *pnext; - int i; - - /* Copy loc into final */ - if(stroke->final_mem) - MEM_freeN(stroke->final_mem); - stroke->final_mem = MEM_callocN(sizeof(StrokePoint) * (stroke->index + 1) * 2, "SculptStroke.final"); - stroke->final.first = stroke->final.last = NULL; - for(i = 0; i <= stroke->index; ++i) { - p = &stroke->final_mem[i]; - p->x = stroke->loc[i][0]; - p->y = stroke->loc[i][1]; - BLI_addtail(&stroke->final, p); - } - - /* Remove shortest edges */ - if(stroke->final.first) { - for(p = ((StrokePoint*)stroke->final.first)->next; p && p->next; p = pnext) { - const int dx = p->x - p->prev->x; - const int dy = p->y - p->prev->y; - const float len = sqrt(dx*dx + dy*dy); - pnext = p->next; - if(len < 10) { - BLI_remlink(&stroke->final, p); - } - } - } - - sculpt_stroke_smooth(stroke); - - /* Subdivide edges */ - for(p = stroke->final.first; p && p->next; p = pnext) { - StrokePoint *np = &stroke->final_mem[i++]; - - pnext = p->next; - np->x = (p->x + p->next->x) / 2; - np->y = (p->y + p->next->y) / 2; - BLI_insertlink(&stroke->final, p, np); - } - - sculpt_stroke_smooth(stroke); - } -} - -static float sculpt_stroke_seglen(StrokePoint *p1, StrokePoint *p2) -{ - int dx = p2->x - p1->x; - int dy = p2->y - p1->y; - return sqrt(dx*dx + dy*dy); -} - -static float sculpt_stroke_final_length(SculptStroke *stroke) -{ - StrokePoint *p; - float len = 0; - for(p = stroke->final.first; p && p->next; ++p) - len += sculpt_stroke_seglen(p, p->next); - return len; -} - -/* If partial is nonzero, cuts off apply after that length has been processed */ -static StrokePoint *sculpt_stroke_apply_generic(Sculpt *sd, SculptStroke *stroke, const int partial) -{ - const int sdspace = 0; //XXX: sd->spacing; - const short spacing = sdspace > 0 ? sdspace : 2; - const int dots = sculpt_stroke_final_length(stroke) / spacing; - int i; - StrokePoint *p = stroke->final.first; - float startloc = stroke->offset; - - for(i = 0; i < dots && p && p->next; ++i) { - const float dotloc = spacing * i; - short co[2]; - float len = sculpt_stroke_seglen(p, p->next); - float u, v; - - /* Find edge containing dot */ - while(dotloc > startloc + len && p && p->next && p->next->next) { - p = p->next; - startloc += len; - len = sculpt_stroke_seglen(p, p->next); - } - - if(!p || !p->next || dotloc > startloc + len) - break; - - if(partial && startloc > partial) { - /* Calculate offset for next stroke segment */ - stroke->offset = startloc + len - dotloc; - break; - } - - u = (dotloc - startloc) / len; - v = 1 - u; - - co[0] = p->x*v + p->next->x*u; - co[1] = p->y*v + p->next->y*u; - - //do_symmetrical_brush_actions(sd, a, co, NULL); - } - - return p ? p->next : NULL; -} - -void sculpt_stroke_apply(Sculpt *sd, SculptStroke *stroke) -{ - /* TODO: make these values user-modifiable? */ - const int partial_len = 100; - const int min_len = 200; - - if(stroke) { - sculpt_stroke_create_final(stroke); - - if(sculpt_stroke_final_length(stroke) > min_len) { - StrokePoint *p = sculpt_stroke_apply_generic(sd, stroke, partial_len); - - /* Replace remaining values in stroke->loc with remaining stroke->final values */ - stroke->index = -1; - stroke->length = 0; - for(; p; p = p->next) { - ++stroke->index; - stroke->loc[stroke->index][0] = p->x; - stroke->loc[stroke->index][1] = p->y; - if(p->next) { - stroke->length += sculpt_stroke_seglen(p, p->next); - } - } - } - } -} - -void sculpt_stroke_apply_all(Sculpt *sd, SculptStroke *stroke) -{ - sculpt_stroke_create_final(stroke); - - if(stroke) { - sculpt_stroke_apply_generic(sd, stroke, 0); - } -} - -/* XXX: drawing goes elsewhere */ -void sculpt_stroke_draw(SculptStroke *stroke) -{ - if(stroke) { - StrokePoint *p; - - /* Draws the original stroke */ - /*glColor3f(1, 0, 0); - glBegin(GL_LINE_STRIP); - for(i = 0; i <= stroke->index; ++i) - glVertex2s(stroke->loc[i][0], stroke->loc[i][1]); - glEnd();*/ - - /* Draws the smoothed stroke */ - glColor3f(0, 1, 0); - glBegin(GL_LINE_STRIP); - for(p = stroke->final.first; p; p = p->next) - glVertex2s(p->x, p->y); - glEnd(); - } -} From 77ec3a1239b33e2cf5eaebd611b68d8de5a56f19 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 23 Aug 2009 17:33:34 +0000 Subject: [PATCH 222/577] deprecated world settings were being used making new world's have zero gravity in the game engine. Double checked these aren't used anymore by renaming the vars in DNA_world_types.h --- .../gameengine/Converter/BL_BlenderDataConversion.cpp | 4 ++-- source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 6cb4e980a3d..ed03bb0bdd5 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -2485,10 +2485,10 @@ void BL_ConvertBlenderObjects(struct Main* maggie, } } if (occlusion) - kxscene->SetDbvtOcclusionRes(blenderscene->world->occlusionRes); + kxscene->SetDbvtOcclusionRes(blenderscene->gm.occlusionRes); } if (blenderscene->world) - kxscene->GetPhysicsEnvironment()->setNumTimeSubSteps(blenderscene->world->physubstep); + kxscene->GetPhysicsEnvironment()->setNumTimeSubSteps(blenderscene->gm.physubstep); // now that the scenegraph is complete, let's instantiate the deformers. // We need that to create reusable derived mesh and physic shapes diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index 13643e3a1ac..4117e493322 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -382,12 +382,12 @@ void KX_KetsjiEngine::StartEngine(bool clearIpo) m_firstframe = true; m_bInitialized = true; // there is always one scene enabled at startup - World* world = m_scenes[0]->GetBlenderScene()->world; - if (world) + Scene* scene = m_scenes[0]->GetBlenderScene(); + if (scene) { - m_ticrate = world->ticrate ? world->ticrate : DEFAULT_LOGIC_TIC_RATE; - m_maxLogicFrame = world->maxlogicstep ? world->maxlogicstep : 5; - m_maxPhysicsFrame = world->maxphystep ? world->maxlogicstep : 5; + m_ticrate = scene->gm.ticrate ? scene->gm.ticrate : DEFAULT_LOGIC_TIC_RATE; + m_maxLogicFrame = scene->gm.maxlogicstep ? scene->gm.maxlogicstep : 5; + m_maxPhysicsFrame = scene->gm.maxphystep ? scene->gm.maxlogicstep : 5; } else { From bb4f5801d1e4457beeee5d52dbd5b18863ac5d03 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 23 Aug 2009 18:20:31 +0000 Subject: [PATCH 223/577] revert previous change, povray rendering works again, somehow I managed to render with previous changes (probably failed to reload the module and was using the register un-modified version) --- release/io/engine_render_pov.py | 160 ++++++++++++++++---------------- 1 file changed, 78 insertions(+), 82 deletions(-) diff --git a/release/io/engine_render_pov.py b/release/io/engine_render_pov.py index e2f7ae5d454..f064add505b 100644 --- a/release/io/engine_render_pov.py +++ b/release/io/engine_render_pov.py @@ -635,11 +635,89 @@ def write_pov_ini(filename_ini, filename_pov, filename_image): file.close() +# Radiosity panel, use in the scene for now. +FloatProperty= bpy.types.Scene.FloatProperty +IntProperty= bpy.types.Scene.IntProperty +BoolProperty= bpy.types.Scene.BoolProperty + +# Not a real pov option, just to know if we should write +BoolProperty( attr="pov_radio_enable", + name="Enable Radiosity", + description="Enable povrays radiosity calculation.", + default= False) +BoolProperty( attr="pov_radio_display_advanced", + name="Advanced Options", + description="Show advanced options.", + default= False) + +# Real pov options +FloatProperty( attr="pov_radio_adc_bailout", + name="ADC Bailout", + description="The adc_bailout for radiosity rays. Use adc_bailout = 0.01 / brightest_ambient_object for good results.", + min=0.0, max=1000.0, soft_min=0.0, soft_max=1.0, default= 0.01) + +BoolProperty( attr="pov_radio_always_sample", + name="Always Sample", + description="Only use the data from the pretrace step and not gather any new samples during the final radiosity pass..", + default= True) + +FloatProperty( attr="pov_radio_brightness", + name="Brightness", + description="Ammount objects are brightened before being returned upwards to the rest of the system.", + min=0.0, max=1000.0, soft_min=0.0, soft_max=10.0, default= 1.0) + +IntProperty( attr="pov_radio_count", + name="Ray Count", + description="number of rays that are sent out whenever a new radiosity value has to be calculated.", + min=1, max=1600, default= 35) + +FloatProperty( attr="pov_radio_error_bound", + name="Error Bound", + description="one of the two main speed/quality tuning values, lower values are more accurate.", + min=0.0, max=1000.0, soft_min=0.1, soft_max=10.0, default= 1.8) + +FloatProperty( attr="pov_radio_gray_threshold", + name="Gray Threshold", + description="one of the two main speed/quality tuning values, lower values are more accurate.", + min=0.0, max=1.0, soft_min=0, soft_max=1, default= 0.0) + +FloatProperty( attr="pov_radio_low_error_factor", + name="Low Error Factor", + description="If you calculate just enough samples, but no more, you will get an image which has slightly blotchy lighting.", + min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default= 0.5) + +# max_sample - not available yet +BoolProperty( attr="pov_radio_media", + name="Media", + description="Radiosity estimation can be affected by media.", + default= False) + +FloatProperty( attr="pov_radio_minimum_reuse", + name="Minimum Reuse", + description="Fraction of the screen width which sets the minimum radius of reuse for each sample point (At values higher than 2% expect errors).", + min=0.0, max=1.0, soft_min=0.1, soft_max=0.1, default= 0.015) + +IntProperty( attr="pov_radio_nearest_count", + name="Nearest Count", + description="Number of old ambient values blended together to create a new interpolated value.", + min=1, max=20, default= 5) + +BoolProperty( attr="pov_radio_normal", + name="Normals", + description="Radiosity estimation can be affected by normals.", + default= False) + +IntProperty( attr="pov_radio_recursion_limit", + name="Recursion Limit", + description="how many recursion levels are used to calculate the diffuse inter-reflection.", + min=1, max=20, default= 3) + class PovrayRender(bpy.types.RenderEngine): __idname__ = 'POVRAY_RENDER' __label__ = "Povray" DELAY = 0.02 + def _export(self, scene): import tempfile @@ -761,11 +839,8 @@ class PovrayRender(bpy.types.RenderEngine): self._cleanup() - bpy.types.register(PovrayRender) - - # Use some of the existing buttons. import buttons_scene buttons_scene.SCENE_PT_render.COMPAT_ENGINES.add('POVRAY_RENDER') @@ -800,88 +875,9 @@ class RenderButtonsPanel(bpy.types.Panel): rd = context.scene.render_data return (rd.use_game_engine==False) and (rd.engine in self.COMPAT_ENGINES) -# Radiosity panel, use in the scene for now. -FloatProperty= bpy.props.FloatProperty -IntProperty= bpy.props.IntProperty -BoolProperty= bpy.props.BoolProperty - class SCENE_PT_povray_radiosity(RenderButtonsPanel): __label__ = "Radiosity" COMPAT_ENGINES = set(['POVRAY_RENDER']) - - __props__ = [ \ - # Not a real pov option, just to know if we should write - BoolProperty( attr="pov_radio_enable", - name="Enable Radiosity", - description="Enable povrays radiosity calculation.", - default= False), - BoolProperty( attr="pov_radio_display_advanced", - name="Advanced Options", - description="Show advanced options.", - default= False), - - # Real pov options - FloatProperty( attr="pov_radio_adc_bailout", - name="ADC Bailout", - description="The adc_bailout for radiosity rays. Use adc_bailout = 0.01 / brightest_ambient_object for good results.", - min=0.0, max=1000.0, soft_min=0.0, soft_max=1.0, default= 0.01), - - BoolProperty( attr="pov_radio_always_sample", - name="Always Sample", - description="Only use the data from the pretrace step and not gather any new samples during the final radiosity pass..", - default= True), - - FloatProperty( attr="pov_radio_brightness", - name="Brightness", - description="Ammount objects are brightened before being returned upwards to the rest of the system.", - min=0.0, max=1000.0, soft_min=0.0, soft_max=10.0, default= 1.0), - - IntProperty( attr="pov_radio_count", - name="Ray Count", - description="number of rays that are sent out whenever a new radiosity value has to be calculated.", - min=1, max=1600, default= 35), - - FloatProperty( attr="pov_radio_error_bound", - name="Error Bound", - description="one of the two main speed/quality tuning values, lower values are more accurate.", - min=0.0, max=1000.0, soft_min=0.1, soft_max=10.0, default= 1.8), - - FloatProperty( attr="pov_radio_gray_threshold", - name="Gray Threshold", - description="one of the two main speed/quality tuning values, lower values are more accurate.", - min=0.0, max=1.0, soft_min=0, soft_max=1, default= 0.0), - - FloatProperty( attr="pov_radio_low_error_factor", - name="Low Error Factor", - description="If you calculate just enough samples, but no more, you will get an image which has slightly blotchy lighting.", - min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default= 0.5), - - # max_sample - not available yet - BoolProperty( attr="pov_radio_media", - name="Media", - description="Radiosity estimation can be affected by media.", - default= False), - - FloatProperty( attr="pov_radio_minimum_reuse", - name="Minimum Reuse", - description="Fraction of the screen width which sets the minimum radius of reuse for each sample point (At values higher than 2% expect errors).", - min=0.0, max=1.0, soft_min=0.1, soft_max=0.1, default= 0.015), - - IntProperty( attr="pov_radio_nearest_count", - name="Nearest Count", - description="Number of old ambient values blended together to create a new interpolated value.", - min=1, max=20, default= 5), - - BoolProperty( attr="pov_radio_normal", - name="Normals", - description="Radiosity estimation can be affected by normals.", - default= False), - - IntProperty( attr="pov_radio_recursion_limit", - name="Recursion Limit", - description="how many recursion levels are used to calculate the diffuse inter-reflection.", - min=1, max=20, default= 3), - ] def draw_header(self, context): layout = self.layout From 7da7103d1aad0294e0e7c39eef1716b276a94259 Mon Sep 17 00:00:00 2001 From: William Reynish Date: Sun, 23 Aug 2009 21:56:32 +0000 Subject: [PATCH 224/577] UI Changed the rounding of action buttons. The round style looked pleasing when they were isolated, viewed by themselves, but looked terrible when grouped, or at small sizes with icons as it was often used. The old Filebrowse or Render This Window buttons were examples of how badly they looked with an icon, and the rounding in the tools area made for some weird visual shapes. When combined in groups of widgets, such as the datablock selectors it looked even weirder, because one side of the group would be square and the other would be round, causing some spatial clashes. http://www.reynish.com/files/blender25/actionbuttons_new.png Also tweaked the tools sub-area color which stood out as being much brighter than the rest of the UI. When the tools area was open in the default layout, the overall impression was asymmetrical, non-harmonic. --- .../blender/editors/interface/interface_widgets.c | 14 +++++++------- source/blender/editors/interface/resources.c | 1 + source/blender/makesrna/intern/rna_modifier.c | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 48de2343c97..ba0d1900344 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1085,7 +1085,7 @@ static struct uiWidgetColors wcol_tool= { {255, 255, 255, 255}, 1, - 25, -25 + 15, -15 }; static struct uiWidgetColors wcol_box= { @@ -1897,7 +1897,7 @@ static void widget_swatch(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat widget_init(&wtb); /* half rounded */ - round_box_edges(&wtb, roundboxalign, rect, 4.0f); + round_box_edges(&wtb, roundboxalign, rect, 5.0f); ui_get_but_vectorf(but, col); wcol->inner[0]= FTOCHAR(col[0]); @@ -1916,7 +1916,7 @@ static void widget_textbut(uiWidgetColors *wcol, rcti *rect, int state, int roun widget_init(&wtb); /* half rounded */ - round_box_edges(&wtb, roundboxalign, rect, 5.0f); + round_box_edges(&wtb, roundboxalign, rect, 4.0f); widgetbase_draw(&wtb, wcol); @@ -1950,8 +1950,8 @@ static void widget_pulldownbut(uiWidgetColors *wcol, rcti *rect, int state, int widget_init(&wtb); - /* fully rounded */ - round_box_edges(&wtb, 15, rect, rad); + /* half rounded */ + round_box_edges(&wtb, 15, rect, 4.0f); widgetbase_draw(&wtb, wcol); } @@ -2049,8 +2049,8 @@ static void widget_roundbut(uiWidgetColors *wcol, rcti *rect, int state, int rou widget_init(&wtb); - /* fully rounded */ - round_box_edges(&wtb, roundboxalign, rect, rad); + /* half rounded */ + round_box_edges(&wtb, roundboxalign, rect, 4.0f); widgetbase_draw(&wtb, wcol); } diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 5b51d898235..8aaede7515a 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -445,6 +445,7 @@ void ui_theme_init_userdef(void) SETCOL(btheme->tv3d.text_hi, 255, 255, 255, 255); SETCOLF(btheme->tv3d.header, 0.45, 0.45, 0.45, 1.0); + SETCOLF(btheme->tv3d.button, 0.45, 0.45, 0.45, 1.0); SETCOL(btheme->tv3d.panel, 165, 165, 165, 127); SETCOL(btheme->tv3d.shade1, 160, 160, 160, 100); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index bfd93a4218b..4845ad28d47 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -55,7 +55,7 @@ EnumPropertyItem modifier_type_items[] ={ {eModifierType_Multires, "MULTIRES", ICON_MOD_MULTIRES, "Multiresolution", ""}, {eModifierType_Subsurf, "SUBSURF", ICON_MOD_SUBSURF, "Subdivision Surface", ""}, {eModifierType_UVProject, "UV_PROJECT", ICON_MOD_UVPROJECT, "UV Project", ""}, - {0, "", 0, "Deformers", ""}, + {0, "", 0, "Deform", ""}, {eModifierType_Armature, "ARMATURE", ICON_MOD_ARMATURE, "Armature", ""}, {eModifierType_Cast, "CAST", ICON_MOD_CAST, "Cast", ""}, {eModifierType_Curve, "CURVE", ICON_MOD_CURVE, "Curve", ""}, From c1edc2f3135f7b0f7936270b2edbdef95f7a66bf Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sun, 23 Aug 2009 22:11:19 +0000 Subject: [PATCH 225/577] * Fix for rendering wire materials --- source/blender/render/intern/source/shadeinput.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index 7887392f1d2..ede3c2e0503 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -188,11 +188,11 @@ void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr) /* copy all relevant material vars, note, keep this synced with render_types.h */ shade_input_init_material(shi); - if (shi->mat->material_type == MA_TYPE_SURFACE) { - shade_material_loop(shi, shr); - } else if (shi->mat->material_type == MA_TYPE_VOLUME) { + if (shi->mat->material_type == MA_TYPE_VOLUME) { if(R.r.mode & R_RAYTRACE) shade_volume_outside(shi, shr); + } else { /* MA_TYPE_SURFACE, MA_TYPE_WIRE */ + shade_material_loop(shi, shr); } } From 53f66e5c88d1f08ad5df83df67b0f0a27366c8df Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sun, 23 Aug 2009 22:13:56 +0000 Subject: [PATCH 226/577] 2.5 3DView: Patch by Lorenzo Pierfederici (lento). Many thanks! * Ported some more menus to python (Pose, Particle...) * Some cleanup and reorganization in the python file to reduce code. :) * Cleanup of old C buttons code. --- release/ui/space_view3d.py | 389 ++++-- source/blender/editors/include/UI_interface.h | 1 - .../editors/space_view3d/view3d_header.c | 1129 +---------------- source/blender/makesrna/intern/rna_ui_api.c | 2 - 4 files changed, 274 insertions(+), 1247 deletions(-) diff --git a/release/ui/space_view3d.py b/release/ui/space_view3d.py index 8e5bc100af1..b88ecaba5cd 100644 --- a/release/ui/space_view3d.py +++ b/release/ui/space_view3d.py @@ -24,8 +24,7 @@ class VIEW3D_HT_header(bpy.types.Header): sub.itemM("VIEW3D_MT_view") # Select Menu - if mode_string not in ('EDIT_TEXT', 'SCULPT', 'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE', 'PARTICLE'): - # XXX: Particle Mode has Select Menu. + if mode_string not in ('EDIT_TEXT', 'SCULPT', 'PAINT_WEIGHT', 'PAINT_VERTEX', 'PAINT_TEXTURE'): sub.itemM("VIEW3D_MT_select_%s" % mode_string) if edit_object: @@ -33,17 +32,44 @@ class VIEW3D_HT_header(bpy.types.Header): elif object: ob_mode_string = object.mode - if ob_mode_string == 'OBJECT': - sub.itemM("VIEW3D_MT_object") - elif ob_mode_string == 'SCULPT': - sub.itemM("VIEW3D_MT_sculpt") - elif ob_mode_string == 'VERTEX_PAINT': - sub.itemM("VIEW3D_MT_vertex_paint") + if mode_string not in ['PAINT_WEIGHT', 'PAINT_TEXTURE']: + sub.itemM("VIEW3D_MT_%s" % mode_string) layout.template_header_3D() # ********** Menu ********** +# ********** Utilities ********** + +class VIEW3D_MT_showhide(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Show/Hide" + _operator_name = "" + + def draw(self, context): + layout = self.layout + + layout.itemO("%s.reveal" % self._operator_name, text="Show Hidden") + layout.itemO("%s.hide" % self._operator_name, text="Hide Selected") + layout.item_booleanO("%s.hide" % self._operator_name, "unselected", True, text="Hide Unselected") + +class VIEW3D_MT_snap(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Snap" + + def draw(self, context): + layout = self.layout + + layout.itemO("view3d.snap_selected_to_grid") + layout.itemO("view3d.snap_selected_to_cursor") + layout.itemO("view3d.snap_selected_to_center") + + layout.itemS() + + layout.itemO("view3d.snap_cursor_to_selected") + layout.itemO("view3d.snap_cursor_to_grid") + layout.itemO("view3d.snap_cursor_to_active") + # ********** View menus ********** class VIEW3D_MT_view(bpy.types.Menu): @@ -63,30 +89,21 @@ class VIEW3D_MT_view(bpy.types.Menu): layout.item_enumO("view3d.viewnumpad", "type", 'FRONT') layout.item_enumO("view3d.viewnumpad", "type", 'RIGHT') - # layout.itemM("VIEW3D_MT_view_cameras", text="Cameras") + layout.itemM("VIEW3D_MT_view_cameras", text="Cameras") layout.itemS() - + layout.itemO("view3d.view_persportho") layout.itemS() - # layout.itemO("view3d.view_show_all_layers") - - # layout.itemS() - - # layout.itemO("view3d.view_local_view") - # layout.itemO("view3d.view_global_view") - - # layout.itemS() - layout.itemM("VIEW3D_MT_view_navigation") - # layout.itemM("VIEW3D_MT_view_align", text="Align View") + layout.itemM("VIEW3D_MT_view_align") layout.itemS() layout.operator_context = "INVOKE_REGION_WIN" - + layout.itemO("view3d.clip_border") layout.itemO("view3d.zoom_border") @@ -99,7 +116,7 @@ class VIEW3D_MT_view(bpy.types.Menu): layout.itemO("screen.region_foursplit", text="Toggle Quad View") layout.itemO("screen.screen_full_area", text="Toggle Full Screen") - + class VIEW3D_MT_view_navigation(bpy.types.Menu): __space_type__ = 'VIEW_3D' __label__ = "Navigation" @@ -107,9 +124,6 @@ class VIEW3D_MT_view_navigation(bpy.types.Menu): def draw(self, context): layout = self.layout - # layout.itemO("view3d.view_fly_mode") - # layout.itemS() - layout.items_enumO("view3d.view_orbit", "type") layout.itemS() @@ -121,6 +135,22 @@ class VIEW3D_MT_view_navigation(bpy.types.Menu): layout.item_floatO("view3d.zoom", "delta", 1.0, text="Zoom In") layout.item_floatO("view3d.zoom", "delta", -1.0, text="Zoom Out") +class VIEW3D_MT_view_align(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Align View" + + def draw(self, context): + layout = self.layout + + layout.itemO("view3d.view_center") + +class VIEW3D_MT_view_cameras(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Cameras" + + def draw(self, context): + layout = self.layout + # ********** Select menus, suffix from context.mode ********** class VIEW3D_MT_select_OBJECT(bpy.types.Menu): @@ -187,9 +217,6 @@ class VIEW3D_MT_select_PARTICLE(bpy.types.Menu): layout.itemS() - #layout.itemO("particle.select_last") - #layout.itemO("particle.select_first") - layout.itemO("particle.select_more") layout.itemO("particle.select_less") @@ -303,12 +330,12 @@ class VIEW3D_MT_select_EDIT_METABALL(bpy.types.Menu): layout.itemS() - layout.itemL(text="Select/Deselect All") - layout.itemL(text="Inverse") + layout.itemO("mball.select_deselect_all_metaelems") + layout.itemO("mball.select_inverse_metaelems") layout.itemS() - layout.itemL(text="Random") + layout.itemO("mball.select_random_metaelems") class VIEW3D_MT_select_EDIT_LATTICE(bpy.types.Menu): __space_type__ = 'VIEW_3D' @@ -363,7 +390,7 @@ class VIEW3D_MT_select_FACE(bpy.types.Menu):# XXX no matching enum # ********** Object menu ********** -class VIEW3D_MT_object(bpy.types.Menu): +class VIEW3D_MT_OBJECT(bpy.types.Menu): __space_type__ = 'VIEW_3D' __context__ = "objectmode" __label__ = "Object" @@ -371,8 +398,8 @@ class VIEW3D_MT_object(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.itemM("VIEW3D_MT_object_clear") - layout.itemM("VIEW3D_MT_object_snap") + layout.itemM("VIEW3D_MT_OBJECT_clear") + layout.itemM("VIEW3D_MT_snap") layout.itemS() @@ -388,10 +415,10 @@ class VIEW3D_MT_object(bpy.types.Menu): layout.itemS() - layout.itemM("VIEW3D_MT_object_parent") - layout.itemM("VIEW3D_MT_object_track") - layout.itemM("VIEW3D_MT_object_group") - layout.itemM("VIEW3D_MT_object_constraints") + layout.itemM("VIEW3D_MT_OBJECT_parent") + layout.itemM("VIEW3D_MT_OBJECT_track") + layout.itemM("VIEW3D_MT_OBJECT_group") + layout.itemM("VIEW3D_MT_OBJECT_constraints") layout.itemS() @@ -399,9 +426,9 @@ class VIEW3D_MT_object(bpy.types.Menu): layout.itemS() - layout.itemM("VIEW3D_MT_object_show") + layout.itemM("VIEW3D_MT_OBJECT_showhide") -class VIEW3D_MT_object_clear(bpy.types.Menu): +class VIEW3D_MT_OBJECT_clear(bpy.types.Menu): __space_type__ = 'VIEW_3D' __label__ = "Clear" @@ -413,24 +440,7 @@ class VIEW3D_MT_object_clear(bpy.types.Menu): layout.itemO("object.scale_clear") layout.itemO("object.origin_clear") -class VIEW3D_MT_object_snap(bpy.types.Menu): - __space_type__ = 'VIEW_3D' - __label__ = "Snap" - - def draw(self, context): - layout = self.layout - - layout.itemO("view3d.snap_selected_to_grid") - layout.itemO("view3d.snap_selected_to_cursor") - layout.itemO("view3d.snap_selected_to_center") - - layout.itemS() - - layout.itemO("view3d.snap_cursor_to_selected") - layout.itemO("view3d.snap_cursor_to_grid") - layout.itemO("view3d.snap_cursor_to_active") - -class VIEW3D_MT_object_parent(bpy.types.Menu): +class VIEW3D_MT_OBJECT_parent(bpy.types.Menu): __space_type__ = 'VIEW_3D' __label__ = "Parent" @@ -440,7 +450,7 @@ class VIEW3D_MT_object_parent(bpy.types.Menu): layout.itemO("object.parent_set") layout.itemO("object.parent_clear") -class VIEW3D_MT_object_track(bpy.types.Menu): +class VIEW3D_MT_OBJECT_track(bpy.types.Menu): __space_type__ = 'VIEW_3D' __label__ = "Track" @@ -450,7 +460,7 @@ class VIEW3D_MT_object_track(bpy.types.Menu): layout.itemO("object.track_set") layout.itemO("object.track_clear") -class VIEW3D_MT_object_group(bpy.types.Menu): +class VIEW3D_MT_OBJECT_group(bpy.types.Menu): __space_type__ = 'VIEW_3D' __label__ = "Group" @@ -465,7 +475,7 @@ class VIEW3D_MT_object_group(bpy.types.Menu): layout.itemO("group.objects_add_active") layout.itemO("group.objects_remove_active") -class VIEW3D_MT_object_constraints(bpy.types.Menu): +class VIEW3D_MT_OBJECT_constraints(bpy.types.Menu): __space_type__ = 'VIEW_3D' __label__ = "Constraints" @@ -475,20 +485,20 @@ class VIEW3D_MT_object_constraints(bpy.types.Menu): layout.itemO("object.constraint_add_with_targets") layout.itemO("object.constraints_clear") -class VIEW3D_MT_object_show(bpy.types.Menu): +class VIEW3D_MT_OBJECT_showhide(bpy.types.Menu): __space_type__ = 'VIEW_3D' __label__ = "Show/Hide" def draw(self, context): layout = self.layout - layout.itemO("object.restrictview_clear") - layout.itemO("object.restrictview_set") + layout.itemO("object.restrictview_clear", text="Show Hidden") + layout.itemO("object.restrictview_set", text="Hide Selected") layout.item_booleanO("object.restrictview_set", "unselected", True, text="Hide Unselected") # ********** Vertex paint menu ********** -class VIEW3D_MT_vertex_paint(bpy.types.Menu): +class VIEW3D_MT_PAINT_VERTEX(bpy.types.Menu): __space_type__ = 'VIEW_3D' __label__ = "Paint" @@ -503,7 +513,7 @@ class VIEW3D_MT_vertex_paint(bpy.types.Menu): # ********** Sculpt menu ********** -class VIEW3D_MT_sculpt(bpy.types.Menu): +class VIEW3D_MT_SCULPT(bpy.types.Menu): __space_type__ = 'VIEW_3D' __label__ = "Sculpt" @@ -537,24 +547,172 @@ class VIEW3D_MT_sculpt(bpy.types.Menu): layout.itemR(brush, "persistent") layout.itemO("sculpt.set_persistent_base") -# ********** Edit Menus, suffix from ob.type ********** - -class VIEW3D_MT_edit_snap(bpy.types.Menu): +# ********** Particle menu ********** + +class VIEW3D_MT_PARTICLE(bpy.types.Menu): __space_type__ = 'VIEW_3D' - __label__ = "Snap" + __label__ = "Particle" def draw(self, context): layout = self.layout - layout.itemO("view3d.snap_selected_to_grid") - layout.itemO("view3d.snap_selected_to_cursor") - layout.itemO("view3d.snap_selected_to_center") + particle_edit = context.tool_settings.particle_edit + + layout.itemO("particle.mirror") layout.itemS() - layout.itemO("view3d.snap_cursor_to_selected") - layout.itemO("view3d.snap_cursor_to_grid") - layout.itemO("view3d.snap_cursor_to_active") + layout.itemO("particle.remove_doubles") + layout.itemO("particle.delete") + + if particle_edit.selection_mode == 'POINT': + layout.itemO("particle.subdivide") + + layout.itemO("particle.rekey") + + layout.itemS() + + layout.itemM("VIEW3D_MT_PARTICLE_showhide") + +class VIEW3D_MT_PARTICLE_showhide(VIEW3D_MT_showhide): + _operator_name = "particle" + +# ********** Pose Menu ********** + +class VIEW3D_MT_POSE(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Pose" + + def draw(self, context): + layout = self.layout + + arm = context.active_object.data + + if arm.drawtype in ('BBONE', 'ENVELOPE'): + layout.item_enumO("tfm.transform", "mode", 'BONESIZE', text="Scale Envelope Distance") + + layout.itemM("VIEW3D_MT_POSE_transform") + + layout.itemS() + + layout.itemO("anim.insert_keyframe_menu") + layout.itemO("anim.delete_keyframe_v3d") + + layout.itemS() + + layout.itemO("pose.apply") + + layout.itemS() + + layout.itemO("pose.copy") + layout.itemO("pose.paste") + layout.item_booleanO("pose.paste", "flipped", True, text="Paste X-Flipped Pose") + + layout.itemS() + + layout.itemM("VIEW3D_MT_POSE_pose") + layout.itemM("VIEW3D_MT_POSE_motion") + layout.itemM("VIEW3D_MT_POSE_group") + + layout.itemS() + + layout.itemM("VIEW3D_MT_POSE_ik") + layout.itemM("VIEW3D_MT_POSE_constraints") + + layout.itemS() + + layout.item_enumO("pose.autoside_names", "axis", 'XAXIS', text="AutoName Left/Right") + layout.item_enumO("pose.autoside_names", "axis", 'YAXIS', text="AutoName Front/Back") + layout.item_enumO("pose.autoside_names", "axis", 'ZAXIS', text="AutoName Top/Bottom") + + layout.itemO("pose.flip_names") + + layout.itemS() + + layout.itemO("pose.armature_layers") + layout.itemO("pose.bone_layers") + + layout.itemS() + + layout.itemM("VIEW3D_MT_POSE_showhide") + layout.item_menu_enumO("pose.flags_set", 'mode', text="Bone Settings") + +class VIEW3D_MT_POSE_transform(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Clear Transform" + + def draw(self, context): + layout = self.layout + + layout.itemL(text="Clear User Transform") + + layout.itemO("pose.loc_clear") + layout.itemO("pose.rot_clear") + layout.itemO("pose.scale_clear") + + layout.itemL(text="Clear Origin") + +class VIEW3D_MT_POSE_pose(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Pose Library" + + def draw(self, context): + layout = self.layout + + layout.itemO("poselib.browse_interactive") + + layout.itemS() + + layout.itemO("poselib.pose_add") + layout.itemO("poselib.pose_rename") + layout.itemO("poselib.pose_remove") + +class VIEW3D_MT_POSE_motion(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Motion Paths" + + def draw(self, context): + layout = self.layout + + layout.itemO("pose.paths_calculate") + layout.itemO("pose.paths_clear") + +class VIEW3D_MT_POSE_group(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Bone Groups" + + def draw(self, context): + layout = self.layout + + layout.itemO("pose.group_assign") + layout.itemO("pose.group_add") + layout.itemO("pose.group_unassign") + layout.itemO("pose.group_remove") + +class VIEW3D_MT_POSE_ik(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Inverse Kinematics" + + def draw(self, context): + layout = self.layout + + layout.itemO("pose.ik_add") + layout.itemO("pose.ik_clear") + +class VIEW3D_MT_POSE_constraints(bpy.types.Menu): + __space_type__ = "VIEW_3D" + __label__ = "Constraints" + + def draw(self, context): + layout = self.layout + + layout.itemO("pose.constraint_add_with_targets") + layout.itemO("pose.constraints_clear") + +class VIEW3D_MT_POSE_showhide(VIEW3D_MT_showhide): + _operator_name = "pose" + +# ********** Edit Menus, suffix from ob.type ********** # Edit MESH class VIEW3D_MT_edit_MESH(bpy.types.Menu): @@ -571,7 +729,7 @@ class VIEW3D_MT_edit_MESH(bpy.types.Menu): layout.itemS() - layout.itemM("VIEW3D_MT_edit_snap") + layout.itemM("VIEW3D_MT_snap") layout.itemS() @@ -616,7 +774,7 @@ class VIEW3D_MT_edit_MESH_vertices(bpy.types.Menu): layout.itemO("mesh.vertices_smooth") layout.itemO("mesh.remove_doubles") - + class VIEW3D_MT_edit_MESH_edges(bpy.types.Menu): __space_type__ = 'VIEW_3D' __label__ = "Edges" @@ -642,7 +800,7 @@ class VIEW3D_MT_edit_MESH_edges(bpy.types.Menu): layout.item_enumO("mesh.edge_rotate", "direction", 'CW', text="Rotate Edge CW") layout.item_enumO("mesh.edge_rotate", "direction", 'CCW', text="Rotate Edge CCW") - + class VIEW3D_MT_edit_MESH_faces(bpy.types.Menu): __space_type__ = 'VIEW_3D' __label__ = "Faces" @@ -679,16 +837,8 @@ class VIEW3D_MT_edit_MESH_normals(bpy.types.Menu): layout.itemO("mesh.flip_normals") -class VIEW3D_MT_edit_MESH_showhide(bpy.types.Menu): - __space_type__ = 'VIEW_3D' - __label__ = "Show/Hide" - - def draw(self, context): - layout = self.layout - - layout.itemO("mesh.reveal") - layout.itemO("mesh.hide") - layout.item_booleanO("mesh.hide", "unselected", True, text="Hide Unselected") +class VIEW3D_MT_edit_MESH_showhide(VIEW3D_MT_showhide): + _operator_name = "mesh" # Edit CURVE @@ -697,8 +847,8 @@ def draw_CURVE(self, context): layout = self.layout settings = context.tool_settings - - layout.itemM("VIEW3D_MT_edit_snap") + + layout.itemM("VIEW3D_MT_snap") layout.itemS() @@ -757,16 +907,8 @@ class VIEW3D_MT_edit_CURVE_segments(bpy.types.Menu): layout.itemO("curve.subdivide") layout.itemO("curve.switch_direction") -class VIEW3D_MT_edit_CURVE_showhide(bpy.types.Menu): - __space_type__ = 'VIEW_3D' - __label__ = "Show/Hide" - - def draw(self, context): - layout = self.layout - - layout.itemO("curve.reveal") - layout.itemO("curve.hide") - layout.item_booleanO("curve.hide", "unselected", True, text="Hide Unselected") +class VIEW3D_MT_edit_CURVE_showhide(VIEW3D_MT_showhide): + _operator_name = "curve" # Edit SURFACE class VIEW3D_MT_edit_SURFACE(bpy.types.Menu): @@ -838,7 +980,7 @@ class VIEW3D_MT_edit_META(bpy.types.Menu): layout.itemS() - layout.itemM("VIEW3D_MT_edit_snap") + layout.itemM("VIEW3D_MT_snap") layout.itemS() @@ -861,8 +1003,8 @@ class VIEW3D_MT_edit_META_showhide(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.itemO("mball.reveal_metaelems") - layout.itemO("mball.hide_metaelems") + layout.itemO("mball.reveal_metaelems", text="Show Hidden") + layout.itemO("mball.hide_metaelems", text="Hide Selected") layout.item_booleanO("mball.hide_metaelems", "unselected", True, text="Hide Unselected") # Edit LATTICE @@ -875,7 +1017,7 @@ class VIEW3D_MT_edit_LATTICE(bpy.types.Menu): settings = context.tool_settings - layout.itemM("VIEW3D_MT_edit_snap") + layout.itemM("VIEW3D_MT_snap") layout.itemS() @@ -897,7 +1039,7 @@ class VIEW3D_MT_edit_ARMATURE(bpy.types.Menu): edit_object = context.edit_object arm = edit_object.data - layout.itemM("VIEW3D_MT_edit_snap") + layout.itemM("VIEW3D_MT_snap") layout.itemM("VIEW3D_MT_edit_ARMATURE_roll") if arm.drawtype == 'ENVELOPE': @@ -1108,6 +1250,8 @@ bpy.types.register(VIEW3D_HT_header) # Header bpy.types.register(VIEW3D_MT_view) #View Menus bpy.types.register(VIEW3D_MT_view_navigation) +bpy.types.register(VIEW3D_MT_view_align) +bpy.types.register(VIEW3D_MT_view_cameras) bpy.types.register(VIEW3D_MT_select_OBJECT) # Select Menus bpy.types.register(VIEW3D_MT_select_POSE) @@ -1120,20 +1264,31 @@ bpy.types.register(VIEW3D_MT_select_EDIT_LATTICE) bpy.types.register(VIEW3D_MT_select_EDIT_ARMATURE) bpy.types.register(VIEW3D_MT_select_FACE) # XXX todo -bpy.types.register(VIEW3D_MT_object) # Object Menu -bpy.types.register(VIEW3D_MT_object_clear) -bpy.types.register(VIEW3D_MT_object_snap) -bpy.types.register(VIEW3D_MT_object_parent) -bpy.types.register(VIEW3D_MT_object_track) -bpy.types.register(VIEW3D_MT_object_group) -bpy.types.register(VIEW3D_MT_object_constraints) -bpy.types.register(VIEW3D_MT_object_show) +bpy.types.register(VIEW3D_MT_OBJECT) # Object Menu +bpy.types.register(VIEW3D_MT_OBJECT_clear) +bpy.types.register(VIEW3D_MT_OBJECT_parent) +bpy.types.register(VIEW3D_MT_OBJECT_track) +bpy.types.register(VIEW3D_MT_OBJECT_group) +bpy.types.register(VIEW3D_MT_OBJECT_constraints) +bpy.types.register(VIEW3D_MT_OBJECT_showhide) -bpy.types.register(VIEW3D_MT_sculpt) # Sculpt Menu +bpy.types.register(VIEW3D_MT_SCULPT) # Sculpt Menu -bpy.types.register(VIEW3D_MT_vertex_paint) +bpy.types.register(VIEW3D_MT_PAINT_VERTEX) -bpy.types.register(VIEW3D_MT_edit_snap) # Edit Menus +bpy.types.register(VIEW3D_MT_PARTICLE) # Particle Menu +bpy.types.register(VIEW3D_MT_PARTICLE_showhide) + +bpy.types.register(VIEW3D_MT_POSE) # POSE Menu +bpy.types.register(VIEW3D_MT_POSE_transform) +bpy.types.register(VIEW3D_MT_POSE_pose) +bpy.types.register(VIEW3D_MT_POSE_motion) +bpy.types.register(VIEW3D_MT_POSE_group) +bpy.types.register(VIEW3D_MT_POSE_ik) +bpy.types.register(VIEW3D_MT_POSE_constraints) +bpy.types.register(VIEW3D_MT_POSE_showhide) + +bpy.types.register(VIEW3D_MT_snap) # Edit Menus bpy.types.register(VIEW3D_MT_edit_MESH) bpy.types.register(VIEW3D_MT_edit_MESH_vertices) diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 5f93743493a..0cb6964b39e 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -645,7 +645,6 @@ void uiTemplateImageLayers(uiLayout *layout, struct bContext *C, struct Image *i void uiTemplateRunningJobs(uiLayout *layout, struct bContext *C); void uiTemplateOperatorSearch(uiLayout *layout); void uiTemplateHeader3D(uiLayout *layout, struct bContext *C); -void uiTemplate_view3d_select_metaballmenu(uiLayout *layout, struct bContext *C); void uiTemplate_view3d_select_faceselmenu(uiLayout *layout, struct bContext *C); void uiTemplateTextureImage(uiLayout *layout, struct bContext *C, struct Tex *tex); diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 73cd65cafcd..6773985e07c 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -188,55 +188,6 @@ static void handle_view3d_lock(bContext *C) } } -/* XXX; all this context stuff... should become operator */ -void do_layer_buttons(bContext *C, short event) -{ - wmWindow *win= CTX_wm_window(C); - Scene *scene= CTX_data_scene(C); - ScrArea *sa= CTX_wm_area(C); - View3D *v3d= sa->spacedata.first; - static int oldlay= 1; - short shift, alt, ctrl; - - shift= win->eventstate->shift; - alt= win->eventstate->alt; - ctrl= win->eventstate->ctrl; - - if(v3d==0) return; - if(v3d->localview) return; - - if(event==-1 && ctrl) { - v3d->scenelock= !v3d->scenelock; - do_view3d_header_buttons(C, NULL, B_SCENELOCK); - } else if (event<0) { - if(v3d->lay== (1<<20)-1) { - if(event==-2 || shift) v3d->lay= oldlay; - } - else { - oldlay= v3d->lay; - v3d->lay= (1<<20)-1; - } - - if(v3d->scenelock) handle_view3d_lock(C); - - /* new layers might need unflushed events events */ - DAG_scene_update_flags(scene, v3d->lay); /* tags all that moves and flushes */ - } - else { - if(alt) { - if(event<11) event+= 10; - } - if(shift) { - if(v3d->lay & (1<lay -= (1<lay += (1<drawtype == OB_SHADED) reshadeall_displist(scene); -} - static int layers_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); @@ -315,403 +266,6 @@ void VIEW3D_OT_layers(wmOperatorType *ot) RNA_def_boolean(ot->srna, "extend", 0, "Extend", ""); } - -#if 0 -static void do_view3d_view_camerasmenu(bContext *C, void *arg, int event) -{ - Scene *scene= CTX_data_scene(C); - Base *base; - int i=1; - - if (event == 1) { - /* Set Active Object as Active Camera */ - /* XXX ugly hack alert */ -// G.qual |= LR_CTRLKEY; -// persptoetsen(PAD0); -// G.qual &= ~LR_CTRLKEY; - } else { - - for( base = FIRSTBASE; base; base = base->next ) { - if (base->object->type == OB_CAMERA) { - i++; - - if (event==i) { - /* XXX use api call! */ - - break; - } - } - } - } - -} - - -static uiBlock *view3d_view_camerasmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - Scene *scene= CTX_data_scene(C); - Base *base; - uiBlock *block; - short yco= 0, menuwidth=120; - int i=1; - char camname[48]; - - block= uiBeginBlock(C, ar, "view3d_view_camerasmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_view_camerasmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Active Object as Active Camera|Ctrl NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, ""); - - for( base = FIRSTBASE; base; base = base->next ) { - if (base->object->type == OB_CAMERA) { - i++; - - strcpy(camname, base->object->id.name+2); - if (base->object == scene->camera) strcat(camname, " (Active)"); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, camname, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, i, ""); - } - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 50); - return block; -} -#endif - -#if 0 -static void do_view3d_view_cameracontrolsmenu(bContext *C, void *arg, int event) -{ - switch(event) { - case 0: /* Orbit Left */ - persptoetsen(PAD4); - break; - case 1: /* Orbit Right */ - persptoetsen(PAD6); - break; - case 2: /* Orbit Up */ - persptoetsen(PAD8); - break; - case 3: /* Orbit Down */ - persptoetsen(PAD2); - break; - case 4: /* Pan left */ - /* XXX ugly hack alert */ -// G.qual |= LR_CTRLKEY; - persptoetsen(PAD4); -// G.qual &= ~LR_CTRLKEY; - break; - case 5: /* Pan right */ - /* XXX ugly hack alert */ -// G.qual |= LR_CTRLKEY; - persptoetsen(PAD6); -// G.qual &= ~LR_CTRLKEY; - break; - case 6: /* Pan up */ - /* ugly hack alert */ -// G.qual |= LR_CTRLKEY; - persptoetsen(PAD8); -// G.qual &= ~LR_CTRLKEY; - break; - case 7: /* Pan down */ - /* ugly hack alert */ -// G.qual |= LR_CTRLKEY; - persptoetsen(PAD2); -// G.qual &= ~LR_CTRLKEY; - break; - case 8: /* Zoom In */ - persptoetsen(PADPLUSKEY); - break; - case 9: /* Zoom Out */ - persptoetsen(PADMINUS); - break; - case 10: /* Reset Zoom */ - persptoetsen(PADENTER); - break; - case 11: /* Camera Fly mode */ - fly(); - break; - } -} - - -static uiBlock *view3d_view_cameracontrolsmenu(bContext *C, ARegion *ar, void *arg_unused) -{ -/* static short tog=0; */ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "view3d_view_cameracontrolsmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_view_cameracontrolsmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Camera Fly Mode|Shift F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Left|NumPad 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Right|NumPad 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Up|NumPad 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Down|NumPad 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Left|Ctrl NumPad 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Right|Ctrl NumPad 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Up|Ctrl NumPad 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Down|Ctrl NumPad 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom In|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Out|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Zoom|NumPad Enter", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 50); - return block; -} - -static void do_view3d_view_alignviewmenu(bContext *C, void *arg, int event) -{ - Scene *scene= CTX_data_scene(C); - ScrArea *sa= CTX_wm_area(C); - View3D *v3d= sa->spacedata.first; - Object *obedit = CTX_data_edit_object(C); - float *curs; - - switch(event) { - - case 0: /* Align View to Selected (edit/faceselect mode) */ - case 1: - case 2: - if ((obedit) && (obedit->type == OB_MESH)) { - editmesh_align_view_to_selected(v3d, event + 1); - } - else if (paint_facesel_test(CTX_data_active_object(C))) { - Object *obact= OBACT; - if (obact && obact->type==OB_MESH) { - Mesh *me= obact->data; - - if (me->mtface) { -// XXX faceselect_align_view_to_selected(v3d, me, event + 1); - ED_area_tag_redraw(sa); - } - } - } - break; - case 3: /* Center View to Cursor */ - curs= give_cursor(scene, v3d); - v3d->ofs[0]= -curs[0]; - v3d->ofs[1]= -curs[1]; - v3d->ofs[2]= -curs[2]; - ED_area_tag_redraw(sa); - break; - case 4: /* Align Active Camera to View */ - /* XXX This ugly hack is a symptom of the nasty persptoetsen function, - * but at least it works for now. - */ -// G.qual |= LR_CTRLKEY|LR_ALTKEY; - persptoetsen(PAD0); -// G.qual &= ~(LR_CTRLKEY|LR_ALTKEY); - break; - case 5: /* Align View to Selected (object mode) */ -// XXX mainqenter(PADASTERKEY, 1); - break; - case 6: /* Center View and Cursor to Origin */ - WM_operator_name_call(C, "VIEW3D_OT_view_center", WM_OP_EXEC_REGION_WIN, NULL); - curs= give_cursor(scene, v3d); - curs[0]=curs[1]=curs[2]= 0.0; - break; - } -} - -static uiBlock *view3d_view_alignviewmenu(bContext *C, ARegion *ar, void *arg_unused) -{ -/* static short tog=0; */ - uiBlock *block; - Object *obedit = CTX_data_edit_object(C); - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "view3d_view_alignviewmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_view_alignviewmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center View to Cursor|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center Cursor and View All|Shift C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align Active Camera to View|Ctrl Alt NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - - if (((obedit) && (obedit->type == OB_MESH)) || (paint_facesel_test(CTX_data_active_object(C)))) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Top)|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Front)|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Side)|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected|NumPad *", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 50); - return block; -} -#endif - -#if 0 -static uiBlock *view3d_view_spacehandlers(bContext *C, ARegion *ar, void *arg_unused) -{ - /* XXX */ - return NULL; -} - - -static void do_view3d_viewmenu(bContext *C, void *arg, int event) -{ - - switch(event) { - case 0: /* User */ - break; - case 1: /* Camera */ - break; - case 2: /* Top */ - break; - case 3: /* Front */ - break; - case 4: /* Side */ - break; - case 5: /* Perspective */ - break; - case 6: /* Orthographic */ - break; - case 7: /* Local View */ - break; - case 8: /* Global View */ - break; - case 9: /* View All (Home) */ - WM_operator_name_call(C, "VIEW3D_OT_view_all", WM_OP_EXEC_REGION_WIN, NULL); - break; - case 11: /* View Selected */ - WM_operator_name_call(C, "VIEW3D_OT_view_center", WM_OP_EXEC_REGION_WIN, NULL); - break; - case 13: /* Play Back Animation */ - break; - case 15: /* Background Image... */ -// add_blockhandler(sa, VIEW3D_HANDLER_BACKGROUND, UI_PNL_UNSTOW); - break; - case 16: /* View Panel */ -// add_blockhandler(sa, VIEW3D_HANDLER_PROPERTIES, UI_PNL_UNSTOW); - break; - case 17: /* Set Clipping Border */ - WM_operator_name_call(C, "VIEW3D_OT_clip_border", WM_OP_INVOKE_REGION_WIN, NULL); - break; - case 18: /* render preview */ -// toggle_blockhandler(sa, VIEW3D_HANDLER_PREVIEW, 0); - break; - case 19: /* zoom within border */ -// view3d_border_zoom(); - break; - case 20: /* Transform Space Panel */ -// add_blockhandler(sa, VIEW3D_HANDLER_TRANSFORM, UI_PNL_UNSTOW); - break; - case 21: /* Grease Pencil */ -// add_blockhandler(sa, VIEW3D_HANDLER_GREASEPENCIL, UI_PNL_UNSTOW); - break; - case 22: /* View all layers */ - do_layer_buttons(C, -2); - break; - } -} -#endif - -#if 0 -static uiBlock *view3d_viewmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - ScrArea *sa= CTX_wm_area(C); - View3D *v3d= sa->spacedata.first; - RegionView3D *rv3d= wm_region_view3d(C); - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "view3d_viewmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_viewmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Orientations...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 20, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Render Preview...|Shift P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 18, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "View Properties...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 16, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Background Image...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 15, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Grease Pencil...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 21, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if ((rv3d->viewbut == 0) && !(rv3d->persp == V3D_CAMOB)) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "User", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "User", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - if (rv3d->persp == V3D_CAMOB) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Camera|NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Camera|NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - if (rv3d->viewbut == 1) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Top|NumPad 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Top|NumPad 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - if (rv3d->viewbut == 2) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Front|NumPad 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Front|NumPad 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - if (rv3d->viewbut == 3) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Side|NumPad 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Side|NumPad 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - - uiDefIconTextBlockBut(block, view3d_view_camerasmenu, NULL, ICON_RIGHTARROW_THIN, "Cameras", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(rv3d->persp==V3D_PERSP) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Perspective|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Perspective|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - if(rv3d->persp==V3D_ORTHO) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Orthographic|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Orthographic|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(v3d->lay== (1<<20)-1) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Previous Layers|Shift ~", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 22, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show All Layers| ~", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 22, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(v3d->localview) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - if(!v3d->localview) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_view_cameracontrolsmenu, NULL, ICON_RIGHTARROW_THIN, "View Navigation", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_view_alignviewmenu, NULL, ICON_RIGHTARROW_THIN, "Align View", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(rv3d->rflag & RV3D_CLIPPING) - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Clipping Border|Alt B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 17, ""); - else - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Clipping Border|Alt B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 17, ""); - if (rv3d->persp==V3D_ORTHO) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Within Border...|Shift B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 19, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, ""); - if(!sa->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 99, ""); - else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 99, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation|Alt A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 13, ""); - -#ifndef DISABLE_PYTHON - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBlockBut(block, view3d_view_spacehandlers, NULL, ICON_RIGHTARROW_THIN, "Space Handler Scripts", 0, yco-=20, 120, 19, ""); -#endif - - if(ar->alignment==RGN_ALIGN_TOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} -#endif - #if 0 void do_view3d_select_object_typemenu(bContext *C, void *arg, int event) { @@ -932,23 +486,6 @@ static uiBlock *view3d_select_object_groupedmenu(bContext *C, ARegion *ar, void #endif -static void view3d_select_metaballmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border"); - uiItemS(layout); - uiItemO(layout, NULL, 0, "MBALL_OT_select_deselect_all_metaelems"); - uiItemO(layout, NULL, 0, "MBALL_OT_select_inverse_metaelems"); - uiItemS(layout); - uiItemO(layout, NULL, 0, "MBALL_OT_select_random_metaelems"); -} - -/* wrapper for python layouts */ -void uiTemplate_view3d_select_metaballmenu(uiLayout *layout, bContext *C) -{ - void *arg_unused = NULL; - view3d_select_metaballmenu(C, layout, arg_unused); -} - void do_view3d_select_faceselmenu(bContext *C, void *arg, int event) { #if 0 @@ -1027,19 +564,6 @@ void uiTemplate_view3d_select_faceselmenu(uiLayout *layout, bContext *C) view3d_select_faceselmenu(C, ar, arg_unused); } -static void view3d_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_selected_to_grid"); - uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_selected_to_cursor"); - uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_selected_to_center"); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_cursor_to_selected"); - uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_cursor_to_grid"); - uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_cursor_to_active"); -} - #if 0 void do_view3d_transform_moveaxismenu(bContext *C, void *arg, int event) { @@ -1813,618 +1337,6 @@ static void do_view3d_edit_objectmenu(bContext *C, void *arg, int event) } #endif -#if 0 -/* visible buttons ported to python, check ifedout buttons */ -static void view3d_edit_mesh_verticesmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, "Merge...", 0, "MESH_OT_merge"); - uiItemO(layout, "Rip", 0, "MESH_OT_rip"); - uiItemO(layout, "Split", 0, "MESH_OT_split"); - uiItemO(layout, "Separate", 0, "MESH_OT_separate"); - - uiItemS(layout); - - uiItemO(layout, "Smooth", 0, "MESH_OT_vertices_smooth"); - uiItemO(layout, "Remove Doubles", 0, "MESH_OT_remove_doubles"); - -#if 0 - uiItemS(layout); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Vertex Parent|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); // add_hook_menu(); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Hook|Ctrl H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); // make_parent(); -#endif -} -#endif - -#if 0 -/* visible buttons ported to python, check ifedout buttons */ -static void view3d_edit_mesh_edgesmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "MESH_OT_edge_face_add"); - -#if 0 - uiItemO(layout, "Bevel", 0, "MESH_OT_bevel"); // bevelmenu(em) - uiItemO(layout, "Loop Subdivide...", 0, "MESH_OT_loop_subdivide"); // Ctr R, CutEdgeloop(1); - uiItemO(layout, "Knife Subdivide...", 0, "MESH_OT_loop_subdivide"); // Shift K, KnifeSubdivide(KNIFE_PROMPT); - - uiItemS(layout); -#endif - - uiItemO(layout, "Subdivide", 0, "MESH_OT_subdivide"); - uiItemFloatO(layout, "Subdivide Smooth", 0, "MESH_OT_subdivide", "smoothness", 1.0f); - - uiItemS(layout); - - uiItemO(layout, "Mark Seam", 0, "MESH_OT_mark_seam"); - uiItemBooleanO(layout, "Clear Seam", 0, "MESH_OT_mark_seam", "clear", 1); - - uiItemS(layout); - - uiItemO(layout, "Mark Sharp", 0, "MESH_OT_mark_sharp"); - uiItemBooleanO(layout, "Clear Sharp", 0, "MESH_OT_mark_sharp", "clear", 1); - -#if 0 - uiItemS(layout); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Adjust Bevel Weight|Ctrl Shift E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Crease SubSurf|Shift E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); -#endif - - uiItemS(layout); - - uiItemEnumO(layout, "Rotate Edge CW", 0, "MESH_OT_edge_rotate", "direction", 1); - uiItemEnumO(layout, "Rotate Edge CCW", 0, "MESH_OT_edge_rotate", "direction", 2); - -#if 0 - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Slide Edge |Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Edge Loop|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Collapse", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, ""); -#endif -} -#endif - -#if 0 -void do_view3d_edit_mirrormenu(bContext *C, void *arg, int event) -{ - float mat[3][3]; - - Mat3One(mat); - - switch(event) { - case 0: - initTransform(TFM_MIRROR, CTX_NO_PET); - Transform(); - break; - case 1: - initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM); - BIF_setSingleAxisConstraint(mat[0], " on global X axis"); - Transform(); - break; - case 2: - initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM); - BIF_setSingleAxisConstraint(mat[1], " on global Y axis"); - Transform(); - break; - case 3: - initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM); - BIF_setSingleAxisConstraint(mat[2], "on global Z axis"); - Transform(); - break; - case 4: - initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM); - BIF_setLocalAxisConstraint('X', " on local X axis"); - Transform(); - break; - case 5: - initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM); - BIF_setLocalAxisConstraint('Y', " on local Y axis"); - Transform(); - break; - case 6: - initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM); - BIF_setLocalAxisConstraint('Z', " on local Z axis"); - Transform(); - break; - } -} - -static uiBlock *view3d_edit_mirrormenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiBeginBlock(C, ar, "view3d_edit_mirrormenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_mirrormenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Interactive Mirror|Ctrl M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Global|Ctrl M, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Global|Ctrl M, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Global|Ctrl M, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Local|Ctrl M, X X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Local|Ctrl M, Y Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Local|Ctrl M, Z Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} -#endif - -#ifndef DISABLE_PYTHON -#if 0 -static void do_view3d_edit_mesh_scriptsmenu(bContext *C, void *arg, int event) -{ - BPY_menu_do_python(PYMENU_MESH, event); -} - -static uiBlock *view3d_edit_mesh_scriptsmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; -// short yco = 20, menuwidth = 120; -// XXX BPyMenu *pym; -// int i = 0; - - block= uiBeginBlock(C, ar, "v3d_emesh_pymenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_mesh_scriptsmenu, NULL); - -// for (pym = BPyMenuTable[PYMENU_MESH]; pym; pym = pym->next, i++) { -// uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, i, pym->tooltip?pym->tooltip:pym->filename); -// } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} -#endif -#endif /* DISABLE_PYTHON */ - -#if 0 -static void do_view3d_edit_meshmenu(bContext *C, void *arg, int event) -{ - ScrArea *sa= CTX_wm_area(C); - - switch(event) { - - case 2: /* transform properties */ - add_blockhandler(sa, VIEW3D_HANDLER_OBJECT, 0); - break; - case 4: /* insert keyframe */ - common_insertkey(); - break; - case 16: /* delete keyframe */ - common_deletekey(); - break; - } -} -#endif - -#if 0 -/* visible buttons ported to python, check ifedout buttons */ -static void view3d_edit_meshmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - Scene *scene= CTX_data_scene(C); - ToolSettings *ts= CTX_data_tool_settings(C); - PointerRNA tsptr; - - RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &tsptr); - - uiItemO(layout, "Undo Editing", 0, "ED_OT_undo"); - uiItemO(layout, "Redo Editing", 0, "ED_OT_redo"); - -#if 0 - uiDefIconTextBlockBut(block, editmode_undohistorymenu, NULL, ICON_RIGHTARROW_THIN, "Undo History", 0, yco-=20, 120, 19, ""); -#endif - - uiItemS(layout); - -#if 0 - uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); -#endif - - uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu, NULL); - - uiItemS(layout); - -#if 0 - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Keyframe|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); - - uiItemS(layout); -#endif - - uiItemO(layout, NULL, 0, "UV_OT_mapping_menu"); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "MESH_OT_extrude"); - uiItemO(layout, NULL, 0, "MESH_OT_duplicate"); - uiItemO(layout, "Delete...", 0, "MESH_OT_delete"); - - uiItemS(layout); - - uiItemMenuF(layout, "Vertices", 0, view3d_edit_mesh_verticesmenu, NULL); - uiItemMenuF(layout, "Edges", 0, view3d_edit_mesh_edgesmenu, NULL); - uiItemMenuF(layout, "Faces", 0, view3d_edit_mesh_facesmenu, NULL); - uiItemMenuF(layout, "Normals", 0, view3d_edit_mesh_normalsmenu, NULL); - - uiItemS(layout); - - uiItemR(layout, NULL, 0, &tsptr, "automerge_editing", 0); - uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0); // |O - uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); // |Shift O - - uiItemS(layout); - - uiItemMenuF(layout, "Show/Hide", 0, view3d_edit_mesh_showhidemenu, NULL); - -#if 0 -#ifndef DISABLE_PYTHON - uiItemS(layout); - uiDefIconTextBlockBut(block, view3d_edit_mesh_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Scripts", 0, yco-=20, 120, 19, ""); -#endif -#endif -} -#endif - -#if 0 -/* visible buttons ported to python, check ifedout buttons */ -static void view3d_edit_curve_controlpointsmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - Object *obedit= CTX_data_edit_object(C); - - if(obedit->type == OB_CURVE) { - uiItemEnumO(layout, NULL, 0, "TFM_OT_transform", "mode", TFM_TILT); - uiItemO(layout, NULL, 0, "CURVE_OT_tilt_clear"); - uiItemO(layout, NULL, 0, "CURVE_OT_separate"); - - uiItemS(layout); - - uiItemEnumO(layout, NULL, 0, "CURVE_OT_handle_type_set", "type", 1); - uiItemEnumO(layout, NULL, 0, "CURVE_OT_handle_type_set", "type", 3); - uiItemEnumO(layout, NULL, 0, "CURVE_OT_handle_type_set", "type", 2); - - uiItemS(layout); - } - - // XXX uiItemO(layout, NULL, 0, "OBJECT_OT_make_vertex_parent"); Make VertexParent|Ctrl P - // make_parent() - // XXX uiItemO(layout, NULL, 0, "OBJECT_OT_add_hook"); Add Hook| Ctrl H - // add_hook_menu() -} -#endif - -#if 0 -/* visible buttons ported to python, check ifedout buttons */ -static void view3d_edit_curvemenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - Scene *scene= CTX_data_scene(C); - ToolSettings *ts= CTX_data_tool_settings(C); - PointerRNA tsptr; - - RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &tsptr); - -#if 0 - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, ""); -#endif - - uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu, NULL); - - uiItemS(layout); - - // XXX uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - // common_insertkey(); - // XXX uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Keyframe|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); - // common_deletekey(); - - - uiItemO(layout, NULL, 0, "CURVE_OT_extrude"); - uiItemO(layout, NULL, 0, "CURVE_OT_duplicate"); - uiItemO(layout, NULL, 0, "CURVE_OT_separate"); - uiItemO(layout, NULL, 0, "CURVE_OT_make_segment"); - uiItemO(layout, NULL, 0, "CURVE_OT_cyclic_toggle"); - uiItemO(layout, NULL, 0, "CURVE_OT_delete"); // Delete... - - uiItemS(layout); - - uiItemMenuF(layout, "Control Points", 0, view3d_edit_curve_controlpointsmenu, NULL); - uiItemMenuF(layout, "Segments", 0, view3d_edit_curve_segmentsmenu, NULL); - - uiItemS(layout); - - uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0); // |O - uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); // |Shift O - - uiItemS(layout); - - uiItemMenuF(layout, "Show/Hide Control Points", 0, view3d_edit_curve_showhidemenu, NULL); -} -#endif - -#if 0 -/* visible buttons ported to python, check ifedout buttons */ -static void view3d_edit_latticemenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - Scene *scene= CTX_data_scene(C); - ToolSettings *ts= CTX_data_tool_settings(C); - PointerRNA tsptr; - - RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &tsptr); - -#if 0 - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, ""); -#endif - - uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu, NULL); - - uiItemS(layout); - - // XXX uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - // common_insertkey(); - // XXX uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Keyframe|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); - // common_deletekey(); - - uiItemO(layout, NULL, 0, "LATTICE_OT_make_regular"); - - uiItemS(layout); - - uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0); // |O - uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); // |Shift O -} -#endif - -#if 0 -static void do_view3d_edit_armaturemenu(bContext *C, void *arg, int event) -{ - static short numcuts= 2; - - switch(event) { - case 0: /* Undo Editing */ - remake_editArmature(); - break; - - case 6: /* Shear */ - initTransform(TFM_SHEAR, CTX_NONE); - Transform(); - break; - case 7: /* Warp */ - initTransform(TFM_WARP, CTX_NONE); - Transform(); - case 23: /* bone sketching panel */ - add_blockhandler(curarea, VIEW3D_HANDLER_BONESKETCH, UI_PNL_UNSTOW); - break; - } -} -#endif - -#if 0 -/* visible buttons ported to python, check ifedout buttons */ -static void view3d_edit_armaturemenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - Object *obedit = CTX_data_edit_object(C); - bArmature *arm= obedit->data; - -#if 0 - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Bone Sketching|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 23, ""); - uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, ""); -#endif - uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu, NULL); - uiItemMenuF(layout, "Bone Roll", 0, view3d_edit_armature_rollmenu, NULL); - - if (arm->drawtype == ARM_ENVELOPE) - uiItemEnumO(layout, "Scale Envelope Distance", 0, "TFM_OT_transform", "mode", TFM_BONESIZE); - else - uiItemEnumO(layout, "Scale B-Bone Width", 0, "TFM_OT_transform", "mode", TFM_BONESIZE); - - uiItemS(layout); - - uiItemO(layout, "Extrude", 0, "ARMATURE_OT_extrude"); - if (arm->flag & ARM_MIRROR_EDIT) - uiItemBooleanO(layout, "Extrude Forked", 0, "ARMATURE_OT_extrude", "forked", 1); - - uiItemO(layout, NULL, 0, "ARMATURE_OT_duplicate"); - uiItemO(layout, NULL, 0, "ARMATURE_OT_merge"); - uiItemO(layout, NULL, 0, "ARMATURE_OT_fill"); - uiItemO(layout, NULL, 0, "ARMATURE_OT_delete"); - uiItemO(layout, NULL, 0, "ARMATURE_OT_separate"); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "ARMATURE_OT_subdivide_simple"); - uiItemO(layout, NULL, 0, "ARMATURE_OT_subdivide_multi"); - - uiItemEnumO(layout, "AutoName Left/Right", 0, "ARMATURE_OT_autoside_names", "axis", 0); - uiItemEnumO(layout, "AutoName Front/Back", 0, "ARMATURE_OT_autoside_names", "axis", 1); - uiItemEnumO(layout, "AutoName Top/Bottom", 0, "ARMATURE_OT_autoside_names", "axis", 2); - - uiItemO(layout, "Flip Left/Right Names", 0, "ARMATURE_OT_flip_names"); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "ARMATURE_OT_armature_layers"); - uiItemO(layout, NULL, 0, "ARMATURE_OT_bone_layers"); - - uiItemS(layout); - - uiItemMenuF(layout, "Parent", 0, view3d_edit_armature_parentmenu, NULL); - - uiItemS(layout); - - uiItemMenuF(layout, "Bone Settings ", 0, view3d_edit_armature_settingsmenu, NULL); -} -#endif - -static void view3d_pose_armature_transformmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - //uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear User Transform|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - //used: clear_user_transform(scene, ob); - //uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiItemO(layout, NULL, 0, "POSE_OT_loc_clear"); - uiItemO(layout, NULL, 0, "POSE_OT_rot_clear"); - uiItemO(layout, NULL, 0, "POSE_OT_scale_clear"); - - // ??? - //uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Origin|Alt O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - //used:clear_object('o'); -} - -static void view3d_pose_armature_showhidemenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, "Show Hidden", 0, "POSE_OT_reveal"); - - uiItemO(layout, "Hide Selected", 0, "POSE_OT_hide"); - uiItemBooleanO(layout, "Hide Unselected", 0, "POSE_OT_hide", "unselected", 1); -} - -static void view3d_pose_armature_ikmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "POSE_OT_ik_add"); - uiItemO(layout, NULL, 0, "POSE_OT_ik_clear"); -} - -static void view3d_pose_armature_constraintsmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "POSE_OT_constraint_add_with_targets"); - uiItemO(layout, NULL, 0, "POSE_OT_constraints_clear"); -} - -static void view3d_pose_armature_groupmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, "Add Selected to Active Group", 0, "POSE_OT_group_assign"); - //uiItemO(layout, "Add Selected to Group", 0, "POSE_OT_group_assign"); - - uiItemO(layout, "Add New Group", 0, "POSE_OT_group_add"); - - uiItemO(layout, "Remove from All Groups", 0, "POSE_OT_group_unassign"); - uiItemO(layout, "Remove Active Group", 0, "POSE_OT_group_remove"); -} - -static void view3d_pose_armature_motionpathsmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "POSE_OT_paths_calculate"); - uiItemO(layout, NULL, 0, "POSE_OT_paths_clear"); -} - -static void view3d_pose_armature_poselibmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "POSELIB_OT_browse_interactive"); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "POSELIB_OT_pose_add"); - uiItemO(layout, NULL, 0, "POSELIB_OT_pose_rename"); - uiItemO(layout, NULL, 0, "POSELIB_OT_pose_remove"); -} - -static void view3d_pose_armature_settingsmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemEnumO(layout, "Toggle a Setting", 0, "POSE_OT_flags_set", "mode", 2); - uiItemEnumO(layout, "Enable a Setting", 0, "POSE_OT_flags_set", "mode", 1); - uiItemEnumO(layout, "Disable a Setting", 0, "POSE_OT_flags_set", "mode", 0); -} - -#if 0 -static void do_view3d_pose_armaturemenu(bContext *C, void *arg, int event) -{ - Object *ob; - ob=OBACT; - - switch(event) { - case 5: - pose_copy_menu(); - break; - case 15: - pose_relax(); - break; - } -} -#endif - -static void view3d_pose_armaturemenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - Object *ob = CTX_data_active_object(C); - bArmature *arm= ob->data; - -#if 0 // XXX to be ported, using uiItemMenuF(layout, "", 0, view3d_pose_armature_menu); - uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); -#endif - if ( (arm) && ((arm->drawtype == ARM_B_BONE) || (arm->drawtype == ARM_ENVELOPE)) ) - uiItemEnumO(layout, "Scale Envelope Distance", 0, "TFM_OT_transform", "mode", TFM_BONESIZE); - uiItemMenuF(layout, "Clear Transform", 0, view3d_pose_armature_transformmenu, NULL); - - uiItemS(layout); - - // TODO: these operators may get renamed - uiItemO(layout, NULL, 0, "ANIM_OT_insert_keyframe_menu"); - uiItemO(layout, NULL, 0, "ANIM_OT_delete_keyframe_v3d"); - - uiItemS(layout); - -#if 0 - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Relax Pose|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); -#endif - uiItemO(layout, NULL, 0, "POSE_OT_apply"); - - uiItemS(layout); - - uiItemO(layout, "Copy Current Pose", 0, "POSE_OT_copy"); - uiItemO(layout, "Paste Pose", 0, "POSE_OT_paste"); - uiItemBooleanO(layout, "Paste X-Flipped Pose", 0, "POSE_OT_paste", "flipped", 1); - - uiItemS(layout); - - uiItemMenuF(layout, "Pose Library", 0, view3d_pose_armature_poselibmenu, NULL); - uiItemMenuF(layout, "Motion Paths", 0, view3d_pose_armature_motionpathsmenu, NULL); - uiItemMenuF(layout, "Bone Groups", 0, view3d_pose_armature_groupmenu, NULL); - - uiItemS(layout); - - uiItemMenuF(layout, "Inverse Kinematics", 0, view3d_pose_armature_ikmenu, NULL); - uiItemMenuF(layout, "Constraints", 0, view3d_pose_armature_constraintsmenu, NULL); - - uiItemS(layout); - - uiItemEnumO(layout, "AutoName Left/Right", 0, "POSE_OT_autoside_names", "axis", 0); - uiItemEnumO(layout, "AutoName Front/Back", 0, "POSE_OT_autoside_names", "axis", 1); - uiItemEnumO(layout, "AutoName Top/Bottom", 0, "POSE_OT_autoside_names", "axis", 2); - - uiItemO(layout, "Flip Left/Right Names", 0, "POSE_OT_flip_names"); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "POSE_OT_armature_layers"); - uiItemO(layout, NULL, 0, "POSE_OT_bone_layers"); - - uiItemS(layout); - - uiItemMenuF(layout, "Show/Hide Bones", 0, view3d_pose_armature_showhidemenu, NULL); - uiItemMenuF(layout, "Bone Settings", 0, view3d_pose_armature_settingsmenu, NULL); - -#if 0 - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Attributes...|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); -#endif -} /* texture paint menu (placeholder, no items yet??) */ static void do_view3d_tpaintmenu(bContext *C, void *arg, int event) @@ -2622,39 +1534,6 @@ static uiBlock *view3d_faceselmenu(bContext *C, ARegion *ar, void *arg_unused) return block; } -static void view3d_particle_showhidemenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "PARTICLE_OT_reveal"); - uiItemO(layout, NULL, 0, "PARTICLE_OT_hide"); - uiItemBooleanO(layout, "Hide Unselected", 0, "PARTICLE_OT_hide", "unselected", 1); -} - -static void view3d_particlemenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - ToolSettings *ts= CTX_data_tool_settings(C); - - // XXX uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Particle Edit Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - // add_blockhandler(sa, VIEW3D_HANDLER_OBJECT, UI_PNL_UNSTOW); - // XXX uiItemS(layout); - // - // XXX uiDefIconTextBut(block, BUTM, 1, (pset->flag & PE_X_MIRROR)? ICON_CHECKBOX_HLT: ICON_CHECKBOX_DEHLT, "X-Axis Mirror Editing", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - // pset->flag ^= PE_X_MIRROR; - - uiItemO(layout, NULL, 0, "PARTICLE_OT_mirror"); // |Ctrl M - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "PARTICLE_OT_remove_doubles"); // |W, 5 - uiItemO(layout, NULL, 0, "PARTICLE_OT_delete"); - if(ts->particle.selectmode & SCE_SELECT_POINT) - uiItemO(layout, NULL, 0, "PARTICLE_OT_subdivide"); // |W, 2 - uiItemO(layout, NULL, 0, "PARTICLE_OT_rekey"); // |W, 1 - - uiItemS(layout); - - uiItemMenuF(layout, "Show/Hide Particles", 0, view3d_particle_showhidemenu, NULL); -} - static char *view3d_modeselect_pup(Scene *scene) { Object *ob= OBACT; @@ -2998,15 +1877,11 @@ static void view3d_header_pulldowns(const bContext *C, uiBlock *block, Object *o } } else if(ob && ob->mode & OB_MODE_PARTICLE_EDIT) { - xmax= GetButStringLength("Particle"); - uiDefMenuBut(block, view3d_particlemenu, NULL, "Particle", xco,yco, xmax-3, 20, ""); - xco+= xmax; + /* ported to python */ } else { if (ob && (ob->mode & OB_MODE_POSE)) { - xmax= GetButStringLength("Pose"); - uiDefMenuBut(block, view3d_pose_armaturemenu, NULL, "Pose", xco,yco, xmax-3, 20, ""); - xco+= xmax; + /* ported to python */ } } diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 587ff57a0b5..7fc2d75a708 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -311,8 +311,6 @@ void RNA_api_ui_layout(StructRNA *srna) func= RNA_def_function(srna, "template_header_3D", "uiTemplateHeader3D"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); - func= RNA_def_function(srna, "view3d_select_metaballmenu", "uiTemplate_view3d_select_metaballmenu"); - RNA_def_function_flag(func, FUNC_USE_CONTEXT); func= RNA_def_function(srna, "view3d_select_faceselmenu", "uiTemplate_view3d_select_faceselmenu"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); From 6ddcb4774609d882ce869a0fe60a3c0516129d58 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sun, 23 Aug 2009 22:19:45 +0000 Subject: [PATCH 227/577] * Fix for volume materials + AAO --- source/blender/render/intern/source/occlusion.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/render/intern/source/occlusion.c b/source/blender/render/intern/source/occlusion.c index a24454a38c4..a15377a8c6d 100644 --- a/source/blender/render/intern/source/occlusion.c +++ b/source/blender/render/intern/source/occlusion.c @@ -663,7 +663,7 @@ static OcclusionTree *occ_tree_build(Render *re) if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak; else vlr++; - if(vlr->mat->mode & MA_TRACEBLE) { + if((vlr->mat->mode & MA_TRACEBLE) && (vlr->mat->material_type == MA_TYPE_SURFACE)) { tree->face[b].obi= c; tree->face[b].facenr= a; tree->occlusion[b]= 1.0f; From 3eed35ada1f30aa1cdddca1556ed4f83bc57a930 Mon Sep 17 00:00:00 2001 From: William Reynish Date: Sun, 23 Aug 2009 22:22:58 +0000 Subject: [PATCH 228/577] Adjusted spacing of header items. Made toggle buttons less wide, with less extra space around them Made number widgets wider to allow larger numbers, such as the current frame field in the timeline. --- release/ui/space_time.py | 2 +- source/blender/editors/interface/interface_layout.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/release/ui/space_time.py b/release/ui/space_time.py index bfa4d5b6485..6e4b5beb161 100644 --- a/release/ui/space_time.py +++ b/release/ui/space_time.py @@ -22,7 +22,7 @@ class TIME_HT_header(bpy.types.Header): sub.itemM("TIME_MT_frame") sub.itemM("TIME_MT_playback") - layout.itemR(scene, "use_preview_range", text="PR", toggle=True) + layout.itemR(scene, "use_preview_range", text="PR") row = layout.row(align=True) if not scene.use_preview_range: diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 8676fe62a3a..3b4471bd4b9 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -793,11 +793,11 @@ static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PropertyRNA } else if(ui_layout_vary_direction(layout) == UI_ITEM_VARY_X) { if(type == PROP_BOOLEAN && strcmp(name, "") != 0) - w += UI_UNIT_X; + w += UI_UNIT_X/5; else if(type == PROP_ENUM) w += UI_UNIT_X/2; else if(type == PROP_FLOAT || type == PROP_INT) - w += UI_UNIT_X*2; + w += UI_UNIT_X*3; } *r_w= w; From ac44d73acdb5297d3e0a177b00a03ef8cca5e696 Mon Sep 17 00:00:00 2001 From: William Reynish Date: Mon, 24 Aug 2009 00:01:09 +0000 Subject: [PATCH 229/577] Made menu text more consistent, using '...' when a menu item spawns a popup or confirmation, and removing redundant starting words in submenus. Also added notifiers for user prefs, and tweaked wave modifier layout. --- release/ui/buttons_data_modifier.py | 34 ++++-- release/ui/space_view3d.py | 113 ++++++++++--------- source/blender/makesrna/intern/rna_userdef.c | 7 ++ 3 files changed, 87 insertions(+), 67 deletions(-) diff --git a/release/ui/buttons_data_modifier.py b/release/ui/buttons_data_modifier.py index 9b2481b0195..bc41b04d32c 100644 --- a/release/ui/buttons_data_modifier.py +++ b/release/ui/buttons_data_modifier.py @@ -397,19 +397,29 @@ class DATA_PT_modifiers(DataButtonsPanel): col = split.column() col.itemR(md, "normals") - sub = col.row(align=True) + sub = col.column() sub.active = md.normals - sub.itemR(md, "x_normal", text="X", toggle=True) - sub.itemR(md, "y_normal", text="Y", toggle=True) - sub.itemR(md, "z_normal", text="Z", toggle=True) + sub.itemR(md, "x_normal", text="X") + sub.itemR(md, "y_normal", text="Y") + sub.itemR(md, "z_normal", text="Z") - flow = layout.column_flow() - flow.itemR(md, "time_offset") - flow.itemR(md, "lifetime") - flow.itemR(md, "damping_time") - flow.itemR(md, "falloff_radius") - flow.itemR(md, "start_position_x") - flow.itemR(md, "start_position_y") + split = layout.split() + + col = split.column() + col.itemL(text="Time:") + sub = col.column(align=True) + sub.itemR(md, "time_offset", text="Offset") + sub.itemR(md, "lifetime", text="Life") + col.itemR(md, "damping_time", text="Damping") + + col = split.column() + col.itemL(text="Position:") + sub = col.column(align=True) + sub.itemR(md, "start_position_x", text="X") + sub.itemR(md, "start_position_y", text="Y") + col.itemR(md, "falloff_radius", text="Falloff") + + layout.itemS() layout.itemR(md, "start_position_object") layout.item_pointerR(md, "vertex_group", ob, "vertex_groups") @@ -420,6 +430,8 @@ class DATA_PT_modifiers(DataButtonsPanel): elif md.texture_coordinates == 'OBJECT': layout.itemR(md, "texture_coordinates_object") + layout.itemS() + flow = layout.column_flow() flow.itemR(md, "speed", slider=True) flow.itemR(md, "height", slider=True) diff --git a/release/ui/space_view3d.py b/release/ui/space_view3d.py index b88ecaba5cd..ae17307080f 100644 --- a/release/ui/space_view3d.py +++ b/release/ui/space_view3d.py @@ -60,15 +60,15 @@ class VIEW3D_MT_snap(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.itemO("view3d.snap_selected_to_grid") - layout.itemO("view3d.snap_selected_to_cursor") - layout.itemO("view3d.snap_selected_to_center") + layout.itemO("view3d.snap_selected_to_grid", text="Selection to Grid") + layout.itemO("view3d.snap_selected_to_cursor", text="Selection to Cursor") + layout.itemO("view3d.snap_selected_to_center", text="Selection to Center") layout.itemS() - layout.itemO("view3d.snap_cursor_to_selected") - layout.itemO("view3d.snap_cursor_to_grid") - layout.itemO("view3d.snap_cursor_to_active") + layout.itemO("view3d.snap_cursor_to_selected", text="Cursor to Selected") + layout.itemO("view3d.snap_cursor_to_grid", text="Cursor to Grid") + layout.itemO("view3d.snap_cursor_to_active", text="Cursor to Active") # ********** View menus ********** @@ -104,8 +104,8 @@ class VIEW3D_MT_view(bpy.types.Menu): layout.operator_context = "INVOKE_REGION_WIN" - layout.itemO("view3d.clip_border") - layout.itemO("view3d.zoom_border") + layout.itemO("view3d.clip_border", text="Clipping Border...") + layout.itemO("view3d.zoom_border", text="Zoom Border...") layout.itemS() @@ -168,8 +168,8 @@ class VIEW3D_MT_select_OBJECT(bpy.types.Menu): layout.itemO("object.select_inverse", text="Inverse") layout.itemO("object.select_random", text="Random") layout.itemO("object.select_by_layer", text="Select All by Layer") - layout.item_enumO("object.select_by_type", "type", "", text="Select All by Type") - layout.itemO("object.select_grouped", text="Select Grouped") + layout.item_enumO("object.select_by_type", "type", "", text="Select All by Type...") + layout.itemO("object.select_grouped", text="Select Grouped...") class VIEW3D_MT_select_POSE(bpy.types.Menu): __space_type__ = 'VIEW_3D' @@ -178,7 +178,7 @@ class VIEW3D_MT_select_POSE(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.itemO("view3d.select_border") + layout.itemO("view3d.select_border", text="Border Select...") layout.itemS() @@ -227,7 +227,7 @@ class VIEW3D_MT_select_EDIT_MESH(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.itemO("view3d.select_border") + layout.itemO("view3d.select_border", text="Border Select...") layout.itemS() @@ -271,8 +271,8 @@ class VIEW3D_MT_select_EDIT_CURVE(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.itemO("view3d.select_border") - layout.itemO("view3d.select_circle") + layout.itemO("view3d.select_border", text="Border Select...") + layout.itemO("view3d.select_circle", text="Circle Select...") layout.itemS() @@ -300,8 +300,8 @@ class VIEW3D_MT_select_EDIT_SURFACE(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.itemO("view3d.select_border") - layout.itemO("view3d.select_circle") + layout.itemO("view3d.select_border", text="Border Select...") + layout.itemO("view3d.select_circle", text="Circle Select...") layout.itemS() @@ -357,7 +357,7 @@ class VIEW3D_MT_select_EDIT_ARMATURE(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.itemO("view3d.select_border") + layout.itemO("view3d.select_border", text="Border Select...") layout.itemS() @@ -403,15 +403,15 @@ class VIEW3D_MT_OBJECT(bpy.types.Menu): layout.itemS() - layout.itemO("anim.insert_keyframe_menu") - layout.itemO("anim.delete_keyframe_v3d") + layout.itemO("anim.insert_keyframe_menu", text="Insert Keyframe...") + layout.itemO("anim.delete_keyframe_v3d", text="Delete Keyframe...") layout.itemS() layout.itemO("object.duplicate") layout.item_booleanO("object.duplicate", "linked", True, text="Duplicate Linked") - layout.itemO("object.delete") - layout.itemO("object.proxy_make") + layout.itemO("object.delete", text="Delete...") + layout.itemO("object.proxy_make", text="Make Proxy...") layout.itemS() @@ -435,10 +435,10 @@ class VIEW3D_MT_OBJECT_clear(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.itemO("object.location_clear") - layout.itemO("object.rotation_clear") - layout.itemO("object.scale_clear") - layout.itemO("object.origin_clear") + layout.itemO("object.location_clear", text="Location") + layout.itemO("object.rotation_clear", text="Rotation") + layout.itemO("object.scale_clear", text="Scale") + layout.itemO("object.origin_clear", text="Origin") class VIEW3D_MT_OBJECT_parent(bpy.types.Menu): __space_type__ = 'VIEW_3D' @@ -447,8 +447,8 @@ class VIEW3D_MT_OBJECT_parent(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.itemO("object.parent_set") - layout.itemO("object.parent_clear") + layout.itemO("object.parent_set", text="Set") + layout.itemO("object.parent_clear", text="Clear") class VIEW3D_MT_OBJECT_track(bpy.types.Menu): __space_type__ = 'VIEW_3D' @@ -457,8 +457,8 @@ class VIEW3D_MT_OBJECT_track(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.itemO("object.track_set") - layout.itemO("object.track_clear") + layout.itemO("object.track_set", text="Set") + layout.itemO("object.track_clear", text="Clear") class VIEW3D_MT_OBJECT_group(bpy.types.Menu): __space_type__ = 'VIEW_3D' @@ -595,8 +595,8 @@ class VIEW3D_MT_POSE(bpy.types.Menu): layout.itemS() - layout.itemO("anim.insert_keyframe_menu") - layout.itemO("anim.delete_keyframe_v3d") + layout.itemO("anim.insert_keyframe_menu", text="Insert Keyframe...") + layout.itemO("anim.delete_keyframe_v3d", text="Delete Keyframe...") layout.itemS() @@ -629,8 +629,8 @@ class VIEW3D_MT_POSE(bpy.types.Menu): layout.itemS() - layout.itemO("pose.armature_layers") - layout.itemO("pose.bone_layers") + layout.itemO("pose.armature_layers", text="Change Armature Layers...") + layout.itemO("pose.bone_layers", text="Change Bone Layers...") layout.itemS() @@ -644,13 +644,13 @@ class VIEW3D_MT_POSE_transform(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.itemL(text="Clear User Transform") + layout.itemL(text="User Transform") - layout.itemO("pose.loc_clear") - layout.itemO("pose.rot_clear") - layout.itemO("pose.scale_clear") + layout.itemO("pose.loc_clear", text="Location") + layout.itemO("pose.rot_clear", text="Rotation") + layout.itemO("pose.scale_clear", text="Scale") - layout.itemL(text="Clear Origin") + layout.itemL(text="Origin") class VIEW3D_MT_POSE_pose(bpy.types.Menu): __space_type__ = "VIEW_3D" @@ -659,13 +659,13 @@ class VIEW3D_MT_POSE_pose(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.itemO("poselib.browse_interactive") + layout.itemO("poselib.browse_interactive", text="Browse Poses...") layout.itemS() - layout.itemO("poselib.pose_add") - layout.itemO("poselib.pose_rename") - layout.itemO("poselib.pose_remove") + layout.itemO("poselib.pose_add", text="Add Pose...") + layout.itemO("poselib.pose_rename", text="Rename Pose...") + layout.itemO("poselib.pose_remove", text="Remove Pose...") class VIEW3D_MT_POSE_motion(bpy.types.Menu): __space_type__ = "VIEW_3D" @@ -674,8 +674,8 @@ class VIEW3D_MT_POSE_motion(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.itemO("pose.paths_calculate") - layout.itemO("pose.paths_clear") + layout.itemO("pose.paths_calculate", text="Calculate") + layout.itemO("pose.paths_clear", text="Clear") class VIEW3D_MT_POSE_group(bpy.types.Menu): __space_type__ = "VIEW_3D" @@ -683,11 +683,14 @@ class VIEW3D_MT_POSE_group(bpy.types.Menu): def draw(self, context): layout = self.layout + layout.itemO("pose.group_add") + layout.itemO("pose.group_remove") + + layout.itemS() layout.itemO("pose.group_assign") - layout.itemO("pose.group_add") layout.itemO("pose.group_unassign") - layout.itemO("pose.group_remove") + class VIEW3D_MT_POSE_ik(bpy.types.Menu): __space_type__ = "VIEW_3D" @@ -706,7 +709,7 @@ class VIEW3D_MT_POSE_constraints(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.itemO("pose.constraint_add_with_targets") + layout.itemO("pose.constraint_add_with_targets", text="Add (With Targets)...") layout.itemO("pose.constraints_clear") class VIEW3D_MT_POSE_showhide(VIEW3D_MT_showhide): @@ -733,13 +736,13 @@ class VIEW3D_MT_edit_MESH(bpy.types.Menu): layout.itemS() - layout.itemO("uv.mapping_menu") + layout.itemO("uv.mapping_menu", text="UV Unwrap...") layout.itemS() layout.itemO("mesh.extrude") layout.itemO("mesh.duplicate") - layout.itemO("mesh.delete") + layout.itemO("mesh.delete", text="Delete...") layout.itemS() @@ -784,7 +787,6 @@ class VIEW3D_MT_edit_MESH_edges(bpy.types.Menu): layout.itemO("mesh.edge_face_add") layout.itemO("mesh.subdivide") - layout.item_floatO("mesh.subdivide", "smoothness", 1.0, text="Subdivide Smooth") layout.itemS() @@ -857,7 +859,7 @@ def draw_CURVE(self, context): layout.itemO("curve.separate") layout.itemO("curve.make_segment") layout.itemO("curve.cyclic_toggle") - layout.itemO("curve.delete") + layout.itemO("curve.delete", text="Delete...") layout.itemS() @@ -984,7 +986,7 @@ class VIEW3D_MT_edit_META(bpy.types.Menu): layout.itemS() - layout.itemO("mball.delete_metaelems") + layout.itemO("mball.delete_metaelems", text="Delete...") layout.itemO("mball.duplicate_metaelems") layout.itemS() @@ -1062,8 +1064,7 @@ class VIEW3D_MT_edit_ARMATURE(bpy.types.Menu): layout.itemS() - layout.itemO("armature.subdivide_simple") - layout.itemO("armature.subdivide_multi") + layout.itemO("armature.subdivide_multi", text="Subdivide") layout.itemS() @@ -1092,8 +1093,8 @@ class VIEW3D_MT_edit_ARMATURE_parent(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.itemO("armature.parent_set") - layout.itemO("armature.parent_clear") + layout.itemO("armature.parent_set", text="Make") + layout.itemO("armature.parent_clear", text="Clear") class VIEW3D_MT_edit_ARMATURE_roll(bpy.types.Menu): __space_type__ = 'VIEW_3D' diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index b74dc6f757b..946aa1cd682 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -1662,16 +1662,19 @@ static void rna_def_userdef_view(BlenderRNA *brna) prop= RNA_def_property(srna, "show_mini_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_ROTVIEWICON); RNA_def_property_ui_text(prop, "Show Mini Axis", "Show a small rotating 3D axis in the bottom left corner of the 3D View."); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "mini_axis_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "rvisize"); RNA_def_property_range(prop, 10, 64); RNA_def_property_ui_text(prop, "Mini Axis Size", "The axis icon's size."); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "mini_axis_brightness", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "rvibright"); RNA_def_property_range(prop, 0, 10); RNA_def_property_ui_text(prop, "Mini Axis Brightness", "The brightness of the icon."); + RNA_def_property_update(prop, NC_WINDOW, NULL); /* middle mouse button */ prop= RNA_def_property(srna, "middle_mouse_rotate", PROP_BOOLEAN, PROP_NONE); @@ -1705,16 +1708,19 @@ static void rna_def_userdef_view(BlenderRNA *brna) prop= RNA_def_property(srna, "use_manipulator", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "tw_flag", 1); RNA_def_property_ui_text(prop, "Manipulator", "Use 3d transform manipulator."); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "manipulator_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "tw_size"); RNA_def_property_range(prop, 2, 40); RNA_def_property_ui_text(prop, "Manipulator Size", "Diameter of widget, in 10 pixel units."); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "manipulator_handle_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "tw_handlesize"); RNA_def_property_range(prop, 2, 40); RNA_def_property_ui_text(prop, "Manipulator Handle Size", "Size of widget handles as percentage of widget radius."); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "manipulator_hotspot", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "tw_hotspot"); @@ -1725,6 +1731,7 @@ static void rna_def_userdef_view(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "obcenter_dia"); RNA_def_property_range(prop, 4, 10); RNA_def_property_ui_text(prop, "Object Center Size", "Diameter in Pixels for Object/Lamp center display."); + RNA_def_property_update(prop, NC_WINDOW, NULL); prop= RNA_def_property(srna, "ndof_pan_speed", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ndof_pan"); From 5e9e6df2a24b28cbb8c1de293725ebe4af3f9a2d Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Mon, 24 Aug 2009 02:49:57 +0000 Subject: [PATCH 230/577] * changes to work with updated FFMPEG libs. Mainly build system. CMake files may need changing too. NOTE: remember to svn up in lib/windows! --- SConstruct | 10 +++++----- config/win32-mingw-config.py | 8 ++++---- config/win32-vc-config.py | 2 +- source/blender/src/header_info.c | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/SConstruct b/SConstruct index a5c70f40366..4ce3aa25d11 100644 --- a/SConstruct +++ b/SConstruct @@ -570,11 +570,11 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw'): '${LCGDIR}/ffmpeg/lib/avformat-52.dll', '${LCGDIR}/ffmpeg/lib/avdevice-52.dll', '${LCGDIR}/ffmpeg/lib/avutil-50.dll', - '${LCGDIR}/ffmpeg/lib/libfaad-2.dll', - '${LCGDIR}/ffmpeg/lib/libfaac-0.dll', - '${LCGDIR}/ffmpeg/lib/libmp3lame-0.dll', - '${LCGDIR}/ffmpeg/lib/libx264-67.dll', - '${LCGDIR}/ffmpeg/lib/xvidcore.dll', +# '${LCGDIR}/ffmpeg/lib/libfaad-2.dll', +# '${LCGDIR}/ffmpeg/lib/libfaac-0.dll', +# '${LCGDIR}/ffmpeg/lib/libmp3lame-0.dll', +# '${LCGDIR}/ffmpeg/lib/libx264-67.dll', +# '${LCGDIR}/ffmpeg/lib/xvidcore.dll', '${LCGDIR}/ffmpeg/lib/swscale-0.dll'] windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources) allinstall += windlls diff --git a/config/win32-mingw-config.py b/config/win32-mingw-config.py index 5801df86c27..f7130cb4ac3 100644 --- a/config/win32-mingw-config.py +++ b/config/win32-mingw-config.py @@ -26,10 +26,10 @@ BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib' # Warning, this static lib configuration is untested! users of this OS please confirm. BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a' -WITH_BF_FFMPEG = False -BF_FFMPEG_LIB = 'avformat swscale avcodec avutil avdevice xvidcore x264' -BF_FFMPEG_LIBPATH = LIBDIR + '/gcc/ffmpeg/lib' -BF_FFMPEG_INC = LIBDIR + '/gcc/ffmpeg/include' +WITH_BF_FFMPEG = True +BF_FFMPEG_LIB = 'avformat-52 avcodec-52 avdevice-52 avutil-50 swscale-0' +BF_FFMPEG_LIBPATH = LIBDIR + '/ffmpeg/lib' +BF_FFMPEG_INC = LIBDIR + '/ffmpeg/include' WITH_BF_SDL = True BF_SDL = LIBDIR + '/sdl' diff --git a/config/win32-vc-config.py b/config/win32-vc-config.py index 359f52e6bf8..3ec76d464bc 100644 --- a/config/win32-vc-config.py +++ b/config/win32-vc-config.py @@ -7,7 +7,7 @@ BF_VERSE_INCLUDE = "#extern/verse/dist" # enable ffmpeg support WITH_BF_FFMPEG = True # -DWITH_FFMPEG BF_FFMPEG = LIBDIR +'/ffmpeg' -BF_FFMPEG_INC = '${BF_FFMPEG}/include' +BF_FFMPEG_INC = '${BF_FFMPEG}/include ${BF_FFMPEG}/include/msvc' BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib' BF_FFMPEG_LIB = 'avformat-52.lib avcodec-52.lib avdevice-52.lib avutil-50.lib swscale-0.lib' diff --git a/source/blender/src/header_info.c b/source/blender/src/header_info.c index 65baa4df830..4b560139b0f 100644 --- a/source/blender/src/header_info.c +++ b/source/blender/src/header_info.c @@ -565,8 +565,8 @@ static void copy_game_dll(char *dll_filename, char *source_dir, char *dest_dir) static void copy_all_game_dlls(char *str) { -#define GAME_DLL_COUNT 17 - char *game_dll_list[GAME_DLL_COUNT]={"avcodec-52.dll", "avdevice-52.dll", "avformat-52.dll", "avutil-50.dll", "libfaac-0.dll", "libfaad-2.dll", "libmp3lame-0.dll", "libx264-67.dll", "swscale-0.dll", "xvidcore.dll", "gnu_gettext.dll", "libtiff.dll", "python26.dll", "SDL.dll", "pthreadVC2.dll", "libpng.dll", "zlib.dll"}; +#define GAME_DLL_COUNT 12 + char *game_dll_list[GAME_DLL_COUNT]={"avcodec-52.dll", "avdevice-52.dll", "avformat-52.dll", "avutil-50.dll", "swscale-0.dll", "gnu_gettext.dll", "libtiff.dll", "python26.dll", "SDL.dll", "pthreadVC2.dll", "libpng.dll", "zlib.dll"}; char dest_dir[FILE_MAX]; char source_dir[FILE_MAX]; From b33b6babbd2e5b87dcf0dee35074120cbcf5f934 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 24 Aug 2009 04:31:13 +0000 Subject: [PATCH 231/577] 2.5 - Sliders in Animation Editors The 'Show Sliders' option for DopeSheet and Graph Editors now works again. When this option is enabled (it is disabled by default), a slider (or combobox) is shown beside the mute/lock toggles for F-Curves. Editing the slider will result in a new keyframe being added on the current frame. So, for all the (ex)-Maya animators out there, you can now animate in a channelbox-like way. :) Also in this commit: * Fixed some warnings in modifier.c from previous commits there * Fixed some refresh problems with DopeSheet channel list (which were only obvious after adding back the sliders) * Removed the old/unrestored and nasty slider code used in the past by the Action Editor only. --- source/blender/blenkernel/intern/modifier.c | 1 + .../editors/animation/anim_channels_defines.c | 138 +++++-- .../editors/animation/anim_ipo_utils.c | 3 +- .../editors/interface/interface_widgets.c | 2 +- .../editors/space_action/action_draw.c | 336 +----------------- .../editors/space_action/space_action.c | 3 +- .../editors/space_graph/graph_header.c | 4 +- source/blender/makesdna/DNA_space_types.h | 1 + source/blender/makesrna/intern/rna_space.c | 4 + 9 files changed, 125 insertions(+), 367 deletions(-) diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 1cb163a4de7..c78227a363f 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -78,6 +78,7 @@ #include "BKE_main.h" #include "BKE_anim.h" +#include "BKE_action.h" #include "BKE_bmesh.h" // XXX #include "BKE_booleanops.h" #include "BKE_cloth.h" diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index acf7467713b..b16420a7094 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -79,6 +79,7 @@ #include "UI_view2d.h" #include "ED_anim_api.h" +#include "ED_keyframing.h" #include "ED_keyframes_edit.h" // XXX move the select modes out of there! #include "ED_screen.h" #include "ED_space_api.h" @@ -1869,13 +1870,14 @@ void ANIM_channel_setting_set (bAnimContext *ac, bAnimListElem *ale, int setting // XXX hardcoded size of icons #define ICON_WIDTH 17 +// XXX hardcoded width of sliders +#define SLIDER_WIDTH 70 /* Draw the given channel */ // TODO: make this use UI controls for the buttons void ANIM_channel_draw (bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc) { bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale); - View2D *v2d= &ac->ar->v2d; short selected, offset; float y, ymid, ytext; @@ -1970,26 +1972,6 @@ void ANIM_channel_draw (bAnimContext *ac, bAnimListElem *ale, float yminc, float offset += 3; UI_DrawString(offset, ytext, name); } - - /* step 6) draw mute+protection toggles + (sliders) ....................... */ - /* reset offset - now goes from RHS of panel */ - offset = 0; - - // TODO: we need a mechanism of drawing over (and hiding) stuff from here... - // TODO: when drawing sliders, make those draw instead of these toggles if not enough space - - if (v2d) { - /* protect... */ - if (acf->has_setting(ac, ale, ACHANNEL_SETTING_PROTECT)) { - /* just skip - drawn as widget now */ - offset += ICON_WIDTH; - } - /* mute... */ - if (acf->has_setting(ac, ale, ACHANNEL_SETTING_MUTE)) { - /* just skip - drawn as widget now */ - offset += ICON_WIDTH; - } - } } /* ------------------ */ @@ -2000,6 +1982,44 @@ static void achannel_setting_widget_cb(bContext *C, void *poin, void *poin2) WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL); } +/* callback for widget sliders - insert keyframes */ +static void achannel_setting_slider_cb(bContext *C, void *id_poin, void *fcu_poin) +{ + ID *id= (ID *)id_poin; + FCurve *fcu= (FCurve *)fcu_poin; + + Scene *scene= CTX_data_scene(C); + PointerRNA id_ptr, ptr; + PropertyRNA *prop; + short flag=0, done=0; + float cfra; + + /* get current frame */ + // NOTE: this will do for now... + cfra= (float)CFRA; + + /* get flags for keyframing */ + if (IS_AUTOKEY_FLAG(INSERTNEEDED)) + flag |= INSERTKEY_NEEDED; + if (IS_AUTOKEY_FLAG(AUTOMATKEY)) + flag |= INSERTKEY_MATRIX; + + + /* get RNA pointer, and resolve the path */ + RNA_id_pointer_create(id, &id_ptr); + + /* try to resolve the path stored in the F-Curve */ + if (RNA_path_resolve(&id_ptr, fcu->rna_path, &ptr, &prop)) { + /* insert a keyframe for this F-Curve */ + done= insert_keyframe_direct(ptr, prop, fcu, cfra, flag); + + if (done) + WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL); + } +} + + + /* Draw a widget for some setting */ static void draw_setting_widget (bAnimContext *ac, bAnimListElem *ale, bAnimChannelType *acf, uiBlock *block, int xpos, int ypos, int setting) { @@ -2164,15 +2184,75 @@ void ANIM_channel_draw_widgets (bAnimContext *ac, bAnimListElem *ale, uiBlock *b // TODO: when drawing sliders, make those draw instead of these toggles if not enough space if (v2d) { - /* protect... */ - if (acf->has_setting(ac, ale, ACHANNEL_SETTING_PROTECT)) { - offset += ICON_WIDTH; - draw_setting_widget(ac, ale, acf, block, (int)v2d->cur.xmax-offset, ymid, ACHANNEL_SETTING_PROTECT); + short draw_sliders = 0; + + /* check if we need to show the sliders */ + if ((ac->sa) && ELEM(ac->spacetype, SPACE_ACTION, SPACE_IPO)) { + switch (ac->spacetype) { + case SPACE_ACTION: + { + SpaceAction *saction= (SpaceAction *)ac->sa->spacedata.first; + draw_sliders= (saction->flag & SACTION_SLIDERS); + } + break; + case SPACE_IPO: + { + SpaceIpo *sipo= (SpaceIpo *)ac->sa->spacedata.first; + draw_sliders= (sipo->flag & SIPO_SLIDERS); + } + break; + } } - /* mute... */ - if (acf->has_setting(ac, ale, ACHANNEL_SETTING_MUTE)) { - offset += ICON_WIDTH; - draw_setting_widget(ac, ale, acf, block, (int)v2d->cur.xmax-offset, ymid, ACHANNEL_SETTING_MUTE); + + /* check if there's enough space for the toggles if the sliders are drawn too */ + if ( !(draw_sliders) || ((v2d->mask.xmax-v2d->mask.xmin) > ACHANNEL_BUTTON_WIDTH/2) ) { + /* protect... */ + if (acf->has_setting(ac, ale, ACHANNEL_SETTING_PROTECT)) { + offset += ICON_WIDTH; + draw_setting_widget(ac, ale, acf, block, (int)v2d->cur.xmax-offset, ymid, ACHANNEL_SETTING_PROTECT); + } + /* mute... */ + if (acf->has_setting(ac, ale, ACHANNEL_SETTING_MUTE)) { + offset += ICON_WIDTH; + draw_setting_widget(ac, ale, acf, block, (int)v2d->cur.xmax-offset, ymid, ACHANNEL_SETTING_MUTE); + } + } + + /* draw slider + * - even if we can draw sliders for this view, we must also check that the channel-type supports them + * (only only F-Curves really can support them for now) + * - to make things easier, we use RNA-autobuts for this so that changes are reflected immediately, + * whereever they occurred. BUT, we don't use the layout engine, otherwise we'd get wrong alignment, + * and wouldn't be able to auto-keyframe... + * - slider should start before the toggles (if they're visible) to keep a clean line down the side + */ + if ((draw_sliders) && (ale->type == ANIMTYPE_FCURVE)) { + /* adjust offset */ + offset += SLIDER_WIDTH; + + /* need backdrop behind sliders... */ + uiBlockSetEmboss(block, UI_EMBOSS); + + if (ale->id) { /* Slider using RNA Access -------------------- */ + FCurve *fcu= (FCurve *)ale->data; + PointerRNA id_ptr, ptr; + PropertyRNA *prop; + + /* get RNA pointer, and resolve the path */ + RNA_id_pointer_create(ale->id, &id_ptr); + + /* try to resolve the path */ + if (RNA_path_resolve(&id_ptr, fcu->rna_path, &ptr, &prop)) { + uiBut *but; + + /* create the slider button, and assign relevant callback to ensure keyframes are inserted... */ + but= uiDefAutoButR(block, &ptr, prop, fcu->array_index, "", 0, (int)v2d->cur.xmax-offset, ymid, SLIDER_WIDTH, (int)ymaxc-yminc); + uiButSetFunc(but, achannel_setting_slider_cb, ale->id, fcu); + } + } + else { /* Special Slider for stuff without RNA Access ---------- */ + // TODO: only implement this case when we really need it... + } } } } diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c index 394cc53dda2..ecf0bdbf285 100644 --- a/source/blender/editors/animation/anim_ipo_utils.c +++ b/source/blender/editors/animation/anim_ipo_utils.c @@ -93,9 +93,8 @@ int geticon_anim_blocktype(short blocktype) } /* Write into "name" buffer, the name of the property (retrieved using RNA from the curve's settings) - * WARNING: name buffer we're writing to cannot exceed 128 chars (check action_draw.c for details) + * WARNING: name buffer we're writing to cannot exceed 256 chars (check anim_channels_defines.c for details) */ -// TODO: have an extra var to indicate if prop was valid? void getname_anim_fcurve(char *name, ID *id, FCurve *fcu) { /* sanity checks */ diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index ba0d1900344..a55b11afe48 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2050,7 +2050,7 @@ static void widget_roundbut(uiWidgetColors *wcol, rcti *rect, int state, int rou widget_init(&wtb); /* half rounded */ - round_box_edges(&wtb, roundboxalign, rect, 4.0f); + round_box_edges(&wtb, roundboxalign, rect, 5.0f); widgetbase_draw(&wtb, wcol); } diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 4fb22064c17..4288cc10a26 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -92,306 +92,6 @@ #include "ED_screen.h" #include "ED_space_api.h" -#if 0 // XXX old includes for reference only - #include "BIF_editaction.h" - #include "BIF_editkey.h" - #include "BIF_editnla.h" - #include "BIF_drawgpencil.h" - #include "BIF_keyframing.h" - #include "BIF_language.h" - #include "BIF_space.h" - - #include "BDR_editcurve.h" - #include "BDR_gpencil.h" - - #include "BSE_drawnla.h" - #include "BSE_drawipo.h" - #include "BSE_drawview.h" - #include "BSE_editaction_types.h" - #include "BSE_editipo.h" - #include "BSE_headerbuttons.h" - #include "BSE_time.h" - #include "BSE_view.h" -#endif // XXX old defines for reference only - -/* XXX */ -extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad); - -/********************************** Slider Stuff **************************** */ - -#if 0 // XXX all of this slider stuff will need a rethink! -/* sliders for shapekeys */ -static void meshactionbuts(SpaceAction *saction, Object *ob, Key *key) -{ - int i; - char str[64]; - float x, y; - uiBlock *block; - uiBut *but; - - /* lets make the shapekey sliders */ - - /* reset the damn myortho2 or the sliders won't draw/redraw - * correctly *grumble* - */ - mywinset(curarea->win); - myortho2(-0.375f, curarea->winx-0.375f, G.v2d->cur.ymin, G.v2d->cur.ymax); - - sprintf(str, "actionbuttonswin %d", curarea->win); - block= uiNewBlock (&curarea->uiblocks, str, UI_EMBOSS); - - x = ACHANNEL_NAMEWIDTH + 1; - y = 0.0f; - - uiBlockSetEmboss(block, UI_EMBOSSN); - - if (!(G.saction->flag & SACTION_SLIDERS)) { - ACTWIDTH = ACHANNEL_NAMEWIDTH; - but=uiDefIconButBitS(block, TOG, SACTION_SLIDERS, B_REDR, - ICON_DISCLOSURE_TRI_RIGHT, - ACHANNEL_NAMEWIDTH - XIC - 5, (short)y + CHANNELHEIGHT, - XIC,YIC-2, - &(G.saction->flag), 0, 0, 0, 0, - "Show action window sliders"); - /* no hilite, the winmatrix is not correct later on... */ - uiButSetFlag(but, UI_NO_HILITE); - } - else { - but= uiDefIconButBitS(block, TOG, SACTION_SLIDERS, B_REDR, - ICON_DISCLOSURE_TRI_DOWN, - ACHANNEL_NAMEWIDTH - XIC - 5, (short)y + CHANNELHEIGHT, - XIC,YIC-2, - &(G.saction->flag), 0, 0, 0, 0, - "Hide action window sliders"); - /* no hilite, the winmatrix is not correct later on... */ - uiButSetFlag(but, UI_NO_HILITE); - - ACTWIDTH = ACHANNEL_NAMEWIDTH + SLIDERWIDTH; - - /* sliders are open so draw them */ - BIF_ThemeColor(TH_FACE); - - glRects(ACHANNEL_NAMEWIDTH, 0, ACHANNEL_NAMEWIDTH+SLIDERWIDTH, curarea->winy); - uiBlockSetEmboss(block, UI_EMBOSS); - for (i=1; i < key->totkey; i++) { - make_rvk_slider(block, ob, i, - (int)x, (int)y, SLIDERWIDTH-2, CHANNELHEIGHT-1, "Slider to control Shape Keys"); - - y-=CHANNELHEIGHT+CHANNELSKIP; - - /* see sliderval array in editkey.c */ - if (i >= 255) break; - } - } - uiDrawBlock(C, block); -} - -static void icu_slider_func(void *voidicu, void *voidignore) -{ - /* the callback for the icu sliders ... copies the - * value from the icu->curval into a bezier at the - * right frame on the right ipo curve (creating both the - * ipo curve and the bezier if needed). - */ - IpoCurve *icu= voidicu; - BezTriple *bezt=NULL; - float cfra, icuval; - - cfra = frame_to_float(CFRA); - if (G.saction->pin==0 && OBACT) - cfra= get_action_frame(OBACT, cfra); - - /* if the ipocurve exists, try to get a bezier - * for this frame - */ - bezt = get_bezt_icu_time(icu, &cfra, &icuval); - - /* create the bezier triple if one doesn't exist, - * otherwise modify it's value - */ - if (bezt == NULL) { - insert_vert_icu(icu, cfra, icu->curval, 0); - } - else { - bezt->vec[1][1] = icu->curval; - } - - /* make sure the Ipo's are properly processed and - * redraw as necessary - */ - sort_time_ipocurve(icu); - testhandles_ipocurve(icu); - - /* nla-update (in case this affects anything) */ - synchronize_action_strips(); - - /* do redraw pushes, and also the depsgraph flushes */ - if (OBACT->pose || ob_get_key(OBACT)) - DAG_object_flush_update(G.scene, OBACT, OB_RECALC); - else - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_OB); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWIPO, 0); - allspace(REMAKEIPO, 0); - allqueue(REDRAWBUTSALL, 0); -} - -static void make_icu_slider(uiBlock *block, IpoCurve *icu, - int x, int y, int w, int h, char *tip) -{ - /* create a slider for the ipo-curve*/ - uiBut *but; - - if(icu == NULL) return; - - if (IS_EQ(icu->slide_max, icu->slide_min)) { - if (IS_EQ(icu->ymax, icu->ymin)) { - if (ELEM(icu->blocktype, ID_CO, ID_KE)) { - /* hack for constraints and shapekeys (and maybe a few others) */ - icu->slide_min= 0.0; - icu->slide_max= 1.0; - } - else { - icu->slide_min= -100; - icu->slide_max= 100; - } - } - else { - icu->slide_min= icu->ymin; - icu->slide_max= icu->ymax; - } - } - if (icu->slide_min >= icu->slide_max) { - SWAP(float, icu->slide_min, icu->slide_max); - } - - but=uiDefButF(block, NUMSLI, REDRAWVIEW3D, "", - x, y , w, h, - &(icu->curval), icu->slide_min, icu->slide_max, - 10, 2, tip); - - uiButSetFunc(but, icu_slider_func, icu, NULL); - - // no hilite, the winmatrix is not correct later on... - uiButSetFlag(but, UI_NO_HILITE); -} - -/* sliders for ipo-curves of active action-channel */ -static void action_icu_buts(SpaceAction *saction) -{ - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - int filter; - void *data; - short datatype; - - char str[64]; - float x, y; - uiBlock *block; - - /* lets make the action sliders */ - - /* reset the damn myortho2 or the sliders won't draw/redraw - * correctly *grumble* - */ - mywinset(curarea->win); - myortho2(-0.375f, curarea->winx-0.375f, G.v2d->cur.ymin, G.v2d->cur.ymax); - - sprintf(str, "actionbuttonswin %d", curarea->win); - block= uiNewBlock (&curarea->uiblocks, str, UI_EMBOSS); - - x = (float)ACHANNEL_NAMEWIDTH + 1; - y = 0.0f; - - uiBlockSetEmboss(block, UI_EMBOSSN); - - if (G.saction->flag & SACTION_SLIDERS) { - /* sliders are open so draw them */ - - /* get editor data */ - data= get_action_context(&datatype); - if (data == NULL) return; - - /* build list of channels to draw */ - filter= (ACTFILTER_FORDRAWING|ACTFILTER_VISIBLE|ACTFILTER_CHANNELS); - actdata_filter(&act_data, filter, data, datatype); - - /* draw backdrop first */ - BIF_ThemeColor(TH_FACE); // change this color... it's ugly - glRects(ACHANNEL_NAMEWIDTH, (short)G.v2d->cur.ymin, ACHANNEL_NAMEWIDTH+SLIDERWIDTH, (short)G.v2d->cur.ymax); - - uiBlockSetEmboss(block, UI_EMBOSS); - for (ale= act_data.first; ale; ale= ale->next) { - const float yminc= y-CHANNELHEIGHT/2; - const float ymaxc= y+CHANNELHEIGHT/2; - - /* check if visible */ - if ( IN_RANGE(yminc, G.v2d->cur.ymin, G.v2d->cur.ymax) || - IN_RANGE(ymaxc, G.v2d->cur.ymin, G.v2d->cur.ymax) ) - { - /* determine what needs to be drawn */ - switch (ale->type) { - case ACTTYPE_CONCHAN: /* constraint channel */ - { - bActionChannel *achan = (bActionChannel *)ale->owner; - IpoCurve *icu = (IpoCurve *)ale->key_data; - - /* only show if owner is selected */ - if ((ale->ownertype == ACTTYPE_OBJECT) || SEL_ACHAN(achan)) { - make_icu_slider(block, icu, - (int)x, (int)y, SLIDERWIDTH-2, CHANNELHEIGHT-2, - "Slider to control current value of Constraint Influence"); - } - } - break; - case ACTTYPE_ICU: /* ipo-curve channel */ - { - bActionChannel *achan = (bActionChannel *)ale->owner; - IpoCurve *icu = (IpoCurve *)ale->key_data; - - /* only show if owner is selected */ - if ((ale->ownertype == ACTTYPE_OBJECT) || SEL_ACHAN(achan)) { - make_icu_slider(block, icu, - (int)x, (int)y, SLIDERWIDTH-2, CHANNELHEIGHT-2, - "Slider to control current value of IPO-Curve"); - } - } - break; - case ACTTYPE_SHAPEKEY: /* shapekey channel */ - { - Object *ob= (Object *)ale->id; - IpoCurve *icu= (IpoCurve *)ale->key_data; - - // TODO: only show if object is active - if (icu) { - make_icu_slider(block, icu, - (int)x, (int)y, SLIDERWIDTH-2, CHANNELHEIGHT-2, - "Slider to control ShapeKey"); - } - else if (ob && ale->index) { - make_rvk_slider(block, ob, ale->index, - (int)x, (int)y, SLIDERWIDTH-2, CHANNELHEIGHT-1, "Slider to control Shape Keys"); - } - } - break; - } - } - - /* adjust y-position for next one */ - y-=CHANNELHEIGHT+CHANNELSKIP; - } - - /* free tempolary channels */ - BLI_freelistN(&act_data); - } - uiDrawBlock(C, block); -} - -#endif // XXX all of this slider stuff will need a rethink - /* ************************************************************************* */ /* Channel List */ @@ -518,7 +218,6 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) adt= ANIM_nla_mapping_get(ac, NULL); /* start and end of action itself */ - // TODO: this has not had scaling applied calc_action_range(ac->data, &act_start, &act_end, 0); } @@ -550,43 +249,14 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) if ( IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) || IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) ) { + bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale); int sel=0; /* determine if any need to draw channel */ if (ale->datatype != ALE_NONE) { /* determine if channel is selected */ - switch (ale->type) { - case ANIMTYPE_SCENE: - { - Scene *sce= (Scene *)ale->data; - sel = SEL_SCEC(sce); - } - break; - case ANIMTYPE_OBJECT: - { - Base *base= (Base *)ale->data; - sel = SEL_OBJC(base); - } - break; - case ANIMTYPE_GROUP: - { - bActionGroup *agrp = (bActionGroup *)ale->data; - sel = SEL_AGRP(agrp); - } - break; - case ANIMTYPE_FCURVE: - { - FCurve *fcu = (FCurve *)ale->data; - sel = SEL_FCU(fcu); - } - break; - case ANIMTYPE_GPLAYER: - { - bGPDlayer *gpl = (bGPDlayer *)ale->data; - sel = SEL_GPL(gpl); - } - break; - } + if (acf->has_setting(ac, ale, ACHANNEL_SETTING_SELECT)) + sel= ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_SELECT); if (ELEM(ac->datatype, ANIMCONT_ACTION, ANIMCONT_DOPESHEET)) { switch (ale->type) { diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index 275ac4ea4c1..2977d07d845 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -243,7 +243,7 @@ static void action_channel_area_draw(const bContext *C, ARegion *ar) /* data */ if (ANIM_animdata_get_context(C, &ac)) { - draw_channel_names(C, &ac, saction, ar); + draw_channel_names((bContext *)C, &ac, saction, ar); } /* reset view matrix */ @@ -294,6 +294,7 @@ static void action_channel_area_listener(ARegion *ar, wmNotifier *wmn) case NC_SCENE: switch(wmn->data) { case ND_OB_ACTIVE: + case ND_FRAME: ED_region_tag_redraw(ar); break; } diff --git a/source/blender/editors/space_graph/graph_header.c b/source/blender/editors/space_graph/graph_header.c index fc02cadb475..06d48fe20f3 100644 --- a/source/blender/editors/space_graph/graph_header.c +++ b/source/blender/editors/space_graph/graph_header.c @@ -81,6 +81,8 @@ static void graph_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemS(layout); uiItemR(layout, NULL, 0, &spaceptr, "show_cframe_indicator", 0); + uiItemR(layout, NULL, 0, &spaceptr, "show_sliders", 0); + uiItemR(layout, NULL, 0, &spaceptr, "automerge_keyframes", 0); if (sipo->flag & SIPO_NOHANDLES) uiItemO(layout, "Show Handles", ICON_CHECKBOX_DEHLT, "GRAPH_OT_handles_view_toggle"); @@ -88,7 +90,7 @@ static void graph_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemO(layout, "Show Handles", ICON_CHECKBOX_HLT, "GRAPH_OT_handles_view_toggle"); uiItemR(layout, NULL, 0, &spaceptr, "only_selected_curves_handles", 0); - uiItemR(layout, NULL, 0, &spaceptr, "automerge_keyframes", 0); + if (sipo->flag & SIPO_DRAWTIME) uiItemO(layout, "Show Frames", 0, "ANIM_OT_time_toggle"); diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 37f28cfeaa6..6fdc3a7787b 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -720,6 +720,7 @@ enum FileSortTypeE { #define SIPO_DRAWTIME (1<<4) #define SIPO_SELCUVERTSONLY (1<<5) #define SIPO_DRAWNAMES (1<<6) +#define SIPO_SLIDERS (1<<7) /* SpaceIpo->mode (Graph Editor Mode) */ enum { diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 8e8c9a9837c..a754d619741 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1075,6 +1075,10 @@ static void rna_def_space_graph(BlenderRNA *brna) RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCFRANUM); RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line."); + prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SLIDERS); + RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels."); + prop= RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_NOHANDLES); RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bezier control points."); From 90895fce8ca4f40bd41026b0406d80e8e83e0e8d Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 24 Aug 2009 08:13:09 +0000 Subject: [PATCH 232/577] * Fix for camera+internal surface object inside ztransp volume --- source/blender/render/intern/source/shadeinput.c | 3 ++- source/blender/render/intern/source/volumetric.c | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index ede3c2e0503..ed654eaf526 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -169,7 +169,8 @@ void shade_material_loop(ShadeInput *shi, ShadeResult *shr) } if(R.r.mode & R_RAYTRACE) { - shade_volume_inside(shi, shr); + if (R.render_volumes_inside.first) + shade_volume_inside(shi, shr); } } diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index cf66d580944..0e2e3913819 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -575,15 +575,14 @@ static void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr, int in startco = shi->camera_co; endco = shi->co; - if (!ztransp) { - if (trace_behind) { + if (trace_behind) { + if (!ztransp) /* trace behind the volume object */ vol_trace_behind(shi, shi->vlr, endco, col); - } else { - /* we're tracing through the volume between the camera - * and a solid surface, so use that pre-shaded radiance */ - QUATCOPY(col, shr->combined); - } + } else { + /* we're tracing through the volume between the camera + * and a solid surface, so use that pre-shaded radiance */ + QUATCOPY(col, shr->combined); } /* shade volume from 'camera' to 1st hit point */ @@ -676,8 +675,9 @@ void shade_volume_inside(ShadeInput *shi, ShadeResult *shr) MatInside *m; Material *mat_backup; - if (BLI_countlist(&R.render_volumes_inside) == 0) return; + //if (BLI_countlist(&R.render_volumes_inside) == 0) return; + /* XXX: extend to multiple volumes perhaps later */ mat_backup = shi->mat; m = R.render_volumes_inside.first; shi->mat = m->ma; From 1ef190088ba9ffd7c3ab4c62ff102fd8eddd1331 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 24 Aug 2009 09:17:09 +0000 Subject: [PATCH 233/577] patch from Ron Walker (o6a). Descriptions for TFM, TEXT, CONSOLE and ED operators. - Made some minor edits. --- source/blender/editors/mesh/editmesh_mods.c | 3 +- .../editors/space_console/console_ops.c | 12 ++++++ .../editors/space_console/console_report.c | 6 +++ .../blender/editors/space_text/text_header.c | 1 + source/blender/editors/space_text/text_ops.c | 43 +++++++++++++++++++ .../blender/editors/transform/transform_ops.c | 15 +++++++ source/blender/editors/util/undo.c | 2 + .../GameLogic/SCA_PropertyEventManager.h | 13 +++--- 8 files changed, 88 insertions(+), 7 deletions(-) diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index d27aa3f7e3a..789527fd96d 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -4475,7 +4475,8 @@ void MESH_OT_vertices_transform_to_sphere(wmOperatorType *ot) { /* identifiers */ ot->name= "Vertices to Sphere"; - ot->description= "Move selected vertices outward in a spherical shape."; + //added "around cursor" to differentiate between "TFM_OT_tosphere()" + ot->description= "Move selected vertices outward in a spherical shape around cursor."; ot->idname= "MESH_OT_vertices_transform_to_sphere"; /* api callbacks */ diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index fa9055f2d8d..f8dbe0c3dd4 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -280,6 +280,7 @@ void CONSOLE_OT_move(wmOperatorType *ot) { /* identifiers */ ot->name= "Move Cursor"; + ot->description= "Move cursor position."; ot->idname= "CONSOLE_OT_move"; /* api callbacks */ @@ -324,6 +325,7 @@ void CONSOLE_OT_insert(wmOperatorType *ot) { /* identifiers */ ot->name= "Insert"; + ot->description= "Insert text at cursor position."; ot->idname= "CONSOLE_OT_insert"; /* api callbacks */ @@ -391,6 +393,7 @@ void CONSOLE_OT_delete(wmOperatorType *ot) { /* identifiers */ ot->name= "Delete"; + ot->description= "Delete text by cursor position."; ot->idname= "CONSOLE_OT_delete"; /* api callbacks */ @@ -434,6 +437,7 @@ void CONSOLE_OT_clear(wmOperatorType *ot) { /* identifiers */ ot->name= "Clear"; + ot->description= "Clear text by type."; ot->idname= "CONSOLE_OT_clear"; /* api callbacks */ @@ -478,6 +482,7 @@ void CONSOLE_OT_history_cycle(wmOperatorType *ot) { /* identifiers */ ot->name= "History Cycle"; + ot->description= "Cycle through history."; ot->idname= "CONSOLE_OT_history_cycle"; /* api callbacks */ @@ -525,6 +530,7 @@ void CONSOLE_OT_history_append(wmOperatorType *ot) { /* identifiers */ ot->name= "History Append"; + ot->description= "Append history at cursor position."; ot->idname= "CONSOLE_OT_history_append"; /* api callbacks */ @@ -572,6 +578,7 @@ void CONSOLE_OT_scrollback_append(wmOperatorType *ot) /* identifiers */ ot->name= "Scrollback Append"; + ot->description= "Append scrollback text by type."; ot->idname= "CONSOLE_OT_scrollback_append"; /* api callbacks */ @@ -614,6 +621,7 @@ void CONSOLE_OT_copy(wmOperatorType *ot) { /* identifiers */ ot->name= "Copy to Clipboard"; + ot->description= "Copy selected text to clipboard."; ot->idname= "CONSOLE_OT_copy"; /* api callbacks */ @@ -648,6 +656,7 @@ void CONSOLE_OT_paste(wmOperatorType *ot) { /* identifiers */ ot->name= "Paste from Clipboard"; + ot->description= "Paste text from clipboard."; ot->idname= "CONSOLE_OT_paste"; /* api callbacks */ @@ -679,6 +688,9 @@ void CONSOLE_OT_zoom(wmOperatorType *ot) { /* identifiers */ ot->name= "Console Zoom"; + /*optionals - + "Zoom view font." */ + ot->description= "Zoom screen area."; ot->idname= "CONSOLE_OT_zoom"; /* api callbacks */ diff --git a/source/blender/editors/space_console/console_report.c b/source/blender/editors/space_console/console_report.c index 2e23c4039f1..08d003f0706 100644 --- a/source/blender/editors/space_console/console_report.c +++ b/source/blender/editors/space_console/console_report.c @@ -114,6 +114,7 @@ void CONSOLE_OT_report_replay(wmOperatorType *ot) { /* identifiers */ ot->name= "Replay Operators"; + ot->description= "Replay selected reports."; ot->idname= "CONSOLE_OT_report_replay"; /* api callbacks */ @@ -160,6 +161,7 @@ void CONSOLE_OT_select_pick(wmOperatorType *ot) { /* identifiers */ ot->name= "Select report"; + ot->description= "Select reports by index."; ot->idname= "CONSOLE_OT_select_pick"; /* api callbacks */ @@ -213,6 +215,7 @@ void CONSOLE_OT_select_all_toggle(wmOperatorType *ot) { /* identifiers */ ot->name= "(De)Select All"; + ot->description= "(de)select all reports."; ot->idname= "CONSOLE_OT_select_all_toggle"; /* api callbacks */ @@ -304,6 +307,7 @@ void CONSOLE_OT_select_border(wmOperatorType *ot) { /* identifiers */ ot->name= "Border Select"; + ot->description= "Toggle border selection."; ot->idname= "CONSOLE_OT_select_border"; /* api callbacks */ @@ -357,6 +361,7 @@ void CONSOLE_OT_report_delete(wmOperatorType *ot) { /* identifiers */ ot->name= "Delete Reports"; + ot->description= "Delete selected reports."; ot->idname= "CONSOLE_OT_report_delete"; /* api callbacks */ @@ -401,6 +406,7 @@ void CONSOLE_OT_report_copy(wmOperatorType *ot) { /* identifiers */ ot->name= "Copy Reports to Clipboard"; + ot->description= "Copy selected reports to Clipboard."; ot->idname= "CONSOLE_OT_report_copy"; /* api callbacks */ diff --git a/source/blender/editors/space_text/text_header.c b/source/blender/editors/space_text/text_header.c index 0e2d2ce1698..089436cfcf9 100644 --- a/source/blender/editors/space_text/text_header.c +++ b/source/blender/editors/space_text/text_header.c @@ -215,6 +215,7 @@ void TEXT_OT_properties(wmOperatorType *ot) { /* identifiers */ ot->name= "Properties"; + ot->description= "Toggle text properties panel."; ot->idname= "TEXT_OT_properties"; /* api callbacks */ diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 4c9f47ed170..7e514ea723a 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -176,6 +176,7 @@ void TEXT_OT_new(wmOperatorType *ot) { /* identifiers */ ot->name= "New"; + ot->description= "Create a new text data block."; ot->idname= "TEXT_OT_new"; /* api callbacks */ @@ -223,6 +224,7 @@ void TEXT_OT_open(wmOperatorType *ot) { /* identifiers */ ot->name= "Open"; + ot->description= "Open a new text data block."; ot->idname= "TEXT_OT_open"; /* api callbacks */ @@ -260,6 +262,7 @@ void TEXT_OT_reload(wmOperatorType *ot) { /* identifiers */ ot->name= "Reload"; + ot->description= "Reload active text data block from its file."; ot->idname= "TEXT_OT_reload"; /* api callbacks */ @@ -337,6 +340,7 @@ void TEXT_OT_unlink(wmOperatorType *ot) { /* identifiers */ ot->name= "Unlink"; + ot->description= "Unlink active text data block."; ot->idname= "TEXT_OT_unlink"; /* api callbacks */ @@ -367,6 +371,7 @@ void TEXT_OT_make_internal(wmOperatorType *ot) { /* identifiers */ ot->name= "Make Internal"; + ot->description= "Make active text file internal."; ot->idname= "TEXT_OT_make_internal"; /* api callbacks */ @@ -435,6 +440,7 @@ void TEXT_OT_save(wmOperatorType *ot) { /* identifiers */ ot->name= "Save"; + ot->description= "Save active text data block."; ot->idname= "TEXT_OT_save"; /* api callbacks */ @@ -490,6 +496,7 @@ void TEXT_OT_save_as(wmOperatorType *ot) { /* identifiers */ ot->name= "Save As"; + ot->description= "Save active text file with options."; ot->idname= "TEXT_OT_save_as"; /* api callbacks */ @@ -527,6 +534,7 @@ void TEXT_OT_run_script(wmOperatorType *ot) { /* identifiers */ ot->name= "Run Script"; + ot->description= "Run active script."; ot->idname= "TEXT_OT_run_script"; /* api callbacks */ @@ -583,6 +591,7 @@ void TEXT_OT_refresh_pyconstraints(wmOperatorType *ot) { /* identifiers */ ot->name= "Refresh PyConstraints"; + ot->description= "Refresh all pyconstraints."; ot->idname= "TEXT_OT_refresh_pyconstraints"; /* api callbacks */ @@ -704,6 +713,7 @@ void TEXT_OT_paste(wmOperatorType *ot) { /* identifiers */ ot->name= "Paste"; + ot->description= "Paste text from clipboard."; ot->idname= "TEXT_OT_paste"; /* api callbacks */ @@ -744,6 +754,7 @@ void TEXT_OT_copy(wmOperatorType *ot) { /* identifiers */ ot->name= "Copy"; + ot->description= "Copy selected text to clipboard."; ot->idname= "TEXT_OT_copy"; /* api callbacks */ @@ -774,6 +785,7 @@ void TEXT_OT_cut(wmOperatorType *ot) { /* identifiers */ ot->name= "Cut"; + ot->description= "Cut selected text to clipboard."; ot->idname= "TEXT_OT_cut"; /* api callbacks */ @@ -809,6 +821,7 @@ void TEXT_OT_indent(wmOperatorType *ot) { /* identifiers */ ot->name= "Indent"; + ot->description= "Indent selected text."; ot->idname= "TEXT_OT_indent"; /* api callbacks */ @@ -844,6 +857,7 @@ void TEXT_OT_unindent(wmOperatorType *ot) { /* identifiers */ ot->name= "Unindent"; + ot->description= "Unindent selected text."; ot->idname= "TEXT_OT_unindent"; /* api callbacks */ @@ -884,6 +898,7 @@ void TEXT_OT_line_break(wmOperatorType *ot) { /* identifiers */ ot->name= "Line Break"; + ot->description= "Insert line break at cursor position."; ot->idname= "TEXT_OT_line_break"; /* api callbacks */ @@ -916,6 +931,7 @@ void TEXT_OT_comment(wmOperatorType *ot) { /* identifiers */ ot->name= "Comment"; + ot->description= "Convert selected text to comment."; ot->idname= "TEXT_OT_comment"; /* api callbacks */ @@ -949,6 +965,7 @@ void TEXT_OT_uncomment(wmOperatorType *ot) { /* identifiers */ ot->name= "Uncomment"; + ot->description= "Convert selected comment to text."; ot->idname= "TEXT_OT_uncomment"; /* api callbacks */ @@ -1090,6 +1107,7 @@ void TEXT_OT_convert_whitespace(wmOperatorType *ot) { /* identifiers */ ot->name= "Convert Whitespace"; + ot->description= "Convert whitespaces by type."; ot->idname= "TEXT_OT_convert_whitespace"; /* api callbacks */ @@ -1120,6 +1138,7 @@ void TEXT_OT_select_all(wmOperatorType *ot) { /* identifiers */ ot->name= "Select All"; + ot->description= "Select all text."; ot->idname= "TEXT_OT_select_all"; /* api callbacks */ @@ -1147,6 +1166,7 @@ void TEXT_OT_select_line(wmOperatorType *ot) { /* identifiers */ ot->name= "Select Line"; + ot->description= "Select text by line."; ot->idname= "TEXT_OT_select_line"; /* api clinebacks */ @@ -1184,6 +1204,7 @@ void TEXT_OT_previous_marker(wmOperatorType *ot) { /* identifiers */ ot->name= "Previous Marker"; + ot->description= "Move to previous marker."; ot->idname= "TEXT_OT_previous_marker"; /* api callbacks */ @@ -1221,6 +1242,7 @@ void TEXT_OT_next_marker(wmOperatorType *ot) { /* identifiers */ ot->name= "Next Marker"; + ot->description= "Move to next marker"; ot->idname= "TEXT_OT_next_marker"; /* api callbacks */ @@ -1248,6 +1270,7 @@ void TEXT_OT_markers_clear(wmOperatorType *ot) { /* identifiers */ ot->name= "Clear All Markers"; + ot->description= "Clear all markers."; ot->idname= "TEXT_OT_markers_clear"; /* api callbacks */ @@ -1531,6 +1554,7 @@ void TEXT_OT_move(wmOperatorType *ot) { /* identifiers */ ot->name= "Move Cursor"; + ot->description= "Move cursor to position type."; ot->idname= "TEXT_OT_move"; /* api callbacks */ @@ -1557,6 +1581,7 @@ void TEXT_OT_move_select(wmOperatorType *ot) { /* identifiers */ ot->name= "Move Select"; + ot->description= "Make selection from current cursor position to new cursor position type."; ot->idname= "TEXT_OT_move_select"; /* api callbacks */ @@ -1596,6 +1621,7 @@ void TEXT_OT_jump(wmOperatorType *ot) { /* identifiers */ ot->name= "Jump"; + ot->description= "Jump cursor to line."; ot->idname= "TEXT_OT_jump"; /* api callbacks */ @@ -1648,6 +1674,7 @@ void TEXT_OT_delete(wmOperatorType *ot) { /* identifiers */ ot->name= "Delete"; + ot->description= "Delete text by cursor position."; ot->idname= "TEXT_OT_delete"; /* api callbacks */ @@ -1828,6 +1855,10 @@ void TEXT_OT_scroll(wmOperatorType *ot) { /* identifiers */ ot->name= "Scroll"; + /*don't really see the difference between this and + scroll_bar. Both do basically the same thing (aside + from keymaps).*/ + ot->description= "Scroll text screen."; ot->idname= "TEXT_OT_scroll"; /* api callbacks */ @@ -1876,6 +1907,10 @@ void TEXT_OT_scroll_bar(wmOperatorType *ot) { /* identifiers */ ot->name= "Scrollbar"; + /*don't really see the difference between this and + scroll. Both do basically the same thing (aside + from keymaps).*/ + ot->description= "Scroll text screen."; ot->idname= "TEXT_OT_scroll_bar"; /* api callbacks */ @@ -2151,6 +2186,7 @@ void TEXT_OT_cursor_set(wmOperatorType *ot) { /* identifiers */ ot->name= "Set Cursor"; + ot->description= "Set cursor selection."; ot->idname= "TEXT_OT_cursor_set"; /* api callbacks */ @@ -2274,6 +2310,7 @@ void TEXT_OT_insert(wmOperatorType *ot) { /* identifiers */ ot->name= "Insert"; + ot->description= "Insert text at cursor position."; ot->idname= "TEXT_OT_insert"; /* api callbacks */ @@ -2378,6 +2415,7 @@ void TEXT_OT_find(wmOperatorType *ot) { /* identifiers */ ot->name= "Find"; + ot->description= "Find specified text."; ot->idname= "TEXT_OT_find"; /* api callbacks */ @@ -2396,6 +2434,7 @@ void TEXT_OT_replace(wmOperatorType *ot) { /* identifiers */ ot->name= "Replace"; + ot->description= "Replace text with specified text."; ot->idname= "TEXT_OT_replace"; /* api callbacks */ @@ -2414,6 +2453,7 @@ void TEXT_OT_mark_all(wmOperatorType *ot) { /* identifiers */ ot->name= "Mark All"; + ot->description= "Mark all specified text."; ot->idname= "TEXT_OT_mark_all"; /* api callbacks */ @@ -2443,6 +2483,7 @@ void TEXT_OT_find_set_selected(wmOperatorType *ot) { /* identifiers */ ot->name= "Find Set Selected"; + ot->description= "Find specified text and set as selected."; ot->idname= "TEXT_OT_find_set_selected"; /* api callbacks */ @@ -2469,6 +2510,7 @@ void TEXT_OT_replace_set_selected(wmOperatorType *ot) { /* identifiers */ ot->name= "Replace Set Selected"; + ot->description= "Replace text with specified text and set as selected."; ot->idname= "TEXT_OT_replace_set_selected"; /* api callbacks */ @@ -2631,6 +2673,7 @@ void TEXT_OT_to_3d_object(wmOperatorType *ot) { /* identifiers */ ot->name= "To 3D Object"; + ot->description= "Create 3d text object from active text data block."; ot->idname= "TEXT_OT_to_3d_object"; /* api callbacks */ diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 081e9589fb8..e50a8205afa 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -148,6 +148,7 @@ void TFM_OT_select_orientation(struct wmOperatorType *ot) /* identifiers */ ot->name = "Select Orientation"; + ot->description= "Select orientation type."; ot->idname = "TFM_OT_select_orientation"; /* api callbacks */ @@ -308,6 +309,7 @@ void TFM_OT_translate(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Translate"; + ot->description= "Translate selected items."; ot->idname = OP_TRANSLATION; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -333,6 +335,7 @@ void TFM_OT_resize(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Resize"; + ot->description= "Resize selected items."; ot->idname = OP_RESIZE; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -359,6 +362,7 @@ void TFM_OT_trackball(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Trackball"; + ot->description= "Trackball style rotation of selected items."; ot->idname = OP_TRACKBALL; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -380,6 +384,7 @@ void TFM_OT_rotate(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Rotate"; + ot->description= "Rotate selected items."; ot->idname = OP_ROTATION; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -405,6 +410,10 @@ void TFM_OT_tilt(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Tilt"; + /*optionals - + "Tilt selected vertices." + "Specify an extra axis rotation for selected vertices of 3d curve." */ + ot->description= "Tilt selected vertices of 3d curve."; ot->idname = OP_TILT; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -428,6 +437,7 @@ void TFM_OT_warp(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Warp"; + ot->description= "Warp selected vertices around the cursor."; ot->idname = OP_WARP; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -452,6 +462,7 @@ void TFM_OT_shear(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Shear"; + ot->description= "Shear selected vertices along the horizontal screen axis."; ot->idname = OP_SHEAR; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -476,6 +487,7 @@ void TFM_OT_shrink_fatten(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Shrink/Fatten"; + ot->description= "Shrink/fatten selected vertices along vertex normals."; ot->idname = OP_SHRINK_FATTEN; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -497,6 +509,8 @@ void TFM_OT_tosphere(struct wmOperatorType *ot) { /* identifiers */ ot->name = "To Sphere"; + //added "around mesh center" to defferentiate between "MESH_OT_vertices_to_sphere()" + ot->description= "Move selected vertices outward in a spherical shape around mesh center."; ot->idname = OP_TOSPHERE; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -548,6 +562,7 @@ void TFM_OT_transform(struct wmOperatorType *ot) /* identifiers */ ot->name = "Transform"; + ot->description= "Transform selected items by mode type."; ot->idname = "TFM_OT_transform"; ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index 18159414cf6..41159397634 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -239,6 +239,7 @@ void ED_OT_undo(wmOperatorType *ot) { /* identifiers */ ot->name= "Undo"; + ot->description= "Undo previous action."; ot->idname= "ED_OT_undo"; /* api callbacks */ @@ -250,6 +251,7 @@ void ED_OT_redo(wmOperatorType *ot) { /* identifiers */ ot->name= "Redo"; + ot->description= "Redo previous action."; ot->idname= "ED_OT_redo"; /* api callbacks */ diff --git a/source/gameengine/GameLogic/SCA_PropertyEventManager.h b/source/gameengine/GameLogic/SCA_PropertyEventManager.h index 011f3285f63..a9692377df8 100644 --- a/source/gameengine/GameLogic/SCA_PropertyEventManager.h +++ b/source/gameengine/GameLogic/SCA_PropertyEventManager.h @@ -40,16 +40,17 @@ class SCA_PropertyEventManager : public SCA_EventManager class SCA_LogicManager* m_logicmgr; public: - -#ifdef WITH_CXX_GUARDEDALLOC - void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_PropertyEventManager"); } - void operator delete( void *mem ) { MEM_freeN(mem); } -#endif - SCA_PropertyEventManager(class SCA_LogicManager* logicmgr); virtual ~SCA_PropertyEventManager(); virtual void NextFrame(); //SCA_LogicManager* GetLogicManager() { return m_logicmgr;} + + +#ifdef WITH_CXX_GUARDEDALLOC +public: + void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "GE:SCA_PropertyEventManager"); } + void operator delete( void *mem ) { MEM_freeN(mem); } +#endif }; #endif //__KX_PROPERTYEVENTMANAGER From b39f73431a644dc0164d06bca8e54f1a734c6950 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 24 Aug 2009 10:07:49 +0000 Subject: [PATCH 234/577] [#19232] (2.5) Correction of cmake for windows about audio (jack and openal) from Guillaume Lecocq (lguillaume) [#19247] (2.5) useless WITH_OPENEXR redefinition from Mauro Toffanin (equilibrium) --- CMakeLists.txt | 4 ++-- .../imbuf/intern/openexr/openexr_api.cpp | 1 - source/creator/CMakeLists.txt | 20 +++++++++++++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ef4296e266..d1e18723f5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -251,8 +251,8 @@ IF(WIN32) IF(WITH_JACK) SET(JACK ${LIBDIR}/jack) - SET(JACK_INC ${JACK}/include/jack) - SET(JACK_LIB jack) + SET(JACK_INC ${JACK}/include/jack ${JACK}/include) + SET(JACK_LIB libjack) SET(JACK_LIBPATH ${JACK}/lib) ENDIF(WITH_JACK) diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index 32d97d79bd7..a780727b1a2 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -51,7 +51,6 @@ _CRTIMP void __cdecl _invalid_parameter_noinfo(void) #include "IMB_imbuf.h" #include "IMB_allocimbuf.h" -#define WITH_OPENEXR #include "openexr_multi.h" } diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 3b95c409b30..24b70c5664a 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -261,6 +261,26 @@ IF(WITH_INSTALL) COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\xvidcore.dll\" \"${TARGETDIR}\\\" ) ENDIF(WITH_FFMPEG) + + IF(WITH_JACK) + ADD_CUSTOM_COMMAND(TARGET blender + POST_BUILD + MAIN_DEPENDENCY blender + COMMAND copy /Y \"${WIN_LIBDIR}\\jack\\lib\\libjack.dll\" \"${TARGETDIR}\\\" + ) + ENDIF(WITH_JACK) + + IF(WITH_OPENAL) + ADD_CUSTOM_COMMAND(TARGET blender + POST_BUILD + MAIN_DEPENDENCY blender + COMMAND copy /Y \"${WIN_LIBDIR}\\openal\\lib\\OpenAL32.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\openal\\lib\\wrap_oal.dll\" \"${TARGETDIR}\\\" + + ) + ENDIF(WITH_OPENAL) + + ENDIF(WIN32) ENDIF(WITH_INSTALL) From 9967037e92ad75e76c3536a93a63a7100e4ccdc9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 24 Aug 2009 10:16:39 +0000 Subject: [PATCH 235/577] [#19029] Baking selected to active with nearby dupliframes objects crashes blender from Jorge Hodge (watcom) Confirmed the crash. baking didn't account for RE_RAY_TRANSFORM_OFFS in R.objectinstance. --- source/blender/render/intern/source/rendercore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c index 2793e238dc7..6b6a736a420 100644 --- a/source/blender/render/intern/source/rendercore.c +++ b/source/blender/render/intern/source/rendercore.c @@ -2241,7 +2241,7 @@ static int bake_check_intersect(Isect *is, int ob, RayFace *face) /* no direction checking for now, doesn't always improve the result * (INPR(shi->facenor, bs->dir) > 0.0f); */ - return (R.objectinstance[ob].obr->ob != bs->actob); + return (R.objectinstance[ob & ~RE_RAY_TRANSFORM_OFFS].obr->ob != bs->actob); } static int bake_intersect_tree(RayTree* raytree, Isect* isect, float *start, float *dir, float sign, float *hitco, float *dist) From 0b459178e1a247c647def869566da3d901d059ae Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 24 Aug 2009 10:21:53 +0000 Subject: [PATCH 236/577] [#19232] (2.5) Correction of cmake for windows about audio (jack and openal) Didnt apply the patch updated with sndfile. --- source/creator/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 24b70c5664a..0d9d0fe8856 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -262,6 +262,14 @@ IF(WITH_INSTALL) ) ENDIF(WITH_FFMPEG) + IF(WITH_SNDFILE) + ADD_CUSTOM_COMMAND(TARGET blender + POST_BUILD + MAIN_DEPENDENCY blender + COMMAND copy /Y \"${WIN_LIBDIR}\\sndfile\\lib\\libsndfile-1.dll\" \"${TARGETDIR}\\\" + ) + ENDIF(WITH_SNDFILE) + IF(WITH_JACK) ADD_CUSTOM_COMMAND(TARGET blender POST_BUILD From 9261efa4d6dd59f9284443fea85a24282eb72d27 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 24 Aug 2009 10:37:39 +0000 Subject: [PATCH 237/577] [#18936] Particle Related Patch from Alberto Santos (dnakhain) This also adds the option to duplicate a particle system with an object. --- description from the patch submission. This patch includes my latest additions to the Python API developed for my Degree's Project. It includes: - Particle - Vertex group dictionary in doc (to use with setvertexgroup/getvertexgroup) - Particle.New return psys (not specified in doc) - Draw As variable and dict - Strand render toggle - Object - psys variable in duplicate - Material - Strand render variables - Texture - Use colorbands - Lamp - Spot buffer type selection --- source/blender/makesdna/DNA_userdef_types.h | 1 + source/blender/python/api2_2x/Lamp.c | 41 +++- source/blender/python/api2_2x/Material.c | 203 ++++++++++++++++++ source/blender/python/api2_2x/Object.c | 10 +- source/blender/python/api2_2x/Particle.c | 100 ++++++++- source/blender/python/api2_2x/Texture.c | 29 +++ source/blender/python/api2_2x/doc/Lamp.py | 7 + source/blender/python/api2_2x/doc/Material.py | 18 ++ source/blender/python/api2_2x/doc/Object.py | 5 +- source/blender/python/api2_2x/doc/Particle.py | 32 ++- source/blender/python/api2_2x/doc/Texture.py | 2 + source/blender/src/editobject.c | 11 + 12 files changed, 450 insertions(+), 9 deletions(-) diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index fbd962f9372..a986f993722 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -313,6 +313,7 @@ extern UserDef U; /* from usiblender.c !!!! */ #define USER_DUP_TEX (1 << 8) #define USER_DUP_ARM (1 << 9) #define USER_DUP_ACT (1 << 10) +#define USER_DUP_PSYS (1 << 11) /* gameflags */ #define USER_DEPRECATED_FLAG 1 diff --git a/source/blender/python/api2_2x/Lamp.c b/source/blender/python/api2_2x/Lamp.c index 3b7a785f32e..d3acc089944 100644 --- a/source/blender/python/api2_2x/Lamp.c +++ b/source/blender/python/api2_2x/Lamp.c @@ -125,6 +125,8 @@ #define EXPP_LAMP_COL_MAX 1.0 #define EXPP_LAMP_FALLOFF_MIN LA_FALLOFF_CONSTANT #define EXPP_LAMP_FALLOFF_MAX LA_FALLOFF_SLIDERS +#define EXPP_LAMP_BUFFERTYPE_MIN LA_SHADBUF_REGULAR +#define EXPP_LAMP_BUFFERTYPE_MAX LA_SHADBUF_HALFWAY /* Raytracing settings */ #define EXPP_LAMP_RAYSAMPLES_MIN 1 @@ -268,6 +270,8 @@ static PyObject *Lamp_clearScriptLinks( BPy_Lamp * self, PyObject * args ); static int Lamp_setComponent( BPy_Lamp * self, PyObject * value, void * closure ); static PyObject *Lamp_getFalloffType( BPy_Lamp * self ); static int Lamp_setFalloffType( BPy_Lamp * self, PyObject * value ); +static PyObject *Lamp_getBufferType( BPy_Lamp * self ); +static int Lamp_setBufferType( BPy_Lamp * self, PyObject * value ); /*****************************************************************************/ /* Python BPy_Lamp methods table: */ @@ -489,6 +493,10 @@ static PyGetSetDef BPy_Lamp_getseters[] = { (getter)Lamp_getFalloffType, (setter)Lamp_setFalloffType, "Lamp falloff type", NULL}, + {"bufferType", + (getter)Lamp_getBufferType, (setter)Lamp_setBufferType, + "Lamp buffer type", + NULL}, {"R", (getter)Lamp_getComponent, (setter)Lamp_setComponent, "Lamp color red component", @@ -828,13 +836,31 @@ static PyObject *Lamp_FalloffsDict( void ) return Falloffs; } +static PyObject *Lamp_BufferTypesDict( void ) +{ /* create the Blender.Lamp.BufferTypes constant dict */ + PyObject *Types = PyConstant_New( ); + + if( Types ) { + BPy_constant *c = ( BPy_constant * ) Types; + + PyConstant_Insert( c, "REGULAR", + PyInt_FromLong( LA_SHADBUF_REGULAR ) ); + PyConstant_Insert( c, "IRREGULAR", + PyInt_FromLong( LA_SHADBUF_IRREGULAR ) ); + PyConstant_Insert( c, "HALFWAY", + PyInt_FromLong( LA_SHADBUF_HALFWAY ) ); + } + + return Types; +} + /*****************************************************************************/ /* Function: Lamp_Init */ /*****************************************************************************/ /* Needed by the Blender module, to register the Blender.Lamp submodule */ PyObject *Lamp_Init( void ) { - PyObject *submodule, *Types, *Modes, *Falloffs; + PyObject *submodule, *Types, *Modes, *Falloffs, *BufferTypes; if( PyType_Ready( &Lamp_Type ) < 0) return NULL; @@ -842,6 +868,7 @@ PyObject *Lamp_Init( void ) Types = Lamp_TypesDict( ); Modes = Lamp_ModesDict( ); Falloffs = Lamp_FalloffsDict( ); + BufferTypes = Lamp_BufferTypesDict( ); submodule = Py_InitModule3( "Blender.Lamp", M_Lamp_methods, M_Lamp_doc ); @@ -852,6 +879,8 @@ PyObject *Lamp_Init( void ) PyModule_AddObject( submodule, "Modes", Modes ); if( Falloffs ) PyModule_AddObject( submodule, "Falloffs", Falloffs ); + if( BufferTypes ) + PyModule_AddObject( submodule, "BufferTypes", BufferTypes ); PyModule_AddIntConstant( submodule, "RGB", IPOKEY_RGB ); PyModule_AddIntConstant( submodule, "ENERGY", IPOKEY_ENERGY ); @@ -1029,6 +1058,11 @@ static PyObject *Lamp_getFalloffType( BPy_Lamp * self ) return PyInt_FromLong( (int)self->lamp->falloff_type ); } +static PyObject *Lamp_getBufferType( BPy_Lamp * self ) +{ + return PyInt_FromLong( (int)self->lamp->buftype ); +} + static int Lamp_setType( BPy_Lamp * self, PyObject * value ) { return EXPP_setIValueRange ( value, &self->lamp->type, @@ -1217,6 +1251,11 @@ static int Lamp_setFalloffType( BPy_Lamp * self, PyObject * value ) EXPP_LAMP_FALLOFF_MIN, EXPP_LAMP_FALLOFF_MAX, 'h' ); } +static int Lamp_setBufferType( BPy_Lamp * self, PyObject * value ) +{ + return EXPP_setIValueRange ( value, &self->lamp->buftype, + EXPP_LAMP_BUFFERTYPE_MIN, EXPP_LAMP_BUFFERTYPE_MAX, 'h' ); +} static PyObject *Lamp_getComponent( BPy_Lamp * self, void * closure ) { diff --git a/source/blender/python/api2_2x/Material.c b/source/blender/python/api2_2x/Material.c index 50a1be3fa97..cc0dd9ff6a5 100644 --- a/source/blender/python/api2_2x/Material.c +++ b/source/blender/python/api2_2x/Material.c @@ -747,6 +747,26 @@ static PyObject *Material_getColorbandSpecularInput( BPy_Material * self ); static int Material_setColorbandDiffuseInput ( BPy_Material * self, PyObject * value); static int Material_setColorbandSpecularInput ( BPy_Material * self, PyObject * value); +static PyObject *Material_getStrandTangentShad( BPy_Material * self ); +static int Material_setStrandTangentShad( BPy_Material * self, PyObject * value); +static PyObject *Material_getStrandSurfDiff( BPy_Material * self ); +static int Material_setStrandSurfDiff( BPy_Material * self, PyObject * value); +static PyObject *Material_getStrandDist( BPy_Material * self ); +static int Material_setStrandDist( BPy_Material * self, PyObject * value); +static PyObject *Material_getStrandBlendUnit( BPy_Material * self ); +static int Material_setStrandBlendUnit( BPy_Material * self, PyObject * value); +static PyObject *Material_getStrandStart( BPy_Material * self ); +static int Material_setStrandStart( BPy_Material * self, PyObject * value); +static PyObject *Material_getStrandEnd( BPy_Material * self ); +static int Material_setStrandEnd( BPy_Material * self, PyObject * value); +static PyObject *Material_getStrandMin( BPy_Material * self ); +static int Material_setStrandMin( BPy_Material * self, PyObject * value); +static PyObject *Material_getStrandShape( BPy_Material * self ); +static int Material_setStrandShape( BPy_Material * self, PyObject * value); +static PyObject *Material_getStrandWidthFad( BPy_Material * self ); +static int Material_setStrandWidthFad( BPy_Material * self, PyObject * value); +static PyObject *Material_getStrandUV( BPy_Material * self ); +static int Material_setStrandUV( BPy_Material * self, PyObject * value); /*****************************************************************************/ @@ -1313,6 +1333,46 @@ static PyGetSetDef BPy_Material_getseters[] = { (getter)Material_getColorbandDiffuseInput, (setter)Material_setColorbandDiffuseInput, "The diffuse colorband input for this material", NULL}, + {"strandTanShad", + (getter)Material_getStrandTangentShad, (setter)Material_setStrandTangentShad, + "Uses direction of strands as normal for tangent-shading", + NULL}, + {"strandSurfDiff", + (getter)Material_getStrandSurfDiff, (setter)Material_setStrandSurfDiff, + "Make diffuse shading more similar to shading the surface", + NULL}, + {"strandDist", + (getter)Material_getStrandDist, (setter)Material_setStrandDist, + "Distance in Blender units over which to blend in the surface normal", + NULL}, + {"strandBlendUnit", + (getter)Material_getStrandBlendUnit, (setter)Material_setStrandBlendUnit, + "Use actual Blender units for widths instead of pixels", + NULL}, + {"strandStart", + (getter)Material_getStrandStart, (setter)Material_setStrandStart, + "Start size of strands", + NULL}, + {"strandEnd", + (getter)Material_getStrandEnd, (setter)Material_setStrandEnd, + "End size of strands", + NULL}, + {"strandMin", + (getter)Material_getStrandMin, (setter)Material_setStrandMin, + "Minimum size of strands in pixels", + NULL}, + {"strandShape", + (getter)Material_getStrandShape, (setter)Material_setStrandShape, + "Shape of strands, positive value makes it rounder, negative makes it spiky", + NULL}, + {"strandFade", + (getter)Material_getStrandWidthFad, (setter)Material_setStrandWidthFad, + "Transparency along the width of the strand", + NULL}, + {"strandUV", + (getter)Material_getStrandUV, (setter)Material_setStrandUV, + "Set name of UV layer to override", + NULL}, /* SSS settings */ {"enableSSS", @@ -3582,3 +3642,146 @@ static int Material_setColorbandSpecularInput ( BPy_Material * self, PyObject * return EXPP_setIValueClamped(value, &self->material->rampin_spec, MA_RAMP_IN_SHADER, MA_RAMP_IN_RESULT, 'b'); } + +/* Strand */ + +static PyObject *Material_getStrandTangentShad( BPy_Material * self ) +{ + return PyInt_FromLong( ((long)( self->material->mode & MA_TANGENT_STR )) > 0 ); +} + +static int Material_setStrandTangentShad( BPy_Material * self, PyObject * value) +{ + int number; + + if( !PyInt_Check( value ) ) + return EXPP_ReturnIntError( PyExc_TypeError, "expected int argument" ); + + number = PyInt_AS_LONG( value ); + + if (number){ + self->material->mode |= MA_TANGENT_STR; + }else{ + self->material->mode &= ~MA_TANGENT_STR; + } + + return 0; +} + +static PyObject *Material_getStrandSurfDiff( BPy_Material * self ) +{ + return PyInt_FromLong( ((long)( self->material->mode & MA_STR_SURFDIFF )) > 0 ); +} + +static int Material_setStrandSurfDiff( BPy_Material * self, PyObject * value) +{ + int number; + + if( !PyInt_Check( value ) ) + return EXPP_ReturnIntError( PyExc_TypeError, "expected int argument" ); + + number = PyInt_AS_LONG( value ); + + if (number){ + self->material->mode |= MA_STR_SURFDIFF; + }else{ + self->material->mode &= ~MA_STR_SURFDIFF; + } + + return 0; +} + +static PyObject *Material_getStrandDist( BPy_Material * self ) +{ + return PyFloat_FromDouble( ((float)( self->material->strand_surfnor )) ); +} + +static int Material_setStrandDist( BPy_Material * self, PyObject * value) +{ + return EXPP_setFloatRange( value, &self->material->strand_surfnor, 0.0, 10.0 ); +} + +static PyObject *Material_getStrandBlendUnit( BPy_Material * self ) +{ + return PyInt_FromLong( ((long)( self->material->mode & MA_STR_B_UNITS )) > 0 ); +} + +static int Material_setStrandBlendUnit( BPy_Material * self, PyObject * value) +{ + int number; + + if( !PyInt_Check( value ) ) + return EXPP_ReturnIntError( PyExc_TypeError, "expected int argument" ); + + number = PyInt_AS_LONG( value ); + + if (number){ + self->material->mode |= MA_STR_B_UNITS; + }else{ + self->material->mode &= ~MA_STR_B_UNITS; + } + + return 0; +} + +static PyObject *Material_getStrandStart( BPy_Material * self ) +{ + return PyFloat_FromDouble( ((float)( self->material->strand_sta )) ); +} + +static int Material_setStrandStart( BPy_Material * self, PyObject * value) +{ + return EXPP_setFloatRange( value, &self->material->strand_sta, 0.0001, 2.0 ); +} + +static PyObject *Material_getStrandEnd( BPy_Material * self ) +{ + return PyFloat_FromDouble( ((float)( self->material->strand_end )) ); +} + +static int Material_setStrandEnd( BPy_Material * self, PyObject * value) +{ + return EXPP_setFloatRange( value, &self->material->strand_end, 0.0001, 1.0 ); +} + +static PyObject *Material_getStrandMin( BPy_Material * self ) +{ + return PyFloat_FromDouble( ((float)( self->material->strand_min )) ); +} + +static int Material_setStrandMin( BPy_Material * self, PyObject * value) +{ + return EXPP_setFloatRange( value, &self->material->strand_min, 0.0001, 10.0 ); +} + +static PyObject *Material_getStrandShape( BPy_Material * self ) +{ + return PyFloat_FromDouble( ((float)( self->material->strand_ease )) ); +} + +static int Material_setStrandShape( BPy_Material * self, PyObject * value) +{ + return EXPP_setFloatRange( value, &self->material->strand_ease, -0.9, 0.9 ); +} + +static PyObject *Material_getStrandWidthFad( BPy_Material * self ) +{ + return PyFloat_FromDouble( ((float)( self->material->strand_widthfade )) ); +} + +static int Material_setStrandWidthFad( BPy_Material * self, PyObject * value) +{ + return EXPP_setFloatRange( value, &self->material->strand_widthfade, 0.0, 2.0 ); +} + +static PyObject *Material_getStrandUV( BPy_Material * self ) +{ + return EXPP_ReturnPyObjError( PyExc_NotImplementedError, + "Material.strandUV not implemented" ); +} + +static int Material_setStrandUV( BPy_Material * self, PyObject * value) +{ + return EXPP_ReturnPyObjError( PyExc_NotImplementedError, + "Material.strandUV not implemented" ); +} diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c index b50b0082bf4..8617491e950 100644 --- a/source/blender/python/api2_2x/Object.c +++ b/source/blender/python/api2_2x/Object.c @@ -1001,9 +1001,10 @@ static PyObject *M_Object_Duplicate( PyObject * self_unused, int material_dupe = 0; int texture_dupe = 0; int ipo_dupe = 0; + int psys_dupe = 0; static char *kwlist[] = {"mesh", "surface", "curve", - "text", "metaball", "armature", "lamp", "material", "texture", "ipo", NULL}; + "text", "metaball", "armature", "lamp", "material", "texture", "ipo", "psys", NULL}; /* duplicating in background causes segfaults */ if( G.background == 1 ) @@ -1011,11 +1012,11 @@ static PyObject *M_Object_Duplicate( PyObject * self_unused, "cannot duplicate objects in background mode" ); - if (!PyArg_ParseTupleAndKeywords(args, kwd, "|iiiiiiiiii", kwlist, + if (!PyArg_ParseTupleAndKeywords(args, kwd, "|iiiiiiiiiii", kwlist, &mesh_dupe, &surface_dupe, &curve_dupe, &text_dupe, &metaball_dupe, - &armature_dupe, &lamp_dupe, &material_dupe, &texture_dupe, &ipo_dupe)) + &armature_dupe, &lamp_dupe, &material_dupe, &texture_dupe, &ipo_dupe, &psys_dupe)) return EXPP_ReturnPyObjError( PyExc_TypeError, - "expected nothing or bool keywords 'mesh', 'surface', 'curve', 'text', 'metaball', 'armature', 'lamp' 'material', 'texture' and 'ipo' as arguments" ); + "expected nothing or bool keywords 'mesh', 'surface', 'curve', 'text', 'metaball', 'armature', 'lamp' 'material', 'texture', 'ipo' and 'psys' as arguments" ); /* USER_DUP_ACT for actions is not supported in the UI so dont support it here */ if (mesh_dupe) dupflag |= USER_DUP_MESH; @@ -1028,6 +1029,7 @@ static PyObject *M_Object_Duplicate( PyObject * self_unused, if (material_dupe) dupflag |= USER_DUP_MAT; if (texture_dupe) dupflag |= USER_DUP_TEX; if (ipo_dupe) dupflag |= USER_DUP_IPO; + if (psys_dupe) dupflag |= USER_DUP_PSYS; adduplicate(2, dupflag); /* 2 is a mode with no transform and no redraw, Duplicate the current selection, context sensitive */ Py_RETURN_NONE; } diff --git a/source/blender/python/api2_2x/Particle.c b/source/blender/python/api2_2x/Particle.c index f69cb6a01b9..850100d29a9 100644 --- a/source/blender/python/api2_2x/Particle.c +++ b/source/blender/python/api2_2x/Particle.c @@ -42,6 +42,7 @@ #include "BKE_utildefines.h" #include "BKE_pointcache.h" #include "BKE_DerivedMesh.h" +#include "BKE_library.h" #include "BIF_editparticle.h" #include "BIF_space.h" #include "blendef.h" @@ -70,6 +71,9 @@ static PyObject *Part_GetMat( BPy_PartSys * self, PyObject * args ); static PyObject *Part_GetSize( BPy_PartSys * self, PyObject * args ); static PyObject *Part_GetVertGroup( BPy_PartSys * self, PyObject * args ); static PyObject *Part_SetVertGroup( BPy_PartSys * self, PyObject * args ); +static int Part_SetName( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_SetNameWithMethod( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_GetName( BPy_PartSys * self, PyObject * args ); static int Part_setSeed( BPy_PartSys * self, PyObject * args ); static PyObject *Part_getSeed( BPy_PartSys * self ); static int Part_setType( BPy_PartSys * self, PyObject * args ); @@ -141,11 +145,16 @@ static int Part_setRenderDied( BPy_PartSys * self, PyObject * args ); static PyObject *Part_getRenderDied( BPy_PartSys * self ); static int Part_setRenderMaterialIndex( BPy_PartSys * self, PyObject * args ); static PyObject *Part_getRenderMaterialIndex( BPy_PartSys * self ); +static int Part_setStrandRender( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getStrandRender( BPy_PartSys * self ); +static int Part_setStrandRenderAn( BPy_PartSys * self, PyObject * args ); +static PyObject *Part_getStrandRenderAn( BPy_PartSys * self ); static int Part_setStep( BPy_PartSys * self, PyObject * args ); static PyObject *Part_getStep( BPy_PartSys * self ); static int Part_setRenderStep( BPy_PartSys * self, PyObject * args ); static PyObject *Part_getRenderStep( BPy_PartSys * self ); static PyObject *Part_getDupOb( BPy_PartSys * self ); +static int Part_setDrawAs( BPy_PartSys * self, PyObject * args ); static PyObject *Part_getDrawAs( BPy_PartSys * self ); static int Part_setPhysType( BPy_PartSys * self, PyObject * args ); static PyObject *Part_getPhysType( BPy_PartSys * self ); @@ -283,6 +292,10 @@ static PyMethodDef BPy_ParticleSys_methods[] = { METH_VARARGS, "() - Get the vertex group which affects a particles attribute"}, {"setVertGroup", ( PyCFunction ) Part_SetVertGroup, METH_VARARGS, "() - Set the vertex group to affect a particles attribute"}, + {"getName", ( PyCFunction ) Part_GetName, METH_NOARGS, + "() - Return particle system's name"}, + {"setName", ( PyCFunction ) Part_SetNameWithMethod, METH_VARARGS, + "(s) - Change particle system's name"}, {NULL, NULL, 0, NULL} }; @@ -430,6 +443,14 @@ static PyGetSetDef BPy_ParticleSys_getseters[] = { (getter)Part_getRenderMaterialIndex, (setter)Part_setRenderMaterialIndex, "Specify material index used for the particles", NULL}, + {"strandRender", + (getter)Part_getStrandRender, (setter)Part_setStrandRender, + "Use the strand primitive to render", + NULL}, + {"strandRenderAngle", + (getter)Part_getStrandRenderAn, (setter)Part_setStrandRenderAn, + "How many degrees path has to curve to make another render segment", + NULL}, {"displayPercentage", (getter)Part_getParticleDisp, (setter)Part_setParticleDisp, "Particle display percentage", @@ -447,8 +468,8 @@ static PyGetSetDef BPy_ParticleSys_getseters[] = { "Get the duplicate ob", NULL}, {"drawAs", - (getter)Part_getDrawAs, NULL, - "Get draw type Particle.DRAWAS([ 'NONE' | 'OBJECT' | 'POINT' | ... ] )", + (getter)Part_getDrawAs, (setter)Part_setDrawAs, + "Draw type Particle.DRAWAS([ 'NONE' | 'OBJECT' | 'POINT' | ... ] )", NULL}, /* Newtonian Physics */ {"physics", @@ -2008,6 +2029,33 @@ static PyObject *Part_SetVertGroup( BPy_PartSys * self, PyObject * args ){ Py_RETURN_NONE; } +PyObject *Part_GetName( BPy_PartSys * self, PyObject * args ) +{ + ID *id = (ID*) self->psys->part; + if (!id) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "data has been removed" ) ); + return PyString_FromString( id->name + 2 ); +} + +int Part_SetName( BPy_PartSys * self, PyObject * args ) +{ + ID *id = (ID*) self->psys->part; + char *name = NULL; + if (!id) return ( EXPP_ReturnIntError( PyExc_RuntimeError, "data has been removed" ) ); + + name = PyString_AsString ( args ); + if( !name ) + return EXPP_ReturnIntError( PyExc_TypeError, + "expected string argument" ); + + rename_id( id, name ); + + return 0; +} + +PyObject * Part_SetNameWithMethod( BPy_PartSys *self, PyObject *args ) +{ + return EXPP_setterWrapper( (void *)self, args, (setter)Part_SetName ); +} /*****************************************************************************/ /* Function: Set/Get Seed */ @@ -2714,6 +2762,44 @@ static PyObject *Part_getRenderDied( BPy_PartSys * self ) return PyInt_FromLong( ((long)( self->psys->part->flag & PART_DIED )) > 0 ); } +static int Part_setStrandRender( BPy_PartSys * self, PyObject * args ) +{ + int number; + + if( !PyInt_Check( args ) ) + return EXPP_ReturnIntError( PyExc_TypeError, "expected int argument" ); + + number = PyInt_AS_LONG( args ); + + if (number){ + self->psys->part->draw |= PART_DRAW_REN_STRAND; + }else{ + self->psys->part->draw &= ~PART_DRAW_REN_STRAND; + } + + return 0; +} + +static PyObject *Part_getStrandRender( BPy_PartSys * self ) +{ + return PyInt_FromLong( ((long)( self->psys->part->draw & PART_DRAW_REN_STRAND )) > 0 ); +} + +static int Part_setStrandRenderAn( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setIValueRange( args, &self->psys->part->adapt_angle, + 0, 45, 'i' ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + +static PyObject *Part_getStrandRenderAn( BPy_PartSys * self ) +{ + return PyInt_FromLong( ((int)( self->psys->part->adapt_angle )) ); +} + static int Part_setParticleDisp( BPy_PartSys * self, PyObject * args ) { int res = EXPP_setIValueRange( args, &self->psys->part->disp, @@ -2762,6 +2848,16 @@ static PyObject *Part_getRenderStep( BPy_PartSys * self ) return PyInt_FromLong( ((short)( self->psys->part->ren_step )) ); } +static int Part_setDrawAs( BPy_PartSys * self, PyObject * args ) +{ + int res = EXPP_setIValueRange( args, &self->psys->part->draw_as, + 0, 9, 'h' ); + + psys_flush_settings( self->psys->part, PSYS_ALLOC, 1 ); + + return res; +} + static PyObject *Part_getDrawAs( BPy_PartSys * self ) { return PyInt_FromLong( (long)( self->psys->part->draw_as ) ); diff --git a/source/blender/python/api2_2x/Texture.c b/source/blender/python/api2_2x/Texture.c index 455badef4ad..e9e1c898fca 100644 --- a/source/blender/python/api2_2x/Texture.c +++ b/source/blender/python/api2_2x/Texture.c @@ -511,6 +511,8 @@ static int Texture_setNoiseBasis2( BPy_Texture *self, PyObject *args, static PyObject *Texture_getColorband( BPy_Texture * self); int Texture_setColorband( BPy_Texture * self, PyObject * value); +static PyObject *Texture_getUseColorband( BPy_Texture * self); +int Texture_setUseColorband( BPy_Texture * self, PyObject * value); static PyObject *Texture_evaluate( BPy_Texture *self, PyObject *value ); static PyObject *Texture_copy( BPy_Texture *self ); @@ -791,6 +793,10 @@ static PyGetSetDef BPy_Texture_getseters[] = { (getter)Texture_getColorband, (setter)Texture_setColorband, "The colorband for this texture", NULL}, + {"useColorband", + (getter)Texture_getUseColorband, (setter)Texture_setUseColorband, + "Use colorband for this texture", + NULL}, {NULL,NULL,NULL,NULL,NULL} /* Sentinel */ }; @@ -2525,6 +2531,29 @@ int Texture_setColorband( BPy_Texture * self, PyObject * value) return EXPP_Colorband_fromPyList( &self->texture->coba, value ); } +static PyObject *Texture_getUseColorband( BPy_Texture * self) +{ + return PyInt_FromLong( ((long)( self->texture->flag & TEX_COLORBAND )) > 0 ); +} + +int Texture_setUseColorband( BPy_Texture * self, PyObject * value) +{ + int number; + + if( !PyInt_Check( value ) ) + return EXPP_ReturnIntError( PyExc_TypeError, "expected int argument" ); + + number = PyInt_AS_LONG( value ); + + if (number){ + self->texture->flag |= TEX_COLORBAND; + }else{ + self->texture->flag &= ~TEX_COLORBAND; + } + + return 0; +} + static PyObject *Texture_evaluate( BPy_Texture * self, PyObject * value ) { TexResult texres= {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL}; diff --git a/source/blender/python/api2_2x/doc/Lamp.py b/source/blender/python/api2_2x/doc/Lamp.py index 878ca53bb15..88b1c2cf800 100644 --- a/source/blender/python/api2_2x/doc/Lamp.py +++ b/source/blender/python/api2_2x/doc/Lamp.py @@ -46,6 +46,11 @@ Example:: - 'NoDiffuse' - 'NoSpecular' - 'RayShadow' +@type BufferTypes: read-only dictionary +@var BufferTypes: The lamp shadowbuffer types. + - 'Regular' + - 'Irregular' + - 'Halfway' Example:: from Blender import Lamp, Object @@ -101,6 +106,8 @@ class Lamp: @ivar bufferSize: Lamp shadow buffer size. Value is clamped to the range [512,5120]. @type bufferSize: int + @ivar bufferType: Lamp shadowbuffer type. See L{BufferTypes} for values. + @type bufferType: int @ivar clipEnd: Lamp shadow map clip end. Value is clamped to the range [1.0,5000.0]. @type clipEnd: float diff --git a/source/blender/python/api2_2x/doc/Material.py b/source/blender/python/api2_2x/doc/Material.py index 59ff4bc8503..801bb4cb04d 100644 --- a/source/blender/python/api2_2x/doc/Material.py +++ b/source/blender/python/api2_2x/doc/Material.py @@ -408,6 +408,24 @@ class Material: @type textures: a tuple of Blender MTex objects. @ivar textures: the Material's Texture list. Empty texture channels contains None. + @ivar strandTanShad: Uses direction of strands as normal for tangent-shading + @type strandTanShad: int + @ivar strandSurfDiff: Make diffuse shading more similar to shading the surface + @type strandSurfDiff: int + @ivar strandDist: Distance in Blender units over which to blend in the surface normal + @type strandDist: float + @ivar strandBlendUnit: Use actual Blender units for widths instead of pixels + @type strandBlendUnit: int + @ivar strandStart: Start size of strands + @type strandStart: float + @ivar strandEnd: End size of strands + @type strandEnd: float + @ivar strandMin: Minimum size of strands in pixels + @type strandMin: float + @ivar strandShape: Shape of strands, positive value makes it rounder, negative makes it spiky + @type strandShape: float + @ivar strandFade: Transparency along the width of the strand + @type strandFade: float @ivar enableSSS: If True, subsurface scattering will be rendered on this material. @type enableSSS: bool @ivar sssScale: If True, subsurface scattering will be rendered on this material. diff --git a/source/blender/python/api2_2x/doc/Object.py b/source/blender/python/api2_2x/doc/Object.py index 212ff95ef74..bd1bd2eb0b3 100644 --- a/source/blender/python/api2_2x/doc/Object.py +++ b/source/blender/python/api2_2x/doc/Object.py @@ -205,7 +205,7 @@ def GetSelected (): """ -def Duplicate (mesh=0, surface=0, curve=0, text=0, metaball=0, armature=0, lamp=0, material=0, texture=0, ipo=0): +def Duplicate (mesh=0, surface=0, curve=0, text=0, metaball=0, armature=0, lamp=0, material=0, texture=0, ipo=0, psys=0): """ Duplicate selected objects on visible layers from Blenders current scene, de-selecting the currently visible, selected objects and making a copy where all new objects are selected. @@ -234,6 +234,8 @@ def Duplicate (mesh=0, surface=0, curve=0, text=0, metaball=0, armature=0, lamp= @param texture: When non-zero, texture data used by the object's materials will be duplicated with the objects. @type ipo: bool @param ipo: When non-zero, Ipo data linked to the object will be duplicated with the objects. + @type psys: bool + @param psys: When non-zero, particle systems used by the object or its object data will be duplicated with the objects. I{B{Example:}} @@ -663,6 +665,7 @@ class Object: particle system with that name exists, it is linked to the object. @type name: string @param name: The name of the requested Particle system (optional). + @return: The particle system linked. """ def addVertexGroupsFromArmature(object): diff --git a/source/blender/python/api2_2x/doc/Particle.py b/source/blender/python/api2_2x/doc/Particle.py index 7193e365536..15481c9dd63 100644 --- a/source/blender/python/api2_2x/doc/Particle.py +++ b/source/blender/python/api2_2x/doc/Particle.py @@ -69,6 +69,20 @@ This module provides access to the B{Particle} in Blender. - NONE: No particle angular velocity - SPIN: Spin particle angular velocity - RANDOM: Random particle angular velocity +@type VERTEXGROUPS: readonly dictionary +@var VERTEXGROUPS: Constant dict used for with L{Particle.VERTEXGROUP} + - DENSITY: VertexGroup affect to particles density + - VELOCITY: VertexGroup affect to particles velocity + - LENGHT: VertexGroup affect to particles lenght + - CLUMP: VertexGroup affect to particles clump + - KINK: VertexGroup affect to particles kink + - ROUGH1: VertexGroup affect to particles rough1 + - ROUGH2: VertexGroup affect to particles rough2 + - ROUGHE: VertexGroup affect to particles roughE + - SIZE: VertexGroup affect to particles size + - TANVEL: VertexGroup affect to particles tangent velocity + - TANROT: VertexGroup affect to particles tangent rotation + - EFFECTOR: VertexGroup affect to particles effector @type CHILDTYPE: readonly dictionary @var CHILDTYPE: Constant dict used for with L{Particle.CHILDTYPE} - NONE: set no children @@ -171,6 +185,10 @@ class Particle: @type renderDied: int @ivar renderMaterial: Specify material used for the particles. @type renderMaterial: int + @ivar strandRender: Use the strand primitive to render. + @type strandRender: int + @ivar strandRenderAngle: How many degrees path has to curve to make another render segment. + @type strandRenderAngle: int @ivar displayPercentage: Particle display percentage. @type displayPercentage: int @ivar hairDisplayStep: How many steps paths are drawn with (power of 2) in visu mode. @@ -179,7 +197,7 @@ class Particle: @type hairRenderStep: int @ivar duplicateObject: Get the duplicate object. @type duplicateObject: Blender Object - @ivar drawAs: Get draw type Particle.DRAWAS([ 'NONE' | 'OBJECT' | 'POINT' | ... ]). + @ivar drawAs: Draw type Particle.DRAWAS([ 'NONE' | 'OBJECT' | 'POINT' | ... ]). @type drawAs: int @ivar physics: Select particle physics type Particle.PHYSICS([ 'BOIDS' | 'KEYED' | 'NEWTONIAN' | 'NONE' ]) @type physics: int @@ -276,6 +294,18 @@ class Particle: @ivar childBranch: Threshold of branching @type childBranch: float """ + def getName(): + """ + Get the name of this Particle System object. + @rtype: string + """ + + def setName(name): + """ + Set the name of this Particle System object. + @type name: string + @param name: The new name. + """ def freeEdit(): """ diff --git a/source/blender/python/api2_2x/doc/Texture.py b/source/blender/python/api2_2x/doc/Texture.py index ad57c303ed2..3431dceb6cd 100644 --- a/source/blender/python/api2_2x/doc/Texture.py +++ b/source/blender/python/api2_2x/doc/Texture.py @@ -393,6 +393,8 @@ class Texture: each color a list of 5 floats [0 - 1], [r,g,b,a,pos]. The colorband can have between 1 and 31 colors. @type colorband: list + @ivar useColorband: Use colorband for this texture. + @type colorband: int @ivar autoRefresh: Refresh image on frame changes enabled. @type autoRefresh: boolean """ diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index b6b6c3c8df9..801b086f980 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -5185,6 +5185,7 @@ void adduplicate(int mode, int dupflag) Object *ob, *obn; ID *id; int a, didit; + ParticleSystem *psys; if(G.scene->id.lib) return; clear_id_newpoins(); @@ -5260,6 +5261,16 @@ void adduplicate(int mode, int dupflag) } } } + if(dupflag & USER_DUP_PSYS) { + for(psys=obn->particlesystem.first; psys; psys=psys->next) { + id= (ID*) psys->part; + if(id) { + ID_NEW_US(psys->part) + else psys->part= psys_copy_settings(psys->part); + id->us--; + } + } + } id= obn->data; didit= 0; From 819a0d2f773a6db9b4dc6b2490f11d087014b1f3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 24 Aug 2009 11:34:48 +0000 Subject: [PATCH 238/577] EDL importer for the sequencer. supports... - audio and video edits - fades, wipes, speed changes (video only) - importing from multiple reels example import from final cut pro. http://www.graphicall.org/ftp/ideasman42/edl_in_blender_px.png http://www.graphicall.org/ftp/ideasman42/edl_import_ui.png --- release/scripts/import_edl.py | 961 ++++++++++++++++++++++++++++++++++ 1 file changed, 961 insertions(+) create mode 100755 release/scripts/import_edl.py diff --git a/release/scripts/import_edl.py b/release/scripts/import_edl.py new file mode 100755 index 00000000000..8c5d041b34c --- /dev/null +++ b/release/scripts/import_edl.py @@ -0,0 +1,961 @@ +#!BPY + +""" +Name: 'Video Sequence (.edl)...' +Blender: 248 +Group: 'Import' +Tooltip: 'Load a CMX formatted EDL into the sequencer' +""" + +# ***** BEGIN GPL LICENSE BLOCK ***** +# +# Copyright (C) 2009: Campbell Barton, ideasman42@gmail.com +# +# 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, +# -------------------------------------------------------------------------- + +class TimeCode(object): + ''' + Simple timecode class + also supports conversion from other time strings used by EDL + ''' + def __init__(self, data, fps): + self.fps= fps + if type(data)==str: + self.fromString(data) + frame = self.asFrame() + self.fromFrame(frame) + else: + self.fromFrame(data) + + def fromString(self, text): + # hh:mm:ss:ff + # No dropframe support yet + + if text.lower().endswith('mps'): # 5.2mps + return self.fromFrame( int( float(text[:-3]) * self.fps ) ) + elif text.lower().endswith('s'): # 5.2s + return self.fromFrame( int( float(text[:-1]) * self.fps ) ) + elif text.isdigit(): # 1234 + return self.fromFrame( int(text) ) + elif ':' in text: # hh:mm:ss:ff + text= text.replace(';', ':').replace(',', ':').replace('.', ':') + text= text.split(':') + + self.hours= int(text[0]) + self.minutes= int(text[1]) + self.seconds= int(text[2]) + self.frame= int(text[3]) + return self + else: + print 'ERROR: could not convert this into timecode "%s"' % test + return self + + + def fromFrame(self, frame): + + if frame < 0: + frame = -frame; + neg=True + else: + neg=False + + fpm = 60 * self.fps + fph = 60 * fpm + + if frame < fph: + self.hours= 0 + else: + self.hours= int(frame/fph) + frame = frame % fph + + if frame < fpm: + self.minutes= 0 + else: + self.minutes= int(frame/fpm) + frame = frame % fpm + + if frame < self.fps: + self.seconds= 0 + else: + self.seconds= int(frame/self.fps) + frame = frame % self.fps + + self.frame= frame + + if neg: + self.frame = -self.frame + self.seconds = -self.seconds + self.minutes = -self.minutes + self.hours = -self.hours + + return self + + def asFrame(self): + abs_frame= self.frame + abs_frame += self.seconds * self.fps + abs_frame += self.minutes * 60 * self.fps + abs_frame += self.hours * 60 * 60 * self.fps + + return abs_frame + + def asString(self): + self.fromFrame(int(self)) + return '%.2d:%.2d:%.2d:%.2d' % (self.hours, self.minutes, self.seconds, self.frame) + + def __repr__(self): + return self.asString() + + # Numeric stuff, may as well have this + def __neg__(self): return TimeCode(-int(self), self.fps) + def __int__(self): return self.asFrame() + def __sub__(self, other): return TimeCode(int(self)-int(other), self.fps) + def __add__(self, other): return TimeCode(int(self)+int(other), self.fps) + def __mul__(self, other): return TimeCode(int(self)*int(other), self.fps) + def __div__(self, other): return TimeCode(int(self)/int(other), self.fps) + def __abs__(self): return TimeCode(abs(int(self)), self.fps) + def __iadd__(self, other): return self.fromFrame(int(self)+int(other)) + def __imul__(self, other): return self.fromFrame(int(self)*int(other)) + def __idiv__(self, other): return self.fromFrame(int(self)/int(other)) +# end timecode + + +'''Comments +Comments can appear at the beginning of the EDL file (header) or between the edit lines in the EDL. The first block of comments in the file is defined to be the header comments and they are associated with the EDL as a whole. Subsequent comments in the EDL file are associated with the first edit line that appears after them. +Edit Entries + [num] [duration] [srcIn] [srcOut] [recIn] [recOut] + + * : Filename or tag value. Filename can be for an MPEG file, Image file, or Image file template. Image file templates use the same pattern matching as for command line glob, and can be used to specify images to encode into MPEG. i.e. /usr/data/images/image*.jpg + * : 'V' | 'A' | 'VA' | 'B' | 'v' | 'a' | 'va' | 'b' which equals Video, Audio, Video_Audio edits (note B or b can be used in place of VA or va). + * : 'C' | 'D' | 'E' | 'FI' | 'FO' | 'W' | 'c' | 'd' | 'e' | 'fi' | 'fo' | 'w'. which equals Cut, Dissolve, Effect, FadeIn, FadeOut, Wipe. + * [num]: if TransitionType = Wipe, then a wipe number must be given. At the moment only wipe 'W0' and 'W1' are supported. + * [duration]: if the TransitionType is not equal to Cut, then an effect duration must be given. Duration is in frames. + * [srcIn]: Src in. If no srcIn is given, then it defaults to the first frame of the video or the first frame in the image pattern. If srcIn isn't specified, then srcOut, recIn, recOut can't be specified. + * [srcOut]: Src out. If no srcOut is given, then it defaults to the last frame of the video - or last image in the image pattern. if srcOut isn't given, then recIn and recOut can't be specified. + * [recIn]: Rec in. If no recIn is given, then it is calculated based on its position in the EDL and the length of its input. + [recOut]: Rec out. If no recOut is given, then it is calculated based on its position in the EDL and the length of its input. first frame of the video. + +For srcIn, srcOut, recIn, recOut, the values can be specified as either timecode, frame number, seconds, or mps seconds. i.e. +[tcode | fnum | sec | mps], where: + + * tcode : SMPTE timecode in hh:mm:ss:ff + * fnum : frame number (the first decodable frame in the video is taken to be frame 0). + * sec : seconds with 's' suffix (e.g. 5.2s) + * mps : seconds with 'mps' suffix (e.g. 5.2mps). This corresponds to the 'seconds' value displayed by Windows MediaPlayer. + +More notes, +Key + +''' + +enum= 0 +TRANSITION_UNKNOWN= enum +TRANSITION_CUT= enum; enum+=1 +TRANSITION_DISSOLVE= enum; enum+=1 +TRANSITION_EFFECT= enum; enum+=1 +TRANSITION_FADEIN= enum; enum+=1 +TRANSITION_FADEOUT= enum; enum+=1 +TRANSITION_WIPE= enum; enum+=1 +TRANSITION_KEY= enum; enum+=1 + +TRANSITION_DICT={ \ + 'c':TRANSITION_CUT, + 'd':TRANSITION_DISSOLVE, + 'e':TRANSITION_EFFECT, + 'fi':TRANSITION_FADEIN, + 'fo':TRANSITION_FADEOUT, + 'w':TRANSITION_WIPE, + 'k':TRANSITION_KEY, + } + +enum= 0 +EDIT_UNKNOWN= 1<= 1.0: + mov.endStill = int(mov.length * (scale - 1.0)) + else: + speed.speedEffectGlobalSpeed = 1.0/scale + meta.endOffset = mov.length - int(mov.length*scale) + + speed.update() + meta.update() + return meta + +def apply_dissolve_ipo(mov, blendin): + len_disp = float(mov.endDisp - mov.startDisp) + + if len_disp <= 0.0: + print 'Error, strip is zero length' + return + + mov.ipo= ipo= bpy.data.ipos.new("fade", "Sequence") + icu= ipo.addCurve('Fac') + + icu.interpolation= Blender.IpoCurve.InterpTypes.LINEAR + icu.append((0, 0)) + icu.append(((int(blendin)/len_disp) * 100, 1)) + + if mov.type not in (SEQ_HD_SOUND, SEQ_RAM_SOUND): + mov.blendMode = Blender.Scene.Sequence.BlendModes.ALPHAOVER + + +def replace_ext(path, ext): + return path[:path.rfind('.')+1] + ext + +def load_edl(filename, reel_files, reel_offsets): + ''' + reel_files - key:reel <--> reel:filename + ''' + + # For test file + # frame_offset = -769 + + + sce= bpy.data.scenes.active + fps= sce.render.fps + + elist= EditList() + if not elist.parse(filename, fps): + return 'Unable to parse "%s"' % filename + # elist.clean() + + + seq= sce.sequence + + track= 0 + + edits = elist.edits[:] + # edits.sort(key = lambda edit: int(edit.recIn)) + + prev_edit = None + for edit in edits: + print edit + frame_offset = reel_offsets[edit.reel] + + + src_start= int(edit.srcIn) + frame_offset + src_end= int(edit.srcOut) + frame_offset + src_length= src_end-src_start + + rec_start= int(edit.recIn) + 1 + rec_end= int(edit.recOut) + 1 + rec_length= rec_end-rec_start + + # print src_length, rec_length, src_start + + if edit.m2 != None: scale = fps/float(edit.m2.fps) + else: scale = 1.0 + + unedited_start= rec_start - src_start + offset_start = src_start - int(src_start*scale) # works for scaling up AND down + + if edit.transition_type == TRANSITION_CUT and (not elist.testOverlap(edit)): + track = 1 + + strip= None + final_strips = [] + if edit.reel.lower()=='bw': + strip= seq.new((0,0,0), rec_start, track+1) + strip.length= rec_length # for color its simple + final_strips.append(strip) + else: + + path_full = reel_files[edit.reel] + path_fileonly= path_full.split('/')[-1].split('\\')[-1] # os.path.basename(full) + path_dironly= path_full[:-len(path_fileonly)] # os.path.dirname(full) + + if edit.edit_type & EDIT_VIDEO: #and edit.transition_type == TRANSITION_CUT: + + try: + strip= seq.new((path_fileonly, path_dironly, path_full, 'movie'), unedited_start + offset_start, track+1) + except: + return 'Invalid input for movie' + + # Apply scaled rec in bounds + if scale != 1.0: + meta = scale_meta_speed(seq, strip, scale) + final_strip = meta + else: + final_strip = strip + + + final_strip.update() + final_strip.startOffset= rec_start - final_strip.startDisp + final_strip.endOffset= rec_end- final_strip.endDisp + final_strip.update() + final_strip.endOffset += (final_strip.endDisp - rec_end) + final_strip.update() + + + if edit.transition_duration: + if not prev_edit: + print "Error no previous strip" + else: + new_end = rec_start + int(edit.transition_duration) + for other in prev_edit.custom_data: + if other.type != SEQ_HD_SOUND and other.type != SEQ_RAM_SOUND: + other.endOffset += (other.endDisp - new_end) + other.update() + + # Apply disolve + if edit.transition_type == TRANSITION_DISSOLVE: + apply_dissolve_ipo(final_strip, edit.transition_duration) + + if edit.transition_type == TRANSITION_WIPE: + other_track = track + 2 + for other in prev_edit.custom_data: + if other.type != SEQ_HD_SOUND and other.type != SEQ_RAM_SOUND: + + strip_wipe= seq.new((SEQ_WIPE, other, final_strip), 1, other_track) + + if edit.wipe_type == WIPE_0: + strip_wipe.wipeEffectAngle = 90 + else: + strip_wipe.wipeEffectAngle = -90 + + other_track += 1 + + + + # strip.endOffset= strip.length - int(edit.srcOut) + #end_offset= (unedited_start+strip.length) - end + # print start, end, end_offset + #strip.endOffset = end_offset + + # break + # print strip + + final_strips.append(final_strip) + + + if edit.edit_type & (EDIT_AUDIO | EDIT_AUDIO_STEREO | EDIT_VIDEO_AUDIO): + + if scale == 1.0: # TODO - scaled audio + + try: + strip= seq.new((path_fileonly, path_dironly, path_full, 'audio_hd'), unedited_start + offset_start, track+6) + except: + + # See if there is a wave file there + path_full_wav = replace_ext(path_full, 'wav') + path_fileonly_wav = replace_ext(path_fileonly, 'wav') + + #try: + strip= seq.new((path_fileonly_wav, path_dironly, path_full_wav, 'audio_hd'), unedited_start + offset_start, track+6) + #except: + # return 'Invalid input for audio' + + final_strip = strip + + # Copied from above + final_strip.update() + final_strip.startOffset= rec_start - final_strip.startDisp + final_strip.endOffset= rec_end- final_strip.endDisp + final_strip.update() + final_strip.endOffset += (final_strip.endDisp - rec_end) + final_strip.update() + + if edit.transition_type == TRANSITION_DISSOLVE: + apply_dissolve_ipo(final_strip, edit.transition_duration) + + final_strips.append(final_strip) + + # strip= seq.new((0.6, 0.6, 0.6), start, track+1) + + if final_strips: + for strip in final_strips: + # strip.length= length + final_strip.name = edit.asName() + edit.custom_data[:]= final_strips + # track = not track + prev_edit = edit + track += 1 + + #break + + + def recursive_update(s): + s.update(1) + for s_kid in s: + recursive_update(s_kid) + + + for s in seq: + recursive_update(s) + + return '' + + + +#load_edl('/fe/edl/EP30CMXtrk1.edl') # /tmp/test.edl +#load_edl('/fe/edl/EP30CMXtrk2.edl') # /tmp/test.edl +#load_edl('/fe/edl/EP30CMXtrk3.edl') # /tmp/test.edl +#load_edl('/root/vid/rush/blender_edl.edl', ['/root/vid/rush/rushes3.avi',]) # /tmp/test.edl + + + + +# ---------------------- Blender UI part +from Blender import Draw, Window +import BPyWindow + +if 0: + DEFAULT_FILE_EDL = '/root/vid/rush/blender_edl.edl' + DEFAULT_FILE_MEDIA = '/root/vid/rush/rushes3_wav.avi' + DEFAULT_FRAME_OFFSET = -769 +else: + DEFAULT_FILE_EDL = '' + DEFAULT_FILE_MEDIA = '' + DEFAULT_FRAME_OFFSET = 0 + +B_EVENT_IMPORT = 1 +B_EVENT_RELOAD = 2 +B_EVENT_FILESEL_EDL = 3 +B_EVENT_NOP = 4 + +B_EVENT_FILESEL = 100 # or greater + +class ReelItemUI(object): + __slots__ = 'filename_but', 'offset_but', 'ui_text' + def __init__(self): + self.filename_but = Draw.Create(DEFAULT_FILE_MEDIA) + self.offset_but = Draw.Create(DEFAULT_FRAME_OFFSET) + self.ui_text = '' + + + +REEL_UI = {} # reel:ui_string + + +#REEL_FILENAMES = {} # reel:filename +#REEL_OFFSETS = {} # reel:filename + +PREF = {} + +PREF['filename'] = Draw.Create(DEFAULT_FILE_EDL) +PREF['reel_act'] = '' + +def edl_reload(): + Window.WaitCursor(1) + filename = PREF['filename'].val + sce= bpy.data.scenes.active + fps= sce.render.fps + + elist= EditList() + + if filename: + if not elist.parse(filename, fps): + Draw.PupMenu('Error%t|Could not open the file "' + filename + '"') + reels = elist.getReels() + else: + reels = {} + + REEL_UI.clear() + for reel_key, edits in reels.iteritems(): + + if reel_key == 'bw': + continue + + flag = 0 + for edit in edits: + flag |= edit.edit_type + + reel_item = REEL_UI[reel_key] = ReelItemUI() + + reel_item.ui_text = '%s (%s): ' % (reel_key, editFlagsToText(flag)) + + Window.WaitCursor(0) + +def edl_set_path(filename): + PREF['filename'].val = filename + edl_reload() + Draw.Redraw() + +def edl_set_path_reel(filename): + REEL_UI[PREF['reel_act']].filename_but.val = filename + Draw.Redraw() + +def edl_reel_keys(): + reel_keys = REEL_UI.keys() + + if 'bw' in reel_keys: + reel_keys.remove('bw') + + reel_keys.sort() + return reel_keys + +def edl_draw(): + + MARGIN = 4 + rect = BPyWindow.spaceRect() + but_width = int((rect[2]-MARGIN*2)/4.0) # 72 + # Clamp + if but_width>100: but_width = 100 + but_height = 17 + + x=MARGIN + y=rect[3]-but_height-MARGIN + xtmp = x + + + + # ---------- ---------- ---------- ---------- + Blender.Draw.BeginAlign() + PREF['filename'] = Draw.String('edl path: ', B_EVENT_RELOAD, xtmp, y, (but_width*3)-20, but_height, PREF['filename'].val, 256, 'EDL Path'); xtmp += (but_width*3)-20; + Draw.PushButton('..', B_EVENT_FILESEL_EDL, xtmp, y, 20, but_height, 'Select an EDL file'); xtmp += 20; + Blender.Draw.EndAlign() + + Draw.PushButton('Reload', B_EVENT_RELOAD, xtmp + MARGIN, y, but_width - MARGIN, but_height, 'Read the ID Property settings from the active curve object'); xtmp += but_width; + y-=but_height + MARGIN + xtmp = x + # ---------- ---------- ---------- ---------- + + reel_keys = edl_reel_keys() + + + + if reel_keys: text = 'Reel file list...' + elif PREF['filename'].val == '': text = 'No EDL loaded.' + else: text = 'No reels found!' + + Draw.Label(text, xtmp + MARGIN, y, but_width*4, but_height); xtmp += but_width*4; + + y-=but_height + MARGIN + xtmp = x + + # ---------- ---------- ---------- ---------- + + + for i, reel_key in enumerate(reel_keys): + reel_item = REEL_UI[reel_key] + + Blender.Draw.BeginAlign() + REEL_UI[reel_key].filename_but = Draw.String(reel_item.ui_text, B_EVENT_NOP, xtmp, y, (but_width*3)-20, but_height, REEL_UI[reel_key].filename_but.val, 256, 'Select the reel path'); xtmp += (but_width*3)-20; + Draw.PushButton('..', B_EVENT_FILESEL + i, xtmp, y, 20, but_height, 'Media path to use for this reel'); xtmp += 20; + Blender.Draw.EndAlign() + + reel_item.offset_but= Draw.Number('ofs:', B_EVENT_NOP, xtmp + MARGIN, y, but_width - MARGIN, but_height, reel_item.offset_but.val, -100000, 100000, 'Start offset in frames when applying timecode'); xtmp += but_width - MARGIN; + + y-=but_height + MARGIN + xtmp = x + + # ---------- ---------- ---------- ---------- + + Draw.PushButton('Import CMX-EDL Sequencer Strips', B_EVENT_IMPORT, xtmp + MARGIN, MARGIN, but_width*4 - MARGIN, but_height, 'Load the EDL file into the sequencer'); xtmp += but_width*4; + y-=but_height + MARGIN + xtmp = x + + +def edl_event(evt, val): + pass + +def edl_bevent(evt): + + if evt == B_EVENT_NOP: + pass + elif evt == B_EVENT_IMPORT: + ''' + Load the file into blender with UI settings + ''' + filename = PREF['filename'].val + + reel_files = {} + reel_offsets = {} + + for reel_key, reel_item in REEL_UI.iteritems(): + reel_files[reel_key] = reel_item.filename_but.val + reel_offsets[reel_key] = reel_item.offset_but.val + + error = load_edl(filename, reel_files, reel_offsets) + if error != '': + Draw.PupMenu('Error%t|' + error) + else: + Window.RedrawAll() + + elif evt == B_EVENT_RELOAD: + edl_reload() + Draw.Redraw() + + elif evt == B_EVENT_FILESEL_EDL: + filename = PREF['filename'].val + if not filename: filename = Blender.sys.join(Blender.sys.expandpath('//'), '*.edl') + + Window.FileSelector(edl_set_path, 'Select EDL', filename) + + elif evt >= B_EVENT_FILESEL: + reel_keys = edl_reel_keys() + reel_key = reel_keys[evt - B_EVENT_FILESEL] + + filename = REEL_UI[reel_key].filename_but.val + if not filename: filename = Blender.sys.expandpath('//') + + PREF['reel_act'] = reel_key # so file set path knows which one to set + Window.FileSelector(edl_set_path_reel, 'Reel Media', filename) + + + +if __name__ == '__main__': + Draw.Register(edl_draw, edl_event, edl_bevent) + edl_reload() + From 01e2aa02495fc200115c49f65aef82f77d80267c Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Mon, 24 Aug 2009 12:34:19 +0000 Subject: [PATCH 239/577] * r22739 broke compilation with scons. Make sure WITH_OPENEXR definition is given --- source/blender/imbuf/intern/openexr/SConscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/imbuf/intern/openexr/SConscript b/source/blender/imbuf/intern/openexr/SConscript index aa166a1983c..30757db1cef 100644 --- a/source/blender/imbuf/intern/openexr/SConscript +++ b/source/blender/imbuf/intern/openexr/SConscript @@ -13,6 +13,6 @@ incs = ['.', '../../../makesdna'] incs += Split(env['BF_OPENEXR_INC']) -defs = [] +defs = ['WITH_OPENEXR'] env.BlenderLib ('bf_openexr', source_files, incs, defs, libtype=['core','player'], priority = [225, 85]) From 8eeb71e6d9eabe99ee774140481b3ad073c46767 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Mon, 24 Aug 2009 14:26:58 +0000 Subject: [PATCH 240/577] Correct transform descriptions. Some operations were described as vertex only when they aren't. --- source/blender/editors/transform/transform_ops.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index e50a8205afa..08d22faf7e7 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -413,7 +413,7 @@ void TFM_OT_tilt(struct wmOperatorType *ot) /*optionals - "Tilt selected vertices." "Specify an extra axis rotation for selected vertices of 3d curve." */ - ot->description= "Tilt selected vertices of 3d curve."; + ot->description= "Tilt selected control vertices of 3d curve."; ot->idname = OP_TILT; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -437,7 +437,7 @@ void TFM_OT_warp(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Warp"; - ot->description= "Warp selected vertices around the cursor."; + ot->description= "Warp selected items around the cursor."; ot->idname = OP_WARP; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -462,7 +462,7 @@ void TFM_OT_shear(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Shear"; - ot->description= "Shear selected vertices along the horizontal screen axis."; + ot->description= "Shear selected items along the horizontal screen axis."; ot->idname = OP_SHEAR; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -487,7 +487,7 @@ void TFM_OT_shrink_fatten(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Shrink/Fatten"; - ot->description= "Shrink/fatten selected vertices along vertex normals."; + ot->description= "Shrink/fatten selected vertices along normals."; ot->idname = OP_SHRINK_FATTEN; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -509,7 +509,7 @@ void TFM_OT_tosphere(struct wmOperatorType *ot) { /* identifiers */ ot->name = "To Sphere"; - //added "around mesh center" to defferentiate between "MESH_OT_vertices_to_sphere()" + //added "around mesh center" to differentiate between "MESH_OT_vertices_to_sphere()" ot->description= "Move selected vertices outward in a spherical shape around mesh center."; ot->idname = OP_TOSPHERE; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; From 8b51b993dbbfe7b1dd092f3d553ccc5b1ac6172a Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Mon, 24 Aug 2009 21:06:55 +0000 Subject: [PATCH 241/577] Smoke: * Bugfix for scaling on non-2^n-textures --- .../blender/editors/space_view3d/drawvolume.c | 10 ++++++---- source/blender/gpu/intern/gpu_extensions.c | 19 ++++++------------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c index 53f193382bd..237ffe71ddb 100644 --- a/source/blender/editors/space_view3d/drawvolume.c +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -197,7 +197,6 @@ void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture RegionView3D *rv3d= ar->regiondata; float viewnormal[3]; - // int res[3]; int i, j, n; float d, d0, dd; float *points = NULL; @@ -237,9 +236,12 @@ void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture GPU_texture_bind(tex, 0); - cor[0] = (float)res[0]/(float)larger_pow2(res[0]); - cor[1] = (float)res[1]/(float)larger_pow2(res[1]); - cor[2] = (float)res[2]/(float)larger_pow2(res[2]); + // if (!GLEW_ARB_texture_non_power_of_two) + { + cor[0] = (float)res[0]/(float)larger_pow2(res[0]); + cor[1] = (float)res[1]/(float)larger_pow2(res[1]); + cor[2] = (float)res[2]/(float)larger_pow2(res[2]); + } // our slices are defined by the plane equation a*x + b*y +c*z + d = 0 // (a,b,c), the plane normal, are given by viewdir diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index 0b6640b9e27..9e53c85a5ba 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -326,6 +326,7 @@ GPUTexture *GPU_texture_create_3D(int w, int h, int depth, float *fpixels) tex->number = -1; tex->refcount = 1; tex->target = GL_TEXTURE_3D; + float vfBorderColor[4] = {0.0f, 0.0f, 0.0f, 0.0f}; glGenTextures(1, &tex->bindcode); @@ -336,7 +337,7 @@ GPUTexture *GPU_texture_create_3D(int w, int h, int depth, float *fpixels) return NULL; } - // if (!GLEW_ARB_texture_non_power_of_two) + if (!GLEW_ARB_texture_non_power_of_two) { tex->w = larger_pow2(tex->w); tex->h = larger_pow2(tex->h); @@ -357,22 +358,14 @@ GPUTexture *GPU_texture_create_3D(int w, int h, int depth, float *fpixels) if (fpixels) { glTexSubImage3D(tex->target, 0, 0, 0, 0, w, h, depth, format, type, pixels); - - /* - if (tex->w > w) - GPU_glTexSubImageEmpty(tex->target, format, w, 0, tex->w-w, tex->h); - if (tex->h > h) - GPU_glTexSubImageEmpty(tex->target, format, 0, h, w, tex->h-h); - */ } - // glTexImage3D(tex->target, 0, GL_RGBA, w, h, depth, 0, GL_RGBA, GL_FLOAT, fpixels); - + // glTexParameterfv(GL_TEXTURE_3D, GL_TEXTURE_BORDER_COLOR, vfBorderColor); glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S,GL_CLAMP_TO_BORDER); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T,GL_CLAMP_TO_BORDER); - glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R,GL_CLAMP_TO_BORDER); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); + glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_BORDER); if (pixels) From 75f1166b6c478ca459b98035da9fb29f4dc1a80e Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Mon, 24 Aug 2009 21:16:23 +0000 Subject: [PATCH 242/577] Smoke: *fixing the fix as usual --- source/blender/gpu/intern/gpu_extensions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index 9e53c85a5ba..23f3a491487 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -318,6 +318,7 @@ GPUTexture *GPU_texture_create_3D(int w, int h, int depth, float *fpixels) GPUTexture *tex; GLenum type, format, internalformat; void *pixels = NULL; + float vfBorderColor[4] = {0.0f, 0.0f, 0.0f, 0.0f}; tex = MEM_callocN(sizeof(GPUTexture), "GPUTexture"); tex->w = w; @@ -326,7 +327,6 @@ GPUTexture *GPU_texture_create_3D(int w, int h, int depth, float *fpixels) tex->number = -1; tex->refcount = 1; tex->target = GL_TEXTURE_3D; - float vfBorderColor[4] = {0.0f, 0.0f, 0.0f, 0.0f}; glGenTextures(1, &tex->bindcode); From 6faf7eb2baea210273d83186f1a4e7d54b3fab4b Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Mon, 24 Aug 2009 21:39:48 +0000 Subject: [PATCH 243/577] Smoke: *enable non-2^n textrues for all gfx cards which support it. * try to enhance the visual quality under linux a bit when gfx card doesn't support it (still errors visible) --- source/blender/editors/space_view3d/drawvolume.c | 2 +- source/blender/gpu/intern/gpu_extensions.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c index 237ffe71ddb..5e0ffb9ba48 100644 --- a/source/blender/editors/space_view3d/drawvolume.c +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -236,7 +236,7 @@ void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture GPU_texture_bind(tex, 0); - // if (!GLEW_ARB_texture_non_power_of_two) + if (!GLEW_ARB_texture_non_power_of_two) { cor[0] = (float)res[0]/(float)larger_pow2(res[0]); cor[1] = (float)res[1]/(float)larger_pow2(res[1]); diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index 23f3a491487..36936a9fcb0 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -360,14 +360,13 @@ GPUTexture *GPU_texture_create_3D(int w, int h, int depth, float *fpixels) glTexSubImage3D(tex->target, 0, 0, 0, 0, w, h, depth, format, type, pixels); } - // glTexParameterfv(GL_TEXTURE_3D, GL_TEXTURE_BORDER_COLOR, vfBorderColor); + glTexParameterfv(GL_TEXTURE_3D, GL_TEXTURE_BORDER_COLOR, vfBorderColor); glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_BORDER); - if (pixels) MEM_freeN(pixels); From 7793848db223e7128bb24f9dfda418b029fab2ef Mon Sep 17 00:00:00 2001 From: William Reynish Date: Mon, 24 Aug 2009 21:45:09 +0000 Subject: [PATCH 244/577] Reverted some keymap changes. Moving to standards for opening/saving etc was causing uproar in IRC. --- source/blender/editors/mesh/editmesh_mods.c | 2 +- source/blender/editors/screen/screen_ops.c | 10 ++++------ .../blender/windowmanager/intern/wm_operators.c | 16 ++++++++-------- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index 789527fd96d..f2c5b7fb727 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -4349,7 +4349,7 @@ void MESH_OT_vertices_smooth(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_int(ot->srna, "repeat", 1, 1, 100, "Number of times to smooth the mesh", "", 1, INT_MAX); + RNA_def_int(ot->srna, "repeat", 1, 1, 100, "Smooth Iterations", "", 1, INT_MAX); } void vertexnoise(Object *obedit, EditMesh *em) diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 380390cf543..799bb0741f3 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -3329,7 +3329,6 @@ void ED_keymap_screen(wmWindowManager *wm) WM_keymap_verify_item(keymap, "SCREEN_OT_repeat_history", F3KEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "SCREEN_OT_repeat_last", RKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "SCREEN_OT_repeat_last", RKEY, KM_PRESS, KM_OSKEY, 0); - WM_keymap_add_item(keymap, "SCREEN_OT_repeat_last", F4KEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "SCREEN_OT_region_flip", F5KEY, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "SCREEN_OT_redo_last", F6KEY, KM_PRESS, 0, 0); @@ -3348,18 +3347,17 @@ void ED_keymap_screen(wmWindowManager *wm) /* render */ WM_keymap_add_item(keymap, "SCREEN_OT_render", F12KEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_OSKEY, 0); +// WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_CTRL, 0); +// WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_OSKEY, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_render", F12KEY, KM_PRESS, KM_CTRL, 0)->ptr, "animation", 1); - RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0)->ptr, "animation", 1); - RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_OSKEY|KM_SHIFT, 0)->ptr, "animation", 1); +// RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0)->ptr, "animation", 1); +// RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_OSKEY|KM_SHIFT, 0)->ptr, "animation", 1); WM_keymap_add_item(keymap, "SCREEN_OT_render_view_cancel", ESCKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "SCREEN_OT_render_view_show", F11KEY, KM_PRESS, 0, 0); /* user prefs */ WM_keymap_add_item(keymap, "SCREEN_OT_userpref_show", COMMAKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "SCREEN_OT_userpref_show", COMMAKEY, KM_PRESS, KM_OSKEY, 0); - WM_keymap_add_item(keymap, "SCREEN_OT_userpref_show", UKEY, KM_PRESS, KM_ALT, 0); /* Anim Playback ------------------------------------------------ */ keymap= WM_keymap_listbase(wm, "Frames", 0, 0); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 6ecbc172c37..5a385418e5d 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1909,22 +1909,22 @@ void wm_window_keymap(wmWindowManager *wm) /* note, this doesn't replace existing keymap items */ WM_keymap_verify_item(keymap, "WM_OT_window_duplicate", WKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); - WM_keymap_add_item(keymap, "WM_OT_read_homefile", NKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "WM_OT_read_homefile", NKEY, KM_PRESS, KM_OSKEY, 0); +// WM_keymap_add_item(keymap, "WM_OT_read_homefile", NKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "WM_OT_read_homefile", XKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "WM_OT_read_homefile", NKEY, KM_PRESS, KM_OSKEY, 0); WM_keymap_add_item(keymap, "WM_OT_save_homefile", UKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "WM_OT_save_homefile", UKEY, KM_PRESS, KM_OSKEY, 0); WM_keymap_add_item(keymap, "WM_OT_open_recentfile", OKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0); WM_keymap_add_item(keymap, "WM_OT_open_recentfile", OKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0); - WM_keymap_add_item(keymap, "WM_OT_open_mainfile", OKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "WM_OT_open_mainfile", OKEY, KM_PRESS, KM_OSKEY, 0); +// WM_keymap_add_item(keymap, "WM_OT_open_mainfile", OKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "WM_OT_open_mainfile", F1KEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "WM_OT_save_mainfile", SKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "WM_OT_save_mainfile", SKEY, KM_PRESS, KM_OSKEY, 0); + WM_keymap_add_item(keymap, "WM_OT_open_mainfile", OKEY, KM_PRESS, KM_OSKEY, 0); +// WM_keymap_add_item(keymap, "WM_OT_save_mainfile", SKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "WM_OT_save_mainfile", WKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0); - WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0); + WM_keymap_add_item(keymap, "WM_OT_save_mainfile", SKEY, KM_PRESS, KM_OSKEY, 0); +// WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0); WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", F2KEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "WM_OT_save_as_mainfile", SKEY, KM_PRESS, KM_SHIFT|KM_OSKEY, 0); WM_keymap_verify_item(keymap, "WM_OT_window_fullscreen_toggle", F11KEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_verify_item(keymap, "WM_OT_exit_blender", QKEY, KM_PRESS, KM_CTRL, 0); From 9dff2ad3d043de606dbc744cd13c11e1ef76e00b Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Mon, 24 Aug 2009 23:09:35 +0000 Subject: [PATCH 245/577] SVN maintenance. --- release/scripts/import_edl.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 release/scripts/import_edl.py diff --git a/release/scripts/import_edl.py b/release/scripts/import_edl.py old mode 100755 new mode 100644 From 8ed64f785491c10467e83584caecc13ec5199aaf Mon Sep 17 00:00:00 2001 From: William Reynish Date: Mon, 24 Aug 2009 23:27:07 +0000 Subject: [PATCH 246/577] Tiny tweaks to Display panel in image editor --- release/ui/space_image.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/release/ui/space_image.py b/release/ui/space_image.py index aa43b14b974..8dc016f55b7 100644 --- a/release/ui/space_image.py +++ b/release/ui/space_image.py @@ -317,7 +317,7 @@ class IMAGE_PT_game_properties(bpy.types.Panel): class IMAGE_PT_view_properties(bpy.types.Panel): __space_type__ = 'IMAGE_EDITOR' __region_type__ = 'UI' - __label__ = "View Properties" + __label__ = "Display" def poll(self, context): sima = context.space_data @@ -335,26 +335,33 @@ class IMAGE_PT_view_properties(bpy.types.Panel): col = split.column() if ima: - col.itemR(ima, "display_aspect") + col.itemR(ima, "display_aspect", text="Aspect Ratio") col = split.column() + col.itemL(text="Coordinates:") col.itemR(sima, "draw_repeated", text="Repeat") if show_uvedit: col.itemR(uvedit, "normalized_coordinates", text="Normalized") elif show_uvedit: + col.itemL(text="Coordinates:") col.itemR(uvedit, "normalized_coordinates", text="Normalized") if show_uvedit: col = layout.column() row = col.row() row.itemR(uvedit, "edge_draw_type", expand=True) - row = col.row() - row.itemR(uvedit, "draw_smooth_edges", text="Smooth") - row.itemR(uvedit, "draw_modified_edges", text="Modified") + + split = layout.split() - row = col.row() - row.itemR(uvedit, "draw_stretch", text="Stretch") - row.itemR(uvedit, "draw_stretch_type", text="") + col = split.column() + col.itemR(uvedit, "draw_stretch", text="Stretch") + sub = col.column() + sub.active = uvedit.draw_stretch + sub.row().itemR(uvedit, "draw_stretch_type", expand=True) + + col = split.column() + col.itemR(uvedit, "draw_smooth_edges", text="Smooth") + col.itemR(uvedit, "draw_modified_edges", text="Modified") #col.itemR(uvedit, "draw_edges") #col.itemR(uvedit, "draw_faces") From 4a78b9e9046567e86ed3ccada83a50c43684facd Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 25 Aug 2009 00:12:11 +0000 Subject: [PATCH 247/577] 2.5 - Assorted Bugfixes for Animation Editing * Inserting keyframes now takes into account whether the F-Curve was editable or not. * Editing keyframes in animation editors now sends proper depsgraph updates instead of just tagging the relevant objects. Thanks JiriH for reporting these bugs. --- source/blender/editors/animation/keyframing.c | 21 +++++++++++++++++-- .../editors/space_action/action_header.c | 4 ++-- .../editors/transform/transform_generics.c | 11 +++++----- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 2da082a9b7c..b62c69c7b38 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -740,6 +740,12 @@ short insert_keyframe_direct (PointerRNA ptr, PropertyRNA *prop, FCurve *fcu, fl printf("ERROR: no F-Curve to add keyframes to \n"); return 0; } + /* F-Curve not editable? */ + if ( (fcu->flag & FCURVE_PROTECTED) || ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) ) { + if (G.f & G_DEBUG) + printf("WARNING: not inserting keyframe for locked F-Curve \n"); + return 0; + } /* if no property given yet, try to validate from F-Curve info */ if ((ptr.id.data == NULL) && (ptr.data==NULL)) { @@ -911,8 +917,19 @@ short delete_keyframe (ID *id, bAction *act, const char group[], const char rna_ /* we don't check the validity of the path here yet, but it should be ok... */ fcu= verify_fcurve(act, group, rna_path, array_index, 0); - /* only continue if we have an F-Curve to remove keyframes from */ - if (act && fcu) { + /* check if F-Curve exists and/or whether it can be edited */ + if ELEM(NULL, act, fcu) { + printf("ERROR: no F-Curve and/or Action to delete keyframe from \n"); + return 0; + } + if ( (fcu->flag & FCURVE_PROTECTED) || ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) ) { + if (G.f & G_DEBUG) + printf("WARNING: not inserting keyframe for locked F-Curve \n"); + return 0; + } + + /* it should be fine to continue now... */ + { short found = -1; int i; diff --git a/source/blender/editors/space_action/action_header.c b/source/blender/editors/space_action/action_header.c index 375136d199e..33a97b5a80a 100644 --- a/source/blender/editors/space_action/action_header.c +++ b/source/blender/editors/space_action/action_header.c @@ -404,13 +404,13 @@ void action_header_buttons(const bContext *C, ARegion *ar) if (saction->flag & SACTION_DRAWTIME) { uiDefButC(block, MENU, B_REDR, "Auto-Snap Keyframes %t|No Snap %x0|Second Step %x1|Nearest Second %x2|Nearest Marker %x3", - xco,yco,70,YIC, &(saction->autosnap), 0, 1, 0, 0, + xco,yco,90,YIC, &(saction->autosnap), 0, 1, 0, 0, "Auto-snapping mode for keyframes when transforming"); } else { uiDefButC(block, MENU, B_REDR, "Auto-Snap Keyframes %t|No Snap %x0|Frame Step %x1|Nearest Frame %x2|Nearest Marker %x3", - xco,yco,70,YIC, &(saction->autosnap), 0, 1, 0, 0, + xco,yco,90,YIC, &(saction->autosnap), 0, 1, 0, 0, "Auto-snapping mode for keyframes when transforming"); } diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 168a65a2e75..edcbd858e37 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -269,7 +269,7 @@ static void editmesh_apply_to_mirror(TransInfo *t) /* tags the given ID block for refreshes (if applicable) due to * Animation Editor editing */ -static void animedit_refresh_id_tags (ID *id) +static void animedit_refresh_id_tags (Scene *scene, ID *id) { if (id) { AnimData *adt= BKE_animdata_from_id(id); @@ -279,12 +279,11 @@ static void animedit_refresh_id_tags (ID *id) adt->recalc |= ADT_RECALC_ANIM; /* if ID-block is Object, set recalc flags */ - // TODO: this should probably go through the depsgraph instead... but for now, let's be lazy switch (GS(id->name)) { case ID_OB: { Object *ob= (Object *)id; - ob->recalc |= OB_RECALC; + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); /* sets recalc flags */ } break; } @@ -384,7 +383,7 @@ void recalcData(TransInfo *t) /* just tag these animdata-blocks to recalc, assuming that some data there changed */ for (ale= anim_data.first; ale; ale= ale->next) { /* set refresh tags for objects using this animation */ - animedit_refresh_id_tags(ale->id); + animedit_refresh_id_tags(t->scene, ale->id); } /* now free temp channels */ @@ -432,7 +431,7 @@ void recalcData(TransInfo *t) calchandles_fcurve(fcu); /* set refresh tags for objects using this animation */ - animedit_refresh_id_tags(ale->id); + animedit_refresh_id_tags(t->scene, ale->id); } /* do resort and other updates? */ @@ -463,7 +462,7 @@ void recalcData(TransInfo *t) continue; /* set refresh tags for objects using this animation */ - animedit_refresh_id_tags(tdn->id); + animedit_refresh_id_tags(t->scene, tdn->id); /* if cancelling transform, just write the values without validating, then move on */ if (t->state == TRANS_CANCEL) { From e2eaf269350d972daec1f19ae5aa5ee7fbad4685 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 25 Aug 2009 01:46:05 +0000 Subject: [PATCH 248/577] 2.5 - NLA Bugfixes: * F-Modifiers on F-Curves can now taken into account when calculating the extents of actions. This is used when there are some NLA strips and some action with some F-Modifiers is being played back on top of those. * The toggles in the NLA channels list now respect the width of the list instead of using a hardcoded position. This means that clicking on these toggles when the list is resized works again. --- source/blender/blenkernel/BKE_action.h | 2 +- source/blender/blenkernel/intern/action.c | 50 +++++++++++++++++-- source/blender/blenkernel/intern/anim_sys.c | 1 - source/blender/blenkernel/intern/nla.c | 2 +- .../blender/editors/space_nla/nla_channels.c | 7 +-- source/blender/editors/space_nla/nla_edit.c | 2 +- 6 files changed, 54 insertions(+), 10 deletions(-) diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h index d35acb5447a..4724ee19aaa 100644 --- a/source/blender/blenkernel/BKE_action.h +++ b/source/blender/blenkernel/BKE_action.h @@ -66,7 +66,7 @@ void free_action(struct bAction *act); void make_local_action(struct bAction *act); /* Some kind of bounding box operation on the action */ -void calc_action_range(const struct bAction *act, float *start, float *end, int incl_hidden); +void calc_action_range(const struct bAction *act, float *start, float *end, short incl_modifiers); /* Does action have any motion data at all? */ short action_has_motion(const struct bAction *act); diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index 6a39139d250..47de044ea25 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -838,14 +838,15 @@ short action_has_motion(const bAction *act) } /* Calculate the extents of given action */ -void calc_action_range(const bAction *act, float *start, float *end, int incl_hidden) +void calc_action_range(const bAction *act, float *start, float *end, short incl_modifiers) { FCurve *fcu; float min=999999999.0f, max=-999999999.0f; - short foundvert=0; + short foundvert=0, foundmod=0; if (act) { for (fcu= act->curves.first; fcu; fcu= fcu->next) { + /* if curve has keyframes, consider them first */ if (fcu->totvert) { float nmin, nmax; @@ -858,10 +859,53 @@ void calc_action_range(const bAction *act, float *start, float *end, int incl_hi foundvert= 1; } + + /* if incl_modifiers is enabled, need to consider modifiers too + * - only really care about the last modifier + */ + if ((incl_modifiers) && (fcu->modifiers.last)) { + FModifier *fcm= fcu->modifiers.last; + + /* only use the maximum sensible limits of the modifiers if they are more extreme */ + switch (fcm->type) { + case FMODIFIER_TYPE_LIMITS: /* Limits F-Modifier */ + { + FMod_Limits *fmd= (FMod_Limits *)fcm->data; + + if (fmd->flag & FCM_LIMIT_XMIN) { + min= MIN2(min, fmd->rect.xmin); + } + if (fmd->flag & FCM_LIMIT_XMAX) { + max= MAX2(max, fmd->rect.xmax); + } + } + break; + + case FMODIFIER_TYPE_CYCLES: /* Cycles F-Modifier */ + { + FMod_Cycles *fmd= (FMod_Cycles *)fcm->data; + + if (fmd->before_mode != FCM_EXTRAPOLATE_NONE) + min= MINAFRAMEF; + if (fmd->after_mode != FCM_EXTRAPOLATE_NONE) + max= MAXFRAMEF; + } + break; + + // TODO: function modifier may need some special limits + + default: /* all other standard modifiers are on the infinite range... */ + min= MINAFRAMEF; + max= MAXFRAMEF; + break; + } + + foundmod= 1; + } } } - if (foundvert) { + if (foundvert || foundmod) { if(min==max) max+= 1.0f; *start= min; *end= max; diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 5eaf2133515..8daaaab62d4 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -1263,7 +1263,6 @@ static void animsys_evaluate_nla (PointerRNA *ptr, AnimData *adt, float ctime) dummy_strip.act= adt->action; dummy_strip.remap= adt->remap; - // FIXME: what happens when we want to included F-Modifier access? calc_action_range(dummy_strip.act, &dummy_strip.actstart, &dummy_strip.actend, 1); dummy_strip.start = dummy_strip.actstart; dummy_strip.end = (IS_EQ(dummy_strip.actstart, dummy_strip.actend)) ? (dummy_strip.actstart + 1.0f): (dummy_strip.actend); diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index c41c4ae78e4..480c79fbc1a 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -291,7 +291,7 @@ NlaStrip *add_nlastrip (bAction *act) /* determine initial range * - strip length cannot be 0... ever... */ - calc_action_range(strip->act, &strip->actstart, &strip->actend, 1); + calc_action_range(strip->act, &strip->actstart, &strip->actend, 0); strip->start = strip->actstart; strip->end = (IS_EQ(strip->actstart, strip->actend)) ? (strip->actstart + 1.0f): (strip->actend); diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index 063b329b7a1..ccf23266427 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -97,6 +97,7 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; int filter; + View2D *v2d= &ac->ar->v2d; int notifierFlags = 0; /* get the channel that was clicked on */ @@ -186,14 +187,14 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho else offset= 0; - if (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) { + if (x >= (v2d->cur.xmax-NLACHANNEL_BUTTON_WIDTH)) { /* toggle protection (only if there's a toggle there) */ nlt->flag ^= NLATRACK_PROTECTED; /* notifier flags - channel was edited */ notifierFlags |= ND_ANIMCHAN_EDIT; } - else if (x >= (NLACHANNEL_NAMEWIDTH-2*NLACHANNEL_BUTTON_WIDTH)) { + else if (x >= (v2d->cur.xmax-2*NLACHANNEL_BUTTON_WIDTH)) { /* toggle mute */ nlt->flag ^= NLATRACK_MUTED; @@ -232,7 +233,7 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho { AnimData *adt= BKE_animdata_from_id(ale->owner); /* this won't crash, right? */ - if (x >= (NLACHANNEL_NAMEWIDTH-NLACHANNEL_BUTTON_WIDTH)) { + if (x >= (v2d->cur.xmax-NLACHANNEL_BUTTON_WIDTH)) { if (nlaedit_is_tweakmode_on(ac) == 0) { /* 'push-down' action - only usable when not in TweakMode */ // TODO: make this use the operator instead of calling the function directly diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index 763f4116416..e53ccd004db 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -1249,7 +1249,7 @@ static int nlaedit_apply_scale_exec (bContext *C, wmOperator *op) * but leave everything else alone */ strip->scale= 1.0f; - calc_action_range(strip->act, &strip->actstart, &strip->actend, 1); + calc_action_range(strip->act, &strip->actstart, &strip->actend, 0); } } } From e80ac54a22214a8ecc499aa70f59bb61fcba4fa3 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 25 Aug 2009 04:05:37 +0000 Subject: [PATCH 249/577] 2.5 - Keying Sets API (now usable from Py-Scripts) Wrapped the Keying Sets API with RNA Functions so that they can now be called from Py-Scripts. This will ultimately be useful for riggers to create Keying Sets which can get loaded up/created for animators to use after importing their rig. I've created a demo for this, which can be found at: http://www.pasteall.org/blend/552 Notes: - Kazanbas, I've had to create a rna_scene_api.c here to hold some of the relevant functions. Hopefully this won't cause you too much pain when you do your next merge from 2.5 to your branch ;) - I've noticed that there seem to be a few cases mentioned in the demo which don't totally work yet. I'll commit some fixes for those later. --- source/blender/blenkernel/intern/anim_sys.c | 20 +-- source/blender/editors/animation/anim_ops.c | 3 - source/blender/editors/animation/keyingsets.c | 131 ------------------ .../blender/editors/include/ED_keyframing.h | 9 -- source/blender/makesrna/RNA_enum_types.h | 2 + source/blender/makesrna/intern/makesrna.c | 4 +- .../blender/makesrna/intern/rna_animation.c | 20 +-- .../makesrna/intern/rna_animation_api.c | 89 ++++++++++++ source/blender/makesrna/intern/rna_internal.h | 2 + source/blender/makesrna/intern/rna_scene.c | 3 + .../blender/makesrna/intern/rna_scene_api.c | 100 +++++++++++++ 11 files changed, 220 insertions(+), 163 deletions(-) create mode 100644 source/blender/makesrna/intern/rna_animation_api.c create mode 100644 source/blender/makesrna/intern/rna_scene_api.c diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 8daaaab62d4..44d73a7f5b4 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -207,12 +207,6 @@ AnimData *BKE_copy_animdata (AnimData *adt) /* *********************************** */ /* KeyingSet API */ -/* NOTES: - * It is very likely that there will be two copies of the api - one for internal use, - * and one 'operator' based wrapper of the internal API, which should allow for access - * from Python/scripts so that riggers can automate the creation of KeyingSets for their rigs. - */ - /* Finding Tools --------------------------- */ /* Find the first path that matches the given criteria */ @@ -299,18 +293,25 @@ void BKE_keyingset_add_destination (KeyingSet *ks, ID *id, const char group_name KS_Path *ksp; /* sanity checks */ - if ELEM(NULL, ks, rna_path) + if ELEM(NULL, ks, rna_path) { + printf("ERROR: no Keying Set and/or RNA Path to add destination with \n"); return; + } /* ID is optional for relative KeyingSets, but is necessary for absolute KeyingSets */ if (id == NULL) { - if (ks->flag & KEYINGSET_ABSOLUTE) + if (ks->flag & KEYINGSET_ABSOLUTE) { + printf("ERROR: No ID provided for absolute destination. \n"); return; + } } /* don't add if there is already a matching KS_Path in the KeyingSet */ - if (BKE_keyingset_find_destination(ks, id, group_name, rna_path, array_index, groupmode)) + if (BKE_keyingset_find_destination(ks, id, group_name, rna_path, array_index, groupmode)) { + if (G.f & G_DEBUG) + printf("ERROR: destination already exists in Keying Set \n"); return; + } /* allocate a new KeyingSet Path */ ksp= MEM_callocN(sizeof(KS_Path), "KeyingSet Path"); @@ -1263,6 +1264,7 @@ static void animsys_evaluate_nla (PointerRNA *ptr, AnimData *adt, float ctime) dummy_strip.act= adt->action; dummy_strip.remap= adt->remap; + /* action range is calculated taking F-Modifiers into account (which making new strips doesn't do due to the troublesome nature of that) */ calc_action_range(dummy_strip.act, &dummy_strip.actstart, &dummy_strip.actend, 1); dummy_strip.start = dummy_strip.actstart; dummy_strip.end = (IS_EQ(dummy_strip.actstart, dummy_strip.actend)) ? (dummy_strip.actstart + 1.0f): (dummy_strip.actend); diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index ffa44e60d00..72fee937e25 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -398,9 +398,6 @@ void ED_operatortypes_anim(void) WM_operatortype_append(ANIM_OT_add_driver_button); WM_operatortype_append(ANIM_OT_remove_driver_button); - - WM_operatortype_append(ANIM_OT_keyingset_add_new); - WM_operatortype_append(ANIM_OT_keyingset_add_destination); } void ED_keymap_anim(wmWindowManager *wm) diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 5bd37ba7831..f19372069c3 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -80,137 +80,6 @@ /* ************************************************** */ /* KEYING SETS - EDITING API */ -/* Operators ------------------------------------------- */ - -/* These operators are only provided for scripting/macro usage, not for direct - * calling from the UI since they wrap some of the data-access API code for these - * (defined in blenkernel) which have quite a few properties. - */ - -/* ----- */ - -static int keyingset_add_destination_exec (bContext *C, wmOperator *op) -{ - PointerRNA ptr; - KeyingSet *ks= NULL; - ID *id= NULL; - char rna_path[256], group_name[64]; // xxx - short groupmode=0, flag=0; - int array_index=0; - - /* get settings from operator properties */ - ptr = RNA_pointer_get(op->ptr, "keyingset"); - if (ptr.data) - ks= (KeyingSet *)ptr.data; - - ptr = RNA_pointer_get(op->ptr, "id"); - if (ptr.data) - id= (ID *)ptr.data; - - groupmode= RNA_enum_get(op->ptr, "grouping_method"); - RNA_string_get(op->ptr, "group_name", group_name); - - RNA_string_get(op->ptr, "rna_path", rna_path); - array_index= RNA_int_get(op->ptr, "array_index"); - - if (RNA_boolean_get(op->ptr, "entire_array")) - flag |= KSP_FLAG_WHOLE_ARRAY; - - /* if enough args are provided, call API method */ - if (ks) { - BKE_keyingset_add_destination(ks, id, group_name, rna_path, array_index, flag, groupmode); - return OPERATOR_FINISHED; - } - else { - BKE_report(op->reports, RPT_ERROR, "Keying Set could not be added."); - return OPERATOR_CANCELLED; - } -} - -void ANIM_OT_keyingset_add_destination (wmOperatorType *ot) -{ - // XXX: this is also defined in rna_animation.c - static EnumPropertyItem prop_mode_grouping_items[] = { - {KSP_GROUP_NAMED, "NAMED", 0, "Named Group", ""}, - {KSP_GROUP_NONE, "NONE", 0, "None", ""}, - {KSP_GROUP_KSNAME, "KEYINGSET", 0, "Keying Set Name", ""}, - {0, NULL, 0, NULL, NULL}}; - - /* identifiers */ - ot->name= "Add Keying Set Destination"; - ot->idname= "ANIM_OT_keyingset_add_destination"; - - /* callbacks */ - ot->exec= keyingset_add_destination_exec; - ot->poll= ED_operator_scene_editable; - - /* props */ - /* pointers */ // xxx - do we want to directly expose these? - RNA_def_pointer_runtime(ot->srna, "keyingset", &RNA_KeyingSet, "Keying Set", "Keying Set to add destination to."); - RNA_def_pointer_runtime(ot->srna, "id", &RNA_ID, "ID", "ID-block for the destination."); - /* grouping */ - RNA_def_enum(ot->srna, "grouping_method", prop_mode_grouping_items, KSP_GROUP_NAMED, "Grouping Method", "Method used to define which Group-name to use."); - RNA_def_string(ot->srna, "group_name", "", 64, "Group Name", "Name of Action Group to assign destination to (only if grouping mode is to use this name)."); - /* rna-path */ - RNA_def_string(ot->srna, "rna_path", "", 256, "RNA-Path", "RNA-Path to destination property."); // xxx hopefully this is long enough - RNA_def_int(ot->srna, "array_index", 0, 0, INT_MAX, "Array Index", "If applicable, the index ", 0, INT_MAX); - /* flags */ - RNA_def_boolean(ot->srna, "entire_array", 1, "Entire Array", "hen an 'array/vector' type is chosen (Location, Rotation, Color, etc.), entire array is to be used."); - -} - -/* ----- */ - -static int keyingset_add_new_exec (bContext *C, wmOperator *op) -{ - Scene *sce= CTX_data_scene(C); - KeyingSet *ks= NULL; - short flag=0, keyingflag=0; - char name[64]; - - /* get settings from operator properties */ - RNA_string_get(op->ptr, "name", name); - - if (RNA_boolean_get(op->ptr, "absolute")) - flag |= KEYINGSET_ABSOLUTE; - if (RNA_boolean_get(op->ptr, "insertkey_needed")) - keyingflag |= INSERTKEY_NEEDED; - if (RNA_boolean_get(op->ptr, "insertkey_visual")) - keyingflag |= INSERTKEY_MATRIX; - - /* call the API func, and set the active keyingset index */ - ks= BKE_keyingset_add(&sce->keyingsets, name, flag, keyingflag); - - if (ks) { - sce->active_keyingset= BLI_countlist(&sce->keyingsets); - return OPERATOR_FINISHED; - } - else { - BKE_report(op->reports, RPT_ERROR, "Keying Set could not be added."); - return OPERATOR_CANCELLED; - } -} - -void ANIM_OT_keyingset_add_new (wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Add Keying Set"; - ot->idname= "ANIM_OT_keyingset_add_new"; - - /* callbacks */ - ot->exec= keyingset_add_new_exec; - ot->poll= ED_operator_scene_editable; - - /* props */ - /* name */ - RNA_def_string(ot->srna, "name", "KeyingSet", 64, "Name", "Name of Keying Set"); - /* flags */ - RNA_def_boolean(ot->srna, "absolute", 1, "Absolute", "Keying Set defines specific paths/settings to be keyframed (i.e. is not reliant on context info)"); - /* keying flags */ - RNA_def_boolean(ot->srna, "insertkey_needed", 0, "Insert Keyframes - Only Needed", "Only insert keyframes where they're needed in the relevant F-Curves."); - RNA_def_boolean(ot->srna, "insertkey_visual", 0, "Insert Keyframes - Visual", "Insert keyframes based on 'visual transforms'."); -} - /* UI API --------------------------------------------- */ /* Build menu-string of available keying-sets (allocates memory for string) diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index 64672e3502b..4bc24a0adeb 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -154,15 +154,6 @@ struct KeyingSet *ANIM_builtin_keyingset_get_named(struct KeyingSet *prevKS, cha /* Initialise builtin KeyingSets on startup */ void init_builtin_keyingsets(void); -/* -------- */ - -/* KeyingSet Editing Operators: - * These can add a new KeyingSet and/or add 'destinations' to the KeyingSets, - * acting as a means by which they can be added outside the Outliner. - */ -void ANIM_OT_keyingset_add_new(struct wmOperatorType *ot); -void ANIM_OT_keyingset_add_destination(struct wmOperatorType *ot); - /* ************ Drivers ********************** */ /* Main Driver Management API calls: diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h index 46d8c50caa6..06be0e69be5 100644 --- a/source/blender/makesrna/RNA_enum_types.h +++ b/source/blender/makesrna/RNA_enum_types.h @@ -41,6 +41,8 @@ extern EnumPropertyItem boidrule_type_items[]; extern EnumPropertyItem beztriple_handle_type_items[]; extern EnumPropertyItem beztriple_interpolation_mode_items[]; +extern EnumPropertyItem keyingset_path_grouping_items[]; + extern EnumPropertyItem fmodifier_type_items[]; extern EnumPropertyItem nla_mode_extend_items[]; diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 83178f32d5f..fa3a5a40686 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -1942,7 +1942,7 @@ RNAProcessItem PROCESS_ITEMS[]= { {"rna_ID.c", NULL, RNA_def_ID}, {"rna_texture.c", NULL, RNA_def_texture}, {"rna_action.c", NULL, RNA_def_action}, - {"rna_animation.c", NULL, RNA_def_animation}, + {"rna_animation.c", "rna_animation_api.c", RNA_def_animation}, {"rna_actuator.c", NULL, RNA_def_actuator}, {"rna_armature.c", NULL, RNA_def_armature}, {"rna_boid.c", NULL, RNA_def_boid}, @@ -1975,7 +1975,7 @@ RNAProcessItem PROCESS_ITEMS[]= { {"rna_pose.c", NULL, RNA_def_pose}, {"rna_property.c", NULL, RNA_def_gameproperty}, {"rna_render.c", NULL, RNA_def_render}, - {"rna_scene.c", NULL, RNA_def_scene}, + {"rna_scene.c", "rna_scene_api.c", RNA_def_scene}, {"rna_screen.c", NULL, RNA_def_screen}, {"rna_sculpt_paint.c", NULL, RNA_def_sculpt_paint}, {"rna_sensor.c", NULL, RNA_def_sensor}, diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index e334e2b5e90..7652987ac86 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -36,6 +36,14 @@ #include "MEM_guardedalloc.h" +/* exported for use in API */ +EnumPropertyItem keyingset_path_grouping_items[] = { + {KSP_GROUP_NAMED, "NAMED", 0, "Named Group", ""}, + {KSP_GROUP_NONE, "NONE", 0, "None", ""}, + {KSP_GROUP_KSNAME, "KEYINGSET", 0, "Keying Set Name", ""}, + {KSP_GROUP_TEMPLATE_ITEM, "TEMPLATE", 0, "Innermost Context-Item Name", ""}, + {0, NULL, 0, NULL, NULL}}; + #ifdef RNA_RUNTIME static int rna_AnimData_action_editable(PointerRNA *ptr) @@ -90,13 +98,6 @@ void rna_def_keyingset_path(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - static EnumPropertyItem prop_mode_grouping_items[] = { - {KSP_GROUP_NAMED, "NAMED", 0, "Named Group", ""}, - {KSP_GROUP_NONE, "NONE", 0, "None", ""}, - {KSP_GROUP_KSNAME, "KEYINGSET", 0, "Keying Set Name", ""}, - {KSP_GROUP_TEMPLATE_ITEM, "TEMPLATE", 0, "Innermost Context-Item Name", ""}, - {0, NULL, 0, NULL, NULL}}; - srna= RNA_def_struct(brna, "KeyingSetPath", NULL); RNA_def_struct_sdna(srna, "KS_Path"); RNA_def_struct_ui_text(srna, "Keying Set Path", "Path to a setting for use in a Keying Set."); @@ -112,7 +113,7 @@ void rna_def_keyingset_path(BlenderRNA *brna) /* Grouping */ prop= RNA_def_property(srna, "grouping", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "groupmode"); - RNA_def_property_enum_items(prop, prop_mode_grouping_items); + RNA_def_property_enum_items(prop, keyingset_path_grouping_items); RNA_def_property_ui_text(prop, "Grouping Method", "Method used to define which Group-name to use."); /* Path + Array Index */ @@ -170,7 +171,8 @@ void rna_def_keyingset(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "keyingflag", INSERTKEY_MATRIX); RNA_def_property_ui_text(prop, "Insert Keyframes - Visual", "Insert keyframes based on 'visual transforms'."); - + /* Keying Set API */ + RNA_api_keyingset(srna); } /* --- */ diff --git a/source/blender/makesrna/intern/rna_animation_api.c b/source/blender/makesrna/intern/rna_animation_api.c new file mode 100644 index 00000000000..6af87335e02 --- /dev/null +++ b/source/blender/makesrna/intern/rna_animation_api.c @@ -0,0 +1,89 @@ +/** + * $Id: + * + * ***** 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) 2009 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Joshua Leung + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include + +#include "RNA_define.h" +#include "RNA_enum_types.h" +#include "RNA_types.h" + +#include "DNA_anim_types.h" +#include "DNA_object_types.h" +#include "DNA_scene_types.h" + +#ifdef RNA_RUNTIME + +#include "BKE_animsys.h" + +static void rna_KeyingSet_add_destination(KeyingSet *keyingset, ReportList *reports, + ID *id, char rna_path[], int array_index, int entire_array, + int grouping_method, char group_name[]) +{ + short flag = 0; + + /* validate flags */ + if (entire_array) + flag |= KSP_FLAG_WHOLE_ARRAY; + + /* if data is valid, call the API function for this */ + if (keyingset) { + BKE_keyingset_add_destination(keyingset, id, group_name, rna_path, array_index, flag, grouping_method); + } + else { + BKE_report(reports, RPT_ERROR, "Keying Set Destination could not be added."); + } +} + +#else + +void RNA_api_keyingset(StructRNA *srna) +{ + FunctionRNA *func; + PropertyRNA *parm; + + /* Add Destination */ + func= RNA_def_function(srna, "add_destination", "rna_KeyingSet_add_destination"); + RNA_def_function_ui_description(func, "Add a new destination for the Keying Set."); + RNA_def_function_flag(func, FUNC_USE_REPORTS); + /* ID-block for target */ + parm= RNA_def_pointer(func, "target_id", "ID", "Target ID", "ID-Datablock for the destination."); + RNA_def_property_flag(parm, PROP_REQUIRED); + /* rna-path */ + parm= RNA_def_string(func, "rna_path", "", 256, "RNA-Path", "RNA-Path to destination property."); // xxx hopefully this is long enough + RNA_def_property_flag(parm, PROP_REQUIRED); + parm=RNA_def_int(func, "array_index", 0, 0, INT_MAX, "Array Index", "If applicable, the index ", 0, INT_MAX); + /* flags */ + parm=RNA_def_boolean(func, "entire_array", 1, "Entire Array", "When an 'array/vector' type is chosen (Location, Rotation, Color, etc.), entire array is to be used."); + /* grouping */ + parm=RNA_def_enum(func, "grouping_method", keyingset_path_grouping_items, KSP_GROUP_KSNAME, "Grouping Method", "Method used to define which Group-name to use."); + parm=RNA_def_string(func, "group_name", "", 64, "Group Name", "Name of Action Group to assign destination to (only if grouping mode is to use this name)."); +} + +#endif + diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 579441691ff..bd28085692f 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -197,9 +197,11 @@ void rna_Object_update_data(struct bContext *C, struct PointerRNA *ptr); /* API functions */ +void RNA_api_keyingset(struct StructRNA *srna); void RNA_api_main(struct StructRNA *srna); void RNA_api_mesh(struct StructRNA *srna); void RNA_api_object(struct StructRNA *srna); +void RNA_api_scene(struct StructRNA *srna); void RNA_api_ui_layout(struct StructRNA *srna); void RNA_api_wm(struct StructRNA *srna); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 40e3efc9e46..592836c8278 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1995,6 +1995,9 @@ void RNA_def_scene(BlenderRNA *brna) rna_def_scene_render_data(brna); rna_def_scene_game_data(brna); rna_def_scene_render_layer(brna); + + /* Scene API */ + RNA_api_scene(srna); } #endif diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c new file mode 100644 index 00000000000..26047ab5dc3 --- /dev/null +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -0,0 +1,100 @@ +/** + * $Id: + * + * ***** 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) 2009 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Joshua Leung + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include + +#include "RNA_define.h" +#include "RNA_enum_types.h" +#include "RNA_types.h" + +#include "DNA_anim_types.h" +#include "DNA_object_types.h" +#include "DNA_scene_types.h" + +#ifdef RNA_RUNTIME + +#include "BKE_animsys.h" + +// Scene API stuff from kazanbas branch here... + + +static KeyingSet *rna_Scene_add_keying_set(Scene *sce, ReportList *reports, + char name[], int absolute, int insertkey_needed, int insertkey_visual) +{ + KeyingSet *ks= NULL; + short flag=0, keyingflag=0; + + /* validate flags */ + if (absolute) + flag |= KEYINGSET_ABSOLUTE; + if (insertkey_needed) + keyingflag |= INSERTKEY_NEEDED; + if (insertkey_visual) + keyingflag |= INSERTKEY_MATRIX; + + /* call the API func, and set the active keyingset index */ + ks= BKE_keyingset_add(&sce->keyingsets, name, flag, keyingflag); + + if (ks) { + sce->active_keyingset= BLI_countlist(&sce->keyingsets); + return ks; + } + else { + BKE_report(reports, RPT_ERROR, "Keying Set could not be added."); + return NULL; + } +} + +#else + +void RNA_api_scene(StructRNA *srna) +{ + FunctionRNA *func; + PropertyRNA *parm; + + // Scene API stuff from kazanbas branch here... + + /* Add Keying Set */ + func= RNA_def_function(srna, "add_keying_set", "rna_Scene_add_keying_set"); + RNA_def_function_ui_description(func, "Add a new Keying Set to Scene."); + RNA_def_function_flag(func, FUNC_USE_REPORTS); + /* returns the new KeyingSet */ + parm= RNA_def_pointer(func, "keyingset", "KeyingSet", "", "Newly created Keying Set."); + RNA_def_function_return(func, parm); + /* name */ + RNA_def_string(func, "name", "KeyingSet", 64, "Name", "Name of Keying Set"); + /* flags */ + RNA_def_boolean(func, "absolute", 1, "Absolute", "Keying Set defines specific paths/settings to be keyframed (i.e. is not reliant on context info)"); + /* keying flags */ + RNA_def_boolean(func, "insertkey_needed", 0, "Insert Keyframes - Only Needed", "Only insert keyframes where they're needed in the relevant F-Curves."); + RNA_def_boolean(func, "insertkey_visual", 0, "Insert Keyframes - Visual", "Insert keyframes based on 'visual transforms'."); +} + +#endif + From 33343fced5d7be2585228300392bfb3adde7ff2e Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 25 Aug 2009 04:32:40 +0000 Subject: [PATCH 250/577] 2.5 - Action Editor New Actions can now be added again from the Action Editor. There are no guarantees that this works totally safely yet (reference counting may be quite off), so you've been warned. --- source/blender/editors/interface/interface_utils.c | 14 ++++++++++++++ .../blender/editors/space_action/action_header.c | 11 ++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index b5cfbe19466..997ac8b78c6 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -444,6 +444,20 @@ int uiDefIDPoinButs(uiBlock *block, Main *bmain, ID *parid, ID *id, int id_code, uiBlockClearButLock(block); } + /* add button */ + if(events & UI_ID_ADD_NEW) { + uiBlockSetButLock(block, (events & UI_ID_PIN) && *pin_p, "Can't unlink pinned data"); + if(parid && parid->lib); + else { + dup_params= MEM_dupallocN(params); + but= uiDefIconBut(block, BUT, 0, ICON_ZOOMIN, x,y,DEF_ICON_BUT_WIDTH,DEF_BUT_HEIGHT, &dup_params->browsenr, params->browsenr, 32767.0, 0, 0, "Add new data block"); + uiButSetNFunc(but, idpoin_cb, MEM_dupallocN(params), SET_INT_IN_POINTER(UI_ID_ADD_NEW)); + x+= DEF_ICON_BUT_WIDTH; + } + + uiBlockClearButLock(block); + } + /* delete button */ if(events & UI_ID_DELETE) { uiBlockSetButLock(block, (events & UI_ID_PIN) && *pin_p, "Can't unlink pinned data"); diff --git a/source/blender/editors/space_action/action_header.c b/source/blender/editors/space_action/action_header.c index 33a97b5a80a..e2a725164c9 100644 --- a/source/blender/editors/space_action/action_header.c +++ b/source/blender/editors/space_action/action_header.c @@ -43,6 +43,7 @@ #include "BLI_blenlib.h" #include "BKE_animsys.h" +#include "BKE_action.h" #include "BKE_context.h" #include "BKE_screen.h" @@ -272,6 +273,7 @@ static void saction_idpoin_handle(bContext *C, ID *id, int event) /* set action */ printf("\tset action \n"); adt->action= saction->action; + adt->action->id.us++; } ED_area_tag_redraw(CTX_wm_area(C)); @@ -282,7 +284,14 @@ static void saction_idpoin_handle(bContext *C, ID *id, int event) break; case UI_ID_ADD_NEW: printf("actedit addnew \n"); - /* XXX not implemented */ + if (saction->pin == 0) { + AnimData *adt= BKE_id_add_animdata(&obact->id); /* this only adds if non-existant */ + + /* set new action */ + // XXX need to restore behaviour to copy old actions... + printf("\tset new action \n"); + adt->action= saction->action= add_empty_action("Action"); + } break; case UI_ID_OPEN: printf("actedit open \n"); From 1441f337fb1140a5d5d852cfdc9320eb38c2bc33 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Tue, 25 Aug 2009 08:11:37 +0000 Subject: [PATCH 251/577] Small error detected by valgrind, thanks cam --- source/blender/render/intern/source/volume_precache.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c index 0b81d775649..71200aa8b0d 100644 --- a/source/blender/render/intern/source/volume_precache.c +++ b/source/blender/render/intern/source/volume_precache.c @@ -712,6 +712,7 @@ void free_volume_precache(Render *re) MEM_freeN(obi->volume_precache->data_r); MEM_freeN(obi->volume_precache->data_g); MEM_freeN(obi->volume_precache->data_b); + obi->volume_precache = NULL; } } From 01bd67bd1ac402ccb5d8e549d3b4fb8e8e7752ec Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Tue, 25 Aug 2009 09:47:14 +0000 Subject: [PATCH 252/577] * removed misleading comments. In short: NEVER EVER copy platform defaults in their entirety as your user-config.py. I'm taking this commit log as an opportunity to also remind people of the existance of doc/blender-scons.txt . If you're a user reading these commit logs, and you haven't pre-ordered the Durian DVD yet, do so now: http://www.blender3d.org/e-shop/product_info_n.php?products_id=120 --- config/darwin-config.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/config/darwin-config.py b/config/darwin-config.py index 5c0fa9a5086..ba1d12542d0 100644 --- a/config/darwin-config.py +++ b/config/darwin-config.py @@ -1,10 +1,3 @@ -# -# Note : if you want to alter this file -# copy it as a whole in the upper folder -# as user-config.py -# dont create a new file with only some -# vars changed. - import commands # IMPORTANT NOTE : OFFICIAL BUILDS SHOULD BE DONE WITH SDKs From 2d38d0d1e1cf8a2a62639eeb3fcbd81de6e69080 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 25 Aug 2009 10:32:53 +0000 Subject: [PATCH 253/577] 2.5 - Keying Sets Bugfix Single-value properties in KeyingSets were not getting keyframed. --- source/blender/editors/animation/keyingsets.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index f19372069c3..d22fe763ad4 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -916,7 +916,7 @@ int modify_keyframes (bContext *C, ListBase *dsources, bAction *act, KeyingSet * * normal non-array entries get keyframed correctly */ i= ksp->array_index; - arraylen= i+1; + arraylen= i; /* get length of array if whole array option is enabled */ if (ksp->flag & KSP_FLAG_WHOLE_ARRAY) { @@ -928,6 +928,10 @@ int modify_keyframes (bContext *C, ListBase *dsources, bAction *act, KeyingSet * arraylen= RNA_property_array_length(prop); } + /* we should do at least one step */ + if (arraylen == i) + arraylen++; + /* for each possible index, perform operation * - assume that arraylen is greater than index */ From 4c8d32b4bf624bd70a4c2b20a9c971ae92e8f8a3 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Tue, 25 Aug 2009 10:56:01 +0000 Subject: [PATCH 254/577] == SCons == * Add sndfile support (False by default). Note: for this to work, make sure that FFMPEG-support is disabled. --- config/linux2-config.py | 23 ++++++----------------- config/win32-mingw-config.py | 25 ++++++------------------- config/win32-vc-config.py | 28 ++++++---------------------- intern/audaspace/SConscript | 5 +++++ tools/Blender.py | 4 ++++ tools/btools.py | 15 +++++++++++---- 6 files changed, 38 insertions(+), 62 deletions(-) diff --git a/config/linux2-config.py b/config/linux2-config.py index a5ac9f4e00e..757b8210e49 100644 --- a/config/linux2-config.py +++ b/config/linux2-config.py @@ -33,6 +33,12 @@ BF_JACK_INC = '${BF_JACK}/include/jack' BF_JACK_LIB = 'jack' BF_JACK_LIBPATH = '${BF_JACK}/lib' +WITH_BF_SNDFILE = False +BF_SNDFILE = '/usr' +BF_SNDFILE_INC = '${BF_SNDFILE}/include/sndfile' +BF_SNDFILE_LIB = 'sndfile' +BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib' + WITH_BF_SDL = True BF_SDL = '/usr' #$(shell sdl-config --prefix) BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags) @@ -85,23 +91,6 @@ BF_BULLET = '#extern/bullet2/src' BF_BULLET_INC = '${BF_BULLET}' BF_BULLET_LIB = 'extern_bullet' -#WITH_BF_NSPR = True -#BF_NSPR = $(LIBDIR)/nspr -#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr -#BF_NSPR_LIB = - -# Uncomment the following line to use Mozilla inplace of netscape -#CPPFLAGS += -DMOZ_NOT_NET -# Location of MOZILLA/Netscape header files... -#BF_MOZILLA = $(LIBDIR)/mozilla -#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl -#BF_MOZILLA_LIB = -# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB -# if this is not set. -# -# Be paranoid regarding library creation (do not update archives) -#BF_PARANOID = True - # enable freetype2 support for text objects BF_FREETYPE = '/usr' BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2' diff --git a/config/win32-mingw-config.py b/config/win32-mingw-config.py index cde41d6ffba..26fa0835255 100644 --- a/config/win32-mingw-config.py +++ b/config/win32-mingw-config.py @@ -3,14 +3,9 @@ LIBDIR = "${LCGDIR}" BF_PYTHON = LIBDIR + '/python' BF_PYTHON_VERSION = '3.1' -#BF_PYTHON_VERSION = '2.6' -#BF_PYTHON_VERSION = '2.6' WITH_BF_STATICPYTHON = False BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}' BF_PYTHON_BINARY = 'python' -#BF_PYTHON_LIB = 'python25' -#BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib/lib25_vs2005' -#BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/lib25_vs2005/libpython25.a' BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}' BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib' BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/libpython${BF_PYTHON_VERSION[0]}${BF_PYTHON_VERSION[2]}.a' @@ -37,6 +32,12 @@ BF_JACK_INC = '${BF_JACK}/include' BF_JACK_LIB = 'libjack' BF_JACK_LIBPATH = '${BF_JACK}/lib' +WITH_BF_SNDFILE = False +BF_SNDFILE = LIBDIR + '/sndfile' +BF_SNDFILE_INC = '${BF_SNDFILE}/include' +BF_SNDFILE_LIB = 'libsndfile' +BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib' + WITH_BF_SDL = True BF_SDL = LIBDIR + '/sdl' BF_SDL_INC = '${BF_SDL}/include' @@ -99,20 +100,6 @@ BF_BULLET_LIB = 'extern_bullet' BF_WINTAB = LIBDIR + '/wintab' BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE' -#WITH_BF_NSPR = True -#BF_NSPR = $(LIBDIR)/nspr -#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr -#BF_NSPR_LIB = - -# Uncomment the following line to use Mozilla inplace of netscape -#CPPFLAGS += -DMOZ_NOT_NET -# Location of MOZILLA/Netscape header files... -#BF_MOZILLA = $(LIBDIR)/mozilla -#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl -#BF_MOZILLA_LIB = -# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB -# if this is not set. - # enable freetype2 support for text objects BF_FREETYPE = LIBDIR + '/gcc/freetype' BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2' diff --git a/config/win32-vc-config.py b/config/win32-vc-config.py index 2c219633540..c50f41b6d4b 100644 --- a/config/win32-vc-config.py +++ b/config/win32-vc-config.py @@ -21,11 +21,6 @@ BF_OPENAL_INC = '${BF_OPENAL}/include ' BF_OPENAL_LIB = 'wrap_oal' BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib' -# TODO - are these useful on win32? -# BF_CXX = '/usr' -# WITH_BF_STATICCXX = False -# BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a' - WITH_BF_ICONV = True BF_ICONV = LIBDIR + '/iconv' BF_ICONV_INC = '${BF_ICONV}/include' @@ -43,6 +38,12 @@ BF_JACK_INC = '${BF_JACK}/include' BF_JACK_LIB = 'libjack' BF_JACK_LIBPATH = '${BF_JACK}/lib' +WITH_BF_SNDFILE = False +BF_SNDFILE = LIBDIR + '/sndfile' +BF_SNDFILE_INC = '${BF_SNDFILE}/include' +BF_SNDFILE_LIB = 'libsndfile-1' +BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib' + WITH_BF_SDL = True BF_SDL = LIBDIR + '/sdl' BF_SDL_INC = '${BF_SDL}/include' @@ -108,23 +109,6 @@ BF_WINTAB_INC = '${BF_WINTAB}/INCLUDE' WITH_BF_BINRELOC = False -#WITH_BF_NSPR = True -#BF_NSPR = $(LIBDIR)/nspr -#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr -#BF_NSPR_LIB = - -# Uncomment the following line to use Mozilla inplace of netscape -#CPPFLAGS += -DMOZ_NOT_NET -# Location of MOZILLA/Netscape header files... -#BF_MOZILLA = $(LIBDIR)/mozilla -#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl -#BF_MOZILLA_LIB = -# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB -# if this is not set. -# -# Be paranoid regarding library creation (do not update archives) -#BF_PARANOID = True - # enable freetype2 support for text objects BF_WITH_FREETYPE = True BF_FREETYPE = LIBDIR + '/freetype' diff --git a/intern/audaspace/SConscript b/intern/audaspace/SConscript index caae070359a..0dfd0bb9e3a 100644 --- a/intern/audaspace/SConscript +++ b/intern/audaspace/SConscript @@ -26,4 +26,9 @@ if env['WITH_BF_JACK']: incs += ' jack ' + env['BF_JACK_INC'] defs.append('WITH_JACK') +if env['WITH_BF_SNDFILE']: + sources += env.Glob('sndfile/*.cpp') + incs += ' sndfile ' + env['BF_SNDFILE_INC'] + defs.append('WITH_SNDFILE') + env.BlenderLib ('bf_audaspace', sources, Split(incs), defs, libtype=['intern'], priority = [25] ) diff --git a/tools/Blender.py b/tools/Blender.py index 789a6981558..421a79454df 100644 --- a/tools/Blender.py +++ b/tools/Blender.py @@ -130,6 +130,8 @@ def setup_staticlibs(lenv): libincs += Split(lenv['BF_FFMPEG_LIBPATH']) if lenv['WITH_BF_JACK']: libincs += Split(lenv['BF_JACK_LIBPATH']) + if lenv['WITH_BF_SNDFILE']: + libincs += Split(lenv['BF_SNDFILE_LIBPATH']) if lenv['WITH_BF_OPENEXR']: libincs += Split(lenv['BF_OPENEXR_LIBPATH']) if lenv['WITH_BF_STATICOPENEXR']: @@ -191,6 +193,8 @@ def setup_syslibs(lenv): syslibs += Split(lenv['BF_OGG_LIB']) if lenv['WITH_BF_JACK']: syslibs += Split(lenv['BF_JACK_LIB']) + if lenv['WITH_BF_SNDFILE']: + syslibs += Split(lenv['BF_SNDFILE_LIB']) if lenv['WITH_BF_FFTW3']: syslibs += Split(lenv['BF_FFTW3_LIB']) if lenv['WITH_BF_SDL']: diff --git a/tools/btools.py b/tools/btools.py index 3e80ac453ce..1ae952adbc7 100755 --- a/tools/btools.py +++ b/tools/btools.py @@ -32,6 +32,7 @@ def validate_arguments(args, bc): 'WITH_BF_SDL', 'BF_SDL', 'BF_SDL_INC', 'BF_SDL_LIB', 'BF_SDL_LIBPATH', 'BF_LIBSAMPLERATE', 'BF_LIBSAMPLERATE_INC', 'BF_LIBSAMPLERATE_LIB', 'BF_LIBSAMPLERATE_LIBPATH', 'WITH_BF_JACK', 'BF_JACK', 'BF_JACK_INC', 'BF_JACK_LIB', 'BF_JACK_LIBPATH', + 'WITH_BF_SNDFILE', 'BF_SNDFILE', 'BF_SNDFILE_INC', 'BF_SNDFILE_LIB', 'BF_SNDFILE_LIBPATH', 'BF_PTHREADS', 'BF_PTHREADS_INC', 'BF_PTHREADS_LIB', 'BF_PTHREADS_LIBPATH', 'WITH_BF_OPENEXR', 'BF_OPENEXR', 'BF_OPENEXR_INC', 'BF_OPENEXR_LIB', 'BF_OPENEXR_LIBPATH', 'WITH_BF_STATICOPENEXR', 'BF_OPENEXR_LIB_STATIC', 'WITH_BF_DDS', @@ -171,13 +172,13 @@ def read_opts(cfg, args): (BoolVariable('WITH_BF_SDL', 'Use SDL if true', False)), ('BF_SDL', 'SDL base path', ''), - ('BF_SDL_INC', 'SDL include path', ''), #$(shell $(BF_SDL)/bin/sdl-config --cflags) - ('BF_SDL_LIB', 'SDL library', ''), #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer + ('BF_SDL_INC', 'SDL include path', ''), + ('BF_SDL_LIB', 'SDL library', ''), ('BF_SDL_LIBPATH', 'SDL library path', ''), ('BF_LIBSAMPLERATE', 'libsamplerate aka SRC base path', ''), - ('BF_LIBSAMPLERATE_INC', 'libsamplerate aka SRC include path', ''), #$(shell $(BF_SDL)/bin/sdl-config --cflags) - ('BF_LIBSAMPLERATE_LIB', 'libsamplerate aka SRC library', ''), #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer + ('BF_LIBSAMPLERATE_INC', 'libsamplerate aka SRC include path', ''), + ('BF_LIBSAMPLERATE_LIB', 'libsamplerate aka SRC library', ''), ('BF_LIBSAMPLERATE_LIBPATH', 'libsamplerate aka SRC library path', ''), (BoolVariable('WITH_BF_JACK', 'Enable jack support if true', True)), @@ -186,6 +187,12 @@ def read_opts(cfg, args): ('BF_JACK_LIB', 'jack library', ''), ('BF_JACK_LIBPATH', 'jack library path', ''), + (BoolVariable('WITH_BF_SNDFILE', 'Enable sndfile support if true', True)), + ('BF_SNDFILE', 'sndfile base path', ''), + ('BF_SNDFILE_INC', 'sndfile include path', ''), + ('BF_SNDFILE_LIB', 'sndfile library', ''), + ('BF_SNDFILE_LIBPATH', 'sndfile library path', ''), + ('BF_PTHREADS', 'Pthreads base path', ''), ('BF_PTHREADS_INC', 'Pthreads include path', ''), ('BF_PTHREADS_LIB', 'Pthreads library', ''), From 8aa6f672bab266986c7d775cfb01c48d834d3ad9 Mon Sep 17 00:00:00 2001 From: William Reynish Date: Tue, 25 Aug 2009 12:31:35 +0000 Subject: [PATCH 255/577] Moved the autokey mode menu from the timeline header into the timeline menus. Its previous prominent large size made it seem like this setting was very important, when in fact it's a setting you are almost never likely to touch. This helps clean up the main UI. --- release/ui/buttons_physics_cloth.py | 2 +- release/ui/buttons_physics_softbody.py | 2 +- release/ui/space_time.py | 41 ++++++++++++++++++---- source/blender/makesrna/intern/rna_scene.c | 2 +- 4 files changed, 37 insertions(+), 10 deletions(-) diff --git a/release/ui/buttons_physics_cloth.py b/release/ui/buttons_physics_cloth.py index 6c499625685..9ddf03e3d4d 100644 --- a/release/ui/buttons_physics_cloth.py +++ b/release/ui/buttons_physics_cloth.py @@ -91,7 +91,7 @@ class PHYSICS_PT_cloth_cache(PhysicButtonsPanel): layout.set_context_pointer("PointCache", cache) row = layout.row() - row.template_list(cache, "point_cache_list", cache, "active_point_cache_index") + row.template_list(cache, "point_cache_list", cache, "active_point_cache_index", rows=2) col = row.column(align=True) col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="") col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="") diff --git a/release/ui/buttons_physics_softbody.py b/release/ui/buttons_physics_softbody.py index 35c0c498436..2beba8c95a0 100644 --- a/release/ui/buttons_physics_softbody.py +++ b/release/ui/buttons_physics_softbody.py @@ -66,7 +66,7 @@ class PHYSICS_PT_softbody_cache(PhysicButtonsPanel): layout.set_context_pointer("PointCache", cache) row = layout.row() - row.template_list(cache, "point_cache_list", cache, "active_point_cache_index") + row.template_list(cache, "point_cache_list", cache, "active_point_cache_index", rows=2) col = row.column(align=True) col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="") col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="") diff --git a/release/ui/space_time.py b/release/ui/space_time.py index 6e4b5beb161..81681e42d92 100644 --- a/release/ui/space_time.py +++ b/release/ui/space_time.py @@ -33,6 +33,8 @@ class TIME_HT_header(bpy.types.Header): row.itemR(scene, "preview_range_end_frame", text="End") layout.itemR(scene, "current_frame", text="") + + layout.itemS() row = layout.row(align=True) row.item_booleanO("screen.frame_jump", "end", False, text="", icon='ICON_REW') @@ -47,18 +49,13 @@ class TIME_HT_header(bpy.types.Header): row.item_booleanO("screen.keyframe_jump", "next", True, text="", icon='ICON_NEXT_KEYFRAME') row.item_booleanO("screen.frame_jump", "end", True, text="", icon='ICON_FF') - layout.itemR(rd, "sync_audio", text="", toggle=True, icon='ICON_SPEAKER') - - layout.itemS() - row = layout.row(align=True) row.itemR(tools, "enable_auto_key", text="", toggle=True, icon='ICON_REC') - sub = row.row() - sub.active = tools.enable_auto_key - sub.itemR(tools, "autokey_mode", text="") if screen.animation_playing and tools.enable_auto_key: subsub = row.row() subsub.itemR(tools, "record_with_nla", toggle=True) + + layout.itemR(rd, "sync_audio", text="", toggle=True, icon='ICON_SPEAKER') layout.itemS() @@ -88,6 +85,7 @@ class TIME_MT_frame(bpy.types.Menu): def draw(self, context): layout = self.layout + tools = context.tool_settings layout.itemO("marker.add", text="Add Marker") layout.itemO("marker.duplicate", text="Duplicate Marker") @@ -99,6 +97,12 @@ class TIME_MT_frame(bpy.types.Menu): layout.itemO("time.start_frame_set") layout.itemO("time.end_frame_set") + + layout.itemS() + + sub = layout.row() + sub.active = tools.enable_auto_key + sub.itemM("TIME_MT_autokey") class TIME_MT_playback(bpy.types.Menu): __space_type__ = 'TIMELINE' @@ -108,6 +112,7 @@ class TIME_MT_playback(bpy.types.Menu): layout = self.layout st = context.space_data + rd = context.scene.render_data layout.itemR(st, "play_top_left") layout.itemR(st, "play_all_3d") @@ -115,10 +120,32 @@ class TIME_MT_playback(bpy.types.Menu): layout.itemR(st, "play_buttons") layout.itemR(st, "play_image") layout.itemR(st, "play_sequencer") + layout.itemS() + layout.itemR(st, "continue_physics") + + layout.itemS() + + layout.itemR(rd, "sync_audio", icon='ICON_SPEAKER') + + + +class TIME_MT_autokey(bpy.types.Menu): + __space_type__ = 'TIMELINE' + __label__ = "Auto-Keyframing Mode" + + def draw(self, context): + layout = self.layout + tools = context.tool_settings + + layout.active = tools.enable_auto_key + + layout.item_enumR(tools, "autokey_mode", "ADD_REPLACE_KEYS") + layout.item_enumR(tools, "autokey_mode", "REPLACE_KEYS") bpy.types.register(TIME_HT_header) bpy.types.register(TIME_MT_view) bpy.types.register(TIME_MT_frame) +bpy.types.register(TIME_MT_autokey) bpy.types.register(TIME_MT_playback) diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 592836c8278..209c771834d 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -418,7 +418,7 @@ static void rna_def_tool_settings(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem auto_key_items[] = { - {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add/Replace", ""}, + {AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add & Replace", ""}, {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""}, {0, NULL, 0, NULL, NULL}}; From 33e2d118bcc8d8301144cd90e7896175ae14d141 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 25 Aug 2009 12:43:25 +0000 Subject: [PATCH 256/577] removing GameLogic.EvalExpression(), unlikely anyone will miss it, was only accessible in 2.49, invalid expressions would crash, valid ones leak memory. --- source/gameengine/Ketsji/KX_PythonInit.cpp | 28 ---------------------- source/gameengine/PyDoc/GameLogic.py | 8 ------- 2 files changed, 36 deletions(-) diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index fcada7bfce4..91515587e8d 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -498,33 +498,6 @@ static PyObject *pyPrintExt(PyObject *,PyObject *,PyObject *) Py_RETURN_NONE; } - -static PyObject *gEvalExpression(PyObject*, PyObject* value) -{ - char* txt= PyString_AsString(value); - - if (txt==NULL) { - PyErr_SetString(PyExc_TypeError, "Expression.calc(text): expects a single string argument"); - return NULL; - } - - CParser parser; - CExpression* expr = parser.ProcessText(txt); - CValue* val = expr->Calculate(); - expr->Release(); - - if (val) { - PyObject* pyobj = val->ConvertValueToPython(); - if (pyobj) - return pyobj; - else - return val->GetProxy(); - } - - Py_RETURN_NONE; -} - - static struct PyMethodDef game_methods[] = { {"expandPath", (PyCFunction)gPyExpandPath, METH_VARARGS, (PY_METHODCHAR)gPyExpandPath_doc}, {"sendMessage", (PyCFunction)gPySendMessage, METH_VARARGS, (PY_METHODCHAR)gPySendMessage_doc}, @@ -553,7 +526,6 @@ static struct PyMethodDef game_methods[] = { {"getAverageFrameRate", (PyCFunction) gPyGetAverageFrameRate, METH_NOARGS, (PY_METHODCHAR)"Gets the estimated average frame rate"}, {"getBlendFileList", (PyCFunction)gPyGetBlendFileList, METH_VARARGS, (PY_METHODCHAR)"Gets a list of blend files in the same directory as the current blend file"}, {"PrintGLInfo", (PyCFunction)pyPrintExt, METH_NOARGS, (PY_METHODCHAR)"Prints GL Extension Info"}, - {"EvalExpression", (PyCFunction)gEvalExpression, METH_O, (PY_METHODCHAR)"Evaluate a string as a game logic expression"}, {NULL, (PyCFunction) NULL, 0, NULL } }; diff --git a/source/gameengine/PyDoc/GameLogic.py b/source/gameengine/PyDoc/GameLogic.py index 46f00fa7ea6..5d9b17316be 100644 --- a/source/gameengine/PyDoc/GameLogic.py +++ b/source/gameengine/PyDoc/GameLogic.py @@ -448,14 +448,6 @@ def setPhysicsTicRate(ticrate): @type ticrate: float """ -def EvalExpression(text): - """ - Evaluate the string as an expression, similar to the expression controller logic brick. - @param text: The expression to evaluate. - @type text: string - @return: The result of the expression. The type depends on the expression. - """ - #{ Utility functions def getAverageFrameRate(): """ From 855974dad931bcba8a63260d1f642da49902d569 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 25 Aug 2009 13:43:21 +0000 Subject: [PATCH 257/577] patch from Mitchell Stokes adding dictionary like access to a scene. (like KX_GameObjects have) val = scene["prop"] scene["prop"] = newval if "prop" in scene: ... val = scene.get("prop", fallback_val) --- source/gameengine/Ketsji/KX_Scene.cpp | 131 +++++++++++++++++++++++++- source/gameengine/Ketsji/KX_Scene.h | 16 ++-- source/gameengine/PyDoc/GameTypes.py | 6 ++ 3 files changed, 145 insertions(+), 8 deletions(-) diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 5c19911fe58..a9bb583bba7 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -1615,7 +1615,10 @@ PyTypeObject KX_Scene::Type = { 0, 0, py_base_repr, - 0,0,0,0,0,0,0,0,0, + 0, + &Sequence, + &Mapping, + 0,0,0,0,0,0, Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, 0,0,0,0,0,0,0, Methods, @@ -1632,8 +1635,115 @@ PyMethodDef KX_Scene::Methods[] = { KX_PYMETHODTABLE_NOARGS(KX_Scene, getName), KX_PYMETHODTABLE(KX_Scene, addObject), + /* dict style access */ + KX_PYMETHODTABLE(KX_Scene, get), + {NULL,NULL} //Sentinel }; +static PyObject *Map_GetItem(PyObject *self_v, PyObject *item) +{ + KX_Scene* self= static_castBGE_PROXY_REF(self_v); + const char *attr_str= _PyUnicode_AsString(item); + PyObject* pyconvert; + + if (self==NULL) { + PyErr_SetString(PyExc_SystemError, "val = scene[key]: KX_Scene, "BGE_PROXY_ERROR_MSG); + return NULL; + } + + if (self->m_attr_dict && (pyconvert=PyDict_GetItem(self->m_attr_dict, item))) { + + if (attr_str) + PyErr_Clear(); + Py_INCREF(pyconvert); + return pyconvert; + } + else { + if(attr_str) PyErr_Format(PyExc_KeyError, "value = scene[key]: KX_Scene, key \"%s\" does not exist", attr_str); + else PyErr_SetString(PyExc_KeyError, "value = scene[key]: KX_Scene, key does not exist"); + return NULL; + } + +} + +static int Map_SetItem(PyObject *self_v, PyObject *key, PyObject *val) +{ + KX_Scene* self= static_castBGE_PROXY_REF(self_v); + const char *attr_str= _PyUnicode_AsString(key); + if(attr_str==NULL) + PyErr_Clear(); + + if (self==NULL) { + PyErr_SetString(PyExc_SystemError, "scene[key] = value: KX_Scene, "BGE_PROXY_ERROR_MSG); + return -1; + } + + if (val==NULL) { /* del ob["key"] */ + int del= 0; + + if(self->m_attr_dict) + del |= (PyDict_DelItem(self->m_attr_dict, key)==0) ? 1:0; + + if (del==0) { + if(attr_str) PyErr_Format(PyExc_KeyError, "scene[key] = value: KX_Scene, key \"%s\" could not be set", attr_str); + else PyErr_SetString(PyExc_KeyError, "del scene[key]: KX_Scene, key could not be deleted"); + return -1; + } + else if (self->m_attr_dict) { + PyErr_Clear(); /* PyDict_DelItem sets an error when it fails */ + } + } + else { /* ob["key"] = value */ + int set = 0; + + if (self->m_attr_dict==NULL) /* lazy init */ + self->m_attr_dict= PyDict_New(); + + + if(PyDict_SetItem(self->m_attr_dict, key, val)==0) + set= 1; + else + PyErr_SetString(PyExc_KeyError, "scene[key] = value: KX_Scene, key not be added to internal dictionary"); + + if(set==0) + return -1; /* pythons error value */ + + } + + return 0; /* success */ +} + +static int Seq_Contains(PyObject *self_v, PyObject *value) +{ + KX_Scene* self= static_castBGE_PROXY_REF(self_v); + + if (self==NULL) { + PyErr_SetString(PyExc_SystemError, "val in scene: KX_Scene, "BGE_PROXY_ERROR_MSG); + return -1; + } + + if (self->m_attr_dict && PyDict_GetItem(self->m_attr_dict, value)) + return 1; + + return 0; +} + +PyMappingMethods KX_Scene::Mapping = { + (lenfunc)NULL , /*inquiry mp_length */ + (binaryfunc)Map_GetItem, /*binaryfunc mp_subscript */ + (objobjargproc)Map_SetItem, /*objobjargproc mp_ass_subscript */ +}; + +PySequenceMethods KX_Scene::Sequence = { + NULL, /* Cant set the len otherwise it can evaluate as false */ + NULL, /* sq_concat */ + NULL, /* sq_repeat */ + NULL, /* sq_item */ + NULL, /* sq_slice */ + NULL, /* sq_ass_item */ + NULL, /* sq_ass_slice */ + (objobjproc)Seq_Contains, /* sq_contains */ +}; PyObject* KX_Scene::pyattr_get_name(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { @@ -1765,3 +1875,22 @@ KX_PYMETHODDEF_DOC(KX_Scene, addObject, replica->Release(); return replica->GetProxy(); } + +/* Matches python dict.get(key, [default]) */ +KX_PYMETHODDEF_DOC(KX_Scene, get, "") +{ + PyObject *key; + PyObject* def = Py_None; + PyObject* ret; + + if (!PyArg_ParseTuple(args, "O|O:get", &key, &def)) + return NULL; + + if (m_attr_dict && (ret=PyDict_GetItem(m_attr_dict, key))) { + Py_INCREF(ret); + return ret; + } + + Py_INCREF(def); + return def; +} diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index f48e9520f53..8d7c0ad8dec 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -90,6 +90,7 @@ struct KX_ClientObjectInfo; class KX_Scene : public PyObjectPlus, public SCA_IScene { Py_Header; + PyObject* m_attr_dict; struct CullingInfo { int m_layer; @@ -262,15 +263,10 @@ protected: double m_suspendedtime; double m_suspendeddelta; - - /** - * This stores anything from python - */ - PyObject* m_attr_dict; struct Scene* m_blenderScene; -public: +public: KX_Scene(class SCA_IInputDevice* keyboarddevice, class SCA_IInputDevice* mousedevice, class NG_NetworkDeviceInterface* ndi, @@ -525,6 +521,8 @@ public: KX_PYMETHOD_DOC_NOARGS(KX_Scene, getObjectList); KX_PYMETHOD_DOC_NOARGS(KX_Scene, getName); KX_PYMETHOD_DOC(KX_Scene, addObject); + KX_PYMETHOD_DOC(KX_Scene, get); + /* KX_PYMETHOD_DOC(KX_Scene, getActiveCamera); KX_PYMETHOD_DOC(KX_Scene, getActiveCamera); @@ -549,7 +547,11 @@ public: static int pyattr_set_active_camera(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); virtual PyObject* py_repr(void) { return PyUnicode_FromString(GetName().ReadPtr()); } - + + /* getitem/setitem */ + static PyMappingMethods Mapping; + static PySequenceMethods Sequence; + /** * Sets the time the scene was suspended */ diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index c82623e6409..9c426aed8e0 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -3868,6 +3868,12 @@ class KX_Scene(PyObjectPlus): @rtype: L{KX_GameObject} """ + + def get(key, default=None): + """ + Return the value matching key, or the default value if its not found. + @return: The key value or a default. + """ class KX_SceneActuator(SCA_IActuator): """ From 9521fa94569b0ab1fe5c9f451e8abf7dd2290b13 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 25 Aug 2009 13:54:56 +0000 Subject: [PATCH 258/577] remove gameOb.has_key(key) method from KX_GameObject and ListValue since python 3.x removes has_key from dictionaries. Instead use __contains__, eg. if key in gameOb: ... Mathutils returns from PyMath.cpp were incorrectly using wrapped Mathutils types. Wrapped types should only be used with a callback now. --- source/gameengine/Expressions/ListValue.cpp | 9 --------- source/gameengine/Expressions/ListValue.h | 1 - source/gameengine/Ketsji/KX_GameObject.cpp | 9 --------- source/gameengine/Ketsji/KX_GameObject.h | 1 - source/gameengine/Ketsji/KX_PyMath.cpp | 8 ++++---- source/gameengine/PyDoc/GameTypes.py | 18 +++--------------- 6 files changed, 7 insertions(+), 39 deletions(-) diff --git a/source/gameengine/Expressions/ListValue.cpp b/source/gameengine/Expressions/ListValue.cpp index 5f45cdc48a2..002674450d1 100644 --- a/source/gameengine/Expressions/ListValue.cpp +++ b/source/gameengine/Expressions/ListValue.cpp @@ -300,7 +300,6 @@ PyMethodDef CListValue::Methods[] = { /* Dict style access */ {"get", (PyCFunction)CListValue::sPyget,METH_VARARGS}, - {"has_key", (PyCFunction)CListValue::sPyhas_key,METH_O}, /* Own cvalue funcs */ {"from_id", (PyCFunction)CListValue::sPyfrom_id,METH_O}, @@ -594,14 +593,6 @@ PyObject* CListValue::Pyget(PyObject *args) return def; } -/* Matches python dict.has_key() */ -PyObject* CListValue::Pyhas_key(PyObject* value) -{ - if (PyUnicode_Check(value) && FindValue((const char *)_PyUnicode_AsString(value))) - Py_RETURN_TRUE; - - Py_RETURN_FALSE; -} PyObject* CListValue::Pyfrom_id(PyObject* value) { diff --git a/source/gameengine/Expressions/ListValue.h b/source/gameengine/Expressions/ListValue.h index 98e6f216f11..2dc458e0148 100644 --- a/source/gameengine/Expressions/ListValue.h +++ b/source/gameengine/Expressions/ListValue.h @@ -74,7 +74,6 @@ public: KX_PYMETHOD_O(CListValue,index); KX_PYMETHOD_O(CListValue,count); KX_PYMETHOD_VARARGS(CListValue,get); - KX_PYMETHOD_O(CListValue,has_key); KX_PYMETHOD_O(CListValue,from_id); diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index a5217273b17..3aef41743a7 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1398,7 +1398,6 @@ PyMethodDef KX_GameObject::Methods[] = { KX_PYMETHODTABLE(KX_GameObject, sendMessage), // dict style access for props - {"has_key",(PyCFunction) KX_GameObject::sPyhas_key, METH_O}, {"get",(PyCFunction) KX_GameObject::sPyget, METH_VARARGS}, // deprecated @@ -2919,14 +2918,6 @@ PyObject* KX_GameObject::Pyget(PyObject *args) return def; } -/* Matches python dict.has_key() */ -PyObject* KX_GameObject::Pyhas_key(PyObject* value) -{ - // the ONLY error case is invalid data, this is checked by the macro'd static function - // that calls this one. but make sure Seq_Contains doesnt add extra errors later on. - return PyBool_FromLong(Seq_Contains((PyObject *)this, value)); -} - /* --------------------------------------------------------------------- * Some stuff taken from the header * --------------------------------------------------------------------- */ diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index ba7451fdeef..a5cd084b4d4 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -844,7 +844,6 @@ public: /* Dict access */ KX_PYMETHOD_VARARGS(KX_GameObject,get); - KX_PYMETHOD_O(KX_GameObject,has_key); /* attributes */ static PyObject* pyattr_get_name(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_PyMath.cpp b/source/gameengine/Ketsji/KX_PyMath.cpp index 6d33c38190c..a41dab194dd 100644 --- a/source/gameengine/Ketsji/KX_PyMath.cpp +++ b/source/gameengine/Ketsji/KX_PyMath.cpp @@ -146,7 +146,7 @@ PyObject* PyObjectFrom(const MT_Quaternion &qrot) { /* NOTE, were re-ordering here for Mathutils compat */ float fvec[4]= {qrot[3], qrot[0], qrot[1], qrot[2]}; - return newQuaternionObject(fvec, Py_WRAP, NULL); + return newQuaternionObject(fvec, Py_NEW, NULL); } #endif @@ -154,7 +154,7 @@ PyObject* PyObjectFrom(const MT_Tuple4 &vec) { #ifdef USE_MATHUTILS float fvec[4]= {vec[0], vec[1], vec[2], vec[3]}; - return newVectorObject(fvec, 4, Py_WRAP, NULL); + return newVectorObject(fvec, 4, Py_NEW, NULL); #else PyObject *list = PyList_New(4); PyList_SET_ITEM(list, 0, PyFloat_FromDouble(vec[0])); @@ -169,7 +169,7 @@ PyObject* PyObjectFrom(const MT_Tuple3 &vec) { #ifdef USE_MATHUTILS float fvec[3]= {vec[0], vec[1], vec[2]}; - return newVectorObject(fvec, 3, Py_WRAP, NULL); + return newVectorObject(fvec, 3, Py_NEW, NULL); #else PyObject *list = PyList_New(3); PyList_SET_ITEM(list, 0, PyFloat_FromDouble(vec[0])); @@ -183,7 +183,7 @@ PyObject* PyObjectFrom(const MT_Tuple2 &vec) { #ifdef USE_MATHUTILS float fvec[2]= {vec[0], vec[1]}; - return newVectorObject(fvec, 2, Py_WRAP, NULL); + return newVectorObject(fvec, 2, Py_NEW, NULL); #else PyObject *list = PyList_New(2); PyList_SET_ITEM(list, 0, PyFloat_FromDouble(vec[0])); diff --git a/source/gameengine/PyDoc/GameTypes.py b/source/gameengine/PyDoc/GameTypes.py index 9c426aed8e0..c391d0c3dec 100644 --- a/source/gameengine/PyDoc/GameTypes.py +++ b/source/gameengine/PyDoc/GameTypes.py @@ -1023,12 +1023,6 @@ class CListValue(CPropValue): Return the value matching key, or the default value if its not found. @return: The key value or a default. """ - def has_key(key): - """ - Return True if the key is found. - @rtype: boolean - @return: The key value or a default. - """ def from_id(id): """ This is a funtion especially for the game engine to return a value with a spesific id. @@ -1582,7 +1576,7 @@ class KX_GameObject(SCA_IObject): @ivar childrenRecursive: all children of this object including childrens children, (read-only). @type childrenRecursive: L{CListValue} of L{KX_GameObject}'s @group Deprecated: getPosition, setPosition, setWorldPosition, getOrientation, setOrientation, getState, setState, getParent, getVisible, getMass, getMesh, getChildren, getChildrenRecursive - @group Property Access: get, has_key, attrDict, getPropertyNames + @group Property Access: get, attrDict, getPropertyNames """ def endObject(): """ @@ -2054,12 +2048,6 @@ class KX_GameObject(SCA_IObject): Return the value matching key, or the default value if its not found. @return: The key value or a default. """ - def has_key(key): - """ - Return True if the key is found. - @rtype: boolean - @return: The key value or a default. - """ class KX_IpoActuator(SCA_IActuator): @@ -5745,7 +5733,7 @@ for name, val in locals().items(): # Store the mappings to new attributes in a list (because there # could be collisions). - if not depAttrs.has_key(attrName): + if attrName not in depAttrs: depAttrs[attrName] = {} mapping = depAttrs[attrName] @@ -5770,7 +5758,7 @@ for name, val in locals().items(): # Another mapping, from a conversion tuple to lists of class # names. conversion = (func, newAttrName) - if not mapping.has_key(conversion): + if conversion not in mapping: mapping[conversion] = [] mapping[conversion].append(name) break From 3d7215da581b5c1dac6d566aa43ef3cfccd13c92 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Tue, 25 Aug 2009 14:26:27 +0000 Subject: [PATCH 259/577] 2.5 Material Buttons: * Fixed some poll checks, they showed empty panels when there was no active material. * Some minor code/whitespace cleanup. --- release/ui/buttons_material.py | 76 +++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 33 deletions(-) diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py index 21201166eda..30b107d452f 100644 --- a/release/ui/buttons_material.py +++ b/release/ui/buttons_material.py @@ -29,7 +29,8 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel): # An exception, dont call the parent poll func because # this manages materials for all engine types - return (context.object) and (context.scene.render_data.engine in self.COMPAT_ENGINES) + engine = context.scene.render_data.engine + return (context.object) and (engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -74,7 +75,9 @@ class MATERIAL_PT_shading(MaterialButtonsPanel): COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME']) def poll(self, context): - return (context.material.type in ('SURFACE', 'WIRE', 'HALO')) + mat = context.material + engine = context.scene.render_data.engine + return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -114,10 +117,8 @@ class MATERIAL_PT_strand(MaterialButtonsPanel): def poll(self, context): mat = context.material - return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES) - - def poll(self, context): - return context.material.type in ('SURFACE', 'WIRE', 'HALO') + engine = context.scene.render_data.engine + return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -177,7 +178,9 @@ class MATERIAL_PT_options(MaterialButtonsPanel): COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME']) def poll(self, context): - return (context.material.type in ('SURFACE', 'WIRE', 'HALO')) + mat = context.material + engine = context.scene.render_data.engine + return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -215,7 +218,9 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel): COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME']) def poll(self, context): - return context.material.type in ('SURFACE', 'WIRE') + mat = context.material + engine = context.scene.render_data.engine + return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -240,7 +245,6 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel): sub = col.column() sub.active = (not mat.ray_shadow_bias) sub.itemR(mat, "shadow_ray_bias", text="Ray Bias") - class MATERIAL_PT_diffuse(MaterialButtonsPanel): __label__ = "Diffuse" @@ -248,7 +252,8 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel): def poll(self, context): mat = context.material - return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES) + engine = context.scene.render_data.engine + return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -294,15 +299,15 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel): split = row.split(percentage=0.3) split.itemL(text="Blend:") split.itemR(mat, "diffuse_ramp_blend", text="") - - + class MATERIAL_PT_specular(MaterialButtonsPanel): __label__ = "Specular" COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME']) def poll(self, context): mat = context.material - return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES) + engine = context.scene.render_data.engine + return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -354,7 +359,8 @@ class MATERIAL_PT_sss(MaterialButtonsPanel): def poll(self, context): mat = context.material - return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES) + engine = context.scene.render_data.engine + return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) def draw_header(self, context): layout = self.layout @@ -399,7 +405,8 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel): def poll(self, context): mat = context.material - return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES) + engine = context.scene.render_data.engine + return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) def draw_header(self, context): layout = self.layout @@ -421,8 +428,7 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel): col = split.column() col.itemR(raym, "reflect", text="Reflectivity") col.itemR(mat, "mirror_color", text="") - - + col = split.column() col.itemR(raym, "fresnel") sub = col.column() @@ -448,8 +454,7 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel): sub.itemR(raym, "gloss_threshold", text="Threshold") sub.itemR(raym, "gloss_samples", text="Samples") sub.itemR(raym, "gloss_anisotropic", text="Anisotropic") - - + class MATERIAL_PT_transp(MaterialButtonsPanel): __label__= "Transparency" __default_closed__ = True @@ -457,7 +462,8 @@ class MATERIAL_PT_transp(MaterialButtonsPanel): def poll(self, context): mat = context.material - return mat and (mat.type in ('SURFACE', 'WIRE')) and (context.scene.render_data.engine in self.COMPAT_ENGINES) + engine = context.scene.render_data.engine + return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) def draw_header(self, context): layout = self.layout @@ -483,8 +489,7 @@ class MATERIAL_PT_transp(MaterialButtonsPanel): row = col.row() row.active = mat.transparency and (not mat.shadeless) row.itemR(mat, "specular_alpha", text="Specular") - - + col = split.column() col.active = (not mat.shadeless) col.itemR(rayt, "fresnel") @@ -518,7 +523,9 @@ class MATERIAL_PT_volume_shading(MaterialButtonsPanel): COMPAT_ENGINES = set(['BLENDER_RENDER']) def poll(self, context): - return (context.material.type == 'VOLUME') and (context.scene.render_data.engine in self.COMPAT_ENGINES) + mat = context.material + engine = context.scene.render_data.engine + return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -536,13 +543,10 @@ class MATERIAL_PT_volume_shading(MaterialButtonsPanel): col = split.column() col.itemR(vol, "absorption") col.itemR(vol, "absorption_color", text="") - - + col = split.column() col.itemR(vol, "emission") col.itemR(vol, "emission_color", text="") - - class MATERIAL_PT_volume_scattering(MaterialButtonsPanel): __label__ = "Scattering" @@ -550,7 +554,9 @@ class MATERIAL_PT_volume_scattering(MaterialButtonsPanel): COMPAT_ENGINES = set(['BLENDER_RENDER']) def poll(self, context): - return (context.material.type == 'VOLUME') and (context.scene.render_data.engine in self.COMPAT_ENGINES) + mat = context.material + engine = context.scene.render_data.engine + return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -587,7 +593,8 @@ class MATERIAL_PT_volume_transp(MaterialButtonsPanel): def poll(self, context): mat = context.material - return mat and (mat.type == 'VOLUME') and (context.scene.render_data.engine in self.COMPAT_ENGINES) + engine = context.scene.render_data.engine + return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES) def draw_header(self, context): layout = self.layout @@ -608,7 +615,9 @@ class MATERIAL_PT_volume_integration(MaterialButtonsPanel): COMPAT_ENGINES = set(['BLENDER_RENDER']) def poll(self, context): - return (context.material.type == 'VOLUME') and (context.scene.render_data.engine in self.COMPAT_ENGINES) + mat = context.material + engine = context.scene.render_data.engine + return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -637,7 +646,8 @@ class MATERIAL_PT_halo(MaterialButtonsPanel): def poll(self, context): mat = context.material - return mat and (mat.type == 'HALO') and (context.scene.render_data.engine in self.COMPAT_ENGINES) + engine = context.scene.render_data.engine + return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES) def draw(self, context): layout = self.layout @@ -683,7 +693,8 @@ class MATERIAL_PT_flare(MaterialButtonsPanel): def poll(self, context): mat = context.material - return mat and (mat.type == 'HALO') and (context.scene.render_data.engine in self.COMPAT_ENGINES) + engine = context.scene.render_data.engine + return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES) def draw_header(self, context): layout = self.layout @@ -728,4 +739,3 @@ bpy.types.register(MATERIAL_PT_physics) bpy.types.register(MATERIAL_PT_strand) bpy.types.register(MATERIAL_PT_options) bpy.types.register(MATERIAL_PT_shadow) - From 4ba6dbce767c7e3fe4c91aaca79da6f35d5492c9 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Tue, 25 Aug 2009 15:30:04 +0000 Subject: [PATCH 260/577] Replaced G.sce by Main.name in sound.c. I hoped for it to resolve the bug of loading sounds with relative paths didn't work, but Main.name isn't set before the sounds are loaded, so the bug resists! Someone who is into file loading should please fix this! --- intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp | 1 - source/blender/blenkernel/BKE_sound.h | 2 +- source/blender/blenkernel/intern/packedFile.c | 2 +- source/blender/blenkernel/intern/sound.c | 12 ++++++------ source/blender/blenloader/intern/readfile.c | 2 +- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp index de0e47300f8..d70a9c25bcb 100644 --- a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp +++ b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp @@ -334,7 +334,6 @@ void AUD_FFMPEGReader::read(int & length, sample_t* & buffer) // read packages and decode them AVPacket packet; int data_size = 0; - int pkgbuf_size = m_pkgbuf->getSize(); int pkgbuf_pos; int left = length; int sample_size = AUD_SAMPLE_SIZE(m_specs); diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index 1dd90b4dbda..84ecd79a008 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -54,7 +54,7 @@ void sound_delete(struct bContext *C, struct bSound* sound); void sound_cache(struct bSound* sound, int ignore); -void sound_load(struct bSound* sound); +void sound_load(struct Main *main, struct bSound* sound); void sound_free(struct bSound* sound); diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index 8c77ed92aa1..3e47c1006e5 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -473,7 +473,7 @@ int unpackSound(ReportList *reports, bSound *sound, int how) freePackedFile(sound->packedfile); sound->packedfile = 0; - sound_load(sound); + sound_load(NULL, sound); ret_value = RET_OK; } diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 74ab41ff577..c6f9db6fda9 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -78,7 +78,7 @@ struct bSound* sound_new_file(struct Main *main, char* filename) int len; strcpy(str, filename); - BLI_convertstringcode(str, G.sce); + BLI_convertstringcode(str, main->name); len = strlen(filename); while(len > 0 && filename[len-1] != '/' && filename[len-1] != '\\') @@ -88,7 +88,7 @@ struct bSound* sound_new_file(struct Main *main, char* filename) strcpy(sound->name, filename); sound->type = SOUND_TYPE_FILE; - sound_load(sound); + sound_load(main, sound); if(!sound->snd_sound) { @@ -114,7 +114,7 @@ struct bSound* sound_new_buffer(struct bContext *C, struct bSound *source) sound->child_sound = source; sound->type = SOUND_TYPE_BUFFER; - sound_load(sound); + sound_load(CTX_data_main(C), sound); if(!sound->snd_sound) { @@ -140,7 +140,7 @@ struct bSound* sound_new_limiter(struct bContext *C, struct bSound *source, floa sound->end = end; sound->type = SOUND_TYPE_LIMITER; - sound_load(sound); + sound_load(CTX_data_main(C), sound); if(!sound->snd_sound) { @@ -172,7 +172,7 @@ void sound_cache(struct bSound* sound, int ignore) sound->cache = AUD_bufferSound(sound->snd_sound); } -void sound_load(struct bSound* sound) +void sound_load(struct Main *main, struct bSound* sound) { if(sound) { @@ -198,7 +198,7 @@ void sound_load(struct bSound* sound) if(sound->id.lib) path = sound->id.lib->filename; else - path = G.sce; + path = main ? main->name : NULL; BLI_convertstringcode(fullpath, path); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 5cc3ff7695a..920e202520e 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5075,7 +5075,7 @@ static void lib_link_sound(FileData *fd, Main *main) sound->ipo= newlibadr_us(fd, sound->id.lib, sound->ipo); // XXX depreceated - old animation system sound->stream = 0; - sound_load(sound); + sound_load(main, sound); } sound= sound->id.next; } From 7288bacad9bbe5e670de3454c9a64dee0c3d920c Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Tue, 25 Aug 2009 17:05:04 +0000 Subject: [PATCH 261/577] blender 2.5 MSVC projectfiles * update for volume rendering * update for audaspace jack * update for rna: animation_api.c, scene_api.c --- .../audaspace/make/msvc_9_0/audaspace.vcproj | 8 ++-- .../blender/blenlib/BLI_blenlib.vcproj | 8 ++++ .../blender/editors/ED_editors.vcproj | 4 -- .../blender/makesrna/RNA_makesrna.vcproj | 8 ++++ .../blender/render/BRE_render.vcproj | 40 ++++++++++++++++++- 5 files changed, 58 insertions(+), 10 deletions(-) diff --git a/intern/audaspace/make/msvc_9_0/audaspace.vcproj b/intern/audaspace/make/msvc_9_0/audaspace.vcproj index 67ab4d44d72..4c0b26f1c4e 100644 --- a/intern/audaspace/make/msvc_9_0/audaspace.vcproj +++ b/intern/audaspace/make/msvc_9_0/audaspace.vcproj @@ -43,7 +43,7 @@ + + @@ -723,6 +727,10 @@ RelativePath="..\..\..\source\blender\blenlib\BLI_util.h" > + + diff --git a/projectfiles_vc9/blender/editors/ED_editors.vcproj b/projectfiles_vc9/blender/editors/ED_editors.vcproj index 0482fa9067a..c70e66b6c2b 100644 --- a/projectfiles_vc9/blender/editors/ED_editors.vcproj +++ b/projectfiles_vc9/blender/editors/ED_editors.vcproj @@ -1302,10 +1302,6 @@ RelativePath="..\..\..\source\blender\editors\sculpt_paint\sculpt_intern.h" > - - + + @@ -762,6 +766,10 @@ RelativePath="..\..\..\source\blender\makesrna\intern\rna_scene.c" > + + diff --git a/projectfiles_vc9/blender/render/BRE_render.vcproj b/projectfiles_vc9/blender/render/BRE_render.vcproj index d7851674857..4e354c6dde3 100644 --- a/projectfiles_vc9/blender/render/BRE_render.vcproj +++ b/projectfiles_vc9/blender/render/BRE_render.vcproj @@ -42,7 +42,7 @@ + + @@ -252,6 +256,18 @@ RelativePath="..\..\..\source\blender\render\intern\source\texture.c" > + + + + + + @@ -297,6 +313,10 @@ RelativePath="..\..\..\source\blender\render\intern\include\pixelshading.h" > + + @@ -309,6 +329,10 @@ RelativePath="..\..\..\source\blender\render\extern\include\RE_shader_ext.h" > + + @@ -353,6 +377,18 @@ RelativePath="..\..\..\source\blender\render\intern\include\vanillaRenderPipe_int.h" > + + + + + + From 706a4c22b54ede250fbdb2c2bd772c63cdbf7d09 Mon Sep 17 00:00:00 2001 From: Arystanbek Dyussenov Date: Tue, 25 Aug 2009 17:06:36 +0000 Subject: [PATCH 262/577] Implemented dynamic and multidimensional array support in RNA. Example code: http://www.pasteall.org/7332/c. New API functions: http://www.pasteall.org/7330/c. Maximum number of dimensions is currently limited to 3, but can be increased arbitrarily if needed. What this means for ID property access: * MeshFace.verts - dynamic array, size 3 or 4 depending on MFace.v4 * MeshTextureFace.uv - dynamic, 2-dimensional array, size depends on MFace.v4 * Object.matrix - 2-dimensional array What this means for functions: * more intuitive API possibility, for example: Mesh.add_vertices([(x, y, z), (x, y, z), ...]) Mesh.add_faces([(1, 2, 3), (4, 5, 6), ...]) Python part is not complete yet, e.g. it is possible to: MeshFace.verts = (1, 2, 3) # even if Mesh.verts is (1, 2, 3, 4) and vice-versa MeshTextureFace.uv = [(0.0, 0.0)] * 4 # only if a corresponding MFace is a quad but the following won't work: MeshTextureFace.uv[3] = (0.0, 0.0) # setting uv[3] modifies MTFace.uv[1][0] instead of MTFace.uv[3] --- source/blender/blenkernel/intern/anim_sys.c | 12 +- source/blender/blenkernel/intern/fcurve.c | 6 +- .../editors/animation/anim_ipo_utils.c | 2 +- source/blender/editors/animation/drivers.c | 6 +- source/blender/editors/animation/keyframing.c | 10 +- source/blender/editors/animation/keyingsets.c | 4 +- source/blender/editors/interface/interface.c | 18 +- .../editors/interface/interface_anim.c | 2 +- .../editors/interface/interface_layout.c | 10 +- .../editors/interface/interface_templates.c | 2 +- .../editors/interface/interface_utils.c | 4 +- .../blender/editors/space_outliner/outliner.c | 4 +- source/blender/makesrna/RNA_access.h | 4 +- source/blender/makesrna/RNA_define.h | 8 +- source/blender/makesrna/RNA_types.h | 3 +- source/blender/makesrna/intern/makesrna.c | 8 + source/blender/makesrna/intern/rna_access.c | 45 +++- source/blender/makesrna/intern/rna_define.c | 46 +++- .../makesrna/intern/rna_internal_types.h | 11 + source/blender/makesrna/intern/rna_mesh.c | 97 ++++++++ source/blender/makesrna/intern/rna_object.c | 4 +- source/blender/python/intern/bpy_array.c | 235 ++++++++++++++++++ source/blender/python/intern/bpy_rna.c | 131 ++-------- source/blender/python/intern/bpy_rna.h | 5 + 24 files changed, 513 insertions(+), 164 deletions(-) create mode 100644 source/blender/python/intern/bpy_array.c diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 44d73a7f5b4..df7004d3f6b 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -441,19 +441,19 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i switch (RNA_property_type(prop)) { case PROP_BOOLEAN: - if (RNA_property_array_length(prop)) + if (RNA_property_array_length(&new_ptr, prop)) RNA_property_boolean_set_index(&new_ptr, prop, array_index, (int)value); else RNA_property_boolean_set(&new_ptr, prop, (int)value); break; case PROP_INT: - if (RNA_property_array_length(prop)) + if (RNA_property_array_length(&new_ptr, prop)) RNA_property_int_set_index(&new_ptr, prop, array_index, (int)value); else RNA_property_int_set(&new_ptr, prop, (int)value); break; case PROP_FLOAT: - if (RNA_property_array_length(prop)) + if (RNA_property_array_length(&new_ptr, prop)) RNA_property_float_set_index(&new_ptr, prop, array_index, value); else RNA_property_float_set(&new_ptr, prop, value); @@ -1178,19 +1178,19 @@ void nladata_flush_channels (ListBase *channels) switch (RNA_property_type(prop)) { case PROP_BOOLEAN: - if (RNA_property_array_length(prop)) + if (RNA_property_array_length(ptr, prop)) RNA_property_boolean_set_index(ptr, prop, array_index, (int)value); else RNA_property_boolean_set(ptr, prop, (int)value); break; case PROP_INT: - if (RNA_property_array_length(prop)) + if (RNA_property_array_length(ptr, prop)) RNA_property_int_set_index(ptr, prop, array_index, (int)value); else RNA_property_int_set(ptr, prop, (int)value); break; case PROP_FLOAT: - if (RNA_property_array_length(prop)) + if (RNA_property_array_length(ptr, prop)) RNA_property_float_set_index(ptr, prop, array_index, value); else RNA_property_float_set(ptr, prop, value); diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 90bf08059d7..31f6e2c6067 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -698,19 +698,19 @@ float driver_get_target_value (ChannelDriver *driver, DriverTarget *dtar) if (RNA_path_resolve(&id_ptr, path, &ptr, &prop)) { switch (RNA_property_type(prop)) { case PROP_BOOLEAN: - if (RNA_property_array_length(prop)) + if (RNA_property_array_length(&ptr, prop)) value= (float)RNA_property_boolean_get_index(&ptr, prop, index); else value= (float)RNA_property_boolean_get(&ptr, prop); break; case PROP_INT: - if (RNA_property_array_length(prop)) + if (RNA_property_array_length(&ptr, prop)) value= (float)RNA_property_int_get_index(&ptr, prop, index); else value= (float)RNA_property_int_get(&ptr, prop); break; case PROP_FLOAT: - if (RNA_property_array_length(prop)) + if (RNA_property_array_length(&ptr, prop)) value= RNA_property_float_get_index(&ptr, prop, index); else value= RNA_property_float_get(&ptr, prop); diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c index ecf0bdbf285..26edf930f0b 100644 --- a/source/blender/editors/animation/anim_ipo_utils.c +++ b/source/blender/editors/animation/anim_ipo_utils.c @@ -147,7 +147,7 @@ void getname_anim_fcurve(char *name, ID *id, FCurve *fcu) propname= (char *)RNA_property_ui_name(prop); /* Array Index - only if applicable */ - if (RNA_property_array_length(prop)) { + if (RNA_property_array_length(&ptr, prop)) { char c= RNA_property_array_item_char(prop, fcu->array_index); /* we need to write the index to a temp buffer (in py syntax) */ diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index 849e2d2eede..e7b7d785d7b 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -157,7 +157,7 @@ short ANIM_add_driver (ID *id, const char rna_path[], int array_index, short fla /* fill in current value for python */ if(type == DRIVER_TYPE_PYTHON) { PropertyType proptype= RNA_property_type(prop); - int array= RNA_property_array_length(prop); + int array= RNA_property_array_length(&ptr, prop); char *expression= fcu->driver->expression; int val, maxlen= sizeof(fcu->driver->expression); float fval; @@ -241,7 +241,7 @@ static int add_driver_button_exec (bContext *C, wmOperator *op) if (path) { if (all) { - length= RNA_property_array_length(prop); + length= RNA_property_array_length(&ptr, prop); if (length) index= 0; else length= 1; @@ -303,7 +303,7 @@ static int remove_driver_button_exec (bContext *C, wmOperator *op) if (path) { if (all) { - length= RNA_property_array_length(prop); + length= RNA_property_array_length(&ptr, prop); if(length) index= 0; else length= 1; diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index b62c69c7b38..dc73011549c 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -503,19 +503,19 @@ static float setting_get_rna_value (PointerRNA *ptr, PropertyRNA *prop, int inde switch (RNA_property_type(prop)) { case PROP_BOOLEAN: - if (RNA_property_array_length(prop)) + if (RNA_property_array_length(ptr, prop)) value= (float)RNA_property_boolean_get_index(ptr, prop, index); else value= (float)RNA_property_boolean_get(ptr, prop); break; case PROP_INT: - if (RNA_property_array_length(prop)) + if (RNA_property_array_length(ptr, prop)) value= (float)RNA_property_int_get_index(ptr, prop, index); else value= (float)RNA_property_int_get(ptr, prop); break; case PROP_FLOAT: - if (RNA_property_array_length(prop)) + if (RNA_property_array_length(ptr, prop)) value= RNA_property_float_get_index(ptr, prop, index); else value= RNA_property_float_get(ptr, prop); @@ -1313,7 +1313,7 @@ static int insert_key_button_exec (bContext *C, wmOperator *op) if (path) { if (all) { - length= RNA_property_array_length(prop); + length= RNA_property_array_length(&ptr, prop); if(length) index= 0; else length= 1; @@ -1396,7 +1396,7 @@ static int delete_key_button_exec (bContext *C, wmOperator *op) if (path) { if (all) { - length= RNA_property_array_length(prop); + length= RNA_property_array_length(&ptr, prop); if(length) index= 0; else length= 1; diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index d22fe763ad4..21f969467aa 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -925,7 +925,7 @@ int modify_keyframes (bContext *C, ListBase *dsources, bAction *act, KeyingSet * RNA_id_pointer_create(ksp->id, &id_ptr); if (RNA_path_resolve(&id_ptr, ksp->rna_path, &ptr, &prop) && prop) - arraylen= RNA_property_array_length(prop); + arraylen= RNA_property_array_length(&ptr, prop); } /* we should do at least one step */ @@ -1048,7 +1048,7 @@ int modify_keyframes (bContext *C, ListBase *dsources, bAction *act, KeyingSet * RNA_id_pointer_create(cks->id, &id_ptr); if (RNA_path_resolve(&id_ptr, path, &ptr, &prop) && prop) - arraylen= RNA_property_array_length(prop); + arraylen= RNA_property_array_length(&ptr, prop); } /* for each possible index, perform operation diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 9bd6c2577ff..3c6e12905d6 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1089,7 +1089,7 @@ void ui_get_but_vectorf(uiBut *but, float *vec) vec[0]= vec[1]= vec[2]= 0.0f; if(RNA_property_type(prop) == PROP_FLOAT) { - tot= RNA_property_array_length(prop); + tot= RNA_property_array_length(&but->rnapoin, prop); tot= MIN2(tot, 3); for(a=0; arnaprop; if(RNA_property_type(prop) == PROP_FLOAT) { - tot= RNA_property_array_length(prop); + tot= RNA_property_array_length(&but->rnapoin, prop); tot= MIN2(tot, 3); for(a=0; arnapoin, prop)) value= RNA_property_boolean_get_index(&but->rnapoin, prop, but->rnaindex); else value= RNA_property_boolean_get(&but->rnapoin, prop); break; case PROP_INT: - if(RNA_property_array_length(prop)) + if(RNA_property_array_length(&but->rnapoin, prop)) value= RNA_property_int_get_index(&but->rnapoin, prop, but->rnaindex); else value= RNA_property_int_get(&but->rnapoin, prop); break; case PROP_FLOAT: - if(RNA_property_array_length(prop)) + if(RNA_property_array_length(&but->rnapoin, prop)) value= RNA_property_float_get_index(&but->rnapoin, prop, but->rnaindex); else value= RNA_property_float_get(&but->rnapoin, prop); @@ -1245,19 +1245,19 @@ void ui_set_but_val(uiBut *but, double value) if(RNA_property_editable(&but->rnapoin, prop)) { switch(RNA_property_type(prop)) { case PROP_BOOLEAN: - if(RNA_property_array_length(prop)) + if(RNA_property_array_length(&but->rnapoin, prop)) RNA_property_boolean_set_index(&but->rnapoin, prop, but->rnaindex, value); else RNA_property_boolean_set(&but->rnapoin, prop, value); break; case PROP_INT: - if(RNA_property_array_length(prop)) + if(RNA_property_array_length(&but->rnapoin, prop)) RNA_property_int_set_index(&but->rnapoin, prop, but->rnaindex, value); else RNA_property_int_set(&but->rnapoin, prop, value); break; case PROP_FLOAT: - if(RNA_property_array_length(prop)) + if(RNA_property_array_length(&but->rnapoin, prop)) RNA_property_float_set_index(&but->rnapoin, prop, but->rnaindex, value); else RNA_property_float_set(&but->rnapoin, prop, value); @@ -2414,7 +2414,7 @@ uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, char *str, short x1, but->rnapoin= *ptr; but->rnaprop= prop; - if(RNA_property_array_length(but->rnaprop)) + if(RNA_property_array_length(&but->rnapoin, but->rnaprop)) but->rnaindex= index; else but->rnaindex= 0; diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c index 2993a1aba15..784d820ea52 100644 --- a/source/blender/editors/interface/interface_anim.c +++ b/source/blender/editors/interface/interface_anim.c @@ -217,7 +217,7 @@ void ui_but_anim_menu(bContext *C, uiBut *but) pup= uiPupMenuBegin(C, RNA_property_ui_name(but->rnaprop), 0); layout= uiPupMenuLayout(pup); - length= RNA_property_array_length(but->rnaprop); + length= RNA_property_array_length(&but->rnapoin, but->rnaprop); if(but->flag & UI_BUT_ANIMATED_KEY) { if(length) { diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 3b4471bd4b9..a52afcb1a92 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -760,7 +760,7 @@ void uiItemO(uiLayout *layout, char *name, int icon, char *opname) /* RNA property items */ -static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PropertyRNA *prop, int index, int *r_w, int *r_h) +static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PointerRNA *ptr, PropertyRNA *prop, int index, int *r_w, int *r_h) { PropertyType type; PropertySubType subtype; @@ -769,7 +769,7 @@ static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PropertyRNA /* arbitrary extended width by type */ type= RNA_property_type(prop); subtype= RNA_property_subtype(prop); - len= RNA_property_array_length(prop); + len= RNA_property_array_length(ptr, prop); if(ELEM3(type, PROP_STRING, PROP_POINTER, PROP_ENUM) && !name[0]) name= "non-empty text"; @@ -819,7 +819,7 @@ void uiItemFullR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, Proper /* retrieve info */ type= RNA_property_type(prop); - len= RNA_property_array_length(prop); + len= RNA_property_array_length(ptr, prop); /* set name and icon */ if(!name) @@ -846,7 +846,7 @@ void uiItemFullR(uiLayout *layout, char *name, int icon, PointerRNA *ptr, Proper expand= (flag & UI_ITEM_R_EXPAND); /* get size */ - ui_item_rna_size(layout, name, icon, prop, index, &w, &h); + ui_item_rna_size(layout, name, icon, ptr, prop, index, &w, &h); /* array property */ if(index == RNA_NO_INDEX && len > 0) @@ -1132,7 +1132,7 @@ void uiItemPointerR(uiLayout *layout, char *name, int icon, struct PointerRNA *p /* create button */ block= uiLayoutGetBlock(layout); - ui_item_rna_size(layout, name, icon, prop, 0, &w, &h); + ui_item_rna_size(layout, name, icon, ptr, prop, 0, &w, &h); but= ui_item_with_label(layout, block, name, icon, ptr, prop, 0, 0, 0, w, h); ui_but_add_search(but, ptr, prop, searchptr, searchprop); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 56badedaded..4cfc44e56c8 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1258,7 +1258,7 @@ void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, char *propname) * the 'remainder' is added to this, as it will be ok to have first row slightly wider if need be * - for now, only split into groups if if group will have at least 5 items */ - layers= RNA_property_array_length(prop); + layers= RNA_property_array_length(ptr, prop); cols= (layers / 2) + (layers % 2); groups= ((cols / 2) < 5) ? (1) : (cols / 2); diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 997ac8b78c6..5b44f6544d1 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -72,7 +72,7 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind { uiBut *but=NULL; const char *propname= RNA_property_identifier(prop); - int arraylen= RNA_property_array_length(prop); + int arraylen= RNA_property_array_length(ptr, prop); switch(RNA_property_type(prop)) { case PROP_BOOLEAN: { @@ -81,7 +81,7 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind if(arraylen && index == -1) return NULL; - length= RNA_property_array_length(prop); + length= RNA_property_array_length(ptr, prop); if(length) value= RNA_property_boolean_get_index(ptr, prop, index); diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index 762ad82344b..d564573a543 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -1084,7 +1084,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i te->flag |= TE_LAZY_CLOSED; } else if(ELEM3(proptype, PROP_BOOLEAN, PROP_INT, PROP_FLOAT)) { - tot= RNA_property_array_length(prop); + tot= RNA_property_array_length(ptr, prop); if(!(tselem->flag & TSE_CLOSED)) { for(a=0; aindex; } - else if (RNA_property_array_length(prop)) { + else if (RNA_property_array_length(ptr, prop)) { /* entire array was selected, so keyframe all */ *flag |= KSP_FLAG_WHOLE_ARRAY; } diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index fb351efed66..cb54fe2ad8d 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -581,8 +581,10 @@ PropertySubType RNA_property_subtype(PropertyRNA *prop); PropertyUnit RNA_property_unit(PropertyRNA *prop); int RNA_property_flag(PropertyRNA *prop); -int RNA_property_array_length(PropertyRNA *prop); +int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop); +int RNA_property_dynamic_array_set_length(PointerRNA *ptr, PropertyRNA *prop, int length); char RNA_property_array_item_char(PropertyRNA *prop, int index); +unsigned short RNA_property_array_dimension(PropertyRNA *prop, unsigned short dim_size[]); int RNA_property_string_maxlength(PropertyRNA *prop); diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h index 33f5d7137b8..1c6837bbcc8 100644 --- a/source/blender/makesrna/RNA_define.h +++ b/source/blender/makesrna/RNA_define.h @@ -88,11 +88,15 @@ void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc); PropertyRNA *RNA_def_float(StructOrFunctionRNA *cont, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); PropertyRNA *RNA_def_float_vector(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); PropertyRNA *RNA_def_float_color(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); -PropertyRNA *RNA_def_float_matrix(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); +PropertyRNA *RNA_def_float_matrix(StructOrFunctionRNA *cont, const char *identifier, int len, int rowsize, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); PropertyRNA *RNA_def_float_rotation(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); PropertyRNA *RNA_def_float_array(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); + /* +PropertyRNA *RNA_def_float_dynamic_array(StructOrFunctionRNA *cont, const char *identifier, float hardmin, float hardmax, + const char *ui_name, const char *ui_description, float softmin, float softmax, unsigned int dimension, unsigned short dim_size[]); + */ PropertyRNA *RNA_def_float_percentage(StructOrFunctionRNA *cont, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); @@ -123,6 +127,7 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, void RNA_def_property_flag(PropertyRNA *prop, int flag); void RNA_def_property_clear_flag(PropertyRNA *prop, int flag); void RNA_def_property_array(PropertyRNA *prop, int arraylength); +void RNA_def_property_multidimensional_array(PropertyRNA *prop, int arraylength, unsigned short arraydimension, unsigned short dimsize[]); void RNA_def_property_range(PropertyRNA *prop, double min, double max); void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item); @@ -146,6 +151,7 @@ void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive); void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *updatefunc); void RNA_def_property_editable_func(PropertyRNA *prop, const char *editable); +void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength, const char *setlength); void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set); void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range); void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char *set, const char *range); diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 042f7578cf4..1acbfb21385 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -152,7 +152,8 @@ typedef enum PropertyFlag { PROP_IDPROPERTY = 1024, PROP_RAW_ACCESS = 8192, PROP_RAW_ARRAY = 16384, - PROP_FREE_POINTERS = 32768 + PROP_FREE_POINTERS = 32768, + PROP_DYNAMIC = 131072 /* for dynamic arrays, and retvals of type string */ } PropertyFlag; typedef struct CollectionPropertyIterator { diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index fa3a5a40686..0c90a28a0e9 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -1724,6 +1724,14 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr rna_print_c_string(f, prop->description); fprintf(f, ",\n\t"); fprintf(f, "%d,\n", prop->icon); fprintf(f, "\t%s, %s|%s, %d,\n", rna_property_typename(prop->type), rna_property_subtypename(prop->subtype), rna_property_subtype_unit(prop->subtype), prop->arraylength); + { + int i; + int tot= sizeof(prop->dimsize) / sizeof(prop->dimsize[0]); + fprintf(f, "\t%s, %s, %d, {", rna_function_string(prop->getlength), rna_function_string(prop->setlength), (int)prop->arraydimension); + for(i= 0; i < tot; i++) { + fprintf(f, i == tot - 1 ? "%d},\n" : "%d, ", (int)prop->dimsize[i]); + } + } fprintf(f, "\t%s, %d, %s,\n", rna_function_string(prop->update), prop->noteflag, rna_function_string(prop->editable)); if(prop->flag & PROP_RAW_ACCESS) rna_set_raw_offset(f, srna, prop); diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index c2f1f31a4bc..e71dcc2a586 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -343,10 +343,11 @@ const char *rna_ensure_property_name(PropertyRNA *prop) return ((IDProperty*)prop)->name; } -int rna_ensure_property_array_length(PropertyRNA *prop) +int rna_ensure_property_array_length(PointerRNA *ptr, PropertyRNA *prop) { - if(prop->magic == RNA_MAGIC) - return prop->arraylength; + if(prop->magic == RNA_MAGIC) { + return prop->getlength ? prop->getlength(ptr) : prop->arraylength; + } else { IDProperty *idprop= (IDProperty*)prop; @@ -549,9 +550,27 @@ int RNA_property_flag(PropertyRNA *prop) return rna_ensure_property(prop)->flag; } -int RNA_property_array_length(PropertyRNA *prop) +int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop) { - return rna_ensure_property_array_length(prop); + return rna_ensure_property_array_length(ptr, prop); +} + +int RNA_property_dynamic_array_set_length(PointerRNA *ptr, PropertyRNA *prop, int length) +{ + if (prop->setlength) + return prop->setlength(ptr, length); + else + prop->arraylength= length; /* function parameters only? */ + + return 1; +} + +unsigned short RNA_property_array_dimension(PropertyRNA *prop, unsigned short dimsize[]) +{ + if (dimsize && prop->arraydimension > 1) { + memcpy(dimsize, prop->dimsize, sizeof(prop->dimsize[0]) * (prop->arraydimension - 1)); + } + return prop->arraydimension; } char RNA_property_array_item_char(PropertyRNA *prop, int index) @@ -1684,7 +1703,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro } /* check item array */ - itemlen= RNA_property_array_length(itemprop); + itemlen= RNA_property_array_length(&itemptr, itemprop); /* try to access as raw array */ if(RNA_property_collection_raw_array(ptr, prop, itemprop, &out)) { @@ -1736,7 +1755,7 @@ static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA *pro iprop= RNA_struct_find_property(&itemptr, propname); if(iprop) { - itemlen= RNA_property_array_length(iprop); + itemlen= RNA_property_array_length(&itemptr, iprop); itemtype= RNA_property_type(iprop); } else { @@ -2675,7 +2694,7 @@ char *RNA_pointer_as_string(PointerRNA *ptr) char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop) { int type = RNA_property_type(prop); - int len = RNA_property_array_length(prop); + int len = RNA_property_array_length(ptr, prop); int i; DynStr *dynstr= BLI_dynstr_new(); @@ -2905,6 +2924,12 @@ void RNA_parameter_list_free(ParameterList *parms) for(tot= 0; parm; parm= parm->next) { if(parm->type == PROP_COLLECTION) BLI_freelistN((ListBase*)((char*)parms->data+tot)); + else if (parm->flag & PROP_DYNAMIC) { + /* for dynamic arrays and strings, data is a pointer to an array */ + char *array= *(char**)((char*)parms->data+tot); + if(array) + MEM_freeN(array); + } tot+= rna_parameter_size(parm); } @@ -3277,7 +3302,7 @@ int RNA_function_call_direct_va(bContext *C, ReportList *reports, PointerRNA *pt type= RNA_property_type(parm); ftype= format[ofs++]; - len= RNA_property_array_length(parm); + len= RNA_property_array_length(&funcptr, parm); alen= rna_function_format_array_length(format, ofs, flen); if (len!=alen) { @@ -3342,7 +3367,7 @@ int RNA_function_call_direct_va(bContext *C, ReportList *reports, PointerRNA *pt type= RNA_property_type(parm); ftype= format[ofs++]; - len= RNA_property_array_length(parm); + len= RNA_property_array_length(&funcptr, parm); alen= rna_function_format_array_length(format, ofs, flen); if (len!=alen) { diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 3b0db949350..1f51b3ff34c 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -1028,6 +1028,26 @@ void RNA_def_property_array(PropertyRNA *prop, int arraylength) DefRNA.error= 1; break; } + + prop->arraydimension= 1; +} + +void RNA_def_property_multidimensional_array(PropertyRNA *prop, int arraylength, unsigned short dimension, unsigned short dimsize[]) +{ + StructRNA *srna= DefRNA.laststruct; + + if (dimension < 1 || dimension > RNA_MAX_ARRAY_DIMENSION) { + fprintf(stderr, "RNA_def_property_multidimensional_array: %s.%s, array dimension must be between 1 and %d.\n", srna->identifier, prop->identifier, RNA_MAX_ARRAY_DIMENSION); + DefRNA.error= 1; + return; + } + + RNA_def_property_array(prop, arraylength); + + prop->arraydimension= dimension; + + if (dimension > 1) + memcpy(prop->dimsize, dimsize, sizeof(dimsize[0]) * (dimension - 1)); } void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description) @@ -1688,6 +1708,23 @@ void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func) prop->update= (UpdateFunc)func; } +void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength, const char *setlength) +{ + if(!DefRNA.preprocess) { + fprintf(stderr, "RNA_def_property_*_funcs: only during preprocessing.\n"); + return; + } + + if (!(prop->flag & PROP_DYNAMIC)) { + fprintf(stderr, "RNA_def_property_dynamic_array_funcs: property is a not dynamic array.\n"); + DefRNA.error= 1; + return; + } + + if(getlength) prop->getlength= (PropArrayLengthGetFunc)getlength; + if(setlength) prop->setlength= (PropArrayLengthSetFunc)setlength; +} + void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set) { StructRNA *srna= DefRNA.laststruct; @@ -2085,14 +2122,15 @@ PropertyRNA *RNA_def_float_color(StructOrFunctionRNA *cont_, const char *identif } -PropertyRNA *RNA_def_float_matrix(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, +PropertyRNA *RNA_def_float_matrix(StructOrFunctionRNA *cont_, const char *identifier, int len, int rowsize, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax) { ContainerRNA *cont= cont_; PropertyRNA *prop; + unsigned short dimsize[1]= {rowsize}; prop= RNA_def_property(cont, identifier, PROP_FLOAT, PROP_MATRIX); - if(len != 0) RNA_def_property_array(prop, len); + if(len != 0) RNA_def_property_multidimensional_array(prop, len, 2, dimsize); if(default_value) RNA_def_property_float_array_default(prop, default_value); if(hardmin != hardmax) RNA_def_property_range(prop, hardmin, hardmax); RNA_def_property_ui_text(prop, ui_name, ui_description); @@ -2292,6 +2330,10 @@ int rna_parameter_size(PropertyRNA *parm) int len= parm->arraylength; if(len > 0) { + + if (parm->flag & PROP_DYNAMIC) + return sizeof(void *); + switch (ptype) { case PROP_BOOLEAN: case PROP_INT: diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index 12bd876ce52..d706fd5ac19 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -40,6 +40,7 @@ struct IDProperty; struct GHash; #define RNA_MAX_ARRAY 32 +#define RNA_MAX_ARRAY_DIMENSION 3 /* Function Callbacks */ @@ -49,6 +50,8 @@ typedef struct IDProperty* (*IDPropertiesFunc)(struct PointerRNA *ptr, int creat typedef struct StructRNA *(*StructRefineFunc)(struct PointerRNA *ptr); typedef char *(*StructPathFunc)(struct PointerRNA *ptr); +typedef int (*PropArrayLengthGetFunc)(struct PointerRNA *ptr); +typedef int (*PropArrayLengthSetFunc)(struct PointerRNA *ptr, int length); typedef int (*PropBooleanGetFunc)(struct PointerRNA *ptr); typedef void (*PropBooleanSetFunc)(struct PointerRNA *ptr, int value); typedef void (*PropBooleanArrayGetFunc)(struct PointerRNA *ptr, int *values); @@ -131,6 +134,14 @@ struct PropertyRNA { PropertySubType subtype; /* if an array this is > 0, specifying the length */ unsigned int arraylength; + /* these, if non-NULL, override arraylength */ + PropArrayLengthGetFunc getlength; + /* if NULL, length cannot be changed by a user */ + PropArrayLengthSetFunc setlength; + /* used only for dynamic arrays for now, default 1 */ + unsigned short arraydimension; + /* dimension sizes for dimensions greater than 1, first dimension size is not specified */ + unsigned short dimsize[RNA_MAX_ARRAY_DIMENSION - 1]; /* callback for updates on change */ UpdateFunc update; diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 84190d60d11..4d53986be4f 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -398,6 +398,51 @@ static void rna_MeshTextureFace_uv4_set(PointerRNA *ptr, const float *values) mtface->uv[3][1]= values[1]; } +static int rna_CustomDataData_numverts(PointerRNA *ptr, int type) +{ + Mesh *me= (Mesh*)ptr->id.data; + CustomData *fdata= rna_mesh_fdata(me); + CustomDataLayer *cdl; + int a; + size_t b; + + for(cdl=fdata->layers, a=0; atotlayer; cdl++, a++) { + if(cdl->type == type) { + b= ((char*)ptr->data - ((char*)cdl->data))/CustomData_sizeof(type); + if(b >= 0 && b < me->totface) + return (me->mface[b].v4? 4: 3); + } + } + + return 0; +} + +static int rna_MeshTextureFace_uv_get_length(PointerRNA *ptr) +{ + return rna_CustomDataData_numverts(ptr, CD_MTFACE) * 2; +} + +static int rna_MeshTextureFace_uv_set_length(PointerRNA *ptr, int length) +{ + return length == rna_MeshTextureFace_uv_get_length(ptr); +} + +static void rna_MeshTextureFace_uv_get(PointerRNA *ptr, float *values) +{ + MTFace *mtface= (MTFace*)ptr->data; + int totvert= rna_CustomDataData_numverts(ptr, CD_MTFACE); + + memcpy(values, mtface->uv, totvert * 2 * sizeof(float)); +} + +static void rna_MeshTextureFace_uv_set(PointerRNA *ptr, const float *values) +{ + MTFace *mtface= (MTFace*)ptr->data; + int totvert= rna_CustomDataData_numverts(ptr, CD_MTFACE); + + memcpy(mtface->uv, values, totvert * 2 * sizeof(float)); +} + static void rna_MeshTextureFaceLayer_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Mesh *me= (Mesh*)ptr->id.data; @@ -660,6 +705,40 @@ static void rna_TextureFace_image_set(PointerRNA *ptr, PointerRNA value) tf->tpage= (struct Image*)id; } +static int rna_MeshFace_verts_get_length(PointerRNA *ptr) +{ + MFace *face= (MFace*)ptr->data; + return face->v4 ? 4 : 3; +} + +static int rna_MeshFace_verts_set_length(PointerRNA *ptr, int length) +{ + MFace *face= (MFace*)ptr->data; + if (length == 3) { + face->v4= 0; + } + else if(length == 4) { + face->v4= 1; + } + else + return 0; + + return 1; +} + +static void rna_MeshFace_verts_get(PointerRNA *ptr, int *values) +{ + MFace *face= (MFace*)ptr->data; + int verts[4] = {face->v1, face->v2, face->v3, face->v4}; + memcpy(values, verts, (face->v4 ? 4 : 3) * sizeof(int)); +} + +static void rna_MeshFace_verts_set(PointerRNA *ptr, const int *values) +{ + MFace *face= (MFace*)ptr->data; + memcpy(&face->v1, values, (face->v4 ? 4 : 3) * sizeof(int)); +} + /* path construction */ static char *rna_VertexGroupElement_path(PointerRNA *ptr) @@ -882,11 +961,21 @@ static void rna_def_mface(BlenderRNA *brna) RNA_def_struct_path_func(srna, "rna_MeshFace_path"); RNA_def_struct_ui_icon(srna, ICON_FACESEL); + /* + // XXX allows creating invalid meshes prop= RNA_def_property(srna, "verts", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "v1"); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Vertices", "Vertex indices"); + */ + // XXX allows creating invalid meshes + prop= RNA_def_property(srna, "verts", PROP_INT, PROP_UNSIGNED); + RNA_def_property_array(prop, 4); + RNA_def_property_flag(prop, PROP_DYNAMIC); + RNA_def_property_dynamic_array_funcs(prop, "rna_MeshFace_verts_get_length", "rna_MeshFace_verts_set_length"); + RNA_def_property_int_funcs(prop, "rna_MeshFace_verts_get", "rna_MeshFace_verts_set", NULL); + RNA_def_property_ui_text(prop, "Vertices", "Vertex indices"); prop= RNA_def_property(srna, "material_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "mat_nr"); @@ -923,6 +1012,7 @@ static void rna_def_mtface(BlenderRNA *brna) {TF_ALPHA, "ALPHA", 0, "Alpha", "Render polygon transparent, depending on alpha channel of the texture"}, {TF_CLIP, "CLIPALPHA", 0, "Clip Alpha", "Use the images alpha values clipped with no blending (binary alpha)"}, {0, NULL, 0, NULL, NULL}}; + unsigned short uv_dim[1]= {2}; srna= RNA_def_struct(brna, "MeshTextureFaceLayer", NULL); RNA_def_struct_ui_text(srna, "Mesh Texture Face Layer", "Layer of texture faces in a Mesh datablock."); @@ -1041,6 +1131,13 @@ static void rna_def_mtface(BlenderRNA *brna) RNA_def_property_array(prop, 2); RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv4_get", "rna_MeshTextureFace_uv4_set", NULL); RNA_def_property_ui_text(prop, "UV 4", ""); + + prop= RNA_def_property(srna, "uv", PROP_FLOAT, PROP_XYZ); + RNA_def_property_multidimensional_array(prop, 4 * 2, 2, uv_dim); + RNA_def_property_flag(prop, PROP_DYNAMIC); + RNA_def_property_dynamic_array_funcs(prop, "rna_MeshTextureFace_uv_get_length", "rna_MeshTextureFace_uv_set_length"); + RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv_get", "rna_MeshTextureFace_uv_set", NULL); + RNA_def_property_ui_text(prop, "UV", ""); } static void rna_def_msticky(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index bad36025eda..f0b055bd0e8 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1029,6 +1029,8 @@ static void rna_def_object(BlenderRNA *brna) {OB_DUPLIGROUP, "GROUP", 0, "Group", "Enable group instancing."}, {0, NULL, 0, NULL, NULL}}; + unsigned short matrix_dimsize[]= {4}; + srna= RNA_def_struct(brna, "Object", "ID"); RNA_def_struct_ui_text(srna, "Object", "Object datablock defining an object in a scene.."); RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT); @@ -1190,7 +1192,7 @@ static void rna_def_object(BlenderRNA *brna) /* matrix */ prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX); RNA_def_property_float_sdna(prop, NULL, "obmat"); - RNA_def_property_array(prop, 16); + RNA_def_property_multidimensional_array(prop, 16, 2, matrix_dimsize); RNA_def_property_ui_text(prop, "Matrix", "Transformation matrix."); /* collections */ diff --git a/source/blender/python/intern/bpy_array.c b/source/blender/python/intern/bpy_array.c new file mode 100644 index 00000000000..d52bfda202d --- /dev/null +++ b/source/blender/python/intern/bpy_array.c @@ -0,0 +1,235 @@ +/** + * + * + * ***** 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. + * + * Contributor(s): Arystanbek Dyussenov + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include "Python.h" + +#include "bpy_rna.h" + +#include "RNA_access.h" + +#include "BLI_string.h" + +#include "MEM_guardedalloc.h" + +typedef void (*ItemConvertFunc)(PyObject *, char *); +typedef int (*ItemTypeCheckFunc)(PyObject *); +typedef void (*RNA_SetArrayFunc)(PointerRNA *, PropertyRNA *, const char *); + +/* Ensures that a python sequence has an expected number of items/sub-items and items are of expected type. */ +static int pyrna_validate_array(PyObject *seq, unsigned short dim, unsigned short totdim, unsigned short dim_size[], + ItemTypeCheckFunc check_item_type, const char *item_type_str, char *error_str, int error_str_size) +{ + int i; + if (dim < totdim) { + for (i= 0; i < PySequence_Length(seq); i++) { + PyObject *item; + int ok= 1; + item= PySequence_GetItem(seq, i); + + if (!PySequence_Check(item)) { + BLI_snprintf(error_str, error_str_size, "expected a %d-dimensional sequence of %s", (int)totdim, item_type_str); + ok= 0; + } + else if (PySequence_Length(item) != dim_size[dim - 1]) { + BLI_snprintf(error_str, error_str_size, "dimension %d should contain %d items", (int)dim, (int)dim_size[dim - 1]); + ok= 0; + } + + if (!pyrna_validate_array(item, dim + 1, totdim, dim_size, check_item_type, item_type_str, error_str, error_str_size)) { + ok= 0; + } + + Py_DECREF(item); + + if (!ok) + return 0; + } + } + else { + for (i= 0; i < PySequence_Length(seq); i++) { + PyObject *item= PySequence_GetItem(seq, i); + + if (!check_item_type(item)) { + Py_DECREF(item); + + BLI_snprintf(error_str, error_str_size, "sequence items should be of type %s", item_type_str); + return 0; + } + + Py_DECREF(item); + } + } + + return 1; +} + +/* Returns the number of items in a single- or multi-dimensional sequence. */ +static int pyrna_count_items(PyObject *seq) +{ + int totitem= 0; + + if (PySequence_Check(seq)) { + int i; + for (i= 0; i < PySequence_Length(seq); i++) { + PyObject *item= PySequence_GetItem(seq, i); + totitem += pyrna_count_items(item); + Py_DECREF(item); + } + } + else + totitem= 1; + + return totitem; +} + +static int pyrna_apply_array_length(PointerRNA *ptr, PropertyRNA *prop, int totitem, char *error_str, int error_str_size) +{ + if (RNA_property_flag(prop) & PROP_DYNAMIC) { + /* length can be flexible */ + if (RNA_property_array_length(ptr, prop) != totitem) { + if (!RNA_property_dynamic_array_set_length(ptr, prop, totitem)) { + BLI_snprintf(error_str, error_str_size, "%s.%s: array length cannot be changed to %d", RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), totitem); + return 0; + } + } + } + else { + /* length is a constraint */ + int len= RNA_property_array_length(ptr, prop); + if (totitem != len) { + BLI_snprintf(error_str, error_str_size, "sequence must have length of %d", len); + return 0; + } + } + return 1; +} + +static char *pyrna_py_to_array(PyObject *seq, unsigned short dim, unsigned short totdim, char *data, unsigned int item_size, ItemConvertFunc convert_item) +{ + unsigned int i; + for (i= 0; i < PySequence_Length(seq); i++) { + PyObject *item= PySequence_GetItem(seq, i); + + if (dim < totdim) { + data= pyrna_py_to_array(item, dim + 1, totdim, data, item_size, convert_item); + } + else { + convert_item(item, data); + data += item_size; + } + + Py_DECREF(item); + } + + return data; +} + +static int pyrna_py_to_array_generic(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, char *error_str, int error_str_size, + ItemTypeCheckFunc check_item_type, const char *item_type_str, int item_size, ItemConvertFunc convert_item, RNA_SetArrayFunc rna_set_array) +{ + unsigned short totdim, dim_size[100]; + int totitem; + char *data= NULL; + + totdim= RNA_property_array_dimension(prop, dim_size); + + if (!pyrna_validate_array(py, 1, totdim, dim_size, check_item_type, item_type_str, error_str, error_str_size)) + return 0; + + totitem= pyrna_count_items(py); + + if (!pyrna_apply_array_length(ptr, prop, totitem, error_str, error_str_size)) + return 0; + + if (totitem) { + if (!param_data || RNA_property_flag(prop) & PROP_DYNAMIC) + data= MEM_callocN(item_size * totitem, "pyrna primitive type array"); + else + data= param_data; + + pyrna_py_to_array(py, 1, totdim, data, item_size, convert_item); + + if (param_data) { + if (RNA_property_flag(prop) & PROP_DYNAMIC) { + /* not freeing allocated mem, RNA_parameter_list_free will do this */ + *(char**)param_data= data; + } + } + else { + /* NULL can only pass through in case RNA property arraylength is 0 (impossible?) */ + rna_set_array(ptr, prop, data); + MEM_freeN(data); + } + } + + return 1; +} + +static void pyrna_py_to_float(PyObject *py, char *data) +{ + *(float*)data= (float)PyFloat_AsDouble(py); +} + +static void pyrna_py_to_int(PyObject *py, char *data) +{ + *(int*)data= (int)PyLong_AsSsize_t(py); +} + +static void pyrna_py_to_boolean(PyObject *py, char *data) +{ + *(int*)data= (int)PyObject_IsTrue(py); +} + +static int py_float_check(PyObject *py) +{ + return PyFloat_Check(py); +} + +static int py_int_check(PyObject *py) +{ + return PyLong_Check(py); +} + +static int py_bool_check(PyObject *py) +{ + return PyBool_Check(py); +} + +int pyrna_py_to_float_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, char *error_str, int error_str_size) +{ + return pyrna_py_to_array_generic(py, ptr, prop, param_data, error_str, error_str_size, + py_float_check, "float", sizeof(float), pyrna_py_to_float, (RNA_SetArrayFunc)RNA_property_float_set_array); +} + +int pyrna_py_to_int_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, char *error_str, int error_str_size) +{ + return pyrna_py_to_array_generic(py, ptr, prop, param_data, error_str, error_str_size, + py_int_check, "int", sizeof(int), pyrna_py_to_int, (RNA_SetArrayFunc)RNA_property_int_set_array); +} + +int pyrna_py_to_boolean_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, char *error_str, int error_str_size) +{ + return pyrna_py_to_array_generic(py, ptr, prop, param_data, error_str, error_str_size, + py_bool_check, "boolean", sizeof(int), pyrna_py_to_boolean, (RNA_SetArrayFunc)RNA_property_boolean_set_array); +} diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 70ff8e48084..3902a9fd9b5 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -246,7 +246,7 @@ PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop) { PyObject *ret; int type = RNA_property_type(prop); - int len = RNA_property_array_length(prop); + int len = RNA_property_array_length(ptr, prop); if (len > 0) { /* resolve the array from a new pytype */ @@ -469,128 +469,43 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *v { /* XXX hard limits should be checked here */ int type = RNA_property_type(prop); - int len = RNA_property_array_length(prop); + int len = RNA_property_array_length(ptr, prop); if (len > 0) { - PyObject *item; - int py_len = -1; - int i; - + char error_str[512]; + int ok= 1; #ifdef USE_MATHUTILS if(MatrixObject_Check(value)) { MatrixObject *mat = (MatrixObject*)value; if(!BaseMath_ReadCallback(mat)) return -1; - - py_len = mat->rowSize * mat->colSize; } else /* continue... */ #endif - if (PySequence_Check(value)) { - py_len= (int)PySequence_Length(value); - } - else { + if (!PySequence_Check(value)) { PyErr_Format(PyExc_TypeError, "%.200s RNA array assignment expected a sequence instead of %.200s instance.", error_prefix, Py_TYPE(value)->tp_name); return -1; } /* done getting the length */ - if (py_len != len) { - PyErr_Format(PyExc_TypeError, "%.200s python sequence length %d did not match the RNA array length %d.", error_prefix, py_len, len); - return -1; - } - /* for arrays we have a limited number of types */ switch (type) { case PROP_BOOLEAN: - { - int *param_arr; - if(data) param_arr= (int*)data; - else param_arr= MEM_mallocN(sizeof(int) * len, "pyrna bool array"); - - - /* collect the variables before assigning, incase one of them is incorrect */ - for (i=0; icontigPtr, sizeof(float) * len); - } else /* continue... */ -#endif - { - /* collect the variables */ - for (i=0; iprop) == PROP_COLLECTION) { len = RNA_property_collection_length(&self->ptr, self->prop); } else { - len = RNA_property_array_length(self->prop); + len = RNA_property_array_length(&self->ptr, self->prop); if (len==0) { /* not an array*/ PyErr_SetString(PyExc_AttributeError, "len() only available for collection RNA types"); @@ -888,7 +803,7 @@ static PyObject *prop_subscript_collection_int(BPy_PropertyRNA * self, int keynu } static PyObject *prop_subscript_array_int(BPy_PropertyRNA * self, int keynum) { - int len= RNA_property_array_length(self->prop); + int len= RNA_property_array_length(&self->ptr, self->prop); if(keynum < 0) keynum += len; @@ -993,7 +908,7 @@ static PyObject *prop_subscript_array(BPy_PropertyRNA * self, PyObject *key) return prop_subscript_array_int(self, PyLong_AsSsize_t(key)); } else if (PySlice_Check(key)) { - int len= RNA_property_array_length(self->prop); + int len= RNA_property_array_length(&self->ptr, self->prop); Py_ssize_t start, stop, step, slicelength; if (PySlice_GetIndicesEx((PySliceObject*)key, len, &start, &stop, &step, &slicelength) < 0) @@ -1020,7 +935,7 @@ static PyObject *pyrna_prop_subscript( BPy_PropertyRNA * self, PyObject *key ) { if (RNA_property_type(self->prop) == PROP_COLLECTION) { return prop_subscript_collection(self, key); - } else if (RNA_property_array_length(self->prop)) { /* arrays are currently fixed length, zero length means its not an array */ + } else if (RNA_property_array_length(&self->ptr, self->prop)) { /* arrays are currently fixed length, zero length means its not an array */ return prop_subscript_array(self, key); } else { PyErr_SetString(PyExc_TypeError, "rna type is not an array or a collection"); @@ -1049,7 +964,7 @@ static int prop_subscript_ass_array_slice(BPy_PropertyRNA * self, int begin, int static int prop_subscript_ass_array_int(BPy_PropertyRNA * self, int keynum, PyObject *value) { - int len= RNA_property_array_length(self->prop); + int len= RNA_property_array_length(&self->ptr, self->prop); if(keynum < 0) keynum += len; @@ -1083,7 +998,7 @@ static int pyrna_prop_ass_subscript( BPy_PropertyRNA * self, PyObject *key, PyOb return prop_subscript_ass_array_int(self, i, value); } else if (PySlice_Check(key)) { - int len= RNA_property_array_length(self->prop); + int len= RNA_property_array_length(&self->ptr, self->prop); Py_ssize_t start, stop, step, slicelength; if (PySlice_GetIndicesEx((PySliceObject*)key, len, &start, &stop, &step, &slicelength) < 0) @@ -1496,7 +1411,7 @@ static void foreach_attr_type( BPy_PropertyRNA *self, char *attr, RNA_PROP_BEGIN(&self->ptr, itemptr, self->prop) { prop = RNA_struct_find_property(&itemptr, attr); *raw_type= RNA_property_raw_type(prop); - *attr_tot = RNA_property_array_length(prop); + *attr_tot = RNA_property_array_length(&itemptr, prop); *attr_signed= (RNA_property_subtype(prop)==PROP_UNSIGNED) ? FALSE:TRUE; break; } @@ -1535,7 +1450,7 @@ static int foreach_parse_args( if (RNA_property_type(self->prop) == PROP_COLLECTION) array_tot = RNA_property_collection_length(&self->ptr, self->prop); else - array_tot = RNA_property_array_length(self->prop); + array_tot = RNA_property_array_length(&self->ptr, self->prop); target_tot= array_tot * (*attr_tot); @@ -1728,7 +1643,7 @@ PyObject *pyrna_prop_iter(BPy_PropertyRNA *self) if (ret==NULL) { /* collection did not work, try array */ - int len = RNA_property_array_length(self->prop); + int len = RNA_property_array_length(&self->ptr, self->prop); if (len) { int i; @@ -1819,7 +1734,7 @@ PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *data) { PyObject *ret; int type = RNA_property_type(prop); - int len = RNA_property_array_length(prop); + int len = RNA_property_array_length(ptr, prop); int a; diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h index 1b8d69bc511..d65849ad8a4 100644 --- a/source/blender/python/intern/bpy_rna.h +++ b/source/blender/python/intern/bpy_rna.h @@ -91,4 +91,9 @@ PyObject *pyrna_basetype_unregister(PyObject *self, PyObject *args); void pyrna_alloc_types(void); void pyrna_free_types(void); +/* primitive type conversion */ +int pyrna_py_to_boolean_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, char *error_str, int error_str_size); +int pyrna_py_to_int_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, char *error_str, int error_str_size); +int pyrna_py_to_float_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, char *error_str, int error_str_size); + #endif From 0ff90bb2586e9e50e962106b6bcafa97484c31ca Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Tue, 25 Aug 2009 17:32:01 +0000 Subject: [PATCH 263/577] blender 2.5 MSVC projectfiles * update for bpy_array.c --- projectfiles_vc9/blender/BPY_python/BPY_python.vcproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj b/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj index d0872a43403..7f1eff21e6f 100644 --- a/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj +++ b/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj @@ -334,6 +334,10 @@ + + From 1d1e8595f23579e940ca403023305f2499c39a54 Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Tue, 25 Aug 2009 18:41:36 +0000 Subject: [PATCH 264/577] Pointcache: *introducing unique ID's following brechts hint from ML Enhancements resulting from this: * multiple caches per modifier stack position --- source/blender/blenkernel/BKE_object.h | 5 ++ source/blender/blenkernel/intern/object.c | 65 ++++++++++++++++++- source/blender/blenkernel/intern/pointcache.c | 25 ++++--- source/blender/blenloader/intern/readfile.c | 1 + .../blender/editors/space_view3d/drawvolume.c | 3 +- source/blender/gpu/intern/gpu_extensions.c | 3 +- source/blender/makesdna/DNA_object_types.h | 1 + 7 files changed, 84 insertions(+), 19 deletions(-) diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index a57529ccf75..68173a1b5c4 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -115,6 +115,11 @@ void object_handle_update(struct Scene *scene, struct Object *ob); float give_timeoffset(struct Object *ob); int give_obdata_texspace(struct Object *ob, int **texflag, float **loc, float **size, float **rot); + +int object_insert_pc(struct Object *ob); +// void object_delete_pc(struct Object *ob, int index); + + #ifdef __cplusplus } #endif diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 0e45aedc3ed..8f5ff988745 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -307,6 +307,8 @@ void free_object(Object *ob) if(ob->gpulamp.first) GPU_lamp_free(ob); free_sculptsession(&ob->sculpt); + + if(ob->pc_ids.first) BLI_freelistN(&ob->pc_ids); } static void unlink_object__unlinkModifierLinks(void *userData, Object *ob, Object **obpoin) @@ -1016,6 +1018,8 @@ Object *add_only_object(int type, char *name) ob->fluidsimFlag = 0; ob->fluidsimSettings = NULL; + ob->pc_ids.first = ob->pc_ids.last = NULL; + return ob; } @@ -1268,7 +1272,8 @@ Object *copy_object(Object *ob) obn->derivedFinal = NULL; obn->gpulamp.first = obn->gpulamp.last = NULL; - + obn->pc_ids.first = obn->pc_ids.last = NULL; + return obn; } @@ -2535,3 +2540,61 @@ int ray_hit_boundbox(struct BoundBox *bb, float ray_start[3], float ray_normal[3 return result; } + +static int pc_cmp(void *a, void *b) +{ + LinkData *ad = a, *bd = b; + if((int)ad->data > (int)bd->data) + return 1; + else return 0; +} + +int object_insert_pc(Object *ob) +{ + LinkData *link = NULL; + int i = 0; + + BLI_sortlist(&ob->pc_ids, pc_cmp); + + for(link=ob->pc_ids.first, i = 0; link; link=link->next, i++) + { + int index =(int)link->data; + + if(i < index) + break; + } + + link = MEM_callocN(sizeof(LinkData), "PCLink"); + link->data = (void *)i; + BLI_addtail(&ob->pc_ids, link); + + return i; +} + +static int pc_findindex(ListBase *listbase, int index) +{ + LinkData *link= NULL; + int number= 0; + + if (listbase == NULL) return -1; + + link= listbase->first; + while (link) { + if ((int)link->data == index) + return number; + + number++; + link= link->next; + } + + return -1; +} + +#if 0 +void object_delete_pc(Object *ob, int index) +{ + int list_index = pc_findindex(&ob->pc_ids, index); + LinkData *link = BLI_findlink(&ob->pc_ids, list_index); + BLI_freelinkN(&ob->pc_ids, link); +} +#endif \ No newline at end of file diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index ca27bde039b..75b49817812 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -391,8 +391,6 @@ static int ptcache_totpoint_cloth(void *cloth_v) void BKE_ptcache_id_from_softbody(PTCacheID *pid, Object *ob, SoftBody *sb) { ParticleSystemModifierData *psmd; - ModifierData *md; - int a; memset(pid, 0, sizeof(PTCacheID)); @@ -418,16 +416,10 @@ void BKE_ptcache_id_from_softbody(PTCacheID *pid, Object *ob, SoftBody *sb) if(sb->particles) { psmd= psys_get_modifier(ob, sb->particles); - pid->stack_index= modifiers_indexInObject(ob, (ModifierData*)psmd); - } - else { - for(a=0, md=ob->modifiers.first; md; md=md->next, a++) { - if(md->type == eModifierType_Softbody) { - pid->stack_index = a; - break; - } - } + // pid->stack_index= modifiers_indexInObject(ob, (ModifierData*)psmd); XXX TODO - get other index DG } + else + pid->stack_index = pid->cache->index; } void BKE_ptcache_id_from_particles(PTCacheID *pid, Object *ob, ParticleSystem *psys) @@ -439,7 +431,7 @@ void BKE_ptcache_id_from_particles(PTCacheID *pid, Object *ob, ParticleSystem *p pid->ob= ob; pid->calldata= psys; pid->type= PTCACHE_TYPE_PARTICLES; - pid->stack_index= modifiers_indexInObject(ob, (ModifierData *)psmd); + pid->stack_index= psys->pointcache->index; pid->cache= psys->pointcache; pid->cache_ptr= &psys->pointcache; pid->ptcaches= &psys->ptcaches; @@ -728,7 +720,7 @@ void BKE_ptcache_id_from_smoke(PTCacheID *pid, struct Object *ob, struct SmokeMo pid->calldata= smd; pid->type= PTCACHE_TYPE_SMOKE_DOMAIN; - pid->stack_index= modifiers_indexInObject(ob, (ModifierData *)smd); + pid->stack_index= sds->point_cache->index; pid->cache= sds->point_cache; pid->cache_ptr= &sds->point_cache; @@ -758,7 +750,7 @@ void BKE_ptcache_id_from_cloth(PTCacheID *pid, Object *ob, ClothModifierData *cl pid->ob= ob; pid->calldata= clmd; pid->type= PTCACHE_TYPE_CLOTH; - pid->stack_index= modifiers_indexInObject(ob, (ModifierData *)clmd); + pid->stack_index= clmd->point_cache->index; pid->cache= clmd->point_cache; pid->cache_ptr= &clmd->point_cache; pid->ptcaches= &clmd->ptcaches; @@ -901,6 +893,10 @@ static int BKE_ptcache_id_filename(PTCacheID *pid, char *filename, int cfra, sho } if (do_ext) { + + if(pid->cache->index < 0) + pid->cache->index = pid->stack_index = object_insert_pc(pid->ob); + if(pid->cache->flag & PTCACHE_EXTERNAL) { if(pid->cache->index >= 0) snprintf(newname, MAX_PTCACHE_FILE, "_%06d_%02d"PTCACHE_EXT, cfra, pid->stack_index); /* always 6 chars */ @@ -1952,6 +1948,7 @@ PointCache *BKE_ptcache_add(ListBase *ptcaches) cache->startframe= 1; cache->endframe= 250; cache->step= 10; + cache->index = -1; BLI_addtail(ptcaches, cache); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 920e202520e..26e3d5bf6f1 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3993,6 +3993,7 @@ static void direct_link_object(FileData *fd, Object *ob) ob->derivedDeform= NULL; ob->derivedFinal= NULL; ob->gpulamp.first= ob->gpulamp.last= NULL; + link_list(fd, &ob->pc_ids); if(ob->sculpt) ob->sculpt= MEM_callocN(sizeof(SculptSession), "reload sculpt session"); diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c index 5e0ffb9ba48..f4242c70139 100644 --- a/source/blender/editors/space_view3d/drawvolume.c +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -236,8 +236,7 @@ void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture GPU_texture_bind(tex, 0); - if (!GLEW_ARB_texture_non_power_of_two) - { + if (!GLEW_ARB_texture_non_power_of_two) { cor[0] = (float)res[0]/(float)larger_pow2(res[0]); cor[1] = (float)res[1]/(float)larger_pow2(res[1]); cor[2] = (float)res[2]/(float)larger_pow2(res[2]); diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index 36936a9fcb0..850b46dc28c 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -337,8 +337,7 @@ GPUTexture *GPU_texture_create_3D(int w, int h, int depth, float *fpixels) return NULL; } - if (!GLEW_ARB_texture_non_power_of_two) - { + if (!GLEW_ARB_texture_non_power_of_two) { tex->w = larger_pow2(tex->w); tex->h = larger_pow2(tex->h); tex->depth = larger_pow2(tex->depth); diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index be43ae7f99d..25fdf615adb 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -237,6 +237,7 @@ typedef struct Object { int pad2; ListBase gpulamp; /* runtime, for lamps only */ + ListBase pc_ids; } Object; /* Warning, this is not used anymore because hooks are now modifiers */ From e2d91a5e5f61cf6ff1398c742ada7fd806299767 Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Tue, 25 Aug 2009 18:53:20 +0000 Subject: [PATCH 265/577] Pointcache: * change function names --- source/blender/blenkernel/BKE_object.h | 4 ++-- source/blender/blenkernel/intern/object.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h index 68173a1b5c4..1cb6efeb838 100644 --- a/source/blender/blenkernel/BKE_object.h +++ b/source/blender/blenkernel/BKE_object.h @@ -116,8 +116,8 @@ void object_handle_update(struct Scene *scene, struct Object *ob); float give_timeoffset(struct Object *ob); int give_obdata_texspace(struct Object *ob, int **texflag, float **loc, float **size, float **rot); -int object_insert_pc(struct Object *ob); -// void object_delete_pc(struct Object *ob, int index); +int object_insert_ptcache(struct Object *ob); +// void object_delete_ptcache(struct Object *ob, int index); #ifdef __cplusplus diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 8f5ff988745..32f70bc690c 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -2549,7 +2549,7 @@ static int pc_cmp(void *a, void *b) else return 0; } -int object_insert_pc(Object *ob) +int object_insert_ptcache(Object *ob) { LinkData *link = NULL; int i = 0; @@ -2591,7 +2591,7 @@ static int pc_findindex(ListBase *listbase, int index) } #if 0 -void object_delete_pc(Object *ob, int index) +void object_delete_ptcache(Object *ob, int index) { int list_index = pc_findindex(&ob->pc_ids, index); LinkData *link = BLI_findlink(&ob->pc_ids, list_index); From 0e9f7757b9f1988d3c1ffa86dd48956341e86e9b Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Tue, 25 Aug 2009 19:58:42 +0000 Subject: [PATCH 266/577] Pointcache: *forgot 1 rename --- source/blender/blenkernel/intern/pointcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 75b49817812..4110570760f 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -895,7 +895,7 @@ static int BKE_ptcache_id_filename(PTCacheID *pid, char *filename, int cfra, sho if (do_ext) { if(pid->cache->index < 0) - pid->cache->index = pid->stack_index = object_insert_pc(pid->ob); + pid->cache->index = pid->stack_index = object_insert_ptcache(pid->ob); if(pid->cache->flag & PTCACHE_EXTERNAL) { if(pid->cache->index >= 0) From 37144b81784356be71e254148de3ed20db34cf06 Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Tue, 25 Aug 2009 20:22:40 +0000 Subject: [PATCH 267/577] Smoke: * reset cache when changing heat or gravity --- source/blender/makesrna/intern/rna_smoke.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c index a119eefa62c..70a5ddf72dd 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -46,6 +46,7 @@ #include "BKE_context.h" #include "BKE_depsgraph.h" #include "BKE_particle.h" +#include "BKE_pointcache.h" #include "ED_object.h" @@ -60,6 +61,21 @@ static void rna_Smoke_dependency_update(bContext *C, PointerRNA *ptr) DAG_scene_sort(CTX_data_scene(C)); } +static void rna_Smoke_reset_cache(bContext *C, PointerRNA *ptr) +{ + SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data; + PointCache *cache = settings->point_cache; + + printf("rna_Smoke_reset_cache\n"); + + cache->flag &= ~PTCACHE_SIMULATION_VALID; + cache->flag |= PTCACHE_OUTDATED; + cache->simframe= 0; + cache->last_exact= 0; + + rna_Smoke_update(C, ptr); +} + static void rna_Smoke_reset(bContext *C, PointerRNA *ptr) { SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data; @@ -150,14 +166,14 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) RNA_def_property_range(prop, -5.0, 5.0); RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5); RNA_def_property_ui_text(prop, "Gravity", "Higher value results in sinking smoke"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_cache"); prop= RNA_def_property(srna, "beta", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "beta"); RNA_def_property_range(prop, -5.0, 5.0); RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5); RNA_def_property_ui_text(prop, "Heat", "Higher value results in faster rising smoke."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_cache"); prop= RNA_def_property(srna, "coll_group", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "coll_group"); From 91cd6fe2c4ff44f721e4ef1b3aa8f48a2ddb8501 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Tue, 25 Aug 2009 20:42:21 +0000 Subject: [PATCH 268/577] libsndfile is not available yet for darwin, builders feel free to add the lib! --- config/darwin-config.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/darwin-config.py b/config/darwin-config.py index ba1d12542d0..92f70d716fc 100644 --- a/config/darwin-config.py +++ b/config/darwin-config.py @@ -112,6 +112,12 @@ BF_JACK_INC = '${BF_JACK}/include/jack' BF_JACK_LIB = 'jack' BF_JACK_LIBPATH = '${BF_JACK}/lib' +WITH_BF_SNDFILE = False +BF_SNDFILE = LIBDIR + '/sndfile' +BF_SNDFILE_INC = '${BF_SNDFILE}/include' +BF_SNDFILE_LIB = 'sndfile' +BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib' + WITH_BF_SDL = True BF_SDL = LIBDIR + '/sdl' #$(shell sdl-config --prefix) BF_SDL_INC = '${BF_SDL}/include' #$(shell $(BF_SDL)/bin/sdl-config --cflags) From cfcd355c27ba1f923d04dec1f735989b260b190c Mon Sep 17 00:00:00 2001 From: Diego Borghetti Date: Tue, 25 Aug 2009 21:25:41 +0000 Subject: [PATCH 269/577] Update Makefile and missing include on voxeldata.c Note that With libsndfile also need libflac and libogg here (Linux), right now I just add this two librarys to the NAN_SNDFILELIBS, but maybe it's better split this ? (NAN_FLAC/NAN_OGG) --- intern/audaspace/intern/Makefile | 3 ++- source/blender/render/intern/source/Makefile | 1 + source/blender/render/intern/source/voxeldata.c | 1 + source/nan_definitions.mk | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/intern/audaspace/intern/Makefile b/intern/audaspace/intern/Makefile index a99f44c54d7..4bdca04c1cb 100644 --- a/intern/audaspace/intern/Makefile +++ b/intern/audaspace/intern/Makefile @@ -47,7 +47,7 @@ endif ifeq ($(WITH_JACK),true) CPPFLAGS += -DWITH_JACK - CPPFLAGS += -I$(NAN_JACKCFLAGS) + CPPFLAGS += $(NAN_JACKCFLAGS) CPPFLAGS += -I../jack endif @@ -58,6 +58,7 @@ endif ifeq ($(WITH_SNDFILE),true) CPPFLAGS += -DWITH_SNDFILE + CPPFLAGS += -I../sndfile endif CPPFLAGS += -I$(LCGDIR)/samplerate/include/ diff --git a/source/blender/render/intern/source/Makefile b/source/blender/render/intern/source/Makefile index 5d4a224002e..c313549f9b9 100644 --- a/source/blender/render/intern/source/Makefile +++ b/source/blender/render/intern/source/Makefile @@ -50,6 +50,7 @@ CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include # not very neat: the rest of blender.. CPPFLAGS += -I../../../editors/include CPPFLAGS += $(NAN_SDLCFLAGS) +CPPFLAGS += -I../../../../../intern/smoke/extern ifeq ($(WITH_QUICKTIME), true) CPPFLAGS += -DWITH_QUICKTIME diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c index ff076579788..f1f01f873a5 100644 --- a/source/blender/render/intern/source/voxeldata.c +++ b/source/blender/render/intern/source/voxeldata.c @@ -42,6 +42,7 @@ #include "BKE_global.h" #include "BKE_image.h" #include "BKE_main.h" +#include "BKE_modifier.h" #include "smoke_API.h" diff --git a/source/nan_definitions.mk b/source/nan_definitions.mk index 50a606496f5..f8afc7f3fa6 100644 --- a/source/nan_definitions.mk +++ b/source/nan_definitions.mk @@ -134,7 +134,7 @@ ifndef CONFIG_GUESS ifeq ($(WITH_SNDFILE),true) export NAN_SNDFILE ?= /usr export NAN_SNDFILECFLAGS ?= -I$(NAN_SNDFILE)/include - export NAN_SNDFILELIBS ?= $(NAN_SNDFILE)/lib/libsndfile.a + export NAN_SNDFILELIBS ?= $(NAN_SNDFILE)/lib/libsndfile.a $(NAN_SNDFILE)/lib/libFLAC.a $(NAN_SNDFILE)/lib/libogg.a endif ifeq ($(NAN_USE_FFMPEG_CONFIG), true) From 6a5773d4a8633374a1f54864c077a0cd5fa122ea Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Tue, 25 Aug 2009 21:53:52 +0000 Subject: [PATCH 270/577] Smoke: * Deleting high res modifier again * fixing smoke + continue physics drawing * fixing cache reset when changing dissolve --- release/ui/buttons_physics_smoke.py | 8 +- source/blender/blenkernel/BKE_smoke.h | 4 - source/blender/blenkernel/intern/modifier.c | 56 ------- source/blender/blenkernel/intern/pointcache.c | 17 --- source/blender/blenkernel/intern/smoke.c | 47 +++++- .../blender/blenkernel/intern/smokehighres.c | 137 ------------------ .../blender/editors/object/object_modifier.c | 7 - .../editors/space_buttons/buttons_context.c | 10 -- .../blender/editors/space_view3d/drawobject.c | 7 +- source/blender/makesdna/DNA_modifier_types.h | 29 ---- source/blender/makesdna/DNA_smoke_types.h | 17 ++- source/blender/makesrna/RNA_access.h | 1 - source/blender/makesrna/intern/rna_modifier.c | 62 -------- source/blender/makesrna/intern/rna_smoke.c | 82 ++++++----- 14 files changed, 110 insertions(+), 374 deletions(-) delete mode 100644 source/blender/blenkernel/intern/smokehighres.c diff --git a/release/ui/buttons_physics_smoke.py b/release/ui/buttons_physics_smoke.py index 5e1ec227080..3cfba0f9df9 100644 --- a/release/ui/buttons_physics_smoke.py +++ b/release/ui/buttons_physics_smoke.py @@ -125,7 +125,7 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel): def poll(self, context): md = context.smoke if md: - return (md.smoke_type == 'TYPE_DOMAIN') + return (md.smoke_type == 'TYPE_DOMAIN') return False @@ -202,7 +202,7 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel): def draw(self, context): layout = self.layout - md = context.smoke_hr + md = context.smoke.domain_settings if md: @@ -223,12 +223,12 @@ class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel): __default_closed__ = True def poll(self, context): - return (context.smoke_hr != None) + return (context.smoke != None) def draw(self, context): layout = self.layout - md = context.smoke_hr + md = context.smoke if md: diff --git a/source/blender/blenkernel/BKE_smoke.h b/source/blender/blenkernel/BKE_smoke.h index bd8581112f8..fddcf0fea83 100644 --- a/source/blender/blenkernel/BKE_smoke.h +++ b/source/blender/blenkernel/BKE_smoke.h @@ -40,9 +40,5 @@ void smokeModifier_free (struct SmokeModifierData *smd); void smokeModifier_reset(struct SmokeModifierData *smd); void smokeModifier_createType(struct SmokeModifierData *smd); -// high res modifier -void smokeHRModifier_do(struct SmokeHRModifierData *shrmd, struct Scene *scene, struct Object *ob, int useRenderParams, int isFinalCalc); -void smokeHRModifier_free(struct SmokeHRModifierData *shrmd); - #endif /* BKE_SMOKE_H_ */ diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index c78227a363f..7a0eb882083 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -5879,50 +5879,6 @@ static void smokeModifier_updateDepgraph( */ } - -/* Smoke High Resolution */ - -static void smokeHRModifier_initData(ModifierData *md) -{ - SmokeHRModifierData *shrmd = (SmokeHRModifierData*) md; - - shrmd->wt = NULL; - shrmd->time = -1; - shrmd->strength = 2.0f; - shrmd->amplify = 1; - shrmd->noise = MOD_SMOKE_NOISEWAVE; - shrmd->point_cache = BKE_ptcache_add(&shrmd->ptcaches); - shrmd->point_cache->flag |= PTCACHE_DISK_CACHE; - shrmd->point_cache->step = 1; -} - -static void smokeHRModifier_freeData(ModifierData *md) -{ - SmokeHRModifierData *shrmd = (SmokeHRModifierData*) md; - - smokeHRModifier_free (shrmd); -} - -static void smokeHRModifier_deformVerts( - ModifierData *md, Object *ob, DerivedMesh *derivedData, - float (*vertexCos)[3], int numVerts, int useRenderParams, int isFinalCalc) -{ - SmokeHRModifierData *shrmd = (SmokeHRModifierData*) md; - smokeHRModifier_do(shrmd, md->scene, ob, useRenderParams, isFinalCalc); -} - -static int smokeHRModifier_dependsOnTime(ModifierData *md) -{ - return 1; -} - -static void smokeHRModifier_updateDepgraph( - ModifierData *md, DagForest *forest, Scene *scene, Object *ob, - DagNode *obNode) -{ - ; -} - /* Cloth */ static void clothModifier_initData(ModifierData *md) @@ -8624,18 +8580,6 @@ ModifierTypeInfo *modifierType_getInfo(ModifierType type) mti->deformVerts = smokeModifier_deformVerts; mti->dependsOnTime = smokeModifier_dependsOnTime; mti->updateDepgraph = smokeModifier_updateDepgraph; - - mti = INIT_TYPE(SmokeHR); - mti->type = eModifierTypeType_OnlyDeform; - mti->initData = smokeHRModifier_initData; - mti->freeData = smokeHRModifier_freeData; - mti->flags = eModifierTypeFlag_AcceptsMesh - | eModifierTypeFlag_UsesPointCache - | eModifierTypeFlag_Single - | eModifierTypeFlag_NoUserAdd; - mti->deformVerts = smokeHRModifier_deformVerts; - mti->dependsOnTime = smokeHRModifier_dependsOnTime; - mti->updateDepgraph = smokeHRModifier_updateDepgraph; mti = INIT_TYPE(Cloth); mti->type = eModifierTypeType_Nonconstructive; diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 4110570760f..d9740091912 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -479,23 +479,6 @@ static int ptcache_totpoint_smoke(void *smoke_v) return 0; } -static int ptcache_totpoint_smoke_turbulence(void *smoke_v) -{ - SmokeHRModifierData *shrmd= (SmokeHRModifierData *)smoke_v; - - if(shrmd->wt) { - /* - unsigned int res[3]; - - smoke_turbulence_get_res(sds->wt, res); - return res[0]*res[1]*res[2]; - */ - return 0; - } - else - return 0; -} - // forward decleration static int ptcache_file_write(PTCacheFile *pf, void *f, size_t tot, int size); diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 7af67364bc5..28d1c264376 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -213,6 +213,14 @@ int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, Derive smd->time = scene->r.cfra; smd->domain->firstframe = smd->time; + /* + if(!smd->domain->wt) + { + smd->domain->wt = smoke_turbulence_init(sds->res, smd->domain->amplify + 1, smd->domain->noise); + smoke_turbulence_initBlenderRNA(smd->domain->wt, &smd->domain->strength); + } + */ + if(!smd->domain->view3d) { // TVox is for transparency @@ -518,6 +526,9 @@ void smokeModifier_freeDomain(SmokeModifierData *smd) if(smd->domain->fluid) smoke_free(smd->domain->fluid); + if(smd->domain->wt) + smoke_turbulence_free(smd->domain->wt); + BKE_ptcache_free_list(&smd->domain->ptcaches); smd->domain->point_cache = NULL; @@ -585,6 +596,12 @@ void smokeModifier_reset(struct SmokeModifierData *smd) smoke_free(smd->domain->fluid); smd->domain->fluid = NULL; } + + if(smd->domain->wt) + { + smoke_turbulence_free(smd->domain->wt); + smd->domain->wt = NULL; + } smd->domain->point_cache->flag &= ~PTCACHE_SIMULATION_VALID; smd->domain->point_cache->flag |= PTCACHE_OUTDATED; @@ -663,6 +680,10 @@ void smokeModifier_createType(struct SmokeModifierData *smd) smd->domain->beta = 0.1; smd->domain->flags = MOD_SMOKE_DISSOLVE_LOG; smd->domain->diss_speed = 5; + smd->domain->strength = 2.0f; + smd->domain->amplify = 1; + smd->domain->noise = MOD_SMOKE_NOISEWAVE; + smd->domain->wt = NULL; // init 3dview buffer smd->domain->view3d = NULL; @@ -783,6 +804,28 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM smoke_simulate_domain(smd, scene, ob, dm); + { + // float light[3] = {0.0,0.0,0.0}; // TODO: take real LAMP coordinates - dg + Base *base_tmp = NULL; + + for(base_tmp = scene->base.first; base_tmp; base_tmp= base_tmp->next) + { + if(base_tmp->object->type == OB_LAMP) + { + Lamp *la = (Lamp *)base_tmp->object->data; + + if(la->type == LA_LOCAL) + { + VECCOPY(light, base_tmp->object->obmat[3]); + have_lamp = 1; + break; + } + } + } + } + + smoke_prepare_View(smd, (float)framenr, light, have_lamp); + return; } @@ -885,11 +928,11 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM BKE_ptcache_write_cache(&pid, framenr); - // printf("Writing cache_low\n"); + // printf("Writing cache_low, %d\n", framenr); tend(); - printf ( "Frame: %d, Time: %f\n", (int)smd->time, ( float ) tval() ); + // printf ( "Frame: %d, Time: %f\n", (int)smd->time, ( float ) tval() ); } } diff --git a/source/blender/blenkernel/intern/smokehighres.c b/source/blender/blenkernel/intern/smokehighres.c deleted file mode 100644 index 6a2e0549158..00000000000 --- a/source/blender/blenkernel/intern/smokehighres.c +++ /dev/null @@ -1,137 +0,0 @@ -/** - * smokehighres.c - * - * $Id$ - * - * ***** 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) Blender Foundation. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): Daniel Genrich - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/* Part of the code copied from elbeem fluid library, copyright by Nils Thuerey */ - -#include "DNA_scene_types.h" -#include "DNA_listBase.h" -#include "DNA_modifier_types.h" -#include "DNA_object_types.h" -#include "DNA_smoke_types.h" - -#include "BKE_modifier.h" -#include "BKE_smoke.h" -#include "BKE_pointcache.h" - -#include "smoke_API.h" - -// we need different handling for the high-res feature -/* -if(bigdensity) -{ - // init all surrounding cells according to amplification, too - int i, j, k; - - smoke_turbulence_get_res(smd->domain->wt, bigres); - - for(i = 0; i < smd->domain->amplify + 1; i++) - for(j = 0; j < smd->domain->amplify + 1; j++) - for(k = 0; k < smd->domain->amplify + 1; k++) - { - index = smoke_get_index((smd->domain->amplify + 1)* cell[0] + i, bigres[0], (smd->domain->amplify + 1)* cell[1] + j, bigres[1], (smd->domain->amplify + 1)* cell[2] + k); - bigdensity[index] = sfs->density; - } -} -*/ - -static void smokeHRinit(SmokeHRModifierData *shrmd, SmokeDomainSettings *sds) -{ - if(!shrmd->wt) - { - shrmd->wt = smoke_turbulence_init(sds->res, shrmd->amplify + 1, shrmd->noise); - smoke_turbulence_initBlenderRNA(shrmd->wt, &shrmd->strength); - } -} - -void smokeHRModifier_free(SmokeHRModifierData *shrmd) -{ - if(shrmd->wt) - smoke_turbulence_free(shrmd->wt); - - BKE_ptcache_free_list(&shrmd->ptcaches); - shrmd->point_cache = NULL; -} - -void smokeHRModifier_do(SmokeHRModifierData *shrmd, Scene *scene, Object *ob, int useRenderParams, int isFinalCalc) -{ - ModifierData *md = NULL; - SmokeModifierData *smd = NULL; - SmokeDomainSettings *sds = NULL; - - // find underlaying smoke domain - smd = (SmokeModifierData *)modifiers_findByType(ob, eModifierType_Smoke); - if(!(smd && smd->type == MOD_SMOKE_TYPE_DOMAIN)) - return; - - sds = smd->domain; - - smokeHRinit(shrmd, sds); - - // smoke_turbulence_dissolve(shrmd->wt, sds->diss_speed, sds->flags & MOD_SMOKE_DISSOLVE_LOG); - - // smoke_turbulence_step(shrmd->wt, sds->fluid); -} - - -// update necessary information for 3dview ("high res" option) -void smoke_prepare_bigView(SmokeHRModifierData *shrmd, float *light) -{ - float *density = NULL; - size_t i = 0; - int bigres[3]; -/* - smoke_turbulence_get_res(shrmd->wt, bigres); - - if(!smd->domain->traybig) - { - // TRay is for self shadowing - smd->domain->traybig = MEM_callocN(sizeof(float)*bigres[0]*bigres[1]*bigres[2], "Smoke_tRayBig"); - } - if(!smd->domain->tvoxbig) - { - // TVox is for tranaparency - smd->domain->tvoxbig = MEM_callocN(sizeof(float)*bigres[0]*bigres[1]*bigres[2], "Smoke_tVoxBig"); - } - - density = smoke_turbulence_get_density(smd->domain->wt); - for (i = 0; i < bigres[0] * bigres[1] * bigres[2]; i++) - { - // Transparency computation - // formula taken from "Visual Simulation of Smoke" / Fedkiw et al. pg. 4 - // T_vox = exp(-C_ext * h) - // C_ext/sigma_t = density * C_ext - smoke_set_bigtvox(smd, i, exp(-density[i] * 7.0 * smd->domain->dx / (smd->domain->amplify + 1)) ); - } - smoke_calc_transparency(smd, light, 1); - */ -} - - diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index ec46cea8e84..0b8fedd2eda 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -164,13 +164,6 @@ int ED_object_modifier_remove(ReportList *reports, Scene *scene, Object *ob, Mod DAG_scene_sort(scene); } - else if(md->type == eModifierType_Smoke) { - ModifierData *tmd = modifiers_findByType(ob, eModifierType_SmokeHR); - if(tmd) { - BLI_remlink(&ob->modifiers, tmd); - modifier_free(tmd); - } - } BLI_remlink(&ob->modifiers, md); modifier_free(md); diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 994bb0010d8..8306487013a 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -697,16 +697,6 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r return 1; } } - else if(CTX_data_equals(member, "smoke_hr")) { - PointerRNA *ptr= get_pointer_type(path, &RNA_Object); - - if(ptr && ptr->data) { - Object *ob= ptr->data; - ModifierData *md= modifiers_findByType(ob, eModifierType_SmokeHR); - CTX_data_pointer_set(result, &ob->id, &RNA_SmokeHRModifier, md); - return 1; - } - } else if(CTX_data_equals(member, "collision")) { PointerRNA *ptr= get_pointer_type(path, &RNA_Object); diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 9fc9bf94cd7..bcb962bdcd7 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -5312,12 +5312,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) } /* draw code for smoke */ - if(((SmokeHRModifierData *)(md = modifiers_findByType(ob, eModifierType_SmokeHR)) && (((SmokeHRModifierData *)md)->flags & MOD_SMOKE_SHOWHIGHRES))) { - // GPU_create_smoke(smd); - // draw_volume(scene, ar, v3d, base, smd->domain->tex, smd->domain->res); - // GPU_free_smoke(smd); - } - else { + { md = modifiers_findByType(ob, eModifierType_Smoke); if (md) { SmokeModifierData *smd = (SmokeModifierData *)md; diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index a4587c34e89..be7452c4ae1 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -42,7 +42,6 @@ typedef enum ModifierType { eModifierType_Multires, eModifierType_Surface, eModifierType_Smoke, - eModifierType_SmokeHR, NUM_MODIFIER_TYPES } ModifierType; @@ -255,34 +254,6 @@ typedef struct SmokeModifierData { int type; /* domain, inflow, outflow, ... */ } SmokeModifierData; - -/* noise */ -#define MOD_SMOKE_NOISEWAVE (1<<0) -#define MOD_SMOKE_NOISEFFT (1<<1) -#define MOD_SMOKE_NOISECURL (1<<2) - -/* flags */ -#define MOD_SMOKE_SHOWHIGHRES (1<<0) /* show high resolution */ - -typedef struct SmokeHRModifierData { - ModifierData modifier; - - struct WTURBULENCE *wt; // WTURBULENCE object, if active - struct PointCache *point_cache; /* definition is in DNA_object_force.h */ - struct ListBase ptcaches; - struct GPUTexture *tex; - float *view3d; /* voxel data for display */ - unsigned int v3dnum; /* number of frame in view3d buffer */ - float time; - float strength; - int res[3]; - int maxres; - short noise; /* noise type: wave, curl, anisotropic */ - short pad; - int amplify; - int flags; -} SmokeHRModifierData; - typedef struct DisplaceModifierData { ModifierData modifier; diff --git a/source/blender/makesdna/DNA_smoke_types.h b/source/blender/makesdna/DNA_smoke_types.h index 2d8b21b86de..542281e1960 100644 --- a/source/blender/makesdna/DNA_smoke_types.h +++ b/source/blender/makesdna/DNA_smoke_types.h @@ -32,10 +32,15 @@ /* flags */ #define MOD_SMOKE_HIGHRES (1<<1) /* enable high resolution */ #define MOD_SMOKE_DISSOLVE (1<<2) /* let smoke dissolve */ -#define MOD_SMOKE_DISSOLVE_LOG (1<<3) /* using 1/x for dissolve */ +#define MOD_SMOKE_DISSOLVE_LOG (1<<3) /* using 1/x for dissolve * + +/* noise */ +#define MOD_SMOKE_NOISEWAVE (1<<0) +#define MOD_SMOKE_NOISEFFT (1<<1) +#define MOD_SMOKE_NOISECURL (1<<2) /* viewsettings */ -/* nothing so far */ +#define MOD_SMOKE_SHOWHIGHRES (1<<0) /* show high resolution */ typedef struct SmokeDomainSettings { struct SmokeModifierData *smd; /* for fast RNA access */ @@ -64,6 +69,14 @@ typedef struct SmokeDomainSettings { int diss_speed;/* in frames */ struct PointCache *point_cache; /* definition is in DNA_object_force.h */ struct ListBase ptcaches; + struct WTURBULENCE *wt; // WTURBULENCE object, if active + int pad3; + float strength; + int res_wt[3]; + int maxres_wt; + short noise; /* noise type: wave, curl, anisotropic */ + short pad2; + int amplify; } SmokeDomainSettings; diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index cb54fe2ad8d..ea7451ee77a 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -389,7 +389,6 @@ extern StructRNA RNA_SmokeCollSettings; extern StructRNA RNA_SmokeDomainSettings; extern StructRNA RNA_SmokeFlowSettings; extern StructRNA RNA_SmokeModifier; -extern StructRNA RNA_SmokeHRModifier; extern StructRNA RNA_SmoothModifier; extern StructRNA RNA_SoftBodyModifier; extern StructRNA RNA_SoftBodySettings; diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 4845ad28d47..bb073d19a46 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -75,7 +75,6 @@ EnumPropertyItem modifier_type_items[] ={ {eModifierType_ParticleInstance, "PARTICLE_INSTANCE", ICON_MOD_PARTICLES, "Particle Instance", ""}, {eModifierType_ParticleSystem, "PARTICLE_SYSTEM", ICON_MOD_PARTICLES, "Particle System", ""}, {eModifierType_Smoke, "SMOKE", 0, "Smoke", ""}, - {eModifierType_SmokeHR, "SMOKE_HR", 0, "SmokeHR", ""}, {eModifierType_Softbody, "SOFT_BODY", ICON_MOD_SOFT, "Soft Body", ""}, {eModifierType_Surface, "SURFACE", ICON_MOD_PHYSICS, "Surface", ""}, {0, NULL, 0, NULL, NULL}}; @@ -159,8 +158,6 @@ static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr) return &RNA_SurfaceModifier; case eModifierType_Smoke: return &RNA_SmokeModifier; - case eModifierType_SmokeHR: - return &RNA_SmokeHRModifier; default: return &RNA_Modifier; } @@ -201,15 +198,6 @@ static void rna_Smoke_set_type(bContext *C, PointerRNA *ptr) rna_Modifier_dependency_update(C, ptr); } -static void rna_SmokeHR_reset(bContext *C, PointerRNA *ptr) -{ - // SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data; - - // smokeModifier_reset(settings->smd); - - // rna_Smoke_update(C, ptr); -} - static void rna_ExplodeModifier_vgroup_get(PointerRNA *ptr, char *value) { ExplodeModifierData *emd= (ExplodeModifierData*)ptr->data; @@ -1563,55 +1551,6 @@ static void rna_def_modifier_cloth(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Point Cache", ""); } -static void rna_def_modifier_smoke_highresolution(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - static EnumPropertyItem prop_noise_type_items[] = { - {MOD_SMOKE_NOISEWAVE, "NOISEWAVE", 0, "Wavelet", ""}, -#if FFTW3 == 1 - {MOD_SMOKE_NOISEFFT, "NOISEFFT", 0, "FFT", ""}, -#endif - /* {MOD_SMOKE_NOISECURL, "NOISECURL", 0, "Curl", ""}, */ - {0, NULL, 0, NULL, NULL}}; - - srna= RNA_def_struct(brna, "SmokeHRModifier", "Modifier"); - RNA_def_struct_ui_text(srna, "Smoke High Resolution Modifier", "Smoke high resolution simulation modifier."); - RNA_def_struct_sdna(srna, "SmokeHRModifierData"); - - prop= RNA_def_property(srna, "show_highres", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_SHOWHIGHRES); - RNA_def_property_ui_text(prop, "High res", "Show high resolution (using amplification)."); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); - - prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "noise"); - RNA_def_property_enum_items(prop, prop_noise_type_items); - RNA_def_property_ui_text(prop, "Noise Method", "Noise method which is used for creating the high resolution"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_SmokeHR_reset"); - - prop= RNA_def_property(srna, "amplify", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "amplify"); - RNA_def_property_range(prop, 1, 10); - RNA_def_property_ui_range(prop, 1, 10, 1, 0); - RNA_def_property_ui_text(prop, "Amplification", "Enhance the resolution of smoke by this factor using noise."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_SmokeHR_reset"); - - prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "strength"); - RNA_def_property_range(prop, 1.0, 10.0); - RNA_def_property_ui_range(prop, 1.0, 10.0, 1, 2); - RNA_def_property_ui_text(prop, "Strength", "Strength of wavelet noise"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_SmokeHR_reset"); - - prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "point_cache"); - RNA_def_property_struct_type(prop, "PointCache"); - RNA_def_property_ui_text(prop, "Point Cache", ""); - -} - static void rna_def_modifier_smoke(BlenderRNA *brna) { StructRNA *srna; @@ -2028,7 +1967,6 @@ void RNA_def_modifier(BlenderRNA *brna) rna_def_modifier_multires(brna); rna_def_modifier_surface(brna); rna_def_modifier_smoke(brna); - rna_def_modifier_smoke_highresolution(brna); } #endif diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c index 70a5ddf72dd..e671665bd17 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -61,21 +61,6 @@ static void rna_Smoke_dependency_update(bContext *C, PointerRNA *ptr) DAG_scene_sort(CTX_data_scene(C)); } -static void rna_Smoke_reset_cache(bContext *C, PointerRNA *ptr) -{ - SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data; - PointCache *cache = settings->point_cache; - - printf("rna_Smoke_reset_cache\n"); - - cache->flag &= ~PTCACHE_SIMULATION_VALID; - cache->flag |= PTCACHE_OUTDATED; - cache->simframe= 0; - cache->last_exact= 0; - - rna_Smoke_update(C, ptr); -} - static void rna_Smoke_reset(bContext *C, PointerRNA *ptr) { SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data; @@ -94,23 +79,6 @@ static void rna_Smoke_reset_dependancy(bContext *C, PointerRNA *ptr) rna_Smoke_dependency_update(C, ptr); } -static void rna_Smoke_enable_HR(bContext *C, PointerRNA *ptr) -{ - SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data; - Object *ob = (Object*)ptr->id.data; - - if(settings->flags & MOD_SMOKE_HIGHRES) - BLI_addtail(&ob->modifiers, modifier_new(eModifierType_SmokeHR)); - else - { - ModifierData *tmd = modifiers_findByType(ob, eModifierType_SmokeHR); - if(tmd) { - BLI_remlink(&ob->modifiers, tmd); - modifier_free(tmd); - } - } -} - static void rna_Smoke_redraw(bContext *C, PointerRNA *ptr) { SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data; @@ -149,6 +117,14 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; + static EnumPropertyItem prop_noise_type_items[] = { + {MOD_SMOKE_NOISEWAVE, "NOISEWAVE", 0, "Wavelet", ""}, +#if FFTW3 == 1 + {MOD_SMOKE_NOISEFFT, "NOISEFFT", 0, "FFT", ""}, +#endif + /* {MOD_SMOKE_NOISECURL, "NOISECURL", 0, "Curl", ""}, */ + {0, NULL, 0, NULL, NULL}}; + srna = RNA_def_struct(brna, "SmokeDomainSettings", NULL); RNA_def_struct_ui_text(srna, "Domain Settings", "Smoke domain settings."); RNA_def_struct_sdna(srna, "SmokeDomainSettings"); @@ -166,14 +142,14 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) RNA_def_property_range(prop, -5.0, 5.0); RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5); RNA_def_property_ui_text(prop, "Gravity", "Higher value results in sinking smoke"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_cache"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "beta", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "beta"); RNA_def_property_range(prop, -5.0, 5.0); RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5); RNA_def_property_ui_text(prop, "Heat", "Higher value results in faster rising smoke."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_cache"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "coll_group", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "coll_group"); @@ -206,22 +182,54 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "highres", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGHRES); RNA_def_property_ui_text(prop, "High Resolution Smoke", "Enable high resolution smoke"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_enable_HR"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL); prop= RNA_def_property(srna, "dissolve_smoke", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE); RNA_def_property_ui_text(prop, "Dissolve Smoke", "Enable smoke to disappear over time."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "dissolve_smoke_log", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE_LOG); RNA_def_property_ui_text(prop, "Logarithmic dissolve", "Using 1/x "); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "point_cache"); RNA_def_property_struct_type(prop, "PointCache"); RNA_def_property_ui_text(prop, "Point Cache", ""); + + prop= RNA_def_property(srna, "show_highres", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "viewsettings", MOD_SMOKE_SHOWHIGHRES); + RNA_def_property_ui_text(prop, "High res", "Show high resolution (using amplification)."); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + + prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "noise"); + RNA_def_property_enum_items(prop, prop_noise_type_items); + RNA_def_property_ui_text(prop, "Noise Method", "Noise method which is used for creating the high resolution"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + + prop= RNA_def_property(srna, "amplify", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "amplify"); + RNA_def_property_range(prop, 1, 10); + RNA_def_property_ui_range(prop, 1, 10, 1, 0); + RNA_def_property_ui_text(prop, "Amplification", "Enhance the resolution of smoke by this factor using noise."); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + + prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "strength"); + RNA_def_property_range(prop, 1.0, 10.0); + RNA_def_property_ui_range(prop, 1.0, 10.0, 1, 2); + RNA_def_property_ui_text(prop, "Strength", "Strength of wavelet noise"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); + + /* + prop= RNA_def_property(srna, "point_cache_hr", PROP_POINTER, PROP_NEVER_NULL); + RNA_def_property_pointer_sdna(prop, NULL, "point_cache"); + RNA_def_property_struct_type(prop, "PointCache"); + RNA_def_property_ui_text(prop, "Point Cache", ""); + */ } static void rna_def_smoke_flow_settings(BlenderRNA *brna) From 0a23895f95382a8c6d5c36bc8b36802c4474eb2e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 25 Aug 2009 22:51:18 +0000 Subject: [PATCH 271/577] remove all python api functions deprecated in 2.49 --- .../Converter/BL_ActionActuator.cpp | 449 ------------------ .../gameengine/Converter/BL_ActionActuator.h | 25 - .../Converter/BL_ShapeActionActuator.cpp | 384 --------------- .../Converter/BL_ShapeActionActuator.h | 23 - source/gameengine/Expressions/Value.cpp | 8 - source/gameengine/Expressions/Value.h | 2 - .../GameLogic/SCA_ActuatorSensor.cpp | 41 -- .../gameengine/GameLogic/SCA_ActuatorSensor.h | 5 - .../gameengine/GameLogic/SCA_DelaySensor.cpp | 97 ---- source/gameengine/GameLogic/SCA_DelaySensor.h | 8 - .../gameengine/GameLogic/SCA_IController.cpp | 86 ---- source/gameengine/GameLogic/SCA_IController.h | 6 - .../gameengine/GameLogic/SCA_ILogicBrick.cpp | 45 -- source/gameengine/GameLogic/SCA_ILogicBrick.h | 4 - source/gameengine/GameLogic/SCA_ISensor.cpp | 191 -------- source/gameengine/GameLogic/SCA_ISensor.h | 15 - .../GameLogic/SCA_JoystickSensor.cpp | 219 --------- .../gameengine/GameLogic/SCA_JoystickSensor.h | 20 - .../GameLogic/SCA_KeyboardSensor.cpp | 188 -------- .../gameengine/GameLogic/SCA_KeyboardSensor.h | 19 - .../gameengine/GameLogic/SCA_MouseSensor.cpp | 28 -- source/gameengine/GameLogic/SCA_MouseSensor.h | 7 - .../GameLogic/SCA_PropertyActuator.cpp | 73 --- .../GameLogic/SCA_PropertyActuator.h | 8 - .../GameLogic/SCA_PropertySensor.cpp | 115 ----- .../gameengine/GameLogic/SCA_PropertySensor.h | 12 - .../GameLogic/SCA_PythonController.cpp | 52 -- .../GameLogic/SCA_RandomActuator.cpp | 107 ----- .../gameengine/GameLogic/SCA_RandomActuator.h | 10 - .../gameengine/GameLogic/SCA_RandomSensor.cpp | 44 -- .../gameengine/GameLogic/SCA_RandomSensor.h | 7 - .../KXNetwork/KX_NetworkMessageActuator.cpp | 85 ---- .../KXNetwork/KX_NetworkMessageActuator.h | 7 - .../KXNetwork/KX_NetworkMessageSensor.cpp | 89 ---- .../KXNetwork/KX_NetworkMessageSensor.h | 8 - source/gameengine/Ketsji/KX_Camera.cpp | 92 ---- source/gameengine/Ketsji/KX_Camera.h | 3 - .../gameengine/Ketsji/KX_CameraActuator.cpp | 157 ------ source/gameengine/Ketsji/KX_CameraActuator.h | 12 - .../Ketsji/KX_ConstraintActuator.cpp | 338 ------------- .../gameengine/Ketsji/KX_ConstraintActuator.h | 22 - source/gameengine/Ketsji/KX_GameActuator.cpp | 37 -- source/gameengine/Ketsji/KX_GameActuator.h | 5 - source/gameengine/Ketsji/KX_GameObject.cpp | 163 +------ source/gameengine/Ketsji/KX_GameObject.h | 12 +- source/gameengine/Ketsji/KX_IpoActuator.cpp | 248 ---------- source/gameengine/Ketsji/KX_IpoActuator.h | 17 - source/gameengine/Ketsji/KX_MeshProxy.cpp | 20 - .../gameengine/Ketsji/KX_MouseFocusSensor.cpp | 79 --- .../gameengine/Ketsji/KX_MouseFocusSensor.h | 8 - .../gameengine/Ketsji/KX_ObjectActuator.cpp | 327 ------------- source/gameengine/Ketsji/KX_ObjectActuator.h | 23 - .../gameengine/Ketsji/KX_ParentActuator.cpp | 55 --- source/gameengine/Ketsji/KX_ParentActuator.h | 5 - source/gameengine/Ketsji/KX_PythonInit.cpp | 2 - source/gameengine/Ketsji/KX_RadarSensor.cpp | 54 +-- source/gameengine/Ketsji/KX_RadarSensor.h | 5 - source/gameengine/Ketsji/KX_RaySensor.cpp | 71 --- source/gameengine/Ketsji/KX_RaySensor.h | 6 - .../Ketsji/KX_SCA_AddObjectActuator.cpp | 209 -------- .../Ketsji/KX_SCA_AddObjectActuator.h | 19 - .../Ketsji/KX_SCA_DynamicActuator.cpp | 39 -- .../Ketsji/KX_SCA_DynamicActuator.h | 5 - .../Ketsji/KX_SCA_ReplaceMeshActuator.cpp | 34 -- .../Ketsji/KX_SCA_ReplaceMeshActuator.h | 7 +- source/gameengine/Ketsji/KX_Scene.cpp | 30 -- source/gameengine/Ketsji/KX_Scene.h | 21 +- source/gameengine/Ketsji/KX_SceneActuator.cpp | 121 ----- source/gameengine/Ketsji/KX_SceneActuator.h | 16 - source/gameengine/Ketsji/KX_SoundActuator.cpp | 117 ----- source/gameengine/Ketsji/KX_SoundActuator.h | 12 - source/gameengine/Ketsji/KX_StateActuator.cpp | 55 --- source/gameengine/Ketsji/KX_StateActuator.h | 4 +- source/gameengine/Ketsji/KX_TouchSensor.cpp | 105 ---- source/gameengine/Ketsji/KX_TouchSensor.h | 17 - .../gameengine/Ketsji/KX_TrackToActuator.cpp | 127 ----- source/gameengine/Ketsji/KX_TrackToActuator.h | 13 - .../Ketsji/KX_VisibilityActuator.cpp | 27 -- .../gameengine/Ketsji/KX_VisibilityActuator.h | 5 - 79 files changed, 17 insertions(+), 5214 deletions(-) diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index 5a3629cfcd3..ca4290703e1 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -436,365 +436,6 @@ bool BL_ActionActuator::Update(double curtime, bool frame) /* Python functions */ /* ------------------------------------------------------------------------- */ -/* setStart */ -const char BL_ActionActuator::GetAction_doc[] = -"getAction()\n" -"\tReturns a string containing the name of the current action.\n"; - -PyObject* BL_ActionActuator::PyGetAction(PyObject* args, - PyObject* kwds) { - ShowDeprecationWarning("getAction()", "the action property"); - - if (m_action){ - return PyUnicode_FromString(m_action->id.name+2); - } - Py_RETURN_NONE; -} - -/* getProperty */ -const char BL_ActionActuator::GetProperty_doc[] = -"getProperty()\n" -"\tReturns the name of the property to be used in FromProp mode.\n"; - -PyObject* BL_ActionActuator::PyGetProperty(PyObject* args, - PyObject* kwds) { - ShowDeprecationWarning("getProperty()", "the property property"); - - PyObject *result; - - result = Py_BuildValue("s", (const char *)m_propname); - - return result; -} - -/* getProperty */ -const char BL_ActionActuator::GetFrameProperty_doc[] = -"getFrameProperty()\n" -"\tReturns the name of the property, that is set to the current frame number.\n"; - -PyObject* BL_ActionActuator::PyGetFrameProperty(PyObject* args, - PyObject* kwds) { - ShowDeprecationWarning("getFrameProperty()", "the frameProperty property"); - - PyObject *result; - - result = Py_BuildValue("s", (const char *)m_framepropname); - - return result; -} - -/* getFrame */ -const char BL_ActionActuator::GetFrame_doc[] = -"getFrame()\n" -"\tReturns the current frame number.\n"; - -PyObject* BL_ActionActuator::PyGetFrame(PyObject* args, - PyObject* kwds) { - ShowDeprecationWarning("getFrame()", "the frame property"); - - PyObject *result; - - result = Py_BuildValue("f", m_localtime); - - return result; -} - -/* getEnd */ -const char BL_ActionActuator::GetEnd_doc[] = -"getEnd()\n" -"\tReturns the last frame of the action.\n"; - -PyObject* BL_ActionActuator::PyGetEnd(PyObject* args, - PyObject* kwds) { - ShowDeprecationWarning("getEnd()", "the end property"); - - PyObject *result; - - result = Py_BuildValue("f", m_endframe); - - return result; -} - -/* getStart */ -const char BL_ActionActuator::GetStart_doc[] = -"getStart()\n" -"\tReturns the starting frame of the action.\n"; - -PyObject* BL_ActionActuator::PyGetStart(PyObject* args, - PyObject* kwds) { - ShowDeprecationWarning("getStart()", "the start property"); - - PyObject *result; - - result = Py_BuildValue("f", m_startframe); - - return result; -} - -/* getBlendin */ -const char BL_ActionActuator::GetBlendin_doc[] = -"getBlendin()\n" -"\tReturns the number of interpolation animation frames to be\n" -"\tgenerated when this actuator is triggered.\n"; - -PyObject* BL_ActionActuator::PyGetBlendin(PyObject* args, - PyObject* kwds) { - ShowDeprecationWarning("getBlendin()", "the blendin property"); - - PyObject *result; - - result = Py_BuildValue("f", m_blendin); - - return result; -} - -/* getPriority */ -const char BL_ActionActuator::GetPriority_doc[] = -"getPriority()\n" -"\tReturns the priority for this actuator. Actuators with lower\n" -"\tPriority numbers will override actuators with higher numbers.\n"; - -PyObject* BL_ActionActuator::PyGetPriority(PyObject* args, - PyObject* kwds) { - ShowDeprecationWarning("getPriority()", "the priority property"); - - PyObject *result; - - result = Py_BuildValue("i", m_priority); - - return result; -} - -/* setAction */ -const char BL_ActionActuator::SetAction_doc[] = -"setAction(action, (reset))\n" -"\t - action : The name of the action to set as the current action.\n" -"\t - reset : Optional parameter indicating whether to reset the\n" -"\t blend timer or not. A value of 1 indicates that the\n" -"\t timer should be reset. A value of 0 will leave it\n" -"\t unchanged. If reset is not specified, the timer will" -"\t be reset.\n"; - -PyObject* BL_ActionActuator::PySetAction(PyObject* args, - PyObject* kwds) { - ShowDeprecationWarning("setAction()", "the action property"); - - char *string; - int reset = 1; - - if (PyArg_ParseTuple(args,"s|i:setAction",&string, &reset)) - { - bAction *action; - - action = (bAction*)SCA_ILogicBrick::m_sCurrentLogicManager->GetActionByName(STR_String(string)); - - if (!action){ - /* NOTE! Throw an exception or something */ - // printf ("setAction failed: Action not found\n", string); - } - else{ - m_action=action; - if (reset) - m_blendframe = 0; - } - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -/* setStart */ -const char BL_ActionActuator::SetStart_doc[] = -"setStart(start)\n" -"\t - start : Specifies the starting frame of the animation.\n"; - -PyObject* BL_ActionActuator::PySetStart(PyObject* args, - PyObject* kwds) { - ShowDeprecationWarning("setStart()", "the start property"); - - float start; - - if (PyArg_ParseTuple(args,"f:setStart",&start)) - { - m_startframe = start; - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -/* setEnd */ -const char BL_ActionActuator::SetEnd_doc[] = -"setEnd(end)\n" -"\t - end : Specifies the ending frame of the animation.\n"; - -PyObject* BL_ActionActuator::PySetEnd(PyObject* args, - PyObject* kwds) { - ShowDeprecationWarning("setEnd()", "the end property"); - - float end; - - if (PyArg_ParseTuple(args,"f:setEnd",&end)) - { - m_endframe = end; - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -/* setBlendin */ -const char BL_ActionActuator::SetBlendin_doc[] = -"setBlendin(blendin)\n" -"\t - blendin : Specifies the number of frames of animation to generate\n" -"\t when making transitions between actions.\n"; - -PyObject* BL_ActionActuator::PySetBlendin(PyObject* args, - PyObject* kwds) { - ShowDeprecationWarning("setBlendin()", "the blendin property"); - - float blendin; - - if (PyArg_ParseTuple(args,"f:setBlendin",&blendin)) - { - m_blendin = blendin; - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -/* setBlendtime */ -const char BL_ActionActuator::SetBlendtime_doc[] = -"setBlendtime(blendtime)\n" -"\t - blendtime : Allows the script to directly modify the internal timer\n" -"\t used when generating transitions between actions. This\n" -"\t parameter must be in the range from 0.0 to 1.0.\n"; - -PyObject* BL_ActionActuator::PySetBlendtime(PyObject* args, - PyObject* kwds) { - ShowDeprecationWarning("setBlendtime()", "the blendtime property"); - - float blendframe; - - if (PyArg_ParseTuple(args,"f:setBlendtime",&blendframe)) - { - m_blendframe = blendframe * m_blendin; - if (m_blendframe<0) - m_blendframe = 0; - if (m_blendframe>m_blendin) - m_blendframe = m_blendin; - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -/* setPriority */ -const char BL_ActionActuator::SetPriority_doc[] = -"setPriority(priority)\n" -"\t - priority : Specifies the new priority. Actuators will lower\n" -"\t priority numbers will override actuators with higher\n" -"\t numbers.\n"; - -PyObject* BL_ActionActuator::PySetPriority(PyObject* args, - PyObject* kwds) { - ShowDeprecationWarning("setPriority()", "the priority property"); - - int priority; - - if (PyArg_ParseTuple(args,"i:setPriority",&priority)) - { - m_priority = priority; - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -/* setFrame */ -const char BL_ActionActuator::SetFrame_doc[] = -"setFrame(frame)\n" -"\t - frame : Specifies the new current frame for the animation\n"; - -PyObject* BL_ActionActuator::PySetFrame(PyObject* args, - PyObject* kwds) { - ShowDeprecationWarning("setFrame()", "the frame property"); - - float frame; - - if (PyArg_ParseTuple(args,"f:setFrame",&frame)) - { - m_localtime = frame; - if (m_localtimem_endframe) - m_localtime=m_endframe; - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -/* setProperty */ -const char BL_ActionActuator::SetProperty_doc[] = -"setProperty(prop)\n" -"\t - prop : A string specifying the property name to be used in\n" -"\t FromProp playback mode.\n"; - -PyObject* BL_ActionActuator::PySetProperty(PyObject* args, - PyObject* kwds) { - ShowDeprecationWarning("setProperty()", "the property property"); - - char *string; - - if (PyArg_ParseTuple(args,"s:setProperty",&string)) - { - m_propname = string; - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -/* setFrameProperty */ -const char BL_ActionActuator::SetFrameProperty_doc[] = -"setFrameProperty(prop)\n" -"\t - prop : A string specifying the property of the frame set up update.\n"; - -PyObject* BL_ActionActuator::PySetFrameProperty(PyObject* args, - PyObject* kwds) { - ShowDeprecationWarning("setFrameProperty()", "the frameProperty property"); - - char *string; - - if (PyArg_ParseTuple(args,"s:setFrameProperty",&string)) - { - m_framepropname = string; - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - PyObject* BL_ActionActuator::PyGetChannel(PyObject* value) { char *string= _PyUnicode_AsString(value); @@ -849,72 +490,6 @@ PyObject* BL_ActionActuator::PyGetChannel(PyObject* value) { */ } -/* getType */ -const char BL_ActionActuator::GetType_doc[] = -"getType()\n" -"\tReturns the operation mode of the actuator.\n"; -PyObject* BL_ActionActuator::PyGetType(PyObject* args, - PyObject* kwds) { - ShowDeprecationWarning("getType()", "the type property"); - - return Py_BuildValue("h", m_playtype); -} - -/* setType */ -const char BL_ActionActuator::SetType_doc[] = -"setType(mode)\n" -"\t - mode: Play (0), Flipper (2), LoopStop (3), LoopEnd (4) or Property (6)\n" -"\tSet the operation mode of the actuator.\n"; -PyObject* BL_ActionActuator::PySetType(PyObject* args, - PyObject* kwds) { - ShowDeprecationWarning("setType()", "the type property"); - - short typeArg; - - if (!PyArg_ParseTuple(args, "h:setType", &typeArg)) { - return NULL; - } - - switch (typeArg) { - case ACT_ACTION_PLAY: - case ACT_ACTION_FLIPPER: - case ACT_ACTION_LOOP_STOP: - case ACT_ACTION_LOOP_END: - case ACT_ACTION_FROM_PROP: - m_playtype = typeArg; - break; - default: - printf("Invalid type for action actuator: %d\n", typeArg); /* error */ - } - Py_RETURN_NONE; -} - -PyObject* BL_ActionActuator::PyGetContinue() { - ShowDeprecationWarning("getContinue()", "the continue property"); - - return PyLong_FromSsize_t((long)(m_end_reset==0)); -} - -PyObject* BL_ActionActuator::PySetContinue(PyObject* value) { - ShowDeprecationWarning("setContinue()", "the continue property"); - - int param = PyObject_IsTrue( value ); - - if( param == -1 ) { - PyErr_SetString( PyExc_TypeError, "expected True/False or 0/1" ); - return NULL; - } - - if (param) { - m_end_reset = 0; - } else { - m_end_reset = 1; - } - Py_RETURN_NONE; -} - -//<-----Deprecated - /* setChannel */ KX_PYMETHODDEF_DOC(BL_ActionActuator, setChannel, "setChannel(channel, matrix)\n" @@ -1028,31 +603,7 @@ PyTypeObject BL_ActionActuator::Type = { }; PyMethodDef BL_ActionActuator::Methods[] = { - //Deprecated -----> - {"setAction", (PyCFunction) BL_ActionActuator::sPySetAction, METH_VARARGS, (const char *)SetAction_doc}, - {"setStart", (PyCFunction) BL_ActionActuator::sPySetStart, METH_VARARGS, (const char *)SetStart_doc}, - {"setEnd", (PyCFunction) BL_ActionActuator::sPySetEnd, METH_VARARGS, (const char *)SetEnd_doc}, - {"setBlendin", (PyCFunction) BL_ActionActuator::sPySetBlendin, METH_VARARGS, (const char *)SetBlendin_doc}, - {"setPriority", (PyCFunction) BL_ActionActuator::sPySetPriority, METH_VARARGS, (const char *)SetPriority_doc}, - {"setFrame", (PyCFunction) BL_ActionActuator::sPySetFrame, METH_VARARGS, (const char *)SetFrame_doc}, - {"setProperty", (PyCFunction) BL_ActionActuator::sPySetProperty, METH_VARARGS, (const char *)SetProperty_doc}, - {"setFrameProperty", (PyCFunction) BL_ActionActuator::sPySetFrameProperty, METH_VARARGS, (const char *)SetFrameProperty_doc}, - {"setBlendtime", (PyCFunction) BL_ActionActuator::sPySetBlendtime, METH_VARARGS, (const char *)SetBlendtime_doc}, - - {"getAction", (PyCFunction) BL_ActionActuator::sPyGetAction, METH_VARARGS, (const char *)GetAction_doc}, - {"getStart", (PyCFunction) BL_ActionActuator::sPyGetStart, METH_VARARGS, (const char *)GetStart_doc}, - {"getEnd", (PyCFunction) BL_ActionActuator::sPyGetEnd, METH_VARARGS, (const char *)GetEnd_doc}, - {"getBlendin", (PyCFunction) BL_ActionActuator::sPyGetBlendin, METH_VARARGS, (const char *)GetBlendin_doc}, - {"getPriority", (PyCFunction) BL_ActionActuator::sPyGetPriority, METH_VARARGS, (const char *)GetPriority_doc}, - {"getFrame", (PyCFunction) BL_ActionActuator::sPyGetFrame, METH_VARARGS, (const char *)GetFrame_doc}, - {"getProperty", (PyCFunction) BL_ActionActuator::sPyGetProperty, METH_VARARGS, (const char *)GetProperty_doc}, - {"getFrameProperty", (PyCFunction) BL_ActionActuator::sPyGetFrameProperty, METH_VARARGS, (const char *)GetFrameProperty_doc}, {"getChannel", (PyCFunction) BL_ActionActuator::sPyGetChannel, METH_O}, - {"getType", (PyCFunction) BL_ActionActuator::sPyGetType, METH_VARARGS, (const char *)GetType_doc}, - {"setType", (PyCFunction) BL_ActionActuator::sPySetType, METH_VARARGS, (const char *)SetType_doc}, - {"getContinue", (PyCFunction) BL_ActionActuator::sPyGetContinue, METH_NOARGS, 0}, - {"setContinue", (PyCFunction) BL_ActionActuator::sPySetContinue, METH_O, 0}, - //<------ KX_PYMETHODTABLE(BL_ActionActuator, setChannel), {NULL,NULL} //Sentinel }; diff --git a/source/gameengine/Converter/BL_ActionActuator.h b/source/gameengine/Converter/BL_ActionActuator.h index 6003e23e315..a6b4c4a055d 100644 --- a/source/gameengine/Converter/BL_ActionActuator.h +++ b/source/gameengine/Converter/BL_ActionActuator.h @@ -84,32 +84,7 @@ public: bAction* GetAction() { return m_action; } void SetAction(bAction* act) { m_action= act; } - //Deprecated -----> - KX_PYMETHOD_DOC(BL_ActionActuator,SetAction); - KX_PYMETHOD_DOC(BL_ActionActuator,SetBlendin); - KX_PYMETHOD_DOC(BL_ActionActuator,SetPriority); - KX_PYMETHOD_DOC(BL_ActionActuator,SetStart); - KX_PYMETHOD_DOC(BL_ActionActuator,SetEnd); - KX_PYMETHOD_DOC(BL_ActionActuator,SetFrame); - KX_PYMETHOD_DOC(BL_ActionActuator,SetProperty); - KX_PYMETHOD_DOC(BL_ActionActuator,SetFrameProperty); - KX_PYMETHOD_DOC(BL_ActionActuator,SetBlendtime); - - KX_PYMETHOD_DOC(BL_ActionActuator,GetAction); - KX_PYMETHOD_DOC(BL_ActionActuator,GetBlendin); - KX_PYMETHOD_DOC(BL_ActionActuator,GetPriority); - KX_PYMETHOD_DOC(BL_ActionActuator,GetStart); - KX_PYMETHOD_DOC(BL_ActionActuator,GetEnd); - KX_PYMETHOD_DOC(BL_ActionActuator,GetFrame); - KX_PYMETHOD_DOC(BL_ActionActuator,GetProperty); - KX_PYMETHOD_DOC(BL_ActionActuator,GetFrameProperty); KX_PYMETHOD_O(BL_ActionActuator,GetChannel); - KX_PYMETHOD_DOC(BL_ActionActuator,GetType); - KX_PYMETHOD_DOC(BL_ActionActuator,SetType); - KX_PYMETHOD_NOARGS(BL_ActionActuator,GetContinue); - KX_PYMETHOD_O(BL_ActionActuator,SetContinue); - //<----- - KX_PYMETHOD_DOC(BL_ActionActuator,setChannel); static PyObject* pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp index 4af9a6c83a9..44eb603a940 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp +++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp @@ -434,26 +434,6 @@ PyTypeObject BL_ShapeActionActuator::Type = { PyMethodDef BL_ShapeActionActuator::Methods[] = { - {"setAction", (PyCFunction) BL_ShapeActionActuator::sPySetAction, METH_VARARGS, (const char *)SetAction_doc}, - {"setStart", (PyCFunction) BL_ShapeActionActuator::sPySetStart, METH_VARARGS, (const char *)SetStart_doc}, - {"setEnd", (PyCFunction) BL_ShapeActionActuator::sPySetEnd, METH_VARARGS, (const char *)SetEnd_doc}, - {"setBlendin", (PyCFunction) BL_ShapeActionActuator::sPySetBlendin, METH_VARARGS, (const char *)SetBlendin_doc}, - {"setPriority", (PyCFunction) BL_ShapeActionActuator::sPySetPriority, METH_VARARGS, (const char *)SetPriority_doc}, - {"setFrame", (PyCFunction) BL_ShapeActionActuator::sPySetFrame, METH_VARARGS, (const char *)SetFrame_doc}, - {"setProperty", (PyCFunction) BL_ShapeActionActuator::sPySetProperty, METH_VARARGS, (const char *)SetProperty_doc}, - {"setFrameProperty", (PyCFunction) BL_ShapeActionActuator::sPySetFrameProperty, METH_VARARGS, (const char *)SetFrameProperty_doc}, - {"setBlendtime", (PyCFunction) BL_ShapeActionActuator::sPySetBlendtime, METH_VARARGS, (const char *)SetBlendtime_doc}, - - {"getAction", (PyCFunction) BL_ShapeActionActuator::sPyGetAction, METH_NOARGS, (const char *)GetAction_doc}, - {"getStart", (PyCFunction) BL_ShapeActionActuator::sPyGetStart, METH_NOARGS, (const char *)GetStart_doc}, - {"getEnd", (PyCFunction) BL_ShapeActionActuator::sPyGetEnd, METH_NOARGS, (const char *)GetEnd_doc}, - {"getBlendin", (PyCFunction) BL_ShapeActionActuator::sPyGetBlendin, METH_NOARGS, (const char *)GetBlendin_doc}, - {"getPriority", (PyCFunction) BL_ShapeActionActuator::sPyGetPriority, METH_NOARGS, (const char *)GetPriority_doc}, - {"getFrame", (PyCFunction) BL_ShapeActionActuator::sPyGetFrame, METH_NOARGS, (const char *)GetFrame_doc}, - {"getProperty", (PyCFunction) BL_ShapeActionActuator::sPyGetProperty, METH_NOARGS, (const char *)GetProperty_doc}, - {"getFrameProperty", (PyCFunction) BL_ShapeActionActuator::sPyGetFrameProperty, METH_NOARGS, (const char *)GetFrameProperty_doc}, - {"getType", (PyCFunction) BL_ShapeActionActuator::sPyGetType, METH_NOARGS, (const char *)GetType_doc}, - {"setType", (PyCFunction) BL_ShapeActionActuator::sPySetType, METH_NOARGS, (const char *)SetType_doc}, {NULL,NULL} //Sentinel }; @@ -471,370 +451,6 @@ PyAttributeDef BL_ShapeActionActuator::Attributes[] = { { NULL } //Sentinel }; -/* setStart */ -const char BL_ShapeActionActuator::GetAction_doc[] = -"getAction()\n" -"\tReturns a string containing the name of the current action.\n"; - -PyObject* BL_ShapeActionActuator::PyGetAction() { - ShowDeprecationWarning("getAction()", "the action property"); - if (m_action){ - return PyUnicode_FromString(m_action->id.name+2); - } - Py_RETURN_NONE; -} - -/* getProperty */ -const char BL_ShapeActionActuator::GetProperty_doc[] = -"getProperty()\n" -"\tReturns the name of the property to be used in FromProp mode.\n"; - -PyObject* BL_ShapeActionActuator::PyGetProperty() { - ShowDeprecationWarning("getProperty()", "the property property"); - PyObject *result; - - result = Py_BuildValue("s", (const char *)m_propname); - - return result; -} - -/* getFrame */ -const char BL_ShapeActionActuator::GetFrame_doc[] = -"getFrame()\n" -"\tReturns the current frame number.\n"; - -PyObject* BL_ShapeActionActuator::PyGetFrame() { - ShowDeprecationWarning("getFrame()", "the frame property"); - PyObject *result; - - result = Py_BuildValue("f", m_localtime); - - return result; -} - -/* getEnd */ -const char BL_ShapeActionActuator::GetEnd_doc[] = -"getEnd()\n" -"\tReturns the last frame of the action.\n"; - -PyObject* BL_ShapeActionActuator::PyGetEnd() { - ShowDeprecationWarning("getEnd()", "the end property"); - PyObject *result; - - result = Py_BuildValue("f", m_endframe); - - return result; -} - -/* getStart */ -const char BL_ShapeActionActuator::GetStart_doc[] = -"getStart()\n" -"\tReturns the starting frame of the action.\n"; - -PyObject* BL_ShapeActionActuator::PyGetStart() { - ShowDeprecationWarning("getStart()", "the start property"); - PyObject *result; - - result = Py_BuildValue("f", m_startframe); - - return result; -} - -/* getBlendin */ -const char BL_ShapeActionActuator::GetBlendin_doc[] = -"getBlendin()\n" -"\tReturns the number of interpolation animation frames to be\n" -"\tgenerated when this actuator is triggered.\n"; - -PyObject* BL_ShapeActionActuator::PyGetBlendin() { - ShowDeprecationWarning("getBlendin()", "the blendin property"); - PyObject *result; - - result = Py_BuildValue("f", m_blendin); - - return result; -} - -/* getPriority */ -const char BL_ShapeActionActuator::GetPriority_doc[] = -"getPriority()\n" -"\tReturns the priority for this actuator. Actuators with lower\n" -"\tPriority numbers will override actuators with higher numbers.\n"; - -PyObject* BL_ShapeActionActuator::PyGetPriority() { - ShowDeprecationWarning("getPriority()", "the priority property"); - PyObject *result; - - result = Py_BuildValue("i", m_priority); - - return result; -} - -/* setAction */ -const char BL_ShapeActionActuator::SetAction_doc[] = -"setAction(action, (reset))\n" -"\t - action : The name of the action to set as the current action.\n" -"\t Should be an action with Shape channels.\n" -"\t - reset : Optional parameter indicating whether to reset the\n" -"\t blend timer or not. A value of 1 indicates that the\n" -"\t timer should be reset. A value of 0 will leave it\n" -"\t unchanged. If reset is not specified, the timer will" -"\t be reset.\n"; - -PyObject* BL_ShapeActionActuator::PySetAction(PyObject* args) { - ShowDeprecationWarning("setAction()", "the action property"); - char *string; - int reset = 1; - - if (PyArg_ParseTuple(args,"s|i:setAction",&string, &reset)) - { - bAction *action; - - action = (bAction*)SCA_ILogicBrick::m_sCurrentLogicManager->GetActionByName(STR_String(string)); - - if (!action){ - /* NOTE! Throw an exception or something */ - // printf ("setAction failed: Action not found\n", string); - } - else{ - m_action=action; - if (reset) - m_blendframe = 0.f; - } - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -/* setStart */ -const char BL_ShapeActionActuator::SetStart_doc[] = -"setStart(start)\n" -"\t - start : Specifies the starting frame of the animation.\n"; - -PyObject* BL_ShapeActionActuator::PySetStart(PyObject* args) { - ShowDeprecationWarning("setStart()", "the start property"); - float start; - - if (PyArg_ParseTuple(args,"f:setStart",&start)) - { - m_startframe = start; - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -/* setEnd */ -const char BL_ShapeActionActuator::SetEnd_doc[] = -"setEnd(end)\n" -"\t - end : Specifies the ending frame of the animation.\n"; - -PyObject* BL_ShapeActionActuator::PySetEnd(PyObject* args) { - ShowDeprecationWarning("setEnd()", "the end property"); - float end; - - if (PyArg_ParseTuple(args,"f:setEnd",&end)) - { - m_endframe = end; - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -/* setBlendin */ -const char BL_ShapeActionActuator::SetBlendin_doc[] = -"setBlendin(blendin)\n" -"\t - blendin : Specifies the number of frames of animation to generate\n" -"\t when making transitions between actions.\n"; - -PyObject* BL_ShapeActionActuator::PySetBlendin(PyObject* args) { - ShowDeprecationWarning("setBlendin()", "the blendin property"); - float blendin; - - if (PyArg_ParseTuple(args,"f:setBlendin",&blendin)) - { - m_blendin = blendin; - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -/* setBlendtime */ -const char BL_ShapeActionActuator::SetBlendtime_doc[] = -"setBlendtime(blendtime)\n" -"\t - blendtime : Allows the script to directly modify the internal timer\n" -"\t used when generating transitions between actions. This\n" -"\t parameter must be in the range from 0.0 to 1.0.\n"; - -PyObject* BL_ShapeActionActuator::PySetBlendtime(PyObject* args) { - ShowDeprecationWarning("setBlendtime()", "the blendTime property"); - float blendframe; - - if (PyArg_ParseTuple(args,"f:setBlendtime",&blendframe)) - { - m_blendframe = blendframe * m_blendin; - if (m_blendframe<0.f) - m_blendframe = 0.f; - if (m_blendframe>m_blendin) - m_blendframe = m_blendin; - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -/* setPriority */ -const char BL_ShapeActionActuator::SetPriority_doc[] = -"setPriority(priority)\n" -"\t - priority : Specifies the new priority. Actuators will lower\n" -"\t priority numbers will override actuators with higher\n" -"\t numbers.\n"; - -PyObject* BL_ShapeActionActuator::PySetPriority(PyObject* args) { - ShowDeprecationWarning("setPriority()", "the priority property"); - int priority; - - if (PyArg_ParseTuple(args,"i:setPriority",&priority)) - { - m_priority = priority; - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -/* getProperty */ -const char BL_ShapeActionActuator::GetFrameProperty_doc[] = -"getFrameProperty()\n" -"\tReturns the name of the property, that is set to the current frame number.\n"; - -PyObject* BL_ShapeActionActuator::PyGetFrameProperty() { - ShowDeprecationWarning("getFrameProperty()", "the frameProperty property"); - PyObject *result; - - result = Py_BuildValue("s", (const char *)m_framepropname); - - return result; -} - - -/* setFrame */ -const char BL_ShapeActionActuator::SetFrame_doc[] = -"setFrame(frame)\n" -"\t - frame : Specifies the new current frame for the animation\n"; - -PyObject* BL_ShapeActionActuator::PySetFrame(PyObject* args) { - ShowDeprecationWarning("setFrame()", "the frame property"); - float frame; - - if (PyArg_ParseTuple(args,"f:setFrame",&frame)) - { - m_localtime = frame; - if (m_localtimem_endframe) - m_localtime=m_endframe; - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -/* setProperty */ -const char BL_ShapeActionActuator::SetProperty_doc[] = -"setProperty(prop)\n" -"\t - prop : A string specifying the property name to be used in\n" -"\t FromProp playback mode.\n"; - -PyObject* BL_ShapeActionActuator::PySetProperty(PyObject* args) { - ShowDeprecationWarning("setProperty()", "the property property"); - char *string; - - if (PyArg_ParseTuple(args,"s:setProperty",&string)) - { - m_propname = string; - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -/* setFrameProperty */ -const char BL_ShapeActionActuator::SetFrameProperty_doc[] = -"setFrameProperty(prop)\n" -"\t - prop : A string specifying the property of the frame set up update.\n"; - -PyObject* BL_ShapeActionActuator::PySetFrameProperty(PyObject* args) { - ShowDeprecationWarning("setFrameProperty()", "the frameProperty property"); - char *string; - - if (PyArg_ParseTuple(args,"s:setFrameProperty",&string)) - { - m_framepropname = string; - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -/* getType */ -const char BL_ShapeActionActuator::GetType_doc[] = -"getType()\n" -"\tReturns the operation mode of the actuator.\n"; -PyObject* BL_ShapeActionActuator::PyGetType() { - ShowDeprecationWarning("getType()", "the type property"); - return Py_BuildValue("h", m_playtype); -} - -/* setType */ -const char BL_ShapeActionActuator::SetType_doc[] = -"setType(mode)\n" -"\t - mode: Play (0), Flipper (2), LoopStop (3), LoopEnd (4) or Property (6)\n" -"\tSet the operation mode of the actuator.\n"; -PyObject* BL_ShapeActionActuator::PySetType(PyObject* args) { - ShowDeprecationWarning("setType()", "the type property"); - short typeArg; - - if (!PyArg_ParseTuple(args, "h:setType", &typeArg)) { - return NULL; - } - - switch (typeArg) { - case ACT_ACTION_PLAY: - case ACT_ACTION_FLIPPER: - case ACT_ACTION_LOOP_STOP: - case ACT_ACTION_LOOP_END: - case ACT_ACTION_FROM_PROP: - m_playtype = typeArg; - break; - default: - printf("Invalid type for action actuator: %d\n", typeArg); /* error */ - } - - Py_RETURN_NONE; -} - PyObject* BL_ShapeActionActuator::pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { BL_ShapeActionActuator* self= static_cast(self_v); diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.h b/source/gameengine/Converter/BL_ShapeActionActuator.h index 890fe3f9de9..28a6d90abdf 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.h +++ b/source/gameengine/Converter/BL_ShapeActionActuator.h @@ -82,29 +82,6 @@ public: bAction* GetAction() { return m_action; } void SetAction(bAction* act) { m_action= act; } - KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetAction); - KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetBlendin); - KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetPriority); - KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetStart); - KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetEnd); - KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetFrame); - KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetProperty); - KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetFrameProperty); - KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetBlendtime); - KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetChannel); - - KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetAction); - KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetBlendin); - KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetPriority); - KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetStart); - KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetEnd); - KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetFrame); - KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetProperty); - KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetFrameProperty); -// KX_PYMETHOD(BL_ActionActuator,GetChannel); - KX_PYMETHOD_DOC_NOARGS(BL_ShapeActionActuator,GetType); - KX_PYMETHOD_DOC_VARARGS(BL_ShapeActionActuator,SetType); - static PyObject* pyattr_get_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_action(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/Expressions/Value.cpp b/source/gameengine/Expressions/Value.cpp index 04bcc3a5561..130317d77e2 100644 --- a/source/gameengine/Expressions/Value.cpp +++ b/source/gameengine/Expressions/Value.cpp @@ -62,17 +62,9 @@ PyTypeObject CValue::Type = { }; PyMethodDef CValue::Methods[] = { - { "getName", (PyCFunction) CValue::sPyGetName, METH_NOARGS}, {NULL,NULL} //Sentinel }; -PyObject* CValue::PyGetName() -{ - ShowDeprecationWarning("getName()", "the name property"); - - return PyUnicode_FromString(this->GetName()); -} - /*#define CVALUE_DEBUG*/ #ifdef CVALUE_DEBUG int gRefCount; diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index 5f08736afde..7d4adcdb64f 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -242,8 +242,6 @@ public: static PyObject * pyattr_get_name(void * self, const KX_PYATTRIBUTE_DEF * attrdef); virtual PyObject* ConvertKeysToPython( void ); - - KX_PYMETHOD_NOARGS(CValue,GetName); #else CValue(); diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp index 11ea089270a..428362a0a24 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp @@ -143,10 +143,6 @@ PyTypeObject SCA_ActuatorSensor::Type = { }; PyMethodDef SCA_ActuatorSensor::Methods[] = { - //Deprecated functions ------> - {"getActuator", (PyCFunction) SCA_ActuatorSensor::sPyGetActuator, METH_NOARGS, (const char *)GetActuator_doc}, - {"setActuator", (PyCFunction) SCA_ActuatorSensor::sPySetActuator, METH_VARARGS, (const char *)SetActuator_doc}, - //<----- Deprecated {NULL,NULL} //Sentinel }; @@ -167,41 +163,4 @@ int SCA_ActuatorSensor::CheckActuator(void *self, const PyAttributeDef*) return 1; } -/* 3. getActuator */ -const char SCA_ActuatorSensor::GetActuator_doc[] = -"getActuator()\n" -"\tReturn the Actuator with which the sensor operates.\n"; -PyObject* SCA_ActuatorSensor::PyGetActuator() -{ - ShowDeprecationWarning("getActuator()", "the actuator property"); - return PyUnicode_FromString(m_checkactname); -} - -/* 4. setActuator */ -const char SCA_ActuatorSensor::SetActuator_doc[] = -"setActuator(name)\n" -"\t- name: string\n" -"\tSets the Actuator with which to operate. If there is no Actuator\n" -"\tof this name, the call is ignored.\n"; -PyObject* SCA_ActuatorSensor::PySetActuator(PyObject* args) -{ - ShowDeprecationWarning("setActuator()", "the actuator property"); - /* We should query whether the name exists. Or should we create a prop */ - /* on the fly? */ - char *actNameArg = NULL; - - if (!PyArg_ParseTuple(args, "s:setActuator", &actNameArg)) { - return NULL; - } - - SCA_IActuator* act = GetParent()->FindActuator(STR_String(actNameArg)); - if (act) { - m_checkactname = actNameArg; - m_actuator = act; - } else { - ; /* error: bad actuator name */ - } - Py_RETURN_NONE; -} - /* eof */ diff --git a/source/gameengine/GameLogic/SCA_ActuatorSensor.h b/source/gameengine/GameLogic/SCA_ActuatorSensor.h index cf8e735cad4..1a095148500 100644 --- a/source/gameengine/GameLogic/SCA_ActuatorSensor.h +++ b/source/gameengine/GameLogic/SCA_ActuatorSensor.h @@ -59,11 +59,6 @@ public: /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - - /* 3. setProperty */ - KX_PYMETHOD_DOC_VARARGS(SCA_ActuatorSensor,SetActuator); - /* 4. getProperty */ - KX_PYMETHOD_DOC_NOARGS(SCA_ActuatorSensor,GetActuator); static int CheckActuator(void *self, const PyAttributeDef*); }; diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.cpp b/source/gameengine/GameLogic/SCA_DelaySensor.cpp index 0d563db910e..0f67ddd56a5 100644 --- a/source/gameengine/GameLogic/SCA_DelaySensor.cpp +++ b/source/gameengine/GameLogic/SCA_DelaySensor.cpp @@ -152,16 +152,6 @@ PyTypeObject SCA_DelaySensor::Type = { }; PyMethodDef SCA_DelaySensor::Methods[] = { - //Deprecated functions ------> - /* setProperty */ - {"setDelay", (PyCFunction) SCA_DelaySensor::sPySetDelay, METH_VARARGS, (const char *)SetDelay_doc}, - {"setDuration", (PyCFunction) SCA_DelaySensor::sPySetDuration, METH_VARARGS, (const char *)SetDuration_doc}, - {"setRepeat", (PyCFunction) SCA_DelaySensor::sPySetRepeat, METH_VARARGS, (const char *)SetRepeat_doc}, - /* getProperty */ - {"getDelay", (PyCFunction) SCA_DelaySensor::sPyGetDelay, METH_NOARGS, (const char *)GetDelay_doc}, - {"getDuration", (PyCFunction) SCA_DelaySensor::sPyGetDuration, METH_NOARGS, (const char *)GetDuration_doc}, - {"getRepeat", (PyCFunction) SCA_DelaySensor::sPyGetRepeat, METH_NOARGS, (const char *)GetRepeat_doc}, - //<----- Deprecated {NULL,NULL} //Sentinel }; @@ -172,91 +162,4 @@ PyAttributeDef SCA_DelaySensor::Attributes[] = { { NULL } //Sentinel }; -const char SCA_DelaySensor::SetDelay_doc[] = -"setDelay(delay)\n" -"\t- delay: length of the initial OFF period as number of frame\n" -"\t 0 for immediate trigger\n" -"\tSet the initial delay before the positive trigger\n"; -PyObject* SCA_DelaySensor::PySetDelay(PyObject* args) -{ - ShowDeprecationWarning("setDelay()", "the delay property"); - int delay; - - if(!PyArg_ParseTuple(args, "i:setDelay", &delay)) { - return NULL; - } - if (delay < 0) { - PyErr_SetString(PyExc_ValueError, "Delay cannot be negative"); - return NULL; - } - m_delay = delay; - Py_RETURN_NONE; -} - -const char SCA_DelaySensor::SetDuration_doc[] = -"setDuration(duration)\n" -"\t- duration: length of the ON period in number of frame after the initial off period\n" -"\t 0 for no ON period\n" -"\tSet the duration of the ON pulse after initial delay.\n" -"\tIf > 0, a negative trigger is fired at the end of the ON pulse.\n"; -PyObject* SCA_DelaySensor::PySetDuration(PyObject* args) -{ - ShowDeprecationWarning("setDuration()", "the duration property"); - int duration; - - if(!PyArg_ParseTuple(args, "i:setDuration", &duration)) { - return NULL; - } - if (duration < 0) { - PyErr_SetString(PyExc_ValueError, "Duration cannot be negative"); - return NULL; - } - m_duration = duration; - Py_RETURN_NONE; -} - -const char SCA_DelaySensor::SetRepeat_doc[] = -"setRepeat(repeat)\n" -"\t- repeat: 1 if the initial OFF-ON cycle should be repeated indefinately\n" -"\t 0 if the initial OFF-ON cycle should run only once\n" -"\tSet the sensor repeat mode\n"; -PyObject* SCA_DelaySensor::PySetRepeat(PyObject* args) -{ - ShowDeprecationWarning("setRepeat()", "the repeat property"); - int repeat; - - if(!PyArg_ParseTuple(args, "i:setRepeat", &repeat)) { - return NULL; - } - m_repeat = (repeat != 0); - Py_RETURN_NONE; -} - -const char SCA_DelaySensor::GetDelay_doc[] = -"getDelay()\n" -"\tReturn the delay parameter value\n"; -PyObject* SCA_DelaySensor::PyGetDelay() -{ - ShowDeprecationWarning("getDelay()", "the delay property"); - return PyLong_FromSsize_t(m_delay); -} - -const char SCA_DelaySensor::GetDuration_doc[] = -"getDuration()\n" -"\tReturn the duration parameter value\n"; -PyObject* SCA_DelaySensor::PyGetDuration() -{ - ShowDeprecationWarning("getDuration()", "the duration property"); - return PyLong_FromSsize_t(m_duration); -} - -const char SCA_DelaySensor::GetRepeat_doc[] = -"getRepeat()\n" -"\tReturn the repeat parameter value\n"; -PyObject* SCA_DelaySensor::PyGetRepeat() -{ - ShowDeprecationWarning("getRepeat()", "the repeat property"); - return BoolToPyArg(m_repeat); -} - /* eof */ diff --git a/source/gameengine/GameLogic/SCA_DelaySensor.h b/source/gameengine/GameLogic/SCA_DelaySensor.h index 8270e8959b7..187a9179b5d 100644 --- a/source/gameengine/GameLogic/SCA_DelaySensor.h +++ b/source/gameengine/GameLogic/SCA_DelaySensor.h @@ -59,14 +59,6 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - /* setProperty */ - KX_PYMETHOD_DOC_VARARGS(SCA_DelaySensor,SetDelay); - KX_PYMETHOD_DOC_VARARGS(SCA_DelaySensor,SetDuration); - KX_PYMETHOD_DOC_VARARGS(SCA_DelaySensor,SetRepeat); - /* getProperty */ - KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetDelay); - KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetDuration); - KX_PYMETHOD_DOC_NOARGS(SCA_DelaySensor,GetRepeat); }; diff --git a/source/gameengine/GameLogic/SCA_IController.cpp b/source/gameengine/GameLogic/SCA_IController.cpp index 24c39563c28..7cfd2adc1d0 100644 --- a/source/gameengine/GameLogic/SCA_IController.cpp +++ b/source/gameengine/GameLogic/SCA_IController.cpp @@ -221,13 +221,6 @@ PyTypeObject SCA_IController::Type = { }; PyMethodDef SCA_IController::Methods[] = { - //Deprecated functions ------> - {"getSensor", (PyCFunction) SCA_IController::sPyGetSensor, METH_O}, - {"getActuator", (PyCFunction) SCA_IController::sPyGetActuator, METH_O}, - {"getSensors", (PyCFunction) SCA_IController::sPyGetSensors, METH_NOARGS}, - {"getActuators", (PyCFunction) SCA_IController::sPyGetActuators, METH_NOARGS}, - {"getState", (PyCFunction) SCA_IController::sPyGetState, METH_NOARGS}, - //<----- Deprecated {NULL,NULL} //Sentinel }; @@ -239,85 +232,6 @@ PyAttributeDef SCA_IController::Attributes[] = { { NULL } //Sentinel }; -PyObject* SCA_IController::PyGetActuators() -{ - ShowDeprecationWarning("getActuators()", "the actuators property"); - - PyObject* resultlist = PyList_New(m_linkedactuators.size()); - for (unsigned int index=0;indexGetProxy()); - } - - return resultlist; -} - -PyObject* SCA_IController::PyGetSensor(PyObject* value) -{ - ShowDeprecationWarning("getSensor(string)", "the sensors[string] property"); - - char *scriptArg = _PyUnicode_AsString(value); - if (scriptArg==NULL) { - PyErr_SetString(PyExc_TypeError, "controller.getSensor(string): Python Controller, expected a string (sensor name)"); - return NULL; - } - - for (unsigned int index=0;indexGetName(); - if (realname == scriptArg) - { - return sensor->GetProxy(); - } - } - - PyErr_Format(PyExc_AttributeError, "controller.getSensor(string): Python Controller, unable to find requested sensor \"%s\"", scriptArg); - return NULL; -} - -PyObject* SCA_IController::PyGetActuator(PyObject* value) -{ - ShowDeprecationWarning("getActuator(string)", "the actuators[string] property"); - - char *scriptArg = _PyUnicode_AsString(value); - if (scriptArg==NULL) { - PyErr_SetString(PyExc_TypeError, "controller.getActuator(string): Python Controller, expected a string (actuator name)"); - return NULL; - } - - for (unsigned int index=0;indexGetName() == scriptArg) - { - return actua->GetProxy(); - } - } - - PyErr_Format(PyExc_AttributeError, "controller.getActuator(string): Python Controller, unable to find requested actuator \"%s\"", scriptArg); - return NULL; -} - -PyObject* SCA_IController::PyGetSensors() -{ - ShowDeprecationWarning("getSensors()", "the sensors property"); - - PyObject* resultlist = PyList_New(m_linkedsensors.size()); - for (unsigned int index=0;indexGetProxy()); - } - - return resultlist; -} - -PyObject* SCA_IController::PyGetState() -{ - ShowDeprecationWarning("getState()", "the state property"); - return PyLong_FromSsize_t(m_statemask); -} - PyObject* SCA_IController::pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_IController* self= static_cast(self_v); diff --git a/source/gameengine/GameLogic/SCA_IController.h b/source/gameengine/GameLogic/SCA_IController.h index 523878bee26..202921c6986 100644 --- a/source/gameengine/GameLogic/SCA_IController.h +++ b/source/gameengine/GameLogic/SCA_IController.h @@ -97,12 +97,6 @@ public: } } } - - KX_PYMETHOD_NOARGS(SCA_IController,GetSensors); - KX_PYMETHOD_NOARGS(SCA_IController,GetActuators); - KX_PYMETHOD_O(SCA_IController,GetSensor); - KX_PYMETHOD_O(SCA_IController,GetActuator); - KX_PYMETHOD_NOARGS(SCA_IController,GetState); static PyObject* pyattr_get_state(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_sensors(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp index 2c64e02913d..f679d0ee487 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp @@ -199,11 +199,6 @@ PyTypeObject SCA_ILogicBrick::Type = { }; PyMethodDef SCA_ILogicBrick::Methods[] = { - // --> Deprecated - {"getOwner", (PyCFunction) SCA_ILogicBrick::sPyGetOwner, METH_NOARGS}, - {"getExecutePriority", (PyCFunction) SCA_ILogicBrick::sPyGetExecutePriority, METH_NOARGS}, - {"setExecutePriority", (PyCFunction) SCA_ILogicBrick::sPySetExecutePriority, METH_VARARGS}, - // <-- Deprecated {NULL,NULL} //Sentinel }; @@ -232,46 +227,6 @@ int SCA_ILogicBrick::CheckProperty(void *self, const PyAttributeDef *attrdef) return 0; } -PyObject* SCA_ILogicBrick::PyGetOwner() -{ - ShowDeprecationWarning("getOwner()", "the owner property"); - - CValue* parent = GetParent(); - if (parent) - { - return parent->GetProxy(); - } - - printf("ERROR: Python scriptblock without owner\n"); - Py_RETURN_NONE; //Int_FromLong(IsPositiveTrigger()); -} - - - -PyObject* SCA_ILogicBrick::PySetExecutePriority(PyObject* args) -{ - ShowDeprecationWarning("setExecutePriority()", "the executePriority property"); - - int priority=0; - - if (!PyArg_ParseTuple(args, "i:setExecutePriority", &priority)) { - return NULL; - } - - m_Execute_Priority = priority; - - Py_RETURN_NONE; -} - - - -PyObject* SCA_ILogicBrick::PyGetExecutePriority() -{ - ShowDeprecationWarning("getExecutePriority()", "the executePriority property"); - return PyLong_FromSsize_t(m_Execute_Priority); -} - - /*Attribute functions */ PyObject* SCA_ILogicBrick::pyattr_get_owner(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.h b/source/gameengine/GameLogic/SCA_ILogicBrick.h index 50679856802..ac533335f0b 100644 --- a/source/gameengine/GameLogic/SCA_ILogicBrick.h +++ b/source/gameengine/GameLogic/SCA_ILogicBrick.h @@ -126,10 +126,6 @@ public: // python methods - - KX_PYMETHOD_NOARGS(SCA_ILogicBrick,GetOwner); - KX_PYMETHOD_VARARGS(SCA_ILogicBrick,SetExecutePriority); - KX_PYMETHOD_NOARGS(SCA_ILogicBrick,GetExecutePriority); static PyObject* pyattr_get_owner(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/GameLogic/SCA_ISensor.cpp b/source/gameengine/GameLogic/SCA_ISensor.cpp index b018124dcca..497a5d1095a 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.cpp +++ b/source/gameengine/GameLogic/SCA_ISensor.cpp @@ -292,171 +292,6 @@ void SCA_ISensor::Activate(class SCA_LogicManager* logicmgr) /* Python Functions */ /* ----------------------------------------------- */ -//Deprecated Functions ------> -const char SCA_ISensor::IsPositive_doc[] = -"isPositive()\n" -"\tReturns whether the sensor is in an active state.\n"; -PyObject* SCA_ISensor::PyIsPositive() -{ - ShowDeprecationWarning("isPositive()", "the read-only positive property"); - int retval = GetState(); - return PyLong_FromSsize_t(retval); -} - -const char SCA_ISensor::IsTriggered_doc[] = -"isTriggered()\n" -"\tReturns whether the sensor has triggered the current controller.\n"; -PyObject* SCA_ISensor::PyIsTriggered() -{ - ShowDeprecationWarning("isTriggered()", "the read-only triggered property"); - // check with the current controller - int retval = 0; - if (SCA_PythonController::m_sCurrentController) - retval = SCA_PythonController::m_sCurrentController->IsTriggered(this); - return PyLong_FromSsize_t(retval); -} - -/** - * getUsePulseMode: getter for the pulse mode (KX_TRUE = on) - */ -const char SCA_ISensor::GetUsePosPulseMode_doc[] = -"getUsePosPulseMode()\n" -"\tReturns whether positive pulse mode is active.\n"; -PyObject* SCA_ISensor::PyGetUsePosPulseMode() -{ - ShowDeprecationWarning("getUsePosPulseMode()", "the usePosPulseMode property"); - return BoolToPyArg(m_pos_pulsemode); -} - -/** - * setUsePulseMode: setter for the pulse mode (KX_TRUE = on) - */ -const char SCA_ISensor::SetUsePosPulseMode_doc[] = -"setUsePosPulseMode(pulse?)\n" -"\t - pulse? : Pulse when a positive event occurs?\n" -"\t (KX_TRUE, KX_FALSE)\n" -"\tSet whether to do pulsing when positive pulses occur.\n"; -PyObject* SCA_ISensor::PySetUsePosPulseMode(PyObject* args) -{ - ShowDeprecationWarning("setUsePosPulseMode()", "the usePosPulseMode property"); - int pyarg = 0; - if(!PyArg_ParseTuple(args, "i:setUsePosPulseMode", &pyarg)) { return NULL; } - m_pos_pulsemode = PyArgToBool(pyarg); - Py_RETURN_NONE; -} - -/** - * getFrequency: getter for the pulse mode interval - */ -const char SCA_ISensor::GetFrequency_doc[] = -"getFrequency()\n" -"\tReturns the frequency of the updates in pulse mode.\n" ; -PyObject* SCA_ISensor::PyGetFrequency() -{ - ShowDeprecationWarning("getFrequency()", "the frequency property"); - return PyLong_FromSsize_t(m_pulse_frequency); -} - -/** - * setFrequency: setter for the pulse mode (KX_TRUE = on) - */ -const char SCA_ISensor::SetFrequency_doc[] = -"setFrequency(pulse_frequency)\n" -"\t- pulse_frequency: The frequency of the updates in pulse mode (integer)" -"\tSet the frequency of the updates in pulse mode.\n" -"\tIf the frequency is negative, it is set to 0.\n" ; -PyObject* SCA_ISensor::PySetFrequency(PyObject* args) -{ - ShowDeprecationWarning("setFrequency()", "the frequency property"); - int pulse_frequencyArg = 0; - - if(!PyArg_ParseTuple(args, "i:setFrequency", &pulse_frequencyArg)) { - return NULL; - } - - /* We can do three things here: clip, ignore and raise an exception. */ - /* Exceptions don't work yet, ignoring is not desirable now... */ - if (pulse_frequencyArg < 0) { - pulse_frequencyArg = 0; - }; - m_pulse_frequency = pulse_frequencyArg; - - Py_RETURN_NONE; -} - - -const char SCA_ISensor::GetInvert_doc[] = -"getInvert()\n" -"\tReturns whether or not pulses from this sensor are inverted.\n" ; -PyObject* SCA_ISensor::PyGetInvert() -{ - ShowDeprecationWarning("getInvert()", "the invert property"); - return BoolToPyArg(m_invert); -} - -const char SCA_ISensor::SetInvert_doc[] = -"setInvert(invert?)\n" -"\t- invert?: Invert the event-values? (KX_TRUE, KX_FALSE)\n" -"\tSet whether to invert pulses.\n"; -PyObject* SCA_ISensor::PySetInvert(PyObject* args) -{ - ShowDeprecationWarning("setInvert()", "the invert property"); - int pyarg = 0; - if(!PyArg_ParseTuple(args, "i:setInvert", &pyarg)) { return NULL; } - m_invert = PyArgToBool(pyarg); - Py_RETURN_NONE; -} - -const char SCA_ISensor::GetLevel_doc[] = -"getLevel()\n" -"\tReturns whether this sensor is a level detector or a edge detector.\n" -"\tIt makes a difference only in case of logic state transition (state actuator).\n" -"\tA level detector will immediately generate a pulse, negative or positive\n" -"\tdepending on the sensor condition, as soon as the state is activated.\n" -"\tA edge detector will wait for a state change before generating a pulse.\n"; -PyObject* SCA_ISensor::PyGetLevel() -{ - ShowDeprecationWarning("getLevel()", "the level property"); - return BoolToPyArg(m_level); -} - -const char SCA_ISensor::SetLevel_doc[] = -"setLevel(level?)\n" -"\t- level?: Detect level instead of edge? (KX_TRUE, KX_FALSE)\n" -"\tSet whether to detect level or edge transition when entering a state.\n"; -PyObject* SCA_ISensor::PySetLevel(PyObject* args) -{ - ShowDeprecationWarning("setLevel()", "the level property"); - int pyarg = 0; - if(!PyArg_ParseTuple(args, "i:setLevel", &pyarg)) { return NULL; } - m_level = PyArgToBool(pyarg); - Py_RETURN_NONE; -} - -const char SCA_ISensor::GetUseNegPulseMode_doc[] = -"getUseNegPulseMode()\n" -"\tReturns whether negative pulse mode is active.\n"; -PyObject* SCA_ISensor::PyGetUseNegPulseMode() -{ - ShowDeprecationWarning("getUseNegPulseMode()", "the useNegPulseMode property"); - return BoolToPyArg(m_neg_pulsemode); -} - -const char SCA_ISensor::SetUseNegPulseMode_doc[] = -"setUseNegPulseMode(pulse?)\n" -"\t - pulse? : Pulse when a negative event occurs?\n" -"\t (KX_TRUE, KX_FALSE)\n" -"\tSet whether to do pulsing when negative pulses occur.\n"; -PyObject* SCA_ISensor::PySetUseNegPulseMode(PyObject* args) -{ - ShowDeprecationWarning("setUseNegPulseMode()", "the useNegPulseMode property"); - int pyarg = 0; - if(!PyArg_ParseTuple(args, "i:setUseNegPulseMode", &pyarg)) { return NULL; } - m_neg_pulsemode = PyArgToBool(pyarg); - Py_RETURN_NONE; -} -//<------Deprecated - KX_PYMETHODDEF_DOC_NOARGS(SCA_ISensor, reset, "reset()\n" "\tReset sensor internal state, effect depends on the type of sensor and settings.\n" @@ -494,32 +329,6 @@ PyTypeObject SCA_ISensor::Type = { }; PyMethodDef SCA_ISensor::Methods[] = { - //Deprecated functions -----> - {"isPositive", (PyCFunction) SCA_ISensor::sPyIsPositive, - METH_NOARGS, (const char *)IsPositive_doc}, - {"isTriggered", (PyCFunction) SCA_ISensor::sPyIsTriggered, - METH_VARARGS, (const char *)IsTriggered_doc}, - {"getUsePosPulseMode", (PyCFunction) SCA_ISensor::sPyGetUsePosPulseMode, - METH_NOARGS, (const char *)GetUsePosPulseMode_doc}, - {"setUsePosPulseMode", (PyCFunction) SCA_ISensor::sPySetUsePosPulseMode, - METH_VARARGS, (const char *)SetUsePosPulseMode_doc}, - {"getFrequency", (PyCFunction) SCA_ISensor::sPyGetFrequency, - METH_NOARGS, (const char *)GetFrequency_doc}, - {"setFrequency", (PyCFunction) SCA_ISensor::sPySetFrequency, - METH_VARARGS, (const char *)SetFrequency_doc}, - {"getUseNegPulseMode", (PyCFunction) SCA_ISensor::sPyGetUseNegPulseMode, - METH_NOARGS, (const char *)GetUseNegPulseMode_doc}, - {"setUseNegPulseMode", (PyCFunction) SCA_ISensor::sPySetUseNegPulseMode, - METH_VARARGS, (const char *)SetUseNegPulseMode_doc}, - {"getInvert", (PyCFunction) SCA_ISensor::sPyGetInvert, - METH_NOARGS, (const char *)GetInvert_doc}, - {"setInvert", (PyCFunction) SCA_ISensor::sPySetInvert, - METH_VARARGS, (const char *)SetInvert_doc}, - {"getLevel", (PyCFunction) SCA_ISensor::sPyGetLevel, - METH_NOARGS, (const char *)GetLevel_doc}, - {"setLevel", (PyCFunction) SCA_ISensor::sPySetLevel, - METH_VARARGS, (const char *)SetLevel_doc}, - //<----- Deprecated KX_PYMETHODTABLE_NOARGS(SCA_ISensor, reset), {NULL,NULL} //Sentinel }; diff --git a/source/gameengine/GameLogic/SCA_ISensor.h b/source/gameengine/GameLogic/SCA_ISensor.h index 81864ab6a34..742b05bd88b 100644 --- a/source/gameengine/GameLogic/SCA_ISensor.h +++ b/source/gameengine/GameLogic/SCA_ISensor.h @@ -172,21 +172,6 @@ public: { return !m_links; } /* Python functions: */ - - //Deprecated functions -----> - KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,IsPositive); - KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,IsTriggered); - KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetUsePosPulseMode); - KX_PYMETHOD_DOC_VARARGS(SCA_ISensor,SetUsePosPulseMode); - KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetFrequency); - KX_PYMETHOD_DOC_VARARGS(SCA_ISensor,SetFrequency); - KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetUseNegPulseMode); - KX_PYMETHOD_DOC_VARARGS(SCA_ISensor,SetUseNegPulseMode); - KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetInvert); - KX_PYMETHOD_DOC_VARARGS(SCA_ISensor,SetInvert); - KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,GetLevel); - KX_PYMETHOD_DOC_VARARGS(SCA_ISensor,SetLevel); - //<------ KX_PYMETHOD_DOC_NOARGS(SCA_ISensor,reset); static PyObject* pyattr_get_triggered(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp index 76d35e6d615..4936b380352 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp @@ -273,24 +273,6 @@ PyTypeObject SCA_JoystickSensor::Type = { }; PyMethodDef SCA_JoystickSensor::Methods[] = { - //Deprecated functions ------> - {"getIndex", (PyCFunction) SCA_JoystickSensor::sPyGetIndex, METH_NOARGS, (const char *)GetIndex_doc}, - {"setIndex", (PyCFunction) SCA_JoystickSensor::sPySetIndex, METH_O, (const char *)SetIndex_doc}, - {"getAxis", (PyCFunction) SCA_JoystickSensor::sPyGetAxis, METH_NOARGS, (const char *)GetAxis_doc}, - {"setAxis", (PyCFunction) SCA_JoystickSensor::sPySetAxis, METH_VARARGS, (const char *)SetAxis_doc}, - {"getAxisValue", (PyCFunction) SCA_JoystickSensor::sPyGetAxisValue, METH_NOARGS, (const char *)GetAxisValue_doc}, - {"getThreshold", (PyCFunction) SCA_JoystickSensor::sPyGetThreshold, METH_NOARGS, (const char *)GetThreshold_doc}, - {"setThreshold", (PyCFunction) SCA_JoystickSensor::sPySetThreshold, METH_VARARGS, (const char *)SetThreshold_doc}, - {"getButton", (PyCFunction) SCA_JoystickSensor::sPyGetButton, METH_NOARGS, (const char *)GetButton_doc}, - {"setButton", (PyCFunction) SCA_JoystickSensor::sPySetButton, METH_O, (const char *)SetButton_doc}, - {"getHat", (PyCFunction) SCA_JoystickSensor::sPyGetHat, METH_NOARGS, (const char *)GetHat_doc}, - {"setHat", (PyCFunction) SCA_JoystickSensor::sPySetHat, METH_VARARGS, (const char *)SetHat_doc}, - {"getNumAxes", (PyCFunction) SCA_JoystickSensor::sPyNumberOfAxes, METH_NOARGS, (const char *)NumberOfAxes_doc}, - {"getNumButtons",(PyCFunction) SCA_JoystickSensor::sPyNumberOfButtons,METH_NOARGS, (const char *)NumberOfButtons_doc}, - {"getNumHats", (PyCFunction) SCA_JoystickSensor::sPyNumberOfHats, METH_NOARGS, (const char *)NumberOfHats_doc}, - {"isConnected", (PyCFunction) SCA_JoystickSensor::sPyConnected, METH_NOARGS, (const char *)Connected_doc}, - {"getButtonValue",(PyCFunction) SCA_JoystickSensor::sPyGetButtonValue, METH_NOARGS,(const char *)GetButtonValue_doc}, - //<----- Deprecated {"getButtonActiveList",(PyCFunction) SCA_JoystickSensor::sPyGetButtonActiveList, METH_NOARGS,(const char *)GetButtonActiveList_doc}, {"getButtonStatus",(PyCFunction) SCA_JoystickSensor::sPyGetButtonStatus, METH_VARARGS,(const char *)GetButtonStatus_doc}, {NULL,NULL} //Sentinel @@ -314,138 +296,6 @@ PyAttributeDef SCA_JoystickSensor::Attributes[] = { { NULL } //Sentinel }; - -/* get index ---------------------------------------------------------- */ -const char SCA_JoystickSensor::GetIndex_doc[] = -"getIndex\n" -"\tReturns the joystick index to use.\n"; -PyObject* SCA_JoystickSensor::PyGetIndex( ) { - ShowDeprecationWarning("getIndex()", "the index property"); - return PyLong_FromSsize_t(m_joyindex); -} - - -/* set index ---------------------------------------------------------- */ -const char SCA_JoystickSensor::SetIndex_doc[] = -"setIndex\n" -"\tSets the joystick index to use.\n"; -PyObject* SCA_JoystickSensor::PySetIndex( PyObject* value ) { - ShowDeprecationWarning("setIndex()", "the index property"); - int index = PyLong_AsSsize_t( value ); /* -1 on error, will raise an error in this case */ - if (index < 0 || index >= JOYINDEX_MAX) { - PyErr_SetString(PyExc_ValueError, "joystick index out of range or not an int"); - return NULL; - } - - m_joyindex = index; - Py_RETURN_NONE; -} - -/* get axis ---------------------------------------------------------- */ -const char SCA_JoystickSensor::GetAxis_doc[] = -"getAxis\n" -"\tReturns the current axis this sensor reacts to.\n"; -PyObject* SCA_JoystickSensor::PyGetAxis( ) { - ShowDeprecationWarning("getAxis()", "the axis property"); - return Py_BuildValue("[ii]",m_axis, m_axisf); -} - - -/* set axis ---------------------------------------------------------- */ -const char SCA_JoystickSensor::SetAxis_doc[] = -"setAxis\n" -"\tSets the current axis this sensor reacts to.\n"; -PyObject* SCA_JoystickSensor::PySetAxis( PyObject* args ) { - ShowDeprecationWarning("setAxis()", "the axis property"); - - int axis,axisflag; - if(!PyArg_ParseTuple(args, "ii:setAxis", &axis, &axisflag)){ - return NULL; - } - m_axis = axis; - m_axisf = axisflag; - - CheckAxis((void *)this, NULL); /* clamp values */ - Py_RETURN_NONE; -} - - -/* get axis value ----------------------------------------------------- */ -const char SCA_JoystickSensor::GetAxisValue_doc[] = -"getAxisValue\n" -"\tReturns a list of the values for the current state of each axis.\n"; -PyObject* SCA_JoystickSensor::PyGetAxisValue( ) { - ShowDeprecationWarning("getAxisValue()", "the axisPosition property"); - SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex); - - int axis_index= joy->GetNumberOfAxes(); - PyObject *list= PyList_New(axis_index); - - while(axis_index--) { - PyList_SET_ITEM(list, axis_index, PyLong_FromSsize_t(joy->GetAxisPosition(axis_index))); - } - - return list; -} - - -/* get threshold ----------------------------------------------------- */ -const char SCA_JoystickSensor::GetThreshold_doc[] = -"getThreshold\n" -"\tReturns the threshold of the axis.\n"; -PyObject* SCA_JoystickSensor::PyGetThreshold( ) { - ShowDeprecationWarning("getThreshold()", "the threshold property"); - return PyLong_FromSsize_t(m_precision); -} - - -/* set threshold ----------------------------------------------------- */ -const char SCA_JoystickSensor::SetThreshold_doc[] = -"setThreshold\n" -"\tSets the threshold of the axis.\n"; -PyObject* SCA_JoystickSensor::PySetThreshold( PyObject* args ) { - ShowDeprecationWarning("setThreshold()", "the threshold property"); - int thresh; - if(!PyArg_ParseTuple(args, "i:setThreshold", &thresh)){ - return NULL; - } - m_precision = thresh; - Py_RETURN_NONE; -} - -/* get button -------------------------------------------------------- */ -const char SCA_JoystickSensor::GetButton_doc[] = -"getButton\n" -"\tReturns the current button this sensor is checking.\n"; -PyObject* SCA_JoystickSensor::PyGetButton( ) { - ShowDeprecationWarning("getButton()", "the button property"); - return PyLong_FromSsize_t(m_button); -} - -/* set button -------------------------------------------------------- */ -const char SCA_JoystickSensor::SetButton_doc[] = -"setButton\n" -"\tSets the button the sensor reacts to.\n"; -PyObject* SCA_JoystickSensor::PySetButton( PyObject* value ) { - ShowDeprecationWarning("setButton()", "the button property"); - int button = PyLong_AsSsize_t(value); - if(button==-1 && PyErr_Occurred()) { - PyErr_SetString(PyExc_ValueError, "expected an int"); - return NULL; - } - m_button = button; - Py_RETURN_NONE; -} - -/* get button value -------------------------------------------------- */ -const char SCA_JoystickSensor::GetButtonValue_doc[] = -"getButtonValue\n" -"\tReturns a list containing the indicies of the current pressed state of each button.\n"; -PyObject* SCA_JoystickSensor::PyGetButtonValue( ) { - ShowDeprecationWarning("getButtonValue()", "getButtonActiveList"); - return PyGetButtonActiveList( ); -} - /* get button active list -------------------------------------------------- */ const char SCA_JoystickSensor::GetButtonActiveList_doc[] = "getButtonActiveList\n" @@ -485,75 +335,6 @@ PyObject* SCA_JoystickSensor::PyGetButtonStatus( PyObject* args ) { return PyBool_FromLong(0); } -/* get hat ----------------------------------------------------------- */ -const char SCA_JoystickSensor::GetHat_doc[] = -"getHat\n" -"\tReturns the current direction of the hat.\n"; -PyObject* SCA_JoystickSensor::PyGetHat( ) { - ShowDeprecationWarning("getHat()", "the hat property"); - return Py_BuildValue("[ii]",m_hat, m_hatf); -} - - -/* set hat ----------------------------------------------------------- */ -const char SCA_JoystickSensor::SetHat_doc[] = -"setHat\n" -"\tSets the hat the sensor reacts to.\n"; -PyObject* SCA_JoystickSensor::PySetHat( PyObject* args ) { - ShowDeprecationWarning("setHat()", "the hat property"); - int hat,hatflag; - if(!PyArg_ParseTuple(args, "ii:setHat", &hat, &hatflag)){ - return NULL; - } - m_hat = hat; - m_hatf = hatflag; - - CheckHat((void *)this, NULL); /* clamp values */ - Py_RETURN_NONE; -} - - -/* get # of ----------------------------------------------------- */ -const char SCA_JoystickSensor::NumberOfAxes_doc[] = -"getNumAxes\n" -"\tReturns the number of axes .\n"; -PyObject* SCA_JoystickSensor::PyNumberOfAxes( ) { - ShowDeprecationWarning("getNumAxes()", "the numAxis property"); - SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex); - // when the joystick is null their is 0 exis still. dumb but scripters should use isConnected() - return PyLong_FromSsize_t( joy ? joy->GetNumberOfAxes() : 0 ); -} - - -const char SCA_JoystickSensor::NumberOfButtons_doc[] = -"getNumButtons\n" -"\tReturns the number of buttons .\n"; -PyObject* SCA_JoystickSensor::PyNumberOfButtons( ) { - ShowDeprecationWarning("getNumButtons()", "the numButtons property"); - SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex); - return PyLong_FromSsize_t( joy ? joy->GetNumberOfButtons() : 0 ); -} - - -const char SCA_JoystickSensor::NumberOfHats_doc[] = -"getNumHats\n" -"\tReturns the number of hats .\n"; -PyObject* SCA_JoystickSensor::PyNumberOfHats( ) { - ShowDeprecationWarning("getNumHats()", "the numHats property"); - SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex); - return PyLong_FromSsize_t( joy ? joy->GetNumberOfHats() : 0 ); -} - -const char SCA_JoystickSensor::Connected_doc[] = -"getConnected\n" -"\tReturns True if a joystick is connected at this joysticks index.\n"; -PyObject* SCA_JoystickSensor::PyConnected( ) { - ShowDeprecationWarning("getConnected()", "the connected property"); - SCA_Joystick *joy = ((SCA_JoystickManager *)m_eventmgr)->GetJoystickDevice(m_joyindex); - return PyBool_FromLong( joy ? joy->Connected() : 0 ); -} - - PyObject* SCA_JoystickSensor::pyattr_get_axis_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_JoystickSensor* self= static_cast(self_v); diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.h b/source/gameengine/GameLogic/SCA_JoystickSensor.h index 1189b1ec18c..b793c591ac1 100644 --- a/source/gameengine/GameLogic/SCA_JoystickSensor.h +++ b/source/gameengine/GameLogic/SCA_JoystickSensor.h @@ -122,28 +122,8 @@ public: /* --------------------------------------------------------------------- */ /* Joystick Index */ - KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetIndex); - KX_PYMETHOD_DOC_O(SCA_JoystickSensor,SetIndex); - /* Axes*/ - KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetAxis); - KX_PYMETHOD_DOC_VARARGS(SCA_JoystickSensor,SetAxis); - KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetAxisValue); - KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetThreshold); - KX_PYMETHOD_DOC_VARARGS(SCA_JoystickSensor,SetThreshold); - /* Buttons */ - KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetButton); - KX_PYMETHOD_DOC_O(SCA_JoystickSensor,SetButton); - KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetButtonValue); KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetButtonActiveList); KX_PYMETHOD_DOC_VARARGS(SCA_JoystickSensor,GetButtonStatus); - /* Hats */ - KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,GetHat); - KX_PYMETHOD_DOC_VARARGS(SCA_JoystickSensor,SetHat); - /* number of */ - KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,NumberOfAxes); - KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,NumberOfButtons); - KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,NumberOfHats); - KX_PYMETHOD_DOC_NOARGS(SCA_JoystickSensor,Connected); static PyObject* pyattr_get_axis_values(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_axis_single(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp index 13b32b5446c..d2e3871fec2 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp @@ -408,184 +408,6 @@ void SCA_KeyboardSensor::LogKeystrokes(void) /* Python Functions */ /* ------------------------------------------------------------------------- */ -//Deprecated -----> -/** 1. GetKey : check which key this sensor looks at */ -const char SCA_KeyboardSensor::GetKey_doc[] = -"getKey()\n" -"\tReturn the code of the key this sensor is listening to.\n" ; -PyObject* SCA_KeyboardSensor::PyGetKey() -{ - ShowDeprecationWarning("getKey()", "the key property"); - return PyLong_FromSsize_t(m_hotkey); -} - -/** 2. SetKey: change the key to look at */ -const char SCA_KeyboardSensor::SetKey_doc[] = -"setKey(keycode)\n" -"\t- keycode: any code from GameKeys\n" -"\tSet the key this sensor should listen to.\n" ; -PyObject* SCA_KeyboardSensor::PySetKey(PyObject* args) -{ - ShowDeprecationWarning("setKey()", "the key property"); - int keyCode; - - if(!PyArg_ParseTuple(args, "i:setKey", &keyCode)) { - return NULL; - } - - /* Since we have symbolic constants for this in Python, we don't guard */ - /* anything. It's up to the user to provide a sensible number. */ - m_hotkey = keyCode; - - Py_RETURN_NONE; -} - -/** 3. GetHold1 : set the first bucky bit */ -const char SCA_KeyboardSensor::GetHold1_doc[] = -"getHold1()\n" -"\tReturn the code of the first key modifier to the key this \n" -"\tsensor is listening to.\n" ; -PyObject* SCA_KeyboardSensor::PyGetHold1() -{ - ShowDeprecationWarning("getHold1()", "the hold1 property"); - return PyLong_FromSsize_t(m_qual); -} - -/** 4. SetHold1: change the first bucky bit */ -const char SCA_KeyboardSensor::SetHold1_doc[] = -"setHold1(keycode)\n" -"\t- keycode: any code from GameKeys\n" -"\tSet the first modifier to the key this sensor should listen to.\n" ; -PyObject* SCA_KeyboardSensor::PySetHold1(PyObject* args) -{ - ShowDeprecationWarning("setHold1()", "the hold1 property"); - int keyCode; - - if(!PyArg_ParseTuple(args, "i:setHold1", &keyCode)) { - return NULL; - } - - /* Since we have symbolic constants for this in Python, we don't guard */ - /* anything. It's up to the user to provide a sensible number. */ - m_qual = keyCode; - - Py_RETURN_NONE; -} - -/** 5. GetHold2 : get the second bucky bit */ -const char SCA_KeyboardSensor::GetHold2_doc[] = -"getHold2()\n" -"\tReturn the code of the second key modifier to the key this \n" -"\tsensor is listening to.\n" ; -PyObject* SCA_KeyboardSensor::PyGetHold2() -{ - ShowDeprecationWarning("getHold2()", "the hold2 property"); - return PyLong_FromSsize_t(m_qual2); -} - -/** 6. SetHold2: change the second bucky bit */ -const char SCA_KeyboardSensor::SetHold2_doc[] = -"setHold2(keycode)\n" -"\t- keycode: any code from GameKeys\n" -"\tSet the first modifier to the key this sensor should listen to.\n" ; -PyObject* SCA_KeyboardSensor::PySetHold2(PyObject* args) -{ - ShowDeprecationWarning("setHold2()", "the hold2 property"); - int keyCode; - - if(!PyArg_ParseTuple(args, "i:setHold2", &keyCode)) { - return NULL; - } - - /* Since we have symbolic constants for this in Python, we don't guard */ - /* anything. It's up to the user to provide a sensible number. */ - m_qual2 = keyCode; - - Py_RETURN_NONE; -} - - -const char SCA_KeyboardSensor::GetPressedKeys_doc[] = -"getPressedKeys()\n" -"\tGet a list of pressed keys that have either been pressed, or just released this frame.\n" ; - -PyObject* SCA_KeyboardSensor::PyGetPressedKeys() -{ - ShowDeprecationWarning("getPressedKeys()", "events"); - - SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)m_eventmgr)->GetInputDevice(); - - int num = inputdev->GetNumJustEvents(); - PyObject* resultlist = PyList_New(num); - - if (num > 0) - { - - int index = 0; - - for (int i=SCA_IInputDevice::KX_BEGINKEY ; i<= SCA_IInputDevice::KX_ENDKEY;i++) - { - const SCA_InputEvent & inevent = inputdev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) i); - if ((inevent.m_status == SCA_InputEvent::KX_JUSTACTIVATED) - || (inevent.m_status == SCA_InputEvent::KX_JUSTRELEASED)) - { - PyObject* keypair = PyList_New(2); - PyList_SET_ITEM(keypair,0,PyLong_FromSsize_t(i)); - PyList_SET_ITEM(keypair,1,PyLong_FromSsize_t(inevent.m_status)); - PyList_SET_ITEM(resultlist,index,keypair); - index++; - - if (index >= num) /* should not happen */ - break; - } - } - } - - return resultlist; -} - - - -const char SCA_KeyboardSensor::GetCurrentlyPressedKeys_doc[] = -"getCurrentlyPressedKeys()\n" -"\tGet a list of keys that are currently pressed.\n" ; - -PyObject* SCA_KeyboardSensor::PyGetCurrentlyPressedKeys() -{ - ShowDeprecationWarning("getCurrentlyPressedKeys()", "events"); - - SCA_IInputDevice* inputdev = ((SCA_KeyboardManager *)m_eventmgr)->GetInputDevice(); - - int num = inputdev->GetNumActiveEvents(); - PyObject* resultlist = PyList_New(num); - - if (num > 0) - { - int index = 0; - - for (int i=SCA_IInputDevice::KX_BEGINKEY ; i<= SCA_IInputDevice::KX_ENDKEY;i++) - { - const SCA_InputEvent & inevent = inputdev->GetEventValue((SCA_IInputDevice::KX_EnumInputs) i); - if ( (inevent.m_status == SCA_InputEvent::KX_ACTIVE) - || (inevent.m_status == SCA_InputEvent::KX_JUSTACTIVATED)) - { - PyObject* keypair = PyList_New(2); - PyList_SET_ITEM(keypair,0,PyLong_FromSsize_t(i)); - PyList_SET_ITEM(keypair,1,PyLong_FromSsize_t(inevent.m_status)); - PyList_SET_ITEM(resultlist,index,keypair); - index++; - - if (index >= num) /* should never happen */ - break; - } - } - } - - return resultlist; -} - -//<---- Deprecated - KX_PYMETHODDEF_DOC_O(SCA_KeyboardSensor, getKeyStatus, "getKeyStatus(keycode)\n" "\tGet the given key's status (KX_NO_INPUTSTATUS, KX_JUSTACTIVATED, KX_ACTIVE or KX_JUSTRELEASED).\n") @@ -635,16 +457,6 @@ PyTypeObject SCA_KeyboardSensor::Type = { }; PyMethodDef SCA_KeyboardSensor::Methods[] = { - //Deprecated functions ------> - {"getKey", (PyCFunction) SCA_KeyboardSensor::sPyGetKey, METH_NOARGS, (const char *)GetKey_doc}, - {"setKey", (PyCFunction) SCA_KeyboardSensor::sPySetKey, METH_VARARGS, (const char *)SetKey_doc}, - {"getHold1", (PyCFunction) SCA_KeyboardSensor::sPyGetHold1, METH_NOARGS, (const char *)GetHold1_doc}, - {"setHold1", (PyCFunction) SCA_KeyboardSensor::sPySetHold1, METH_VARARGS, (const char *)SetHold1_doc}, - {"getHold2", (PyCFunction) SCA_KeyboardSensor::sPyGetHold2, METH_NOARGS, (const char *)GetHold2_doc}, - {"setHold2", (PyCFunction) SCA_KeyboardSensor::sPySetHold2, METH_VARARGS, (const char *)SetHold2_doc}, - {"getPressedKeys", (PyCFunction) SCA_KeyboardSensor::sPyGetPressedKeys, METH_NOARGS, (const char *)GetPressedKeys_doc}, - {"getCurrentlyPressedKeys", (PyCFunction) SCA_KeyboardSensor::sPyGetCurrentlyPressedKeys, METH_NOARGS, (const char *)GetCurrentlyPressedKeys_doc}, - //<----- Deprecated KX_PYMETHODTABLE_O(SCA_KeyboardSensor, getKeyStatus), {NULL,NULL} //Sentinel }; diff --git a/source/gameengine/GameLogic/SCA_KeyboardSensor.h b/source/gameengine/GameLogic/SCA_KeyboardSensor.h index bce56b800e6..d7e0f301a9d 100644 --- a/source/gameengine/GameLogic/SCA_KeyboardSensor.h +++ b/source/gameengine/GameLogic/SCA_KeyboardSensor.h @@ -107,25 +107,6 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - //Deprecated functions -----> - /** 1. GetKey : check which key this sensor looks at */ - KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,GetKey); - /** 2. SetKey: change the key to look at */ - KX_PYMETHOD_DOC_VARARGS(SCA_KeyboardSensor,SetKey); - /** 3. GetHold1 : set the first bucky bit */ - KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,GetHold1); - /** 4. SetHold1: change the first bucky bit */ - KX_PYMETHOD_DOC_VARARGS(SCA_KeyboardSensor,SetHold1); - /** 5. GetHold2 : set the second bucky bit */ - KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,GetHold2); - /** 6. SetHold2: change the second bucky bit */ - KX_PYMETHOD_DOC_VARARGS(SCA_KeyboardSensor,SetHold2); - /** 9. GetPressedKeys: */ - KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,GetPressedKeys); - /** 9. GetCurrrentlyPressedKeys: */ - KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,GetCurrentlyPressedKeys); - // <------ - // KeyEvents: KX_PYMETHOD_DOC_NOARGS(SCA_KeyboardSensor,getEventList); // KeyStatus: diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.cpp b/source/gameengine/GameLogic/SCA_MouseSensor.cpp index e19b5a3956b..9d32682eaa9 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.cpp +++ b/source/gameengine/GameLogic/SCA_MouseSensor.cpp @@ -243,30 +243,6 @@ bool SCA_MouseSensor::isValid(SCA_MouseSensor::KX_MOUSESENSORMODE m) /* Python functions */ /* ------------------------------------------------------------------------- */ -//Deprecated functions ------> -/* get x position ---------------------------------------------------------- */ -const char SCA_MouseSensor::GetXPosition_doc[] = -"getXPosition\n" -"\tReturns the x-coordinate of the mouse sensor, in frame coordinates.\n" -"\tThe lower-left corner is the origin. The coordinate is given in\n" -"\tpixels\n"; -PyObject* SCA_MouseSensor::PyGetXPosition() { - ShowDeprecationWarning("getXPosition()", "the position property"); - return PyLong_FromSsize_t(m_x); -} - -/* get y position ---------------------------------------------------------- */ -const char SCA_MouseSensor::GetYPosition_doc[] = -"getYPosition\n" -"\tReturns the y-coordinate of the mouse sensor, in frame coordinates.\n" -"\tThe lower-left corner is the origin. The coordinate is given in\n" -"\tpixels\n"; -PyObject* SCA_MouseSensor::PyGetYPosition() { - ShowDeprecationWarning("getYPosition()", "the position property"); - return PyLong_FromSsize_t(m_y); -} -//<----- Deprecated - KX_PYMETHODDEF_DOC_O(SCA_MouseSensor, getButtonStatus, "getButtonStatus(button)\n" "\tGet the given button's status (KX_INPUT_NONE, KX_INPUT_NONE, KX_INPUT_JUST_ACTIVATED, KX_INPUT_ACTIVE, KX_INPUT_JUST_RELEASED).\n") @@ -316,10 +292,6 @@ PyTypeObject SCA_MouseSensor::Type = { }; PyMethodDef SCA_MouseSensor::Methods[] = { - //Deprecated functions ------> - {"getXPosition", (PyCFunction) SCA_MouseSensor::sPyGetXPosition, METH_VARARGS, (const char *)GetXPosition_doc}, - {"getYPosition", (PyCFunction) SCA_MouseSensor::sPyGetYPosition, METH_VARARGS, (const char *)GetYPosition_doc}, - //<----- Deprecated KX_PYMETHODTABLE_O(SCA_MouseSensor, getButtonStatus), {NULL,NULL} //Sentinel }; diff --git a/source/gameengine/GameLogic/SCA_MouseSensor.h b/source/gameengine/GameLogic/SCA_MouseSensor.h index ad74a77a219..a679e605428 100644 --- a/source/gameengine/GameLogic/SCA_MouseSensor.h +++ b/source/gameengine/GameLogic/SCA_MouseSensor.h @@ -106,13 +106,6 @@ class SCA_MouseSensor : public SCA_ISensor /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - - //Deprecated functions -----> - /* read x-coordinate */ - KX_PYMETHOD_DOC_NOARGS(SCA_MouseSensor,GetXPosition); - /* read y-coordinate */ - KX_PYMETHOD_DOC_NOARGS(SCA_MouseSensor,GetYPosition); - //<----- deprecated // get button status KX_PYMETHOD_DOC_O(SCA_MouseSensor,getButtonStatus); diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp index 5afb537c28a..9446487cdb7 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.cpp +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.cpp @@ -250,12 +250,6 @@ PyTypeObject SCA_PropertyActuator::Type = { }; PyMethodDef SCA_PropertyActuator::Methods[] = { - //Deprecated functions ------> - {"setProperty", (PyCFunction) SCA_PropertyActuator::sPySetProperty, METH_VARARGS, (const char *)SetProperty_doc}, - {"getProperty", (PyCFunction) SCA_PropertyActuator::sPyGetProperty, METH_VARARGS, (const char *)GetProperty_doc}, - {"setValue", (PyCFunction) SCA_PropertyActuator::sPySetValue, METH_VARARGS, (const char *)SetValue_doc}, - {"getValue", (PyCFunction) SCA_PropertyActuator::sPyGetValue, METH_VARARGS, (const char *)GetValue_doc}, - //<----- Deprecated {NULL,NULL} //Sentinel }; @@ -266,71 +260,4 @@ PyAttributeDef SCA_PropertyActuator::Attributes[] = { { NULL } //Sentinel }; -/* 1. setProperty */ -const char SCA_PropertyActuator::SetProperty_doc[] = -"setProperty(name)\n" -"\t- name: string\n" -"\tSet the property on which to operate. If there is no property\n" -"\tof this name, the call is ignored.\n"; -PyObject* SCA_PropertyActuator::PySetProperty(PyObject* args, PyObject* kwds) -{ - ShowDeprecationWarning("setProperty()", "the 'propName' property"); - /* Check whether the name exists first ! */ - char *nameArg; - if (!PyArg_ParseTuple(args, "s:setProperty", &nameArg)) { - return NULL; - } - - CValue* prop = GetParent()->FindIdentifier(nameArg); - - if (!prop->IsError()) { - m_propname = nameArg; - } else { - ; /* not found ... */ - } - prop->Release(); - - Py_RETURN_NONE; -} - -/* 2. getProperty */ -const char SCA_PropertyActuator::GetProperty_doc[] = -"getProperty(name)\n" -"\tReturn the property on which the actuator operates.\n"; -PyObject* SCA_PropertyActuator::PyGetProperty(PyObject* args, PyObject* kwds) -{ - ShowDeprecationWarning("getProperty()", "the 'propName' property"); - return PyUnicode_FromString(m_propname); -} - -/* 3. setValue */ -const char SCA_PropertyActuator::SetValue_doc[] = -"setValue(value)\n" -"\t- value: string\n" -"\tSet the value with which the actuator operates. If the value\n" -"\tis not compatible with the type of the property, the subsequent\n" -"\t action is ignored.\n"; -PyObject* SCA_PropertyActuator::PySetValue(PyObject* args, PyObject* kwds) -{ - ShowDeprecationWarning("setValue()", "the value property"); - char *valArg; - if(!PyArg_ParseTuple(args, "s:setValue", &valArg)) { - return NULL; - } - - if (valArg) m_exprtxt = valArg; - - Py_RETURN_NONE; -} - -/* 4. getValue */ -const char SCA_PropertyActuator::GetValue_doc[] = -"getValue()\n" -"\tReturns the value with which the actuator operates.\n"; -PyObject* SCA_PropertyActuator::PyGetValue(PyObject* args, PyObject* kwds) -{ - ShowDeprecationWarning("getValue()", "the value property"); - return PyUnicode_FromString(m_exprtxt); -} - /* eof */ diff --git a/source/gameengine/GameLogic/SCA_PropertyActuator.h b/source/gameengine/GameLogic/SCA_PropertyActuator.h index 8fb2e7a7bc5..833547a5cd3 100644 --- a/source/gameengine/GameLogic/SCA_PropertyActuator.h +++ b/source/gameengine/GameLogic/SCA_PropertyActuator.h @@ -83,14 +83,6 @@ public: /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - - // python wrapped methods - KX_PYMETHOD_DOC(SCA_PropertyActuator,SetProperty); - KX_PYMETHOD_DOC(SCA_PropertyActuator,GetProperty); - KX_PYMETHOD_DOC(SCA_PropertyActuator,SetValue); - KX_PYMETHOD_DOC(SCA_PropertyActuator,GetValue); - - /* 5. - ... setObject, getObject, setProp2, getProp2, setMode, getMode*/ }; diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.cpp b/source/gameengine/GameLogic/SCA_PropertySensor.cpp index 96c769bd3d3..9c09c8410fb 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.cpp +++ b/source/gameengine/GameLogic/SCA_PropertySensor.cpp @@ -324,14 +324,6 @@ PyTypeObject SCA_PropertySensor::Type = { }; PyMethodDef SCA_PropertySensor::Methods[] = { - //Deprecated functions ------> - {"getType", (PyCFunction) SCA_PropertySensor::sPyGetType, METH_NOARGS, (const char *)GetType_doc}, - {"setType", (PyCFunction) SCA_PropertySensor::sPySetType, METH_VARARGS, (const char *)SetType_doc}, - {"getProperty", (PyCFunction) SCA_PropertySensor::sPyGetProperty, METH_NOARGS, (const char *)GetProperty_doc}, - {"setProperty", (PyCFunction) SCA_PropertySensor::sPySetProperty, METH_VARARGS, (const char *)SetProperty_doc}, - {"getValue", (PyCFunction) SCA_PropertySensor::sPyGetValue, METH_NOARGS, (const char *)GetValue_doc}, - {"setValue", (PyCFunction) SCA_PropertySensor::sPySetValue, METH_VARARGS, (const char *)SetValue_doc}, - //<----- Deprecated {NULL,NULL} //Sentinel }; @@ -342,111 +334,4 @@ PyAttributeDef SCA_PropertySensor::Attributes[] = { { NULL } //Sentinel }; -/* 1. getType */ -const char SCA_PropertySensor::GetType_doc[] = -"getType()\n" -"\tReturns the type of check this sensor performs.\n"; -PyObject* SCA_PropertySensor::PyGetType() -{ - ShowDeprecationWarning("getType()", "the mode property"); - return PyLong_FromSsize_t(m_checktype); -} - -/* 2. setType */ -const char SCA_PropertySensor::SetType_doc[] = -"setType(type)\n" -"\t- type: KX_PROPSENSOR_EQUAL, KX_PROPSENSOR_NOTEQUAL,\n" -"\t KX_PROPSENSOR_INTERVAL, KX_PROPSENSOR_CHANGED,\n" -"\t or KX_PROPSENSOR_EXPRESSION.\n" -"\tSet the type of check to perform.\n"; -PyObject* SCA_PropertySensor::PySetType(PyObject* args) -{ - ShowDeprecationWarning("setType()", "the mode property"); - int typeArg; - - if (!PyArg_ParseTuple(args, "i:setType", &typeArg)) { - return NULL; - } - - if ( (typeArg > KX_PROPSENSOR_NODEF) - && (typeArg < KX_PROPSENSOR_MAX) ) { - m_checktype = typeArg; - } - - Py_RETURN_NONE; -} - -/* 3. getProperty */ -const char SCA_PropertySensor::GetProperty_doc[] = -"getProperty()\n" -"\tReturn the property with which the sensor operates.\n"; -PyObject* SCA_PropertySensor::PyGetProperty() -{ - ShowDeprecationWarning("getProperty()", "the 'propName' property"); - return PyUnicode_FromString(m_checkpropname); -} - -/* 4. setProperty */ -const char SCA_PropertySensor::SetProperty_doc[] = -"setProperty(name)\n" -"\t- name: string\n" -"\tSets the property with which to operate. If there is no property\n" -"\tof this name, the call is ignored.\n"; -PyObject* SCA_PropertySensor::PySetProperty(PyObject* args) -{ - ShowDeprecationWarning("setProperty()", "the 'propName' property"); - /* We should query whether the name exists. Or should we create a prop */ - /* on the fly? */ - char *propNameArg = NULL; - - if (!PyArg_ParseTuple(args, "s:setProperty", &propNameArg)) { - return NULL; - } - - CValue *prop = FindIdentifier(STR_String(propNameArg)); - if (!prop->IsError()) { - m_checkpropname = propNameArg; - } else { - ; /* error: bad property name */ - } - prop->Release(); - Py_RETURN_NONE; -} - -/* 5. getValue */ -const char SCA_PropertySensor::GetValue_doc[] = -"getValue()\n" -"\tReturns the value with which the sensor operates.\n"; -PyObject* SCA_PropertySensor::PyGetValue() -{ - ShowDeprecationWarning("getValue()", "the value property"); - return PyUnicode_FromString(m_checkpropval); -} - -/* 6. setValue */ -const char SCA_PropertySensor::SetValue_doc[] = -"setValue(value)\n" -"\t- value: string\n" -"\tSet the value with which the sensor operates. If the value\n" -"\tis not compatible with the type of the property, the subsequent\n" -"\t action is ignored.\n"; -PyObject* SCA_PropertySensor::PySetValue(PyObject* args) -{ - ShowDeprecationWarning("setValue()", "the value property"); - /* Here, we need to check whether the value is 'valid' for this property.*/ - /* We know that the property exists, or is NULL. */ - char *propValArg = NULL; - - if(!PyArg_ParseTuple(args, "s:setValue", &propValArg)) { - return NULL; - } - STR_String oldval = m_checkpropval; - m_checkpropval = propValArg; - if (validValueForProperty(m_proxy, NULL)) { - m_checkpropval = oldval; - return NULL; - } - Py_RETURN_NONE; -} - /* eof */ diff --git a/source/gameengine/GameLogic/SCA_PropertySensor.h b/source/gameengine/GameLogic/SCA_PropertySensor.h index 3513fcdf5ae..a5bbfc8438b 100644 --- a/source/gameengine/GameLogic/SCA_PropertySensor.h +++ b/source/gameengine/GameLogic/SCA_PropertySensor.h @@ -88,18 +88,6 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - /* 1. getType */ - KX_PYMETHOD_DOC_NOARGS(SCA_PropertySensor,GetType); - /* 2. setType */ - KX_PYMETHOD_DOC_VARARGS(SCA_PropertySensor,SetType); - /* 3. setProperty */ - KX_PYMETHOD_DOC_VARARGS(SCA_PropertySensor,SetProperty); - /* 4. getProperty */ - KX_PYMETHOD_DOC_NOARGS(SCA_PropertySensor,GetProperty); - /* 5. getValue */ - KX_PYMETHOD_DOC_NOARGS(SCA_PropertySensor,GetValue); - /* 6. setValue */ - KX_PYMETHOD_DOC_VARARGS(SCA_PropertySensor,SetValue); /** * Test whether this is a sensible value (type check) */ diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index 8ece7fb4ae1..ecaa8c508db 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -204,27 +204,7 @@ SCA_IActuator* SCA_PythonController::LinkedActuatorFromPy(PyObject *value) return false; } -/* warning, self is not the SCA_PythonController, its a PyObjectPlus_Proxy */ -PyObject* SCA_PythonController::sPyAddActiveActuator(PyObject* self, PyObject* args) -{ - ShowDeprecationWarning("GameLogic.addActiveActuator(act, bool)", "controller.activate(act) or controller.deactivate(act)"); - - PyObject* ob1; - int activate; - if (!PyArg_ParseTuple(args, "Oi:addActiveActuator", &ob1,&activate)) - return NULL; - - SCA_IActuator* actu = LinkedActuatorFromPy(ob1); - if(actu==NULL) - return NULL; - - bool boolval = (activate!=0); - m_sCurrentLogicManager->AddActiveActuator((SCA_IActuator*)actu,boolval); - Py_RETURN_NONE; -} - const char* SCA_PythonController::sPyGetCurrentController__doc__ = "getCurrentController()"; -const char* SCA_PythonController::sPyAddActiveActuator__doc__= "addActiveActuator(actuator,bool)"; PyTypeObject SCA_PythonController::Type = { PyVarObject_HEAD_INIT(NULL, 0) @@ -251,11 +231,6 @@ PyTypeObject SCA_PythonController::Type = { PyMethodDef SCA_PythonController::Methods[] = { {"activate", (PyCFunction) SCA_PythonController::sPyActivate, METH_O}, {"deactivate", (PyCFunction) SCA_PythonController::sPyDeActivate, METH_O}, - - //Deprecated functions ------> - {"setScript", (PyCFunction) SCA_PythonController::sPySetScript, METH_O}, - {"getScript", (PyCFunction) SCA_PythonController::sPyGetScript, METH_NOARGS}, - //<----- Deprecated {NULL,NULL} //Sentinel }; @@ -510,33 +485,6 @@ PyObject* SCA_PythonController::PyDeActivate(PyObject *value) Py_RETURN_NONE; } -/* 1. getScript */ -PyObject* SCA_PythonController::PyGetScript() -{ - ShowDeprecationWarning("getScript()", "the script property"); - return PyUnicode_FromString(m_scriptText); -} - -/* 2. setScript */ -PyObject* SCA_PythonController::PySetScript(PyObject* value) -{ - char *scriptArg = _PyUnicode_AsString(value); - - ShowDeprecationWarning("setScript()", "the script property"); - - if (scriptArg==NULL) { - PyErr_SetString(PyExc_TypeError, "expected a string (script name)"); - return NULL; - } - - /* set scripttext sets m_bModified to true, - so next time the script is needed, a reparse into byte code is done */ - - this->SetScriptText(scriptArg); - - Py_RETURN_NONE; -} - PyObject* SCA_PythonController::pyattr_get_script(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { //SCA_PythonController* self= static_cast(static_cast(static_cast(static_cast(static_cast(self_v))))); diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.cpp b/source/gameengine/GameLogic/SCA_RandomActuator.cpp index 2b10f491378..a3a5cc2303e 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.cpp +++ b/source/gameengine/GameLogic/SCA_RandomActuator.cpp @@ -337,15 +337,6 @@ PyTypeObject SCA_RandomActuator::Type = { }; PyMethodDef SCA_RandomActuator::Methods[] = { - //Deprecated functions ------> - {"setSeed", (PyCFunction) SCA_RandomActuator::sPySetSeed, METH_VARARGS, (const char *)SetSeed_doc}, - {"getSeed", (PyCFunction) SCA_RandomActuator::sPyGetSeed, METH_NOARGS, (const char *)GetSeed_doc}, - {"getPara1", (PyCFunction) SCA_RandomActuator::sPyGetPara1, METH_NOARGS, (const char *)GetPara1_doc}, - {"getPara2", (PyCFunction) SCA_RandomActuator::sPyGetPara2, METH_NOARGS, (const char *)GetPara2_doc}, - {"getDistribution", (PyCFunction) SCA_RandomActuator::sPyGetDistribution, METH_NOARGS, (const char *)GetDistribution_doc}, - {"setProperty", (PyCFunction) SCA_RandomActuator::sPySetProperty, METH_VARARGS, (const char *)SetProperty_doc}, - {"getProperty", (PyCFunction) SCA_RandomActuator::sPyGetProperty, METH_NOARGS, (const char *)GetProperty_doc}, - //<----- Deprecated KX_PYMETHODTABLE(SCA_RandomActuator, setBoolConst), KX_PYMETHODTABLE_NOARGS(SCA_RandomActuator, setBoolUniform), KX_PYMETHODTABLE(SCA_RandomActuator, setBoolBernouilli), @@ -389,104 +380,6 @@ int SCA_RandomActuator::pyattr_set_seed(void *self, const struct KX_PYATTRIBUTE_ } } -/* 1. setSeed */ -const char SCA_RandomActuator::SetSeed_doc[] = -"setSeed(seed)\n" -"\t- seed: integer\n" -"\tSet the initial seed of the generator. Equal seeds produce\n" -"\tequal series. If the seed is 0, the generator will produce\n" -"\tthe same value on every call.\n"; -PyObject* SCA_RandomActuator::PySetSeed(PyObject* args) { - ShowDeprecationWarning("setSeed()", "the seed property"); - long seedArg; - if(!PyArg_ParseTuple(args, "i:setSeed", &seedArg)) { - return NULL; - } - - m_base->SetSeed(seedArg); - - Py_RETURN_NONE; -} -/* 2. getSeed */ -const char SCA_RandomActuator::GetSeed_doc[] = -"getSeed()\n" -"\tReturns the initial seed of the generator. Equal seeds produce\n" -"\tequal series.\n"; -PyObject* SCA_RandomActuator::PyGetSeed() -{ - ShowDeprecationWarning("getSeed()", "the seed property"); - return PyLong_FromSsize_t(m_base->GetSeed()); -} - -/* 4. getPara1 */ -const char SCA_RandomActuator::GetPara1_doc[] = -"getPara1()\n" -"\tReturns the first parameter of the active distribution. Refer\n" -"\tto the documentation of the generator types for the meaning\n" -"\tof this value."; -PyObject* SCA_RandomActuator::PyGetPara1() -{ - ShowDeprecationWarning("getPara1()", "the para1 property"); - return PyFloat_FromDouble(m_parameter1); -} - -/* 6. getPara2 */ -const char SCA_RandomActuator::GetPara2_doc[] = -"getPara2()\n" -"\tReturns the first parameter of the active distribution. Refer\n" -"\tto the documentation of the generator types for the meaning\n" -"\tof this value."; -PyObject* SCA_RandomActuator::PyGetPara2() -{ - ShowDeprecationWarning("getPara2()", "the para2 property"); - return PyFloat_FromDouble(m_parameter2); -} - -/* 8. getDistribution */ -const char SCA_RandomActuator::GetDistribution_doc[] = -"getDistribution()\n" -"\tReturns the type of the active distribution.\n"; -PyObject* SCA_RandomActuator::PyGetDistribution() -{ - ShowDeprecationWarning("getDistribution()", "the distribution property"); - return PyLong_FromSsize_t(m_distribution); -} - -/* 9. setProperty */ -const char SCA_RandomActuator::SetProperty_doc[] = -"setProperty(name)\n" -"\t- name: string\n" -"\tSet the property to which the random value is assigned. If the \n" -"\tgenerator and property types do not match, the assignment is ignored.\n"; -PyObject* SCA_RandomActuator::PySetProperty(PyObject* args) { - ShowDeprecationWarning("setProperty()", "the 'propName' property"); - char *nameArg; - if (!PyArg_ParseTuple(args, "s:setProperty", &nameArg)) { - return NULL; - } - - CValue* prop = GetParent()->FindIdentifier(nameArg); - - if (!prop->IsError()) { - m_propname = nameArg; - } else { - ; /* not found ... */ - } - prop->Release(); - - Py_RETURN_NONE; -} -/* 10. getProperty */ -const char SCA_RandomActuator::GetProperty_doc[] = -"getProperty(name)\n" -"\tReturn the property to which the random value is assigned. If the \n" -"\tgenerator and property types do not match, the assignment is ignored.\n"; -PyObject* SCA_RandomActuator::PyGetProperty() -{ - ShowDeprecationWarning("getProperty()", "the 'propName' property"); - return PyUnicode_FromString(m_propname); -} - /* 11. setBoolConst */ KX_PYMETHODDEF_DOC_VARARGS(SCA_RandomActuator, setBoolConst, "setBoolConst(value)\n" diff --git a/source/gameengine/GameLogic/SCA_RandomActuator.h b/source/gameengine/GameLogic/SCA_RandomActuator.h index c7d3fe21217..f84c44b43c9 100644 --- a/source/gameengine/GameLogic/SCA_RandomActuator.h +++ b/source/gameengine/GameLogic/SCA_RandomActuator.h @@ -99,16 +99,6 @@ class SCA_RandomActuator : public SCA_IActuator static PyObject* pyattr_get_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_seed(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); - // Deprecated methods -----> - KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator,SetSeed); - KX_PYMETHOD_DOC_NOARGS(SCA_RandomActuator,GetSeed); - KX_PYMETHOD_DOC_NOARGS(SCA_RandomActuator,GetPara1); - KX_PYMETHOD_DOC_NOARGS(SCA_RandomActuator,GetPara2); - KX_PYMETHOD_DOC_NOARGS(SCA_RandomActuator,GetDistribution); - KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator,SetProperty); - KX_PYMETHOD_DOC_NOARGS(SCA_RandomActuator,GetProperty); - // <----- - KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator, setBoolConst); KX_PYMETHOD_DOC_NOARGS(SCA_RandomActuator, setBoolUniform); KX_PYMETHOD_DOC_VARARGS(SCA_RandomActuator, setBoolBernouilli); diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.cpp b/source/gameengine/GameLogic/SCA_RandomSensor.cpp index a09d8328906..890875e61c6 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.cpp +++ b/source/gameengine/GameLogic/SCA_RandomSensor.cpp @@ -152,11 +152,6 @@ PyTypeObject SCA_RandomSensor::Type = { }; PyMethodDef SCA_RandomSensor::Methods[] = { - //Deprecated functions -----> - {"setSeed", (PyCFunction) SCA_RandomSensor::sPySetSeed, METH_VARARGS, (const char *)SetSeed_doc}, - {"getSeed", (PyCFunction) SCA_RandomSensor::sPyGetSeed, METH_NOARGS, (const char *)GetSeed_doc}, - {"getLastDraw", (PyCFunction) SCA_RandomSensor::sPyGetLastDraw, METH_NOARGS, (const char *)GetLastDraw_doc}, - //<----- Deprecated {NULL,NULL} //Sentinel }; @@ -166,45 +161,6 @@ PyAttributeDef SCA_RandomSensor::Attributes[] = { {NULL} //Sentinel }; -/* 1. setSeed */ -const char SCA_RandomSensor::SetSeed_doc[] = -"setSeed(seed)\n" -"\t- seed: integer\n" -"\tSet the initial seed of the generator. Equal seeds produce\n" -"\tequal series. If the seed is 0, the generator will produce\n" -"\tthe same value on every call.\n"; -PyObject* SCA_RandomSensor::PySetSeed(PyObject* args) { - ShowDeprecationWarning("setSeed()", "the seed property"); - long seedArg; - if(!PyArg_ParseTuple(args, "i:setSeed", &seedArg)) { - return NULL; - } - - m_basegenerator->SetSeed(seedArg); - - Py_RETURN_NONE; -} - -/* 2. getSeed */ -const char SCA_RandomSensor::GetSeed_doc[] = -"getSeed()\n" -"\tReturns the initial seed of the generator. Equal seeds produce\n" -"\tequal series.\n"; -PyObject* SCA_RandomSensor::PyGetSeed() { - ShowDeprecationWarning("getSeed()", "the seed property"); - return PyLong_FromSsize_t(m_basegenerator->GetSeed()); -} - -/* 3. getLastDraw */ -const char SCA_RandomSensor::GetLastDraw_doc[] = -"getLastDraw()\n" -"\tReturn the last value that was drawn.\n"; -PyObject* SCA_RandomSensor::PyGetLastDraw() { - ShowDeprecationWarning("getLastDraw()", "the lastDraw property"); - return PyLong_FromSsize_t(m_lastdraw); -} - - PyObject* SCA_RandomSensor::pyattr_get_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { SCA_RandomSensor* self= static_cast(self_v); diff --git a/source/gameengine/GameLogic/SCA_RandomSensor.h b/source/gameengine/GameLogic/SCA_RandomSensor.h index 5e66c36cccf..f93cf57370e 100644 --- a/source/gameengine/GameLogic/SCA_RandomSensor.h +++ b/source/gameengine/GameLogic/SCA_RandomSensor.h @@ -59,13 +59,6 @@ public: /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - - /* 1. setSeed */ - KX_PYMETHOD_DOC_VARARGS(SCA_RandomSensor,SetSeed); - /* 2. getSeed */ - KX_PYMETHOD_DOC_NOARGS(SCA_RandomSensor,GetSeed); - /* 3. getLastDraw */ - KX_PYMETHOD_DOC_NOARGS(SCA_RandomSensor,GetLastDraw); static PyObject* pyattr_get_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_seed(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp index 410cf308217..3af8f765251 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp @@ -123,16 +123,6 @@ PyTypeObject KX_NetworkMessageActuator::Type = { }; PyMethodDef KX_NetworkMessageActuator::Methods[] = { - // Deprecated -----> - {"setToPropName", (PyCFunction) - KX_NetworkMessageActuator::sPySetToPropName, METH_VARARGS}, - {"setSubject", (PyCFunction) - KX_NetworkMessageActuator::sPySetSubject, METH_VARARGS}, - {"setBodyType", (PyCFunction) - KX_NetworkMessageActuator::sPySetBodyType, METH_VARARGS}, - {"setBody", (PyCFunction) - KX_NetworkMessageActuator::sPySetBody, METH_VARARGS}, - // <----- {NULL,NULL} // Sentinel }; @@ -143,78 +133,3 @@ PyAttributeDef KX_NetworkMessageActuator::Attributes[] = { KX_PYATTRIBUTE_STRING_RW("body", 0, 16384, false, KX_NetworkMessageActuator, m_body), { NULL } //Sentinel }; - -// Deprecated -----> -// 1. SetToPropName -PyObject* KX_NetworkMessageActuator::PySetToPropName( - PyObject* args, - PyObject* kwds) -{ - ShowDeprecationWarning("setToProp()", "the propName property"); - char* ToPropName; - - if (PyArg_ParseTuple(args, "s:setToPropName", &ToPropName)) { - m_toPropName = ToPropName; - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -// 2. SetSubject -PyObject* KX_NetworkMessageActuator::PySetSubject( - PyObject* args, - PyObject* kwds) -{ - ShowDeprecationWarning("setSubject()", "the subject property"); - char* Subject; - - if (PyArg_ParseTuple(args, "s:setSubject", &Subject)) { - m_subject = Subject; - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -// 3. SetBodyType -PyObject* KX_NetworkMessageActuator::PySetBodyType( - PyObject* args, - PyObject* kwds) -{ - ShowDeprecationWarning("setBodyType()", "the usePropBody property"); - int BodyType; - - if (PyArg_ParseTuple(args, "i:setBodyType", &BodyType)) { - m_bPropBody = (BodyType != 0); - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -// 4. SetBody -PyObject* KX_NetworkMessageActuator::PySetBody( - PyObject* args, - PyObject* kwds) -{ - ShowDeprecationWarning("setBody()", "the body property"); - char* Body; - - if (PyArg_ParseTuple(args, "s:setBody", &Body)) { - m_body = Body; - } - else { - return NULL; - } - - Py_RETURN_NONE; -} - -// <----- Deprecated diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h index b4f55f2a466..fa7a674c250 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h @@ -60,13 +60,6 @@ public: /* Python interface ------------------------------------------- */ /* ------------------------------------------------------------ */ - // Deprecated -----> - KX_PYMETHOD(KX_NetworkMessageActuator, SetToPropName); - KX_PYMETHOD(KX_NetworkMessageActuator, SetSubject); - KX_PYMETHOD(KX_NetworkMessageActuator, SetBodyType); - KX_PYMETHOD(KX_NetworkMessageActuator, SetBody); - // <----- - }; #endif //__KX_NETWORKMESSAGEACTUATOR_H diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp index 779c75b484f..392e9dd9d1b 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp @@ -186,23 +186,6 @@ PyTypeObject KX_NetworkMessageSensor::Type = { }; PyMethodDef KX_NetworkMessageSensor::Methods[] = { - // Deprecated -----> - {"setSubjectFilterText", (PyCFunction) - KX_NetworkMessageSensor::sPySetSubjectFilterText, METH_O, - (const char *)SetSubjectFilterText_doc}, - {"getFrameMessageCount", (PyCFunction) - KX_NetworkMessageSensor::sPyGetFrameMessageCount, METH_NOARGS, - (const char *)GetFrameMessageCount_doc}, - {"getBodies", (PyCFunction) - KX_NetworkMessageSensor::sPyGetBodies, METH_NOARGS, - (const char *)GetBodies_doc}, - {"getSubject", (PyCFunction) - KX_NetworkMessageSensor::sPyGetSubject, METH_NOARGS, - (const char *)GetSubject_doc}, - {"getSubjects", (PyCFunction) - KX_NetworkMessageSensor::sPyGetSubjects, METH_NOARGS, - (const char *)GetSubjects_doc}, - // <----- {NULL,NULL} //Sentinel }; @@ -233,75 +216,3 @@ PyObject* KX_NetworkMessageSensor::pyattr_get_subjects(void *self_v, const KX_PY return (new CListValue())->NewProxy(true); } } - -// Deprecated -----> -// 1. Set the message subject that this sensor listens for -const char KX_NetworkMessageSensor::SetSubjectFilterText_doc[] = -"\tsetSubjectFilterText(value)\n" -"\tChange the message subject text that this sensor is listening to.\n"; - -PyObject* KX_NetworkMessageSensor::PySetSubjectFilterText(PyObject* value) -{ - ShowDeprecationWarning("setSubjectFilterText()", "subject"); - char* Subject = _PyUnicode_AsString(value); - if (Subject==NULL) { - PyErr_SetString(PyExc_TypeError, "sensor.tsetSubjectFilterText(string): KX_NetworkMessageSensor, expected a string message"); - return NULL; - } - - m_subject = Subject; - Py_RETURN_NONE; -} - -// 2. Get the number of messages received since the last frame -const char KX_NetworkMessageSensor::GetFrameMessageCount_doc[] = -"\tgetFrameMessageCount()\n" -"\tGet the number of messages received since the last frame.\n"; - -PyObject* KX_NetworkMessageSensor::PyGetFrameMessageCount() -{ - ShowDeprecationWarning("getFrameMessageCount()", "frameMessageCount"); - return PyLong_FromSsize_t(long(m_frame_message_count)); -} - -// 3. Get the message bodies -const char KX_NetworkMessageSensor::GetBodies_doc[] = -"\tgetBodies()\n" -"\tGet the list of message bodies.\n"; - -PyObject* KX_NetworkMessageSensor::PyGetBodies() -{ - ShowDeprecationWarning("getBodies()", "bodies"); - if (m_BodyList) { - return m_BodyList->GetProxy(); - } else { - return (new CListValue())->NewProxy(true); - } -} - -// 4. Get the message subject: field of the message sensor -const char KX_NetworkMessageSensor::GetSubject_doc[] = -"\tgetSubject()\n" -"\tGet the subject: field of the message sensor.\n"; - -PyObject* KX_NetworkMessageSensor::PyGetSubject() -{ - ShowDeprecationWarning("getSubject()", "subject"); - return PyUnicode_FromString(m_subject ? m_subject : ""); -} - -// 5. Get the message subjects -const char KX_NetworkMessageSensor::GetSubjects_doc[] = -"\tgetSubjects()\n" -"\tGet list of message subjects.\n"; - -PyObject* KX_NetworkMessageSensor::PyGetSubjects() -{ - ShowDeprecationWarning("getSubjects()", "subjects"); - if (m_SubjectList) { - return m_SubjectList->GetProxy(); - } else { - return (new CListValue())->NewProxy(true); - } -} -// <----- Deprecated diff --git a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h index c955e560e0a..d8a0651d2f1 100644 --- a/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h +++ b/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h @@ -70,14 +70,6 @@ public: /* Python interface -------------------------------------------- */ /* ------------------------------------------------------------- */ - // Deprecated -----> - KX_PYMETHOD_DOC_O(KX_NetworkMessageSensor, SetSubjectFilterText); - KX_PYMETHOD_DOC_NOARGS(KX_NetworkMessageSensor, GetFrameMessageCount); - KX_PYMETHOD_DOC_NOARGS(KX_NetworkMessageSensor, GetBodies); - KX_PYMETHOD_DOC_NOARGS(KX_NetworkMessageSensor, GetSubject); - KX_PYMETHOD_DOC_NOARGS(KX_NetworkMessageSensor, GetSubjects); - // <----- - /* attributes */ static PyObject* pyattr_get_bodies(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_subjects(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_Camera.cpp b/source/gameengine/Ketsji/KX_Camera.cpp index fd289a0b55e..0832809772d 100644 --- a/source/gameengine/Ketsji/KX_Camera.cpp +++ b/source/gameengine/Ketsji/KX_Camera.cpp @@ -496,12 +496,6 @@ PyMethodDef KX_Camera::Methods[] = { KX_PYMETHODTABLE_O(KX_Camera, getScreenPosition), KX_PYMETHODTABLE(KX_Camera, getScreenVect), KX_PYMETHODTABLE(KX_Camera, getScreenRay), - - // DEPRECATED - KX_PYMETHODTABLE_O(KX_Camera, enableViewport), - KX_PYMETHODTABLE_NOARGS(KX_Camera, getProjectionMatrix), - KX_PYMETHODTABLE_O(KX_Camera, setProjectionMatrix), - {NULL,NULL} //Sentinel }; @@ -680,92 +674,6 @@ KX_PYMETHODDEF_DOC_NOARGS(KX_Camera, getWorldToCamera, return PyObjectFrom(GetWorldToCamera()); /* new ref */ } -KX_PYMETHODDEF_DOC_NOARGS(KX_Camera, getProjectionMatrix, -"getProjectionMatrix() -> Matrix4x4\n" -"\treturns this camera's projection matrix, as a list of four lists of four values.\n\n" -"\tie: [[1.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0], [0.0, 0.0, 1.0, 0.0], [0.0, 0.0, 0.0, 1.0]])\n" -) -{ - ShowDeprecationWarning("getProjectionMatrix()", "the projection_matrix property"); - return PyObjectFrom(GetProjectionMatrix()); /* new ref */ -} - -KX_PYMETHODDEF_DOC_O(KX_Camera, setProjectionMatrix, -"setProjectionMatrix(MT_Matrix4x4 m) -> None\n" -"\tSets this camera's projection matrix\n" -"\n" -"\tExample:\n" -"\timport GameLogic\n" -"\t# Set a perspective projection matrix\n" -"\tdef Perspective(left, right, bottom, top, near, far):\n" -"\t\tm = MT_Matrix4x4()\n" -"\t\tm[0][0] = m[0][2] = right - left\n" -"\t\tm[1][1] = m[1][2] = top - bottom\n" -"\t\tm[2][2] = m[2][3] = -far - near\n" -"\t\tm[3][2] = -1\n" -"\t\tm[3][3] = 0\n" -"\t\treturn m\n" -"\n" -"\t# Set an orthographic projection matrix\n" -"\tdef Orthographic(left, right, bottom, top, near, far):\n" -"\t\tm = MT_Matrix4x4()\n" -"\t\tm[0][0] = right - left\n" -"\t\tm[0][3] = -right - left\n" -"\t\tm[1][1] = top - bottom\n" -"\t\tm[1][3] = -top - bottom\n" -"\t\tm[2][2] = far - near\n" -"\t\tm[2][3] = -far - near\n" -"\t\tm[3][3] = 1\n" -"\t\treturn m\n" -"\n" -"\t# Set an isometric projection matrix\n" -"\tdef Isometric(left, right, bottom, top, near, far):\n" -"\t\tm = MT_Matrix4x4()\n" -"\t\tm[0][0] = m[0][2] = m[1][1] = 0.8660254037844386\n" -"\t\tm[1][0] = 0.25\n" -"\t\tm[1][2] = -0.25\n" -"\t\tm[3][3] = 1\n" -"\t\treturn m\n" -"\n" -"\t" -"\tco = GameLogic.getCurrentController()\n" -"\tcam = co.getOwner()\n" -"\tcam.setProjectionMatrix(Perspective(-1.0, 1.0, -1.0, 1.0, 0.1, 1))\n") -{ - ShowDeprecationWarning("setProjectionMatrix(mat)", "the projection_matrix property"); - - MT_Matrix4x4 mat; - if (!PyMatTo(value, mat)) - { - PyErr_SetString(PyExc_TypeError, "camera.setProjectionMatrix(matrix): KX_Camera, expected 4x4 list as matrix argument."); - return NULL; - } - - SetProjectionMatrix(mat); - Py_RETURN_NONE; -} - -KX_PYMETHODDEF_DOC_O(KX_Camera, enableViewport, -"enableViewport(viewport)\n" -"Sets this camera's viewport status\n" -) -{ - ShowDeprecationWarning("enableViewport(bool)", "the useViewport property"); - - int viewport = PyObject_IsTrue(value); - if (viewport == -1) { - PyErr_SetString(PyExc_ValueError, "camera.enableViewport(bool): KX_Camera, expected True/False or 0/1"); - return NULL; - } - - if(viewport) - EnableViewport(true); - else - EnableViewport(false); - - Py_RETURN_NONE; -} - KX_PYMETHODDEF_DOC_VARARGS(KX_Camera, setViewport, "setViewport(left, bottom, right, top)\n" "Sets this camera's viewport\n") diff --git a/source/gameengine/Ketsji/KX_Camera.h b/source/gameengine/Ketsji/KX_Camera.h index 74c8e6d4e4f..bf7a39d93c8 100644 --- a/source/gameengine/Ketsji/KX_Camera.h +++ b/source/gameengine/Ketsji/KX_Camera.h @@ -273,10 +273,7 @@ public: KX_PYMETHOD_DOC_NOARGS(KX_Camera, getCameraToWorld); KX_PYMETHOD_DOC_NOARGS(KX_Camera, getWorldToCamera); - KX_PYMETHOD_DOC_NOARGS(KX_Camera, getProjectionMatrix); - KX_PYMETHOD_DOC_O(KX_Camera, setProjectionMatrix); - KX_PYMETHOD_DOC_O(KX_Camera, enableViewport); KX_PYMETHOD_DOC_VARARGS(KX_Camera, setViewport); KX_PYMETHOD_DOC_NOARGS(KX_Camera, setOnTop); diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp index b5a0a63cf68..9c00b5991af 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.cpp +++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp @@ -378,17 +378,6 @@ PyTypeObject KX_CameraActuator::Type = { }; PyMethodDef KX_CameraActuator::Methods[] = { - // ---> deprecated (all) - {"setObject",(PyCFunction) KX_CameraActuator::sPySetObject, METH_O, (const char *)SetObject_doc}, - {"getObject",(PyCFunction) KX_CameraActuator::sPyGetObject, METH_VARARGS, (const char *)GetObject_doc}, - {"setMin" ,(PyCFunction) KX_CameraActuator::sPySetMin, METH_VARARGS, (const char *)SetMin_doc}, - {"getMin" ,(PyCFunction) KX_CameraActuator::sPyGetMin, METH_NOARGS, (const char *)GetMin_doc}, - {"setMax" ,(PyCFunction) KX_CameraActuator::sPySetMax, METH_VARARGS, (const char *)SetMax_doc}, - {"getMax" ,(PyCFunction) KX_CameraActuator::sPyGetMax, METH_NOARGS, (const char *)GetMax_doc}, - {"setHeight",(PyCFunction) KX_CameraActuator::sPySetHeight, METH_VARARGS, (const char *)SetHeight_doc}, - {"getHeight",(PyCFunction) KX_CameraActuator::sPyGetHeight, METH_NOARGS, (const char *)GetHeight_doc}, - {"setXY" ,(PyCFunction) KX_CameraActuator::sPySetXY, METH_VARARGS, (const char *)SetXY_doc}, - {"getXY" ,(PyCFunction) KX_CameraActuator::sPyGetXY, METH_NOARGS, (const char *)GetXY_doc}, {NULL,NULL,NULL,NULL} //Sentinel }; @@ -401,152 +390,6 @@ PyAttributeDef KX_CameraActuator::Attributes[] = { {NULL} }; -/* get obj ---------------------------------------------------------- */ -const char KX_CameraActuator::GetObject_doc[] = -"getObject(name_only = 1)\n" -"name_only - optional arg, when true will return the KX_GameObject rather then its name\n" -"\tReturns the object this sensor reacts to.\n"; -PyObject* KX_CameraActuator::PyGetObject(PyObject* args) -{ - int ret_name_only = 1; - - ShowDeprecationWarning("getObject()", "the object property"); - - if (!PyArg_ParseTuple(args, "|i:getObject", &ret_name_only)) - return NULL; - - if (!m_ob) - Py_RETURN_NONE; - - if (ret_name_only) - return PyUnicode_FromString(m_ob->GetName().ReadPtr()); - else - return m_ob->GetProxy(); -} -/* set obj ---------------------------------------------------------- */ -const char KX_CameraActuator::SetObject_doc[] = -"setObject(object)\n" -"\t- object: KX_GameObject, string or None\n" -"\tSets the object this sensor reacts to.\n"; -PyObject* KX_CameraActuator::PySetObject(PyObject* value) -{ - KX_GameObject *gameobj; - - ShowDeprecationWarning("setObject()", "the object property"); - - if (!ConvertPythonToGameObject(value, &gameobj, true, "actuator.setObject(value): KX_CameraActuator")) - return NULL; // ConvertPythonToGameObject sets the error - - if (m_ob != NULL) - m_ob->UnregisterActuator(this); - - m_ob = (SCA_IObject*)gameobj; - if (m_ob) - m_ob->RegisterActuator(this); - - Py_RETURN_NONE; -} - -/* get min ---------------------------------------------------------- */ -const char KX_CameraActuator::GetMin_doc[] = -"getMin\n" -"\tReturns the minimum value set in the Min: field.\n"; -PyObject* KX_CameraActuator::PyGetMin() -{ - ShowDeprecationWarning("getMin()", "the min property"); - return PyFloat_FromDouble(m_minHeight); -} -/* set min ---------------------------------------------------------- */ -const char KX_CameraActuator::SetMin_doc[] = -"setMin\n" -"\tSets the minimum value.\n"; -PyObject* KX_CameraActuator::PySetMin(PyObject* args) -{ - ShowDeprecationWarning("setMin()", "the min property"); - float min; - if(PyArg_ParseTuple(args,"f:setMin", &min)) - { - m_minHeight = min; - Py_RETURN_NONE; - } - return NULL; -} -/* get min ---------------------------------------------------------- */ -const char KX_CameraActuator::GetMax_doc[] = -"getMax\n" -"\tReturns the maximum value set in the Max: field.\n"; -PyObject* KX_CameraActuator::PyGetMax() -{ - ShowDeprecationWarning("getMax()", "the max property"); - return PyFloat_FromDouble(m_maxHeight); -} -/* set min ---------------------------------------------------------- */ -const char KX_CameraActuator::SetMax_doc[] = -"setMax\n" -"\tSets the maximum value.\n"; -PyObject* KX_CameraActuator::PySetMax(PyObject* args) -{ - ShowDeprecationWarning("getMax()", "the max property"); - float max; - if(PyArg_ParseTuple(args,"f:setMax", &max)) - { - m_maxHeight = max; - Py_RETURN_NONE; - } - return NULL; -} -/* get height ---------------------------------------------------------- */ -const char KX_CameraActuator::GetHeight_doc[] = -"getHeight\n" -"\tReturns the height value set in the height: field.\n"; -PyObject* KX_CameraActuator::PyGetHeight() -{ - ShowDeprecationWarning("getHeight()", "the height property"); - return PyFloat_FromDouble(m_height); -} -/* set height ---------------------------------------------------------- */ -const char KX_CameraActuator::SetHeight_doc[] = -"setHeight\n" -"\tSets the height value.\n"; -PyObject* KX_CameraActuator::PySetHeight(PyObject* args) -{ - ShowDeprecationWarning("getHeight()", "the height property"); - float height; - if(PyArg_ParseTuple(args,"f:setHeight", &height)) - { - m_height = height; - Py_RETURN_NONE; - } - return NULL; -} -/* set XY ---------------------------------------------------------- */ -const char KX_CameraActuator::SetXY_doc[] = -"setXY\n" -"\tSets axis the camera tries to get behind.\n" -"\t1=x, 0=y\n"; -PyObject* KX_CameraActuator::PySetXY(PyObject* args) -{ - ShowDeprecationWarning("setXY()", "the useXY property"); - int value; - if(PyArg_ParseTuple(args,"i:setXY", &value)) - { - m_x = value != 0; - Py_RETURN_NONE; - } - return NULL; -} - -/* get XY -------------------------------------------------------------*/ -const char KX_CameraActuator::GetXY_doc[] = -"getXY\n" -"\tGets the axis the camera tries to get behind.\n" -"\tTrue = X, False = Y\n"; -PyObject* KX_CameraActuator::PyGetXY() -{ - ShowDeprecationWarning("getXY()", "the xy property"); - return PyLong_FromSsize_t(m_x); -} - PyObject* KX_CameraActuator::pyattr_get_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_CameraActuator* self= static_cast(self_v); diff --git a/source/gameengine/Ketsji/KX_CameraActuator.h b/source/gameengine/Ketsji/KX_CameraActuator.h index 057c6fed770..e047e3724ea 100644 --- a/source/gameengine/Ketsji/KX_CameraActuator.h +++ b/source/gameengine/Ketsji/KX_CameraActuator.h @@ -119,18 +119,6 @@ private : /* --------------------------------------------------------------------- */ /* set object to look at */ - KX_PYMETHOD_DOC_O(KX_CameraActuator,SetObject); - /* get current object */ - KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,GetObject); - KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,SetMin); - KX_PYMETHOD_DOC_NOARGS(KX_CameraActuator,GetMin); - KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,SetMax); - KX_PYMETHOD_DOC_NOARGS(KX_CameraActuator,GetMax); - KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,SetHeight); - KX_PYMETHOD_DOC_NOARGS(KX_CameraActuator,GetHeight); - KX_PYMETHOD_DOC_VARARGS(KX_CameraActuator,SetXY); - KX_PYMETHOD_DOC_NOARGS(KX_CameraActuator,GetXY); - static PyObject* pyattr_get_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_object(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp index 5f6244c3ab6..7f1d2c7d53c 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp @@ -587,30 +587,6 @@ PyTypeObject KX_ConstraintActuator::Type = { }; PyMethodDef KX_ConstraintActuator::Methods[] = { - // Deprecated --> - {"setDamp", (PyCFunction) KX_ConstraintActuator::sPySetDamp, METH_VARARGS, (const char *)SetDamp_doc}, - {"getDamp", (PyCFunction) KX_ConstraintActuator::sPyGetDamp, METH_NOARGS, (const char *)GetDamp_doc}, - {"setRotDamp", (PyCFunction) KX_ConstraintActuator::sPySetRotDamp, METH_VARARGS, (const char *)SetRotDamp_doc}, - {"getRotDamp", (PyCFunction) KX_ConstraintActuator::sPyGetRotDamp, METH_NOARGS, (const char *)GetRotDamp_doc}, - {"setDirection", (PyCFunction) KX_ConstraintActuator::sPySetDirection, METH_VARARGS, (const char *)SetDirection_doc}, - {"getDirection", (PyCFunction) KX_ConstraintActuator::sPyGetDirection, METH_NOARGS, (const char *)GetDirection_doc}, - {"setOption", (PyCFunction) KX_ConstraintActuator::sPySetOption, METH_VARARGS, (const char *)SetOption_doc}, - {"getOption", (PyCFunction) KX_ConstraintActuator::sPyGetOption, METH_NOARGS, (const char *)GetOption_doc}, - {"setTime", (PyCFunction) KX_ConstraintActuator::sPySetTime, METH_VARARGS, (const char *)SetTime_doc}, - {"getTime", (PyCFunction) KX_ConstraintActuator::sPyGetTime, METH_NOARGS, (const char *)GetTime_doc}, - {"setProperty", (PyCFunction) KX_ConstraintActuator::sPySetProperty, METH_VARARGS, (const char *)SetProperty_doc}, - {"getProperty", (PyCFunction) KX_ConstraintActuator::sPyGetProperty, METH_NOARGS, (const char *)GetProperty_doc}, - {"setMin", (PyCFunction) KX_ConstraintActuator::sPySetMin, METH_VARARGS, (const char *)SetMin_doc}, - {"getMin", (PyCFunction) KX_ConstraintActuator::sPyGetMin, METH_NOARGS, (const char *)GetMin_doc}, - {"setDistance", (PyCFunction) KX_ConstraintActuator::sPySetMin, METH_VARARGS, (const char *)SetDistance_doc}, - {"getDistance", (PyCFunction) KX_ConstraintActuator::sPyGetMin, METH_NOARGS, (const char *)GetDistance_doc}, - {"setMax", (PyCFunction) KX_ConstraintActuator::sPySetMax, METH_VARARGS, (const char *)SetMax_doc}, - {"getMax", (PyCFunction) KX_ConstraintActuator::sPyGetMax, METH_NOARGS, (const char *)GetMax_doc}, - {"setRayLength", (PyCFunction) KX_ConstraintActuator::sPySetMax, METH_VARARGS, (const char *)SetRayLength_doc}, - {"getRayLength", (PyCFunction) KX_ConstraintActuator::sPyGetMax, METH_NOARGS, (const char *)GetRayLength_doc}, - {"setLimit", (PyCFunction) KX_ConstraintActuator::sPySetLimit, METH_VARARGS, (const char *)SetLimit_doc}, - {"getLimit", (PyCFunction) KX_ConstraintActuator::sPyGetLimit, METH_NOARGS, (const char *)GetLimit_doc}, - // <-- {NULL,NULL} //Sentinel }; @@ -642,318 +618,4 @@ int KX_ConstraintActuator::pyattr_check_direction(void *self, const struct KX_PY return 0; } -/* 2. setDamp */ -const char KX_ConstraintActuator::SetDamp_doc[] = -"setDamp(duration)\n" -"\t- duration: integer\n" -"\tSets the time constant of the orientation and distance constraint.\n" -"\tIf the duration is negative, it is set to 0.\n"; -PyObject* KX_ConstraintActuator::PySetDamp(PyObject* args) { - ShowDeprecationWarning("setDamp()", "the damp property"); - int dampArg; - if(!PyArg_ParseTuple(args, "i:setDamp", &dampArg)) { - return NULL; - } - - m_posDampTime = dampArg; - if (m_posDampTime < 0) m_posDampTime = 0; - - Py_RETURN_NONE; -} -/* 3. getDamp */ -const char KX_ConstraintActuator::GetDamp_doc[] = -"getDamp()\n" -"\tReturns the damping parameter.\n"; -PyObject* KX_ConstraintActuator::PyGetDamp(){ - ShowDeprecationWarning("getDamp()", "the damp property"); - return PyLong_FromSsize_t(m_posDampTime); -} - -/* 2. setRotDamp */ -const char KX_ConstraintActuator::SetRotDamp_doc[] = -"setRotDamp(duration)\n" -"\t- duration: integer\n" -"\tSets the time constant of the orientation constraint.\n" -"\tIf the duration is negative, it is set to 0.\n"; -PyObject* KX_ConstraintActuator::PySetRotDamp(PyObject* args) { - ShowDeprecationWarning("setRotDamp()", "the rotDamp property"); - int dampArg; - if(!PyArg_ParseTuple(args, "i:setRotDamp", &dampArg)) { - return NULL; - } - - m_rotDampTime = dampArg; - if (m_rotDampTime < 0) m_rotDampTime = 0; - - Py_RETURN_NONE; -} -/* 3. getRotDamp */ -const char KX_ConstraintActuator::GetRotDamp_doc[] = -"getRotDamp()\n" -"\tReturns the damping time for application of the constraint.\n"; -PyObject* KX_ConstraintActuator::PyGetRotDamp(){ - ShowDeprecationWarning("getRotDamp()", "the rotDamp property"); - return PyLong_FromSsize_t(m_rotDampTime); -} - -/* 2. setDirection */ -const char KX_ConstraintActuator::SetDirection_doc[] = -"setDirection(vector)\n" -"\t- vector: 3-tuple\n" -"\tSets the reference direction in world coordinate for the orientation constraint.\n"; -PyObject* KX_ConstraintActuator::PySetDirection(PyObject* args) { - ShowDeprecationWarning("setDirection()", "the direction property"); - float x, y, z; - MT_Scalar len; - MT_Vector3 dir; - - if(!PyArg_ParseTuple(args, "(fff):setDirection", &x, &y, &z)) { - return NULL; - } - dir[0] = x; - dir[1] = y; - dir[2] = z; - len = dir.length(); - if (MT_fuzzyZero(len)) { - std::cout << "Invalid direction" << std::endl; - return NULL; - } - m_refDirVector = dir/len; - m_refDirection[0] = x/len; - m_refDirection[1] = y/len; - m_refDirection[2] = z/len; - - Py_RETURN_NONE; -} -/* 3. getDirection */ -const char KX_ConstraintActuator::GetDirection_doc[] = -"getDirection()\n" -"\tReturns the reference direction of the orientation constraint as a 3-tuple.\n"; -PyObject* KX_ConstraintActuator::PyGetDirection(){ - ShowDeprecationWarning("getDirection()", "the direction property"); - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_refDirection[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_refDirection[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_refDirection[2])); - return retVal; -} - -/* 2. setOption */ -const char KX_ConstraintActuator::SetOption_doc[] = -"setOption(option)\n" -"\t- option: integer\n" -"\tSets several options of the distance constraint.\n" -"\tBinary combination of the following values:\n" -"\t\t 64 : Activate alignment to surface\n" -"\t\t128 : Detect material rather than property\n" -"\t\t256 : No deactivation if ray does not hit target\n" -"\t\t512 : Activate distance control\n"; -PyObject* KX_ConstraintActuator::PySetOption(PyObject* args) { - ShowDeprecationWarning("setOption()", "the option property"); - int option; - if(!PyArg_ParseTuple(args, "i:setOption", &option)) { - return NULL; - } - - m_option = option; - - Py_RETURN_NONE; -} -/* 3. getOption */ -const char KX_ConstraintActuator::GetOption_doc[] = -"getOption()\n" -"\tReturns the option parameter.\n"; -PyObject* KX_ConstraintActuator::PyGetOption(){ - ShowDeprecationWarning("getOption()", "the option property"); - return PyLong_FromSsize_t(m_option); -} - -/* 2. setTime */ -const char KX_ConstraintActuator::SetTime_doc[] = -"setTime(duration)\n" -"\t- duration: integer\n" -"\tSets the activation time of the actuator.\n" -"\tThe actuator disables itself after this many frame.\n" -"\tIf set to 0 or negative, the actuator is not limited in time.\n"; -PyObject* KX_ConstraintActuator::PySetTime(PyObject* args) { - ShowDeprecationWarning("setTime()", "the time property"); - int t; - if(!PyArg_ParseTuple(args, "i:setTime", &t)) { - return NULL; - } - - if (t < 0) - t = 0; - m_activeTime = t; - - Py_RETURN_NONE; -} -/* 3. getTime */ -const char KX_ConstraintActuator::GetTime_doc[] = -"getTime()\n" -"\tReturns the time parameter.\n"; -PyObject* KX_ConstraintActuator::PyGetTime(){ - ShowDeprecationWarning("getTime()", "the time property"); - return PyLong_FromSsize_t(m_activeTime); -} - -/* 2. setProperty */ -const char KX_ConstraintActuator::SetProperty_doc[] = -"setProperty(property)\n" -"\t- property: string\n" -"\tSets the name of the property or material for the ray detection of the distance constraint.\n" -"\tIf empty, the ray will detect any collisioning object.\n"; -PyObject* KX_ConstraintActuator::PySetProperty(PyObject* args) { - ShowDeprecationWarning("setProperty()", "the 'property' property"); - char *property; - if (!PyArg_ParseTuple(args, "s:setProperty", &property)) { - return NULL; - } - if (property == NULL) { - m_property = ""; - } else { - m_property = property; - } - - Py_RETURN_NONE; -} -/* 3. getProperty */ -const char KX_ConstraintActuator::GetProperty_doc[] = -"getProperty()\n" -"\tReturns the property parameter.\n"; -PyObject* KX_ConstraintActuator::PyGetProperty(){ - ShowDeprecationWarning("getProperty()", "the 'property' property"); - return PyUnicode_FromString(m_property.Ptr()); -} - -/* 4. setDistance */ -const char KX_ConstraintActuator::SetDistance_doc[] = -"setDistance(distance)\n" -"\t- distance: float\n" -"\tSets the target distance in distance constraint\n"; -/* 4. setMin */ -const char KX_ConstraintActuator::SetMin_doc[] = -"setMin(lower_bound)\n" -"\t- lower_bound: float\n" -"\tSets the lower value of the interval to which the value\n" -"\tis clipped.\n"; -PyObject* KX_ConstraintActuator::PySetMin(PyObject* args) { - ShowDeprecationWarning("setMin() or setDistance()", "the min or distance property"); - float minArg; - if(!PyArg_ParseTuple(args, "f:setMin", &minArg)) { - return NULL; - } - - switch (m_locrot) { - default: - m_minimumBound = minArg; - break; - case KX_ACT_CONSTRAINT_ROTX: - case KX_ACT_CONSTRAINT_ROTY: - case KX_ACT_CONSTRAINT_ROTZ: - m_minimumBound = MT_radians(minArg); - break; - } - - Py_RETURN_NONE; -} -/* 5. getDistance */ -const char KX_ConstraintActuator::GetDistance_doc[] = -"getDistance()\n" -"\tReturns the distance parameter \n"; -/* 5. getMin */ -const char KX_ConstraintActuator::GetMin_doc[] = -"getMin()\n" -"\tReturns the lower value of the interval to which the value\n" -"\tis clipped.\n"; -PyObject* KX_ConstraintActuator::PyGetMin() { - ShowDeprecationWarning("getMin() or getDistance()", "the min or distance property"); - return PyFloat_FromDouble(m_minimumBound); -} - -/* 6. setRayLength */ -const char KX_ConstraintActuator::SetRayLength_doc[] = -"setRayLength(length)\n" -"\t- length: float\n" -"\tSets the maximum ray length of the distance constraint\n"; -/* 6. setMax */ -const char KX_ConstraintActuator::SetMax_doc[] = -"setMax(upper_bound)\n" -"\t- upper_bound: float\n" -"\tSets the upper value of the interval to which the value\n" -"\tis clipped.\n"; -PyObject* KX_ConstraintActuator::PySetMax(PyObject* args){ - ShowDeprecationWarning("setMax() or setRayLength()", "the max or rayLength property"); - float maxArg; - if(!PyArg_ParseTuple(args, "f:setMax", &maxArg)) { - return NULL; - } - - switch (m_locrot) { - default: - m_maximumBound = maxArg; - break; - case KX_ACT_CONSTRAINT_ROTX: - case KX_ACT_CONSTRAINT_ROTY: - case KX_ACT_CONSTRAINT_ROTZ: - m_maximumBound = MT_radians(maxArg); - break; - } - - Py_RETURN_NONE; -} -/* 7. getRayLength */ -const char KX_ConstraintActuator::GetRayLength_doc[] = -"getRayLength()\n" -"\tReturns the length of the ray\n"; -/* 7. getMax */ -const char KX_ConstraintActuator::GetMax_doc[] = -"getMax()\n" -"\tReturns the upper value of the interval to which the value\n" -"\tis clipped.\n"; -PyObject* KX_ConstraintActuator::PyGetMax() { - ShowDeprecationWarning("getMax() or getRayLength()", "the max or rayLength property"); - return PyFloat_FromDouble(m_maximumBound); -} - - -/* This setter/getter probably for the constraint type */ -/* 8. setLimit */ -const char KX_ConstraintActuator::SetLimit_doc[] = -"setLimit(type)\n" -"\t- type: integer\n" -"\t 1 : LocX\n" -"\t 2 : LocY\n" -"\t 3 : LocZ\n" -"\t 7 : Distance along +X axis\n" -"\t 8 : Distance along +Y axis\n" -"\t 9 : Distance along +Z axis\n" -"\t 10 : Distance along -X axis\n" -"\t 11 : Distance along -Y axis\n" -"\t 12 : Distance along -Z axis\n" -"\t 13 : Align X axis\n" -"\t 14 : Align Y axis\n" -"\t 15 : Align Z axis\n" -"\tSets the type of constraint.\n"; -PyObject* KX_ConstraintActuator::PySetLimit(PyObject* args) { - ShowDeprecationWarning("setLimit()", "the limit property"); - int locrotArg; - if(!PyArg_ParseTuple(args, "i:setLimit", &locrotArg)) { - return NULL; - } - - if (IsValidMode((KX_CONSTRAINTTYPE)locrotArg)) m_locrot = locrotArg; - - Py_RETURN_NONE; -} -/* 9. getLimit */ -const char KX_ConstraintActuator::GetLimit_doc[] = -"getLimit()\n" -"\tReturns the type of constraint.\n"; -PyObject* KX_ConstraintActuator::PyGetLimit() { - ShowDeprecationWarning("setLimit()", "the limit property"); - return PyLong_FromSsize_t(m_locrot); -} - /* eof */ diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.h b/source/gameengine/Ketsji/KX_ConstraintActuator.h index 677904aedc9..9b6ed59e75c 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.h +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.h @@ -143,28 +143,6 @@ protected: static int pyattr_check_direction(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_check_min(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); - KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetDamp); - KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetDamp); - KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetRotDamp); - KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetRotDamp); - KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetDirection); - KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetDirection); - KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetOption); - KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetOption); - KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetTime); - KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetTime); - KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetProperty); - KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetProperty); - KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetMin); - KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetMin); - static const char SetDistance_doc[]; - static const char GetDistance_doc[]; - KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetMax); - KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetMax); - static const char SetRayLength_doc[]; - static const char GetRayLength_doc[]; - KX_PYMETHOD_DOC_VARARGS(KX_ConstraintActuator,SetLimit); - KX_PYMETHOD_DOC_NOARGS(KX_ConstraintActuator,GetLimit); }; #endif //__KX_CONSTRAINTACTUATOR diff --git a/source/gameengine/Ketsji/KX_GameActuator.cpp b/source/gameengine/Ketsji/KX_GameActuator.cpp index 3f67de1e9a9..42dc4d8fd24 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.cpp +++ b/source/gameengine/Ketsji/KX_GameActuator.cpp @@ -230,10 +230,6 @@ PyTypeObject KX_GameActuator::Type = { PyMethodDef KX_GameActuator::Methods[] = { - // Deprecated -----> - {"getFile", (PyCFunction) KX_GameActuator::sPyGetFile, METH_VARARGS, (const char *)GetFile_doc}, - {"setFile", (PyCFunction) KX_GameActuator::sPySetFile, METH_VARARGS, (const char *)SetFile_doc}, - // <----- {NULL,NULL} //Sentinel }; @@ -242,36 +238,3 @@ PyAttributeDef KX_GameActuator::Attributes[] = { KX_PYATTRIBUTE_INT_RW("mode", KX_GAME_NODEF+1, KX_GAME_MAX-1, true, KX_GameActuator, m_mode), { NULL } //Sentinel }; - -// Deprecated -----> -/* getFile */ -const char KX_GameActuator::GetFile_doc[] = -"getFile()\n" -"get the name of the file to start.\n"; -PyObject* KX_GameActuator::PyGetFile(PyObject* args, PyObject* kwds) -{ - ShowDeprecationWarning("getFile()", "the fileName property"); - return PyUnicode_FromString(m_filename); -} - -/* setFile */ -const char KX_GameActuator::SetFile_doc[] = -"setFile(name)\n" -"set the name of the file to start.\n"; -PyObject* KX_GameActuator::PySetFile(PyObject* args, PyObject* kwds) -{ - char* new_file; - - ShowDeprecationWarning("setFile()", "the fileName property"); - - if (!PyArg_ParseTuple(args, "s:setFile", &new_file)) - { - return NULL; - } - - m_filename = STR_String(new_file); - - Py_RETURN_NONE; - -} -// <----- diff --git a/source/gameengine/Ketsji/KX_GameActuator.h b/source/gameengine/Ketsji/KX_GameActuator.h index cabbf827b40..37d09a5a9fb 100644 --- a/source/gameengine/Ketsji/KX_GameActuator.h +++ b/source/gameengine/Ketsji/KX_GameActuator.h @@ -75,11 +75,6 @@ protected: /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - - // Deprecated functions -----> - KX_PYMETHOD_DOC(KX_GameActuator,GetFile); - KX_PYMETHOD_DOC(KX_GameActuator,SetFile); - // <----- }; /* end of class KX_GameActuator */ diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 3aef41743a7..79b110b11ef 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1383,8 +1383,8 @@ PyMethodDef KX_GameObject::Methods[] = { {"setVisible",(PyCFunction) KX_GameObject::sPySetVisible, METH_VARARGS}, {"setOcclusion",(PyCFunction) KX_GameObject::sPySetOcclusion, METH_VARARGS}, {"removeParent", (PyCFunction)KX_GameObject::sPyRemoveParent,METH_NOARGS}, - {"getChildren", (PyCFunction)KX_GameObject::sPyGetChildren,METH_NOARGS}, - {"getChildrenRecursive", (PyCFunction)KX_GameObject::sPyGetChildrenRecursive,METH_NOARGS}, + + {"getPhysicsId", (PyCFunction)KX_GameObject::sPyGetPhysicsId,METH_NOARGS}, {"getPropertyNames", (PyCFunction)KX_GameObject::sPyGetPropertyNames,METH_NOARGS}, {"replaceMesh",(PyCFunction) KX_GameObject::sPyReplaceMesh, METH_VARARGS}, @@ -1400,18 +1400,6 @@ PyMethodDef KX_GameObject::Methods[] = { // dict style access for props {"get",(PyCFunction) KX_GameObject::sPyget, METH_VARARGS}, - // deprecated - {"getPosition", (PyCFunction) KX_GameObject::sPyGetPosition, METH_NOARGS}, - {"setPosition", (PyCFunction) KX_GameObject::sPySetPosition, METH_O}, - {"setWorldPosition", (PyCFunction) KX_GameObject::sPySetWorldPosition, METH_O}, - {"getOrientation", (PyCFunction) KX_GameObject::sPyGetOrientation, METH_NOARGS}, - {"setOrientation", (PyCFunction) KX_GameObject::sPySetOrientation, METH_O}, - {"getState",(PyCFunction) KX_GameObject::sPyGetState, METH_NOARGS}, - {"setState",(PyCFunction) KX_GameObject::sPySetState, METH_O}, - {"getParent", (PyCFunction)KX_GameObject::sPyGetParent,METH_NOARGS}, - {"getVisible",(PyCFunction) KX_GameObject::sPyGetVisible, METH_NOARGS}, - {"getMass", (PyCFunction) KX_GameObject::sPyGetMass, METH_NOARGS}, - {"getMesh", (PyCFunction)KX_GameObject::sPyGetMesh,METH_VARARGS}, {NULL,NULL} //Sentinel }; @@ -1514,13 +1502,6 @@ PyObject* KX_GameObject::PyReinstancePhysicsMesh(PyObject* args) Py_RETURN_FALSE; } - -PyObject* KX_GameObject::PyGetPosition() -{ - ShowDeprecationWarning("getPosition()", "the position property"); - return PyObjectFrom(NodeGetWorldPosition()); -} - static PyObject *Map_GetItem(PyObject *self_v, PyObject *item) { KX_GameObject* self= static_castBGE_PROXY_REF(self_v); @@ -2200,41 +2181,6 @@ PyObject* KX_GameObject::PySetOcclusion(PyObject* args) Py_RETURN_NONE; } -PyObject* KX_GameObject::PyGetVisible() -{ - ShowDeprecationWarning("getVisible()", "the visible property"); - return PyLong_FromSsize_t(m_bVisible); -} - -PyObject* KX_GameObject::PyGetState() -{ - ShowDeprecationWarning("getState()", "the state property"); - int state = 0; - state |= GetState(); - return PyLong_FromSsize_t(state); -} - -PyObject* KX_GameObject::PySetState(PyObject* value) -{ - ShowDeprecationWarning("setState()", "the state property"); - int state_i = PyLong_AsSsize_t(value); - unsigned int state = 0; - - if (state_i == -1 && PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, "expected an int bit field"); - return NULL; - } - - state |= state_i; - if ((state & ((1<<30)-1)) == 0) { - PyErr_SetString(PyExc_AttributeError, "The state bitfield was not between 0 and 30 (1<<0 and 1<<29)"); - return NULL; - } - SetState(state); - - Py_RETURN_NONE; -} - PyObject* KX_GameObject::PyGetVelocity(PyObject* args) { // only can get the velocity if we have a physics object connected to us... @@ -2253,14 +2199,6 @@ PyObject* KX_GameObject::PyGetVelocity(PyObject* args) } } - - -PyObject* KX_GameObject::PyGetMass() -{ - ShowDeprecationWarning("getMass()", "the mass property"); - return PyFloat_FromDouble((GetPhysicsController() != NULL) ? GetPhysicsController()->GetMass() : 0.0f); -} - PyObject* KX_GameObject::PyGetReactionForce() { // only can get the velocity if we have a physics object connected to us... @@ -2297,18 +2235,6 @@ PyObject* KX_GameObject::PyDisableRigidBody() } - -PyObject* KX_GameObject::PyGetParent() -{ - ShowDeprecationWarning("getParent()", "the parent property"); - KX_GameObject* parent = this->GetParent(); - if (parent) { - parent->Release(); /* self->GetParent() AddRef's */ - return parent->GetProxy(); - } - Py_RETURN_NONE; -} - PyObject* KX_GameObject::PySetParent(PyObject* args) { KX_Scene *scene = KX_GetActiveScene(); @@ -2334,41 +2260,6 @@ PyObject* KX_GameObject::PyRemoveParent() Py_RETURN_NONE; } -PyObject* KX_GameObject::PyGetChildren() -{ - ShowDeprecationWarning("getChildren()", "the children property"); - - return GetChildren()->NewProxy(true); -} - -PyObject* KX_GameObject::PyGetChildrenRecursive() -{ - ShowDeprecationWarning("getChildrenRecursive()", "the childrenRecursive property"); - - return GetChildrenRecursive()->NewProxy(true); -} - -PyObject* KX_GameObject::PyGetMesh(PyObject* args) -{ - ShowDeprecationWarning("getMesh()", "the meshes property (now a list of meshes)"); - - int mesh = 0; - - if (!PyArg_ParseTuple(args, "|i:getMesh", &mesh)) - return NULL; // python sets a simple error - - if (((unsigned int)mesh < m_meshes.size()) && mesh >= 0) - { - KX_MeshProxy* meshproxy = new KX_MeshProxy(m_meshes[mesh]); - return meshproxy->NewProxy(true); // XXX Todo Python own. - } - - Py_RETURN_NONE; -} - - - - PyObject* KX_GameObject::PySetCollisionMargin(PyObject* value) { @@ -2432,29 +2323,6 @@ PyObject* KX_GameObject::PyRestoreDynamics() } - -PyObject* KX_GameObject::PyGetOrientation() //keywords -{ - ShowDeprecationWarning("getOrientation()", "the orientation property"); - return PyObjectFrom(NodeGetWorldOrientation()); -} - - - -PyObject* KX_GameObject::PySetOrientation(PyObject* value) -{ - ShowDeprecationWarning("setOrientation()", "the orientation property"); - MT_Matrix3x3 rot; - - /* if value is not a sequence PyOrientationTo makes an error */ - if (!PyOrientationTo(value, rot, "gameOb.setOrientation(sequence): KX_GameObject, ")) - return NULL; - - NodeSetLocalOrientation(rot); - NodeUpdateGS(0.f); - Py_RETURN_NONE; -} - PyObject* KX_GameObject::PyAlignAxisToVect(PyObject* args) { PyObject* pyvect; @@ -2487,33 +2355,6 @@ PyObject* KX_GameObject::PyGetAxisVect(PyObject* value) return NULL; } -PyObject* KX_GameObject::PySetPosition(PyObject* value) -{ - ShowDeprecationWarning("setPosition()", "the localPosition property"); - MT_Point3 pos; - if (PyVecTo(value, pos)) - { - NodeSetLocalPosition(pos); - NodeUpdateGS(0.f); - Py_RETURN_NONE; - } - - return NULL; -} - -PyObject* KX_GameObject::PySetWorldPosition(PyObject* value) -{ - ShowDeprecationWarning("setWorldPosition()", "the worldPosition property"); - MT_Point3 pos; - if (PyVecTo(value, pos)) - { - NodeSetWorldPosition(pos); - NodeUpdateGS(0.f); - Py_RETURN_NONE; - } - - return NULL; -} PyObject* KX_GameObject::PyGetPhysicsId() { diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index a5cd084b4d4..845cead1cdb 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -795,9 +795,7 @@ public: { return PyUnicode_FromString(GetName().ReadPtr()); } - - KX_PYMETHOD_NOARGS(KX_GameObject,GetPosition); - KX_PYMETHOD_O(KX_GameObject,SetPosition); + KX_PYMETHOD_O(KX_GameObject,SetWorldPosition); KX_PYMETHOD_VARARGS(KX_GameObject, ApplyForce); KX_PYMETHOD_VARARGS(KX_GameObject, ApplyTorque); @@ -808,10 +806,10 @@ public: KX_PYMETHOD_VARARGS(KX_GameObject,GetAngularVelocity); KX_PYMETHOD_VARARGS(KX_GameObject,SetAngularVelocity); KX_PYMETHOD_VARARGS(KX_GameObject,GetVelocity); - KX_PYMETHOD_NOARGS(KX_GameObject,GetMass); + KX_PYMETHOD_NOARGS(KX_GameObject,GetReactionForce); - KX_PYMETHOD_NOARGS(KX_GameObject,GetOrientation); - KX_PYMETHOD_O(KX_GameObject,SetOrientation); + + KX_PYMETHOD_NOARGS(KX_GameObject,GetVisible); KX_PYMETHOD_VARARGS(KX_GameObject,SetVisible); KX_PYMETHOD_VARARGS(KX_GameObject,SetOcclusion); @@ -828,7 +826,7 @@ public: KX_PYMETHOD_NOARGS(KX_GameObject,GetParent); KX_PYMETHOD_VARARGS(KX_GameObject,SetParent); KX_PYMETHOD_NOARGS(KX_GameObject,RemoveParent); - KX_PYMETHOD_NOARGS(KX_GameObject,GetChildren); + KX_PYMETHOD_NOARGS(KX_GameObject,GetChildren); KX_PYMETHOD_NOARGS(KX_GameObject,GetChildrenRecursive); KX_PYMETHOD_VARARGS(KX_GameObject,GetMesh); KX_PYMETHOD_NOARGS(KX_GameObject,GetPhysicsId); diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp index 3f241e90836..b71907be961 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.cpp +++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp @@ -434,21 +434,6 @@ PyTypeObject KX_IpoActuator::Type = { }; PyMethodDef KX_IpoActuator::Methods[] = { - // deprecated - {"set", (PyCFunction) KX_IpoActuator::sPySet, METH_VARARGS, (const char *)Set_doc}, - {"setProperty", (PyCFunction) KX_IpoActuator::sPySetProperty, METH_VARARGS, (const char *)SetProperty_doc}, - {"setStart", (PyCFunction) KX_IpoActuator::sPySetStart, METH_VARARGS, (const char *)SetStart_doc}, - {"getStart", (PyCFunction) KX_IpoActuator::sPyGetStart, METH_NOARGS, (const char *)GetStart_doc}, - {"setEnd", (PyCFunction) KX_IpoActuator::sPySetEnd, METH_VARARGS, (const char *)SetEnd_doc}, - {"getEnd", (PyCFunction) KX_IpoActuator::sPyGetEnd, METH_NOARGS, (const char *)GetEnd_doc}, - {"setIpoAsForce", (PyCFunction) KX_IpoActuator::sPySetIpoAsForce, METH_VARARGS, (const char *)SetIpoAsForce_doc}, - {"getIpoAsForce", (PyCFunction) KX_IpoActuator::sPyGetIpoAsForce, METH_NOARGS, (const char *)GetIpoAsForce_doc}, - {"setIpoAdd", (PyCFunction) KX_IpoActuator::sPySetIpoAdd, METH_VARARGS, (const char *)SetIpoAdd_doc}, - {"getIpoAdd", (PyCFunction) KX_IpoActuator::sPyGetIpoAdd, METH_NOARGS, (const char *)GetIpoAdd_doc}, - {"setForceIpoActsLocal", (PyCFunction) KX_IpoActuator::sPySetForceIpoActsLocal, METH_VARARGS, (const char *)SetForceIpoActsLocal_doc}, - {"getForceIpoActsLocal", (PyCFunction) KX_IpoActuator::sPyGetForceIpoActsLocal, METH_NOARGS, (const char *)GetForceIpoActsLocal_doc}, - {"setType", (PyCFunction) KX_IpoActuator::sPySetType, METH_VARARGS, (const char *)SetType_doc}, - {"getType", (PyCFunction) KX_IpoActuator::sPyGetType, METH_NOARGS, (const char *)GetType_doc}, {NULL,NULL} //Sentinel }; @@ -466,237 +451,4 @@ PyAttributeDef KX_IpoActuator::Attributes[] = { { NULL } //Sentinel }; - -/* set --------------------------------------------------------------------- */ -const char KX_IpoActuator::Set_doc[] = -"set(type, startframe, endframe, mode?)\n" -"\t - type: Play, PingPong, Flipper, LoopStop, LoopEnd or FromProp (string)\n" -"\t - startframe: first frame to use (int)\n" -"\t - endframe : last frame to use (int)\n" -"\t - mode? : special mode (0=normal, 1=interpret location as force, 2=additive)" -"\tSet the properties of the actuator.\n"; -PyObject* KX_IpoActuator::PySet(PyObject* args) { - - ShowDeprecationWarning("set()", "a range properties"); - - /* sets modes PLAY, PINGPONG, FLIPPER, LOOPSTOP, LOOPEND */ - /* arg 1 = mode string, arg 2 = startframe, arg3 = stopframe, */ - /* arg4 = force toggle */ - char* mode; - int forceToggle; - int modenum; - int startFrame, stopFrame; - if(!PyArg_ParseTuple(args, "siii:set", &mode, &startFrame, - &stopFrame, &forceToggle)) { - return NULL; - } - modenum = string2mode(mode); - - switch (modenum) { - case KX_ACT_IPO_PLAY: - case KX_ACT_IPO_PINGPONG: - case KX_ACT_IPO_FLIPPER: - case KX_ACT_IPO_LOOPSTOP: - case KX_ACT_IPO_LOOPEND: - m_type = modenum; - m_startframe = startFrame; - m_endframe = stopFrame; - m_ipo_as_force = forceToggle == 1; - m_ipo_add = forceToggle == 2; - break; - default: - ; /* error */ - } - - Py_RETURN_NONE; -} - -/* set property ----------------------------------------------------------- */ -const char KX_IpoActuator::SetProperty_doc[] = -"setProperty(propname)\n" -"\t - propname: name of the property (string)\n" -"\tSet the property to be used in FromProp mode.\n"; -PyObject* KX_IpoActuator::PySetProperty(PyObject* args) { - - ShowDeprecationWarning("setProperty()", "the propName property"); - - /* mode is implicit here, but not supported yet... */ - /* args: property */ - char *propertyName; - if(!PyArg_ParseTuple(args, "s:setProperty", &propertyName)) { - return NULL; - } - - m_propname = propertyName; - - Py_RETURN_NONE; -} - -/* 4. setStart: */ -const char KX_IpoActuator::SetStart_doc[] = -"setStart(frame)\n" -"\t - frame: first frame to use (int)\n" -"\tSet the frame from which the ipo starts playing.\n"; -PyObject* KX_IpoActuator::PySetStart(PyObject* args) { - - ShowDeprecationWarning("setStart()", "the frameStart property"); - - float startArg; - if(!PyArg_ParseTuple(args, "f:setStart", &startArg)) { - return NULL; - } - - m_startframe = startArg; - - Py_RETURN_NONE; -} -/* 5. getStart: */ -const char KX_IpoActuator::GetStart_doc[] = -"getStart()\n" -"\tReturns the frame from which the ipo starts playing.\n"; -PyObject* KX_IpoActuator::PyGetStart() { - ShowDeprecationWarning("getStart()", "the frameStart property"); - return PyFloat_FromDouble(m_startframe); -} - -/* 6. setEnd: */ -const char KX_IpoActuator::SetEnd_doc[] = -"setEnd(frame)\n" -"\t - frame: last frame to use (int)\n" -"\tSet the frame at which the ipo stops playing.\n"; -PyObject* KX_IpoActuator::PySetEnd(PyObject* args) { - ShowDeprecationWarning("setEnd()", "the frameEnd property"); - float endArg; - if(!PyArg_ParseTuple(args, "f:setEnd", &endArg)) { - return NULL; - } - - m_endframe = endArg; - - Py_RETURN_NONE; -} -/* 7. getEnd: */ -const char KX_IpoActuator::GetEnd_doc[] = -"getEnd()\n" -"\tReturns the frame at which the ipo stops playing.\n"; -PyObject* KX_IpoActuator::PyGetEnd() { - ShowDeprecationWarning("getEnd()", "the frameEnd property"); - return PyFloat_FromDouble(m_endframe); -} - -/* 6. setIpoAsForce: */ -const char KX_IpoActuator::SetIpoAsForce_doc[] = -"setIpoAsForce(force?)\n" -"\t - force? : interpret this ipo as a force? (KX_TRUE, KX_FALSE)\n" -"\tSet whether to interpret the ipo as a force rather than a displacement.\n"; -PyObject* KX_IpoActuator::PySetIpoAsForce(PyObject* args) { - ShowDeprecationWarning("setIpoAsForce()", "the useIpoAsForce property"); - int boolArg; - - if (!PyArg_ParseTuple(args, "i:setIpoAsForce", &boolArg)) { - return NULL; - } - - m_ipo_as_force = PyArgToBool(boolArg); - if (m_ipo_as_force) - m_ipo_add = false; - - Py_RETURN_NONE; -} -/* 7. getIpoAsForce: */ -const char KX_IpoActuator::GetIpoAsForce_doc[] = -"getIpoAsForce()\n" -"\tReturns whether to interpret the ipo as a force rather than a displacement.\n"; -PyObject* KX_IpoActuator::PyGetIpoAsForce() { - ShowDeprecationWarning("getIpoAsForce()", "the useIpoAsForce property"); - return BoolToPyArg(m_ipo_as_force); -} - -/* 6. setIpoAsForce: */ -const char KX_IpoActuator::SetIpoAdd_doc[] = -"setIpoAdd(add?)\n" -"\t - add? : add flag (KX_TRUE, KX_FALSE)\n" -"\tSet whether to interpret the ipo as additive rather than absolute.\n"; -PyObject* KX_IpoActuator::PySetIpoAdd(PyObject* args) { - ShowDeprecationWarning("setIpoAdd()", "the useIpoAdd property"); - int boolArg; - - if (!PyArg_ParseTuple(args, "i:setIpoAdd", &boolArg)) { - return NULL; - } - - m_ipo_add = PyArgToBool(boolArg); - if (m_ipo_add) - m_ipo_as_force = false; - - Py_RETURN_NONE; -} -/* 7. getIpoAsForce: */ -const char KX_IpoActuator::GetIpoAdd_doc[] = -"getIpoAsAdd()\n" -"\tReturns whether to interpret the ipo as additive rather than absolute.\n"; -PyObject* KX_IpoActuator::PyGetIpoAdd() { - ShowDeprecationWarning("getIpoAdd()", "the useIpoAdd property"); - return BoolToPyArg(m_ipo_add); -} - -/* 8. setType: */ -const char KX_IpoActuator::SetType_doc[] = -"setType(mode)\n" -"\t - mode: Play, PingPong, Flipper, LoopStop, LoopEnd or FromProp (string)\n" -"\tSet the operation mode of the actuator.\n"; -PyObject* KX_IpoActuator::PySetType(PyObject* args) { - ShowDeprecationWarning("setType()", "the mode property"); - int typeArg; - - if (!PyArg_ParseTuple(args, "i:setType", &typeArg)) { - return NULL; - } - - if ( (typeArg > KX_ACT_IPO_NODEF) - && (typeArg < KX_ACT_IPO_MAX) ) { - m_type = typeArg; - } - - Py_RETURN_NONE; -} -/* 9. getType: */ -const char KX_IpoActuator::GetType_doc[] = -"getType()\n" -"\tReturns the operation mode of the actuator.\n"; -PyObject* KX_IpoActuator::PyGetType() { - ShowDeprecationWarning("getType()", "the mode property"); - return PyLong_FromSsize_t(m_type); -} - -/* 10. setForceIpoActsLocal: */ -const char KX_IpoActuator::SetForceIpoActsLocal_doc[] = -"setForceIpoActsLocal(local?)\n" -"\t - local? : Apply the ipo-as-force in the object's local\n" -"\t coordinates? (KX_TRUE, KX_FALSE)\n" -"\tSet whether to apply the force in the object's local\n" -"\tcoordinates rather than the world global coordinates.\n"; -PyObject* KX_IpoActuator::PySetForceIpoActsLocal(PyObject* args) { - ShowDeprecationWarning("setForceIpoActsLocal()", "the useIpoLocal property"); - int boolArg; - - if (!PyArg_ParseTuple(args, "i:setForceIpoActsLocal", &boolArg)) { - return NULL; - } - - m_ipo_local = PyArgToBool(boolArg); - - Py_RETURN_NONE; -} -/* 11. getForceIpoActsLocal: */ -const char KX_IpoActuator::GetForceIpoActsLocal_doc[] = -"getForceIpoActsLocal()\n" -"\tReturn whether to apply the force in the object's local\n" -"\tcoordinates rather than the world global coordinates.\n"; -PyObject* KX_IpoActuator::PyGetForceIpoActsLocal() { - ShowDeprecationWarning("getForceIpoActsLocal()", "the useIpoLocal property"); - return BoolToPyArg(m_ipo_local); -} - - /* eof */ diff --git a/source/gameengine/Ketsji/KX_IpoActuator.h b/source/gameengine/Ketsji/KX_IpoActuator.h index 0581d1644ee..72fe812f98e 100644 --- a/source/gameengine/Ketsji/KX_IpoActuator.h +++ b/source/gameengine/Ketsji/KX_IpoActuator.h @@ -138,23 +138,6 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - //KX_PYMETHOD_DOC - KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,Set); - KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetProperty); -/* KX_PYMETHOD_DOC(KX_IpoActuator,SetKey2Key); */ - KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetStart); - KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetStart); - KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetEnd); - KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetEnd); - KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetIpoAsForce); - KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetIpoAsForce); - KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetIpoAdd); - KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetIpoAdd); - KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetType); - KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetType); - KX_PYMETHOD_DOC_VARARGS(KX_IpoActuator,SetForceIpoActsLocal); - KX_PYMETHOD_DOC_NOARGS(KX_IpoActuator,GetForceIpoActsLocal); - }; #endif //__KX_IPOACTUATOR diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp index e15847fe6c6..744fdb75796 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.cpp +++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp @@ -68,18 +68,12 @@ PyTypeObject KX_MeshProxy::Type = { }; PyMethodDef KX_MeshProxy::Methods[] = { -// Deprecated -----> -{"getNumMaterials", (PyCFunction)KX_MeshProxy::sPyGetNumMaterials,METH_VARARGS}, -{"getNumPolygons", (PyCFunction)KX_MeshProxy::sPyGetNumPolygons,METH_NOARGS}, -// <----- - {"getMaterialName", (PyCFunction)KX_MeshProxy::sPyGetMaterialName,METH_VARARGS}, {"getTextureName", (PyCFunction)KX_MeshProxy::sPyGetTextureName,METH_VARARGS}, {"getVertexArrayLength", (PyCFunction)KX_MeshProxy::sPyGetVertexArrayLength,METH_VARARGS}, {"getVertex", (PyCFunction)KX_MeshProxy::sPyGetVertex,METH_VARARGS}, {"getPolygon", (PyCFunction)KX_MeshProxy::sPyGetPolygon,METH_VARARGS}, //{"getIndexArrayLength", (PyCFunction)KX_MeshProxy::sPyGetIndexArrayLength,METH_VARARGS}, - {NULL,NULL} //Sentinel }; @@ -119,20 +113,6 @@ CValue* KX_MeshProxy::GetReplica() { return NULL;} // stuff for python integration - -PyObject* KX_MeshProxy::PyGetNumMaterials(PyObject* args, PyObject* kwds) -{ - int num = m_meshobj->NumMaterials(); - ShowDeprecationWarning("getNumMaterials()", "the numMaterials property"); - return PyLong_FromSsize_t(num); -} - -PyObject* KX_MeshProxy::PyGetNumPolygons() -{ - int num = m_meshobj->NumPolygons(); - ShowDeprecationWarning("getNumPolygons()", "the numPolygons property"); - return PyLong_FromSsize_t(num); -} PyObject* KX_MeshProxy::PyGetMaterialName(PyObject* args, PyObject* kwds) { diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp index 881747edff2..8abc4f6b897 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp @@ -368,13 +368,6 @@ PyTypeObject KX_MouseFocusSensor::Type = { }; PyMethodDef KX_MouseFocusSensor::Methods[] = { - {"getRayTarget", (PyCFunction) KX_MouseFocusSensor::sPyGetRayTarget, METH_NOARGS, (const char *)GetRayTarget_doc}, - {"getRaySource", (PyCFunction) KX_MouseFocusSensor::sPyGetRaySource, METH_NOARGS, (const char *)GetRaySource_doc}, - {"getHitObject",(PyCFunction) KX_MouseFocusSensor::sPyGetHitObject,METH_NOARGS, (const char *)GetHitObject_doc}, - {"getHitPosition",(PyCFunction) KX_MouseFocusSensor::sPyGetHitPosition,METH_NOARGS, (const char *)GetHitPosition_doc}, - {"getHitNormal",(PyCFunction) KX_MouseFocusSensor::sPyGetHitNormal,METH_NOARGS, (const char *)GetHitNormal_doc}, - {"getRayDirection",(PyCFunction) KX_MouseFocusSensor::sPyGetRayDirection,METH_NOARGS, (const char *)GetRayDirection_doc}, - {NULL,NULL} //Sentinel }; @@ -389,78 +382,6 @@ PyAttributeDef KX_MouseFocusSensor::Attributes[] = { { NULL } //Sentinel }; -const char KX_MouseFocusSensor::GetHitObject_doc[] = -"getHitObject()\n" -"\tReturns the object that was hit by this ray.\n"; -PyObject* KX_MouseFocusSensor::PyGetHitObject() -{ - ShowDeprecationWarning("GetHitObject()", "the hitObject property"); - - if (m_hitObject) - return m_hitObject->GetProxy(); - - Py_RETURN_NONE; -} - - -const char KX_MouseFocusSensor::GetHitPosition_doc[] = -"getHitPosition()\n" -"\tReturns the position (in worldcoordinates) where the object was hit by this ray.\n"; -PyObject* KX_MouseFocusSensor::PyGetHitPosition() -{ - ShowDeprecationWarning("getHitPosition()", "the hitPosition property"); - - return PyObjectFrom(m_hitPosition); -} - -const char KX_MouseFocusSensor::GetRayDirection_doc[] = -"getRayDirection()\n" -"\tReturns the direction from the ray (in worldcoordinates) .\n"; -PyObject* KX_MouseFocusSensor::PyGetRayDirection() -{ - ShowDeprecationWarning("getRayDirection()", "the rayDirection property"); - - MT_Vector3 dir = m_prevTargetPoint - m_prevSourcePoint; - if(MT_fuzzyZero(dir)) dir.setValue(0,0,0); - else dir.normalize(); - return PyObjectFrom(dir); -} - -const char KX_MouseFocusSensor::GetHitNormal_doc[] = -"getHitNormal()\n" -"\tReturns the normal (in worldcoordinates) at the point of collision where the object was hit by this ray.\n"; -PyObject* KX_MouseFocusSensor::PyGetHitNormal() -{ - ShowDeprecationWarning("getHitNormal()", "the hitNormal property"); - - return PyObjectFrom(m_hitNormal); -} - - -/* getRayTarget */ -const char KX_MouseFocusSensor::GetRayTarget_doc[] = -"getRayTarget()\n" -"\tReturns the target of the ray that seeks the focus object,\n" -"\tin worldcoordinates."; -PyObject* KX_MouseFocusSensor::PyGetRayTarget() -{ - ShowDeprecationWarning("getRayTarget()", "the rayTarget property"); - - return PyObjectFrom(m_prevTargetPoint); -} - -/* getRayTarget */ -const char KX_MouseFocusSensor::GetRaySource_doc[] = -"getRaySource()\n" -"\tReturns the source of the ray that seeks the focus object,\n" -"\tin worldcoordinates."; -PyObject* KX_MouseFocusSensor::PyGetRaySource() -{ - ShowDeprecationWarning("getRaySource()", "the raySource property"); - - return PyObjectFrom(m_prevSourcePoint); -} - /* Attributes */ PyObject* KX_MouseFocusSensor::pyattr_get_ray_source(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { diff --git a/source/gameengine/Ketsji/KX_MouseFocusSensor.h b/source/gameengine/Ketsji/KX_MouseFocusSensor.h index 89ac012c068..7b53557467f 100644 --- a/source/gameengine/Ketsji/KX_MouseFocusSensor.h +++ b/source/gameengine/Ketsji/KX_MouseFocusSensor.h @@ -90,14 +90,6 @@ class KX_MouseFocusSensor : public SCA_MouseSensor /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetRayTarget); - KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetRaySource); - - KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetHitObject); - KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetHitPosition); - KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetHitNormal); - KX_PYMETHOD_DOC_NOARGS(KX_MouseFocusSensor,GetRayDirection); - /* attributes */ static PyObject* pyattr_get_ray_source(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_ray_target(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index 2ee30ee0bfa..99179c5ed96 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -347,32 +347,6 @@ PyTypeObject KX_ObjectActuator::Type = { }; PyMethodDef KX_ObjectActuator::Methods[] = { - // Deprecated -----> - {"getForce", (PyCFunction) KX_ObjectActuator::sPyGetForce, METH_NOARGS}, - {"setForce", (PyCFunction) KX_ObjectActuator::sPySetForce, METH_VARARGS}, - {"getTorque", (PyCFunction) KX_ObjectActuator::sPyGetTorque, METH_NOARGS}, - {"setTorque", (PyCFunction) KX_ObjectActuator::sPySetTorque, METH_VARARGS}, - {"getDLoc", (PyCFunction) KX_ObjectActuator::sPyGetDLoc, METH_NOARGS}, - {"setDLoc", (PyCFunction) KX_ObjectActuator::sPySetDLoc, METH_VARARGS}, - {"getDRot", (PyCFunction) KX_ObjectActuator::sPyGetDRot, METH_NOARGS}, - {"setDRot", (PyCFunction) KX_ObjectActuator::sPySetDRot, METH_VARARGS}, - {"getLinearVelocity", (PyCFunction) KX_ObjectActuator::sPyGetLinearVelocity, METH_NOARGS}, - {"setLinearVelocity", (PyCFunction) KX_ObjectActuator::sPySetLinearVelocity, METH_VARARGS}, - {"getAngularVelocity", (PyCFunction) KX_ObjectActuator::sPyGetAngularVelocity, METH_NOARGS}, - {"setAngularVelocity", (PyCFunction) KX_ObjectActuator::sPySetAngularVelocity, METH_VARARGS}, - {"setDamping", (PyCFunction) KX_ObjectActuator::sPySetDamping, METH_VARARGS}, - {"getDamping", (PyCFunction) KX_ObjectActuator::sPyGetDamping, METH_NOARGS}, - {"setForceLimitX", (PyCFunction) KX_ObjectActuator::sPySetForceLimitX, METH_VARARGS}, - {"getForceLimitX", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitX, METH_NOARGS}, - {"setForceLimitY", (PyCFunction) KX_ObjectActuator::sPySetForceLimitY, METH_VARARGS}, - {"getForceLimitY", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitY, METH_NOARGS}, - {"setForceLimitZ", (PyCFunction) KX_ObjectActuator::sPySetForceLimitZ, METH_VARARGS}, - {"getForceLimitZ", (PyCFunction) KX_ObjectActuator::sPyGetForceLimitZ, METH_NOARGS}, - {"setPID", (PyCFunction) KX_ObjectActuator::sPyGetPID, METH_NOARGS}, - {"getPID", (PyCFunction) KX_ObjectActuator::sPySetPID, METH_VARARGS}, - - // <----- Deprecated - {NULL,NULL} //Sentinel }; @@ -667,305 +641,4 @@ int KX_ObjectActuator::pyattr_set_reference(void *self, const struct KX_PYATTRIB return PY_SET_ATTR_SUCCESS; } - -/* 1. set ------------------------------------------------------------------ */ -/* Removed! */ - -/* 2. getForce */ -PyObject* KX_ObjectActuator::PyGetForce() -{ - ShowDeprecationWarning("getForce()", "the force and the useLocalForce properties"); - PyObject *retVal = PyList_New(4); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_force[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_force[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_force[2])); - PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.Force)); - - return retVal; -} -/* 3. setForce */ -PyObject* KX_ObjectActuator::PySetForce(PyObject* args) -{ - ShowDeprecationWarning("setForce()", "the force and the useLocalForce properties"); - float vecArg[3]; - int bToggle = 0; - if (!PyArg_ParseTuple(args, "fffi:setForce", &vecArg[0], &vecArg[1], - &vecArg[2], &bToggle)) { - return NULL; - } - m_force.setValue(vecArg); - m_bitLocalFlag.Force = PyArgToBool(bToggle); - UpdateFuzzyFlags(); - Py_RETURN_NONE; -} - -/* 4. getTorque */ -PyObject* KX_ObjectActuator::PyGetTorque() -{ - ShowDeprecationWarning("getTorque()", "the torque and the useLocalTorque properties"); - PyObject *retVal = PyList_New(4); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_torque[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_torque[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_torque[2])); - PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.Torque)); - - return retVal; -} -/* 5. setTorque */ -PyObject* KX_ObjectActuator::PySetTorque(PyObject* args) -{ - ShowDeprecationWarning("setTorque()", "the torque and the useLocalTorque properties"); - float vecArg[3]; - int bToggle = 0; - if (!PyArg_ParseTuple(args, "fffi:setTorque", &vecArg[0], &vecArg[1], - &vecArg[2], &bToggle)) { - return NULL; - } - m_torque.setValue(vecArg); - m_bitLocalFlag.Torque = PyArgToBool(bToggle); - UpdateFuzzyFlags(); - Py_RETURN_NONE; -} - -/* 6. getDLoc */ -PyObject* KX_ObjectActuator::PyGetDLoc() -{ - ShowDeprecationWarning("getDLoc()", "the dLoc and the useLocalDLoc properties"); - PyObject *retVal = PyList_New(4); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_dloc[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_dloc[2])); - PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.DLoc)); - - return retVal; -} -/* 7. setDLoc */ -PyObject* KX_ObjectActuator::PySetDLoc(PyObject* args) -{ - ShowDeprecationWarning("setDLoc()", "the dLoc and the useLocalDLoc properties"); - float vecArg[3]; - int bToggle = 0; - if(!PyArg_ParseTuple(args, "fffi:setDLoc", &vecArg[0], &vecArg[1], - &vecArg[2], &bToggle)) { - return NULL; - } - m_dloc.setValue(vecArg); - m_bitLocalFlag.DLoc = PyArgToBool(bToggle); - UpdateFuzzyFlags(); - Py_RETURN_NONE; -} - -/* 8. getDRot */ -PyObject* KX_ObjectActuator::PyGetDRot() -{ - ShowDeprecationWarning("getDRot()", "the dRot and the useLocalDRot properties"); - PyObject *retVal = PyList_New(4); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_drot[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_drot[2])); - PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.DRot)); - - return retVal; -} -/* 9. setDRot */ -PyObject* KX_ObjectActuator::PySetDRot(PyObject* args) -{ - ShowDeprecationWarning("setDRot()", "the dRot and the useLocalDRot properties"); - float vecArg[3]; - int bToggle = 0; - if (!PyArg_ParseTuple(args, "fffi:setDRot", &vecArg[0], &vecArg[1], - &vecArg[2], &bToggle)) { - return NULL; - } - m_drot.setValue(vecArg); - m_bitLocalFlag.DRot = PyArgToBool(bToggle); - UpdateFuzzyFlags(); - Py_RETURN_NONE; -} - -/* 10. getLinearVelocity */ -PyObject* KX_ObjectActuator::PyGetLinearVelocity() { - ShowDeprecationWarning("getLinearVelocity()", "the linV and the useLocalLinV properties"); - PyObject *retVal = PyList_New(4); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_linear_velocity[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_linear_velocity[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_linear_velocity[2])); - PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.LinearVelocity)); - - return retVal; -} - -/* 11. setLinearVelocity */ -PyObject* KX_ObjectActuator::PySetLinearVelocity(PyObject* args) { - ShowDeprecationWarning("setLinearVelocity()", "the linV and the useLocalLinV properties"); - float vecArg[3]; - int bToggle = 0; - if (!PyArg_ParseTuple(args, "fffi:setLinearVelocity", &vecArg[0], &vecArg[1], - &vecArg[2], &bToggle)) { - return NULL; - } - m_linear_velocity.setValue(vecArg); - m_bitLocalFlag.LinearVelocity = PyArgToBool(bToggle); - UpdateFuzzyFlags(); - Py_RETURN_NONE; -} - - -/* 12. getAngularVelocity */ -PyObject* KX_ObjectActuator::PyGetAngularVelocity() { - ShowDeprecationWarning("getAngularVelocity()", "the angV and the useLocalAngV properties"); - PyObject *retVal = PyList_New(4); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_angular_velocity[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_angular_velocity[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_angular_velocity[2])); - PyList_SET_ITEM(retVal, 3, BoolToPyArg(m_bitLocalFlag.AngularVelocity)); - - return retVal; -} -/* 13. setAngularVelocity */ -PyObject* KX_ObjectActuator::PySetAngularVelocity(PyObject* args) { - ShowDeprecationWarning("setAngularVelocity()", "the angV and the useLocalAngV properties"); - float vecArg[3]; - int bToggle = 0; - if (!PyArg_ParseTuple(args, "fffi:setAngularVelocity", &vecArg[0], &vecArg[1], - &vecArg[2], &bToggle)) { - return NULL; - } - m_angular_velocity.setValue(vecArg); - m_bitLocalFlag.AngularVelocity = PyArgToBool(bToggle); - UpdateFuzzyFlags(); - Py_RETURN_NONE; -} - -/* 13. setDamping */ -PyObject* KX_ObjectActuator::PySetDamping(PyObject* args) { - ShowDeprecationWarning("setDamping()", "the damping property"); - int damping = 0; - if (!PyArg_ParseTuple(args, "i:setDamping", &damping) || damping < 0 || damping > 1000) { - return NULL; - } - m_damping = damping; - Py_RETURN_NONE; -} - -/* 13. getVelocityDamping */ -PyObject* KX_ObjectActuator::PyGetDamping() { - ShowDeprecationWarning("getDamping()", "the damping property"); - return Py_BuildValue("i",m_damping); -} -/* 6. getForceLimitX */ -PyObject* KX_ObjectActuator::PyGetForceLimitX() -{ - ShowDeprecationWarning("getForceLimitX()", "the forceLimitX property"); - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[0])); - PyList_SET_ITEM(retVal, 2, BoolToPyArg(m_bitLocalFlag.Torque)); - - return retVal; -} -/* 7. setForceLimitX */ -PyObject* KX_ObjectActuator::PySetForceLimitX(PyObject* args) -{ - ShowDeprecationWarning("setForceLimitX()", "the forceLimitX property"); - float vecArg[2]; - int bToggle = 0; - if(!PyArg_ParseTuple(args, "ffi:setForceLimitX", &vecArg[0], &vecArg[1], &bToggle)) { - return NULL; - } - m_drot[0] = vecArg[0]; - m_dloc[0] = vecArg[1]; - m_bitLocalFlag.Torque = PyArgToBool(bToggle); - Py_RETURN_NONE; -} - -/* 6. getForceLimitY */ -PyObject* KX_ObjectActuator::PyGetForceLimitY() -{ - ShowDeprecationWarning("getForceLimitY()", "the forceLimitY property"); - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[1])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[1])); - PyList_SET_ITEM(retVal, 2, BoolToPyArg(m_bitLocalFlag.DLoc)); - - return retVal; -} -/* 7. setForceLimitY */ -PyObject* KX_ObjectActuator::PySetForceLimitY(PyObject* args) -{ - ShowDeprecationWarning("setForceLimitY()", "the forceLimitY property"); - float vecArg[2]; - int bToggle = 0; - if(!PyArg_ParseTuple(args, "ffi:setForceLimitY", &vecArg[0], &vecArg[1], &bToggle)) { - return NULL; - } - m_drot[1] = vecArg[0]; - m_dloc[1] = vecArg[1]; - m_bitLocalFlag.DLoc = PyArgToBool(bToggle); - Py_RETURN_NONE; -} - -/* 6. getForceLimitZ */ -PyObject* KX_ObjectActuator::PyGetForceLimitZ() -{ - ShowDeprecationWarning("getForceLimitZ()", "the forceLimitZ property"); - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_drot[2])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_dloc[2])); - PyList_SET_ITEM(retVal, 2, BoolToPyArg(m_bitLocalFlag.DRot)); - - return retVal; -} -/* 7. setForceLimitZ */ -PyObject* KX_ObjectActuator::PySetForceLimitZ(PyObject* args) -{ - ShowDeprecationWarning("setForceLimitZ()", "the forceLimitZ property"); - float vecArg[2]; - int bToggle = 0; - if(!PyArg_ParseTuple(args, "ffi:setForceLimitZ", &vecArg[0], &vecArg[1], &bToggle)) { - return NULL; - } - m_drot[2] = vecArg[0]; - m_dloc[2] = vecArg[1]; - m_bitLocalFlag.DRot = PyArgToBool(bToggle); - Py_RETURN_NONE; -} - -/* 4. getPID */ -PyObject* KX_ObjectActuator::PyGetPID() -{ - ShowDeprecationWarning("getPID()", "the pid property"); - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_pid[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_pid[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_pid[2])); - - return retVal; -} -/* 5. setPID */ -PyObject* KX_ObjectActuator::PySetPID(PyObject* args) -{ - ShowDeprecationWarning("setPID()", "the pid property"); - float vecArg[3]; - if (!PyArg_ParseTuple(args, "fff:setPID", &vecArg[0], &vecArg[1], &vecArg[2])) { - return NULL; - } - m_pid.setValue(vecArg); - Py_RETURN_NONE; -} - - - - - /* eof */ diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.h b/source/gameengine/Ketsji/KX_ObjectActuator.h index 20aec9e0e86..7a8c7de16b1 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.h +++ b/source/gameengine/Ketsji/KX_ObjectActuator.h @@ -163,29 +163,6 @@ public: /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForce); - KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForce); - KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetTorque); - KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetTorque); - KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDLoc); - KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetDLoc); - KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDRot); - KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetDRot); - KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetLinearVelocity); - KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetLinearVelocity); - KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetAngularVelocity); - KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetAngularVelocity); - KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetDamping); - KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetDamping); - KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitX); - KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForceLimitX); - KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitY); - KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForceLimitY); - KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetForceLimitZ); - KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetForceLimitZ); - KX_PYMETHOD_NOARGS(KX_ObjectActuator,GetPID); - KX_PYMETHOD_VARARGS(KX_ObjectActuator,SetPID); - /* Attributes */ static PyObject* pyattr_get_forceLimitX(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_forceLimitX(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp index 621aeea87be..20e982f03e0 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.cpp +++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp @@ -162,10 +162,6 @@ PyTypeObject KX_ParentActuator::Type = { }; PyMethodDef KX_ParentActuator::Methods[] = { - // Deprecated -----> - {"setObject", (PyCFunction) KX_ParentActuator::sPySetObject, METH_O, (const char *)SetObject_doc}, - {"getObject", (PyCFunction) KX_ParentActuator::sPyGetObject, METH_VARARGS, (const char *)GetObject_doc}, - // <----- {NULL,NULL} //Sentinel }; @@ -205,55 +201,4 @@ int KX_ParentActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBUTE return PY_SET_ATTR_SUCCESS; } - -/* Deprecated -----> */ -/* 1. setObject */ -const char KX_ParentActuator::SetObject_doc[] = -"setObject(object)\n" -"\t- object: KX_GameObject, string or None\n" -"\tSet the object to set as parent.\n"; -PyObject* KX_ParentActuator::PySetObject(PyObject* value) { - KX_GameObject *gameobj; - - ShowDeprecationWarning("setObject()", "the object property"); - - if (!ConvertPythonToGameObject(value, &gameobj, true, "actuator.setObject(value): KX_ParentActuator")) - return NULL; // ConvertPythonToGameObject sets the error - - if (m_ob != NULL) - m_ob->UnregisterActuator(this); - - m_ob = (SCA_IObject*)gameobj; - if (m_ob) - m_ob->RegisterActuator(this); - - Py_RETURN_NONE; -} - -/* 2. getObject */ - -/* get obj ---------------------------------------------------------- */ -const char KX_ParentActuator::GetObject_doc[] = -"getObject(name_only = 1)\n" -"name_only - optional arg, when true will return the KX_GameObject rather then its name\n" -"\tReturns the object that is set to.\n"; -PyObject* KX_ParentActuator::PyGetObject(PyObject* args) -{ - int ret_name_only = 1; - - ShowDeprecationWarning("getObject()", "the object property"); - - if (!PyArg_ParseTuple(args, "|i:getObject", &ret_name_only)) - return NULL; - - if (!m_ob) - Py_RETURN_NONE; - - if (ret_name_only) - return PyUnicode_FromString(m_ob->GetName().ReadPtr()); - else - return m_ob->GetProxy(); -} -/* <----- */ - /* eof */ diff --git a/source/gameengine/Ketsji/KX_ParentActuator.h b/source/gameengine/Ketsji/KX_ParentActuator.h index aeb39eabf89..f750affc8a1 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.h +++ b/source/gameengine/Ketsji/KX_ParentActuator.h @@ -84,11 +84,6 @@ class KX_ParentActuator : public SCA_IActuator /* These are used to get and set m_ob */ static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); - - // Deprecated -----> - KX_PYMETHOD_DOC_O(KX_ParentActuator,SetObject); - KX_PYMETHOD_DOC_VARARGS(KX_ParentActuator,GetObject); - // <----- }; /* end of class KX_ParentActuator : public SCA_PropertyActuator */ diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 49cf895af17..5afaf61dee2 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -484,8 +484,6 @@ static struct PyMethodDef game_methods[] = { METH_NOARGS, gPyGetCurrentScene_doc}, {"getSceneList", (PyCFunction) gPyGetSceneList, METH_NOARGS, (const char *)gPyGetSceneList_doc}, - {"addActiveActuator",(PyCFunction) SCA_PythonController::sPyAddActiveActuator, - METH_VARARGS, (const char *)SCA_PythonController::sPyAddActiveActuator__doc__}, {"getRandomFloat",(PyCFunction) gPyGetRandomFloat, METH_NOARGS, (const char *)gPyGetRandomFloat_doc}, {"setGravity",(PyCFunction) gPySetGravity, METH_O, (const char *)"set Gravitation"}, diff --git a/source/gameengine/Ketsji/KX_RadarSensor.cpp b/source/gameengine/Ketsji/KX_RadarSensor.cpp index d020a2544d2..eb127be8044 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.cpp +++ b/source/gameengine/Ketsji/KX_RadarSensor.cpp @@ -176,51 +176,7 @@ void KX_RadarSensor::SynchronizeTransform() /* Python Functions */ /* ------------------------------------------------------------------------- */ -//Deprecated -----> -/* getConeOrigin */ -const char KX_RadarSensor::GetConeOrigin_doc[] = -"getConeOrigin()\n" -"\tReturns the origin of the cone with which to test. The origin\n" -"\tis in the middle of the cone."; -PyObject* KX_RadarSensor::PyGetConeOrigin() { - ShowDeprecationWarning("getConeOrigin()", "the coneOrigin property"); - - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_cone_origin[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_cone_origin[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_cone_origin[2])); - - return retVal; -} - -/* getConeOrigin */ -const char KX_RadarSensor::GetConeTarget_doc[] = -"getConeTarget()\n" -"\tReturns the center of the bottom face of the cone with which to test.\n"; -PyObject* KX_RadarSensor::PyGetConeTarget() { - ShowDeprecationWarning("getConeTarget()", "the coneTarget property"); - - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_cone_target[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_cone_target[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_cone_target[2])); - - return retVal; -} - -/* getConeHeight */ -const char KX_RadarSensor::GetConeHeight_doc[] = -"getConeHeight()\n" -"\tReturns the height of the cone with which to test.\n"; -PyObject* KX_RadarSensor::PyGetConeHeight() { - - ShowDeprecationWarning("getConeHeight()", "the distance property"); - - return PyFloat_FromDouble(m_coneheight); -} -//<----- Deprecated +/* none */ /* ------------------------------------------------------------------------- */ /* Python Integration Hooks */ @@ -248,14 +204,6 @@ PyTypeObject KX_RadarSensor::Type = { }; PyMethodDef KX_RadarSensor::Methods[] = { - //Deprecated -----> - {"getConeOrigin", (PyCFunction) KX_RadarSensor::sPyGetConeOrigin, - METH_VARARGS, (const char *)GetConeOrigin_doc}, - {"getConeTarget", (PyCFunction) KX_RadarSensor::sPyGetConeTarget, - METH_VARARGS, (const char *)GetConeTarget_doc}, - {"getConeHeight", (PyCFunction) KX_RadarSensor::sPyGetConeHeight, - METH_VARARGS, (const char *)GetConeHeight_doc}, - //<----- {NULL} //Sentinel }; diff --git a/source/gameengine/Ketsji/KX_RadarSensor.h b/source/gameengine/Ketsji/KX_RadarSensor.h index 9f38d75abc4..487e9f1aaa7 100644 --- a/source/gameengine/Ketsji/KX_RadarSensor.h +++ b/source/gameengine/Ketsji/KX_RadarSensor.h @@ -90,11 +90,6 @@ public: /* python */ virtual sensortype GetSensorType() { return ST_RADAR; } - //Deprecated -----> - KX_PYMETHOD_DOC_NOARGS(KX_RadarSensor,GetConeOrigin); - KX_PYMETHOD_DOC_NOARGS(KX_RadarSensor,GetConeTarget); - KX_PYMETHOD_DOC_NOARGS(KX_RadarSensor,GetConeHeight); - //<----- }; #endif //__KX_RADAR_SENSOR_H diff --git a/source/gameengine/Ketsji/KX_RaySensor.cpp b/source/gameengine/Ketsji/KX_RaySensor.cpp index 8616145d709..1f36945ccaa 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.cpp +++ b/source/gameengine/Ketsji/KX_RaySensor.cpp @@ -342,12 +342,6 @@ PyTypeObject KX_RaySensor::Type = { }; PyMethodDef KX_RaySensor::Methods[] = { - // Deprecated -----> - {"getHitObject",(PyCFunction) KX_RaySensor::sPyGetHitObject,METH_NOARGS, (const char *)GetHitObject_doc}, - {"getHitPosition",(PyCFunction) KX_RaySensor::sPyGetHitPosition,METH_NOARGS, (const char *)GetHitPosition_doc}, - {"getHitNormal",(PyCFunction) KX_RaySensor::sPyGetHitNormal,METH_NOARGS, (const char *)GetHitNormal_doc}, - {"getRayDirection",(PyCFunction) KX_RaySensor::sPyGetRayDirection,METH_NOARGS, (const char *)GetRayDirection_doc}, - // <----- {NULL,NULL} //Sentinel }; @@ -372,68 +366,3 @@ PyObject* KX_RaySensor::pyattr_get_hitobject(void *self_v, const KX_PYATTRIBUTE_ Py_RETURN_NONE; } - -// Deprecated -----> -const char KX_RaySensor::GetHitObject_doc[] = -"getHitObject()\n" -"\tReturns the name of the object that was hit by this ray.\n"; -PyObject* KX_RaySensor::PyGetHitObject() -{ - ShowDeprecationWarning("getHitObject()", "the hitObject property"); - if (m_hitObject) - { - return m_hitObject->GetProxy(); - } - Py_RETURN_NONE; -} - - -const char KX_RaySensor::GetHitPosition_doc[] = -"getHitPosition()\n" -"\tReturns the position (in worldcoordinates) where the object was hit by this ray.\n"; -PyObject* KX_RaySensor::PyGetHitPosition() -{ - ShowDeprecationWarning("getHitPosition()", "the hitPosition property"); - - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_hitPosition[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_hitPosition[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_hitPosition[2])); - - return retVal; -} - -const char KX_RaySensor::GetRayDirection_doc[] = -"getRayDirection()\n" -"\tReturns the direction from the ray (in worldcoordinates) .\n"; -PyObject* KX_RaySensor::PyGetRayDirection() -{ - ShowDeprecationWarning("getRayDirection()", "the rayDirection property"); - - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_rayDirection[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_rayDirection[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_rayDirection[2])); - - return retVal; -} - -const char KX_RaySensor::GetHitNormal_doc[] = -"getHitNormal()\n" -"\tReturns the normal (in worldcoordinates) of the object at the location where the object was hit by this ray.\n"; -PyObject* KX_RaySensor::PyGetHitNormal() -{ - ShowDeprecationWarning("getHitNormal()", "the hitNormal property"); - - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_hitNormal[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_hitNormal[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_hitNormal[2])); - - return retVal; -} - -// <----- Deprecated diff --git a/source/gameengine/Ketsji/KX_RaySensor.h b/source/gameengine/Ketsji/KX_RaySensor.h index 530c8ce54e5..d3e92a14214 100644 --- a/source/gameengine/Ketsji/KX_RaySensor.h +++ b/source/gameengine/Ketsji/KX_RaySensor.h @@ -84,12 +84,6 @@ public: KX_RAY_AXIS_NEG_Z }; - // Deprecated -----> - KX_PYMETHOD_DOC_NOARGS(KX_RaySensor,GetHitObject); - KX_PYMETHOD_DOC_NOARGS(KX_RaySensor,GetHitPosition); - KX_PYMETHOD_DOC_NOARGS(KX_RaySensor,GetHitNormal); - KX_PYMETHOD_DOC_NOARGS(KX_RaySensor,GetRayDirection); - // <----- /* Attributes */ static PyObject* pyattr_get_hitobject(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp index fffb0ac1220..099403fc28d 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp @@ -192,18 +192,7 @@ PyTypeObject KX_SCA_AddObjectActuator::Type = { }; PyMethodDef KX_SCA_AddObjectActuator::Methods[] = { - // ---> deprecated - {"setTime", (PyCFunction) KX_SCA_AddObjectActuator::sPySetTime, METH_O, (const char *)SetTime_doc}, - {"getTime", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetTime, METH_NOARGS, (const char *)GetTime_doc}, - {"getLinearVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetLinearVelocity, METH_NOARGS, (const char *)GetLinearVelocity_doc}, - {"setLinearVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPySetLinearVelocity, METH_VARARGS, (const char *)SetLinearVelocity_doc}, - {"getAngularVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetAngularVelocity, METH_NOARGS, (const char *)GetAngularVelocity_doc}, - {"setAngularVelocity", (PyCFunction) KX_SCA_AddObjectActuator::sPySetAngularVelocity, METH_VARARGS, (const char *)SetAngularVelocity_doc}, - {"getLastCreatedObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetLastCreatedObject, METH_NOARGS,"getLastCreatedObject() : get the object handle to the last created object\n"}, {"instantAddObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyInstantAddObject, METH_NOARGS,"instantAddObject() : immediately add object without delay\n"}, - {"setObject", (PyCFunction) KX_SCA_AddObjectActuator::sPySetObject, METH_O, (const char *)SetObject_doc}, - {"getObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyGetObject, METH_VARARGS, (const char *)GetObject_doc}, - {NULL,NULL} //Sentinel }; @@ -253,181 +242,6 @@ PyObject* KX_SCA_AddObjectActuator::pyattr_get_objectLastCreated(void *self, con return actuator->m_lastCreatedObject->GetProxy(); } -/* 1. setObject */ -const char KX_SCA_AddObjectActuator::SetObject_doc[] = -"setObject(object)\n" -"\t- object: KX_GameObject, string or None\n" -"\tSets the object that will be added. There has to be an object\n" -"\tof this name. If not, this function does nothing.\n"; -PyObject* KX_SCA_AddObjectActuator::PySetObject(PyObject* value) -{ - KX_GameObject *gameobj; - - ShowDeprecationWarning("setObject()", "the object property"); - - if (!ConvertPythonToGameObject(value, &gameobj, true, "actuator.setObject(value): KX_SCA_AddObjectActuator")) - return NULL; // ConvertPythonToGameObject sets the error - - if (m_OriginalObject != NULL) - m_OriginalObject->UnregisterActuator(this); - - m_OriginalObject = (SCA_IObject*)gameobj; - if (m_OriginalObject) - m_OriginalObject->RegisterActuator(this); - - Py_RETURN_NONE; -} - - - -/* 2. setTime */ -const char KX_SCA_AddObjectActuator::SetTime_doc[] = -"setTime(duration)\n" -"\t- duration: integer\n" -"\tSets the lifetime of the object that will be added, in frames. \n" -"\tIf the duration is negative, it is set to 0.\n"; - - -PyObject* KX_SCA_AddObjectActuator::PySetTime(PyObject* value) -{ - ShowDeprecationWarning("setTime()", "the time property"); - int deltatime = PyLong_AsSsize_t(value); - if (deltatime==-1 && PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, "expected an int"); - return NULL; - } - - m_timeProp = deltatime; - if (m_timeProp < 0) m_timeProp = 0; - - Py_RETURN_NONE; -} - - - -/* 3. getTime */ -const char KX_SCA_AddObjectActuator::GetTime_doc[] = -"getTime()\n" -"\tReturns the lifetime of the object that will be added.\n"; - - -PyObject* KX_SCA_AddObjectActuator::PyGetTime() -{ - ShowDeprecationWarning("getTime()", "the time property"); - return PyLong_FromSsize_t(m_timeProp); -} - - -/* 4. getObject */ -const char KX_SCA_AddObjectActuator::GetObject_doc[] = -"getObject(name_only = 1)\n" -"name_only - optional arg, when true will return the KX_GameObject rather then its name\n" -"\tReturns the name of the object that will be added.\n"; -PyObject* KX_SCA_AddObjectActuator::PyGetObject(PyObject* args) -{ - int ret_name_only = 1; - - ShowDeprecationWarning("getObject()", "the object property"); - - if (!PyArg_ParseTuple(args, "|i:getObject", &ret_name_only)) - return NULL; - - if (!m_OriginalObject) - Py_RETURN_NONE; - - if (ret_name_only) - return PyUnicode_FromString(m_OriginalObject->GetName().ReadPtr()); - else - return m_OriginalObject->GetProxy(); -} - - - -/* 5. getLinearVelocity */ -const char KX_SCA_AddObjectActuator::GetLinearVelocity_doc[] = -"GetLinearVelocity()\n" -"\tReturns the linear velocity that will be assigned to \n" -"\tthe created object.\n"; - -PyObject* KX_SCA_AddObjectActuator::PyGetLinearVelocity() -{ - ShowDeprecationWarning("getLinearVelocity()", "the linearVelocity property"); - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_linear_velocity[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_linear_velocity[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_linear_velocity[2])); - - return retVal; -} - - - -/* 6. setLinearVelocity */ -const char KX_SCA_AddObjectActuator::SetLinearVelocity_doc[] = -"setLinearVelocity(vx, vy, vz)\n" -"\t- vx: float\n" -"\t- vy: float\n" -"\t- vz: float\n" -"\t- local: bool\n" -"\tAssign this velocity to the created object. \n"; - -PyObject* KX_SCA_AddObjectActuator::PySetLinearVelocity(PyObject* args) -{ - ShowDeprecationWarning("setLinearVelocity()", "the linearVelocity property"); - - float vecArg[3]; - if (!PyArg_ParseTuple(args, "fff:setLinearVelocity", &vecArg[0], &vecArg[1], &vecArg[2])) - return NULL; - - m_linear_velocity[0] = vecArg[0]; - m_linear_velocity[1] = vecArg[1]; - m_linear_velocity[2] = vecArg[2]; - Py_RETURN_NONE; -} - -/* 7. getAngularVelocity */ -const char KX_SCA_AddObjectActuator::GetAngularVelocity_doc[] = -"GetAngularVelocity()\n" -"\tReturns the angular velocity that will be assigned to \n" -"\tthe created object.\n"; - -PyObject* KX_SCA_AddObjectActuator::PyGetAngularVelocity() -{ - ShowDeprecationWarning("getAngularVelocity()", "the angularVelocity property"); - PyObject *retVal = PyList_New(3); - - PyList_SET_ITEM(retVal, 0, PyFloat_FromDouble(m_angular_velocity[0])); - PyList_SET_ITEM(retVal, 1, PyFloat_FromDouble(m_angular_velocity[1])); - PyList_SET_ITEM(retVal, 2, PyFloat_FromDouble(m_angular_velocity[2])); - - return retVal; -} - - - -/* 8. setAngularVelocity */ -const char KX_SCA_AddObjectActuator::SetAngularVelocity_doc[] = -"setAngularVelocity(vx, vy, vz)\n" -"\t- vx: float\n" -"\t- vy: float\n" -"\t- vz: float\n" -"\t- local: bool\n" -"\tAssign this angular velocity to the created object. \n"; - -PyObject* KX_SCA_AddObjectActuator::PySetAngularVelocity(PyObject* args) -{ - ShowDeprecationWarning("setAngularVelocity()", "the angularVelocity property"); - - float vecArg[3]; - if (!PyArg_ParseTuple(args, "fff:setAngularVelocity", &vecArg[0], &vecArg[1], &vecArg[2])) - return NULL; - - m_angular_velocity[0] = vecArg[0]; - m_angular_velocity[1] = vecArg[1]; - m_angular_velocity[2] = vecArg[2]; - Py_RETURN_NONE; -} void KX_SCA_AddObjectActuator::InstantAddObject() { @@ -470,26 +284,3 @@ PyObject* KX_SCA_AddObjectActuator::PyInstantAddObject() Py_RETURN_NONE; } - - - -/* 7. GetLastCreatedObject */ -const char KX_SCA_AddObjectActuator::GetLastCreatedObject_doc[] = -"getLastCreatedObject()\n" -"\tReturn the last created object. \n"; - - -PyObject* KX_SCA_AddObjectActuator::PyGetLastCreatedObject() -{ - ShowDeprecationWarning("getLastCreatedObject()", "the objectLastCreated property"); - SCA_IObject* result = this->GetLastCreatedObject(); - - // if result->GetSGNode() is NULL - // it means the object has ended, The BGE python api crashes in many places if the object is returned. - if (result && (static_cast(result))->GetSGNode()) - { - return result->GetProxy(); - } - // don't return NULL to python anymore, it gives trouble in the scripts - Py_RETURN_NONE; -} diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h index 3151e7a89ca..7137ba5209e 100644 --- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h @@ -115,25 +115,6 @@ public: void InstantAddObject(); - /* 1. setObject */ - KX_PYMETHOD_DOC_O(KX_SCA_AddObjectActuator,SetObject); - /* 2. setTime */ - KX_PYMETHOD_DOC_O(KX_SCA_AddObjectActuator,SetTime); - /* 3. getTime */ - KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,GetTime); - /* 4. getObject */ - KX_PYMETHOD_DOC_VARARGS(KX_SCA_AddObjectActuator,GetObject); - /* 5. getLinearVelocity */ - KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,GetLinearVelocity); - /* 6. setLinearVelocity */ - KX_PYMETHOD_DOC_VARARGS(KX_SCA_AddObjectActuator,SetLinearVelocity); - /* 7. getAngularVelocity */ - KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,GetAngularVelocity); - /* 8. setAngularVelocity */ - KX_PYMETHOD_DOC_VARARGS(KX_SCA_AddObjectActuator,SetAngularVelocity); - /* 9. getLastCreatedObject */ - KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,GetLastCreatedObject); - /* 10. instantAddObject*/ KX_PYMETHOD_DOC_NOARGS(KX_SCA_AddObjectActuator,InstantAddObject); static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp index 196c1915f72..646cfb7219f 100644 --- a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp @@ -70,9 +70,6 @@ PyTypeObject KX_SCA_DynamicActuator::Type = { }; PyMethodDef KX_SCA_DynamicActuator::Methods[] = { - // ---> deprecated - KX_PYMETHODTABLE(KX_SCA_DynamicActuator, setOperation), - KX_PYMETHODTABLE(KX_SCA_DynamicActuator, getOperation), {NULL,NULL} //Sentinel }; @@ -82,42 +79,6 @@ PyAttributeDef KX_SCA_DynamicActuator::Attributes[] = { { NULL } //Sentinel }; - -/* 1. setOperation */ -KX_PYMETHODDEF_DOC(KX_SCA_DynamicActuator, setOperation, -"setOperation(operation?)\n" -"\t - operation? : type of dynamic operation\n" -"\t 0 = restore dynamics\n" -"\t 1 = disable dynamics\n" -"\t 2 = enable rigid body\n" -"\t 3 = disable rigid body\n" -"Change the dynamic status of the parent object.\n") -{ - ShowDeprecationWarning("setOperation()", "the mode property"); - int dyn_operation; - - if (!PyArg_ParseTuple(args, "i:setOperation", &dyn_operation)) - { - return NULL; - } - if (dyn_operation <0 || dyn_operation>3) { - PyErr_SetString(PyExc_IndexError, "Dynamic Actuator's setOperation() range must be between 0 and 3"); - return NULL; - } - m_dyn_operation= dyn_operation; - Py_RETURN_NONE; -} - -KX_PYMETHODDEF_DOC(KX_SCA_DynamicActuator, getOperation, -"getOperation() -> integer\n" -"Returns the operation type of this actuator.\n" -) -{ - ShowDeprecationWarning("getOperation()", "the mode property"); - return PyLong_FromSsize_t((long)m_dyn_operation); -} - - /* ------------------------------------------------------------------------- */ /* Native functions */ /* ------------------------------------------------------------------------- */ diff --git a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h index 8b598c9ecfa..58b28654eca 100644 --- a/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_DynamicActuator.h @@ -71,11 +71,6 @@ class KX_SCA_DynamicActuator : public SCA_IActuator KX_DYN_DISABLE_RIGID_BODY, KX_DYN_SET_MASS, }; - - /* 1. setOperation */ - KX_PYMETHOD_DOC(KX_SCA_DynamicActuator,setOperation); - KX_PYMETHOD_DOC(KX_SCA_DynamicActuator,getOperation); - }; #endif diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp index 0819ad99633..e85b8a32798 100644 --- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp +++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp @@ -74,9 +74,6 @@ PyTypeObject KX_SCA_ReplaceMeshActuator::Type = { PyMethodDef KX_SCA_ReplaceMeshActuator::Methods[] = { KX_PYMETHODTABLE(KX_SCA_ReplaceMeshActuator, instantReplaceMesh), - // Deprecated -----> - {"setMesh", (PyCFunction) KX_SCA_ReplaceMeshActuator::sPySetMesh, METH_O, (const char *)SetMesh_doc}, - KX_PYMETHODTABLE(KX_SCA_ReplaceMeshActuator, getMesh), {NULL,NULL} //Sentinel }; @@ -108,37 +105,6 @@ int KX_SCA_ReplaceMeshActuator::pyattr_set_mesh(void *self, const struct KX_PYAT return PY_SET_ATTR_SUCCESS; } -/* 1. setMesh */ -const char KX_SCA_ReplaceMeshActuator::SetMesh_doc[] = - "setMesh(name)\n" - "\t- name: string or None\n" - "\tSet the mesh that will be substituted for the current one.\n"; - -PyObject* KX_SCA_ReplaceMeshActuator::PySetMesh(PyObject* value) -{ - ShowDeprecationWarning("setMesh()", "the mesh property"); - RAS_MeshObject* new_mesh; - - if (!ConvertPythonToMesh(value, &new_mesh, true, "actuator.mesh = value: KX_SCA_ReplaceMeshActuator")) - return NULL; - - m_mesh = new_mesh; - Py_RETURN_NONE; -} - -KX_PYMETHODDEF_DOC(KX_SCA_ReplaceMeshActuator, getMesh, -"getMesh() -> string\n" -"Returns the name of the mesh to be substituted.\n" -) -{ - ShowDeprecationWarning("getMesh()", "the mesh property"); - if (!m_mesh) - Py_RETURN_NONE; - - return PyUnicode_FromString(const_cast(m_mesh->GetName().ReadPtr())); -} - - KX_PYMETHODDEF_DOC(KX_SCA_ReplaceMeshActuator, instantReplaceMesh, "instantReplaceMesh() : immediately replace mesh without delay\n") { diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h index 1e258420836..e5482c29aa7 100644 --- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h +++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h @@ -74,12 +74,13 @@ class KX_SCA_ReplaceMeshActuator : public SCA_IActuator void InstantReplaceMesh(); + /* --------------------------------------------------------------------- */ + /* Python interface ---------------------------------------------------- */ + /* --------------------------------------------------------------------- */ + static PyObject* pyattr_get_mesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_mesh(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); - /* 1. setMesh */ - KX_PYMETHOD_DOC_O(KX_SCA_ReplaceMeshActuator,SetMesh); - KX_PYMETHOD_DOC(KX_SCA_ReplaceMeshActuator,getMesh); KX_PYMETHOD_DOC(KX_SCA_ReplaceMeshActuator,instantReplaceMesh); }; diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index a9bb583bba7..3483496c3a6 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -1630,9 +1630,6 @@ PyTypeObject KX_Scene::Type = { }; PyMethodDef KX_Scene::Methods[] = { - KX_PYMETHODTABLE_NOARGS(KX_Scene, getLightList), - KX_PYMETHODTABLE_NOARGS(KX_Scene, getObjectList), - KX_PYMETHODTABLE_NOARGS(KX_Scene, getName), KX_PYMETHODTABLE(KX_Scene, addObject), /* dict style access */ @@ -1824,33 +1821,6 @@ PyAttributeDef KX_Scene::Attributes[] = { { NULL } //Sentinel }; -KX_PYMETHODDEF_DOC_NOARGS(KX_Scene, getLightList, -"getLightList() -> list [KX_Light]\n" -"Returns a list of all lights in the scene.\n" -) -{ - ShowDeprecationWarning("getLightList()", "the lights property"); - return m_lightlist->GetProxy(); -} - -KX_PYMETHODDEF_DOC_NOARGS(KX_Scene, getObjectList, -"getObjectList() -> list [KX_GameObject]\n" -"Returns a list of all game objects in the scene.\n" -) -{ - ShowDeprecationWarning("getObjectList()", "the objects property"); - return m_objectlist->GetProxy(); -} - -KX_PYMETHODDEF_DOC_NOARGS(KX_Scene, getName, -"getName() -> string\n" -"Returns the name of the scene.\n" -) -{ - ShowDeprecationWarning("getName()", "the name property"); - return PyUnicode_FromString(GetName()); -} - KX_PYMETHODDEF_DOC(KX_Scene, addObject, "addObject(object, other, time=0)\n" "Returns the added object.\n") diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index 8d7c0ad8dec..3e0dc303d72 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -517,25 +517,12 @@ public: */ void SetNodeTree(SG_Tree* root); - KX_PYMETHOD_DOC_NOARGS(KX_Scene, getLightList); - KX_PYMETHOD_DOC_NOARGS(KX_Scene, getObjectList); - KX_PYMETHOD_DOC_NOARGS(KX_Scene, getName); + /* --------------------------------------------------------------------- */ + /* Python interface ---------------------------------------------------- */ + /* --------------------------------------------------------------------- */ + KX_PYMETHOD_DOC(KX_Scene, addObject); KX_PYMETHOD_DOC(KX_Scene, get); - -/* - KX_PYMETHOD_DOC(KX_Scene, getActiveCamera); - KX_PYMETHOD_DOC(KX_Scene, getActiveCamera); - KX_PYMETHOD_DOC(KX_Scene, findCamera); - - KX_PYMETHOD_DOC(KX_Scene, getGravity); - - KX_PYMETHOD_DOC(KX_Scene, setActivityCulling); - KX_PYMETHOD_DOC(KX_Scene, setActivityCullingRadius); - - KX_PYMETHOD_DOC(KX_Scene, setSceneViewport); - KX_PYMETHOD_DOC(KX_Scene, setSceneViewport); - */ /* attributes */ static PyObject* pyattr_get_name(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_SceneActuator.cpp b/source/gameengine/Ketsji/KX_SceneActuator.cpp index a0b7664d63a..ea1be7bca6c 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.cpp +++ b/source/gameengine/Ketsji/KX_SceneActuator.cpp @@ -245,14 +245,6 @@ PyTypeObject KX_SceneActuator::Type = { PyMethodDef KX_SceneActuator::Methods[] = { - //Deprecated functions ------> - {"setUseRestart", (PyCFunction) KX_SceneActuator::sPySetUseRestart, METH_VARARGS, (const char *)SetUseRestart_doc}, - {"setScene", (PyCFunction) KX_SceneActuator::sPySetScene, METH_VARARGS, (const char *)SetScene_doc}, - {"setCamera", (PyCFunction) KX_SceneActuator::sPySetCamera, METH_O, (const char *)SetCamera_doc}, - {"getUseRestart", (PyCFunction) KX_SceneActuator::sPyGetUseRestart, METH_NOARGS, (const char *)GetUseRestart_doc}, - {"getScene", (PyCFunction) KX_SceneActuator::sPyGetScene, METH_NOARGS, (const char *)GetScene_doc}, - {"getCamera", (PyCFunction) KX_SceneActuator::sPyGetCamera, METH_NOARGS, (const char *)GetCamera_doc}, - //<----- Deprecated {NULL,NULL} //Sentinel }; @@ -295,117 +287,4 @@ int KX_SceneActuator::pyattr_set_camera(void *self, const struct KX_PYATTRIBUTE_ return PY_SET_ATTR_SUCCESS; } - -/* 2. setUseRestart--------------------------------------------------------- */ -const char KX_SceneActuator::SetUseRestart_doc[] = -"setUseRestart(flag)\n" -"\t- flag: 0 or 1.\n" -"\tSet flag to 1 to restart the scene.\n" ; -PyObject* KX_SceneActuator::PySetUseRestart(PyObject* args) -{ - ShowDeprecationWarning("setUseRestart()", "the useRestart property"); - int boolArg; - - if (!PyArg_ParseTuple(args, "i:setUseRestart", &boolArg)) - { - return NULL; - } - - m_restart = boolArg != 0; - - Py_RETURN_NONE; -} - - - -/* 3. getUseRestart: */ -const char KX_SceneActuator::GetUseRestart_doc[] = -"getUseRestart()\n" -"\tReturn whether the scene will be restarted.\n" ; -PyObject* KX_SceneActuator::PyGetUseRestart() -{ - ShowDeprecationWarning("getUseRestart()", "the useRestart property"); - return PyLong_FromSsize_t(!(m_restart == 0)); -} - - - -/* 4. set scene------------------------------------------------------------- */ -const char KX_SceneActuator::SetScene_doc[] = -"setScene(scene)\n" -"\t- scene: string\n" -"\tSet the name of scene the actuator will switch to.\n" ; -PyObject* KX_SceneActuator::PySetScene(PyObject* args) -{ - ShowDeprecationWarning("setScene()", "the scene property"); - /* one argument: a scene, ignore the rest */ - char *scene_name; - - if(!PyArg_ParseTuple(args, "s:setScene", &scene_name)) - { - return NULL; - } - - /* Scene switch is done by name. */ - m_nextSceneName = scene_name; - - Py_RETURN_NONE; -} - - - -/* 5. getScene: */ -const char KX_SceneActuator::GetScene_doc[] = -"getScene()\n" -"\tReturn the name of the scene the actuator wants to switch to.\n" ; -PyObject* KX_SceneActuator::PyGetScene() -{ - ShowDeprecationWarning("getScene()", "the scene property"); - return PyUnicode_FromString(m_nextSceneName); -} - - - -/* 6. set camera------------------------------------------------------------ */ -const char KX_SceneActuator::SetCamera_doc[] = -"setCamera(camera)\n" -"\t- camera: string\n" -"\tSet the camera to switch to.\n" ; -PyObject* KX_SceneActuator::PySetCamera(PyObject* value) -{ - ShowDeprecationWarning("setCamera()", "the camera property"); - KX_Camera *camOb; - - if (!ConvertPythonToCamera(value, &camOb, true, "actu.setCamera(value): KX_SceneActuator")) - return NULL; - - if (m_camera) - m_camera->UnregisterActuator(this); - - if(camOb==NULL) { - m_camera= NULL; - } - else { - m_camera = camOb; - m_camera->RegisterActuator(this); - } - Py_RETURN_NONE; -} - - - -/* 7. getCamera: */ -const char KX_SceneActuator::GetCamera_doc[] = -"getCamera()\n" -"\tReturn the name of the camera to switch to.\n" ; -PyObject* KX_SceneActuator::PyGetCamera() -{ - ShowDeprecationWarning("getCamera()", "the camera property"); - if (m_camera) { - return PyUnicode_FromString(m_camera->GetName()); - } - else { - Py_RETURN_NONE; - } -} /* eof */ diff --git a/source/gameengine/Ketsji/KX_SceneActuator.h b/source/gameengine/Ketsji/KX_SceneActuator.h index 86de3395d1e..e979a8ce559 100644 --- a/source/gameengine/Ketsji/KX_SceneActuator.h +++ b/source/gameengine/Ketsji/KX_SceneActuator.h @@ -90,22 +90,6 @@ class KX_SceneActuator : public SCA_IActuator /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - - /* 1. set */ - /* Removed */ - - /* 2. setUseRestart: */ - KX_PYMETHOD_DOC_VARARGS(KX_SceneActuator,SetUseRestart); - /* 3. getUseRestart: */ - KX_PYMETHOD_DOC_NOARGS(KX_SceneActuator,GetUseRestart); - /* 4. setScene: */ - KX_PYMETHOD_DOC_VARARGS(KX_SceneActuator,SetScene); - /* 5. getScene: */ - KX_PYMETHOD_DOC_NOARGS(KX_SceneActuator,GetScene); - /* 6. setCamera: */ - KX_PYMETHOD_DOC_O(KX_SceneActuator,SetCamera); - /* 7. getCamera: */ - KX_PYMETHOD_DOC_NOARGS(KX_SceneActuator,GetCamera); static PyObject* pyattr_get_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_camera(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); diff --git a/source/gameengine/Ketsji/KX_SoundActuator.cpp b/source/gameengine/Ketsji/KX_SoundActuator.cpp index 024c51cabc1..e2b4022a312 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.cpp +++ b/source/gameengine/Ketsji/KX_SoundActuator.cpp @@ -296,17 +296,6 @@ PyTypeObject KX_SoundActuator::Type = { }; PyMethodDef KX_SoundActuator::Methods[] = { - // Deprecated -----> - {"setGain",(PyCFunction) KX_SoundActuator::sPySetGain,METH_VARARGS,NULL}, - {"getGain",(PyCFunction) KX_SoundActuator::sPyGetGain,METH_NOARGS,NULL}, - {"setPitch",(PyCFunction) KX_SoundActuator::sPySetPitch,METH_VARARGS,NULL}, - {"getPitch",(PyCFunction) KX_SoundActuator::sPyGetPitch,METH_NOARGS,NULL}, - {"setRollOffFactor",(PyCFunction) KX_SoundActuator::sPySetRollOffFactor,METH_VARARGS,NULL}, - {"getRollOffFactor",(PyCFunction) KX_SoundActuator::sPyGetRollOffFactor,METH_NOARGS,NULL}, - {"setType",(PyCFunction) KX_SoundActuator::sPySetType,METH_VARARGS,NULL}, - {"getType",(PyCFunction) KX_SoundActuator::sPyGetType,METH_NOARGS,NULL}, - // <----- - KX_PYMETHODTABLE_NOARGS(KX_SoundActuator, startSound), KX_PYMETHODTABLE_NOARGS(KX_SoundActuator, pauseSound), KX_PYMETHODTABLE_NOARGS(KX_SoundActuator, stopSound), @@ -427,109 +416,3 @@ int KX_SoundActuator::pyattr_set_rollOffFactor(void *self, const struct KX_PYATT return PY_SET_ATTR_SUCCESS; } - -PyObject* KX_SoundActuator::PySetGain(PyObject* args) -{ - ShowDeprecationWarning("setGain()", "the volume property"); - float gain = 1.0; - if (!PyArg_ParseTuple(args, "f:setGain", &gain)) - return NULL; - - m_volume = gain; - if(m_handle) - AUD_setSoundVolume(m_handle, gain); - - Py_RETURN_NONE; -} - - - -PyObject* KX_SoundActuator::PyGetGain() -{ - ShowDeprecationWarning("getGain()", "the volume property"); - float gain = m_volume; - PyObject* result = PyFloat_FromDouble(gain); - - return result; -} - - - -PyObject* KX_SoundActuator::PySetPitch(PyObject* args) -{ - ShowDeprecationWarning("setPitch()", "the pitch property"); - float pitch = 1.0; - if (!PyArg_ParseTuple(args, "f:setPitch", &pitch)) - return NULL; - - m_pitch = pitch; - if(m_handle) - AUD_setSoundPitch(m_handle, pitch); - - Py_RETURN_NONE; -} - - - -PyObject* KX_SoundActuator::PyGetPitch() -{ - ShowDeprecationWarning("getPitch()", "the pitch property"); - float pitch = m_pitch; - PyObject* result = PyFloat_FromDouble(pitch); - - return result; -} - - - -PyObject* KX_SoundActuator::PySetRollOffFactor(PyObject* args) -{ - ShowDeprecationWarning("setRollOffFactor()", "the rollOffFactor property"); - float rollofffactor = 1.0; - if (!PyArg_ParseTuple(args, "f:setRollOffFactor", &rollofffactor)) - return NULL; - - m_3d.rolloff_factor = rollofffactor; - if(m_handle) - AUD_set3DSourceSetting(m_handle, AUD_3DSS_ROLLOFF_FACTOR, rollofffactor); - - Py_RETURN_NONE; -} - - - -PyObject* KX_SoundActuator::PyGetRollOffFactor() -{ - ShowDeprecationWarning("getRollOffFactor()", "the rollOffFactor property"); - float rollofffactor = m_3d.rolloff_factor; - PyObject* result = PyFloat_FromDouble(rollofffactor); - - return result; -} - - - -PyObject* KX_SoundActuator::PySetType(PyObject* args) -{ - int typeArg; - ShowDeprecationWarning("setType()", "the mode property"); - - if (!PyArg_ParseTuple(args, "i:setType", &typeArg)) { - return NULL; - } - - if ( (typeArg > KX_SOUNDACT_NODEF) - && (typeArg < KX_SOUNDACT_MAX) ) { - m_type = (KX_SOUNDACT_TYPE) typeArg; - } - - Py_RETURN_NONE; -} - -PyObject* KX_SoundActuator::PyGetType() -{ - ShowDeprecationWarning("getType()", "the mode property"); - return PyLong_FromSsize_t(m_type); -} -// <----- - diff --git a/source/gameengine/Ketsji/KX_SoundActuator.h b/source/gameengine/Ketsji/KX_SoundActuator.h index bc0293ed2b4..43198f1a253 100644 --- a/source/gameengine/Ketsji/KX_SoundActuator.h +++ b/source/gameengine/Ketsji/KX_SoundActuator.h @@ -110,18 +110,6 @@ public: static PyObject* pyattr_get_pitch(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_rollOffFactor(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_type(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); - - // Deprecated -----> - KX_PYMETHOD_VARARGS(KX_SoundActuator,SetGain); - KX_PYMETHOD_NOARGS(KX_SoundActuator,GetGain); - KX_PYMETHOD_VARARGS(KX_SoundActuator,SetPitch); - KX_PYMETHOD_NOARGS(KX_SoundActuator,GetPitch); - KX_PYMETHOD_VARARGS(KX_SoundActuator,SetRollOffFactor); - KX_PYMETHOD_NOARGS(KX_SoundActuator,GetRollOffFactor); - KX_PYMETHOD_VARARGS(KX_SoundActuator,SetType); - KX_PYMETHOD_NOARGS(KX_SoundActuator,GetType); - // <----- - }; #endif //__KX_SOUNDACTUATOR diff --git a/source/gameengine/Ketsji/KX_StateActuator.cpp b/source/gameengine/Ketsji/KX_StateActuator.cpp index 09d95612cbb..4159e9c373d 100644 --- a/source/gameengine/Ketsji/KX_StateActuator.cpp +++ b/source/gameengine/Ketsji/KX_StateActuator.cpp @@ -159,12 +159,6 @@ PyTypeObject KX_StateActuator::Type = { }; PyMethodDef KX_StateActuator::Methods[] = { - // deprecated --> - {"setOperation", (PyCFunction) KX_StateActuator::sPySetOperation, - METH_VARARGS, (const char *)SetOperation_doc}, - {"setMask", (PyCFunction) KX_StateActuator::sPySetMask, - METH_VARARGS, (const char *)SetMask_doc}, - // <-- {NULL,NULL} //Sentinel }; @@ -173,52 +167,3 @@ PyAttributeDef KX_StateActuator::Attributes[] = { KX_PYATTRIBUTE_INT_RW("mask",0,0x3FFFFFFF,false,KX_StateActuator,m_mask), { NULL } //Sentinel }; - - -/* set operation ---------------------------------------------------------- */ -const char -KX_StateActuator::SetOperation_doc[] = -"setOperation(op)\n" -"\t - op : bit operation (0=Copy, 1=Set, 2=Clear, 3=Negate)" -"\tSet the type of bit operation to be applied on object state mask.\n" -"\tUse setMask() to specify the bits that will be modified.\n"; -PyObject* - -KX_StateActuator::PySetOperation(PyObject* args) { - ShowDeprecationWarning("setOperation()", "the operation property"); - int oper; - - if(!PyArg_ParseTuple(args, "i:setOperation", &oper)) { - return NULL; - } - - m_operation = oper; - - Py_RETURN_NONE; -} - -/* set mask ---------------------------------------------------------- */ -const char -KX_StateActuator::SetMask_doc[] = -"setMask(mask)\n" -"\t - mask : bits that will be modified" -"\tSet the value that defines the bits that will be modified by the operation.\n" -"\tThe bits that are 1 in the value will be updated in the object state,\n" -"\tthe bits that are 0 are will be left unmodified expect for the Copy operation\n" -"\twhich copies the value to the object state.\n"; -PyObject* - -KX_StateActuator::PySetMask(PyObject* args) { - ShowDeprecationWarning("setMask()", "the mask property"); - int mask; - - if(!PyArg_ParseTuple(args, "i:setMask", &mask)) { - return NULL; - } - - m_mask = mask; - - Py_RETURN_NONE; -} - - diff --git a/source/gameengine/Ketsji/KX_StateActuator.h b/source/gameengine/Ketsji/KX_StateActuator.h index ce86c4b44fe..4cf84f74287 100644 --- a/source/gameengine/Ketsji/KX_StateActuator.h +++ b/source/gameengine/Ketsji/KX_StateActuator.h @@ -88,9 +88,7 @@ class KX_StateActuator : public SCA_IActuator /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - //KX_PYMETHOD_DOC - KX_PYMETHOD_DOC_VARARGS(KX_StateActuator,SetOperation); - KX_PYMETHOD_DOC_VARARGS(KX_StateActuator,SetMask); + }; #endif diff --git a/source/gameengine/Ketsji/KX_TouchSensor.cpp b/source/gameengine/Ketsji/KX_TouchSensor.cpp index 26e414c5b47..cde67787e2f 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.cpp +++ b/source/gameengine/Ketsji/KX_TouchSensor.cpp @@ -315,16 +315,6 @@ PyTypeObject KX_TouchSensor::Type = { }; PyMethodDef KX_TouchSensor::Methods[] = { - //Deprecated -----> - {"setProperty", - (PyCFunction) KX_TouchSensor::sPySetProperty, METH_O, (const char *)SetProperty_doc}, - {"getProperty", - (PyCFunction) KX_TouchSensor::sPyGetProperty, METH_NOARGS, (const char *)GetProperty_doc}, - {"getHitObject", - (PyCFunction) KX_TouchSensor::sPyGetHitObject, METH_NOARGS, (const char *)GetHitObject_doc}, - {"getHitObjectList", - (PyCFunction) KX_TouchSensor::sPyGetHitObjectList, METH_NOARGS, (const char *)GetHitObjectList_doc}, - //<----- {NULL,NULL} //Sentinel }; @@ -339,101 +329,6 @@ PyAttributeDef KX_TouchSensor::Attributes[] = { /* Python API */ -/* 1. setProperty */ -const char KX_TouchSensor::SetProperty_doc[] = -"setProperty(name)\n" -"\t- name: string\n" -"\tSet the property or material to collide with. Use\n" -"\tsetTouchMaterial() to switch between properties and\n" -"\tmaterials."; -PyObject* KX_TouchSensor::PySetProperty(PyObject* value) -{ - ShowDeprecationWarning("setProperty()", "the propName property"); - char *nameArg= _PyUnicode_AsString(value); - if (nameArg==NULL) { - PyErr_SetString(PyExc_ValueError, "expected a "); - return NULL; - } - - m_touchedpropname = nameArg; - Py_RETURN_NONE; -} -/* 2. getProperty */ -const char KX_TouchSensor::GetProperty_doc[] = -"getProperty(name)\n" -"\tReturns the property or material to collide with. Use\n" -"\tgetTouchMaterial() to find out whether this sensor\n" -"\tlooks for properties or materials."; -PyObject* KX_TouchSensor::PyGetProperty() { - ShowDeprecationWarning("getProperty()", "the propName property"); - - return PyUnicode_FromString(m_touchedpropname); -} - -const char KX_TouchSensor::GetHitObject_doc[] = -"getHitObject()\n" -; -PyObject* KX_TouchSensor::PyGetHitObject() -{ - ShowDeprecationWarning("getHitObject()", "the hitObject property"); - /* to do: do Py_IncRef if the object is already known in Python */ - /* otherwise, this leaks memory */ - if (m_hitObject) - { - return m_hitObject->GetProxy(); - } - Py_RETURN_NONE; -} - -const char KX_TouchSensor::GetHitObjectList_doc[] = -"getHitObjectList()\n" -"\tReturn a list of the objects this object collided with,\n" -"\tbut only those matching the property/material condition.\n"; -PyObject* KX_TouchSensor::PyGetHitObjectList() -{ - ShowDeprecationWarning("getHitObjectList()", "the hitObjectList property"); - /* to do: do Py_IncRef if the object is already known in Python */ - /* otherwise, this leaks memory */ /* Edit, this seems ok and not to leak memory - Campbell */ - return m_colliders->GetProxy(); -} - -/*getTouchMaterial and setTouchMaterial were never added to the api, -they can probably be removed with out anyone noticing*/ - -/* 5. getTouchMaterial */ -const char KX_TouchSensor::GetTouchMaterial_doc[] = -"getTouchMaterial()\n" -"\tReturns KX_TRUE if this sensor looks for a specific material,\n" -"\tKX_FALSE if it looks for a specific property.\n" ; -PyObject* KX_TouchSensor::PyGetTouchMaterial() -{ - ShowDeprecationWarning("getTouchMaterial()", "the useMaterial property"); - return PyLong_FromSsize_t(m_bFindMaterial); -} - -/* 6. setTouchMaterial */ -#if 0 -const char KX_TouchSensor::SetTouchMaterial_doc[] = -"setTouchMaterial(flag)\n" -"\t- flag: KX_TRUE or KX_FALSE.\n" -"\tSet flag to KX_TRUE to switch on positive pulse mode,\n" -"\tKX_FALSE to switch off positive pulse mode.\n" ; -PyObject* KX_TouchSensor::PySetTouchMaterial(PyObject *value) -{ - ShowDeprecationWarning("setTouchMaterial()", "the useMaterial property"); - int pulseArg = PyLong_AsSsize_t(value); - - if(pulseArg ==-1 && PyErr_Occurred()) { - PyErr_SetString(PyExc_ValueError, "expected a bool"); - return NULL; - } - - m_bFindMaterial = pulseArg != 0; - - Py_RETURN_NONE; -} -#endif - PyObject* KX_TouchSensor::pyattr_get_object_hit(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { KX_TouchSensor* self= static_cast(self_v); diff --git a/source/gameengine/Ketsji/KX_TouchSensor.h b/source/gameengine/Ketsji/KX_TouchSensor.h index 5f571614b06..ad1830e05c9 100644 --- a/source/gameengine/Ketsji/KX_TouchSensor.h +++ b/source/gameengine/Ketsji/KX_TouchSensor.h @@ -119,23 +119,6 @@ public: /* --------------------------------------------------------------------- */ /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - - //Deprecated -----> - /* 1. setProperty */ - KX_PYMETHOD_DOC_O(KX_TouchSensor,SetProperty); - /* 2. getProperty */ - KX_PYMETHOD_DOC_NOARGS(KX_TouchSensor,GetProperty); - /* 3. getHitObject */ - KX_PYMETHOD_DOC_NOARGS(KX_TouchSensor,GetHitObject); - /* 4. getHitObject */ - KX_PYMETHOD_DOC_NOARGS(KX_TouchSensor,GetHitObjectList); - /* 5. getTouchMaterial */ - KX_PYMETHOD_DOC_NOARGS(KX_TouchSensor,GetTouchMaterial); -#if 0 - /* 6. setTouchMaterial */ - KX_PYMETHOD_DOC_O(KX_TouchSensor,SetTouchMaterial); -#endif - //<----- static PyObject* pyattr_get_object_hit(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); static PyObject* pyattr_get_object_hit_list(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.cpp b/source/gameengine/Ketsji/KX_TrackToActuator.cpp index b5b7e9de444..e6c2f86bbce 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.cpp +++ b/source/gameengine/Ketsji/KX_TrackToActuator.cpp @@ -453,14 +453,6 @@ PyTypeObject KX_TrackToActuator::Type = { }; PyMethodDef KX_TrackToActuator::Methods[] = { - // ---> deprecated - {"setTime", (PyCFunction) KX_TrackToActuator::sPySetTime, METH_VARARGS, (const char *)SetTime_doc}, - {"getTime", (PyCFunction) KX_TrackToActuator::sPyGetTime, METH_NOARGS, (const char *)GetTime_doc}, - {"setUse3D", (PyCFunction) KX_TrackToActuator::sPySetUse3D, METH_VARARGS, (const char *)SetUse3D_doc}, - {"getUse3D", (PyCFunction) KX_TrackToActuator::sPyGetUse3D, METH_NOARGS, (const char *)GetUse3D_doc}, - {"setObject", (PyCFunction) KX_TrackToActuator::sPySetObject, METH_O, (const char *)SetObject_doc}, - {"getObject", (PyCFunction) KX_TrackToActuator::sPyGetObject, METH_VARARGS, (const char *)GetObject_doc}, - {NULL,NULL} //Sentinel }; @@ -500,123 +492,4 @@ int KX_TrackToActuator::pyattr_set_object(void *self, const struct KX_PYATTRIBUT return PY_SET_ATTR_SUCCESS; } - -/* 1. setObject */ -const char KX_TrackToActuator::SetObject_doc[] = -"setObject(object)\n" -"\t- object: KX_GameObject, string or None\n" -"\tSet the object to track with the parent of this actuator.\n"; -PyObject* KX_TrackToActuator::PySetObject(PyObject* value) -{ - KX_GameObject *gameobj; - - ShowDeprecationWarning("setObject()", "the object property"); - - if (!ConvertPythonToGameObject(value, &gameobj, true, "actuator.setObject(value): KX_TrackToActuator")) - return NULL; // ConvertPythonToGameObject sets the error - - if (m_object != NULL) - m_object->UnregisterActuator(this); - - m_object = (SCA_IObject*)gameobj; - if (m_object) - m_object->RegisterActuator(this); - - Py_RETURN_NONE; -} - - - -/* 2. getObject */ -const char KX_TrackToActuator::GetObject_doc[] = -"getObject(name_only = 1)\n" -"name_only - optional arg, when true will return the KX_GameObject rather then its name\n" -"\tReturns the object to track with the parent of this actuator\n"; -PyObject* KX_TrackToActuator::PyGetObject(PyObject* args) -{ - int ret_name_only = 1; - - ShowDeprecationWarning("getObject()", "the object property"); - - if (!PyArg_ParseTuple(args, "|i:getObject", &ret_name_only)) - return NULL; - - if (!m_object) - Py_RETURN_NONE; - - if (ret_name_only) - return PyUnicode_FromString(m_object->GetName()); - else - return m_object->GetProxy(); -} - - - -/* 3. setTime */ -const char KX_TrackToActuator::SetTime_doc[] = -"setTime(time)\n" -"\t- time: integer\n" -"\tSet the time in frames with which to delay the tracking motion.\n"; -PyObject* KX_TrackToActuator::PySetTime(PyObject* args) -{ - ShowDeprecationWarning("setTime()", "the timer property"); - int timeArg; - - if (!PyArg_ParseTuple(args, "i:setTime", &timeArg)) - { - return NULL; - } - - m_time= timeArg; - - Py_RETURN_NONE; -} - - - -/* 4.getTime */ -const char KX_TrackToActuator::GetTime_doc[] = -"getTime()\n" -"\t- time: integer\n" -"\tReturn the time in frames with which the tracking motion is delayed.\n"; -PyObject* KX_TrackToActuator::PyGetTime() -{ - ShowDeprecationWarning("getTime()", "the timer property"); - return PyLong_FromSsize_t(m_time); -} - - - -/* 5. getUse3D */ -const char KX_TrackToActuator::GetUse3D_doc[] = -"getUse3D()\n" -"\tReturns 1 if the motion is allowed to extend in the z-direction.\n"; -PyObject* KX_TrackToActuator::PyGetUse3D() -{ - ShowDeprecationWarning("setTime()", "the use3D property"); - return PyLong_FromSsize_t(!(m_allow3D == 0)); -} - - - -/* 6. setUse3D */ -const char KX_TrackToActuator::SetUse3D_doc[] = -"setUse3D(value)\n" -"\t- value: 0 or 1\n" -"\tSet to 1 to allow the tracking motion to extend in the z-direction,\n" -"\tset to 0 to lock the tracking motion to the x-y plane.\n"; -PyObject* KX_TrackToActuator::PySetUse3D(PyObject* args) -{ - ShowDeprecationWarning("setTime()", "the use3D property"); - int boolArg; - - if (!PyArg_ParseTuple(args, "i:setUse3D", &boolArg)) { - return NULL; - } - - m_allow3D = !(boolArg == 0); - - Py_RETURN_NONE; -} - /* eof */ diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.h b/source/gameengine/Ketsji/KX_TrackToActuator.h index 801e695bb9b..bbfc1d17576 100644 --- a/source/gameengine/Ketsji/KX_TrackToActuator.h +++ b/source/gameengine/Ketsji/KX_TrackToActuator.h @@ -74,19 +74,6 @@ class KX_TrackToActuator : public SCA_IActuator /* These are used to get and set m_ob */ static PyObject* pyattr_get_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef); static int pyattr_set_object(void *self, const struct KX_PYATTRIBUTE_DEF *attrdef, PyObject *value); - - /* 1. setObject */ - KX_PYMETHOD_DOC_O(KX_TrackToActuator,SetObject); - /* 2. getObject */ - KX_PYMETHOD_DOC_VARARGS(KX_TrackToActuator,GetObject); - /* 3. setTime */ - KX_PYMETHOD_DOC_VARARGS(KX_TrackToActuator,SetTime); - /* 4. getTime */ - KX_PYMETHOD_DOC_NOARGS(KX_TrackToActuator,GetTime); - /* 5. getUse3D */ - KX_PYMETHOD_DOC_NOARGS(KX_TrackToActuator,GetUse3D); - /* 6. setUse3D */ - KX_PYMETHOD_DOC_VARARGS(KX_TrackToActuator,SetUse3D); }; /* end of class KX_TrackToActuator : public KX_EditObjectActuator */ diff --git a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp index 97c893c6caa..184e127209f 100644 --- a/source/gameengine/Ketsji/KX_VisibilityActuator.cpp +++ b/source/gameengine/Ketsji/KX_VisibilityActuator.cpp @@ -113,10 +113,6 @@ PyTypeObject KX_VisibilityActuator::Type = { }; PyMethodDef KX_VisibilityActuator::Methods[] = { - // Deprecated -----> - {"set", (PyCFunction) KX_VisibilityActuator::sPySetVisible, METH_VARARGS, - (const char *) SetVisible_doc}, - // <----- {NULL,NULL} //Sentinel }; @@ -126,26 +122,3 @@ PyAttributeDef KX_VisibilityActuator::Attributes[] = { KX_PYATTRIBUTE_BOOL_RW("useRecursion", KX_VisibilityActuator, m_recursive), { NULL } //Sentinel }; - -/* set visibility ---------------------------------------------------------- */ -const char -KX_VisibilityActuator::SetVisible_doc[] = -"setVisible(visible?)\n" -"\t - visible? : Make the object visible? (KX_TRUE, KX_FALSE)" -"\tSet the properties of the actuator.\n"; -PyObject* - -KX_VisibilityActuator::PySetVisible(PyObject* args) { - int vis; - ShowDeprecationWarning("SetVisible()", "the visible property"); - - if(!PyArg_ParseTuple(args, "i:setVisible", &vis)) { - return NULL; - } - - m_visible = PyArgToBool(vis); - - Py_RETURN_NONE; -} - - diff --git a/source/gameengine/Ketsji/KX_VisibilityActuator.h b/source/gameengine/Ketsji/KX_VisibilityActuator.h index 3ad50c6cea2..e75551644a4 100644 --- a/source/gameengine/Ketsji/KX_VisibilityActuator.h +++ b/source/gameengine/Ketsji/KX_VisibilityActuator.h @@ -67,11 +67,6 @@ class KX_VisibilityActuator : public SCA_IActuator /* Python interface ---------------------------------------------------- */ /* --------------------------------------------------------------------- */ - // Deprecated -----> - KX_PYMETHOD_DOC_VARARGS(KX_VisibilityActuator,SetVisible); - // <----- - - }; #endif From c4a1c8fbeb86396788866d6dc3eb1b5b5dc3f67d Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Tue, 25 Aug 2009 22:56:08 +0000 Subject: [PATCH 272/577] Unconditionally define WITH_OPENEXR. Compiling openexr_api.cpp requires WITH_OPENEXR, to get the right part of the openexr_multi.h file. Broken since r22739. --- source/blender/imbuf/intern/openexr/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/blender/imbuf/intern/openexr/Makefile b/source/blender/imbuf/intern/openexr/Makefile index f77e3723e8a..083089b11d5 100644 --- a/source/blender/imbuf/intern/openexr/Makefile +++ b/source/blender/imbuf/intern/openexr/Makefile @@ -35,6 +35,9 @@ include nan_compile.mk CFLAGS += $(LEVEL_1_C_WARNINGS) +# If compiling the API, WITH_OPENEXR must be set. +CPPFLAGS += -DWITH_OPENEXR + CPPFLAGS += -I../../../makesdna CPPFLAGS += -I../../../blenkernel CPPFLAGS += -I../../../blenlib From 3f5a2a11944a2e983d62babe8bb02b03e14c805d Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Tue, 25 Aug 2009 23:39:49 +0000 Subject: [PATCH 273/577] Smoke: *Bugfix for crash on using a plane as smoke domain (reported by DingTo) * Bringing slowly high res back, not yet working --- source/blender/blenkernel/intern/pointcache.c | 44 +++++++++++-- source/blender/blenkernel/intern/smoke.c | 65 +++++++++++++------ source/blender/blenloader/intern/readfile.c | 3 +- source/blender/blenloader/intern/writefile.c | 5 +- .../blender/editors/space_view3d/drawobject.c | 2 +- source/blender/makesdna/DNA_smoke_types.h | 4 +- source/blender/makesrna/intern/rna_smoke.c | 10 ++- 7 files changed, 94 insertions(+), 39 deletions(-) diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index d9740091912..42bea260450 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -703,11 +703,44 @@ void BKE_ptcache_id_from_smoke(PTCacheID *pid, struct Object *ob, struct SmokeMo pid->calldata= smd; pid->type= PTCACHE_TYPE_SMOKE_DOMAIN; - pid->stack_index= sds->point_cache->index; + pid->stack_index= sds->point_cache[0]->index; - pid->cache= sds->point_cache; - pid->cache_ptr= &sds->point_cache; - pid->ptcaches= &sds->ptcaches; + pid->cache= sds->point_cache[0]; + pid->cache_ptr= &(sds->point_cache[0]); + pid->ptcaches= &(sds->ptcaches[0]); + + pid->totpoint= pid->totwrite= ptcache_totpoint_smoke; + + pid->write_elem= NULL; + pid->read_elem= NULL; + + pid->read_stream = ptcache_read_smoke; + pid->write_stream = ptcache_write_smoke; + + pid->interpolate_elem= NULL; + + pid->write_header= ptcache_write_basic_header; + pid->read_header= ptcache_read_basic_header; + + pid->data_types= (1<info_types= 0; +} + +void BKE_ptcache_id_from_smoke_turbulence(PTCacheID *pid, struct Object *ob, struct SmokeModifierData *smd) +{ + SmokeDomainSettings *sds = smd->domain; + + memset(pid, 0, sizeof(PTCacheID)); + + pid->ob= ob; + pid->calldata= smd; + + pid->type= PTCACHE_TYPE_SMOKE_HIGHRES; + pid->stack_index= sds->point_cache[1]->index; + + pid->cache= sds->point_cache[1]; + pid->cache_ptr= &sds->point_cache[1]; + pid->ptcaches= &sds->ptcaches[1]; pid->totpoint= pid->totwrite= ptcache_totpoint_smoke; @@ -1792,10 +1825,7 @@ int BKE_ptcache_id_reset(Scene *scene, PTCacheID *pid, int mode) else if(pid->type == PTCACHE_TYPE_PARTICLES) psys_reset(pid->calldata, PSYS_RESET_DEPSGRAPH); else if(pid->type == PTCACHE_TYPE_SMOKE_DOMAIN) - { smokeModifier_reset(pid->calldata); - printf("reset PTCACHE_TYPE_SMOKE_DOMAIN\n"); - } } if(clear) BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0); diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 28d1c264376..cd9679be486 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -166,6 +166,10 @@ int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, Derive // calc other res with max_res provided VECSUB(size, max, min); + + if((size[0] < FLT_EPSILON) || (size[1] < FLT_EPSILON) || (size[2] < FLT_EPSILON)) + return 0; + if(size[0] > size[1]) { if(size[0] > size[1]) @@ -213,13 +217,11 @@ int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, Derive smd->time = scene->r.cfra; smd->domain->firstframe = smd->time; - /* - if(!smd->domain->wt) + if(!smd->domain->wt && (smd->domain->flags & MOD_SMOKE_HIGHRES)) { - smd->domain->wt = smoke_turbulence_init(sds->res, smd->domain->amplify + 1, smd->domain->noise); + smd->domain->wt = smoke_turbulence_init(smd->domain->res, smd->domain->amplify + 1, smd->domain->noise); smoke_turbulence_initBlenderRNA(smd->domain->wt, &smd->domain->strength); } - */ if(!smd->domain->view3d) { @@ -409,10 +411,10 @@ int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene, Derive { smd->coll->bvhtree = NULL; // bvhtree_build_from_smoke ( ob->obmat, dm->getFaceArray(dm), dm->getNumFaces(dm), dm->getVertArray(dm), dm->getNumVerts(dm), 0.0 ); } - + return 1; } - return 0; + return 1; } /*! init triangle divisions */ @@ -529,8 +531,10 @@ void smokeModifier_freeDomain(SmokeModifierData *smd) if(smd->domain->wt) smoke_turbulence_free(smd->domain->wt); - BKE_ptcache_free_list(&smd->domain->ptcaches); - smd->domain->point_cache = NULL; + BKE_ptcache_free_list(&(smd->domain->ptcaches[0])); + smd->domain->point_cache[0] = NULL; + BKE_ptcache_free_list(&(smd->domain->ptcaches[1])); + smd->domain->point_cache[1] = NULL; MEM_freeN(smd->domain); smd->domain = NULL; @@ -603,10 +607,15 @@ void smokeModifier_reset(struct SmokeModifierData *smd) smd->domain->wt = NULL; } - smd->domain->point_cache->flag &= ~PTCACHE_SIMULATION_VALID; - smd->domain->point_cache->flag |= PTCACHE_OUTDATED; - smd->domain->point_cache->simframe= 0; - smd->domain->point_cache->last_exact= 0; + smd->domain->point_cache[0]->flag &= ~PTCACHE_SIMULATION_VALID; + smd->domain->point_cache[0]->flag |= PTCACHE_OUTDATED; + smd->domain->point_cache[0]->simframe= 0; + smd->domain->point_cache[0]->last_exact= 0; + + smd->domain->point_cache[1]->flag &= ~PTCACHE_SIMULATION_VALID; + smd->domain->point_cache[1]->flag |= PTCACHE_OUTDATED; + smd->domain->point_cache[1]->simframe= 0; + smd->domain->point_cache[1]->last_exact= 0; // printf("reset_domain\n"); } @@ -666,9 +675,13 @@ void smokeModifier_createType(struct SmokeModifierData *smd) smd->domain->smd = smd; - smd->domain->point_cache = BKE_ptcache_add(&smd->domain->ptcaches); - smd->domain->point_cache->flag |= PTCACHE_DISK_CACHE; - smd->domain->point_cache->step = 1; + smd->domain->point_cache[0] = BKE_ptcache_add(&(smd->domain->ptcaches[0])); + smd->domain->point_cache[0]->flag |= PTCACHE_DISK_CACHE; + smd->domain->point_cache[0]->step = 1; + + smd->domain->point_cache[1] = BKE_ptcache_add(&(smd->domain->ptcaches[1])); + smd->domain->point_cache[1]->flag |= PTCACHE_DISK_CACHE; + smd->domain->point_cache[1]->step = 1; /* set some standard values */ smd->domain->fluid = NULL; @@ -775,8 +788,9 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM } else if(smd->type & MOD_SMOKE_TYPE_DOMAIN) { - PointCache *cache; + PointCache *cache, *cache_wt; PTCacheID pid; + PTCacheID pid_wt; float timescale; int cache_result = 0; int startframe, endframe, framenr; @@ -788,7 +802,7 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM framenr = scene->r.cfra; - cache = sds->point_cache; + cache = sds->point_cache[0]; BKE_ptcache_id_from_smoke(&pid, ob, smd); BKE_ptcache_id_time(&pid, scene, framenr, &startframe, &endframe, ×cale); @@ -800,12 +814,15 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM cache->simframe= 0; cache->last_exact= 0; - smokeModifier_init(smd, ob, scene, dm); + if(!smokeModifier_init(smd, ob, scene, dm)) + return; + + if(!smd->domain->fluid) + return; smoke_simulate_domain(smd, scene, ob, dm); { - // float light[3] = {0.0,0.0,0.0}; // TODO: take real LAMP coordinates - dg Base *base_tmp = NULL; for(base_tmp = scene->base.first; base_tmp; base_tmp= base_tmp->next) @@ -852,7 +869,11 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED); } - smokeModifier_init(smd, ob, scene, dm); + if(!smokeModifier_init(smd, ob, scene, dm)) + return; + + if(!smd->domain->fluid) + return; /* try to read from cache */ cache_result = BKE_ptcache_read_cache(&pid, (float)framenr, scene->r.frs_sec); @@ -904,8 +925,10 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM smoke_simulate_domain(smd, scene, ob, dm); + if(sds->wt) + smoke_turbulence_step(sds->wt, sds->fluid); + { - // float light[3] = {0.0,0.0,0.0}; // TODO: take real LAMP coordinates - dg Base *base_tmp = NULL; for(base_tmp = scene->base.first; base_tmp; base_tmp= base_tmp->next) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 26e3d5bf6f1..aaba65b21af 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3695,7 +3695,8 @@ static void direct_link_modifiers(FileData *fd, ListBase *lb) smd->domain->view3d = NULL; smd->domain->tex = NULL; - direct_link_pointcache_list(fd, &smd->domain->ptcaches, &smd->domain->point_cache); + direct_link_pointcache_list(fd, &(smd->domain->ptcaches[0]), &(smd->domain->point_cache[0])); + direct_link_pointcache_list(fd, &(smd->domain->ptcaches[1]), &(smd->domain->point_cache[1])); } else if(smd->type==MOD_SMOKE_TYPE_FLOW) { diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index eb3f17f368c..26fd0cf6af6 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1136,7 +1136,10 @@ static void write_modifiers(WriteData *wd, ListBase *modbase) */ if((smd->type & MOD_SMOKE_TYPE_DOMAIN) && smd->domain) - write_pointcaches(wd, &smd->domain->ptcaches); + { + write_pointcaches(wd, &(smd->domain->ptcaches[0])); + write_pointcaches(wd, &(smd->domain->ptcaches[1])); + } } else if(md->type==eModifierType_Fluidsim) { FluidsimModifierData *fluidmd = (FluidsimModifierData*) md; diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index bcb962bdcd7..6cf229ead31 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -5316,7 +5316,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) md = modifiers_findByType(ob, eModifierType_Smoke); if (md) { SmokeModifierData *smd = (SmokeModifierData *)md; - if(smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain) { + if(smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain && smd->domain->fluid) { GPU_create_smoke(smd); draw_volume(scene, ar, v3d, base, smd->domain->tex, smd->domain->res); GPU_free_smoke(smd); diff --git a/source/blender/makesdna/DNA_smoke_types.h b/source/blender/makesdna/DNA_smoke_types.h index 542281e1960..a8ab4734af0 100644 --- a/source/blender/makesdna/DNA_smoke_types.h +++ b/source/blender/makesdna/DNA_smoke_types.h @@ -67,8 +67,8 @@ typedef struct SmokeDomainSettings { short diss_percent; short pad; int diss_speed;/* in frames */ - struct PointCache *point_cache; /* definition is in DNA_object_force.h */ - struct ListBase ptcaches; + struct PointCache *point_cache[2]; /* definition is in DNA_object_force.h */ + struct ListBase ptcaches[2]; struct WTURBULENCE *wt; // WTURBULENCE object, if active int pad3; float strength; diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c index e671665bd17..5ef25edacf7 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -177,7 +177,7 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) RNA_def_property_range(prop, 1.0, 100.0); RNA_def_property_ui_range(prop, 1.0, 1000.0, 1, 0); RNA_def_property_ui_text(prop, "Dissolve Speed", "Dissolve Speed"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, NULL); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "highres", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGHRES); @@ -195,7 +195,7 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "point_cache"); + RNA_def_property_pointer_sdna(prop, NULL, "point_cache[0]"); RNA_def_property_struct_type(prop, "PointCache"); RNA_def_property_ui_text(prop, "Point Cache", ""); @@ -224,12 +224,10 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Strength", "Strength of wavelet noise"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); - /* - prop= RNA_def_property(srna, "point_cache_hr", PROP_POINTER, PROP_NEVER_NULL); - RNA_def_property_pointer_sdna(prop, NULL, "point_cache"); + prop= RNA_def_property(srna, "point_cache_turbulence", PROP_POINTER, PROP_NEVER_NULL); + RNA_def_property_pointer_sdna(prop, NULL, "point_cache[1]"); RNA_def_property_struct_type(prop, "PointCache"); RNA_def_property_ui_text(prop, "Point Cache", ""); - */ } static void rna_def_smoke_flow_settings(BlenderRNA *brna) From 4893cdc33855e566dade323fa2f8486536821018 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 26 Aug 2009 00:38:43 +0000 Subject: [PATCH 274/577] 2.5 - Warning cleanups (for mingw+scons) Also, made the Outliner's horizontal scrollbar work better for keymaps view. It's still using an approximation of the width, but at least you can scroll now. --- intern/smoke/extern/smoke_API.h | 4 +- source/blender/blenkernel/intern/boids.c | 4 +- source/blender/blenkernel/intern/object.c | 4 +- .../blenkernel/intern/particle_system.c | 2 +- source/blender/blenkernel/intern/pointcache.c | 20 +-- source/blender/blenkernel/intern/smoke.c | 12 +- source/blender/blenkernel/intern/texture.c | 2 +- source/blender/blenlib/BLI_voxel.h | 2 +- .../editors/animation/keyframes_general.c | 139 +++++++++--------- .../editors/interface/interface_regions.c | 2 +- .../editors/interface/interface_templates.c | 2 +- .../editors/interface/interface_widgets.c | 8 +- .../blender/editors/space_outliner/outliner.c | 5 +- .../editors/space_sequencer/sequencer_add.c | 2 +- .../editors/space_view3d/view3d_header.c | 4 +- source/blender/makesdna/DNA_smoke_types.h | 2 +- source/blender/makesrna/intern/rna_smoke.c | 4 +- .../render/intern/include/volume_precache.h | 2 +- .../render/intern/include/volumetric.h | 2 +- .../render/intern/source/pointdensity.c | 2 +- .../blender/render/intern/source/volumetric.c | 2 +- .../blender/render/intern/source/voxeldata.c | 2 +- 22 files changed, 117 insertions(+), 111 deletions(-) diff --git a/intern/smoke/extern/smoke_API.h b/intern/smoke/extern/smoke_API.h index b21ce473202..1a3edce2344 100644 --- a/intern/smoke/extern/smoke_API.h +++ b/intern/smoke/extern/smoke_API.h @@ -32,6 +32,8 @@ extern "C" { #endif +struct FLUID_3D; + // export void smoke_export(struct FLUID_3D *fluid, float *dt, float *dx, float **dens, float **densold, float **heat, float **heatold, float **vx, float **vy, float **vz, float **vxold, float **vyold, float **vzold, unsigned char **obstacles); @@ -74,4 +76,4 @@ void smoke_turbulence_export(struct WTURBULENCE *wt, float **dens, float **denso } #endif -#endif /* SMOKE_API_H_ */ \ No newline at end of file +#endif /* SMOKE_API_H_ */ diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c index d8926fc5753..5c62e434cb6 100644 --- a/source/blender/blenkernel/intern/boids.c +++ b/source/blender/blenkernel/intern/boids.c @@ -76,7 +76,7 @@ static int rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Object *priority_ob = NULL; float vec[3] = {0.0f, 0.0f, 0.0f}, loc[3] = {0.0f, 0.0f, 0.0f}; float mul = (rule->type == eBoidRuleType_Avoid ? 1.0 : -1.0); - float priority = 0.0f, len; + float priority = 0.0f, len = 0.0f; int ret = 0; /* first find out goal/predator with highest priority */ @@ -614,7 +614,7 @@ static int rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti KDTreeNearest *ptn = NULL; ParticleTarget *pt; ParticleData *epars; - ParticleData *enemy_pa; + ParticleData *enemy_pa = NULL; /* friends & enemies */ float closest_enemy[3] = {0.0f,0.0f,0.0f}; float closest_dist = fbr->distance + 1.0f; diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 32f70bc690c..5e2a00c219d 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -2571,6 +2571,7 @@ int object_insert_ptcache(Object *ob) return i; } +#if 0 static int pc_findindex(ListBase *listbase, int index) { LinkData *link= NULL; @@ -2590,11 +2591,10 @@ static int pc_findindex(ListBase *listbase, int index) return -1; } -#if 0 void object_delete_ptcache(Object *ob, int index) { int list_index = pc_findindex(&ob->pc_ids, index); LinkData *link = BLI_findlink(&ob->pc_ids, list_index); BLI_freelinkN(&ob->pc_ids, link); } -#endif \ No newline at end of file +#endif diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index dcd3fcd2f89..bf642a14a49 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -3238,7 +3238,7 @@ static void deflect_particle(Scene *scene, Object *pob, ParticleSystemModifierDa ParticleCollision col; BVHTreeRayHit hit; float ray_dir[3], zerovec[3]={0.0,0.0,0.0}; - float radius = ((part->flag & PART_SIZE_DEFL)?pa->size:0.0f), boid_z; + float radius = ((part->flag & PART_SIZE_DEFL)?pa->size:0.0f), boid_z = 0.0f; int deflections=0, max_deflections=10; VECCOPY(col.co1, pa->prev_state.co); diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 42bea260450..69da8f19d8c 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -424,8 +424,6 @@ void BKE_ptcache_id_from_softbody(PTCacheID *pid, Object *ob, SoftBody *sb) void BKE_ptcache_id_from_particles(PTCacheID *pid, Object *ob, ParticleSystem *psys) { - ParticleSystemModifierData *psmd= psys_get_modifier(ob, psys); - memset(pid, 0, sizeof(PTCacheID)); pid->ob= ob; @@ -484,7 +482,7 @@ static int ptcache_file_write(PTCacheFile *pf, void *f, size_t tot, int size); static int ptcache_compress_write(PTCacheFile *pf, unsigned char *in, unsigned int in_len, unsigned char *out, int mode) { - int r; + int r = 0; unsigned char compressed; LZO_HEAP_ALLOC(wrkmem, LZO1X_MEM_COMPRESS); unsigned int out_len = LZO_OUT_LEN(in_len); @@ -566,11 +564,12 @@ static int ptcache_write_smoke(PTCacheFile *pf, void *smoke_v) return 0; } +/* static int ptcache_write_smoke_turbulence(PTCacheFile *pf, void *smoke_v) { SmokeModifierData *smd= (SmokeModifierData *)smoke_v; SmokeDomainSettings *sds = smd->domain; - /* + if(sds->wt) { unsigned int res_big[3]; size_t res = sds->res[0]*sds->res[1]*sds->res[2]; @@ -599,16 +598,16 @@ static int ptcache_write_smoke_turbulence(PTCacheFile *pf, void *smoke_v) return 1; } -*/ return 0; } +*/ // forward decleration static int ptcache_file_read(PTCacheFile *pf, void *f, size_t tot, int size); static int ptcache_compress_read(PTCacheFile *pf, unsigned char *result, unsigned int len) { - int r; + int r = 0; unsigned char compressed = 0; unsigned int in_len; unsigned int out_len = len; @@ -673,11 +672,12 @@ static void ptcache_read_smoke(PTCacheFile *pf, void *smoke_v) } } +/* static void ptcache_read_smoke_turbulence(PTCacheFile *pf, void *smoke_v) { SmokeModifierData *smd= (SmokeModifierData *)smoke_v; SmokeDomainSettings *sds = smd->domain; - /* + if(sds->fluid) { unsigned int res[3]; float *dens, *densold, *tcu, *tcv, *tcw; @@ -690,8 +690,8 @@ static void ptcache_read_smoke_turbulence(PTCacheFile *pf, void *smoke_v) ptcache_compress_read(pf, (unsigned char*)dens, out_len); } - */ } +*/ void BKE_ptcache_id_from_smoke(PTCacheID *pid, struct Object *ob, struct SmokeModifierData *smd) { @@ -1162,7 +1162,7 @@ int BKE_ptcache_read_cache(PTCacheID *pid, float cfra, float frs_sec) int cfra1 = 0, cfra2 = 0; int totpoint = 0, totpoint2 = 0; int *index = &i, *index2 = &i; - int use_old = 0, old_frame; + int use_old = 0, old_frame = 0; int ret = 0, error = 0; @@ -2084,7 +2084,7 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker) Base *base; ListBase pidlist; PTCacheID *pid = baker->pid; - PointCache *cache; + PointCache *cache = NULL; float frameleno = scene->r.framelen; int cfrao = CFRA; int startframe = MAXFRAME; diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index cd9679be486..223d48012df 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -92,10 +92,10 @@ static void tend ( void ) { QueryPerformanceCounter ( &liCurrentTime ); } -static double tval() -{ - return ((double)( (liCurrentTime.QuadPart - liStartTime.QuadPart)* (double)1000.0/(double)liFrequency.QuadPart )); -} +//static double tval() +//{ +// return ((double)( (liCurrentTime.QuadPart - liStartTime.QuadPart)* (double)1000.0/(double)liFrequency.QuadPart )); +//} #else #include static struct timeval _tstart, _tend; @@ -788,9 +788,8 @@ void smokeModifier_do(SmokeModifierData *smd, Scene *scene, Object *ob, DerivedM } else if(smd->type & MOD_SMOKE_TYPE_DOMAIN) { - PointCache *cache, *cache_wt; + PointCache *cache; PTCacheID pid; - PTCacheID pid_wt; float timescale; int cache_result = 0; int startframe, endframe, framenr; @@ -1424,7 +1423,6 @@ void smoke_calc_transparency(float *result, float *p0, float *p1, int res[3], fl { int x, y, z; float bv[6]; - float bigfactor = 1.0; // x bv[0] = p0[0]; diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 96e9f54fc0c..61f62b2222d 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -750,7 +750,7 @@ void make_local_texture(Tex *tex) void autotexname(Tex *tex) { - char texstr[20][12]= {"None" , "Clouds" , "Wood", "Marble", "Magic" , "Blend", + char texstr[20][15]= {"None" , "Clouds" , "Wood", "Marble", "Magic" , "Blend", "Stucci", "Noise" , "Image", "Plugin", "EnvMap" , "Musgrave", "Voronoi", "DistNoise", "Point Density", "Voxel Data", "", "", "", ""}; Image *ima; diff --git a/source/blender/blenlib/BLI_voxel.h b/source/blender/blenlib/BLI_voxel.h index 091d8e3682d..9b815ccbf42 100644 --- a/source/blender/blenlib/BLI_voxel.h +++ b/source/blender/blenlib/BLI_voxel.h @@ -37,4 +37,4 @@ 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 */ \ No newline at end of file +#endif /* BLI_VOXEL_H */ diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index fc67ee34a2e..ced3c117700 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -127,11 +127,11 @@ void duplicate_fcurve_keys(FCurve *fcu) { BezTriple *newbezt; int i; - - if (fcu == NULL) + + /* this can only work when there is an F-Curve, and also when there are some BezTriples */ + if ELEM(NULL, fcu, fcu->bezt) return; - // XXX this does not take into account sample data... for (i=0; i < fcu->totvert; i++) { /* If a key is selected */ if (fcu->bezt[i].f2 & SELECT) { @@ -160,7 +160,7 @@ void duplicate_fcurve_keys(FCurve *fcu) /* **************************************************** */ /* Various Tools */ -/* Basic IPO-Curve 'cleanup' function that removes 'double points' and unnecessary keyframes on linear-segments only */ +/* Basic F-Curve 'cleanup' function that removes 'double points' and unnecessary keyframes on linear-segments only */ void clean_fcurve(FCurve *fcu, float thresh) { BezTriple *old_bezts, *bezt, *beztn; @@ -285,74 +285,74 @@ void smooth_fcurve (FCurve *fcu) } } - /* if any points were selected, allocate tSmooth_Bezt points to work on */ - if (totSel >= 3) { - tSmooth_Bezt *tarray, *tsb; - - /* allocate memory in one go */ - tsb= tarray= MEM_callocN(totSel*sizeof(tSmooth_Bezt), "tSmooth_Bezt Array"); - - /* populate tarray with data of selected points */ - bezt= fcu->bezt; - for (i=0, x=0; (i < fcu->totvert) && (x < totSel); i++, bezt++) { - if (BEZSELECTED(bezt)) { - /* tsb simply needs pointer to vec, and index */ - tsb->h1 = &bezt->vec[0][1]; - tsb->h2 = &bezt->vec[1][1]; - tsb->h3 = &bezt->vec[2][1]; - - /* advance to the next tsb to populate */ - if (x < totSel- 1) - tsb++; - else - break; - } - } - - /* calculate the new smoothed F-Curve's with weighted averages: - * - this is done with two passes - * - uses 5 points for each operation (which stores in the relevant handles) - * - previous: w/a ratio = 3:5:2:1:1 - * - next: w/a ratio = 1:1:2:5:3 - */ - - /* round 1: calculate previous and next */ - tsb= tarray; - for (i=0; i < totSel; i++, tsb++) { - /* don't touch end points (otherwise, curves slowly explode) */ - if (ELEM(i, 0, (totSel-1)) == 0) { - const tSmooth_Bezt *tP1 = tsb - 1; - const tSmooth_Bezt *tP2 = (i-2 > 0) ? (tsb - 2) : (NULL); - const tSmooth_Bezt *tN1 = tsb + 1; - const tSmooth_Bezt *tN2 = (i+2 < totSel) ? (tsb + 2) : (NULL); - - const float p1 = *tP1->h2; - const float p2 = (tP2) ? (*tP2->h2) : (*tP1->h2); - const float c1 = *tsb->h2; - const float n1 = *tN1->h2; - const float n2 = (tN2) ? (*tN2->h2) : (*tN1->h2); - - /* calculate previous and next */ - *tsb->h1= (3*p2 + 5*p1 + 2*c1 + n1 + n2) / 12; - *tsb->h3= (p2 + p1 + 2*c1 + 5*n1 + 3*n2) / 12; - } - } - - /* round 2: calculate new values and reset handles */ - tsb= tarray; - for (i=0; i < totSel; i++, tsb++) { - /* calculate new position by averaging handles */ - *tsb->h2 = (*tsb->h1 + *tsb->h3) / 2; + /* if any points were selected, allocate tSmooth_Bezt points to work on */ + if (totSel >= 3) { + tSmooth_Bezt *tarray, *tsb; - /* reset handles now */ - *tsb->h1 = *tsb->h2; - *tsb->h3 = *tsb->h2; + /* allocate memory in one go */ + tsb= tarray= MEM_callocN(totSel*sizeof(tSmooth_Bezt), "tSmooth_Bezt Array"); + + /* populate tarray with data of selected points */ + bezt= fcu->bezt; + for (i=0, x=0; (i < fcu->totvert) && (x < totSel); i++, bezt++) { + if (BEZSELECTED(bezt)) { + /* tsb simply needs pointer to vec, and index */ + tsb->h1 = &bezt->vec[0][1]; + tsb->h2 = &bezt->vec[1][1]; + tsb->h3 = &bezt->vec[2][1]; + + /* advance to the next tsb to populate */ + if (x < totSel- 1) + tsb++; + else + break; + } + } + + /* calculate the new smoothed F-Curve's with weighted averages: + * - this is done with two passes + * - uses 5 points for each operation (which stores in the relevant handles) + * - previous: w/a ratio = 3:5:2:1:1 + * - next: w/a ratio = 1:1:2:5:3 + */ + + /* round 1: calculate previous and next */ + tsb= tarray; + for (i=0; i < totSel; i++, tsb++) { + /* don't touch end points (otherwise, curves slowly explode) */ + if (ELEM(i, 0, (totSel-1)) == 0) { + const tSmooth_Bezt *tP1 = tsb - 1; + const tSmooth_Bezt *tP2 = (i-2 > 0) ? (tsb - 2) : (NULL); + const tSmooth_Bezt *tN1 = tsb + 1; + const tSmooth_Bezt *tN2 = (i+2 < totSel) ? (tsb + 2) : (NULL); + + const float p1 = *tP1->h2; + const float p2 = (tP2) ? (*tP2->h2) : (*tP1->h2); + const float c1 = *tsb->h2; + const float n1 = *tN1->h2; + const float n2 = (tN2) ? (*tN2->h2) : (*tN1->h2); + + /* calculate previous and next */ + *tsb->h1= (3*p2 + 5*p1 + 2*c1 + n1 + n2) / 12; + *tsb->h3= (p2 + p1 + 2*c1 + 5*n1 + 3*n2) / 12; + } + } + + /* round 2: calculate new values and reset handles */ + tsb= tarray; + for (i=0; i < totSel; i++, tsb++) { + /* calculate new position by averaging handles */ + *tsb->h2 = (*tsb->h1 + *tsb->h3) / 2; + + /* reset handles now */ + *tsb->h1 = *tsb->h2; + *tsb->h3 = *tsb->h2; + } + + /* free memory required for tarray */ + MEM_freeN(tarray); } - /* free memory required for tarray */ - MEM_freeN(tarray); -} - /* recalculate handles */ calchandles_fcurve(fcu); } @@ -371,7 +371,6 @@ ListBase animcopybuf = {NULL, NULL}; static float animcopy_firstframe= 999999999.0f; /* datatype for use in copy/paste buffer */ -// XXX F-Curve editor should use this too typedef struct tAnimCopybufItem { struct tAnimCopybufItem *next, *prev; diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index e83dca5a500..1d911fef418 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1330,7 +1330,7 @@ static void ui_block_func_MENUSTR(bContext *C, uiLayout *layout, void *arg_str) { uiBlock *block= uiLayoutGetBlock(layout); uiPopupBlockHandle *handle= block->handle; - uiLayout *split, *column; + uiLayout *split, *column=NULL; uiBut *bt; MenuData *md; MenuEntry *entry; diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 4cfc44e56c8..6aa5f5efc41 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1318,7 +1318,7 @@ ListBase uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, char *pr Panel *pa; ListBase lb, *itemlb; char *name, str[32]; - int icon=0, i= 0, activei= 0, len, items, found, min, max; + int icon=0, i= 0, activei= 0, len= 0, items, found, min, max; lb.first= lb.last= NULL; diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index a55b11afe48..f0085f71373 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1946,12 +1946,12 @@ static void widget_pulldownbut(uiWidgetColors *wcol, rcti *rect, int state, int { if(state & UI_ACTIVE) { uiWidgetBase wtb; - float rad= 0.5f*(rect->ymax - rect->ymin); + float rad= 0.5f*(rect->ymax - rect->ymin); // 4.0f widget_init(&wtb); /* half rounded */ - round_box_edges(&wtb, 15, rect, 4.0f); + round_box_edges(&wtb, 15, rect, rad); widgetbase_draw(&wtb, wcol); } @@ -2045,12 +2045,12 @@ static void widget_but(uiWidgetColors *wcol, rcti *rect, int state, int roundbox static void widget_roundbut(uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign) { uiWidgetBase wtb; - float rad= 0.5f*(rect->ymax - rect->ymin); + float rad= 5.0f; //0.5f*(rect->ymax - rect->ymin); widget_init(&wtb); /* half rounded */ - round_box_edges(&wtb, roundboxalign, rect, 5.0f); + round_box_edges(&wtb, roundboxalign, rect, rad); widgetbase_draw(&wtb, wcol); } diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index d564573a543..fca5b0cc59a 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -5274,7 +5274,10 @@ void draw_outliner(const bContext *C) sizex_rna= MAX2(OL_RNA_COLX, sizex_rna+OL_RNA_COL_SPACEX); /* get width of data (for setting 'tot' rect, this is column 1 + column 2 + a bit extra) */ - sizex= sizex_rna + OL_RNA_COL_SIZEX + 50; + if (soops->outlinevis == SO_KEYMAP) + sizex= sizex_rna + OL_RNA_COL_SIZEX*3 + 50; // XXX this is only really a quick hack to make this wide enough... + else + sizex= sizex_rna + OL_RNA_COL_SIZEX + 50; } else { /* width must take into account restriction columns (if visible) so that entries will still be visible */ diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 5d58ea431a9..bdedef4b6c8 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -291,7 +291,7 @@ static int sequencer_add_movie_strip_exec(bContext *C, wmOperator *op) struct anim *an; char filename[FILE_MAX]; - Sequence *seq, *soundseq; /* generic strip vars */ + Sequence *seq, *soundseq=NULL; /* generic strip vars */ Strip *strip; StripElem *se; diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 6773985e07c..eee85f21798 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -1005,9 +1005,10 @@ static uiBlock *view3d_object_mirrormenu(bContext *C, ARegion *ar, void *arg_unu #endif #endif +#if 0 static void view3d_edit_object_transformmenu(bContext *C, uiLayout *layout, void *arg_unused) { -#if 0 +#if 0 // XXX not used anymore uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Scale/Rotation to ObData|Ctrl A, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); apply_objects_locrot(); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Apply Visual Transform|Ctrl A, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, ""); @@ -1024,6 +1025,7 @@ static void view3d_edit_object_transformmenu(bContext *C, uiLayout *layout, void uiItemO(layout, NULL, 0, "OBJECT_OT_scale_clear"); uiItemO(layout, NULL, 0, "OBJECT_OT_origin_clear"); } +#endif #if 0 static void do_view3d_edit_object_makelocalmenu(bContext *C, void *arg, int event) diff --git a/source/blender/makesdna/DNA_smoke_types.h b/source/blender/makesdna/DNA_smoke_types.h index a8ab4734af0..7c6c7fab9e4 100644 --- a/source/blender/makesdna/DNA_smoke_types.h +++ b/source/blender/makesdna/DNA_smoke_types.h @@ -32,7 +32,7 @@ /* flags */ #define MOD_SMOKE_HIGHRES (1<<1) /* enable high resolution */ #define MOD_SMOKE_DISSOLVE (1<<2) /* let smoke dissolve */ -#define MOD_SMOKE_DISSOLVE_LOG (1<<3) /* using 1/x for dissolve * +#define MOD_SMOKE_DISSOLVE_LOG (1<<3) /* using 1/x for dissolve */ /* noise */ #define MOD_SMOKE_NOISEWAVE (1<<0) diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c index 5ef25edacf7..d7c70d8b9e9 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -79,12 +79,14 @@ static void rna_Smoke_reset_dependancy(bContext *C, PointerRNA *ptr) rna_Smoke_dependency_update(C, ptr); } +#if 0 static void rna_Smoke_redraw(bContext *C, PointerRNA *ptr) { SmokeDomainSettings *settings = (SmokeDomainSettings*)ptr->data; - // settings->flags |= MOD_SMOKE_VIEW_REDRAWNICE; + settings->flags |= MOD_SMOKE_VIEW_REDRAWNICE; } +#endif static char *rna_SmokeDomainSettings_path(PointerRNA *ptr) { diff --git a/source/blender/render/intern/include/volume_precache.h b/source/blender/render/intern/include/volume_precache.h index d8a94c2d560..dbd02759a63 100644 --- a/source/blender/render/intern/include/volume_precache.h +++ b/source/blender/render/intern/include/volume_precache.h @@ -31,4 +31,4 @@ void free_volume_precache(Render *re); int point_inside_volume_objectinstance(ObjectInstanceRen *obi, float *co); int using_lightcache(Material *ma); -#define VOL_MS_TIMESTEP 0.1f \ No newline at end of file +#define VOL_MS_TIMESTEP 0.1f diff --git a/source/blender/render/intern/include/volumetric.h b/source/blender/render/intern/include/volumetric.h index 543e179bc88..026b4840ea3 100644 --- a/source/blender/render/intern/include/volumetric.h +++ b/source/blender/render/intern/include/volumetric.h @@ -44,4 +44,4 @@ void shade_volume_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct #define VOL_BOUNDS_SS 1 #define VOL_SHADE_OUTSIDE 0 -#define VOL_SHADE_INSIDE 1 \ No newline at end of file +#define VOL_SHADE_INSIDE 1 diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index fbc39b61257..5f8cf5504fa 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -324,7 +324,7 @@ void accum_density(void *userdata, int index, float squared_dist) { PointDensityRangeData *pdr = (PointDensityRangeData *)userdata; const float dist = (pdr->squared_radius - squared_dist) / pdr->squared_radius * 0.5f; - float density; + float density = 0.0f; if (pdr->falloff_type == TEX_PD_FALLOFF_STD) density = dist; diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 0e2e3913819..13996905437 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -685,4 +685,4 @@ void shade_volume_inside(ShadeInput *shi, ShadeResult *shr) volume_trace(shi, shr, VOL_SHADE_INSIDE); shi->mat = mat_backup; -} \ No newline at end of file +} diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c index f1f01f873a5..836faeb05b9 100644 --- a/source/blender/render/intern/source/voxeldata.c +++ b/source/blender/render/intern/source/voxeldata.c @@ -162,7 +162,7 @@ void init_frame_smoke(Render *re, VoxelData *vd, Tex *tex) ob= vd->object; /* draw code for smoke */ - if(md = (ModifierData *)modifiers_findByType(ob, eModifierType_Smoke)) + if( (md = (ModifierData *)modifiers_findByType(ob, eModifierType_Smoke)) ) { SmokeModifierData *smd = (SmokeModifierData *)md; From 833afdd9e7fe50b80ce67f11f113b03f751eca18 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Wed, 26 Aug 2009 01:49:57 +0000 Subject: [PATCH 275/577] Map manipulator to leftmouse, not actionmouse. We don't want this to flip around when people change left or right mouse select. --- source/blender/editors/space_view3d/view3d_ops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 929272bc066..e9d1f6406b0 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -132,7 +132,8 @@ void view3d_keymap(wmWindowManager *wm) km = WM_keymap_add_item(keymap, "SKETCH_OT_draw_preview", MOUSEMOVE, KM_ANY, KM_CTRL, 0); RNA_boolean_set(km->ptr, "snap", 1); - WM_keymap_verify_item(keymap, "VIEW3D_OT_manipulator", ACTIONMOUSE, KM_PRESS, 0, 0); + WM_keymap_verify_item(keymap, "VIEW3D_OT_manipulator", LEFTMOUSE, KM_PRESS, 0, 0); /* manipulator always on left mouse, not on action mouse*/ + WM_keymap_verify_item(keymap, "VIEW3D_OT_cursor3d", ACTIONMOUSE, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "VIEW3D_OT_viewrotate", MIDDLEMOUSE, KM_PRESS, 0, 0); From d893b0f9ff5fc21277b9c24568e224961537c23c Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Wed, 26 Aug 2009 02:18:47 +0000 Subject: [PATCH 276/577] Clear transform flag on all bones that are not transformed. --- source/blender/editors/transform/transform_conversions.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 57a77ae75b8..48947794620 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -698,6 +698,8 @@ int count_set_pose_transflags(int *out_mode, short around, Object *ob) bone->flag &= ~BONE_HINGE_CHILD_TRANSFORM; bone->flag &= ~BONE_TRANSFORM_CHILD; } + else + bone->flag &= ~BONE_TRANSFORM; } /* make sure no bone can be transformed when a parent is transformed */ From 43422354895bb620d6731f928d121ae6cd06da48 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 26 Aug 2009 06:15:43 +0000 Subject: [PATCH 277/577] - Mathutils.Vector assignment wasnt working in the BGE's py api, was using getValue() rather than setValue() - added GPL header to bpy_interface.c from 2.4x's BPY_interface.c - warning fixes --- source/blender/editors/object/object_vgroup.c | 2 +- .../python/generic/bpy_internal_import.h | 9 ++++++ source/blender/python/generic/vector.c | 4 +-- source/blender/python/intern/bpy_interface.c | 31 ++++++++++++++++++- source/gameengine/Ketsji/KX_PyMath.h | 6 ++-- .../Physics/Bullet/CcdPhysicsEnvironment.cpp | 4 +-- 6 files changed, 47 insertions(+), 9 deletions(-) diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 154ab14df60..767a04d9170 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -1076,7 +1076,7 @@ void vgroup_operation_with_menu(Object *ob) short nr; if (menustr) { -// XXX nr= pupmenu(menustr); + nr= 1; // pupmenu(menustr); // XXX if ((nr >= 1) && (nr <= defCount)) ob->actdef= nr; diff --git a/source/blender/python/generic/bpy_internal_import.h b/source/blender/python/generic/bpy_internal_import.h index c93d930dab0..4e761fe8da0 100644 --- a/source/blender/python/generic/bpy_internal_import.h +++ b/source/blender/python/generic/bpy_internal_import.h @@ -31,6 +31,15 @@ #ifndef EXPP_bpy_import_h #define EXPP_bpy_import_h +/* python redefines :/ */ +#ifdef _POSIX_C_SOURCE +#undef _POSIX_C_SOURCE +#endif + +#ifdef _XOPEN_SOURCE +#undef _XOPEN_SOURCE +#endif + #include #include "compile.h" /* for the PyCodeObject */ #include "eval.h" /* for PyEval_EvalCode */ diff --git a/source/blender/python/generic/vector.c b/source/blender/python/generic/vector.c index 923c4bbe58a..c4a8a37ee05 100644 --- a/source/blender/python/generic/vector.c +++ b/source/blender/python/generic/vector.c @@ -168,7 +168,7 @@ static PyObject *Vector_Resize2D(VectorObject * self) return NULL; } if(self->cb_user) { - PyErr_SetString(PyExc_TypeError, "vector.resize4d(): cannot resize a vector that has an owner"); + PyErr_SetString(PyExc_TypeError, "vector.resize2d(): cannot resize a vector that has an owner"); return NULL; } @@ -191,7 +191,7 @@ static PyObject *Vector_Resize3D(VectorObject * self) return NULL; } if(self->cb_user) { - PyErr_SetString(PyExc_TypeError, "vector.resize4d(): cannot resize a vector that has an owner"); + PyErr_SetString(PyExc_TypeError, "vector.resize3d(): cannot resize a vector that has an owner"); return NULL; } diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 69b733d3fda..43db337c6db 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -1,4 +1,28 @@ - +/** + * $Id: + * + * ***** 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. + * + * Contributor(s): Michel Selten, Willian P. Germano, Stephen Swaney, + * Chris Keith, Chris Want, Ken Hughes, Campbell Barton + * + * ***** END GPL LICENSE BLOCK ***** + */ + #include #include #include @@ -10,6 +34,11 @@ #include "BLI_winstuff.h" #endif +/* grr, python redefines */ +#ifdef _POSIX_C_SOURCE +#undef _POSIX_C_SOURCE +#endif + #include #include "compile.h" /* for the PyCodeObject */ #include "eval.h" /* for PyEval_EvalCode */ diff --git a/source/gameengine/Ketsji/KX_PyMath.h b/source/gameengine/Ketsji/KX_PyMath.h index 9ee11c9e745..a8488e8e60a 100644 --- a/source/gameengine/Ketsji/KX_PyMath.h +++ b/source/gameengine/Ketsji/KX_PyMath.h @@ -113,7 +113,7 @@ bool PyVecTo(PyObject* pyval, T& vec) PyErr_Format(PyExc_AttributeError, "error setting vector, %d args, should be %d", pyvec->size, Size(vec)); return false; } - vec.getValue((float *) pyvec->vec); + vec.setValue((float *) pyvec->vec); return true; } else if(QuaternionObject_Check(pyval)) { @@ -123,7 +123,7 @@ bool PyVecTo(PyObject* pyval, T& vec) return false; } /* xyzw -> wxyz reordering is done by PyQuatTo */ - vec.getValue((float *) pyquat->quat); + vec.setValue((float *) pyquat->quat); return true; } else if(EulerObject_Check(pyval)) { @@ -132,7 +132,7 @@ bool PyVecTo(PyObject* pyval, T& vec) PyErr_Format(PyExc_AttributeError, "error setting vector, %d args, should be %d", 3, Size(vec)); return false; } - vec.getValue((float *) pyeul->eul); + vec.setValue((float *) pyeul->eul); return true; } else #endif diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index bc7ccacc39b..bf28802870a 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -327,7 +327,6 @@ CcdPhysicsEnvironment::CcdPhysicsEnvironment(bool useDbvtCulling,btDispatcher* d :m_cullingCache(NULL), m_cullingTree(NULL), m_numIterations(10), -m_scalingPropagated(false), m_numTimeSubSteps(1), m_ccdMode(0), m_solverType(-1), @@ -336,7 +335,8 @@ m_enableSatCollisionDetection(false), m_solver(NULL), m_ownPairCache(NULL), m_filterCallback(NULL), -m_ownDispatcher(NULL) +m_ownDispatcher(NULL), +m_scalingPropagated(false) { for (int i=0;i Date: Wed, 26 Aug 2009 06:17:39 +0000 Subject: [PATCH 278/577] * Fix for yesterday's valgrind fix * Fix for plane material preview render. Now, light cache aborts if there isn't enough volume, and falls back on non-cached single scattering. It still doesn't make much sense to render a plane as a volume, but for now in the preview it will shade the region in between the plane and the checker background. --- .../render/intern/include/volume_precache.h | 35 + .../render/intern/source/volume_precache.c | 23 +- .../blender/render/intern/source/volumetric.c | 690 ++++++++++++++++++ 3 files changed, 741 insertions(+), 7 deletions(-) diff --git a/source/blender/render/intern/include/volume_precache.h b/source/blender/render/intern/include/volume_precache.h index dbd02759a63..93620dc9bf4 100644 --- a/source/blender/render/intern/include/volume_precache.h +++ b/source/blender/render/intern/include/volume_precache.h @@ -1,3 +1,37 @@ +<<<<<<< .mine +/** + * + * ***** 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 ***** + */ + +void volume_precache(Render *re); +void free_volume_precache(Render *re); +int point_inside_volume_objectinstance(ObjectInstanceRen *obi, float *co); + +#define VOL_MS_TIMESTEP 0.1f======= /** * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -32,3 +66,4 @@ int point_inside_volume_objectinstance(ObjectInstanceRen *obi, float *co); int using_lightcache(Material *ma); #define VOL_MS_TIMESTEP 0.1f +>>>>>>> .r22793 diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c index 71200aa8b0d..d5a54759332 100644 --- a/source/blender/render/intern/source/volume_precache.c +++ b/source/blender/render/intern/source/volume_precache.c @@ -499,8 +499,7 @@ static void precache_init_parts(Render *re, RayTree *tree, ShadeInput *shi, Obje res = vp->res; VecSubf(voxel, bbmax, bbmin); - if ((voxel[0] < FLT_EPSILON) || (voxel[1] < FLT_EPSILON) || (voxel[2] < FLT_EPSILON)) - return; + voxel[0] /= res[0]; voxel[1] /= res[1]; voxel[2] /= res[2]; @@ -564,7 +563,7 @@ static VolPrecachePart *precache_get_new_part(Render *re) return nextpa; } -static void precache_resolution(VolumePrecache *vp, float *bbmin, float *bbmax, int res) +static int precache_resolution(VolumePrecache *vp, float *bbmin, float *bbmax, int res) { float dim[3], div; @@ -574,10 +573,15 @@ static void precache_resolution(VolumePrecache *vp, float *bbmin, float *bbmax, dim[0] /= div; dim[1] /= div; dim[2] /= div; - + vp->res[0] = dim[0] * (float)res; vp->res[1] = dim[1] * (float)res; vp->res[2] = dim[2] * (float)res; + + if ((vp->res[0] < 1) || (vp->res[1] < 1) || (vp->res[2] < 1)) + return 0; + + return 1; } /* Precache a volume into a 3D voxel grid. @@ -608,7 +612,12 @@ void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *obi, Mat if (!tree) return; vp = MEM_callocN(sizeof(VolumePrecache), "volume light cache"); - precache_resolution(vp, bbmin, bbmax, ma->vol.precache_resolution); + + if (!precache_resolution(vp, bbmin, bbmax, ma->vol.precache_resolution)) { + MEM_freeN(vp); + vp = NULL; + return; + } vp->data_r = MEM_callocN(sizeof(float)*vp->res[0]*vp->res[1]*vp->res[2], "volume light cache data red channel"); vp->data_g = MEM_callocN(sizeof(float)*vp->res[0]*vp->res[1]*vp->res[2], "volume light cache data green channel"); @@ -675,7 +684,7 @@ void vol_precache_objectinstance_threads(Render *re, ObjectInstanceRen *obi, Mat } } -int using_lightcache(Material *ma) +static int using_lightcache(Material *ma) { return (((ma->vol.shadeflag & MA_VOL_PRECACHESHADING) && (ma->vol.shade_type == MA_VOL_SHADE_SINGLE)) || (ELEM(ma->vol.shade_type, MA_VOL_SHADE_MULTIPLE, MA_VOL_SHADE_SINGLEPLUSMULTIPLE))); @@ -708,10 +717,10 @@ void free_volume_precache(Render *re) for(obi= re->instancetable.first; obi; obi= obi->next) { if (obi->volume_precache != NULL) { - MEM_freeN(obi->volume_precache); MEM_freeN(obi->volume_precache->data_r); MEM_freeN(obi->volume_precache->data_g); MEM_freeN(obi->volume_precache->data_b); + MEM_freeN(obi->volume_precache); obi->volume_precache = NULL; } } diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 13996905437..441237dab79 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -1,3 +1,692 @@ +<<<<<<< .mine +/** + * + * ***** 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 +#include +#include +#include + +#include "MEM_guardedalloc.h" + +#include "BLI_blenlib.h" +#include "BLI_arithb.h" +#include "BLI_rand.h" +#include "BLI_voxel.h" + +#include "RE_shader_ext.h" +#include "RE_raytrace.h" + +#include "DNA_material_types.h" +#include "DNA_group_types.h" +#include "DNA_lamp_types.h" + +#include "BKE_global.h" + +#include "render_types.h" +#include "pixelshading.h" +#include "shading.h" +#include "texture.h" +#include "volumetric.h" +#include "volume_precache.h" + +#if defined( _MSC_VER ) && !defined( __cplusplus ) +# define inline __inline +#endif // defined( _MSC_VER ) && !defined( __cplusplus ) + +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* defined in pipeline.c, is hardcopy of active dynamic allocated Render */ +/* only to be used here in this file, it's for speed */ +extern struct Render R; +/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + + +/* tracing */ + +static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, Isect *isect, int intersect_type) +{ + float maxsize = RE_ray_tree_max_size(R.raytree); + + /* XXX TODO - get raytrace max distance from object instance's bounding box */ + /* need to account for scaling only, but keep coords in camera space... + * below code is WIP and doesn't work! + VecSubf(bb_dim, shi->obi->obr->boundbox[1], shi->obi->obr->boundbox[2]); + Mat3MulVecfl(shi->obi->nmat, bb_dim); + maxsize = VecLength(bb_dim); + */ + + VECCOPY(isect->start, co); + isect->end[0] = co[0] + vec[0] * maxsize; + isect->end[1] = co[1] + vec[1] * maxsize; + isect->end[2] = co[2] + vec[2] * maxsize; + + isect->mode= RE_RAY_MIRROR; + isect->oborig= RAY_OBJECT_SET(&R, shi->obi); + isect->face_last= NULL; + isect->ob_last= 0; + isect->lay= -1; + + if (intersect_type == VOL_BOUNDS_DEPTH) isect->faceorig= (RayFace*)shi->vlr; + else if (intersect_type == VOL_BOUNDS_SS) isect->faceorig= NULL; + + if(RE_ray_tree_intersect(R.raytree, isect)) + { + hitco[0] = isect->start[0] + isect->labda*isect->vec[0]; + hitco[1] = isect->start[1] + isect->labda*isect->vec[1]; + hitco[2] = isect->start[2] + isect->labda*isect->vec[2]; + return 1; + } else { + return 0; + } +} + +static void shade_intersection(ShadeInput *shi, float *col, Isect *is) +{ + ShadeInput shi_new; + ShadeResult shr_new; + + memset(&shi_new, 0, sizeof(ShadeInput)); + + shi_new.mask= shi->mask; + shi_new.osatex= shi->osatex; + shi_new.thread= shi->thread; + shi_new.depth = shi->depth + 1; + shi_new.volume_depth= shi->volume_depth + 1; + shi_new.xs= shi->xs; + shi_new.ys= shi->ys; + shi_new.lay= shi->lay; + shi_new.passflag= SCE_PASS_COMBINED; /* result of tracing needs no pass info */ + shi_new.combinedflag= 0xFFFFFF; /* ray trace does all options */ + shi_new.light_override= shi->light_override; + shi_new.mat_override= shi->mat_override; + + VECCOPY(shi_new.camera_co, is->start); + + memset(&shr_new, 0, sizeof(ShadeResult)); + + /* hardcoded limit of 100 for now - prevents problems in weird geometry */ + if (shi->volume_depth < 100) { + shade_ray(is, &shi_new, &shr_new); + } + + VecCopyf(col, shr_new.combined); + col[3] = shr_new.alpha; +} + +static void vol_trace_behind(ShadeInput *shi, VlakRen *vlr, float *co, float *col) +{ + Isect isect; + float maxsize = RE_ray_tree_max_size(R.raytree); + + VECCOPY(isect.start, co); + isect.end[0] = isect.start[0] + shi->view[0] * maxsize; + isect.end[1] = isect.start[1] + shi->view[1] * maxsize; + isect.end[2] = isect.start[2] + shi->view[2] * maxsize; + + isect.faceorig= (RayFace *)vlr; + + isect.mode= RE_RAY_MIRROR; + isect.oborig= RAY_OBJECT_SET(&R, shi->obi); + isect.face_last= NULL; + isect.ob_last= 0; + isect.lay= -1; + + /* check to see if there's anything behind the volume, otherwise shade the sky */ + if(RE_ray_tree_intersect(R.raytree, &isect)) { + shade_intersection(shi, col, &isect); + } else { + shadeSkyView(col, co, shi->view, NULL, shi->thread); + shadeSunView(col, shi->view); + } +} + +/* input shader data */ + +float vol_get_stepsize(struct ShadeInput *shi, int context) +{ + if (shi->mat->vol.stepsize_type == MA_VOL_STEP_RANDOMIZED) { + /* range between 0.75 and 1.25 */ + const float rnd = 0.5f * BLI_thread_frand(shi->thread) + 0.75f; + + if (context == STEPSIZE_VIEW) + return shi->mat->vol.stepsize * rnd; + else if (context == STEPSIZE_SHADE) + return shi->mat->vol.shade_stepsize * rnd; + } + else { // MA_VOL_STEP_CONSTANT + + if (context == STEPSIZE_VIEW) + return shi->mat->vol.stepsize; + else if (context == STEPSIZE_SHADE) + return shi->mat->vol.shade_stepsize; + } + + return shi->mat->vol.stepsize; +} + +/* trilinear interpolation */ +static void vol_get_precached_scattering(ShadeInput *shi, float *scatter_col, float *co) +{ + VolumePrecache *vp = shi->obi->volume_precache; + float bbmin[3], bbmax[3], dim[3]; + float sample_co[3]; + + if (!vp) return; + + /* convert input coords to 0.0, 1.0 */ + VECCOPY(bbmin, shi->obi->obr->boundbox[0]); + VECCOPY(bbmax, shi->obi->obr->boundbox[1]); + VecSubf(dim, bbmax, bbmin); + + sample_co[0] = ((co[0] - bbmin[0]) / dim[0]); + sample_co[1] = ((co[1] - bbmin[1]) / dim[1]); + sample_co[2] = ((co[2] - bbmin[2]) / dim[2]); + + scatter_col[0] = voxel_sample_trilinear(vp->data_r, vp->res, sample_co); + scatter_col[1] = voxel_sample_trilinear(vp->data_g, vp->res, sample_co); + scatter_col[2] = voxel_sample_trilinear(vp->data_b, vp->res, sample_co); +} + +float vol_get_density(struct ShadeInput *shi, float *co) +{ + float density = shi->mat->vol.density; + float density_scale = shi->mat->vol.density_scale; + float col[3] = {0.0, 0.0, 0.0}; + + do_volume_tex(shi, co, MAP_DENSITY, col, &density); + + return density * density_scale; +} + +/* scattering multiplier, values above 1.0 are non-physical, + * but can be useful to tweak lighting */ +float vol_get_scattering_fac(ShadeInput *shi, float *co) +{ + float scatter = shi->mat->vol.scattering; + float col[3] = {0.0, 0.0, 0.0}; + + do_volume_tex(shi, co, MAP_SCATTERING, col, &scatter); + + return scatter; +} + +/* compute emission component, amount of radiance to add per segment + * can be textured with 'emit' */ +void vol_get_emission(ShadeInput *shi, float *emission_col, float *co, float density) +{ + float emission = shi->mat->vol.emission; + VECCOPY(emission_col, shi->mat->vol.emission_col); + + do_volume_tex(shi, co, MAP_EMISSION+MAP_EMISSION_COL, emission_col, &emission); + + emission_col[0] = emission_col[0] * emission * density; + emission_col[1] = emission_col[1] * emission * density; + emission_col[2] = emission_col[2] * emission * density; +} + +void vol_get_absorption(ShadeInput *shi, float *absorb_col, float *co) +{ + float absorption = shi->mat->vol.absorption; + VECCOPY(absorb_col, shi->mat->vol.absorption_col); + + do_volume_tex(shi, co, MAP_ABSORPTION+MAP_ABSORPTION_COL, absorb_col, &absorption); + + absorb_col[0] = (1.0f - absorb_col[0]) * absorption; + absorb_col[1] = (1.0f - absorb_col[1]) * absorption; + absorb_col[2] = (1.0f - absorb_col[2]) * absorption; +} + + +/* phase function - determines in which directions the light + * is scattered in the volume relative to incoming direction + * and view direction */ +float vol_get_phasefunc(ShadeInput *shi, short phasefunc_type, float g, float *w, float *wp) +{ + const float costheta = Inpf(w, wp); + const float scale = M_PI; + + /* + * Scale constant is required, since Blender's shading system doesn't normalise for + * energy conservation - eg. scaling by 1/pi for a lambert shader. + * This makes volumes darker than other solid objects, for the same lighting intensity. + * To correct this, scale up the phase function values + * until Blender's shading system supports this better. --matt + */ + + switch (phasefunc_type) { + case MA_VOL_PH_MIEHAZY: + return scale * (0.5f + 4.5f * powf(0.5 * (1.f + costheta), 8.f)) / (4.f*M_PI); + case MA_VOL_PH_MIEMURKY: + return scale * (0.5f + 16.5f * powf(0.5 * (1.f + costheta), 32.f)) / (4.f*M_PI); + case MA_VOL_PH_RAYLEIGH: + return scale * 3.f/(16.f*M_PI) * (1 + costheta * costheta); + case MA_VOL_PH_HG: + return scale * (1.f / (4.f * M_PI) * (1.f - g*g) / powf(1.f + g*g - 2.f * g * costheta, 1.5f)); + case MA_VOL_PH_SCHLICK: + { + const float k = 1.55f * g - .55f * g * g * g; + const float kcostheta = k * costheta; + return scale * (1.f / (4.f * M_PI) * (1.f - k*k) / ((1.f - kcostheta) * (1.f - kcostheta))); + } + case MA_VOL_PH_ISOTROPIC: + default: + return scale * (1.f / (4.f * M_PI)); + } +} + +/* Compute attenuation, otherwise known as 'optical thickness', extinction, or tau. + * Used in the relationship Transmittance = e^(-attenuation) + */ +void vol_get_attenuation_seg(ShadeInput *shi, float *transmission, float stepsize, float *co, float density) +{ + /* input density = density at co */ + float tau[3] = {0.f, 0.f, 0.f}; + float absorb_col[3]; + + vol_get_absorption(shi, absorb_col, co); + + /* homogenous volume within the sampled distance */ + tau[0] = stepsize * density * absorb_col[0]; + tau[1] = stepsize * density * absorb_col[1]; + tau[2] = stepsize * density * absorb_col[2]; + + transmission[0] *= exp(-tau[0]); + transmission[1] *= exp(-tau[1]); + transmission[2] *= exp(-tau[2]); +} + +/* Compute attenuation, otherwise known as 'optical thickness', extinction, or tau. + * Used in the relationship Transmittance = e^(-attenuation) + */ +void vol_get_attenuation(ShadeInput *shi, float *transmission, float *co, float *endco, float density, float stepsize) +{ + /* input density = density at co */ + float tau[3] = {0.f, 0.f, 0.f}; + float absorb_col[3]; + int s, nsteps; + float step_vec[3], step_sta[3], step_end[3]; + const float dist = VecLenf(co, endco); + + vol_get_absorption(shi, absorb_col, co); + + nsteps = (int)((dist / stepsize) + 0.5); + + VecSubf(step_vec, endco, co); + VecMulf(step_vec, 1.0f / nsteps); + + VecCopyf(step_sta, co); + VecAddf(step_end, step_sta, step_vec); + + for (s = 0; s < nsteps; s++) { + if (s > 0) + density = vol_get_density(shi, step_sta); + + tau[0] += stepsize * density; + tau[1] += stepsize * density; + tau[2] += stepsize * density; + + if (s < nsteps-1) { + VecCopyf(step_sta, step_end); + VecAddf(step_end, step_end, step_vec); + } + } + VecMulVecf(tau, tau, absorb_col); + + transmission[0] *= exp(-tau[0]); + transmission[1] *= exp(-tau[1]); + transmission[2] *= exp(-tau[2]); +} + +void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float *lacol, float stepsize, float density) +{ + float visifac, lv[3], lampdist; + float tr[3]={1.0,1.0,1.0}; + float hitco[3], *atten_co; + float p; + float scatter_fac; + float shade_stepsize = vol_get_stepsize(shi, STEPSIZE_SHADE); + + if (lar->mode & LA_LAYER) if((lar->lay & shi->obi->lay)==0) return; + if ((lar->lay & shi->lay)==0) return; + if (lar->energy == 0.0) return; + + if ((visifac= lamp_get_visibility(lar, co, lv, &lampdist)) == 0.f) return; + + VecCopyf(lacol, &lar->r); + + if(lar->mode & LA_TEXTURE) { + shi->osatex= 0; + do_lamp_tex(lar, lv, shi, lacol, LA_TEXTURE); + } + + VecMulf(lacol, visifac*lar->energy); + + if (ELEM(lar->type, LA_SUN, LA_HEMI)) + VECCOPY(lv, lar->vec); + VecMulf(lv, -1.0f); + + if (shi->mat->vol.shade_type != MA_VOL_SHADE_NONE) { + Isect is; + + /* find minimum of volume bounds, or lamp coord */ + if (vol_get_bounds(shi, co, lv, hitco, &is, VOL_BOUNDS_SS)) { + float dist = VecLenf(co, hitco); + VlakRen *vlr = (VlakRen *)is.face; + + /* simple internal shadowing */ + if (vlr->mat->material_type == MA_TYPE_SURFACE) { + lacol[0] = lacol[1] = lacol[2] = 0.0f; + return; + } + + if (ELEM(lar->type, LA_SUN, LA_HEMI)) + /* infinite lights, can never be inside volume */ + atten_co = hitco; + else if ( lampdist < dist ) { + atten_co = lar->co; + } else + atten_co = hitco; + + vol_get_attenuation(shi, tr, co, atten_co, density, shade_stepsize); + + VecMulVecf(lacol, lacol, tr); + } + else { + /* Point is on the outside edge of the volume, + * therefore no attenuation, full transmission. + * Radiance from lamp remains unchanged */ + } + } + + p = vol_get_phasefunc(shi, shi->mat->vol.phasefunc_type, shi->mat->vol.phasefunc_g, shi->view, lv); + VecMulf(lacol, p); + + scatter_fac = vol_get_scattering_fac(shi, co); + VecMulf(lacol, scatter_fac); +} + +/* single scattering only for now */ +void vol_get_scattering(ShadeInput *shi, float *scatter_col, float *co, float stepsize, float density) +{ + ListBase *lights; + GroupObject *go; + LampRen *lar; + + scatter_col[0] = scatter_col[1] = scatter_col[2] = 0.f; + + lights= get_lights(shi); + for(go=lights->first; go; go= go->next) + { + float lacol[3] = {0.f, 0.f, 0.f}; + lar= go->lampren; + + if (lar) { + vol_shade_one_lamp(shi, co, lar, lacol, stepsize, density); + VecAddf(scatter_col, scatter_col, lacol); + } + } +} + + +/* +The main volumetric integrator, using an emission/absorption/scattering model. + +Incoming radiance = + +outgoing radiance from behind surface * beam transmittance/attenuation ++ added radiance from all points along the ray due to participating media + --> radiance for each segment = + (radiance added by scattering + radiance added by emission) * beam transmittance/attenuation +*/ +static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float *endco) +{ + float tr[3] = {1.0f, 1.0f, 1.0f}; + float radiance[3] = {0.f, 0.f, 0.f}, d_radiance[3] = {0.f, 0.f, 0.f}; + float stepsize = vol_get_stepsize(shi, STEPSIZE_VIEW); + int nsteps, s; + float emit_col[3], scatter_col[3] = {0.0, 0.0, 0.0}; + float stepvec[3], step_sta[3], step_end[3], step_mid[3]; + float density; + const float depth_cutoff = shi->mat->vol.depth_cutoff; + + /* ray marching */ + nsteps = (int)((VecLenf(co, endco) / stepsize) + 0.5); + + VecSubf(stepvec, endco, co); + VecMulf(stepvec, 1.0f / nsteps); + VecCopyf(step_sta, co); + VecAddf(step_end, step_sta, stepvec); + + /* get radiance from all points along the ray due to participating media */ + for (s = 0; s < nsteps; s++) { + + density = vol_get_density(shi, step_sta); + + /* there's only any use in shading here if there's actually some density to shade! */ + if (density > 0.01f) { + + /* transmittance component (alpha) */ + vol_get_attenuation_seg(shi, tr, stepsize, co, density); + + step_mid[0] = step_sta[0] + (stepvec[0] * 0.5); + step_mid[1] = step_sta[1] + (stepvec[1] * 0.5); + step_mid[2] = step_sta[2] + (stepvec[2] * 0.5); + + /* incoming light via emission or scattering (additive) */ + vol_get_emission(shi, emit_col, step_mid, density); + + if (shi->obi->volume_precache) + vol_get_precached_scattering(shi, scatter_col, step_mid); + else + vol_get_scattering(shi, scatter_col, step_mid, stepsize, density); + + VecMulf(scatter_col, density); + VecAddf(d_radiance, emit_col, scatter_col); + + /* Lv += Tr * (Lve() + Ld) */ + VecMulVecf(d_radiance, tr, d_radiance); + VecMulf(d_radiance, stepsize); + + VecAddf(radiance, radiance, d_radiance); + } + + VecCopyf(step_sta, step_end); + VecAddf(step_end, step_end, stepvec); + + /* luminance rec. 709 */ + if ((0.2126*tr[0] + 0.7152*tr[1] + 0.0722*tr[2]) < depth_cutoff) break; + } + + /* multiply original color (behind volume) with beam transmittance over entire distance */ + VecMulVecf(col, tr, col); + VecAddf(col, col, radiance); + + /* alpha <-- transmission luminance */ + col[3] = 1.0f -(0.2126*tr[0] + 0.7152*tr[1] + 0.0722*tr[2]); +} + +/* the main entry point for volume shading */ +static void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr, int inside_volume) +{ + float hitco[3], col[4] = {0.f,0.f,0.f,0.f}; + float *startco, *endco; + int trace_behind = 1; + const int ztransp= ((shi->depth==0) && (shi->mat->mode & MA_TRANSP) && (shi->mat->mode & MA_ZTRANSP)); + Isect is; + + /* check for shading an internal face a volume object directly */ + if (inside_volume == VOL_SHADE_INSIDE) + trace_behind = 0; + else if (inside_volume == VOL_SHADE_OUTSIDE) { + if (shi->flippednor) + inside_volume = VOL_SHADE_INSIDE; + } + + if (ztransp && inside_volume == VOL_SHADE_INSIDE) { + MatInside *mi; + int render_this=0; + + /* don't render the backfaces of ztransp volume materials. + + * volume shading renders the internal volume from between the + * near view intersection of the solid volume to the + * intersection on the other side, as part of the shading of + * the front face. + + * Because ztransp renders both front and back faces independently + * this will double up, so here we prevent rendering the backface as well, + * which would otherwise render the volume in between the camera and the backface + * --matt */ + + for (mi=R.render_volumes_inside.first; mi; mi=mi->next) { + /* weak... */ + if (mi->ma == shi->mat) render_this=1; + } + if (!render_this) return; + } + + + if (inside_volume == VOL_SHADE_INSIDE) + { + startco = shi->camera_co; + endco = shi->co; + + if (trace_behind) { + if (!ztransp) + /* trace behind the volume object */ + vol_trace_behind(shi, shi->vlr, endco, col); + } else { + /* we're tracing through the volume between the camera + * and a solid surface, so use that pre-shaded radiance */ + QUATCOPY(col, shr->combined); + } + + /* shade volume from 'camera' to 1st hit point */ + volumeintegrate(shi, col, startco, endco); + } + /* trace to find a backface, the other side bounds of the volume */ + /* (ray intersect ignores front faces here) */ + else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH)) + { + VlakRen *vlr = (VlakRen *)is.face; + + startco = shi->co; + endco = hitco; + + if (!ztransp) { + /* if it's another face in the same material */ + if (vlr->mat == shi->mat) { + /* trace behind the 2nd (raytrace) hit point */ + vol_trace_behind(shi, (VlakRen *)is.face, endco, col); + } else { + shade_intersection(shi, col, &is); + } + } + + /* shade volume from 1st hit point to 2nd hit point */ + volumeintegrate(shi, col, startco, endco); + } + + if (ztransp) + col[3] = col[3]>1.f?1.f:col[3]; + else + col[3] = 1.f; + + VecCopyf(shr->combined, col); + shr->alpha = col[3]; + + VECCOPY(shr->diff, shr->combined); +} + +/* Traces a shadow through the object, + * pretty much gets the transmission over a ray path */ +void shade_volume_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct Isect *last_is) +{ + float hitco[3]; + float tr[3] = {1.0,1.0,1.0}; + Isect is; + float shade_stepsize = vol_get_stepsize(shi, STEPSIZE_SHADE); + float *startco, *endco; + float density=0.f; + + memset(shr, 0, sizeof(ShadeResult)); + + /* if 1st hit normal is facing away from the camera, + * then we're inside the volume already. */ + if (shi->flippednor) { + startco = last_is->start; + endco = shi->co; + } + /* trace to find a backface, the other side bounds of the volume */ + /* (ray intersect ignores front faces here) */ + else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH)) { + startco = shi->co; + endco = hitco; + } + else { + shr->combined[0] = shr->combined[1] = shr->combined[2] = 0.f; + shr->alpha = shr->combined[3] = 1.f; + return; + } + + density = vol_get_density(shi, startco); + vol_get_attenuation(shi, tr, startco, endco, density, shade_stepsize); + + VecCopyf(shr->combined, tr); + shr->combined[3] = 1.0f -(0.2126*tr[0] + 0.7152*tr[1] + 0.0722*tr[2]); + shr->alpha = shr->combined[3]; +} + + +/* delivers a fully filled in ShadeResult, for all passes */ +void shade_volume_outside(ShadeInput *shi, ShadeResult *shr) +{ + memset(shr, 0, sizeof(ShadeResult)); + volume_trace(shi, shr, VOL_SHADE_OUTSIDE); +} + + +void shade_volume_inside(ShadeInput *shi, ShadeResult *shr) +{ + MatInside *m; + Material *mat_backup; + + //if (BLI_countlist(&R.render_volumes_inside) == 0) return; + + /* XXX: extend to multiple volumes perhaps later */ + mat_backup = shi->mat; + m = R.render_volumes_inside.first; + shi->mat = m->ma; + + volume_trace(shi, shr, VOL_SHADE_INSIDE); + + shi->mat = mat_backup; +}======= /** * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -686,3 +1375,4 @@ void shade_volume_inside(ShadeInput *shi, ShadeResult *shr) shi->mat = mat_backup; } +>>>>>>> .r22793 From 740752da12543c5d6183a6956ed4f439693ba288 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 26 Aug 2009 06:51:26 +0000 Subject: [PATCH 279/577] * Hopefully fix some weird merging business --- .../render/intern/include/volume_precache.h | 38 +- .../blender/render/intern/source/volumetric.c | 692 +----------------- 2 files changed, 2 insertions(+), 728 deletions(-) diff --git a/source/blender/render/intern/include/volume_precache.h b/source/blender/render/intern/include/volume_precache.h index 93620dc9bf4..9d87a219c82 100644 --- a/source/blender/render/intern/include/volume_precache.h +++ b/source/blender/render/intern/include/volume_precache.h @@ -1,4 +1,3 @@ -<<<<<<< .mine /** * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -31,39 +30,4 @@ void volume_precache(Render *re); void free_volume_precache(Render *re); int point_inside_volume_objectinstance(ObjectInstanceRen *obi, float *co); -#define VOL_MS_TIMESTEP 0.1f======= -/** - * - * ***** 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 ***** - */ - -void volume_precache(Render *re); -void free_volume_precache(Render *re); -int point_inside_volume_objectinstance(ObjectInstanceRen *obi, float *co); -int using_lightcache(Material *ma); - -#define VOL_MS_TIMESTEP 0.1f ->>>>>>> .r22793 +#define VOL_MS_TIMESTEP 0.1f \ No newline at end of file diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 441237dab79..046a145e9da 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -1,4 +1,3 @@ -<<<<<<< .mine /** * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -686,693 +685,4 @@ void shade_volume_inside(ShadeInput *shi, ShadeResult *shr) volume_trace(shi, shr, VOL_SHADE_INSIDE); shi->mat = mat_backup; -}======= -/** - * - * ***** 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 -#include -#include -#include - -#include "MEM_guardedalloc.h" - -#include "BLI_blenlib.h" -#include "BLI_arithb.h" -#include "BLI_rand.h" -#include "BLI_voxel.h" - -#include "RE_shader_ext.h" -#include "RE_raytrace.h" - -#include "DNA_material_types.h" -#include "DNA_group_types.h" -#include "DNA_lamp_types.h" - -#include "BKE_global.h" - -#include "render_types.h" -#include "pixelshading.h" -#include "shading.h" -#include "texture.h" -#include "volumetric.h" -#include "volume_precache.h" - -#if defined( _MSC_VER ) && !defined( __cplusplus ) -# define inline __inline -#endif // defined( _MSC_VER ) && !defined( __cplusplus ) - -/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ -/* defined in pipeline.c, is hardcopy of active dynamic allocated Render */ -/* only to be used here in this file, it's for speed */ -extern struct Render R; -/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ - - -/* tracing */ - -static int vol_get_bounds(ShadeInput *shi, float *co, float *vec, float *hitco, Isect *isect, int intersect_type) -{ - float maxsize = RE_ray_tree_max_size(R.raytree); - - /* XXX TODO - get raytrace max distance from object instance's bounding box */ - /* need to account for scaling only, but keep coords in camera space... - * below code is WIP and doesn't work! - VecSubf(bb_dim, shi->obi->obr->boundbox[1], shi->obi->obr->boundbox[2]); - Mat3MulVecfl(shi->obi->nmat, bb_dim); - maxsize = VecLength(bb_dim); - */ - - VECCOPY(isect->start, co); - isect->end[0] = co[0] + vec[0] * maxsize; - isect->end[1] = co[1] + vec[1] * maxsize; - isect->end[2] = co[2] + vec[2] * maxsize; - - isect->mode= RE_RAY_MIRROR; - isect->oborig= RAY_OBJECT_SET(&R, shi->obi); - isect->face_last= NULL; - isect->ob_last= 0; - isect->lay= -1; - - if (intersect_type == VOL_BOUNDS_DEPTH) isect->faceorig= (RayFace*)shi->vlr; - else if (intersect_type == VOL_BOUNDS_SS) isect->faceorig= NULL; - - if(RE_ray_tree_intersect(R.raytree, isect)) - { - hitco[0] = isect->start[0] + isect->labda*isect->vec[0]; - hitco[1] = isect->start[1] + isect->labda*isect->vec[1]; - hitco[2] = isect->start[2] + isect->labda*isect->vec[2]; - return 1; - } else { - return 0; - } -} - -static void shade_intersection(ShadeInput *shi, float *col, Isect *is) -{ - ShadeInput shi_new; - ShadeResult shr_new; - - memset(&shi_new, 0, sizeof(ShadeInput)); - - shi_new.mask= shi->mask; - shi_new.osatex= shi->osatex; - shi_new.thread= shi->thread; - shi_new.depth = shi->depth + 1; - shi_new.volume_depth= shi->volume_depth + 1; - shi_new.xs= shi->xs; - shi_new.ys= shi->ys; - shi_new.lay= shi->lay; - shi_new.passflag= SCE_PASS_COMBINED; /* result of tracing needs no pass info */ - shi_new.combinedflag= 0xFFFFFF; /* ray trace does all options */ - shi_new.light_override= shi->light_override; - shi_new.mat_override= shi->mat_override; - - VECCOPY(shi_new.camera_co, is->start); - - memset(&shr_new, 0, sizeof(ShadeResult)); - - /* hardcoded limit of 100 for now - prevents problems in weird geometry */ - if (shi->volume_depth < 100) { - shade_ray(is, &shi_new, &shr_new); - } - - VecCopyf(col, shr_new.combined); - col[3] = shr_new.alpha; -} - -static void vol_trace_behind(ShadeInput *shi, VlakRen *vlr, float *co, float *col) -{ - Isect isect; - float maxsize = RE_ray_tree_max_size(R.raytree); - - VECCOPY(isect.start, co); - isect.end[0] = isect.start[0] + shi->view[0] * maxsize; - isect.end[1] = isect.start[1] + shi->view[1] * maxsize; - isect.end[2] = isect.start[2] + shi->view[2] * maxsize; - - isect.faceorig= (RayFace *)vlr; - - isect.mode= RE_RAY_MIRROR; - isect.oborig= RAY_OBJECT_SET(&R, shi->obi); - isect.face_last= NULL; - isect.ob_last= 0; - isect.lay= -1; - - /* check to see if there's anything behind the volume, otherwise shade the sky */ - if(RE_ray_tree_intersect(R.raytree, &isect)) { - shade_intersection(shi, col, &isect); - } else { - shadeSkyView(col, co, shi->view, NULL, shi->thread); - shadeSunView(col, shi->view); - } -} - -/* input shader data */ - -float vol_get_stepsize(struct ShadeInput *shi, int context) -{ - if (shi->mat->vol.stepsize_type == MA_VOL_STEP_RANDOMIZED) { - /* range between 0.75 and 1.25 */ - const float rnd = 0.5f * BLI_thread_frand(shi->thread) + 0.75f; - - if (context == STEPSIZE_VIEW) - return shi->mat->vol.stepsize * rnd; - else if (context == STEPSIZE_SHADE) - return shi->mat->vol.shade_stepsize * rnd; - } - else { // MA_VOL_STEP_CONSTANT - - if (context == STEPSIZE_VIEW) - return shi->mat->vol.stepsize; - else if (context == STEPSIZE_SHADE) - return shi->mat->vol.shade_stepsize; - } - - return shi->mat->vol.stepsize; -} - -/* trilinear interpolation */ -static void vol_get_precached_scattering(ShadeInput *shi, float *scatter_col, float *co) -{ - VolumePrecache *vp = shi->obi->volume_precache; - float bbmin[3], bbmax[3], dim[3]; - float sample_co[3]; - - if (!vp) return; - - /* convert input coords to 0.0, 1.0 */ - VECCOPY(bbmin, shi->obi->obr->boundbox[0]); - VECCOPY(bbmax, shi->obi->obr->boundbox[1]); - VecSubf(dim, bbmax, bbmin); - - sample_co[0] = ((co[0] - bbmin[0]) / dim[0]); - sample_co[1] = ((co[1] - bbmin[1]) / dim[1]); - sample_co[2] = ((co[2] - bbmin[2]) / dim[2]); - - scatter_col[0] = voxel_sample_trilinear(vp->data_r, vp->res, sample_co); - scatter_col[1] = voxel_sample_trilinear(vp->data_g, vp->res, sample_co); - scatter_col[2] = voxel_sample_trilinear(vp->data_b, vp->res, sample_co); -} - -float vol_get_density(struct ShadeInput *shi, float *co) -{ - float density = shi->mat->vol.density; - float density_scale = shi->mat->vol.density_scale; - float col[3] = {0.0, 0.0, 0.0}; - - do_volume_tex(shi, co, MAP_DENSITY, col, &density); - - return density * density_scale; -} - -/* scattering multiplier, values above 1.0 are non-physical, - * but can be useful to tweak lighting */ -float vol_get_scattering_fac(ShadeInput *shi, float *co) -{ - float scatter = shi->mat->vol.scattering; - float col[3] = {0.0, 0.0, 0.0}; - - do_volume_tex(shi, co, MAP_SCATTERING, col, &scatter); - - return scatter; -} - -/* compute emission component, amount of radiance to add per segment - * can be textured with 'emit' */ -void vol_get_emission(ShadeInput *shi, float *emission_col, float *co, float density) -{ - float emission = shi->mat->vol.emission; - VECCOPY(emission_col, shi->mat->vol.emission_col); - - do_volume_tex(shi, co, MAP_EMISSION+MAP_EMISSION_COL, emission_col, &emission); - - emission_col[0] = emission_col[0] * emission * density; - emission_col[1] = emission_col[1] * emission * density; - emission_col[2] = emission_col[2] * emission * density; -} - -void vol_get_absorption(ShadeInput *shi, float *absorb_col, float *co) -{ - float absorption = shi->mat->vol.absorption; - VECCOPY(absorb_col, shi->mat->vol.absorption_col); - - do_volume_tex(shi, co, MAP_ABSORPTION+MAP_ABSORPTION_COL, absorb_col, &absorption); - - absorb_col[0] = (1.0f - absorb_col[0]) * absorption; - absorb_col[1] = (1.0f - absorb_col[1]) * absorption; - absorb_col[2] = (1.0f - absorb_col[2]) * absorption; -} - - -/* phase function - determines in which directions the light - * is scattered in the volume relative to incoming direction - * and view direction */ -float vol_get_phasefunc(ShadeInput *shi, short phasefunc_type, float g, float *w, float *wp) -{ - const float costheta = Inpf(w, wp); - const float scale = M_PI; - - /* - * Scale constant is required, since Blender's shading system doesn't normalise for - * energy conservation - eg. scaling by 1/pi for a lambert shader. - * This makes volumes darker than other solid objects, for the same lighting intensity. - * To correct this, scale up the phase function values - * until Blender's shading system supports this better. --matt - */ - - switch (phasefunc_type) { - case MA_VOL_PH_MIEHAZY: - return scale * (0.5f + 4.5f * powf(0.5 * (1.f + costheta), 8.f)) / (4.f*M_PI); - case MA_VOL_PH_MIEMURKY: - return scale * (0.5f + 16.5f * powf(0.5 * (1.f + costheta), 32.f)) / (4.f*M_PI); - case MA_VOL_PH_RAYLEIGH: - return scale * 3.f/(16.f*M_PI) * (1 + costheta * costheta); - case MA_VOL_PH_HG: - return scale * (1.f / (4.f * M_PI) * (1.f - g*g) / powf(1.f + g*g - 2.f * g * costheta, 1.5f)); - case MA_VOL_PH_SCHLICK: - { - const float k = 1.55f * g - .55f * g * g * g; - const float kcostheta = k * costheta; - return scale * (1.f / (4.f * M_PI) * (1.f - k*k) / ((1.f - kcostheta) * (1.f - kcostheta))); - } - case MA_VOL_PH_ISOTROPIC: - default: - return scale * (1.f / (4.f * M_PI)); - } -} - -/* Compute attenuation, otherwise known as 'optical thickness', extinction, or tau. - * Used in the relationship Transmittance = e^(-attenuation) - */ -void vol_get_attenuation_seg(ShadeInput *shi, float *transmission, float stepsize, float *co, float density) -{ - /* input density = density at co */ - float tau[3] = {0.f, 0.f, 0.f}; - float absorb_col[3]; - - vol_get_absorption(shi, absorb_col, co); - - /* homogenous volume within the sampled distance */ - tau[0] = stepsize * density * absorb_col[0]; - tau[1] = stepsize * density * absorb_col[1]; - tau[2] = stepsize * density * absorb_col[2]; - - transmission[0] *= exp(-tau[0]); - transmission[1] *= exp(-tau[1]); - transmission[2] *= exp(-tau[2]); -} - -/* Compute attenuation, otherwise known as 'optical thickness', extinction, or tau. - * Used in the relationship Transmittance = e^(-attenuation) - */ -void vol_get_attenuation(ShadeInput *shi, float *transmission, float *co, float *endco, float density, float stepsize) -{ - /* input density = density at co */ - float tau[3] = {0.f, 0.f, 0.f}; - float absorb_col[3]; - int s, nsteps; - float step_vec[3], step_sta[3], step_end[3]; - const float dist = VecLenf(co, endco); - - vol_get_absorption(shi, absorb_col, co); - - nsteps = (int)((dist / stepsize) + 0.5); - - VecSubf(step_vec, endco, co); - VecMulf(step_vec, 1.0f / nsteps); - - VecCopyf(step_sta, co); - VecAddf(step_end, step_sta, step_vec); - - for (s = 0; s < nsteps; s++) { - if (s > 0) - density = vol_get_density(shi, step_sta); - - tau[0] += stepsize * density; - tau[1] += stepsize * density; - tau[2] += stepsize * density; - - if (s < nsteps-1) { - VecCopyf(step_sta, step_end); - VecAddf(step_end, step_end, step_vec); - } - } - VecMulVecf(tau, tau, absorb_col); - - transmission[0] *= exp(-tau[0]); - transmission[1] *= exp(-tau[1]); - transmission[2] *= exp(-tau[2]); -} - -void vol_shade_one_lamp(struct ShadeInput *shi, float *co, LampRen *lar, float *lacol, float stepsize, float density) -{ - float visifac, lv[3], lampdist; - float tr[3]={1.0,1.0,1.0}; - float hitco[3], *atten_co; - float p; - float scatter_fac; - float shade_stepsize = vol_get_stepsize(shi, STEPSIZE_SHADE); - - if (lar->mode & LA_LAYER) if((lar->lay & shi->obi->lay)==0) return; - if ((lar->lay & shi->lay)==0) return; - if (lar->energy == 0.0) return; - - if ((visifac= lamp_get_visibility(lar, co, lv, &lampdist)) == 0.f) return; - - VecCopyf(lacol, &lar->r); - - if(lar->mode & LA_TEXTURE) { - shi->osatex= 0; - do_lamp_tex(lar, lv, shi, lacol, LA_TEXTURE); - } - - VecMulf(lacol, visifac*lar->energy); - - if (ELEM(lar->type, LA_SUN, LA_HEMI)) - VECCOPY(lv, lar->vec); - VecMulf(lv, -1.0f); - - if (shi->mat->vol.shade_type != MA_VOL_SHADE_NONE) { - Isect is; - - /* find minimum of volume bounds, or lamp coord */ - if (vol_get_bounds(shi, co, lv, hitco, &is, VOL_BOUNDS_SS)) { - float dist = VecLenf(co, hitco); - VlakRen *vlr = (VlakRen *)is.face; - - /* simple internal shadowing */ - if (vlr->mat->material_type == MA_TYPE_SURFACE) { - lacol[0] = lacol[1] = lacol[2] = 0.0f; - return; - } - - if (ELEM(lar->type, LA_SUN, LA_HEMI)) - /* infinite lights, can never be inside volume */ - atten_co = hitco; - else if ( lampdist < dist ) { - atten_co = lar->co; - } else - atten_co = hitco; - - vol_get_attenuation(shi, tr, co, atten_co, density, shade_stepsize); - - VecMulVecf(lacol, lacol, tr); - } - else { - /* Point is on the outside edge of the volume, - * therefore no attenuation, full transmission. - * Radiance from lamp remains unchanged */ - } - } - - p = vol_get_phasefunc(shi, shi->mat->vol.phasefunc_type, shi->mat->vol.phasefunc_g, shi->view, lv); - VecMulf(lacol, p); - - scatter_fac = vol_get_scattering_fac(shi, co); - VecMulf(lacol, scatter_fac); -} - -/* single scattering only for now */ -void vol_get_scattering(ShadeInput *shi, float *scatter_col, float *co, float stepsize, float density) -{ - ListBase *lights; - GroupObject *go; - LampRen *lar; - - scatter_col[0] = scatter_col[1] = scatter_col[2] = 0.f; - - lights= get_lights(shi); - for(go=lights->first; go; go= go->next) - { - float lacol[3] = {0.f, 0.f, 0.f}; - lar= go->lampren; - - if (lar) { - vol_shade_one_lamp(shi, co, lar, lacol, stepsize, density); - VecAddf(scatter_col, scatter_col, lacol); - } - } -} - - -/* -The main volumetric integrator, using an emission/absorption/scattering model. - -Incoming radiance = - -outgoing radiance from behind surface * beam transmittance/attenuation -+ added radiance from all points along the ray due to participating media - --> radiance for each segment = - (radiance added by scattering + radiance added by emission) * beam transmittance/attenuation -*/ -static void volumeintegrate(struct ShadeInput *shi, float *col, float *co, float *endco) -{ - float tr[3] = {1.0f, 1.0f, 1.0f}; - float radiance[3] = {0.f, 0.f, 0.f}, d_radiance[3] = {0.f, 0.f, 0.f}; - float stepsize = vol_get_stepsize(shi, STEPSIZE_VIEW); - int nsteps, s; - float emit_col[3], scatter_col[3] = {0.0, 0.0, 0.0}; - float stepvec[3], step_sta[3], step_end[3], step_mid[3]; - float density; - const float depth_cutoff = shi->mat->vol.depth_cutoff; - - /* ray marching */ - nsteps = (int)((VecLenf(co, endco) / stepsize) + 0.5); - - VecSubf(stepvec, endco, co); - VecMulf(stepvec, 1.0f / nsteps); - VecCopyf(step_sta, co); - VecAddf(step_end, step_sta, stepvec); - - /* get radiance from all points along the ray due to participating media */ - for (s = 0; s < nsteps; s++) { - - density = vol_get_density(shi, step_sta); - - /* there's only any use in shading here if there's actually some density to shade! */ - if (density > 0.01f) { - - /* transmittance component (alpha) */ - vol_get_attenuation_seg(shi, tr, stepsize, co, density); - - step_mid[0] = step_sta[0] + (stepvec[0] * 0.5); - step_mid[1] = step_sta[1] + (stepvec[1] * 0.5); - step_mid[2] = step_sta[2] + (stepvec[2] * 0.5); - - /* incoming light via emission or scattering (additive) */ - vol_get_emission(shi, emit_col, step_mid, density); - - if (using_lightcache(shi->mat)) { - vol_get_precached_scattering(shi, scatter_col, step_mid); - } else - vol_get_scattering(shi, scatter_col, step_mid, stepsize, density); - - VecMulf(scatter_col, density); - VecAddf(d_radiance, emit_col, scatter_col); - - /* Lv += Tr * (Lve() + Ld) */ - VecMulVecf(d_radiance, tr, d_radiance); - VecMulf(d_radiance, stepsize); - - VecAddf(radiance, radiance, d_radiance); - } - - VecCopyf(step_sta, step_end); - VecAddf(step_end, step_end, stepvec); - - /* luminance rec. 709 */ - if ((0.2126*tr[0] + 0.7152*tr[1] + 0.0722*tr[2]) < depth_cutoff) break; - } - - /* multiply original color (behind volume) with beam transmittance over entire distance */ - VecMulVecf(col, tr, col); - VecAddf(col, col, radiance); - - /* alpha <-- transmission luminance */ - col[3] = 1.0f -(0.2126*tr[0] + 0.7152*tr[1] + 0.0722*tr[2]); -} - -/* the main entry point for volume shading */ -static void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr, int inside_volume) -{ - float hitco[3], col[4] = {0.f,0.f,0.f,0.f}; - float *startco, *endco; - int trace_behind = 1; - const int ztransp= ((shi->depth==0) && (shi->mat->mode & MA_TRANSP) && (shi->mat->mode & MA_ZTRANSP)); - Isect is; - - /* check for shading an internal face a volume object directly */ - if (inside_volume == VOL_SHADE_INSIDE) - trace_behind = 0; - else if (inside_volume == VOL_SHADE_OUTSIDE) { - if (shi->flippednor) - inside_volume = VOL_SHADE_INSIDE; - } - - if (ztransp && inside_volume == VOL_SHADE_INSIDE) { - MatInside *mi; - int render_this=0; - - /* don't render the backfaces of ztransp volume materials. - - * volume shading renders the internal volume from between the - * near view intersection of the solid volume to the - * intersection on the other side, as part of the shading of - * the front face. - - * Because ztransp renders both front and back faces independently - * this will double up, so here we prevent rendering the backface as well, - * which would otherwise render the volume in between the camera and the backface - * --matt */ - - for (mi=R.render_volumes_inside.first; mi; mi=mi->next) { - /* weak... */ - if (mi->ma == shi->mat) render_this=1; - } - if (!render_this) return; - } - - - if (inside_volume == VOL_SHADE_INSIDE) - { - startco = shi->camera_co; - endco = shi->co; - - if (trace_behind) { - if (!ztransp) - /* trace behind the volume object */ - vol_trace_behind(shi, shi->vlr, endco, col); - } else { - /* we're tracing through the volume between the camera - * and a solid surface, so use that pre-shaded radiance */ - QUATCOPY(col, shr->combined); - } - - /* shade volume from 'camera' to 1st hit point */ - volumeintegrate(shi, col, startco, endco); - } - /* trace to find a backface, the other side bounds of the volume */ - /* (ray intersect ignores front faces here) */ - else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH)) - { - VlakRen *vlr = (VlakRen *)is.face; - - startco = shi->co; - endco = hitco; - - if (!ztransp) { - /* if it's another face in the same material */ - if (vlr->mat == shi->mat) { - /* trace behind the 2nd (raytrace) hit point */ - vol_trace_behind(shi, (VlakRen *)is.face, endco, col); - } else { - shade_intersection(shi, col, &is); - } - } - - /* shade volume from 1st hit point to 2nd hit point */ - volumeintegrate(shi, col, startco, endco); - } - - if (ztransp) - col[3] = col[3]>1.f?1.f:col[3]; - else - col[3] = 1.f; - - VecCopyf(shr->combined, col); - shr->alpha = col[3]; - - VECCOPY(shr->diff, shr->combined); -} - -/* Traces a shadow through the object, - * pretty much gets the transmission over a ray path */ -void shade_volume_shadow(struct ShadeInput *shi, struct ShadeResult *shr, struct Isect *last_is) -{ - float hitco[3]; - float tr[3] = {1.0,1.0,1.0}; - Isect is; - float shade_stepsize = vol_get_stepsize(shi, STEPSIZE_SHADE); - float *startco, *endco; - float density=0.f; - - memset(shr, 0, sizeof(ShadeResult)); - - /* if 1st hit normal is facing away from the camera, - * then we're inside the volume already. */ - if (shi->flippednor) { - startco = last_is->start; - endco = shi->co; - } - /* trace to find a backface, the other side bounds of the volume */ - /* (ray intersect ignores front faces here) */ - else if (vol_get_bounds(shi, shi->co, shi->view, hitco, &is, VOL_BOUNDS_DEPTH)) { - startco = shi->co; - endco = hitco; - } - else { - shr->combined[0] = shr->combined[1] = shr->combined[2] = 0.f; - shr->alpha = shr->combined[3] = 1.f; - return; - } - - density = vol_get_density(shi, startco); - vol_get_attenuation(shi, tr, startco, endco, density, shade_stepsize); - - VecCopyf(shr->combined, tr); - shr->combined[3] = 1.0f -(0.2126*tr[0] + 0.7152*tr[1] + 0.0722*tr[2]); - shr->alpha = shr->combined[3]; -} - - -/* delivers a fully filled in ShadeResult, for all passes */ -void shade_volume_outside(ShadeInput *shi, ShadeResult *shr) -{ - memset(shr, 0, sizeof(ShadeResult)); - volume_trace(shi, shr, VOL_SHADE_OUTSIDE); -} - - -void shade_volume_inside(ShadeInput *shi, ShadeResult *shr) -{ - MatInside *m; - Material *mat_backup; - - //if (BLI_countlist(&R.render_volumes_inside) == 0) return; - - /* XXX: extend to multiple volumes perhaps later */ - mat_backup = shi->mat; - m = R.render_volumes_inside.first; - shi->mat = m->ma; - - volume_trace(shi, shr, VOL_SHADE_INSIDE); - - shi->mat = mat_backup; -} ->>>>>>> .r22793 +} \ No newline at end of file From 7abb8c4bde4973ed84348c96102204abdf353187 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 26 Aug 2009 07:59:58 +0000 Subject: [PATCH 280/577] this was causing failed build when the file was missing --- source/creator/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 0d9d0fe8856..f563dec9575 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -139,7 +139,7 @@ IF(WITH_INSTALL) COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/site-packages COMMAND mkdir ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/site-packages # python needs it. - COMMAND rm ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/lib-dynload/_tkinter.so + COMMAND rm -f ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/lib-dynload/_tkinter.so COMMAND find ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION} -name "test" -prune -exec rm -rf {} "\;" COMMAND find ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION} -name "*.py?" -exec rm -rf {} "\;" COMMAND find ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION} -name "*.so"-exec strip -s {} "\;" From 36b85d4508106752b0595fcb5150fd19f90b8739 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Wed, 26 Aug 2009 08:09:29 +0000 Subject: [PATCH 281/577] Changed default audio device from SDL to OpenAL after a discussion in IRC, we're testing if OpenAL works flawlessly on all plattforms and if so we'll keep it as default device as it supports 3D Audio for the GE what SDL doesn't. --- source/blender/blenkernel/intern/sound.c | 13 +++---------- source/blender/blenloader/intern/readfile.c | 6 +++--- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index c6f9db6fda9..f6fb1ddcc5a 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -34,7 +34,7 @@ void sound_init() { AUD_Specs specs; - int device, buffersize, success; + int device, buffersize; device = U.audiodevice; buffersize = U.mixbufsize; @@ -54,15 +54,8 @@ void sound_init() if(specs.channels <= AUD_CHANNELS_INVALID) specs.channels = AUD_CHANNELS_STEREO; - if(!AUD_init(device, specs, buffersize)) { - if(device == AUD_SDL_DEVICE) - success= AUD_init(AUD_OPENAL_DEVICE, specs, AUD_DEFAULT_BUFFER_SIZE*4); - else - success= AUD_init(AUD_SDL_DEVICE, specs, AUD_DEFAULT_BUFFER_SIZE*4); - - if(!success) - AUD_init(AUD_NULL_DEVICE, specs, buffersize); - } + if(!AUD_init(device, specs, buffersize)) + AUD_init(AUD_NULL_DEVICE, specs, buffersize); } void sound_exit() diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index aaba65b21af..877f23aad92 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9675,13 +9675,13 @@ static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead) bfd->user->uifonts.first= bfd->user->uifonts.last= NULL; bfd->user->uistyles.first= bfd->user->uistyles.last= NULL; - // AUD_XXX + // AUD_XXX that's bad because if the user has saved No Audio, it changes to OpenAL always if(bfd->user->audiochannels == 0) bfd->user->audiochannels = 2; if(bfd->user->audiodevice == 0) - bfd->user->audiodevice = 1; + bfd->user->audiodevice = 2; if(bfd->user->audioformat == 0) - bfd->user->audioformat = 0x12; + bfd->user->audioformat = 0x24; if(bfd->user->audiorate == 0) bfd->user->audiorate = 44100; From adcb21b1f4b079f892e259446bab32c1bc74304f Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Wed, 26 Aug 2009 10:02:17 +0000 Subject: [PATCH 282/577] Close the old audio device before and not after opening the new. --- intern/audaspace/intern/AUD_C-API.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/intern/audaspace/intern/AUD_C-API.cpp b/intern/audaspace/intern/AUD_C-API.cpp index 9481e2139e8..995d4c5f99e 100644 --- a/intern/audaspace/intern/AUD_C-API.cpp +++ b/intern/audaspace/intern/AUD_C-API.cpp @@ -77,6 +77,9 @@ int AUD_init(AUD_DeviceType device, AUD_Specs specs, int buffersize) #endif AUD_IDevice* dev = NULL; + if(AUD_device) + AUD_exit(); + try { switch(device) @@ -107,9 +110,6 @@ int AUD_init(AUD_DeviceType device, AUD_Specs specs, int buffersize) return false; } - if(AUD_device) - AUD_exit(); - AUD_device = dev; if(AUD_device->checkCapability(AUD_CAPS_3D_DEVICE)) AUD_3ddevice = dynamic_cast(AUD_device); From 043ad7bc8e8e32161563798268727c1f42c9b3d6 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 26 Aug 2009 12:01:15 +0000 Subject: [PATCH 283/577] 2.5 - Grease Pencil Version 2 (Crude rebirth) This commit is the start of the new Grease Pencil implementation. I've just ported the old code to make it work with operators, and to store its data in Grease-Pencil datablocks. However, this is currently still really buggy, with only the barebones of the drawing/creation tools restored (no UI panels, no options). To use (not recommended), use D+S+move_mouse (and click when finished) for now. There are some rather serious event handling errors going on here... --- source/blender/blenloader/intern/readfile.c | 4 + source/blender/editors/gpencil/drawgpencil.c | 9 +- source/blender/editors/gpencil/gpencil_edit.c | 3 + .../blender/editors/gpencil/gpencil_intern.h | 14 +- source/blender/editors/gpencil/gpencil_ops.c | 68 + .../blender/editors/gpencil/gpencil_paint.c | 1296 +++++++++++++++++ source/blender/editors/include/ED_gpencil.h | 14 +- source/blender/editors/space_api/spacetypes.c | 4 +- .../editors/space_view3d/view3d_draw.c | 5 +- .../blender/editors/space_view3d/view3d_ops.c | 6 +- source/blender/makesdna/DNA_scene_types.h | 4 + 11 files changed, 1415 insertions(+), 12 deletions(-) create mode 100644 source/blender/editors/gpencil/gpencil_ops.c create mode 100644 source/blender/editors/gpencil/gpencil_paint.c diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 877f23aad92..913477198b8 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4042,6 +4042,7 @@ static void lib_link_scene(FileData *fd, Main *main) sce->world= newlibadr_us(fd, sce->id.lib, sce->world); sce->set= newlibadr(fd, sce->id.lib, sce->set); sce->ima= newlibadr_us(fd, sce->id.lib, sce->ima); + sce->gpd= newlibadr_us(fd, sce->id.lib, sce->gpd); link_paint(fd, sce, &sce->toolsettings->sculpt->paint); link_paint(fd, sce, &sce->toolsettings->vpaint->paint); @@ -10547,6 +10548,9 @@ static void expand_scene(FileData *fd, Main *mainvar, Scene *sce) if(sce->r.dometext) expand_doit(fd, mainvar, sce->gm.dome.warptext); + + if(sce->gpd) + expand_doit(fd, mainvar, sce->gpd); } static void expand_camera(FileData *fd, Main *mainvar, Camera *ca) diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index 735f1ffddb9..242be943507 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -933,7 +933,7 @@ void draw_gpencil_2dimage (bContext *C, ImBuf *ibuf) /* check that we have grease-pencil stuff to draw */ if (ELEM(NULL, sa, ibuf)) return; - gpd= gpencil_data_getactive(sa); + gpd= gpencil_data_getactive(C); if (gpd == NULL) return; /* calculate rect */ @@ -1007,7 +1007,7 @@ void draw_gpencil_2dview (bContext *C, short onlyv2d) /* check that we have grease-pencil stuff to draw */ if (sa == NULL) return; - gpd= gpencil_data_getactive(sa); + gpd= gpencil_data_getactive(C); if (gpd == NULL) return; /* draw it! */ @@ -1020,14 +1020,13 @@ void draw_gpencil_2dview (bContext *C, short onlyv2d) */ void draw_gpencil_3dview (bContext *C, short only3d) { - ScrArea *sa= CTX_wm_area(C); ARegion *ar= CTX_wm_region(C); Scene *scene= CTX_data_scene(C); bGPdata *gpd; int dflag = 0; /* check that we have grease-pencil stuff to draw */ - gpd= gpencil_data_getactive(sa); + gpd= gpencil_data_getactive(C); if (gpd == NULL) return; /* draw it! */ @@ -1047,7 +1046,7 @@ void draw_gpencil_oglrender (bContext *C) /* assume gpencil data comes from v3d */ if (v3d == NULL) return; - gpd= v3d->gpd; + gpd= gpencil_data_getactive(C); if (gpd == NULL) return; /* pass 1: draw 3d-strokes ------------ > */ diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index ef4e09274f2..4480da45572 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -25,6 +25,8 @@ * ***** END GPL LICENSE BLOCK ***** */ +#if 0 // XXX COMPILE GUARDS FOR OLD CODE + #include #include #include @@ -1697,3 +1699,4 @@ short gpencil_do_paint (bContext *C) } /* ************************************************** */ +#endif // XXX COMPILE GUARDS FOR OLD CODE diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h index 721d8544225..b134328c8a0 100644 --- a/source/blender/editors/gpencil/gpencil_intern.h +++ b/source/blender/editors/gpencil/gpencil_intern.h @@ -29,8 +29,20 @@ #define ED_GPENCIL_INTERN_H /* internal exports only */ + + +/* ***************************************************** */ +/* Operator Defines */ + +struct wmOperatorType; + +/* drawing ---------- */ + +void GPENCIL_OT_draw(struct wmOperatorType *ot); + + /******************************************************* */ -/* FILTERED ACTION DATA - TYPES */ +/* FILTERED ACTION DATA - TYPES ---> XXX DEPRECEATED OLD ANIM SYSTEM CODE! */ /* XXX - TODO: replace this with the modern bAnimListElem... */ /* This struct defines a structure used for quick access */ diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c new file mode 100644 index 00000000000..cb6d66b2fcc --- /dev/null +++ b/source/blender/editors/gpencil/gpencil_ops.c @@ -0,0 +1,68 @@ +/** + * $Id: gpencil_ops.c 21617 2009-07-16 04:45:52Z aligorith $ + * + * ***** 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) 2009, Blender Foundation, Joshua Leung + * This is a new part of Blender + * + * Contributor(s): Joshua Leung + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include +#include + +#include "BLI_blenlib.h" + +#include "DNA_windowmanager_types.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "RNA_access.h" +#include "RNA_define.h" +#include "RNA_enum_types.h" + +#include "gpencil_intern.h" + +/* ****************************************** */ +/* Generic Editing Keymap */ + +void gpencil_common_keymap(wmWindowManager *wm, ListBase *keymap) +{ + wmKeymapItem *km; + + /* if no keymap provided, use default */ + if (keymap == NULL) + keymap= WM_keymap_listbase(wm, "Grease Pencil Generic", 0, 0); + + /* Draw */ + WM_keymap_add_item(keymap, "GPENCIL_OT_draw", SKEY, KM_PRESS, 0, DKEY); +} + +/* ****************************************** */ + +void ED_operatortypes_gpencil (void) +{ + /* Drawing ----------------------- */ + WM_operatortype_append(GPENCIL_OT_draw); +} + +/* ****************************************** */ diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c new file mode 100644 index 00000000000..dc701924b3e --- /dev/null +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -0,0 +1,1296 @@ +/* Grease Pencil - version 2 + * By Joshua Leung + */ + +#include +#include +#include +#include +#include + +#include "MEM_guardedalloc.h" + +#include "BLI_blenlib.h" +#include "BLI_arithb.h" + +#include "BKE_gpencil.h" +#include "BKE_context.h" +#include "BKE_global.h" +#include "BKE_report.h" +#include "BKE_utildefines.h" + +#include "DNA_gpencil_types.h" +#include "DNA_action_types.h" +#include "DNA_object_types.h" +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_space_types.h" +#include "DNA_view2d_types.h" +#include "DNA_view3d_types.h" +#include "DNA_windowmanager_types.h" + +#include "UI_view2d.h" + +#include "ED_armature.h" +#include "ED_gpencil.h" +#include "ED_sequencer.h" +#include "ED_screen.h" +#include "ED_view3d.h" + +#include "RNA_access.h" +#include "RNA_define.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "gpencil_intern.h" + +/* ******************************************* */ +/* Context Wrangling... */ + +/* Get the active Grease Pencil datablock */ +// TODO: move this to a gpencil_utils.c? +bGPdata *gpencil_data_getactive (bContext *C) +{ + Scene *scene= CTX_data_scene(C); + ScrArea *sa= CTX_wm_area(C); + + /* if there's an active area, check if the particular editor may + * have defined any special Grease Pencil context for editing... + */ + if (sa) { + switch (sa->spacetype) { + case SPACE_VIEW3D: /* 3D-View */ + { + Object *ob= CTX_data_active_object(C); + + /* just in case... */ + if (ob) { + /* depending on the mode of the object, we may be able to get some GP data + * from different elements - i.e. bones... + */ + if (ob->mode & OB_MODE_POSE) { + //bPoseChannel *pchan= CTX_data_active_pchan(C); + + /* if posechannel has GP data, use that... */ + //if (pchan && pchan->gpd) + // return pchan->gpd; + } + + /* still here, so check if active Object has GP data */ + //if (ob->gpd) + // return ob->gpd; + } + } + break; + + case SPACE_NODE: /* Nodes Editor */ + { + //SpaceNode *snode= (SpaceNode *)CTX_wm_space_data(C); + + /* return the GP data for the active node block/node */ + } + break; + + case SPACE_SEQ: /* Sequencer */ + { + //SpaceSeq *sseq= (SpaceSeq *)CTX_wm_space_data(C); + + /* return the GP data for the active strips/image/etc. */ + } + break; + } + } + + /* just fall back on the scene's GP data */ + return (scene) ? scene->gpd : NULL; +} + + +/* check if context is suitable for drawing */ +static int gpencil_draw_poll (bContext *C) +{ + // TODO: must check context for Grease Pencil data... + return 1; +} + +/* ******************************************* */ +/* 'Globals' and Defines */ + +/* Temporary 'Stroke' Operation data */ +typedef struct tGPsdata { + Scene *scene; /* current scene from context */ + ScrArea *sa; /* area where painting originated */ + ARegion *ar; /* region where painting originated */ + View2D *v2d; /* needed for GP_STROKE_2DSPACE */ + +#if 0 // XXX review this 2d image stuff... + ImBuf *ibuf; /* needed for GP_STROKE_2DIMAGE */ + struct IBufViewSettings { + int offsx, offsy; /* offsets */ + int sizex, sizey; /* dimensions to use as scale-factor */ + } im2d_settings; /* needed for GP_STROKE_2DIMAGE */ +#endif + + bGPdata *gpd; /* gp-datablock layer comes from */ + bGPDlayer *gpl; /* layer we're working on */ + bGPDframe *gpf; /* frame we're working on */ + + short status; /* current status of painting */ + short paintmode; /* mode for painting */ + + int mval[2]; /* current mouse-position */ + int mvalo[2]; /* previous recorded mouse-position */ + + float pressure; /* current stylus pressure */ + float opressure; /* previous stylus pressure */ + + short radius; /* radius of influence for eraser */ + short flags; /* flags that can get set during runtime */ +} tGPsdata; + +/* values for tGPsdata->status */ +enum { + GP_STATUS_NORMAL = 0, /* running normally */ + GP_STATUS_ERROR, /* something wasn't correctly set up */ + GP_STATUS_DONE /* painting done */ +}; + +/* values for tGPsdata->paintmode */ +enum { + GP_PAINTMODE_DRAW = 0, + GP_PAINTMODE_ERASER +}; + +/* Return flags for adding points to stroke buffer */ +enum { + GP_STROKEADD_INVALID = -2, /* error occurred - insufficient info to do so */ + GP_STROKEADD_OVERFLOW = -1, /* error occurred - cannot fit any more points */ + GP_STROKEADD_NORMAL, /* point was successfully added */ + GP_STROKEADD_FULL /* cannot add any more points to buffer */ +}; + +/* Runtime flags */ +enum { + GP_PAINTFLAG_FIRSTRUN = (1<<0), /* operator just started */ + GP_PAINTFLAG_STRAIGHTLINES = (1<<1), /* only take the endpoints of a stroke */ +}; + +/* ------ */ + +/* maximum sizes of gp-session buffer */ +#define GP_STROKE_BUFFER_MAX 5000 + +/* Macros for accessing sensitivity thresholds... */ + /* minimum number of pixels mouse should move before new point created */ +#define MIN_MANHATTEN_PX (U.gp_manhattendist) + /* minimum length of new segment before new point can be added */ +#define MIN_EUCLIDEAN_PX (U.gp_euclideandist) + +/* macro to test if only converting endpoints - only for use when converting! */ +// XXX for now, don't test for editpaint too... +//#define GP_BUFFER2STROKE_ENDPOINTS ((gpd->flag & GP_DATA_EDITPAINT) && (p->flags & GP_PAINTFLAG_STRAIGHTLINES)) +#define GP_BUFFER2STROKE_ENDPOINTS ((p->flags & GP_PAINTFLAG_STRAIGHTLINES)) + +/* ------ */ +/* Forward defines for some functions... */ + +static void gp_session_validatebuffer(tGPsdata *p); + +/* ******************************************* */ +/* Calculations/Conversions */ + +/* Stroke Editing ---------------------------- */ + +/* check if the current mouse position is suitable for adding a new point */ +static short gp_stroke_filtermval (tGPsdata *p, int mval[2], int pmval[2]) +{ + int dx= abs(mval[0] - pmval[0]); + int dy= abs(mval[1] - pmval[1]); + + /* check if mouse moved at least certain distance on both axes (best case) */ + if ((dx > MIN_MANHATTEN_PX) && (dy > MIN_MANHATTEN_PX)) + return 1; + + /* check if the distance since the last point is significant enough */ + // future optimisation: sqrt here may be too slow? + else if (sqrt(dx*dx + dy*dy) > MIN_EUCLIDEAN_PX) + return 1; + + /* mouse 'didn't move' */ + else + return 0; +} + +/* convert screen-coordinates to buffer-coordinates */ +// XXX this method needs a total overhaul! +static void gp_stroke_convertcoords (tGPsdata *p, short mval[], float out[]) +{ + bGPdata *gpd= p->gpd; + + /* in 3d-space - pt->x/y/z are 3 side-by-side floats */ + if (gpd->sbuffer_sflag & GP_STROKE_3DSPACE) { + View3D *v3d= p->sa->spacedata.first; + const short mx=mval[0], my=mval[1]; + float *fp= give_cursor(p->scene, v3d); // XXX NULL could be v3d + float dvec[3]; + + /* Current method just converts each point in screen-coordinates to + * 3D-coordinates using the 3D-cursor as reference. In general, this + * works OK, but it could of course be improved. + * + * TODO: + * - investigate using nearest point(s) on a previous stroke as + * reference point instead or as offset, for easier stroke matching + * - investigate projection onto geometry (ala retopo) + */ + + /* method taken from editview.c - mouse_cursor() */ + project_short_noclip(p->ar, fp, mval); + window_to_3d_delta(p->ar, dvec, mval[0]-mx, mval[1]-my); + VecSubf(out, fp, dvec); + } + + /* 2d - on 'canvas' (assume that p->v2d is set) */ + else if ((gpd->sbuffer_sflag & GP_STROKE_2DSPACE) && (p->v2d)) { + float x, y; + + UI_view2d_region_to_view(p->v2d, mval[0], mval[1], &x, &y); + + out[0]= x; + out[1]= y; + } + +#if 0 + /* 2d - on image 'canvas' (assume that p->v2d is set) */ + else if (gpd->sbuffer_sflag & GP_STROKE_2DIMAGE) { + int sizex, sizey, offsx, offsy; + + /* get stored settings + * - assume that these have been set already (there are checks that set sane 'defaults' just in case) + */ + sizex= p->im2d_settings.sizex; + sizey= p->im2d_settings.sizey; + offsx= p->im2d_settings.offsx; + offsy= p->im2d_settings.offsy; + + /* calculate new points */ + out[0]= (float)(mval[0] - offsx) / (float)sizex; + out[1]= (float)(mval[1] - offsy) / (float)sizey; + } +#endif + + /* 2d - relative to screen (viewport area) */ + else { + out[0] = (float)(mval[0]) / (float)(p->sa->winx) * 1000; + out[1] = (float)(mval[1]) / (float)(p->sa->winy) * 1000; + } +} + +/* add current stroke-point to buffer (returns whether point was successfully added) */ +static short gp_stroke_addpoint (tGPsdata *p, int mval[2], float pressure) +{ + bGPdata *gpd= p->gpd; + tGPspoint *pt; + + /* check if still room in buffer */ + if (gpd->sbuffer_size >= GP_STROKE_BUFFER_MAX) + return GP_STROKEADD_OVERFLOW; + + /* get pointer to destination point */ + pt= ((tGPspoint *)(gpd->sbuffer) + gpd->sbuffer_size); + + /* store settings */ + pt->x= mval[0]; + pt->y= mval[1]; + pt->pressure= pressure; + + /* increment counters */ + gpd->sbuffer_size++; + + /* check if another operation can still occur */ + if (gpd->sbuffer_size == GP_STROKE_BUFFER_MAX) + return GP_STROKEADD_FULL; + else + return GP_STROKEADD_NORMAL; +} + +/* smooth a stroke (in buffer) before storing it */ +static void gp_stroke_smooth (tGPsdata *p) +{ + bGPdata *gpd= p->gpd; + int i=0, cmx=gpd->sbuffer_size; + + /* only smooth if smoothing is enabled, and we're not doing a straight line */ + if (!(U.gp_settings & GP_PAINT_DOSMOOTH) || GP_BUFFER2STROKE_ENDPOINTS) + return; + + /* don't try if less than 2 points in buffer */ + if ((cmx <= 2) || (gpd->sbuffer == NULL)) + return; + + /* apply weighting-average (note doing this along path sequentially does introduce slight error) */ + for (i=0; i < gpd->sbuffer_size; i++) { + tGPspoint *pc= (((tGPspoint *)gpd->sbuffer) + i); + tGPspoint *pb= (i-1 > 0)?(pc-1):(pc); + tGPspoint *pa= (i-2 > 0)?(pc-2):(pb); + tGPspoint *pd= (i+1 < cmx)?(pc+1):(pc); + tGPspoint *pe= (i+2 < cmx)?(pc+2):(pd); + + pc->x= (short)(0.1*pa->x + 0.2*pb->x + 0.4*pc->x + 0.2*pd->x + 0.1*pe->x); + pc->y= (short)(0.1*pa->y + 0.2*pb->y + 0.4*pc->y + 0.2*pd->y + 0.1*pe->y); + } +} + +/* simplify a stroke (in buffer) before storing it + * - applies a reverse Chaikin filter + * - code adapted from etch-a-ton branch (editarmature_sketch.c) + */ +static void gp_stroke_simplify (tGPsdata *p) +{ + bGPdata *gpd= p->gpd; + tGPspoint *old_points= (tGPspoint *)gpd->sbuffer; + short num_points= gpd->sbuffer_size; + short flag= gpd->sbuffer_sflag; + short i, j; + + /* only simplify if simlification is enabled, and we're not doing a straight line */ + if (!(U.gp_settings & GP_PAINT_DOSIMPLIFY) || GP_BUFFER2STROKE_ENDPOINTS) + return; + + /* don't simplify if less than 4 points in buffer */ + if ((num_points <= 2) || (old_points == NULL)) + return; + + /* clear buffer (but don't free mem yet) so that we can write to it + * - firstly set sbuffer to NULL, so a new one is allocated + * - secondly, reset flag after, as it gets cleared auto + */ + gpd->sbuffer= NULL; + gp_session_validatebuffer(p); + gpd->sbuffer_sflag = flag; + +/* macro used in loop to get position of new point + * - used due to the mixture of datatypes in use here + */ +#define GP_SIMPLIFY_AVPOINT(offs, sfac) \ + { \ + co[0] += (float)(old_points[offs].x * sfac); \ + co[1] += (float)(old_points[offs].y * sfac); \ + pressure += old_points[offs].pressure * sfac; \ + } + + for (i = 0, j = 0; i < num_points; i++) + { + if (i - j == 3) + { + float co[2], pressure; + int mco[2]; + + /* initialise values */ + co[0]= 0; + co[1]= 0; + pressure = 0; + + /* using macro, calculate new point */ + GP_SIMPLIFY_AVPOINT(j, -0.25f); + GP_SIMPLIFY_AVPOINT(j+1, 0.75f); + GP_SIMPLIFY_AVPOINT(j+2, 0.75f); + GP_SIMPLIFY_AVPOINT(j+3, -0.25f); + + /* set values for adding */ + mco[0]= (int)co[0]; + mco[1]= (int)co[1]; + + /* ignore return values on this... assume to be ok for now */ + gp_stroke_addpoint(p, mco, pressure); + + j += 2; + } + } + + /* free old buffer */ + MEM_freeN(old_points); +} + + +/* make a new stroke from the buffer data */ +static void gp_stroke_newfrombuffer (tGPsdata *p) +{ + bGPdata *gpd= p->gpd; + bGPDstroke *gps; + bGPDspoint *pt; + tGPspoint *ptc; + int i, totelem; + + /* get total number of points to allocate space for: + * - in 'Draw Mode', holding the Ctrl-Modifier will only take endpoints + * - otherwise, do whole stroke + */ + if (GP_BUFFER2STROKE_ENDPOINTS) + totelem = (gpd->sbuffer_size >= 2) ? 2: gpd->sbuffer_size; + else + totelem = gpd->sbuffer_size; + + /* exit with error if no valid points from this stroke */ + if (totelem == 0) { + if (G.f & G_DEBUG) + printf("Error: No valid points in stroke buffer to convert (tot=%d) \n", gpd->sbuffer_size); + return; + } + + /* allocate memory for a new stroke */ + gps= MEM_callocN(sizeof(bGPDstroke), "gp_stroke"); + + /* allocate enough memory for a continuous array for storage points */ + pt= gps->points= MEM_callocN(sizeof(bGPDspoint)*totelem, "gp_stroke_points"); + + /* copy appropriate settings for stroke */ + gps->totpoints= totelem; + gps->thickness= p->gpl->thickness; + gps->flag= gpd->sbuffer_sflag; + + /* copy points from the buffer to the stroke */ + if (GP_BUFFER2STROKE_ENDPOINTS) { + /* 'Draw Mode' + Ctrl-Modifier - only endpoints */ + { + /* first point */ + ptc= gpd->sbuffer; + + /* convert screen-coordinates to appropriate coordinates (and store them) */ + gp_stroke_convertcoords(p, &ptc->x, &pt->x); + + /* copy pressure */ + pt->pressure= ptc->pressure; + + pt++; + } + + if (totelem == 2) { + /* last point if applicable */ + ptc= ((tGPspoint *)gpd->sbuffer) + (gpd->sbuffer_size - 1); + + /* convert screen-coordinates to appropriate coordinates (and store them) */ + gp_stroke_convertcoords(p, &ptc->x, &pt->x); + + /* copy pressure */ + pt->pressure= ptc->pressure; + } + } + else { + /* convert all points (normal behaviour) */ + for (i=0, ptc=gpd->sbuffer; i < gpd->sbuffer_size && ptc; i++, ptc++) { + /* convert screen-coordinates to appropriate coordinates (and store them) */ + gp_stroke_convertcoords(p, &ptc->x, &pt->x); + + /* copy pressure */ + pt->pressure= ptc->pressure; + + pt++; + } + } + + /* add stroke to frame */ + BLI_addtail(&p->gpf->strokes, gps); +} + +/* --- 'Eraser' for 'Paint' Tool ------ */ + +/* eraser tool - remove segment from stroke/split stroke (after lasso inside) */ +static short gp_stroke_eraser_splitdel (bGPDframe *gpf, bGPDstroke *gps, int i) +{ + bGPDspoint *pt_tmp= gps->points; + bGPDstroke *gsn = NULL; + + /* if stroke only had two points, get rid of stroke */ + if (gps->totpoints == 2) { + /* free stroke points, then stroke */ + MEM_freeN(pt_tmp); + BLI_freelinkN(&gpf->strokes, gps); + + /* nothing left in stroke, so stop */ + return 1; + } + + /* if last segment, just remove segment from the stroke */ + else if (i == gps->totpoints - 2) { + /* allocate new points array, and assign most of the old stroke there */ + gps->totpoints--; + gps->points= MEM_callocN(sizeof(bGPDspoint)*gps->totpoints, "gp_stroke_points"); + memcpy(gps->points, pt_tmp, sizeof(bGPDspoint)*gps->totpoints); + + /* free temp buffer */ + MEM_freeN(pt_tmp); + + /* nothing left in stroke, so stop */ + return 1; + } + + /* if first segment, just remove segment from the stroke */ + else if (i == 0) { + /* allocate new points array, and assign most of the old stroke there */ + gps->totpoints--; + gps->points= MEM_callocN(sizeof(bGPDspoint)*gps->totpoints, "gp_stroke_points"); + memcpy(gps->points, pt_tmp + 1, sizeof(bGPDspoint)*gps->totpoints); + + /* free temp buffer */ + MEM_freeN(pt_tmp); + + /* no break here, as there might still be stuff to remove in this stroke */ + return 0; + } + + /* segment occurs in 'middle' of stroke, so split */ + else { + /* duplicate stroke, and assign 'later' data to that stroke */ + gsn= MEM_dupallocN(gps); + gsn->prev= gsn->next= NULL; + BLI_insertlinkafter(&gpf->strokes, gps, gsn); + + gsn->totpoints= gps->totpoints - i; + gsn->points= MEM_callocN(sizeof(bGPDspoint)*gsn->totpoints, "gp_stroke_points"); + memcpy(gsn->points, pt_tmp + i, sizeof(bGPDspoint)*gsn->totpoints); + + /* adjust existing stroke */ + gps->totpoints= i; + gps->points= MEM_callocN(sizeof(bGPDspoint)*gps->totpoints, "gp_stroke_points"); + memcpy(gps->points, pt_tmp, sizeof(bGPDspoint)*i); + + /* free temp buffer */ + MEM_freeN(pt_tmp); + + /* nothing left in stroke, so stop */ + return 1; + } +} + +/* eraser tool - check if part of stroke occurs within last segment drawn by eraser */ +static short gp_stroke_eraser_strokeinside (int mval[], int mvalo[], short rad, short x0, short y0, short x1, short y1) +{ + /* simple within-radius check for now */ + if (edge_inside_circle(mval[0], mval[1], rad, x0, y0, x1, y1)) + return 1; + + /* not inside */ + return 0; +} + +/* eraser tool - evaluation per stroke */ +// TODO: this could really do with some optimisation (KD-Tree/BVH?) +static void gp_stroke_eraser_dostroke (tGPsdata *p, int mval[], int mvalo[], short rad, rcti *rect, bGPDframe *gpf, bGPDstroke *gps) +{ + bGPDspoint *pt1, *pt2; + int x0=0, y0=0, x1=0, y1=0; + short xyval[2]; + int i; + + if (gps->totpoints == 0) { + /* just free stroke */ + if (gps->points) + MEM_freeN(gps->points); + BLI_freelinkN(&gpf->strokes, gps); + } + else if (gps->totpoints == 1) { + /* get coordinates */ + if (gps->flag & GP_STROKE_3DSPACE) { + project_short(p->ar, &gps->points->x, xyval); + x0= xyval[0]; + y0= xyval[1]; + } + else if (gps->flag & GP_STROKE_2DSPACE) { + UI_view2d_view_to_region(p->v2d, gps->points->x, gps->points->y, &x0, &y0); + } +#if 0 + else if (gps->flag & GP_STROKE_2DIMAGE) { + int offsx, offsy, sizex, sizey; + + /* get stored settings */ + sizex= p->im2d_settings.sizex; + sizey= p->im2d_settings.sizey; + offsx= p->im2d_settings.offsx; + offsy= p->im2d_settings.offsy; + + /* calculate new points */ + x0= (int)((gps->points->x * sizex) + offsx); + y0= (int)((gps->points->y * sizey) + offsy); + } +#endif + else { + x0= (int)(gps->points->x / 1000 * p->sa->winx); + y0= (int)(gps->points->y / 1000 * p->sa->winy); + } + + /* do boundbox check first */ + if (BLI_in_rcti(rect, x0, y0)) { + /* only check if point is inside */ + if ( ((x0-mval[0])*(x0-mval[0]) + (y0-mval[1])*(y0-mval[1])) <= rad*rad ) { + /* free stroke */ + MEM_freeN(gps->points); + BLI_freelinkN(&gpf->strokes, gps); + } + } + } + else { + /* loop over the points in the stroke, checking for intersections + * - an intersection will require the stroke to be split + */ + for (i=0; (i+1) < gps->totpoints; i++) { + /* get points to work with */ + pt1= gps->points + i; + pt2= gps->points + i + 1; + + /* get coordinates */ + if (gps->flag & GP_STROKE_3DSPACE) { + project_short(p->ar, &pt1->x, xyval); + x0= xyval[0]; + y0= xyval[1]; + + project_short(p->ar, &pt2->x, xyval); + x1= xyval[0]; + y1= xyval[1]; + } + else if (gps->flag & GP_STROKE_2DSPACE) { + UI_view2d_view_to_region(p->v2d, pt1->x, pt1->y, &x0, &y0); + + UI_view2d_view_to_region(p->v2d, pt2->x, pt2->y, &x1, &y1); + } +#if 0 + else if (gps->flag & GP_STROKE_2DIMAGE) { + int offsx, offsy, sizex, sizey; + + /* get stored settings */ + sizex= p->im2d_settings.sizex; + sizey= p->im2d_settings.sizey; + offsx= p->im2d_settings.offsx; + offsy= p->im2d_settings.offsy; + + /* calculate new points */ + x0= (int)((pt1->x * sizex) + offsx); + y0= (int)((pt1->y * sizey) + offsy); + + x1= (int)((pt2->x * sizex) + offsx); + y1= (int)((pt2->y * sizey) + offsy); + } +#endif + else { + x0= (int)(pt1->x / 1000 * p->sa->winx); + y0= (int)(pt1->y / 1000 * p->sa->winy); + x1= (int)(pt2->x / 1000 * p->sa->winx); + y1= (int)(pt2->y / 1000 * p->sa->winy); + } + + /* check that point segment of the boundbox of the eraser stroke */ + if (BLI_in_rcti(rect, x0, y0) || BLI_in_rcti(rect, x1, y1)) { + /* check if point segment of stroke had anything to do with + * eraser region (either within stroke painted, or on its lines) + * - this assumes that linewidth is irrelevant + */ + if (gp_stroke_eraser_strokeinside(mval, mvalo, rad, x0, y0, x1, y1)) { + /* if function returns true, break this loop (as no more point to check) */ + if (gp_stroke_eraser_splitdel(gpf, gps, i)) + break; + } + } + } + } +} + +/* erase strokes which fall under the eraser strokes */ +static void gp_stroke_doeraser (tGPsdata *p) +{ + bGPDframe *gpf= p->gpf; + bGPDstroke *gps, *gpn; + rcti rect; + + /* rect is rectangle of eraser */ + rect.xmin= p->mval[0] - p->radius; + rect.ymin= p->mval[1] - p->radius; + rect.xmax= p->mval[0] + p->radius; + rect.ymax= p->mval[1] + p->radius; + + /* loop over strokes, checking segments for intersections */ + for (gps= gpf->strokes.first; gps; gps= gpn) { + gpn= gps->next; + gp_stroke_eraser_dostroke(p, p->mval, p->mvalo, p->radius, &rect, gpf, gps); + } +} + +/* ******************************************* */ +/* Sketching Operator */ + +/* clear the session buffers (call this before AND after a paint operation) */ +static void gp_session_validatebuffer (tGPsdata *p) +{ + bGPdata *gpd= p->gpd; + + /* clear memory of buffer (or allocate it if starting a new session) */ + if (gpd->sbuffer) + memset(gpd->sbuffer, 0, sizeof(tGPspoint)*GP_STROKE_BUFFER_MAX); + else + gpd->sbuffer= MEM_callocN(sizeof(tGPspoint)*GP_STROKE_BUFFER_MAX, "gp_session_strokebuffer"); + + /* reset indices */ + gpd->sbuffer_size = 0; + + /* reset flags */ + gpd->sbuffer_sflag= 0; +} + +/* init new painting session */ +static tGPsdata *gp_session_initpaint (bContext *C) +{ + tGPsdata *p = NULL; + ScrArea *curarea= CTX_wm_area(C); + ARegion *ar= CTX_wm_region(C); + + /* make sure the active view (at the starting time) is a 3d-view */ + if (curarea == NULL) { + if (G.f & G_DEBUG) + printf("Error: No active view for painting \n"); + return NULL; + } + + /* create new context data */ + p= MEM_callocN(sizeof(tGPsdata), "GPencil Drawing Data"); + + /* pass on current scene */ + p->scene= CTX_data_scene(C); + + switch (curarea->spacetype) { + /* supported views first */ + case SPACE_VIEW3D: + { + //View3D *v3d= curarea->spacedata.first; + + /* set current area */ + p->sa= curarea; + p->ar= ar; + +#if 0 // XXX will this sort of antiquated stuff be restored? + /* check that gpencil data is allowed to be drawn */ + if ((v3d->flag2 & V3D_DISPGP)==0) { + p->status= GP_STATUS_ERROR; + if (G.f & G_DEBUG) + printf("Error: In active view, Grease Pencil not shown \n"); + return p; + } +#endif + } + break; +#if 0 // XXX these other spaces will come over time... + case SPACE_NODE: + { + SpaceNode *snode= curarea->spacedata.first; + + /* set current area */ + p->sa= curarea; + p->ar= ar; + p->v2d= &ar->v2d; + + /* check that gpencil data is allowed to be drawn */ + if ((snode->flag & SNODE_DISPGP)==0) { + p->status= GP_STATUS_ERROR; + if (G.f & G_DEBUG) + printf("Error: In active view, Grease Pencil not shown \n"); + return; + } + } + break; + case SPACE_SEQ: + { + SpaceSeq *sseq= curarea->spacedata.first; + + /* set current area */ + p->sa= curarea; + p->ar= ar; + p->v2d= &ar->v2d; + + /* check that gpencil data is allowed to be drawn */ + if (sseq->mainb == SEQ_DRAW_SEQUENCE) { + p->status= GP_STATUS_ERROR; + if (G.f & G_DEBUG) + printf("Error: In active view (sequencer), active mode doesn't support Grease Pencil \n"); + return; + } + if ((sseq->flag & SEQ_DRAW_GPENCIL)==0) { + p->status= GP_STATUS_ERROR; + if (G.f & G_DEBUG) + printf("Error: In active view, Grease Pencil not shown \n"); + return; + } + } + break; + case SPACE_IMAGE: + { + SpaceImage *sima= curarea->spacedata.first; + + /* set the current area */ + p->sa= curarea; + p->ar= ar; + p->v2d= &ar->v2d; + p->ibuf= BKE_image_get_ibuf(sima->image, &sima->iuser); + + /* check that gpencil data is allowed to be drawn */ + if ((sima->flag & SI_DISPGP)==0) { + p->status= GP_STATUS_ERROR; + if (G.f & G_DEBUG) + printf("Error: In active view, Grease Pencil not shown \n"); + return; + } + } + break; +#endif + /* unsupported views */ + default: + { + p->status= GP_STATUS_ERROR; + if (G.f & G_DEBUG) + printf("Error: Active view not appropriate for Grease Pencil drawing \n"); + return p; + } + break; + } + + /* get gp-data */ + p->gpd= gpencil_data_getactive(C); + if (p->gpd == NULL) { + /* add new GPencil block for the active scene for now... */ + p->gpd= gpencil_data_addnew("GPencil"); + p->scene->gpd= p->gpd; + } + + /* set edit flags */ + G.f |= G_GREASEPENCIL; + + /* set initial run flag */ + p->flags |= GP_PAINTFLAG_FIRSTRUN; + + /* clear out buffer (stored in gp-data), in case something contaminated it */ + gp_session_validatebuffer(p); + +#if 0 + /* set 'default' im2d_settings just in case something that uses this doesn't set it */ + p->im2d_settings.sizex= 1; + p->im2d_settings.sizey= 1; +#endif + + /* return context data for running paint operator */ + return p; +} + +/* cleanup after a painting session */ +static void gp_session_cleanup (tGPsdata *p) +{ + bGPdata *gpd= (p) ? p->gpd : NULL; + + /* error checking */ + if (gpd == NULL) + return; + + /* free stroke buffer */ + if (gpd->sbuffer) { + MEM_freeN(gpd->sbuffer); + gpd->sbuffer= NULL; + } + + /* clear flags */ + gpd->sbuffer_size= 0; + gpd->sbuffer_sflag= 0; +} + +/* init new stroke */ +static void gp_paint_initstroke (tGPsdata *p, short paintmode) +{ + /* get active layer (or add a new one if non-existent) */ + p->gpl= gpencil_layer_getactive(p->gpd); + if (p->gpl == NULL) + p->gpl= gpencil_layer_addnew(p->gpd); + if (p->gpl->flag & GP_LAYER_LOCKED) { + p->status= GP_STATUS_ERROR; + if (G.f & G_DEBUG) + printf("Error: Cannot paint on locked layer \n"); + return; + } + + /* get active frame (add a new one if not matching frame) */ + p->gpf= gpencil_layer_getframe(p->gpl, p->scene->r.cfra, 1); + if (p->gpf == NULL) { + p->status= GP_STATUS_ERROR; + if (G.f & G_DEBUG) + printf("Error: No frame created (gpencil_paint_init) \n"); + return; + } + else + p->gpf->flag |= GP_FRAME_PAINT; + + /* set 'eraser' for this stroke if using eraser */ + p->paintmode= paintmode; + if (p->paintmode == GP_PAINTMODE_ERASER) + p->gpd->sbuffer_sflag |= GP_STROKE_ERASER; + + /* check if points will need to be made in view-aligned space */ + // XXX this should be the default? this is something that needs review + /*if (p->gpd->flag & GP_DATA_VIEWALIGN)*/ { + switch (p->sa->spacetype) { + case SPACE_VIEW3D: + { + View3D *v3d= (View3D *)p->sa->spacedata.first; + RegionView3D *rv3d= p->ar->regiondata; + + // TODO: this should only happen for scene... otherwise use object center! + float *fp= give_cursor(p->scene, v3d); + initgrabz(rv3d, fp[0], fp[1], fp[2]); + + p->gpd->sbuffer_sflag |= GP_STROKE_3DSPACE; + } + break; +#if 0 // XXX other spacetypes to be restored in due course + case SPACE_NODE: + { + p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE; + } + break; + case SPACE_SEQ: + { + SpaceSeq *sseq= (SpaceSeq *)p->sa->spacedata.first; + int rectx, recty; + float zoom, zoomx, zoomy; + + /* set draw 2d-stroke flag */ + p->gpd->sbuffer_sflag |= GP_STROKE_2DIMAGE; + + /* calculate zoom factor */ + zoom= (float)(SEQ_ZOOM_FAC(sseq->zoom)); + if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) { + zoomx = zoom * ((float)p->scene->r.xasp / (float)p->scene->r.yasp); + zoomy = zoom; + } + else + zoomx = zoomy = zoom; + + /* calculate rect size to use to calculate the size of the drawing area + * - We use the size of the output image not the size of the ibuf being shown + * as it is too messy getting the ibuf (and could be too slow). This should be + * a reasonable for most cases anyway. + */ + rectx= (p->scene->r.size * p->scene->r.xsch) / 100; + recty= (p->scene->r.size * p->scene->r.ysch) / 100; + + /* set offset and scale values for opertations to use */ + p->im2d_settings.sizex= (int)(zoomx * rectx); + p->im2d_settings.sizey= (int)(zoomy * recty); + p->im2d_settings.offsx= (int)((p->sa->winx-p->im2d_settings.sizex)/2 + sseq->xof); + p->im2d_settings.offsy= (int)((p->sa->winy-p->im2d_settings.sizey)/2 + sseq->yof); + } + break; + case SPACE_IMAGE: + { + /* check if any ibuf available */ + if (p->ibuf) + p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE; + } + break; +#endif + } + } +} + +/* finish off a stroke (clears buffer, but doesn't finish the paint operation) */ +static void gp_paint_strokeend (tGPsdata *p) +{ + /* check if doing eraser or not */ + if ((p->gpd->sbuffer_sflag & GP_STROKE_ERASER) == 0) { + /* smooth stroke before transferring? */ + gp_stroke_smooth(p); + + /* simplify stroke before transferring? */ + gp_stroke_simplify(p); + + /* transfer stroke to frame */ + gp_stroke_newfrombuffer(p); + } + + /* clean up buffer now */ + gp_session_validatebuffer(p); +} + +/* finish off stroke painting operation */ +static void gp_paint_cleanup (tGPsdata *p) +{ + /* finish off a stroke */ + gp_paint_strokeend(p); + + /* "unlock" frame */ + p->gpf->flag &= ~GP_FRAME_PAINT; +} + +/* ------------------------------- */ + + +static int gpencil_draw_init (bContext *C, wmOperator *op) +{ + tGPsdata *p; + int paintmode= RNA_enum_get(op->ptr, "mode"); + + /* check context */ + p= op->customdata= gp_session_initpaint(C); + if ((p == NULL) || (p->status == GP_STATUS_ERROR)) { + /* something wasn't set correctly in context */ + gp_session_cleanup(p); + return 0; + } + + /* init painting data */ + gp_paint_initstroke(p, paintmode); + if (p->status == GP_STATUS_ERROR) { + gp_session_cleanup(p); + return 0; + } + + /* radius for eraser circle is defined in userprefs now */ + // TODO: make this more easily tweaked... + p->radius= U.gp_eraser; + + /* everything is now setup ok */ + return 1; +} + +/* ------------------------------- */ + +static void gpencil_draw_exit (bContext *C, wmOperator *op) +{ + tGPsdata *p= op->customdata; + + /* clear edit flags */ + G.f &= ~G_GREASEPENCIL; + + /* restore cursor to indicate end of drawing */ + // XXX (cursor callbacks in regiontype) setcursor_space(p.sa->spacetype, CURSOR_STD); + + /* check size of buffer before cleanup, to determine if anything happened here */ + if (p->paintmode == GP_PAINTMODE_ERASER) { + // TODO clear radial cursor thing + // XXX draw_sel_circle(NULL, p.mvalo, 0, p.radius, 0); + } + + /* cleanup */ + gp_paint_cleanup(p); + gp_session_cleanup(p); + + /* finally, free the temp data */ + MEM_freeN(p); + op->customdata= NULL; +} + +static int gpencil_draw_cancel (bContext *C, wmOperator *op) +{ + /* this is just a wrapper around exit() */ + gpencil_draw_exit(C, op); + return OPERATOR_CANCELLED; +} + +/* ------------------------------- */ + +static void gpencil_draw_apply_event (bContext *C, wmOperator *op, wmEvent *event) +{ + tGPsdata *p= op->customdata; + ARegion *ar= p->ar; + int tablet=0; + + /* convert from window-space to area-space mouse coordintes */ + // NOTE: float to ints conversions, +1 factor is probably used to ensure a bit more accurate rounding... + p->mval[0]= event->x - ar->winrct.xmin + 1; + p->mval[1]= event->y - ar->winrct.ymin + 1; + + /* handle pressure sensitivity (which is supplied by tablets) */ + if (event->custom == EVT_DATA_TABLET) { + wmTabletData *wmtab= event->customdata; + + tablet= (wmtab->Active != EVT_TABLET_NONE); + p->pressure= wmtab->Pressure; + //if (wmtab->Active == EVT_TABLET_ERASER) + // TODO... this should get caught by the keymaps which call drawing in the first place + } + else + p->pressure= 1.0f; + + /* special exception for start of strokes (i.e. maybe for just a dot) */ + if (p->flags & GP_PAINTFLAG_FIRSTRUN) { + p->flags &= ~GP_PAINTFLAG_FIRSTRUN; + + p->mvalo[0]= p->mval[0]; + p->mvalo[1]= p->mval[1]; + p->opressure= p->pressure; + + /* special exception here for too high pressure values on first touch in + * windows for some tablets, then we just skip first touch .. + */ + if (tablet && (p->pressure >= 0.99f)) + return; + } + + + /* handle drawing/erasing -> test for erasing first */ + if (p->paintmode == GP_PAINTMODE_ERASER) { + /* do 'live' erasing now */ + gp_stroke_doeraser(p); + + /* store used values */ + p->mvalo[0]= p->mval[0]; + p->mvalo[1]= p->mval[1]; + p->opressure= p->pressure; + } + /* only add current point to buffer if mouse moved (even though we got an event, it might be just noise) */ + else if (gp_stroke_filtermval(p, p->mval, p->mvalo)) { + /* try to add point */ + short ok= gp_stroke_addpoint(p, p->mval, p->pressure); + + /* handle errors while adding point */ + if ((ok == GP_STROKEADD_FULL) || (ok == GP_STROKEADD_OVERFLOW)) { + /* finish off old stroke */ + gp_paint_strokeend(p); + + /* start a new stroke, starting from previous point */ + gp_stroke_addpoint(p, p->mvalo, p->opressure); + ok= gp_stroke_addpoint(p, p->mval, p->pressure); + } + else if (ok == GP_STROKEADD_INVALID) { + /* the painting operation cannot continue... */ + BKE_report(op->reports, RPT_ERROR, "Cannot paint stroke"); + p->status = GP_STATUS_ERROR; + + if (G.f & G_DEBUG) + printf("Error: Grease-Pencil Paint - Add Point Invalid \n"); + // XXX break! + } + + /* store used values */ + p->mvalo[0]= p->mval[0]; + p->mvalo[1]= p->mval[1]; + p->opressure= p->pressure; + } + + /* force refresh */ + ED_area_tag_redraw(p->sa); // XXX this is crude +} + +/* ------------------------------- */ + +static int gpencil_draw_invoke (bContext *C, wmOperator *op, wmEvent *event) +{ + tGPsdata *p = NULL; + + printf("GPencil - Starting Drawing \n"); + + /* try to initialise context data needed while drawing */ + if (!gpencil_draw_init(C, op)) { + if (op->customdata) MEM_freeN(op->customdata); + printf("\tGP - no valid data \n"); + return OPERATOR_CANCELLED; + } + else + p= op->customdata; + + // TODO: set any additional settings that we can take from the events? + // TODO? if tablet is erasing, force eraser to be on? + + /* if eraser is on, draw radial aid */ + if (p->paintmode == GP_PAINTMODE_ERASER) { + // TODO: this involves mucking around with radial control, so we leave this for now.. + } + + printf("\tGP - set first spot\n"); + + /* handle the initial drawing - i.e. for just doing a simple dot */ + gpencil_draw_apply_event(C, op, event); + + /* add a modal handler for this operator, so that we can then draw continuous strokes */ + WM_event_add_modal_handler(C, &CTX_wm_window(C)->handlers, op); + return OPERATOR_RUNNING_MODAL; +} + +static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) +{ + tGPsdata *p= op->customdata; + + printf("\tGP - handle modal event...\n"); + + switch (event->type) { + /* moving mouse - assumed that mouse button is down */ + case MOUSEMOVE: + /* handle drawing event */ + printf("\t\tGP - add point\n"); + gpencil_draw_apply_event(C, op, event); + + /* finish painting operation if anything went wrong just now */ + if (p->status == GP_STATUS_ERROR) { + printf("\t\t\tGP - error done! \n"); + gpencil_draw_exit(C, op); + return OPERATOR_CANCELLED; + } + break; + + /* end of stroke - i.e. when a mouse-button release occurs */ + case LEFTMOUSE: + case MIDDLEMOUSE: + case RIGHTMOUSE: + printf("\t\tGP - end of stroke \n"); + gpencil_draw_exit(C, op); + return OPERATOR_FINISHED; + + /* scrolling mouse-wheel increases radius of eraser + * - though this is quite a difficult action to perform + */ + case WHEELUPMOUSE: + p->radius += 1.5f; + break; + case WHEELDOWNMOUSE: + p->radius -= 1.5f; + break; + + /* handle ctrl key - used to toggle straight-lines only (for drawing) */ + // XXX hardcoded keymap stuff + case LEFTCTRLKEY: + case RIGHTCTRLKEY: + if (event->val == KM_PRESS) + p->flags |= GP_PAINTFLAG_STRAIGHTLINES; + else if (event->val == KM_RELEASE) + p->flags &= ~GP_PAINTFLAG_STRAIGHTLINES; + break; + + default: + return OPERATOR_RUNNING_MODAL|OPERATOR_PASS_THROUGH; + break; + } + + return OPERATOR_RUNNING_MODAL; +} + +/* ------------------------------- */ + +static EnumPropertyItem prop_gpencil_drawmodes[] = { + {GP_PAINTMODE_DRAW, "DRAW", 0, "Draw", ""}, + {GP_PAINTMODE_ERASER, "ERASER", 0, "Eraser", ""}, + {0, NULL, 0, NULL, NULL} +}; + +void GPENCIL_OT_draw (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Grease Pencil Draw"; + ot->idname= "GPENCIL_OT_draw"; + ot->description= "Make annotations on the active data."; + + /* api callbacks */ + //ot->exec= gpencil_draw_exec; + ot->invoke= gpencil_draw_invoke; + ot->modal= gpencil_draw_modal; + ot->cancel= gpencil_draw_cancel; + ot->poll= gpencil_draw_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; + + /* settings for drawing */ + RNA_def_enum(ot->srna, "mode", prop_gpencil_drawmodes, 0, "Mode", "Way to intepret mouse movements."); +} diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h index ad8124c89d7..c1e37ce2e81 100644 --- a/source/blender/editors/include/ED_gpencil.h +++ b/source/blender/editors/include/ED_gpencil.h @@ -41,7 +41,7 @@ struct bGPDframe; struct bGPdata; struct uiBlock; struct ImBuf; - +struct wmWindowManager; /* ------------- Grease-Pencil Helpers -------------- */ @@ -52,9 +52,19 @@ typedef struct tGPspoint { float pressure; /* pressure of tablet at this point */ } tGPspoint; +/* ----------- Grease Pencil New Tools ------------- */ + +struct bGPdata *gpencil_data_getactive(struct bContext *C); + +/* ----------- Grease Pencil Operators ------------- */ + +void gpencil_common_keymap(struct wmWindowManager *wm, ListBase *keymap); + +void ED_operatortypes_gpencil(void); + /* ------------ Grease-Pencil Depreceated Stuff ------------------ */ -struct bGPdata *gpencil_data_getactive(struct ScrArea *sa); +//struct bGPdata *gpencil_data_getactive(struct ScrArea *sa); short gpencil_data_setactive(struct ScrArea *sa, struct bGPdata *gpd); struct ScrArea *gpencil_data_findowner(struct bGPdata *gpd); diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c index 041e6a09323..61b6fe391ae 100644 --- a/source/blender/editors/space_api/spacetypes.c +++ b/source/blender/editors/space_api/spacetypes.c @@ -42,6 +42,7 @@ #include "ED_anim_api.h" #include "ED_armature.h" #include "ED_curve.h" +#include "ED_gpencil.h" #include "ED_markers.h" #include "ED_mesh.h" #include "ED_object.h" @@ -83,7 +84,7 @@ void ED_spacetypes_init(void) /* register operator types for screen and all spaces */ ED_operatortypes_screen(); ED_operatortypes_anim(); - ED_operatortypes_animchannels(); // XXX have this as part of anim() ones instead? + ED_operatortypes_animchannels(); ED_operatortypes_object(); ED_operatortypes_mesh(); ED_operatortypes_sculpt(); @@ -97,6 +98,7 @@ void ED_spacetypes_init(void) ED_operatortypes_fluid(); ED_operatortypes_metaball(); ED_operatortypes_boids(); + ED_operatortypes_gpencil(); ui_view2d_operatortypes(); diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 905657910b8..07ffb35f807 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -78,6 +78,7 @@ #include "ED_armature.h" #include "ED_keyframing.h" +#include "ED_gpencil.h" #include "ED_mesh.h" #include "ED_screen.h" #include "ED_space_api.h" @@ -2082,8 +2083,8 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) } /* draw grease-pencil stuff */ -// if (v3d->flag2 & V3D_DISPGP) -// draw_gpencil_3dview(ar, 1); + //if (v3d->flag2 & V3D_DISPGP) + draw_gpencil_3dview(C, 1); BDR_drawSketch(C); diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index e9d1f6406b0..19a70834587 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -52,6 +52,7 @@ #include "WM_api.h" #include "WM_types.h" +#include "ED_gpencil.h" #include "ED_screen.h" #include "ED_transform.h" @@ -131,7 +132,10 @@ void view3d_keymap(wmWindowManager *wm) WM_keymap_add_item(keymap, "SKETCH_OT_draw_preview", MOUSEMOVE, KM_ANY, 0, 0); km = WM_keymap_add_item(keymap, "SKETCH_OT_draw_preview", MOUSEMOVE, KM_ANY, KM_CTRL, 0); RNA_boolean_set(km->ptr, "snap", 1); - + + /* grease pencil */ + gpencil_common_keymap(wm, keymap); // XXX + WM_keymap_verify_item(keymap, "VIEW3D_OT_manipulator", LEFTMOUSE, KM_PRESS, 0, 0); /* manipulator always on left mouse, not on action mouse*/ WM_keymap_verify_item(keymap, "VIEW3D_OT_cursor3d", ACTIONMOUSE, KM_PRESS, 0, 0); diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 9161157f597..20429120812 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -48,6 +48,7 @@ struct bNodeTree; struct AnimData; struct Editing; struct SceneStats; +struct bGPdata; typedef struct Base { struct Base *next, *prev; @@ -718,6 +719,9 @@ typedef struct Scene { /* Units */ struct UnitSettings unit; + + /* Grease Pencil */ + struct bGPdata *gpd; } Scene; From c97d964064bfb9d64e3f866f62095ccdc32a80fd Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 26 Aug 2009 12:51:27 +0000 Subject: [PATCH 284/577] - Add remove game properties now possible from the logic space properties panel. - PyDebugLine, utility function to run if the BGE crashes, you can see which python file and line called the C/C++ code. --- release/ui/space_logic.py | 13 ++-- source/blender/editors/object/object_edit.c | 69 +++++++++++++++++++ source/blender/editors/object/object_intern.h | 3 + source/blender/editors/object/object_ops.c | 3 + .../gameengine/Expressions/PyObjectPlus.cpp | 68 +++++++++--------- 5 files changed, 119 insertions(+), 37 deletions(-) diff --git a/release/ui/space_logic.py b/release/ui/space_logic.py index 68ddceb8534..f9920f78497 100644 --- a/release/ui/space_logic.py +++ b/release/ui/space_logic.py @@ -14,12 +14,17 @@ class LOGIC_PT_properties(bpy.types.Panel): ob = context.active_object game = ob.game - for prop in game.properties: - flow = layout.row() + for i, prop in enumerate(game.properties): + flow = layout.row(align=True) flow.itemR(prop, "name", text="") flow.itemR(prop, "type", text="") flow.itemR(prop, "value", text="") # we dont care about the type. rna will display correctly - flow.itemR(prop, "debug") + flow.itemR(prop, "debug", text="", toggle=True, icon='ICON_INFO') + flow.item_intO("object.game_property_remove", "index", i, text="", icon='ICON_X') + + flow = layout.row() + flow.itemO("object.game_property_new") + + bpy.types.register(LOGIC_PT_properties) - diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 3d2ddba3757..4b7d3474d98 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -7161,3 +7161,72 @@ void ED_object_toggle_modes(bContext *C, int mode) if(mode & OB_MODE_PARTICLE_EDIT) WM_operator_name_call(C, "PARTICLE_OT_particle_edit_toggle", WM_OP_EXEC_REGION_WIN, NULL); } + +/* game property ops */ + +static int game_property_new(bContext *C, wmOperator *op) +{ + Object *ob= CTX_data_active_object(C); + bProperty *prop; + + if(!ob) + return OPERATOR_CANCELLED; + + prop= new_property(PROP_FLOAT); + BLI_addtail(&ob->prop, prop); + unique_property(NULL, prop, 0); // make_unique_prop_names(prop->name); + + return OPERATOR_FINISHED; +} + + +void OBJECT_OT_game_property_new(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "New Game Property"; + ot->idname= "OBJECT_OT_game_property_new"; + + /* api callbacks */ + ot->exec= game_property_new; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int game_property_remove(bContext *C, wmOperator *op) +{ + Object *ob= CTX_data_active_object(C); + bProperty *prop; + int index; + + if(!ob) + return OPERATOR_CANCELLED; + + index = RNA_int_get(op->ptr, "index"); + + prop= BLI_findlink(&ob->prop, index); + + if(prop) { + BLI_remlink(&ob->prop, prop); + free_property(prop); + return OPERATOR_FINISHED; + } + else { + return OPERATOR_CANCELLED; + } +} + +void OBJECT_OT_game_property_remove(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Remove Game Property"; + ot->idname= "OBJECT_OT_game_property_remove"; + + /* api callbacks */ + ot->exec= game_property_remove; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "Property index to remove ", 0, INT_MAX); +} diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index 2f164102be2..82bbb34f59a 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -147,6 +147,9 @@ void OBJECT_OT_vertex_group_deselect(struct wmOperatorType *ot); void OBJECT_OT_vertex_group_copy_to_linked(struct wmOperatorType *ot); void OBJECT_OT_vertex_group_copy(struct wmOperatorType *ot); +void OBJECT_OT_game_property_new(struct wmOperatorType *ot); +void OBJECT_OT_game_property_remove(struct wmOperatorType *ot); + /* editkey.c */ void OBJECT_OT_shape_key_add(struct wmOperatorType *ot); void OBJECT_OT_shape_key_remove(struct wmOperatorType *ot); diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 239b162c14f..73dad7895a1 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -150,6 +150,9 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_vertex_group_copy_to_linked); WM_operatortype_append(OBJECT_OT_vertex_group_copy); + WM_operatortype_append(OBJECT_OT_game_property_new); + WM_operatortype_append(OBJECT_OT_game_property_remove); + WM_operatortype_append(OBJECT_OT_shape_key_add); WM_operatortype_append(OBJECT_OT_shape_key_remove); diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 5be703f0fa4..99c943d4f24 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -906,45 +906,47 @@ void PyObjectPlus::SetDeprecationWarnings(bool ignoreDeprecationWarnings) m_ignore_deprecation_warnings = ignoreDeprecationWarnings; } -void PyObjectPlus::ShowDeprecationWarning_func(const char* old_way,const char* new_way) +void PyDebugLine() { - { - printf("Method %s is deprecated, please use %s instead.\n", old_way, new_way); - - // import sys; print '\t%s:%d' % (sys._getframe(0).f_code.co_filename, sys._getframe(0).f_lineno) - - PyObject *getframe, *frame; - PyObject *f_lineno, *f_code, *co_filename; - - getframe = PySys_GetObject((char *)"_getframe"); // borrowed - if (getframe) { - frame = PyObject_CallObject(getframe, NULL); - if (frame) { - f_lineno= PyObject_GetAttrString(frame, "f_lineno"); - f_code= PyObject_GetAttrString(frame, "f_code"); - if (f_lineno && f_code) { - co_filename= PyObject_GetAttrString(f_code, "co_filename"); - if (co_filename) { - - printf("\t%s:%d\n", _PyUnicode_AsString(co_filename), (int)PyLong_AsSsize_t(f_lineno)); - - Py_DECREF(f_lineno); - Py_DECREF(f_code); - Py_DECREF(co_filename); - Py_DECREF(frame); - return; - } + // import sys; print '\t%s:%d' % (sys._getframe(0).f_code.co_filename, sys._getframe(0).f_lineno) + + PyObject *getframe, *frame; + PyObject *f_lineno, *f_code, *co_filename; + + getframe = PySys_GetObject((char *)"_getframe"); // borrowed + if (getframe) { + frame = PyObject_CallObject(getframe, NULL); + if (frame) { + f_lineno= PyObject_GetAttrString(frame, "f_lineno"); + f_code= PyObject_GetAttrString(frame, "f_code"); + if (f_lineno && f_code) { + co_filename= PyObject_GetAttrString(f_code, "co_filename"); + if (co_filename) { + + printf("\t%s:%d\n", _PyUnicode_AsString(co_filename), (int)PyLong_AsSsize_t(f_lineno)); + + Py_DECREF(f_lineno); + Py_DECREF(f_code); + Py_DECREF(co_filename); + Py_DECREF(frame); + return; } - - Py_XDECREF(f_lineno); - Py_XDECREF(f_code); - Py_DECREF(frame); } + Py_XDECREF(f_lineno); + Py_XDECREF(f_code); + Py_DECREF(frame); } - PyErr_Clear(); - printf("\tERROR - Could not access sys._getframe(0).f_lineno or sys._getframe().f_code.co_filename\n"); + } + PyErr_Clear(); + printf("\tERROR - Could not access sys._getframe(0).f_lineno or sys._getframe().f_code.co_filename\n"); +} + +void PyObjectPlus::ShowDeprecationWarning_func(const char* old_way,const char* new_way) +{ + printf("Method %s is deprecated, please use %s instead.\n", old_way, new_way); + PyDebugLine(); } void PyObjectPlus::ClearDeprecationWarning() From 47ce314bc5be90f63799c43805ef509c22d7fcf2 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Wed, 26 Aug 2009 14:19:29 +0000 Subject: [PATCH 285/577] 2.5 Sound: - Cleaned up DNA_sound_types.h, especially the bSound structure. - Fixed a caching bug. --- source/blender/blenkernel/intern/sequence.c | 2 +- source/blender/blenkernel/intern/sound.c | 67 ++++++----- source/blender/blenloader/intern/readfile.c | 8 +- .../editors/space_sequencer/sequencer_add.c | 4 +- .../editors/space_sequencer/sequencer_draw.c | 106 ------------------ source/blender/makesdna/DNA_sound_types.h | 93 +++++++-------- .../Converter/KX_ConvertActuators.cpp | 2 +- 7 files changed, 87 insertions(+), 195 deletions(-) diff --git a/source/blender/blenkernel/intern/sequence.c b/source/blender/blenkernel/intern/sequence.c index 159a60ad3af..c6b714c3125 100644 --- a/source/blender/blenkernel/intern/sequence.c +++ b/source/blender/blenkernel/intern/sequence.c @@ -570,7 +570,7 @@ void reload_sequence_new_file(Scene *scene, Sequence * seq) } seq->strip->len = seq->len; } else if (seq->type == SEQ_SOUND) { - seq->len = AUD_getInfo(seq->sound->snd_sound).length * FPS; + seq->len = AUD_getInfo(seq->sound->handle).length * FPS; seq->len -= seq->anim_startofs; seq->len -= seq->anim_endofs; if (seq->len < 0) { diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index f6fb1ddcc5a..070b5786a74 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -79,11 +79,11 @@ struct bSound* sound_new_file(struct Main *main, char* filename) sound = alloc_libblock(&main->sound, ID_SO, filename+len); strcpy(sound->name, filename); - sound->type = SOUND_TYPE_FILE; +// XXX unused currently sound->type = SOUND_TYPE_FILE; sound_load(main, sound); - if(!sound->snd_sound) + if(!sound->handle) { free_libblock(&main->sound, sound); sound = NULL; @@ -109,7 +109,7 @@ struct bSound* sound_new_buffer(struct bContext *C, struct bSound *source) sound_load(CTX_data_main(C), sound); - if(!sound->snd_sound) + if(!sound->handle) { free_libblock(&CTX_data_main(C)->sound, sound); sound = NULL; @@ -135,7 +135,7 @@ struct bSound* sound_new_limiter(struct bContext *C, struct bSound *source, floa sound_load(CTX_data_main(C), sound); - if(!sound->snd_sound) + if(!sound->handle) { free_libblock(&CTX_data_main(C)->sound, sound); sound = NULL; @@ -162,22 +162,25 @@ void sound_cache(struct bSound* sound, int ignore) if(sound->cache && !ignore) AUD_unload(sound->cache); - sound->cache = AUD_bufferSound(sound->snd_sound); + sound->cache = AUD_bufferSound(sound->handle); } void sound_load(struct Main *main, struct bSound* sound) { if(sound) { - if(sound->snd_sound) + if(sound->handle) { - AUD_unload(sound->snd_sound); - sound->snd_sound = NULL; + AUD_unload(sound->handle); + sound->handle = NULL; } +// XXX unused currently +#if 0 switch(sound->type) { case SOUND_TYPE_FILE: +#endif { char fullpath[FILE_MAX]; char *path; @@ -197,26 +200,25 @@ void sound_load(struct Main *main, struct bSound* sound) /* but we need a packed file then */ if (pf) - sound->snd_sound = AUD_loadBuffer((unsigned char*) pf->data, pf->size); + sound->handle = AUD_loadBuffer((unsigned char*) pf->data, pf->size); /* or else load it from disk */ else - sound->snd_sound = AUD_load(fullpath); + sound->handle = AUD_load(fullpath); + } // XXX +// XXX unused currently +#if 0 break; } case SOUND_TYPE_BUFFER: - if(sound->child_sound && sound->child_sound->snd_sound) - sound->snd_sound = AUD_bufferSound(sound->child_sound->snd_sound); + if(sound->child_sound && sound->child_sound->handle) + sound->handle = AUD_bufferSound(sound->child_sound->handle); break; case SOUND_TYPE_LIMITER: - if(sound->child_sound && sound->child_sound->snd_sound) - sound->snd_sound = AUD_limitSound(sound->child_sound, sound->start, sound->end); + if(sound->child_sound && sound->child_sound->handle) + sound->handle = AUD_limitSound(sound->child_sound, sound->start, sound->end); break; } - - if(sound->cache) - { - - } +#endif } } @@ -228,10 +230,10 @@ void sound_free(struct bSound* sound) sound->packedfile = NULL; } - if(sound->snd_sound) + if(sound->handle) { - AUD_unload(sound->snd_sound); - sound->snd_sound = NULL; + AUD_unload(sound->handle); + sound->handle = NULL; } } @@ -241,20 +243,23 @@ void sound_unlink(struct bContext *C, struct bSound* sound) Scene *scene; SoundHandle *handle; +// XXX unused currently +#if 0 for(snd = CTX_data_main(C)->sound.first; snd; snd = snd->id.next) { if(snd->child_sound == sound) { snd->child_sound = NULL; - if(snd->snd_sound) + if(snd->handle) { - AUD_unload(sound->snd_sound); - snd->snd_sound = NULL; + AUD_unload(sound->handle); + snd->handle = NULL; } sound_unlink(C, snd); } } +#endif for(scene = CTX_data_main(C)->scene.first; scene; scene = scene->id.next) { @@ -372,9 +377,9 @@ void sound_update_playing(struct bContext *C) { if(handle->state == AUD_STATUS_INVALID) { - if(handle->source && handle->source->snd_sound) + if(handle->source && handle->source->handle) { - AUD_Sound* limiter = AUD_limitSound(handle->source->cache ? handle->source->cache : handle->source->snd_sound, handle->frameskip / fps, (handle->frameskip + handle->endframe - handle->startframe)/fps); + AUD_Sound* limiter = AUD_limitSound(handle->source->cache ? handle->source->cache : handle->source->handle, handle->frameskip / fps, (handle->frameskip + handle->endframe - handle->startframe)/fps); handle->handle = AUD_play(limiter, 1); AUD_unload(limiter); if(handle->handle) @@ -413,10 +418,10 @@ void sound_scrub(struct bContext *C) { if(cfra >= handle->startframe && cfra < handle->endframe && !handle->mute) { - if(handle->source && handle->source->snd_sound) + if(handle->source && handle->source->handle) { int frameskip = handle->frameskip + cfra - handle->startframe; - AUD_Sound* limiter = AUD_limitSound(handle->source->cache ? handle->source->cache : handle->source->snd_sound, frameskip / fps, (frameskip + 1)/fps); + AUD_Sound* limiter = AUD_limitSound(handle->source->cache ? handle->source->cache : handle->source->handle, frameskip / fps, (frameskip + 1)/fps); AUD_play(limiter, 0); AUD_unload(limiter); } @@ -439,7 +444,7 @@ AUD_Device* sound_mixdown(struct Scene *scene, AUD_Specs specs, int start, int e for(handle = scene->sound_handles.first; handle; handle = handle->next) { - if(start < handle->endframe && end > handle->startframe && !handle->mute && handle->source && handle->source->snd_sound) + if(start < handle->endframe && end > handle->startframe && !handle->mute && handle->source && handle->source->handle) { frameskip = handle->frameskip; s = handle->startframe - start; @@ -451,7 +456,7 @@ AUD_Device* sound_mixdown(struct Scene *scene, AUD_Specs specs, int start, int e s = 0; } - limiter = AUD_limitSound(handle->source->snd_sound, frameskip / fps, e / fps); + limiter = AUD_limitSound(handle->source->handle, frameskip / fps, e / fps); delayer = AUD_delaySound(limiter, s / fps); AUD_playDevice(mixdown, delayer); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 913477198b8..6771135a772 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5061,10 +5061,13 @@ static void fix_relpaths_library(const char *basepath, Main *main) static void direct_link_sound(FileData *fd, bSound *sound) { - sound->snd_sound = NULL; + sound->handle = NULL; sound->packedfile = direct_link_packedfile(fd, sound->packedfile); sound->newpackedfile = direct_link_packedfile(fd, sound->newpackedfile); + + if(sound->cache) + sound_cache(sound, 1); } static void lib_link_sound(FileData *fd, Main *main) @@ -5076,8 +5079,7 @@ static void lib_link_sound(FileData *fd, Main *main) if(sound->id.flag & LIB_NEEDLINK) { sound->id.flag -= LIB_NEEDLINK; sound->ipo= newlibadr_us(fd, sound->id.lib, sound->ipo); // XXX depreceated - old animation system - sound->stream = 0; - + sound_load(main, sound); } sound= sound->id.next; diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index bdedef4b6c8..e6d50976957 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -242,13 +242,13 @@ static Sequence* sequencer_add_sound_strip(bContext *C, wmOperator *op, int star sound = sound_new_file(CTX_data_main(C), filename); - if (sound==NULL || sound->snd_sound == NULL) { + if (sound==NULL || sound->handle == NULL) { if(op) BKE_report(op->reports, RPT_ERROR, "Unsupported audio format"); return NULL; } - info = AUD_getInfo(sound->snd_sound); + info = AUD_getInfo(sound->handle); if (info.specs.format == AUD_FORMAT_INVALID) { sound_delete(C, sound); diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 367bfb68208..76bed3772b1 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -225,108 +225,6 @@ static void drawmeta_contents(Scene *scene, Sequence *seqm, float x1, float y1, } } -static void drawseqwave(Scene *scene, View2D *v2d, Sequence *seq, float x1, float y1, float x2, float y2, int winx) -{ - /* - x1 is the starting x value to draw the wave, - x2 the end x value, same for y1 and y2 - winx is the zoom level. - */ - - float - f, /* floating point value used to store the X draw location for the wave lines when openGL drawing*/ - midy, /* fast access to the middle location (y1+y2)/2 */ - clipxmin, /* the minimum X value, clip this with the window */ - clipxmax, /* the maximum X value, clip this with the window */ - sample_step, /* steps to move per sample, floating value must later translate into an int */ - fsofs, /* steps to move per sample, floating value must later translate into an int */ - feofs_sofs, /* */ - sound_width, /* convenience: x2-x1 */ - wavemulti; /* scale the samples by this value when GL_LINE drawing so it renders the right height */ - - int - offset, /* initial offset value for the wave drawing */ - offset_next, /* when in the wave drawing loop this value is the samples intil the next vert */ - sofs, /* Constrained offset value (~3) for the wave, start */ - eofs, /* ditto, end */ - wavesample, /* inner loop storage if the current wave sample value, used to make the 2 values below */ - wavesamplemin, /* used for finding the min and max wave peaks */ - wavesamplemax, /* ditto */ - subsample_step=4; /* when the sample step is 4 every sample of - the wave is evaluated for min and max values used to draw the wave, - however this is slow ehrn zoomed out so when the sample step is above - 1 (the larger the further out the zoom is) so not evaluate all samples, only some. */ - - signed short* s; - bSound *sound; - uint8_t *stream; - -// XXX audio_makestream(seq->sound); - if(seq->sound==NULL || seq->sound->stream==NULL) return; - - if (seq->flag & SEQ_MUTE) glColor3ub(0x70, 0x80, 0x80); else glColor3ub(0x70, 0xc0, 0xc0); - - sofs = ((int)( FRA2TIME(seq->startdisp-seq->start+seq->anim_startofs)*(float)scene->r.audio.mixrate*4.0 )) & (~3); - eofs = ((int)( FRA2TIME(seq->enddisp-seq->start+seq->anim_startofs)*(float)scene->r.audio.mixrate*4.0 )) & (~3); - - /* clip the drawing area to the screen bounds to save time */ - sample_step= (v2d->cur.xmax - v2d->cur.xmin)/winx; - clipxmin= MAX2(x1, v2d->cur.xmin); - clipxmax= MIN2(x2, v2d->cur.xmax); - - if (sample_step > 1) - subsample_step= ((int)(subsample_step*sample_step*8)) & (~3); - - /* for speedy access */ - midy = (y1+y2)/2; - fsofs= (float)sofs; - feofs_sofs= (float)(eofs-sofs); - sound_width= x2-x1; - sound = seq->sound; - stream = sound->stream; - wavemulti = (y2-y1)/196605; /*y2-y1 is the height*/ - wavesample=0; - - /* we need to get the starting offset value, excuse the duplicate code */ - f=clipxmin; - offset= (int) (fsofs + ((f-x1)/sound_width) * feofs_sofs) & (~3); - - /* start the loop, draw a line per sample_step -sample_step is about 1 line drawn per pixel */ - glBegin(GL_LINES); - for (f=x1+sample_step; f<=clipxmax; f+=sample_step) { - - offset_next = (int) (fsofs + ((f-x1)/sound_width) * feofs_sofs) & (~3); - if (f > v2d->cur.xmin) { - /* if this is close to the last sample just exit */ - if (offset_next >= sound->streamlen) break; - - wavesamplemin = 131070; - wavesamplemax = -131070; - - /*find with high and low of the waveform for this draw, - evaluate small samples to find this range */ - while (offset < offset_next) { - s = (signed short*)(stream+offset); - - wavesample = s[0]*2 + s[1]; - if (wavesamplemin>wavesample) - wavesamplemin=wavesample; - if (wavesamplemaxtype == SEQ_SOUND) - drawseqwave(scene, v2d, seq, x1, y1, x2, y2, ar->winx); - if (!is_single_image) draw_seq_extensions(scene, sseq, seq); diff --git a/source/blender/makesdna/DNA_sound_types.h b/source/blender/makesdna/DNA_sound_types.h index 5f6ebf60865..55b48e4aacd 100644 --- a/source/blender/makesdna/DNA_sound_types.h +++ b/source/blender/makesdna/DNA_sound_types.h @@ -70,57 +70,59 @@ typedef struct Sound3D typedef struct bSound { ID id; - char name[160]; - void *stream; // AUD_XXX deprecated - struct PackedFile *packedfile; - struct PackedFile *newpackedfile; // AUD_XXX deprecated - void *snd_sound; // AUD_XXX used for AUD_Sound now - struct Ipo *ipo; // AUD_XXX deprecated - float volume, panning; // AUD_XXX deprecated - /** - * Sets the rollofffactor. The rollofffactor is a per-Source parameter - * the application can use to increase or decrease the range of a source - * by decreasing or increasing the attenuation, respectively. The default - * value is 1. The implementation is free to optimize for a rollofffactor - * value of 0, which indicates that the application does not wish any - * distance attenuation on the respective Source. - */ - float attenuation; // AUD_XXX deprecated - float pitch; // AUD_XXX deprecated - /** - * min_gain indicates the minimal gain which is always guaranteed for this sound - */ - float min_gain; // AUD_XXX deprecated - /** - * max_gain indicates the maximal gain which is always guaranteed for this sound - */ - float max_gain; // AUD_XXX deprecated - /** - * Sets the referencedistance at which the listener will experience gain. - */ - float distance; // AUD_XXX deprecated - int flags; // AUD_XXX deprecated - int streamlen; // AUD_XXX deprecated - char channels; // AUD_XXX deprecated - char highprio; // AUD_XXX deprecated - char pad[10]; // AUD_XXX deprecated - // AUD_XXX NEW - int type; + /** + * The path to the sound file. + */ + char name[160]; + + /** + * The packed file. + */ + struct PackedFile *packedfile; + + /** + * The handle for audaspace. + */ + void *handle; + + /** + * Deprecated; used for loading pre 2.5 files. + */ + struct PackedFile *newpackedfile; + struct Ipo *ipo; + float volume; + float attenuation; + float pitch; + float min_gain; + float max_gain; + float distance; + int flags; + +/** currently int type; + struct bSound *child_sound;*/ + + /** + * Whether the sound has been changed and must be restarted if playing. + */ int changed; - struct bSound *child_sound; + + /** + * The audaspace handle for cache. + */ void *cache; - // SOUND_TYPE_LIMITER - float start, end; +/** XXX unused currently // SOUND_TYPE_LIMITER + float start, end;*/ } bSound; +/* XXX unused currently typedef enum eSound_Type { SOUND_TYPE_INVALID = -1, SOUND_TYPE_FILE = 0, SOUND_TYPE_BUFFER, SOUND_TYPE_LIMITER -} eSound_Type; +} eSound_Type;*/ /* spacesound->flag */ #define SND_DRAWFRAMES 1 @@ -142,18 +144,7 @@ typedef struct SpaceSound { int pad2; } SpaceSound; - -#define SOUND_CHANNELS_STEREO 0 -#define SOUND_CHANNELS_LEFT 1 -#define SOUND_CHANNELS_RIGHT 2 - -#define SOUND_FLAGS_LOOP (1 << 0) -#define SOUND_FLAGS_FIXED_VOLUME (1 << 1) -#define SOUND_FLAGS_FIXED_PANNING (1 << 2) #define SOUND_FLAGS_3D (1 << 3) -#define SOUND_FLAGS_BIDIRECTIONAL_LOOP (1 << 4) -#define SOUND_FLAGS_PRIORITY (1 << 5) -#define SOUND_FLAGS_SEQUENCE (1 << 6) /* to DNA_sound_types.h*/ diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index 07f6f628e06..91a39bd7686 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -396,7 +396,7 @@ void BL_ConvertActuators(char* maggiename, "\" has no sound datablock." << std::endl; } else - snd_sound = sound->cache ? sound->cache : sound->snd_sound; + snd_sound = sound->cache ? sound->cache : sound->handle; KX_SoundActuator* tmpsoundact = new KX_SoundActuator(gameobj, snd_sound, From 6badfa583671cea43e6617e5485c56558ff3ec14 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Wed, 26 Aug 2009 15:13:58 +0000 Subject: [PATCH 286/577] 2.5 Scene RNA: * Added RNA for Render Baking. Missing: Bake Operator and property "Quad Split Order". --- source/blender/makesrna/intern/rna_scene.c | 81 +++++++++++++++++++++- 1 file changed, 79 insertions(+), 2 deletions(-) diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 209c771834d..86ceee55f47 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -32,6 +32,9 @@ #include "DNA_scene_types.h" #include "DNA_userdef_types.h" +/* Include for Bake Options */ +#include "RE_pipeline.h" + #ifdef WITH_FFMPEG #include "BKE_writeffmpeg.h" #include @@ -1110,6 +1113,30 @@ static void rna_def_scene_render_data(BlenderRNA *brna) {R_OUTPUT_WINDOW, "WINDOW", 0, "New Window", "Images are rendered in new Window"}, {0, NULL, 0, NULL, NULL}}; + /* Bake */ + static EnumPropertyItem bake_mode_items[] ={ + {RE_BAKE_ALL, "FULL", 0, "Full Render", ""}, + {RE_BAKE_AO, "AO", 0, "Ambient Occlusion", ""}, + {RE_BAKE_SHADOW, "SHADOW", 0, "Shadow", ""}, + {RE_BAKE_NORMALS, "NORMALS", 0, "Normals", ""}, + {RE_BAKE_TEXTURE, "TEXTURE", 0, "Textures", ""}, + {RE_BAKE_DISPLACEMENT, "DISPLACEMENT", 0, "Displacement", ""}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem bake_normal_space_items[] ={ + {R_BAKE_SPACE_CAMERA, "CAMERA", 0, "Camera", ""}, + {R_BAKE_SPACE_WORLD, "WORLD", 0, "World", ""}, + {R_BAKE_SPACE_OBJECT, "OBJECT", 0, "Object", ""}, + {R_BAKE_SPACE_TANGENT, "TANGENT", 0, "Tangent", ""}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem bake_aa_items[] ={ + {5, "AA_5", 0, "5", ""}, + {8, "AA_8", 0, "8", ""}, + {11, "AA_11", 0, "11", ""}, + {16, "AA_16", 0, "16", ""}, + {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem octree_resolution_items[] = { {64, "OCTREE_RES_64", 0, "64", ""}, {128, "OCTREE_RES_128", 0, "128", ""}, @@ -1141,8 +1168,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) {0, "STAMP_FONT_LARGE", 0, "Large", ""}, {4, "STAMP_FONT_EXTRALARGE", 0, "Extra Large", ""}, {0, NULL, 0, NULL, NULL}}; - - + static EnumPropertyItem image_type_items[] = { {0, "", 0, "Image", NULL}, {R_PNG, "PNG", 0, "PNG", ""}, @@ -1707,6 +1733,57 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Output Path", "Directory/name to save animations, # characters defines the position and length of frame numbers."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); + /* Bake */ + + prop= RNA_def_property(srna, "bake_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_mode"); + RNA_def_property_enum_items(prop, bake_mode_items); + RNA_def_property_ui_text(prop, "Bake Mode", ""); + + prop= RNA_def_property(srna, "bake_normal_space", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_normal_space"); + RNA_def_property_enum_items(prop, bake_normal_space_items); + RNA_def_property_ui_text(prop, "Normal Space", "Choose normal space for baking"); + + prop= RNA_def_property(srna, "bake_aa_mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "bake_osa"); + RNA_def_property_enum_items(prop, bake_aa_items); + RNA_def_property_ui_text(prop, "Anti-Aliasing Level", ""); + + prop= RNA_def_property(srna, "bake_active", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_TO_ACTIVE); + RNA_def_property_ui_text(prop, "Selected to Active", "Bake shading on the surface of selected objects to the active object"); + + prop= RNA_def_property(srna, "bake_normalized", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_NORMALIZE); + RNA_def_property_ui_text(prop, "Normalized", ""); + //"Bake ambient occlusion normalized, without taking into acount material settings" + //"Normalized displacement value to fit the 'Dist' range" + // XXX: Need 1 tooltip here... + + prop= RNA_def_property(srna, "bake_clear", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_CLEAR); + RNA_def_property_ui_text(prop, "Clear", "Clear Images before baking"); + + prop= RNA_def_property(srna, "bake_enable_aa", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_OSA); + RNA_def_property_ui_text(prop, "Anti-Aliasing", "Enables Anti-aliasing"); + + prop= RNA_def_property(srna, "bake_margin", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "bake_filter"); + RNA_def_property_range(prop, 0, 32); + RNA_def_property_ui_text(prop, "Margin", "Amount of pixels to extend the baked result with, as post process filter"); + + prop= RNA_def_property(srna, "bake_distance", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "bake_maxdist"); + RNA_def_property_range(prop, 0.0, 1000.0); + RNA_def_property_ui_text(prop, "Distance", "Maximum distance from active object to other object (in blender units"); + + prop= RNA_def_property(srna, "bake_bias", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "bake_biasdist"); + RNA_def_property_range(prop, 0.0, 1000.0); + RNA_def_property_ui_text(prop, "Bias", "Bias towards faces further away from the object (in blender units)"); + /* stamp */ prop= RNA_def_property(srna, "stamp_time", PROP_BOOLEAN, PROP_NONE); From 0db2975ff6cc2592b062f749059e640dc1e2b140 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 26 Aug 2009 16:05:01 +0000 Subject: [PATCH 287/577] [#18837] if a sunlamp is set to a too high energy, speculars turn black shr->spec values could be greater then 1.0, causing negative color when using (1.0-shr->spec[i]) as a blending factor. When shr->spec[i] is 1.0 the mircol is ignored, so only mix the mircol when needed (like clamping the spec). --- source/blender/render/intern/source/rayshade.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index 75b9557f337..182e60365a6 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -1239,15 +1239,18 @@ void ray_trace(ShadeInput *shi, ShadeResult *shr) } if(shi->combinedflag & SCE_PASS_REFLECT) { + /* values in shr->spec can be greater then 1.0. + * in the case when it is 1.0 diff */ - f= fr*(1.0f-shr->spec[0]); f1= 1.0f-i; - diff[0]= f*mircol[0] + f1*diff[0]; + f1= 1.0f-i; - f= fg*(1.0f-shr->spec[1]); f1= 1.0f-i; - diff[1]= f*mircol[1] + f1*diff[1]; + diff[0] *= f1; + diff[1] *= f1; + diff[2] *= f1; - f= fb*(1.0f-shr->spec[2]); f1= 1.0f-i; - diff[2]= f*mircol[2] + f1*diff[2]; + if(shr->spec[0]<1.0f) diff[0] += mircol[0] * (fr*(1.0f-shr->spec[0])); + if(shr->spec[1]<1.0f) diff[1] += mircol[1] * (fg*(1.0f-shr->spec[1])); + if(shr->spec[2]<1.0f) diff[2] += mircol[2] * (fb*(1.0f-shr->spec[2])); } } } From 1e50c17f91cbd09929ab9624b045ba2e8ea0f979 Mon Sep 17 00:00:00 2001 From: Diego Borghetti Date: Wed, 26 Aug 2009 17:13:20 +0000 Subject: [PATCH 288/577] Update makefile for libed_gpencil. --- source/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/source/Makefile b/source/Makefile index 93bd2e23903..a13d8bb41d5 100644 --- a/source/Makefile +++ b/source/Makefile @@ -265,6 +265,7 @@ PULIB += $(OCGDIR)/blender/ed_uvedit/$(DEBUG_DIR)libed_uvedit.a PULIB += $(OCGDIR)/blender/ed_screen/$(DEBUG_DIR)libed_screen.a PULIB += $(OCGDIR)/blender/ed_console/$(DEBUG_DIR)libed_console.a PULIB += $(OCGDIR)/blender/ed_userpref/$(DEBUG_DIR)libed_userpref.a +PULIB += $(OCGDIR)/blender/ed_gpencil/$(DEBUG_DIR)libed_gpencil.a PULIB += $(OCGDIR)/blender/windowmanager/$(DEBUG_DIR)libwindowmanager.a PULIB += $(OCGDIR)/blender/python/$(DEBUG_DIR)libpython.a PULIB += $(OCGDIR)/blender/makesrna/$(DEBUG_DIR)librna.a From c30f54e326aa38c383c24dd288d3e0b8ce07d2d4 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Wed, 26 Aug 2009 18:20:17 +0000 Subject: [PATCH 289/577] 2.5 Sound: RNA for bSound. --- source/blender/blenkernel/BKE_sound.h | 2 ++ source/blender/blenkernel/intern/sound.c | 11 ++++++++ source/blender/makesrna/intern/rna_sound.c | 29 ++++++++++++++++++++++ 3 files changed, 42 insertions(+) diff --git a/source/blender/blenkernel/BKE_sound.h b/source/blender/blenkernel/BKE_sound.h index 84ecd79a008..e9f6eb21e36 100644 --- a/source/blender/blenkernel/BKE_sound.h +++ b/source/blender/blenkernel/BKE_sound.h @@ -54,6 +54,8 @@ void sound_delete(struct bContext *C, struct bSound* sound); void sound_cache(struct bSound* sound, int ignore); +void sound_delete_cache(struct bSound* sound); + void sound_load(struct Main *main, struct bSound* sound); void sound_free(struct bSound* sound); diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 070b5786a74..3794fbe90ef 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -163,6 +163,16 @@ void sound_cache(struct bSound* sound, int ignore) AUD_unload(sound->cache); sound->cache = AUD_bufferSound(sound->handle); + sound->changed = TRUE; +} + +void sound_delete_cache(struct bSound* sound) +{ + if(sound->cache) + { + AUD_unload(sound->cache); + sound->cache = NULL; + } } void sound_load(struct Main *main, struct bSound* sound) @@ -219,6 +229,7 @@ void sound_load(struct Main *main, struct bSound* sound) break; } #endif + sound->changed = TRUE; } } diff --git a/source/blender/makesrna/intern/rna_sound.c b/source/blender/makesrna/intern/rna_sound.c index a029ef85544..38e4d850c68 100644 --- a/source/blender/makesrna/intern/rna_sound.c +++ b/source/blender/makesrna/intern/rna_sound.c @@ -34,6 +34,29 @@ #ifdef RNA_RUNTIME +#include "BKE_sound.h" +#include "BKE_context.h" + +static void rna_Sound_filename_update(bContext *C, PointerRNA *ptr) +{ + sound_load(CTX_data_main(C), (bSound*)ptr->data); +} + +static int rna_Sound_caching_get(PointerRNA *ptr) +{ + bSound *sound = (bSound*)(ptr->data); + return sound->cache != NULL; +} + +static void rna_Sound_caching_set(PointerRNA *ptr, const int value) +{ + bSound *sound = (bSound*)(ptr->data); + if(value) + sound_cache(sound, 0); + else + sound_delete_cache(sound); +} + #else static void rna_def_sound(BlenderRNA *brna) @@ -51,10 +74,16 @@ static void rna_def_sound(BlenderRNA *brna) prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_ui_text(prop, "Filename", "Sound sample file used by this Sound datablock."); + RNA_def_property_update(prop, 0, "rna_Sound_filename_update"); prop= RNA_def_property(srna, "packed_file", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "packedfile"); RNA_def_property_ui_text(prop, "Packed File", ""); + + prop= RNA_def_property(srna, "caching", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_Sound_caching_get", "rna_Sound_caching_set"); + RNA_def_property_ui_text(prop, "Caching", "The sound file is decoded and loaded into RAM."); + RNA_def_property_update(prop, 0, "rna_Sound_filename_update"); } void RNA_def_sound(BlenderRNA *brna) From ae8dcde0e2daa9c74ef6db40abe20256fe5675cb Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Wed, 26 Aug 2009 19:30:02 +0000 Subject: [PATCH 290/577] SVN maintenance. --- source/blender/editors/gpencil/gpencil_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c index cb6d66b2fcc..c5fa8398cd8 100644 --- a/source/blender/editors/gpencil/gpencil_ops.c +++ b/source/blender/editors/gpencil/gpencil_ops.c @@ -1,5 +1,5 @@ /** - * $Id: gpencil_ops.c 21617 2009-07-16 04:45:52Z aligorith $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * From a3bc7f3d1d2824a1d05832a4c9186f440fbb91b0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 26 Aug 2009 20:06:16 +0000 Subject: [PATCH 291/577] BGE shape key actuator working, though only tried a simple testcase. --- source/blender/blenkernel/intern/sca.c | 2 -- .../gameengine/Converter/BL_ShapeActionActuator.cpp | 12 ++++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c index 139895bbdaf..e4d73208c64 100644 --- a/source/blender/blenkernel/intern/sca.c +++ b/source/blender/blenkernel/intern/sca.c @@ -418,12 +418,10 @@ void init_actuator(bActuator *act) act->data= 0; switch(act->type) { -#ifdef __NLA case ACT_ACTION: case ACT_SHAPEACTION: act->data= MEM_callocN(sizeof(bActionActuator), "actionact"); break; -#endif case ACT_SOUND: sa = act->data= MEM_callocN(sizeof(bSoundActuator), "soundact"); sa->volume = 1.0f; diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp index 44eb603a940..81ce9ff6154 100644 --- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp +++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp @@ -40,6 +40,7 @@ #include "STR_HashedString.h" #include "DNA_nla_types.h" #include "DNA_action_types.h" +#include "DNA_anim_types.h" #include "DNA_scene_types.h" #include "BKE_action.h" #include "DNA_armature_types.h" @@ -51,6 +52,10 @@ #include "FloatValue.h" #include "PyObjectPlus.h" +extern "C" { + #include "BKE_animsys.h" +} + #ifdef HAVE_CONFIG_H #include #endif @@ -370,8 +375,11 @@ bool BL_ShapeActionActuator::Update(double curtime, bool frame) m_blendstart = curtime; } // only interested in shape channel - // XXX extract_ipochannels_from_action(&tchanbase, &key->id, m_action, "Shape", m_localtime); - + + // in 2.4x was // extract_ipochannels_from_action(&tchanbase, &key->id, m_action, "Shape", m_localtime); + BKE_animsys_evaluate_animdata(&key->id, key->adt, m_localtime, ADT_RECALC_ANIM); + + // XXX - in 2.5 theres no way to do this. possibly not that important to support - Campbell if (0) { // XXX !execute_ipochannels(&tchanbase)) { // no update, this is possible if action does not match the keys, stop the action keepgoing = false; From 65b7d58fa212377226f9a132cfd274a76328e2a6 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 27 Aug 2009 01:01:13 +0000 Subject: [PATCH 292/577] Grease Pencil: Bugfixes * Realtime updates now work again * Fixed problems with clicks to start drawing resulting in a stroke being ended. * Changed the hotkeys to Ctrl-Alt-Shift-LMB (draw) and Ctrl-Alt-Shift-RMB (erase). Still very temporary stuff, will probably change these a few more times as I experiment with new approaches. --- source/blender/editors/gpencil/gpencil_ops.c | 8 ++++-- .../blender/editors/gpencil/gpencil_paint.c | 26 +++++++++++-------- .../editors/space_view3d/view3d_draw.c | 6 ++--- source/blender/windowmanager/WM_types.h | 1 + 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c index c5fa8398cd8..c18c7bb3f78 100644 --- a/source/blender/editors/gpencil/gpencil_ops.c +++ b/source/blender/editors/gpencil/gpencil_ops.c @@ -47,14 +47,18 @@ void gpencil_common_keymap(wmWindowManager *wm, ListBase *keymap) { - wmKeymapItem *km; + wmKeymapItem *kmi; /* if no keymap provided, use default */ if (keymap == NULL) keymap= WM_keymap_listbase(wm, "Grease Pencil Generic", 0, 0); /* Draw */ - WM_keymap_add_item(keymap, "GPENCIL_OT_draw", SKEY, KM_PRESS, 0, DKEY); + /* draw */ + WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT|KM_ALT, 0); + /* erase */ + kmi=WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT|KM_ALT, 0); + RNA_enum_set(kmi->ptr, "mode", 1); // XXX need to make the defines for this public (this is GP_PAINTMODE_ERASER) } /* ****************************************** */ diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index dc701924b3e..059c3417a04 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -859,7 +859,7 @@ static tGPsdata *gp_session_initpaint (bContext *C) p->scene->gpd= p->gpd; } - /* set edit flags */ + /* set edit flags - so that buffer will get drawn */ G.f |= G_GREASEPENCIL; /* set initial run flag */ @@ -1171,7 +1171,7 @@ static void gpencil_draw_apply_event (bContext *C, wmOperator *op, wmEvent *even } /* force refresh */ - ED_area_tag_redraw(p->sa); // XXX this is crude + WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX please work! } /* ------------------------------- */ @@ -1216,6 +1216,18 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) printf("\tGP - handle modal event...\n"); switch (event->type) { + /* end of stroke -> ONLY when a mouse-button release occurs + * otherwise, carry on to mouse-move... + */ + case LEFTMOUSE: + case MIDDLEMOUSE: + case RIGHTMOUSE: + if (event->val != KM_PRESS) { + printf("\t\tGP - end of stroke \n"); + gpencil_draw_exit(C, op); + return OPERATOR_FINISHED; + } + /* moving mouse - assumed that mouse button is down */ case MOUSEMOVE: /* handle drawing event */ @@ -1230,14 +1242,6 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) } break; - /* end of stroke - i.e. when a mouse-button release occurs */ - case LEFTMOUSE: - case MIDDLEMOUSE: - case RIGHTMOUSE: - printf("\t\tGP - end of stroke \n"); - gpencil_draw_exit(C, op); - return OPERATOR_FINISHED; - /* scrolling mouse-wheel increases radius of eraser * - though this is quite a difficult action to perform */ @@ -1259,7 +1263,7 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) break; default: - return OPERATOR_RUNNING_MODAL|OPERATOR_PASS_THROUGH; + printf("\t\tGP unknown event - %d \n", event->type); break; } diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 07ffb35f807..4ca1f296f15 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2084,7 +2084,7 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) /* draw grease-pencil stuff */ //if (v3d->flag2 & V3D_DISPGP) - draw_gpencil_3dview(C, 1); + draw_gpencil_3dview((bContext *)C, 1); BDR_drawSketch(C); @@ -2100,9 +2100,9 @@ void view3d_main_area_draw(const bContext *C, ARegion *ar) if(rv3d->persp>1) drawviewborder(scene, ar, v3d); if(rv3d->rflag & RV3D_FLYMODE) drawviewborder_flymode(ar); - /* draw grease-pencil stuff */ + /* draw grease-pencil stuff - needed to get paint-buffer shown too (since it's 2D) */ // if (v3d->flag2 & V3D_DISPGP) -// draw_gpencil_3dview(ar, 0); + draw_gpencil_3dview((bContext *)C, 0); drawcursor(scene, ar, v3d); diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 42ee6e926fc..5687cb565d1 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -149,6 +149,7 @@ typedef struct wmNotifier { #define ND_SCREENDELETE (2<<16) #define ND_SCREENCAST (3<<16) #define ND_ANIMPLAY (4<<16) +#define ND_GPENCIL (5<<16) /* NC_SCENE Scene */ #define ND_SCENEBROWSE (1<<16) From 7994ff39b8acff9a7addbacb97a26387ce181025 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 27 Aug 2009 01:57:09 +0000 Subject: [PATCH 293/577] Grease Pencil: Another quick experiment - easier usage * Changed the hotkey to simply be: Hold DKEY, click+drag using Left-Mouse (draw) or Right-Mouse (erase). How to get tablet erasers to work (via keymaps) is on todo... You can simply hold DKEY until you've finished drawing, thanks to the nice way that keymaps can support standard-key modifiers now. * Eraser works now too. --- source/blender/editors/gpencil/gpencil_ops.c | 8 ++++++-- source/blender/editors/gpencil/gpencil_paint.c | 10 ++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c index c18c7bb3f78..347a611ee30 100644 --- a/source/blender/editors/gpencil/gpencil_ops.c +++ b/source/blender/editors/gpencil/gpencil_ops.c @@ -55,9 +55,9 @@ void gpencil_common_keymap(wmWindowManager *wm, ListBase *keymap) /* Draw */ /* draw */ - WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT|KM_ALT, 0); + WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, 0, DKEY); /* erase */ - kmi=WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT|KM_ALT, 0); + kmi=WM_keymap_add_item(keymap, "GPENCIL_OT_draw", RIGHTMOUSE, KM_PRESS, 0, DKEY); RNA_enum_set(kmi->ptr, "mode", 1); // XXX need to make the defines for this public (this is GP_PAINTMODE_ERASER) } @@ -67,6 +67,10 @@ void ED_operatortypes_gpencil (void) { /* Drawing ----------------------- */ WM_operatortype_append(GPENCIL_OT_draw); + + /* Editing (Buttons) ------------ */ + + /* Editing (Time) --------------- */ } /* ****************************************** */ diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 059c3417a04..2f60efb2179 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1030,6 +1030,7 @@ static void gp_paint_cleanup (tGPsdata *p) static int gpencil_draw_init (bContext *C, wmOperator *op) { tGPsdata *p; + wmWindow *win= CTX_wm_window(C); int paintmode= RNA_enum_get(op->ptr, "mode"); /* check context */ @@ -1048,9 +1049,14 @@ static int gpencil_draw_init (bContext *C, wmOperator *op) } /* radius for eraser circle is defined in userprefs now */ - // TODO: make this more easily tweaked... p->radius= U.gp_eraser; + /* set cursor */ + if (p->paintmode == GP_PAINTMODE_ERASER) + WM_cursor_modal(win, BC_CROSSCURSOR); // XXX need a better cursor + else + WM_cursor_modal(win, BC_PAINTBRUSHCURSOR); + /* everything is now setup ok */ return 1; } @@ -1065,7 +1071,7 @@ static void gpencil_draw_exit (bContext *C, wmOperator *op) G.f &= ~G_GREASEPENCIL; /* restore cursor to indicate end of drawing */ - // XXX (cursor callbacks in regiontype) setcursor_space(p.sa->spacetype, CURSOR_STD); + WM_cursor_restore(CTX_wm_window(C)); /* check size of buffer before cleanup, to determine if anything happened here */ if (p->paintmode == GP_PAINTMODE_ERASER) { From fe46d5ba7ac6679121acc08574955b22f7653fc7 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 27 Aug 2009 06:03:41 +0000 Subject: [PATCH 294/577] Grease Pencil: RNA Wrapping * Wrapped Grease Pencil datatypes in RNA. * Hooked up Grease Pencil access in RNA (i.e. via Main, ID, and Scene) TODO: Updates to properties are currently lacking property-update calls, since there's no good notifier for this. --- source/blender/makesdna/DNA_gpencil_types.h | 4 +- source/blender/makesrna/RNA_access.h | 5 + source/blender/makesrna/intern/makesrna.c | 1 + source/blender/makesrna/intern/rna_ID.c | 1 + source/blender/makesrna/intern/rna_action.c | 20 +- .../blender/makesrna/intern/rna_animation.c | 3 +- source/blender/makesrna/intern/rna_gpencil.c | 242 ++++++++++++++++++ source/blender/makesrna/intern/rna_internal.h | 1 + source/blender/makesrna/intern/rna_main.c | 9 +- source/blender/makesrna/intern/rna_scene.c | 8 + 10 files changed, 280 insertions(+), 14 deletions(-) create mode 100644 source/blender/makesrna/intern/rna_gpencil.c diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index ed209a127c7..4bae9935ea7 100644 --- a/source/blender/makesdna/DNA_gpencil_types.h +++ b/source/blender/makesdna/DNA_gpencil_types.h @@ -33,7 +33,7 @@ /* Grease-Pencil Annotations - 'Stroke Point' * -> Coordinates may either be 2d or 3d depending on settings at the time * -> Coordinates of point on stroke, in proportions of window size - * (i.e. n/1000). This assumes that the bottom-left corner is (0,0) + * This assumes that the bottom-left corner is (0,0) */ typedef struct bGPDspoint { float x, y, z; /* co-ordinates of point (usually 2d, but can be 3d as well) */ @@ -135,12 +135,14 @@ typedef struct bGPdata { /* bGPdata->flag */ // XXX many of these flags should be depreceated for more general ideas in 2.5 /* don't allow painting to occur at all */ + // XXX is depreceated - not well understood #define GP_DATA_LMBPLOCK (1<<0) /* show debugging info in viewport (i.e. status print) */ #define GP_DATA_DISPINFO (1<<1) /* in Action Editor, show as expanded channel */ #define GP_DATA_EXPAND (1<<2) /* is the block overriding all clicks? */ + // XXX is depreceated - nasty old concept #define GP_DATA_EDITPAINT (1<<3) /* new strokes are added in viewport space */ #define GP_DATA_VIEWALIGN (1<<4) diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index ea7451ee77a..98205d17ef3 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -213,6 +213,11 @@ extern StructRNA RNA_GameSoftBodySettings; extern StructRNA RNA_GameStringProperty; extern StructRNA RNA_GameTimerProperty; extern StructRNA RNA_GlowSequence; +extern StructRNA RNA_GreasePencil; +extern StructRNA RNA_GPencilLayer; +extern StructRNA RNA_GPencilFrame; +extern StructRNA RNA_GPencilStroke; +extern StructRNA RNA_GPencilStrokePoint; extern StructRNA RNA_Group; extern StructRNA RNA_Header; extern StructRNA RNA_HemiLamp; diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 0c90a28a0e9..bb7b6cbcd37 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -1964,6 +1964,7 @@ RNAProcessItem PROCESS_ITEMS[]= { {"rna_curve.c", NULL, RNA_def_curve}, {"rna_fcurve.c", NULL, RNA_def_fcurve}, {"rna_fluidsim.c", NULL, RNA_def_fluidsim}, + {"rna_gpencil.c", NULL, RNA_def_gpencil}, {"rna_group.c", NULL, RNA_def_group}, {"rna_image.c", NULL, RNA_def_image}, {"rna_key.c", NULL, RNA_def_key}, diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index f6e0a2468c4..dd26391b11e 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -97,6 +97,7 @@ StructRNA *ID_code_to_RNA_type(short idcode) case ID_BR: return &RNA_Brush; case ID_CA: return &RNA_Camera; case ID_CU: return &RNA_Curve; + case ID_GD: return &RNA_GreasePencil; case ID_GR: return &RNA_Group; case ID_IM: return &RNA_Image; case ID_KE: return &RNA_Key; diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c index 3639d6d3fff..e376d3125e3 100644 --- a/source/blender/makesrna/intern/rna_action.c +++ b/source/blender/makesrna/intern/rna_action.c @@ -42,15 +42,15 @@ void rna_def_action_group(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna= RNA_def_struct(brna, "ActionGroup", NULL); RNA_def_struct_sdna(srna, "bActionGroup"); RNA_def_struct_ui_text(srna, "Action Group", "Groups of F-Curves."); - + prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", ""); RNA_def_struct_name_property(srna, prop); - + /* dna warns not to treat the Action Channel listbase in the Action Group struct like a normal listbase. I'll leave this here but comment out, for Joshua to review. He can probably shed some more light on why this is */ @@ -58,19 +58,19 @@ void rna_def_action_group(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "channels", NULL); RNA_def_property_struct_type(prop, "FCurve"); RNA_def_property_ui_text(prop, "Channels", "F-Curves in this group.");*/ - + prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_SELECTED); RNA_def_property_ui_text(prop, "Selected", "Action Group is selected."); - + prop= RNA_def_property(srna, "locked", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_PROTECTED); RNA_def_property_ui_text(prop, "Locked", "Action Group is locked."); - + prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", AGRP_EXPANDED); RNA_def_property_ui_text(prop, "Expanded", "Action Group is expanded."); - + prop= RNA_def_property(srna, "custom_color", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "customCol"); RNA_def_property_ui_text(prop, "Custom Color", "Index of custom color set."); @@ -85,17 +85,17 @@ void rna_def_action(BlenderRNA *brna) RNA_def_struct_sdna(srna, "bAction"); RNA_def_struct_ui_text(srna, "Action", "A collection of F-Curves for animation."); RNA_def_struct_ui_icon(srna, ICON_ACTION); - + prop= RNA_def_property(srna, "fcurves", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "curves", NULL); RNA_def_property_struct_type(prop, "FCurve"); RNA_def_property_ui_text(prop, "F-Curves", "The individual F-Curves that make up the Action."); - + prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "groups", NULL); RNA_def_property_struct_type(prop, "ActionGroup"); RNA_def_property_ui_text(prop, "Groups", "Convenient groupings of F-Curves."); - + prop= RNA_def_property(srna, "pose_markers", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "markers", NULL); RNA_def_property_struct_type(prop, "TimelineMarker"); diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index 7652987ac86..e4bea893992 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Contributor(s): Blender Foundation (2008), Roland Hess + * Contributor(s): Blender Foundation (2009), Joshua Leung * * ***** END GPL LICENSE BLOCK ***** */ @@ -157,7 +157,6 @@ void rna_def_keyingset(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYINGSET_BUILTIN); RNA_def_property_ui_text(prop, "Built-In", "Keying Set is a built-in to Blender."); - /* TODO: for now, this is editable, but do we really want this to happen? */ prop= RNA_def_property(srna, "absolute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYINGSET_ABSOLUTE); RNA_def_property_ui_text(prop, "Absolute", "Keying Set defines specific paths/settings to be keyframed (i.e. is not reliant on context info)"); diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c new file mode 100644 index 00000000000..2ef7d9d2d90 --- /dev/null +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -0,0 +1,242 @@ +/** + * $Id: rna_gpencil.c 22756 2009-08-25 04:05:37Z aligorith $ + * + * ***** 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. + * + * Contributor(s): Blender Foundation (2009), Joshua Leung + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include + +#include "RNA_define.h" +#include "RNA_types.h" +#include "RNA_enum_types.h" + +#include "rna_internal.h" + +#include "DNA_gpencil_types.h" +#include "DNA_scene_types.h" + +#include "MEM_guardedalloc.h" + +#ifdef RNA_RUNTIME + +static int rna_GPencilLayer_active_frame_editable(PointerRNA *ptr) +{ + bGPDlayer *gpl= (bGPDlayer *)ptr->data; + + /* surely there must be other criteria too... */ + if (gpl->flag & GP_LAYER_LOCKED) + return 0; + else + return 1; +} + +void rna_GPencilLayer_active_set(PointerRNA *ptr, int value) +{ + bGPdata *gpd= ptr->id.data; + bGPDlayer *gpl= ptr->data; + + /* disabled all other layers anyway */ + if (GS(gpd->id.name) == ID_GD) { + bGPDlayer *gl; + + for (gl= gpd->layers.first; gl; gl= gl->next) + gl->flag &= ~GP_LAYER_ACTIVE; + } + + /* if enabling value, make it active */ + if (value) + gpl->flag |= GP_LAYER_ACTIVE; +} + +#else + +void rna_def_gpencil_stroke_point(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "GPencilStrokePoint", NULL); + RNA_def_struct_sdna(srna, "bGPDspoint"); + RNA_def_struct_ui_text(srna, "Grease Pencil Stroke Point", "Data point for freehand stroke curve."); + + prop= RNA_def_property(srna, "coordinates", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "x"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Coordinates", ""); + + prop= RNA_def_property(srna, "pressure", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "pressure"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Pressure", "Pressure of tablet at point when drawing it."); +} + +void rna_def_gpencil_stroke(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "GPencilStroke", NULL); + RNA_def_struct_sdna(srna, "bGPDstroke"); + RNA_def_struct_ui_text(srna, "Grease Pencil Stroke", "Freehand curve defining part of a sketch."); + + /* Points */ + prop= RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_sdna(prop, NULL, "points", "totpoints"); + RNA_def_property_struct_type(prop, "GPencilStrokePoint"); + RNA_def_property_ui_text(prop, "Stroke Points", "Stroke data points"); + + /* Flags - Readonly type-info really... */ + // TODO... +} + +void rna_def_gpencil_frame(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "GPencilFrame", NULL); + RNA_def_struct_sdna(srna, "bGPDframe"); + RNA_def_struct_ui_text(srna, "Grease Pencil Frame", "Collection of related sketches on a particular frame"); + + /* Strokes */ + prop= RNA_def_property(srna, "strokes", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_sdna(prop, NULL, "strokes", NULL); + RNA_def_property_struct_type(prop, "GPencilStroke"); + RNA_def_property_ui_text(prop, "Strokes", "Freehand curves defining the sketch on this frame."); + + /* Frame Number */ + prop= RNA_def_property(srna, "frame_number", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "framenum"); + RNA_def_property_range(prop, MINFRAME, MAXFRAME); // XXX note: this cannot occur on the same frame as another sketch + RNA_def_property_ui_text(prop, "Frame Number", "The frame on which this sketch appears."); + + /* Flags */ + prop= RNA_def_property(srna, "paint_lock", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_FRAME_PAINT); // XXX should it be editable? + RNA_def_property_ui_text(prop, "Paint Lock", "Frame is being edited (painted on)."); + + prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_FRAME_SELECT); + RNA_def_property_ui_text(prop, "Selected", "Frame is selected for editing in the DopeSheet."); +} + +void rna_def_gpencil_layer(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "GPencilLayer", NULL); + RNA_def_struct_sdna(srna, "bGPDlayer"); + RNA_def_struct_ui_text(srna, "Grease Pencil Layer", "Collection of related sketches"); + + /* Name */ + prop= RNA_def_property(srna, "info", PROP_STRING, PROP_NONE); + RNA_def_property_ui_text(prop, "Info", "Description of layer"); + RNA_def_struct_name_property(srna, prop); + + /* Frames */ + prop= RNA_def_property(srna, "frames", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_sdna(prop, NULL, "frames", NULL); + RNA_def_property_struct_type(prop, "GPencilFrame"); + RNA_def_property_ui_text(prop, "Frames", "Sketches for this layer on different frames."); + + /* Active Frame */ + prop= RNA_def_property(srna, "active_frame", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "actframe"); + RNA_def_property_ui_text(prop, "Active Frame", "Frame currently being displayed for this layer."); + RNA_def_property_editable_func(prop, "rna_GPencilLayer_active_frame_editable"); + + /* Drawing Color */ + prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Color", "Color that all sketches in this layer are drawn with."); + + prop= RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "color[3]"); + RNA_def_property_range(prop, 0.3, 1.0f); + RNA_def_property_ui_text(prop, "Opacity", "Visibility of strokes."); + + /* Line Thickness */ + prop= RNA_def_property(srna, "line_thickness", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "thickness"); + RNA_def_property_range(prop, 1, 10); + RNA_def_property_ui_text(prop, "Thickness", "Thickness of strokes (in pixels)."); + + /* Onion-Skinning */ + prop= RNA_def_property(srna, "use_onion_skinning", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ONIONSKIN); + RNA_def_property_ui_text(prop, "Use Onion Skinning", "Ghost frames on either side of frame."); + + prop= RNA_def_property(srna, "max_ghost_range", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "gstep"); + RNA_def_property_range(prop, 0, 120); + RNA_def_property_ui_text(prop, "Max Ghost Range", "Maximum number of frames on either side of the active frame to show. (0 = just show the 'first' available sketch on either side)"); + + /* Flags */ + prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_HIDE); + RNA_def_property_ui_text(prop, "Hide", "Layer doesn't get drawn."); + + prop= RNA_def_property(srna, "locked", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_LOCKED); + RNA_def_property_ui_text(prop, "Locked", "Layer is protected from further editing and/or frame changes."); + + prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ACTIVE); + RNA_def_property_boolean_funcs(prop, NULL, "rna_GPencilLayer_active_set"); + RNA_def_property_ui_text(prop, "Active", "Layer is 'active' layer being edited."); + + prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_SELECT); + RNA_def_property_ui_text(prop, "Selected", "Layer is selected for editing in the DopeSheet."); + +} + +void rna_def_gpencil_data(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + srna= RNA_def_struct(brna, "GreasePencil", "ID"); + RNA_def_struct_sdna(srna, "bGPdata"); + RNA_def_struct_ui_text(srna, "Grease Pencil", "Freehand annotation sketchbook."); + //RNA_def_struct_ui_icon(srna, ICON_GPENCIL); + + /* Layers */ + prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE); + RNA_def_property_collection_sdna(prop, NULL, "layers", NULL); + RNA_def_property_struct_type(prop, "GPencilLayer"); + RNA_def_property_ui_text(prop, "Layers", "Similar to layers in Photoshop."); +} + +/* --- */ + +void RNA_def_gpencil(BlenderRNA *brna) +{ + rna_def_gpencil_data(brna); + + rna_def_gpencil_layer(brna); + rna_def_gpencil_frame(brna); + rna_def_gpencil_stroke(brna); + rna_def_gpencil_stroke_point(brna); +} + +#endif diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index bd28085692f..0a9ef9f90d1 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -130,6 +130,7 @@ void RNA_def_curve(struct BlenderRNA *brna); void RNA_def_fluidsim(struct BlenderRNA *brna); void RNA_def_fcurve(struct BlenderRNA *brna); void RNA_def_gameproperty(struct BlenderRNA *brna); +void RNA_def_gpencil(struct BlenderRNA *brna); void RNA_def_group(struct BlenderRNA *brna); void RNA_def_image(struct BlenderRNA *brna); void RNA_def_key(struct BlenderRNA *brna); diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index 4a24027f7e9..82e460ea57d 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -207,6 +207,12 @@ static void rna_Main_particle_begin(CollectionPropertyIterator *iter, PointerRNA rna_iterator_listbase_begin(iter, &bmain->particle, NULL); } +static void rna_Main_gpencil_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) +{ + Main *bmain= (Main*)ptr->data; + rna_iterator_listbase_begin(iter, &bmain->gpencil, NULL); +} + static void rna_Main_wm_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Main *bmain= (Main*)ptr->data; @@ -240,13 +246,14 @@ void RNA_def_main(BlenderRNA *brna) {"brushes", "Brush", "rna_Main_brush_begin", "Brushes", "Brush datablocks.", NULL, NULL}, {"worlds", "World", "rna_Main_world_begin", "Worlds", "World datablocks.", NULL, NULL}, {"groups", "Group", "rna_Main_group_begin", "Groups", "Group datablocks.", NULL, NULL}, - {"keys", "ID", "rna_Main_key_begin", "Keys", "Key datablocks.", NULL, NULL}, + {"keys", "Key", "rna_Main_key_begin", "Keys", "Key datablocks.", NULL, NULL}, {"scripts", "ID", "rna_Main_script_begin", "Scripts", "Script datablocks.", NULL, NULL}, {"texts", "Text", "rna_Main_text_begin", "Texts", "Text datablocks.", NULL, NULL}, {"sounds", "ID", "rna_Main_sound_begin", "Sounds", "Sound datablocks.", NULL, NULL}, {"armatures", "Armature", "rna_Main_armature_begin", "Armatures", "Armature datablocks.", NULL, NULL}, {"actions", "Action", "rna_Main_action_begin", "Actions", "Action datablocks.", NULL, NULL}, {"particles", "ParticleSettings", "rna_Main_particle_begin", "Particles", "Particle datablocks.", NULL, NULL}, + {"gpencil", "GreasePencil", "rna_Main_gpencil_begin", "Grease Pencil", "Grease Pencil datablocks.", NULL, NULL}, {NULL, NULL, NULL, NULL, NULL, NULL, NULL}}; int i; diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 86ceee55f47..2408d9337e1 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -2067,6 +2067,14 @@ void RNA_def_scene(BlenderRNA *brna) prop= RNA_def_string(func, "statistics", "", 0, "Statistics", ""); RNA_def_function_return(func, prop); + /* Grease Pencil */ + prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "gpd"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_struct_type(prop, "GreasePencil"); + RNA_def_property_ui_text(prop, "Grease Pencil Data", "Grease Pencil datablock"); + + /* Nestled Data */ rna_def_tool_settings(brna); rna_def_unit_settings(brna); rna_def_scene_render_data(brna); From 324b3fbe747a6544b60be1eb8a0cb6b01db736de Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 27 Aug 2009 06:55:54 +0000 Subject: [PATCH 295/577] - BGE crash fix when casting a ray to the same location as the object from python. - Incorrect Mathutils vector docstrings. - last rayshade commit had an incomplete comment. --- source/blender/python/api2_2x/vector.c | 4 ++-- source/blender/render/intern/source/rayshade.c | 4 +++- source/gameengine/Ketsji/KX_GameObject.cpp | 8 +++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/blender/python/api2_2x/vector.c b/source/blender/python/api2_2x/vector.c index cb206363dbf..a7e00e2878a 100644 --- a/source/blender/python/api2_2x/vector.c +++ b/source/blender/python/api2_2x/vector.c @@ -58,8 +58,8 @@ struct PyMethodDef Vector_methods[] = { {"normalize", (PyCFunction) Vector_Normalize, METH_NOARGS, Vector_Normalize_doc}, {"negate", (PyCFunction) Vector_Negate, METH_NOARGS, Vector_Negate_doc}, {"resize2D", (PyCFunction) Vector_Resize2D, METH_NOARGS, Vector_Resize2D_doc}, - {"resize3D", (PyCFunction) Vector_Resize3D, METH_NOARGS, Vector_Resize2D_doc}, - {"resize4D", (PyCFunction) Vector_Resize4D, METH_NOARGS, Vector_Resize2D_doc}, + {"resize3D", (PyCFunction) Vector_Resize3D, METH_NOARGS, Vector_Resize3D_doc}, + {"resize4D", (PyCFunction) Vector_Resize4D, METH_NOARGS, Vector_Resize4D_doc}, {"toTrackQuat", ( PyCFunction ) Vector_ToTrackQuat, METH_VARARGS, Vector_ToTrackQuat_doc}, {"reflect", ( PyCFunction ) Vector_Reflect, METH_O, Vector_Reflect_doc}, {"cross", ( PyCFunction ) Vector_Cross, METH_O, Vector_Dot_doc}, diff --git a/source/blender/render/intern/source/rayshade.c b/source/blender/render/intern/source/rayshade.c index 182e60365a6..e683a499e17 100644 --- a/source/blender/render/intern/source/rayshade.c +++ b/source/blender/render/intern/source/rayshade.c @@ -1240,7 +1240,9 @@ void ray_trace(ShadeInput *shi, ShadeResult *shr) if(shi->combinedflag & SCE_PASS_REFLECT) { /* values in shr->spec can be greater then 1.0. - * in the case when it is 1.0 diff */ + * In this case the mircol uses a zero blending factor, so ignoring it is ok. + * Fixes bug #18837 - when the spec is higher then 1.0, + * diff can become a negative color - Campbell */ f1= 1.0f-i; diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index d04174a32aa..ba8905973d5 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -2597,12 +2597,10 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCastTo, } } MT_Point3 fromPoint = NodeGetWorldPosition(); + if (dist != 0.0f) - { - MT_Vector3 toDir = toPoint-fromPoint; - toDir.normalize(); - toPoint = fromPoint + (dist) * toDir; - } + toPoint = fromPoint + dist * (toPoint-fromPoint).safe_normalized(); + PHY_IPhysicsEnvironment* pe = KX_GetActiveScene()->GetPhysicsEnvironment(); KX_IPhysicsController *spc = GetPhysicsController(); KX_GameObject *parent = GetParent(); From 55f82852ca4a88080bf9928445e52d24330a4889 Mon Sep 17 00:00:00 2001 From: William Reynish Date: Thu, 27 Aug 2009 08:46:39 +0000 Subject: [PATCH 296/577] Tweaked layout of game properties. The Add button is now at the top, meaning it doesn't move around - this is also more consistent with constraints/modifiers etc. Used the same 'box' layout as constraints/modifiers. Also ported some name changes from the materials UI script to RNA to keep these consistent. Animation editors always show the RNA name after all, so it's good to keep the names similar. --- release/ui/buttons_material.py | 24 +++++------ release/ui/space_logic.py | 23 +++++------ source/blender/editors/animation/anim_ops.c | 4 +- source/blender/makesrna/intern/rna_material.c | 40 +++++++++---------- 4 files changed, 45 insertions(+), 46 deletions(-) diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py index 30b107d452f..e7add9c59f3 100644 --- a/release/ui/buttons_material.py +++ b/release/ui/buttons_material.py @@ -130,8 +130,8 @@ class MATERIAL_PT_strand(MaterialButtonsPanel): col = split.column(align=True) col.itemL(text="Size:") - col.itemR(tan, "start_size", text="Root") - col.itemR(tan, "end_size", text="Tip") + col.itemR(tan, "root_size", text="Root") + col.itemR(tan, "tip_size", text="Tip") col.itemR(tan, "min_size", text="Minimum") col.itemR(tan, "blender_units") sub = col.column() @@ -231,7 +231,7 @@ class MATERIAL_PT_shadow(MaterialButtonsPanel): col = split.column() col.itemR(mat, "shadows", text="Receive") - col.itemR(mat, "transparent_shadows", text="Receive Transparent") + col.itemR(mat, "receive_transparent_shadows", text="Receive Transparent") col.itemR(mat, "only_shadow", text="Shadows Only") col.itemR(mat, "cast_shadows_only", text="Cast Only") col.itemR(mat, "shadow_casting_alpha", text="Casting Alpha") @@ -266,7 +266,7 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel): col.itemR(mat, "diffuse_color", text="") sub = col.column() sub.active = (not mat.shadeless) - sub.itemR(mat, "diffuse_reflection", text="Intensity") + sub.itemR(mat, "diffuse_intensity", text="Intensity") col = split.column() col.active = (not mat.shadeless) @@ -320,7 +320,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel): col = split.column() col.itemR(mat, "specular_color", text="") - col.itemR(mat, "specular_reflection", text="Intensity") + col.itemR(mat, "specular_intensity", text="Intensity") col = split.column() col.itemR(mat, "specular_shader", text="") @@ -426,7 +426,7 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel): split = layout.split() col = split.column() - col.itemR(raym, "reflect", text="Reflectivity") + col.itemR(raym, "reflectivity") col.itemR(mat, "mirror_color", text="") col = split.column() @@ -448,9 +448,9 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel): col = split.column() col.itemL(text="Gloss:") - col.itemR(raym, "gloss", text="Amount") + col.itemR(raym, "gloss_amount", text="Amount") sub = col.column() - sub.active = raym.gloss < 1 + sub.active = raym.gloss_amount < 1 sub.itemR(raym, "gloss_threshold", text="Threshold") sub.itemR(raym, "gloss_samples", text="Samples") sub.itemR(raym, "gloss_anisotropic", text="Anisotropic") @@ -511,9 +511,9 @@ class MATERIAL_PT_transp(MaterialButtonsPanel): col = split.column() col.itemL(text="Gloss:") - col.itemR(rayt, "gloss", text="Amount") + col.itemR(rayt, "gloss_amount", text="Amount") sub = col.column() - sub.active = rayt.gloss < 1 + sub.active = rayt.gloss_amount < 1 sub.itemR(rayt, "gloss_threshold", text="Threshold") sub.itemR(rayt, "gloss_samples", text="Samples") @@ -663,8 +663,8 @@ class MATERIAL_PT_halo(MaterialButtonsPanel): col.itemR(halo, "hardness") col.itemR(halo, "add") col.itemL(text="Options:") - col.itemR(halo, "use_texture", text="Texture") - col.itemR(halo, "use_vertex_normal", text="Vertex Normal") + col.itemR(halo, "texture") + col.itemR(halo, "vertex_normal") col.itemR(halo, "xalpha") col.itemR(halo, "shaded") col.itemR(halo, "soft") diff --git a/release/ui/space_logic.py b/release/ui/space_logic.py index f9920f78497..9b0e3dc7f38 100644 --- a/release/ui/space_logic.py +++ b/release/ui/space_logic.py @@ -14,17 +14,16 @@ class LOGIC_PT_properties(bpy.types.Panel): ob = context.active_object game = ob.game - for i, prop in enumerate(game.properties): - flow = layout.row(align=True) - flow.itemR(prop, "name", text="") - flow.itemR(prop, "type", text="") - flow.itemR(prop, "value", text="") # we dont care about the type. rna will display correctly - flow.itemR(prop, "debug", text="", toggle=True, icon='ICON_INFO') - flow.item_intO("object.game_property_remove", "index", i, text="", icon='ICON_X') + layout.itemO("object.game_property_new", text="Add Game Property") + + for i, prop in enumerate(game.properties): + + box = layout.box() + row = box.row() + row.itemR(prop, "name", text="") + row.itemR(prop, "type", text="") + row.itemR(prop, "value", text="") # we dont care about the type. rna will display correctly + row.itemR(prop, "debug", text="", toggle=True, icon='ICON_INFO') + row.item_intO("object.game_property_remove", "index", i, text="", icon='ICON_X') - flow = layout.row() - flow.itemO("object.game_property_new") - - - bpy.types.register(LOGIC_PT_properties) diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index 72fee937e25..3d45dcc92ca 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -406,10 +406,10 @@ void ED_keymap_anim(wmWindowManager *wm) /* frame management */ /* NOTE: 'ACTIONMOUSE' not 'LEFTMOUSE', as user may have swapped mouse-buttons */ - WM_keymap_verify_item(keymap, "ANIM_OT_change_frame", ACTIONMOUSE, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "ANIM_OT_change_frame", ACTIONMOUSE, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "ANIM_OT_time_toggle", TKEY, KM_PRESS, KM_CTRL, 0); /* preview range */ - WM_keymap_verify_item(keymap, "ANIM_OT_previewrange_set", PKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_verify_item(keymap, "ANIM_OT_previewrange_set", PKEY, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "ANIM_OT_previewrange_clear", PKEY, KM_PRESS, KM_ALT, 0); } diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index cde65f46e5c..e9970e4391e 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -685,10 +685,10 @@ static void rna_def_material_diffuse(StructRNA *srna) RNA_def_property_ui_text(prop, "Diffuse Shader Model", ""); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "diffuse_reflection", PROP_FLOAT, PROP_PERCENTAGE); + prop= RNA_def_property(srna, "diffuse_intensity", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_float_sdna(prop, NULL, "ref"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Diffuse Reflection", "Amount of diffuse reflection."); + RNA_def_property_ui_text(prop, "Diffuse Intensity", "Amount of diffuse reflection."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING_DRAW, NULL); prop= RNA_def_property(srna, "roughness", PROP_FLOAT, PROP_NONE); @@ -746,10 +746,10 @@ static void rna_def_material_raymirror(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Enabled", "Enable raytraced reflections."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "reflect", PROP_FLOAT, PROP_PERCENTAGE); + prop= RNA_def_property(srna, "reflectivity", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_float_sdna(prop, NULL, "ray_mirror"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Reflect", "Sets the amount mirror reflection for raytrace."); + RNA_def_property_ui_text(prop, "Reflectivity", "Sets the amount mirror reflection for raytrace."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "fresnel", PROP_FLOAT, PROP_NONE); @@ -764,10 +764,10 @@ static void rna_def_material_raymirror(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "gloss", PROP_FLOAT, PROP_PERCENTAGE); + prop= RNA_def_property(srna, "gloss_amount", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_float_sdna(prop, NULL, "gloss_mir"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Gloss", "The shininess of the reflection. Values < 1.0 give diffuse, blurry reflections."); + RNA_def_property_ui_text(prop, "Gloss Amount", "The shininess of the reflection. Values < 1.0 give diffuse, blurry reflections."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "gloss_anisotropic", PROP_FLOAT, PROP_PERCENTAGE); @@ -835,10 +835,10 @@ static void rna_def_material_raytra(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "gloss", PROP_FLOAT, PROP_PERCENTAGE); + prop= RNA_def_property(srna, "gloss_amount", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_float_sdna(prop, NULL, "gloss_tra"); RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Gloss", "The clarity of the refraction. Values < 1.0 give diffuse, blurry refractions."); + RNA_def_property_ui_text(prop, "Gloss Amount", "The clarity of the refraction. Values < 1.0 give diffuse, blurry refractions."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "gloss_samples", PROP_INT, PROP_NONE); @@ -1133,14 +1133,14 @@ static void rna_def_material_halo(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Star", "Renders halo as a star."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "use_texture", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "texture", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALOTEX); - RNA_def_property_ui_text(prop, "Use Texture", "Gives halo a texture."); + RNA_def_property_ui_text(prop, "Texture", "Gives halo a texture."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "use_vertex_normal", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "vertex_normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_HALOPUNO); - RNA_def_property_ui_text(prop, "Use Vertex Normal", "Uses the vertex normal to specify the dimension of the halo."); + RNA_def_property_ui_text(prop, "Vertex Normal", "Uses the vertex normal to specify the dimension of the halo."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "xalpha", PROP_BOOLEAN, PROP_NONE); @@ -1247,10 +1247,10 @@ void rna_def_material_specularity(StructRNA *srna) RNA_def_property_ui_text(prop, "Specular Shader Model", ""); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "specular_reflection", PROP_FLOAT, PROP_PERCENTAGE); + prop= RNA_def_property(srna, "specular_intensity", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_float_sdna(prop, NULL, "spec"); RNA_def_property_range(prop, 0, 1); - RNA_def_property_ui_text(prop, "Specularity Intensity", ""); + RNA_def_property_ui_text(prop, "Specular Intensity", ""); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); /* NOTE: "har", "param", etc are used for multiple purposes depending on @@ -1320,16 +1320,16 @@ void rna_def_material_strand(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Blender Units", "Use Blender units for widths instead of pixels."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "start_size", PROP_FLOAT, PROP_UNSIGNED); + prop= RNA_def_property(srna, "root_size", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "strand_sta"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_MaterialStrand_start_size_range"); - RNA_def_property_ui_text(prop, "Start Size", "Start size of strands in pixels Blender units."); + RNA_def_property_ui_text(prop, "Root Size", "Start size of strands in pixels Blender units."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "end_size", PROP_FLOAT, PROP_UNSIGNED); + prop= RNA_def_property(srna, "tip_size", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "strand_end"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_MaterialStrand_end_size_range"); - RNA_def_property_ui_text(prop, "End Size", "Start size of strands in pixels or Blender units."); + RNA_def_property_ui_text(prop, "Tip Size", "Start size of strands in pixels or Blender units."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "min_size", PROP_FLOAT, PROP_UNSIGNED); @@ -1551,9 +1551,9 @@ void RNA_def_material(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Exclude Mist", "Excludes this material from mist effects (in world settings)"); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "transparent_shadows", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "receive_transparent_shadows", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", MA_SHADOW_TRA); - RNA_def_property_ui_text(prop, "Transparent Shadows", "Allow this object to receive transparent shadows casted through other objects"); + RNA_def_property_ui_text(prop, "Receive Transparent Shadows", "Allow this object to receive transparent shadows casted through other objects"); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); prop= RNA_def_property(srna, "ray_shadow_bias", PROP_BOOLEAN, PROP_NONE); From 12a0f2c0987688b2fcf8daf44d9462b524fe139a Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Thu, 27 Aug 2009 09:52:41 +0000 Subject: [PATCH 297/577] Fix for sounds with relative paths not being loaded correctly. --- .../blender/blenloader/intern/readblenentry.c | 18 +++--------------- source/blender/blenloader/intern/readfile.c | 7 +++++-- source/blender/blenloader/intern/readfile.h | 2 +- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index 1f276913ea8..ac561eb6186 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -331,11 +331,7 @@ BlendFileData *BLO_read_from_file(char *file, ReportList *reports) fd = blo_openblenderfile(file, reports); if (fd) { fd->reports= reports; - bfd= blo_read_file_internal(fd); - if (bfd) { - bfd->type= BLENFILETYPE_BLEND; - strncpy(bfd->main->name, file, sizeof(bfd->main->name)-1); - } + bfd= blo_read_file_internal(fd, file); blo_freefiledata(fd); } @@ -350,11 +346,7 @@ BlendFileData *BLO_read_from_memory(void *mem, int memsize, ReportList *reports) fd = blo_openblendermemory(mem, memsize, reports); if (fd) { fd->reports= reports; - bfd= blo_read_file_internal(fd); - if (bfd) { - bfd->type= BLENFILETYPE_BLEND; - strcpy(bfd->main->name, ""); - } + bfd= blo_read_file_internal(fd, ""); blo_freefiledata(fd); } @@ -383,11 +375,7 @@ BlendFileData *BLO_read_from_memfile(Main *oldmain, const char *filename, MemFil /* makes lookup of existing images in old main */ blo_make_image_pointer_map(fd, oldmain); - bfd= blo_read_file_internal(fd); - if (bfd) { - bfd->type= BLENFILETYPE_BLEND; - strcpy(bfd->main->name, ""); - } + bfd= blo_read_file_internal(fd, ""); /* ensures relinked images are not freed */ blo_end_image_pointer_map(fd, oldmain); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 6771135a772..5d61e3d305e 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9700,7 +9700,7 @@ static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead) return bhead; } -BlendFileData *blo_read_file_internal(FileData *fd) +BlendFileData *blo_read_file_internal(FileData *fd, char *file) { BHead *bhead= blo_firstbhead(fd); BlendFileData *bfd; @@ -9711,6 +9711,9 @@ BlendFileData *blo_read_file_internal(FileData *fd) bfd->main->versionfile= fd->fileversion; + bfd->type= BLENFILETYPE_BLEND; + strncpy(bfd->main->name, file, sizeof(bfd->main->name)-1); + while(bhead) { switch(bhead->code) { case DATA: @@ -11131,7 +11134,7 @@ BlendFileData *blo_read_blendafterruntime(int file, char *name, int actualsize, return NULL; fd->reports= reports; - bfd= blo_read_file_internal(fd); + bfd= blo_read_file_internal(fd, ""); blo_freefiledata(fd); return bfd; diff --git a/source/blender/blenloader/intern/readfile.h b/source/blender/blenloader/intern/readfile.h index e39fefa8205..2a0b6c327d3 100644 --- a/source/blender/blenloader/intern/readfile.h +++ b/source/blender/blenloader/intern/readfile.h @@ -108,7 +108,7 @@ struct Main; void blo_join_main(ListBase *mainlist); void blo_split_main(ListBase *mainlist, struct Main *main); -BlendFileData *blo_read_file_internal(FileData *fd); +BlendFileData *blo_read_file_internal(FileData *fd, char *file); FileData *blo_openblenderfile(char *name, struct ReportList *reports); FileData *blo_openblendermemory(void *buffer, int buffersize, struct ReportList *reports); From 2c7065e541f1ea51dbeea045bc3214ce22d4ca82 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 27 Aug 2009 15:22:41 +0000 Subject: [PATCH 298/577] - assigning vectors in the BGE wasn't updating the vector from the callback - Pkey only starts in BGE in Object Mode - warning in readblenentry.c, is silent on 64bit too. --- source/blender/blenloader/intern/readblenentry.c | 2 +- source/blender/editors/space_view3d/view3d_view.c | 7 ++++++- source/gameengine/Ketsji/KX_PyMath.h | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index ac561eb6186..33641a0b004 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -200,7 +200,7 @@ void BLO_blendhandle_print_sizes(BlendHandle *bh, void *fp) buf[2]= buf[2]?buf[2]:' '; buf[3]= buf[3]?buf[3]:' '; - fprintf(fp, "['%.4s', '%s', %d, %ld ], \n", buf, name, bhead->nr, (intptr_t)bhead->len+sizeof(BHead)); + fprintf(fp, "['%.4s', '%s', %d, %ld ], \n", buf, name, bhead->nr, (long int)bhead->len+sizeof(BHead)); } } fprintf(fp, "]\n"); diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index ce7b6ba454d..771c02e95b6 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1444,6 +1444,11 @@ extern void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int always_ #endif // GAMEBLENDER == 1 +int game_engine_poll(bContext *C) +{ + return CTX_data_mode_enum(C)==CTX_MODE_OBJECT ? 1:0; +} + static int game_engine_exec(bContext *C, wmOperator *unused) { #if GAMEBLENDER == 1 @@ -1503,7 +1508,7 @@ void VIEW3D_OT_game_start(wmOperatorType *ot) /* api callbacks */ ot->exec= game_engine_exec; - //ot->poll= ED_operator_view3d_active; + ot->poll= game_engine_poll; } /* ************************************** */ diff --git a/source/gameengine/Ketsji/KX_PyMath.h b/source/gameengine/Ketsji/KX_PyMath.h index a8488e8e60a..17102905607 100644 --- a/source/gameengine/Ketsji/KX_PyMath.h +++ b/source/gameengine/Ketsji/KX_PyMath.h @@ -109,6 +109,7 @@ bool PyVecTo(PyObject* pyval, T& vec) if(VectorObject_Check(pyval)) { VectorObject *pyvec= (VectorObject *)pyval; + BaseMath_ReadCallback(pyvec); if (pyvec->size != Size(vec)) { PyErr_Format(PyExc_AttributeError, "error setting vector, %d args, should be %d", pyvec->size, Size(vec)); return false; @@ -118,6 +119,7 @@ bool PyVecTo(PyObject* pyval, T& vec) } else if(QuaternionObject_Check(pyval)) { QuaternionObject *pyquat= (QuaternionObject *)pyval; + BaseMath_ReadCallback(pyquat); if (4 != Size(vec)) { PyErr_Format(PyExc_AttributeError, "error setting vector, %d args, should be %d", 4, Size(vec)); return false; @@ -128,6 +130,7 @@ bool PyVecTo(PyObject* pyval, T& vec) } else if(EulerObject_Check(pyval)) { EulerObject *pyeul= (EulerObject *)pyval; + BaseMath_ReadCallback(pyeul); if (3 != Size(vec)) { PyErr_Format(PyExc_AttributeError, "error setting vector, %d args, should be %d", 3, Size(vec)); return false; From 28392eedbefe1bf9322d30d8697128b2dafb55d5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 27 Aug 2009 16:34:13 +0000 Subject: [PATCH 299/577] was casting the PyObjectPlus type to a PyObject for new BGE vector and matrix types, need to get its proxy instead. --- source/gameengine/Expressions/PyObjectPlus.h | 5 ++++- source/gameengine/Ketsji/KX_GameObject.cpp | 14 +++++++------- source/gameengine/Ketsji/KX_ObjectActuator.cpp | 4 ++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h index e9e81dddaaa..f9edb7877b0 100644 --- a/source/gameengine/Expressions/PyObjectPlus.h +++ b/source/gameengine/Expressions/PyObjectPlus.h @@ -86,7 +86,7 @@ typedef struct { -typedef struct { +typedef struct PyObjectPlus_Proxy { PyObject_HEAD /* required python macro */ class PyObjectPlus *ref; bool py_owns; @@ -99,6 +99,9 @@ typedef struct { /* Note, sometimes we dont care what BGE type this is as long as its a proxy */ #define BGE_PROXY_CHECK_TYPE(_type) ((_type)->tp_dealloc == PyObjectPlus::py_base_dealloc) +/* Opposite of BGE_PROXY_REF */ +#define BGE_PROXY_FROM_REF(_self) (((PyObjectPlus *)_self)->GetProxy()) + // This must be the first line of each // PyC++ class diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index 79b110b11ef..91213bee865 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1798,7 +1798,7 @@ int KX_GameObject::pyattr_set_visible(void *self_v, const KX_PYATTRIBUTE_DEF *at PyObject* KX_GameObject::pyattr_get_worldPosition(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { #ifdef USE_MATHUTILS - return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_POS_GLOBAL); + return newVectorObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_POS_GLOBAL); #else KX_GameObject* self= static_cast(self_v); return PyObjectFrom(self->NodeGetWorldPosition()); @@ -1820,7 +1820,7 @@ int KX_GameObject::pyattr_set_worldPosition(void *self_v, const KX_PYATTRIBUTE_D PyObject* KX_GameObject::pyattr_get_localPosition(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { #ifdef USE_MATHUTILS - return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_POS_LOCAL); + return newVectorObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_POS_LOCAL); #else KX_GameObject* self= static_cast(self_v); return PyObjectFrom(self->NodeGetLocalPosition()); @@ -1842,7 +1842,7 @@ int KX_GameObject::pyattr_set_localPosition(void *self_v, const KX_PYATTRIBUTE_D PyObject* KX_GameObject::pyattr_get_localInertia(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { #ifdef USE_MATHUTILS - return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_INERTIA_LOCAL); + return newVectorObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_INERTIA_LOCAL); #else KX_GameObject* self= static_cast(self_v); if (self->GetPhysicsController()) @@ -1854,7 +1854,7 @@ PyObject* KX_GameObject::pyattr_get_localInertia(void *self_v, const KX_PYATTRIB PyObject* KX_GameObject::pyattr_get_worldOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { #ifdef USE_MATHUTILS - return newMatrixObject_cb((PyObject *)self_v, 3, 3, mathutils_kxgameob_matrix_cb_index, MATHUTILS_MAT_CB_ORI_GLOBAL); + return newMatrixObject_cb(BGE_PROXY_FROM_REF(self_v), 3, 3, mathutils_kxgameob_matrix_cb_index, MATHUTILS_MAT_CB_ORI_GLOBAL); #else KX_GameObject* self= static_cast(self_v); return PyObjectFrom(self->NodeGetWorldOrientation()); @@ -1879,7 +1879,7 @@ int KX_GameObject::pyattr_set_worldOrientation(void *self_v, const KX_PYATTRIBUT PyObject* KX_GameObject::pyattr_get_localOrientation(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { #ifdef USE_MATHUTILS - return newMatrixObject_cb((PyObject *)self_v, 3, 3, mathutils_kxgameob_matrix_cb_index, MATHUTILS_MAT_CB_ORI_LOCAL); + return newMatrixObject_cb(BGE_PROXY_FROM_REF(self_v), 3, 3, mathutils_kxgameob_matrix_cb_index, MATHUTILS_MAT_CB_ORI_LOCAL); #else KX_GameObject* self= static_cast(self_v); return PyObjectFrom(self->NodeGetLocalOrientation()); @@ -1903,7 +1903,7 @@ int KX_GameObject::pyattr_set_localOrientation(void *self_v, const KX_PYATTRIBUT PyObject* KX_GameObject::pyattr_get_worldScaling(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { #ifdef USE_MATHUTILS - return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_SCALE_GLOBAL); + return newVectorObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_SCALE_GLOBAL); #else KX_GameObject* self= static_cast(self_v); return PyObjectFrom(self->NodeGetWorldScaling()); @@ -1913,7 +1913,7 @@ PyObject* KX_GameObject::pyattr_get_worldScaling(void *self_v, const KX_PYATTRIB PyObject* KX_GameObject::pyattr_get_localScaling(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { #ifdef USE_MATHUTILS - return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_SCALE_LOCAL); + return newVectorObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_SCALE_LOCAL); #else KX_GameObject* self= static_cast(self_v); return PyObjectFrom(self->NodeGetLocalScaling()); diff --git a/source/gameengine/Ketsji/KX_ObjectActuator.cpp b/source/gameengine/Ketsji/KX_ObjectActuator.cpp index 99179c5ed96..2601ced9c38 100644 --- a/source/gameengine/Ketsji/KX_ObjectActuator.cpp +++ b/source/gameengine/Ketsji/KX_ObjectActuator.cpp @@ -467,7 +467,7 @@ Mathutils_Callback mathutils_obactu_vector_cb = { PyObject* KX_ObjectActuator::pyattr_get_linV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxobactu_vector_cb_index, MATHUTILS_VEC_CB_LINV); + return newVectorObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxobactu_vector_cb_index, MATHUTILS_VEC_CB_LINV); } int KX_ObjectActuator::pyattr_set_linV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) @@ -481,7 +481,7 @@ int KX_ObjectActuator::pyattr_set_linV(void *self_v, const KX_PYATTRIBUTE_DEF *a PyObject* KX_ObjectActuator::pyattr_get_angV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef) { - return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxobactu_vector_cb_index, MATHUTILS_VEC_CB_ANGV); + return newVectorObject_cb(BGE_PROXY_FROM_REF(self_v), 3, mathutils_kxobactu_vector_cb_index, MATHUTILS_VEC_CB_ANGV); } int KX_ObjectActuator::pyattr_set_angV(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject *value) From 9c1cf53e9ab023e281697e2810ba45031c024101 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Thu, 27 Aug 2009 18:24:12 +0000 Subject: [PATCH 300/577] 2.5 Volumetric: * Wrapped some missing Point Density RNA and added the options to the UI. * Some UI changes (greying out...) Matt: Please check. :) --- release/ui/buttons_texture.py | 49 +++++++++++++---- source/blender/makesrna/intern/rna_texture.c | 56 ++++++++++++++++++-- 2 files changed, 91 insertions(+), 14 deletions(-) diff --git a/release/ui/buttons_texture.py b/release/ui/buttons_texture.py index 4827f677336..c9f1585ec81 100644 --- a/release/ui/buttons_texture.py +++ b/release/ui/buttons_texture.py @@ -623,6 +623,7 @@ class TEXTURE_PT_voxeldata(TextureButtonsPanel): def draw(self, context): layout = self.layout + tex = context.texture vd = tex.voxeldata @@ -631,12 +632,13 @@ class TEXTURE_PT_voxeldata(TextureButtonsPanel): layout.itemR(vd, "source_path") if vd.file_format == 'RAW_8BIT': layout.itemR(vd, "resolution") - if vd.file_format == 'SMOKE': + elif vd.file_format == 'SMOKE': layout.itemR(vd, "domain_object") layout.itemR(vd, "still") - if vd.still: - layout.itemR(vd, "still_frame_number") + row = layout.row() + row.active = vd.still + row.itemR(vd, "still_frame_number") layout.itemR(vd, "interpolation") layout.itemR(vd, "intensity") @@ -651,27 +653,51 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel): def draw(self, context): layout = self.layout + tex = context.texture pd = tex.pointdensity + ob = context.object - layout.itemR(pd, "point_source") - layout.itemR(pd, "object") + layout.itemR(pd, "point_source", expand=True) if pd.point_source == 'PARTICLE_SYSTEM': - layout.item_pointerR(pd, "particle_system", pd.object, "particle_systems", text="") + layout.item_pointerR(pd, "particle_system", ob, "particle_systems", text="System") + layout.itemR(pd, "particle_cache", text="Cache") + else: + layout.itemR(pd, "object") + layout.itemR(pd, "vertices_cache", text="Cache") + + layout.itemS() + layout.itemR(pd, "radius") layout.itemR(pd, "falloff") if pd.falloff == 'SOFT': layout.itemR(pd, "falloff_softness") - layout.itemR(pd, "color_source") + + layout.itemS() + layout.itemR(pd, "turbulence") - layout.itemR(pd, "turbulence_size") - layout.itemR(pd, "turbulence_depth") - layout.itemR(pd, "turbulence_influence") + col = layout.column() + col.active = pd.turbulence + sub = col.column_flow() + sub.itemR(pd, "turbulence_size") + sub.itemR(pd, "turbulence_depth") + sub.itemR(pd, "turbulence_strength") + col.itemR(pd, "turbulence_influence", text="Influence") + col.itemR(pd, "noise_basis") + + layout.itemS() + + layout.itemR(pd, "color_source") + if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_VELOCITY'): + layout.itemR(pd, "speed_scale") + if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_AGE'): + layout.template_color_ramp(pd.color_ramp, expand=True) bpy.types.register(TEXTURE_PT_context_texture) bpy.types.register(TEXTURE_PT_preview) -bpy.types.register(TEXTURE_PT_clouds) + +bpy.types.register(TEXTURE_PT_clouds) # Texture Type Panels bpy.types.register(TEXTURE_PT_wood) bpy.types.register(TEXTURE_PT_marble) bpy.types.register(TEXTURE_PT_magic) @@ -687,6 +713,7 @@ bpy.types.register(TEXTURE_PT_voronoi) bpy.types.register(TEXTURE_PT_distortednoise) bpy.types.register(TEXTURE_PT_voxeldata) bpy.types.register(TEXTURE_PT_pointdensity) + bpy.types.register(TEXTURE_PT_colors) bpy.types.register(TEXTURE_PT_mapping) bpy.types.register(TEXTURE_PT_influence) diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index a949d26f51a..f899d52543e 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -1333,8 +1333,21 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) static EnumPropertyItem point_source_items[] = { {TEX_PD_PSYS, "PARTICLE_SYSTEM", 0, "Particle System", "Generate point density from a particle system"}, {TEX_PD_OBJECT, "OBJECT", 0, "Object Vertices", "Generate point density from an object's vertices"}, + //{TEX_PD_FILE, "FILE", 0 , "File", ""}, {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem particle_cache_items[] = { + {TEX_PD_OBJECTLOC, "OBJECT_LOCATION", 0, "Emit Object Location", ""}, + {TEX_PD_OBJECTSPACE, "OBJECT_SPACE", 0, "Emit Object Space", ""}, + {TEX_PD_WORLDSPACE, "WORLD_SPACE", 0 , "Global Space", ""}, + {0, NULL, 0, NULL, NULL}}; + + static EnumPropertyItem vertice_cache_items[] = { + {TEX_PD_OBJECTLOC, "OBJECT_LOCATION", 0, "Object Location", ""}, + {TEX_PD_OBJECTSPACE, "OBJECT_SPACE", 0, "Object Space", ""}, + {TEX_PD_WORLDSPACE, "WORLD_SPACE", 0 , "Global Space", ""}, + {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem falloff_items[] = { {TEX_PD_FALLOFF_STD, "STANDARD", 0, "Standard", ""}, {TEX_PD_FALLOFF_SMOOTH, "SMOOTH", 0, "Smooth", ""}, @@ -1354,7 +1367,7 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) {TEX_PD_NOISE_STATIC, "STATIC", 0, "Static", "Noise patterns will remain unchanged, faster and suitable for stills"}, {TEX_PD_NOISE_VEL, "PARTICLE_VELOCITY", 0, "Particle Velocity", "Turbulent noise driven by particle velocity"}, {TEX_PD_NOISE_AGE, "PARTICLE_AGE", 0, "Particle Age", "Turbulent noise driven by the particle's age between birth and death"}, - {TEX_PD_NOISE_TIME, "GLOBAL_TIME", 0, "Global Time", "Turbulent noise driven by the global current frame"}, + {TEX_PD_NOISE_TIME, "GLOBAL_TIME", 0, "Global Time", "Turbulent noise driven by the global current frame"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "PointDensity", NULL); @@ -1380,6 +1393,18 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, NC_TEXTURE, NULL); + prop= RNA_def_property(srna, "particle_cache", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "psys_cache_space"); + RNA_def_property_enum_items(prop, particle_cache_items); + RNA_def_property_ui_text(prop, "Particle Cache", "Co-ordinate system to cache particles in"); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + + prop= RNA_def_property(srna, "vertices_cache", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "ob_cache_space"); + RNA_def_property_enum_items(prop, vertice_cache_items); + RNA_def_property_ui_text(prop, "Vertices Cache", "Co-ordinate system to cache vertices in"); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "radius"); RNA_def_property_range(prop, 0.01, FLT_MAX); @@ -1404,6 +1429,19 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Color Source", "Data to derive color results from"); RNA_def_property_update(prop, NC_TEXTURE, NULL); + prop= RNA_def_property(srna, "speed_scale", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "speed_scale"); + RNA_def_property_range(prop, 0.001, 100.0); + RNA_def_property_ui_text(prop, "Scale", "Multipler to bring particle speed within an acceptable range"); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + + prop= RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL); + RNA_def_property_pointer_sdna(prop, NULL, "coba"); + RNA_def_property_struct_type(prop, "ColorRamp"); + RNA_def_property_ui_text(prop, "Color Ramp", ""); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + + /* Turbulence */ prop= RNA_def_property(srna, "turbulence", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_PD_TURBULENCE); RNA_def_property_ui_text(prop, "Turbulence", "Add directed noise to the density at render-time"); @@ -1415,6 +1453,12 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Size", "Scale of the added turbulent noise"); RNA_def_property_update(prop, NC_TEXTURE, NULL); + prop= RNA_def_property(srna, "turbulence_strength", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "noise_fac"); + RNA_def_property_range(prop, 0.01, FLT_MAX); + RNA_def_property_ui_text(prop, "Strength", ""); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + prop= RNA_def_property(srna, "turbulence_depth", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "noise_depth"); RNA_def_property_range(prop, 0, INT_MAX); @@ -1426,9 +1470,14 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) RNA_def_property_enum_items(prop, turbulence_influence_items); RNA_def_property_ui_text(prop, "Turbulence Influence", "Method for driving added turbulent noise"); RNA_def_property_update(prop, NC_TEXTURE, NULL); + + prop= RNA_def_property(srna, "noise_basis", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "noise_basis"); + RNA_def_property_enum_items(prop, prop_noise_basis_items); + RNA_def_property_ui_text(prop, "Noise Basis", "Noise formula used for tubulence"); + RNA_def_property_update(prop, NC_TEXTURE, NULL); + - - srna= RNA_def_struct(brna, "PointDensityTexture", "Texture"); RNA_def_struct_sdna(srna, "Tex"); RNA_def_struct_ui_text(srna, "Point Density", "Settings for the Point Density texture"); @@ -1454,6 +1503,7 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna) static EnumPropertyItem file_format_items[] = { {TEX_VD_BLENDERVOXEL, "BLENDER_VOXEL", 0, "Blender Voxel", "Default binary voxel file format"}, {TEX_VD_RAW_8BIT, "RAW_8BIT", 0, "8 bit RAW", "8 bit greyscale binary data"}, + //{TEX_VD_RAW_16BIT, "RAW_16BIT", 0, "16 bit RAW", ""}, {TEX_VD_IMAGE_SEQUENCE, "IMAGE_SEQUENCE", 0, "Image Sequence", "Generate voxels from a sequence of image slices"}, {TEX_VD_SMOKE, "SMOKE", 0, "Smoke", "Render voxels from a Blender smoke simulation"}, {0, NULL, 0, NULL, NULL}}; From 590950a0fafb7e56ac32f32f1dff76b5c9cbce81 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Thu, 27 Aug 2009 19:10:53 +0000 Subject: [PATCH 301/577] 2.5: * Deleted the box layout in logic editor, as discussed in IRC. We need a better solution here, maybe 2 lines? * Typo in Sequencer RNA. --- release/ui/buttons_texture.py | 90 +++++++++++++------ release/ui/space_logic.py | 14 +-- source/blender/makesrna/intern/rna_sequence.c | 2 +- 3 files changed, 70 insertions(+), 36 deletions(-) diff --git a/release/ui/buttons_texture.py b/release/ui/buttons_texture.py index c9f1585ec81..78d5e6af790 100644 --- a/release/ui/buttons_texture.py +++ b/release/ui/buttons_texture.py @@ -657,43 +657,76 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel): tex = context.texture pd = tex.pointdensity ob = context.object - + layout.itemR(pd, "point_source", expand=True) - if pd.point_source == 'PARTICLE_SYSTEM': - layout.item_pointerR(pd, "particle_system", ob, "particle_systems", text="System") - layout.itemR(pd, "particle_cache", text="Cache") - else: - layout.itemR(pd, "object") - layout.itemR(pd, "vertices_cache", text="Cache") - - layout.itemS() - - layout.itemR(pd, "radius") - layout.itemR(pd, "falloff") - if pd.falloff == 'SOFT': - layout.itemR(pd, "falloff_softness") - - layout.itemS() - layout.itemR(pd, "turbulence") + split = layout.split() - col = layout.column() - col.active = pd.turbulence - sub = col.column_flow() - sub.itemR(pd, "turbulence_size") - sub.itemR(pd, "turbulence_depth") - sub.itemR(pd, "turbulence_strength") - col.itemR(pd, "turbulence_influence", text="Influence") - col.itemR(pd, "noise_basis") + col = split.column() + if pd.point_source == 'PARTICLE_SYSTEM': + col.itemL(text="System:") + col.item_pointerR(pd, "particle_system", ob, "particle_systems", text="") + col.itemL(text="Cache:") + col.itemR(pd, "particle_cache", text="") + else: + col.itemL(text="Object:") + col.itemR(pd, "object", text="") + col.itemL(text="Cache:") + col.itemR(pd, "vertices_cache", text="") - layout.itemS() + sub = split.column() - layout.itemR(pd, "color_source") + sub.itemL() + sub.itemR(pd, "radius") + + sub.itemL(text="Falloff:") + sub.itemR(pd, "falloff", text="") + if pd.falloff == 'SOFT': + sub.itemR(pd, "falloff_softness") + + col.itemL(text="Color Source:") + col.itemR(pd, "color_source", text="") if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_VELOCITY'): - layout.itemR(pd, "speed_scale") + col.itemR(pd, "speed_scale") if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_AGE'): layout.template_color_ramp(pd.color_ramp, expand=True) +class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel): + __label__ = "Turbulence" + + def poll(self, context): + tex = context.texture + return (tex and tex.type == 'POINT_DENSITY') + + def draw_header(self, context): + layout = self.layout + + tex = context.texture + pd = tex.pointdensity + + layout.itemR(pd, "turbulence", text="") + + def draw(self, context): + layout = self.layout + + tex = context.texture + pd = tex.pointdensity + layout.active = pd.turbulence + + split = layout.split() + + col = split.column() + col.itemL(text="Influence:") + col.itemR(pd, "turbulence_influence", text="") + col.itemL(text="Noise Basis:") + col.itemR(pd, "noise_basis", text="") + + col = split.column() + col.itemL() + col.itemR(pd, "turbulence_size") + col.itemR(pd, "turbulence_depth") + col.itemR(pd, "turbulence_strength") + bpy.types.register(TEXTURE_PT_context_texture) bpy.types.register(TEXTURE_PT_preview) @@ -713,6 +746,7 @@ bpy.types.register(TEXTURE_PT_voronoi) bpy.types.register(TEXTURE_PT_distortednoise) bpy.types.register(TEXTURE_PT_voxeldata) bpy.types.register(TEXTURE_PT_pointdensity) +bpy.types.register(TEXTURE_PT_pointdensity_turbulence) bpy.types.register(TEXTURE_PT_colors) bpy.types.register(TEXTURE_PT_mapping) diff --git a/release/ui/space_logic.py b/release/ui/space_logic.py index 9b0e3dc7f38..5748d15a53a 100644 --- a/release/ui/space_logic.py +++ b/release/ui/space_logic.py @@ -11,19 +11,19 @@ class LOGIC_PT_properties(bpy.types.Panel): def draw(self, context): layout = self.layout + ob = context.active_object game = ob.game layout.itemO("object.game_property_new", text="Add Game Property") - + for i, prop in enumerate(game.properties): - box = layout.box() - row = box.row() - row.itemR(prop, "name", text="") - row.itemR(prop, "type", text="") - row.itemR(prop, "value", text="") # we dont care about the type. rna will display correctly - row.itemR(prop, "debug", text="", toggle=True, icon='ICON_INFO') + row = layout.row(align=True) + row.itemR(prop, "name", text="") + row.itemR(prop, "type", text="") + row.itemR(prop, "value", text="", toggle=True) # we dont care about the type. rna will display correctly + row.itemR(prop, "debug", text="", toggle=True, icon='ICON_INFO') row.item_intO("object.game_property_remove", "index", i, text="", icon='ICON_X') bpy.types.register(LOGIC_PT_properties) diff --git a/source/blender/makesrna/intern/rna_sequence.c b/source/blender/makesrna/intern/rna_sequence.c index 470909f4eff..5d275f7a87c 100644 --- a/source/blender/makesrna/intern/rna_sequence.c +++ b/source/blender/makesrna/intern/rna_sequence.c @@ -360,7 +360,7 @@ static void rna_def_sequence(BlenderRNA *brna) {SEQ_META, "META", 0, "Meta", ""}, {SEQ_SCENE, "SCENE", 0, "Scene", ""}, {SEQ_MOVIE, "MOVIE", 0, "Movie", ""}, - {SEQ_SOUND, "_SOUND", 0, "Sound", ""}, + {SEQ_SOUND, "SOUND", 0, "Sound", ""}, {SEQ_EFFECT, "REPLACE", 0, "Replace", ""}, {SEQ_CROSS, "CROSS", 0, "Cross", ""}, {SEQ_ADD, "ADD", 0, "Add", ""}, From 9c66deb47a1c2c7330d483090ec715a4c35e3e07 Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Thu, 27 Aug 2009 20:37:50 +0000 Subject: [PATCH 302/577] SVN maintenance. --- source/blender/makesrna/intern/rna_gpencil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index 2ef7d9d2d90..340ba1a0f31 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -1,5 +1,5 @@ /** - * $Id: rna_gpencil.c 22756 2009-08-25 04:05:37Z aligorith $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * From d7bf9688ac78169a37fbfc0d3d5bcd5b5be19170 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 27 Aug 2009 23:29:07 +0000 Subject: [PATCH 303/577] fix for crash when a parent compound object didn't get a physics controller. also show this in the UI. --- source/blender/src/buttons_logic.c | 22 ++++++++++++------- .../Converter/BL_BlenderDataConversion.cpp | 4 +++- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index 0412aa72b37..6117c10c718 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -3513,14 +3513,20 @@ static void buttons_bullet(uiBlock *block, Object *ob) } if (ob->body_type!=OB_BODY_TYPE_SOFT) { - if (ob->parent) - uiDefButBitI(block, TOG, OB_CHILD, B_REDR, "Add to parent", 240,105,110,19, - &ob->gameflag, 0, 0, 0, 0, - "Add this shape to the parent compound shape"); - else - uiDefButBitI(block, TOG, OB_CHILD, B_REDR, "Compound", 240,105,110,19, - &ob->gameflag, 0, 0, 0, 0, - "Create a compound shape with the children's shape that are tagged for addition"); + if (ob->parent) { + if(ob->parent->gameflag & (OB_DYNAMIC|OB_COLLISION)) { + uiDefButBitI(block, TOG, OB_CHILD, B_REDR, "Add to parent", 240,105,110,19, + &ob->gameflag, 0, 0, 0, 0, + "Add this shape to the parent compound shape"); + } + } + else { + if(ob->gameflag & (OB_DYNAMIC|OB_COLLISION)) { + uiDefButBitI(block, TOG, OB_CHILD, B_REDR, "Compound", 240,105,110,19, + &ob->gameflag, 0, 0, 0, 0, + "Create a compound shape with the children's shape that are tagged for addition"); + } + } } } uiBlockEndAlign(block); diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index d2e6bbb43f7..c2566caba1e 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1381,7 +1381,9 @@ void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, bool isCompoundChild = false; bool hasCompoundChildren = !parent && (blenderobject->gameflag & OB_CHILD); - if (parent/* && (parent->gameflag & OB_DYNAMIC)*/) { + /* When the parent is not OB_DYNAMIC and has no OB_COLLISION then it gets no bullet controller + * and cant be apart of the parents compound shape */ + if (parent && (parent->gameflag & (OB_DYNAMIC | OB_COLLISION))) { if ((parent->gameflag & OB_CHILD) != 0 && (blenderobject->gameflag & OB_CHILD)) { From 208f6daa1d2631e0643a97e6d0f456255a0dcde4 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Fri, 28 Aug 2009 02:24:14 +0000 Subject: [PATCH 304/577] * Tweak texture paint view3d settings, make projection paint options dependent on the tool, rather than (weirdly) the tool's availability dependent on projection paint settings. --- release/ui/space_view3d_toolbar.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py index bbca43279a7..0e6dc76d49d 100644 --- a/release/ui/space_view3d_toolbar.py +++ b/release/ui/space_view3d_toolbar.py @@ -362,10 +362,8 @@ class VIEW3D_PT_tools_brush(PaintPanel): col = layout.column(align=True) col.item_enumR(settings, "tool", 'DRAW') col.item_enumR(settings, "tool", 'SOFTEN') - if settings.use_projection: - col.item_enumR(settings, "tool", 'CLONE') - else: - col.item_enumR(settings, "tool", 'SMEAR') + col.item_enumR(settings, "tool", 'CLONE') + col.item_enumR(settings, "tool", 'SMEAR') col = layout.column() col.itemR(brush, "color", text="") @@ -540,12 +538,22 @@ class VIEW3D_PT_tools_vertexpaint(View3DPanel): # col.itemR(vpaint, "mul", text="") -# ********** default tools for texturepaint **************** +# ********** options for projection paint **************** -class VIEW3D_PT_tools_texturepaint(View3DPanel): +class VIEW3D_PT_tools_projectpaint(View3DPanel): __context__ = "texturepaint" - __label__ = "Options" + __label__ = "Project Paint" + + def poll(self, context): + return context.tool_settings.image_paint.tool != 'SMEAR' + + def draw_header(self, context): + layout = self.layout + + ipaint = context.tool_settings.image_paint + layout.itemR(ipaint, "use_projection", text="") + def draw(self, context): layout = self.layout @@ -554,7 +562,6 @@ class VIEW3D_PT_tools_texturepaint(View3DPanel): use_projection= ipaint.use_projection col = layout.column() - col.itemR(ipaint, "use_projection") sub = col.column() sub.active = use_projection sub.itemR(ipaint, "use_occlude") @@ -631,5 +638,5 @@ bpy.types.register(VIEW3D_PT_tools_brush_curve) bpy.types.register(VIEW3D_PT_sculpt_options) bpy.types.register(VIEW3D_PT_tools_vertexpaint) bpy.types.register(VIEW3D_PT_tools_weightpaint) -bpy.types.register(VIEW3D_PT_tools_texturepaint) +bpy.types.register(VIEW3D_PT_tools_projectpaint) bpy.types.register(VIEW3D_PT_tools_particlemode) From 8794951d9f5b408568ea35d916b6217d165ba440 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Fri, 28 Aug 2009 09:38:36 +0000 Subject: [PATCH 305/577] A python port of dataoc. --- release/datafiles/datatoc.py | 72 ++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 release/datafiles/datatoc.py diff --git a/release/datafiles/datatoc.py b/release/datafiles/datatoc.py new file mode 100644 index 00000000000..805d7205651 --- /dev/null +++ b/release/datafiles/datatoc.py @@ -0,0 +1,72 @@ +#!/usr/bin/python3 +# +# ***** 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) 2009 Blender Foundation. +# All rights reserved. +# +# Contributor(s): Jörg Müller +# +# ***** END GPL LICENCE BLOCK ***** + +import sys + +if len(sys.argv) < 2: + print("Usage: datatoc ") + sys.exit(1) + +filename = sys.argv[1] + +try: + fpin = open(filename, "rb"); +except: + print("Unable to open input <{0}>".format(sys.argv[1])) + sys.exit(1) + +size = fpin.seek(0, 2) +fpin.seek(0) + +if filename[0] == ".": + filename = filename[1:] + +cname = filename + ".c" +print("Making C file <{0}>".format(cname)) + +filename = filename.replace(".", "_") + +try: + fpout = open(cname, "w") +except: + print("Unable to open output <{0}>".format(cname)) + sys.exit(1) + +fpout.write("/* DataToC output of file <{0}> */\n\n".format(filename)) +fpout.write("int datatoc_{0}_size= {1};\n".format(filename, size)) + +fpout.write("char datatoc_{0}[]= {{\n".format(filename)) + +while size > 0: + size -= 1 + if size % 32 == 31: + fpout.write("\n") + + fpout.write("{0:3d},".format(ord(fpin.read(1)))) + +fpout.write("\n 0};\n\n") + +fpin.close() +fpout.close() From 3ac11df33bf47d98e1a945beaea99e9a98f716d2 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Fri, 28 Aug 2009 11:13:45 +0000 Subject: [PATCH 306/577] First try of sound operators, untested. --- source/blender/editors/sound/sound_intern.h | 39 +++++++ source/blender/editors/sound/sound_ops.c | 107 ++++++++++++++++++++ 2 files changed, 146 insertions(+) create mode 100644 source/blender/editors/sound/sound_intern.h create mode 100644 source/blender/editors/sound/sound_ops.c diff --git a/source/blender/editors/sound/sound_intern.h b/source/blender/editors/sound/sound_intern.h new file mode 100644 index 00000000000..b0d6abb3f00 --- /dev/null +++ b/source/blender/editors/sound/sound_intern.h @@ -0,0 +1,39 @@ +/** + * $Id:$ + * + * ***** 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) 2008 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef ED_SOUND_INTERN_H +#define ED_SOUND_INTERN_H + +struct wmOperatorType; + +void SOUND_OT_open(wmOperatorType *ot); + +void sound_operatortype_init(void); + +#endif /* ED_SOUND_INTERN_H */ + diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c new file mode 100644 index 00000000000..59bb9c5319c --- /dev/null +++ b/source/blender/editors/sound/sound_ops.c @@ -0,0 +1,107 @@ +/** + * $Id:$ + * + * ***** 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) 2007 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include + +#include "DNA_scene_types.h" +#include "DNA_space_types.h" +#include "DNA_sound_types.h" +#include "DNA_windowmanager_types.h" + +#include "BKE_context.h" +#include "BKE_main.h" +#include "BKE_report.h" +#include "BKE_sound.h" + +#include "RNA_access.h" +#include "RNA_define.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "AUD_C-API.h" + +#include "sound_intern.h" + +/******************** open sound operator ********************/ + +static int open_exec(bContext *C, wmOperator *op) +{ + char filename[FILE_MAX]; + bSound *sound; + AUD_SoundInfo info; + + RNA_string_get(op->ptr, "filename", filename); + + sound = sound_new_file(CTX_data_main(C), filename); + + if (sound==NULL || sound->handle == NULL) { + BKE_report(op->reports, RPT_ERROR, "Unsupported audio format"); + return OPERATOR_CANCELLED; + } + + info = AUD_getInfo(sound->handle); + + if (info.specs.format == AUD_FORMAT_INVALID) { + sound_delete(C, sound); + BKE_report(op->reports, RPT_ERROR, "Unsupported audio format"); + return OPERATOR_CANCELLED; + } + + return OPERATOR_FINISHED; +} + +static int open_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + return WM_operator_filesel(C, op, event); +} + +void SOUND_OT_open(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Open"; + ot->idname= "SOUND_OT_open"; + ot->description= "Load a sound file into blender"; + + /* api callbacks */ + ot->exec= open_exec; + ot->invoke= open_invoke; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE); +} + +/* ******************************************************* */ + +void sound_operatortype_init(void) +{ + WM_operatortype_append(SOUND_OT_open); +} From 6a8020b9c6693bdb14885914e8688847e2d11629 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Fri, 28 Aug 2009 12:27:29 +0000 Subject: [PATCH 307/577] First try in sound UI for the sequencer. --- release/ui/space_sequencer.py | 24 +++++++++++++ source/blender/editors/include/ED_sound.h | 35 +++++++++++++++++++ source/blender/editors/sound/sound_intern.h | 2 -- source/blender/editors/sound/sound_ops.c | 6 ++-- source/blender/editors/space_api/spacetypes.c | 2 ++ .../blender/editors/space_image/image_ops.c | 2 +- 6 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 source/blender/editors/include/ED_sound.h diff --git a/release/ui/space_sequencer.py b/release/ui/space_sequencer.py index 1498c37d761..6b86ea5dabe 100644 --- a/release/ui/space_sequencer.py +++ b/release/ui/space_sequencer.py @@ -455,6 +455,29 @@ class SEQUENCER_PT_input(SequencerButtonsPanel): col.itemR(strip, "animation_start_offset", text="Start") col.itemR(strip, "animation_end_offset", text="End") +class SEQUENCER_PT_sound(SequencerButtonsPanel): + __label__ = "Sound" + + def poll(self, context): + if context.space_data.display_mode != 'SEQUENCER': + return False + + strip = act_strip(context) + if not strip: + return False + + return strip.type in ('SOUND') + + def draw(self, context): + layout = self.layout + + strip = act_strip(context) + + layout.template_ID(strip, "sound", new="sound.open") + + layout.itemR(strip.sound, "filename") + layout.itemR(strip.sound, "caching") + class SEQUENCER_PT_filter(SequencerButtonsPanel): __label__ = "Filter" @@ -558,6 +581,7 @@ bpy.types.register(SEQUENCER_MT_strip) bpy.types.register(SEQUENCER_PT_edit) # sequencer panels bpy.types.register(SEQUENCER_PT_effect) bpy.types.register(SEQUENCER_PT_input) +bpy.types.register(SEQUENCER_PT_sound) bpy.types.register(SEQUENCER_PT_filter) bpy.types.register(SEQUENCER_PT_proxy) diff --git a/source/blender/editors/include/ED_sound.h b/source/blender/editors/include/ED_sound.h new file mode 100644 index 00000000000..584370bc738 --- /dev/null +++ b/source/blender/editors/include/ED_sound.h @@ -0,0 +1,35 @@ +/** + * $Id:$ + * + * ***** 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) 2008 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#ifndef ED_SOUND_H +#define ED_SOUND_H + +void ED_operatortypes_sound(void); + +#endif /* ED_SOUND_H */ + diff --git a/source/blender/editors/sound/sound_intern.h b/source/blender/editors/sound/sound_intern.h index b0d6abb3f00..eb793a0b661 100644 --- a/source/blender/editors/sound/sound_intern.h +++ b/source/blender/editors/sound/sound_intern.h @@ -33,7 +33,5 @@ struct wmOperatorType; void SOUND_OT_open(wmOperatorType *ot); -void sound_operatortype_init(void); - #endif /* ED_SOUND_INTERN_H */ diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 59bb9c5319c..a23a28423ef 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -38,6 +38,8 @@ #include "BKE_report.h" #include "BKE_sound.h" +#include "ED_sound.h" + #include "RNA_access.h" #include "RNA_define.h" @@ -84,7 +86,7 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *event) void SOUND_OT_open(wmOperatorType *ot) { /* identifiers */ - ot->name= "Open"; + ot->name= "Open Sound"; ot->idname= "SOUND_OT_open"; ot->description= "Load a sound file into blender"; @@ -101,7 +103,7 @@ void SOUND_OT_open(wmOperatorType *ot) /* ******************************************************* */ -void sound_operatortype_init(void) +void ED_operatortypes_sound(void) { WM_operatortype_append(SOUND_OT_open); } diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c index 61b6fe391ae..0d702144959 100644 --- a/source/blender/editors/space_api/spacetypes.c +++ b/source/blender/editors/space_api/spacetypes.c @@ -51,6 +51,7 @@ #include "ED_screen.h" #include "ED_sculpt.h" #include "ED_space_api.h" +#include "ED_sound.h" #include "ED_uvedit.h" #include "ED_mball.h" @@ -99,6 +100,7 @@ void ED_spacetypes_init(void) ED_operatortypes_metaball(); ED_operatortypes_boids(); ED_operatortypes_gpencil(); + ED_operatortypes_sound(); ui_view2d_operatortypes(); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index d9f02a35142..7a39cd587eb 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -650,7 +650,7 @@ static int open_invoke(bContext *C, wmOperator *op, wmEvent *event) void IMAGE_OT_open(wmOperatorType *ot) { /* identifiers */ - ot->name= "Open"; + ot->name= "Open Image"; ot->idname= "IMAGE_OT_open"; /* api callbacks */ From d7656684e213e4755e6f499d2e3a0734507e803d Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Fri, 28 Aug 2009 12:38:59 +0000 Subject: [PATCH 308/577] Quick fix for scons (untested though :/). --- source/blender/editors/SConscript | 1 + source/blender/editors/sound/SConscript | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 source/blender/editors/sound/SConscript diff --git a/source/blender/editors/SConscript b/source/blender/editors/SConscript index 05f17dae1a1..ccffbdb15d5 100644 --- a/source/blender/editors/SConscript +++ b/source/blender/editors/SConscript @@ -15,6 +15,7 @@ SConscript(['datafiles/SConscript', 'gpencil/SConscript', 'physics/SConscript', 'preview/SConscript', + 'sound/SConscript', 'space_buttons/SConscript', 'space_file/SConscript', 'space_image/SConscript', diff --git a/source/blender/editors/sound/SConscript b/source/blender/editors/sound/SConscript new file mode 100644 index 00000000000..7968f4c53a9 --- /dev/null +++ b/source/blender/editors/sound/SConscript @@ -0,0 +1,14 @@ +#!/usr/bin/python +Import ('env') + +sources = env.Glob('*.c') + +incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' +incs += ' ../../windowmanager #/intern/guardedalloc' +incs += ' #/intern/guardedalloc' +incs += ' ../../makesrna ../../python' +incs += ' #/intern/audaspace/intern' + +defs = [] + +env.BlenderLib ( 'bf_editors_sound', sources, Split(incs), defs, libtype=['core'], priority=[35] ) From c15db042cc1b1168a9894a7f5848a866e7b3575a Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 28 Aug 2009 12:41:45 +0000 Subject: [PATCH 309/577] Grease Pencil: WIP Code Reordering + Context Stuff * Shuffled some code around, and renamed some functions used for getting context info - Split UI-buttons into a separate file from stroke-drawing code - Removed some obsolete code (i.e. old paint code that used to be in _edit, but which has been moved to _paint). * Made drawing in 3D-View default to using the active object as the owner of the Grease Pencil data. For now, the drawing code will therefore only show the GP data for the active object only. More work to come on this. * Fixed freeing code for Objects/Scenes with GP data. --- source/blender/blenkernel/intern/object.c | 1 + source/blender/blenkernel/intern/scene.c | 5 + source/blender/blenloader/intern/readfile.c | 4 + .../blender/editors/animation/anim_filter.c | 2 +- source/blender/editors/gpencil/drawgpencil.c | 341 +--- .../blender/editors/gpencil/gpencil_buttons.c | 334 ++++ source/blender/editors/gpencil/gpencil_edit.c | 1638 +---------------- .../blender/editors/gpencil/gpencil_paint.c | 122 +- source/blender/editors/include/ED_gpencil.h | 36 +- .../editors/transform/transform_conversions.c | 2 +- source/blender/makesdna/DNA_object_types.h | 7 +- source/blender/makesrna/intern/rna_object.c | 7 + 12 files changed, 478 insertions(+), 2021 deletions(-) create mode 100644 source/blender/editors/gpencil/gpencil_buttons.c diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 5e2a00c219d..6f57a658efa 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -284,6 +284,7 @@ void free_object(Object *ob) if(ob->adt) BKE_free_animdata((ID *)ob); if(ob->poselib) ob->poselib->id.us--; if(ob->dup_group) ob->dup_group->id.us--; + if(ob->gpd) ob->gpd->id.us--; if(ob->defbase.first) BLI_freelistN(&ob->defbase); if(ob->pose) diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 6dd362d15a8..63dabf18faa 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -245,6 +245,11 @@ void free_scene(Scene *sce) base= base->next; } /* do not free objects! */ + + if(sce->gpd) { + sce->gpd->id.us--; + sce->gpd= NULL; + } BLI_freelistN(&sce->base); seq_free_editing(sce); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 5d61e3d305e..1a811ebc08a 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3449,6 +3449,8 @@ static void lib_link_object(FileData *fd, Main *main) } for(a=0; atotcol; a++) ob->mat[a]= newlibadr_us(fd, ob->id.lib, ob->mat[a]); + ob->gpd= newlibadr_us(fd, ob->id.lib, ob->gpd); + ob->id.flag -= LIB_NEEDLINK; /* if id.us==0 a new base will be created later on */ @@ -10418,6 +10420,8 @@ static void expand_object(FileData *fd, Main *mainvar, Object *ob) expand_doit(fd, mainvar, ob->poselib); expand_constraints(fd, mainvar, &ob->constraints); + expand_doit(fd, mainvar, ob->gpd); + // XXX depreceated - old animation system (for version patching only) expand_doit(fd, mainvar, ob->ipo); expand_doit(fd, mainvar, ob->action); diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 37c8aeac13a..55fb1ccace0 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -885,7 +885,7 @@ static int animdata_filter_gpencil (ListBase *anim_data, bScreen *sc, int filter for (sa= sc->areabase.first; sa; sa= sa->next) { /* try to get gp data */ // XXX need to put back grease pencil api... - gpd= gpencil_data_getactive(sa); + gpd= gpencil_data_get_active(sa); if (gpd == NULL) continue; /* add gpd as channel too (if for drawing, and it has layers) */ diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index 242be943507..4a48e9a4e3b 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -67,278 +67,11 @@ #include "ED_sequencer.h" #include "ED_util.h" -#include "UI_interface.h" #include "UI_resources.h" #include "UI_view2d.h" #include "gpencil_intern.h" -/* ************************************************** */ -/* GREASE PENCIL PANEL-UI DRAWING */ - -/* Every space which implements Grease-Pencil functionality should have a panel - * for the settings. All of the space-dependent parts should be coded in the panel - * code for that space, but the rest is all handled by generic panel here. - */ - -/* ------- Callbacks ----------- */ -/* These are just 'dummy wrappers' around gpencil api calls */ - -#if 0 -// XXX -/* make layer active one after being clicked on */ -void gp_ui_activelayer_cb (void *gpd, void *gpl) -{ - gpencil_layer_setactive(gpd, gpl); - - scrarea_queue_winredraw(curarea); - allqueue(REDRAWACTION, 0); -} - -/* rename layer and set active */ -void gp_ui_renamelayer_cb (void *gpd_arg, void *gpl_arg) -{ - bGPdata *gpd= (bGPdata *)gpd_arg; - bGPDlayer *gpl= (bGPDlayer *)gpl_arg; - - BLI_uniquename(&gpd->layers, gpl, "GP_Layer", '.', offsetof(bGPDlayer, info[0]), 128); - gpencil_layer_setactive(gpd, gpl); - - scrarea_queue_winredraw(curarea); - allqueue(REDRAWACTION, 0); -} - -/* add a new layer */ -void gp_ui_addlayer_cb (void *gpd, void *dummy) -{ - gpencil_layer_addnew(gpd); - - scrarea_queue_winredraw(curarea); - allqueue(REDRAWACTION, 0); -} - -/* delete active layer */ -void gp_ui_dellayer_cb (void *gpd, void *dummy) -{ - gpencil_layer_delactive(gpd); - - scrarea_queue_winredraw(curarea); - allqueue(REDRAWACTION, 0); -} - -/* delete last stroke of active layer */ -void gp_ui_delstroke_cb (void *gpd, void *gpl) -{ - bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0); - - if (gpf) { - if (gpf->framenum != CFRA) return; - - gpencil_layer_setactive(gpd, gpl); - gpencil_frame_delete_laststroke(gpl, gpf); - - scrarea_queue_winredraw(curarea); - } -} - -/* delete active frame of active layer */ -void gp_ui_delframe_cb (void *gpd, void *gpl) -{ - bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0); - - gpencil_layer_setactive(gpd, gpl); - gpencil_layer_delframe(gpl, gpf); - - scrarea_queue_winredraw(curarea); - allqueue(REDRAWACTION, 0); -} - -/* convert the active layer to geometry */ -void gp_ui_convertlayer_cb (void *gpd, void *gpl) -{ - gpencil_layer_setactive(gpd, gpl); - gpencil_convert_menu(); - - scrarea_queue_winredraw(curarea); -} -#endif - -/* ------- Drawing Code ------- */ - -#if 0 -/* XXX */ -/* draw the controls for a given layer */ -static void gp_drawui_layer (uiBlock *block, bGPdata *gpd, bGPDlayer *gpl, short *xco, short *yco) -{ - uiBut *but; - short active= (gpl->flag & GP_LAYER_ACTIVE); - short width= 314; - short height; - int rb_col; - - /* unless button has own callback, it adds this callback to button */ - uiBlockSetFunc(block, gp_ui_activelayer_cb, gpd, gpl); - - /* draw header */ - { - uiBlockSetEmboss(block, UI_EMBOSSN); - - /* rounded header */ - if (active) uiBlockSetCol(block, TH_BUT_ACTION); - rb_col= (active)?-20:20; - uiDefBut(block, ROUNDBOX, B_REDR, "", *xco-8, *yco-2, width, 24, NULL, 5.0, 0.0, 15.0, (float)(rb_col-20), ""); - if (active) uiBlockSetCol(block, TH_AUTO); - - /* lock toggle */ - uiDefIconButBitI(block, ICONTOG, GP_LAYER_LOCKED, B_REDR, ICON_UNLOCKED, *xco-7, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Layer cannot be modified"); - } - - /* when layer is locked or hidden, only draw header */ - if (gpl->flag & (GP_LAYER_LOCKED|GP_LAYER_HIDE)) { - char name[256]; /* gpl->info is 128, but we need space for 'locked/hidden' as well */ - - height= 0; - - /* visibility button (only if hidden but not locked!) */ - if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED)) - uiDefIconButBitI(block, ICONTOG, GP_LAYER_HIDE, B_REDR, ICON_RESTRICT_VIEW_OFF, *xco+12, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Visibility of layer"); - - /* name */ - if (gpl->flag & GP_LAYER_HIDE) - sprintf(name, "%s (Hidden)", gpl->info); - else - sprintf(name, "%s (Locked)", gpl->info); - uiDefBut(block, LABEL, 1, name, *xco+35, *yco, 240, 20, NULL, 0.0, 0.0, 0, 0, "Short description of what this layer is for (optional)"); - - /* delete button (only if hidden but not locked!) */ - if ((gpl->flag & GP_LAYER_HIDE) & !(gpl->flag & GP_LAYER_LOCKED)) { - but= uiDefIconBut(block, BUT, B_REDR, ICON_X, *xco+(width-30), *yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer"); - uiButSetFunc(but, gp_ui_dellayer_cb, gpd, NULL); - } - uiBlockSetEmboss(block, UI_EMBOSS); - } - else { - height= 97; - - /* draw rest of header */ - { - /* visibility button */ - uiDefIconButBitI(block, ICONTOG, GP_LAYER_HIDE, B_REDR, ICON_RESTRICT_VIEW_OFF, *xco+12, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Visibility of layer"); - - uiBlockSetEmboss(block, UI_EMBOSS); - - /* name */ - but= uiDefButC(block, TEX, B_REDR, "Info:", *xco+36, *yco, 240, 19, gpl->info, 0, 127, 0, 0, "Short description of what this layer is for (optional)"); - uiButSetFunc(but, gp_ui_renamelayer_cb, gpd, gpl); - - /* delete 'button' */ - uiBlockSetEmboss(block, UI_EMBOSSN); - - but= uiDefIconBut(block, BUT, B_REDR, ICON_X, *xco+(width-30), *yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer"); - uiButSetFunc(but, gp_ui_dellayer_cb, gpd, NULL); - - uiBlockSetEmboss(block, UI_EMBOSS); - } - - /* draw backdrop */ - if (active) uiBlockSetCol(block, TH_BUT_ACTION); - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-8, *yco-height, width, height-1, NULL, 5.0, 0.0, 12.0, (float)rb_col, ""); - if (active) uiBlockSetCol(block, TH_AUTO); - - /* draw settings */ - { - /* color */ - uiBlockBeginAlign(block); - uiDefButF(block, COL, B_REDR, "", *xco, *yco-26, 150, 19, gpl->color, 0, 0, 0, 0, "Color to use for all strokes on this Grease Pencil Layer"); - uiDefButF(block, NUMSLI, B_REDR, "Opacity: ", *xco,*yco-45,150,19, &gpl->color[3], 0.3f, 1.0f, 0, 0, "Visibility of stroke (0.3 to 1.0)"); - uiBlockEndAlign(block); - - /* stroke thickness */ - uiDefButS(block, NUMSLI, B_REDR, "Thickness:", *xco, *yco-75, 150, 20, &gpl->thickness, 1, 10, 0, 0, "Thickness of strokes (in pixels)"); - - /* debugging options */ - if (G.f & G_DEBUG) { - uiDefButBitI(block, TOG, GP_LAYER_DRAWDEBUG, B_REDR, "Show Points", *xco, *yco-95, 150, 20, &gpl->flag, 0, 0, 0, 0, "Show points which form the strokes"); - } - - /* onion-skinning */ - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, GP_LAYER_ONIONSKIN, B_REDR, "Onion-Skin", *xco+160, *yco-26, 140, 20, &gpl->flag, 0, 0, 0, 0, "Ghost frames on either side of frame"); - uiDefButS(block, NUMSLI, B_REDR, "GStep:", *xco+160, *yco-46, 140, 20, &gpl->gstep, 0, 120, 0, 0, "Max number of frames on either side of active frame to show (0 = just 'first' available sketch on either side)"); - uiBlockEndAlign(block); - - /* options */ - uiBlockBeginAlign(block); - if (curarea->spacetype == SPACE_VIEW3D) { - but= uiDefBut(block, BUT, B_REDR, "Convert to...", *xco+160, *yco-75, 140, 20, NULL, 0, 0, 0, 0, "Converts this layer's strokes to geometry (Hotkey = Alt-Shift-C)"); - uiButSetFunc(but, gp_ui_convertlayer_cb, gpd, gpl); - } - else { - but= uiDefBut(block, BUT, B_REDR, "Del Active Frame", *xco+160, *yco-75, 140, 20, NULL, 0, 0, 0, 0, "Erases the the active frame for this layer (Hotkey = Alt-XKEY/DEL)"); - uiButSetFunc(but, gp_ui_delframe_cb, gpd, gpl); - } - - but= uiDefBut(block, BUT, B_REDR, "Del Last Stroke", *xco+160, *yco-95, 140, 20, NULL, 0, 0, 0, 0, "Erases the last stroke from the active frame (Hotkey = Alt-XKEY/DEL)"); - uiButSetFunc(but, gp_ui_delstroke_cb, gpd, gpl); - uiBlockEndAlign(block); - } - } - - /* adjust height for new to start */ - (*yco) -= (height + 27); -} -#endif -/* Draw the contents for a grease-pencil panel. This assumes several things: - * - that panel has been created, is 318 x 204. max yco is 225 - * - that a toggle for turning on/off gpencil drawing is 150 x 20, starting from (10,225) - * which is basically the top left-hand corner - * It will return the amount of extra space to extend the panel by - */ -short draw_gpencil_panel (uiBlock *block, bGPdata *gpd, ScrArea *sa) -{ -#if 0 - uiBut *but; - bGPDlayer *gpl; - short xco= 10, yco= 170; - - /* draw gpd settings first */ - { - /* add new layer buttons */ - but= uiDefBut(block, BUT, B_REDR, "Add New Layer", 10,205,150,20, 0, 0, 0, 0, 0, "Adds a new Grease Pencil Layer"); - uiButSetFunc(but, gp_ui_addlayer_cb, gpd, NULL); - - - /* show override lmb-clicks button + painting lock */ - uiBlockBeginAlign(block); - if ((gpd->flag & GP_DATA_EDITPAINT)==0) { - uiDefButBitI(block, TOG, GP_DATA_EDITPAINT, B_REDR, "Draw Mode", 170, 225, 130, 20, &gpd->flag, 0, 0, 0, 0, "Interpret click-drag as new strokes"); - - uiBlockSetCol(block, TH_BUT_SETTING); - uiDefIconButBitI(block, ICONTOG, GP_DATA_LMBPLOCK, B_REDR, ICON_UNLOCKED, 300, 225, 20, 20, &gpd->flag, 0.0, 0.0, 0, 0, "Painting cannot occur with Shift-LMB (when making selections)"); - uiBlockSetCol(block, TH_AUTO); - } - else - uiDefButBitI(block, TOG, GP_DATA_EDITPAINT, B_REDR, "Draw Mode", 170, 225, 150, 20, &gpd->flag, 0, 0, 0, 0, "Interpret click-drag as new strokes"); - uiBlockEndAlign(block); - - /* 'view align' button (naming depends on context) */ - if (sa->spacetype == SPACE_VIEW3D) - uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Sketch in 3D", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added in 3D-space"); - else - uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Stick to View", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added on 2d-canvas"); - } - - /* draw for each layer */ - for (gpl= gpd->layers.first; gpl; gpl= gpl->next) { - gp_drawui_layer(block, gpd, gpl, &xco, &yco); - } - - /* return new height if necessary */ - return (yco < 0) ? (204 - yco) : 204; -#endif - return 0; -} - /* ************************************************** */ /* GREASE PENCIL DRAWING */ @@ -432,8 +165,8 @@ static void gp_draw_stroke_point (bGPDspoint *points, short thickness, short sfl co[1]= (points->y * winy) + offsy; } else { - co[0]= (points->x / 1000 * winx); - co[1]= (points->y / 1000 * winy); + co[0]= (points->x / 100 * winx); + co[1]= (points->y / 100 * winy); } /* if thickness is less than GP_DRAWTHICKNESS_SPECIAL, simple dot looks ok @@ -525,8 +258,8 @@ static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness, glVertex2f(x, y); } else { - const float x= (pt->x / 1000 * winx); - const float y= (pt->y / 1000 * winy); + const float x= (pt->x / 100 * winx); + const float y= (pt->y / 100 * winy); glVertex2f(x, y); } @@ -565,10 +298,10 @@ static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness, s1[1]= (pt2->y * winy) + offsy; } else { - s0[0]= (pt1->x / 1000 * winx); - s0[1]= (pt1->y / 1000 * winy); - s1[0]= (pt2->x / 1000 * winx); - s1[1]= (pt2->y / 1000 * winy); + s0[0]= (pt1->x / 100 * winx); + s0[1]= (pt1->y / 100 * winy); + s1[0]= (pt2->x / 100 * winx); + s1[1]= (pt2->y / 100 * winy); } /* calculate gradient and normal - 'angle'=(ny/nx) */ @@ -713,8 +446,8 @@ static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness, glVertex2f(x, y); } else { - const float x= (float)(pt->x / 1000 * winx); - const float y= (float)(pt->y / 1000 * winy); + const float x= (float)(pt->x / 100 * winx); + const float y= (float)(pt->y / 100 * winy); glVertex2f(x, y); } @@ -872,47 +605,7 @@ static void gp_draw_data (bGPdata *gpd, int offsx, int offsy, int winx, int winy /* turn off alpha blending, then smooth lines */ glDisable(GL_BLEND); // alpha blending glDisable(GL_LINE_SMOOTH); // smooth lines - - /* show info for debugging the status of gpencil */ -#if 0 - if ( ((dflag & GP_DRAWDATA_NOSTATUS)==0) && (gpd->flag & GP_DATA_DISPINFO) ) { - char printable[256]; - short xmax; - /* get text to display */ - if (actlay) { - if (gpd->flag & GP_DATA_EDITPAINT) - UI_ThemeColor(TH_BONE_POSE); // should be blue-ish - else if (actlay->actframe == NULL) - UI_ThemeColor(TH_REDALERT); - else if (actlay->actframe->framenum == cfra) - UI_ThemeColor(TH_VERTEX_SELECT); // should be yellow - else - UI_ThemeColor(TH_TEXT_HI); - - if (actlay->actframe) { - sprintf(printable, "GPencil: Layer ('%s'), Frame (%d)%s", - actlay->info, actlay->actframe->framenum, - ((gpd->flag & GP_DATA_EDITPAINT)?" , Draw Mode On":"") ); - } - else { - sprintf(printable, "GPencil: Layer ('%s'), Frame %s", - actlay->info, ((gpd->flag & GP_DATA_EDITPAINT)?" , Draw Mode On":"") ); - } - } - else { - UI_ThemeColor(TH_REDALERT); - sprintf(printable, "GPencil: Layer "); - } - xmax= GetButStringLength(printable); - - /* only draw it if view is wide enough (assume padding of 20 is enough for now) */ - if (winx > (xmax + 20)) { - BLF_draw_default(winx-xmax, winy-20, 0.0f, printable); - } - } -#endif - /* restore initial gl conditions */ glLineWidth(1.0); glPointSize(1.0); @@ -921,6 +614,12 @@ static void gp_draw_data (bGPdata *gpd, int offsx, int offsy, int winx, int winy /* ----- Grease Pencil Sketches Drawing API ------ */ +// ............................ +// XXX +// We need to review the calls below, since they may be/are not that suitable for +// the new ways that we intend to be drawing data... +// ............................ + /* draw grease-pencil sketches to specified 2d-view that uses ibuf corrections */ void draw_gpencil_2dimage (bContext *C, ImBuf *ibuf) { @@ -933,7 +632,7 @@ void draw_gpencil_2dimage (bContext *C, ImBuf *ibuf) /* check that we have grease-pencil stuff to draw */ if (ELEM(NULL, sa, ibuf)) return; - gpd= gpencil_data_getactive(C); + gpd= gpencil_data_get_active(C); // XXX if (gpd == NULL) return; /* calculate rect */ @@ -1007,7 +706,7 @@ void draw_gpencil_2dview (bContext *C, short onlyv2d) /* check that we have grease-pencil stuff to draw */ if (sa == NULL) return; - gpd= gpencil_data_getactive(C); + gpd= gpencil_data_get_active(C); // XXX if (gpd == NULL) return; /* draw it! */ @@ -1026,7 +725,7 @@ void draw_gpencil_3dview (bContext *C, short only3d) int dflag = 0; /* check that we have grease-pencil stuff to draw */ - gpd= gpencil_data_getactive(C); + gpd= gpencil_data_get_active(C); // XXX if (gpd == NULL) return; /* draw it! */ @@ -1046,7 +745,7 @@ void draw_gpencil_oglrender (bContext *C) /* assume gpencil data comes from v3d */ if (v3d == NULL) return; - gpd= gpencil_data_getactive(C); + gpd= gpencil_data_get_active(C); if (gpd == NULL) return; /* pass 1: draw 3d-strokes ------------ > */ diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c new file mode 100644 index 00000000000..87f3b60dcc2 --- /dev/null +++ b/source/blender/editors/gpencil/gpencil_buttons.c @@ -0,0 +1,334 @@ +/** + * $Id: drawgpencil.c 22802 2009-08-26 12:01:15Z aligorith $ + * + * ***** 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) 2008, Blender Foundation, Joshua Leung + * This is a new part of Blender + * + * Contributor(s): Joshua Leung + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include +#include +#include +#include + +#include "MEM_guardedalloc.h" + +#include "BLI_arithb.h" +#include "BLI_blenlib.h" + +#include "DNA_gpencil_types.h" +#include "DNA_listBase.h" +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_userdef_types.h" +#include "DNA_windowmanager_types.h" + +#include "BKE_context.h" +#include "BKE_global.h" +#include "BKE_gpencil.h" +#include "BKE_utildefines.h" + +#include "PIL_time.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "BIF_gl.h" +#include "BIF_glutil.h" + +#include "ED_gpencil.h" +#include "ED_sequencer.h" +#include "ED_util.h" + +#include "UI_interface.h" +#include "UI_resources.h" +#include "UI_view2d.h" + +#include "gpencil_intern.h" + +/* ************************************************** */ +/* GREASE PENCIL PANEL-UI DRAWING */ + +/* Every space which implements Grease-Pencil functionality should have a panel + * for the settings. All of the space-dependent parts should be coded in the panel + * code for that space, but the rest is all handled by generic panel here. + */ + +/* ------- Callbacks ----------- */ +/* These are just 'dummy wrappers' around gpencil api calls */ + +#if 0 +// XXX +/* make layer active one after being clicked on */ +void gp_ui_activelayer_cb (void *gpd, void *gpl) +{ + gpencil_layer_setactive(gpd, gpl); + + scrarea_queue_winredraw(curarea); + allqueue(REDRAWACTION, 0); +} + +/* rename layer and set active */ +void gp_ui_renamelayer_cb (void *gpd_arg, void *gpl_arg) +{ + bGPdata *gpd= (bGPdata *)gpd_arg; + bGPDlayer *gpl= (bGPDlayer *)gpl_arg; + + BLI_uniquename(&gpd->layers, gpl, "GP_Layer", '.', offsetof(bGPDlayer, info[0]), 128); + gpencil_layer_setactive(gpd, gpl); + + scrarea_queue_winredraw(curarea); + allqueue(REDRAWACTION, 0); +} + +/* add a new layer */ +void gp_ui_addlayer_cb (void *gpd, void *dummy) +{ + gpencil_layer_addnew(gpd); + + scrarea_queue_winredraw(curarea); + allqueue(REDRAWACTION, 0); +} + +/* delete active layer */ +void gp_ui_dellayer_cb (void *gpd, void *dummy) +{ + gpencil_layer_delactive(gpd); + + scrarea_queue_winredraw(curarea); + allqueue(REDRAWACTION, 0); +} + +/* delete last stroke of active layer */ +void gp_ui_delstroke_cb (void *gpd, void *gpl) +{ + bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0); + + if (gpf) { + if (gpf->framenum != CFRA) return; + + gpencil_layer_setactive(gpd, gpl); + gpencil_frame_delete_laststroke(gpl, gpf); + + scrarea_queue_winredraw(curarea); + } +} + +/* delete active frame of active layer */ +void gp_ui_delframe_cb (void *gpd, void *gpl) +{ + bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0); + + gpencil_layer_setactive(gpd, gpl); + gpencil_layer_delframe(gpl, gpf); + + scrarea_queue_winredraw(curarea); + allqueue(REDRAWACTION, 0); +} + +/* convert the active layer to geometry */ +void gp_ui_convertlayer_cb (void *gpd, void *gpl) +{ + gpencil_layer_setactive(gpd, gpl); + gpencil_convert_menu(); + + scrarea_queue_winredraw(curarea); +} +#endif + +/* ------- Drawing Code ------- */ + +#if 0 +/* XXX */ +/* draw the controls for a given layer */ +static void gp_drawui_layer (uiBlock *block, bGPdata *gpd, bGPDlayer *gpl, short *xco, short *yco) +{ + uiBut *but; + short active= (gpl->flag & GP_LAYER_ACTIVE); + short width= 314; + short height; + int rb_col; + + /* unless button has own callback, it adds this callback to button */ + uiBlockSetFunc(block, gp_ui_activelayer_cb, gpd, gpl); + + /* draw header */ + { + uiBlockSetEmboss(block, UI_EMBOSSN); + + /* rounded header */ + if (active) uiBlockSetCol(block, TH_BUT_ACTION); + rb_col= (active)?-20:20; + uiDefBut(block, ROUNDBOX, B_REDR, "", *xco-8, *yco-2, width, 24, NULL, 5.0, 0.0, 15.0, (float)(rb_col-20), ""); + if (active) uiBlockSetCol(block, TH_AUTO); + + /* lock toggle */ + uiDefIconButBitI(block, ICONTOG, GP_LAYER_LOCKED, B_REDR, ICON_UNLOCKED, *xco-7, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Layer cannot be modified"); + } + + /* when layer is locked or hidden, only draw header */ + if (gpl->flag & (GP_LAYER_LOCKED|GP_LAYER_HIDE)) { + char name[256]; /* gpl->info is 128, but we need space for 'locked/hidden' as well */ + + height= 0; + + /* visibility button (only if hidden but not locked!) */ + if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED)) + uiDefIconButBitI(block, ICONTOG, GP_LAYER_HIDE, B_REDR, ICON_RESTRICT_VIEW_OFF, *xco+12, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Visibility of layer"); + + /* name */ + if (gpl->flag & GP_LAYER_HIDE) + sprintf(name, "%s (Hidden)", gpl->info); + else + sprintf(name, "%s (Locked)", gpl->info); + uiDefBut(block, LABEL, 1, name, *xco+35, *yco, 240, 20, NULL, 0.0, 0.0, 0, 0, "Short description of what this layer is for (optional)"); + + /* delete button (only if hidden but not locked!) */ + if ((gpl->flag & GP_LAYER_HIDE) & !(gpl->flag & GP_LAYER_LOCKED)) { + but= uiDefIconBut(block, BUT, B_REDR, ICON_X, *xco+(width-30), *yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer"); + uiButSetFunc(but, gp_ui_dellayer_cb, gpd, NULL); + } + uiBlockSetEmboss(block, UI_EMBOSS); + } + else { + height= 97; + + /* draw rest of header */ + { + /* visibility button */ + uiDefIconButBitI(block, ICONTOG, GP_LAYER_HIDE, B_REDR, ICON_RESTRICT_VIEW_OFF, *xco+12, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Visibility of layer"); + + uiBlockSetEmboss(block, UI_EMBOSS); + + /* name */ + but= uiDefButC(block, TEX, B_REDR, "Info:", *xco+36, *yco, 240, 19, gpl->info, 0, 127, 0, 0, "Short description of what this layer is for (optional)"); + uiButSetFunc(but, gp_ui_renamelayer_cb, gpd, gpl); + + /* delete 'button' */ + uiBlockSetEmboss(block, UI_EMBOSSN); + + but= uiDefIconBut(block, BUT, B_REDR, ICON_X, *xco+(width-30), *yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer"); + uiButSetFunc(but, gp_ui_dellayer_cb, gpd, NULL); + + uiBlockSetEmboss(block, UI_EMBOSS); + } + + /* draw backdrop */ + if (active) uiBlockSetCol(block, TH_BUT_ACTION); + uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-8, *yco-height, width, height-1, NULL, 5.0, 0.0, 12.0, (float)rb_col, ""); + if (active) uiBlockSetCol(block, TH_AUTO); + + /* draw settings */ + { + /* color */ + uiBlockBeginAlign(block); + uiDefButF(block, COL, B_REDR, "", *xco, *yco-26, 150, 19, gpl->color, 0, 0, 0, 0, "Color to use for all strokes on this Grease Pencil Layer"); + uiDefButF(block, NUMSLI, B_REDR, "Opacity: ", *xco,*yco-45,150,19, &gpl->color[3], 0.3f, 1.0f, 0, 0, "Visibility of stroke (0.3 to 1.0)"); + uiBlockEndAlign(block); + + /* stroke thickness */ + uiDefButS(block, NUMSLI, B_REDR, "Thickness:", *xco, *yco-75, 150, 20, &gpl->thickness, 1, 10, 0, 0, "Thickness of strokes (in pixels)"); + + /* debugging options */ + if (G.f & G_DEBUG) { + uiDefButBitI(block, TOG, GP_LAYER_DRAWDEBUG, B_REDR, "Show Points", *xco, *yco-95, 150, 20, &gpl->flag, 0, 0, 0, 0, "Show points which form the strokes"); + } + + /* onion-skinning */ + uiBlockBeginAlign(block); + uiDefButBitI(block, TOG, GP_LAYER_ONIONSKIN, B_REDR, "Onion-Skin", *xco+160, *yco-26, 140, 20, &gpl->flag, 0, 0, 0, 0, "Ghost frames on either side of frame"); + uiDefButS(block, NUMSLI, B_REDR, "GStep:", *xco+160, *yco-46, 140, 20, &gpl->gstep, 0, 120, 0, 0, "Max number of frames on either side of active frame to show (0 = just 'first' available sketch on either side)"); + uiBlockEndAlign(block); + + /* options */ + uiBlockBeginAlign(block); + if (curarea->spacetype == SPACE_VIEW3D) { + but= uiDefBut(block, BUT, B_REDR, "Convert to...", *xco+160, *yco-75, 140, 20, NULL, 0, 0, 0, 0, "Converts this layer's strokes to geometry (Hotkey = Alt-Shift-C)"); + uiButSetFunc(but, gp_ui_convertlayer_cb, gpd, gpl); + } + else { + but= uiDefBut(block, BUT, B_REDR, "Del Active Frame", *xco+160, *yco-75, 140, 20, NULL, 0, 0, 0, 0, "Erases the the active frame for this layer (Hotkey = Alt-XKEY/DEL)"); + uiButSetFunc(but, gp_ui_delframe_cb, gpd, gpl); + } + + but= uiDefBut(block, BUT, B_REDR, "Del Last Stroke", *xco+160, *yco-95, 140, 20, NULL, 0, 0, 0, 0, "Erases the last stroke from the active frame (Hotkey = Alt-XKEY/DEL)"); + uiButSetFunc(but, gp_ui_delstroke_cb, gpd, gpl); + uiBlockEndAlign(block); + } + } + + /* adjust height for new to start */ + (*yco) -= (height + 27); +} +#endif +/* Draw the contents for a grease-pencil panel. This assumes several things: + * - that panel has been created, is 318 x 204. max yco is 225 + * - that a toggle for turning on/off gpencil drawing is 150 x 20, starting from (10,225) + * which is basically the top left-hand corner + * It will return the amount of extra space to extend the panel by + */ +short draw_gpencil_panel (uiBlock *block, bGPdata *gpd, ScrArea *sa) +{ +#if 0 + uiBut *but; + bGPDlayer *gpl; + short xco= 10, yco= 170; + + /* draw gpd settings first */ + { + /* add new layer buttons */ + but= uiDefBut(block, BUT, B_REDR, "Add New Layer", 10,205,150,20, 0, 0, 0, 0, 0, "Adds a new Grease Pencil Layer"); + uiButSetFunc(but, gp_ui_addlayer_cb, gpd, NULL); + + + /* show override lmb-clicks button + painting lock */ + uiBlockBeginAlign(block); + if ((gpd->flag & GP_DATA_EDITPAINT)==0) { + uiDefButBitI(block, TOG, GP_DATA_EDITPAINT, B_REDR, "Draw Mode", 170, 225, 130, 20, &gpd->flag, 0, 0, 0, 0, "Interpret click-drag as new strokes"); + + uiBlockSetCol(block, TH_BUT_SETTING); + uiDefIconButBitI(block, ICONTOG, GP_DATA_LMBPLOCK, B_REDR, ICON_UNLOCKED, 300, 225, 20, 20, &gpd->flag, 0.0, 0.0, 0, 0, "Painting cannot occur with Shift-LMB (when making selections)"); + uiBlockSetCol(block, TH_AUTO); + } + else + uiDefButBitI(block, TOG, GP_DATA_EDITPAINT, B_REDR, "Draw Mode", 170, 225, 150, 20, &gpd->flag, 0, 0, 0, 0, "Interpret click-drag as new strokes"); + uiBlockEndAlign(block); + + /* 'view align' button (naming depends on context) */ + if (sa->spacetype == SPACE_VIEW3D) + uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Sketch in 3D", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added in 3D-space"); + else + uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Stick to View", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added on 2d-canvas"); + } + + /* draw for each layer */ + for (gpl= gpd->layers.first; gpl; gpl= gpl->next) { + gp_drawui_layer(block, gpd, gpl, &xco, &yco); + } + + /* return new height if necessary */ + return (yco < 0) ? (204 - yco) : 204; +#endif + return 0; +} + +/* ************************************************** */ diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 4480da45572..3130e190ce2 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -17,7 +17,7 @@ * 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) 2008, Blender Foundation + * The Original Code is Copyright (C) 2008, Blender Foundation, Joshua Leung * This is a new part of Blender * * Contributor(s): Joshua Leung @@ -25,8 +25,7 @@ * ***** END GPL LICENSE BLOCK ***** */ -#if 0 // XXX COMPILE GUARDS FOR OLD CODE - + #include #include #include @@ -69,6 +68,8 @@ #include "WM_api.h" #include "WM_types.h" +#include "RNA_access.h" + #include "UI_view2d.h" #include "ED_armature.h" @@ -76,1627 +77,70 @@ #include "ED_sequencer.h" #include "ED_view3d.h" -#include "PIL_time.h" /* sleep */ - #include "gpencil_intern.h" -/* XXX */ -static void BIF_undo_push() {} -static void error() {} -static int pupmenu() {return 0;} -static void add_object_draw() {} -static int get_activedevice() {return 0;} -#define L_MOUSE 0 -#define R_MOUSE 0 +/* ************************************************ */ +/* Context Wrangling... */ -/* ************************************************** */ -/* XXX - OLD DEPRECEATED CODE... */ - -/* ----------- GP-Datablock API ------------- */ - -/* get the appropriate bGPdata from the active/given context */ -// XXX region or region data? -bGPdata *gpencil_data_getactive (ScrArea *sa) +/* Get pointer to active Grease Pencil datablock, and an RNA-pointer to trace back to whatever owns it */ +bGPdata **gpencil_data_get_pointers (bContext *C, PointerRNA *ptr) { - ScrArea *curarea= NULL; // XXX + Scene *scene= CTX_data_scene(C); + ScrArea *sa= CTX_wm_area(C); - /* error checking */ - if ((sa == NULL) && (curarea == NULL)) - return NULL; - if (sa == NULL) - sa= curarea; - - /* handle depending on spacetype */ - switch (sa->spacetype) { - case SPACE_VIEW3D: - { - View3D *v3d= sa->spacedata.first; - return v3d->gpd; - } - break; - case SPACE_NODE: - { - SpaceNode *snode= sa->spacedata.first; - return snode->gpd; - } - break; - case SPACE_SEQ: - { - SpaceSeq *sseq= sa->spacedata.first; - - /* only applicable for image modes */ - if (sseq->mainb != SEQ_DRAW_SEQUENCE) - return sseq->gpd; - } - break; - case SPACE_IMAGE: - { - SpaceImage *sima= sa->spacedata.first; - return sima->gpd; - } - break; - } - - /* nothing found */ - return NULL; -} - -/* set bGPdata for the active/given context, and return success/fail */ -short gpencil_data_setactive (ScrArea *sa, bGPdata *gpd) -{ - ScrArea *curarea= NULL; // XXX - - /* error checking */ - if ((sa == NULL) && (curarea == NULL)) - return 0; - if (gpd == NULL) - return 0; - if (sa == NULL) - sa= curarea; - - /* handle depending on spacetype */ - // TODO: someday we should have multi-user data, so no need to loose old data - switch (sa->spacetype) { - case SPACE_VIEW3D: - { - View3D *v3d= sa->spacedata.first; - - /* free the existing block */ - if (v3d->gpd) - free_gpencil_data(v3d->gpd); - v3d->gpd= gpd; - - return 1; - } - break; - case SPACE_NODE: - { - SpaceNode *snode= sa->spacedata.first; - - /* free the existing block */ - if (snode->gpd) - free_gpencil_data(snode->gpd); - snode->gpd= gpd; - - /* set special settings */ - gpd->flag |= GP_DATA_VIEWALIGN; - - return 1; - } - break; - case SPACE_SEQ: - { - SpaceSeq *sseq= sa->spacedata.first; - - /* only applicable if right mode */ - if (sseq->mainb != SEQ_DRAW_SEQUENCE) { - /* free the existing block */ - if (sseq->gpd) - free_gpencil_data(sseq->gpd); - sseq->gpd= gpd; - - return 1; - } - } - break; - case SPACE_IMAGE: - { - SpaceImage *sima= sa->spacedata.first; - - if (sima->gpd) - free_gpencil_data(sima->gpd); - sima->gpd= gpd; - - return 1; - } - break; - } - - /* failed to add */ - return 0; -} - -/* return the ScrArea that has the given GP-datablock - * - assumes that only searching in current screen - * - is based on GP-datablocks only being able to - * exist for one area at a time (i.e. not multiuser) - */ -ScrArea *gpencil_data_findowner (bGPdata *gpd) -{ - bScreen *curscreen= NULL; // XXX - ScrArea *sa; - - /* error checking */ - if (gpd == NULL) - return NULL; - - /* loop over all scrareas for current screen, and check if that area has this gpd */ - for (sa= curscreen->areabase.first; sa; sa= sa->next) { - /* use get-active func to see if match */ - if (gpencil_data_getactive(sa) == gpd) - return sa; - } - - /* not found */ - return NULL; -} - -/* ************************************************** */ -/* GREASE-PENCIL EDITING - Tools */ - -/* --------- Data Deletion ---------- */ - -/* delete the last stroke on the active layer */ -void gpencil_delete_laststroke (bGPdata *gpd, int cfra) -{ - bGPDlayer *gpl= gpencil_layer_getactive(gpd); - bGPDframe *gpf= gpencil_layer_getframe(gpl, cfra, 0); - - gpencil_frame_delete_laststroke(gpl, gpf); -} - -/* delete the active frame */ -void gpencil_delete_actframe (bGPdata *gpd, int cfra) -{ - bGPDlayer *gpl= gpencil_layer_getactive(gpd); - bGPDframe *gpf= gpencil_layer_getframe(gpl, cfra, 0); - - gpencil_layer_delframe(gpl, gpf); -} - - - -/* delete various grase-pencil elements - * mode: 1 - last stroke - * 2 - active frame - * 3 - active layer - */ -void gpencil_delete_operation (int cfra, short mode) -{ - bGPdata *gpd; - - /* get datablock to work on */ - gpd= gpencil_data_getactive(NULL); - if (gpd == NULL) return; - - switch (mode) { - case 1: /* last stroke */ - gpencil_delete_laststroke(gpd, cfra); - break; - case 2: /* active frame */ - gpencil_delete_actframe(gpd, cfra); - break; - case 3: /* active layer */ - gpencil_layer_delactive(gpd); - break; - } - - /* redraw and undo-push */ - BIF_undo_push("GPencil Delete"); -} - -/* display a menu for deleting different grease-pencil elements */ -void gpencil_delete_menu (void) -{ - bGPdata *gpd= gpencil_data_getactive(NULL); - int cfra= 0; // XXX - short mode; - - /* only show menu if it will be relevant */ - if (gpd == NULL) return; - - mode= pupmenu("Grease Pencil Erase...%t|Last Stroke%x1|Active Frame%x2|Active Layer%x3"); - if (mode <= 0) return; - - gpencil_delete_operation(cfra, mode); -} - -/* --------- Data Conversion ---------- */ - -/* convert the coordinates from the given stroke point into 3d-coordinates */ -static void gp_strokepoint_convertcoords (bGPDstroke *gps, bGPDspoint *pt, float p3d[3]) -{ - ARegion *ar= NULL; // XXX - - if (gps->flag & GP_STROKE_3DSPACE) { - /* directly use 3d-coordinates */ - VecCopyf(p3d, &pt->x); - } - else { - short mval[2]; - int mx=0, my=0; - float *fp= give_cursor(NULL, NULL); // XXX should be scene, v3d - float dvec[3]; - - /* get screen coordinate */ - if (gps->flag & GP_STROKE_2DSPACE) { - // XXX - // View2D *v2d= spacelink_get_view2d(curarea->spacedata.first); - // UI_view2d_view_to_region(v2d, pt->x, pt->y, &mx, &my); - } - else { - // XXX - // mx= (short)(pt->x / 1000 * curarea->winx); - // my= (short)(pt->y / 1000 * curarea->winy); - } - - /* convert screen coordinate to 3d coordinates - * - method taken from editview.c - mouse_cursor() - */ - project_short_noclip(ar, fp, mval); - window_to_3d_delta(ar, dvec, mval[0]-mx, mval[1]-my); - VecSubf(p3d, fp, dvec); - } -} - -/* --- */ - -/* convert stroke to 3d path */ -static void gp_stroke_to_path (bGPDlayer *gpl, bGPDstroke *gps, Curve *cu) -{ - bGPDspoint *pt; - Nurb *nu; - BPoint *bp; - int i; - - /* create new 'nurb' within the curve */ - nu = (Nurb *)MEM_callocN(sizeof(Nurb), "gpstroke_to_path(nurb)"); - - nu->pntsu= gps->totpoints; - nu->pntsv= 1; - nu->orderu= gps->totpoints; - nu->flagu= 2; /* endpoint */ - nu->resolu= 32; - - nu->bp= (BPoint *)MEM_callocN(sizeof(BPoint)*gps->totpoints, "bpoints"); - - /* add points */ - for (i=0, pt=gps->points, bp=nu->bp; i < gps->totpoints; i++, pt++, bp++) { - float p3d[3]; - - /* get coordinates to add at */ - gp_strokepoint_convertcoords(gps, pt, p3d); - VecCopyf(bp->vec, p3d); - - /* set settings */ - bp->f1= SELECT; - bp->radius = bp->weight = pt->pressure * gpl->thickness; - } - - /* add nurb to curve */ - BLI_addtail(&cu->nurb, nu); -} - -/* convert stroke to 3d bezier */ -static void gp_stroke_to_bezier (bGPDlayer *gpl, bGPDstroke *gps, Curve *cu) -{ - bGPDspoint *pt; - Nurb *nu; - BezTriple *bezt; - int i; - - /* create new 'nurb' within the curve */ - nu = (Nurb *)MEM_callocN(sizeof(Nurb), "gpstroke_to_bezier(nurb)"); - - nu->pntsu= gps->totpoints; - nu->resolu= 12; - nu->resolv= 12; - nu->type= CU_BEZIER; - nu->bezt = (BezTriple *)MEM_callocN(gps->totpoints*sizeof(BezTriple), "bezts"); - - /* add points */ - for (i=0, pt=gps->points, bezt=nu->bezt; i < gps->totpoints; i++, pt++, bezt++) { - float p3d[3]; - - /* get coordinates to add at */ - gp_strokepoint_convertcoords(gps, pt, p3d); - - /* TODO: maybe in future the handles shouldn't be in same place */ - VecCopyf(bezt->vec[0], p3d); - VecCopyf(bezt->vec[1], p3d); - VecCopyf(bezt->vec[2], p3d); - - /* set settings */ - bezt->h1= bezt->h2= HD_FREE; - bezt->f1= bezt->f2= bezt->f3= SELECT; - bezt->radius = bezt->weight = pt->pressure * gpl->thickness * 0.1f; - } - - /* must calculate handles or else we crash */ - calchandlesNurb(nu); - - /* add nurb to curve */ - BLI_addtail(&cu->nurb, nu); -} - -/* convert a given grease-pencil layer to a 3d-curve representation (using current view if appropriate) */ -static void gp_layer_to_curve (bGPdata *gpd, bGPDlayer *gpl, Scene *scene, short mode) -{ - bGPDframe *gpf= gpencil_layer_getframe(gpl, scene->r.cfra, 0); - bGPDstroke *gps; - Object *ob; - Curve *cu; - - /* error checking */ - if (ELEM3(NULL, gpd, gpl, gpf)) - return; - - /* only convert if there are any strokes on this layer's frame to convert */ - if (gpf->strokes.first == NULL) - return; - - /* init the curve object (remove rotation and get curve data from it) - * - must clear transforms set on object, as those skew our results + /* if there's an active area, check if the particular editor may + * have defined any special Grease Pencil context for editing... */ - add_object_draw(OB_CURVE); - ob= OBACT; - ob->loc[0]= ob->loc[1]= ob->loc[2]= 0; - ob->rot[0]= ob->rot[1]= ob->rot[2]= 0; - cu= ob->data; - cu->flag |= CU_3D; - - /* rename object and curve to layer name */ - rename_id((ID *)ob, gpl->info); - rename_id((ID *)cu, gpl->info); - - /* add points to curve */ - for (gps= gpf->strokes.first; gps; gps= gps->next) { - switch (mode) { - case 1: - gp_stroke_to_path(gpl, gps, cu); - break; - case 2: - gp_stroke_to_bezier(gpl, gps, cu); - break; - } - } -} - -/* --- */ - -/* convert a stroke to a bone chain */ -static void gp_stroke_to_bonechain (bGPDlayer *gpl, bGPDstroke *gps, bArmature *arm, ListBase *bones) -{ - EditBone *ebo, *prev=NULL; - bGPDspoint *pt, *ptn; - int i; - - /* add each segment separately */ - for (i=0, pt=gps->points, ptn=gps->points+1; i < (gps->totpoints-1); prev=ebo, i++, pt++, ptn++) { - float p3da[3], p3db[3]; - - /* get coordinates to add at */ - gp_strokepoint_convertcoords(gps, pt, p3da); - gp_strokepoint_convertcoords(gps, ptn, p3db); - - /* allocate new bone */ - ebo= MEM_callocN(sizeof(EditBone), "eBone"); - - VecCopyf(ebo->head, p3da); - VecCopyf(ebo->tail, p3db); - - /* add new bone - note: sync with editarmature.c::add_editbone() */ - { - BLI_strncpy(ebo->name, "Stroke", 32); - unique_editbone_name(bones, ebo->name, NULL); - - BLI_addtail(bones, ebo); - - if (i > 0) + if (sa) { + switch (sa->spacetype) { + case SPACE_VIEW3D: /* 3D-View */ { - ebo->flag |= BONE_CONNECTED; - } - ebo->weight= 1.0f; - ebo->dist= 0.25f; - ebo->xwidth= 0.1f; - ebo->zwidth= 0.1f; - ebo->ease1= 1.0f; - ebo->ease2= 1.0f; - ebo->rad_head= pt->pressure * gpl->thickness * 0.1f; - ebo->rad_tail= ptn->pressure * gpl->thickness * 0.1f; - ebo->segments= 1; - ebo->layer= arm->layer; - } - - /* set parenting */ - ebo->parent= prev; - } -} - -/* convert a given grease-pencil layer to a 3d-curve representation (using current view if appropriate) */ -// XXX depreceated... we now have etch-a-ton for this... -static void gp_layer_to_armature (bGPdata *gpd, bGPDlayer *gpl, Scene *scene, View3D *v3d, short mode) -{ - bGPDframe *gpf= gpencil_layer_getframe(gpl, scene->r.cfra, 0); - bGPDstroke *gps; - Object *ob; - bArmature *arm; - - /* error checking */ - if (ELEM3(NULL, gpd, gpl, gpf)) - return; - - /* only convert if there are any strokes on this layer's frame to convert */ - if (gpf->strokes.first == NULL) - return; - - /* init the armature object (remove rotation and assign armature data to it) - * - must clear transforms set on object, as those skew our results - */ - add_object_draw(OB_ARMATURE); - ob= OBACT; - ob->loc[0]= ob->loc[1]= ob->loc[2]= 0; - ob->rot[0]= ob->rot[1]= ob->rot[2]= 0; - arm= ob->data; - - /* rename object and armature to layer name */ - rename_id((ID *)ob, gpl->info); - rename_id((ID *)arm, gpl->info); - - /* this is editmode armature */ - arm->edbo= MEM_callocN(sizeof(ListBase), "arm edbo"); - - /* convert segments to bones, strokes to bone chains */ - for (gps= gpf->strokes.first; gps; gps= gps->next) { - gp_stroke_to_bonechain(gpl, gps, arm, arm->edbo); - } - - /* adjust roll of bones - * - set object as EditMode object, but need to clear afterwards! - * - use 'align to world z-up' option - */ - { - /* set our data as if we're in editmode to fool auto_align_armature() */ - scene->obedit= ob; - - /* WARNING: need to make sure this magic number doesn't change */ - auto_align_armature(scene, v3d, 2); - - scene->obedit= NULL; - } - - /* flush editbones to armature */ - ED_armature_from_edit(scene, ob); - ED_armature_edit_free(ob); -} - -/* --- */ - -/* convert grease-pencil strokes to another representation - * mode: 1 - Active layer to path - * 2 - Active layer to bezier - * 3 - Active layer to armature - */ -void gpencil_convert_operation (short mode) -{ - Scene *scene= NULL; // XXX - View3D *v3d= NULL; // XXX - RegionView3D *rv3d= NULL; // XXX - bGPdata *gpd; - float *fp= give_cursor(scene, v3d); - - /* get datablock to work on */ - gpd= gpencil_data_getactive(NULL); - if (gpd == NULL) return; - - /* initialise 3d-cursor correction globals */ - initgrabz(rv3d, fp[0], fp[1], fp[2]); - - /* handle selection modes */ - switch (mode) { - case 1: /* active layer only (to path) */ - case 2: /* active layer only (to bezier) */ - { - bGPDlayer *gpl= gpencil_layer_getactive(gpd); - gp_layer_to_curve(gpd, gpl, scene, mode); - } - break; - case 3: /* active layer only (to armature) */ - { - bGPDlayer *gpl= gpencil_layer_getactive(gpd); - gp_layer_to_armature(gpd, gpl, scene, v3d, mode); - } - break; - } - - /* redraw and undo-push */ - BIF_undo_push("GPencil Convert"); -} - -/* ************************************************** */ -/* GREASE-PENCIL EDITING MODE - Painting */ - -/* ---------- 'Globals' and Defines ----------------- */ - -/* maximum sizes of gp-session buffer */ -#define GP_STROKE_BUFFER_MAX 5000 - -/* Macros for accessing sensitivity thresholds... */ - /* minimum number of pixels mouse should move before new point created */ -#define MIN_MANHATTEN_PX (U.gp_manhattendist) - /* minimum length of new segment before new point can be added */ -#define MIN_EUCLIDEAN_PX (U.gp_euclideandist) - -/* macro to test if only converting endpoints - only for use when converting! */ -#define GP_BUFFER2STROKE_ENDPOINTS ((gpd->flag & GP_DATA_EDITPAINT) && (ctrl)) - -/* ------ */ - -/* Temporary 'Stroke' Operation data */ -typedef struct tGPsdata { - Scene *scene; /* current scene from context */ - ScrArea *sa; /* area where painting originated */ - ARegion *ar; /* region where painting originated */ - View2D *v2d; /* needed for GP_STROKE_2DSPACE */ - - ImBuf *ibuf; /* needed for GP_STROKE_2DIMAGE */ - struct IBufViewSettings { - int offsx, offsy; /* offsets */ - int sizex, sizey; /* dimensions to use as scale-factor */ - } im2d_settings; /* needed for GP_STROKE_2DIMAGE */ - - bGPdata *gpd; /* gp-datablock layer comes from */ - bGPDlayer *gpl; /* layer we're working on */ - bGPDframe *gpf; /* frame we're working on */ - - short status; /* current status of painting */ - short paintmode; /* mode for painting */ - - short mval[2]; /* current mouse-position */ - short mvalo[2]; /* previous recorded mouse-position */ - - float pressure; /* current stylus pressure */ - float opressure; /* previous stylus pressure */ - - short radius; /* radius of influence for eraser */ -} tGPsdata; - -/* values for tGPsdata->status */ -enum { - GP_STATUS_NORMAL = 0, /* running normally */ - GP_STATUS_ERROR, /* something wasn't correctly set up */ - GP_STATUS_DONE /* painting done */ -}; - -/* values for tGPsdata->paintmode */ -enum { - GP_PAINTMODE_DRAW = 0, - GP_PAINTMODE_ERASER -}; - -/* Return flags for adding points to stroke buffer */ -enum { - GP_STROKEADD_INVALID = -2, /* error occurred - insufficient info to do so */ - GP_STROKEADD_OVERFLOW = -1, /* error occurred - cannot fit any more points */ - GP_STROKEADD_NORMAL, /* point was successfully added */ - GP_STROKEADD_FULL /* cannot add any more points to buffer */ -}; - -/* ---------- Stroke Editing ------------ */ - -/* clear the session buffers (call this before AND after a paint operation) */ -static void gp_session_validatebuffer (tGPsdata *p) -{ - bGPdata *gpd= p->gpd; - - /* clear memory of buffer (or allocate it if starting a new session) */ - if (gpd->sbuffer) - memset(gpd->sbuffer, 0, sizeof(tGPspoint)*GP_STROKE_BUFFER_MAX); - else - gpd->sbuffer= MEM_callocN(sizeof(tGPspoint)*GP_STROKE_BUFFER_MAX, "gp_session_strokebuffer"); - - /* reset indices */ - gpd->sbuffer_size = 0; - - /* reset flags */ - gpd->sbuffer_sflag= 0; -} - -/* check if the current mouse position is suitable for adding a new point */ -static short gp_stroke_filtermval (tGPsdata *p, short mval[2], short pmval[2]) -{ - short dx= abs(mval[0] - pmval[0]); - short dy= abs(mval[1] - pmval[1]); - - /* check if mouse moved at least certain distance on both axes (best case) */ - if ((dx > MIN_MANHATTEN_PX) && (dy > MIN_MANHATTEN_PX)) - return 1; - - /* check if the distance since the last point is significant enough */ - // future optimisation: sqrt here may be too slow? - else if (sqrt(dx*dx + dy*dy) > MIN_EUCLIDEAN_PX) - return 1; - - /* mouse 'didn't move' */ - else - return 0; -} - -/* convert screen-coordinates to buffer-coordinates */ -static void gp_stroke_convertcoords (tGPsdata *p, short mval[], float out[]) -{ - bGPdata *gpd= p->gpd; - - /* in 3d-space - pt->x/y/z are 3 side-by-side floats */ - if (gpd->sbuffer_sflag & GP_STROKE_3DSPACE) { - const short mx=mval[0], my=mval[1]; - float *fp= give_cursor(p->scene, NULL); // XXX NULL could be v3d - float dvec[3]; - - /* Current method just converts each point in screen-coordinates to - * 3D-coordinates using the 3D-cursor as reference. In general, this - * works OK, but it could of course be improved. - * - * TODO: - * - investigate using nearest point(s) on a previous stroke as - * reference point instead or as offset, for easier stroke matching - * - investigate projection onto geometry (ala retopo) - */ - - /* method taken from editview.c - mouse_cursor() */ - project_short_noclip(p->ar, fp, mval); - window_to_3d_delta(p->ar, dvec, mval[0]-mx, mval[1]-my); - VecSubf(out, fp, dvec); - } - - /* 2d - on 'canvas' (assume that p->v2d is set) */ - else if ((gpd->sbuffer_sflag & GP_STROKE_2DSPACE) && (p->v2d)) { - float x, y; - - UI_view2d_region_to_view(p->v2d, mval[0], mval[1], &x, &y); - - out[0]= x; - out[1]= y; - } - - /* 2d - on image 'canvas' (assume that p->v2d is set) */ - else if (gpd->sbuffer_sflag & GP_STROKE_2DIMAGE) { - int sizex, sizey, offsx, offsy; - - /* get stored settings - * - assume that these have been set already (there are checks that set sane 'defaults' just in case) - */ - sizex= p->im2d_settings.sizex; - sizey= p->im2d_settings.sizey; - offsx= p->im2d_settings.offsx; - offsy= p->im2d_settings.offsy; - - /* calculate new points */ - out[0]= (float)(mval[0] - offsx) / (float)sizex; - out[1]= (float)(mval[1] - offsy) / (float)sizey; - } - - /* 2d - relative to screen (viewport area) */ - else { - out[0] = (float)(mval[0]) / (float)(p->sa->winx) * 1000; - out[1] = (float)(mval[1]) / (float)(p->sa->winy) * 1000; - } -} - -/* add current stroke-point to buffer (returns whether point was successfully added) */ -static short gp_stroke_addpoint (tGPsdata *p, short mval[2], float pressure) -{ - bGPdata *gpd= p->gpd; - tGPspoint *pt; - - /* check if still room in buffer */ - if (gpd->sbuffer_size >= GP_STROKE_BUFFER_MAX) - return GP_STROKEADD_OVERFLOW; - - /* get pointer to destination point */ - pt= ((tGPspoint *)(gpd->sbuffer) + gpd->sbuffer_size); - - /* store settings */ - pt->x= mval[0]; - pt->y= mval[1]; - pt->pressure= pressure; - - /* increment counters */ - gpd->sbuffer_size++; - - /* check if another operation can still occur */ - if (gpd->sbuffer_size == GP_STROKE_BUFFER_MAX) - return GP_STROKEADD_FULL; - else - return GP_STROKEADD_NORMAL; -} - -/* smooth a stroke (in buffer) before storing it */ -static void gp_stroke_smooth (tGPsdata *p) -{ - bGPdata *gpd= p->gpd; - int i=0, cmx=gpd->sbuffer_size; - int ctrl= 0; // XXX - - /* only smooth if smoothing is enabled, and we're not doing a straight line */ - if (!(U.gp_settings & GP_PAINT_DOSMOOTH) || GP_BUFFER2STROKE_ENDPOINTS) - return; - - /* don't try if less than 2 points in buffer */ - if ((cmx <= 2) || (gpd->sbuffer == NULL)) - return; - - /* apply weighting-average (note doing this along path sequentially does introduce slight error) */ - for (i=0; i < gpd->sbuffer_size; i++) { - tGPspoint *pc= (((tGPspoint *)gpd->sbuffer) + i); - tGPspoint *pb= (i-1 > 0)?(pc-1):(pc); - tGPspoint *pa= (i-2 > 0)?(pc-2):(pb); - tGPspoint *pd= (i+1 < cmx)?(pc+1):(pc); - tGPspoint *pe= (i+2 < cmx)?(pc+2):(pd); - - pc->x= (short)(0.1*pa->x + 0.2*pb->x + 0.4*pc->x + 0.2*pd->x + 0.1*pe->x); - pc->y= (short)(0.1*pa->y + 0.2*pb->y + 0.4*pc->y + 0.2*pd->y + 0.1*pe->y); - } -} - -/* simplify a stroke (in buffer) before storing it - * - applies a reverse Chaikin filter - * - code adapted from etch-a-ton branch (editarmature_sketch.c) - */ -static void gp_stroke_simplify (tGPsdata *p) -{ - bGPdata *gpd= p->gpd; - tGPspoint *old_points= (tGPspoint *)gpd->sbuffer; - short num_points= gpd->sbuffer_size; - short flag= gpd->sbuffer_sflag; - short i, j; - int ctrl= 0; // XXX - - /* only simplify if simlification is enabled, and we're not doing a straight line */ - if (!(U.gp_settings & GP_PAINT_DOSIMPLIFY) || GP_BUFFER2STROKE_ENDPOINTS) - return; - - /* don't simplify if less than 4 points in buffer */ - if ((num_points <= 2) || (old_points == NULL)) - return; - - /* clear buffer (but don't free mem yet) so that we can write to it - * - firstly set sbuffer to NULL, so a new one is allocated - * - secondly, reset flag after, as it gets cleared auto - */ - gpd->sbuffer= NULL; - gp_session_validatebuffer(p); - gpd->sbuffer_sflag = flag; - -/* macro used in loop to get position of new point - * - used due to the mixture of datatypes in use here - */ -#define GP_SIMPLIFY_AVPOINT(offs, sfac) \ - { \ - co[0] += (float)(old_points[offs].x * sfac); \ - co[1] += (float)(old_points[offs].y * sfac); \ - pressure += old_points[offs].pressure * sfac; \ - } - - for (i = 0, j = 0; i < num_points; i++) - { - if (i - j == 3) - { - float co[2], pressure; - short mco[2]; - - /* initialise values */ - co[0]= 0; - co[1]= 0; - pressure = 0; - - /* using macro, calculate new point */ - GP_SIMPLIFY_AVPOINT(j, -0.25f); - GP_SIMPLIFY_AVPOINT(j+1, 0.75f); - GP_SIMPLIFY_AVPOINT(j+2, 0.75f); - GP_SIMPLIFY_AVPOINT(j+3, -0.25f); - - /* set values for adding */ - mco[0]= (short)co[0]; - mco[1]= (short)co[1]; - - /* ignore return values on this... assume to be ok for now */ - gp_stroke_addpoint(p, mco, pressure); - - j += 2; - } - } - - /* free old buffer */ - MEM_freeN(old_points); -} - - -/* make a new stroke from the buffer data */ -static void gp_stroke_newfrombuffer (tGPsdata *p) -{ - bGPdata *gpd= p->gpd; - bGPDstroke *gps; - bGPDspoint *pt; - tGPspoint *ptc; - int i, totelem; - int ctrl= 0; // XXX - - /* get total number of points to allocate space for: - * - in 'Draw Mode', holding the Ctrl-Modifier will only take endpoints - * - otherwise, do whole stroke - */ - if (GP_BUFFER2STROKE_ENDPOINTS) - totelem = (gpd->sbuffer_size >= 2) ? 2: gpd->sbuffer_size; - else - totelem = gpd->sbuffer_size; - - /* exit with error if no valid points from this stroke */ - if (totelem == 0) { - if (G.f & G_DEBUG) - printf("Error: No valid points in stroke buffer to convert (tot=%d) \n", gpd->sbuffer_size); - return; - } - - /* allocate memory for a new stroke */ - gps= MEM_callocN(sizeof(bGPDstroke), "gp_stroke"); - - /* allocate enough memory for a continuous array for storage points */ - pt= gps->points= MEM_callocN(sizeof(bGPDspoint)*totelem, "gp_stroke_points"); - - /* copy appropriate settings for stroke */ - gps->totpoints= totelem; - gps->thickness= p->gpl->thickness; - gps->flag= gpd->sbuffer_sflag; - - /* copy points from the buffer to the stroke */ - if (GP_BUFFER2STROKE_ENDPOINTS) { - /* 'Draw Mode' + Ctrl-Modifier - only endpoints */ - { - /* first point */ - ptc= gpd->sbuffer; - - /* convert screen-coordinates to appropriate coordinates (and store them) */ - gp_stroke_convertcoords(p, &ptc->x, &pt->x); - - /* copy pressure */ - pt->pressure= ptc->pressure; - - pt++; - } - - if (totelem == 2) { - /* last point if applicable */ - ptc= ((tGPspoint *)gpd->sbuffer) + (gpd->sbuffer_size - 1); - - /* convert screen-coordinates to appropriate coordinates (and store them) */ - gp_stroke_convertcoords(p, &ptc->x, &pt->x); - - /* copy pressure */ - pt->pressure= ptc->pressure; - } - } - else { - /* convert all points (normal behaviour) */ - for (i=0, ptc=gpd->sbuffer; i < gpd->sbuffer_size && ptc; i++, ptc++) { - /* convert screen-coordinates to appropriate coordinates (and store them) */ - gp_stroke_convertcoords(p, &ptc->x, &pt->x); - - /* copy pressure */ - pt->pressure= ptc->pressure; - - pt++; - } - } - - /* add stroke to frame */ - BLI_addtail(&p->gpf->strokes, gps); -} - -/* --- 'Eraser' for 'Paint' Tool ------ */ - -/* eraser tool - remove segment from stroke/split stroke (after lasso inside) */ -static short gp_stroke_eraser_splitdel (bGPDframe *gpf, bGPDstroke *gps, int i) -{ - bGPDspoint *pt_tmp= gps->points; - bGPDstroke *gsn = NULL; - - /* if stroke only had two points, get rid of stroke */ - if (gps->totpoints == 2) { - /* free stroke points, then stroke */ - MEM_freeN(pt_tmp); - BLI_freelinkN(&gpf->strokes, gps); - - /* nothing left in stroke, so stop */ - return 1; - } - - /* if last segment, just remove segment from the stroke */ - else if (i == gps->totpoints - 2) { - /* allocate new points array, and assign most of the old stroke there */ - gps->totpoints--; - gps->points= MEM_callocN(sizeof(bGPDspoint)*gps->totpoints, "gp_stroke_points"); - memcpy(gps->points, pt_tmp, sizeof(bGPDspoint)*gps->totpoints); - - /* free temp buffer */ - MEM_freeN(pt_tmp); - - /* nothing left in stroke, so stop */ - return 1; - } - - /* if first segment, just remove segment from the stroke */ - else if (i == 0) { - /* allocate new points array, and assign most of the old stroke there */ - gps->totpoints--; - gps->points= MEM_callocN(sizeof(bGPDspoint)*gps->totpoints, "gp_stroke_points"); - memcpy(gps->points, pt_tmp + 1, sizeof(bGPDspoint)*gps->totpoints); - - /* free temp buffer */ - MEM_freeN(pt_tmp); - - /* no break here, as there might still be stuff to remove in this stroke */ - return 0; - } - - /* segment occurs in 'middle' of stroke, so split */ - else { - /* duplicate stroke, and assign 'later' data to that stroke */ - gsn= MEM_dupallocN(gps); - gsn->prev= gsn->next= NULL; - BLI_insertlinkafter(&gpf->strokes, gps, gsn); - - gsn->totpoints= gps->totpoints - i; - gsn->points= MEM_callocN(sizeof(bGPDspoint)*gsn->totpoints, "gp_stroke_points"); - memcpy(gsn->points, pt_tmp + i, sizeof(bGPDspoint)*gsn->totpoints); - - /* adjust existing stroke */ - gps->totpoints= i; - gps->points= MEM_callocN(sizeof(bGPDspoint)*gps->totpoints, "gp_stroke_points"); - memcpy(gps->points, pt_tmp, sizeof(bGPDspoint)*i); - - /* free temp buffer */ - MEM_freeN(pt_tmp); - - /* nothing left in stroke, so stop */ - return 1; - } -} - -/* eraser tool - check if part of stroke occurs within last segment drawn by eraser */ -static short gp_stroke_eraser_strokeinside (short mval[], short mvalo[], short rad, short x0, short y0, short x1, short y1) -{ - /* simple within-radius check for now */ - if (edge_inside_circle(mval[0], mval[1], rad, x0, y0, x1, y1)) - return 1; - - /* not inside */ - return 0; -} - -/* eraser tool - evaluation per stroke */ -static void gp_stroke_eraser_dostroke (tGPsdata *p, short mval[], short mvalo[], short rad, rcti *rect, bGPDframe *gpf, bGPDstroke *gps) -{ - bGPDspoint *pt1, *pt2; - int x0=0, y0=0, x1=0, y1=0; - short xyval[2]; - int i; - - if (gps->totpoints == 0) { - /* just free stroke */ - if (gps->points) - MEM_freeN(gps->points); - BLI_freelinkN(&gpf->strokes, gps); - } - else if (gps->totpoints == 1) { - /* get coordinates */ - if (gps->flag & GP_STROKE_3DSPACE) { - project_short(p->ar, &gps->points->x, xyval); - x0= xyval[0]; - y0= xyval[1]; - } - else if (gps->flag & GP_STROKE_2DSPACE) { - UI_view2d_view_to_region(p->v2d, gps->points->x, gps->points->y, &x0, &y0); - } - else if (gps->flag & GP_STROKE_2DIMAGE) { - int offsx, offsy, sizex, sizey; - - /* get stored settings */ - sizex= p->im2d_settings.sizex; - sizey= p->im2d_settings.sizey; - offsx= p->im2d_settings.offsx; - offsy= p->im2d_settings.offsy; - - /* calculate new points */ - x0= (short)((gps->points->x * sizex) + offsx); - y0= (short)((gps->points->y * sizey) + offsy); - } - else { - x0= (short)(gps->points->x / 1000 * p->sa->winx); - y0= (short)(gps->points->y / 1000 * p->sa->winy); - } - - /* do boundbox check first */ - if (BLI_in_rcti(rect, x0, y0)) { - /* only check if point is inside */ - if ( ((x0-mval[0])*(x0-mval[0]) + (y0-mval[1])*(y0-mval[1])) <= rad*rad ) { - /* free stroke */ - MEM_freeN(gps->points); - BLI_freelinkN(&gpf->strokes, gps); - } - } - } - else { - /* loop over the points in the stroke, checking for intersections - * - an intersection will require the stroke to be split - */ - for (i=0; (i+1) < gps->totpoints; i++) { - /* get points to work with */ - pt1= gps->points + i; - pt2= gps->points + i + 1; - - /* get coordinates */ - if (gps->flag & GP_STROKE_3DSPACE) { - project_short(p->ar, &pt1->x, xyval); - x0= xyval[0]; - y0= xyval[1]; + Object *ob= CTX_data_active_object(C); - project_short(p->ar, &pt2->x, xyval); - x1= xyval[0]; - y1= xyval[1]; - } - else if (gps->flag & GP_STROKE_2DSPACE) { - UI_view2d_view_to_region(p->v2d, pt1->x, pt1->y, &x0, &y0); + // TODO: we can include other data-types such as bones later if need be... - UI_view2d_view_to_region(p->v2d, pt2->x, pt2->y, &x1, &y1); - } - else if (gps->flag & GP_STROKE_2DIMAGE) { - int offsx, offsy, sizex, sizey; - - /* get stored settings */ - sizex= p->im2d_settings.sizex; - sizey= p->im2d_settings.sizey; - offsx= p->im2d_settings.offsx; - offsy= p->im2d_settings.offsy; - - /* calculate new points */ - x0= (short)((pt1->x * sizex) + offsx); - y0= (short)((pt1->y * sizey) + offsy); - - x1= (short)((pt2->x * sizex) + offsx); - y1= (short)((pt2->y * sizey) + offsy); - } - else { - x0= (short)(pt1->x / 1000 * p->sa->winx); - y0= (short)(pt1->y / 1000 * p->sa->winy); - x1= (short)(pt2->x / 1000 * p->sa->winx); - y1= (short)(pt2->y / 1000 * p->sa->winy); - } - - /* check that point segment of the boundbox of the eraser stroke */ - if (BLI_in_rcti(rect, x0, y0) || BLI_in_rcti(rect, x1, y1)) { - /* check if point segment of stroke had anything to do with - * eraser region (either within stroke painted, or on its lines) - * - this assumes that linewidth is irrelevant - */ - if (gp_stroke_eraser_strokeinside(mval, mvalo, rad, x0, y0, x1, y1)) { - /* if function returns true, break this loop (as no more point to check) */ - if (gp_stroke_eraser_splitdel(gpf, gps, i)) - break; + /* just in case no active object */ + if (ob) { + /* for now, as long as there's an object, default to using that in 3D-View */ + if (ptr) RNA_id_pointer_create(&ob->id, ptr); + return &ob->gpd; } } - } - } -} - -/* erase strokes which fall under the eraser strokes */ -static void gp_stroke_doeraser (tGPsdata *p) -{ - bGPDframe *gpf= p->gpf; - bGPDstroke *gps, *gpn; - rcti rect; - - /* rect is rectangle of eraser */ - rect.xmin= p->mval[0] - p->radius; - rect.ymin= p->mval[1] - p->radius; - rect.xmax= p->mval[0] + p->radius; - rect.ymax= p->mval[1] + p->radius; - - /* loop over strokes, checking segments for intersections */ - for (gps= gpf->strokes.first; gps; gps= gpn) { - gpn= gps->next; - gp_stroke_eraser_dostroke(p, p->mval, p->mvalo, p->radius, &rect, gpf, gps); - } -} - -/* ---------- 'Paint' Tool ------------ */ - -/* init new painting session */ -static void gp_session_initpaint (bContext *C, tGPsdata *p) -{ - ScrArea *curarea= CTX_wm_area(C); - ARegion *ar= CTX_wm_region(C); - - /* clear previous data (note: is on stack) */ - memset(p, 0, sizeof(tGPsdata)); - - /* make sure the active view (at the starting time) is a 3d-view */ - if (curarea == NULL) { - p->status= GP_STATUS_ERROR; - if (G.f & G_DEBUG) - printf("Error: No active view for painting \n"); - return; - } - - /* pass on current scene */ - p->scene= CTX_data_scene(C); - - switch (curarea->spacetype) { - /* supported views first */ - case SPACE_VIEW3D: - { - View3D *v3d= curarea->spacedata.first; + break; - /* set current area */ - p->sa= curarea; - p->ar= ar; - - /* check that gpencil data is allowed to be drawn */ - if ((v3d->flag2 & V3D_DISPGP)==0) { - p->status= GP_STATUS_ERROR; - if (G.f & G_DEBUG) - printf("Error: In active view, Grease Pencil not shown \n"); - return; - } - } - break; - case SPACE_NODE: - { - SpaceNode *snode= curarea->spacedata.first; - - /* set current area */ - p->sa= curarea; - p->ar= ar; - p->v2d= &ar->v2d; - - /* check that gpencil data is allowed to be drawn */ - if ((snode->flag & SNODE_DISPGP)==0) { - p->status= GP_STATUS_ERROR; - if (G.f & G_DEBUG) - printf("Error: In active view, Grease Pencil not shown \n"); - return; - } - } - break; - case SPACE_SEQ: - { - SpaceSeq *sseq= curarea->spacedata.first; - - /* set current area */ - p->sa= curarea; - p->ar= ar; - p->v2d= &ar->v2d; - - /* check that gpencil data is allowed to be drawn */ - if (sseq->mainb == SEQ_DRAW_SEQUENCE) { - p->status= GP_STATUS_ERROR; - if (G.f & G_DEBUG) - printf("Error: In active view (sequencer), active mode doesn't support Grease Pencil \n"); - return; - } - if ((sseq->flag & SEQ_DRAW_GPENCIL)==0) { - p->status= GP_STATUS_ERROR; - if (G.f & G_DEBUG) - printf("Error: In active view, Grease Pencil not shown \n"); - return; - } - } - break; - case SPACE_IMAGE: - { - SpaceImage *sima= curarea->spacedata.first; - - /* set the current area */ - p->sa= curarea; - p->ar= ar; - p->v2d= &ar->v2d; - p->ibuf= BKE_image_get_ibuf(sima->image, &sima->iuser); - - /* check that gpencil data is allowed to be drawn */ - if ((sima->flag & SI_DISPGP)==0) { - p->status= GP_STATUS_ERROR; - if (G.f & G_DEBUG) - printf("Error: In active view, Grease Pencil not shown \n"); - return; - } - } - break; - /* unsupported views */ - default: - { - p->status= GP_STATUS_ERROR; - if (G.f & G_DEBUG) - printf("Error: Active view not appropriate for Grease Pencil drawing \n"); - return; - } - break; - } - - /* get gp-data */ - p->gpd= gpencil_data_getactive(p->sa); - if (p->gpd == NULL) { - short ok; - - p->gpd= gpencil_data_addnew("GPencil"); - ok= gpencil_data_setactive(p->sa, p->gpd); - - /* most of the time, the following check isn't needed */ - if (ok == 0) { - /* free gpencil data as it can't be used */ - free_gpencil_data(p->gpd); - p->gpd= NULL; - p->status= GP_STATUS_ERROR; - if (G.f & G_DEBUG) - printf("Error: Could not assign newly created Grease Pencil data to active area \n"); - return; - } - } - - /* set edit flags */ - G.f |= G_GREASEPENCIL; - - /* clear out buffer (stored in gp-data) in case something contaminated it */ - gp_session_validatebuffer(p); - - /* set 'default' im2d_settings just in case something that uses this doesn't set it */ - p->im2d_settings.sizex= 1; - p->im2d_settings.sizey= 1; -} - -/* cleanup after a painting session */ -static void gp_session_cleanup (tGPsdata *p) -{ - bGPdata *gpd= p->gpd; - - /* error checking */ - if (gpd == NULL) - return; - - /* free stroke buffer */ - if (gpd->sbuffer) { - MEM_freeN(gpd->sbuffer); - gpd->sbuffer= NULL; - } - - /* clear flags */ - gpd->sbuffer_size= 0; - gpd->sbuffer_sflag= 0; -} - -/* init new stroke */ -static void gp_paint_initstroke (tGPsdata *p, short paintmode) -{ - /* get active layer (or add a new one if non-existent) */ - p->gpl= gpencil_layer_getactive(p->gpd); - if (p->gpl == NULL) - p->gpl= gpencil_layer_addnew(p->gpd); - if (p->gpl->flag & GP_LAYER_LOCKED) { - p->status= GP_STATUS_ERROR; - if (G.f & G_DEBUG) - printf("Error: Cannot paint on locked layer \n"); - return; - } - - /* get active frame (add a new one if not matching frame) */ - p->gpf= gpencil_layer_getframe(p->gpl, p->scene->r.cfra, 1); - if (p->gpf == NULL) { - p->status= GP_STATUS_ERROR; - if (G.f & G_DEBUG) - printf("Error: No frame created (gpencil_paint_init) \n"); - return; - } - else - p->gpf->flag |= GP_FRAME_PAINT; - - /* set 'eraser' for this stroke if using eraser */ - p->paintmode= paintmode; - if (p->paintmode == GP_PAINTMODE_ERASER) - p->gpd->sbuffer_sflag |= GP_STROKE_ERASER; - - /* check if points will need to be made in view-aligned space */ - if (p->gpd->flag & GP_DATA_VIEWALIGN) { - switch (p->sa->spacetype) { - case SPACE_VIEW3D: + case SPACE_NODE: /* Nodes Editor */ { - View3D *v3d= (View3D *)p->sa->spacedata.first; - RegionView3D *rv3d= NULL; // XXX - float *fp= give_cursor(p->scene, v3d); + //SpaceNode *snode= (SpaceNode *)CTX_wm_space_data(C); - initgrabz(rv3d, fp[0], fp[1], fp[2]); - - p->gpd->sbuffer_sflag |= GP_STROKE_3DSPACE; + /* return the GP data for the active node block/node */ } break; - case SPACE_NODE: + + case SPACE_SEQ: /* Sequencer */ { - p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE; - } - break; - case SPACE_SEQ: - { - SpaceSeq *sseq= (SpaceSeq *)p->sa->spacedata.first; - int rectx, recty; - float zoom, zoomx, zoomy; + //SpaceSeq *sseq= (SpaceSeq *)CTX_wm_space_data(C); - /* set draw 2d-stroke flag */ - p->gpd->sbuffer_sflag |= GP_STROKE_2DIMAGE; - - /* calculate zoom factor */ - zoom= (float)(SEQ_ZOOM_FAC(sseq->zoom)); - if (sseq->mainb == SEQ_DRAW_IMG_IMBUF) { - zoomx = zoom * ((float)p->scene->r.xasp / (float)p->scene->r.yasp); - zoomy = zoom; - } - else - zoomx = zoomy = zoom; - - /* calculate rect size to use to calculate the size of the drawing area - * - We use the size of the output image not the size of the ibuf being shown - * as it is too messy getting the ibuf (and could be too slow). This should be - * a reasonable for most cases anyway. - */ - rectx= (p->scene->r.size * p->scene->r.xsch) / 100; - recty= (p->scene->r.size * p->scene->r.ysch) / 100; - - /* set offset and scale values for opertations to use */ - p->im2d_settings.sizex= (int)(zoomx * rectx); - p->im2d_settings.sizey= (int)(zoomy * recty); - p->im2d_settings.offsx= (int)((p->sa->winx-p->im2d_settings.sizex)/2 + sseq->xof); - p->im2d_settings.offsy= (int)((p->sa->winy-p->im2d_settings.sizey)/2 + sseq->yof); - } - break; - case SPACE_IMAGE: - { - /* check if any ibuf available */ - if (p->ibuf) - p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE; + /* return the GP data for the active strips/image/etc. */ } break; } } + + /* just fall back on the scene's GP data */ + if (ptr) RNA_id_pointer_create((ID *)scene, ptr); + return (scene) ? &scene->gpd : NULL; } -/* finish off a stroke (clears buffer, but doesn't finish the paint operation) */ -static void gp_paint_strokeend (tGPsdata *p) +/* Get the active Grease Pencil datablock */ +bGPdata *gpencil_data_get_active (bContext *C) { - /* check if doing eraser or not */ - if ((p->gpd->sbuffer_sflag & GP_STROKE_ERASER) == 0) { - /* smooth stroke before transferring? */ - gp_stroke_smooth(p); - - /* simplify stroke before transferring? */ - gp_stroke_simplify(p); - - /* transfer stroke to frame */ - gp_stroke_newfrombuffer(p); - } - - /* clean up buffer now */ - gp_session_validatebuffer(p); + bGPdata **gpd_ptr= gpencil_data_get_pointers(C, NULL); + return (gpd_ptr) ? *(gpd_ptr) : NULL; } -/* finish off stroke painting operation */ -static void gp_paint_cleanup (tGPsdata *p) -{ - /* finish off a stroke */ - gp_paint_strokeend(p); - - /* "unlock" frame */ - p->gpf->flag &= ~GP_FRAME_PAINT; - - /* add undo-push so stroke can be undone */ - /* FIXME: currently disabled, as it's impossible to get this working nice - * as gpenci data is on currently screen-level (which isn't saved to undo files) - */ - //BIF_undo_push("GPencil Stroke"); - - /* force redraw after drawing action */ - // XXX force_draw_plus(SPACE_ACTION, 0); -} - -/* -------- */ - -/* main call to paint a new stroke */ -// XXX will become modal(), gets event, includes all info! -short gpencil_paint (bContext *C, short paintmode) -{ - tGPsdata p; - short ok = GP_STROKEADD_NORMAL; - - /* init paint-data */ - gp_session_initpaint(C, &p); - if (p.status == GP_STATUS_ERROR) { - gp_session_cleanup(&p); - return 0; - } - gp_paint_initstroke(&p, paintmode); - if (p.status == GP_STATUS_ERROR) { - gp_session_cleanup(&p); - return 0; - } - - /* set cursor to indicate drawing */ - // XXX (cursor callbacks in regiontype) setcursor_space(p.sa->spacetype, CURSOR_VPAINT); - - /* init drawing-device settings */ - // XXX getmouseco_areawin(p.mval); - // XXX p.pressure = get_pressure(); - - p.mvalo[0]= p.mval[0]; - p.mvalo[1]= p.mval[1]; - p.opressure= p.pressure; - - /* radius for eraser circle is defined in userprefs now */ - // TODO: make this more easily tweaked... - p.radius= U.gp_eraser; - - /* start drawing eraser-circle (if applicable) */ - //if (paintmode == GP_PAINTMODE_ERASER) - // XXX draw_sel_circle(p.mval, NULL, p.radius, p.radius, 0); // draws frontbuffer, but sets backbuf again - - /* only allow painting of single 'dots' if: - * - pressure is not excessive (as it can be on some windows tablets) - * - draw-mode for active datablock is turned on - * - not erasing - */ - if (paintmode != GP_PAINTMODE_ERASER) { - if (!(p.pressure >= 0.99f) || (p.gpd->flag & GP_DATA_EDITPAINT)) { - gp_stroke_addpoint(&p, p.mval, p.pressure); - } - } - - /* XXX paint loop */ - if(0) { - /* get current user input */ - // XXX getmouseco_areawin(p.mval); - // XXX p.pressure = get_pressure(); - - /* only add current point to buffer if mouse moved (otherwise wait until it does) */ - if (paintmode == GP_PAINTMODE_ERASER) { - /* do 'live' erasing now */ - gp_stroke_doeraser(&p); - - // XXX draw_sel_circle(p.mval, p.mvalo, p.radius, p.radius, 0); - // XXX force_draw(0); - - p.mvalo[0]= p.mval[0]; - p.mvalo[1]= p.mval[1]; - p.opressure= p.pressure; - } - else if (gp_stroke_filtermval(&p, p.mval, p.mvalo)) { - /* try to add point */ - ok= gp_stroke_addpoint(&p, p.mval, p.pressure); - - /* handle errors while adding point */ - if ((ok == GP_STROKEADD_FULL) || (ok == GP_STROKEADD_OVERFLOW)) { - /* finish off old stroke */ - gp_paint_strokeend(&p); - - /* start a new stroke, starting from previous point */ - gp_stroke_addpoint(&p, p.mvalo, p.opressure); - ok= gp_stroke_addpoint(&p, p.mval, p.pressure); - } - else if (ok == GP_STROKEADD_INVALID) { - /* the painting operation cannot continue... */ - error("Cannot paint stroke"); - p.status = GP_STATUS_ERROR; - - if (G.f & G_DEBUG) - printf("Error: Grease-Pencil Paint - Add Point Invalid \n"); - // XXX break; - } - // XXX force_draw(0); - - p.mvalo[0]= p.mval[0]; - p.mvalo[1]= p.mval[1]; - p.opressure= p.pressure; - } - - /* do mouse checking at the end, so don't check twice, and potentially - * miss a short tap - */ - } - - /* clear edit flags */ - G.f &= ~G_GREASEPENCIL; - - /* restore cursor to indicate end of drawing */ - // XXX (cursor callbacks in regiontype) setcursor_space(p.sa->spacetype, CURSOR_STD); - - /* check size of buffer before cleanup, to determine if anything happened here */ - if (paintmode == GP_PAINTMODE_ERASER) { - ok= 1; /* assume that we did something... */ - // XXX draw_sel_circle(NULL, p.mvalo, 0, p.radius, 0); - } - else - ok= p.gpd->sbuffer_size; - - /* cleanup */ - gp_paint_cleanup(&p); - gp_session_cleanup(&p); - - /* done! return if a stroke was successfully added */ - return ok; -} +/* ************************************************ */ +/* Panel Operators */ -/* All event (loops) handling checking if stroke drawing should be initiated - * should call this function. - */ -short gpencil_do_paint (bContext *C) -{ - ScrArea *sa= CTX_wm_area(C); - bGPdata *gpd = gpencil_data_getactive(sa); - short retval= 0; - int alt= 0, shift= 0, mbut= 0; // XXX - - /* check if possible to do painting */ - if (gpd == NULL) - return 0; - - /* currently, we will only 'paint' if: - * 1. draw-mode on gpd is set (for accessibility reasons) - * a) single dots are only available by this method if a single click is made - * b) a straight line is drawn if ctrl-modifier is held (check is done when stroke is converted!) - * 2. if shift-modifier is held + lmb -> 'quick paint' - * - * OR - * - * draw eraser stroke if: - * 1. using the eraser on a tablet - * 2. draw-mode on gpd is set (for accessiblity reasons) - * (eraser is mapped to right-mouse) - * 3. Alt + 'select' mouse-button - * i.e. if LMB = select: Alt-LMB - * if RMB = select: Alt-RMB - */ - if (get_activedevice() == 2) { - /* eraser on a tablet - always try to erase strokes */ - retval = gpencil_paint(C, GP_PAINTMODE_ERASER); - } - else if (gpd->flag & GP_DATA_EDITPAINT) { - /* try to paint/erase */ - if (mbut == L_MOUSE) - retval = gpencil_paint(C, GP_PAINTMODE_DRAW); - else if (mbut == R_MOUSE) - retval = gpencil_paint(C, GP_PAINTMODE_ERASER); - } - else if (!(gpd->flag & GP_DATA_LMBPLOCK)) { - /* try to paint/erase as not locked */ - if (shift && (mbut == L_MOUSE)) { - retval = gpencil_paint(C, GP_PAINTMODE_DRAW); - } - else if (alt) { - if ((U.flag & USER_LMOUSESELECT) && (mbut == L_MOUSE)) - retval = gpencil_paint(C, GP_PAINTMODE_ERASER); - else if (!(U.flag & USER_LMOUSESELECT) && (mbut == R_MOUSE)) - retval = gpencil_paint(C, GP_PAINTMODE_ERASER); - } - } - - /* return result of trying to paint */ - return retval; -} -/* ************************************************** */ -#endif // XXX COMPILE GUARDS FOR OLD CODE +/* ************************************************ */ diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 2f60efb2179..d6bdea2db55 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1,5 +1,28 @@ -/* Grease Pencil - version 2 - * By Joshua Leung +/** + * $Id$ + * + * ***** 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) 2008, Blender Foundation, Joshua Leung + * This is a new part of Blender + * + * Contributor(s): Joshua Leung + * + * ***** END GPL LICENSE BLOCK ***** */ #include @@ -38,8 +61,8 @@ #include "ED_view3d.h" #include "RNA_access.h" -#include "RNA_define.h" +#include "RNA_define.h" #include "WM_api.h" #include "WM_types.h" @@ -48,65 +71,6 @@ /* ******************************************* */ /* Context Wrangling... */ -/* Get the active Grease Pencil datablock */ -// TODO: move this to a gpencil_utils.c? -bGPdata *gpencil_data_getactive (bContext *C) -{ - Scene *scene= CTX_data_scene(C); - ScrArea *sa= CTX_wm_area(C); - - /* if there's an active area, check if the particular editor may - * have defined any special Grease Pencil context for editing... - */ - if (sa) { - switch (sa->spacetype) { - case SPACE_VIEW3D: /* 3D-View */ - { - Object *ob= CTX_data_active_object(C); - - /* just in case... */ - if (ob) { - /* depending on the mode of the object, we may be able to get some GP data - * from different elements - i.e. bones... - */ - if (ob->mode & OB_MODE_POSE) { - //bPoseChannel *pchan= CTX_data_active_pchan(C); - - /* if posechannel has GP data, use that... */ - //if (pchan && pchan->gpd) - // return pchan->gpd; - } - - /* still here, so check if active Object has GP data */ - //if (ob->gpd) - // return ob->gpd; - } - } - break; - - case SPACE_NODE: /* Nodes Editor */ - { - //SpaceNode *snode= (SpaceNode *)CTX_wm_space_data(C); - - /* return the GP data for the active node block/node */ - } - break; - - case SPACE_SEQ: /* Sequencer */ - { - //SpaceSeq *sseq= (SpaceSeq *)CTX_wm_space_data(C); - - /* return the GP data for the active strips/image/etc. */ - } - break; - } - } - - /* just fall back on the scene's GP data */ - return (scene) ? scene->gpd : NULL; -} - - /* check if context is suitable for drawing */ static int gpencil_draw_poll (bContext *C) { @@ -282,8 +246,8 @@ static void gp_stroke_convertcoords (tGPsdata *p, short mval[], float out[]) /* 2d - relative to screen (viewport area) */ else { - out[0] = (float)(mval[0]) / (float)(p->sa->winx) * 1000; - out[1] = (float)(mval[1]) / (float)(p->sa->winy) * 1000; + out[0] = (float)(mval[0]) / (float)(p->sa->winx) * 100; + out[1] = (float)(mval[1]) / (float)(p->sa->winy) * 100; } } @@ -616,8 +580,8 @@ static void gp_stroke_eraser_dostroke (tGPsdata *p, int mval[], int mvalo[], sho } #endif else { - x0= (int)(gps->points->x / 1000 * p->sa->winx); - y0= (int)(gps->points->y / 1000 * p->sa->winy); + x0= (int)(gps->points->x / 100 * p->sa->winx); + y0= (int)(gps->points->y / 100 * p->sa->winy); } /* do boundbox check first */ @@ -673,10 +637,10 @@ static void gp_stroke_eraser_dostroke (tGPsdata *p, int mval[], int mvalo[], sho } #endif else { - x0= (int)(pt1->x / 1000 * p->sa->winx); - y0= (int)(pt1->y / 1000 * p->sa->winy); - x1= (int)(pt2->x / 1000 * p->sa->winx); - y1= (int)(pt2->y / 1000 * p->sa->winy); + x0= (int)(pt1->x / 100 * p->sa->winx); + y0= (int)(pt1->y / 100 * p->sa->winy); + x1= (int)(pt2->x / 100 * p->sa->winx); + y1= (int)(pt2->y / 100 * p->sa->winy); } /* check that point segment of the boundbox of the eraser stroke */ @@ -740,6 +704,7 @@ static void gp_session_validatebuffer (tGPsdata *p) static tGPsdata *gp_session_initpaint (bContext *C) { tGPsdata *p = NULL; + bGPdata **gpd_ptr = NULL; ScrArea *curarea= CTX_wm_area(C); ARegion *ar= CTX_wm_region(C); @@ -852,11 +817,18 @@ static tGPsdata *gp_session_initpaint (bContext *C) } /* get gp-data */ - p->gpd= gpencil_data_getactive(C); - if (p->gpd == NULL) { - /* add new GPencil block for the active scene for now... */ - p->gpd= gpencil_data_addnew("GPencil"); - p->scene->gpd= p->gpd; + gpd_ptr= gpencil_data_get_pointers(C, NULL); + if (gpd_ptr == NULL) { + p->status= GP_STATUS_ERROR; + if (G.f & G_DEBUG) + printf("Error: Current context doesn't allow for any Grease Pencil data \n"); + return p; + } + else { + /* if no existing GPencil block exists, add one */ + if (*gpd_ptr == NULL) + *gpd_ptr= gpencil_data_addnew("GPencil"); + p->gpd= *gpd_ptr; } /* set edit flags - so that buffer will get drawn */ diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h index c1e37ce2e81..25e622d8551 100644 --- a/source/blender/editors/include/ED_gpencil.h +++ b/source/blender/editors/include/ED_gpencil.h @@ -38,49 +38,35 @@ struct SpaceSeq; struct bGPdata; struct bGPDlayer; struct bGPDframe; -struct bGPdata; +struct PointerRNA; +struct uiLayout; struct uiBlock; struct ImBuf; struct wmWindowManager; -/* ------------- Grease-Pencil Helpers -------------- */ +/* ------------- Grease-Pencil Helpers ---------------- */ -/* Temporary 'Stroke Point' data */ +/* Temporary 'Stroke Point' data + * + * Used as part of the 'stroke cache' used during drawing of new strokes + */ typedef struct tGPspoint { short x, y; /* x and y coordinates of cursor (in relative to area) */ float pressure; /* pressure of tablet at this point */ } tGPspoint; -/* ----------- Grease Pencil New Tools ------------- */ +/* ----------- Grease Pencil Tools/Context ------------- */ -struct bGPdata *gpencil_data_getactive(struct bContext *C); +struct bGPdata **gpencil_data_get_pointers(struct bContext *C, struct PointerRNA *ptr); +struct bGPdata *gpencil_data_get_active(struct bContext *C); -/* ----------- Grease Pencil Operators ------------- */ +/* ----------- Grease Pencil Operators ----------------- */ void gpencil_common_keymap(struct wmWindowManager *wm, ListBase *keymap); void ED_operatortypes_gpencil(void); -/* ------------ Grease-Pencil Depreceated Stuff ------------------ */ - -//struct bGPdata *gpencil_data_getactive(struct ScrArea *sa); -short gpencil_data_setactive(struct ScrArea *sa, struct bGPdata *gpd); -struct ScrArea *gpencil_data_findowner(struct bGPdata *gpd); - -/* ------------ Grease-Pencil Editing API ------------------ */ - -void gpencil_delete_actframe(struct bGPdata *gpd, int cfra); -void gpencil_delete_laststroke(struct bGPdata *gpd, int cfra); - -void gpencil_delete_operation(int cfra, short mode); -void gpencil_delete_menu(void); - -void gpencil_convert_operation(short mode); -void gpencil_convert_menu(void); - -short gpencil_do_paint(struct bContext *C); - /* ------------ Grease-Pencil Drawing API ------------------ */ /* drawgpencil.c */ diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 48947794620..5c5b7281f20 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -4736,7 +4736,7 @@ void special_aftertrans_update(TransInfo *t) * - sync this with actdata_filter_gpencil() in editaction.c */ for (sa= sc->areabase.first; sa; sa= sa->next) { - bGPdata *gpd= gpencil_data_getactive(sa); + bGPdata *gpd= gpencil_data_get_active(sa); if (gpd) posttrans_gpd_clean(gpd); diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 25fdf615adb..d1e70c16408 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -54,7 +54,10 @@ struct FluidsimSettings; struct ParticleSystem; struct DerivedMesh; struct SculptSession; +struct bGPdata; + +/* Vertex Groups - Name Info */ typedef struct bDeformGroup { struct bDeformGroup *next, *prev; char name[32]; @@ -110,6 +113,8 @@ typedef struct Object { struct bPose *pose; void *data; + struct bGPdata *gpd; /* Grease Pencil data */ + ListBase constraintChannels; // XXX depreceated... old animation system ListBase effect; ListBase disp; @@ -209,7 +214,7 @@ typedef struct Object { short recalc; /* dependency flag */ float anisotropicFriction[3]; - ListBase constraints; + ListBase constraints; /* object constraints */ ListBase nlastrips; // XXX depreceated... old animation system ListBase hooks; ListBase particlesystem; /* particle systems */ diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index f0b055bd0e8..cae96b0af4b 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1464,6 +1464,13 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_ui_text(prop, "X-Ray", "Makes the object draw in front of others."); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); + /* Grease Pencil */ + prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "gpd"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_struct_type(prop, "GreasePencil"); + RNA_def_property_ui_text(prop, "Grease Pencil Data", "Grease Pencil datablock"); + /* pose */ prop= RNA_def_property(srna, "pose_library", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "poselib"); From af85ee01f8b9facf76761e8c3c758ee1ccd18986 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Fri, 28 Aug 2009 13:42:58 +0000 Subject: [PATCH 310/577] Update MSVC project files. --- .../audaspace/make/msvc_9_0/audaspace.vcproj | 28 ++++++++++++++++--- projectfiles_vc9/blender/blender.vcproj | 12 ++++---- .../blender/blenkernel/BKE_blenkernel.vcproj | 16 ++++------- .../blender/editors/ED_editors.vcproj | 28 +++++++++++++++++++ .../blender/imbuf/BL_imbuf.vcproj | 12 ++++---- .../blender/makesrna/RNA_makesrna.vcproj | 4 +++ .../blender/makesrna/RNA_rna.vcproj | 4 +++ .../gameengine/videotexture/TEX_Video.vcproj | 4 +-- 8 files changed, 80 insertions(+), 28 deletions(-) diff --git a/intern/audaspace/make/msvc_9_0/audaspace.vcproj b/intern/audaspace/make/msvc_9_0/audaspace.vcproj index 4c0b26f1c4e..0d8ade43e07 100644 --- a/intern/audaspace/make/msvc_9_0/audaspace.vcproj +++ b/intern/audaspace/make/msvc_9_0/audaspace.vcproj @@ -43,7 +43,7 @@ + + + + + + + + + + diff --git a/projectfiles_vc9/blender/blender.vcproj b/projectfiles_vc9/blender/blender.vcproj index 7b71ee49870..56913cb8160 100644 --- a/projectfiles_vc9/blender/blender.vcproj +++ b/projectfiles_vc9/blender/blender.vcproj @@ -73,12 +73,12 @@ diff --git a/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj b/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj index 7f0867cc7b6..87f10346726 100644 --- a/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj +++ b/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj @@ -43,7 +43,7 @@ - - diff --git a/projectfiles_vc9/blender/editors/ED_editors.vcproj b/projectfiles_vc9/blender/editors/ED_editors.vcproj index c70e66b6c2b..9f2fc769e49 100644 --- a/projectfiles_vc9/blender/editors/ED_editors.vcproj +++ b/projectfiles_vc9/blender/editors/ED_editors.vcproj @@ -293,6 +293,10 @@ RelativePath="..\..\..\source\blender\editors\include\ED_sequencer.h" > + + @@ -1342,6 +1346,10 @@ RelativePath="..\..\..\source\blender\editors\gpencil\editaction_gpencil.c" > + + @@ -1350,6 +1358,14 @@ RelativePath="..\..\..\source\blender\editors\gpencil\gpencil_intern.h" > + + + + + + + + + + diff --git a/projectfiles_vc9/blender/imbuf/BL_imbuf.vcproj b/projectfiles_vc9/blender/imbuf/BL_imbuf.vcproj index f9470dcebfe..0e25b26831b 100644 --- a/projectfiles_vc9/blender/imbuf/BL_imbuf.vcproj +++ b/projectfiles_vc9/blender/imbuf/BL_imbuf.vcproj @@ -43,7 +43,7 @@ + + diff --git a/projectfiles_vc9/blender/makesrna/RNA_rna.vcproj b/projectfiles_vc9/blender/makesrna/RNA_rna.vcproj index 1d7c3f38581..84359390f41 100644 --- a/projectfiles_vc9/blender/makesrna/RNA_rna.vcproj +++ b/projectfiles_vc9/blender/makesrna/RNA_rna.vcproj @@ -230,6 +230,10 @@ RelativePath="..\..\..\source\blender\makesrna\intern\rna_fluidsim_gen.c" > + + diff --git a/projectfiles_vc9/gameengine/videotexture/TEX_Video.vcproj b/projectfiles_vc9/gameengine/videotexture/TEX_Video.vcproj index e2731cf94e9..94e09303a1b 100644 --- a/projectfiles_vc9/gameengine/videotexture/TEX_Video.vcproj +++ b/projectfiles_vc9/gameengine/videotexture/TEX_Video.vcproj @@ -42,7 +42,7 @@ Date: Fri, 28 Aug 2009 14:25:17 +0000 Subject: [PATCH 311/577] - povray and ply work now. Again, please try not to break scripts - at least grep the release dir for the names you change. - rna material property rename gloss_amount -> gloss_factor, since its from 0.0 to 1.0, prefix factor is used on other material settings. reflectivity -> reflect_factor --- release/io/engine_render_pov.py | 17 +++++------------ release/io/export_ply.py | 17 ++++++++--------- release/ui/buttons_material.py | 10 +++++----- release/ui/space_sequencer.py | 2 +- source/blender/makesrna/intern/rna_material.c | 6 +++--- 5 files changed, 22 insertions(+), 30 deletions(-) diff --git a/release/io/engine_render_pov.py b/release/io/engine_render_pov.py index f064add505b..c3165d22540 100644 --- a/release/io/engine_render_pov.py +++ b/release/io/engine_render_pov.py @@ -82,8 +82,8 @@ def write_pov(filename, scene=None, info_callback = None): file.write('#declare %s = finish {\n' % name) if material: - file.write('\tdiffuse %.3g\n' % material.diffuse_reflection) - file.write('\tspecular %.3g\n' % material.specular_reflection) + file.write('\tdiffuse %.3g\n' % material.diffuse_intensity) + file.write('\tspecular %.3g\n' % material.specular_intensity) file.write('\tambient %.3g\n' % material.ambient) #file.write('\tambient rgb <%.3g, %.3g, %.3g>\n' % tuple([c*material.ambient for c in world.ambient_color])) # povray blends the global value @@ -101,10 +101,10 @@ def write_pov(filename, scene=None, info_callback = None): if material.raytrace_mirror.enabled: raytrace_mirror= material.raytrace_mirror - if raytrace_mirror.reflect: + if raytrace_mirror.reflect_factor: file.write('\treflection {\n') file.write('\t\trgb <%.3g, %.3g, %.3g>' % tuple(material.mirror_color)) - file.write('\t\tfresnel 1 falloff %.3g exponent %.3g metallic %.3g} ' % (raytrace_mirror.fresnel, raytrace_mirror.fresnel_fac, raytrace_mirror.reflect)) + file.write('\t\tfresnel 1 falloff %.3g exponent %.3g metallic %.3g} ' % (raytrace_mirror.fresnel, raytrace_mirror.fresnel_factor, raytrace_mirror.reflect_factor)) else: file.write('\tdiffuse 0.8\n') @@ -300,14 +300,7 @@ def write_pov(filename, scene=None, info_callback = None): try: vcol_layer = me.active_vertex_color.data except:vcol_layer = None - - def regular_face(f): - fv = f.verts - if fv[3]== 0: - return fv[0], fv[1], fv[2] - return fv[0], fv[1], fv[2], fv[3] - - faces_verts = [regular_face(f) for f in me.faces] + faces_verts = [f.verts for f in me.faces] faces_normals = [tuple(f.normal) for f in me.faces] verts_normals = [tuple(v.normal) for v in me.verts] diff --git a/release/io/export_ply.py b/release/io/export_ply.py index 3668693db16..c293119d3c8 100644 --- a/release/io/export_ply.py +++ b/release/io/export_ply.py @@ -64,7 +64,7 @@ def write(filename, scene, ob, \ raise Exception("Error, Select 1 active object") return - file = open(filename, 'wb') + file = open(filename, 'w') #EXPORT_EDGES = Draw.Create(0) @@ -88,9 +88,9 @@ def write(filename, scene, ob, \ # mesh.transform(ob.matrixWorld) # XXX - faceUV = len(mesh.uv_layers) > 0 + faceUV = len(mesh.uv_textures) > 0 vertexUV = len(mesh.sticky) > 0 - vertexColors = len(mesh.vcol_layers) > 0 + vertexColors = len(mesh.vertex_colors) > 0 if (not faceUV) and (not vertexUV): EXPORT_UV = False if not vertexColors: EXPORT_COLORS = False @@ -100,7 +100,7 @@ def write(filename, scene, ob, \ if faceUV: active_uv_layer = None - for lay in mesh.uv_layers: + for lay in mesh.uv_textures: if lay.active: active_uv_layer= lay.data break @@ -110,7 +110,7 @@ def write(filename, scene, ob, \ if vertexColors: active_col_layer = None - for lay in mesh.vcol_layers: + for lay in mesh.vertex_colors: if lay.active: active_col_layer= lay.data if not active_col_layer: @@ -123,8 +123,8 @@ def write(filename, scene, ob, \ mesh_verts = mesh.verts # save a lookup ply_verts = [] # list of dictionaries # vdict = {} # (index, normal, uv) -> new index - vdict = [{} for i in xrange(len(mesh_verts))] - ply_faces = [[] for f in xrange(len(mesh.faces))] + vdict = [{} for i in range(len(mesh_verts))] + ply_faces = [[] for f in range(len(mesh.faces))] vert_count = 0 for i, f in enumerate(mesh.faces): @@ -141,8 +141,7 @@ def write(filename, scene, ob, \ col = active_col_layer[i] col = col.color1, col.color2, col.color3, col.color4 - f_verts= list(f.verts) - if not f_verts[3]: f_verts.pop() # XXX face length should be 3/4, not always 4 + f_verts= f.verts pf= ply_faces[i] for j, vidx in enumerate(f_verts): diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py index e7add9c59f3..e317d990c39 100644 --- a/release/ui/buttons_material.py +++ b/release/ui/buttons_material.py @@ -426,7 +426,7 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel): split = layout.split() col = split.column() - col.itemR(raym, "reflectivity") + col.itemR(raym, "reflect_factor") col.itemR(mat, "mirror_color", text="") col = split.column() @@ -448,9 +448,9 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel): col = split.column() col.itemL(text="Gloss:") - col.itemR(raym, "gloss_amount", text="Amount") + col.itemR(raym, "gloss_factor", text="Amount") sub = col.column() - sub.active = raym.gloss_amount < 1 + sub.active = raym.gloss_factor < 1.0 sub.itemR(raym, "gloss_threshold", text="Threshold") sub.itemR(raym, "gloss_samples", text="Samples") sub.itemR(raym, "gloss_anisotropic", text="Anisotropic") @@ -511,9 +511,9 @@ class MATERIAL_PT_transp(MaterialButtonsPanel): col = split.column() col.itemL(text="Gloss:") - col.itemR(rayt, "gloss_amount", text="Amount") + col.itemR(rayt, "gloss_factor", text="Amount") sub = col.column() - sub.active = rayt.gloss_amount < 1 + sub.active = rayt.gloss_factor < 1.0 sub.itemR(rayt, "gloss_threshold", text="Threshold") sub.itemR(rayt, "gloss_samples", text="Samples") diff --git a/release/ui/space_sequencer.py b/release/ui/space_sequencer.py index 6b86ea5dabe..de3cfa17987 100644 --- a/release/ui/space_sequencer.py +++ b/release/ui/space_sequencer.py @@ -466,7 +466,7 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel): if not strip: return False - return strip.type in ('SOUND') + return strip.type in ('SOUND', ) def draw(self, context): layout = self.layout diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index e9970e4391e..db573f0a666 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -746,7 +746,7 @@ static void rna_def_material_raymirror(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Enabled", "Enable raytraced reflections."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "reflectivity", PROP_FLOAT, PROP_PERCENTAGE); + prop= RNA_def_property(srna, "reflect_factor", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_float_sdna(prop, NULL, "ray_mirror"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Reflectivity", "Sets the amount mirror reflection for raytrace."); @@ -764,7 +764,7 @@ static void rna_def_material_raymirror(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "gloss_amount", PROP_FLOAT, PROP_PERCENTAGE); + prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_float_sdna(prop, NULL, "gloss_mir"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Gloss Amount", "The shininess of the reflection. Values < 1.0 give diffuse, blurry reflections."); @@ -835,7 +835,7 @@ static void rna_def_material_raytra(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Fresnel Factor", "Blending factor for Fresnel."); RNA_def_property_update(prop, NC_MATERIAL|ND_SHADING, NULL); - prop= RNA_def_property(srna, "gloss_amount", PROP_FLOAT, PROP_PERCENTAGE); + prop= RNA_def_property(srna, "gloss_factor", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_float_sdna(prop, NULL, "gloss_tra"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Gloss Amount", "The clarity of the refraction. Values < 1.0 give diffuse, blurry refractions."); From 9e7b276dba2493fe1597fbdb0d906d1bab776fe9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 28 Aug 2009 15:03:49 +0000 Subject: [PATCH 312/577] Sequence sound was raising a python exception with crop and offset buttons. renamed RNA properties. x_offset, y_offset -> offset_x, offset_y, this order is more common in rna. render.border -> render.use_border render.placeholders -> render.use_placeholder render.no_overwrite -> render.use_overwrite --- release/ui/buttons_data_text.py | 4 +-- release/ui/buttons_scene.py | 8 ++--- release/ui/space_sequencer.py | 39 +++++++++++----------- release/ui/space_view3d.py | 4 +-- source/blender/makesrna/intern/rna_curve.c | 4 +-- source/blender/makesrna/intern/rna_scene.c | 10 +++--- source/blender/makesrna/intern/rna_space.c | 8 ++--- 7 files changed, 39 insertions(+), 38 deletions(-) diff --git a/release/ui/buttons_data_text.py b/release/ui/buttons_data_text.py index 62d4d0a4d21..1abc82cfaa3 100644 --- a/release/ui/buttons_data_text.py +++ b/release/ui/buttons_data_text.py @@ -134,8 +134,8 @@ class DATA_PT_paragraph(DataButtonsPanel): col = split.column(align=True) col.itemL(text="Offset:") - col.itemR(text, "x_offset", text="X") - col.itemR(text, "y_offset", text="Y") + col.itemR(text, "offset_x", text="X") + col.itemR(text, "offset_y", text="Y") #col.itemR(text, "wrap") """ diff --git a/release/ui/buttons_scene.py b/release/ui/buttons_scene.py index 08eee7ef43a..abd42e32e35 100644 --- a/release/ui/buttons_scene.py +++ b/release/ui/buttons_scene.py @@ -222,8 +222,8 @@ class SCENE_PT_output(RenderButtonsPanel): col = split.column() col.itemR(rd, "file_extensions") - col.itemR(rd, "placeholders") - col.itemR(rd, "no_overwrite") + col.itemR(rd, "use_overwrite") + col.itemR(rd, "use_placeholder") if rd.file_format in ('AVIJPEG', 'JPEG'): split = layout.split() @@ -370,9 +370,9 @@ class SCENE_PT_dimensions(RenderButtonsPanel): sub.itemR(rd, "pixel_aspect_y", text="Y") row = col.row() - row.itemR(rd, "border", text="Border") + row.itemR(rd, "use_border", text="Border") rowsub = row.row() - rowsub.active = rd.border + rowsub.active = rd.use_border rowsub.itemR(rd, "crop_to_border", text="Crop") col = split.column(align=True) diff --git a/release/ui/space_sequencer.py b/release/ui/space_sequencer.py index de3cfa17987..cf9d89edec8 100644 --- a/release/ui/space_sequencer.py +++ b/release/ui/space_sequencer.py @@ -434,26 +434,27 @@ class SEQUENCER_PT_input(SequencerButtonsPanel): if elem: col.itemR(elem, "filename", text="") # strip.elements[0] could be a fallback - layout.itemR(strip, "use_translation", text="Image Offset:") - if strip.transform: - col = layout.column(align=True) - col.active = strip.use_translation - col.itemR(strip.transform, "offset_x", text="X") - col.itemR(strip.transform, "offset_y", text="Y") - - layout.itemR(strip, "use_crop", text="Image Crop:") - if strip.crop: - col = layout.column(align=True) - col.active = strip.use_crop - col.itemR(strip.crop, "top") - col.itemR(strip.crop, "left") - col.itemR(strip.crop, "bottom") - col.itemR(strip.crop, "right") + if strip.type != 'SOUND': + layout.itemR(strip, "use_translation", text="Image Offset:") + if strip.transform: + col = layout.column(align=True) + col.active = strip.use_translation + col.itemR(strip.transform, "offset_x", text="X") + col.itemR(strip.transform, "offset_y", text="Y") - col = layout.column(align=True) - col.itemL(text="Trim Duration:") - col.itemR(strip, "animation_start_offset", text="Start") - col.itemR(strip, "animation_end_offset", text="End") + layout.itemR(strip, "use_crop", text="Image Crop:") + if strip.crop: + col = layout.column(align=True) + col.active = strip.use_crop + col.itemR(strip.crop, "top") + col.itemR(strip.crop, "left") + col.itemR(strip.crop, "bottom") + col.itemR(strip.crop, "right") + + col = layout.column(align=True) + col.itemL(text="Trim Duration:") + col.itemR(strip, "animation_start_offset", text="Start") + col.itemR(strip, "animation_end_offset", text="End") class SEQUENCER_PT_sound(SequencerButtonsPanel): __label__ = "Sound" diff --git a/release/ui/space_view3d.py b/release/ui/space_view3d.py index ae17307080f..5801f9e7941 100644 --- a/release/ui/space_view3d.py +++ b/release/ui/space_view3d.py @@ -1244,8 +1244,8 @@ class VIEW3D_PT_background_image(bpy.types.Panel): col.itemL(text="Offset:") col = layout.column(align=True) - col.itemR(bg, "x_offset", text="X") - col.itemR(bg, "y_offset", text="Y") + col.itemR(bg, "offset_x", text="X") + col.itemR(bg, "offset_y", text="Y") bpy.types.register(VIEW3D_HT_header) # Header diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 1dd3d0e63c5..bb094eef962 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -401,13 +401,13 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna) RNA_def_property_ui_text(prop, "Shear", "Italic angle of the characters"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - prop= RNA_def_property(srna, "x_offset", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "xof"); RNA_def_property_range(prop, -50.0f, 50.0f); RNA_def_property_ui_text(prop, "X Offset", "Horizontal offset from the object center"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - prop= RNA_def_property(srna, "y_offset", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "yof"); RNA_def_property_range(prop, -50.0f, 50.0f); RNA_def_property_ui_text(prop, "Y Offset", "Vertical offset from the object center"); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 2408d9337e1..02b891c6cd2 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1650,7 +1650,7 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Motion Blur", "Use multi-sampled 3D scene motion blur (uses number of anti-aliasing samples)."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "border", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER); RNA_def_property_ui_text(prop, "Border", "Render a user-defined border region, within the frame size."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); @@ -1660,14 +1660,14 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Crop to Border", "Crop the rendered frame to the defined border size."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "placeholders", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "use_placeholder", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_TOUCH); RNA_def_property_ui_text(prop, "Placeholders", "Create empty placeholder files while rendering frames (similar to Unix 'touch')."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "no_overwrite", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "mode", R_NO_OVERWRITE); - RNA_def_property_ui_text(prop, "No Overwrite", "Skip and don't overwrite existing files while rendering"); + prop= RNA_def_property(srna, "use_overwrite", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", R_NO_OVERWRITE); + RNA_def_property_ui_text(prop, "Overwrite", "Overwrite existing files while rendering."); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "use_compositing", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index a754d619741..d6a17526a65 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -493,12 +493,12 @@ static void rna_def_background_image(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed."); RNA_def_property_update(prop, NC_WINDOW, NULL); - prop= RNA_def_property(srna, "x_offset", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "xof"); RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally from the view center"); RNA_def_property_update(prop, NC_WINDOW, NULL); - prop= RNA_def_property(srna, "y_offset", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "yof"); RNA_def_property_ui_text(prop, "Y Offset", "Offsets image vertically from the view center"); RNA_def_property_update(prop, NC_WINDOW, NULL); @@ -913,11 +913,11 @@ static void rna_def_space_sequencer(BlenderRNA *brna) /* not sure we need rna access to these but adding anyway */ - prop= RNA_def_property(srna, "x_offset", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "xof"); RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally from the view center"); - prop= RNA_def_property(srna, "y_offset", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "yof"); RNA_def_property_ui_text(prop, "Y Offset", "Offsets image horizontally from the view center"); From 9781320716c32adec710c3d616685fb4171faa29 Mon Sep 17 00:00:00 2001 From: Diego Borghetti Date: Fri, 28 Aug 2009 15:54:15 +0000 Subject: [PATCH 313/577] Add Makefile for sound ops. --- source/Makefile | 1 + source/blender/editors/Makefile | 1 + source/blender/editors/sound/Makefile | 51 +++++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 source/blender/editors/sound/Makefile diff --git a/source/Makefile b/source/Makefile index a13d8bb41d5..d9acd4bf059 100644 --- a/source/Makefile +++ b/source/Makefile @@ -266,6 +266,7 @@ PULIB += $(OCGDIR)/blender/ed_screen/$(DEBUG_DIR)libed_screen.a PULIB += $(OCGDIR)/blender/ed_console/$(DEBUG_DIR)libed_console.a PULIB += $(OCGDIR)/blender/ed_userpref/$(DEBUG_DIR)libed_userpref.a PULIB += $(OCGDIR)/blender/ed_gpencil/$(DEBUG_DIR)libed_gpencil.a +PULIB += $(OCGDIR)/blender/ed_opsound/$(DEBUG_DIR)libed_opsound.a PULIB += $(OCGDIR)/blender/windowmanager/$(DEBUG_DIR)libwindowmanager.a PULIB += $(OCGDIR)/blender/python/$(DEBUG_DIR)libpython.a PULIB += $(OCGDIR)/blender/makesrna/$(DEBUG_DIR)librna.a diff --git a/source/blender/editors/Makefile b/source/blender/editors/Makefile index bbbb3fb985f..6a9d695ab0e 100644 --- a/source/blender/editors/Makefile +++ b/source/blender/editors/Makefile @@ -66,5 +66,6 @@ DIRS = armature \ space_sequencer \ space_logic \ space_userpref \ + sound include nan_subdirs.mk diff --git a/source/blender/editors/sound/Makefile b/source/blender/editors/sound/Makefile new file mode 100644 index 00000000000..10145035eb4 --- /dev/null +++ b/source/blender/editors/sound/Makefile @@ -0,0 +1,51 @@ +# +# $Id$ +# +# ***** 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) 2007 Blender Foundation +# All rights reserved. +# +# The Original Code is: all of this file. +# +# Contributor(s): none yet. +# +# ***** END GPL LICENSE BLOCK ***** +# +# Makes module object directory and bounces make to subdirectories. + +LIBNAME = ed_opsound +DIR = $(OCGDIR)/blender/$(LIBNAME) + +include nan_compile.mk + +CFLAGS += $(LEVEL_1_C_WARNINGS) + +CPPFLAGS += -I$(NAN_GUARDEDALLOC)/include + +CPPFLAGS += -I../../windowmanager +CPPFLAGS += -I../../blenkernel +CPPFLAGS += -I../../blenloader +CPPFLAGS += -I../../blenlib +CPPFLAGS += -I../../makesdna +CPPFLAGS += -I../../makesrna +CPPFLAGS += -I../../imbuf +CPPFLAGS += -I$(NAN_AUDASPACE)/include + +# own include + +CPPFLAGS += -I../include From a179d16550d15a4543aef940d515ae039ce43e45 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Fri, 28 Aug 2009 20:41:12 +0000 Subject: [PATCH 314/577] Moved unpack_method_items to the right place. --- source/blender/editors/space_image/image_ops.c | 10 +--------- source/blender/makesrna/RNA_enum_types.h | 2 ++ source/blender/makesrna/intern/rna_packedfile.c | 7 +++++++ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 7a39cd587eb..bee06e6892f 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -61,6 +61,7 @@ #include "RNA_access.h" #include "RNA_define.h" #include "RNA_types.h" +#include "RNA_enum_types.h" #include "ED_image.h" #include "ED_screen.h" @@ -1166,15 +1167,6 @@ void IMAGE_OT_pack(wmOperatorType *ot) /********************* unpack operator *********************/ -/* XXX move this to some place where it can be reused */ - -const EnumPropertyItem unpack_method_items[] = { - {PF_USE_LOCAL, "USE_LOCAL", 0, "Use Local File", ""}, - {PF_WRITE_LOCAL, "WRITE_LOCAL", 0, "Write Local File (overwrite existing)", ""}, - {PF_USE_ORIGINAL, "USE_ORIGINAL", 0, "Use Original File", ""}, - {PF_WRITE_ORIGINAL, "WRITE_ORIGINAL", 0, "Write Original File (overwrite existing)", ""}, - {0, NULL, 0, NULL, NULL}}; - void unpack_menu(bContext *C, char *opname, char *abs_name, char *folder, PackedFile *pf) { uiPopupMenu *pup; diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h index 06be0e69be5..3bba474677f 100644 --- a/source/blender/makesrna/RNA_enum_types.h +++ b/source/blender/makesrna/RNA_enum_types.h @@ -53,6 +53,8 @@ extern EnumPropertyItem event_type_items[]; extern EnumPropertyItem brush_sculpt_tool_items[]; +extern EnumPropertyItem unpack_method_items[]; + #endif /* RNA_ENUM_TYPES */ diff --git a/source/blender/makesrna/intern/rna_packedfile.c b/source/blender/makesrna/intern/rna_packedfile.c index 6b9a708f555..85918bce05b 100644 --- a/source/blender/makesrna/intern/rna_packedfile.c +++ b/source/blender/makesrna/intern/rna_packedfile.c @@ -31,6 +31,13 @@ #include "DNA_packedFile_types.h" +EnumPropertyItem unpack_method_items[] = { + {PF_USE_LOCAL, "USE_LOCAL", 0, "Use Local File", ""}, + {PF_WRITE_LOCAL, "WRITE_LOCAL", 0, "Write Local File (overwrite existing)", ""}, + {PF_USE_ORIGINAL, "USE_ORIGINAL", 0, "Use Original File", ""}, + {PF_WRITE_ORIGINAL, "WRITE_ORIGINAL", 0, "Write Original File (overwrite existing)", ""}, + {0, NULL, 0, NULL, NULL}}; + #ifdef RNA_RUNTIME #else From 6f80bff0e2390f3e93ee31967e7ada417c7ba0c3 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 28 Aug 2009 20:51:30 +0000 Subject: [PATCH 315/577] 2.5: fix bug in ID property loading, which also loading python RNA collections saves as ID properties. --- source/blender/blenloader/intern/readfile.c | 29 +++++++++++---------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 1a811ebc08a..89dfa4e2557 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1373,12 +1373,10 @@ static void IDP_DirectLinkIDPArray(IDProperty *prop, int switch_endian, FileData prop->totallen = prop->len; prop->data.pointer = newdataadr(fd, prop->data.pointer); - if (switch_endian) { - array= (IDProperty*) prop->data.pointer; + array= (IDProperty*) prop->data.pointer; - for(i=0; ilen; i++) - IDP_DirectLinkProperty(&array[i], switch_endian, fd); - } + for(i=0; ilen; i++) + IDP_DirectLinkProperty(&array[i], switch_endian, fd); } static void IDP_DirectLinkArray(IDProperty *prop, int switch_endian, FileData *fd) @@ -1390,19 +1388,22 @@ static void IDP_DirectLinkArray(IDProperty *prop, int switch_endian, FileData *f prop->totallen = prop->len; prop->data.pointer = newdataadr(fd, prop->data.pointer); - if (switch_endian) { - if(prop->subtype == IDP_GROUP) { - test_pointer_array(fd, prop->data.pointer); - array= prop->data.pointer; + if(prop->subtype == IDP_GROUP) { + test_pointer_array(fd, prop->data.pointer); + array= prop->data.pointer; - for(i=0; ilen; i++) - IDP_DirectLinkProperty(array[i], switch_endian, fd); - } - else if(prop->subtype == IDP_DOUBLE) { + for(i=0; ilen; i++) + IDP_DirectLinkProperty(array[i], switch_endian, fd); + } + else if(prop->subtype == IDP_DOUBLE) { + if (switch_endian) { for (i=0; ilen; i++) { SWITCH_LONGINT(((double*)prop->data.pointer)[i]); } - } else { + } + } + else { + if (switch_endian) { for (i=0; ilen; i++) { SWITCH_INT(((int*)prop->data.pointer)[i]); } From 6f4e0e8e54aba3b674b86dcfb367cceb8619e786 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Fri, 28 Aug 2009 21:07:55 +0000 Subject: [PATCH 316/577] 2.5 Paint: * Cleaned up some vertex paint code. Reduces code duplication a bit. --- .../editors/sculpt_paint/paint_vertex.c | 95 ++++++++----------- 1 file changed, 37 insertions(+), 58 deletions(-) diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index ee3d9e5baa1..581d10ee883 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1610,13 +1610,13 @@ For future: */ -struct VPaintData { +typedef struct VPaintData { ViewContext vc; unsigned int paintcol; int *indexar; float *vertexcosnos; float vpimat[3][3]; -}; +} VPaintData; static int vpaint_stroke_test_start(bContext *C, struct wmOperator *op, wmEvent *event) { @@ -1655,6 +1655,38 @@ static int vpaint_stroke_test_start(bContext *C, struct wmOperator *op, wmEvent return 1; } +static void vpaint_paint_face(VPaint *vp, VPaintData *vpd, Object *ob, int index, float mval[2]) +{ + ViewContext *vc = &vpd->vc; + Mesh *me = get_mesh(ob); + MFace *mface= ((MFace*)me->mface) + index; + unsigned int *mcol= ((unsigned int*)me->mcol) + 4*index; + unsigned int *mcolorig= ((unsigned int*)vp->vpaint_prev) + 4*index; + int alpha, i; + + if((vp->flag & VP_COLINDEX && mface->mat_nr!=ob->actcol-1) || + (G.f & G_FACESELECT && !(mface->flag & ME_FACE_SEL))) + return; + + if(vp->mode==VP_BLUR) { + unsigned int fcol1= mcol_blend( mcol[0], mcol[1], 128); + if(mface->v4) { + unsigned int fcol2= mcol_blend( mcol[2], mcol[3], 128); + vpd->paintcol= mcol_blend( fcol1, fcol2, 128); + } + else { + vpd->paintcol= mcol_blend( mcol[2], fcol1, 170); + } + + } + + for(i = 0; i < (mface->v4 ? 4 : 3); ++i) { + alpha= calc_vp_alpha_dl(vp, vc, vpd->vpimat, vpd->vertexcosnos+6*(&mface->v1)[i], mval); + if(alpha) + vpaint_blend(vp, mcol+i, mcolorig+i, vpd->paintcol, alpha); + } +} + static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, PointerRNA *itemptr) { ToolSettings *ts= CTX_data_tool_settings(C); @@ -1694,62 +1726,9 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P MTC_Mat4SwapMat4(vc->rv3d->persmat, mat); - if(vp->flag & VP_COLINDEX) { - for(index=0; indextotface) { - MFace *mface= ((MFace *)me->mface) + (indexar[index]-1); - - if(mface->mat_nr!=ob->actcol-1) { - indexar[index]= 0; - } - } - } - } - if((G.f & G_FACESELECT) && me->mface) { - for(index=0; indextotface) { - MFace *mface= ((MFace *)me->mface) + (indexar[index]-1); - - if((mface->flag & ME_FACE_SEL)==0) - indexar[index]= 0; - } - } - } - - for(index=0; indextotface) { - MFace *mface= ((MFace *)me->mface) + (indexar[index]-1); - unsigned int *mcol= ( (unsigned int *)me->mcol) + 4*(indexar[index]-1); - unsigned int *mcolorig= ( (unsigned int *)vp->vpaint_prev) + 4*(indexar[index]-1); - int alpha; - - if(vp->mode==VP_BLUR) { - unsigned int fcol1= mcol_blend( mcol[0], mcol[1], 128); - if(mface->v4) { - unsigned int fcol2= mcol_blend( mcol[2], mcol[3], 128); - vpd->paintcol= mcol_blend( fcol1, fcol2, 128); - } - else { - vpd->paintcol= mcol_blend( mcol[2], fcol1, 170); - } - - } - - alpha= calc_vp_alpha_dl(vp, vc, vpd->vpimat, vpd->vertexcosnos+6*mface->v1, mval); - if(alpha) vpaint_blend(vp, mcol, mcolorig, vpd->paintcol, alpha); - - alpha= calc_vp_alpha_dl(vp, vc, vpd->vpimat, vpd->vertexcosnos+6*mface->v2, mval); - if(alpha) vpaint_blend(vp, mcol+1, mcolorig+1, vpd->paintcol, alpha); - - alpha= calc_vp_alpha_dl(vp, vc, vpd->vpimat, vpd->vertexcosnos+6*mface->v3, mval); - if(alpha) vpaint_blend(vp, mcol+2, mcolorig+2, vpd->paintcol, alpha); - - if(mface->v4) { - alpha= calc_vp_alpha_dl(vp, vc, vpd->vpimat, vpd->vertexcosnos+6*mface->v4, mval); - if(alpha) vpaint_blend(vp, mcol+3, mcolorig+3, vpd->paintcol, alpha); - } - } + for(index=0; indextotface) + vpaint_paint_face(vp, vpd, ob, indexar[index]-1, mval); } MTC_Mat4SwapMat4(vc->rv3d->persmat, mat); From 99eae3d93a8281b7c947ce8a42aafbe8b3c9a706 Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Fri, 28 Aug 2009 21:31:13 +0000 Subject: [PATCH 317/577] SVN maintenance. --- source/blender/editors/gpencil/gpencil_buttons.c | 2 +- source/blender/editors/include/ED_sound.h | 2 +- source/blender/editors/sound/sound_intern.h | 2 +- source/blender/editors/sound/sound_ops.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c index 87f3b60dcc2..12e987af47b 100644 --- a/source/blender/editors/gpencil/gpencil_buttons.c +++ b/source/blender/editors/gpencil/gpencil_buttons.c @@ -1,5 +1,5 @@ /** - * $Id: drawgpencil.c 22802 2009-08-26 12:01:15Z aligorith $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/include/ED_sound.h b/source/blender/editors/include/ED_sound.h index 584370bc738..afb2752fa6b 100644 --- a/source/blender/editors/include/ED_sound.h +++ b/source/blender/editors/include/ED_sound.h @@ -1,5 +1,5 @@ /** - * $Id:$ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/sound/sound_intern.h b/source/blender/editors/sound/sound_intern.h index eb793a0b661..ec8b0688305 100644 --- a/source/blender/editors/sound/sound_intern.h +++ b/source/blender/editors/sound/sound_intern.h @@ -1,5 +1,5 @@ /** - * $Id:$ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index a23a28423ef..83f83c637bf 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -1,5 +1,5 @@ /** - * $Id:$ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * From 03b3d2cb794c5fe03fc4c27b006044e24e294cfc Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Fri, 28 Aug 2009 21:47:05 +0000 Subject: [PATCH 318/577] Sound packing/unpacking operators. --- source/blender/blenkernel/intern/sound.c | 6 +- source/blender/editors/sound/sound_ops.c | 178 +++++++++++++++++++++++ 2 files changed, 181 insertions(+), 3 deletions(-) diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 3794fbe90ef..8159f2f8c4c 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -163,7 +163,7 @@ void sound_cache(struct bSound* sound, int ignore) AUD_unload(sound->cache); sound->cache = AUD_bufferSound(sound->handle); - sound->changed = TRUE; + sound->changed++; } void sound_delete_cache(struct bSound* sound) @@ -204,7 +204,7 @@ void sound_load(struct Main *main, struct bSound* sound) if(sound->id.lib) path = sound->id.lib->filename; else - path = main ? main->name : NULL; + path = main ? main->name : G.sce; BLI_convertstringcode(fullpath, path); @@ -229,7 +229,7 @@ void sound_load(struct Main *main, struct bSound* sound) break; } #endif - sound->changed = TRUE; + sound->changed++; } } diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 83f83c637bf..e03d647602e 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -26,22 +26,33 @@ * ***** END GPL LICENSE BLOCK ***** */ +#include +#include #include +#include "DNA_packedFile_types.h" #include "DNA_scene_types.h" #include "DNA_space_types.h" #include "DNA_sound_types.h" +#include "DNA_sequence_types.h" #include "DNA_windowmanager_types.h" #include "BKE_context.h" +#include "BKE_global.h" #include "BKE_main.h" #include "BKE_report.h" +#include "BKE_packedFile.h" #include "BKE_sound.h" +#include "BLI_blenlib.h" + #include "ED_sound.h" #include "RNA_access.h" #include "RNA_define.h" +#include "RNA_enum_types.h" + +#include "UI_interface.h" #include "WM_api.h" #include "WM_types.h" @@ -103,7 +114,174 @@ void SOUND_OT_open(wmOperatorType *ot) /* ******************************************************* */ +static int sound_poll(bContext *C) +{ + Editing* ed = CTX_data_scene(C)->ed; + + if(!ed || !ed->act_seq || ed->act_seq->type != SEQ_SOUND || !ed->act_seq->sound) + return 0; + + return 1; +} +/********************* pack operator *********************/ + +static int pack_exec(bContext *C, wmOperator *op) +{ + Editing* ed = CTX_data_scene(C)->ed; + bSound* sound; + + if(!ed || !ed->act_seq || ed->act_seq->type != SEQ_SOUND) + return OPERATOR_CANCELLED; + + sound = ed->act_seq->sound; + + if(!sound || sound->packedfile) + return OPERATOR_CANCELLED; + + sound->packedfile= newPackedFile(op->reports, sound->name); + sound_load(CTX_data_main(C), sound); + + return OPERATOR_FINISHED; +} + +void SOUND_OT_pack(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Pack Sound"; + ot->idname= "SOUND_OT_pack"; + + /* api callbacks */ + ot->exec= pack_exec; + ot->poll= sound_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/********************* unpack operator *********************/ + +// XXX this function is in image_ops.c too, exactly the same, should be moved to a generally accessible position +void unpack_menu(bContext *C, char *opname, char *abs_name, char *folder, PackedFile *pf) +{ + uiPopupMenu *pup; + uiLayout *layout; + char line[FILE_MAX + 100]; + char local_name[FILE_MAXDIR + FILE_MAX], fi[FILE_MAX]; + + strcpy(local_name, abs_name); + BLI_splitdirstring(local_name, fi); + sprintf(local_name, "//%s/%s", folder, fi); + + pup= uiPupMenuBegin(C, "Unpack file", 0); + layout= uiPupMenuLayout(pup); + + uiItemEnumO(layout, "Remove Pack", 0, opname, "method", PF_REMOVE); + + if(strcmp(abs_name, local_name)) { + switch(checkPackedFile(local_name, pf)) { + case PF_NOFILE: + sprintf(line, "Create %s", local_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_LOCAL); + break; + case PF_EQUAL: + sprintf(line, "Use %s (identical)", local_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_USE_LOCAL); + break; + case PF_DIFFERS: + sprintf(line, "Use %s (differs)", local_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_USE_LOCAL); + sprintf(line, "Overwrite %s", local_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_LOCAL); + break; + } + } + + switch(checkPackedFile(abs_name, pf)) { + case PF_NOFILE: + sprintf(line, "Create %s", abs_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_ORIGINAL); + break; + case PF_EQUAL: + sprintf(line, "Use %s (identical)", abs_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_USE_ORIGINAL); + break; + case PF_DIFFERS: + sprintf(line, "Use %s (differs)", local_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_USE_ORIGINAL); + sprintf(line, "Overwrite %s", local_name); + uiItemEnumO(layout, line, 0, opname, "method", PF_WRITE_ORIGINAL); + break; + } + + uiPupMenuEnd(C, pup); +} + +static int unpack_exec(bContext *C, wmOperator *op) +{ + int method= RNA_enum_get(op->ptr, "method"); + Editing* ed = CTX_data_scene(C)->ed; + bSound* sound; + + if(!ed || !ed->act_seq || ed->act_seq->type != SEQ_SOUND) + return OPERATOR_CANCELLED; + + sound = ed->act_seq->sound; + + if(!sound || !sound->packedfile) + return OPERATOR_CANCELLED; + + if(G.fileflags & G_AUTOPACK) + BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save."); + + unpackSound(op->reports, sound, method); + + return OPERATOR_FINISHED; +} + +static int unpack_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + Editing* ed = CTX_data_scene(C)->ed; + bSound* sound; + + if(!ed || !ed->act_seq || ed->act_seq->type != SEQ_SOUND) + return OPERATOR_CANCELLED; + + sound = ed->act_seq->sound; + + if(!sound || !sound->packedfile) + return OPERATOR_CANCELLED; + + if(G.fileflags & G_AUTOPACK) + BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save."); + + unpack_menu(C, "SOUND_OT_unpack", sound->name, "audio", sound->packedfile); + + return OPERATOR_FINISHED; +} + +void SOUND_OT_unpack(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Unpack Sound"; + ot->idname= "SOUND_OT_unpack"; + + /* api callbacks */ + ot->exec= unpack_exec; + ot->invoke= unpack_invoke; + ot->poll= sound_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_enum(ot->srna, "method", unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack."); +} + +/* ******************************************************* */ + void ED_operatortypes_sound(void) { WM_operatortype_append(SOUND_OT_open); + WM_operatortype_append(SOUND_OT_pack); + WM_operatortype_append(SOUND_OT_unpack); } From 77c587a8250cd21c751bbab0c4dd263989d88b9a Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Fri, 28 Aug 2009 21:47:11 +0000 Subject: [PATCH 319/577] 2.5 Paint: * Removed the BKE_sculpt file and moved it's contents (basically just the sculpt session struct) to BKE_paint --- source/blender/blenkernel/BKE_paint.h | 39 ++++++++++ source/blender/blenkernel/BKE_sculpt.h | 72 ------------------- source/blender/blenkernel/intern/object.c | 2 +- source/blender/blenloader/intern/readfile.c | 2 +- source/blender/editors/sculpt_paint/sculpt.c | 1 - .../editors/sculpt_paint/sculpt_intern.h | 1 - 6 files changed, 41 insertions(+), 76 deletions(-) delete mode 100644 source/blender/blenkernel/BKE_sculpt.h diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index 4337d275776..7dc9e4499c6 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -29,9 +29,13 @@ #define BKE_PAINT_H struct Brush; +struct MFace; +struct MultireModifierData; +struct MVert; struct Object; struct Paint; struct Scene; +struct StrokeCache; extern const char PAINT_CURSOR_SCULPT[3]; extern const char PAINT_CURSOR_VERTEX_PAINT[3]; @@ -53,4 +57,39 @@ void paint_brush_slot_remove(struct Paint *p); * however hiding faces is useful */ int paint_facesel_test(struct Object *ob); +/* Session data (mode-specific) */ + +typedef struct SculptSession { + struct ProjVert *projverts; + + /* Mesh data (not copied) can come either directly from a Mesh, or from a MultiresDM */ + struct MultiresModifierData *multires; /* Special handling for multires meshes */ + struct MVert *mvert; + struct MFace *mface; + int totvert, totface; + float *face_normals; + + /* Mesh connectivity */ + struct ListBase *fmap; + struct IndexNode *fmap_mem; + int fmap_size; + + /* Used temporarily per-stroke */ + float *vertexcosnos; + ListBase damaged_rects; + ListBase damaged_verts; + + /* Used to cache the render of the active texture */ + unsigned int texcache_side, *texcache, texcache_actual; + + /* Layer brush persistence between strokes */ + float (*mesh_co_orig)[3]; /* Copy of the mesh vertices' locations */ + float *layer_disps; /* Displacements for each vertex */ + + struct SculptStroke *stroke; + struct StrokeCache *cache; +} SculptSession; + +void free_sculptsession(SculptSession **); + #endif diff --git a/source/blender/blenkernel/BKE_sculpt.h b/source/blender/blenkernel/BKE_sculpt.h deleted file mode 100644 index 9e5647a8775..00000000000 --- a/source/blender/blenkernel/BKE_sculpt.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * $Id$ - * - * ***** 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) 2007 by Nicholas Bishop - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#ifndef BKE_SCULPT_H -#define BKE_SCULPT_H - -struct MFace; -struct MultireModifierData; -struct MVert; -struct Object; -struct StrokeCache; - -typedef struct SculptSession { - struct ProjVert *projverts; - - /* Mesh data (not copied) can come either directly from a Mesh, or from a MultiresDM */ - struct MultiresModifierData *multires; /* Special handling for multires meshes */ - struct MVert *mvert; - struct MFace *mface; - int totvert, totface; - float *face_normals; - - /* Mesh connectivity */ - struct ListBase *fmap; - struct IndexNode *fmap_mem; - int fmap_size; - - /* Used temporarily per-stroke */ - float *vertexcosnos; - ListBase damaged_rects; - ListBase damaged_verts; - - /* Used to cache the render of the active texture */ - unsigned int texcache_side, *texcache, texcache_actual; - - /* Layer brush persistence between strokes */ - float (*mesh_co_orig)[3]; /* Copy of the mesh vertices' locations */ - float *layer_disps; /* Displacements for each vertex */ - - struct SculptStroke *stroke; - struct StrokeCache *cache; -} SculptSession; - -void free_sculptsession(SculptSession **); - -#endif diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 6f57a658efa..1cb0abfe21c 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -101,13 +101,13 @@ #include "BKE_mball.h" #include "BKE_modifier.h" #include "BKE_object.h" +#include "BKE_paint.h" #include "BKE_particle.h" #include "BKE_pointcache.h" #include "BKE_property.h" #include "BKE_sca.h" #include "BKE_scene.h" #include "BKE_screen.h" -#include "BKE_sculpt.h" #include "BKE_softbody.h" #include "LBM_fluidsim.h" diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 89dfa4e2557..9d5ae3062a1 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -135,6 +135,7 @@ #include "BKE_multires.h" #include "BKE_node.h" // for tree type defines #include "BKE_object.h" +#include "BKE_paint.h" #include "BKE_particle.h" #include "BKE_pointcache.h" #include "BKE_property.h" // for get_ob_property @@ -143,7 +144,6 @@ #include "BKE_scene.h" #include "BKE_softbody.h" // sbNew() #include "BKE_bullet.h" // bsbNew() -#include "BKE_sculpt.h" #include "BKE_sequence.h" #include "BKE_texture.h" // for open_plugin_tex #include "BKE_utildefines.h" // SWITCH_INT DATA ENDB DNA1 O_BINARY GLOB USER TEST REND diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index adaba804799..b08e8ab5c2b 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -65,7 +65,6 @@ #include "BKE_modifier.h" #include "BKE_multires.h" #include "BKE_paint.h" -#include "BKE_sculpt.h" #include "BKE_texture.h" #include "BKE_utildefines.h" #include "BKE_colortools.h" diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h index febca301939..25f97b862e6 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.h +++ b/source/blender/editors/sculpt_paint/sculpt_intern.h @@ -32,7 +32,6 @@ #include "DNA_listBase.h" #include "DNA_vec_types.h" -#include "BKE_sculpt.h" struct Brush; struct Mesh; From 17fc83e537f8bfca643d555b8f5e2d14afebd93d Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Fri, 28 Aug 2009 21:54:41 +0000 Subject: [PATCH 320/577] Error in last commit. --- source/blender/editors/sound/sound_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index e03d647602e..d8a84611298 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -161,7 +161,7 @@ void SOUND_OT_pack(wmOperatorType *ot) /********************* unpack operator *********************/ // XXX this function is in image_ops.c too, exactly the same, should be moved to a generally accessible position -void unpack_menu(bContext *C, char *opname, char *abs_name, char *folder, PackedFile *pf) +static void unpack_menu(bContext *C, char *opname, char *abs_name, char *folder, PackedFile *pf) { uiPopupMenu *pup; uiLayout *layout; From beee5161a9a48eb1610dcad6d9c136b907b2d8ee Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Fri, 28 Aug 2009 22:04:37 +0000 Subject: [PATCH 321/577] UI for sound (un)packing. --- release/ui/space_sequencer.py | 7 +++++++ source/blender/editors/sound/sound_ops.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/release/ui/space_sequencer.py b/release/ui/space_sequencer.py index cf9d89edec8..87111b2925f 100644 --- a/release/ui/space_sequencer.py +++ b/release/ui/space_sequencer.py @@ -476,6 +476,13 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel): layout.template_ID(strip, "sound", new="sound.open") + layout.itemS() + + if strip.sound.packed_file: + layout.itemO("sound.unpack") + else: + layout.itemO("sound.pack") + layout.itemR(strip.sound, "filename") layout.itemR(strip.sound, "caching") diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index d8a84611298..75204207284 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -118,7 +118,7 @@ static int sound_poll(bContext *C) { Editing* ed = CTX_data_scene(C)->ed; - if(!ed || !ed->act_seq || ed->act_seq->type != SEQ_SOUND || !ed->act_seq->sound) + if(!ed || !ed->act_seq || ed->act_seq->type != SEQ_SOUND) return 0; return 1; From 732844bb28f1ad7b14d91455ad24df3d3be86e0c Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sat, 29 Aug 2009 00:41:14 +0000 Subject: [PATCH 322/577] * Fixes for point density texture --- release/ui/buttons_texture.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/release/ui/buttons_texture.py b/release/ui/buttons_texture.py index 78d5e6af790..ad0542d787a 100644 --- a/release/ui/buttons_texture.py +++ b/release/ui/buttons_texture.py @@ -656,7 +656,6 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel): tex = context.texture pd = tex.pointdensity - ob = context.object layout.itemR(pd, "point_source", expand=True) @@ -664,8 +663,12 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel): col = split.column() if pd.point_source == 'PARTICLE_SYSTEM': + col.itemL(text="Object:") + col.itemR(pd, "object", text="") + col = col.column() + col.enabled = pd.object col.itemL(text="System:") - col.item_pointerR(pd, "particle_system", ob, "particle_systems", text="") + col.item_pointerR(pd, "particle_system", pd.object, "particle_systems", text="") col.itemL(text="Cache:") col.itemR(pd, "particle_cache", text="") else: From f46f6dc7ba32411a8031a243bba635c8cc3ade29 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 29 Aug 2009 01:54:10 +0000 Subject: [PATCH 323/577] Grease Pencil: Toolbar Compatability Fixes * When starting Grease Pencil from the toolbar, strokes are now started only when a click-drag begins. * Made the 'straight-lines' option an RNA property for the operator * Added an exec() callback and relevant stroke-collection stuff so that interactive redo/changing settings can work. WARNING: this is highly unstable here - keeps crashing though I cannot determine the cause yet. --- .../blender/editors/gpencil/gpencil_paint.c | 255 +++++++++++++----- .../blender/editors/space_view3d/view3d_ops.c | 2 +- 2 files changed, 182 insertions(+), 75 deletions(-) diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index d6bdea2db55..445d9ae346d 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -115,7 +115,8 @@ typedef struct tGPsdata { /* values for tGPsdata->status */ enum { - GP_STATUS_NORMAL = 0, /* running normally */ + GP_STATUS_IDLING = 0, /* stroke isn't in progress yet */ + GP_STATUS_PAINTING, /* a stroke is in progress */ GP_STATUS_ERROR, /* something wasn't correctly set up */ GP_STATUS_DONE /* painting done */ }; @@ -196,7 +197,7 @@ static void gp_stroke_convertcoords (tGPsdata *p, short mval[], float out[]) if (gpd->sbuffer_sflag & GP_STROKE_3DSPACE) { View3D *v3d= p->sa->spacedata.first; const short mx=mval[0], my=mval[1]; - float *fp= give_cursor(p->scene, v3d); // XXX NULL could be v3d + float *fp= give_cursor(p->scene, v3d); float dvec[3]; /* Current method just converts each point in screen-coordinates to @@ -727,10 +728,19 @@ static tGPsdata *gp_session_initpaint (bContext *C) { //View3D *v3d= curarea->spacedata.first; - /* set current area */ + /* set current area + * - must verify that region data is 3D-view (and not something else) + */ p->sa= curarea; p->ar= ar; + if (ar->regiondata == NULL) { + p->status= GP_STATUS_ERROR; + if (G.f & G_DEBUG) + printf("Error: 3D-View active region doesn't have any region data, so cannot be drawable \n"); + return p; + } + #if 0 // XXX will this sort of antiquated stuff be restored? /* check that gpencil data is allowed to be drawn */ if ((v3d->flag2 & V3D_DISPGP)==0) { @@ -1002,8 +1012,8 @@ static void gp_paint_cleanup (tGPsdata *p) static int gpencil_draw_init (bContext *C, wmOperator *op) { tGPsdata *p; - wmWindow *win= CTX_wm_window(C); int paintmode= RNA_enum_get(op->ptr, "mode"); + int straightLines= RNA_boolean_get(op->ptr, "straight_lines"); /* check context */ p= op->customdata= gp_session_initpaint(C); @@ -1023,11 +1033,9 @@ static int gpencil_draw_init (bContext *C, wmOperator *op) /* radius for eraser circle is defined in userprefs now */ p->radius= U.gp_eraser; - /* set cursor */ - if (p->paintmode == GP_PAINTMODE_ERASER) - WM_cursor_modal(win, BC_CROSSCURSOR); // XXX need a better cursor - else - WM_cursor_modal(win, BC_PAINTBRUSHCURSOR); + /* set line-drawing settings (straight or freehand lines) */ + if (straightLines) + p->flags |= GP_PAINTFLAG_STRAIGHTLINES; /* everything is now setup ok */ return 1; @@ -1069,45 +1077,9 @@ static int gpencil_draw_cancel (bContext *C, wmOperator *op) /* ------------------------------- */ -static void gpencil_draw_apply_event (bContext *C, wmOperator *op, wmEvent *event) +/* create a new stroke point at the point indicated by the painting context */ +static void gpencil_draw_apply (bContext *C, wmOperator *op, tGPsdata *p) { - tGPsdata *p= op->customdata; - ARegion *ar= p->ar; - int tablet=0; - - /* convert from window-space to area-space mouse coordintes */ - // NOTE: float to ints conversions, +1 factor is probably used to ensure a bit more accurate rounding... - p->mval[0]= event->x - ar->winrct.xmin + 1; - p->mval[1]= event->y - ar->winrct.ymin + 1; - - /* handle pressure sensitivity (which is supplied by tablets) */ - if (event->custom == EVT_DATA_TABLET) { - wmTabletData *wmtab= event->customdata; - - tablet= (wmtab->Active != EVT_TABLET_NONE); - p->pressure= wmtab->Pressure; - //if (wmtab->Active == EVT_TABLET_ERASER) - // TODO... this should get caught by the keymaps which call drawing in the first place - } - else - p->pressure= 1.0f; - - /* special exception for start of strokes (i.e. maybe for just a dot) */ - if (p->flags & GP_PAINTFLAG_FIRSTRUN) { - p->flags &= ~GP_PAINTFLAG_FIRSTRUN; - - p->mvalo[0]= p->mval[0]; - p->mvalo[1]= p->mval[1]; - p->opressure= p->pressure; - - /* special exception here for too high pressure values on first touch in - * windows for some tablets, then we just skip first touch .. - */ - if (tablet && (p->pressure >= 0.99f)) - return; - } - - /* handle drawing/erasing -> test for erasing first */ if (p->paintmode == GP_PAINTMODE_ERASER) { /* do 'live' erasing now */ @@ -1147,6 +1119,59 @@ static void gpencil_draw_apply_event (bContext *C, wmOperator *op, wmEvent *even p->mvalo[1]= p->mval[1]; p->opressure= p->pressure; } +} + +/* handle draw event */ +static void gpencil_draw_apply_event (bContext *C, wmOperator *op, wmEvent *event) +{ + tGPsdata *p= op->customdata; + ARegion *ar= p->ar; + PointerRNA itemptr; + float mousef[2]; + int tablet=0; + + /* convert from window-space to area-space mouse coordintes */ + // NOTE: float to ints conversions, +1 factor is probably used to ensure a bit more accurate rounding... + p->mval[0]= event->x - ar->winrct.xmin + 1; + p->mval[1]= event->y - ar->winrct.ymin + 1; + + /* handle pressure sensitivity (which is supplied by tablets) */ + if (event->custom == EVT_DATA_TABLET) { + wmTabletData *wmtab= event->customdata; + + tablet= (wmtab->Active != EVT_TABLET_NONE); + p->pressure= wmtab->Pressure; + //if (wmtab->Active == EVT_TABLET_ERASER) + // TODO... this should get caught by the keymaps which call drawing in the first place + } + else + p->pressure= 1.0f; + + /* special exception for start of strokes (i.e. maybe for just a dot) */ + if (p->flags & GP_PAINTFLAG_FIRSTRUN) { + p->flags &= ~GP_PAINTFLAG_FIRSTRUN; + + p->mvalo[0]= p->mval[0]; + p->mvalo[1]= p->mval[1]; + p->opressure= p->pressure; + + /* special exception here for too high pressure values on first touch in + * windows for some tablets, then we just skip first touch .. + */ + if (tablet && (p->pressure >= 0.99f)) + return; + } + + /* fill in stroke data (not actually used directly by gpencil_draw_apply) */ + RNA_collection_add(op->ptr, "stroke", &itemptr); + + mousef[0]= p->mval[0]; + mousef[1]= p->mval[1]; + RNA_float_set_array(&itemptr, "mouse", mousef); + RNA_float_set(&itemptr, "pressure", p->pressure); + + /* apply the current latest drawing point */ + gpencil_draw_apply(C, op, p); /* force refresh */ WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX please work! @@ -1154,9 +1179,69 @@ static void gpencil_draw_apply_event (bContext *C, wmOperator *op, wmEvent *even /* ------------------------------- */ +/* operator 'redo' (i.e. after changing some properties) */ +static int gpencil_draw_exec (bContext *C, wmOperator *op) +{ + tGPsdata *p = NULL; + + printf("GPencil - Starting Re-Drawing \n"); + + /* try to initialise context data needed while drawing */ + if (!gpencil_draw_init(C, op)) { + if (op->customdata) MEM_freeN(op->customdata); + printf("\tGP - no valid data \n"); + return OPERATOR_CANCELLED; + } + else + p= op->customdata; + + printf("\tGP - Start redrawing stroke \n"); + + /* loop over the stroke RNA elements recorded (i.e. progress of mouse movement), + * setting the relevant values in context at each step, then applying + */ + RNA_BEGIN(op->ptr, itemptr, "stroke") + { + float mousef[2]; + + printf("\t\tGP - stroke elem \n"); + + /* get relevant data for this point from stroke */ + RNA_float_get_array(&itemptr, "mouse", mousef); + p->mval[0] = (short)mousef[0]; + p->mval[1] = (short)mousef[1]; + p->pressure= RNA_float_get(&itemptr, "pressure"); + + /* if first run, set previous data too */ + if (p->flags & GP_PAINTFLAG_FIRSTRUN) { + p->flags &= ~GP_PAINTFLAG_FIRSTRUN; + + p->mvalo[0]= p->mval[0]; + p->mvalo[1]= p->mval[1]; + p->opressure= p->pressure; + } + + /* apply this data as necessary now (as per usual) */ + gpencil_draw_apply(C, op, p); + } + RNA_END; + + printf("\tGP - done \n"); + + /* cleanup */ + gpencil_draw_exit(C, op); + + /* done */ + return OPERATOR_FINISHED; +} + +/* ------------------------------- */ + +/* start of interactive drawing part of operator */ static int gpencil_draw_invoke (bContext *C, wmOperator *op, wmEvent *event) { tGPsdata *p = NULL; + wmWindow *win= CTX_wm_window(C); printf("GPencil - Starting Drawing \n"); @@ -1177,16 +1262,35 @@ static int gpencil_draw_invoke (bContext *C, wmOperator *op, wmEvent *event) // TODO: this involves mucking around with radial control, so we leave this for now.. } - printf("\tGP - set first spot\n"); + /* set cursor */ + if (p->paintmode == GP_PAINTMODE_ERASER) + WM_cursor_modal(win, BC_CROSSCURSOR); // XXX need a better cursor + else + WM_cursor_modal(win, BC_PAINTBRUSHCURSOR); - /* handle the initial drawing - i.e. for just doing a simple dot */ - gpencil_draw_apply_event(C, op, event); + /* special hack: if there was an initial event, then we were invoked via a hotkey, and + * painting should start immediately. Otherwise, this was called from a toolbar, in which + * case we should wait for the mouse to be clicked. + */ + if (event->type) { + /* hotkey invoked - start drawing */ + printf("\tGP - set first spot\n"); + p->status= GP_STATUS_PAINTING; + + /* handle the initial drawing - i.e. for just doing a simple dot */ + gpencil_draw_apply_event(C, op, event); + } + else { + /* toolbar invoked - don't start drawing yet... */ + printf("\tGP - hotkey invoked... waiting for click-drag\n"); + } /* add a modal handler for this operator, so that we can then draw continuous strokes */ WM_event_add_modal_handler(C, &CTX_wm_window(C)->handlers, op); return OPERATOR_RUNNING_MODAL; } +/* events handling during interactive drawing part of operator */ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) { tGPsdata *p= op->customdata; @@ -1198,25 +1302,35 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) * otherwise, carry on to mouse-move... */ case LEFTMOUSE: - case MIDDLEMOUSE: case RIGHTMOUSE: - if (event->val != KM_PRESS) { + /* if painting, end stroke */ + if (p->status == GP_STATUS_PAINTING) { + /* basically, this should be mouse-button up */ printf("\t\tGP - end of stroke \n"); gpencil_draw_exit(C, op); return OPERATOR_FINISHED; } + else { + /* not painting, so start stroke (this should be mouse-button down) */ + printf("\t\tGP - start stroke \n"); + p->status= GP_STATUS_PAINTING; + /* no break now, since we should immediately start painting */ + } - /* moving mouse - assumed that mouse button is down */ + /* moving mouse - assumed that mouse button is down if in painting status */ case MOUSEMOVE: - /* handle drawing event */ - printf("\t\tGP - add point\n"); - gpencil_draw_apply_event(C, op, event); - - /* finish painting operation if anything went wrong just now */ - if (p->status == GP_STATUS_ERROR) { - printf("\t\t\tGP - error done! \n"); - gpencil_draw_exit(C, op); - return OPERATOR_CANCELLED; + /* check if we're currently painting */ + if (p->status == GP_STATUS_PAINTING) { + /* handle drawing event */ + printf("\t\tGP - add point\n"); + gpencil_draw_apply_event(C, op, event); + + /* finish painting operation if anything went wrong just now */ + if (p->status == GP_STATUS_ERROR) { + printf("\t\t\tGP - error done! \n"); + gpencil_draw_exit(C, op); + return OPERATOR_CANCELLED; + } } break; @@ -1229,17 +1343,7 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) case WHEELDOWNMOUSE: p->radius -= 1.5f; break; - - /* handle ctrl key - used to toggle straight-lines only (for drawing) */ - // XXX hardcoded keymap stuff - case LEFTCTRLKEY: - case RIGHTCTRLKEY: - if (event->val == KM_PRESS) - p->flags |= GP_PAINTFLAG_STRAIGHTLINES; - else if (event->val == KM_RELEASE) - p->flags &= ~GP_PAINTFLAG_STRAIGHTLINES; - break; - + default: printf("\t\tGP unknown event - %d \n", event->type); break; @@ -1264,7 +1368,7 @@ void GPENCIL_OT_draw (wmOperatorType *ot) ot->description= "Make annotations on the active data."; /* api callbacks */ - //ot->exec= gpencil_draw_exec; + ot->exec= gpencil_draw_exec; ot->invoke= gpencil_draw_invoke; ot->modal= gpencil_draw_modal; ot->cancel= gpencil_draw_cancel; @@ -1275,4 +1379,7 @@ void GPENCIL_OT_draw (wmOperatorType *ot) /* settings for drawing */ RNA_def_enum(ot->srna, "mode", prop_gpencil_drawmodes, 0, "Mode", "Way to intepret mouse movements."); + RNA_def_boolean(ot->srna, "straight_lines", 0, "Straight Lines", "Only take the endpoints of the strokes, so that straight lines can be drawn."); + + RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", ""); } diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 19a70834587..f4e1e008099 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -134,7 +134,7 @@ void view3d_keymap(wmWindowManager *wm) RNA_boolean_set(km->ptr, "snap", 1); /* grease pencil */ - gpencil_common_keymap(wm, keymap); // XXX + gpencil_common_keymap(wm, keymap); WM_keymap_verify_item(keymap, "VIEW3D_OT_manipulator", LEFTMOUSE, KM_PRESS, 0, 0); /* manipulator always on left mouse, not on action mouse*/ From 8930a4fd332e69442b4de2efe42019bf5a41c946 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 29 Aug 2009 06:50:32 +0000 Subject: [PATCH 324/577] Grease Pencil: UI (i.e. Panel) for Settings Restored the UI for access to the GP layers. There are still a few minor bugs here: * Wrong icons on the toggles - even when they're enabled, they only show a single state * The ID-template doesn't seem to be showing up. Dunno what's going wrong there... --- .../blender/editors/gpencil/gpencil_buttons.c | 338 +++++++----------- source/blender/editors/gpencil/gpencil_edit.c | 126 +++++++ .../blender/editors/gpencil/gpencil_intern.h | 7 + source/blender/editors/gpencil/gpencil_ops.c | 6 + .../blender/editors/gpencil/gpencil_paint.c | 5 +- source/blender/editors/include/ED_gpencil.h | 5 +- .../editors/space_view3d/view3d_buttons.c | 35 +- 7 files changed, 291 insertions(+), 231 deletions(-) diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c index 12e987af47b..b572cd6916a 100644 --- a/source/blender/editors/gpencil/gpencil_buttons.c +++ b/source/blender/editors/gpencil/gpencil_buttons.c @@ -47,11 +47,11 @@ #include "BKE_gpencil.h" #include "BKE_utildefines.h" -#include "PIL_time.h" - #include "WM_api.h" #include "WM_types.h" +#include "RNA_access.h" + #include "BIF_gl.h" #include "BIF_glutil.h" @@ -76,259 +76,195 @@ /* ------- Callbacks ----------- */ /* These are just 'dummy wrappers' around gpencil api calls */ -#if 0 -// XXX + /* make layer active one after being clicked on */ -void gp_ui_activelayer_cb (void *gpd, void *gpl) +void gp_ui_activelayer_cb (bContext *C, void *gpd, void *gpl) { gpencil_layer_setactive(gpd, gpl); - scrarea_queue_winredraw(curarea); - allqueue(REDRAWACTION, 0); + WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX please work! } -/* rename layer and set active */ -void gp_ui_renamelayer_cb (void *gpd_arg, void *gpl_arg) -{ - bGPdata *gpd= (bGPdata *)gpd_arg; - bGPDlayer *gpl= (bGPDlayer *)gpl_arg; - - BLI_uniquename(&gpd->layers, gpl, "GP_Layer", '.', offsetof(bGPDlayer, info[0]), 128); - gpencil_layer_setactive(gpd, gpl); - - scrarea_queue_winredraw(curarea); - allqueue(REDRAWACTION, 0); -} - -/* add a new layer */ -void gp_ui_addlayer_cb (void *gpd, void *dummy) -{ - gpencil_layer_addnew(gpd); - - scrarea_queue_winredraw(curarea); - allqueue(REDRAWACTION, 0); -} - -/* delete active layer */ -void gp_ui_dellayer_cb (void *gpd, void *dummy) +/* delete 'active' layer */ +void gp_ui_dellayer_cb (bContext *C, void *gpd, void *gpl) { + /* make sure the layer we want to remove is the active one */ + gpencil_layer_setactive(gpd, gpl); gpencil_layer_delactive(gpd); - scrarea_queue_winredraw(curarea); - allqueue(REDRAWACTION, 0); + WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX please work! } -/* delete last stroke of active layer */ -void gp_ui_delstroke_cb (void *gpd, void *gpl) -{ - bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0); - - if (gpf) { - if (gpf->framenum != CFRA) return; - - gpencil_layer_setactive(gpd, gpl); - gpencil_frame_delete_laststroke(gpl, gpf); - - scrarea_queue_winredraw(curarea); - } -} - -/* delete active frame of active layer */ -void gp_ui_delframe_cb (void *gpd, void *gpl) -{ - bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0); - - gpencil_layer_setactive(gpd, gpl); - gpencil_layer_delframe(gpl, gpf); - - scrarea_queue_winredraw(curarea); - allqueue(REDRAWACTION, 0); -} - -/* convert the active layer to geometry */ -void gp_ui_convertlayer_cb (void *gpd, void *gpl) -{ - gpencil_layer_setactive(gpd, gpl); - gpencil_convert_menu(); - - scrarea_queue_winredraw(curarea); -} -#endif - /* ------- Drawing Code ------- */ -#if 0 -/* XXX */ /* draw the controls for a given layer */ -static void gp_drawui_layer (uiBlock *block, bGPdata *gpd, bGPDlayer *gpl, short *xco, short *yco) +static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl) { + uiLayout *box=NULL, *split=NULL; + uiLayout *col=NULL, *subcol=NULL; + uiLayout *row=NULL, *subrow=NULL; + uiBlock *block; uiBut *but; - short active= (gpl->flag & GP_LAYER_ACTIVE); - short width= 314; - short height; - int rb_col; + PointerRNA ptr; + + /* make pointer to layer data */ + RNA_pointer_create((ID *)gpd, &RNA_GPencilLayer, gpl, &ptr); /* unless button has own callback, it adds this callback to button */ + block= uiLayoutGetBlock(layout); uiBlockSetFunc(block, gp_ui_activelayer_cb, gpd, gpl); - /* draw header */ - { - uiBlockSetEmboss(block, UI_EMBOSSN); - - /* rounded header */ - if (active) uiBlockSetCol(block, TH_BUT_ACTION); - rb_col= (active)?-20:20; - uiDefBut(block, ROUNDBOX, B_REDR, "", *xco-8, *yco-2, width, 24, NULL, 5.0, 0.0, 15.0, (float)(rb_col-20), ""); - if (active) uiBlockSetCol(block, TH_AUTO); - - /* lock toggle */ - uiDefIconButBitI(block, ICONTOG, GP_LAYER_LOCKED, B_REDR, ICON_UNLOCKED, *xco-7, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Layer cannot be modified"); - } + /* draw header ---------------------------------- */ + /* get layout-row + UI-block for header */ + box= uiLayoutBox(layout); + + row= uiLayoutRow(box, 0); + block= uiLayoutGetBlock(row); // err... + + uiBlockSetEmboss(block, UI_EMBOSSN); + + /* left-align ............................... */ + subrow= uiLayoutRow(row, 1); + uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_LEFT); + + /* active */ + uiItemR(subrow, "", ICON_RADIOBUT_OFF, &ptr, "active", UI_ITEM_R_TOGGLE); // XXX we need to set it to toggle to get icon + + /* locked */ + uiItemR(subrow, "", ICON_UNLOCKED, &ptr, "locked", UI_ITEM_R_TOGGLE); // XXX we need to set it to toggle to get icon /* when layer is locked or hidden, only draw header */ if (gpl->flag & (GP_LAYER_LOCKED|GP_LAYER_HIDE)) { char name[256]; /* gpl->info is 128, but we need space for 'locked/hidden' as well */ - height= 0; - /* visibility button (only if hidden but not locked!) */ if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED)) - uiDefIconButBitI(block, ICONTOG, GP_LAYER_HIDE, B_REDR, ICON_RESTRICT_VIEW_OFF, *xco+12, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Visibility of layer"); + uiItemR(subrow, "", ICON_RESTRICT_VIEW_OFF, &ptr, "hide", UI_ITEM_R_TOGGLE); // XXX we need to set it to toggle to get icon /* name */ if (gpl->flag & GP_LAYER_HIDE) sprintf(name, "%s (Hidden)", gpl->info); else sprintf(name, "%s (Locked)", gpl->info); - uiDefBut(block, LABEL, 1, name, *xco+35, *yco, 240, 20, NULL, 0.0, 0.0, 0, 0, "Short description of what this layer is for (optional)"); + uiItemL(subrow, name, 0); /* delete button (only if hidden but not locked!) */ if ((gpl->flag & GP_LAYER_HIDE) & !(gpl->flag & GP_LAYER_LOCKED)) { - but= uiDefIconBut(block, BUT, B_REDR, ICON_X, *xco+(width-30), *yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer"); - uiButSetFunc(but, gp_ui_dellayer_cb, gpd, NULL); + /* right-align ............................... */ + subrow= uiLayoutRow(row, 1); + uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_RIGHT); + block= uiLayoutGetBlock(subrow); // XXX... err... + + but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer"); + uiButSetFunc(but, gp_ui_dellayer_cb, gpd, gpl); } uiBlockSetEmboss(block, UI_EMBOSS); } else { - height= 97; + /* draw rest of header -------------------------------- */ + /* visibility button */ + uiItemR(subrow, "", ICON_RESTRICT_VIEW_OFF, &ptr, "hide", UI_ITEM_R_TOGGLE); // XXX we need to set it to toggle to get icon - /* draw rest of header */ - { - /* visibility button */ - uiDefIconButBitI(block, ICONTOG, GP_LAYER_HIDE, B_REDR, ICON_RESTRICT_VIEW_OFF, *xco+12, *yco-1, 20, 20, &gpl->flag, 0.0, 0.0, 0, 0, "Visibility of layer"); + uiBlockSetEmboss(block, UI_EMBOSS); + + /* name */ + uiItemR(subrow, "", 0, &ptr, "info", 0); + + /* delete 'button' */ + uiBlockSetEmboss(block, UI_EMBOSSN); + /* right-align ............................... */ + subrow= uiLayoutRow(row, 1); + uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_RIGHT); + block= uiLayoutGetBlock(subrow); // XXX... err... - uiBlockSetEmboss(block, UI_EMBOSS); + but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer"); + uiButSetFunc(but, gp_ui_dellayer_cb, gpd, gpl); + uiBlockSetEmboss(block, UI_EMBOSS); + + + /* new backdrop ----------------------------------- */ + box= uiLayoutBox(layout); + split= uiLayoutSplit(box, 0.5f); + + + /* draw settings ---------------------------------- */ + /* left column ..................... */ + col= uiLayoutColumn(split, 0); + + /* color */ + subcol= uiLayoutColumn(col, 1); + uiItemR(subcol, "", 0, &ptr, "color", 0); + uiItemR(subcol, NULL, 0, &ptr, "opacity", UI_ITEM_R_SLIDER); - /* name */ - but= uiDefButC(block, TEX, B_REDR, "Info:", *xco+36, *yco, 240, 19, gpl->info, 0, 127, 0, 0, "Short description of what this layer is for (optional)"); - uiButSetFunc(but, gp_ui_renamelayer_cb, gpd, gpl); - - /* delete 'button' */ - uiBlockSetEmboss(block, UI_EMBOSSN); - - but= uiDefIconBut(block, BUT, B_REDR, ICON_X, *xco+(width-30), *yco, 19, 19, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer"); - uiButSetFunc(but, gp_ui_dellayer_cb, gpd, NULL); - - uiBlockSetEmboss(block, UI_EMBOSS); + /* stroke thickness */ + subcol= uiLayoutColumn(col, 1); + uiItemR(subcol, NULL, 0, &ptr, "line_thickness", UI_ITEM_R_SLIDER); + + /* debugging options */ + if (G.f & G_DEBUG) { + // XXX this option hasn't been wrapped yet... since it's just debug + //subcol= uiLayoutColumn(col, 1); + // uiItemR(subrow, NULL, 0, &ptr, "show_points", 0); } - /* draw backdrop */ - if (active) uiBlockSetCol(block, TH_BUT_ACTION); - uiDefBut(block, ROUNDBOX, B_DIFF, "", *xco-8, *yco-height, width, height-1, NULL, 5.0, 0.0, 12.0, (float)rb_col, ""); - if (active) uiBlockSetCol(block, TH_AUTO); + /* right column ................... */ + col= uiLayoutColumn(split, 0); - /* draw settings */ - { - /* color */ - uiBlockBeginAlign(block); - uiDefButF(block, COL, B_REDR, "", *xco, *yco-26, 150, 19, gpl->color, 0, 0, 0, 0, "Color to use for all strokes on this Grease Pencil Layer"); - uiDefButF(block, NUMSLI, B_REDR, "Opacity: ", *xco,*yco-45,150,19, &gpl->color[3], 0.3f, 1.0f, 0, 0, "Visibility of stroke (0.3 to 1.0)"); - uiBlockEndAlign(block); - - /* stroke thickness */ - uiDefButS(block, NUMSLI, B_REDR, "Thickness:", *xco, *yco-75, 150, 20, &gpl->thickness, 1, 10, 0, 0, "Thickness of strokes (in pixels)"); - - /* debugging options */ - if (G.f & G_DEBUG) { - uiDefButBitI(block, TOG, GP_LAYER_DRAWDEBUG, B_REDR, "Show Points", *xco, *yco-95, 150, 20, &gpl->flag, 0, 0, 0, 0, "Show points which form the strokes"); - } - - /* onion-skinning */ - uiBlockBeginAlign(block); - uiDefButBitI(block, TOG, GP_LAYER_ONIONSKIN, B_REDR, "Onion-Skin", *xco+160, *yco-26, 140, 20, &gpl->flag, 0, 0, 0, 0, "Ghost frames on either side of frame"); - uiDefButS(block, NUMSLI, B_REDR, "GStep:", *xco+160, *yco-46, 140, 20, &gpl->gstep, 0, 120, 0, 0, "Max number of frames on either side of active frame to show (0 = just 'first' available sketch on either side)"); - uiBlockEndAlign(block); - - /* options */ - uiBlockBeginAlign(block); - if (curarea->spacetype == SPACE_VIEW3D) { - but= uiDefBut(block, BUT, B_REDR, "Convert to...", *xco+160, *yco-75, 140, 20, NULL, 0, 0, 0, 0, "Converts this layer's strokes to geometry (Hotkey = Alt-Shift-C)"); - uiButSetFunc(but, gp_ui_convertlayer_cb, gpd, gpl); - } - else { - but= uiDefBut(block, BUT, B_REDR, "Del Active Frame", *xco+160, *yco-75, 140, 20, NULL, 0, 0, 0, 0, "Erases the the active frame for this layer (Hotkey = Alt-XKEY/DEL)"); - uiButSetFunc(but, gp_ui_delframe_cb, gpd, gpl); - } - - but= uiDefBut(block, BUT, B_REDR, "Del Last Stroke", *xco+160, *yco-95, 140, 20, NULL, 0, 0, 0, 0, "Erases the last stroke from the active frame (Hotkey = Alt-XKEY/DEL)"); - uiButSetFunc(but, gp_ui_delstroke_cb, gpd, gpl); - uiBlockEndAlign(block); - } + /* onion-skinning */ + subcol= uiLayoutColumn(col, 1); + uiItemR(subcol, "Onion Skinning", 0, &ptr, "use_onion_skinning", 0); + uiItemR(subcol, "GStep", 0, &ptr, "max_ghost_range", 0); // XXX shorter name here? (i.e. GStep) + + /* additional options... */ + // None at the moment... } - - /* adjust height for new to start */ - (*yco) -= (height + 27); } -#endif -/* Draw the contents for a grease-pencil panel. This assumes several things: - * - that panel has been created, is 318 x 204. max yco is 225 - * - that a toggle for turning on/off gpencil drawing is 150 x 20, starting from (10,225) - * which is basically the top left-hand corner - * It will return the amount of extra space to extend the panel by - */ -short draw_gpencil_panel (uiBlock *block, bGPdata *gpd, ScrArea *sa) + +/* Draw the contents for a grease-pencil panel*/ +static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, PointerRNA *ctx_ptr) { -#if 0 - uiBut *but; bGPDlayer *gpl; - short xco= 10, yco= 170; + uiLayout *col; - /* draw gpd settings first */ - { - /* add new layer buttons */ - but= uiDefBut(block, BUT, B_REDR, "Add New Layer", 10,205,150,20, 0, 0, 0, 0, 0, "Adds a new Grease Pencil Layer"); - uiButSetFunc(but, gp_ui_addlayer_cb, gpd, NULL); + /* draw gpd settings first ------------------------------------- */ + col= uiLayoutColumn(layout, 1); + /* current Grease Pencil block */ + // TODO: show some info about who owns this? + // XXX: this template doesn't show up! + uiTemplateID(col, C, ctx_ptr, "grease_pencil", "GPENCIL_OT_data_new", "GPENCIL_OT_data_unlink"); - - /* show override lmb-clicks button + painting lock */ - uiBlockBeginAlign(block); - if ((gpd->flag & GP_DATA_EDITPAINT)==0) { - uiDefButBitI(block, TOG, GP_DATA_EDITPAINT, B_REDR, "Draw Mode", 170, 225, 130, 20, &gpd->flag, 0, 0, 0, 0, "Interpret click-drag as new strokes"); - - uiBlockSetCol(block, TH_BUT_SETTING); - uiDefIconButBitI(block, ICONTOG, GP_DATA_LMBPLOCK, B_REDR, ICON_UNLOCKED, 300, 225, 20, 20, &gpd->flag, 0.0, 0.0, 0, 0, "Painting cannot occur with Shift-LMB (when making selections)"); - uiBlockSetCol(block, TH_AUTO); - } - else - uiDefButBitI(block, TOG, GP_DATA_EDITPAINT, B_REDR, "Draw Mode", 170, 225, 150, 20, &gpd->flag, 0, 0, 0, 0, "Interpret click-drag as new strokes"); - uiBlockEndAlign(block); - - /* 'view align' button (naming depends on context) */ - if (sa->spacetype == SPACE_VIEW3D) - uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Sketch in 3D", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added in 3D-space"); - else - uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Stick to View", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added on 2d-canvas"); - } + /* add new layer button */ + uiItemO(col, NULL, 0, "GPENCIL_OT_layer_add"); - /* draw for each layer */ - for (gpl= gpd->layers.first; gpl; gpl= gpl->next) { - gp_drawui_layer(block, gpd, gpl, &xco, &yco); - } - - /* return new height if necessary */ - return (yco < 0) ? (204 - yco) : 204; + /* 'view align' button (naming depends on context) */ +#if 0 // XXX for now, this is enabled by default anyways + if (sa->spacetype == SPACE_VIEW3D) + uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Sketch in 3D", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added in 3D-space"); + else + uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Stick to View", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added on 2d-canvas"); #endif - return 0; + + /* draw each layer --------------------------------------------- */ + for (gpl= gpd->layers.first; gpl; gpl= gpl->next) { + col= uiLayoutColumn(layout, 1); + gp_drawui_layer(col, gpd, gpl); + } } + +/* Standard panel to be included whereever Grease Pencil is used... */ +void gpencil_panel_standard(const bContext *C, Panel *pa) +{ + bGPdata **gpd_ptr = NULL; + PointerRNA ptr; + + //if (v3d->flag2 & V3D_DISPGP)... etc. + + /* get pointer to Grease Pencil Data */ + gpd_ptr= gpencil_data_get_pointers((bContext *)C, &ptr); + + if (gpd_ptr && *gpd_ptr) + draw_gpencil_panel((bContext *)C, pa->layout, *gpd_ptr, &ptr); +} + /* ************************************************** */ diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 3130e190ce2..2faf3ccbbda 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -60,6 +60,7 @@ #include "BKE_gpencil.h" #include "BKE_image.h" #include "BKE_library.h" +#include "BKE_report.h" #include "BKE_utildefines.h" #include "BIF_gl.h" @@ -123,6 +124,9 @@ bGPdata **gpencil_data_get_pointers (bContext *C, PointerRNA *ptr) /* return the GP data for the active strips/image/etc. */ } break; + + default: /* unsupported space */ + return NULL; } } @@ -141,6 +145,128 @@ bGPdata *gpencil_data_get_active (bContext *C) /* ************************************************ */ /* Panel Operators */ +/* poll callback for adding data/layers - special */ +static int gp_add_poll (bContext *C) +{ + /* the base line we have is that we have somewhere to add Grease Pencil data */ + return gpencil_data_get_pointers(C, NULL) != NULL; +} +/* ******************* Add New Data ************************ */ + +/* add new datablock - wrapper around API */ +static int gp_data_add_exec (bContext *C, wmOperator *op) +{ + bGPdata **gpd_ptr= gpencil_data_get_pointers(C, NULL); + + if (gpd_ptr == NULL) { + BKE_report(op->reports, RPT_ERROR, "Nowhere for Grease Pencil data to go"); + return OPERATOR_CANCELLED; + } + else { + /* just add new datablock now */ + *gpd_ptr= gpencil_data_addnew("GPencil"); + } + + /* notifiers */ + WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX please work! + + return OPERATOR_FINISHED; +} + +void GPENCIL_OT_data_add (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Grease Pencil Add New"; + ot->idname= "GPENCIL_OT_data_add"; + ot->description= "Add new Grease Pencil datablock."; + + /* callbacks */ + ot->exec= gp_data_add_exec; + ot->poll= gp_add_poll; +} + +/* ******************* Unlink Data ************************ */ + +/* poll callback for adding data/layers - special */ +static int gp_data_unlink_poll (bContext *C) +{ + bGPdata **gpd_ptr= gpencil_data_get_pointers(C, NULL); + + /* if we have access to some active data, make sure there's a datablock before enabling this */ + return (gpd_ptr && *gpd_ptr); +} + + +/* unlink datablock - wrapper around API */ +static int gp_data_unlink_exec (bContext *C, wmOperator *op) +{ + bGPdata **gpd_ptr= gpencil_data_get_pointers(C, NULL); + + if (gpd_ptr == NULL) { + BKE_report(op->reports, RPT_ERROR, "Nowhere for Grease Pencil data to go"); + return OPERATOR_CANCELLED; + } + else { + /* just unlink datablock now, decreasing its user count */ + bGPdata *gpd= (*gpd_ptr); + + gpd->id.us--; + *gpd_ptr= NULL; + } + + /* notifiers */ + WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX please work! + + return OPERATOR_FINISHED; +} + +void GPENCIL_OT_data_unlink (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Grease Pencil Unlink"; + ot->idname= "GPENCIL_OT_data_unlink"; + ot->description= "Unlink active Grease Pencil datablock."; + + /* callbacks */ + ot->exec= gp_data_unlink_exec; + ot->poll= gp_data_unlink_poll; +} + +/* ******************* Add New Layer ************************ */ + +/* add new layer - wrapper around API */ +static int gp_layer_add_exec (bContext *C, wmOperator *op) +{ + bGPdata **gpd_ptr= gpencil_data_get_pointers(C, NULL); + + /* if there's no existing Grease-Pencil data there, add some */ + if (gpd_ptr == NULL) { + BKE_report(op->reports, RPT_ERROR, "Nowhere for Grease Pencil data to go"); + return OPERATOR_CANCELLED; + } + if (*gpd_ptr == NULL) + *gpd_ptr= gpencil_data_addnew("GPencil"); + + /* add new layer now */ + gpencil_layer_addnew(*gpd_ptr); + + /* notifiers */ + WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX please work! + + return OPERATOR_FINISHED; +} + +void GPENCIL_OT_layer_add (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add New Layer"; + ot->idname= "GPENCIL_OT_layer_add"; + ot->description= "Add new Grease Pencil layer for the active Grease Pencil datablock."; + + /* callbacks */ + ot->exec= gp_layer_add_exec; + ot->poll= gp_add_poll; +} /* ************************************************ */ diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h index b134328c8a0..cc98d491f7a 100644 --- a/source/blender/editors/gpencil/gpencil_intern.h +++ b/source/blender/editors/gpencil/gpencil_intern.h @@ -40,6 +40,13 @@ struct wmOperatorType; void GPENCIL_OT_draw(struct wmOperatorType *ot); +/* buttons editing --- */ + +void GPENCIL_OT_data_add(struct wmOperatorType *ot); +void GPENCIL_OT_data_unlink(struct wmOperatorType *ot); + +void GPENCIL_OT_layer_add(struct wmOperatorType *ot); + /******************************************************* */ /* FILTERED ACTION DATA - TYPES ---> XXX DEPRECEATED OLD ANIM SYSTEM CODE! */ diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c index 347a611ee30..364b27b61b0 100644 --- a/source/blender/editors/gpencil/gpencil_ops.c +++ b/source/blender/editors/gpencil/gpencil_ops.c @@ -66,10 +66,16 @@ void gpencil_common_keymap(wmWindowManager *wm, ListBase *keymap) void ED_operatortypes_gpencil (void) { /* Drawing ----------------------- */ + WM_operatortype_append(GPENCIL_OT_draw); /* Editing (Buttons) ------------ */ + WM_operatortype_append(GPENCIL_OT_data_add); + WM_operatortype_append(GPENCIL_OT_data_unlink); + + WM_operatortype_append(GPENCIL_OT_layer_add); + /* Editing (Time) --------------- */ } diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 445d9ae346d..82dc76a2152 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -919,7 +919,7 @@ static void gp_paint_initstroke (tGPsdata *p, short paintmode) View3D *v3d= (View3D *)p->sa->spacedata.first; RegionView3D *rv3d= p->ar->regiondata; - // TODO: this should only happen for scene... otherwise use object center! + // TODO: this should only happen for scene... otherwise apply correction for object center! float *fp= give_cursor(p->scene, v3d); initgrabz(rv3d, fp[0], fp[1], fp[2]); @@ -1231,6 +1231,9 @@ static int gpencil_draw_exec (bContext *C, wmOperator *op) /* cleanup */ gpencil_draw_exit(C, op); + /* refreshes */ + WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX please work! + /* done */ return OPERATOR_FINISHED; } diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h index 25e622d8551..ba60211ef3f 100644 --- a/source/blender/editors/include/ED_gpencil.h +++ b/source/blender/editors/include/ED_gpencil.h @@ -39,8 +39,7 @@ struct bGPdata; struct bGPDlayer; struct bGPDframe; struct PointerRNA; -struct uiLayout; -struct uiBlock; +struct Panel; struct ImBuf; struct wmWindowManager; @@ -75,5 +74,7 @@ void draw_gpencil_2dview(struct bContext *C, short onlyv2d); void draw_gpencil_3dview(struct bContext *C, short only3d); void draw_gpencil_oglrender(struct bContext *C); +void gpencil_panel_standard(const struct bContext *C, struct Panel *pa); + #endif /* ED_GPENCIL_H */ diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 9b05f5b25b2..2fbe7e5db79 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -36,6 +36,7 @@ #include "DNA_armature_types.h" #include "DNA_curve_types.h" #include "DNA_camera_types.h" +#include "DNA_gpencil_types.h" #include "DNA_lamp_types.h" #include "DNA_lattice_types.h" #include "DNA_meta_types.h" @@ -81,6 +82,7 @@ #include "ED_armature.h" #include "ED_curve.h" #include "ED_image.h" +#include "ED_gpencil.h" #include "ED_keyframing.h" #include "ED_mesh.h" #include "ED_object.h" @@ -1199,33 +1201,6 @@ static void view3d_panel_preview(bContext *C, ARegion *ar, short cntrl) // VIEW3 } #endif -#if 0 -static void view3d_panel_gpencil(const bContext *C, Panel *pa) -{ - View3D *v3d= CTX_wm_view3d(C); - uiBlock *block; - - block= uiLayoutFreeBlock(pa->layout); - - /* allocate memory for gpd if drawing enabled (this must be done first or else we crash) */ - if (v3d->flag2 & V3D_DISPGP) { -// if (v3d->gpd == NULL) -// XXX gpencil_data_setactive(ar, gpencil_data_addnew()); - } - - if (v3d->flag2 & V3D_DISPGP) { -// XXX bGPdata *gpd= v3d->gpd; - - /* draw button for showing gpencil settings and drawings */ - uiDefButBitS(block, TOG, V3D_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &v3d->flag2, 0, 0, 0, 0, "Display freehand annotations overlay over this 3D View (draw using Shift-LMB)"); - } - else { - uiDefButBitS(block, TOG, V3D_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &v3d->flag2, 0, 0, 0, 0, "Display freehand annotations overlay over this 3D View"); - uiDefBut(block, LABEL, 1, " ", 160, 180, 150, 20, NULL, 0.0, 0.0, 0, 0, ""); - } -} -#endif - static void delete_sketch_armature(bContext *C, void *arg1, void *arg2) { BIF_deleteSketch(C); @@ -1416,6 +1391,12 @@ void view3d_buttons_register(ARegionType *art) strcpy(pt->label, "Transform"); pt->draw= view3d_panel_object; BLI_addtail(&art->paneltypes, pt); + + pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel gpencil"); + strcpy(pt->idname, "VIEW3D_PT_gpencil"); + strcpy(pt->label, "Grease Pencil"); + pt->draw= gpencil_panel_standard; + BLI_addtail(&art->paneltypes, pt); /* pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel properties"); strcpy(pt->idname, "VIEW3D_PT_properties"); From e055bb7f7d35d36be7083c637fb90d1ef9f10fd7 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sat, 29 Aug 2009 07:44:21 +0000 Subject: [PATCH 325/577] ui layout tweaks --- release/ui/buttons_data_armature.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/release/ui/buttons_data_armature.py b/release/ui/buttons_data_armature.py index 3a1de0d5f0b..f207b556a6d 100644 --- a/release/ui/buttons_data_armature.py +++ b/release/ui/buttons_data_armature.py @@ -40,6 +40,12 @@ class DATA_PT_skeleton(DataButtonsPanel): split = layout.split() + col = split.column() + col.itemL(text="Layers:") + col.template_layers(arm, "layer") + col.itemL(text="Protected Layers:") + col.template_layers(arm, "layer_protection") + col = split.column() col.itemR(arm, "rest_position") col.itemL(text="Deform:") @@ -49,13 +55,7 @@ class DATA_PT_skeleton(DataButtonsPanel): col.itemR(arm, "deform_bbone_rest", text="B-Bones Rest") #col.itemR(arm, "x_axis_mirror") #col.itemR(arm, "auto_ik") - - col = split.column() - col.itemL(text="Layers:") - col.template_layers(arm, "layer") - col.itemL(text="Protected Layers:") - col.template_layers(arm, "layer_protection") - + class DATA_PT_display(DataButtonsPanel): __label__ = "Display" @@ -154,7 +154,7 @@ class DATA_PT_ghost(DataButtonsPanel): split = layout.split() col = split.column() - col.itemR(arm, "ghost_type", text="Scope") + col.itemR(arm, "ghost_type", text="") sub = col.column(align=True) if arm.ghost_type == 'RANGE': From a9947b33b23a3b0d53ad0451c35996daec14b8ae Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sat, 29 Aug 2009 10:34:31 +0000 Subject: [PATCH 326/577] minor tweaks --- release/ui/buttons_physics_fluid.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/ui/buttons_physics_fluid.py b/release/ui/buttons_physics_fluid.py index 1d0a64c517a..5af63bdc3ba 100644 --- a/release/ui/buttons_physics_fluid.py +++ b/release/ui/buttons_physics_fluid.py @@ -46,7 +46,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel): layout.itemR(fluid, "type") if fluid.type == 'DOMAIN': - layout.itemO("fluid.bake", text="BAKE") + layout.itemO("fluid.bake", text="Bake Fluid Simulation", icon='ICON_MOD_FLUIDSIM') split = layout.split() col = split.column() From 3080a6273325bdfcde3d1898334e3749aa2f9b2d Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 29 Aug 2009 11:48:38 +0000 Subject: [PATCH 327/577] Grease Pencil UI - Small fixes for the toggles (icons working correctly now) --- source/blender/editors/gpencil/gpencil_buttons.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c index b572cd6916a..954f6c7e61e 100644 --- a/source/blender/editors/gpencil/gpencil_buttons.c +++ b/source/blender/editors/gpencil/gpencil_buttons.c @@ -76,7 +76,6 @@ /* ------- Callbacks ----------- */ /* These are just 'dummy wrappers' around gpencil api calls */ - /* make layer active one after being clicked on */ void gp_ui_activelayer_cb (bContext *C, void *gpd, void *gpl) { @@ -106,6 +105,7 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl) uiBlock *block; uiBut *but; PointerRNA ptr; + int icon; /* make pointer to layer data */ RNA_pointer_create((ID *)gpd, &RNA_GPencilLayer, gpl, &ptr); @@ -128,10 +128,12 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl) uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_LEFT); /* active */ - uiItemR(subrow, "", ICON_RADIOBUT_OFF, &ptr, "active", UI_ITEM_R_TOGGLE); // XXX we need to set it to toggle to get icon + icon= (gpl->flag & GP_LAYER_ACTIVE) ? ICON_RADIOBUT_ON : ICON_RADIOBUT_OFF; + uiItemR(subrow, "", icon, &ptr, "active", 0); /* locked */ - uiItemR(subrow, "", ICON_UNLOCKED, &ptr, "locked", UI_ITEM_R_TOGGLE); // XXX we need to set it to toggle to get icon + icon= (gpl->flag & GP_LAYER_LOCKED) ? ICON_LOCKED : ICON_UNLOCKED; + uiItemR(subrow, "", icon, &ptr, "locked", 0); /* when layer is locked or hidden, only draw header */ if (gpl->flag & (GP_LAYER_LOCKED|GP_LAYER_HIDE)) { @@ -139,7 +141,8 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl) /* visibility button (only if hidden but not locked!) */ if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED)) - uiItemR(subrow, "", ICON_RESTRICT_VIEW_OFF, &ptr, "hide", UI_ITEM_R_TOGGLE); // XXX we need to set it to toggle to get icon + uiItemR(subrow, "", ICON_RESTRICT_VIEW_ON, &ptr, "hide", 0); + /* name */ if (gpl->flag & GP_LAYER_HIDE) @@ -163,7 +166,7 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl) else { /* draw rest of header -------------------------------- */ /* visibility button */ - uiItemR(subrow, "", ICON_RESTRICT_VIEW_OFF, &ptr, "hide", UI_ITEM_R_TOGGLE); // XXX we need to set it to toggle to get icon + uiItemR(subrow, "", ICON_RESTRICT_VIEW_OFF, &ptr, "hide", 0); uiBlockSetEmboss(block, UI_EMBOSS); @@ -227,10 +230,9 @@ static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, Poi uiLayout *col; /* draw gpd settings first ------------------------------------- */ - col= uiLayoutColumn(layout, 1); + col= uiLayoutColumn(layout, 0); /* current Grease Pencil block */ // TODO: show some info about who owns this? - // XXX: this template doesn't show up! uiTemplateID(col, C, ctx_ptr, "grease_pencil", "GPENCIL_OT_data_new", "GPENCIL_OT_data_unlink"); /* add new layer button */ From c03004f93eb94d4af10acaf0b7e8ca7adb097dd0 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sat, 29 Aug 2009 14:53:00 +0000 Subject: [PATCH 328/577] 2.5: Added some sound actuator UI to reveal its real power, check it out! :) --- source/blender/editors/sound/sound_ops.c | 6 ++++++ .../blender/editors/space_logic/logic_window.c | 17 ++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index 75204207284..303ca0eaefd 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -43,6 +43,7 @@ #include "BKE_report.h" #include "BKE_packedFile.h" #include "BKE_sound.h" +#include "BKE_utildefines.h" #include "BLI_blenlib.h" @@ -86,6 +87,10 @@ static int open_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } + if (RNA_boolean_get(op->ptr, "cache")) { + sound_cache(sound, 0); + } + return OPERATOR_FINISHED; } @@ -110,6 +115,7 @@ void SOUND_OT_open(wmOperatorType *ot) /* properties */ WM_operator_properties_filesel(ot, FOLDERFILE|SOUNDFILE|MOVIEFILE); + RNA_def_boolean(ot->srna, "cache", FALSE, "Cache", "Cache the sound in memory."); } /* ******************************************************* */ diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 06bd95f060f..d4475527058 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -1990,7 +1990,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh sa->sndnr = 0; if(sa->flag & ACT_SND_3D_SOUND) - ysize = 114; + ysize = 180; else ysize = 92; @@ -2003,24 +2003,31 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh /* reset this value, it is for handling the event */ sa->sndnr = 0; uiDefButS(block, MENU, B_SOUNDACT_BROWSE, str, xco+10,yco-22,20,19, &(sa->sndnr), 0, 0, 0, 0, ""); + uiDefButO(block, BUT, "sound.open", 0, "Load Sound", xco+wval+10, yco-22, wval, 19, "Load a sound file. Remember to set caching on for small sounds that are played often."); if(sa->sound) { char dummy_str[] = "Sound mode %t|Play Stop %x0|Play End %x1|Loop Stop %x2|Loop End %x3|Loop Ping Pong Stop %x5|Loop Ping Pong %x4"; - uiDefBut(block, TEX, B_IDNAME, "SO:",xco+30,yco-22,width-40,19, sa->sound->id.name+2, 0.0, 21.0, 0, 0, ""); + uiDefBut(block, TEX, B_IDNAME, "SO:",xco+30,yco-22,wval-20,19, sa->sound->id.name+2, 0.0, 21.0, 0, 0, ""); uiDefButS(block, MENU, 1, dummy_str,xco+10,yco-44,width-20, 19, &sa->type, 0.0, 0.0, 0, 0, ""); uiDefButF(block, NUM, 0, "Volume:", xco+10,yco-66,wval, 19, &sa->volume, 0.0, 1.0, 0, 0, "Sets the volume of this sound"); uiDefButF(block, NUM, 0, "Pitch:",xco+wval+10,yco-66,wval, 19, &sa->pitch,-12.0, 12.0, 0, 0, "Sets the pitch of this sound"); uiDefButS(block, TOG | BIT, 0, "3D Sound", xco+10, yco-88, width-20, 19, &sa->flag, 0.0, 1.0, 0.0, 0.0, "Plays the sound positioned in 3D space."); if(sa->flag & ACT_SND_3D_SOUND) { - uiDefButF(block, NUM, 0, "Rolloff: ", xco+10, yco-110, wval, 19, &sa->sound3D.rolloff_factor, 0.0, 5.0, 0.0, 0.0, "The rolloff factor defines the influence factor on volume depending on distance."); - uiDefButF(block, NUM, 0, "Reference distance: ", xco+wval+10, yco-110, wval, 19, &sa->sound3D.reference_distance, 0.0, 1000.0, 0.0, 0.0, "The reference distance is the distance where the sound has a gain of 1.0."); + uiDefButF(block, NUM, 0, "Minimum Gain: ", xco+10, yco-110, wval, 19, &sa->sound3D.min_gain, 0.0, 1.0, 0.0, 0.0, "The minimum gain of the sound, no matter how far it is away."); + uiDefButF(block, NUM, 0, "Maximum Gain: ", xco+10, yco-132, wval, 19, &sa->sound3D.max_gain, 0.0, 1.0, 0.0, 0.0, "The maximum gain of the sound, no matter how near it is.."); + uiDefButF(block, NUM, 0, "Reference Distance: ", xco+10, yco-154, wval, 19, &sa->sound3D.reference_distance, 0.0, 1000.0, 0.0, 0.0, "The reference distance is the distance where the sound has a gain of 1.0."); + uiDefButF(block, NUM, 0, "Maximum Distance: ", xco+10, yco-176, wval, 19, &sa->sound3D.max_distance, 0.0, 1000.0, 0.0, 0.0, "The maximum distance at which you can hear the sound."); + uiDefButF(block, NUM, 0, "Rolloff: ", xco+wval+10, yco-110, wval, 19, &sa->sound3D.rolloff_factor, 0.0, 5.0, 0.0, 0.0, "The rolloff factor defines the influence factor on volume depending on distance."); + uiDefButF(block, NUM, 0, "Cone Outer Gain: ", xco+wval+10, yco-132, wval, 19, &sa->sound3D.cone_outer_gain, 0.0, 1.0, 0.0, 0.0, "The gain outside the outer cone. The gain in the outer cone will be interpolated between this value und the normal gain in the inner cone."); + uiDefButF(block, NUM, 0, "Cone Outer Angle: ", xco+wval+10, yco-154, wval, 19, &sa->sound3D.cone_outer_angle, 0.0, 360.0, 0.0, 0.0, "The angle of the outer cone."); + uiDefButF(block, NUM, 0, "Cone Inner Angle: ", xco+wval+10, yco-176, wval, 19, &sa->sound3D.cone_inner_angle, 0.0, 360.0, 0.0, 0.0, "The angle of the inner cone."); } } MEM_freeN(str); } else { - uiDefBut(block, LABEL, 0, "Use Sound window (F10) to load samples", xco, yco-24, width, 19, NULL, 0, 0, 0, 0, ""); + uiDefButO(block, BUT, "sound.open", 0, "Load Sound", xco+10, yco-22, width-20, 19, "Load a sound file."); } yco-= ysize; From 874d38eeb401a75f849cc36c7d7b911129c3aa75 Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Sat, 29 Aug 2009 15:20:36 +0000 Subject: [PATCH 329/577] Point cache editing: - Baked point caches for particles, cloth and softbody can now be edited in particle mode. * This overwrites the old cloth/sb cache editmode editing. * The type of editable system is chosen from a menu. * For particles the current particle system and it's current cache are used. - Currently this only works for caches that are in memory, but some automatic conversion from disk to memory and back can be implemented later. - All tools from hair editing can't be applied to point caches and are hidden in the tool panel and specials menu. Some functionality like subdividing paths can be later implemented in a slightly different way from how it works for hair. - Code is not yet optimized for speed, so editing might be slow sometimes. Known issues: - Cloth doesn't update properly while in particle mode, due to the way cloth modifier currently works. Daniel can you check on this? - As "particle mode" is not only for particles any more some other name would be in place? - Better icons are needed for the path, point, and tip-modes as the current icons from mesh edit mode are quite misleading. - Direct editing of point velocities is not yet implemented, but will be in the future. Other changes: - Hair editing doesn't require a "make editable" button press any more. - Multiple caches in single particle system disables changing emission properties. - Unified ui code for all point cache panels. * Defined in buttons_particle.py and imported for cloth, smoke & softbody. - Proper disabling of properties in ui after baking point caches. (Daniel could you please make needed disable code for smoke panels as their functionality is not familiar to me.) - Hair weight brush has been removed. Once hair dynamics is re-implemented I'll code a more useable alternative to the functionality. Bug fixes: - Unlinking particle settings crashed. - Deleting the active object with particles in the scene crashed. - Softbody didn't write point caches correctly on save. --- release/ui/buttons_particle.py | 157 +- release/ui/buttons_physics_cloth.py | 64 +- release/ui/buttons_physics_smoke.py | 46 +- release/ui/buttons_physics_softbody.py | 64 +- release/ui/space_view3d_toolbar.py | 83 +- source/blender/blenkernel/BKE_particle.h | 50 +- source/blender/blenkernel/BKE_pointcache.h | 78 +- source/blender/blenkernel/intern/cloth.c | 2 +- source/blender/blenkernel/intern/particle.c | 428 ++-- .../blenkernel/intern/particle_system.c | 49 +- source/blender/blenkernel/intern/pointcache.c | 63 +- source/blender/blenkernel/intern/scene.c | 4 +- source/blender/blenloader/intern/readfile.c | 6 +- source/blender/blenloader/intern/writefile.c | 2 +- source/blender/editors/include/ED_particle.h | 10 +- source/blender/editors/mesh/editmesh.c | 156 +- .../blender/editors/physics/ed_pointcache.c | 13 +- source/blender/editors/physics/editparticle.c | 2172 +++++++++-------- .../blender/editors/space_outliner/outliner.c | 2 - .../blender/editors/space_view3d/drawobject.c | 197 +- .../editors/space_view3d/view3d_header.c | 6 +- .../editors/transform/transform_conversions.c | 96 +- .../editors/transform/transform_manipulator.c | 18 +- source/blender/makesdna/DNA_object_force.h | 9 +- source/blender/makesdna/DNA_particle_types.h | 12 +- source/blender/makesdna/DNA_scene_types.h | 26 +- source/blender/makesrna/intern/rna_particle.c | 62 +- .../makesrna/intern/rna_sculpt_paint.c | 158 +- 28 files changed, 2076 insertions(+), 1957 deletions(-) diff --git a/release/ui/buttons_particle.py b/release/ui/buttons_particle.py index 0454f2a4023..0b18b7c2072 100644 --- a/release/ui/buttons_particle.py +++ b/release/ui/buttons_particle.py @@ -2,13 +2,79 @@ import bpy def particle_panel_enabled(psys): - return psys.point_cache.baked==False and psys.editable==False + return psys.point_cache.baked==False and psys.edited==False def particle_panel_poll(context): psys = context.particle_system if psys==None: return False if psys.settings==None: return False return psys.settings.type in ('EMITTER', 'REACTOR', 'HAIR') + +def point_cache_ui(self, cache, enabled, particles, smoke): + layout = self.layout + layout.set_context_pointer("PointCache", cache) + + row = layout.row() + row.template_list(cache, "point_cache_list", cache, "active_point_cache_index", rows=2 ) + col = row.column(align=True) + col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="") + col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="") + + row = layout.row() + row.itemL(text="File Name:") + if particles: + row.itemR(cache, "external") + + if cache.external: + split = layout.split(percentage=0.80) + split.itemR(cache, "name", text="") + split.itemR(cache, "index", text="") + + layout.itemL(text="File Path:") + layout.itemR(cache, "filepath", text="") + + layout.itemL(text=cache.info) + else: + layout.itemR(cache, "name", text="") + + if not particles: + row = layout.row() + row.enabled = enabled + row.itemR(cache, "start_frame") + row.itemR(cache, "end_frame") + + row = layout.row() + + if cache.baked == True: + row.itemO("ptcache.free_bake", text="Free Bake") + else: + row.item_booleanO("ptcache.bake", "bake", True, text="Bake") + + sub = row.row() + sub.enabled = (cache.frames_skipped or cache.outdated) and enabled + sub.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame") + + row = layout.row() + row.enabled = enabled + row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake") + row.itemR(cache, "step"); + + if not smoke: + row = layout.row() + sub = row.row() + sub.enabled = enabled + sub.itemR(cache, "quick_cache") + row.itemR(cache, "disk_cache") + + layout.itemL(text=cache.info) + + layout.itemS() + + row = layout.row() + row.item_booleanO("ptcache.bake_all", "bake", True, text="Bake All Dynamics") + row.itemO("ptcache.free_bake_all", text="Free All Bakes") + layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame") + class ParticleButtonsPanel(bpy.types.Panel): __space_type__ = 'PROPERTIES' @@ -38,7 +104,16 @@ class PARTICLE_PT_particles(ParticleButtonsPanel): col.itemO("object.particle_system_add", icon='ICON_ZOOMIN', text="") col.itemO("object.particle_system_remove", icon='ICON_ZOOMOUT', text="") - if psys: + if psys and not psys.settings: + split = layout.split(percentage=0.32) + col = split.column() + col.itemL(text="Name:") + col.itemL(text="Settings:") + + col = split.column() + col.itemR(psys, "name", text="") + col.template_ID(psys, "settings", new="particle.new") + elif psys: part = psys.settings split = layout.split(percentage=0.32) @@ -69,10 +144,10 @@ class PARTICLE_PT_particles(ParticleButtonsPanel): split = layout.split(percentage=0.65) if part.type=='HAIR': - if psys.editable==True: - split.itemO("particle.editable_set", text="Free Edit") + if psys.edited==True: + split.itemO("particle.edited_clear", text="Free Edit") else: - split.itemO("particle.editable_set", text="Make Editable") + split.itemL(text="") row = split.row() row.enabled = particle_panel_enabled(psys) row.itemR(part, "hair_step") @@ -96,7 +171,7 @@ class PARTICLE_PT_emission(ParticleButtonsPanel): psys = context.particle_system part = psys.settings - layout.enabled = particle_panel_enabled(psys) + layout.enabled = particle_panel_enabled(psys) and not psys.multiple_caches row = layout.row() row.itemR(part, "amount") @@ -149,76 +224,8 @@ class PARTICLE_PT_cache(ParticleButtonsPanel): layout = self.layout psys = context.particle_system - part = psys.settings - cache = psys.point_cache - layout.set_context_pointer("PointCache", cache) - row = layout.row() - row.template_list(cache, "point_cache_list", cache, "active_point_cache_index", rows=2 ) - col = row.column(align=True) - col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="") - col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="") - - row = layout.row() - row.itemL(text="File Name:") - row.itemR(cache, "external") - - if cache.external: - split = layout.split(percentage=0.80) - split.itemR(cache, "name", text="") - split.itemR(cache, "index", text="") - - layout.itemL(text="File Path:") - layout.itemR(cache, "filepath", text="") - - layout.itemL(text=cache.info) - - #split = layout.split() - - #col = split.column(align=True) - #col.itemR(part, "start") - #col.itemR(part, "end") - - #col = split.column(align=True) - #col.itemR(part, "lifetime") - #col.itemR(part, "random_lifetime", slider=True) - else: - layout.itemR(cache, "name", text="") - - row = layout.row() - - if cache.baked == True: - row.itemO("ptcache.free_bake", text="Free Bake") - else: - row.item_booleanO("ptcache.bake", "bake", True, text="Bake") - - subrow = row.row() - subrow.enabled = (cache.frames_skipped or cache.outdated) and particle_panel_enabled(psys) - subrow.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame") - - row = layout.row() - row.enabled = particle_panel_enabled(psys) - row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake") - row.itemR(cache, "step"); - - row = layout.row() - subrow = row.row() - subrow.enabled = particle_panel_enabled(psys) - subrow.itemR(cache, "quick_cache") - row.itemR(cache, "disk_cache") - - layout.itemL(text=cache.info) - - layout.itemS() - - row = layout.row() - row.item_booleanO("ptcache.bake_all", "bake", True, text="Bake All Dynamics") - row.itemO("ptcache.free_bake_all", text="Free All Bakes") - layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame") - - # for particles these are figured out automatically - #row.itemR(cache, "start_frame") - #row.itemR(cache, "end_frame") + point_cache_ui(self, psys.point_cache, particle_panel_enabled(psys), 1, 0) class PARTICLE_PT_initial(ParticleButtonsPanel): __label__ = "Velocity" diff --git a/release/ui/buttons_physics_cloth.py b/release/ui/buttons_physics_cloth.py index 9ddf03e3d4d..9399d557a51 100644 --- a/release/ui/buttons_physics_cloth.py +++ b/release/ui/buttons_physics_cloth.py @@ -1,6 +1,11 @@ import bpy +from buttons_particle import point_cache_ui + +def cloth_panel_enabled(md): + return md.point_cache.baked==False + class PhysicButtonsPanel(bpy.types.Panel): __space_type__ = 'PROPERTIES' __region_type__ = 'WINDOW' @@ -41,6 +46,8 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel): split = layout.split() + split.active = cloth_panel_enabled(md) + col = split.column() col.itemL(text="Quality:") col.itemR(cloth, "quality", text="Steps",slider=True) @@ -85,53 +92,8 @@ class PHYSICS_PT_cloth_cache(PhysicButtonsPanel): return (context.cloth != None) def draw(self, context): - layout = self.layout - - cache = context.cloth.point_cache - layout.set_context_pointer("PointCache", cache) - - row = layout.row() - row.template_list(cache, "point_cache_list", cache, "active_point_cache_index", rows=2) - col = row.column(align=True) - col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="") - col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="") - - row = layout.row() - row.itemR(cache, "name") - - row = layout.row() - row.itemR(cache, "start_frame") - row.itemR(cache, "end_frame") - - row = layout.row() - - if cache.baked == True: - row.itemO("ptcache.free_bake", text="Free Bake") - else: - row.item_booleanO("ptcache.bake", "bake", True, text="Bake") - - subrow = row.row() - subrow.enabled = cache.frames_skipped or cache.outdated - subrow.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame") - - row = layout.row() - #row.enabled = particle_panel_enabled(psys) - row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake") - row.itemR(cache, "step"); - - row = layout.row() - #row.enabled = particle_panel_enabled(psys) - row.itemR(cache, "quick_cache") - row.itemR(cache, "disk_cache") - - layout.itemL(text=cache.info) - - layout.itemS() - - row = layout.row() - row.itemO("ptcache.bake_all", "bake", True, text="Bake All Dynamics") - row.itemO("ptcache.free_bake_all", text="Free All Bakes") - layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame") + md = context.cloth + point_cache_ui(self, md.point_cache, cloth_panel_enabled(md), 0, 0) class PHYSICS_PT_cloth_collision(PhysicButtonsPanel): __label__ = "Cloth Collision" @@ -143,7 +105,8 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel): def draw_header(self, context): layout = self.layout cloth = context.cloth.collision_settings - + + layout.active = cloth_panel_enabled(context.cloth) layout.itemR(cloth, "enable_collision", text="") def draw(self, context): @@ -151,7 +114,7 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel): cloth = context.cloth.collision_settings split = layout.split() - layout.active = cloth.enable_collision + layout.active = cloth.enable_collision and cloth_panel_enabled(md) col = split.column() col.itemR(cloth, "collision_quality", slider=True, text="Quality") @@ -176,6 +139,7 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel): layout = self.layout cloth = context.cloth.settings + layout.active = cloth_panel_enabled(context.cloth) layout.itemR(cloth, "stiffness_scaling", text="") def draw(self, context): @@ -183,7 +147,7 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel): ob = context.object cloth = context.cloth.settings - layout.active = cloth.stiffness_scaling + layout.active = cloth.stiffness_scaling and cloth_panel_enabled(md) split = layout.split() diff --git a/release/ui/buttons_physics_smoke.py b/release/ui/buttons_physics_smoke.py index 3cfba0f9df9..d7313632638 100644 --- a/release/ui/buttons_physics_smoke.py +++ b/release/ui/buttons_physics_smoke.py @@ -1,6 +1,8 @@ import bpy +from buttons_particle import point_cache_ui + def smoke_panel_enabled_low(smd): if smd.smoke_type == 'TYPE_DOMAIN': return smd.domain.point_cache.baked==False @@ -139,48 +141,8 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel): domain = md.domain_settings cache = domain.point_cache - layout.set_context_pointer("PointCache", cache) - - row = layout.row() - row.template_list(cache, "point_cache_list", cache, "active_point_cache_index") - col = row.column(align=True) - col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="") - col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="") - - row = layout.row() - row.itemR(cache, "name") - - row = layout.row() - row.itemR(cache, "start_frame") - row.itemR(cache, "end_frame") - - row = layout.row() - - if cache.baked == True: - row.itemO("ptcache.free_bake", text="Free Bake") - else: - row.item_booleanO("ptcache.bake", "bake", True, text="Bake") - - subrow = row.row() - subrow.enabled = cache.frames_skipped or cache.outdated - subrow.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame") - - row = layout.row() - #row.enabled = smoke_panel_enabled(psys) - row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake") - - row = layout.row() - #row.enabled = smoke_panel_enabled(psys) - - layout.itemL(text=cache.info) - - layout.itemS() - - row = layout.row() - row.itemO("ptcache.bake_all", "bake", True, text="Bake All Dynamics") - row.itemO("ptcache.free_bake_all", text="Free All Bakes") - layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame") - + point_cache_ui(self, cache, cache.baked==False, 0, 1) + class PHYSICS_PT_smoke_highres(PhysicButtonsPanel): __label__ = "Smoke High Resolution" __default_closed__ = True diff --git a/release/ui/buttons_physics_softbody.py b/release/ui/buttons_physics_softbody.py index 2beba8c95a0..3d3c3c23faf 100644 --- a/release/ui/buttons_physics_softbody.py +++ b/release/ui/buttons_physics_softbody.py @@ -1,6 +1,11 @@ import bpy +from buttons_particle import point_cache_ui + +def softbody_panel_enabled(md): + return md.point_cache.baked==False + class PhysicButtonsPanel(bpy.types.Panel): __space_type__ = 'PROPERTIES' __region_type__ = 'WINDOW' @@ -41,6 +46,7 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel): # General split = layout.split() + split.enabled = softbody_panel_enabled(md) col = split.column() col.itemL(text="Object:") @@ -60,52 +66,9 @@ class PHYSICS_PT_softbody_cache(PhysicButtonsPanel): return (context.soft_body) def draw(self, context): - layout = self.layout - - cache = context.soft_body.point_cache - layout.set_context_pointer("PointCache", cache) - - row = layout.row() - row.template_list(cache, "point_cache_list", cache, "active_point_cache_index", rows=2) - col = row.column(align=True) - col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="") - col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="") - - row = layout.row() - row.itemR(cache, "name") - - row = layout.row() - row.itemR(cache, "start_frame") - row.itemR(cache, "end_frame") - - row = layout.row() - - if cache.baked == True: - row.itemO("ptcache.free_bake", text="Free Bake") - else: - row.item_booleanO("ptcache.bake", "bake", True, text="Bake") - - sub = row.row() - sub.enabled = cache.frames_skipped or cache.outdated - sub.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame") + md = context.soft_body + point_cache_ui(self, md.point_cache, softbody_panel_enabled(md), 0, 0) - row = layout.row() - row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake") - row.itemR(cache, "step"); - - row = layout.row() - row.itemR(cache, "quick_cache") - row.itemR(cache, "disk_cache") - - layout.itemL(text=cache.info) - - layout.itemS() - - row = layout.row() - row.itemO("ptcache.bake_all", "bake", True, text="Bake All Dynamics") - row.itemO("ptcache.free_bake_all", text="Free All Bakes") - layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame") - class PHYSICS_PT_softbody_goal(PhysicButtonsPanel): __label__ = "Soft Body Goal" @@ -117,6 +80,7 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel): softbody = context.soft_body.settings + layout.active = softbody_panel_enabled(context.soft_body) layout.itemR(softbody, "use_goal", text="") def draw(self, context): @@ -129,7 +93,7 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel): if md: softbody = md.settings - layout.active = softbody.use_goal + layout.active = softbody.use_goal and softbody_panel_enabled(md) # Goal split = layout.split() @@ -159,6 +123,7 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel): softbody = context.soft_body.settings + layout.active = softbody_panel_enabled(context.soft_body) layout.itemR(softbody, "use_edges", text="") def draw(self, context): @@ -170,7 +135,7 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel): if md: softbody = md.settings - layout.active = softbody.use_edges + layout.active = softbody.use_edges and softbody_panel_enabled(md) split = layout.split() @@ -209,6 +174,7 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel): softbody = context.soft_body.settings + layout.active = softbody_panel_enabled(context.soft_body) layout.itemR(softbody, "self_collision", text="") def draw(self, context): @@ -220,7 +186,7 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel): if md: softbody = md.settings - layout.active = softbody.self_collision + layout.active = softbody.self_collision and softbody_panel_enabled(md) layout.itemL(text="Collision Type:") layout.itemR(softbody, "collision_type", expand=True) @@ -245,6 +211,8 @@ class PHYSICS_PT_softbody_solver(PhysicButtonsPanel): if md: softbody = md.settings + + layout.active = softbody_panel_enabled(md) # Solver split = layout.split() diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py index 0e6dc76d49d..517571e1b09 100644 --- a/release/ui/space_view3d_toolbar.py +++ b/release/ui/space_view3d_toolbar.py @@ -362,8 +362,10 @@ class VIEW3D_PT_tools_brush(PaintPanel): col = layout.column(align=True) col.item_enumR(settings, "tool", 'DRAW') col.item_enumR(settings, "tool", 'SOFTEN') - col.item_enumR(settings, "tool", 'CLONE') - col.item_enumR(settings, "tool", 'SMEAR') + if settings.use_projection: + col.item_enumR(settings, "tool", 'CLONE') + else: + col.item_enumR(settings, "tool", 'SMEAR') col = layout.column() col.itemR(brush, "color", text="") @@ -426,9 +428,9 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel): if not texture_paint: layout.itemR(brush, "smooth_stroke") col = layout.column() - col.active = brush.smooth_stroke - col.itemR(brush, "smooth_stroke_radius", text="Radius", slider=True) - col.itemR(brush, "smooth_stroke_factor", text="Factor", slider=True) + col.itemR(brush, "airbrush") + col.itemR(brush, "anchored") + col.itemR(brush, "rake") layout.itemR(brush, "space") row = layout.row(align=True) @@ -538,22 +540,12 @@ class VIEW3D_PT_tools_vertexpaint(View3DPanel): # col.itemR(vpaint, "mul", text="") -# ********** options for projection paint **************** +# ********** default tools for texturepaint **************** -class VIEW3D_PT_tools_projectpaint(View3DPanel): +class VIEW3D_PT_tools_texturepaint(View3DPanel): __context__ = "texturepaint" - __label__ = "Project Paint" - - def poll(self, context): - return context.tool_settings.image_paint.tool != 'SMEAR' - - def draw_header(self, context): - layout = self.layout - - ipaint = context.tool_settings.image_paint + __label__ = "Options" - layout.itemR(ipaint, "use_projection", text="") - def draw(self, context): layout = self.layout @@ -562,6 +554,7 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel): use_projection= ipaint.use_projection col = layout.column() + col.itemR(ipaint, "use_projection") sub = col.column() sub.active = use_projection sub.itemR(ipaint, "use_occlude") @@ -606,22 +599,58 @@ class VIEW3D_PT_tools_particlemode(View3DPanel): def draw(self, context): layout = self.layout pe = context.tool_settings.particle_edit + ob = pe.object - col = layout.column(align=True) - col.itemR(pe, "emitter_deflect", text="Deflect") - sub = col.row() - sub.active = pe.emitter_deflect - sub.itemR(pe, "emitter_distance", text="Distance") + row = layout.row() + row.itemL(text="Edit:") + row.itemR(pe, "type", text="") + + if pe.type == 'PARTICLES': + if ob.particle_systems: + if len(ob.particle_systems) > 1: + layout.template_list(ob, "particle_systems", ob, "active_particle_system_index", type='ICONS') + + ptcache = ob.particle_systems[ob.active_particle_system_index].point_cache + else: + for md in ob.modifiers: + if md.type==pe.type: + ptcache = md.point_cache + + if ptcache and len(ptcache.point_cache_list) > 1: + layout.template_list(ptcache, "point_cache_list", ptcache, "active_point_cache_index", type='ICONS') + + + if not pe.editable: + layout.itemL(text="Point cache must be baked") + layout.itemL(text="to enable editing!") col = layout.column(align=True) + if pe.hair: + col.active = pe.editable + col.itemR(pe, "emitter_deflect", text="Deflect emitter") + sub = col.row() + sub.active = pe.emitter_deflect + sub.itemR(pe, "emitter_distance", text="Distance") + + col = layout.column(align=True) + col.active = pe.editable col.itemL(text="Keep:") col.itemR(pe, "keep_lengths", text="Lenghts") col.itemR(pe, "keep_root", text="Root") + if not pe.hair: + col.itemL(text="Correct:") + col.itemR(pe, "auto_velocity", text="Velocity") col = layout.column(align=True) - col.itemL(text="Display:") - col.itemR(pe, "show_time", text="Time") - col.itemR(pe, "show_children", text="Children") + col.active = pe.editable + col.itemL(text="Draw:") + col.itemR(pe, "draw_step", text="Path Steps") + if pe.type == 'PARTICLES': + col.itemR(pe, "draw_particles", text="Particles") + col.itemR(pe, "fade_time") + sub = col.row() + sub.active = pe.fade_time + sub.itemR(pe, "fade_frames", slider=True) bpy.types.register(VIEW3D_PT_tools_objectmode) bpy.types.register(VIEW3D_PT_tools_meshedit) @@ -638,5 +667,5 @@ bpy.types.register(VIEW3D_PT_tools_brush_curve) bpy.types.register(VIEW3D_PT_sculpt_options) bpy.types.register(VIEW3D_PT_tools_vertexpaint) bpy.types.register(VIEW3D_PT_tools_weightpaint) -bpy.types.register(VIEW3D_PT_tools_projectpaint) +bpy.types.register(VIEW3D_PT_tools_texturepaint) bpy.types.register(VIEW3D_PT_tools_particlemode) diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h index cf02efc34ac..e24114cd219 100644 --- a/source/blender/blenkernel/BKE_particle.h +++ b/source/blender/blenkernel/BKE_particle.h @@ -109,46 +109,10 @@ typedef struct ParticleCacheKey{ float vel[3]; float rot[4]; float col[3]; + float time; int steps; } ParticleCacheKey; -typedef struct ParticleEditKey{ - float *co; - float *vel; - float *rot; - float *time; - - float world_co[3]; - float length; - short flag; -} ParticleEditKey; - -typedef struct ParticleUndo { - struct ParticleUndo *next, *prev; - struct ParticleEditKey **keys; - struct KDTree *emitter_field; - struct ParticleData *particles; - float *emitter_cosnos; - int totpart, totkeys; - char name[64]; -} ParticleUndo; - -typedef struct ParticleEdit { - ListBase undo; - struct ParticleUndo *curundo; - - ParticleEditKey **keys; - int totkeys; - - int *mirror_cache; - - struct KDTree *emitter_field; - float *emitter_cosnos; - - char sel_col[3]; - char nosel_col[3]; -} ParticleEdit; - typedef struct ParticleThreadContext { /* shared */ struct Scene *scene; @@ -240,7 +204,7 @@ int psys_check_enabled(struct Object *ob, struct ParticleSystem *psys); void psys_free_boid_rules(struct ListBase *list); void psys_free_settings(struct ParticleSettings *part); void free_child_path_cache(struct ParticleSystem *psys); -void psys_free_path_cache(struct ParticleSystem *psys); +void psys_free_path_cache(struct ParticleSystem *psys, struct PTCacheEdit *edit); void free_hair(struct ParticleSystem *psys, int softbody); void free_keyed_keys(struct ParticleSystem *psys); void psys_free(struct Object * ob, struct ParticleSystem * psys); @@ -271,9 +235,9 @@ void psys_reset(struct ParticleSystem *psys, int mode); void psys_find_parents(struct Object *ob, struct ParticleSystemModifierData *psmd, struct ParticleSystem *psys); -void psys_cache_paths(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys, float cfra, int editupdate); +void psys_cache_paths(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys, float cfra); +void psys_cache_edit_paths(struct Scene *scene, struct Object *ob, struct PTCacheEdit *edit, float cfra); void psys_cache_child_paths(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys, float cfra, int editupdate); -void psys_update_world_cos(struct Object *ob, struct ParticleSystem *psys); int do_guide(struct Scene *scene, struct ParticleKey *state, int pa_num, float time, struct ListBase *lb); float psys_get_size(struct Object *ob, struct Material *ma, struct ParticleSystemModifierData *psmd, struct IpoCurve *icu_size, struct ParticleSystem *psys, struct ParticleSettings *part, struct ParticleData *pa, float *vg_size); float psys_get_timestep(struct ParticleSettings *part); @@ -359,12 +323,6 @@ void reset_particle(struct Scene *scene, struct ParticleData *pa, struct Particl #define PSYS_EC_PARTICLE 4 #define PSYS_EC_REACTOR 8 -/* ParticleEditKey->flag */ -#define PEK_SELECT 1 -#define PEK_TO_SELECT 2 -#define PEK_TAG 4 -#define PEK_HIDE 8 - /* index_dmcache */ #define DMCACHE_NOTFOUND -1 #define DMCACHE_ISCHILD -2 diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h index 531487549da..9ba34091064 100644 --- a/source/blender/blenkernel/BKE_pointcache.h +++ b/source/blender/blenkernel/BKE_pointcache.h @@ -101,6 +101,8 @@ typedef struct PTCacheFile { void *cur[BPHYS_TOT_DATA]; } PTCacheFile; +#define PTCACHE_VEL_PER_SEC 1 + typedef struct PTCacheID { struct PTCacheID *next, *prev; @@ -109,6 +111,7 @@ typedef struct PTCacheID { void *calldata; int type; int stack_index; + int flag; /* flags defined in DNA_object_force.h */ unsigned int data_types, info_types; @@ -151,6 +154,75 @@ typedef struct PTCacheBaker { void *progresscontext; } PTCacheBaker; +/* PTCacheEditKey->flag */ +#define PEK_SELECT 1 +#define PEK_TAG 2 +#define PEK_HIDE 4 +#define PEK_USE_WCO 8 + +typedef struct PTCacheEditKey{ + float *co; + float *vel; + float *rot; + float *time; + + float world_co[3]; + float ftime; + float length; + short flag; +} PTCacheEditKey; + +/* PTCacheEditPoint->flag */ +#define PEP_TAG 1 +#define PEP_EDIT_RECALC 2 +#define PEP_TRANSFORM 4 +#define PEP_HIDE 8 + +typedef struct PTCacheEditPoint { + struct PTCacheEditKey *keys; + int totkey; + short flag; +} PTCacheEditPoint; + +typedef struct PTCacheUndo { + struct PTCacheUndo *next, *prev; + struct PTCacheEditPoint *points; + + /* particles stuff */ + struct ParticleData *particles; + struct KDTree *emitter_field; + float *emitter_cosnos; + + /* cache stuff */ + struct ListBase mem_cache; + + int totpoint; + char name[64]; +} PTCacheUndo; + +typedef struct PTCacheEdit { + ListBase undo; + struct PTCacheUndo *curundo; + PTCacheEditPoint *points; + + struct PTCacheID pid; + + /* particles stuff */ + struct ParticleSystem *psys; + struct ParticleData *particles; + struct KDTree *emitter_field; + float *emitter_cosnos; + int *mirror_cache; + + struct ParticleCacheKey **pathcache; /* path cache (runtime) */ + ListBase pathcachebufs; + + int totpoint, totframes, totcached, edited; + + char sel_col[3]; + char nosel_col[3]; +} PTCacheEdit; + /* Particle functions */ void BKE_ptcache_make_particle_key(struct ParticleKey *key, int index, void **data, float time); @@ -179,6 +251,10 @@ void BKE_ptcache_update_info(PTCacheID *pid); /* Size of cache data type. */ int BKE_ptcache_data_size(int data_type); +/* Memory cache read/write helpers. */ +void BKE_ptcache_mem_init_pointers(struct PTCacheMem *pm); +void BKE_ptcache_mem_incr_pointers(struct PTCacheMem *pm); + /* Copy a specific data type from cache data to point data. */ void BKE_ptcache_data_get(void **data, int type, int index, void *to); @@ -197,7 +273,7 @@ int BKE_ptcache_get_continue_physics(void); /******************* Allocate & free ***************/ struct PointCache *BKE_ptcache_add(struct ListBase *ptcaches); -void BKE_ptache_free_mem(struct PointCache *cache); +void BKE_ptcache_free_mem(struct ListBase *mem_cache); void BKE_ptcache_free(struct PointCache *cache); void BKE_ptcache_free_list(struct ListBase *ptcaches); struct PointCache *BKE_ptcache_copy_list(struct ListBase *ptcaches_new, struct ListBase *ptcaches_old); diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index 3acaaecb1e8..eafd9eb01fe 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -347,7 +347,7 @@ void cloth_clear_cache(Object *ob, ClothModifierData *clmd, float framenr) BKE_ptcache_id_from_cloth(&pid, ob, clmd); // don't do anything as long as we're in editmode! - if(pid.cache->flag & PTCACHE_BAKE_EDIT_ACTIVE) + if(pid.cache->edit && ob->mode & OB_MODE_PARTICLE_EDIT) return; BKE_ptcache_id_clear(&pid, PTCACHE_CLEAR_AFTER, framenr); diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index e1987d34a6c..18e3512967a 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -321,7 +321,7 @@ int psys_ob_has_hair(Object *ob) } int psys_in_edit_mode(Scene *scene, ParticleSystem *psys) { - return ((scene->basact->object->mode & OB_MODE_PARTICLE_EDIT) && psys==psys_get_current((scene->basact)->object) && psys->edit); + return (scene->basact && (scene->basact->object->mode & OB_MODE_PARTICLE_EDIT) && psys==psys_get_current((scene->basact)->object) && (psys->edit || psys->pointcache->edit)); } int psys_check_enabled(Object *ob, ParticleSystem *psys) { @@ -406,13 +406,20 @@ void free_child_path_cache(ParticleSystem *psys) psys->childcache = NULL; psys->totchildcache = 0; } -void psys_free_path_cache(ParticleSystem *psys) +void psys_free_path_cache(ParticleSystem *psys, PTCacheEdit *edit) { - psys_free_path_cache_buffers(psys->pathcache, &psys->pathcachebufs); - psys->pathcache= NULL; - psys->totcached= 0; + if(edit) { + psys_free_path_cache_buffers(edit->pathcache, &edit->pathcachebufs); + edit->pathcache= NULL; + edit->totcached= 0; + } + else { + psys_free_path_cache_buffers(psys->pathcache, &psys->pathcachebufs); + psys->pathcache= NULL; + psys->totcached= 0; - free_child_path_cache(psys); + free_child_path_cache(psys); + } } void psys_free_children(ParticleSystem *psys) { @@ -431,14 +438,14 @@ void psys_free(Object *ob, ParticleSystem * psys) int nr = 0; ParticleSystem * tpsys; - psys_free_path_cache(psys); + psys_free_path_cache(psys, NULL); free_hair(psys, 1); free_keyed_keys(psys); if(psys->edit && psys->free_edit) - psys->free_edit(psys); + psys->free_edit(psys->edit); if(psys->particles){ if(psys->particles->boid) @@ -645,7 +652,7 @@ void psys_render_restore(Object *ob, ParticleSystem *psys) psmd->dm->release(psmd->dm); } - psys_free_path_cache(psys); + psys_free_path_cache(psys, NULL); if(psys->child){ MEM_freeN(psys->child); @@ -953,17 +960,25 @@ void psys_interpolate_particle(short type, ParticleKey keys[4], float dt, Partic typedef struct ParticleInterpolationData { - ParticleKey *kkey[2]; HairKey *hkey[2]; - BodyPoint *bp[2]; + + int keyed; + ParticleKey *kkey[2]; + SoftBody *soft; - int keyed, cached; + BodyPoint *bp[2]; + + PointCache *cache; + + PTCacheEditPoint *epoint; + PTCacheEditKey *ekey[2]; + float birthtime, dietime; + int bspline; } ParticleInterpolationData; /* Assumes pointcache->mem_cache exists, so for disk cached particles call psys_make_temp_pointcache() before use */ -static void get_pointcache_keys_for_time(Object *ob, ParticleSystem *psys, int index, float t, ParticleKey *key1, ParticleKey *key2) +static void get_pointcache_keys_for_time(Object *ob, PointCache *cache, int index, float t, ParticleKey *key1, ParticleKey *key2) { - PointCache *cache = psys->pointcache; static PTCacheMem *pm = NULL; /* not thread safe */ if(index < 0) { /* initialize */ @@ -990,22 +1005,27 @@ static void get_pointcache_keys_for_time(Object *ob, ParticleSystem *psys, int i static void init_particle_interpolation(Object *ob, ParticleSystem *psys, ParticleData *pa, ParticleInterpolationData *pind) { - if(pind->keyed) { - pind->kkey[0] = pa->keys; + if(pind->epoint) { + PTCacheEditPoint *point = pind->epoint; - if(pa->totkey > 1) - pind->kkey[1] = pa->keys + 1; - else - pind->kkey[1] = NULL; + pind->ekey[0] = point->keys; + pind->ekey[1] = point->totkey > 1 ? point->keys + 1 : NULL; + + pind->birthtime = *(point->keys->time); + pind->dietime = *((point->keys + point->totkey - 1)->time); + } + else if(pind->keyed) { + pind->kkey[0] = pa->keys; + pind->kkey[1] = pa->totkey > 1 ? pa->keys + 1 : NULL; pind->birthtime = pa->keys->time; pind->dietime = (pa->keys + pa->totkey - 1)->time; } - else if(pind->cached) { - get_pointcache_keys_for_time(ob, psys, -1, 0.0f, NULL, NULL); + else if(pind->cache) { + get_pointcache_keys_for_time(ob, pind->cache, -1, 0.0f, NULL, NULL); - pind->birthtime = pa->time; - pind->dietime = pa->dietime; + pind->birthtime = pa ? pa->time : pind->cache->startframe; + pind->dietime = pa ? pa->dietime : pind->cache->endframe; } else { pind->hkey[0] = pa->hair; @@ -1020,6 +1040,14 @@ static void init_particle_interpolation(Object *ob, ParticleSystem *psys, Partic pind->bp[1] = pind->soft->bpoint + pa->bpi + 1; } } +static void edit_to_particle(ParticleKey *key, PTCacheEditKey *ekey) +{ + VECCOPY(key->co, ekey->co); + if(ekey->vel) { + VECCOPY(key->vel, ekey->vel); + } + key->time = *(ekey->time); +} static void hair_to_particle(ParticleKey *key, HairKey *hkey) { VECCOPY(key->co, hkey->co); @@ -1033,11 +1061,24 @@ static void bp_to_particle(ParticleKey *key, BodyPoint *bp, HairKey *hkey) static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData *pa, float t, float frs_sec, ParticleInterpolationData *pind, ParticleKey *result) { + PTCacheEditPoint *point = pind->epoint; ParticleKey keys[4]; + int point_vel = (point && point->keys->vel); float real_t, dfra, keytime; /* interpret timing and find keys */ - if(pind->keyed) { + if(point) { + if(result->time < 0.0f) + real_t = -result->time; + else + real_t = *(pind->ekey[0]->time) + t * (*(pind->ekey[0][point->totkey-1].time) - *(pind->ekey[0]->time)); + + while(*(pind->ekey[1]->time) < real_t) + pind->ekey[1]++; + + pind->ekey[0] = pind->ekey[1] - 1; + } + else if(pind->keyed) { /* we have only one key, so let's use that */ if(pind->kkey[1]==NULL) { copy_particle_key(result, pind->kkey[0], 1); @@ -1074,7 +1115,7 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData pind->kkey[0] = pind->kkey[1] - 1; } - else if(pind->cached) { + else if(pind->cache) { if(result->time < 0.0f) /* flag for time in frames */ real_t = -result->time; else @@ -1095,7 +1136,11 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData } /* set actual interpolation keys */ - if(pind->soft) { + if(point) { + edit_to_particle(keys + 1, pind->ekey[0]); + edit_to_particle(keys + 2, pind->ekey[1]); + } + else if(pind->soft) { pind->bp[0] = pind->bp[1] - 1; bp_to_particle(keys + 1, pind->bp[0], pind->hkey[0]); bp_to_particle(keys + 2, pind->bp[1], pind->hkey[1]); @@ -1104,8 +1149,8 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData memcpy(keys + 1, pind->kkey[0], sizeof(ParticleKey)); memcpy(keys + 2, pind->kkey[1], sizeof(ParticleKey)); } - else if(pind->cached) { - get_pointcache_keys_for_time(NULL, psys, p, real_t, keys+1, keys+2); + else if(pind->cache) { + get_pointcache_keys_for_time(NULL, pind->cache, p, real_t, keys+1, keys+2); } else { hair_to_particle(keys + 1, pind->hkey[0]); @@ -1113,8 +1158,14 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData } /* set secondary interpolation keys for hair */ - if(!pind->keyed && !pind->cached) { - if(pind->soft) { + if(!pind->keyed && !pind->cache && !point_vel) { + if(point) { + if(pind->ekey[0] != point->keys) + edit_to_particle(keys, pind->ekey[0] - 1); + else + edit_to_particle(keys, pind->ekey[0]); + } + else if(pind->soft) { if(pind->hkey[0] != pa->hair) bp_to_particle(keys, pind->bp[0] - 1, pind->hkey[0] - 1); else @@ -1127,7 +1178,13 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData hair_to_particle(keys, pind->hkey[0]); } - if(pind->soft) { + if(point) { + if(pind->ekey[1] != point->keys + point->totkey - 1) + edit_to_particle(keys + 3, pind->ekey[1] + 1); + else + edit_to_particle(keys + 3, pind->ekey[1]); + } + else if(pind->soft) { if(pind->hkey[1] != pa->hair + pa->totkey - 1) bp_to_particle(keys + 3, pind->bp[1] + 1, pind->hkey[1] + 1); else @@ -1145,19 +1202,19 @@ static void do_particle_interpolation(ParticleSystem *psys, int p, ParticleData keytime = (real_t - keys[1].time) / dfra; /* convert velocity to timestep size */ - if(pind->keyed || pind->cached){ + if(pind->keyed || pind->cache || point_vel){ VecMulf(keys[1].vel, dfra / frs_sec); VecMulf(keys[2].vel, dfra / frs_sec); QuatInterpol(result->rot,keys[1].rot,keys[2].rot,keytime); } /* now we should have in chronologiacl order k1<=k2<=t<=k3<=k4 with keytime between [0,1]->[k2,k3] (k1 & k4 used for cardinal & bspline interpolation)*/ - psys_interpolate_particle((pind->keyed || pind->cached) ? -1 /* signal for cubic interpolation */ - : ((psys->part->flag & PART_HAIR_BSPLINE) ? KEY_BSPLINE : KEY_CARDINAL) + psys_interpolate_particle((pind->keyed || pind->cache || point_vel) ? -1 /* signal for cubic interpolation */ + : (pind->bspline ? KEY_BSPLINE : KEY_CARDINAL) ,keys, keytime, result, 1); /* the velocity needs to be converted back from cubic interpolation */ - if(pind->keyed || pind->cached) + if(pind->keyed || pind->cache || point_vel) VecMulf(result->vel, frs_sec / dfra); } /************************************************/ @@ -1610,7 +1667,7 @@ ParticleSystemModifierData *psys_get_modifier(Object *ob, ParticleSystem *psys) } } } - return 0; + return NULL; } /************************************************/ /* Particles on a shape */ @@ -2129,7 +2186,7 @@ int psys_threads_init_path(ParticleThread *threads, Scene *scene, float cfra, in /*---start figuring out what is actually wanted---*/ if(psys_in_edit_mode(scene, psys)) - if(psys->renderdata==0 && (psys->edit==NULL || pset->flag & PE_SHOW_CHILD)==0) + if(psys->renderdata==0 && (psys->edit==NULL || pset->flag & PE_DRAW_PART)==0) totchild=0; if(totchild && part->from!=PART_FROM_PARTICLE && part->childtype==PART_CHILD_FACES){ @@ -2245,7 +2302,7 @@ void psys_thread_create_path(ParticleThread *thread, struct ChildParticle *cpa, needupdate= 0; w= 0; while(w<4 && cpa->pa[w]>=0) { - if(psys->particles[cpa->pa[w]].flag & PARS_EDIT_RECALC) { + if(psys->edit->points[cpa->pa[w]].flag & PEP_EDIT_RECALC) { needupdate= 1; break; } @@ -2288,7 +2345,7 @@ void psys_thread_create_path(ParticleThread *thread, struct ChildParticle *cpa, } else{ if(ctx->editupdate && !(part->flag & PART_BRANCHING)) { - if(!(psys->particles[cpa->parent].flag & PARS_EDIT_RECALC)) + if(!(psys->edit->points[cpa->parent].flag & PEP_EDIT_RECALC)) return; memset(keys, 0, sizeof(*keys)*(ctx->steps+1)); @@ -2557,24 +2614,20 @@ void psys_cache_child_paths(Scene *scene, Object *ob, ParticleSystem *psys, floa /* -Usefull for making use of opengl vertex arrays for super fast strand drawing. */ /* -Makes child strands possible and creates them too into the cache. */ /* -Cached path data is also used to determine cut position for the editmode tool. */ -void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra, int editupdate) +void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra) { - ParticleCacheKey *ca, **cache=psys->pathcache; + ParticleCacheKey *ca, **cache= psys->pathcache; ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys); - ParticleEditSettings *pset = &scene->toolsettings->particle; ParticleSettings *part = psys->part; + ParticleEditSettings *pset = &scene->toolsettings->particle; - ParticleData *pa; + ParticleData *pa = psys->particles; ParticleKey result; - ParticleEdit *edit = 0; - ParticleEditKey *ekey = 0; - - SoftBody *soft = 0; + SoftBody *soft = NULL; BodyPoint *bp[2] = {NULL, NULL}; Material *ma; - ParticleInterpolationData pind; float birthtime = 0.0, dietime = 0.0; @@ -2583,132 +2636,98 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra float prev_tangent[3], hairmat[4][4]; float rotmat[3][3]; int k,i; - int steps = (int)pow(2.0, (double)psys->part->draw_step); + int steps = (int)pow(2.0, (double)(psys->renderdata ? part->ren_step : part->draw_step)); int totpart = psys->totpart; - float sel_col[3]; - float nosel_col[3]; float length, vec[3]; float *vg_effector= NULL, effector=0.0f; float *vg_length= NULL, pa_length=1.0f; int keyed, baked; /* we don't have anything valid to create paths from so let's quit here */ - if((psys->flag & PSYS_HAIR_DONE)==0 && (psys->flag & PSYS_KEYED)==0 && (psys->pointcache->flag & PTCACHE_BAKED)==0) + if(!(psys->flag & PSYS_HAIR_DONE) && !(psys->flag & PSYS_KEYED) && !(psys->pointcache->flag & PTCACHE_BAKED)) return; + if(psys_in_edit_mode(scene, psys)) + if(psys->renderdata==0 && (psys->edit==NULL || pset->flag & PE_DRAW_PART)==0) + return; + BLI_srandom(psys->seed); keyed = psys->flag & PSYS_KEYED; baked = psys->pointcache->flag & PTCACHE_BAKED; - if(psys->renderdata) { - steps = (int)pow(2.0, (double)psys->part->ren_step); - } - else if(psys_in_edit_mode(scene, psys)) { - edit=psys->edit; - - //timed = edit->draw_timed; + /* clear out old and create new empty path cache */ + psys_free_path_cache(psys, NULL); + cache= psys->pathcache= psys_alloc_path_cache_buffers(&psys->pathcachebufs, totpart, steps+1); - if(pset->brushtype == PE_BRUSH_WEIGHT) { - sel_col[0] = sel_col[1] = sel_col[2] = 1.0f; - nosel_col[0] = nosel_col[1] = nosel_col[2] = 0.0f; - } - else{ - sel_col[0] = (float)edit->sel_col[0] / 255.0f; - sel_col[1] = (float)edit->sel_col[1] / 255.0f; - sel_col[2] = (float)edit->sel_col[2] / 255.0f; - nosel_col[0] = (float)edit->nosel_col[0] / 255.0f; - nosel_col[1] = (float)edit->nosel_col[1] / 255.0f; - nosel_col[2] = (float)edit->nosel_col[2] / 255.0f; - } - } - - if(editupdate && psys->pathcache && totpart == psys->totcached) { - cache = psys->pathcache; - } - else { - /* clear out old and create new empty path cache */ - psys_free_path_cache(psys); - cache= psys_alloc_path_cache_buffers(&psys->pathcachebufs, totpart, steps+1); - psys->pathcache= cache; - } - - if(edit==NULL && psys->soft && psys->softflag & OB_SB_ENABLE) { + if(psys->soft && psys->softflag & OB_SB_ENABLE) { soft = psys->soft; if(!soft->bpoint) soft= NULL; } - + psys->lattice = psys_get_lattice(scene, ob, psys); ma= give_current_material(ob, psys->part->omat); if(ma && (psys->part->draw & PART_DRAW_MAT_COL)) VECCOPY(col, &ma->r) - + if(psys->part->from!=PART_FROM_PARTICLE) { if(!(psys->part->flag & PART_CHILD_EFFECT)) vg_effector = psys_cache_vgroup(psmd->dm, psys, PSYS_VG_EFFECTOR); - if(!edit && !psys->totchild) + if(!psys->totchild) vg_length = psys_cache_vgroup(psmd->dm, psys, PSYS_VG_LENGTH); } /*---first main loop: create all actual particles' paths---*/ - for(i=0,pa=psys->particles; iflag & PARS_NO_DISP || pa->flag & PARS_UNEXIST)) { + for(i=0; iflag & PARS_NO_DISP || pa->flag & PARS_UNEXIST) { if(soft) bp[0] += pa->totkey; /* TODO use of initialized value? */ continue; } - if(editupdate && !(pa->flag & PARS_EDIT_RECALC)) continue; - else memset(cache[i], 0, sizeof(*cache[i])*(steps+1)); - - if(!edit && !psys->totchild) { + if(!psys->totchild) { pa_length = 1.0f - part->randlength * 0.5 * (1.0f + pa->r_ave[0]); if(vg_length) pa_length *= psys_particle_value_from_verts(psmd->dm,part->from,pa,vg_length); } + pind.keyed = keyed; + pind.cache = baked ? psys->pointcache : NULL; + pind.soft = soft; + pind.epoint = NULL; + pind.bspline = (psys->part->flag & PART_HAIR_BSPLINE); + + memset(cache[i], 0, sizeof(*cache[i])*(steps+1)); + cache[i]->steps = steps; - if(edit) - ekey = edit->keys[i]; - /*--get the first data points--*/ - pind.keyed = keyed; - pind.cached = baked; - pind.soft = soft; init_particle_interpolation(ob, psys, pa, &pind); - /* hairmat is needed for for non-hair particle too so we get proper rotations */ psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat); VECCOPY(rotmat[0], hairmat[2]); VECCOPY(rotmat[1], hairmat[1]); VECCOPY(rotmat[2], hairmat[0]); - if(!edit) { - if(part->draw & PART_ABS_PATH_TIME) { - birthtime = MAX2(pind.birthtime, part->path_start); - dietime = MIN2(pind.dietime, part->path_end); - } - else { - float tb = pind.birthtime; - birthtime = tb + part->path_start * (pind.dietime - tb); - dietime = tb + part->path_end * (pind.dietime - tb); - } - - if(birthtime >= dietime) { - cache[i]->steps = -1; - continue; - } - - dietime = birthtime + pa_length * (dietime - birthtime); + if(part->draw & PART_ABS_PATH_TIME) { + birthtime = MAX2(pind.birthtime, part->path_start); + dietime = MIN2(pind.dietime, part->path_end); } - else - /* XXX brecht: don't know if this code from 2.4 is correct - * still, but makes hair appear again in particle mode */ - dietime= pind.hkey[0][pa->totkey-1].time; + else { + float tb = pind.birthtime; + birthtime = tb + part->path_start * (pind.dietime - tb); + dietime = tb + part->path_end * (pind.dietime - tb); + } + + if(birthtime >= dietime) { + cache[i]->steps = -1; + continue; + } + + dietime = birthtime + pa_length * (dietime - birthtime); /*--interpolate actual path from data points--*/ for(k=0, ca=cache[i]; k<=steps; k++, ca++){ @@ -2726,40 +2745,8 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra } VECCOPY(ca->co, result.co); - - /* selection coloring in edit mode */ - if(edit){ - if(pset->brushtype==PE_BRUSH_WEIGHT){ - if(k==steps) - VecLerpf(ca->col, nosel_col, sel_col, pind.hkey[0]->weight); - else - VecLerpf(ca->col, nosel_col, sel_col, - (1.0f - keytime) * pind.hkey[0]->weight + keytime * pind.hkey[1]->weight); - } - else{ - if((ekey + (pind.hkey[0] - pa->hair))->flag & PEK_SELECT){ - if((ekey + (pind.hkey[1] - pa->hair))->flag & PEK_SELECT){ - VECCOPY(ca->col, sel_col); - } - else{ - VecLerpf(ca->col, sel_col, nosel_col, keytime); - } - } - else{ - if((ekey + (pind.hkey[1] - pa->hair))->flag & PEK_SELECT){ - VecLerpf(ca->col, nosel_col, sel_col, keytime); - } - else{ - VECCOPY(ca->col, nosel_col); - } - } - } - } - else{ - VECCOPY(ca->col, col); - } + VECCOPY(ca->col, col); } - /*--modify paths and calculate rotation & velocity--*/ @@ -2772,16 +2759,16 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra for(k=0, ca=cache[i]; k<=steps; k++, ca++) { /* apply effectors */ - if(!(psys->part->flag & PART_CHILD_EFFECT) && edit==0 && k) + if(!(psys->part->flag & PART_CHILD_EFFECT) && k) do_path_effectors(scene, ob, psys, i, ca, k, steps, cache[i]->co, effector, dfra, cfra, &length, vec); /* apply guide curves to path data */ - if(edit==0 && psys->effectors.first && (psys->part->flag & PART_CHILD_EFFECT)==0) + if(psys->effectors.first && (psys->part->flag & PART_CHILD_EFFECT)==0) /* ca is safe to cast, since only co and vel are used */ do_guide(scene, (ParticleKey*)ca, i, (float)k/(float)steps, &psys->effectors); /* apply lattice */ - if(psys->lattice && edit==0) + if(psys->lattice) calc_latt_deform(psys->lattice, ca->co, 1.0f); /* figure out rotation */ @@ -2810,8 +2797,8 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra cosangle= Inpf(tangent, prev_tangent); /* note we do the comparison on cosangle instead of - * angle, since floating point accuracy makes it give - * different results across platforms */ + * angle, since floating point accuracy makes it give + * different results across platforms */ if(cosangle > 0.999999f) { QUATCOPY((ca - 1)->rot, (ca - 2)->rot); } @@ -2856,6 +2843,124 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra if(vg_length) MEM_freeN(vg_length); } +void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cfra) +{ + ParticleCacheKey *ca, **cache= edit->pathcache; + ParticleEditSettings *pset = &scene->toolsettings->particle; + + PTCacheEditPoint *point = edit->points; + PTCacheEditKey *ekey = NULL; + + ParticleSystem *psys = edit->psys; + ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys); + ParticleSettings *part = psys ? psys->part : NULL; + ParticleData *pa = psys ? psys->particles : NULL; + + ParticleInterpolationData pind; + ParticleKey result; + + float birthtime = 0.0, dietime = 0.0; + float t, time = 0.0, keytime = 0.0, dfra = 1.0, frs_sec; + float hairmat[4][4]; + int k,i; + int steps = (int)pow(2.0, (double)pset->draw_step); + int totpart = edit->totpoint; + float sel_col[3]; + float nosel_col[3]; + + steps = MAX2(steps, 4); + + if(!cache || edit->totpoint != edit->totcached) { + /* clear out old and create new empty path cache */ + psys_free_path_cache(NULL, edit); + cache= edit->pathcache= psys_alloc_path_cache_buffers(&edit->pathcachebufs, totpart, steps+1); + } + + frs_sec = (psys || edit->pid.flag & PTCACHE_VEL_PER_SEC) ? 25.0f : 1.0f; + + sel_col[0] = (float)edit->sel_col[0] / 255.0f; + sel_col[1] = (float)edit->sel_col[1] / 255.0f; + sel_col[2] = (float)edit->sel_col[2] / 255.0f; + nosel_col[0] = (float)edit->nosel_col[0] / 255.0f; + nosel_col[1] = (float)edit->nosel_col[1] / 255.0f; + nosel_col[2] = (float)edit->nosel_col[2] / 255.0f; + + /*---first main loop: create all actual particles' paths---*/ + for(i=0; itotcached && !(point->flag & PEP_EDIT_RECALC)) + continue; + + ekey = point->keys; + + pind.keyed = 0; + pind.cache = NULL; + pind.soft = NULL; + pind.epoint = point; + pind.bspline = psys ? (psys->part->flag & PART_HAIR_BSPLINE) : 0; + + memset(cache[i], 0, sizeof(*cache[i])*(steps+1)); + + cache[i]->steps = steps; + + /*--get the first data points--*/ + init_particle_interpolation(ob, psys, pa, &pind); + + if(psys) + psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat); + + birthtime = pind.birthtime; + dietime = pind.dietime; + + if(birthtime >= dietime) { + cache[i]->steps = -1; + continue; + } + + /*--interpolate actual path from data points--*/ + for(k=0, ca=cache[i]; k<=steps; k++, ca++){ + time = (float)k / (float)steps; + + t = birthtime + time * (dietime - birthtime); + + result.time = -t; + + do_particle_interpolation(psys, i, pa, t, frs_sec, &pind, &result); + + /* non-hair points are allready in global space */ + if(psys) + Mat4MulVecfl(hairmat, result.co); + + VECCOPY(ca->co, result.co); + + ca->vel[0] = ca->vel[1] = 0.0f; + ca->vel[1] = 1.0f; + + /* selection coloring in edit mode */ + if((ekey + (pind.ekey[0] - point->keys))->flag & PEK_SELECT){ + if((ekey + (pind.ekey[1] - point->keys))->flag & PEK_SELECT){ + VECCOPY(ca->col, sel_col); + } + else{ + keytime = (t - (*pind.ekey[0]->time))/((*pind.ekey[1]->time) - (*pind.ekey[0]->time)); + VecLerpf(ca->col, sel_col, nosel_col, keytime); + } + } + else{ + if((ekey + (pind.ekey[1] - point->keys))->flag & PEK_SELECT){ + keytime = (t - (*pind.ekey[0]->time))/((*pind.ekey[1]->time) - (*pind.ekey[0]->time)); + VecLerpf(ca->col, nosel_col, sel_col, keytime); + } + else{ + VECCOPY(ca->col, nosel_col); + } + } + + ca->time = t; + } + } + + edit->totcached = totpart; +} /************************************************/ /* Particle Key handling */ /************************************************/ @@ -3663,8 +3768,9 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i } pind.keyed = keyed; - pind.cached = cached; + pind.cache = cached ? psys->pointcache : NULL; pind.soft = NULL; + pind.epoint = NULL; init_particle_interpolation(ob, psys, pa, &pind); do_particle_interpolation(psys, p, pa, t, frs_sec, &pind, state); diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index bf642a14a49..0f72c1c5866 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -127,7 +127,7 @@ void psys_reset(ParticleSystem *psys, int mode) int i; if(ELEM(mode, PSYS_RESET_ALL, PSYS_RESET_DEPSGRAPH)) { - if(mode == PSYS_RESET_ALL || !(part->type == PART_HAIR && (psys->flag & PSYS_EDITED))) { + if(mode == PSYS_RESET_ALL || !(part->type == PART_HAIR && (psys->edit && psys->edit->edited))) { if(psys->particles) { if(psys->particles->keys) MEM_freeN(psys->particles->keys); @@ -145,6 +145,12 @@ void psys_reset(ParticleSystem *psys, int mode) if(psys->reactevents.first) BLI_freelistN(&psys->reactevents); + + if(psys->edit && psys->free_edit) { + psys->free_edit(psys->edit); + psys->edit = NULL; + psys->free_edit = NULL; + } } } else if(mode == PSYS_RESET_CACHE_MISS) { @@ -165,7 +171,7 @@ void psys_reset(ParticleSystem *psys, int mode) psys->totchild= 0; /* reset path cache */ - psys_free_path_cache(psys); + psys_free_path_cache(psys, NULL); /* reset point cache */ psys->pointcache->flag &= ~PTCACHE_SIMULATION_VALID; @@ -2274,7 +2280,7 @@ void psys_clear_temp_pointcache(ParticleSystem *psys) if((psys->pointcache->flag & PTCACHE_DISK_CACHE)==0) return; - BKE_ptache_free_mem(psys->pointcache); + BKE_ptcache_free_mem(&psys->pointcache->mem_cache); } void psys_get_pointcache_start_end(Scene *scene, ParticleSystem *psys, int *sfra, int *efra) { @@ -3747,41 +3753,17 @@ static void psys_update_path_cache(Scene *scene, Object *ob, ParticleSystemModif if((part->type==PART_HAIR || psys->flag&PSYS_KEYED || psys->pointcache->flag & PTCACHE_BAKED) && ( psys_in_edit_mode(scene, psys) || (part->type==PART_HAIR || (part->ren_as == PART_DRAW_PATH && (part->draw_as == PART_DRAW_REND || psys->renderdata))))){ - psys_cache_paths(scene, ob, psys, cfra, 0); + psys_cache_paths(scene, ob, psys, cfra); /* for render, child particle paths are computed on the fly */ if(part->childtype) { - if(((psys->totchild!=0)) || (psys_in_edit_mode(scene, psys) && (pset->flag&PE_SHOW_CHILD))) + if(((psys->totchild!=0)) || (psys_in_edit_mode(scene, psys) && (pset->flag&PE_DRAW_PART))) if(!(psys->part->type == PART_HAIR) || (psys->flag & PSYS_HAIR_DONE)) psys_cache_child_paths(scene, ob, psys, cfra, 0); } } else if(psys->pathcache) - psys_free_path_cache(psys); -} - -/* calculate and store key locations in world coordinates */ -void psys_update_world_cos(Object *ob, ParticleSystem *psys) -{ - ParticleSystemModifierData *psmd= psys_get_modifier(ob, psys); - ParticleData *pa; - ParticleEditKey *key; - int i, k, totpart; - float hairmat[4][4]; - - if(psys==0 || psys->edit==0) - return; - - totpart= psys->totpart; - - for(i=0, pa=psys->particles; idm, psys->part->from, pa, hairmat); - - for(k=0, key=psys->edit->keys[i]; ktotkey; k++, key++) { - VECCOPY(key->world_co,key->co); - Mat4MulVecfl(hairmat, key->world_co); - } - } + psys_free_path_cache(psys, NULL); } static void hair_step(Scene *scene, Object *ob, ParticleSystemModifierData *psmd, ParticleSystem *psys, float cfra) @@ -3808,9 +3790,6 @@ static void hair_step(Scene *scene, Object *ob, ParticleSystemModifierData *psmd psys_init_effectors(scene, ob, part->eff_group, psys); if(psys->effectors.first) precalc_effectors(scene, ob,psys,psmd,cfra); - - if(psys_in_edit_mode(scene, psys)) - psys_update_world_cos(ob, psys); psys_update_path_cache(scene, ob,psmd,psys,cfra); } @@ -4339,7 +4318,7 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle psys_update_path_cache(scene, ob, psmd, psys,(int)cfra); } else if(psys->pathcache) - psys_free_path_cache(psys); + psys_free_path_cache(psys, NULL); /* cleanup */ if(vg_vel) MEM_freeN(vg_vel); @@ -4385,7 +4364,7 @@ static void psys_to_softbody(Scene *scene, Object *ob, ParticleSystem *psys) static int hair_needs_recalc(ParticleSystem *psys) { - if((psys->flag & PSYS_EDITED)==0 && + if((!psys->edit || !psys->edit->edited) && ((psys->flag & PSYS_HAIR_DONE)==0 || psys->recalc & PSYS_RECALC_RESET)) { return 1; } diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 69da8f19d8c..c0223d1690c 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -434,6 +434,8 @@ void BKE_ptcache_id_from_particles(PTCacheID *pid, Object *ob, ParticleSystem *p pid->cache_ptr= &psys->pointcache; pid->ptcaches= &psys->ptcaches; + pid->flag |= PTCACHE_VEL_PER_SEC; + pid->write_elem= ptcache_write_particle; pid->write_stream = NULL; pid->read_stream = NULL; @@ -800,14 +802,16 @@ void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob) } for(psys=ob->particlesystem.first; psys; psys=psys->next) { - pid= MEM_callocN(sizeof(PTCacheID), "PTCacheID"); - BKE_ptcache_id_from_particles(pid, ob, psys); - BLI_addtail(lb, pid); - - if(psys->soft) { + if(psys->part) { pid= MEM_callocN(sizeof(PTCacheID), "PTCacheID"); - BKE_ptcache_id_from_softbody(pid, ob, psys->soft); + BKE_ptcache_id_from_particles(pid, ob, psys); BLI_addtail(lb, pid); + + if(psys->soft) { + pid= MEM_callocN(sizeof(PTCacheID), "PTCacheID"); + BKE_ptcache_id_from_softbody(pid, ob, psys->soft); + BLI_addtail(lb, pid); + } } } @@ -1087,7 +1091,7 @@ static void ptcache_file_init_pointers(PTCacheFile *pf) pf->cur[BPHYS_DATA_BOIDS] = data_types & (1<data.boids : NULL; } -static void ptcache_mem_init_pointers(PTCacheMem *pm) +void BKE_ptcache_mem_init_pointers(PTCacheMem *pm) { int data_types = pm->data_types; int i; @@ -1096,7 +1100,7 @@ static void ptcache_mem_init_pointers(PTCacheMem *pm) pm->cur[i] = data_types & (1<data[i] : NULL; } -static void ptcache_mem_incr_pointers(PTCacheMem *pm) +void BKE_ptcache_mem_incr_pointers(PTCacheMem *pm) { int i; @@ -1249,12 +1253,12 @@ int BKE_ptcache_read_cache(PTCacheID *pid, float cfra, float frs_sec) return 0; if(pm) { - ptcache_mem_init_pointers(pm); + BKE_ptcache_mem_init_pointers(pm); totpoint = pm->totpoint; index = pm->data_types & (1<cur[BPHYS_DATA_INDEX] : &i; } if(pm2) { - ptcache_mem_init_pointers(pm2); + BKE_ptcache_mem_init_pointers(pm2); totpoint2 = pm2->totpoint; index2 = pm2->data_types & (1<cur[BPHYS_DATA_INDEX] : &i; } @@ -1336,7 +1340,7 @@ int BKE_ptcache_read_cache(PTCacheID *pid, float cfra, float frs_sec) } if(pm) { - ptcache_mem_incr_pointers(pm); + BKE_ptcache_mem_incr_pointers(pm); index = pm->data_types & (1<cur[BPHYS_DATA_INDEX] : &i; } } @@ -1387,7 +1391,7 @@ int BKE_ptcache_read_cache(PTCacheID *pid, float cfra, float frs_sec) } if(pm2) { - ptcache_mem_incr_pointers(pm2); + BKE_ptcache_mem_incr_pointers(pm2); index2 = pm2->data_types & (1<cur[BPHYS_DATA_INDEX] : &i; } } @@ -1559,11 +1563,11 @@ int BKE_ptcache_write_cache(PTCacheID *pid, int cfra) pm->data_types = cfra ? pid->data_types : pid->info_types; ptcache_alloc_data(pm); - ptcache_mem_init_pointers(pm); + BKE_ptcache_mem_init_pointers(pm); for(i=0; iwrite_elem && pid->write_elem(i, pid->calldata, pm->cur)) - ptcache_mem_incr_pointers(pm); + BKE_ptcache_mem_incr_pointers(pm); } //ptcache_make_index_array(pm, pid->totpoint(pid->calldata)); @@ -1664,6 +1668,8 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, int cfra) PTCacheMem *pm= pid->cache->mem_cache.first; PTCacheMem *link= NULL; + pm= pid->cache->mem_cache.first; + if(mode == PTCACHE_CLEAR_ALL) { pid->cache->last_exact = 0; for(; pm; pm=pm->next) @@ -1863,7 +1869,7 @@ int BKE_ptcache_object_reset(Scene *scene, Object *ob, int mode) else if(psys->recalc & PSYS_RECALC_REDO || psys->recalc & PSYS_RECALC_CHILD) skip = 1; - if(skip == 0) { + if(skip == 0 && psys->part) { BKE_ptcache_id_from_particles(&pid, ob, psys); reset |= BKE_ptcache_id_reset(scene, &pid, mode); } @@ -1968,9 +1974,9 @@ PointCache *BKE_ptcache_add(ListBase *ptcaches) return cache; } -void BKE_ptache_free_mem(PointCache *cache) +void BKE_ptcache_free_mem(ListBase *mem_cache) { - PTCacheMem *pm = cache->mem_cache.first; + PTCacheMem *pm = mem_cache->first; if(pm) { for(; pm; pm=pm->next) { @@ -1979,22 +1985,25 @@ void BKE_ptache_free_mem(PointCache *cache) MEM_freeN(pm->index_array); } - BLI_freelistN(&cache->mem_cache); + BLI_freelistN(mem_cache); } } void BKE_ptcache_free(PointCache *cache) { - BKE_ptache_free_mem(cache); + BKE_ptcache_free_mem(&cache->mem_cache); + if(cache->edit && cache->free_edit) + cache->free_edit(cache->edit); MEM_freeN(cache); } void BKE_ptcache_free_list(ListBase *ptcaches) { PointCache *cache = ptcaches->first; - for(; cache; cache=cache->next) - BKE_ptache_free_mem(cache); - - BLI_freelistN(ptcaches); + while(cache) { + BLI_remlink(ptcaches, cache); + BKE_ptcache_free(cache); + cache = ptcaches->first; + } } static PointCache *ptcache_copy(PointCache *cache) @@ -2258,7 +2267,7 @@ void BKE_ptcache_disk_to_mem(PTCacheID *pid) pm->frame = cfra; ptcache_alloc_data(pm); - ptcache_mem_init_pointers(pm); + BKE_ptcache_mem_init_pointers(pm); ptcache_file_init_pointers(pf); for(i=0; itotpoint; i++) { @@ -2274,7 +2283,7 @@ void BKE_ptcache_disk_to_mem(PTCacheID *pid) return; } ptcache_copy_data(pf->cur, pm->cur); - ptcache_mem_incr_pointers(pm); + BKE_ptcache_mem_incr_pointers(pm); } //ptcache_make_index_array(pm, pid->totpoint(pid->calldata)); @@ -2305,7 +2314,7 @@ void BKE_ptcache_mem_to_disk(PTCacheID *pid) pf->totpoint = pm->totpoint; pf->type = pid->type; - ptcache_mem_init_pointers(pm); + BKE_ptcache_mem_init_pointers(pm); ptcache_file_init_pointers(pf); if(!ptcache_file_write_header_begin(pf) || !pid->write_header(pf)) { @@ -2325,7 +2334,7 @@ void BKE_ptcache_mem_to_disk(PTCacheID *pid) ptcache_file_close(pf); return; } - ptcache_mem_incr_pointers(pm); + BKE_ptcache_mem_incr_pointers(pm); } ptcache_file_close(pf); diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 63dabf18faa..10f6a8cf47c 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -404,11 +404,13 @@ Scene *add_scene(char *name) sce->unit.scale_length = 1.0f; pset= &sce->toolsettings->particle; - pset->flag= PE_KEEP_LENGTHS|PE_LOCK_FIRST|PE_DEFLECT_EMITTER; + pset->flag= PE_KEEP_LENGTHS|PE_LOCK_FIRST|PE_DEFLECT_EMITTER|PE_AUTO_VELOCITY; pset->emitterdist= 0.25f; pset->totrekey= 5; pset->totaddkey= 5; pset->brushtype= PE_BRUSH_NONE; + pset->draw_step= 2; + pset->fade_frames= 2; for(a=0; abrush[a].strength= 50; pset->brush[a].size= 50; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 9d5ae3062a1..070c873686c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2963,8 +2963,10 @@ static void direct_link_pointcache(FileData *fd, PointCache *cache) else cache->mem_cache.first = cache->mem_cache.last = NULL; - cache->flag &= ~(PTCACHE_SIMULATION_VALID|PTCACHE_BAKE_EDIT_ACTIVE); + cache->flag &= ~PTCACHE_SIMULATION_VALID; cache->simframe= 0; + cache->edit= NULL; + cache->free_edit= NULL; } static void direct_link_pointcache_list(FileData *fd, ListBase *ptcaches, PointCache **ocache) @@ -3137,7 +3139,7 @@ static void direct_link_particlesystems(FileData *fd, ListBase *particles) link_list(fd, &psys->targets); - psys->edit = 0; + psys->edit = NULL; psys->free_edit = NULL; psys->pathcache = 0; psys->childcache = 0; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 26fd0cf6af6..88c6f205d15 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1208,7 +1208,7 @@ static void write_objects(WriteData *wd, ListBase *idbase) writestruct(wd, DATA, "PartDeflect", 1, ob->pd); writestruct(wd, DATA, "SoftBody", 1, ob->soft); - if(ob->soft) writestruct(wd, DATA, "PointCache", 1, ob->soft->pointcache); + if(ob->soft) write_pointcaches(wd, &ob->soft->ptcaches); writestruct(wd, DATA, "BulletSoftBody", 1, ob->bsoft); write_particlesystems(wd, &ob->particlesystem); diff --git a/source/blender/editors/include/ED_particle.h b/source/blender/editors/include/ED_particle.h index 43cb5053f48..dcac51928a3 100644 --- a/source/blender/editors/include/ED_particle.h +++ b/source/blender/editors/include/ED_particle.h @@ -39,18 +39,16 @@ struct rcti; struct wmWindowManager; /* particle edit mode */ -void PE_change_act(void *ob_v, void *act_v); -void PE_change_act_psys(struct Scene *scene, struct Object *ob, struct ParticleSystem *psys); -int PE_can_edit(struct ParticleSystem *psys); +void PE_free_ptcache_edit(struct PTCacheEdit *edit); +int PE_start_edit(struct PTCacheEdit *edit); /* access */ -struct ParticleSystem *PE_get_current(struct Scene *scene, struct Object *ob); -short PE_get_current_num(struct Object *ob); +struct PTCacheEdit *PE_get_current(struct Scene *scene, struct Object *ob); int PE_minmax(struct Scene *scene, float *min, float *max); struct ParticleEditSettings *PE_settings(Scene *scene); /* update calls */ -void PE_hide_keys_time(struct Scene *scene, struct ParticleSystem *psys, float cfra); +void PE_hide_keys_time(struct Scene *scene, struct PTCacheEdit *edit, float cfra); void PE_update_object(struct Scene *scene, struct Object *ob, int useflag); /* selection tools */ diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index 17838d6042c..c3f1637d3af 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -743,78 +743,6 @@ static void edge_drawflags(Mesh *me, EditMesh *em) } } -static int editmesh_pointcache_edit(Scene *scene, Object *ob, int totvert, PTCacheID *pid_p, float mat[][4], int load) -{ - Cloth *cloth; - SoftBody *sb; - ClothModifierData *clmd; - PTCacheID pid, tmpid; - int cfra= (int)scene->r.cfra, found= 0; - - pid.cache= NULL; - - /* check for cloth */ - if(modifiers_isClothEnabled(ob)) { - clmd= (ClothModifierData*)modifiers_findByType(ob, eModifierType_Cloth); - cloth= clmd->clothObject; - - BKE_ptcache_id_from_cloth(&tmpid, ob, clmd); - - /* verify vertex count and baked status */ - if(cloth && (totvert == cloth->numverts)) { - if((tmpid.cache->flag & PTCACHE_BAKED) && (tmpid.cache->flag & PTCACHE_BAKE_EDIT)) { - pid= tmpid; - - if(load && (pid.cache->flag & PTCACHE_BAKE_EDIT_ACTIVE)) - found= 1; - } - } - } - - /* check for softbody */ - if(!found && ob->soft) { - sb= ob->soft; - - BKE_ptcache_id_from_softbody(&tmpid, ob, sb); - - /* verify vertex count and baked status */ - if(sb->bpoint && (totvert == sb->totpoint)) { - if((tmpid.cache->flag & PTCACHE_BAKED) && (tmpid.cache->flag & PTCACHE_BAKE_EDIT)) { - pid= tmpid; - - if(load && (pid.cache->flag & PTCACHE_BAKE_EDIT_ACTIVE)) - found= 1; - } - } - } - - /* if not making editmesh verify editing was active for this point cache */ - if(load) { - if(found) - pid.cache->flag &= ~PTCACHE_BAKE_EDIT_ACTIVE; - else - return 0; - } - - /* check if we have cache for this frame */ - if(pid.cache && BKE_ptcache_id_exist(&pid, cfra)) { - *pid_p = pid; - - if(load) { - Mat4CpyMat4(mat, ob->obmat); - } - else { - pid.cache->editframe= cfra; - pid.cache->flag |= PTCACHE_BAKE_EDIT_ACTIVE; - Mat4Invert(mat, ob->obmat); /* ob->imat is not up to date */ - } - - return 1; - } - - return 0; -} - /* turns Mesh into editmesh */ void make_editMesh(Scene *scene, Object *ob) { @@ -828,11 +756,8 @@ void make_editMesh(Scene *scene, Object *ob) EditFace *efa; EditEdge *eed; EditSelection *ese; - PTCacheID pid; - Cloth *cloth; - SoftBody *sb; - float cacheco[3], cachemat[4][4], *co; - int tot, a, cacheedit= 0, eekadoodle= 0; + float *co; + int tot, a, eekadoodle= 0; if(me->edit_mesh==NULL) me->edit_mesh= MEM_callocN(sizeof(EditMesh), "editmesh"); @@ -867,26 +792,10 @@ void make_editMesh(Scene *scene, Object *ob) CustomData_copy(&me->vdata, &em->vdata, CD_MASK_EDITMESH, CD_CALLOC, 0); mvert= me->mvert; - cacheedit= editmesh_pointcache_edit(scene, ob, tot, &pid, cachemat, 0); - evlist= (EditVert **)MEM_mallocN(tot*sizeof(void *),"evlist"); for(a=0; aclothObject; - VECCOPY(cacheco, cloth->verts[a].x) - } - else if(pid.type == PTCACHE_TYPE_SOFTBODY) { - sb= (SoftBody*)pid.calldata; - VECCOPY(cacheco, sb->bpoint[a].pos) - } - - Mat4MulVecfl(cachemat, cacheco); - co= cacheco; - } - else - co= mvert->co; + co= mvert->co; eve= addvertlist(em, co, NULL); evlist[a]= eve; @@ -1011,11 +920,6 @@ void make_editMesh(Scene *scene, Object *ob) if (EM_get_actFace(em, 0)==NULL) { EM_set_actFace(em, em->faces.first ); /* will use the first face, this is so we alwats have an active face */ } - - /* vertex coordinates change with cache edit, need to recalc */ - if(cacheedit) - recalc_editnormals(em); - } /* makes Mesh out of editmesh */ @@ -1031,12 +935,8 @@ void load_editMesh(Scene *scene, Object *ob) EditFace *efa, *efa_act; EditEdge *eed; EditSelection *ese; - SoftBody *sb; - Cloth *cloth; - ClothModifierData *clmd; - PTCacheID pid; - float *fp, *newkey, *oldkey, nor[3], cacheco[3], cachemat[4][4]; - int i, a, ototvert, cacheedit= 0; + float *fp, *newkey, *oldkey, nor[3]; + int i, a, ototvert; /* this one also tests of edges are not in faces: */ /* eed->f2==0: not in face, f2==1: draw it */ @@ -1090,48 +990,8 @@ void load_editMesh(Scene *scene, Object *ob) eve= em->verts.first; a= 0; - /* check for point cache editing */ - cacheedit= editmesh_pointcache_edit(scene, ob, em->totvert, &pid, cachemat, 1); - while(eve) { - if(cacheedit) { - if(pid.type == PTCACHE_TYPE_CLOTH) { - clmd= (ClothModifierData*)pid.calldata; - cloth= clmd->clothObject; - - /* assign position */ - VECCOPY(cacheco, cloth->verts[a].x) - VECCOPY(cloth->verts[a].x, eve->co); - Mat4MulVecfl(cachemat, cloth->verts[a].x); - - /* find plausible velocity, not physical correct but gives - * nicer results when commented */ - VECSUB(cacheco, cloth->verts[a].x, cacheco); - VecMulf(cacheco, clmd->sim_parms->stepsPerFrame*10.0f); - VECADD(cloth->verts[a].v, cloth->verts[a].v, cacheco); - } - else if(pid.type == PTCACHE_TYPE_SOFTBODY) { - sb= (SoftBody*)pid.calldata; - - /* assign position */ - VECCOPY(cacheco, sb->bpoint[a].pos) - VECCOPY(sb->bpoint[a].pos, eve->co); - Mat4MulVecfl(cachemat, sb->bpoint[a].pos); - - /* changing velocity for softbody doesn't seem to give - * good results? */ -#if 0 - VECSUB(cacheco, sb->bpoint[a].pos, cacheco); - VecMulf(cacheco, sb->minloops*10.0f); - VECADD(sb->bpoint[a].vec, sb->bpoint[a].pos, cacheco); -#endif - } - - if(oldverts) - VECCOPY(mvert->co, oldverts[a].co) - } - else - VECCOPY(mvert->co, eve->co); + VECCOPY(mvert->co, eve->co); mvert->mat_nr= 32767; /* what was this for, halos? */ @@ -1155,10 +1015,6 @@ void load_editMesh(Scene *scene, Object *ob) eve= eve->next; mvert++; } - - /* write changes to cache */ - if(cacheedit) - BKE_ptcache_write_cache(&pid, pid.cache->editframe); /* the edges */ a= 0; diff --git a/source/blender/editors/physics/ed_pointcache.c b/source/blender/editors/physics/ed_pointcache.c index 917e2b40d72..68e0c28e9c1 100644 --- a/source/blender/editors/physics/ed_pointcache.c +++ b/source/blender/editors/physics/ed_pointcache.c @@ -46,6 +46,7 @@ #include "ED_screen.h" #include "ED_physics.h" +#include "ED_particle.h" #include "UI_interface.h" #include "UI_resources.h" @@ -184,8 +185,16 @@ static int ptcache_free_bake_exec(bContext *C, wmOperator *op) { PointerRNA ptr= CTX_data_pointer_get_type(C, "PointCache", &RNA_PointCache); PointCache *cache= ptr.data; - - cache->flag &= ~PTCACHE_BAKED; + + if(cache->edit) { + if(!cache->edit->edited || 1) {// XXX okee("Lose changes done in particle mode?")) { + PE_free_ptcache_edit(cache->edit); + cache->edit = NULL; + cache->flag &= ~PTCACHE_BAKED; + } + } + else + cache->flag &= ~PTCACHE_BAKED; return OPERATOR_FINISHED; } diff --git a/source/blender/editors/physics/editparticle.c b/source/blender/editors/physics/editparticle.c index b92632b45af..dbb11f72890 100644 --- a/source/blender/editors/physics/editparticle.c +++ b/source/blender/editors/physics/editparticle.c @@ -57,7 +57,8 @@ #include "BKE_particle.h" #include "BKE_report.h" #include "BKE_scene.h" -#include "BKE_utildefines.h" +#include "BKE_utildefines.h" +#include "BKE_pointcache.h" #include "BLI_arithb.h" #include "BLI_blenlib.h" @@ -85,11 +86,25 @@ #include "physics_intern.h" -static void PE_create_particle_edit(Scene *scene, Object *ob, ParticleSystem *psys); -static void ParticleUndo_clear(ParticleSystem *psys); +static void PE_create_particle_edit(Scene *scene, Object *ob, PointCache *cache, ParticleSystem *psys); +static void PTCacheUndo_clear(PTCacheEdit *edit); -#define LOOP_PARTICLES(i, pa) for(i=0, pa=psys->particles; iedit)for(k=0, key=psys->edit->keys[i]; ktotkey; k++, key++) +#define KEY_K PTCacheEditKey *key; int k +#define POINT_P PTCacheEditPoint *point; int p +#define LOOP_POINTS for(p=0, point=edit->points; ptotpoint; p++, point++) +#define LOOP_VISIBLE_POINTS for(p=0, point=edit->points; ptotpoint; p++, point++) if(!(point->flag & PEP_HIDE)) +#define LOOP_SELECTED_POINTS for(p=0, point=edit->points; ptotpoint; p++, point++) if(point_is_selected(point)) +#define LOOP_UNSELECTED_POINTS for(p=0, point=edit->points; ptotpoint; p++, point++) if(!point_is_selected(point)) +#define LOOP_EDITED_POINTS for(p=0, point=edit->points; ptotpoint; p++, point++) if(point->flag & PEP_EDIT_RECALC) +#define LOOP_TAGGED_POINTS for(p=0, point=edit->points; ptotpoint; p++, point++) if(point->flag & PEP_TAG) +#define LOOP_KEYS for(k=0, key=point->keys; ktotkey; k++, key++) +#define LOOP_VISIBLE_KEYS for(k=0, key=point->keys; ktotkey; k++, key++) if(!(key->flag & PEK_HIDE)) +#define LOOP_SELECTED_KEYS for(k=0, key=point->keys; ktotkey; k++, key++) if((key->flag & PEK_SELECT) && !(key->flag & PEK_HIDE)) +#define LOOP_TAGGED_KEYS for(k=0, key=point->keys; ktotkey; k++, key++) if(key->flag & PEK_TAG) + +#define LOOP_PARTICLES(i, pa) for(i=0, pa=psys->particles; itotpart; i++, pa++) + +#define KEY_WCO (key->flag & PEK_USE_WCO ? key->world_co : key->co) /**************************** utilities *******************************/ @@ -97,14 +112,14 @@ static int PE_poll(bContext *C) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); - ParticleSystem *psys; + PTCacheEdit *edit; if(!scene || !ob) return 0; - psys= PE_get_current(scene, ob); + edit= PE_get_current(scene, ob); - return (psys && psys->edit && (ob && ob->mode & OB_MODE_PARTICLE_EDIT)); + return (edit && (ob->mode & OB_MODE_PARTICLE_EDIT)); } static int PE_poll_3dview(bContext *C) @@ -113,22 +128,21 @@ static int PE_poll_3dview(bContext *C) CTX_wm_region(C)->regiontype == RGN_TYPE_WINDOW; } -static void PE_free_particle_edit(ParticleSystem *psys) +void PE_free_ptcache_edit(PTCacheEdit *edit) { - ParticleEdit *edit= psys->edit; - int i, totpart= psys->totpart; + POINT_P; if(edit==0) return; - ParticleUndo_clear(psys); + PTCacheUndo_clear(edit); - if(edit->keys) { - for(i=0; ikeys[i]) - MEM_freeN(edit->keys[i]); + if(edit->points) { + LOOP_POINTS { + if(point->keys) + MEM_freeN(point->keys); } - MEM_freeN(edit->keys); + MEM_freeN(edit->points); } if(edit->mirror_cache) @@ -144,19 +158,23 @@ static void PE_free_particle_edit(ParticleSystem *psys) edit->emitter_field= 0; } - MEM_freeN(edit); + psys_free_path_cache(NULL, edit); - psys->edit= NULL; - psys->free_edit= NULL; + MEM_freeN(edit); } /************************************************/ /* Edit Mode Helpers */ /************************************************/ -int PE_can_edit(ParticleSystem *psys) +int PE_start_edit(PTCacheEdit *edit) { - return (psys && psys->edit); + if(edit) { + edit->edited = 1; + return 1; + } + + return 0; } ParticleEditSettings *PE_settings(Scene *scene) @@ -165,73 +183,99 @@ ParticleEditSettings *PE_settings(Scene *scene) } /* always gets atleast the first particlesystem even if PSYS_CURRENT flag is not set */ -ParticleSystem *PE_get_current(Scene *scene, Object *ob) +PTCacheEdit *PE_get_current(Scene *scene, Object *ob) { - ParticleSystem *psys; + ParticleEditSettings *pset= PE_settings(scene); + PTCacheEdit *edit = NULL; + ListBase pidlist; + PTCacheID *pid; + + pset->scene = scene; + pset->object = ob; if(ob==NULL) return NULL; - psys= ob->particlesystem.first; - while(psys) { - if(psys->flag & PSYS_CURRENT) + BKE_ptcache_ids_from_object(&pidlist, ob); + + /* in the case of only one editable thing, set pset->edittype accordingly */ + if(pidlist.first == pidlist.last) { + pid = pidlist.first; + switch(pid->type) { + case PTCACHE_TYPE_PARTICLES: + pset->edittype = PE_TYPE_PARTICLES; + break; + case PTCACHE_TYPE_SOFTBODY: + pset->edittype = PE_TYPE_SOFTBODY; + break; + case PTCACHE_TYPE_CLOTH: + pset->edittype = PE_TYPE_CLOTH; + break; + } + } + + for(pid=pidlist.first; pid; pid=pid->next) { + if(pset->edittype == PE_TYPE_PARTICLES && pid->type == PTCACHE_TYPE_PARTICLES) { + ParticleSystem *psys = pid->calldata; + + if(psys->flag & PSYS_CURRENT) { + if(psys->part && psys->part->type == PART_HAIR) { + if(!psys->edit && psys->flag & PSYS_HAIR_DONE) + PE_create_particle_edit(scene, ob, NULL, psys); + edit = psys->edit; + } + else { + if(pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit) + PE_create_particle_edit(scene, ob, pid->cache, psys); + edit = pid->cache->edit; + } + + break; + } + } + else if(pset->edittype == PE_TYPE_SOFTBODY && pid->type == PTCACHE_TYPE_SOFTBODY) { + if(pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit) + PE_create_particle_edit(scene, ob, pid->cache, NULL); + edit = pid->cache->edit; break; - psys=psys->next; + } + else if(pset->edittype == PE_TYPE_CLOTH && pid->type == PTCACHE_TYPE_CLOTH) { + if(pid->cache->flag & PTCACHE_BAKED && !pid->cache->edit) + PE_create_particle_edit(scene, ob, pid->cache, NULL); + edit = pid->cache->edit; + break; + } } - if(psys==NULL && ob->particlesystem.first) { - psys=ob->particlesystem.first; - psys->flag |= PSYS_CURRENT; - } + if(edit) + edit->pid = *pid; - /* this happens when Blender is started with particle - * edit mode enabled XXX there's a draw error then? */ - if(psys && psys_check_enabled(ob, psys) && (ob == OBACT) && (ob->mode & OB_MODE_PARTICLE_EDIT)) - if(psys->part->type == PART_HAIR && psys->flag & PSYS_EDITED) - if(psys->edit == NULL) - PE_create_particle_edit(scene, ob, psys); + BLI_freelistN(&pidlist); - return psys; + return edit; } -/* returns -1 if no system has PSYS_CURRENT flag */ -short PE_get_current_num(Object *ob) +void PE_hide_keys_time(Scene *scene, PTCacheEdit *edit, float cfra) { - short num=0; - ParticleSystem *psys= ob->particlesystem.first; - - while(psys) { - if(psys->flag & PSYS_CURRENT) - return num; - num++; - psys=psys->next; - } - - return -1; -} - -void PE_hide_keys_time(Scene *scene, ParticleSystem *psys, float cfra) -{ - ParticleData *pa; - ParticleEditKey *key; ParticleEditSettings *pset=PE_settings(scene); - int i, k, totpart= psys->totpart; + POINT_P; KEY_K; - if(pset->draw_timed && pset->selectmode==SCE_SELECT_POINT) { - LOOP_PARTICLES(i, pa) { - LOOP_KEYS(k, key) { - if(fabs(cfra-*key->time) < pset->draw_timed) + + if(pset->flag & PE_FADE_TIME && pset->selectmode==SCE_SELECT_POINT) { + LOOP_POINTS { + LOOP_KEYS { + if(fabs(cfra-*key->time) < pset->fade_frames) key->flag &= ~PEK_HIDE; else { key->flag |= PEK_HIDE; - key->flag &= ~PEK_SELECT; + //key->flag &= ~PEK_SELECT; } } } } else { - LOOP_PARTICLES(i, pa) { - LOOP_KEYS(k, key) { + LOOP_POINTS { + LOOP_KEYS { key->flag &= ~PEK_HIDE; } } @@ -247,7 +291,7 @@ typedef struct PEData { Scene *scene; Object *ob; DerivedMesh *dm; - ParticleSystem *psys; + PTCacheEdit *edit; short *mval; rcti *rect; @@ -276,7 +320,7 @@ static void PE_set_data(bContext *C, PEData *data) data->scene= CTX_data_scene(C); data->ob= CTX_data_active_object(C); - data->psys= PE_get_current(data->scene, data->ob); + data->edit= PE_get_current(data->scene, data->ob); } static void PE_set_view3d_data(bContext *C, PEData *data) @@ -388,121 +432,103 @@ static int key_inside_test(PEData *data, float co[3]) return key_inside_rect(data, co); } -static int particle_is_selected(ParticleSystem *psys, ParticleData *pa) +static int point_is_selected(PTCacheEditPoint *point) { - ParticleEditKey *key; - int sel, i, k; + KEY_K; + int sel; - if(pa->flag & PARS_HIDE) + if(point->flag & PEP_HIDE) return 0; sel= 0; - i= pa - psys->particles; - LOOP_KEYS(k, key) - if(key->flag & PEK_SELECT) - return 1; + LOOP_SELECTED_KEYS { + return 1; + } return 0; } /*************************** iterators *******************************/ -typedef void (*ForParticleFunc)(PEData *data, int pa_index); -typedef void (*ForKeyFunc)(PEData *data, int pa_index, int key_index); -typedef void (*ForKeyMatFunc)(PEData *data, float mat[][4], float imat[][4], int pa_index, int key_index); +typedef void (*ForPointFunc)(PEData *data, int point_index); +typedef void (*ForKeyFunc)(PEData *data, int point_index, int key_index); +typedef void (*ForKeyMatFunc)(PEData *data, float mat[][4], float imat[][4], int point_index, int key_index, PTCacheEditKey *key); static void for_mouse_hit_keys(PEData *data, ForKeyFunc func, int nearest) { - ParticleSystem *psys= data->psys; - ParticleEdit *edit= psys->edit; - ParticleData *pa; - ParticleEditKey *key; ParticleEditSettings *pset= PE_settings(data->scene); - int i, k, totpart, nearest_pa, nearest_key; + PTCacheEdit *edit= data->edit; + POINT_P; KEY_K; + int nearest_point, nearest_key; float dist= data->rad; /* in path select mode we have no keys */ if(pset->selectmode==SCE_SELECT_PATH) return; - totpart= psys->totpart; - nearest_pa= -1; + nearest_point= -1; nearest_key= -1; - LOOP_PARTICLES(i, pa) { - if(pa->flag & PARS_HIDE) continue; - + LOOP_VISIBLE_POINTS { if(pset->selectmode == SCE_SELECT_END) { /* only do end keys */ - key= edit->keys[i] + pa->totkey-1; + key= point->keys + point->totkey-1; if(nearest) { - if(key_inside_circle(data, dist, key->world_co, &dist)) { - nearest_pa= i; - nearest_key= pa->totkey-1; + if(key_inside_circle(data, dist, KEY_WCO, &dist)) { + nearest_point= p; + nearest_key= point->totkey-1; } } - else if(key_inside_test(data, key->world_co)) - func(data, i, pa->totkey-1); + else if(key_inside_test(data, KEY_WCO)) + func(data, p, point->totkey-1); } else { /* do all keys */ - key= edit->keys[i]; - - LOOP_KEYS(k, key) { - if(key->flag & PEK_HIDE) continue; - + LOOP_VISIBLE_KEYS { if(nearest) { - if(key_inside_circle(data, dist, key->world_co, &dist)) { - nearest_pa= i; + if(key_inside_circle(data, dist, KEY_WCO, &dist)) { + nearest_point= p; nearest_key= k; } } - else if(key_inside_test(data, key->world_co)) - func(data, i, k); + else if(key_inside_test(data, KEY_WCO)) + func(data, p, k); } } } /* do nearest only */ - if(nearest && nearest_pa > -1) - func(data, nearest_pa, nearest_key); + if(nearest && nearest_point > -1) + func(data, nearest_point, nearest_key); } -static void foreach_mouse_hit_particle(PEData *data, ForParticleFunc func, int selected) +static void foreach_mouse_hit_point(PEData *data, ForPointFunc func, int selected) { - ParticleSystem *psys= data->psys; - ParticleData *pa; - ParticleEditKey *key; ParticleEditSettings *pset= PE_settings(data->scene); - int i, k, totpart; - - totpart= psys->totpart; + PTCacheEdit *edit= data->edit; + POINT_P; KEY_K; /* all is selected in path mode */ if(pset->selectmode==SCE_SELECT_PATH) selected=0; - LOOP_PARTICLES(i, pa) { - if(pa->flag & PARS_HIDE) continue; - + LOOP_VISIBLE_POINTS { if(pset->selectmode==SCE_SELECT_END) { /* only do end keys */ - key= psys->edit->keys[i] + pa->totkey-1; + key= point->keys + point->totkey - 1; if(selected==0 || key->flag & PEK_SELECT) - if(key_inside_circle(data, data->rad, key->world_co, &data->dist)) - func(data, i); + if(key_inside_circle(data, data->rad, KEY_WCO, &data->dist)) + func(data, p); } else { /* do all keys */ - LOOP_KEYS(k, key) { - if(key->flag & PEK_HIDE) continue; - + LOOP_VISIBLE_KEYS { if(selected==0 || key->flag & PEK_SELECT) { - if(key_inside_circle(data, data->rad, key->world_co, &data->dist)) { - func(data, i); + if(key_inside_circle(data, data->rad, KEY_WCO, &data->dist)) { + func(data, p); break; } } @@ -513,16 +539,15 @@ static void foreach_mouse_hit_particle(PEData *data, ForParticleFunc func, int s static void foreach_mouse_hit_key(PEData *data, ForKeyMatFunc func, int selected) { - ParticleSystem *psys= data->psys; - ParticleData *pa; - ParticleEditKey *key; - ParticleSystemModifierData *psmd=0; + PTCacheEdit *edit = data->edit; + ParticleSystem *psys = edit->psys; + ParticleSystemModifierData *psmd = NULL; ParticleEditSettings *pset= PE_settings(data->scene); - int i, k, totpart; + POINT_P; KEY_K; float mat[4][4], imat[4][4]; - psmd= psys_get_modifier(data->ob,psys); - totpart= psys->totpart; + if(edit->psys) + psmd= psys_get_modifier(data->ob, edit->psys); /* all is selected in path mode */ if(pset->selectmode==SCE_SELECT_PATH) @@ -531,99 +556,77 @@ static void foreach_mouse_hit_key(PEData *data, ForKeyMatFunc func, int selected Mat4One(imat); Mat4One(mat); - LOOP_PARTICLES(i, pa) { - if(pa->flag & PARS_HIDE) continue; - - psys_mat_hair_to_global(data->ob, psmd->dm, psys->part->from, pa, mat); - Mat4Invert(imat,mat); + LOOP_VISIBLE_POINTS { + if(edit->psys) { + psys_mat_hair_to_global(data->ob, psmd->dm, psys->part->from, psys->particles + p, mat); + Mat4Invert(imat,mat); + } if(pset->selectmode==SCE_SELECT_END) { /* only do end keys */ - key= psys->edit->keys[i] + pa->totkey-1; + key= point->keys + point->totkey-1; if(selected==0 || key->flag & PEK_SELECT) - if(key_inside_circle(data, data->rad, key->world_co, &data->dist)) - func(data, mat, imat, i, pa->totkey-1); + if(key_inside_circle(data, data->rad, KEY_WCO, &data->dist)) + func(data, mat, imat, p, point->totkey-1, key); } else { /* do all keys */ - LOOP_KEYS(k, key) { - if(key->flag&PEK_HIDE) continue; - + LOOP_VISIBLE_KEYS { if(selected==0 || key->flag & PEK_SELECT) - if(key_inside_circle(data, data->rad, key->world_co, &data->dist)) - func(data, mat, imat, i, k); + if(key_inside_circle(data, data->rad, KEY_WCO, &data->dist)) + func(data, mat, imat, p, k, key); } } } } -static void foreach_selected_particle(PEData *data, ForParticleFunc func) +static void foreach_selected_point(PEData *data, ForPointFunc func) { - ParticleSystem *psys= data->psys; - ParticleData *pa; - int i, totpart; + PTCacheEdit *edit = data->edit; + POINT_P; - totpart= psys->totpart; - - LOOP_PARTICLES(i, pa) - if(particle_is_selected(psys, pa)) - func(data, i); + LOOP_SELECTED_POINTS { + func(data, p); + } } static void foreach_selected_key(PEData *data, ForKeyFunc func) { - ParticleSystem *psys= data->psys; - ParticleData *pa; - ParticleEditKey *key; - int i, k, totpart; + PTCacheEdit *edit = data->edit; + POINT_P; KEY_K; - totpart= psys->totpart; - - LOOP_PARTICLES(i, pa) { - if(pa->flag & PARS_HIDE) continue; - - key= psys->edit->keys[i]; - - LOOP_KEYS(k, key) - if(key->flag & PEK_SELECT) - func(data, i, k); + LOOP_VISIBLE_POINTS { + LOOP_SELECTED_KEYS { + func(data, p, k); + } } } -void PE_foreach_particle(PEData *data, ForParticleFunc func) +static void foreach_point(PEData *data, ForPointFunc func) { - ParticleSystem *psys= data->psys; - int i, totpart; + PTCacheEdit *edit = data->edit; + POINT_P; - totpart= psys->totpart; - - for(i=0; itotpart; - - LOOP_PARTICLES(i, pa) { - if(pa->flag & PARS_HIDE) continue; - - key= psys->edit->keys[i]; + POINT_P; KEY_K; + int sel= 0; + LOOP_VISIBLE_POINTS { if(pset->selectmode==SCE_SELECT_POINT) { - for(k=0; ktotkey; k++,key++) - if(key->flag & PEK_SELECT) - sel++; + LOOP_SELECTED_KEYS { + sel++; + } } else if(pset->selectmode==SCE_SELECT_END) { - key += pa->totkey-1; - + key = point->keys + point->totkey - 1; if(key->flag & PEK_SELECT) sel++; } @@ -638,7 +641,7 @@ static int count_selected_keys(Scene *scene, ParticleSystem *psys) static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys) { - ParticleEdit *edit; + PTCacheEdit *edit; ParticleData *pa; ParticleSystemModifierData *psmd; KDTree *tree; @@ -696,8 +699,9 @@ static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys) static void PE_mirror_particle(Object *ob, DerivedMesh *dm, ParticleSystem *psys, ParticleData *pa, ParticleData *mpa) { HairKey *hkey, *mhkey; - ParticleEditKey *key, *mkey; - ParticleEdit *edit; + PTCacheEditPoint *point, *mpoint; + PTCacheEditKey *key, *mkey; + PTCacheEdit *edit; float mat[4][4], mmat[4][4], immat[4][4]; int i, mi, k; @@ -717,17 +721,20 @@ static void PE_mirror_particle(Object *ob, DerivedMesh *dm, ParticleSystem *psys else mi= mpa - psys->particles; + point = edit->points + i; + mpoint = edit->points + mi; + /* make sure they have the same amount of keys */ if(pa->totkey != mpa->totkey) { if(mpa->hair) MEM_freeN(mpa->hair); - if(edit->keys[mi]) MEM_freeN(edit->keys[mi]); + if(mpoint->keys) MEM_freeN(mpoint->keys); mpa->hair= MEM_dupallocN(pa->hair); - edit->keys[mi]= MEM_dupallocN(edit->keys[i]); - mpa->totkey= pa->totkey; + mpoint->keys= MEM_dupallocN(point->keys); + mpoint->totkey= point->totkey; mhkey= mpa->hair; - mkey= edit->keys[mi]; + mkey= mpoint->keys; for(k=0; ktotkey; k++, mkey++, mhkey++) { mkey->co= mhkey->co; mkey->time= &mhkey->time; @@ -742,8 +749,8 @@ static void PE_mirror_particle(Object *ob, DerivedMesh *dm, ParticleSystem *psys hkey=pa->hair; mhkey=mpa->hair; - key= edit->keys[i]; - mkey= edit->keys[mi]; + key= point->keys; + mkey= mpoint->keys; for(k=0; ktotkey; k++, hkey++, mhkey++, key++, mkey++) { VECCOPY(mhkey->co, hkey->co); Mat4MulVecfl(mat, mhkey->co); @@ -754,199 +761,172 @@ static void PE_mirror_particle(Object *ob, DerivedMesh *dm, ParticleSystem *psys mkey->flag |= PEK_TAG; } - if(pa->flag & PARS_TAG) - mpa->flag |= PARS_TAG; - if(pa->flag & PARS_EDIT_RECALC) - mpa->flag |= PARS_EDIT_RECALC; + if(point->flag & PEP_TAG) + mpoint->flag |= PEP_TAG; + if(point->flag & PEP_EDIT_RECALC) + mpoint->flag |= PEP_EDIT_RECALC; } static void PE_apply_mirror(Object *ob, ParticleSystem *psys) { - ParticleEdit *edit; - ParticleData *pa; + PTCacheEdit *edit; ParticleSystemModifierData *psmd; - int i, totpart; + POINT_P; + + if(!psys) + return; edit= psys->edit; psmd= psys_get_modifier(ob, psys); - totpart= psys->totpart; /* we delay settings the PARS_EDIT_RECALC for mirrored particles * to avoid doing mirror twice */ - LOOP_PARTICLES(i, pa) { - if(pa->flag & PARS_EDIT_RECALC) { - PE_mirror_particle(ob, psmd->dm, psys, pa, NULL); + LOOP_POINTS { + if(point->flag & PEP_EDIT_RECALC) { + PE_mirror_particle(ob, psmd->dm, psys, psys->particles + p, NULL); - if(edit->mirror_cache[i] != -1) - psys->particles[edit->mirror_cache[i]].flag &= ~PARS_EDIT_RECALC; + if(edit->mirror_cache[p] != -1) + edit->points[edit->mirror_cache[p]].flag &= ~PEP_EDIT_RECALC; } } - LOOP_PARTICLES(i, pa) - if(pa->flag & PARS_EDIT_RECALC) - if(edit->mirror_cache[i] != -1) - psys->particles[edit->mirror_cache[i]].flag |= PARS_EDIT_RECALC; - - edit->totkeys= psys_count_keys(psys); + LOOP_POINTS { + if(point->flag & PEP_EDIT_RECALC) + if(edit->mirror_cache[p] != -1) + edit->points[edit->mirror_cache[p]].flag |= PEP_EDIT_RECALC; + } } /************************************************/ /* Edit Calculation */ /************************************************/ /* tries to stop edited particles from going through the emitter's surface */ -static void pe_deflect_emitter(Scene *scene, Object *ob, ParticleSystem *psys) +static void pe_deflect_emitter(Scene *scene, Object *ob, PTCacheEdit *edit) { - ParticleEdit *edit; - ParticleData *pa; - ParticleEditKey *key; ParticleEditSettings *pset= PE_settings(scene); - ParticleSystemModifierData *psmd= psys_get_modifier(ob,psys); - int i, k, totpart,index; + ParticleSystem *psys; + ParticleSystemModifierData *psmd; + POINT_P; KEY_K; + int index; float *vec, *nor, dvec[3], dot, dist_1st; float hairimat[4][4], hairmat[4][4]; - if(psys==0) + if(edit==NULL || edit->psys==NULL || (pset->flag & PE_DEFLECT_EMITTER)==0) return; - if((pset->flag & PE_DEFLECT_EMITTER)==0) - return; + psys = edit->psys; + psmd = psys_get_modifier(ob,psys); - edit= psys->edit; - totpart= psys->totpart; - - LOOP_PARTICLES(i, pa) { - if(!(pa->flag & PARS_EDIT_RECALC)) - continue; - - psys_mat_hair_to_object(ob, psmd->dm, psys->part->from, pa, hairmat); - - LOOP_KEYS(k, key) { + LOOP_EDITED_POINTS { + psys_mat_hair_to_object(ob, psmd->dm, psys->part->from, psys->particles + p, hairmat); + + LOOP_KEYS { Mat4MulVecfl(hairmat, key->co); } - //} - //LOOP_PARTICLES(i, pa) { - key=psys->edit->keys[i]+1; + LOOP_KEYS { + if(k==0) { + dist_1st = VecLenf((key+1)->co, key->co); + dist_1st *= 0.75f * pset->emitterdist; + } + else { + index= BLI_kdtree_find_nearest(edit->emitter_field,key->co,NULL,NULL); + + vec=edit->emitter_cosnos +index*6; + nor=vec+3; - dist_1st=VecLenf((key-1)->co,key->co); - dist_1st*=0.75f*pset->emitterdist; + VecSubf(dvec, key->co, vec); - for(k=1; ktotkey; k++, key++) { - index= BLI_kdtree_find_nearest(edit->emitter_field,key->co,NULL,NULL); - - vec=edit->emitter_cosnos +index*6; - nor=vec+3; + dot=Inpf(dvec,nor); + VECCOPY(dvec,nor); - VecSubf(dvec, key->co, vec); - - dot=Inpf(dvec,nor); - VECCOPY(dvec,nor); - - if(dot>0.0f) { - if(dot0.0f) { + if(dotco,key->co,dvec); + } + } + else { Normalize(dvec); VecMulf(dvec,dist_1st-dot); VecAddf(key->co,key->co,dvec); } + if(k==1) + dist_1st*=1.3333f; } - else { - Normalize(dvec); - VecMulf(dvec,dist_1st-dot); - VecAddf(key->co,key->co,dvec); - } - if(k==1) - dist_1st*=1.3333f; } - //} - - //LOOP_PARTICLES(i, pa) { Mat4Invert(hairimat,hairmat); - LOOP_KEYS(k, key) { + LOOP_KEYS { Mat4MulVecfl(hairimat, key->co); } } } /* force set distances between neighbouring keys */ -void PE_apply_lengths(Scene *scene, ParticleSystem *psys) +void PE_apply_lengths(Scene *scene, PTCacheEdit *edit) { - ParticleEdit *edit; - ParticleData *pa; - ParticleEditKey *key; + ParticleEditSettings *pset=PE_settings(scene); - int i, k, totpart; + POINT_P; KEY_K; float dv1[3]; - if(psys==0) + if(edit==0 || (pset->flag & PE_KEEP_LENGTHS)==0) return; - if((pset->flag & PE_KEEP_LENGTHS)==0) - return; - - edit= psys->edit; - totpart= psys->totpart; - - LOOP_PARTICLES(i, pa) { - if(!(pa->flag & PARS_EDIT_RECALC)) - continue; - - for(k=1, key=edit->keys[i] + 1; ktotkey; k++, key++) { - VecSubf(dv1, key->co, (key - 1)->co); - Normalize(dv1); - VecMulf(dv1, (key - 1)->length); - VecAddf(key->co, (key - 1)->co, dv1); + LOOP_EDITED_POINTS { + LOOP_KEYS { + if(k) { + VecSubf(dv1, key->co, (key - 1)->co); + Normalize(dv1); + VecMulf(dv1, (key - 1)->length); + VecAddf(key->co, (key - 1)->co, dv1); + } } } } /* try to find a nice solution to keep distances between neighbouring keys */ -static void pe_iterate_lengths(Scene *scene, ParticleSystem *psys) +static void pe_iterate_lengths(Scene *scene, PTCacheEdit *edit) { - ParticleEdit *edit; - ParticleData *pa; - ParticleEditKey *key; ParticleEditSettings *pset=PE_settings(scene); - int i, j, k, totpart; + POINT_P; + PTCacheEditKey *key; + int j, k; float tlen; float dv0[3]= {0.0f, 0.0f, 0.0f}; float dv1[3]= {0.0f, 0.0f, 0.0f}; float dv2[3]= {0.0f, 0.0f, 0.0f}; - if(psys==0) + if(edit==0) return; if((pset->flag & PE_KEEP_LENGTHS)==0) return; - edit= psys->edit; - totpart= psys->totpart; - - LOOP_PARTICLES(i, pa) { - if(!(pa->flag & PARS_EDIT_RECALC)) - continue; - - for(j=1; jtotkey; j++) { - float mul= 1.0f / (float)pa->totkey; + LOOP_EDITED_POINTS { + for(j=1; jtotkey; j++) { + float mul= 1.0f / (float)point->totkey; if(pset->flag & PE_LOCK_FIRST) { - key= edit->keys[i] + 1; + key= point->keys + 1; k= 1; dv1[0]= dv1[1]= dv1[2]= 0.0; } else { - key= edit->keys[i]; + key= point->keys; k= 0; dv0[0]= dv0[1]= dv0[2]= 0.0; } - for(; ktotkey; k++, key++) { + for(; ktotkey; k++, key++) { if(k) { VecSubf(dv0, (key - 1)->co, key->co); tlen= Normalize(dv0); VecMulf(dv0, (mul * (tlen - (key - 1)->length))); } - if(k < pa->totkey - 1) { + if(k < point->totkey - 1) { VecSubf(dv2, (key + 1)->co, key->co); tlen= Normalize(dv2); VecMulf(dv2, mul * (tlen - key->length)); @@ -962,20 +942,16 @@ static void pe_iterate_lengths(Scene *scene, ParticleSystem *psys) } } /* set current distances to be kept between neighbouting keys */ -static void recalc_lengths(ParticleSystem *psys) +static void recalc_lengths(PTCacheEdit *edit) { - ParticleData *pa; - ParticleEditKey *key; - int i, k, totpart; + POINT_P; KEY_K; - if(psys==0) + if(edit==0) return; - totpart= psys->totpart; - - LOOP_PARTICLES(i, pa) { - key= psys->edit->keys[i]; - for(k=0; ktotkey-1; k++, key++) { + LOOP_EDITED_POINTS { + key= point->keys; + for(k=0; ktotkey-1; k++, key++) { key->length= VecLenf(key->co, (key + 1)->co); } } @@ -985,7 +961,7 @@ static void recalc_lengths(ParticleSystem *psys) static void recalc_emitter_field(Object *ob, ParticleSystem *psys) { DerivedMesh *dm=psys_get_modifier(ob,psys)->dm; - ParticleEdit *edit= psys->edit; + PTCacheEdit *edit= psys->edit; MFace *mface; MVert *mvert; float *vec, *nor; @@ -1042,74 +1018,145 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys) static void PE_update_selection(Scene *scene, Object *ob, int useflag) { - ParticleSystem *psys= PE_get_current(scene, ob); - ParticleEdit *edit= psys->edit; ParticleEditSettings *pset= PE_settings(scene); - ParticleSettings *part= psys->part; - ParticleData *pa; + PTCacheEdit *edit= PE_get_current(scene, ob); HairKey *hkey; - ParticleEditKey *key; - float cfra= CFRA; - int i, k, totpart; - - totpart= psys->totpart; + POINT_P; KEY_K; /* flag all particles to be updated if not using flag */ if(!useflag) - LOOP_PARTICLES(i, pa) - pa->flag |= PARS_EDIT_RECALC; + LOOP_POINTS + point->flag |= PEP_EDIT_RECALC; /* flush edit key flag to hair key flag to preserve selection * on save */ - LOOP_PARTICLES(i, pa) { - key= edit->keys[i]; - - for(k=0, hkey=pa->hair; ktotkey; k++, hkey++, key++) + if(edit->psys) LOOP_POINTS { + hkey = edit->psys->particles[p].hair; + LOOP_KEYS { hkey->editflag= key->flag; + hkey++; + } } - psys_cache_paths(scene, ob, psys, CFRA, 1); + psys_cache_edit_paths(scene, ob, edit, CFRA); - if(part->childtype && (pset->flag & PE_SHOW_CHILD)) - psys_cache_child_paths(scene, ob, psys, cfra, 1); /* disable update flag */ - LOOP_PARTICLES(i, pa) - pa->flag &= ~PARS_EDIT_RECALC; + LOOP_POINTS + point->flag &= ~PEP_EDIT_RECALC; } +static void update_world_cos(Object *ob, PTCacheEdit *edit) +{ + ParticleSystem *psys = edit->psys; + ParticleSystemModifierData *psmd= psys_get_modifier(ob, psys); + POINT_P; KEY_K; + float hairmat[4][4]; + + if(psys==0 || psys->edit==0) + return; + + LOOP_POINTS { + psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles+p, hairmat); + + LOOP_KEYS { + VECCOPY(key->world_co,key->co); + Mat4MulVecfl(hairmat, key->world_co); + } + } +} +static void update_velocities(Object *ob, PTCacheEdit *edit) +{ + /*TODO: get frs_sec properly */ + float vec1[3], vec2[3], frs_sec, dfra; + POINT_P; KEY_K; + + /* hair doesn't use velocities */ + if(edit->psys || !edit->points || !edit->points->keys->vel) + return; + + frs_sec = edit->pid.flag & PTCACHE_VEL_PER_SEC ? 25.0f : 1.0f; + + LOOP_EDITED_POINTS { + LOOP_KEYS { + if(k==0) { + dfra = *(key+1)->time - *key->time; + + if(dfra <= 0.0f) + continue; + + VECSUB(key->vel, (key+1)->co, key->co); + + if(point->totkey>2) { + VECSUB(vec1, (key+1)->co, (key+2)->co); + Projf(vec2, vec1, key->vel); + VECSUB(vec2, vec1, vec2); + VECADDFAC(key->vel, key->vel, vec2, 0.5f); + } + } + else if(k==point->totkey-1) { + dfra = *key->time - *(key-1)->time; + + if(dfra <= 0.0f) + continue; + + VECSUB(key->vel, key->co, (key-1)->co); + + if(point->totkey>2) { + VECSUB(vec1, (key-2)->co, (key-1)->co); + Projf(vec2, vec1, key->vel); + VECSUB(vec2, vec1, vec2); + VECADDFAC(key->vel, key->vel, vec2, 0.5f); + } + } + else { + dfra = *(key+1)->time - *(key-1)->time; + + if(dfra <= 0.0f) + continue; + + VECSUB(key->vel, (key+1)->co, (key-1)->co); + } + VecMulf(key->vel, frs_sec/dfra); + } + } +} void PE_update_object(Scene *scene, Object *ob, int useflag) { - ParticleSystem *psys= PE_get_current(scene, ob); ParticleEditSettings *pset= PE_settings(scene); - ParticleSettings *part= psys->part; - ParticleData *pa; - float cfra= CFRA; - int i, totpart= psys->totpart; + PTCacheEdit *edit = PE_get_current(scene, ob); + POINT_P; + + if(!edit) + return; /* flag all particles to be updated if not using flag */ if(!useflag) - LOOP_PARTICLES(i, pa) - pa->flag |= PARS_EDIT_RECALC; + LOOP_POINTS { + point->flag |= PEP_EDIT_RECALC; + } /* do post process on particle edit keys */ - pe_iterate_lengths(scene, psys); - pe_deflect_emitter(scene, ob, psys); - PE_apply_lengths(scene, psys); + pe_iterate_lengths(scene, edit); + pe_deflect_emitter(scene, ob, edit); + PE_apply_lengths(scene, edit); if(pset->flag & PE_X_MIRROR) - PE_apply_mirror(ob,psys); - psys_update_world_cos(ob,psys); - PE_hide_keys_time(scene, psys, cfra); + PE_apply_mirror(ob,edit->psys); + if(edit->psys) + update_world_cos(ob, edit); + if(pset->flag & PE_AUTO_VELOCITY) + update_velocities(ob, edit); + PE_hide_keys_time(scene, edit, CFRA); /* regenerate path caches */ - psys_cache_paths(scene, ob, psys, cfra, 1); - - if(part->childtype && (pset->flag & PE_SHOW_CHILD)) - psys_cache_child_paths(scene, ob, psys, cfra, 1); + psys_cache_edit_paths(scene, ob, edit, CFRA); /* disable update flag */ - LOOP_PARTICLES(i, pa) - pa->flag &= ~PARS_EDIT_RECALC; + LOOP_POINTS { + point->flag &= ~PEP_EDIT_RECALC; + } + + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); } /************************************************/ @@ -1118,48 +1165,44 @@ void PE_update_object(Scene *scene, Object *ob, int useflag) /*-----selection callbacks-----*/ -static void select_key(PEData *data, int pa_index, int key_index) +static void select_key(PEData *data, int point_index, int key_index) { - ParticleSystem *psys= data->psys; - ParticleData *pa= psys->particles + pa_index; - ParticleEditKey *key= psys->edit->keys[pa_index] + key_index; + PTCacheEdit *edit = data->edit; + PTCacheEditPoint *point = edit->points + point_index; + PTCacheEditKey *key = point->keys + key_index; if(data->select) key->flag |= PEK_SELECT; else key->flag &= ~PEK_SELECT; - pa->flag |= PARS_EDIT_RECALC; + point->flag |= PEP_EDIT_RECALC; } -static void select_keys(PEData *data, int pa_index, int key_index) +static void select_keys(PEData *data, int point_index, int key_index) { - ParticleSystem *psys= data->psys; - ParticleData *pa= psys->particles + pa_index; - ParticleEditKey *key= psys->edit->keys[pa_index]; - int k; + PTCacheEdit *edit = data->edit; + PTCacheEditPoint *point = edit->points + point_index; + KEY_K; - for(k=0; ktotkey; k++,key++) { + LOOP_KEYS { if(data->select) key->flag |= PEK_SELECT; else key->flag &= ~PEK_SELECT; } - pa->flag |= PARS_EDIT_RECALC; + point->flag |= PEP_EDIT_RECALC; } -static void toggle_key_select(PEData *data, int pa_index, int key_index) +static void toggle_key_select(PEData *data, int point_index, int key_index) { - ParticleSystem *psys= data->psys; - ParticleData *pa= psys->particles + pa_index; + PTCacheEdit *edit = data->edit; + PTCacheEditPoint *point = edit->points + point_index; + PTCacheEditKey *key = point->keys + key_index; - if(psys->edit->keys[pa_index][key_index].flag&PEK_SELECT) - psys->edit->keys[pa_index][key_index].flag &= ~PEK_SELECT; - else - psys->edit->keys[pa_index][key_index].flag |= PEK_SELECT; - - pa->flag |= PARS_EDIT_RECALC; + key->flag ^= PEK_SELECT; + point->flag |= PEP_EDIT_RECALC; } /************************ de select all operator ************************/ @@ -1168,33 +1211,24 @@ static int de_select_all_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); - ParticleSystem *psys= PE_get_current(scene, ob); - ParticleEdit *edit= 0; - ParticleData *pa; - ParticleEditKey *key; - int i, k, totpart, sel= 0; + PTCacheEdit *edit= PE_get_current(scene, ob); + POINT_P; KEY_K; + int sel= 0; - edit= psys->edit; - totpart= psys->totpart; - - LOOP_PARTICLES(i, pa) { - if(pa->flag & PARS_HIDE) continue; - LOOP_KEYS(k, key) { - if(key->flag & PEK_SELECT) { - sel= 1; - key->flag &= ~PEK_SELECT; - pa->flag |= PARS_EDIT_RECALC; - } + LOOP_VISIBLE_POINTS { + LOOP_SELECTED_KEYS { + sel= 1; + key->flag &= ~PEK_SELECT; + point->flag |= PEP_EDIT_RECALC; } } if(sel==0) { - LOOP_PARTICLES(i, pa) { - if(pa->flag & PARS_HIDE) continue; - LOOP_KEYS(k, key) { + LOOP_VISIBLE_POINTS { + LOOP_KEYS { if(!(key->flag & PEK_SELECT)) { key->flag |= PEK_SELECT; - pa->flag |= PARS_EDIT_RECALC; + point->flag |= PEP_EDIT_RECALC; } } } @@ -1227,26 +1261,17 @@ int PE_mouse_particles(bContext *C, short *mval, int extend) PEData data; Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); - ParticleSystem *psys= PE_get_current(scene, ob); - ParticleEdit *edit= 0; - ParticleData *pa; - ParticleEditKey *key; - int i, k, totpart; + PTCacheEdit *edit= PE_get_current(scene, ob); + POINT_P; KEY_K; - if(!PE_can_edit(psys)) + if(!PE_start_edit(edit)) return OPERATOR_CANCELLED; - edit= psys->edit; - totpart= psys->totpart; - if(!extend) { - LOOP_PARTICLES(i, pa) { - if(pa->flag & PARS_HIDE) continue; - LOOP_KEYS(k, key) { - if(key->flag & PEK_SELECT) { - key->flag &= ~PEK_SELECT; - pa->flag |= PARS_EDIT_RECALC; - } + LOOP_VISIBLE_POINTS { + LOOP_SELECTED_KEYS { + key->flag &= ~PEK_SELECT; + point->flag |= PEP_EDIT_RECALC; } } } @@ -1265,11 +1290,9 @@ int PE_mouse_particles(bContext *C, short *mval, int extend) /************************ select first operator ************************/ -static void select_root(PEData *data, int pa_index) +static void select_root(PEData *data, int point_index) { - ParticleSystem *psys= data->psys; - - psys->edit->keys[pa_index]->flag |= PEK_SELECT; + data->edit->points[point_index].keys->flag |= PEK_SELECT; } static int select_first_exec(bContext *C, wmOperator *op) @@ -1277,7 +1300,7 @@ static int select_first_exec(bContext *C, wmOperator *op) PEData data; PE_set_data(C, &data); - PE_foreach_particle(&data, select_root); + foreach_point(&data, select_root); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, data.ob); return OPERATOR_FINISHED; @@ -1299,13 +1322,10 @@ void PARTICLE_OT_select_first(wmOperatorType *ot) /************************ select last operator ************************/ -static void select_tip(PEData *data, int pa_index) +static void select_tip(PEData *data, int point_index) { - ParticleSystem *psys= data->psys; - ParticleData *pa= psys->particles + pa_index; - ParticleEditKey *key= psys->edit->keys[pa_index] + pa->totkey-1; - - key->flag |= PEK_SELECT; + PTCacheEditPoint *point = data->edit->points + point_index; + point->keys[point->totkey - 1].flag |= PEK_SELECT; } static int select_last_exec(bContext *C, wmOperator *op) @@ -1313,7 +1333,7 @@ static int select_last_exec(bContext *C, wmOperator *op) PEData data; PE_set_data(C, &data); - PE_foreach_particle(&data, select_tip); + foreach_point(&data, select_tip); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, data.ob); return OPERATOR_FINISHED; @@ -1396,10 +1416,10 @@ int PE_border_select(bContext *C, rcti *rect, int select) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); - ParticleSystem *psys= PE_get_current(scene, ob); + PTCacheEdit *edit= PE_get_current(scene, ob); PEData data; - if(!PE_can_edit(psys)) + if(!PE_start_edit(edit)) return OPERATOR_CANCELLED; PE_set_view3d_data(C, &data); @@ -1420,10 +1440,10 @@ int PE_circle_select(bContext *C, int selecting, short *mval, float rad) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); - ParticleSystem *psys= PE_get_current(scene, ob); + PTCacheEdit *edit= PE_get_current(scene, ob); PEData data; - if(!PE_can_edit(psys)) + if(!PE_start_edit(edit)) return OPERATOR_FINISHED; PE_set_view3d_data(C, &data); @@ -1446,47 +1466,42 @@ int PE_lasso_select(bContext *C, short mcords[][2], short moves, short select) Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); ARegion *ar= CTX_wm_region(C); - ParticleSystem *psys= PE_get_current(scene, ob); - ParticleSystemModifierData *psmd; - ParticleEdit *edit; - ParticleData *pa; - ParticleEditKey *key; ParticleEditSettings *pset= PE_settings(scene); + PTCacheEdit *edit = PE_get_current(scene, ob); + ParticleSystem *psys = edit->psys; + ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys); + POINT_P; KEY_K; float co[3], mat[4][4]; short vertco[2]; - int i, k, totpart; - if(!PE_can_edit(psys)) + if(!PE_start_edit(edit)) return OPERATOR_CANCELLED; - psmd= psys_get_modifier(ob, psys); - edit= psys->edit; - totpart= psys->totpart; + Mat4One(mat); - LOOP_PARTICLES(i, pa) { - if(pa->flag & PARS_HIDE) continue; - - psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, mat); + LOOP_VISIBLE_POINTS { + if(edit->psys) + psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles + p, mat); if(pset->selectmode==SCE_SELECT_POINT) { - LOOP_KEYS(k, key) { + LOOP_KEYS { VECCOPY(co, key->co); Mat4MulVecfl(mat, co); project_short(ar, co, vertco); if((vertco[0] != IS_CLIPPED) && lasso_inside(mcords,moves,vertco[0],vertco[1])) { if(select && !(key->flag & PEK_SELECT)) { key->flag |= PEK_SELECT; - pa->flag |= PARS_EDIT_RECALC; + point->flag |= PEP_EDIT_RECALC; } else if(key->flag & PEK_SELECT) { key->flag &= ~PEK_SELECT; - pa->flag |= PARS_EDIT_RECALC; + point->flag |= PEP_EDIT_RECALC; } } } } else if(pset->selectmode==SCE_SELECT_END) { - key= edit->keys[i] + pa->totkey - 1; + key= point->keys + point->totkey - 1; VECCOPY(co, key->co); Mat4MulVecfl(mat, co); @@ -1494,11 +1509,11 @@ int PE_lasso_select(bContext *C, short mcords[][2], short moves, short select) if((vertco[0] != IS_CLIPPED) && lasso_inside(mcords,moves,vertco[0],vertco[1])) { if(select && !(key->flag & PEK_SELECT)) { key->flag |= PEK_SELECT; - pa->flag |= PARS_EDIT_RECALC; + point->flag |= PEP_EDIT_RECALC; } else if(key->flag & PEK_SELECT) { key->flag &= ~PEK_SELECT; - pa->flag |= PARS_EDIT_RECALC; + point->flag |= PEP_EDIT_RECALC; } } } @@ -1516,35 +1531,25 @@ static int hide_exec(bContext *C, wmOperator *op) { Object *ob= CTX_data_active_object(C); Scene *scene= CTX_data_scene(C); - ParticleSystem *psys= PE_get_current(scene, ob); - ParticleEdit *edit; - ParticleEditKey *key; - ParticleData *pa; - int i, k, totpart; - - edit= psys->edit; - totpart= psys->totpart; + PTCacheEdit *edit= PE_get_current(scene, ob); + POINT_P; KEY_K; if(RNA_enum_get(op->ptr, "unselected")) { - LOOP_PARTICLES(i, pa) { - if(!particle_is_selected(psys, pa)) { - pa->flag |= PARS_HIDE; - pa->flag |= PARS_EDIT_RECALC; + LOOP_UNSELECTED_POINTS { + point->flag |= PEP_HIDE; + point->flag |= PEP_EDIT_RECALC; - LOOP_KEYS(k, key) - key->flag &= ~PEK_SELECT; - } + LOOP_KEYS + key->flag &= ~PEK_SELECT; } } else { - LOOP_PARTICLES(i, pa) { - if(particle_is_selected(psys, pa)) { - pa->flag |= PARS_HIDE; - pa->flag |= PARS_EDIT_RECALC; + LOOP_SELECTED_POINTS { + point->flag |= PEP_HIDE; + point->flag |= PEP_EDIT_RECALC; - LOOP_KEYS(k, key) - key->flag &= ~PEK_SELECT; - } + LOOP_KEYS + key->flag &= ~PEK_SELECT; } } @@ -1577,21 +1582,15 @@ static int reveal_exec(bContext *C, wmOperator *op) { Object *ob= CTX_data_active_object(C); Scene *scene= CTX_data_scene(C); - ParticleSystem *psys= PE_get_current(scene, ob); - ParticleEdit *edit; - ParticleEditKey *key; - ParticleData *pa; - int i, k, totpart; + PTCacheEdit *edit= PE_get_current(scene, ob); + POINT_P; KEY_K; - edit= psys->edit; - totpart= psys->totpart; + LOOP_POINTS { + if(point->flag & PEP_HIDE) { + point->flag &= ~PEP_HIDE; + point->flag |= PEP_EDIT_RECALC; - LOOP_PARTICLES(i, pa) { - if(pa->flag & PARS_HIDE) { - pa->flag &= ~PARS_HIDE; - pa->flag |= PARS_EDIT_RECALC; - - LOOP_KEYS(k, key) + LOOP_KEYS key->flag |= PEK_SELECT; } } @@ -1618,34 +1617,30 @@ void PARTICLE_OT_reveal(wmOperatorType *ot) /************************ select less operator ************************/ -static void select_less_keys(PEData *data, int pa_index) +static void select_less_keys(PEData *data, int point_index) { - ParticleSystem *psys= data->psys; - ParticleEdit *edit= psys->edit; - ParticleData *pa= &psys->particles[pa_index]; - ParticleEditKey *key; - int k; - - for(k=0,key=edit->keys[pa_index]; ktotkey; k++,key++) { - if((key->flag & PEK_SELECT)==0) continue; + PTCacheEdit *edit= data->edit; + PTCacheEditPoint *point = edit->points + point_index; + KEY_K; + LOOP_SELECTED_KEYS { if(k==0) { if(((key+1)->flag&PEK_SELECT)==0) - key->flag |= PEK_TO_SELECT; + key->flag |= PEK_TAG; } - else if(k==pa->totkey-1) { + else if(k==point->totkey-1) { if(((key-1)->flag&PEK_SELECT)==0) - key->flag |= PEK_TO_SELECT; + key->flag |= PEK_TAG; } else { if((((key-1)->flag & (key+1)->flag) & PEK_SELECT)==0) - key->flag |= PEK_TO_SELECT; + key->flag |= PEK_TAG; } } - for(k=0,key=edit->keys[pa_index]; ktotkey; k++,key++) { - if(key->flag&PEK_TO_SELECT) - key->flag &= ~(PEK_TO_SELECT|PEK_SELECT); + LOOP_KEYS { + if(key->flag&PEK_TAG) + key->flag &= ~(PEK_TAG|PEK_SELECT); } } @@ -1654,7 +1649,7 @@ static int select_less_exec(bContext *C, wmOperator *op) PEData data; PE_set_data(C, &data); - PE_foreach_particle(&data, select_less_keys); + foreach_point(&data, select_less_keys); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, data.ob); return OPERATOR_FINISHED; @@ -1676,34 +1671,32 @@ void PARTICLE_OT_select_less(wmOperatorType *ot) /************************ select more operator ************************/ -static void select_more_keys(PEData *data, int pa_index) +static void select_more_keys(PEData *data, int point_index) { - ParticleSystem *psys= data->psys; - ParticleEdit *edit= psys->edit; - ParticleData *pa= &psys->particles[pa_index]; - ParticleEditKey *key; - int k; + PTCacheEdit *edit= data->edit; + PTCacheEditPoint *point = edit->points + point_index; + KEY_K; - for(k=0,key=edit->keys[pa_index]; ktotkey; k++,key++) { + LOOP_KEYS { if(key->flag & PEK_SELECT) continue; if(k==0) { if((key+1)->flag&PEK_SELECT) - key->flag |= PEK_TO_SELECT; + key->flag |= PEK_TAG; } - else if(k==pa->totkey-1) { + else if(k==point->totkey-1) { if((key-1)->flag&PEK_SELECT) - key->flag |= PEK_TO_SELECT; + key->flag |= PEK_TAG; } else { if(((key-1)->flag | (key+1)->flag) & PEK_SELECT) - key->flag |= PEK_TO_SELECT; + key->flag |= PEK_TAG; } } - for(k=0,key=edit->keys[pa_index]; ktotkey; k++,key++) { - if(key->flag&PEK_TO_SELECT) { - key->flag &= ~PEK_TO_SELECT; + LOOP_KEYS { + if(key->flag&PEK_TAG) { + key->flag &= ~PEK_TAG; key->flag |= PEK_SELECT; } } @@ -1714,7 +1707,7 @@ static int select_more_exec(bContext *C, wmOperator *op) PEData data; PE_set_data(C, &data); - PE_foreach_particle(&data, select_more_keys); + foreach_point(&data, select_more_keys); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, data.ob); return OPERATOR_FINISHED; @@ -1738,12 +1731,13 @@ void PARTICLE_OT_select_more(wmOperatorType *ot) static void rekey_particle(PEData *data, int pa_index) { - ParticleSystem *psys= data->psys; - ParticleData *pa= &psys->particles[pa_index]; - ParticleEdit *edit= psys->edit; + PTCacheEdit *edit= data->edit; + ParticleSystem *psys= edit->psys; + ParticleData *pa= psys->particles + pa_index; + PTCacheEditPoint *point = edit->points + pa_index; ParticleKey state; HairKey *key, *new_keys; - ParticleEditKey *ekey; + PTCacheEditKey *ekey; float dval, sta, end; int k; @@ -1772,19 +1766,21 @@ static void rekey_particle(PEData *data, int pa_index) MEM_freeN(pa->hair); pa->hair= new_keys; - pa->totkey=data->totrekey; + point->totkey=pa->totkey=data->totrekey; - if(edit->keys[pa_index]) - MEM_freeN(edit->keys[pa_index]); - ekey= edit->keys[pa_index]= MEM_callocN(pa->totkey * sizeof(ParticleEditKey),"Hair re-key edit keys"); + + if(point->keys) + MEM_freeN(point->keys); + ekey= point->keys= MEM_callocN(pa->totkey * sizeof(PTCacheEditKey),"Hair re-key edit keys"); for(k=0, key=pa->hair; ktotkey; k++, key++, ekey++) { ekey->co= key->co; ekey->time= &key->time; + ekey->flag |= PEK_USE_WCO; } pa->flag &= ~PARS_REKEY; - pa->flag |= PARS_EDIT_RECALC; + point->flag |= PEP_EDIT_RECALC; } static int rekey_exec(bContext *C, wmOperator *op) @@ -1796,11 +1792,9 @@ static int rekey_exec(bContext *C, wmOperator *op) data.dval= 1.0f / (float)(data.totrekey-1); data.totrekey= RNA_int_get(op->ptr, "keys"); - foreach_selected_particle(&data, rekey_particle); - - data.psys->edit->totkeys= psys_count_keys(data.psys); - recalc_lengths(data.psys); + foreach_selected_point(&data, rekey_particle); + recalc_lengths(data.edit); PE_update_object(data.scene, data.ob, 1); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, data.ob); @@ -1827,19 +1821,19 @@ void PARTICLE_OT_rekey(wmOperatorType *ot) static void rekey_particle_to_time(Scene *scene, Object *ob, int pa_index, float path_time) { - ParticleSystem *psys= PE_get_current(scene, ob); - ParticleEdit *edit=0; + PTCacheEdit *edit= PE_get_current(scene, ob); + ParticleSystem *psys; ParticleData *pa; ParticleKey state; HairKey *new_keys, *key; - ParticleEditKey *ekey; + PTCacheEditKey *ekey; int k; - if(psys==0) return; + if(!edit || !edit->psys) return; - edit= psys->edit; + psys = edit->psys; - pa= &psys->particles[pa_index]; + pa= psys->particles + pa_index; pa->flag |= PARS_REKEY; @@ -1858,7 +1852,7 @@ static void rekey_particle_to_time(Scene *scene, Object *ob, int pa_index, float pa->hair= new_keys; /* update edit pointers */ - for(k=0, key=pa->hair, ekey=edit->keys[pa_index]; ktotkey; k++, key++, ekey++) { + for(k=0, key=pa->hair, ekey=edit->points[pa_index].keys; ktotkey; k++, key++, ekey++) { ekey->co= key->co; ekey->time= &key->time; } @@ -1870,10 +1864,11 @@ static void rekey_particle_to_time(Scene *scene, Object *ob, int pa_index, float static int remove_tagged_particles(Scene *scene, Object *ob, ParticleSystem *psys) { - ParticleEdit *edit= psys->edit; + PTCacheEdit *edit = psys->edit; ParticleEditSettings *pset= PE_settings(scene); ParticleData *pa, *npa=0, *new_pars=0; - ParticleEditKey **key, **nkey=0, **new_keys=0; + POINT_P; + PTCacheEditPoint *npoint=0, *new_points=0; ParticleSystemModifierData *psmd; int i, totpart, new_totpart= psys->totpart, removed= 0; @@ -1882,55 +1877,51 @@ static int remove_tagged_particles(Scene *scene, Object *ob, ParticleSystem *psy psmd= psys_get_modifier(ob, psys); totpart= psys->totpart; - LOOP_PARTICLES(i, pa) - if(pa->flag & PARS_TAG) - PE_mirror_particle(ob, psmd->dm, psys, pa, NULL); + LOOP_TAGGED_POINTS { + PE_mirror_particle(ob, psmd->dm, psys, psys->particles + p, NULL); + } } - for(i=0, pa=psys->particles; itotpart; i++, pa++) { - if(pa->flag & PARS_TAG) { - new_totpart--; - removed++; - } + LOOP_TAGGED_POINTS { + new_totpart--; + removed++; } if(new_totpart != psys->totpart) { if(new_totpart) { npa= new_pars= MEM_callocN(new_totpart * sizeof(ParticleData), "ParticleData array"); - nkey= new_keys= MEM_callocN(new_totpart * sizeof(ParticleEditKey *), "ParticleEditKey array"); + npoint= new_points= MEM_callocN(new_totpart * sizeof(PTCacheEditPoint), "PTCacheEditKey array"); } pa= psys->particles; - key= edit->keys; - for(i=0; itotpart; i++, pa++, key++) { - if(pa->flag & PARS_TAG) { - if(*key) - MEM_freeN(*key); + point= edit->points; + for(i=0; itotpart; i++, pa++, point++) { + if(point->flag & PEP_TAG) { + if(point->keys) + MEM_freeN(point->keys); if(pa->hair) MEM_freeN(pa->hair); } else { memcpy(npa, pa, sizeof(ParticleData)); - memcpy(nkey, key, sizeof(ParticleEditKey*)); + memcpy(npoint, point, sizeof(PTCacheEditPoint)); npa++; - nkey++; + npoint++; } } if(psys->particles) MEM_freeN(psys->particles); psys->particles= new_pars; - if(edit->keys) MEM_freeN(edit->keys); - edit->keys= new_keys; + if(edit->points) MEM_freeN(edit->points); + edit->points= new_points; if(edit->mirror_cache) { MEM_freeN(edit->mirror_cache); edit->mirror_cache= NULL; } - psys->totpart= new_totpart; - - edit->totkeys= psys_count_keys(psys); + edit->totpoint= psys->totpart= new_totpart; } return removed; @@ -1938,84 +1929,82 @@ static int remove_tagged_particles(Scene *scene, Object *ob, ParticleSystem *psy static void remove_tagged_keys(Scene *scene, Object *ob, ParticleSystem *psys) { - ParticleEdit *edit= psys->edit; + PTCacheEdit *edit= psys->edit; ParticleEditSettings *pset= PE_settings(scene); ParticleData *pa; - HairKey *key, *nkey, *new_keys=0; - ParticleEditKey *ekey; + HairKey *hkey, *nhkey, *new_hkeys=0; + POINT_P; KEY_K; ParticleSystemModifierData *psmd; - int i, k, totpart= psys->totpart; short new_totkey; if(pset->flag & PE_X_MIRROR) { /* mirror key tags */ psmd= psys_get_modifier(ob, psys); - LOOP_PARTICLES(i, pa) { - LOOP_KEYS(k,ekey) { - if(ekey->flag & PEK_TAG) { - PE_mirror_particle(ob, psmd->dm, psys, pa, NULL); - break; - } + LOOP_POINTS { + LOOP_TAGGED_KEYS { + PE_mirror_particle(ob, psmd->dm, psys, psys->particles + p, NULL); + break; } } } - LOOP_PARTICLES(i, pa) { - new_totkey= pa->totkey; - LOOP_KEYS(k,ekey) { - if(ekey->flag & PEK_TAG) - new_totkey--; + LOOP_POINTS { + new_totkey= point->totkey; + LOOP_TAGGED_KEYS { + new_totkey--; } /* we can't have elements with less than two keys*/ if(new_totkey < 2) - pa->flag |= PARS_TAG; + point->flag |= PEP_TAG; } remove_tagged_particles(scene, ob, psys); - totpart= psys->totpart; - - LOOP_PARTICLES(i, pa) { + LOOP_POINTS { + pa = psys->particles + p; new_totkey= pa->totkey; - LOOP_KEYS(k,ekey) { - if(ekey->flag & PEK_TAG) - new_totkey--; + + LOOP_TAGGED_KEYS { + new_totkey--; } + if(new_totkey != pa->totkey) { - key= pa->hair; - nkey= new_keys= MEM_callocN(new_totkey*sizeof(HairKey), "HairKeys"); + hkey= pa->hair; + nhkey= new_hkeys= MEM_callocN(new_totkey*sizeof(HairKey), "HairKeys"); - for(k=0, ekey=edit->keys[i]; kflag & PEK_TAG && key < pa->hair + pa->totkey) { + LOOP_KEYS { + while(key->flag & PEK_TAG && hkey < pa->hair + pa->totkey) { key++; - ekey++; + hkey++; } - if(key < pa->hair + pa->totkey) { - VECCOPY(nkey->co, key->co); - nkey->time= key->time; - nkey->weight= key->weight; + if(hkey < pa->hair + pa->totkey) { + VECCOPY(nhkey->co, hkey->co); + nhkey->time= hkey->time; + nhkey->weight= hkey->weight; } + hkey++; + nhkey++; } if(pa->hair) MEM_freeN(pa->hair); - pa->hair= new_keys; + pa->hair= new_hkeys; - pa->totkey=new_totkey; + point->totkey= pa->totkey= new_totkey; - if(edit->keys[i]) - MEM_freeN(edit->keys[i]); - ekey= edit->keys[i]= MEM_callocN(new_totkey*sizeof(ParticleEditKey), "particle edit keys"); + if(point->keys) + MEM_freeN(point->keys); + key= point->keys= MEM_callocN(new_totkey*sizeof(PTCacheEditKey), "particle edit keys"); - for(k=0, key=pa->hair; ktotkey; k++, key++, ekey++) { - ekey->co= key->co; - ekey->time= &key->time; + hkey = pa->hair; + LOOP_KEYS { + key->co= hkey->co; + key->time= &hkey->time; + hkey++; } } } - - edit->totkeys= psys_count_keys(psys); } /************************ subdivide opertor *********************/ @@ -2023,19 +2012,19 @@ static void remove_tagged_keys(Scene *scene, Object *ob, ParticleSystem *psys) /* works like normal edit mode subdivide, inserts keys between neighbouring selected keys */ static void subdivide_particle(PEData *data, int pa_index) { - ParticleSystem *psys= data->psys; - ParticleEdit *edit= psys->edit; - ParticleData *pa= &psys->particles[pa_index]; - + PTCacheEdit *edit= data->edit; + ParticleSystem *psys= edit->psys; + ParticleData *pa= psys->particles + pa_index; + PTCacheEditPoint *point = edit->points + pa_index; ParticleKey state; HairKey *key, *nkey, *new_keys; - ParticleEditKey *ekey, *nekey, *new_ekeys; + PTCacheEditKey *ekey, *nekey, *new_ekeys; int k; short totnewkey=0; float endtime; - for(k=0, ekey=edit->keys[pa_index]; ktotkey-1; k++,ekey++) { + for(k=0, ekey=point->keys; ktotkey-1; k++,ekey++) { if(ekey->flag&PEK_SELECT && (ekey+1)->flag&PEK_SELECT) totnewkey++; } @@ -2045,13 +2034,13 @@ static void subdivide_particle(PEData *data, int pa_index) pa->flag |= PARS_REKEY; nkey= new_keys= MEM_callocN((pa->totkey+totnewkey)*(sizeof(HairKey)),"Hair subdivide keys"); - nekey= new_ekeys= MEM_callocN((pa->totkey+totnewkey)*(sizeof(ParticleEditKey)),"Hair subdivide edit keys"); + nekey= new_ekeys= MEM_callocN((pa->totkey+totnewkey)*(sizeof(PTCacheEditKey)),"Hair subdivide edit keys"); endtime= pa->hair[pa->totkey-1].time; - for(k=0, key=pa->hair, ekey=edit->keys[pa_index]; ktotkey-1; k++, key++, ekey++) { + for(k=0, key=pa->hair, ekey=point->keys; ktotkey-1; k++, key++, ekey++) { memcpy(nkey,key,sizeof(HairKey)); - memcpy(nekey,ekey,sizeof(ParticleEditKey)); + memcpy(nekey,ekey,sizeof(PTCacheEditKey)); nekey->co= nkey->co; nekey->time= &nkey->time; @@ -2067,7 +2056,7 @@ static void subdivide_particle(PEData *data, int pa_index) nekey->co= nkey->co; nekey->time= &nkey->time; - nekey->flag |= PEK_SELECT; + nekey->flag |= (PEK_SELECT|PEK_USE_WCO); nekey++; nkey++; @@ -2075,7 +2064,7 @@ static void subdivide_particle(PEData *data, int pa_index) } /*tip still not copied*/ memcpy(nkey,key,sizeof(HairKey)); - memcpy(nekey,ekey,sizeof(ParticleEditKey)); + memcpy(nekey,ekey,sizeof(PTCacheEditKey)); nekey->co= nkey->co; nekey->time= &nkey->time; @@ -2084,13 +2073,12 @@ static void subdivide_particle(PEData *data, int pa_index) MEM_freeN(pa->hair); pa->hair= new_keys; - if(edit->keys[pa_index]) - MEM_freeN(edit->keys[pa_index]); + if(point->keys) + MEM_freeN(point->keys); + point->keys= new_ekeys; - edit->keys[pa_index]= new_ekeys; - - pa->totkey += totnewkey; - pa->flag |= PARS_EDIT_RECALC; + point->totkey = pa->totkey = pa->totkey + totnewkey; + point->flag |= PEP_EDIT_RECALC; pa->flag &= ~PARS_REKEY; } @@ -2099,13 +2087,9 @@ static int subdivide_exec(bContext *C, wmOperator *op) PEData data; PE_set_data(C, &data); - PE_foreach_particle(&data, subdivide_particle); + foreach_point(&data, subdivide_particle); - data.psys->edit->totkeys= psys_count_keys(data.psys); - - recalc_lengths(data.psys); - psys_update_world_cos(data.ob, data.psys); - + recalc_lengths(data.edit); PE_update_object(data.scene, data.ob, 1); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, data.ob); @@ -2132,15 +2116,15 @@ static int remove_doubles_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); - ParticleSystem *psys= PE_get_current(scene, ob); ParticleEditSettings *pset=PE_settings(scene); - ParticleData *pa; - ParticleEdit *edit; + PTCacheEdit *edit= PE_get_current(scene, ob); + ParticleSystem *psys = edit->psys; ParticleSystemModifierData *psmd; KDTree *tree; KDTreeNearest nearest[10]; + POINT_P; float mat[4][4], co[3], threshold= RNA_float_get(op->ptr, "threshold"); - int i, n, totn, removed, totpart, flag, totremoved; + int n, totn, removed, flag, totremoved; edit= psys->edit; psmd= psys_get_modifier(ob, psys); @@ -2149,37 +2133,32 @@ static int remove_doubles_exec(bContext *C, wmOperator *op) do { removed= 0; - totpart= psys->totpart; - tree=BLI_kdtree_new(totpart); + tree=BLI_kdtree_new(psys->totpart); /* insert particles into kd tree */ - LOOP_PARTICLES(i, pa) { - if(particle_is_selected(psys, pa)) { - psys_mat_hair_to_object(ob, psmd->dm, psys->part->from, pa, mat); - VECCOPY(co, pa->hair[0].co); - Mat4MulVecfl(mat, co); - BLI_kdtree_insert(tree, i, co, NULL); - } + LOOP_SELECTED_POINTS { + psys_mat_hair_to_object(ob, psmd->dm, psys->part->from, psys->particles+p, mat); + VECCOPY(co, point->keys->co); + Mat4MulVecfl(mat, co); + BLI_kdtree_insert(tree, p, co, NULL); } BLI_kdtree_balance(tree); /* tag particles to be removed */ - LOOP_PARTICLES(i, pa) { - if(particle_is_selected(psys, pa)) { - psys_mat_hair_to_object(ob, psmd->dm, psys->part->from, pa, mat); - VECCOPY(co, pa->hair[0].co); - Mat4MulVecfl(mat, co); + LOOP_SELECTED_POINTS { + psys_mat_hair_to_object(ob, psmd->dm, psys->part->from, psys->particles+p, mat); + VECCOPY(co, point->keys->co); + Mat4MulVecfl(mat, co); - totn= BLI_kdtree_find_n_nearest(tree,10,co,NULL,nearest); + totn= BLI_kdtree_find_n_nearest(tree,10,co,NULL,nearest); - for(n=0; n i && nearest[n].dist < threshold) { - if(!(pa->flag & PARS_TAG)) { - pa->flag |= PARS_TAG; - removed++; - } + for(n=0; n p && nearest[n].dist < threshold) { + if(!(point->flag & PEP_TAG)) { + point->flag |= PEP_TAG; + removed++; } } } @@ -2200,7 +2179,7 @@ static int remove_doubles_exec(bContext *C, wmOperator *op) BKE_reportf(op->reports, RPT_INFO, "Remove %d double particles.", totremoved); - psys_update_world_cos(ob, psys); + PE_update_object(scene, ob, 0); DAG_object_flush_update(scene, ob, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); @@ -2347,16 +2326,16 @@ static EnumPropertyItem delete_type_items[]= { static void set_delete_particle(PEData *data, int pa_index) { - ParticleSystem *psys= data->psys; + PTCacheEdit *edit= data->edit; - psys->particles[pa_index].flag |= PARS_TAG; + edit->points[pa_index].flag |= PEP_TAG; } static void set_delete_particle_key(PEData *data, int pa_index, int key_index) { - ParticleSystem *psys= data->psys; + PTCacheEdit *edit= data->edit; - psys->edit->keys[pa_index][key_index].flag |= PEK_TAG; + edit->points[pa_index].keys[key_index].flag |= PEK_TAG; } static int delete_exec(bContext *C, wmOperator *op) @@ -2368,15 +2347,17 @@ static int delete_exec(bContext *C, wmOperator *op) if(type == DEL_KEY) { foreach_selected_key(&data, set_delete_particle_key); - remove_tagged_keys(data.scene, data.ob, data.psys); - recalc_lengths(data.psys); + remove_tagged_keys(data.scene, data.ob, data.edit->psys); + recalc_lengths(data.edit); } else if(type == DEL_PARTICLE) { - foreach_selected_particle(&data, set_delete_particle); - remove_tagged_particles(data.scene, data.ob, data.psys); - recalc_lengths(data.psys); + foreach_selected_point(&data, set_delete_particle); + remove_tagged_particles(data.scene, data.ob, data.edit->psys); + recalc_lengths(data.edit); } + PE_update_object(data.scene, data.ob, 0); + DAG_object_flush_update(data.scene, data.ob, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, data.ob); @@ -2407,15 +2388,15 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged) { Mesh *me= (Mesh*)(ob->data); ParticleSystemModifierData *psmd; - ParticleSystem *psys= PE_get_current(scene, ob); - ParticleEdit *edit; + PTCacheEdit *edit= PE_get_current(scene, ob); + ParticleSystem *psys = edit->psys; ParticleData *pa, *newpa, *new_pars; - ParticleEditKey *ekey, **newkey, **key, **new_keys; + PTCacheEditPoint *newpoint, *new_points; + POINT_P; KEY_K; HairKey *hkey; int *mirrorfaces; - int i, k, rotation, totpart, newtotpart; + int rotation, totpart, newtotpart; - edit= psys->edit; psmd= psys_get_modifier(ob, psys); mirrorfaces= mesh_get_x_mirror_faces(ob, NULL); @@ -2425,29 +2406,28 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged) totpart= psys->totpart; newtotpart= psys->totpart; - LOOP_PARTICLES(i, pa) { - if(pa->flag & PARS_HIDE) continue; - + LOOP_VISIBLE_POINTS { + pa = psys->particles + p; if(!tagged) { - if(particle_is_selected(psys, pa)) { - if(edit->mirror_cache[i] != -1) { + if(point_is_selected(point)) { + if(edit->mirror_cache[p] != -1) { /* already has a mirror, don't need to duplicate */ PE_mirror_particle(ob, psmd->dm, psys, pa, NULL); continue; } else - pa->flag |= PARS_TAG; + point->flag |= PEP_TAG; } } - if((pa->flag & PARS_TAG) && mirrorfaces[pa->num*2] != -1) + if((point->flag & PEP_TAG) && mirrorfaces[pa->num*2] != -1) newtotpart++; } if(newtotpart != psys->totpart) { /* allocate new arrays and copy existing */ new_pars= MEM_callocN(newtotpart*sizeof(ParticleData), "ParticleData new"); - new_keys= MEM_callocN(newtotpart*sizeof(ParticleEditKey*), "ParticleEditKey new"); + new_points= MEM_callocN(newtotpart*sizeof(PTCacheEditPoint), "PTCacheEditPoint new"); if(psys->particles) { memcpy(new_pars, psys->particles, totpart*sizeof(ParticleData)); @@ -2455,36 +2435,35 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged) } psys->particles= new_pars; - if(edit->keys) { - memcpy(new_keys, edit->keys, totpart*sizeof(ParticleEditKey*)); - MEM_freeN(edit->keys); + if(edit->points) { + memcpy(new_points, edit->points, totpart*sizeof(PTCacheEditPoint)); + MEM_freeN(edit->points); } - edit->keys= new_keys; + edit->points= new_points; if(edit->mirror_cache) { MEM_freeN(edit->mirror_cache); edit->mirror_cache= NULL; } - psys->totpart= newtotpart; + edit->totpoint= psys->totpart= newtotpart; /* create new elements */ - pa= psys->particles; newpa= psys->particles + totpart; - key= edit->keys; - newkey= edit->keys + totpart; + newpoint= edit->points + totpart; - for(i=0; iflag & PARS_HIDE) continue; + LOOP_VISIBLE_POINTS { + pa = psys->particles + p; - if(!(pa->flag & PARS_TAG) || mirrorfaces[pa->num*2] == -1) + if(!(point->flag & PEP_TAG) || mirrorfaces[pa->num*2] == -1) continue; /* duplicate */ *newpa= *pa; + *newpoint= *point; if(pa->hair) newpa->hair= MEM_dupallocN(pa->hair); if(pa->keys) newpa->keys= MEM_dupallocN(pa->keys); - if(*key) *newkey= MEM_dupallocN(*key); + if(point->keys) newpoint->keys= MEM_dupallocN(point->keys); /* rotate weights according to vertex index rotation */ rotation= mirrorfaces[pa->num*2+1]; @@ -2503,24 +2482,23 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged) newpa->num_dmcache= psys_particle_dm_face_lookup(ob,psmd->dm,newpa->num,newpa->fuv, NULL); /* update edit key pointers */ - ekey= *newkey; - for(k=0, hkey=newpa->hair; ktotkey; k++, hkey++, ekey++) { - ekey->co= hkey->co; - ekey->time= &hkey->time; + key= newpoint->keys; + for(k=0, hkey=newpa->hair; ktotkey; k++, hkey++, key++) { + key->co= hkey->co; + key->time= &hkey->time; } /* map key positions as mirror over x axis */ PE_mirror_particle(ob, psmd->dm, psys, pa, newpa); newpa++; - newkey++; + newpoint++; } - - edit->totkeys= psys_count_keys(psys); } - for(pa=psys->particles, i=0; itotpart; i++, pa++) - pa->flag &= ~PARS_TAG; + LOOP_POINTS { + point->flag &= ~PEP_TAG; + } MEM_freeN(mirrorfaces); } @@ -2529,11 +2507,11 @@ static int mirror_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); - ParticleSystem *psys= PE_get_current(scene, ob); + PTCacheEdit *edit= PE_get_current(scene, ob); PE_mirror_x(scene, ob, 0); - psys_update_world_cos(ob, psys); + update_world_cos(ob, edit); WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); DAG_object_flush_update(scene, ob, OB_RECALC_DATA); @@ -2560,7 +2538,6 @@ static EnumPropertyItem brush_type_items[]= { {PE_BRUSH_NONE, "NONE", 0, "None", ""}, {PE_BRUSH_COMB, "COMB", 0, "Comb", ""}, {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", ""}, - {PE_BRUSH_WEIGHT, "WEIGHT", 0, "Weight", ""}, {PE_BRUSH_ADD, "ADD", 0, "Add", ""}, {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", ""}, {PE_BRUSH_PUFF, "PUFF", 0, "Puff", ""}, @@ -2593,14 +2570,46 @@ void PARTICLE_OT_brush_set(wmOperatorType *ot) RNA_def_enum(ot->srna, "type", brush_type_items, PE_BRUSH_NONE, "Type", "Brush type to select for editing."); } + +/*********************** set mode operator **********************/ + +static EnumPropertyItem edit_type_items[]= { + {PE_TYPE_PARTICLES, "PARTICLES", 0, "Particles", ""}, + {PE_TYPE_SOFTBODY, "SOFTBODY", 0, "Soft body", ""}, + {PE_TYPE_CLOTH, "CLOTH", 0, "Cloth", ""}, + {0, NULL, 0, NULL, NULL} +}; + +static int set_edit_mode_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + ParticleEditSettings *pset= PE_settings(scene); + + pset->edittype= RNA_enum_get(op->ptr, "type"); + + return OPERATOR_FINISHED; +} + +void PARTICLE_OT_edit_type_set(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Set Brush"; + ot->idname= "PARTICLE_OT_edit_type_set"; + + /* api callbacks */ + ot->exec= set_brush_exec; + ot->invoke= WM_menu_invoke; + ot->poll= PE_poll; + + /* properties */ + RNA_def_enum(ot->srna, "type", edit_type_items, PE_TYPE_PARTICLES, "Type", "Edit type to select for editing."); +} + /************************* brush edit callbacks ********************/ -static void brush_comb(PEData *data, float mat[][4], float imat[][4], int pa_index, int key_index) +static void brush_comb(PEData *data, float mat[][4], float imat[][4], int point_index, int key_index, PTCacheEditKey *key) { - ParticleSystem *psys= data->psys; - ParticleData *pa= &psys->particles[pa_index]; ParticleEditSettings *pset= PE_settings(data->scene); - HairKey *key= pa->hair + key_index; float cvec[3], fac; if(pset->flag & PE_LOCK_FIRST && key_index == 0) return; @@ -2612,19 +2621,21 @@ static void brush_comb(PEData *data, float mat[][4], float imat[][4], int pa_ind VecMulf(cvec, fac); VECADD(key->co, key->co, cvec); - pa->flag |= PARS_EDIT_RECALC; + (data->edit->points + point_index)->flag |= PEP_EDIT_RECALC; } static void brush_cut(PEData *data, int pa_index) { - ParticleSystem *psys= data->psys; + PTCacheEdit *edit = data->edit; + ParticleSystem *psys= edit->psys; ARegion *ar= data->vc.ar; Object *ob= data->ob; + ParticleEditSettings *pset= PE_settings(data->scene); ParticleData *pa= &psys->particles[pa_index]; - ParticleCacheKey *key= psys->pathcache[pa_index]; + ParticleCacheKey *key= edit->pathcache[pa_index]; float rad2, cut_time= 1.0; float x0, x1, v0, v1, o0, o1, xo0, xo1, d, dv; - int k, cut, keys= (int)pow(2.0, (double)psys->part->draw_step); + int k, cut, keys= (int)pow(2.0, (double)pset->draw_step); short vertco[2]; /* blunt scissors */ @@ -2699,93 +2710,97 @@ static void brush_cut(PEData *data, int pa_index) if(cut) { if(cut_time < 0.0f) { - pa->flag |= PARS_TAG; + edit->points[pa_index].flag |= PEP_TAG; } else { rekey_particle_to_time(data->scene, ob, pa_index, cut_time); - pa->flag |= PARS_EDIT_RECALC; + edit->points[pa_index].flag |= PEP_EDIT_RECALC; } } } -static void brush_length(PEData *data, int pa_index) +static void brush_length(PEData *data, int point_index) { - ParticleSystem *psys= data->psys; - ParticleData *pa= &psys->particles[pa_index]; - HairKey *key; + PTCacheEdit *edit= data->edit; + PTCacheEditPoint *point = edit->points + point_index; + KEY_K; float dvec[3],pvec[3]; - int k; - key= pa->hair; - VECCOPY(pvec,key->co); - - for(k=1, key++; ktotkey; k++,key++) { - VECSUB(dvec,key->co,pvec); - VECCOPY(pvec,key->co); - VecMulf(dvec,data->growfac); - VECADD(key->co,(key-1)->co,dvec); + LOOP_KEYS { + if(k==0) { + VECCOPY(pvec,key->co); + } + else { + VECSUB(dvec,key->co,pvec); + VECCOPY(pvec,key->co); + VecMulf(dvec,data->growfac); + VECADD(key->co,(key-1)->co,dvec); + } } - pa->flag |= PARS_EDIT_RECALC; + point->flag |= PEP_EDIT_RECALC; } -static void brush_puff(PEData *data, int pa_index) +static void brush_puff(PEData *data, int point_index) { - ParticleSystem *psys= data->psys; - ParticleData *pa= &psys->particles[pa_index]; - ParticleEdit *edit= psys->edit; - HairKey *key; + PTCacheEdit *edit = data->edit; + ParticleSystem *psys = edit->psys; + PTCacheEditPoint *point = edit->points + point_index; + KEY_K; float mat[4][4], imat[4][4]; float lastco[3], rootco[3], co[3], nor[3], kco[3], dco[3], fac, length; - int k; - psys_mat_hair_to_global(data->ob, data->dm, psys->part->from, pa, mat); - Mat4Invert(imat,mat); - - /* find root coordinate and normal on emitter */ - key= pa->hair; - VECCOPY(co, key->co); - Mat4MulVecfl(mat, co); - - pa_index= BLI_kdtree_find_nearest(edit->emitter_field, co, NULL, NULL); - if(pa_index == -1) return; - - VECCOPY(rootco, co); - VecCopyf(nor, &psys->edit->emitter_cosnos[pa_index*6+3]); - Normalize(nor); - length= 0.0f; - - fac= (float)pow((double)(1.0f - data->dist / data->rad), (double)data->pufffac); - fac *= 0.025f; - if(data->invert) - fac= -fac; - - for(k=1, key++; ktotkey; k++, key++) { - /* compute position as if hair was standing up straight */ - VECCOPY(lastco, co); - VECCOPY(co, key->co); - Mat4MulVecfl(mat, co); - length += VecLenf(lastco, co); - - VECADDFAC(kco, rootco, nor, length); - - /* blend between the current and straight position */ - VECSUB(dco, kco, co); - VECADDFAC(co, co, dco, fac); - - VECCOPY(key->co, co); - Mat4MulVecfl(imat, key->co); + if(psys) { + psys_mat_hair_to_global(data->ob, data->dm, psys->part->from, psys->particles + point_index, mat); + Mat4Invert(imat,mat); + } + else { + Mat4One(mat); + Mat4One(imat); } - pa->flag |= PARS_EDIT_RECALC; + LOOP_KEYS { + if(k==0) { + /* find root coordinate and normal on emitter */ + VECCOPY(co, key->co); + Mat4MulVecfl(mat, co); + + point_index= BLI_kdtree_find_nearest(edit->emitter_field, co, NULL, NULL); + if(point_index == -1) return; + + VECCOPY(rootco, co); + VecCopyf(nor, &edit->emitter_cosnos[point_index*6+3]); + Normalize(nor); + length= 0.0f; + + fac= (float)pow((double)(1.0f - data->dist / data->rad), (double)data->pufffac); + fac *= 0.025f; + if(data->invert) + fac= -fac; + } + else { + /* compute position as if hair was standing up straight */ + VECCOPY(lastco, co); + VECCOPY(co, key->co); + Mat4MulVecfl(mat, co); + length += VecLenf(lastco, co); + + VECADDFAC(kco, rootco, nor, length); + + /* blend between the current and straight position */ + VECSUB(dco, kco, co); + VECADDFAC(co, co, dco, fac); + + VECCOPY(key->co, co); + Mat4MulVecfl(imat, key->co); + } + } + + point->flag |= PEP_EDIT_RECALC; } -static void brush_smooth_get(PEData *data, float mat[][4], float imat[][4], int pa_index, int key_index) -{ - ParticleSystem *psys= data->psys; - ParticleData *pa= &psys->particles[pa_index]; - HairKey *key= pa->hair + key_index; - +static void brush_smooth_get(PEData *data, float mat[][4], float imat[][4], int point_index, int key_index, PTCacheEditKey *key) +{ if(key_index) { float dvec[3]; @@ -2796,11 +2811,8 @@ static void brush_smooth_get(PEData *data, float mat[][4], float imat[][4], int } } -static void brush_smooth_do(PEData *data, float mat[][4], float imat[][4], int pa_index, int key_index) +static void brush_smooth_do(PEData *data, float mat[][4], float imat[][4], int point_index, int key_index, PTCacheEditKey *key) { - ParticleSystem *psys= data->psys; - ParticleData *pa= &psys->particles[pa_index]; - HairKey *key= pa->hair + key_index; float vec[3], dvec[3]; if(key_index) { @@ -2815,18 +2827,18 @@ static void brush_smooth_do(PEData *data, float mat[][4], float imat[][4], int p VECADD(key->co,key->co,dvec); } - pa->flag |= PARS_EDIT_RECALC; + (data->edit->points + point_index)->flag |= PEP_EDIT_RECALC; } static void brush_add(PEData *data, short number) { Scene *scene= data->scene; Object *ob= data->ob; - ParticleSystem *psys= data->psys; + PTCacheEdit *edit = data->edit; + ParticleSystem *psys= edit->psys; ParticleData *add_pars= MEM_callocN(number*sizeof(ParticleData),"ParticleData add"); ParticleSystemModifierData *psmd= psys_get_modifier(ob,psys); ParticleEditSettings *pset= PE_settings(scene); - ParticleEdit *edit= psys->edit; int i, k, n= 0, totpart= psys->totpart; short mco[2]; short dmx= 0, dmy= 0; @@ -2873,19 +2885,20 @@ static void brush_add(PEData *data, short number) float hairmat[4][4], cur_co[3]; KDTree *tree=0; ParticleData *pa, *new_pars= MEM_callocN(newtotpart*sizeof(ParticleData),"ParticleData new"); - ParticleEditKey *ekey, **key, **new_keys= MEM_callocN(newtotpart*sizeof(ParticleEditKey *),"ParticleEditKey array new"); + PTCacheEditPoint *point, *new_points= MEM_callocN(newtotpart*sizeof(PTCacheEditPoint),"PTCacheEditPoint array new"); + PTCacheEditKey *key; HairKey *hkey; /* save existing elements */ memcpy(new_pars, psys->particles, totpart * sizeof(ParticleData)); - memcpy(new_keys, edit->keys, totpart * sizeof(ParticleEditKey*)); + memcpy(new_points, edit->points, totpart * sizeof(PTCacheEditPoint)); /* change old arrays to new ones */ if(psys->particles) MEM_freeN(psys->particles); psys->particles= new_pars; - if(edit->keys) MEM_freeN(edit->keys); - edit->keys= new_keys; + if(edit->points) MEM_freeN(edit->points); + edit->points= new_points; if(edit->mirror_cache) { MEM_freeN(edit->mirror_cache); @@ -2904,29 +2917,29 @@ static void brush_add(PEData *data, short number) BLI_kdtree_balance(tree); } - psys->totpart= newtotpart; + edit->totpoint= psys->totpart= newtotpart; /* create new elements */ pa= psys->particles + totpart; - key= edit->keys + totpart; + point= edit->points + totpart; - for(i=totpart; ihair= MEM_callocN(pset->totaddkey * sizeof(HairKey), "BakeKey key add"); - ekey= *key= MEM_callocN(pset->totaddkey * sizeof(ParticleEditKey), "ParticleEditKey add"); - pa->totkey= pset->totaddkey; + key= point->keys= MEM_callocN(pset->totaddkey * sizeof(PTCacheEditKey), "PTCacheEditKey add"); + point->totkey= pa->totkey= pset->totaddkey; - for(k=0, hkey=pa->hair; ktotkey; k++, hkey++, ekey++) { - ekey->co= hkey->co; - ekey->time= &hkey->time; + for(k=0, hkey=pa->hair; ktotkey; k++, hkey++, key++) { + key->co= hkey->co; + key->time= &hkey->time; } pa->size= 1.0f; initialize_particle(pa,i,ob,psys,psmd); reset_particle(scene, pa,psys,psmd,ob,0.0,1.0,0,0,0); - pa->flag |= PARS_EDIT_RECALC; + point->flag |= PEP_EDIT_RECALC; if(pset->flag & PE_X_MIRROR) - pa->flag |= PARS_TAG; /* signal for duplicate */ + point->flag |= PEP_TAG; /* signal for duplicate */ framestep= pa->lifetime/(float)(pset->totaddkey-1); @@ -2997,7 +3010,6 @@ static void brush_add(PEData *data, short number) Mat4MulVecfl(imat, hkey->co); } } - edit->totkeys= psys_count_keys(psys); if(tree) BLI_kdtree_free(tree); @@ -3009,25 +3021,12 @@ static void brush_add(PEData *data, short number) dm->release(dm); } -static void brush_weight(PEData *data, float mat[][4], float imat[][4], int pa_index, int key_index) -{ - ParticleSystem *psys= data->psys; - ParticleData *pa; - - /* roots have full weight allways */ - if(key_index) { - pa= &psys->particles[pa_index]; - pa->hair[key_index].weight= data->weightfac; - pa->flag |= PARS_EDIT_RECALC; - } -} - /************************* brush edit operator ********************/ typedef struct BrushEdit { Scene *scene; Object *ob; - ParticleSystem *psys; + PTCacheEdit *edit; int first; int lastmouse[2]; @@ -3037,8 +3036,8 @@ static int brush_edit_init(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); - ParticleSystem *psys= PE_get_current(scene, ob); ParticleEditSettings *pset= PE_settings(scene); + PTCacheEdit *edit= PE_get_current(scene, ob); ARegion *ar= CTX_wm_region(C); BrushEdit *bedit; @@ -3053,7 +3052,7 @@ static int brush_edit_init(bContext *C, wmOperator *op) bedit->scene= scene; bedit->ob= ob; - bedit->psys= psys; + bedit->edit= edit; return 1; } @@ -3063,15 +3062,18 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) BrushEdit *bedit= op->customdata; Scene *scene= bedit->scene; Object *ob= bedit->ob; - ParticleSystem *psys= bedit->psys; + PTCacheEdit *edit= bedit->edit; ParticleEditSettings *pset= PE_settings(scene); - ParticleSystemModifierData *psmd= psys_get_modifier(ob, psys); + ParticleSystemModifierData *psmd= edit->psys ? psys_get_modifier(ob, edit->psys) : NULL; ParticleBrushData *brush= &pset->brush[pset->brushtype]; ARegion *ar= CTX_wm_region(C); - float vec1[3], vec2[3], mousef[2]; + float vec[3], mousef[2]; short mval[2], mvalo[2]; int flip, mouse[2], dx, dy, removed= 0, selected= 0; + if(!PE_start_edit(edit)) + return; + RNA_float_get_array(itemptr, "mouse", mousef); mouse[0] = mousef[0]; mouse[1] = mousef[1]; @@ -3096,7 +3098,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) || bedit->first) { view3d_operator_needs_opengl(C); - selected= (short)count_selected_keys(scene, psys); + selected= (short)count_selected_keys(scene, edit); switch(pset->brushtype) { case PE_BRUSH_COMB: @@ -3115,10 +3117,8 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) Mat4Invert(ob->imat, ob->obmat); - window_to_3d(ar, vec1, mvalo[0], mvalo[1]); - window_to_3d(ar, vec2, mval[0], mval[1]); - VECSUB(vec1, vec2, vec1); - data.dvec= vec1; + window_to_3d_delta(ar, vec, dx, dy); + data.dvec= vec; foreach_mouse_hit_key(&data, brush_comb, selected); break; @@ -3126,20 +3126,22 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) case PE_BRUSH_CUT: { PEData data; + + if(edit->psys && edit->pathcache) { + PE_set_view3d_data(C, &data); + data.mval= mval; + data.rad= (float)brush->size; + data.cutfac= (float)(brush->strength / 100.0f); - PE_set_view3d_data(C, &data); - data.mval= mval; - data.rad= (float)brush->size; - data.cutfac= (float)(brush->strength / 100.0f); + if(selected) + foreach_selected_point(&data, brush_cut); + else + foreach_point(&data, brush_cut); - if(selected) - foreach_selected_particle(&data, brush_cut); - else - PE_foreach_particle(&data, brush_cut); - - removed= remove_tagged_particles(scene, ob, psys); - if(pset->flag & PE_KEEP_LENGTHS) - recalc_lengths(psys); + removed= remove_tagged_particles(scene, ob, edit->psys); + if(pset->flag & PE_KEEP_LENGTHS) + recalc_lengths(edit); + } break; } case PE_BRUSH_LENGTH: @@ -3157,61 +3159,50 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) else data.growfac= 1.0f + data.growfac; - foreach_mouse_hit_particle(&data, brush_length, selected); + foreach_mouse_hit_point(&data, brush_length, selected); if(pset->flag & PE_KEEP_LENGTHS) - recalc_lengths(psys); + recalc_lengths(edit); break; } case PE_BRUSH_PUFF: { PEData data; - PE_set_view3d_data(C, &data); - data.dm= psmd->dm; - data.mval= mval; - data.rad= (float)brush->size; + if(edit->psys) { + PE_set_view3d_data(C, &data); + data.dm= psmd->dm; + data.mval= mval; + data.rad= (float)brush->size; - data.pufffac= (float)(brush->strength - 50) / 50.0f; - if(data.pufffac < 0.0f) - data.pufffac= 1.0f - 9.0f * data.pufffac; - else - data.pufffac= 1.0f - data.pufffac; + data.pufffac= (float)(brush->strength - 50) / 50.0f; + if(data.pufffac < 0.0f) + data.pufffac= 1.0f - 9.0f * data.pufffac; + else + data.pufffac= 1.0f - data.pufffac; - data.invert= (brush->invert ^ flip); - Mat4Invert(ob->imat, ob->obmat); + data.invert= (brush->invert ^ flip); + Mat4Invert(ob->imat, ob->obmat); - foreach_mouse_hit_particle(&data, brush_puff, selected); + foreach_mouse_hit_point(&data, brush_puff, selected); + } break; } case PE_BRUSH_ADD: { PEData data; - if(psys->part->from==PART_FROM_FACE) { + if(edit->psys && edit->psys->part->from==PART_FROM_FACE) { PE_set_view3d_data(C, &data); data.mval= mval; brush_add(&data, brush->strength); if(pset->flag & PE_KEEP_LENGTHS) - recalc_lengths(psys); + recalc_lengths(edit); } break; } - case PE_BRUSH_WEIGHT: - { - PEData data; - - PE_set_view3d_data(C, &data); - data.mval= mval; - data.rad= (float)brush->size; - - data.weightfac= (float)(brush->strength / 100.0f); - - foreach_mouse_hit_key(&data, brush_weight, selected); - break; - } case PE_BRUSH_SMOOTH: { PEData data; @@ -3238,14 +3229,14 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) } } if((pset->flag & PE_KEEP_LENGTHS)==0) - recalc_lengths(psys); + recalc_lengths(edit); if(pset->brushtype == PE_BRUSH_ADD || removed) { if(pset->brushtype == PE_BRUSH_ADD && (pset->flag & PE_X_MIRROR)) PE_mirror_x(scene, ob, 1); - psys_update_world_cos(ob,psys); - psys_free_path_cache(psys); + update_world_cos(ob,edit); + psys_free_path_cache(NULL, edit); DAG_object_flush_update(scene, ob, OB_RECALC_DATA); } else @@ -3357,104 +3348,157 @@ void PARTICLE_OT_brush_edit(wmOperatorType *ot) /*********************** undo ***************************/ -static void free_ParticleUndo(ParticleUndo *undo) +static void free_PTCacheUndo(PTCacheUndo *undo) { - ParticleData *pa; + PTCacheEditPoint *point; int i; - for(i=0, pa=undo->particles; itotpart; i++, pa++) { - if(pa->hair) - MEM_freeN(pa->hair); - if(undo->keys[i]) - MEM_freeN(undo->keys[i]); + for(i=0, point=undo->points; itotpoint; i++, point++) { + if(undo->particles && (undo->particles + i)->hair) + MEM_freeN((undo->particles + i)->hair); + if(point->keys) + MEM_freeN(point->keys); } - if(undo->keys) - MEM_freeN(undo->keys); + if(undo->points) + MEM_freeN(undo->points); if(undo->particles) MEM_freeN(undo->particles); - //if(undo->emitter_cosnos) - // MEM_freeN(undo->emitter_cosnos); + BKE_ptcache_free_mem(&undo->mem_cache); } -static void make_ParticleUndo(ParticleSystem *psys, ParticleUndo *undo) +static void make_PTCacheUndo(PTCacheEdit *edit, PTCacheUndo *undo) { - ParticleData *pa,*upa; + PTCacheEditPoint *point; int i; - undo->totpart= psys->totpart; - undo->totkeys= psys->edit->totkeys; + undo->totpoint= edit->totpoint; - upa= undo->particles= MEM_dupallocN(psys->particles); - undo->keys= MEM_dupallocN(psys->edit->keys); - - for(i=0, pa=psys->particles; itotpart; i++, pa++, upa++) { - upa->hair= MEM_dupallocN(pa->hair); - undo->keys[i]= MEM_dupallocN(psys->edit->keys[i]); + if(edit->psys) { + ParticleData *pa; + + pa= undo->particles= MEM_dupallocN(edit->psys->particles); + + for(i=0; itotpoint; i++, pa++) + pa->hair= MEM_dupallocN(pa->hair); + } + else { + PTCacheMem *pm; + + BLI_duplicatelist(&undo->mem_cache, &edit->pid.cache->mem_cache); + pm = undo->mem_cache.first; + + for(; pm; pm=pm->next) { + for(i=0; idata[i] = MEM_dupallocN(pm->data[i]); + } + } + + point= undo->points = MEM_dupallocN(edit->points); + undo->totpoint = edit->totpoint; + + for(i=0; itotpoint; i++, point++) { + point->keys= MEM_dupallocN(point->keys); /* no need to update edit key->co & key->time pointers here */ } } -static void get_ParticleUndo(ParticleSystem *psys, ParticleUndo *undo) +static void get_PTCacheUndo(PTCacheEdit *edit, PTCacheUndo *undo) { - ParticleData *pa, *upa; - ParticleEditKey *key; + ParticleSystem *psys = edit->psys; + ParticleData *pa; HairKey *hkey; - int i, k, totpart= psys->totpart; + POINT_P; KEY_K; - LOOP_PARTICLES(i, pa) { - if(pa->hair) - MEM_freeN(pa->hair); + LOOP_POINTS { + if(psys && psys->particles[p].hair) + MEM_freeN(psys->particles[p].hair); - if(psys->edit->keys[i]) - MEM_freeN(psys->edit->keys[i]); + if(point->keys) + MEM_freeN(point->keys); } - if(psys->particles) + if(psys && psys->particles) MEM_freeN(psys->particles); - if(psys->edit->keys) - MEM_freeN(psys->edit->keys); - if(psys->edit->mirror_cache) { - MEM_freeN(psys->edit->mirror_cache); - psys->edit->mirror_cache= NULL; + if(edit->points) + MEM_freeN(edit->points); + if(edit->mirror_cache) { + MEM_freeN(edit->mirror_cache); + edit->mirror_cache= NULL; } - pa= psys->particles= MEM_dupallocN(undo->particles); - psys->edit->keys= MEM_dupallocN(undo->keys); + edit->points= MEM_dupallocN(undo->points); + edit->totpoint = undo->totpoint; - for(i=0,upa=undo->particles; itotpart; i++, upa++, pa++) { - hkey= pa->hair= MEM_dupallocN(upa->hair); - key= psys->edit->keys[i]= MEM_dupallocN(undo->keys[i]); - for(k=0; ktotkey; k++, hkey++, key++) { - key->co= hkey->co; - key->time= &hkey->time; + LOOP_POINTS { + point->keys= MEM_dupallocN(point->keys); + } + + if(psys) { + psys->particles= MEM_dupallocN(undo->particles); + + psys->totpart= undo->totpoint; + + LOOP_POINTS { + pa = psys->particles + p; + hkey= pa->hair = MEM_dupallocN(pa->hair); + + LOOP_KEYS { + key->co= hkey->co; + key->time= &hkey->time; + hkey++; + } } } + else { + PTCacheMem *pm; + int i; - psys->totpart= undo->totpart; - psys->edit->totkeys= undo->totkeys; + BKE_ptcache_free_mem(&edit->pid.cache->mem_cache); + + BLI_duplicatelist(&edit->pid.cache->mem_cache, &undo->mem_cache); + + pm = edit->pid.cache->mem_cache.first; + + for(; pm; pm=pm->next) { + for(i=0; idata[i] = MEM_dupallocN(pm->data[i]); + + BKE_ptcache_mem_init_pointers(pm); + + LOOP_POINTS { + LOOP_KEYS { + if((int)key->ftime == pm->frame) { + key->co = pm->cur[BPHYS_DATA_LOCATION]; + key->vel = pm->cur[BPHYS_DATA_VELOCITY]; + key->rot = pm->cur[BPHYS_DATA_ROTATION]; + key->time = &key->ftime; + } + } + BKE_ptcache_mem_incr_pointers(pm); + } + } + } } void PE_undo_push(Scene *scene, char *str) { - ParticleSystem *psys= PE_get_current(scene, OBACT); - ParticleEdit *edit= 0; - ParticleUndo *undo; + PTCacheEdit *edit= PE_get_current(scene, OBACT); + PTCacheUndo *undo; int nr; - if(!PE_can_edit(psys)) return; - edit= psys->edit; + if(!edit) return; /* remove all undos after (also when curundo==NULL) */ while(edit->undo.last != edit->curundo) { undo= edit->undo.last; BLI_remlink(&edit->undo, undo); - free_ParticleUndo(undo); + free_PTCacheUndo(undo); MEM_freeN(undo); } /* make new */ - edit->curundo= undo= MEM_callocN(sizeof(ParticleUndo), "particle undo file"); + edit->curundo= undo= MEM_callocN(sizeof(PTCacheUndo), "particle undo file"); strncpy(undo->name, str, 64-1); BLI_addtail(&edit->undo, undo); @@ -3468,27 +3512,25 @@ void PE_undo_push(Scene *scene, char *str) } if(undo) { while(edit->undo.first!=undo) { - ParticleUndo *first= edit->undo.first; + PTCacheUndo *first= edit->undo.first; BLI_remlink(&edit->undo, first); - free_ParticleUndo(first); + free_PTCacheUndo(first); MEM_freeN(first); } } /* copy */ - make_ParticleUndo(psys,edit->curundo); + make_PTCacheUndo(edit,edit->curundo); } void PE_undo_step(Scene *scene, int step) { - ParticleSystem *psys= PE_get_current(scene, OBACT); - ParticleEdit *edit= 0; + PTCacheEdit *edit= PE_get_current(scene, OBACT); - if(!PE_can_edit(psys)) return; - edit= psys->edit; + if(!edit) return; if(step==0) { - get_ParticleUndo(psys,edit->curundo); + get_PTCacheUndo(edit,edit->curundo); } else if(step==1) { @@ -3496,7 +3538,7 @@ void PE_undo_step(Scene *scene, int step) else { if(G.f & G_DEBUG) printf("undo %s\n", edit->curundo->name); edit->curundo= edit->curundo->prev; - get_ParticleUndo(psys, edit->curundo); + get_PTCacheUndo(edit, edit->curundo); } } else { @@ -3504,18 +3546,19 @@ void PE_undo_step(Scene *scene, int step) if(edit->curundo==NULL || edit->curundo->next==NULL); else { - get_ParticleUndo(psys, edit->curundo->next); + get_PTCacheUndo(edit, edit->curundo->next); edit->curundo= edit->curundo->next; if(G.f & G_DEBUG) printf("redo %s\n", edit->curundo->name); } } + PE_update_object(scene, OBACT, 0); DAG_object_flush_update(scene, OBACT, OB_RECALC_DATA); } -static void ParticleUndo_number(Scene *scene, ParticleEdit *edit, int nr) +static void PTCacheUndo_number(Scene *scene, PTCacheEdit *edit, int nr) { - ParticleUndo *undo; + PTCacheUndo *undo; int a=1; for(undo= edit->undo.first; undo; undo= undo->next, a++) { @@ -3525,20 +3568,15 @@ static void ParticleUndo_number(Scene *scene, ParticleEdit *edit, int nr) PE_undo_step(scene, 0); } -static void ParticleUndo_clear(ParticleSystem *psys) +static void PTCacheUndo_clear(PTCacheEdit *edit) { - ParticleUndo *undo; - ParticleEdit *edit; - - if(psys==0) return; - - edit= psys->edit; + PTCacheUndo *undo; if(edit==0) return; undo= edit->undo.first; while(undo) { - free_ParticleUndo(undo); + free_PTCacheUndo(undo); undo= undo->next; } BLI_freelistN(&edit->undo); @@ -3557,15 +3595,13 @@ void PE_redo(Scene *scene) void PE_undo_menu(Scene *scene, Object *ob) { - ParticleSystem *psys= PE_get_current(scene, ob); - ParticleEdit *edit= 0; - ParticleUndo *undo; + PTCacheEdit *edit= PE_get_current(scene, ob); + PTCacheUndo *undo; DynStr *ds; short event=0; char *menu; - if(!PE_can_edit(psys)) return; - edit= psys->edit; + if(!edit) return; ds= BLI_dynstr_new(); @@ -3582,7 +3618,7 @@ void PE_undo_menu(Scene *scene, Object *ob) // XXX event= pupmenu_col(menu, 20); MEM_freeN(menu); - if(event>0) ParticleUndo_number(scene, edit,event); + if(event>0) PTCacheUndo_number(scene, edit, event); } /************************ utilities ******************************/ @@ -3590,30 +3626,29 @@ void PE_undo_menu(Scene *scene, Object *ob) int PE_minmax(Scene *scene, float *min, float *max) { Object *ob= OBACT; - ParticleSystem *psys= PE_get_current(scene, ob); - ParticleSystemModifierData *psmd; - ParticleData *pa; - ParticleEditKey *key; + PTCacheEdit *edit= PE_get_current(scene, ob); + ParticleSystem *psys = edit->psys; + ParticleSystemModifierData *psmd = NULL; + POINT_P; KEY_K; float co[3], mat[4][4]; - int i, k, totpart, ok= 0; + int ok= 0; - if(!PE_can_edit(psys)) return ok; + if(!edit) return ok; - psmd= psys_get_modifier(ob, psys); - totpart= psys->totpart; + if(psys) + psmd= psys_get_modifier(ob, psys); + else + Mat4One(mat); - LOOP_PARTICLES(i, pa) { - if(pa->flag & PARS_HIDE) continue; + LOOP_VISIBLE_POINTS { + if(psys) + psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles+p, mat); - psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, mat); - - LOOP_KEYS(k, key) { - if(key->flag & PEK_SELECT) { - VECCOPY(co, key->co); - Mat4MulVecfl(mat, co); - DO_MINMAX(co, min, max); - ok= 1; - } + LOOP_SELECTED_KEYS { + VECCOPY(co, key->co); + Mat4MulVecfl(mat, co); + DO_MINMAX(co, min, max); + ok= 1; } } @@ -3628,56 +3663,106 @@ int PE_minmax(Scene *scene, float *min, float *max) /************************ particle edit toggle operator ************************/ /* initialize needed data for bake edit */ -static void PE_create_particle_edit(Scene *scene, Object *ob, ParticleSystem *psys) +static void PE_create_particle_edit(Scene *scene, Object *ob, PointCache *cache, ParticleSystem *psys) { - ParticleEdit *edit= psys->edit; - ParticleData *pa; - ParticleEditKey *key; + PTCacheEdit *edit= psys ? psys->edit : cache->edit; + POINT_P; KEY_K; + ParticleData *pa = NULL; HairKey *hkey; - int i, k, totpart= psys->totpart, alloc=1; + int totpoint; - if((psys->flag & PSYS_EDITED)==0) + if(!psys && !cache) return; - if(edit) { - int newtotkeys= psys_count_keys(psys); + if(cache && cache->flag & PTCACHE_DISK_CACHE) + return; - if(newtotkeys == edit->totkeys) - alloc=0; - } + if(!edit) { + totpoint = psys ? psys->totpart : ((PTCacheMem*)cache->mem_cache.first)->totpoint; - if(alloc) { - if(edit) { - printf("ParticleEdit exists already! Poke jahka!"); - PE_free_particle_edit(psys); - } + edit= MEM_callocN(sizeof(PTCacheEdit), "PE_create_particle_edit"); + edit->points=MEM_callocN(totpoint*sizeof(PTCacheEditPoint),"PTCacheEditPoints"); + edit->totpoint = totpoint; - edit= psys->edit=MEM_callocN(sizeof(ParticleEdit), "PE_create_particle_edit"); - psys->free_edit= PE_free_particle_edit; + if(psys && !cache) { + psys->edit= edit; + edit->psys = psys; - edit->keys=MEM_callocN(totpart*sizeof(ParticleEditKey*),"ParticleEditKey array"); + psys->free_edit= PE_free_ptcache_edit; - LOOP_PARTICLES(i, pa) { - key= edit->keys[i]= MEM_callocN(pa->totkey*sizeof(ParticleEditKey),"ParticleEditKeys"); - for(k=0, hkey=pa->hair; ktotkey; k++, hkey++, key++) { - key->co= hkey->co; - key->time= &hkey->time; - key->flag= hkey->editflag; + edit->pathcache = NULL; + edit->pathcachebufs.first = edit->pathcachebufs.last = NULL; + + pa = psys->particles; + LOOP_POINTS { + point->totkey = pa->totkey; + point->keys= MEM_callocN(point->totkey*sizeof(PTCacheEditKey),"ParticleEditKeys"); + point->flag |= PEP_EDIT_RECALC; + + hkey = pa->hair; + LOOP_KEYS { + key->co= hkey->co; + key->time= &hkey->time; + key->flag= hkey->editflag; + key->flag |= PEK_USE_WCO; + hkey++; + } + pa++; } } + else { + PTCacheMem *pm; + int totframe=0; - edit->totkeys= psys_count_keys(psys); + cache->edit= edit; + cache->free_edit= PE_free_ptcache_edit; + edit->psys = NULL; + + for(pm=cache->mem_cache.first; pm; pm=pm->next) + totframe++; + + for(pm=cache->mem_cache.first; pm; pm=pm->next) { + BKE_ptcache_mem_init_pointers(pm); + + LOOP_POINTS { + if(psys) { + pa = psys->particles + p; + if((pm->next && pm->next->frame < pa->time) + || (pm->prev && pm->prev->frame >= pa->dietime)) { + BKE_ptcache_mem_incr_pointers(pm); + continue; + } + } + + if(!point->totkey) { + key = point->keys = MEM_callocN(totframe*sizeof(PTCacheEditKey),"ParticleEditKeys"); + point->flag |= PEP_EDIT_RECALC; + } + else + key = point->keys + point->totkey; + + key->co = pm->cur[BPHYS_DATA_LOCATION]; + key->vel = pm->cur[BPHYS_DATA_VELOCITY]; + key->rot = pm->cur[BPHYS_DATA_ROTATION]; + key->ftime = (float)pm->frame; + key->time = &key->ftime; + BKE_ptcache_mem_incr_pointers(pm); + + point->totkey++; + } + } + psys = NULL; + } UI_GetThemeColor3ubv(TH_EDGE_SELECT, edit->sel_col); UI_GetThemeColor3ubv(TH_WIRE, edit->nosel_col); - } - recalc_lengths(psys); - recalc_emitter_field(ob, psys); - psys_update_world_cos(ob, psys); + recalc_lengths(edit); + if(psys && !cache) + recalc_emitter_field(ob, psys); + PE_update_object(scene, ob, 1); - if(alloc) { - ParticleUndo_clear(psys); + PTCacheUndo_clear(edit); PE_undo_push(scene, "Original"); } } @@ -3690,30 +3775,16 @@ static int particle_edit_toggle_poll(bContext *C) if(!scene || !ob || ob->id.lib) return 0; - return (ob->particlesystem.first != NULL); + return (ob->particlesystem.first || modifiers_findByType(ob, eModifierType_Cloth) || modifiers_findByType(ob, eModifierType_Softbody)); } static int particle_edit_toggle_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); - ParticleSystem *psys= PE_get_current(scene, ob); - - if(psys==NULL) { - psys= ob->particlesystem.first; - psys->flag |= PSYS_CURRENT; - } + PTCacheEdit *edit= PE_get_current(scene, ob, PE_settings(scene)->edittype); if(!(ob->mode & OB_MODE_PARTICLE_EDIT)) { - if(psys && psys->part->type == PART_HAIR && psys->flag & PSYS_EDITED) { - if(psys_check_enabled(ob, psys)) { - if(psys->edit==NULL) - PE_create_particle_edit(scene, ob, psys); - - psys_update_world_cos(ob, psys); - } - } - ob->mode |= OB_MODE_PARTICLE_EDIT; toggle_particle_cursor(C, 1); WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_PARTICLE, NULL); @@ -3746,112 +3817,65 @@ void PARTICLE_OT_particle_edit_toggle(wmOperatorType *ot) /************************ set editable operator ************************/ -static int set_editable_exec(bContext *C, wmOperator *op) +static int clear_edited_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); - ParticleSystem *psys= PE_get_current(scene, ob); + ParticleSystem *psys = psys_get_current(ob); - if(psys->flag & PSYS_EDITED) { - if(1) { // XXX okee("Lose changes done in particle mode?")) { - if(psys->edit) - PE_free_particle_edit(psys); + if(psys->edit) { + if(psys->edit->edited || 1) { // XXX okee("Lose changes done in particle mode?")) + PE_free_ptcache_edit(psys->edit); + + psys->edit = NULL; + psys->free_edit = NULL; - psys->flag &= ~PSYS_EDITED; psys->recalc |= PSYS_RECALC_RESET; + psys_reset(psys, PSYS_RESET_DEPSGRAPH); DAG_object_flush_update(scene, ob, OB_RECALC_DATA); } } - else { - if(psys_check_enabled(ob, psys)) { - psys->flag |= PSYS_EDITED; - - if(ob->mode & OB_MODE_PARTICLE_EDIT) - PE_create_particle_edit(scene, ob, psys); - } - else - BKE_report(op->reports, RPT_ERROR, "Particle system not enabled, skipping set editable"); - } return OPERATOR_FINISHED; } -void PARTICLE_OT_editable_set(wmOperatorType *ot) +void PARTICLE_OT_edited_clear(wmOperatorType *ot) { /* identifiers */ - ot->name= "Set Editable"; - ot->idname= "PARTICLE_OT_editable_set"; + ot->name= "Clear Edited"; + ot->idname= "PARTICLE_OT_edited_clear"; /* api callbacks */ - ot->exec= set_editable_exec; + ot->exec= clear_edited_exec; ot->poll= particle_edit_toggle_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -/*********************** change active **************************/ - -void PE_change_act(void *ob_v, void *act_v) -{ - Scene *scene= NULL; // XXX - Object *ob= ob_v; - ParticleSystem *psys; - short act= *((short*)act_v) - 1; - - if((psys=psys_get_current(ob))) - psys->flag &= ~PSYS_CURRENT; - - if(act>=0) { - if((psys=BLI_findlink(&ob->particlesystem,act))) { - psys->flag |= PSYS_CURRENT; - - if(psys_check_enabled(ob, psys)) { - if(ob->mode & OB_MODE_PARTICLE_EDIT && !psys->edit) - PE_create_particle_edit(scene, ob, psys); - psys_update_world_cos(ob, psys); - } - } - } -} - -void PE_change_act_psys(Scene *scene, Object *ob, ParticleSystem *psys) -{ - ParticleSystem *p; - - if((p=psys_get_current(ob))) - p->flag &= ~PSYS_CURRENT; - - psys->flag |= PSYS_CURRENT; - - if(psys_check_enabled(ob, psys)) { - if(ob->mode & OB_MODE_PARTICLE_EDIT && !psys->edit) - PE_create_particle_edit(scene, ob, psys); - - psys_update_world_cos(ob, psys); - } -} - /*********************** specials menu **************************/ static int specials_menu_invoke(bContext *C, wmOperator *op, wmEvent *event) { Scene *scene= CTX_data_scene(C); ParticleEditSettings *pset=PE_settings(scene); + PTCacheEdit *edit = PE_get_current(scene, CTX_data_active_object(C)); uiPopupMenu *pup; uiLayout *layout; pup= uiPupMenuBegin(C, "Specials", 0); layout= uiPupMenuLayout(pup); - uiItemO(layout, NULL, 0, "PARTICLE_OT_rekey"); - if(pset->selectmode & SCE_SELECT_POINT) { - uiItemO(layout, NULL, 0, "PARTICLE_OT_subdivide"); - uiItemO(layout, NULL, 0, "PARTICLE_OT_select_first"); - uiItemO(layout, NULL, 0, "PARTICLE_OT_select_last"); + if(edit->psys) { + uiItemO(layout, NULL, 0, "PARTICLE_OT_rekey"); + if(pset->selectmode & SCE_SELECT_POINT) { + uiItemO(layout, NULL, 0, "PARTICLE_OT_subdivide"); + uiItemO(layout, NULL, 0, "PARTICLE_OT_select_first"); + uiItemO(layout, NULL, 0, "PARTICLE_OT_select_last"); + } + uiItemO(layout, NULL, 0, "PARTICLE_OT_remove_doubles"); } - uiItemO(layout, NULL, 0, "PARTICLE_OT_remove_doubles"); uiPupMenuEnd(C, pup); @@ -3896,7 +3920,7 @@ void ED_operatortypes_particle(void) WM_operatortype_append(PARTICLE_OT_specials_menu); WM_operatortype_append(PARTICLE_OT_particle_edit_toggle); - WM_operatortype_append(PARTICLE_OT_editable_set); + WM_operatortype_append(PARTICLE_OT_edited_clear); } void ED_keymap_particle(wmWindowManager *wm) diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index fca5b0cc59a..e6cd9c0e448 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -2120,9 +2120,7 @@ static int tree_element_active_psys(bContext *C, Scene *scene, TreeElement *te, { if(set) { Object *ob= (Object *)tselem->id; - ParticleSystem *psys= te->directdata; - PE_change_act_psys(scene, ob, psys); WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, ob); // XXX extern_set_butspace(F7KEY, 0); diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 6cf229ead31..e49616fc740 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -89,6 +89,7 @@ #include "BKE_object.h" #include "BKE_paint.h" #include "BKE_particle.h" +#include "BKE_pointcache.h" #include "BKE_property.h" #include "BKE_smoke.h" #include "BKE_unit.h" @@ -3138,6 +3139,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv { Object *ob=base->object; ParticleSystemModifierData *psmd; + ParticleEditSettings *pset = PE_settings(scene); ParticleSettings *part; ParticleData *pars, *pa; ParticleKey state, *states=0; @@ -3166,9 +3168,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if(pars==0) return; - // XXX what logic is this? - if(!scene->obedit && psys_in_edit_mode(scene, psys) - && psys->flag & PSYS_HAIR_DONE && part->draw_as==PART_DRAW_PATH) + /* don't draw normal paths in edit mode */ + if(psys_in_edit_mode(scene, psys) && (pset->flag & PE_DRAW_PART)==0) return; if(part->draw_as==PART_DRAW_NOT) return; @@ -3709,33 +3710,27 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv wmLoadMatrix(rv3d->viewmat); } -static void draw_particle_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, ParticleSystem *psys, int dt) +static void draw_ptcache_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob, PTCacheEdit *edit, int dt) { - ParticleEdit *edit = psys->edit; - ParticleData *pa; - ParticleCacheKey **path; - ParticleEditKey *key; + ParticleCacheKey **cache, *path, *pkey; + PTCacheEditPoint *point; + PTCacheEditKey *key; ParticleEditSettings *pset = PE_settings(scene); - int i, k, totpart = psys->totpart, totchild=0, timed = pset->draw_timed; + int i, k, totpoint = edit->totpoint, timed = pset->flag & PE_FADE_TIME ? pset->fade_frames : 0; + int steps; char nosel[4], sel[4]; float sel_col[3]; float nosel_col[3]; - char val[32]; + float *pathcol = NULL, *pcol; /* create path and child path cache if it doesn't exist already */ - if(psys->pathcache==0){ - PE_hide_keys_time(scene, psys,CFRA); - psys_cache_paths(scene, ob, psys, CFRA,0); - } - if(psys->pathcache==0) + if(edit->pathcache==0) + psys_cache_edit_paths(scene, ob, edit, CFRA); + + if(edit->pathcache==0) return; - if(pset->flag & PE_SHOW_CHILD && psys->part->draw_as == PART_DRAW_PATH) { - if(psys->childcache==0) - psys_cache_child_paths(scene, ob, psys, CFRA, 0); - } - else if(!(pset->flag & PE_SHOW_CHILD) && psys->childcache) - free_child_path_cache(psys); + PE_hide_keys_time(scene, edit, CFRA); /* opengl setup */ if((v3d->flag & V3D_ZBUF_SELECT)==0) @@ -3751,65 +3746,50 @@ static void draw_particle_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Ob nosel_col[1]=(float)nosel[1]/255.0f; nosel_col[2]=(float)nosel[2]/255.0f; - if(psys->childcache) - totchild = psys->totchildcache; /* draw paths */ - if(timed) + if(timed) { glEnable(GL_BLEND); + steps = (*edit->pathcache)->steps + 1; + pathcol = MEM_callocN(steps*4*sizeof(float), "particle path color data"); + } glEnableClientState(GL_VERTEX_ARRAY); - if(dt > OB_WIRE) { - /* solid shaded with lighting */ - glEnableClientState(GL_NORMAL_ARRAY); - glEnableClientState(GL_COLOR_ARRAY); + /* solid shaded with lighting */ + glEnableClientState(GL_NORMAL_ARRAY); + glEnableClientState(GL_COLOR_ARRAY); - glEnable(GL_COLOR_MATERIAL); - glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE); - } - else { - /* flat wire color */ - glDisableClientState(GL_NORMAL_ARRAY); - glDisable(GL_LIGHTING); - UI_ThemeColor(TH_WIRE); - } + glEnable(GL_COLOR_MATERIAL); + glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE); /* only draw child paths with lighting */ if(dt > OB_WIRE) glEnable(GL_LIGHTING); - if(psys->part->draw_as == PART_DRAW_PATH) { - for(i=0, path=psys->childcache; ico); - if(dt > OB_WIRE) { - glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), (*path)->vel); - glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), (*path)->col); + /* draw paths without lighting */ + cache=edit->pathcache; + for(i=0; ico); + glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), path->vel); + + if(timed) { + for(k=0, pcol=pathcol, pkey=path; kcol); + pcol[3] = 1.0f - fabs((float)CFRA - pkey->time)/(float)pset->fade_frames; } - glDrawArrays(GL_LINE_STRIP, 0, (int)(*path)->steps + 1); + glColorPointer(4, GL_FLOAT, 4*sizeof(float), pathcol); } + else + glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), path->col); + + glDrawArrays(GL_LINE_STRIP, 0, path->steps + 1); } - if(dt > OB_WIRE) - glDisable(GL_LIGHTING); + if(pathcol) { MEM_freeN(pathcol); pathcol = pcol = NULL; } - if(pset->brushtype == PE_BRUSH_WEIGHT) { - glLineWidth(2.0f); - glEnableClientState(GL_COLOR_ARRAY); - glDisable(GL_LIGHTING); - } - - /* draw parents last without lighting */ - for(i=0, pa=psys->particles, path = psys->pathcache; ico); - if(dt > OB_WIRE) - glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), (*path)->vel); - if(dt > OB_WIRE || pset->brushtype == PE_BRUSH_WEIGHT) - glColorPointer(3, GL_FLOAT, sizeof(ParticleCacheKey), (*path)->col); - - glDrawArrays(GL_LINE_STRIP, 0, (int)(*path)->steps + 1); - } /* draw edit vertices */ if(pset->selectmode!=SCE_SELECT_PATH){ @@ -3819,61 +3799,74 @@ static void draw_particle_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Ob glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE)); if(pset->selectmode==SCE_SELECT_POINT){ + float *pd=0,*pdata=0; float *cd=0,*cdata=0; - cd=cdata=MEM_callocN(edit->totkeys*(timed?4:3)*sizeof(float), "particle edit color data"); + int totkeys = 0; + + for (i=0, point=edit->points; iflag & PEP_HIDE)) + totkeys += point->totkey; + + if(!edit->psys) + pd=pdata=MEM_callocN(totkeys*3*sizeof(float), "particle edit point data"); + cd=cdata=MEM_callocN(totkeys*(timed?4:3)*sizeof(float), "particle edit color data"); + + for(i=0, point=edit->points; iflag & PEP_HIDE) + continue; + + for(k=0, key=point->keys; ktotkey; k++, key++){ + if(pd) { + VECCOPY(pd, key->co); + pd += 3; + } - for(i=0, pa=psys->particles; ikeys[i]; ktotkey; k++, key++){ if(key->flag&PEK_SELECT){ VECCOPY(cd,sel_col); } else{ VECCOPY(cd,nosel_col); } + if(timed) - *(cd+3) = (key->flag&PEK_HIDE)?0.0f:1.0f; + *(cd+3) = 1.0f - fabs((float)CFRA - *key->time)/(float)pset->fade_frames; + cd += (timed?4:3); } } cd=cdata; - for(i=0, pa=psys->particles; iflag & PARS_HIDE)==0){ - glVertexPointer(3, GL_FLOAT, sizeof(ParticleEditKey), edit->keys[i]->world_co); - glColorPointer((timed?4:3), GL_FLOAT, (timed?4:3)*sizeof(float), cd); - glDrawArrays(GL_POINTS, 0, pa->totkey); - } - cd += (timed?4:3) * pa->totkey; + pd=pdata; + for(i=0, point=edit->points; iflag & PEP_HIDE) + continue; - if((pset->flag&PE_SHOW_TIME) && (pa->flag&PARS_HIDE)==0 && !(G.f & G_RENDER_SHADOW)){ - for(k=0, key=edit->keys[i]+k; ktotkey; k++, key++){ - if(key->flag & PEK_HIDE) continue; + if(edit->psys) + glVertexPointer(3, GL_FLOAT, sizeof(PTCacheEditKey), point->keys->world_co); + else + glVertexPointer(3, GL_FLOAT, 3*sizeof(float), pd); - sprintf(val," %.1f",*key->time); - view3d_particle_text_draw_add(key->world_co[0], key->world_co[1], key->world_co[2], val, 0); - } - } + glColorPointer((timed?4:3), GL_FLOAT, (timed?4:3)*sizeof(float), cd); + + glDrawArrays(GL_POINTS, 0, point->totkey); + + pd += pd ? 3 * point->totkey : 0; + cd += (timed?4:3) * point->totkey; } - if(cdata) - MEM_freeN(cdata); - cd=cdata=0; + if(pdata) { MEM_freeN(pdata); pd=pdata=0; } + if(cdata) { MEM_freeN(cdata); cd=cdata=0; } } else if(pset->selectmode == SCE_SELECT_END){ - for(i=0, pa=psys->particles; iflag & PARS_HIDE)==0){ - key = edit->keys[i] + pa->totkey - 1; + for(i=0, point=edit->points; iflag & PEP_HIDE)==0){ + key = point->keys + point->totkey - 1; if(key->flag & PEK_SELECT) glColor3fv(sel_col); else glColor3fv(nosel_col); /* has to be like this.. otherwise selection won't work, have try glArrayElement later..*/ glBegin(GL_POINTS); - glVertex3fv(key->world_co); + glVertex3fv(key->flag & PEK_USE_WCO ? key->world_co : key->co); glEnd(); - - if((pset->flag & PE_SHOW_TIME) && !(G.f & G_RENDER_SHADOW)){ - sprintf(val," %.1f",*key->time); - view3d_particle_text_draw_add(key->world_co[0], key->world_co[1], key->world_co[2], val, 0); - } } } } @@ -5298,11 +5291,6 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) for(psys=ob->particlesystem.first; psys; psys=psys->next) draw_new_particle_system(scene, v3d, rv3d, base, psys, dt); - if(ob->mode & OB_MODE_PARTICLE_EDIT && ob==OBACT) { - psys= PE_get_current(scene, ob); - if(psys && !scene->obedit && psys_in_edit_mode(scene, psys)) - draw_particle_edit(scene, v3d, rv3d, ob, psys, dt); - } view3d_particle_text_draw(v3d, ar); wmMultMatrix(ob->obmat); @@ -5310,6 +5298,21 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) //glDepthMask(GL_TRUE); if(col) cpack(col); } + + if( (warning_recursive==0) && + (flag & DRAW_PICKING)==0 && + (!scene->obedit) + ) { + + if(ob->mode & OB_MODE_PARTICLE_EDIT && ob==OBACT) { + PTCacheEdit *edit = PE_get_current(scene, ob); + if(edit) { + wmLoadMatrix(rv3d->viewmat); + draw_ptcache_edit(scene, v3d, rv3d, ob, edit, dt); + wmMultMatrix(ob->obmat); + } + } + } /* draw code for smoke */ { diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index eee85f21798..305b6956037 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -1571,7 +1571,7 @@ static char *view3d_modeselect_pup(Scene *scene) str += sprintf(str, formatstr, "Pose Mode", OB_MODE_POSE, ICON_POSE_HLT); } - if (ob->particlesystem.first) { + if (ob->particlesystem.first || modifiers_findByType(ob, eModifierType_Cloth) || modifiers_findByType(ob, eModifierType_Softbody)) { str += sprintf(str, formatstr, "Particle Mode", OB_MODE_PARTICLE_EDIT, ICON_PARTICLEMODE); } @@ -1661,6 +1661,7 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event) ScrArea *sa= CTX_wm_area(C); View3D *v3d= sa->spacedata.first; Object *obedit = CTX_data_edit_object(C); + Object *ob = CTX_data_active_object(C); EditMesh *em= NULL; int bit, ctrl= win->eventstate->ctrl, shift= win->eventstate->shift; PointerRNA props_ptr; @@ -1759,14 +1760,17 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event) case B_SEL_PATH: ts->particle.selectmode= SCE_SELECT_PATH; + WM_event_add_notifier(C, NC_OBJECT, ob); ED_undo_push(C, "Selectmode Set: Path"); break; case B_SEL_POINT: ts->particle.selectmode = SCE_SELECT_POINT; + WM_event_add_notifier(C, NC_OBJECT, ob); ED_undo_push(C, "Selectmode Set: Point"); break; case B_SEL_END: ts->particle.selectmode = SCE_SELECT_END; + WM_event_add_notifier(C, NC_OBJECT, ob); ED_undo_push(C, "Selectmode Set: End point"); break; diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 5c5b7281f20..aaede541b76 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -1617,31 +1617,32 @@ static void createTransParticleVerts(bContext *C, TransInfo *t) TransDataExtension *tx; Base *base = CTX_data_active_base(C); Object *ob = CTX_data_active_object(C); - ParticleSystem *psys = PE_get_current(t->scene, ob); - ParticleSystemModifierData *psmd = NULL; ParticleEditSettings *pset = PE_settings(t->scene); - ParticleData *pa = NULL; - ParticleEdit *edit; - ParticleEditKey *key; + PTCacheEdit *edit = PE_get_current(t->scene, ob); + ParticleSystem *psys = NULL; + ParticleSystemModifierData *psmd = NULL; + PTCacheEditPoint *point; + PTCacheEditKey *key; float mat[4][4]; - int i,k, totpart, transformparticle; + int i,k, transformparticle; int count = 0, hasselected = 0; int propmode = t->flag & T_PROP_EDIT; - if(psys==NULL || t->settings->particle.selectmode==SCE_SELECT_PATH) return; + if(edit==NULL || t->settings->particle.selectmode==SCE_SELECT_PATH) return; - psmd = psys_get_modifier(ob,psys); + psys = edit->psys; + + if(psys) + psmd = psys_get_modifier(ob,psys); - edit = psys->edit; - totpart = psys->totpart; base->flag |= BA_HAS_RECALC_DATA; - for(i=0, pa=psys->particles; iflag &= ~PARS_TRANSFORM; + for(i=0, point=edit->points; itotpoint; i++, point++) { + point->flag &= ~PEP_TRANSFORM; transformparticle= 0; - if((pa->flag & PARS_HIDE)==0) { - for(k=0, key=edit->keys[i]; ktotkey; k++, key++) { + if((point->flag & PEP_HIDE)==0) { + for(k=0, key=point->keys; ktotkey; k++, key++) { if((key->flag&PEK_HIDE)==0) { if(key->flag&PEK_SELECT) { hasselected= 1; @@ -1654,8 +1655,8 @@ static void createTransParticleVerts(bContext *C, TransInfo *t) } if(transformparticle) { - count += pa->totkey; - pa->flag |= PARS_TRANSFORM; + count += point->totkey; + point->flag |= PEP_TRANSFORM; } } @@ -1674,18 +1675,23 @@ static void createTransParticleVerts(bContext *C, TransInfo *t) Mat4Invert(ob->imat,ob->obmat); - for(i=0, pa=psys->particles; ipoints; itotpoint; i++, point++) { TransData *head, *tail; head = tail = td; - if(!(pa->flag & PARS_TRANSFORM)) continue; + if(!(point->flag & PEP_TRANSFORM)) continue; - psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, mat); + if(psys) + psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles + i, mat); - for(k=0, key=edit->keys[i]; ktotkey; k++, key++) { - VECCOPY(key->world_co, key->co); - Mat4MulVecfl(mat, key->world_co); - td->loc = key->world_co; + for(k=0, key=point->keys; ktotkey; k++, key++) { + if(psys) { + VECCOPY(key->world_co, key->co); + Mat4MulVecfl(mat, key->world_co); + td->loc = key->world_co; + } + else + td->loc = key->co; VECCOPY(td->iloc, td->loc); VECCOPY(td->center, td->loc); @@ -1713,7 +1719,7 @@ static void createTransParticleVerts(bContext *C, TransInfo *t) if(k==0) tx->size = 0; else tx->size = (key - 1)->time; - if(k == pa->totkey - 1) tx->quat = 0; + if(k == point->totkey - 1) tx->quat = 0; else tx->quat = (key + 1)->time; } @@ -1731,35 +1737,42 @@ void flushTransParticles(TransInfo *t) { Scene *scene = t->scene; Object *ob = OBACT; - ParticleSystem *psys = PE_get_current(scene, ob); + PTCacheEdit *edit = PE_get_current(scene, ob); + ParticleSystem *psys = edit->psys; ParticleSystemModifierData *psmd; - ParticleData *pa; - ParticleEditKey *key; + PTCacheEditPoint *point; + PTCacheEditKey *key; TransData *td; float mat[4][4], imat[4][4], co[3]; int i, k, propmode = t->flag & T_PROP_EDIT; - psmd = psys_get_modifier(ob, psys); + if(psys) + psmd = psys_get_modifier(ob, psys); /* we do transform in world space, so flush world space position - * back to particle local space */ + * back to particle local space (only for hair particles) */ td= t->data; - for(i=0, pa=psys->particles; itotpart; i++, pa++, td++) { - if(!(pa->flag & PARS_TRANSFORM)) continue; + for(i=0, point=edit->points; itotpoint; i++, point++, td++) { + if(!(point->flag & PEP_TRANSFORM)) continue; - psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, mat); - Mat4Invert(imat,mat); + if(psys) { + psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles + i, mat); + Mat4Invert(imat,mat); - for(k=0, key=psys->edit->keys[i]; ktotkey; k++, key++) { - VECCOPY(co, key->world_co); - Mat4MulVecfl(imat, co); + for(k=0, key=point->keys; ktotkey; k++, key++) { + VECCOPY(co, key->world_co); + Mat4MulVecfl(imat, co); - /* optimization for proportional edit */ - if(!propmode || !FloatCompare(key->co, co, 0.0001f)) { - VECCOPY(key->co, co); - pa->flag |= PARS_EDIT_RECALC; + + /* optimization for proportional edit */ + if(!propmode || !FloatCompare(key->co, co, 0.0001f)) { + VECCOPY(key->co, co); + point->flag |= PEP_EDIT_RECALC; + } } } + else + point->flag |= PEP_EDIT_RECALC; } PE_update_object(scene, OBACT, 1); @@ -5256,7 +5269,8 @@ void createTransData(bContext *C, TransInfo *t) } CTX_DATA_END; } - else if (ob && (ob->mode & OB_MODE_PARTICLE_EDIT) && PE_can_edit(PE_get_current(scene, ob))) { + else if (ob && (ob->mode & OB_MODE_PARTICLE_EDIT) + && PE_start_edit(PE_get_current(scene, ob))) { createTransParticleVerts(C, t); if(t->data && t->flag & T_PROP_EDIT) { diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 37fd79e38e1..e4ec43a8f38 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -62,6 +62,7 @@ #include "BKE_mesh.h" #include "BKE_object.h" #include "BKE_particle.h" +#include "BKE_pointcache.h" #include "BKE_utildefines.h" #include "BLI_arithb.h" @@ -362,18 +363,19 @@ int calc_manipulator_stats(const bContext *C) ; } else if(ob && ob->mode & OB_MODE_PARTICLE_EDIT) { - ParticleSystem *psys= PE_get_current(scene, ob); - ParticleData *pa = psys->particles; - ParticleEditKey *ek; + PTCacheEdit *edit= PE_get_current(scene, ob); + PTCacheEditPoint *point; + PTCacheEditKey *ek; int k; - if(psys->edit) { - for(a=0; atotpart; a++,pa++) { - if(pa->flag & PARS_HIDE) continue; + if(edit) { + point = edit->points; + for(a=0; atotpoint; a++,point++) { + if(point->flag & PEP_HIDE) continue; - for(k=0, ek=psys->edit->keys[a]; ktotkey; k++, ek++) { + for(k=0, ek=point->keys; ktotkey; k++, ek++) { if(ek->flag & PEK_SELECT) { - calc_tw_center(scene, ek->world_co); + calc_tw_center(scene, ek->flag & PEK_USE_WCO ? ek->world_co : ek->co); totsel++; } } diff --git a/source/blender/makesdna/DNA_object_force.h b/source/blender/makesdna/DNA_object_force.h index 625864c4888..5696f82ab0d 100644 --- a/source/blender/makesdna/DNA_object_force.h +++ b/source/blender/makesdna/DNA_object_force.h @@ -95,7 +95,7 @@ typedef struct PartDeflect { typedef struct PTCacheMem { struct PTCacheMem *next, *prev; int frame, totpoint; - unsigned int data_types, rt; + unsigned int data_types, flag; int *index_array; /* quick access to stored points with index */ void *data[8]; /* BPHYS_TOT_DATA */ @@ -121,6 +121,9 @@ typedef struct PointCache { char info[64]; char path[240]; /* file path */ struct ListBase mem_cache; + + struct PTCacheEdit *edit; + void (*free_edit)(struct PTCacheEdit *edit); /* free callback */ } PointCache; typedef struct SBVertex { @@ -300,8 +303,8 @@ typedef struct SoftBody { #define PTCACHE_OUTDATED 2 #define PTCACHE_SIMULATION_VALID 4 #define PTCACHE_BAKING 8 -#define PTCACHE_BAKE_EDIT 16 -#define PTCACHE_BAKE_EDIT_ACTIVE 32 +//#define PTCACHE_BAKE_EDIT 16 +//#define PTCACHE_BAKE_EDIT_ACTIVE 32 #define PTCACHE_DISK_CACHE 64 #define PTCACHE_QUICK_CACHE 128 #define PTCACHE_FRAMES_SKIPPED 256 diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index 925fd31328d..12c253a7cb8 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -194,8 +194,8 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in ParticleData *particles; /* (parent) particles */ ChildParticle *child; /* child particles */ - struct ParticleEdit *edit; /* particle editmode (runtime) */ - void (*free_edit)(struct ParticleSystem *sys); /* free callback */ + struct PTCacheEdit *edit; /* particle editmode (runtime) */ + void (*free_edit)(struct PTCacheEdit *edit); /* free callback */ struct ParticleCacheKey **pathcache; /* path cache (runtime) */ struct ParticleCacheKey **childcache; /* child cache (runtime) */ @@ -419,7 +419,7 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in #define PSYS_DELETE 256 /* remove particlesystem as soon as possible */ #define PSYS_HAIR_DONE 512 #define PSYS_KEYED 1024 -#define PSYS_EDITED 2048 +//#define PSYS_EDITED 2048 //#define PSYS_PROTECT_CACHE 4096 #define PSYS_DISABLED 8192 @@ -427,11 +427,7 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in #define PARS_UNEXIST 1 #define PARS_NO_DISP 2 #define PARS_STICKY 4 -#define PARS_TRANSFORM 8 -#define PARS_HIDE 16 -#define PARS_TAG 32 -#define PARS_REKEY 64 -#define PARS_EDIT_RECALC 128 +#define PARS_REKEY 8 /* pars->alive */ #define PARS_KILLED 0 diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 20429120812..73afc3d1a53 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -488,10 +488,15 @@ typedef struct ParticleEditSettings { ParticleBrushData brush[7]; /* 7 = PE_TOT_BRUSH */ void *paintcursor; /* runtime */ - float emitterdist; - int draw_timed; + float emitterdist, rt; - int selectmode, pad; + int selectmode; + int edittype; + + int draw_step, fade_frames; + + struct Scene *scene; + struct Object *object; } ParticleEditSettings; typedef struct TransformOrientation { @@ -1042,9 +1047,10 @@ typedef enum SculptFlags { #define PE_LOCK_FIRST 2 #define PE_DEFLECT_EMITTER 4 #define PE_INTERPOLATE_ADDED 8 -#define PE_SHOW_CHILD 16 -#define PE_SHOW_TIME 32 +#define PE_DRAW_PART 16 #define PE_X_MIRROR 64 +#define PE_FADE_TIME 128 +#define PE_AUTO_VELOCITY 256 /* toolsetting->particle brushtype */ #define PE_BRUSH_NONE -1 @@ -1053,11 +1059,15 @@ typedef enum SculptFlags { #define PE_BRUSH_LENGTH 2 #define PE_BRUSH_PUFF 3 #define PE_BRUSH_ADD 4 -#define PE_BRUSH_WEIGHT 5 -#define PE_BRUSH_SMOOTH 6 +#define PE_BRUSH_SMOOTH 5 /* this must equal ParticleEditSettings.brush array size */ -#define PE_TOT_BRUSH 7 +#define PE_TOT_BRUSH 6 + +/* tooksettings->particle edittype */ +#define PE_TYPE_PARTICLES 0 +#define PE_TYPE_SOFTBODY 1 +#define PE_TYPE_CLOTH 2 /* toolsettings->retopo_mode */ #define RETOPO 1 diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index e0dbc232e06..a1f35eca3c2 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -98,6 +98,7 @@ EnumPropertyItem part_hair_ren_as_items[] = { #include "BKE_context.h" #include "BKE_depsgraph.h" #include "BKE_particle.h" +#include "BKE_pointcache.h" #include "BLI_arithb.h" @@ -436,7 +437,30 @@ static void rna_ParticleTarget_name_get(PointerRNA *ptr, char *str) else strcpy(str, "Invalid target!"); } +static int rna_ParticleSystem_multiple_caches_get(PointerRNA *ptr) +{ + ParticleSystem *psys= (ParticleSystem*)ptr->data; + return (psys->ptcaches.first != psys->ptcaches.last); +} +static int rna_ParticleSystem_editable_get(PointerRNA *ptr) +{ + ParticleSystem *psys= (ParticleSystem*)ptr->data; + + if(psys->part && psys->part->type==PART_HAIR) + return (psys->flag & PSYS_HAIR_DONE); + else + return (psys->pointcache->flag & PTCACHE_BAKED); +} +static int rna_ParticleSystem_edited_get(PointerRNA *ptr) +{ + ParticleSystem *psys= (ParticleSystem*)ptr->data; + + if(psys->part && psys->part->type==PART_HAIR) + return (psys->edit && psys->edit->edited); + else + return (psys->pointcache->edit && psys->pointcache->edit->edited); +} EnumPropertyItem from_items[] = { {PART_FROM_VERT, "VERT", 0, "Vertexes", ""}, {PART_FROM_FACE, "FACE", 0, "Faces", ""}, @@ -725,27 +749,10 @@ static void rna_def_particle(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_STICKY); RNA_def_property_ui_text(prop, "sticky", ""); - prop= RNA_def_property(srna, "transform", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_TRANSFORM); - RNA_def_property_ui_text(prop, "transform", ""); - - prop= RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_HIDE); - RNA_def_property_ui_text(prop, "hide", ""); - - prop= RNA_def_property(srna, "tag", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_TAG); - RNA_def_property_ui_text(prop, "tag", ""); - prop= RNA_def_property(srna, "rekey", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_REKEY); RNA_def_property_ui_text(prop, "rekey", ""); - prop= RNA_def_property(srna, "edit_recalc", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_EDIT_RECALC); - RNA_def_property_ui_text(prop, "edit_recalc", ""); - - prop= RNA_def_property(srna, "alive_state", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "alive"); RNA_def_property_enum_items(prop, alive_items); @@ -1907,11 +1914,6 @@ static void rna_def_particle_system(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_ENABLE); RNA_def_property_ui_text(prop, "Use Soft Body", "Enable use of soft body for hair physics simulation."); - prop= RNA_def_property(srna, "editable", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_EDITED); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* various checks needed */ - RNA_def_property_ui_text(prop, "Editable", "For hair particle systems, finalize the hair to enable editing."); - /* reactor */ prop= RNA_def_property(srna, "reactor_target_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "target_ob"); @@ -2089,12 +2091,28 @@ static void rna_def_particle_system(BlenderRNA *brna) RNA_def_property_struct_type(prop, "PointCache"); RNA_def_property_ui_text(prop, "Point Cache", ""); + prop= RNA_def_property(srna, "multiple_caches", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_ParticleSystem_multiple_caches_get", NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Multiple Caches", "Particle system has multiple point caches"); + /* offset ob */ prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "parent"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Parent", "Use this object's coordinate system instead of global coordinate system."); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + + /* hair or cache editing */ + prop= RNA_def_property(srna, "editable", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_ParticleSystem_editable_get", NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Editable", "Particle system can be edited in particle mode"); + + prop= RNA_def_property(srna, "edited", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_ParticleSystem_edited_get", NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Edited", "Particle system has been edited in particle mode"); } void RNA_def_particle(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index c2c906e38f2..fabe0b647ea 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -33,8 +33,34 @@ #include "BKE_paint.h" +#include "WM_types.h" + +static EnumPropertyItem particle_edit_hair_brush_items[] = { + {PE_BRUSH_NONE, "NONE", 0, "None", "Don't use any brush."}, + {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb hairs."}, + {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth hairs."}, + {PE_BRUSH_ADD, "ADD", 0, "Add", "Add hairs."}, + {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make hairs longer or shorter."}, + {PE_BRUSH_PUFF, "PUFF", 0, "Puff", "Make hairs stand up."}, + {PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs."}, + {0, NULL, 0, NULL, NULL}}; + +static EnumPropertyItem particle_edit_cache_brush_items[] = { + {PE_BRUSH_NONE, "NONE", 0, "None", "Don't use any brush."}, + {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb paths."}, + {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth paths."}, + {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make paths longer or shorter."}, + {0, NULL, 0, NULL, NULL}}; + #ifdef RNA_RUNTIME +#include "BKE_context.h" +#include "BKE_pointcache.h" +#include "BKE_particle.h" +#include "BKE_depsgraph.h" + +#include "ED_particle.h" + static PointerRNA rna_ParticleEdit_brush_get(PointerRNA *ptr) { ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data; @@ -46,6 +72,7 @@ static PointerRNA rna_ParticleEdit_brush_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, &RNA_ParticleBrush, brush); } + static PointerRNA rna_ParticleBrush_curve_get(PointerRNA *ptr) { return rna_pointer_inherit_refine(ptr, &RNA_CurveMapping, NULL); @@ -74,6 +101,65 @@ static void rna_Paint_active_brush_set(PointerRNA *ptr, PointerRNA value) paint_brush_set(ptr->data, value.data); } +static void rna_ParticleEdit_redo(bContext *C, PointerRNA *ptr) +{ + PTCacheEdit *edit = PE_get_current(CTX_data_scene(C), CTX_data_active_object(C)); + + if(!edit) + return; + + psys_free_path_cache(NULL, edit); +} + +static void rna_ParticleEdit_update(bContext *C, PointerRNA *ptr) +{ + Scene *scene = CTX_data_scene(C); + Object *ob = CTX_data_active_object(C); + + if(ob) + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); +} + +static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *ptr, int *free) +{ + Scene *scene= CTX_data_scene(C); + PTCacheEdit *edit; + + if(C==NULL) { + EnumPropertyItem *item= NULL; + int totitem= 0; + + /* needed for doc generation */ + RNA_enum_items_add(&item, &totitem, particle_edit_hair_brush_items); + RNA_enum_item_end(&item, &totitem); + + *free= 1; + + return item; + } + + edit = PE_get_current(scene, CTX_data_active_object(C)); + + if(edit && edit->psys) + return particle_edit_hair_brush_items; + + return particle_edit_cache_brush_items; +} + +static int rna_ParticleEdit_editable_get(PointerRNA *ptr) +{ + ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data; + + return (pset->object && PE_get_current(pset->scene, pset->object)); +} +static int rna_ParticleEdit_hair_get(PointerRNA *ptr) +{ + ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data; + + PTCacheEdit *edit = PE_get_current(pset->scene, pset->object); + + return (edit && edit->psys); +} #else static void rna_def_paint(BlenderRNA *brna) @@ -266,17 +352,6 @@ static void rna_def_particle_edit(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - static EnumPropertyItem tool_items[] = { - {PE_BRUSH_NONE, "NONE", 0, "None", "Don't use any brush."}, - {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb hairs."}, - {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth hairs."}, - {PE_BRUSH_WEIGHT, "WEIGHT", 0, "Weight", "Assign weight to hairs."}, - {PE_BRUSH_ADD, "ADD", 0, "Add", "Add hairs."}, - {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make hairs longer or shorter."}, - {PE_BRUSH_PUFF, "PUFF", 0, "Puff", "Make hairs stand up."}, - {PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs."}, - {0, NULL, 0, NULL, NULL}}; - static EnumPropertyItem select_mode_items[] = { {SCE_SELECT_PATH, "PATH", ICON_EDGESEL, "Path", ""}, // XXX icon {SCE_SELECT_POINT, "POINT", ICON_VERTEXSEL, "Point", ""}, // XXX icon @@ -293,6 +368,14 @@ static void rna_def_particle_edit(BlenderRNA *brna) {1, "SHRINK", 0, "Shrink", "Make hairs shorter."}, {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem edit_type_items[]= { + {PE_TYPE_PARTICLES, "PARTICLES", 0, "Particles", ""}, + {PE_TYPE_SOFTBODY, "SOFT_BODY", 0, "Soft body", ""}, + {PE_TYPE_CLOTH, "CLOTH", 0, "Cloth", ""}, + {0, NULL, 0, NULL, NULL} + }; + + /* edit */ srna= RNA_def_struct(brna, "ParticleEdit", NULL); @@ -301,13 +384,15 @@ static void rna_def_particle_edit(BlenderRNA *brna) prop= RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "brushtype"); - RNA_def_property_enum_items(prop, tool_items); + RNA_def_property_enum_items(prop, particle_edit_hair_brush_items); + RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_ParticleEdit_tool_itemf"); RNA_def_property_ui_text(prop, "Tool", ""); prop= RNA_def_property(srna, "selection_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "selectmode"); RNA_def_property_enum_items(prop, select_mode_items); RNA_def_property_ui_text(prop, "Selection Mode", "Particle select and display mode."); + RNA_def_property_update(prop, NC_OBJECT, "rna_ParticleEdit_update"); prop= RNA_def_property(srna, "keep_lengths", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_KEEP_LENGTHS); @@ -326,13 +411,19 @@ static void rna_def_particle_edit(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0.0f, 10.0f, 10, 3); RNA_def_property_ui_text(prop, "Emitter Distance", "Distance to keep particles away from the emitter."); - prop= RNA_def_property(srna, "show_time", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_SHOW_TIME); - RNA_def_property_ui_text(prop, "Show Time", "Show time values of the baked keys."); + prop= RNA_def_property(srna, "fade_time", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_FADE_TIME); + RNA_def_property_ui_text(prop, "Fade Time", "Fade paths and keys further away from current frame."); + RNA_def_property_update(prop, NC_OBJECT, "rna_ParticleEdit_update"); - prop= RNA_def_property(srna, "show_children", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_SHOW_CHILD); - RNA_def_property_ui_text(prop, "Show Children", "Show child particles."); + prop= RNA_def_property(srna, "auto_velocity", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_AUTO_VELOCITY); + RNA_def_property_ui_text(prop, "Auto Velocity", "Calculate point velocities automatically."); + + prop= RNA_def_property(srna, "draw_particles", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DRAW_PART); + RNA_def_property_ui_text(prop, "Draw Particles", "Draw actual particles."); + RNA_def_property_update(prop, NC_OBJECT, NULL); prop= RNA_def_property(srna, "mirror_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_X_MIRROR); @@ -353,6 +444,37 @@ static void rna_def_particle_edit(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, "rna_ParticleEdit_brush_get", NULL, NULL); RNA_def_property_ui_text(prop, "Brush", ""); + prop= RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE); + RNA_def_property_range(prop, 2, 10); + RNA_def_property_ui_text(prop, "Steps", "How many steps to draw the path with."); + RNA_def_property_update(prop, NC_OBJECT, "rna_ParticleEdit_redo"); + + prop= RNA_def_property(srna, "fade_frames", PROP_INT, PROP_NONE); + RNA_def_property_range(prop, 2, 100); + RNA_def_property_ui_text(prop, "Frames", "How many frames to fade."); + RNA_def_property_update(prop, NC_OBJECT, "rna_ParticleEdit_update"); + + prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "edittype"); + RNA_def_property_enum_items(prop, edit_type_items); + RNA_def_property_ui_text(prop, "Type", ""); + RNA_def_property_update(prop, NC_OBJECT, "rna_ParticleEdit_redo"); + + prop= RNA_def_property(srna, "editable", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_editable_get", NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Editable", "A valid edit mode exists"); + + prop= RNA_def_property(srna, "hair", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_hair_get", NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Hair", "Editing hair"); + + prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Object", "The edited object"); + + /* brush */ srna= RNA_def_struct(brna, "ParticleBrush", NULL); From c9041b61c5a9d98cb0880301ded867f495145366 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 29 Aug 2009 15:46:38 +0000 Subject: [PATCH 330/577] fix for problem building --- source/blender/editors/physics/editparticle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/physics/editparticle.c b/source/blender/editors/physics/editparticle.c index dbb11f72890..c0b600edf36 100644 --- a/source/blender/editors/physics/editparticle.c +++ b/source/blender/editors/physics/editparticle.c @@ -3782,7 +3782,7 @@ static int particle_edit_toggle_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); - PTCacheEdit *edit= PE_get_current(scene, ob, PE_settings(scene)->edittype); + PTCacheEdit *edit= PE_get_current(scene, ob); if(!(ob->mode & OB_MODE_PARTICLE_EDIT)) { ob->mode |= OB_MODE_PARTICLE_EDIT; From e6f2f4db285be1ccdc9c9871171afb1f9e2a4f6c Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Sat, 29 Aug 2009 17:13:06 +0000 Subject: [PATCH 331/577] default length for shape key list, so it looks good when empty --- release/ui/buttons_data_mesh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/ui/buttons_data_mesh.py b/release/ui/buttons_data_mesh.py index f91d706ead7..42b637e1f9d 100644 --- a/release/ui/buttons_data_mesh.py +++ b/release/ui/buttons_data_mesh.py @@ -102,7 +102,7 @@ class DATA_PT_shape_keys(DataButtonsPanel): kb = ob.active_shape_key row = layout.row() - row.template_list(key, "keys", ob, "active_shape_key_index") + row.template_list(key, "keys", ob, "active_shape_key_index", rows=2) col = row.column() From afee963155a2776066d377ed590e755217948d0f Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Sat, 29 Aug 2009 17:25:22 +0000 Subject: [PATCH 332/577] First commit draft for network rendering. Docs are here: http://wiki.blender.org/index.php/User:Theeth/netrender Should be easy to test if people want too, just follow the instructions on wiki Code is still very much in flux, so I'd like if people would refrain from making changes (send patches directly to me if you must). The UI side is very crap, it's basically there just to get things testable. See wiki for known bugs. --- release/io/netrender/__init__.py | 9 + release/io/netrender/client.py | 87 +++++ release/io/netrender/master.py | 546 ++++++++++++++++++++++++++++++ release/io/netrender/model.py | 150 ++++++++ release/io/netrender/operators.py | 238 +++++++++++++ release/io/netrender/slave.py | 147 ++++++++ release/io/netrender/ui.py | 290 ++++++++++++++++ release/io/netrender/utils.py | 80 +++++ 8 files changed, 1547 insertions(+) create mode 100644 release/io/netrender/__init__.py create mode 100644 release/io/netrender/client.py create mode 100644 release/io/netrender/master.py create mode 100644 release/io/netrender/model.py create mode 100644 release/io/netrender/operators.py create mode 100644 release/io/netrender/slave.py create mode 100644 release/io/netrender/ui.py create mode 100644 release/io/netrender/utils.py diff --git a/release/io/netrender/__init__.py b/release/io/netrender/__init__.py new file mode 100644 index 00000000000..e0de2726a55 --- /dev/null +++ b/release/io/netrender/__init__.py @@ -0,0 +1,9 @@ +# This directory is a Python package. + +import model +import operators +import client +import slave +import master +import utils +import ui diff --git a/release/io/netrender/client.py b/release/io/netrender/client.py new file mode 100644 index 00000000000..90039a3273a --- /dev/null +++ b/release/io/netrender/client.py @@ -0,0 +1,87 @@ +import bpy +import sys, os +import http, http.client, http.server, urllib +import subprocess, shutil, time, hashlib + +import netrender.slave as slave +import netrender.master as master +from netrender.utils import * + +class NetworkRenderEngine(bpy.types.RenderEngine): + __idname__ = 'NET_RENDER' + __label__ = "Network Render" + def render(self, scene): + if scene.network_render.mode == "RENDER_CLIENT": + self.render_client(scene) + elif scene.network_render.mode == "RENDER_SLAVE": + self.render_slave(scene) + elif scene.network_render.mode == "RENDER_MASTER": + self.render_master(scene) + else: + print("UNKNOWN OPERATION MODE") + + def render_master(self, scene): + server_address = (scene.network_render.server_address, scene.network_render.server_port) + httpd = master.RenderMasterServer(server_address, master.RenderHandler) + httpd.timeout = 1 + httpd.stats = self.update_stats + while not self.test_break(): + httpd.handle_request() + + def render_slave(self, scene): + slave.render_slave(self, scene) + + def render_client(self, scene): + self.update_stats("", "Network render client initiation") + + conn = clientConnection(scene) + + if conn: + # Sending file + + self.update_stats("", "Network render exporting") + + job_id = scene.network_render.job_id + + # reading back result + + self.update_stats("", "Network render waiting for results") + + clientRequestResult(conn, scene, job_id) + response = conn.getresponse() + + if response.status == http.client.NO_CONTENT: + scene.network_render.job_id = clientSendJob(conn, scene) + clientRequestResult(conn, scene, job_id) + + while response.status == http.client.PROCESSING and not self.test_break(): + print("waiting") + time.sleep(1) + clientRequestResult(conn, scene, job_id) + response = conn.getresponse() + + if response.status != http.client.OK: + conn.close() + return + + r = scene.render_data + x= int(r.resolution_x*r.resolution_percentage*0.01) + y= int(r.resolution_y*r.resolution_percentage*0.01) + + f = open(PATH_PREFIX + "output.exr", "wb") + buf = response.read(1024) + + while buf: + f.write(buf) + buf = response.read(1024) + + f.close() + + result = self.begin_result(0, 0, x, y) + result.load_from_file(PATH_PREFIX + "output.exr", 0, 0) + self.end_result(result) + + conn.close() + +bpy.types.register(NetworkRenderEngine) + diff --git a/release/io/netrender/master.py b/release/io/netrender/master.py new file mode 100644 index 00000000000..5a62ef1a8bf --- /dev/null +++ b/release/io/netrender/master.py @@ -0,0 +1,546 @@ +import sys, os +import http, http.client, http.server, urllib +import subprocess, shutil, time, hashlib + +from netrender.utils import * +import netrender.model + + +class MRenderSlave(netrender.model.RenderSlave): + def __init__(self, name, adress, stats): + super().__init__() + self.id = hashlib.md5(bytes(repr(name) + repr(adress), encoding='utf8')).hexdigest() + self.name = name + self.adress = adress + self.stats = stats + self.last_seen = time.time() + + self.job = None + self.frame = None + + netrender.model.RenderSlave._slave_map[self.id] = self + + def seen(self): + self.last_seen = time.time() + +# sorting key for jobs +def groupKey(job): + return (job.framesLeft() > 0, job.priority, job.credits) + +class MRenderJob(netrender.model.RenderJob): + def __init__(self, job_id, name, path, chunks = 1, priority = 1, credits = 100.0, blacklist = []): + super().__init__() + self.id = job_id + self.name = name + self.path = path + self.frames = [] + self.chunks = chunks + self.priority = priority + self.credits = credits + self.blacklist = blacklist + self.last_dispatched = time.time() + + def update(self): + self.credits -= 5 # cost of one frame + self.credits += (time.time() - self.last_dispatched) / 60 + self.last_dispatched = time.time() + + def addFrame(self, frame_number): + frame = MRenderFrame(frame_number) + self.frames.append(frame) + return frame + + def framesLeft(self): + total = 0 + for j in self.frames: + if j.status == QUEUED: + total += 1 + + return total + + def reset(self, all): + for f in self.frames: + f.reset(all) + + def getFrames(self): + frames = [] + for f in self.frames: + if f.status == QUEUED: + self.update() + frames.append(f) + if len(frames) == self.chunks: + break + + return frames + +class MRenderFrame(netrender.model.RenderFrame): + def __init__(self, frame): + super().__init__() + self.number = frame + self.slave = None + self.time = 0 + self.status = QUEUED + + def reset(self, all): + if all or self.status == ERROR: + self.slave = None + self.time = 0 + self.status = QUEUED + + +# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- +# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + +class RenderHandler(http.server.BaseHTTPRequestHandler): + def send_head(self, code = http.client.OK, headers = {}): + self.send_response(code) + self.send_header("Content-type", "application/octet-stream") + + for key, value in headers.items(): + self.send_header(key, value) + + self.end_headers() + + def do_HEAD(self): + print(self.path) + + if self.path == "status": + job_id = self.headers.get('job-id', "") + job_frame = int(self.headers.get('job-frame', -1)) + + if job_id: + print("status:", job_id, "\n") + + job = self.server.getJobByID(job_id) + if job: + if job_frame != -1: + frame = job[frame] + + if not frame: + # no such frame + self.send_heat(http.client.NOT_FOUND) + return + else: + # no such job id + self.send_head(http.client.NOT_FOUND) + return + + self.send_head() + + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + + def do_GET(self): + print(self.path) + + if self.path == "version": + self.send_head() + self.server.stats("", "New client connection") + self.wfile.write(VERSION) + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + elif self.path == "render": + job_id = self.headers['job-id'] + job_frame = int(self.headers['job-frame']) + print("render:", job_id, job_frame) + + job = self.server.getJobByID(job_id) + + if job: + frame = job[job_frame] + + if frame: + if frame.status in (QUEUED, DISPATCHED): + self.send_head(http.client.PROCESSING) + elif frame.status == DONE: + self.server.stats("", "Sending result back to client") + f = open(PATH_PREFIX + job_id + "%04d" % job_frame + ".exr", 'rb') + + self.send_head() + + shutil.copyfileobj(f, self.wfile) + + f.close() + elif frame.status == ERROR: + self.send_head(http.client.NO_CONTENT) + else: + # no such frame + self.send_head(http.client.NOT_FOUND) + else: + # no such job id + self.send_head(http.client.NOT_FOUND) + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + elif self.path == "log": + job_id = self.headers['job-id'] + job_frame = int(self.headers['job-frame']) + print("log:", job_id, job_frame) + + job = self.server.getJobByID(job_id) + + if job: + frame = job[job_frame] + + if frame: + if frame.status in (QUEUED, DISPATCHED): + self.send_head(http.client.PROCESSING) + elif frame.status == DONE: + self.server.stats("", "Sending log back to client") + f = open(PATH_PREFIX + job_id + "%04d" % job_frame + ".log", 'rb') + + self.send_head() + + shutil.copyfileobj(f, self.wfile) + + f.close() + elif frame.status == ERROR: + self.send_head(http.client.NO_CONTENT) + else: + # no such frame + self.send_head(http.client.NOT_FOUND) + else: + # no such job id + self.send_head(http.client.NOT_FOUND) + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + elif self.path == "status": + job_id = self.headers.get('job-id', "") + job_frame = int(self.headers.get('job-frame', -1)) + + if job_id: + print("status:", job_id, "\n") + + job = self.server.getJobByID(job_id) + if job: + if job_frame != -1: + frame = job[frame] + + if frame: + message = frame.serialize() + else: + # no such frame + self.send_heat(http.client.NOT_FOUND) + return + else: + message = job.serialize() + else: + # no such job id + self.send_head(http.client.NOT_FOUND) + return + else: # status of all jobs + message = [] + + for job in self.server: + results = job.status() + + message.append(job.serialize()) + + self.send_head() + self.wfile.write(bytes(repr(message), encoding='utf8')) + + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + elif self.path == "job": + self.server.update() + + slave_id = self.headers['slave-id'] + + print("slave-id", slave_id) + + self.server.getSlave(slave_id) + + slave = self.server.updateSlave(slave_id) + + if slave: # only if slave id is valid + job, frames = self.server.getNewJob(slave_id) + + if job and frames: + for f in frames: + f.status = DISPATCHED + f.slave = slave + + self.send_head(headers={"job-id": job.id}) + + message = job.serialize(frames) + + self.wfile.write(bytes(repr(message), encoding='utf8')) + + self.server.stats("", "Sending job frame to render node") + else: + # no job available, return error code + self.send_head(http.client.NO_CONTENT) + else: # invalid slave id + self.send_head(http.client.NOT_FOUND) + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + elif self.path == "file": + job_id = self.headers['job-id'] + print("file:", job_id, "\n") + + job = self.server.getJobByID(job_id) + + if job: + self.send_head(headers={"job-id": job.id}) + + self.server.stats("", "Sending file to render node") + f = open(PATH_PREFIX + job.id + ".blend", 'rb') + + shutil.copyfileobj(f, self.wfile) + + f.close() + else: + # no such job id + self.send_head(http.client.NOT_FOUND) + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + elif self.path == "slave": + message = [] + + for slave in self.server.slaves: + message.append(slave.serialize()) + + self.send_head() + + self.wfile.write(bytes(repr(message), encoding='utf8')) + + + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + def do_POST(self): + print(self.path) + + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + if self.path == "job": + print("posting job info") + self.server.stats("", "Receiving job") + + length = int(self.headers['content-length']) + job_frame_string = self.headers['job-frame'] + job_name = self.headers.get('job-name', "") + job_chunks = int(self.headers.get('job-chunks', "1")) + blacklist = self.headers.get('slave-blacklist', '').split() + + print("blacklist", blacklist) + + job_path = str(self.rfile.read(length), encoding='utf8') + + if os.path.exists(job_path): + f = open(job_path, "rb") + buf = f.read() + f.close() + + job_id = hashlib.md5(buf).hexdigest() + + del buf + + job = self.server.getJobByID(job_id) + + if job == None: + job = MRenderJob(job_id, job_name, job_path, chunks = job_chunks, blacklist = blacklist) + self.server.addJob(job) + + if ":" in job_frame_string: + frame_start, frame_end = [int(x) for x in job_frame_string.split(":")] + + for job_frame in range(frame_start, frame_end + 1): + frame = job.addFrame(job_frame) + else: + job_frame = int(job_frame_string) + frame = job.addFrame(job_frame) + + self.send_head(headers={"job-id": job_id}) + else: + self.send_head(http.client.NOT_FOUND) + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + elif self.path == "cancel": + job_id = self.headers.get('job-id', "") + if job_id: + print("cancel:", job_id, "\n") + self.server.removeJob(job_id) + else: # cancel all jobs + self.server.clear() + + self.send_head() + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + elif self.path == "reset": + job_id = self.headers.get('job-id', "") + job_frame = int(self.headers.get('job-frame', "-1")) + all = bool(self.headers.get('reset-all', "False")) + + job = self.server.getJobByID(job_id) + + if job: + if job_frame != -1: + job[job_frame].reset(all) + else: + job.reset(all) + + self.send_head() + else: # job not found + self.send_head(http.client.NOT_FOUND) + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + elif self.path == "slave": + length = int(self.headers['content-length']) + job_frame_string = self.headers['job-frame'] + + name, stats = eval(str(self.rfile.read(length), encoding='utf8')) + + slave_id = self.server.addSlave(name, self.client_address, stats) + + self.send_head(headers = {"slave-id": slave_id}) + + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + # -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + def do_PUT(self): + print(self.path) + + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + if self.path == "file": + print("writing blend file") + self.server.stats("", "Receiving job") + + length = int(self.headers['content-length']) + job_frame_string = self.headers['job-frame'] + job_name = self.headers.get('job-name', "") + job_chunks = int(self.headers.get('job-chunks', "1")) + blacklist = self.headers.get('slave-blacklist', '').split() + + buf = self.rfile.read(length) + + job_id = hashlib.md5(buf).hexdigest() + + job_path = job_id + ".blend" + + f = open(PATH_PREFIX + job_path, "wb") + f.write(buf) + f.close() + + del buf + + job = self.server.getJobByID(job_id) + + if job == None: + job = MRenderJob(job_id, job_name, job_path, chunks = job_chunks, blacklist = blacklist) + self.server.addJob(job) + + if ":" in job_frame_string: + frame_start, frame_end = [int(x) for x in job_frame_string.split(":")] + + for job_frame in range(frame_start, frame_end + 1): + frame = job.addFrame(job_frame) + else: + job_frame = int(job_frame_string) + frame = job.addFrame(job_frame) + + self.send_head(headers={"job-id": job_id}) + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + elif self.path == "render": + print("writing result file") + self.server.stats("", "Receiving render result") + + job_id = self.headers['job-id'] + job_frame = int(self.headers['job-frame']) + job_result = int(self.headers['job-result']) + job_time = float(self.headers['job-time']) + + if job_result == DONE: + length = int(self.headers['content-length']) + buf = self.rfile.read(length) + f = open(PATH_PREFIX + job_id + "%04d" % job_frame + ".exr", 'wb') + f.write(buf) + f.close() + + del buf + + job = self.server.getJobByID(job_id) + frame = job[job_frame] + frame.status = job_result + frame.time = job_time + + self.server.updateSlave(self.headers['slave-id']) + + self.send_head() + # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + elif self.path == "log": + print("writing log file") + self.server.stats("", "Receiving log file") + + length = int(self.headers['content-length']) + job_id = self.headers['job-id'] + job_frame = int(self.headers['job-frame']) + + print("log length:", length) + + buf = self.rfile.read(length) + f = open(PATH_PREFIX + job_id + "%04d" % job_frame + ".log", 'wb') + f.write(buf) + f.close() + + del buf + + self.server.updateSlave(self.headers['slave-id']) + + self.send_head() + + +class RenderMasterServer(http.server.HTTPServer): + def __init__(self, address, handler_class): + super().__init__(address, handler_class) + self.jobs = [] + self.jobs_map = {} + self.slaves = [] + self.slaves_map = {} + + def addSlave(self, name, adress, stats): + slave = MRenderSlave(name, adress, stats) + self.slaves.append(slave) + self.slaves_map[slave.id] = slave + + return slave.id + + def getSlave(self, slave_id): + return self.slaves_map.get(slave_id, None) + + def updateSlave(self, slave_id): + slave = self.getSlave(slave_id) + if slave: + slave.seen() + + return slave + + def clear(self): + self.jobs_map = {} + self.jobs = [] + + def update(self): + self.jobs.sort(key = groupKey) + + def removeJob(self, id): + job = self.jobs_map.pop(id) + + if job: + self.jobs.remove(job) + + def addJob(self, job): + self.jobs.append(job) + self.jobs_map[job.id] = job + + def getJobByID(self, id): + return self.jobs_map.get(id, None) + + def __iter__(self): + for job in self.jobs: + yield job + + def getNewJob(self, slave_id): + if self.jobs: + for job in reversed(self.jobs): + if job.framesLeft() > 0 and slave_id not in job.blacklist: + return job, job.getFrames() + + return None, None diff --git a/release/io/netrender/model.py b/release/io/netrender/model.py new file mode 100644 index 00000000000..6e68929d340 --- /dev/null +++ b/release/io/netrender/model.py @@ -0,0 +1,150 @@ +import sys, os +import http, http.client, http.server, urllib +import subprocess, shutil, time, hashlib + +from netrender.utils import * + +class RenderSlave: + _slave_map = {} + + def __init__(self): + self.id = "" + self.name = "" + self.adress = (0,0) + self.stats = "" + self.total_done = 0 + self.total_error = 0 + self.last_seen = 0.0 + + def serialize(self): + return { + "id": self.id, + "name": self.name, + "adress": self.adress, + "stats": self.stats, + "total_done": self.total_done, + "total_error": self.total_error, + "last_seen": self.last_seen + } + + @staticmethod + def materialize(data): + if not data: + return None + + slave_id = data["id"] + + if slave_id in RenderSlave._slave_map: + return RenderSlave._slave_map[slave_id] + else: + slave = RenderSlave() + slave.id = slave_id + slave.name = data["name"] + slave.adress = data["adress"] + slave.stats = data["stats"] + slave.total_done = data["total_done"] + slave.total_error = data["total_error"] + slave.last_seen = data["last_seen"] + + RenderSlave._slave_map[slave_id] = slave + + return slave + +class RenderJob: + def __init__(self): + self.id = "" + self.name = "" + self.path = "" + self.frames = [] + self.chunks = 0 + self.priority = 0 + self.credits = 0 + self.blacklist = [] + self.last_dispatched = 0.0 + + def __len__(self): + return len(self.frames) + + def status(self): + results = { + QUEUED: 0, + DISPATCHED: 0, + DONE: 0, + ERROR: 0 + } + + for frame in self.frames: + results[frame.status] += 1 + + return results + + def __contains__(self, frame_number): + for f in self.frames: + if f.number == frame_number: + return True + else: + return False + + def __getitem__(self, frame_number): + for f in self.frames: + if f.number == frame_number: + return f + else: + return None + + def serialize(self, frames = None): + return { + "id": self.id, + "name": self.name, + "path": self.path, + "frames": [f.serialize() for f in self.frames if not frames or f in frames], + "priority": self.priority, + "credits": self.credits, + "blacklist": self.blacklist, + "last_dispatched": self.last_dispatched + } + + @staticmethod + def materialize(data): + if not data: + return None + + job = RenderJob() + job.id = data["id"] + job.name = data["name"] + job.path = data["path"] + job.frames = [RenderFrame.materialize(f) for f in data["frames"]] + job.priority = data["priority"] + job.credits = data["credits"] + job.blacklist = data["blacklist"] + job.last_dispatched = data["last_dispatched"] + + return job + +class RenderFrame: + def __init__(self): + self.number = 0 + self.time = 0 + self.status = QUEUED + self.slave = None + + def serialize(self): + return { + "number": self.number, + "time": self.time, + "status": self.status, + "slave": None if not self.slave else self.slave.serialize() + } + + @staticmethod + def materialize(data): + if not data: + return None + + frame = RenderFrame() + frame.number = data["number"] + frame.time = data["time"] + frame.status = data["status"] + frame.slave = RenderSlave.materialize(data["slave"]) + + return frame diff --git a/release/io/netrender/operators.py b/release/io/netrender/operators.py new file mode 100644 index 00000000000..3355c3d1a0b --- /dev/null +++ b/release/io/netrender/operators.py @@ -0,0 +1,238 @@ +import bpy +import sys, os +import http, http.client, http.server, urllib + +from netrender.utils import * +import netrender.model + +class RENDER_OT_netclientsend(bpy.types.Operator): + ''' + Operator documentation text, will be used for the operator tooltip and python docs. + ''' + __idname__ = "render.netclientsend" + __label__ = "Net Render Client Send" + + # List of operator properties, the attributes will be assigned + # to the class instance from the operator settings before calling. + + __props__ = [] + + def poll(self, context): + return True + + def execute(self, context): + scene = context.scene + + conn = clientConnection(scene) + + if conn: + # Sending file + scene.network_render.job_id = clientSendJob(conn, scene, True) + + return ('FINISHED',) + + def invoke(self, context, event): + return self.execute(context) + +class RENDER_OT_netclientstatus(bpy.types.Operator): + '''Operator documentation text, will be used for the operator tooltip and python docs.''' + __idname__ = "render.netclientstatus" + __label__ = "Net Render Client Status" + + # List of operator properties, the attributes will be assigned + # to the class instance from the operator settings before calling. + + __props__ = [] + + def poll(self, context): + return True + + def execute(self, context): + netprops = context.scene.network_render + conn = clientConnection(context.scene) + + if conn: + conn.request("GET", "status") + + response = conn.getresponse() + print( response.status, response.reason ) + + jobs = (netrender.model.RenderJob.materialize(j) for j in eval(str(response.read(), encoding='utf8'))) + + while(len(netprops.jobs) > 0): + netprops.jobs.remove(0) + + for j in jobs: + netprops.jobs.add() + job = netprops.jobs[-1] + + job_results = j.status() + + job.id = j.id + job.name = j.name + job.length = len(j) + job.done = job_results[DONE] + job.error = job_results[ERROR] + + return ('FINISHED',) + + def invoke(self, context, event): + return self.execute(context) + +class RENDER_OT_netclientblacklistslave(bpy.types.Operator): + '''Operator documentation text, will be used for the operator tooltip and python docs.''' + __idname__ = "render.netclientblacklistslave" + __label__ = "Net Render Client Blacklist Slave" + + # List of operator properties, the attributes will be assigned + # to the class instance from the operator settings before calling. + + __props__ = [] + + def poll(self, context): + return True + + def execute(self, context): + netprops = context.scene.network_render + + if netprops.active_slave_index >= 0: + + slave = netrender.slaves[netprops.active_slave_index] + + netprops.slaves_blacklist.add() + + netprops.slaves_blacklist[-1].id = slave.id + netprops.slaves_blacklist[-1].name = slave.name + netprops.slaves_blacklist[-1].adress = slave.adress + netprops.slaves_blacklist[-1].last_seen = slave.last_seen + netprops.slaves_blacklist[-1].stats = slave.stats + + netprops.slaves.remove(netprops.active_slave_index) + netprops.active_slave_index = -1 + + return ('FINISHED',) + + def invoke(self, context, event): + return self.execute(context) + +class RENDER_OT_netclientwhitelistslave(bpy.types.Operator): + '''Operator documentation text, will be used for the operator tooltip and python docs.''' + __idname__ = "render.netclientwhitelistslave" + __label__ = "Net Render Client Whitelist Slave" + + # List of operator properties, the attributes will be assigned + # to the class instance from the operator settings before calling. + + __props__ = [] + + def poll(self, context): + return True + + def execute(self, context): + netprops = context.scene.network_render + + if netprops.active_blacklisted_slave_index >= 0: + + slave = netprops.slaves_blacklist[netprops.active_blacklisted_slave_index] + + netprops.slaves.add() + + netprops.slaves[-1].id = slave.id + netprops.slaves[-1].name = slave.name + netprops.slaves[-1].adress = slave.adress + netprops.slaves[-1].last_seen = slave.last_seen + netprops.slaves[-1].stats = slave.stats + + netprops.slaves_blacklist.remove(netprops.active_blacklisted_slave_index) + netprops.active_blacklisted_slave_index = -1 + + return ('FINISHED',) + + def invoke(self, context, event): + return self.execute(context) + + +class RENDER_OT_netclientslaves(bpy.types.Operator): + '''Operator documentation text, will be used for the operator tooltip and python docs.''' + __idname__ = "render.netclientslaves" + __label__ = "Net Render Client Slaves" + + # List of operator properties, the attributes will be assigned + # to the class instance from the operator settings before calling. + + __props__ = [] + + def poll(self, context): + return True + + def execute(self, context): + netprops = context.scene.network_render + conn = clientConnection(context.scene) + + if conn: + conn.request("GET", "slave") + + response = conn.getresponse() + print( response.status, response.reason ) + + slaves = (netrender.model.RenderSlave.materialize(s) for s in eval(str(response.read(), encoding='utf8'))) + + while(len(netprops.slaves) > 0): + netprops.slaves.remove(0) + + for s in slaves: + for slave in netprops.slaves_blacklist: + if slave.id == s.id: + break + + netprops.slaves.add() + slave = netprops.slaves[-1] + + slave.id = s.id + slave.name = s.name + slave.stats = s.stats + slave.adress = s.adress[0] + slave.last_seen = time.ctime(s.last_seen) + + return ('FINISHED',) + + def invoke(self, context, event): + return self.execute(context) + +class RENDER_OT_netclientcancel(bpy.types.Operator): + '''Operator documentation text, will be used for the operator tooltip and python docs.''' + __idname__ = "render.netclientcancel" + __label__ = "Net Render Client Cancel" + + # List of operator properties, the attributes will be assigned + # to the class instance from the operator settings before calling. + + __props__ = [] + + def poll(self, context): + netrender = scene.network_render + return netrender.active_job_index >= 0 and len(netrender.jobs) > 0 + + def execute(self, context): + netprops = context.scene.network_render + conn = clientConnection(context.scene) + + if conn: + job = netprops.jobs[netrender.active_job_index] + + conn.request("POST", "cancel", headers={"job-id":job.id}) + + response = conn.getresponse() + print( response.status, response.reason ) + + return ('FINISHED',) + + def invoke(self, context, event): + return self.execute(context) + +bpy.ops.add(RENDER_OT_netclientsend) +bpy.ops.add(RENDER_OT_netclientstatus) +bpy.ops.add(RENDER_OT_netclientslaves) +bpy.ops.add(RENDER_OT_netclientblacklistslave) +bpy.ops.add(RENDER_OT_netclientwhitelistslave) +bpy.ops.add(RENDER_OT_netclientcancel) \ No newline at end of file diff --git a/release/io/netrender/slave.py b/release/io/netrender/slave.py new file mode 100644 index 00000000000..03c6803955e --- /dev/null +++ b/release/io/netrender/slave.py @@ -0,0 +1,147 @@ +import sys, os +import http, http.client, http.server, urllib +import subprocess, time + +from netrender.utils import * +import netrender.model + +CANCEL_POLL_SPEED = 2 +MAX_TIMEOUT = 10 +INCREMENT_TIMEOUT = 1 + +def slave_Info(): + sysname, nodename, release, version, machine = os.uname() + return (nodename, sysname + " " + release + " " + machine) + +def testCancel(conn, job_id): + conn.request("HEAD", "status", headers={"job-id":job_id}) + response = conn.getresponse() + + # cancelled if job isn't found anymore + if response.status == http.client.NOT_FOUND: + return True + else: + return False + +def render_slave(engine, scene): + NODE_PREFIX = PATH_PREFIX + "node" + os.sep + timeout = 1 + + if not os.path.exists(NODE_PREFIX): + os.mkdir(NODE_PREFIX) + + engine.update_stats("", "Network render node initiation") + + conn = clientConnection(scene) + + if conn: + conn.request("POST", "slave", repr(slave_Info())) + response = conn.getresponse() + + slave_id = response.getheader("slave-id") + + while not engine.test_break(): + + conn.request("GET", "job", headers={"slave-id":slave_id}) + response = conn.getresponse() + + if response.status == http.client.OK: + timeout = 1 # reset timeout on new job + + job = netrender.model.RenderJob.materialize(eval(str(response.read(), encoding='utf8'))) + + print("File:", job.path) + engine.update_stats("", "Render File", job.path, "for job", job.id) + + if os.path.isabs(job.path): + # if an absolute path, make sure path exists, if it doesn't, use relative local path + job_full_path = job.path + if not os.path.exists(job_full_path): + job_full_path = NODE_PREFIX + job.id + ".blend" + else: + job_full_path = NODE_PREFIX + job.path + + if not os.path.exists(job_full_path): + conn.request("GET", "file", headers={"job-id": job.id, "slave-id":slave_id}) + response = conn.getresponse() + + if response.status != http.client.OK: + break # file for job not returned by server, need to return an error code to server + + f = open(job_full_path, "wb") + buf = response.read(1024) + + while buf: + f.write(buf) + buf = response.read(1024) + + f.close() + + frame_args = [] + + for frame in job.frames: + frame_args += ["-f", str(frame.number)] + + start_t = time.time() + + process = subprocess.Popen([sys.argv[0], "-b", job_full_path, "-o", NODE_PREFIX + job.id, "-E", "BLENDER_RENDER", "-F", "MULTILAYER"] + frame_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + + cancelled = False + stdout = bytes() + run_t = time.time() + while process.poll() == None and not cancelled: + stdout += process.stdout.read(32) + current_t = time.time() + cancelled = engine.test_break() + if current_t - run_t > CANCEL_POLL_SPEED: + if testCancel(conn, job.id): + cancelled = True + else: + run_t = current_t + + if cancelled: + continue # to next frame + + total_t = time.time() - start_t + + avg_t = total_t / len(job.frames) + + status = process.returncode + + print("status", status) + + headers = {"job-id":job.id, "slave-id":slave_id, "job-time":str(avg_t)} + + if status == 0: # non zero status is error + headers["job-result"] = str(DONE) + for frame in job.frames: + headers["job-frame"] = str(frame.number) + # send result back to server + f = open(NODE_PREFIX + job.id + "%04d" % frame.number + ".exr", 'rb') + conn.request("PUT", "render", f, headers=headers) + f.close() + response = conn.getresponse() + else: + headers["job-result"] = str(ERROR) + for frame in job.frames: + headers["job-frame"] = str(frame.number) + # send error result back to server + conn.request("PUT", "render", headers=headers) + response = conn.getresponse() + + for frame in job.frames: + headers["job-frame"] = str(frame.number) + # send log in any case + conn.request("PUT", "log", stdout, headers=headers) + response = conn.getresponse() + else: + if timeout < MAX_TIMEOUT: + timeout += INCREMENT_TIMEOUT + + for i in range(timeout): + time.sleep(1) + if engine.test_break(): + conn.close() + return + + conn.close() diff --git a/release/io/netrender/ui.py b/release/io/netrender/ui.py new file mode 100644 index 00000000000..2fd2b9a317f --- /dev/null +++ b/release/io/netrender/ui.py @@ -0,0 +1,290 @@ +import bpy +import sys, os +import http, http.client, http.server, urllib +import subprocess, shutil, time, hashlib + +import netrender.slave as slave +import netrender.master as master + +VERSION = b"0.3" + +PATH_PREFIX = "/tmp/" + +QUEUED = 0 +DISPATCHED = 1 +DONE = 2 +ERROR = 3 + +class RenderButtonsPanel(bpy.types.Panel): + __space_type__ = "PROPERTIES" + __region_type__ = "WINDOW" + __context__ = "scene" + # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here + + def poll(self, context): + rd = context.scene.render_data + return (rd.use_game_engine==False) and (rd.engine in self.COMPAT_ENGINES) + +# Setting panel, use in the scene for now. +class SCENE_PT_network_settings(RenderButtonsPanel): + __label__ = "Network Settings" + COMPAT_ENGINES = set(['NET_RENDER']) + + def draw_header(self, context): + layout = self.layout + scene = context.scene + + def draw(self, context): + layout = self.layout + scene = context.scene + rd = scene.render_data + + layout.active = True + + split = layout.split() + + col = split.column() + + col.itemR(scene.network_render, "mode") + col.itemR(scene.network_render, "server_address") + col.itemR(scene.network_render, "server_port") + + if scene.network_render.mode == "RENDER_CLIENT": + col.itemR(scene.network_render, "chunks") + col.itemR(scene.network_render, "job_name") + col.itemO("render.netclientsend", text="send job to server") +bpy.types.register(SCENE_PT_network_settings) + +class SCENE_PT_network_slaves(RenderButtonsPanel): + __label__ = "Slaves Status" + COMPAT_ENGINES = set(['NET_RENDER']) + + def poll(self, context): + scene = context.scene + return super().poll(context) and scene.network_render.mode == "RENDER_CLIENT" + + def draw(self, context): + layout = self.layout + + scene = context.scene + netrender = scene.network_render + + row = layout.row() + row.template_list(netrender, "slaves", netrender, "active_slave_index", rows=2) + + col = row.column() + + subcol = col.column(align=True) + subcol.itemO("render.netclientslaves", icon="ICON_FILE_REFRESH", text="") + subcol.itemO("render.netclientblacklistslave", icon="ICON_ZOOMOUT", text="") + + if netrender.active_slave_index >= 0 and len(netrender.slaves) > 0: + layout.itemS() + + slave = netrender.slaves[netrender.active_slave_index] + + layout.itemL(text="Name: " + slave.name) + layout.itemL(text="Adress: " + slave.adress) + layout.itemL(text="Seen: " + slave.last_seen) + layout.itemL(text="Stats: " + slave.stats) + +bpy.types.register(SCENE_PT_network_slaves) + +class SCENE_PT_network_slaves_blacklist(RenderButtonsPanel): + __label__ = "Slaves Blacklist" + COMPAT_ENGINES = set(['NET_RENDER']) + + def poll(self, context): + scene = context.scene + return super().poll(context) and scene.network_render.mode == "RENDER_CLIENT" + + def draw(self, context): + layout = self.layout + + scene = context.scene + netrender = scene.network_render + + row = layout.row() + row.template_list(netrender, "slaves_blacklist", netrender, "active_blacklisted_slave_index", rows=2) + + col = row.column() + + subcol = col.column(align=True) + subcol.itemO("render.netclientwhitelistslave", icon="ICON_ZOOMOUT", text="") + + + if netrender.active_blacklisted_slave_index >= 0 and len(netrender.slaves_blacklist) > 0: + layout.itemS() + + slave = netrender.slaves_blacklist[netrender.active_blacklisted_slave_index] + + layout.itemL(text="Name: " + slave.name) + layout.itemL(text="Adress: " + slave.adress) + layout.itemL(text="Seen: " + slave.last_seen) + layout.itemL(text="Stats: " + slave.stats) + +bpy.types.register(SCENE_PT_network_slaves_blacklist) + +class SCENE_PT_network_jobs(RenderButtonsPanel): + __label__ = "Jobs" + COMPAT_ENGINES = set(['NET_RENDER']) + + def poll(self, context): + scene = context.scene + return super().poll(context) and scene.network_render.mode == "RENDER_CLIENT" + + def draw(self, context): + layout = self.layout + + scene = context.scene + netrender = scene.network_render + + row = layout.row() + row.template_list(netrender, "jobs", netrender, "active_job_index", rows=2) + + col = row.column() + + subcol = col.column(align=True) + subcol.itemO("render.netclientstatus", icon="ICON_FILE_REFRESH", text="") + subcol.itemO("render.netclientcancel", icon="ICON_ZOOMOUT", text="") + + + if netrender.active_job_index >= 0 and len(netrender.jobs) > 0: + layout.itemS() + + job = netrender.jobs[netrender.active_job_index] + + layout.itemL(text="Name: %s" % job.name) + layout.itemL(text="Length: %04i" % job.length) + layout.itemL(text="Done: %04i" % job.done) + layout.itemL(text="Error: %04i" % job.error) + +bpy.types.register(SCENE_PT_network_jobs) + +class NetRenderSettings(bpy.types.IDPropertyGroup): + pass + +class NetRenderSlave(bpy.types.IDPropertyGroup): + pass + +class NetRenderJob(bpy.types.IDPropertyGroup): + pass + +bpy.types.register(NetRenderSettings) +bpy.types.register(NetRenderSlave) +bpy.types.register(NetRenderJob) + +bpy.types.Scene.PointerProperty(attr="network_render", type=NetRenderSettings, name="Network Render", description="Network Render Settings") + +NetRenderSettings.StringProperty( attr="server_address", + name="Server address", + description="IP or name of the master render server", + maxlen = 128, + default = "127.0.0.1") + +NetRenderSettings.IntProperty( attr="server_port", + name="Server port", + description="port of the master render server", + default = 8000, + min=1, + max=65535) + +NetRenderSettings.StringProperty( attr="job_name", + name="Job name", + description="Name of the job", + maxlen = 128, + default = "[default]") + +NetRenderSettings.IntProperty( attr="chunks", + name="Chunks", + description="Number of frame to dispatch to each slave in one chunk", + default = 5, + min=1, + max=65535) + +NetRenderSettings.StringProperty( attr="job_id", + name="Network job id", + description="id of the last sent render job", + maxlen = 64, + default = "") + +NetRenderSettings.IntProperty( attr="active_slave_index", + name="Index of the active slave", + description="", + default = -1, + min= -1, + max=65535) + +NetRenderSettings.IntProperty( attr="active_blacklisted_slave_index", + name="Index of the active slave", + description="", + default = -1, + min= -1, + max=65535) + +NetRenderSettings.IntProperty( attr="active_job_index", + name="Index of the active job", + description="", + default = -1, + min= -1, + max=65535) + +NetRenderSettings.EnumProperty(attr="mode", + items=( + ("RENDER_CLIENT", "Client", "Act as render client"), + ("RENDER_MASTER", "Master", "Act as render master"), + ("RENDER_SLAVE", "Slave", "Act as render slave"), + ), + name="network mode", + description="mode of operation of this instance", + default="RENDER_CLIENT") + +NetRenderSettings.CollectionProperty(attr="slaves", type=NetRenderSlave, name="Slaves", description="") +NetRenderSettings.CollectionProperty(attr="slaves_blacklist", type=NetRenderSlave, name="Slaves Blacklist", description="") +NetRenderSettings.CollectionProperty(attr="jobs", type=NetRenderJob, name="Job List", description="") + +NetRenderSlave.StringProperty( attr="name", + name="Name of the slave", + description="", + maxlen = 64, + default = "") + +NetRenderSlave.StringProperty( attr="adress", + name="Adress of the slave", + description="", + maxlen = 64, + default = "") + +NetRenderJob.StringProperty( attr="id", + name="ID of the job", + description="", + maxlen = 64, + default = "") + + +NetRenderJob.StringProperty( attr="name", + name="Name of the job", + description="", + maxlen = 128, + default = "") + +NetRenderJob.IntProperty( attr="length", + name="Number of frames", + description="", + default = 0, + min= 0, + max=65535) + +NetRenderJob.IntProperty( attr="done", + name="Number of frames rendered", + description="", + default = 0, + min= 0, + max=65535) + +NetRenderJob.IntProperty( attr="error", + name="Number of frames in error", + description="", + default = 0, + min= 0, + max=65535) diff --git a/release/io/netrender/utils.py b/release/io/netrender/utils.py new file mode 100644 index 00000000000..c158ff115fa --- /dev/null +++ b/release/io/netrender/utils.py @@ -0,0 +1,80 @@ +import bpy +import sys, os +import http, http.client, http.server, urllib +import subprocess, shutil, time, hashlib + +VERSION = b"0.3" + +PATH_PREFIX = "/tmp/" + +QUEUED = 0 +DISPATCHED = 1 +DONE = 2 +ERROR = 3 + +def clientConnection(scene): + netrender = scene.network_render + + conn = http.client.HTTPConnection(netrender.server_address, netrender.server_port) + + if clientVerifyVersion(conn): + return conn + else: + conn.close() + return None + +def clientVerifyVersion(conn): + conn.request("GET", "version") + response = conn.getresponse() + + if response.status != http.client.OK: + conn.close() + return False + + server_version = response.read() + + if server_version != VERSION: + print("Incorrect server version!") + print("expected", VERSION, "received", server_version) + return False + + return True + +def clientSendJob(conn, scene, anim = False, chunks = 5): + + if anim: + job_frame = "%i:%i" % (scene.start_frame, scene.end_frame) + else: + job_frame = "%i" % (scene.current_frame, ) + + blacklist = [] + + filename = bpy.data.filename + + name = scene.network_render.job_name + + if name == "[default]": + path, name = os.path.split(filename) + + for slave in scene.network_render.slaves_blacklist: + blacklist.append(slave.id) + + blacklist = " ".join(blacklist) + + headers = {"job-frame":job_frame, "job-name":name, "job-chunks": str(chunks), "slave-blacklist": blacklist} + + # try to send path first + conn.request("POST", "job", filename, headers=headers) + response = conn.getresponse() + + # if not found, send whole file + if response.status == http.client.NOT_FOUND: + f = open(bpy.data.filename, "rb") + conn.request("PUT", "file", f, headers=headers) + f.close() + response = conn.getresponse() + + return response.getheader("job-id") + +def clientRequestResult(conn, scene, job_id): + conn.request("GET", "render", headers={"job-id": job_id, "job-frame":str(scene.current_frame)}) From 47190b2009f528df4050ac8ac0216990d5e12a53 Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Sat, 29 Aug 2009 17:25:26 +0000 Subject: [PATCH 333/577] Missing null check in particle edit code caused a crash when using search boxes. --- source/blender/editors/physics/editparticle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/physics/editparticle.c b/source/blender/editors/physics/editparticle.c index c0b600edf36..220928cb79c 100644 --- a/source/blender/editors/physics/editparticle.c +++ b/source/blender/editors/physics/editparticle.c @@ -199,7 +199,7 @@ PTCacheEdit *PE_get_current(Scene *scene, Object *ob) BKE_ptcache_ids_from_object(&pidlist, ob); /* in the case of only one editable thing, set pset->edittype accordingly */ - if(pidlist.first == pidlist.last) { + if(pidlist.first && pidlist.first == pidlist.last) { pid = pidlist.first; switch(pid->type) { case PTCACHE_TYPE_PARTICLES: From a261330d5c5622701a46d0ce2da95929ece89406 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sat, 29 Aug 2009 18:02:37 +0000 Subject: [PATCH 334/577] 2.5: Bugfix: Preview-Render didn't update when changing material/texture id block/slot. --- source/blender/makesrna/intern/rna_material.c | 2 ++ source/blender/makesrna/intern/rna_object.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index db573f0a666..9d51c687d09 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -1658,11 +1658,13 @@ void rna_def_mtex_common(StructRNA *srna, const char *begin, const char *activeg RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_pointer_funcs(prop, activeget, activeset, NULL); RNA_def_property_ui_text(prop, "Active Texture", "Active texture slot being displayed."); + RNA_def_property_update(prop, NC_TEXTURE|ND_SHADING_DRAW, NULL); prop= RNA_def_property(srna, "active_texture_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "texact"); RNA_def_property_range(prop, 0, MAX_MTEX-1); RNA_def_property_ui_text(prop, "Active Texture Index", "Index of active texture slot."); + RNA_def_property_update(prop, NC_TEXTURE|ND_SHADING_DRAW, NULL); } #endif diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index cae96b0af4b..0535ae131bc 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1141,7 +1141,8 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "actcol"); RNA_def_property_int_funcs(prop, "rna_Object_active_material_index_get", "rna_Object_active_material_index_set", "rna_Object_active_material_index_range"); RNA_def_property_ui_text(prop, "Active Material Index", "Index of active material slot."); - + RNA_def_property_update(prop, NC_OBJECT|ND_SHADING, NULL); + /* transform */ prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION); From 5ab556e0668ef7811e2ac69121813e16bce10146 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Sat, 29 Aug 2009 20:29:29 +0000 Subject: [PATCH 335/577] bugfix: on windows, it wouldn't correctly recognize directories and import python modules on load. BLI_exist vs BLI_exists (fun times were had by all) --- source/blender/python/intern/bpy_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 43db337c6db..ac8acc2c07c 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -618,7 +618,7 @@ void BPY_run_ui_scripts(bContext *C, int reload) } } #ifndef __linux__ - else if( BLI_join_dirfile(path, dirname, de->d_name), S_ISDIR(BLI_exists(path))) { + else if( BLI_join_dirfile(path, dirname, de->d_name), S_ISDIR(BLI_exist(path))) { #else else if(de->d_type==DT_DIR) { BLI_join_dirfile(path, dirname, de->d_name); From 7a562283434ea143cd6ec26b529dd3ea33047aa4 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sat, 29 Aug 2009 21:51:58 +0000 Subject: [PATCH 336/577] 2.5 Paint: * Don't do shared vertex colors for every vpaint dot. Profiling on a large mesh showed vpaint spent about 65% of the time in this function, but most of the time no difference will be apparent in the result. (Could make an operator so the user can force this operation after doing some painting.) TODO: Profiling now shows most time spent in drawing the mesh. (This is done twice for vpaint, the first time for finding backbuf sampling.) --- source/blender/editors/sculpt_paint/paint_vertex.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 581d10ee883..f66a9fbc1ed 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1733,8 +1733,6 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P MTC_Mat4SwapMat4(vc->rv3d->persmat, mat); - do_shared_vertexcol(me); - ED_region_tag_redraw(vc->ar); DAG_object_flush_update(vc->scene, ob, OB_RECALC_DATA); From c6ccf5fd2e9ff8a0bfe045c85e4675b3a8940255 Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Sat, 29 Aug 2009 21:52:57 +0000 Subject: [PATCH 337/577] Cloth didn't update properly in particle mode. Don't understand why the particle mode check was there to begin with, but if removing it causes trouble later on some other solution can be figured out. --- source/blender/blenkernel/intern/DerivedMesh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 84cccd8b939..43b9a63a2c1 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -2077,7 +2077,7 @@ static void clear_mesh_caches(Object *ob) static void mesh_build_data(Scene *scene, Object *ob, CustomDataMask dataMask) { Object *obact = scene->basact?scene->basact->object:NULL; - int editing = paint_facesel_test(ob)|(ob && ob->mode & OB_MODE_PARTICLE_EDIT); + int editing = paint_facesel_test(ob); int needMapping = editing && (ob==obact); float min[3], max[3]; From 530deb73a988a2adfc8add73b842507b68254812 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 29 Aug 2009 23:05:46 +0000 Subject: [PATCH 338/577] Workarounds for 2 rna bugs. - mesh face properties that have no data are tested for length. - the rawtype of MFace.verts is not set, defaulting to CHAR, meaning only verts with 256 verts could be added from python. temp workaround by making PROP_RAW_INT the first in the enum. For some reason makesrna.c doesn't set the raw type MFace.verts at all. --- source/blender/makesrna/RNA_types.h | 8 ++++---- source/blender/makesrna/intern/rna_mesh.c | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 1acbfb21385..b57cbc3aa2c 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -176,11 +176,11 @@ typedef struct CollectionPointerLink { } CollectionPointerLink; typedef enum RawPropertyType { - PROP_RAW_CHAR, + PROP_RAW_INT, // XXX - abused for types that are not set, eg. MFace.verts, needs fixing. PROP_RAW_SHORT, - PROP_RAW_INT, - PROP_RAW_FLOAT, - PROP_RAW_DOUBLE + PROP_RAW_CHAR, + PROP_RAW_DOUBLE, + PROP_RAW_FLOAT } RawPropertyType; typedef struct RawArray { diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 4d53986be4f..edecfc8cdb0 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -708,7 +708,10 @@ static void rna_TextureFace_image_set(PointerRNA *ptr, PointerRNA value) static int rna_MeshFace_verts_get_length(PointerRNA *ptr) { MFace *face= (MFace*)ptr->data; - return face->v4 ? 4 : 3; + if(face) + return face->v4 ? 4 : 3; + else + return 4; // XXX rna_raw_access wants the length of a dummy face. this needs fixing. - Campbell } static int rna_MeshFace_verts_set_length(PointerRNA *ptr, int length) From 371c3bcf7a34c980c99829f2507b56f76d1b481a Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sat, 29 Aug 2009 23:13:27 +0000 Subject: [PATCH 339/577] 2.5 Sound: Bugfixes. --- source/blender/blenloader/intern/readfile.c | 6 +++--- source/blender/editors/space_logic/logic_window.c | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 070c873686c..64fabc825bc 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -5070,9 +5070,6 @@ static void direct_link_sound(FileData *fd, bSound *sound) sound->packedfile = direct_link_packedfile(fd, sound->packedfile); sound->newpackedfile = direct_link_packedfile(fd, sound->newpackedfile); - - if(sound->cache) - sound_cache(sound, 1); } static void lib_link_sound(FileData *fd, Main *main) @@ -5086,6 +5083,9 @@ static void lib_link_sound(FileData *fd, Main *main) sound->ipo= newlibadr_us(fd, sound->id.lib, sound->ipo); // XXX depreceated - old animation system sound_load(main, sound); + + if(sound->cache) + sound_cache(sound, 1); } sound= sound->id.next; } diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index d4475527058..118bcaa0cf4 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -28,6 +28,7 @@ #include #include +#include #include "DNA_actuator_types.h" #include "DNA_controller_types.h" @@ -2016,8 +2017,8 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh { uiDefButF(block, NUM, 0, "Minimum Gain: ", xco+10, yco-110, wval, 19, &sa->sound3D.min_gain, 0.0, 1.0, 0.0, 0.0, "The minimum gain of the sound, no matter how far it is away."); uiDefButF(block, NUM, 0, "Maximum Gain: ", xco+10, yco-132, wval, 19, &sa->sound3D.max_gain, 0.0, 1.0, 0.0, 0.0, "The maximum gain of the sound, no matter how near it is.."); - uiDefButF(block, NUM, 0, "Reference Distance: ", xco+10, yco-154, wval, 19, &sa->sound3D.reference_distance, 0.0, 1000.0, 0.0, 0.0, "The reference distance is the distance where the sound has a gain of 1.0."); - uiDefButF(block, NUM, 0, "Maximum Distance: ", xco+10, yco-176, wval, 19, &sa->sound3D.max_distance, 0.0, 1000.0, 0.0, 0.0, "The maximum distance at which you can hear the sound."); + uiDefButF(block, NUM, 0, "Reference Distance: ", xco+10, yco-154, wval, 19, &sa->sound3D.reference_distance, 0.0, FLT_MAX, 0.0, 0.0, "The reference distance is the distance where the sound has a gain of 1.0."); + uiDefButF(block, NUM, 0, "Maximum Distance: ", xco+10, yco-176, wval, 19, &sa->sound3D.max_distance, 0.0, FLT_MAX, 0.0, 0.0, "The maximum distance at which you can hear the sound."); uiDefButF(block, NUM, 0, "Rolloff: ", xco+wval+10, yco-110, wval, 19, &sa->sound3D.rolloff_factor, 0.0, 5.0, 0.0, 0.0, "The rolloff factor defines the influence factor on volume depending on distance."); uiDefButF(block, NUM, 0, "Cone Outer Gain: ", xco+wval+10, yco-132, wval, 19, &sa->sound3D.cone_outer_gain, 0.0, 1.0, 0.0, 0.0, "The gain outside the outer cone. The gain in the outer cone will be interpolated between this value und the normal gain in the inner cone."); uiDefButF(block, NUM, 0, "Cone Outer Angle: ", xco+wval+10, yco-154, wval, 19, &sa->sound3D.cone_outer_angle, 0.0, 360.0, 0.0, 0.0, "The angle of the outer cone."); From c2696ae63182da338d69a5127f03b1ad8b88f6c9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 29 Aug 2009 23:35:13 +0000 Subject: [PATCH 340/577] quiet warnings --- source/blender/editors/include/ED_particle.h | 1 + 1 file changed, 1 insertion(+) diff --git a/source/blender/editors/include/ED_particle.h b/source/blender/editors/include/ED_particle.h index dcac51928a3..28807caa255 100644 --- a/source/blender/editors/include/ED_particle.h +++ b/source/blender/editors/include/ED_particle.h @@ -37,6 +37,7 @@ struct ParticleSystem; struct RadialControl; struct rcti; struct wmWindowManager; +struct PTCacheEdit; /* particle edit mode */ void PE_free_ptcache_edit(struct PTCacheEdit *edit); From 2cb6078900c0083a6b64b5644af50d44a7fbeb8f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 30 Aug 2009 02:09:57 +0000 Subject: [PATCH 341/577] was crashing when joining in-link to in-link for the logic buttons. --- source/blender/editors/interface/interface_handlers.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index b69e8319956..79c707f5535 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -678,7 +678,11 @@ static void ui_add_link(uiBut *from, uiBut *to) return; } - if (from->type==LINK && to->type==INLINK) { + if (from->type==INLINK && to->type==INLINK) { + printf("cannot link\n"); + return; + } + else if (from->type==LINK && to->type==INLINK) { if( from->link->tocode != (int)to->hardmin ) { printf("cannot link\n"); return; From c9d2a1b71bd8a2155b94f9c00631e526a7be8778 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Sun, 30 Aug 2009 02:40:42 +0000 Subject: [PATCH 342/577] bug fixes and small changes --- release/io/netrender/master.py | 57 +++++++++++++++---------------- release/io/netrender/model.py | 2 +- release/io/netrender/operators.py | 8 ++--- release/io/netrender/slave.py | 7 ++-- release/io/netrender/ui.py | 12 +++++++ 5 files changed, 50 insertions(+), 36 deletions(-) diff --git a/release/io/netrender/master.py b/release/io/netrender/master.py index 5a62ef1a8bf..daca3bcf653 100644 --- a/release/io/netrender/master.py +++ b/release/io/netrender/master.py @@ -5,7 +5,10 @@ import subprocess, shutil, time, hashlib from netrender.utils import * import netrender.model - +JOB_WAITING = 0 # before all data has been entered +JOB_PAUSED = 1 # paused by user +JOB_QUEUED = 2 # ready to be dispatched + class MRenderSlave(netrender.model.RenderSlave): def __init__(self, name, adress, stats): super().__init__() @@ -25,7 +28,7 @@ class MRenderSlave(netrender.model.RenderSlave): # sorting key for jobs def groupKey(job): - return (job.framesLeft() > 0, job.priority, job.credits) + return (job.status, job.framesLeft() > 0, job.priority, job.credits) class MRenderJob(netrender.model.RenderJob): def __init__(self, job_id, name, path, chunks = 1, priority = 1, credits = 100.0, blacklist = []): @@ -33,6 +36,7 @@ class MRenderJob(netrender.model.RenderJob): self.id = job_id self.name = name self.path = path + self.status = JOB_WAITING self.frames = [] self.chunks = chunks self.priority = priority @@ -40,6 +44,9 @@ class MRenderJob(netrender.model.RenderJob): self.blacklist = blacklist self.last_dispatched = time.time() + def start(self): + self.status = JOB_QUEUED + def update(self): self.credits -= 5 # cost of one frame self.credits += (time.time() - self.last_dispatched) / 60 @@ -233,8 +240,6 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): message = [] for job in self.server: - results = job.status() - message.append(job.serialize()) self.send_head() @@ -322,25 +327,14 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): job_chunks = int(self.headers.get('job-chunks', "1")) blacklist = self.headers.get('slave-blacklist', '').split() - print("blacklist", blacklist) - job_path = str(self.rfile.read(length), encoding='utf8') if os.path.exists(job_path): - f = open(job_path, "rb") - buf = f.read() - f.close() + job_id = self.server.nextJobID() - job_id = hashlib.md5(buf).hexdigest() + job = MRenderJob(job_id, job_name, job_path, chunks = job_chunks, blacklist = blacklist) + self.server.addJob(job) - del buf - - job = self.server.getJobByID(job_id) - - if job == None: - job = MRenderJob(job_id, job_name, job_path, chunks = job_chunks, blacklist = blacklist) - self.server.addJob(job) - if ":" in job_frame_string: frame_start, frame_end = [int(x) for x in job_frame_string.split(":")] @@ -349,6 +343,8 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): else: job_frame = int(job_frame_string) frame = job.addFrame(job_frame) + + job.start() self.send_head(headers={"job-id": job_id}) else: @@ -385,9 +381,9 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): length = int(self.headers['content-length']) job_frame_string = self.headers['job-frame'] - name, stats = eval(str(self.rfile.read(length), encoding='utf8')) + slave_info = netrender.model.RenderSlave.materialize(eval(str(self.rfile.read(length), encoding='utf8'))) - slave_id = self.server.addSlave(name, self.client_address, stats) + slave_id = self.server.addSlave(slave_info.name, self.client_address, slave_info.stats) self.send_head(headers = {"slave-id": slave_id}) @@ -410,23 +406,19 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): job_chunks = int(self.headers.get('job-chunks', "1")) blacklist = self.headers.get('slave-blacklist', '').split() - buf = self.rfile.read(length) + job_id = self.server.nextJobID() - job_id = hashlib.md5(buf).hexdigest() + buf = self.rfile.read(length) job_path = job_id + ".blend" f = open(PATH_PREFIX + job_path, "wb") f.write(buf) f.close() - del buf - job = self.server.getJobByID(job_id) - - if job == None: - job = MRenderJob(job_id, job_name, job_path, chunks = job_chunks, blacklist = blacklist) - self.server.addJob(job) + job = MRenderJob(job_id, job_name, job_path, chunks = job_chunks, blacklist = blacklist) + self.server.addJob(job) if ":" in job_frame_string: frame_start, frame_end = [int(x) for x in job_frame_string.split(":")] @@ -437,6 +429,8 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): job_frame = int(job_frame_string) frame = job.addFrame(job_frame) + job.start() + self.send_head(headers={"job-id": job_id}) # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- elif self.path == "render": @@ -495,6 +489,11 @@ class RenderMasterServer(http.server.HTTPServer): self.jobs_map = {} self.slaves = [] self.slaves_map = {} + self.job_id = 0 + + def nextJobID(self): + self.job_id += 1 + return str(self.job_id) def addSlave(self, name, adress, stats): slave = MRenderSlave(name, adress, stats) @@ -540,7 +539,7 @@ class RenderMasterServer(http.server.HTTPServer): def getNewJob(self, slave_id): if self.jobs: for job in reversed(self.jobs): - if job.framesLeft() > 0 and slave_id not in job.blacklist: + if job.status == JOB_QUEUED and job.framesLeft() > 0 and slave_id not in job.blacklist: return job, job.getFrames() return None, None diff --git a/release/io/netrender/model.py b/release/io/netrender/model.py index 6e68929d340..98866ff1dfc 100644 --- a/release/io/netrender/model.py +++ b/release/io/netrender/model.py @@ -65,7 +65,7 @@ class RenderJob: def __len__(self): return len(self.frames) - def status(self): + def framesStatus(self): results = { QUEUED: 0, DISPATCHED: 0, diff --git a/release/io/netrender/operators.py b/release/io/netrender/operators.py index 3355c3d1a0b..8df662b6b52 100644 --- a/release/io/netrender/operators.py +++ b/release/io/netrender/operators.py @@ -66,7 +66,7 @@ class RENDER_OT_netclientstatus(bpy.types.Operator): netprops.jobs.add() job = netprops.jobs[-1] - job_results = j.status() + job_results = j.framesStatus() job.id = j.id job.name = j.name @@ -210,15 +210,15 @@ class RENDER_OT_netclientcancel(bpy.types.Operator): __props__ = [] def poll(self, context): - netrender = scene.network_render - return netrender.active_job_index >= 0 and len(netrender.jobs) > 0 + netprops = context.scene.network_render + return netprops.active_job_index >= 0 and len(netprops.jobs) > 0 def execute(self, context): netprops = context.scene.network_render conn = clientConnection(context.scene) if conn: - job = netprops.jobs[netrender.active_job_index] + job = netprops.jobs[netprops.active_job_index] conn.request("POST", "cancel", headers={"job-id":job.id}) diff --git a/release/io/netrender/slave.py b/release/io/netrender/slave.py index 03c6803955e..59c474293b3 100644 --- a/release/io/netrender/slave.py +++ b/release/io/netrender/slave.py @@ -11,7 +11,10 @@ INCREMENT_TIMEOUT = 1 def slave_Info(): sysname, nodename, release, version, machine = os.uname() - return (nodename, sysname + " " + release + " " + machine) + slave = netrender.model.RenderSlave() + slave.name = nodename + slave.stats = sysname + " " + release + " " + machine + return slave def testCancel(conn, job_id): conn.request("HEAD", "status", headers={"job-id":job_id}) @@ -35,7 +38,7 @@ def render_slave(engine, scene): conn = clientConnection(scene) if conn: - conn.request("POST", "slave", repr(slave_Info())) + conn.request("POST", "slave", repr(slave_Info().serialize())) response = conn.getresponse() slave_id = response.getheader("slave-id") diff --git a/release/io/netrender/ui.py b/release/io/netrender/ui.py index 2fd2b9a317f..71b013c5a63 100644 --- a/release/io/netrender/ui.py +++ b/release/io/netrender/ui.py @@ -255,6 +255,18 @@ NetRenderSlave.StringProperty( attr="adress", maxlen = 64, default = "") +NetRenderSlave.StringProperty( attr="last_seen", + name="Last time slave was seen by server", + description="", + maxlen = 64, + default = "") + +NetRenderSlave.StringProperty( attr="stats", + name="Hardware stats of the slave", + description="", + maxlen = 128, + default = "") + NetRenderJob.StringProperty( attr="id", name="ID of the job", description="", From 4b206c675c21322cf98700dddfc0d0485b3d6ffc Mon Sep 17 00:00:00 2001 From: Tom Musgrove Date: Sun, 30 Aug 2009 03:10:03 +0000 Subject: [PATCH 343/577] just some comment fixes --- source/blender/blenkernel/BKE_shrinkwrap.h | 4 ++-- source/blender/blenkernel/intern/shrinkwrap.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/blender/blenkernel/BKE_shrinkwrap.h b/source/blender/blenkernel/BKE_shrinkwrap.h index eb0e3c4ef00..5b413ae4e44 100644 --- a/source/blender/blenkernel/BKE_shrinkwrap.h +++ b/source/blender/blenkernel/BKE_shrinkwrap.h @@ -115,9 +115,9 @@ typedef struct ShrinkwrapCalcData int vgroup; //Vertex group num struct DerivedMesh *target; //mesh we are shrinking to - SpaceTransform local2target; //transform to move bettwem local and target space + SpaceTransform local2target; //transform to move between local and target space - float keepDist; //Distance to kept from target (units are in local space) + float keepDist; //Distance to keep above target surface (units are in local space) } ShrinkwrapCalcData; diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c index 27357d92aae..efb7db04029 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.c +++ b/source/blender/blenkernel/intern/shrinkwrap.c @@ -574,7 +574,7 @@ void shrinkwrapModifier_deform(ShrinkwrapModifierData *smd, Scene *scene, Object } } - //Just to make sure we are not letting any memory behind + //Just to make sure we are not leaving any memory behind assert(ssmd.emCache == NULL); assert(ssmd.mCache == NULL); } From e104b429295766f9276ea854e02f085cf65e623f Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 30 Aug 2009 04:48:34 +0000 Subject: [PATCH 344/577] Grease Pencil: Drawing Improvements * Smooth strokes can now be drawn again, with normal (i.e. reasonably speedy feedback again). Previously slow drawing was caused by a bad notifier being used - the full screen was redrawn each time instead of just the relevant region. Now, only the relevant region is redrawn while drawing, and a proper flush is done for the rest of the screen at the end. * Made drawing straight lines a proper drawing 'mode' for Grease Pencil now. Use the Ctrl-D-LMB hotkey to draw straight lines in this way. The (buffer) line drawn now will accurately represent the final straight line instead of drawing the freehand path taken as before. --- source/blender/editors/gpencil/gpencil_edit.c | 4 +- .../blender/editors/gpencil/gpencil_intern.h | 7 + source/blender/editors/gpencil/gpencil_ops.c | 5 +- .../blender/editors/gpencil/gpencil_paint.c | 153 +++++++++++------- 4 files changed, 105 insertions(+), 64 deletions(-) diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 2faf3ccbbda..b2228134750 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -169,7 +169,7 @@ static int gp_data_add_exec (bContext *C, wmOperator *op) } /* notifiers */ - WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX please work! + WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX need a nicer one that will work return OPERATOR_FINISHED; } @@ -216,7 +216,7 @@ static int gp_data_unlink_exec (bContext *C, wmOperator *op) } /* notifiers */ - WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX please work! + WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX need a nicer one that will work return OPERATOR_FINISHED; } diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h index cc98d491f7a..2c7bf9156c3 100644 --- a/source/blender/editors/gpencil/gpencil_intern.h +++ b/source/blender/editors/gpencil/gpencil_intern.h @@ -40,6 +40,13 @@ struct wmOperatorType; void GPENCIL_OT_draw(struct wmOperatorType *ot); +/* Paint Modes for operator*/ +typedef enum eGPencil_PaintModes { + GP_PAINTMODE_DRAW = 0, + GP_PAINTMODE_ERASER, + GP_PAINTMODE_DRAW_STRAIGHT, +} eGPencil_PaintModes; + /* buttons editing --- */ void GPENCIL_OT_data_add(struct wmOperatorType *ot); diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c index 364b27b61b0..2d23a331211 100644 --- a/source/blender/editors/gpencil/gpencil_ops.c +++ b/source/blender/editors/gpencil/gpencil_ops.c @@ -56,9 +56,12 @@ void gpencil_common_keymap(wmWindowManager *wm, ListBase *keymap) /* Draw */ /* draw */ WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, 0, DKEY); + /* draw - straight lines */ + kmi=WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, KM_CTRL, DKEY); + RNA_enum_set(kmi->ptr, "mode", GP_PAINTMODE_DRAW_STRAIGHT); /* erase */ kmi=WM_keymap_add_item(keymap, "GPENCIL_OT_draw", RIGHTMOUSE, KM_PRESS, 0, DKEY); - RNA_enum_set(kmi->ptr, "mode", 1); // XXX need to make the defines for this public (this is GP_PAINTMODE_ERASER) + RNA_enum_set(kmi->ptr, "mode", GP_PAINTMODE_ERASER); } /* ****************************************** */ diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 82dc76a2152..9cf6f3d751f 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -68,16 +68,6 @@ #include "gpencil_intern.h" -/* ******************************************* */ -/* Context Wrangling... */ - -/* check if context is suitable for drawing */ -static int gpencil_draw_poll (bContext *C) -{ - // TODO: must check context for Grease Pencil data... - return 1; -} - /* ******************************************* */ /* 'Globals' and Defines */ @@ -121,12 +111,6 @@ enum { GP_STATUS_DONE /* painting done */ }; -/* values for tGPsdata->paintmode */ -enum { - GP_PAINTMODE_DRAW = 0, - GP_PAINTMODE_ERASER -}; - /* Return flags for adding points to stroke buffer */ enum { GP_STROKEADD_INVALID = -2, /* error occurred - insufficient info to do so */ @@ -138,7 +122,6 @@ enum { /* Runtime flags */ enum { GP_PAINTFLAG_FIRSTRUN = (1<<0), /* operator just started */ - GP_PAINTFLAG_STRAIGHTLINES = (1<<1), /* only take the endpoints of a stroke */ }; /* ------ */ @@ -152,16 +135,21 @@ enum { /* minimum length of new segment before new point can be added */ #define MIN_EUCLIDEAN_PX (U.gp_euclideandist) -/* macro to test if only converting endpoints - only for use when converting! */ -// XXX for now, don't test for editpaint too... -//#define GP_BUFFER2STROKE_ENDPOINTS ((gpd->flag & GP_DATA_EDITPAINT) && (p->flags & GP_PAINTFLAG_STRAIGHTLINES)) -#define GP_BUFFER2STROKE_ENDPOINTS ((p->flags & GP_PAINTFLAG_STRAIGHTLINES)) - /* ------ */ /* Forward defines for some functions... */ static void gp_session_validatebuffer(tGPsdata *p); +/* ******************************************* */ +/* Context Wrangling... */ + +/* check if context is suitable for drawing */ +static int gpencil_draw_poll (bContext *C) +{ + /* check if current context can support GPencil data */ + return (gpencil_data_get_pointers(C, NULL) != NULL); +} + /* ******************************************* */ /* Calculations/Conversions */ @@ -258,26 +246,68 @@ static short gp_stroke_addpoint (tGPsdata *p, int mval[2], float pressure) bGPdata *gpd= p->gpd; tGPspoint *pt; - /* check if still room in buffer */ - if (gpd->sbuffer_size >= GP_STROKE_BUFFER_MAX) - return GP_STROKEADD_OVERFLOW; - - /* get pointer to destination point */ - pt= ((tGPspoint *)(gpd->sbuffer) + gpd->sbuffer_size); - - /* store settings */ - pt->x= mval[0]; - pt->y= mval[1]; - pt->pressure= pressure; - - /* increment counters */ - gpd->sbuffer_size++; - - /* check if another operation can still occur */ - if (gpd->sbuffer_size == GP_STROKE_BUFFER_MAX) - return GP_STROKEADD_FULL; - else + /* check painting mode */ + if (p->paintmode == GP_PAINTMODE_DRAW_STRAIGHT) { + /* straight lines only - i.e. only store start and end point in buffer */ + if (gpd->sbuffer_size == 0) { + /* first point in buffer (start point) */ + pt= (tGPspoint *)(gpd->sbuffer); + + /* store settings */ + pt->x= mval[0]; + pt->y= mval[1]; + pt->pressure= pressure; + + /* increment buffer size */ + gpd->sbuffer_size++; + } + else { + /* normally, we just reset the endpoint to the latest value + * - assume that pointers for this are always valid... + */ + pt= ((tGPspoint *)(gpd->sbuffer) + 1); + + /* store settings */ + pt->x= mval[0]; + pt->y= mval[1]; + pt->pressure= pressure; + + /* if this is just the second point we've added, increment the buffer size + * so that it will be drawn properly... + * otherwise, just leave it alone, otherwise we get problems + */ + if (gpd->sbuffer_size != 2) + gpd->sbuffer_size= 2; + } + + /* can keep carrying on this way :) */ return GP_STROKEADD_NORMAL; + } + else if (p->paintmode == GP_PAINTMODE_DRAW) { /* normal drawing */ + /* check if still room in buffer */ + if (gpd->sbuffer_size >= GP_STROKE_BUFFER_MAX) + return GP_STROKEADD_OVERFLOW; + + /* get pointer to destination point */ + pt= ((tGPspoint *)(gpd->sbuffer) + gpd->sbuffer_size); + + /* store settings */ + pt->x= mval[0]; + pt->y= mval[1]; + pt->pressure= pressure; + + /* increment counters */ + gpd->sbuffer_size++; + + /* check if another operation can still occur */ + if (gpd->sbuffer_size == GP_STROKE_BUFFER_MAX) + return GP_STROKEADD_FULL; + else + return GP_STROKEADD_NORMAL; + } + + /* just say it's normal for now, since we don't have another state... */ + return GP_STROKEADD_NORMAL; } /* smooth a stroke (in buffer) before storing it */ @@ -287,7 +317,7 @@ static void gp_stroke_smooth (tGPsdata *p) int i=0, cmx=gpd->sbuffer_size; /* only smooth if smoothing is enabled, and we're not doing a straight line */ - if (!(U.gp_settings & GP_PAINT_DOSMOOTH) || GP_BUFFER2STROKE_ENDPOINTS) + if (!(U.gp_settings & GP_PAINT_DOSMOOTH) || (p->paintmode == GP_PAINTMODE_DRAW_STRAIGHT)) return; /* don't try if less than 2 points in buffer */ @@ -320,7 +350,7 @@ static void gp_stroke_simplify (tGPsdata *p) short i, j; /* only simplify if simlification is enabled, and we're not doing a straight line */ - if (!(U.gp_settings & GP_PAINT_DOSIMPLIFY) || GP_BUFFER2STROKE_ENDPOINTS) + if (!(U.gp_settings & GP_PAINT_DOSIMPLIFY) || (p->paintmode == GP_PAINTMODE_DRAW_STRAIGHT)) return; /* don't simplify if less than 4 points in buffer */ @@ -388,11 +418,10 @@ static void gp_stroke_newfrombuffer (tGPsdata *p) tGPspoint *ptc; int i, totelem; - /* get total number of points to allocate space for: - * - in 'Draw Mode', holding the Ctrl-Modifier will only take endpoints - * - otherwise, do whole stroke + /* get total number of points to allocate space for + * - drawing straight-lines only requires the endpoints */ - if (GP_BUFFER2STROKE_ENDPOINTS) + if (p->paintmode == GP_PAINTMODE_DRAW_STRAIGHT) totelem = (gpd->sbuffer_size >= 2) ? 2: gpd->sbuffer_size; else totelem = gpd->sbuffer_size; @@ -416,8 +445,8 @@ static void gp_stroke_newfrombuffer (tGPsdata *p) gps->flag= gpd->sbuffer_sflag; /* copy points from the buffer to the stroke */ - if (GP_BUFFER2STROKE_ENDPOINTS) { - /* 'Draw Mode' + Ctrl-Modifier - only endpoints */ + if (p->paintmode == GP_PAINTMODE_DRAW_STRAIGHT) { + /* straight lines only -> only endpoints */ { /* first point */ ptc= gpd->sbuffer; @@ -1013,7 +1042,6 @@ static int gpencil_draw_init (bContext *C, wmOperator *op) { tGPsdata *p; int paintmode= RNA_enum_get(op->ptr, "mode"); - int straightLines= RNA_boolean_get(op->ptr, "straight_lines"); /* check context */ p= op->customdata= gp_session_initpaint(C); @@ -1033,10 +1061,6 @@ static int gpencil_draw_init (bContext *C, wmOperator *op) /* radius for eraser circle is defined in userprefs now */ p->radius= U.gp_eraser; - /* set line-drawing settings (straight or freehand lines) */ - if (straightLines) - p->flags |= GP_PAINTFLAG_STRAIGHTLINES; - /* everything is now setup ok */ return 1; } @@ -1126,8 +1150,8 @@ static void gpencil_draw_apply_event (bContext *C, wmOperator *op, wmEvent *even { tGPsdata *p= op->customdata; ARegion *ar= p->ar; - PointerRNA itemptr; - float mousef[2]; + //PointerRNA itemptr; + //float mousef[2]; int tablet=0; /* convert from window-space to area-space mouse coordintes */ @@ -1162,6 +1186,7 @@ static void gpencil_draw_apply_event (bContext *C, wmOperator *op, wmEvent *even return; } +#if 0 // NOTE: disabled for now, since creating this data is currently useless anyways (and slows things down) /* fill in stroke data (not actually used directly by gpencil_draw_apply) */ RNA_collection_add(op->ptr, "stroke", &itemptr); @@ -1169,12 +1194,13 @@ static void gpencil_draw_apply_event (bContext *C, wmOperator *op, wmEvent *even mousef[1]= p->mval[1]; RNA_float_set_array(&itemptr, "mouse", mousef); RNA_float_set(&itemptr, "pressure", p->pressure); +#endif /* apply the current latest drawing point */ gpencil_draw_apply(C, op, p); /* force refresh */ - WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX please work! + ED_region_tag_redraw(p->ar); /* just active area for now, since doing whole screen is too slow */ } /* ------------------------------- */ @@ -1232,7 +1258,7 @@ static int gpencil_draw_exec (bContext *C, wmOperator *op) gpencil_draw_exit(C, op); /* refreshes */ - WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX please work! + WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX need a nicer one that will work /* done */ return OPERATOR_FINISHED; @@ -1311,6 +1337,10 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) /* basically, this should be mouse-button up */ printf("\t\tGP - end of stroke \n"); gpencil_draw_exit(C, op); + + /* one last flush before we're done */ + WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX need a nicer one that will work + return OPERATOR_FINISHED; } else { @@ -1340,6 +1370,7 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) /* scrolling mouse-wheel increases radius of eraser * - though this is quite a difficult action to perform */ + // XXX this stuff doesn't work case WHEELUPMOUSE: p->radius += 1.5f; break; @@ -1358,7 +1389,8 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) /* ------------------------------- */ static EnumPropertyItem prop_gpencil_drawmodes[] = { - {GP_PAINTMODE_DRAW, "DRAW", 0, "Draw", ""}, + {GP_PAINTMODE_DRAW, "DRAW", 0, "Draw Freehand", ""}, + {GP_PAINTMODE_DRAW_STRAIGHT, "DRAW_STRAIGHT", 0, "Draw Straight Lines", ""}, {GP_PAINTMODE_ERASER, "ERASER", 0, "Eraser", ""}, {0, NULL, 0, NULL, NULL} }; @@ -1382,7 +1414,6 @@ void GPENCIL_OT_draw (wmOperatorType *ot) /* settings for drawing */ RNA_def_enum(ot->srna, "mode", prop_gpencil_drawmodes, 0, "Mode", "Way to intepret mouse movements."); - RNA_def_boolean(ot->srna, "straight_lines", 0, "Straight Lines", "Only take the endpoints of the strokes, so that straight lines can be drawn."); - + // xxx the stuff below is used only for redo operator, but is not really working RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", ""); } From 05ebac71ca72966efd2d5d8692f5959c33a9d621 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 30 Aug 2009 05:54:27 +0000 Subject: [PATCH 345/577] Grease Pencil: Bugfix (Dots) + RNA Wrapping * Making single dots should be possible again. * Wrapped the debug option, 'Show Points', for layers, which makes all the points on the layer get drawn with dots indicating positions of stroke points. --- source/blender/editors/gpencil/gpencil_buttons.c | 14 +++++++------- source/blender/editors/gpencil/gpencil_paint.c | 6 +++++- source/blender/makesrna/intern/rna_gpencil.c | 4 ++++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c index 954f6c7e61e..f29d37311fb 100644 --- a/source/blender/editors/gpencil/gpencil_buttons.c +++ b/source/blender/editors/gpencil/gpencil_buttons.c @@ -203,13 +203,6 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl) subcol= uiLayoutColumn(col, 1); uiItemR(subcol, NULL, 0, &ptr, "line_thickness", UI_ITEM_R_SLIDER); - /* debugging options */ - if (G.f & G_DEBUG) { - // XXX this option hasn't been wrapped yet... since it's just debug - //subcol= uiLayoutColumn(col, 1); - // uiItemR(subrow, NULL, 0, &ptr, "show_points", 0); - } - /* right column ................... */ col= uiLayoutColumn(split, 0); @@ -218,6 +211,13 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl) uiItemR(subcol, "Onion Skinning", 0, &ptr, "use_onion_skinning", 0); uiItemR(subcol, "GStep", 0, &ptr, "max_ghost_range", 0); // XXX shorter name here? (i.e. GStep) + /* debugging options */ + // XXX re-enable the debug-only checks later + //if (G.f & G_DEBUG) { + subcol= uiLayoutColumn(col, 1); + uiItemR(subcol, NULL, 0, &ptr, "show_points", 0); + //} + /* additional options... */ // None at the moment... } diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 9cf6f3d751f..c18a807f9d4 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -161,8 +161,12 @@ static short gp_stroke_filtermval (tGPsdata *p, int mval[2], int pmval[2]) int dx= abs(mval[0] - pmval[0]); int dy= abs(mval[1] - pmval[1]); + /* if buffer is empty, just let this go through (i.e. so that dots will work) */ + if (p->gpd->sbuffer_size == 0) + return 1; + /* check if mouse moved at least certain distance on both axes (best case) */ - if ((dx > MIN_MANHATTEN_PX) && (dy > MIN_MANHATTEN_PX)) + else if ((dx > MIN_MANHATTEN_PX) && (dy > MIN_MANHATTEN_PX)) return 1; /* check if the distance since the last point is significant enough */ diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index 340ba1a0f31..e025aca010c 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -208,6 +208,10 @@ void rna_def_gpencil_layer(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_SELECT); RNA_def_property_ui_text(prop, "Selected", "Layer is selected for editing in the DopeSheet."); + prop= RNA_def_property(srna, "show_points", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_DRAWDEBUG); + RNA_def_property_ui_text(prop, "Show Points", "Draw the points which make up the strokes (for debugging purposes)."); + } void rna_def_gpencil_data(BlenderRNA *brna) From 46ba8b6edb242b5cf7605cf04c79c85159eb222c Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 30 Aug 2009 06:10:38 +0000 Subject: [PATCH 346/577] Grease Pencil: Hacky fix for "broken strokes" bug (pun intended) ;) For the strokes drawn using OpenGL lines, moderately-sized changes in the pressure between two points could result in the stroke being disjointed, since a new GL_LINE_STRIP would need to be created with the new line thickness due to the new pressure value. (In reference to the summary of this commit, this bug was noticed by Matt Ebb (broken). This bug is also in 2.4x, but was suprisingly not really noticed.) --- source/blender/editors/gpencil/drawgpencil.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index 4a48e9a4e3b..a89a038d760 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -122,11 +122,21 @@ static void gp_draw_stroke_buffer (tGPspoint *points, int totpoints, short thick glBegin(GL_LINE_STRIP); for (i=0, pt=points; i < totpoints && pt; i++, pt++) { + /* if there was a significant pressure change, stop the curve, change the thickness of the stroke, + * and continue drawing again (since line-width cannot change in middle of GL_LINE_STRIP) + */ if (fabs(pt->pressure - oldpressure) > 0.2f) { glEnd(); glLineWidth(pt->pressure * thickness); glBegin(GL_LINE_STRIP); + /* need to roll-back one point to ensure that there are no gaps in the stroke */ + if (i != 0) { + pt--; + glVertex2f(pt->x, pt->y); + pt++; + } + /* now the point we want... */ glVertex2f(pt->x, pt->y); oldpressure = pt->pressure; @@ -206,11 +216,21 @@ static void gp_draw_stroke_3d (bGPDspoint *points, int totpoints, short thicknes /* draw stroke curve */ glBegin(GL_LINE_STRIP); for (i=0, pt=points; i < totpoints && pt; i++, pt++) { + /* if there was a significant pressure change, stop the curve, change the thickness of the stroke, + * and continue drawing again (since line-width cannot change in middle of GL_LINE_STRIP) + */ if (fabs(pt->pressure - oldpressure) > 0.2f) { glEnd(); glLineWidth(pt->pressure * thickness); glBegin(GL_LINE_STRIP); + /* need to roll-back one point to ensure that there are no gaps in the stroke */ + if (i != 0) { + pt--; + glVertex3f(pt->x, pt->y, pt->z); + pt++; + } + /* now the point we want... */ glVertex3f(pt->x, pt->y, pt->z); oldpressure = pt->pressure; From 466d59461d060b291dc1df8bd8b26fcd8d59ca1d Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sun, 30 Aug 2009 06:42:53 +0000 Subject: [PATCH 347/577] * Limit available texture coordinate types when using volume materials --- source/blender/makesrna/intern/rna_material.c | 68 ++++++++++++++----- 1 file changed, 52 insertions(+), 16 deletions(-) diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 9d51c687d09..651aeae217e 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -35,6 +35,20 @@ #include "WM_types.h" +static EnumPropertyItem prop_texture_coordinates_items[] = { +{TEXCO_GLOB, "GLOBAL", 0, "Global", "Uses global coordinates for the texture coordinates."}, +{TEXCO_OBJECT, "OBJECT", 0, "Object", "Uses linked object's coordinates for texture coordinates."}, +{TEXCO_UV, "UV", 0, "UV", "Uses UV coordinates for texture coordinates."}, +{TEXCO_ORCO, "ORCO", 0, "Generated", "Uses the original undeformed coordinates of the object."}, +{TEXCO_STRAND, "STRAND", 0, "Strand", "Uses normalized strand texture coordinate (1D)."}, +{TEXCO_STICKY, "STICKY", 0, "Sticky", "Uses mesh's sticky coordinates for the texture coordinates."}, +{TEXCO_WINDOW, "WINDOW", 0, "Window", "Uses screen coordinates as texture coordinates."}, +{TEXCO_NORM, "NORMAL", 0, "Normal", "Uses normal vector as texture coordinates."}, +{TEXCO_REFL, "REFLECTION", 0, "Reflection", "Uses reflection vector as texture coordinates."}, +{TEXCO_STRESS, "STRESS", 0, "Stress", "Uses the difference of edge lengths compared to original coordinates of the mesh."}, +{TEXCO_TANGENT, "TANGENT", 0, "Tangent", "Uses the optional tangent vector as texture coordinates."}, +{0, NULL, 0, NULL, NULL}}; + #ifdef RNA_RUNTIME #include "MEM_guardedalloc.h" @@ -207,6 +221,42 @@ void rna_Material_use_nodes_set(PointerRNA *ptr, int value) ED_node_shader_default(ma); } +static EnumPropertyItem *rna_Material_texture_coordinates_itemf(bContext *C, PointerRNA *ptr, int *free) +{ + Material *ma= (Material*)ptr->id.data; + EnumPropertyItem *item= NULL; + int totitem= 0; + + if(C==NULL) { + return prop_texture_coordinates_items; + } + + RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_GLOB); + RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_OBJECT); + RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_ORCO); + + if(ma->material_type == MA_TYPE_VOLUME) { + + } + else if (ELEM3(ma->material_type, MA_TYPE_SURFACE, MA_TYPE_HALO, MA_TYPE_WIRE)) { + RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_UV); + RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_STRAND); + RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_STICKY); + RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_WINDOW); + RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_NORM); + RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_REFL); + RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_STRESS); + RNA_enum_items_add_value(&item, &totitem, prop_texture_coordinates_items, TEXCO_TANGENT); + } + + RNA_enum_item_end(&item, &totitem); + + *free= 1; + + return item; +} + + #else static void rna_def_material_mtex(BlenderRNA *brna) @@ -214,21 +264,6 @@ static void rna_def_material_mtex(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; - static EnumPropertyItem prop_texture_coordinates_items[] = { - {TEXCO_GLOB, "GLOBAL", 0, "Global", "Uses global coordinates for the texture coordinates."}, - {TEXCO_OBJECT, "OBJECT", 0, "Object", "Uses linked object's coordinates for texture coordinates."}, - {TEXCO_UV, "UV", 0, "UV", "Uses UV coordinates for texture coordinates."}, - {TEXCO_ORCO, "ORCO", 0, "Generated", "Uses the original undeformed coordinates of the object."}, - {TEXCO_STRAND, "STRAND", 0, "Strand", "Uses normalized strand texture coordinate (1D)."}, - {TEXCO_STICKY, "STICKY", 0, "Sticky", "Uses mesh's sticky coordinates for the texture coordinates."}, - {TEXCO_WINDOW, "WINDOW", 0, "Window", "Uses screen coordinates as texture coordinates."}, - {TEXCO_NORM, "NORMAL", 0, "Normal", "Uses normal vector as texture coordinates."}, - {TEXCO_REFL, "REFLECTION", 0, "Reflection", "Uses reflection vector as texture coordinates."}, - {TEXCO_STRESS, "STRESS", 0, "Stress", "Uses the difference of edge lengths compared to original coordinates of the mesh."}, - {TEXCO_TANGENT, "TANGENT", 0, "Tangent", "Uses the optional tangent vector as texture coordinates."}, - - {0, NULL, 0, NULL, NULL}}; - static EnumPropertyItem prop_mapping_items[] = { {MTEX_FLAT, "FLAT", 0, "Flat", "Maps X and Y coordinates directly."}, {MTEX_CUBE, "CUBE", 0, "Cube", "Maps using the normal vector."}, @@ -271,9 +306,10 @@ static void rna_def_material_mtex(BlenderRNA *brna) prop= RNA_def_property(srna, "texture_coordinates", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "texco"); RNA_def_property_enum_items(prop, prop_texture_coordinates_items); + RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Material_texture_coordinates_itemf"); RNA_def_property_ui_text(prop, "Texture Coordinates", ""); RNA_def_property_update(prop, NC_TEXTURE, NULL); - + prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "object"); RNA_def_property_struct_type(prop, "Object"); From 970c9214b543c95921dbb51a681457b5d6597133 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Sun, 30 Aug 2009 07:07:02 +0000 Subject: [PATCH 348/577] * Fixes for shading objects inside volumes --- source/blender/render/intern/include/render_types.h | 1 + source/blender/render/intern/source/convertblender.c | 1 + source/blender/render/intern/source/volumetric.c | 12 +++++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/source/blender/render/intern/include/render_types.h b/source/blender/render/intern/include/render_types.h index c4910f7733d..e50e498228d 100644 --- a/source/blender/render/intern/include/render_types.h +++ b/source/blender/render/intern/include/render_types.h @@ -419,6 +419,7 @@ typedef struct VolumeOb typedef struct MatInside { struct MatInside *next, *prev; struct Material *ma; + struct ObjectInstanceRen *obi; } MatInside; typedef struct VolPrecachePart diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index e486daf2585..cf6246e3641 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -2999,6 +2999,7 @@ static void init_camera_inside_volumes(Render *re) mi = MEM_mallocN(sizeof(MatInside), "camera inside material"); mi->ma = vo->ma; + mi->obi = obi; BLI_addtail(&(re->render_volumes_inside), mi); } diff --git a/source/blender/render/intern/source/volumetric.c b/source/blender/render/intern/source/volumetric.c index 046a145e9da..4fa31674bbe 100644 --- a/source/blender/render/intern/source/volumetric.c +++ b/source/blender/render/intern/source/volumetric.c @@ -674,15 +674,25 @@ void shade_volume_inside(ShadeInput *shi, ShadeResult *shr) { MatInside *m; Material *mat_backup; + ObjectInstanceRen *obi_backup; + float prev_alpha = shr->alpha; //if (BLI_countlist(&R.render_volumes_inside) == 0) return; /* XXX: extend to multiple volumes perhaps later */ mat_backup = shi->mat; + obi_backup = shi->obi; + m = R.render_volumes_inside.first; shi->mat = m->ma; + shi->obi = m->obi; + shi->obr = m->obi->obr; volume_trace(shi, shr, VOL_SHADE_INSIDE); - + shr->alpha += prev_alpha; + CLAMP(shr->alpha, 0.f, 1.f); + shi->mat = mat_backup; + shi->obi = obi_backup; + shi->obr = obi_backup->obr; } \ No newline at end of file From c34d49cc5b2d3bdd72f44b77b85c12e7b1717c17 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sun, 30 Aug 2009 09:10:31 +0000 Subject: [PATCH 349/577] Fix for libsndfile in mingw scons config. --- config/win32-mingw-config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/win32-mingw-config.py b/config/win32-mingw-config.py index 26fa0835255..e3834c41a81 100644 --- a/config/win32-mingw-config.py +++ b/config/win32-mingw-config.py @@ -35,7 +35,7 @@ BF_JACK_LIBPATH = '${BF_JACK}/lib' WITH_BF_SNDFILE = False BF_SNDFILE = LIBDIR + '/sndfile' BF_SNDFILE_INC = '${BF_SNDFILE}/include' -BF_SNDFILE_LIB = 'libsndfile' +BF_SNDFILE_LIB = 'libsndfile-1' BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib' WITH_BF_SDL = True From b9b30e2032a7f5ebcf87a22ad4ab8d66194d6125 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sun, 30 Aug 2009 09:11:24 +0000 Subject: [PATCH 350/577] Same fix for libsndfile in cmake. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d1e18723f5d..a92099698c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -259,7 +259,7 @@ IF(WIN32) IF(WITH_SNDFILE) SET(SNDFILE ${LIBDIR}/sndfile) SET(SNDFILE_INC ${SNDFILE}/include) - SET(SNDFILE_LIB sndfile) + SET(SNDFILE_LIB sndfile-1) SET(SNDFILE_LIBPATH ${SNDFILE}/lib) ENDIF(WITH_SNDFILE) From d4d520c9a2312e1b03872f92b1e9be1150d167d5 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 30 Aug 2009 11:37:29 +0000 Subject: [PATCH 351/577] Grease Pencil: Various Drawing Fixes * Restored option to have strokes aligned to screen space. By default, this is not enabled (the setting for view-space is the default instead). * Fixed bugs related to drawing/erasing in screen space. --- source/blender/blenkernel/intern/gpencil.c | 5 ++++ source/blender/editors/gpencil/drawgpencil.c | 2 +- .../blender/editors/gpencil/gpencil_buttons.c | 20 +++++++------ .../blender/editors/gpencil/gpencil_paint.c | 28 +++++++++---------- source/blender/makesrna/intern/rna_gpencil.c | 6 ++++ 5 files changed, 38 insertions(+), 23 deletions(-) diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index dd8f44c71d5..b02128c3c68 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -214,6 +214,11 @@ bGPdata *gpencil_data_addnew (char name[]) /* initial settings */ gpd->flag = (GP_DATA_DISPINFO|GP_DATA_EXPAND); + /* for now, stick to view is also enabled by default + * since this is more useful... + */ + gpd->flag |= GP_DATA_VIEWALIGN; + return gpd; } diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index a89a038d760..d6678b50d7b 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -773,7 +773,7 @@ void draw_gpencil_oglrender (bContext *C) /* pass 2: draw 2d-strokes ------------ > */ /* adjust view matrices */ - wmOrtho2(-0.375f, (float)(ar->winx)-0.375f, -0.375f, (float)(ar->winy)-0.375f); + wmOrtho2(-0.375f, (float)(ar->winx)-0.375f, -0.375f, (float)(ar->winy)-0.375f); // XXX may not be correct anymore glLoadIdentity(); /* draw it! */ diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c index f29d37311fb..774f7b7162b 100644 --- a/source/blender/editors/gpencil/gpencil_buttons.c +++ b/source/blender/editors/gpencil/gpencil_buttons.c @@ -226,9 +226,13 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl) /* Draw the contents for a grease-pencil panel*/ static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, PointerRNA *ctx_ptr) { + PointerRNA gpd_ptr; bGPDlayer *gpl; uiLayout *col; + /* make new PointerRNA for Grease Pencil block */ + RNA_id_pointer_create((ID *)gpd, &gpd_ptr); + /* draw gpd settings first ------------------------------------- */ col= uiLayoutColumn(layout, 0); /* current Grease Pencil block */ @@ -238,19 +242,19 @@ static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, Poi /* add new layer button */ uiItemO(col, NULL, 0, "GPENCIL_OT_layer_add"); - /* 'view align' button (naming depends on context) */ -#if 0 // XXX for now, this is enabled by default anyways - if (sa->spacetype == SPACE_VIEW3D) - uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Sketch in 3D", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added in 3D-space"); - else - uiDefButBitI(block, TOG, GP_DATA_VIEWALIGN, B_REDR, "Stick to View", 170, 205, 150, 20, &gpd->flag, 0, 0, 0, 0, "New strokes are added on 2d-canvas"); -#endif - /* draw each layer --------------------------------------------- */ for (gpl= gpd->layers.first; gpl; gpl= gpl->next) { col= uiLayoutColumn(layout, 1); gp_drawui_layer(col, gpd, gpl); } + + /* draw gpd drawing settings first ------------------------------------- */ + col= uiLayoutColumn(layout, 0); + /* label */ + uiItemL(col, "Drawing Settings:", 0); + + /* 'stick to view' option */ + uiItemR(col, NULL, 0, &gpd_ptr, "view_space_draw", 0); } diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index c18a807f9d4..b5d25ce651f 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -239,8 +239,8 @@ static void gp_stroke_convertcoords (tGPsdata *p, short mval[], float out[]) /* 2d - relative to screen (viewport area) */ else { - out[0] = (float)(mval[0]) / (float)(p->sa->winx) * 100; - out[1] = (float)(mval[1]) / (float)(p->sa->winy) * 100; + out[0] = (float)(mval[0]) / (float)(p->ar->winx) * 100; + out[1] = (float)(mval[1]) / (float)(p->ar->winy) * 100; } } @@ -310,8 +310,8 @@ static short gp_stroke_addpoint (tGPsdata *p, int mval[2], float pressure) return GP_STROKEADD_NORMAL; } - /* just say it's normal for now, since we don't have another state... */ - return GP_STROKEADD_NORMAL; + /* return invalid state for now... */ + return GP_STROKEADD_INVALID; } /* smooth a stroke (in buffer) before storing it */ @@ -614,8 +614,8 @@ static void gp_stroke_eraser_dostroke (tGPsdata *p, int mval[], int mvalo[], sho } #endif else { - x0= (int)(gps->points->x / 100 * p->sa->winx); - y0= (int)(gps->points->y / 100 * p->sa->winy); + x0= (int)(gps->points->x / 100 * p->ar->winx); + y0= (int)(gps->points->y / 100 * p->ar->winy); } /* do boundbox check first */ @@ -671,10 +671,10 @@ static void gp_stroke_eraser_dostroke (tGPsdata *p, int mval[], int mvalo[], sho } #endif else { - x0= (int)(pt1->x / 100 * p->sa->winx); - y0= (int)(pt1->y / 100 * p->sa->winy); - x1= (int)(pt2->x / 100 * p->sa->winx); - y1= (int)(pt2->y / 100 * p->sa->winy); + x0= (int)(pt1->x / 100 * p->ar->winx); + y0= (int)(pt1->y / 100 * p->ar->winy); + x1= (int)(pt2->x / 100 * p->ar->winx); + y1= (int)(pt2->y / 100 * p->ar->winy); } /* check that point segment of the boundbox of the eraser stroke */ @@ -944,15 +944,15 @@ static void gp_paint_initstroke (tGPsdata *p, short paintmode) p->gpd->sbuffer_sflag |= GP_STROKE_ERASER; /* check if points will need to be made in view-aligned space */ - // XXX this should be the default? this is something that needs review - /*if (p->gpd->flag & GP_DATA_VIEWALIGN)*/ { + if (p->gpd->flag & GP_DATA_VIEWALIGN) { switch (p->sa->spacetype) { case SPACE_VIEW3D: { View3D *v3d= (View3D *)p->sa->spacedata.first; RegionView3D *rv3d= p->ar->regiondata; - // TODO: this should only happen for scene... otherwise apply correction for object center! + // TODO 1: when using objects, make the data stick to the object centers? + // TODO 2: what happens when cursor is behind view-camera plane? float *fp= give_cursor(p->scene, v3d); initgrabz(rv3d, fp[0], fp[1], fp[2]); @@ -1139,7 +1139,7 @@ static void gpencil_draw_apply (bContext *C, wmOperator *op, tGPsdata *p) if (G.f & G_DEBUG) printf("Error: Grease-Pencil Paint - Add Point Invalid \n"); - // XXX break! + return; } /* store used values */ diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index e025aca010c..df0e5ae6703 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -208,6 +208,7 @@ void rna_def_gpencil_layer(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_SELECT); RNA_def_property_ui_text(prop, "Selected", "Layer is selected for editing in the DopeSheet."); + // XXX keep this option? prop= RNA_def_property(srna, "show_points", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_DRAWDEBUG); RNA_def_property_ui_text(prop, "Show Points", "Draw the points which make up the strokes (for debugging purposes)."); @@ -229,6 +230,11 @@ void rna_def_gpencil_data(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "layers", NULL); RNA_def_property_struct_type(prop, "GPencilLayer"); RNA_def_property_ui_text(prop, "Layers", "Similar to layers in Photoshop."); + + /* Flags */ + prop= RNA_def_property(srna, "view_space_draw", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_DATA_VIEWALIGN); + RNA_def_property_ui_text(prop, "Stick to View", "Newly drawn strokes get added in view space (i.e. sketches stick to data when view is manipulated)."); } /* --- */ From 7df39b5ea2bd8bfd0c5a2a08aa2c52d051aa5fd5 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 30 Aug 2009 13:32:08 +0000 Subject: [PATCH 352/577] Grease Pencil: Basic Support for Image Editor Again * Grease Pencil works again from Image Editor now. For now, the GPencil datablock is linked to the Image Editor space, but this can be changed if need be. * Made Grease Pencil hotkeys into a separate Grease Pencil keymap, which can get included automagically like for frames/ui/v2d/etc. by supplying ED_KEYMAP_GPENCIL as part of st->keymapflag * Temporarily restored the nasty hack to make View2D-aligned sketches in Image Editor to use OpenGL lines only. I still dunno why this doesn't work normally. (Probably related is that strokes are not visible when there's no image visible atm). --- source/blender/editors/gpencil/drawgpencil.c | 17 +++++--- source/blender/editors/gpencil/gpencil_edit.c | 11 ++++++ source/blender/editors/gpencil/gpencil_ops.c | 7 +--- .../blender/editors/gpencil/gpencil_paint.c | 15 +++---- source/blender/editors/include/ED_gpencil.h | 3 +- source/blender/editors/include/ED_screen.h | 2 +- source/blender/editors/screen/area.c | 4 ++ source/blender/editors/space_api/spacetypes.c | 3 +- .../editors/space_image/image_buttons.c | 7 ++++ .../blender/editors/space_image/image_draw.c | 39 ++++++++++--------- .../editors/space_image/image_intern.h | 1 + .../blender/editors/space_image/space_image.c | 16 +++++--- .../editors/space_view3d/space_view3d.c | 2 +- .../blender/editors/space_view3d/view3d_ops.c | 4 -- 14 files changed, 82 insertions(+), 49 deletions(-) diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index d6678b50d7b..81ee2378717 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -83,6 +83,7 @@ enum { GP_DRAWDATA_ONLY3D = (1<<1), /* only draw 3d-strokes */ GP_DRAWDATA_ONLYV2D = (1<<2), /* only draw 'canvas' strokes */ GP_DRAWDATA_ONLYI2D = (1<<3), /* only draw 'image' strokes */ + GP_DRAWDATA_IEDITHACK = (1<<4), /* special hack for drawing strokes in Image Editor (weird coordinates) */ }; /* thickness above which we should use special drawing */ @@ -254,14 +255,12 @@ static void gp_draw_stroke_3d (bGPDspoint *points, int totpoints, short thicknes /* draw a given stroke in 2d */ static void gp_draw_stroke (bGPDspoint *points, int totpoints, short thickness, short dflag, short sflag, short debug, int offsx, int offsy, int winx, int winy) -{ - int spacetype= 0; // XXX make local gpencil state var? - +{ /* if thickness is less than GP_DRAWTHICKNESS_SPECIAL, 'smooth' opengl lines look better * - 'smooth' opengl lines are also required if Image Editor 'image-based' stroke */ if ( (thickness < GP_DRAWTHICKNESS_SPECIAL) || - ((spacetype==SPACE_IMAGE) && (dflag & GP_DRAWDATA_ONLYV2D)) ) + ((dflag & GP_DRAWDATA_IEDITHACK) && (dflag & GP_DRAWDATA_ONLYV2D)) ) { bGPDspoint *pt; int i; @@ -519,6 +518,9 @@ static void gp_draw_data (bGPdata *gpd, int offsx, int offsy, int winx, int winy { bGPDlayer *gpl, *actlay=NULL; + /* reset line drawing style (in case previous user didn't reset) */ + setlinestyle(0); + /* turn on smooth lines (i.e. anti-aliasing) */ glEnable(GL_LINE_SMOOTH); @@ -669,7 +671,7 @@ void draw_gpencil_2dimage (bContext *C, ImBuf *ibuf) wmOrtho2(ar->v2d.cur.xmin, ar->v2d.cur.xmax, ar->v2d.cur.ymin, ar->v2d.cur.ymax); - dflag |= GP_DRAWDATA_ONLYV2D; + dflag |= GP_DRAWDATA_ONLYV2D|GP_DRAWDATA_IEDITHACK; } break; @@ -729,6 +731,11 @@ void draw_gpencil_2dview (bContext *C, short onlyv2d) gpd= gpencil_data_get_active(C); // XXX if (gpd == NULL) return; + /* special hack for Image Editor */ + // FIXME: the opengl poly-strokes don't draw at right thickness when done this way, so disabled + if (sa->spacetype == SPACE_IMAGE) + dflag |= GP_DRAWDATA_IEDITHACK; + /* draw it! */ if (onlyv2d) dflag |= (GP_DRAWDATA_ONLYV2D|GP_DRAWDATA_NOSTATUS); gp_draw_data(gpd, 0, 0, ar->winx, ar->winy, CFRA, dflag); diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index b2228134750..74fbe250d37 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -125,6 +125,17 @@ bGPdata **gpencil_data_get_pointers (bContext *C, PointerRNA *ptr) } break; + case SPACE_IMAGE: /* Image/UV Editor */ + { + SpaceImage *sima= (SpaceImage *)CTX_wm_space_data(C); + + /* for now, Grease Pencil data is associated with the space... */ + // XXX our convention for everything else is to link to data though... + if (ptr) RNA_pointer_create((ID *)CTX_wm_screen(C), &RNA_SpaceImageEditor, sima, ptr); + return &sima->gpd; + } + break; + default: /* unsupported space */ return NULL; } diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c index 2d23a331211..3acbded0bf8 100644 --- a/source/blender/editors/gpencil/gpencil_ops.c +++ b/source/blender/editors/gpencil/gpencil_ops.c @@ -45,14 +45,11 @@ /* ****************************************** */ /* Generic Editing Keymap */ -void gpencil_common_keymap(wmWindowManager *wm, ListBase *keymap) +void ED_keymap_gpencil(wmWindowManager *wm) { + ListBase *keymap= WM_keymap_listbase(wm, "Grease Pencil", 0, 0); wmKeymapItem *kmi; - /* if no keymap provided, use default */ - if (keymap == NULL) - keymap= WM_keymap_listbase(wm, "Grease Pencil Generic", 0, 0); - /* Draw */ /* draw */ WM_keymap_add_item(keymap, "GPENCIL_OT_draw", LEFTMOUSE, KM_PRESS, 0, DKEY); diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index b5d25ce651f..67bf2951bf8 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -828,6 +828,7 @@ static tGPsdata *gp_session_initpaint (bContext *C) } } break; +#endif case SPACE_IMAGE: { SpaceImage *sima= curarea->spacedata.first; @@ -836,18 +837,20 @@ static tGPsdata *gp_session_initpaint (bContext *C) p->sa= curarea; p->ar= ar; p->v2d= &ar->v2d; - p->ibuf= BKE_image_get_ibuf(sima->image, &sima->iuser); + //p->ibuf= BKE_image_get_ibuf(sima->image, &sima->iuser); +#if 0 // XXX disabled for now /* check that gpencil data is allowed to be drawn */ if ((sima->flag & SI_DISPGP)==0) { p->status= GP_STATUS_ERROR; if (G.f & G_DEBUG) printf("Error: In active view, Grease Pencil not shown \n"); - return; + return p; } +#endif } break; -#endif + /* unsupported views */ default: { @@ -998,14 +1001,12 @@ static void gp_paint_initstroke (tGPsdata *p, short paintmode) p->im2d_settings.offsy= (int)((p->sa->winy-p->im2d_settings.sizey)/2 + sseq->yof); } break; +#endif case SPACE_IMAGE: { - /* check if any ibuf available */ - if (p->ibuf) - p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE; + p->gpd->sbuffer_sflag |= GP_STROKE_2DSPACE; } break; -#endif } } } diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h index ba60211ef3f..388da9a2acc 100644 --- a/source/blender/editors/include/ED_gpencil.h +++ b/source/blender/editors/include/ED_gpencil.h @@ -62,8 +62,7 @@ struct bGPdata *gpencil_data_get_active(struct bContext *C); /* ----------- Grease Pencil Operators ----------------- */ -void gpencil_common_keymap(struct wmWindowManager *wm, ListBase *keymap); - +void ED_keymap_gpencil(struct wmWindowManager *wm); void ED_operatortypes_gpencil(void); /* ------------ Grease-Pencil Drawing API ------------------ */ diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 22a3e737277..0153b3c9bdb 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -150,7 +150,7 @@ int ED_operator_posemode(struct bContext *C); #define ED_KEYMAP_MARKERS 4 #define ED_KEYMAP_ANIMATION 8 #define ED_KEYMAP_FRAMES 16 - +#define ED_KEYMAP_GPENCIL 32 #endif /* ED_SCREEN_H */ diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index f714a291bd7..8c55cccd6b0 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -797,6 +797,10 @@ static void ed_default_handlers(wmWindowManager *wm, ListBase *handlers, int fla ListBase *keymap= WM_keymap_listbase(wm, "Frames", 0, 0); WM_event_add_keymap_handler(handlers, keymap); } + if(flag & ED_KEYMAP_GPENCIL) { + ListBase *keymap= WM_keymap_listbase(wm, "Grease Pencil", 0, 0); + WM_event_add_keymap_handler(handlers, keymap); + } } diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c index 0d702144959..edd5da44526 100644 --- a/source/blender/editors/space_api/spacetypes.c +++ b/source/blender/editors/space_api/spacetypes.c @@ -86,6 +86,7 @@ void ED_spacetypes_init(void) ED_operatortypes_screen(); ED_operatortypes_anim(); ED_operatortypes_animchannels(); + ED_operatortypes_gpencil(); ED_operatortypes_object(); ED_operatortypes_mesh(); ED_operatortypes_sculpt(); @@ -99,7 +100,6 @@ void ED_spacetypes_init(void) ED_operatortypes_fluid(); ED_operatortypes_metaball(); ED_operatortypes_boids(); - ED_operatortypes_gpencil(); ED_operatortypes_sound(); ui_view2d_operatortypes(); @@ -121,6 +121,7 @@ void ED_spacetypes_keymap(wmWindowManager *wm) ED_keymap_screen(wm); ED_keymap_anim(wm); ED_keymap_animchannels(wm); + ED_keymap_gpencil(wm); ED_keymap_object(wm); ED_keymap_mesh(wm); ED_keymap_uvedit(wm); diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index ac0a5c7f53a..2eb070e0e6d 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -67,6 +67,7 @@ #include "IMB_imbuf.h" #include "IMB_imbuf_types.h" +#include "ED_gpencil.h" #include "ED_image.h" #include "ED_mesh.h" #include "ED_space_api.h" @@ -1438,6 +1439,12 @@ void image_buttons_register(ARegionType *art) strcpy(pt->label, "Curves"); pt->draw= image_panel_curves; BLI_addtail(&art->paneltypes, pt); + + pt= MEM_callocN(sizeof(PanelType), "spacetype image panel gpencil"); + strcpy(pt->idname, "IMAGE_PT_gpencil"); + strcpy(pt->label, "Grease Pencil"); + pt->draw= gpencil_panel_standard; + BLI_addtail(&art->paneltypes, pt); } static int image_properties(bContext *C, wmOperator *op) diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index 2f5fc805367..cf9bac1ebee 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -44,6 +44,7 @@ #include "IMB_imbuf.h" #include "IMB_imbuf_types.h" +#include "BKE_context.h" #include "BKE_colortools.h" #include "BKE_global.h" #include "BKE_image.h" @@ -53,6 +54,7 @@ #include "BIF_gl.h" #include "BIF_glutil.h" +#include "ED_gpencil.h" #include "ED_image.h" #include "ED_screen.h" @@ -525,22 +527,26 @@ static void draw_image_buffer_repeated(SpaceImage *sima, ARegion *ar, Scene *sce /* draw uv edit */ /* draw grease pencil */ - -static void draw_image_grease_pencil(SpaceImage *sima, ImBuf *ibuf) +void draw_image_grease_pencil(bContext *C, short onlyv2d) { - /* XXX bring back */ - /* draw grease-pencil ('image' strokes) */ - if (sima->flag & SI_DISPGP) - ; // XXX draw_gpencil_2dimage(sa, ibuf); - -#if 0 - mywinset(sa->win); /* restore scissor after gla call... */ - wmOrtho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375); -#endif - - /* draw grease-pencil (screen strokes) */ - if (sima->flag & SI_DISPGP) - ; // XXX draw_gpencil_2dview(sa, NULL); + /* draw in View2D space? */ + if (onlyv2d) { + /* assume that UI_view2d_ortho(C) has been called... */ + SpaceImage *sima= (SpaceImage *)CTX_wm_space_data(C); + ImBuf *ibuf= ED_space_image_buffer(sima); + + /* draw grease-pencil ('image' strokes) */ + //if (sima->flag & SI_DISPGP) + draw_gpencil_2dimage(C, ibuf); + } + else { + /* assume that UI_view2d_restore(C) has been called... */ + SpaceImage *sima= (SpaceImage *)CTX_wm_space_data(C); + + /* draw grease-pencil ('screen' strokes) */ + //if (sima->flag & SI_DISPGP) + draw_gpencil_2dview(C, 0); + } } /* XXX becomes WM paint cursor */ @@ -689,9 +695,6 @@ void draw_image_main(SpaceImage *sima, ARegion *ar, Scene *scene) else draw_image_buffer(sima, ar, scene, ima, ibuf, 0.0f, 0.0f, zoomx, zoomy); - /* grease pencil */ - draw_image_grease_pencil(sima, ibuf); - /* paint helpers */ draw_image_paint_helpers(sima, ar, scene, zoomx, zoomy); diff --git a/source/blender/editors/space_image/image_intern.h b/source/blender/editors/space_image/image_intern.h index aa97e339c68..a33475c1213 100644 --- a/source/blender/editors/space_image/image_intern.h +++ b/source/blender/editors/space_image/image_intern.h @@ -53,6 +53,7 @@ void IMAGE_OT_toolbox(struct wmOperatorType *ot); /* image_draw.c */ void draw_image_main(struct SpaceImage *sima, struct ARegion *ar, struct Scene *scene); void draw_image_info(struct ARegion *ar, int channels, int x, int y, char *cp, float *fp, int *zp, float *zpf); +void draw_image_grease_pencil(struct bContext *C, short onlyv2d); /* image_ops.c */ int space_image_main_area_poll(struct bContext *C); diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 1506df89c45..bb647e68917 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -54,6 +54,7 @@ #include "IMB_imbuf.h" #include "IMB_imbuf_types.h" +#include "ED_gpencil.h" #include "ED_image.h" #include "ED_mesh.h" #include "ED_space_api.h" @@ -430,16 +431,22 @@ static void image_main_area_draw(const bContext *C, ARegion *ar) /* we set view2d from own zoom and offset each time */ image_main_area_set_view2d(sima, ar, scene); - + /* we draw image in pixelspace */ draw_image_main(sima, ar, scene); /* and uvs in 0.0-1.0 space */ UI_view2d_view_ortho(C, v2d); - draw_uvedit_main(sima, ar, scene, obedit); - ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST); + draw_uvedit_main(sima, ar, scene, obedit); + ED_region_draw_cb_draw(C, ar, REGION_DRAW_POST); + + /* Grease Pencil too (in addition to UV's) */ + draw_image_grease_pencil((bContext *)C, 1); UI_view2d_view_restore(C); + /* draw Grease Pencil - screen space only */ + draw_image_grease_pencil((bContext *)C, 0); + /* scrollers? */ /*scrollers= UI_view2d_scrollers_calc(C, v2d, V2D_UNIT_VALUES, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY); UI_view2d_scrollers_draw(C, v2d, scrollers); @@ -558,11 +565,10 @@ void ED_spacetype_image(void) /* regions: main window */ art= MEM_callocN(sizeof(ARegionType), "spacetype image region"); art->regionid = RGN_TYPE_WINDOW; - art->keymapflag= ED_KEYMAP_FRAMES; + art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_GPENCIL; art->init= image_main_area_init; art->draw= image_main_area_draw; art->listener= image_main_area_listener; - art->keymapflag= 0; BLI_addhead(&st->regiontypes, art); diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 3dd65a6f796..97c5549e1ea 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -871,7 +871,7 @@ void ED_spacetype_view3d(void) /* regions: main window */ art= MEM_callocN(sizeof(ARegionType), "spacetype view3d region"); art->regionid = RGN_TYPE_WINDOW; - art->keymapflag= ED_KEYMAP_FRAMES; + art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_GPENCIL; art->draw= view3d_main_area_draw; art->init= view3d_main_area_init; art->free= view3d_main_area_free; diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index f4e1e008099..7da2e591b10 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -52,7 +52,6 @@ #include "WM_api.h" #include "WM_types.h" -#include "ED_gpencil.h" #include "ED_screen.h" #include "ED_transform.h" @@ -133,9 +132,6 @@ void view3d_keymap(wmWindowManager *wm) km = WM_keymap_add_item(keymap, "SKETCH_OT_draw_preview", MOUSEMOVE, KM_ANY, KM_CTRL, 0); RNA_boolean_set(km->ptr, "snap", 1); - /* grease pencil */ - gpencil_common_keymap(wm, keymap); - WM_keymap_verify_item(keymap, "VIEW3D_OT_manipulator", LEFTMOUSE, KM_PRESS, 0, 0); /* manipulator always on left mouse, not on action mouse*/ WM_keymap_verify_item(keymap, "VIEW3D_OT_cursor3d", ACTIONMOUSE, KM_PRESS, 0, 0); From 257ad93e6deb3e69198bd7c52fa9b44e4093746e Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sun, 30 Aug 2009 15:00:42 +0000 Subject: [PATCH 353/577] Removing old datatoc C source code; use the python version now! --- release/datafiles/datatoc.c | 102 ------------------------------------ 1 file changed, 102 deletions(-) delete mode 100644 release/datafiles/datatoc.c diff --git a/release/datafiles/datatoc.c b/release/datafiles/datatoc.c deleted file mode 100644 index 46b935c7fd6..00000000000 --- a/release/datafiles/datatoc.c +++ /dev/null @@ -1,102 +0,0 @@ -/** - * $Id$ - * - * ***** 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 ***** - */ - -#include -#include -#include - -int main(int argc, char**argv) { - FILE *fpin, *fpout; - char cname[256]; - char sizest[256]; - size_t size; - int i; - - if (argc<1) { - printf ("Usage: datatoc \n"); - exit(1); - } - - fpin= fopen(argv[1], "rb"); - if (!fpin) { - printf ("Unable to open input <%s>\n", argv[1]); - exit(1); - } - - fseek (fpin, 0L, SEEK_END); - size= ftell(fpin); - fseek (fpin, 0L, SEEK_SET); - - if (argv[1][0]=='.') argv[1]++; - - sprintf(cname, "%s.c", argv[1]); - printf ("Making C file <%s>\n", cname); - - for (i=0; i < (int)strlen(argv[1]); i++) - if (argv[1][i]=='.') argv[1][i]='_'; - - sprintf(sizest, "%d", (int)size); - printf ("Input filesize is %ld, Output size should be %ld\n", size, ((int)size)*4 + strlen("/* DataToC output of file <> */\n\n") + strlen("char datatoc_[]= {\"") + strlen ("\"};\n") + (strlen(argv[1])*3) + strlen(sizest) + strlen("int datatoc__size= ;\n") +(((int)(size/256)+1)*5)); - - fpout= fopen(cname, "w"); - if (!fpout) { - printf ("Unable to open output <%s>\n", cname); - exit(1); - } - - fprintf (fpout, "/* DataToC output of file <%s> */\n\n",argv[1]); - fprintf (fpout, "int datatoc_%s_size= %s;\n", argv[1], sizest); - /* - fprintf (fpout, "char datatoc_%s[]= {\"", argv[1]); - - while (size--) { - if(size%256==0) - fprintf(fpout, "\" \\\n\""); - - fprintf (fpout, "\\x%02x", getc(fpin)); - } - - fprintf (fpout, "\"};\n"); - */ - - fprintf (fpout, "char datatoc_%s[]= {\n", argv[1]); - while (size--) { - if(size%32==31) - fprintf(fpout, "\n"); - - /* fprintf (fpout, "\\x%02x", getc(fpin)); */ - fprintf (fpout, "%3d,", getc(fpin)); - } - /* null terminate for the case it is a string */ - fprintf (fpout, "\n 0};\n\n"); - - fclose(fpin); - fclose(fpout); - return 0; -} From 557cf2906befb77eae15a96a385b0d92d563c31e Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Sun, 30 Aug 2009 16:18:05 +0000 Subject: [PATCH 354/577] 2.5 Sound: * Updated UserDef RNA so that only compiled in audio drivers are displayed. (Missing definitions in Makefiles, someone fix please!) * Fixed libsndfile and ffmpeg building with CMake with msvc. --- CMakeLists.txt | 4 ++-- source/blender/makesrna/intern/CMakeLists.txt | 12 ++++++++++++ source/blender/makesrna/intern/SConscript | 9 +++++++++ source/blender/makesrna/intern/rna_userdef.c | 6 ++++++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a92099698c6..1921ef65017 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -259,7 +259,7 @@ IF(WIN32) IF(WITH_SNDFILE) SET(SNDFILE ${LIBDIR}/sndfile) SET(SNDFILE_INC ${SNDFILE}/include) - SET(SNDFILE_LIB sndfile-1) + SET(SNDFILE_LIB libsndfile-1) SET(SNDFILE_LIBPATH ${SNDFILE}/lib) ENDIF(WITH_SNDFILE) @@ -329,7 +329,7 @@ IF(WIN32) SET(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries) SET(FFMPEG ${LIBDIR}/ffmpeg) - SET(FFMPEG_INC ${FFMPEG}/include) + SET(FFMPEG_INC ${FFMPEG}/include ${FFMPEG}/include/msvc) SET(FFMPEG_LIB avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0) SET(FFMPEG_LIBPATH ${FFMPEG}/lib) diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 152f4031b91..a1f42fbccb3 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -75,6 +75,18 @@ IF(WITH_FFTW3) ADD_DEFINITIONS(-DFFTW3=1) ENDIF(WITH_FFTW3) +IF(WITH_SDL) + ADD_DEFINITIONS(-DWITH_SDL) +ENDIF(WITH_SDL) + +IF(WITH_OPENAL) + ADD_DEFINITIONS(-DWITH_OPENAL) +ENDIF(WITH_OPENAL) + +IF(WITH_JACK) + ADD_DEFINITIONS(-DWITH_JACK) +ENDIF(WITH_JACK) + # Build makesrna executable ADD_EXECUTABLE(makesrna ${SRC} ${INC_FILES}) TARGET_LINK_LIBRARIES(makesrna bf_dna) diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript index 1a3687af51e..a24c25b8b95 100644 --- a/source/blender/makesrna/intern/SConscript +++ b/source/blender/makesrna/intern/SConscript @@ -62,6 +62,15 @@ if env['WITH_BF_GAMEENGINE']: if env['WITH_BF_FFTW3']: defs.append('FFTW3=1') +if env['WITH_BF_SDL']: + defs.append('WITH_SDL') + +if env['WITH_BF_OPENAL']: + defs.append('WITH_OPENAL') + +if env['WITH_BF_JACK']: + defs.append('WITH_JACK') + makesrna_tool.Append(CPPDEFINES=defs) makesrna_tool.Append (CPPPATH = Split(incs)) diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index ba980d4caf4..a0716cc7dc7 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2021,9 +2021,15 @@ static void rna_def_userdef_system(BlenderRNA *brna) static EnumPropertyItem audio_device_items[] = { {0, "AUDIO_DEVICE_NULL", 0, "No Audio", "Null device - there will be no audio output."}, +#ifdef WITH_SDL {1, "AUDIO_DEVICE_SDL", 0, "SDL", "SDL device - simple direct media layer, recommended for sequencer usage."}, +#endif +#ifdef WITH_OPENAL {2, "AUDIO_DEVICE_OPENAL", 0, "OpenAL", "OpenAL device - supports 3D audio, recommended for game engine usage."}, +#endif +#ifdef WITH_JACK {3, "AUDIO_DEVICE_JACK", 0, "Jack", "Jack device - open source pro audio, recommended for pro audio users."}, +#endif {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem audio_rate_items[] = { From fee715f8a99c38df08942f39769e7bc520d848da Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Sun, 30 Aug 2009 17:34:04 +0000 Subject: [PATCH 355/577] Make file directly executable. --- release/datafiles/datatoc.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 release/datafiles/datatoc.py diff --git a/release/datafiles/datatoc.py b/release/datafiles/datatoc.py old mode 100644 new mode 100755 From fa68f7ff76cea0fa8b818d332da3ec2213623b35 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 30 Aug 2009 19:02:48 +0000 Subject: [PATCH 356/577] made python 2.x and 3.x compatible. --- release/datafiles/datatoc.py | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/release/datafiles/datatoc.py b/release/datafiles/datatoc.py index 805d7205651..ea72870f2a0 100755 --- a/release/datafiles/datatoc.py +++ b/release/datafiles/datatoc.py @@ -1,5 +1,6 @@ -#!/usr/bin/python3 -# +#!/usr/bin/python +# -*- coding: utf-8 -*- + # ***** BEGIN GPL LICENSE BLOCK ***** # # This program is free software; you can redistribute it and/or @@ -23,10 +24,10 @@ # # ***** END GPL LICENCE BLOCK ***** -import sys +import sys, os if len(sys.argv) < 2: - print("Usage: datatoc ") + sys.stdout.write("Usage: datatoc \n") sys.exit(1) filename = sys.argv[1] @@ -34,37 +35,38 @@ filename = sys.argv[1] try: fpin = open(filename, "rb"); except: - print("Unable to open input <{0}>".format(sys.argv[1])) + sys.stdout.write("Unable to open input %s\n" % sys.argv[1]) sys.exit(1) -size = fpin.seek(0, 2) +fpin.seek(0, os.SEEK_END) +size = fpin.tell() fpin.seek(0) if filename[0] == ".": filename = filename[1:] cname = filename + ".c" -print("Making C file <{0}>".format(cname)) +sys.stdout.write("Making C file <%s>\n" % cname) filename = filename.replace(".", "_") - +sys.stdout.write(str(size)) try: fpout = open(cname, "w") except: - print("Unable to open output <{0}>".format(cname)) + sys.stdout.write("Unable to open output %s\n" % cname) sys.exit(1) -fpout.write("/* DataToC output of file <{0}> */\n\n".format(filename)) -fpout.write("int datatoc_{0}_size= {1};\n".format(filename, size)) +fpout.write("/* DataToC output of file <%s> */\n\n" % filename) +fpout.write("int datatoc_%s_size= %d;\n" % (filename, size)) -fpout.write("char datatoc_{0}[]= {{\n".format(filename)) +fpout.write("char datatoc_%s[]= {\n" % filename) while size > 0: size -= 1 if size % 32 == 31: fpout.write("\n") - fpout.write("{0:3d},".format(ord(fpin.read(1)))) + fpout.write("%.2d," % ord(fpin.read(1))) fpout.write("\n 0};\n\n") From 9abfb508de3c62e72473871b80878a280cbb282a Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sun, 30 Aug 2009 19:26:18 +0000 Subject: [PATCH 357/577] 2.5 Mist/Camera: Changing Mist values didn't update the mist camera drawing in 3D View, when enabled. Bug reported by Julian|H. Thanks! --- source/blender/makesrna/intern/rna_world.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index 525a4446932..0ed5016ccd2 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -324,12 +324,14 @@ static void rna_def_world_mist(BlenderRNA *brna) RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 10000, 10, 2); RNA_def_property_ui_text(prop, "Start", "Starting distance of the mist, measured from the camera"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); prop= RNA_def_property(srna, "depth", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "mistdist"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 10000, 10, 2); RNA_def_property_ui_text(prop, "Depth", "The distance over which the mist effect fades in"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "misthi"); From ca96a75af49910340540960e7dbc797be9b01caf Mon Sep 17 00:00:00 2001 From: Peter Schlaile Date: Sun, 30 Aug 2009 19:38:22 +0000 Subject: [PATCH 358/577] == Sequencer == Fixed hddaudio for sample formats other than 16 bit (8 bit e.g.) --- source/blender/src/hddaudio.c | 66 +++++++++++++++++++++++------------ 1 file changed, 44 insertions(+), 22 deletions(-) diff --git a/source/blender/src/hddaudio.c b/source/blender/src/hddaudio.c index 2aa434e4ac7..be5e07929bf 100644 --- a/source/blender/src/hddaudio.c +++ b/source/blender/src/hddaudio.c @@ -68,14 +68,15 @@ struct hdaudio { int frame_alloc_duration; int decode_pos; int frame_size; - short * decode_cache; - short * decode_cache_zero; + unsigned char * decode_cache; + unsigned char * decode_cache_zero; short * resample_cache; int decode_cache_size; int target_channels; int target_rate; int resample_samples_written; int resample_samples_in; + int decode_sample_format_size; ReSampleContext *resampler; #else @@ -178,9 +179,13 @@ struct hdaudio * sound_open_hdaudio(char * filename) (long long) rval->sample_rate * rval->channels * rval->frame_alloc_duration / AV_TIME_BASE * 2; + rval->decode_sample_format_size + = av_get_bits_per_sample_format(rval->pCodecCtx->sample_fmt) + / 8; - rval->decode_cache = (short*) MEM_mallocN( - rval->decode_cache_size * sizeof(short) + rval->decode_cache = (unsigned char*) MEM_mallocN( + rval->decode_cache_size + * rval->decode_sample_format_size + AVCODEC_MAX_AUDIO_FRAME_SIZE, "hdaudio decode cache"); rval->decode_cache_zero = rval->decode_cache; @@ -191,6 +196,7 @@ struct hdaudio * sound_open_hdaudio(char * filename) rval->resample_cache = 0; rval->resample_samples_written = 0; rval->resample_samples_in = 0; + return rval; #else return 0; @@ -260,7 +266,8 @@ static void sound_hdaudio_run_resampler_continue( = audio_resample( hdaudio->resampler, hdaudio->resample_cache + reuse_tgt, - hdaudio->decode_cache_zero + reuse_src, + hdaudio->decode_cache_zero + + reuse_src * hdaudio->decode_sample_format_size, next_samples_in) + reuse_tgt / target_channels; @@ -285,7 +292,7 @@ static void sound_hdaudio_init_resampler( hdaudio->resampler = av_audio_resample_init( target_channels, hdaudio->channels, target_rate, hdaudio->sample_rate, - SAMPLE_FMT_S16, SAMPLE_FMT_S16, + SAMPLE_FMT_S16, hdaudio->pCodecCtx->sample_fmt, 16, 10, 0, 0.8); hdaudio->target_rate = target_rate; hdaudio->target_channels = target_channels; @@ -327,7 +334,8 @@ static void sound_hdaudio_extract_small_block( * hdaudio->frame_duration / AV_TIME_BASE; rate_conversion = (target_rate != hdaudio->sample_rate) - || (target_channels != hdaudio->channels); + || (target_channels != hdaudio->channels) + || (hdaudio->pCodecCtx->sample_fmt != SAMPLE_FMT_S16); sample_ofs = target_channels * (sample_position % frame_size); frame_position = sample_position / frame_size; @@ -346,15 +354,20 @@ static void sound_hdaudio_extract_small_block( hdaudio->frame_position = frame_position; memmove(hdaudio->decode_cache, - hdaudio->decode_cache + bl_size, - (decode_pos - bl_size) * sizeof(short)); + hdaudio->decode_cache + bl_size + * hdaudio->decode_sample_format_size, + (decode_pos - bl_size) + * hdaudio->decode_sample_format_size); decode_pos -= bl_size; if (decode_pos < hdaudio->decode_cache_size) { - memset(hdaudio->decode_cache + decode_pos, 0, + memset(hdaudio->decode_cache + + decode_pos + * hdaudio->decode_sample_format_size, + 0, (hdaudio->decode_cache_size - decode_pos) - * sizeof(short)); + * hdaudio->decode_sample_format_size); while(av_read_frame( hdaudio->pFormatCtx, &packet) >= 0) { @@ -377,7 +390,8 @@ static void sound_hdaudio_extract_small_block( len = avcodec_decode_audio2( hdaudio->pCodecCtx, hdaudio->decode_cache - + decode_pos, + + decode_pos + * hdaudio->decode_sample_format_size, &data_size, audio_pkt_data, audio_pkt_size); @@ -393,16 +407,17 @@ static void sound_hdaudio_extract_small_block( continue; } - decode_pos += data_size / sizeof(short); + decode_pos += data_size + / hdaudio->decode_sample_format_size; if (decode_pos + data_size - / sizeof(short) + / hdaudio->decode_sample_format_size > hdaudio->decode_cache_size) { break; } } av_free_packet(&packet); - if (decode_pos + data_size / sizeof(short) + if (decode_pos + data_size / hdaudio->decode_sample_format_size > hdaudio->decode_cache_size) { break; } @@ -455,7 +470,8 @@ static void sound_hdaudio_extract_small_block( avcodec_flush_buffers(hdaudio->pCodecCtx); memset(hdaudio->decode_cache, 0, - hdaudio->decode_cache_size * sizeof(short)); + hdaudio->decode_cache_size + * hdaudio->decode_sample_format_size); hdaudio->decode_cache_zero = hdaudio->decode_cache; @@ -512,7 +528,9 @@ static void sound_hdaudio_extract_small_block( } hdaudio->decode_cache_zero - = hdaudio->decode_cache + diff; + = hdaudio->decode_cache + + diff + * hdaudio->decode_sample_format_size; decode_cache_zero_init = 1; } @@ -521,7 +539,8 @@ static void sound_hdaudio_extract_small_block( len = avcodec_decode_audio2( hdaudio->pCodecCtx, hdaudio->decode_cache - + decode_pos, + + decode_pos + * hdaudio->decode_sample_format_size, &data_size, audio_pkt_data, audio_pkt_size); @@ -537,9 +556,10 @@ static void sound_hdaudio_extract_small_block( continue; } - decode_pos += data_size / sizeof(short); + decode_pos += data_size + / hdaudio->decode_sample_format_size; if (decode_pos + data_size - / sizeof(short) + / hdaudio->decode_sample_format_size > hdaudio->decode_cache_size) { break; } @@ -547,7 +567,8 @@ static void sound_hdaudio_extract_small_block( av_free_packet(&packet); - if (decode_pos + data_size / sizeof(short) + if (decode_pos + data_size + / hdaudio->decode_sample_format_size > hdaudio->decode_cache_size) { break; } @@ -561,7 +582,8 @@ static void sound_hdaudio_extract_small_block( memcpy(target_buffer, (rate_conversion ? hdaudio->resample_cache - : hdaudio->decode_cache_zero) + sample_ofs, + : (short*) + hdaudio->decode_cache_zero) + sample_ofs, nb_samples * target_channels * sizeof(short)); } From 6422d335cab87242aa2bf34290817ca96d11e464 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Sun, 30 Aug 2009 20:03:47 +0000 Subject: [PATCH 359/577] bugfix of the bugfix --- release/datafiles/datatoc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/release/datafiles/datatoc.py b/release/datafiles/datatoc.py index ea72870f2a0..362d4ddc126 100755 --- a/release/datafiles/datatoc.py +++ b/release/datafiles/datatoc.py @@ -50,6 +50,7 @@ sys.stdout.write("Making C file <%s>\n" % cname) filename = filename.replace(".", "_") sys.stdout.write(str(size)) +sys.stdout.write("\n") try: fpout = open(cname, "w") except: @@ -66,7 +67,7 @@ while size > 0: if size % 32 == 31: fpout.write("\n") - fpout.write("%.2d," % ord(fpin.read(1))) + fpout.write("%3d," % ord(fpin.read(1))) fpout.write("\n 0};\n\n") From a7689e9b60ef6dbe720a13abddb47f5137fc222d Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Sun, 30 Aug 2009 21:00:26 +0000 Subject: [PATCH 360/577] 2.5 Physic Buttons: * Some Panels missed the "md" context declaration for the new cloth_panel_enabled(md) check. * Code Cleanup. --- release/ui/buttons_physics_cloth.py | 23 ++-- release/ui/buttons_physics_fluid.py | 20 +--- release/ui/buttons_physics_softbody.py | 153 ++++++++++++------------- 3 files changed, 93 insertions(+), 103 deletions(-) diff --git a/release/ui/buttons_physics_cloth.py b/release/ui/buttons_physics_cloth.py index 9399d557a51..a1978f44c18 100644 --- a/release/ui/buttons_physics_cloth.py +++ b/release/ui/buttons_physics_cloth.py @@ -43,11 +43,11 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel): if md: cloth = md.settings + + layout.active = cloth_panel_enabled(md) split = layout.split() - split.active = cloth_panel_enabled(md) - col = split.column() col.itemL(text="Quality:") col.itemR(cloth, "quality", text="Steps",slider=True) @@ -89,7 +89,7 @@ class PHYSICS_PT_cloth_cache(PhysicButtonsPanel): __default_closed__ = True def poll(self, context): - return (context.cloth != None) + return (context.cloth) def draw(self, context): md = context.cloth @@ -100,7 +100,7 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel): __default_closed__ = True def poll(self, context): - return (context.cloth != None) + return (context.cloth) def draw_header(self, context): layout = self.layout @@ -111,11 +111,14 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel): def draw(self, context): layout = self.layout + cloth = context.cloth.collision_settings - split = layout.split() + md = context.cloth layout.active = cloth.enable_collision and cloth_panel_enabled(md) + split = layout.split() + col = split.column() col.itemR(cloth, "collision_quality", slider=True, text="Quality") col.itemR(cloth, "min_distance", slider=True, text="Distance") @@ -123,10 +126,10 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel): col = split.column() col.itemR(cloth, "enable_self_collision", text="Self Collision") - col = col.column() - col.active = cloth.enable_self_collision - col.itemR(cloth, "self_collision_quality", slider=True, text="Quality") - col.itemR(cloth, "self_min_distance", slider=True, text="Distance") + sub = col.column() + sub.active = cloth.enable_self_collision + sub.itemR(cloth, "self_collision_quality", slider=True, text="Quality") + sub.itemR(cloth, "self_min_distance", slider=True, text="Distance") class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel): __label__ = "Cloth Stiffness Scaling" @@ -144,6 +147,8 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel): def draw(self, context): layout = self.layout + + md = context.cloth ob = context.object cloth = context.cloth.settings diff --git a/release/ui/buttons_physics_fluid.py b/release/ui/buttons_physics_fluid.py index 5af63bdc3ba..fe15e22f0b9 100644 --- a/release/ui/buttons_physics_fluid.py +++ b/release/ui/buttons_physics_fluid.py @@ -175,11 +175,7 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel): def poll(self, context): md = context.fluid if md: - settings = md.settings - if settings: - return (settings.type == 'DOMAIN') - - return False + return (md.settings.type == 'DOMAIN') def draw(self, context): layout = self.layout @@ -218,11 +214,7 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel): def poll(self, context): md = context.fluid if md: - settings = md.settings - if settings: - return (settings.type == 'DOMAIN') - - return False + return (md.settings.type == 'DOMAIN') def draw(self, context): layout = self.layout @@ -251,12 +243,8 @@ class PHYSICS_PT_domain_particles(PhysicButtonsPanel): def poll(self, context): md = context.fluid if md: - settings = md.settings - if settings: - return (settings.type == 'DOMAIN') - - return False - + return (md.settings.type == 'DOMAIN') + def draw(self, context): layout = self.layout diff --git a/release/ui/buttons_physics_softbody.py b/release/ui/buttons_physics_softbody.py index 3d3c3c23faf..73eb15d2212 100644 --- a/release/ui/buttons_physics_softbody.py +++ b/release/ui/buttons_physics_softbody.py @@ -71,6 +71,7 @@ class PHYSICS_PT_softbody_cache(PhysicButtonsPanel): class PHYSICS_PT_softbody_goal(PhysicButtonsPanel): __label__ = "Soft Body Goal" + __default_closed__ = True def poll(self, context): return (context.soft_body) @@ -87,39 +88,39 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel): layout = self.layout md = context.soft_body + softbody = md.settings ob = context.object + + layout.active = softbody.use_goal and softbody_panel_enabled(md) split = layout.split() - - if md: - softbody = md.settings - layout.active = softbody.use_goal and softbody_panel_enabled(md) - # Goal - split = layout.split() + # Goal + split = layout.split() - col = split.column() - col.itemL(text="Goal Strengths:") - col.itemR(softbody, "goal_default", text="Default") - sub = col.column(align=True) - sub.itemR(softbody, "goal_min", text="Minimum") - sub.itemR(softbody, "goal_max", text="Maximum") + col = split.column() + col.itemL(text="Goal Strengths:") + col.itemR(softbody, "goal_default", text="Default") + sub = col.column(align=True) + sub.itemR(softbody, "goal_min", text="Minimum") + sub.itemR(softbody, "goal_max", text="Maximum") - col = split.column() - col.itemL(text="Goal Settings:") - col.itemR(softbody, "goal_spring", text="Stiffness") - col.itemR(softbody, "goal_friction", text="Damping") + col = split.column() + col.itemL(text="Goal Settings:") + col.itemR(softbody, "goal_spring", text="Stiffness") + col.itemR(softbody, "goal_friction", text="Damping") - layout.item_pointerR(softbody, "goal_vertex_group", ob, "vertex_groups", text="Vertex Group") + layout.item_pointerR(softbody, "goal_vertex_group", ob, "vertex_groups", text="Vertex Group") class PHYSICS_PT_softbody_edge(PhysicButtonsPanel): __label__ = "Soft Body Edges" + __default_closed__ = True def poll(self, context): return (context.soft_body) def draw_header(self, context): - layout = self.layout + #layout = self.layout softbody = context.soft_body.settings @@ -130,41 +131,40 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel): layout = self.layout md = context.soft_body + softbody = md.settings ob = context.object - - if md: - softbody = md.settings - - layout.active = softbody.use_edges and softbody_panel_enabled(md) - - split = layout.split() - - col = split.column() - col.itemL(text="Springs:") - col.itemR(softbody, "pull") - col.itemR(softbody, "push") - col.itemR(softbody, "damp") - col.itemR(softbody, "plastic") - col.itemR(softbody, "bending") - col.itemR(softbody, "spring_length", text="Length") - - col = split.column() - col.itemR(softbody, "stiff_quads") - sub = col.column() - sub.active = softbody.stiff_quads - sub.itemR(softbody, "shear") - - col.itemR(softbody, "new_aero", text="Aero") - sub = col.column() - sub.enabled = softbody.new_aero - sub.itemR(softbody, "aero", text="Factor") - col.itemL(text="Collision:") - col.itemR(softbody, "edge_collision", text="Edge") - col.itemR(softbody, "face_collision", text="Face") + layout.active = softbody.use_edges and softbody_panel_enabled(md) + + split = layout.split() + + col = split.column() + col.itemL(text="Springs:") + col.itemR(softbody, "pull") + col.itemR(softbody, "push") + col.itemR(softbody, "damp") + col.itemR(softbody, "plastic") + col.itemR(softbody, "bending") + col.itemR(softbody, "spring_length", text="Length") + + col = split.column() + col.itemR(softbody, "stiff_quads") + sub = col.column() + sub.active = softbody.stiff_quads + sub.itemR(softbody, "shear") + + col.itemR(softbody, "new_aero", text="Aero") + sub = col.column() + sub.enabled = softbody.new_aero + sub.itemR(softbody, "aero", text="Factor") + + col.itemL(text="Collision:") + col.itemR(softbody, "edge_collision", text="Edge") + col.itemR(softbody, "face_collision", text="Face") class PHYSICS_PT_softbody_collision(PhysicButtonsPanel): __label__ = "Soft Body Collision" + __default_closed__ = True def poll(self, context): return (context.soft_body) @@ -181,24 +181,23 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel): layout = self.layout md = context.soft_body + softbody = md.settings ob = context.object - - if md: - softbody = md.settings - layout.active = softbody.self_collision and softbody_panel_enabled(md) + layout.active = softbody.self_collision and softbody_panel_enabled(md) - layout.itemL(text="Collision Type:") - layout.itemR(softbody, "collision_type", expand=True) + layout.itemL(text="Collision Type:") + layout.itemR(softbody, "collision_type", expand=True) - col = layout.column(align=True) - col.itemL(text="Ball:") - col.itemR(softbody, "ball_size", text="Size") - col.itemR(softbody, "ball_stiff", text="Stiffness") - col.itemR(softbody, "ball_damp", text="Dampening") + col = layout.column(align=True) + col.itemL(text="Ball:") + col.itemR(softbody, "ball_size", text="Size") + col.itemR(softbody, "ball_stiff", text="Stiffness") + col.itemR(softbody, "ball_damp", text="Dampening") class PHYSICS_PT_softbody_solver(PhysicButtonsPanel): __label__ = "Soft Body Solver" + __default_closed__ = True def poll(self, context): return (context.soft_body) @@ -207,30 +206,28 @@ class PHYSICS_PT_softbody_solver(PhysicButtonsPanel): layout = self.layout md = context.soft_body + softbody = md.settings ob = context.object - - if md: - softbody = md.settings - - layout.active = softbody_panel_enabled(md) - # Solver - split = layout.split() + layout.active = softbody_panel_enabled(md) + + # Solver + split = layout.split() - col = split.column(align=True) - col.itemL(text="Step Size:") - col.itemR(softbody, "minstep") - col.itemR(softbody, "maxstep") - col.itemR(softbody, "auto_step", text="Auto-Step") + col = split.column(align=True) + col.itemL(text="Step Size:") + col.itemR(softbody, "minstep") + col.itemR(softbody, "maxstep") + col.itemR(softbody, "auto_step", text="Auto-Step") - col = split.column() - col.itemR(softbody, "error_limit") - col.itemL(text="Helpers:") - col.itemR(softbody, "choke") - col.itemR(softbody, "fuzzy") + col = split.column() + col.itemR(softbody, "error_limit") + col.itemL(text="Helpers:") + col.itemR(softbody, "choke") + col.itemR(softbody, "fuzzy") - layout.itemL(text="Diagnostics:") - layout.itemR(softbody, "diagnose") + layout.itemL(text="Diagnostics:") + layout.itemR(softbody, "diagnose") bpy.types.register(PHYSICS_PT_softbody) bpy.types.register(PHYSICS_PT_softbody_cache) From 1a968f64dcb706b90a877a1196d0b70a3c57fcff Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Sun, 30 Aug 2009 21:57:10 +0000 Subject: [PATCH 361/577] Fix crash reported by DingTo with camera transform in camera view. --- source/blender/editors/transform/transform_conversions.c | 2 +- source/blender/editors/transform/transform_generics.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index aaede541b76..86d3af31c85 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -5289,7 +5289,7 @@ void createTransData(bContext *C, TransInfo *t) if (t->ar->regiontype == RGN_TYPE_WINDOW) { View3D *v3d = t->view; - RegionView3D *rv3d = t->ar->regiondata; + RegionView3D *rv3d = CTX_wm_region_view3d(C); if((t->flag & T_OBJECT) && v3d->camera == OBACT && rv3d->persp==V3D_CAMOB) { t->flag |= T_CAMERA; diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index edcbd858e37..0f715f1d35a 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1323,7 +1323,7 @@ void calculateCenter(TransInfo *t) /* voor panning from cameraview */ if(t->flag & T_OBJECT) { - if(t->spacetype==SPACE_VIEW3D) + if(t->spacetype==SPACE_VIEW3D && t->ar->regiontype == RGN_TYPE_WINDOW) { View3D *v3d = t->view; Scene *scene = t->scene; From 3fa51df744ea5c4585e4cb53a207a0f106ec2032 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 31 Aug 2009 01:58:11 +0000 Subject: [PATCH 362/577] Grease Pencil: Restored some editing operators (convert and delete active frame) * Convert operator - can currently be used to convert active Grease Pencil layer to curves. I had a look at making this part of a special "curve sketching" macro, though it seems that we cannot have modal operators coming first in a macro (and also cannot specify operator calling modes) * Delete Active Frame operator - does what its name say it does. It deletes the active frame for the active layer of Grease Pencil sketches. --- source/blender/blenkernel/intern/gpencil.c | 2 +- .../blender/editors/gpencil/gpencil_buttons.c | 20 +- source/blender/editors/gpencil/gpencil_edit.c | 304 ++++++++++++++++++ .../blender/editors/gpencil/gpencil_intern.h | 4 + source/blender/editors/gpencil/gpencil_ops.c | 4 + 5 files changed, 324 insertions(+), 10 deletions(-) diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index b02128c3c68..43c4137e73e 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -313,7 +313,7 @@ bGPdata *gpencil_data_duplicate (bGPdata *src) void gpencil_frame_delete_laststroke (bGPDlayer *gpl, bGPDframe *gpf) { bGPDstroke *gps= (gpf) ? gpf->strokes.last : NULL; - int cfra = 1; // XXX FIXME!!! + int cfra = (gpf) ? gpf->framenum : 0; /* assume that the current frame was not locked */ /* error checking */ if (ELEM(NULL, gpf, gps)) diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c index 774f7b7162b..c3f779b59b8 100644 --- a/source/blender/editors/gpencil/gpencil_buttons.c +++ b/source/blender/editors/gpencil/gpencil_buttons.c @@ -203,6 +203,12 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl) subcol= uiLayoutColumn(col, 1); uiItemR(subcol, NULL, 0, &ptr, "line_thickness", UI_ITEM_R_SLIDER); + /* debugging options */ + if (G.f & G_DEBUG) { + subcol= uiLayoutColumn(col, 1); + uiItemR(subcol, NULL, 0, &ptr, "show_points", 0); + } + /* right column ................... */ col= uiLayoutColumn(split, 0); @@ -211,15 +217,10 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl) uiItemR(subcol, "Onion Skinning", 0, &ptr, "use_onion_skinning", 0); uiItemR(subcol, "GStep", 0, &ptr, "max_ghost_range", 0); // XXX shorter name here? (i.e. GStep) - /* debugging options */ - // XXX re-enable the debug-only checks later - //if (G.f & G_DEBUG) { - subcol= uiLayoutColumn(col, 1); - uiItemR(subcol, NULL, 0, &ptr, "show_points", 0); - //} - /* additional options... */ - // None at the moment... + subcol= uiLayoutColumn(col, 1); + uiItemO(subcol, "Delete Frame", 0, "GPENCIL_OT_active_frame_delete"); + uiItemO(subcol, "Convert...", 0, "GPENCIL_OT_convert"); } } @@ -237,7 +238,8 @@ static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, Poi col= uiLayoutColumn(layout, 0); /* current Grease Pencil block */ // TODO: show some info about who owns this? - uiTemplateID(col, C, ctx_ptr, "grease_pencil", "GPENCIL_OT_data_new", "GPENCIL_OT_data_unlink"); + //uiTemplateID(col, C, ctx_ptr, "grease_pencil", "GPENCIL_OT_data_new", "GPENCIL_OT_data_unlink"); // XXX not working + uiItemR(col, NULL, 0, ctx_ptr, "grease_pencil", 0); // XXX this will have to do for now... /* add new layer button */ uiItemO(col, NULL, 0, "GPENCIL_OT_layer_add"); diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 74fbe250d37..8cf1affa8c6 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -60,6 +60,7 @@ #include "BKE_gpencil.h" #include "BKE_image.h" #include "BKE_library.h" +#include "BKE_object.h" #include "BKE_report.h" #include "BKE_utildefines.h" @@ -70,6 +71,7 @@ #include "WM_types.h" #include "RNA_access.h" +#include "RNA_define.h" #include "UI_view2d.h" @@ -280,4 +282,306 @@ void GPENCIL_OT_layer_add (wmOperatorType *ot) ot->poll= gp_add_poll; } +/* ******************* Delete Active Frame ************************ */ + +static int gp_actframe_delete_poll (bContext *C) +{ + bGPdata *gpd= gpencil_data_get_active(C); + bGPDlayer *gpl= gpencil_layer_getactive(gpd); + + /* only if there's an active layer with an active frame */ + return (gpl && gpl->actframe); +} + +/* delete active frame - wrapper around API calls */ +static int gp_actframe_delete_exec (bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + bGPdata *gpd= gpencil_data_get_active(C); + bGPDlayer *gpl= gpencil_layer_getactive(gpd); + bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0); + + /* if there's no existing Grease-Pencil data there, add some */ + if (gpd == NULL) { + BKE_report(op->reports, RPT_ERROR, "No Grease Pencil data"); + return OPERATOR_CANCELLED; + } + if ELEM(NULL, gpl, gpf) { + BKE_report(op->reports, RPT_ERROR, "No active frame to delete"); + return OPERATOR_CANCELLED; + } + + /* delete it... */ + gpencil_layer_delframe(gpl, gpf); + + /* notifiers */ + WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX please work! + + return OPERATOR_FINISHED; +} + +void GPENCIL_OT_active_frame_delete (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Delete Active Frame"; + ot->idname= "GPENCIL_OT_active_frame_delete"; + ot->description= "Delete the active frame for the active Grease Pencil datablock."; + + /* callbacks */ + ot->exec= gp_actframe_delete_exec; + ot->poll= gp_actframe_delete_poll; +} + +/* ************************************************ */ +/* Grease Pencil to Data Operator */ + +/* defines for possible modes */ +enum { + GP_STROKECONVERT_PATH = 1, + GP_STROKECONVERT_CURVE, +}; + +/* RNA enum define */ +static EnumPropertyItem prop_gpencil_convertmodes[] = { + {GP_STROKECONVERT_PATH, "PATH", 0, "Path", ""}, + {GP_STROKECONVERT_CURVE, "CURVE", 0, "Bezier Curve", ""}, + {0, NULL, 0, NULL, NULL} +}; + +/* --- */ + +/* convert the coordinates from the given stroke point into 3d-coordinates + * - assumes that the active space is the 3D-View + */ +static void gp_strokepoint_convertcoords (bContext *C, bGPDstroke *gps, bGPDspoint *pt, float p3d[3]) +{ + Scene *scene= CTX_data_scene(C); + View3D *v3d= CTX_wm_view3d(C); + ARegion *ar= CTX_wm_region(C); + + if (gps->flag & GP_STROKE_3DSPACE) { + /* directly use 3d-coordinates */ + VecCopyf(p3d, &pt->x); + } + else { + float *fp= give_cursor(scene, v3d); + float dvec[3]; + short mval[2]; + int mx, my; + + /* get screen coordinate */ + if (gps->flag & GP_STROKE_2DSPACE) { + View2D *v2d= &ar->v2d; + UI_view2d_view_to_region(v2d, pt->x, pt->y, &mx, &my); + } + else { + mx= (int)(pt->x / 100 * ar->winx); + my= (int)(pt->y / 100 * ar->winy); + } + mval[0]= (short)mx; + mval[1]= (short)my; + + /* convert screen coordinate to 3d coordinates + * - method taken from editview.c - mouse_cursor() + */ + project_short_noclip(ar, fp, mval); + window_to_3d(ar, dvec, mval[0]-mx, mval[1]-my); + VecSubf(p3d, fp, dvec); + } +} + +/* --- */ + +/* convert stroke to 3d path */ +static void gp_stroke_to_path (bContext *C, bGPDlayer *gpl, bGPDstroke *gps, Curve *cu) +{ + bGPDspoint *pt; + Nurb *nu; + BPoint *bp; + int i; + + /* create new 'nurb' within the curve */ + nu = (Nurb *)MEM_callocN(sizeof(Nurb), "gpstroke_to_path(nurb)"); + + nu->pntsu= gps->totpoints; + nu->pntsv= 1; + nu->orderu= gps->totpoints; + nu->flagu= 2; /* endpoint */ + nu->resolu= 32; + + nu->bp= (BPoint *)MEM_callocN(sizeof(BPoint)*gps->totpoints, "bpoints"); + + /* add points */ + for (i=0, pt=gps->points, bp=nu->bp; i < gps->totpoints; i++, pt++, bp++) { + float p3d[3]; + + /* get coordinates to add at */ + gp_strokepoint_convertcoords(C, gps, pt, p3d); + VecCopyf(bp->vec, p3d); + + /* set settings */ + bp->f1= SELECT; + bp->radius = bp->weight = pt->pressure * gpl->thickness; + } + + /* add nurb to curve */ + BLI_addtail(&cu->nurb, nu); +} + +/* convert stroke to 3d bezier */ +static void gp_stroke_to_bezier (bContext *C, bGPDlayer *gpl, bGPDstroke *gps, Curve *cu) +{ + bGPDspoint *pt; + Nurb *nu; + BezTriple *bezt; + int i; + + /* create new 'nurb' within the curve */ + nu = (Nurb *)MEM_callocN(sizeof(Nurb), "gpstroke_to_bezier(nurb)"); + + nu->pntsu= gps->totpoints; + nu->resolu= 12; + nu->resolv= 12; + nu->type= CU_BEZIER; + nu->bezt = (BezTriple *)MEM_callocN(gps->totpoints*sizeof(BezTriple), "bezts"); + + /* add points */ + for (i=0, pt=gps->points, bezt=nu->bezt; i < gps->totpoints; i++, pt++, bezt++) { + float p3d[3]; + + /* get coordinates to add at */ + gp_strokepoint_convertcoords(C, gps, pt, p3d); + + /* TODO: maybe in future the handles shouldn't be in same place */ + VecCopyf(bezt->vec[0], p3d); + VecCopyf(bezt->vec[1], p3d); + VecCopyf(bezt->vec[2], p3d); + + /* set settings */ + bezt->h1= bezt->h2= HD_FREE; + bezt->f1= bezt->f2= bezt->f3= SELECT; + bezt->radius = bezt->weight = pt->pressure * gpl->thickness * 0.1f; + } + + /* must calculate handles or else we crash */ + calchandlesNurb(nu); + + /* add nurb to curve */ + BLI_addtail(&cu->nurb, nu); +} + +/* convert a given grease-pencil layer to a 3d-curve representation (using current view if appropriate) */ +static void gp_layer_to_curve (bContext *C, bGPdata *gpd, bGPDlayer *gpl, short mode) +{ + Scene *scene= CTX_data_scene(C); + bGPDframe *gpf= gpencil_layer_getframe(gpl, CFRA, 0); + bGPDstroke *gps; + Base *base= BASACT; + Object *ob; + Curve *cu; + + /* error checking */ + if (ELEM3(NULL, gpd, gpl, gpf)) + return; + + /* only convert if there are any strokes on this layer's frame to convert */ + if (gpf->strokes.first == NULL) + return; + + /* init the curve object (remove rotation and get curve data from it) + * - must clear transforms set on object, as those skew our results + */ + ob= add_object(scene, OB_CURVE); + ob->loc[0]= ob->loc[1]= ob->loc[2]= 0; + ob->rot[0]= ob->rot[1]= ob->rot[2]= 0; + cu= ob->data; + cu->flag |= CU_3D; + + /* rename object and curve to layer name */ + rename_id((ID *)ob, gpl->info); + rename_id((ID *)cu, gpl->info); + + /* add points to curve */ + for (gps= gpf->strokes.first; gps; gps= gps->next) { + switch (mode) { + case GP_STROKECONVERT_PATH: + gp_stroke_to_path(C, gpl, gps, cu); + break; + case GP_STROKECONVERT_CURVE: + gp_stroke_to_bezier(C, gpl, gps, cu); + break; + } + } + + /* restore old active object */ + BASACT= base; +} + +/* --- */ + +static int gp_convert_poll (bContext *C) +{ + bGPdata *gpd= gpencil_data_get_active(C); + ScrArea *sa= CTX_wm_area(C); + + /* only if there's valid data, and the current view is 3D View */ + return ((sa->spacetype == SPACE_VIEW3D) && gpencil_layer_getactive(gpd)); +} + +static int gp_convert_layer_exec (bContext *C, wmOperator *op) +{ + bGPdata *gpd= gpencil_data_get_active(C); + bGPDlayer *gpl= gpencil_layer_getactive(gpd); + Scene *scene= CTX_data_scene(C); + View3D *v3d= CTX_wm_view3d(C); + float *fp= give_cursor(scene, v3d); + int mode= RNA_enum_get(op->ptr, "type"); + + /* check if there's data to work with */ + if (gpd == NULL) { + BKE_report(op->reports, RPT_ERROR, "No Grease Pencil data to work on."); + return OPERATOR_CANCELLED; + } + + /* initialise 3d-cursor correction globals */ + initgrabz(CTX_wm_region_view3d(C), fp[0], fp[1], fp[2]); + + /* handle conversion modes */ + switch (mode) { + case GP_STROKECONVERT_PATH: + case GP_STROKECONVERT_CURVE: + gp_layer_to_curve(C, gpd, gpl, mode); + break; + + default: /* unsupoorted */ + BKE_report(op->reports, RPT_ERROR, "Unknown conversion option."); + return OPERATOR_CANCELLED; + } + + /* notifiers */ + WM_event_add_notifier(C, NC_OBJECT|NA_ADDED, NULL); + + /* done */ + return OPERATOR_FINISHED; +} + +void GPENCIL_OT_convert (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Convert Grease Pencil"; + ot->idname= "GPENCIL_OT_convert"; + ot->description= "Convert the active Grease Pencil layer to a new Object."; + + /* callbacks */ + ot->invoke= WM_menu_invoke; + ot->exec= gp_convert_layer_exec; + ot->poll= gp_convert_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_enum(ot->srna, "type", prop_gpencil_convertmodes, 0, "Type", ""); +} + /* ************************************************ */ diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h index 2c7bf9156c3..57e8c882d20 100644 --- a/source/blender/editors/gpencil/gpencil_intern.h +++ b/source/blender/editors/gpencil/gpencil_intern.h @@ -54,6 +54,10 @@ void GPENCIL_OT_data_unlink(struct wmOperatorType *ot); void GPENCIL_OT_layer_add(struct wmOperatorType *ot); +void GPENCIL_OT_active_frame_delete(struct wmOperatorType *ot); + +void GPENCIL_OT_convert(struct wmOperatorType *ot); + /******************************************************* */ /* FILTERED ACTION DATA - TYPES ---> XXX DEPRECEATED OLD ANIM SYSTEM CODE! */ diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c index 3acbded0bf8..d33ad16dfb1 100644 --- a/source/blender/editors/gpencil/gpencil_ops.c +++ b/source/blender/editors/gpencil/gpencil_ops.c @@ -76,6 +76,10 @@ void ED_operatortypes_gpencil (void) WM_operatortype_append(GPENCIL_OT_layer_add); + WM_operatortype_append(GPENCIL_OT_active_frame_delete); + + WM_operatortype_append(GPENCIL_OT_convert); + /* Editing (Time) --------------- */ } From 6b3351c327771c6572ddfb3677db087b15bf06d1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 31 Aug 2009 03:36:02 +0000 Subject: [PATCH 363/577] bugfix [#19254] KX_PolyProxy returns improper VertexIndex with triangles, using .getVertexIndex() and .v1, .v2, etc. Surprising this wasn't noticed before. Any mix of quads/tris caused the face verts of either quads/tries (whichever comes last). Tested by exporting the KX_MeshProxy and re-importing as an OBJ. This fix assumes there are only 2 m_darray's per face array which is currently true, but wont be if edge support is added back. --- source/gameengine/Ketsji/KX_PolyProxy.cpp | 10 +++++----- source/gameengine/Rasterizer/RAS_MaterialBucket.h | 3 +++ source/gameengine/Rasterizer/RAS_Polygon.cpp | 15 +++++++++++++++ source/gameengine/Rasterizer/RAS_Polygon.h | 1 + 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/source/gameengine/Ketsji/KX_PolyProxy.cpp b/source/gameengine/Ketsji/KX_PolyProxy.cpp index b56b5500c39..66457f46deb 100644 --- a/source/gameengine/Ketsji/KX_PolyProxy.cpp +++ b/source/gameengine/Ketsji/KX_PolyProxy.cpp @@ -140,19 +140,19 @@ PyObject* KX_PolyProxy::py_getattro(PyObject *attr) } if (!strcmp(attr_str, "v1")) { - return PyInt_FromLong(m_polygon->GetVertexOffset(0)); + return PyInt_FromLong(m_polygon->GetVertexOffsetAbs(m_mesh, 0)); } if (!strcmp(attr_str, "v2")) { - return PyInt_FromLong(m_polygon->GetVertexOffset(1)); + return PyInt_FromLong(m_polygon->GetVertexOffsetAbs(m_mesh, 1)); } if (!strcmp(attr_str, "v3")) { - return PyInt_FromLong(m_polygon->GetVertexOffset(2)); + return PyInt_FromLong(m_polygon->GetVertexOffsetAbs(m_mesh, 2)); } if (!strcmp(attr_str, "v4")) { - return PyInt_FromLong(((m_polygon->VertexCount()>3)?m_polygon->GetVertexOffset(3):0)); + return PyInt_FromLong(((m_polygon->VertexCount()>3)?m_polygon->GetVertexOffsetAbs(m_mesh, 3):0)); } if (!strcmp(attr_str, "visible")) { @@ -255,7 +255,7 @@ KX_PYMETHODDEF_DOC(KX_PolyProxy, getVertexIndex, } if (index < m_polygon->VertexCount()) { - return PyInt_FromLong(m_polygon->GetVertexOffset(index)); + return PyInt_FromLong(m_polygon->GetVertexOffsetAbs(m_mesh, index)); } return PyInt_FromLong(0); } diff --git a/source/gameengine/Rasterizer/RAS_MaterialBucket.h b/source/gameengine/Rasterizer/RAS_MaterialBucket.h index 8db75b8b735..49837652483 100644 --- a/source/gameengine/Rasterizer/RAS_MaterialBucket.h +++ b/source/gameengine/Rasterizer/RAS_MaterialBucket.h @@ -79,8 +79,11 @@ class RAS_DisplayArray public: vector m_vertex; vector m_index; + /* LINE currently isnt used */ enum { LINE = 2, TRIANGLE = 3, QUAD = 4 } m_type; //RAS_MeshSlot *m_origSlot; + + /* Number of RAS_MeshSlot using this array */ int m_users; enum { BUCKET_MAX_INDEX = 65535 }; diff --git a/source/gameengine/Rasterizer/RAS_Polygon.cpp b/source/gameengine/Rasterizer/RAS_Polygon.cpp index eacc1285166..87c5118c5fb 100644 --- a/source/gameengine/Rasterizer/RAS_Polygon.cpp +++ b/source/gameengine/Rasterizer/RAS_Polygon.cpp @@ -31,6 +31,7 @@ #endif #include "RAS_Polygon.h" +#include "RAS_MeshObject.h" /* only for GetVertexOffsetAbs */ RAS_Polygon::RAS_Polygon(RAS_MaterialBucket* bucket, RAS_DisplayArray *darray, int numvert) { @@ -63,6 +64,20 @@ int RAS_Polygon::GetVertexOffset(int i) return m_offset[i]; } +int RAS_Polygon::GetVertexOffsetAbs(RAS_MeshObject *mesh, int i) +{ + /* hack that only works because there can only ever be 2 different + * GetDisplayArray's per mesh. if this uses a different display array to the first + * then its incices are offset. + * if support for edges is added back this would need to be changed. */ + RAS_DisplayArray* darray= mesh->GetPolygon(0)->GetDisplayArray(); + + if(m_darray != darray) + return m_offset[i] + darray->m_vertex.size(); + + return m_offset[i]; +} + /* int RAS_Polygon::GetEdgeCode() { diff --git a/source/gameengine/Rasterizer/RAS_Polygon.h b/source/gameengine/Rasterizer/RAS_Polygon.h index 41eaa6bdd4a..188390f1c6b 100644 --- a/source/gameengine/Rasterizer/RAS_Polygon.h +++ b/source/gameengine/Rasterizer/RAS_Polygon.h @@ -68,6 +68,7 @@ public: void SetVertexOffset(int i, unsigned short offset); int GetVertexOffset(int i); + int GetVertexOffsetAbs(RAS_MeshObject *mesh, int i); /* accounts for quad and tri arrays, slower, for python */ // each bit is for a visible edge, starting with bit 1 for the first edge, bit 2 for second etc. // - Not used yet! From 7ad4386653ad916a97f3054cab46350ea90fcc54 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 31 Aug 2009 04:24:28 +0000 Subject: [PATCH 364/577] Grease Pencil: Cleanup Work + Bugfixes * Disabled temporary debugging prints, since event handling now seems stable * Modified the initgrabz() code so that when the cursor is behind the viewplane, the z-factor is calculated as if the cursor was on the other side of the view plane. This seems to work well, and doesn't seem to have any negative side-effects (yet). --- .../blender/editors/gpencil/gpencil_paint.c | 84 +++++++++++-------- .../editors/space_view3d/view3d_view.c | 5 +- 2 files changed, 51 insertions(+), 38 deletions(-) diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 67bf2951bf8..99b85d62026 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -86,6 +86,7 @@ typedef struct tGPsdata { } im2d_settings; /* needed for GP_STROKE_2DIMAGE */ #endif + PointerRNA ownerPtr;/* pointer to owner of gp-datablock */ bGPdata *gpd; /* gp-datablock layer comes from */ bGPDlayer *gpl; /* layer we're working on */ bGPDframe *gpf; /* frame we're working on */ @@ -153,6 +154,29 @@ static int gpencil_draw_poll (bContext *C) /* ******************************************* */ /* Calculations/Conversions */ +/* Utilities --------------------------------- */ + +/* get the reference point for stroke-point conversions */ +static void gp_get_3d_reference (tGPsdata *p, float *vec) +{ + View3D *v3d= p->sa->spacedata.first; + float *fp= give_cursor(p->scene, v3d); + + /* the reference point used depends on the owner... */ + if (p->ownerPtr.type == &RNA_Object) { + Object *ob= (Object *)p->ownerPtr.data; + + /* active Object + * - use relative distance of 3D-cursor from object center + */ + VecSubf(vec, fp, ob->loc); + } + else { + /* use 3D-cursor */ + VecCopyf(vec, fp); + } +} + /* Stroke Editing ---------------------------- */ /* check if the current mouse position is suitable for adding a new point */ @@ -187,10 +211,8 @@ static void gp_stroke_convertcoords (tGPsdata *p, short mval[], float out[]) /* in 3d-space - pt->x/y/z are 3 side-by-side floats */ if (gpd->sbuffer_sflag & GP_STROKE_3DSPACE) { - View3D *v3d= p->sa->spacedata.first; const short mx=mval[0], my=mval[1]; - float *fp= give_cursor(p->scene, v3d); - float dvec[3]; + float rvec[3], dvec[3]; /* Current method just converts each point in screen-coordinates to * 3D-coordinates using the 3D-cursor as reference. In general, this @@ -201,11 +223,12 @@ static void gp_stroke_convertcoords (tGPsdata *p, short mval[], float out[]) * reference point instead or as offset, for easier stroke matching * - investigate projection onto geometry (ala retopo) */ + gp_get_3d_reference(p, rvec); /* method taken from editview.c - mouse_cursor() */ - project_short_noclip(p->ar, fp, mval); + project_short_noclip(p->ar, rvec, mval); window_to_3d_delta(p->ar, dvec, mval[0]-mx, mval[1]-my); - VecSubf(out, fp, dvec); + VecSubf(out, rvec, dvec); } /* 2d - on 'canvas' (assume that p->v2d is set) */ @@ -831,7 +854,7 @@ static tGPsdata *gp_session_initpaint (bContext *C) #endif case SPACE_IMAGE: { - SpaceImage *sima= curarea->spacedata.first; + //SpaceImage *sima= curarea->spacedata.first; /* set the current area */ p->sa= curarea; @@ -863,7 +886,7 @@ static tGPsdata *gp_session_initpaint (bContext *C) } /* get gp-data */ - gpd_ptr= gpencil_data_get_pointers(C, NULL); + gpd_ptr= gpencil_data_get_pointers(C, &p->ownerPtr); if (gpd_ptr == NULL) { p->status= GP_STATUS_ERROR; if (G.f & G_DEBUG) @@ -951,13 +974,11 @@ static void gp_paint_initstroke (tGPsdata *p, short paintmode) switch (p->sa->spacetype) { case SPACE_VIEW3D: { - View3D *v3d= (View3D *)p->sa->spacedata.first; RegionView3D *rv3d= p->ar->regiondata; + float rvec[3]; - // TODO 1: when using objects, make the data stick to the object centers? - // TODO 2: what happens when cursor is behind view-camera plane? - float *fp= give_cursor(p->scene, v3d); - initgrabz(rv3d, fp[0], fp[1], fp[2]); + gp_get_3d_reference(p, rvec); + initgrabz(rv3d, rvec[0], rvec[1], rvec[2]); p->gpd->sbuffer_sflag |= GP_STROKE_3DSPACE; } @@ -1215,18 +1236,18 @@ static int gpencil_draw_exec (bContext *C, wmOperator *op) { tGPsdata *p = NULL; - printf("GPencil - Starting Re-Drawing \n"); + //printf("GPencil - Starting Re-Drawing \n"); /* try to initialise context data needed while drawing */ if (!gpencil_draw_init(C, op)) { if (op->customdata) MEM_freeN(op->customdata); - printf("\tGP - no valid data \n"); + //printf("\tGP - no valid data \n"); return OPERATOR_CANCELLED; } else p= op->customdata; - printf("\tGP - Start redrawing stroke \n"); + //printf("\tGP - Start redrawing stroke \n"); /* loop over the stroke RNA elements recorded (i.e. progress of mouse movement), * setting the relevant values in context at each step, then applying @@ -1235,7 +1256,7 @@ static int gpencil_draw_exec (bContext *C, wmOperator *op) { float mousef[2]; - printf("\t\tGP - stroke elem \n"); + //printf("\t\tGP - stroke elem \n"); /* get relevant data for this point from stroke */ RNA_float_get_array(&itemptr, "mouse", mousef); @@ -1257,7 +1278,7 @@ static int gpencil_draw_exec (bContext *C, wmOperator *op) } RNA_END; - printf("\tGP - done \n"); + //printf("\tGP - done \n"); /* cleanup */ gpencil_draw_exit(C, op); @@ -1277,7 +1298,7 @@ static int gpencil_draw_invoke (bContext *C, wmOperator *op, wmEvent *event) tGPsdata *p = NULL; wmWindow *win= CTX_wm_window(C); - printf("GPencil - Starting Drawing \n"); + //printf("GPencil - Starting Drawing \n"); /* try to initialise context data needed while drawing */ if (!gpencil_draw_init(C, op)) { @@ -1308,7 +1329,7 @@ static int gpencil_draw_invoke (bContext *C, wmOperator *op, wmEvent *event) */ if (event->type) { /* hotkey invoked - start drawing */ - printf("\tGP - set first spot\n"); + //printf("\tGP - set first spot\n"); p->status= GP_STATUS_PAINTING; /* handle the initial drawing - i.e. for just doing a simple dot */ @@ -1316,7 +1337,7 @@ static int gpencil_draw_invoke (bContext *C, wmOperator *op, wmEvent *event) } else { /* toolbar invoked - don't start drawing yet... */ - printf("\tGP - hotkey invoked... waiting for click-drag\n"); + //printf("\tGP - hotkey invoked... waiting for click-drag\n"); } /* add a modal handler for this operator, so that we can then draw continuous strokes */ @@ -1329,7 +1350,7 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) { tGPsdata *p= op->customdata; - printf("\tGP - handle modal event...\n"); + //printf("\tGP - handle modal event...\n"); switch (event->type) { /* end of stroke -> ONLY when a mouse-button release occurs @@ -1340,7 +1361,7 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) /* if painting, end stroke */ if (p->status == GP_STATUS_PAINTING) { /* basically, this should be mouse-button up */ - printf("\t\tGP - end of stroke \n"); + //printf("\t\tGP - end of stroke \n"); gpencil_draw_exit(C, op); /* one last flush before we're done */ @@ -1350,7 +1371,7 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) } else { /* not painting, so start stroke (this should be mouse-button down) */ - printf("\t\tGP - start stroke \n"); + //printf("\t\tGP - start stroke \n"); p->status= GP_STATUS_PAINTING; /* no break now, since we should immediately start painting */ } @@ -1360,31 +1381,20 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event) /* check if we're currently painting */ if (p->status == GP_STATUS_PAINTING) { /* handle drawing event */ - printf("\t\tGP - add point\n"); + //printf("\t\tGP - add point\n"); gpencil_draw_apply_event(C, op, event); /* finish painting operation if anything went wrong just now */ if (p->status == GP_STATUS_ERROR) { - printf("\t\t\tGP - error done! \n"); + //printf("\t\t\tGP - error done! \n"); gpencil_draw_exit(C, op); return OPERATOR_CANCELLED; } } break; - /* scrolling mouse-wheel increases radius of eraser - * - though this is quite a difficult action to perform - */ - // XXX this stuff doesn't work - case WHEELUPMOUSE: - p->radius += 1.5f; - break; - case WHEELDOWNMOUSE: - p->radius -= 1.5f; - break; - default: - printf("\t\tGP unknown event - %d \n", event->type); + //printf("\t\tGP unknown event - %d \n", event->type); break; } diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 771c02e95b6..c61b2f0f31d 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -482,7 +482,10 @@ void initgrabz(RegionView3D *rv3d, float x, float y, float z) /* Negative zfac means x, y, z was behind the camera (in perspective). * This gives flipped directions, so revert back to ok default case. */ - if (rv3d->zfac < 0.0f) rv3d->zfac = 1.0f; + // NOTE: I've changed this to flip zfac to be positive again for now so that GPencil draws ok + // -- Aligorith, 2009Aug31 + //if (rv3d->zfac < 0.0f) rv3d->zfac = 1.0f; + if (rv3d->zfac < 0.0f) rv3d->zfac= -rv3d->zfac; } /* always call initgrabz */ From 07abbaa9d722115ec7899cef22862232c37f66d2 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 31 Aug 2009 04:39:08 +0000 Subject: [PATCH 365/577] 2.5 - Datatype defines for MotionPaths and Visualisation Settings --- source/blender/makesdna/DNA_action_types.h | 50 +++++++++++++++++++++- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index 6f097ea3882..c9d75d5c262 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -40,6 +40,54 @@ struct SpaceLink; struct Object; +/* ************************************************ */ +/* Visualisation */ + +/* Motion Paths ------------------------------------ */ +/* (used for Pose Channels and Objects) */ + +/* Data point for motion path */ +typedef struct bMotionPathVert { + float co[3]; /* coordinates of point in 3D-space */ + int flag; /* quick settings */ +} bMotionPathVert; + +/* Motion Path data cache - for elements providing transforms (i.e. Objects or PoseChannels) */ +typedef struct bMotionPath { + bMotionPathVert *points; /* path samples */ + int length; /* the number of cached verts */ + + int start_frame; /* for drawing paths, the start frame number */ + int end_frame; /* for drawing paths, the end frame number */ + + int flag; /* extra settings */ +} bMotionPath; + + + +/* Animation Visualisation Settings - for Objects or Armatures (not PoseChannels) */ +typedef struct bAnimVizSettings { + int pad; + int pathflag; /* eMotionPath_Settings */ + + int pathsf, pathef; /* start and end frames of path-calculation range */ + int pathbc, pathac; /* number of frames before/after current frame of path-calculation */ +} bAnimVizSettings; + +/* bMotionPathSettings->flag */ +typedef enum eMotionPath_Settings { + /* show frames on path */ + MOTIONPATH_FLAG_FNUMS = (1<<0), + /* show keyframes on path */ + MOTIONPATH_FLAG_KFRAS = (1<<1), + /* for bones - calculate head-points for curves instead of tips */ + MOTIONPATH_FLAG_HEADS = (1<<2), + /* show path around current frame */ + MOTIONPATH_FLAG_ACFRA = (1<<3), + /* show keyframe/frame numbers */ + MOTIONPATH_FLAG_KFNOS = (1<<4) +} eMotionPath_Settings; + /* ************************************************ */ /* Poses */ @@ -438,5 +486,3 @@ typedef enum ACHAN_FLAG { #endif - - From 043641de72d7c9b6d27d92ccc3c64dc784450b11 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 31 Aug 2009 13:03:38 +0000 Subject: [PATCH 366/577] corrections to epydocs --- source/blender/python/api2_2x/doc/Particle.py | 16 ++++++++-------- source/blender/python/api2_2x/doc/Texture.py | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/source/blender/python/api2_2x/doc/Particle.py b/source/blender/python/api2_2x/doc/Particle.py index 15481c9dd63..b8e263f948f 100644 --- a/source/blender/python/api2_2x/doc/Particle.py +++ b/source/blender/python/api2_2x/doc/Particle.py @@ -70,7 +70,7 @@ This module provides access to the B{Particle} in Blender. - SPIN: Spin particle angular velocity - RANDOM: Random particle angular velocity @type VERTEXGROUPS: readonly dictionary -@var VERTEXGROUPS: Constant dict used for with L{Particle.VERTEXGROUP} +@var VERTEXGROUPS: Constant dict used for with L{Particle.getVertGroup} and L{Particle.setVertGroup} - DENSITY: VertexGroup affect to particles density - VELOCITY: VertexGroup affect to particles velocity - LENGHT: VertexGroup affect to particles lenght @@ -106,7 +106,7 @@ def New(object): """ Create a new particle system applied to L{object} @type object: string or L{Blender.Object.Object} - @param name: The name of an existing object. + @param object: The existing object to add the particle system to. @rtype: L{Particle} @return: a new Particle system. """ @@ -287,12 +287,12 @@ class Particle: @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 + @ivar childBranchAnim: Animate branching + @type childBranchAnim: int + @ivar childBranchSymm: Start and end points are the same + @type childBranchSymm: int + @ivar childBranchThre: Threshold of branching + @type childBranchThre: float """ def getName(): """ diff --git a/source/blender/python/api2_2x/doc/Texture.py b/source/blender/python/api2_2x/doc/Texture.py index 3431dceb6cd..b9a65d3017a 100644 --- a/source/blender/python/api2_2x/doc/Texture.py +++ b/source/blender/python/api2_2x/doc/Texture.py @@ -394,7 +394,7 @@ class Texture: The colorband can have between 1 and 31 colors. @type colorband: list @ivar useColorband: Use colorband for this texture. - @type colorband: int + @type useColorband: int @ivar autoRefresh: Refresh image on frame changes enabled. @type autoRefresh: boolean """ From bd5bab6b86163ddcd44bababee421b9dd4bf1b1e Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Mon, 31 Aug 2009 13:56:21 +0000 Subject: [PATCH 367/577] Win64: We need manifest if openmp is enabled --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1921ef65017..529d65b0dfe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -377,7 +377,7 @@ IF(WIN32) SET(WINTAB_INC ${LIBDIR}/wintab/include) IF(CMAKE_CL_64) - SET(PLATFORM_LINKFLAGS "/MANIFEST:NO /MANIFESTUAC:NO /MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ") + SET(PLATFORM_LINKFLAGS "/MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ") ELSE(CMAKE_CL_64) SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ") ENDIF(CMAKE_CL_64) From dfef0746e49844c217d515f487886805e2ef4684 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Mon, 31 Aug 2009 14:25:39 +0000 Subject: [PATCH 368/577] Update MSVC project files. --- .../blender/BPY_python/BPY_python.vcproj | 9 +++++---- projectfiles_vc9/blender/blender.vcproj | 10 +++++----- .../blender/blenkernel/BKE_blenkernel.vcproj | 13 +++++++------ projectfiles_vc9/blender/imbuf/BL_imbuf.vcproj | 12 ++++++------ projectfiles_vc9/blender/loader/BLO_loader.vcproj | 9 +++++---- projectfiles_vc9/blender/nodes/nodes.vcproj | 8 ++++---- projectfiles_vc9/blender/src/BL_src.vcproj | 4 ++-- .../gameengine/blenderhook/KX_blenderhook.vcproj | 4 ++-- .../gameengine/converter/KX_converter.vcproj | 13 +++++++------ .../gameengine/expression/EXP_expressions.vcproj | 12 ++++++------ .../gameengine/gamelogic/SCA_GameLogic.vcproj | 12 ++++++------ .../gameengine/gameplayer/common/GP_common.vcproj | 9 +++++---- .../gameengine/gameplayer/ghost/GP_ghost.vcproj | 4 ++-- projectfiles_vc9/gameengine/ketsji/KX_ketsji.vcproj | 13 +++++++------ .../gameengine/ketsji/network/KX_network.vcproj | 12 ++++++------ .../PHY_Physics/PHY_Bullet/PHY_Bullet.vcproj | 12 ++++++------ .../gameengine/rasterizer/RAS_rasterizer.vcproj | 12 ++++++------ .../gameengine/videotexture/TEX_Video.vcproj | 4 ++-- projectfiles_vc9/kernel/system/SYS_system.vcproj | 5 +++-- 19 files changed, 92 insertions(+), 85 deletions(-) diff --git a/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj b/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj index 55ef074178b..306bf4fecfd 100644 --- a/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj +++ b/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj @@ -4,6 +4,7 @@ Version="9,00" Name="BPY_python" ProjectGUID="{5A2EA6DC-1A53-4E87-9166-52870CE3B4EA}" + RootNamespace="BPY_python" TargetFrameworkVersion="131072" > @@ -42,7 +43,7 @@ diff --git a/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj b/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj index 3cc89a17f1e..197f4050d6f 100644 --- a/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj +++ b/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj @@ -4,6 +4,7 @@ Version="9,00" Name="BKE_blenkernel" ProjectGUID="{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}" + RootNamespace="BKE_blenkernel" TargetFrameworkVersion="131072" > @@ -42,7 +43,7 @@ @@ -117,7 +118,7 @@ @@ -42,7 +43,7 @@ @@ -42,7 +43,7 @@ @@ -42,7 +43,7 @@ @@ -42,7 +43,7 @@ Date: Mon, 31 Aug 2009 15:28:43 +0000 Subject: [PATCH 369/577] BGE bug #18963: obj.sendMessage() with 4 arguments crashes Blender. --- source/gameengine/Ketsji/KX_GameObject.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index ba8905973d5..bfafce1dd40 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -2793,7 +2793,7 @@ KX_PYMETHODDEF_DOC_VARARGS(KX_GameObject, sendMessage, char* to = (char *)""; const STR_String& from = GetName(); - if (!PyArg_ParseTuple(args, "s|sss:sendMessage", &subject, &body, &to)) + if (!PyArg_ParseTuple(args, "s|ss:sendMessage", &subject, &body, &to)) return NULL; scene->GetNetworkScene()->SendMessage(to, from, subject, body); From 0b968bcbd99b140c2d9d6fd231edb68172d4dfc8 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Mon, 31 Aug 2009 15:54:56 +0000 Subject: [PATCH 370/577] BGE bug #19020: The GE Torque actuator x -& y-axis do not work in 2.49a (winxp) --- source/gameengine/Physics/Bullet/CcdPhysicsController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 20e830c9dc3..7f84b06cc3c 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -1073,7 +1073,7 @@ void CcdPhysicsController::ApplyTorque(float torqueX,float torqueY,float torque //workaround for incompatibility between 'DYNAMIC' game object, and angular factor //a DYNAMIC object has some inconsistency: it has no angular effect due to collisions, but still has torque const btVector3& angFac = body->getAngularFactor(); - btVector3 tmpFac(0,0,1); + btVector3 tmpFac(1,1,1); body->setAngularFactor(tmpFac); body->applyTorque(torque); body->setAngularFactor(angFac); From 8b18843b98b300a14558f5b04c8bf995f8973da0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 31 Aug 2009 16:36:02 +0000 Subject: [PATCH 371/577] remove "_amount" from rna names, its not helpful. --- release/ui/buttons_physics_fluid.py | 4 ++-- release/ui/buttons_texture.py | 2 +- source/blender/makesrna/intern/rna_fluidsim.c | 2 +- source/blender/makesrna/intern/rna_texture.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/release/ui/buttons_physics_fluid.py b/release/ui/buttons_physics_fluid.py index fe15e22f0b9..6f7a97ff793 100644 --- a/release/ui/buttons_physics_fluid.py +++ b/release/ui/buttons_physics_fluid.py @@ -94,7 +94,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel): col.itemL(text="Slip Type:") col.itemR(fluid, "slip_type", text="") if fluid.slip_type == 'PARTIALSLIP': - col.itemR(fluid, "partial_slip_amount", slider=True, text="Amount") + col.itemR(fluid, "partial_slip_factor", slider=True, text="Amount") col.itemL(text="Impact:") col.itemR(fluid, "impact_factor", text="Factor") @@ -228,7 +228,7 @@ class PHYSICS_PT_domain_boundary(PhysicButtonsPanel): sub = col.column(align=True) sub.itemR(fluid, "slip_type", text="") if fluid.slip_type == 'PARTIALSLIP': - sub.itemR(fluid, "partial_slip_amount", slider=True, text="Amount") + sub.itemR(fluid, "partial_slip_factor", slider=True, text="Amount") col = split.column() col.itemL(text="Surface:") diff --git a/release/ui/buttons_texture.py b/release/ui/buttons_texture.py index ad0542d787a..ee3f85e15ef 100644 --- a/release/ui/buttons_texture.py +++ b/release/ui/buttons_texture.py @@ -609,7 +609,7 @@ class TEXTURE_PT_distortednoise(TextureTypePanel): layout.itemR(tex, "noise_basis", text="Basis") flow = layout.column_flow() - flow.itemR(tex, "distortion_amount", text="Distortion") + flow.itemR(tex, "distortion", text="Distortion") flow.itemR(tex, "noise_size", text="Size") flow.itemR(tex, "nabla") diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c index 936e1700ed7..dda21f63528 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -162,7 +162,7 @@ static void rna_def_fluidsim_slip(StructRNA *srna) RNA_def_property_enum_items(prop, slip_items); RNA_def_property_ui_text(prop, "Slip Type", ""); - prop= RNA_def_property(srna, "partial_slip_amount", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "partial_slip_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "partSlipValue"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Partial Slip Amount", "Amount of mixing between no- and free-slip, 0 is no slip and 1 is free slip."); diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index f899d52543e..6de0be9b19c 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -1293,7 +1293,7 @@ static void rna_def_texture_distorted_noise(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Distorted Noise", "Procedural distorted noise texture."); RNA_def_struct_sdna(srna, "Tex"); - prop= RNA_def_property(srna, "distortion_amount", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "distortion", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dist_amount"); RNA_def_property_range(prop, 0, 10); RNA_def_property_ui_text(prop, "Distortion Amount", ""); From 7fccc53fc671aaa3e1e7b7d7e923f197792dc563 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Mon, 31 Aug 2009 17:00:03 +0000 Subject: [PATCH 372/577] More MSVC project file update (don't propagate those changes to 2.5). --- projectfiles_vc9/blender/blender.vcproj | 6 +++--- .../gameengine/gameplayer/ghost/GP_ghost.vcproj | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/projectfiles_vc9/blender/blender.vcproj b/projectfiles_vc9/blender/blender.vcproj index 80f39be2a59..0ffbcd9aa67 100644 --- a/projectfiles_vc9/blender/blender.vcproj +++ b/projectfiles_vc9/blender/blender.vcproj @@ -73,12 +73,12 @@ From 15f81f4b03692691cee123e9094c92378658d8bb Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 31 Aug 2009 18:16:18 +0000 Subject: [PATCH 373/577] Part 1 of the 2.49b commit --- release/VERSION | 2 +- release/datafiles/splash.jpg | Bin 197158 -> 197165 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/release/VERSION b/release/VERSION index 3046e7afa7d..1ec4cde4e46 100644 --- a/release/VERSION +++ b/release/VERSION @@ -1 +1 @@ -2.49a +2.49b diff --git a/release/datafiles/splash.jpg b/release/datafiles/splash.jpg index 1c34cf36f75901d09ac606101f999812254cdf48..e35a26a2c2360539cccc052fa07e00363e7dce74 100644 GIT binary patch delta 190714 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 delta 190686 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

\n"; @@ -1340,7 +1341,7 @@ void yafrayFileRender_t::writeObject(Object* obj, ObjectRen *obr, const vectorv2] = vidx++; ver = vlr->v2; MTC_cp3Float(ver->co, tvec); - MTC_Mat4MulVecfl(imat, tvec); + Mat4MulVecfl(imat, tvec); ostr << "\t\t\t

\n"; @@ -1361,7 +1362,7 @@ void yafrayFileRender_t::writeObject(Object* obj, ObjectRen *obr, const vectorv3] = vidx++; ver = vlr->v3; MTC_cp3Float(ver->co, tvec); - MTC_Mat4MulVecfl(imat, tvec); + Mat4MulVecfl(imat, tvec); ostr << "\t\t\t

\n"; @@ -1382,7 +1383,7 @@ void yafrayFileRender_t::writeObject(Object* obj, ObjectRen *obr, const vectorv4] = vidx++; ver = vlr->v4; MTC_cp3Float(ver->co, tvec); - MTC_Mat4MulVecfl(imat, tvec); + Mat4MulVecfl(imat, tvec); ostr << "\t\t\t

\n"; @@ -1532,7 +1533,7 @@ void yafrayFileRender_t::writeAllObjects() for (int j=0;j<4;j++) obmat[i][j] = dupMtx->second[(i<<2)+j]; - MTC_Mat4Invert(imat, obmat); + Mat4Invert(imat, obmat); // first object written as normal (but with transform of first duplivert) Object* obj = dup_srcob[dupMtx->first]; @@ -1546,7 +1547,7 @@ void yafrayFileRender_t::writeAllObjects() for (int j=0;j<4;j++) nmat[i][j] = dupMtx->second[curmtx+(i<<2)+j]; - MTC_Mat4MulMat4(cmat, imat, nmat); // transform with respect to original = inverse_original * new + Mat4MulMat4(cmat, imat, nmat); // transform with respect to original = inverse_original * new ostr.str(""); // yafray matrix = transpose of Blender @@ -1592,13 +1593,13 @@ void yafrayFileRender_t::writeAreaLamp(LampRen* lamp, int num, float iview[4][4] // transform area lamp coords back to world float lpco[4][3]; MTC_cp3Float(a, lpco[0]); - MTC_Mat4MulVecfl(iview, lpco[0]); + Mat4MulVecfl(iview, lpco[0]); MTC_cp3Float(b, lpco[1]); - MTC_Mat4MulVecfl(iview, lpco[1]); + Mat4MulVecfl(iview, lpco[1]); MTC_cp3Float(c, lpco[2]); - MTC_Mat4MulVecfl(iview, lpco[2]); + Mat4MulVecfl(iview, lpco[2]); MTC_cp3Float(d, lpco[3]); - MTC_Mat4MulVecfl(iview, lpco[3]); + Mat4MulVecfl(iview, lpco[3]); ostr << "\t\n"; ostr << "\t\n"; ostr << "\t\n"; @@ -1618,7 +1619,7 @@ void yafrayFileRender_t::writeLamps() float iview[4][4]; // re->viewinv != inv.re->viewmat because of possible ortho mode (see convertBlenderScene.c) // have to invert it here - MTC_Mat4Invert(iview, re->viewmat); + Mat4Invert(iview, re->viewmat); // all lamps for(go=(GroupObject *)re->lights.first; go; go= go->next, i++) { @@ -1751,9 +1752,9 @@ void yafrayFileRender_t::writeLamps() // transform lamp co & vec back to world float lpco[3], lpvec[3]; MTC_cp3Float(lamp->co, lpco); - MTC_Mat4MulVecfl(iview, lpco); + Mat4MulVecfl(iview, lpco); MTC_cp3Float(lamp->vec, lpvec); - MTC_Mat4Mul3Vecfl(iview, lpvec); + Mat4Mul3Vecfl(iview, lpvec); // position, (==-blendir for sun/hemi) if ((lamp->type==LA_SUN) || (lamp->type==LA_HEMI)) diff --git a/source/blender/yafray/intern/export_Plugin.cpp b/source/blender/yafray/intern/export_Plugin.cpp index db9fb7ccc72..cabb90f44c4 100644 --- a/source/blender/yafray/intern/export_Plugin.cpp +++ b/source/blender/yafray/intern/export_Plugin.cpp @@ -6,6 +6,7 @@ using namespace std; +#define MTC_cp3Float(_a, _b) VecCopyf(_b, _a) #ifdef WIN32 #define WIN32_SKIP_HKEY_PROTECTION @@ -19,7 +20,6 @@ using namespace std; #define FILE_MAXFILE 80 #endif - static string find_path() { HKEY hkey; @@ -939,10 +939,10 @@ void yafrayPluginRender_t::writeMaterialsAndModulators() // In this case this means the inverse of that matrix float texmat[4][4], itexmat[4][4]; if ((mtex->texco & TEXCO_OBJECT) && (mtex->object)) - MTC_Mat4CpyMat4(texmat, mtex->object->obmat); + Mat4CpyMat4(texmat, mtex->object->obmat); else // also for refl. map - MTC_Mat4CpyMat4(texmat, maincam_obj->obmat); - MTC_Mat4Invert(itexmat, texmat); + Mat4CpyMat4(texmat, maincam_obj->obmat); + Mat4Invert(itexmat, texmat); #define flp yafray::parameter_t params["m00"]=flp(itexmat[0][0]); params["m01"]=flp(itexmat[1][0]); params["m02"]=flp(itexmat[2][0]); params["m03"]=flp(itexmat[3][0]); @@ -1231,15 +1231,15 @@ void yafrayPluginRender_t::genVertices(vector &verts, int &vi // for deformed objects, object->imat is no longer valid, // so have to create inverse render matrix ourselves here float mat[4][4], imat[4][4]; - MTC_Mat4MulMat4(mat, obj->obmat, re->viewmat); - MTC_Mat4Invert(imat, mat); + Mat4MulMat4(mat, obj->obmat, re->viewmat); + Mat4Invert(imat, mat); if (vert_idx.find(vlr->v1)==vert_idx.end()) { vert_idx[vlr->v1] = vidx++; ver = vlr->v1; MTC_cp3Float(ver->co, tvec); - MTC_Mat4MulVecfl(imat, tvec); + Mat4MulVecfl(imat, tvec); verts.push_back(yafray::point3d_t(tvec[0], tvec[1], tvec[2])); // has_orco now an int, if 1 -> strand mapping, if 2 -> normal orco mapping if (has_orco==1) @@ -1252,7 +1252,7 @@ void yafrayPluginRender_t::genVertices(vector &verts, int &vi vert_idx[vlr->v2] = vidx++; ver = vlr->v2; MTC_cp3Float(ver->co, tvec); - MTC_Mat4MulVecfl(imat, tvec); + Mat4MulVecfl(imat, tvec); verts.push_back(yafray::point3d_t(tvec[0], tvec[1], tvec[2])); // has_orco now an int, if 1 -> strand mapping, if 2 -> normal orco mapping if (has_orco==1) @@ -1265,7 +1265,7 @@ void yafrayPluginRender_t::genVertices(vector &verts, int &vi vert_idx[vlr->v3] = vidx++; ver = vlr->v3; MTC_cp3Float(ver->co, tvec); - MTC_Mat4MulVecfl(imat, tvec); + Mat4MulVecfl(imat, tvec); verts.push_back(yafray::point3d_t(tvec[0], tvec[1], tvec[2])); // has_orco now an int, if 1 -> strand mapping, if 2 -> normal orco mapping if (has_orco==1) @@ -1278,7 +1278,7 @@ void yafrayPluginRender_t::genVertices(vector &verts, int &vi vert_idx[vlr->v4] = vidx++; ver = vlr->v4; MTC_cp3Float(ver->co, tvec); - MTC_Mat4MulVecfl(imat, tvec); + Mat4MulVecfl(imat, tvec); verts.push_back(yafray::point3d_t(tvec[0], tvec[1], tvec[2])); // has_orco now an int, if 1 -> strand mapping, if 2 -> normal orco mapping if (has_orco==1) @@ -1414,7 +1414,7 @@ void yafrayPluginRender_t::writeAllObjects() for (int i=0;i<4;i++) for (int j=0;j<4;j++) obmat[i][j] = dupMtx->second[(i<<2)+j]; - MTC_Mat4Invert(imat, obmat); + Mat4Invert(imat, obmat); // first object written as normal (but with transform of first duplivert) Object* obj = dup_srcob[dupMtx->first]; @@ -1428,7 +1428,7 @@ void yafrayPluginRender_t::writeAllObjects() for (int j=0;j<4;j++) nmat[i][j] = dupMtx->second[curmtx+(i<<2)+j]; - MTC_Mat4MulMat4(cmat, imat, nmat); // transform with respect to original = inverse_original * new + Mat4MulMat4(cmat, imat, nmat); // transform with respect to original = inverse_original * new float mtr[4*4]; mtr[0*4+0]=cmat[0][0]; mtr[0*4+1]=cmat[1][0]; mtr[0*4+2]=cmat[2][0]; mtr[0*4+3]=cmat[3][0]; @@ -1475,13 +1475,13 @@ void yafrayPluginRender_t::writeAreaLamp(LampRen* lamp, int num, float iview[4][ // transform area lamp coords back to world float lpco[4][3]; MTC_cp3Float(a, lpco[0]); - MTC_Mat4MulVecfl(iview, lpco[0]); + Mat4MulVecfl(iview, lpco[0]); MTC_cp3Float(b, lpco[1]); - MTC_Mat4MulVecfl(iview, lpco[1]); + Mat4MulVecfl(iview, lpco[1]); MTC_cp3Float(c, lpco[2]); - MTC_Mat4MulVecfl(iview, lpco[2]); + Mat4MulVecfl(iview, lpco[2]); MTC_cp3Float(d, lpco[3]); - MTC_Mat4MulVecfl(iview, lpco[3]); + Mat4MulVecfl(iview, lpco[3]); params["a"] = yafray::parameter_t(yafray::point3d_t(lpco[0][0], lpco[0][1], lpco[0][2])); params["b"] = yafray::parameter_t(yafray::point3d_t(lpco[1][0], lpco[1][1], lpco[1][2])); params["c"] = yafray::parameter_t(yafray::point3d_t(lpco[2][0], lpco[2][1], lpco[2][2])); @@ -1500,7 +1500,7 @@ void yafrayPluginRender_t::writeLamps() float iview[4][4]; // re->viewinv != inv.re->viewmat because of possible ortho mode (see convertBlenderScene.c) // have to invert it here - MTC_Mat4Invert(iview, re->viewmat); + Mat4Invert(iview, re->viewmat); // all lamps for(go=(GroupObject *)re->lights.first; go; go= go->next, i++) @@ -1641,9 +1641,9 @@ void yafrayPluginRender_t::writeLamps() // transform lamp co & vec back to world float lpco[3], lpvec[3]; MTC_cp3Float(lamp->co, lpco); - MTC_Mat4MulVecfl(iview, lpco); + Mat4MulVecfl(iview, lpco); MTC_cp3Float(lamp->vec, lpvec); - MTC_Mat4Mul3Vecfl(iview, lpvec); + Mat4Mul3Vecfl(iview, lpvec); // position, (==-blendir for sun/hemi) if ((lamp->type==LA_SUN) || (lamp->type==LA_HEMI)) diff --git a/source/blender/yafray/intern/yafray_Render.cpp b/source/blender/yafray/intern/yafray_Render.cpp index 01da4683d71..97a3f3b518a 100644 --- a/source/blender/yafray/intern/yafray_Render.cpp +++ b/source/blender/yafray/intern/yafray_Render.cpp @@ -85,7 +85,7 @@ bool yafrayRender_t::getAllMatTexObs() if(obi->flag & R_DUPLI_TRANSFORMED) { // compute object matrix with dupli transform, need to transform // obi->mat out of view space for it - MTC_Mat4MulSerie(mat, re->viewinv, obi->mat, re->viewmat, obi->obr->ob->obmat, 0, 0, 0, 0); + Mat4MulSerie(mat, re->viewinv, obi->mat, re->viewmat, obi->obr->ob->obmat, 0, 0, 0, 0); addDupliMtx(obi->obr->ob, mat); } } diff --git a/source/blender/yafray/intern/yafray_Render.h b/source/blender/yafray/intern/yafray_Render.h index 43d2c6c602a..b3ab12e8ae9 100644 --- a/source/blender/yafray/intern/yafray_Render.h +++ b/source/blender/yafray/intern/yafray_Render.h @@ -29,8 +29,7 @@ extern "C" { #include "renderpipeline.h" /* useful matrix & vector operations */ -#include "MTC_matrixops.h" -#include "MTC_vectorops.h" +#include "BLI_arithb.h" #include "BLI_blenlib.h" From d1c90f4bef6de71087cdcaaa6afd055e49bb893c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 6 Sep 2009 00:36:26 +0000 Subject: [PATCH 451/577] =?UTF-8?q?easier=20to=20re-apply=20the=20replacem?= =?UTF-8?q?ent=20table=20then=20merge=20from=202.4x=EF=BB=BF,=20same=20as?= =?UTF-8?q?=2023023?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit replacements... MTC_cross3Float -> Crossf MTC_diff3Float -> VecSubf MTC_dot3Float -> Inpf MTC_Mat3CpyMat4 -> Mat3CpyMat4 MTC_Mat3MulVecd -> Mat3MulVecd MTC_Mat3MulVecfl -> Mat3MulVecfl MTC_Mat4CpyMat4 -> Mat4CpyMat4 MTC_Mat4Invert -> Mat4Invert MTC_Mat4Mul3Vecfl -> Mat4Mul3Vecfl MTC_Mat4MulMat4 -> Mat4MulMat4 MTC_Mat4MulSerie -> Mat4MulSerie MTC_Mat4MulVec4fl -> Mat4MulVec4fl MTC_Mat4MulVecfl -> Mat4MulVecfl MTC_Mat4One -> Mat4One MTC_Mat4Ortho -> Mat4Ortho MTC_Mat4SwapMat4 -> Mat4SwapMat4 --- source/blender/blenkernel/intern/modifier.c | 34 +- source/blender/blenkernel/intern/texture.c | 2 +- source/blender/blenlib/MTC_matrixops.h | 162 ------- source/blender/blenlib/MTC_vectorops.h | 58 --- source/blender/blenlib/intern/matrixops.c | 438 ------------------ source/blender/blenlib/intern/vectorops.c | 166 ------- source/blender/editors/mesh/editmesh_mods.c | 2 +- .../editors/sculpt_paint/paint_vertex.c | 10 +- .../blender/editors/space_view3d/drawobject.c | 6 +- .../blender/editors/space_view3d/drawvolume.c | 2 +- .../nodes/intern/TEX_nodes/TEX_rotate.c | 8 +- .../render/intern/source/convertblender.c | 102 ++-- source/blender/render/intern/source/envmap.c | 80 ++-- .../blender/render/intern/source/initrender.c | 2 +- .../render/intern/source/pixelshading.c | 12 +- source/blender/render/intern/source/shadbuf.c | 16 +- .../blender/render/intern/source/shadeinput.c | 18 +- .../render/intern/source/shadeoutput.c | 8 +- source/blender/render/intern/source/texture.c | 44 +- source/blender/render/intern/source/zbuf.c | 2 +- 20 files changed, 174 insertions(+), 998 deletions(-) delete mode 100644 source/blender/blenlib/MTC_matrixops.h delete mode 100644 source/blender/blenlib/MTC_vectorops.h delete mode 100644 source/blender/blenlib/intern/matrixops.c delete mode 100644 source/blender/blenlib/intern/vectorops.c diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 9c8c43cc8cb..f06173264ee 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -73,8 +73,8 @@ #include "BLI_editVert.h" -#include "MTC_matrixops.h" -#include "MTC_vectorops.h" + + #include "BKE_main.h" #include "BKE_anim.h" @@ -1190,7 +1190,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, if(amd->end_cap && amd->end_cap != ob) end_cap = mesh_get_derived_final(scene, amd->end_cap, CD_MASK_MESH); - MTC_Mat4One(offset); + Mat4One(offset); indexMap = MEM_callocN(sizeof(*indexMap) * dm->getNumVerts(dm), "indexmap"); @@ -1212,14 +1212,14 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, float result_mat[4][4]; if(ob) - MTC_Mat4Invert(obinv, ob->obmat); + Mat4Invert(obinv, ob->obmat); else - MTC_Mat4One(obinv); + Mat4One(obinv); - MTC_Mat4MulSerie(result_mat, offset, + Mat4MulSerie(result_mat, offset, obinv, amd->offset_ob->obmat, NULL, NULL, NULL, NULL, NULL); - MTC_Mat4CpyMat4(offset, result_mat); + Mat4CpyMat4(offset, result_mat); } if(amd->fit_type == MOD_ARR_FITCURVE && amd->curve_ob) { @@ -1244,7 +1244,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, prescribed length */ if(amd->fit_type == MOD_ARR_FITLENGTH || amd->fit_type == MOD_ARR_FITCURVE) { - float dist = sqrt(MTC_dot3Float(offset[3], offset[3])); + float dist = sqrt(Inpf(offset[3], offset[3])); if(dist > 1e-6f) /* this gives length = first copy start to last copy end @@ -1277,11 +1277,11 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, result = CDDM_from_template(dm, finalVerts, finalEdges, finalFaces); /* calculate the offset matrix of the final copy (for merging) */ - MTC_Mat4One(final_offset); + Mat4One(final_offset); for(j=0; j < count - 1; j++) { - MTC_Mat4MulMat4(tmp_mat, final_offset, offset); - MTC_Mat4CpyMat4(final_offset, tmp_mat); + Mat4MulMat4(tmp_mat, final_offset, offset); + Mat4CpyMat4(final_offset, tmp_mat); } numVerts = numEdges = numFaces = 0; @@ -1317,7 +1317,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, if((count > 1) && (amd->flags & MOD_ARR_MERGE)) { float tmp_co[3]; VECCOPY(tmp_co, mv->co); - MTC_Mat4MulVecfl(offset, tmp_co); + Mat4MulVecfl(offset, tmp_co); for(j = 0; j < maxVerts; j++) { /* if vertex already merged, don't use it */ @@ -1332,7 +1332,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, if(amd->flags & MOD_ARR_MERGEFINAL) { VECCOPY(tmp_co, inMV->co); inMV = &src_mvert[i]; - MTC_Mat4MulVecfl(final_offset, tmp_co); + Mat4MulVecfl(final_offset, tmp_co); if(VecLenCompare(tmp_co, inMV->co, amd->merge_dist)) indexMap[i].merge_final = 1; } @@ -1350,7 +1350,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, *mv2 = *mv; numVerts++; - MTC_Mat4MulVecfl(offset, co); + Mat4MulVecfl(offset, co); VECCOPY(mv2->co, co); } } else if(indexMap[i].merge != i && indexMap[i].merge_final) { @@ -3182,7 +3182,7 @@ static void tag_and_count_extra_edges(SmoothMesh *mesh, float split_angle, /* we know the edge has 2 faces, so check the angle */ SmoothFace *face1 = edge->faces->link; SmoothFace *face2 = edge->faces->next->link; - float edge_angle_cos = MTC_dot3Float(face1->normal, + float edge_angle_cos = Inpf(face1->normal, face2->normal); if(edge_angle_cos < threshold) { @@ -4051,11 +4051,11 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd, /* find the projector which the face points at most directly * (projector normal with largest dot product is best) */ - best_dot = MTC_dot3Float(projectors[0].normal, face_no); + best_dot = Inpf(projectors[0].normal, face_no); best_projector = &projectors[0]; for(j = 1; j < num_projectors; ++j) { - float tmp_dot = MTC_dot3Float(projectors[j].normal, + float tmp_dot = Inpf(projectors[j].normal, face_no); if(tmp_dot > best_dot) { best_dot = tmp_dot; diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 61f62b2222d..fe8b97db606 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -38,7 +38,7 @@ #include "PIL_dynlib.h" -#include "MTC_matrixops.h" + #include "BLI_blenlib.h" #include "BLI_arithb.h" diff --git a/source/blender/blenlib/MTC_matrixops.h b/source/blender/blenlib/MTC_matrixops.h deleted file mode 100644 index 2bc644be564..00000000000 --- a/source/blender/blenlib/MTC_matrixops.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - * matrixops.h - * - * $Id$ - * - * ***** 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 ***** - */ - -#ifndef MATRIXOPS_H -#define MATRIXOPS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* ------------------------------------------------------------------------- */ -/* need rewriting: */ -/** - * copy the left upp3 3 by 3 of m2 to m1 - */ -void MTC_Mat3CpyMat4(float m1[][3], float m2[][4]); - -/* ------------------------------------------------------------------------- */ -/* operations based on 4 by 4 matrices */ - -/** - * Copy m1 to m2 - */ -void MTC_Mat4CpyMat4(float m1[][4], float m2[][4]); - -/** - * Multiply all matrices after the first, leave the result in the - * first argument - */ -void MTC_Mat4MulSerie(float answ[][4], - float m1[][4], float m2[][4], float m3[][4], - float m4[][4], float m5[][4], float m6[][4], - float m7[][4], float m8[][4]); - -/** - * m1 = m2 matprod m3 - */ -void MTC_Mat4MulMat4(float m1[][4], float m2[][4], float m3[][4]); - -/** - * Do vec^t prod mat, result in vec. Ignore vec[3] (vec is a - * float[3]) - */ -void MTC_Mat4MulVecfl(float mat[][4], float *vec); - -/** - * Invert mat, result in inverse. Always returns 1 - */ -int MTC_Mat4Invert(float inverse[][4], float mat[][4]); - -/** - * Make the set of mat orthonormal (mat should already be orthogonal)? - * (doesn't appear to normalize properly?) - */ -void MTC_Mat4Ortho(float mat[][4]); - -/** - * vec = mat prod vec, result in vec, ignore fourth component entirely - * (4th component is _not_ accessed!!! vec is 3d) - */ -void MTC_Mat4Mul3Vecfl(float mat[][4], float *vec); - -/** - * vec = mat prod vec, result in vec - */ -void MTC_Mat4MulVec4fl(float mat[][4], float *vec); - -/** - * Set to the 4-D unity matrix - */ -void MTC_Mat4One(float m[][4]); - -/** - * Swap matrices m1 and m2 - */ -void MTC_Mat4SwapMat4(float m1[][4], float m2[][4]); - -/** - * Copy m2 to the top-left 3x3 of m1, don't touch the remaining elements. - */ -void MTC_Mat4CpyMat3nc(float m1[][4], float m2[][3]); - -/** - * m1 = m2 * m3, but only the top-left 3x3 - */ -void MTC_Mat4MulMat33(float m1[][3], float m2[][4], float m3[][3]); - -/* ------------------------------------------------------------------------- */ -/* Operations based on 3 by 3 matrices */ -/** - * Do vec^t prod mat, result in vec.(vex is 3d) - */ -void MTC_Mat3MulVecfl(float mat[][3], float *vec); - -/** - * Copy m1 to m2 - */ -void MTC_Mat3CpyMat3(float m1[][3], float m2[][3]); - -/** - * m1 = m2 prod m3 - */ -void MTC_Mat3MulMat3(float m1[][3], float m3[][3], float m2[][3]); - -/** - * vec = vec prod mat - */ -void MTC_Mat3MulVecd(float mat[][3], double *vec); - -/** - * Guess: invert matrix - * result goes to m1 - */ -void MTC_Mat3Inv(float m1[][3], float m2[][3]); - -/** - * Sort of a determinant matrix? Doesn't seem very adjoint to me... - * result goes to m1 - */ -void MTC_Mat3Adj(float m1[][3], float m[][3]); - -/** - * Set to the 3D unity matrix - */ -void MTC_Mat3One(float m[][3]); - -/* ------------------------------------------------------------------------- */ - -#ifdef __cplusplus -} -#endif - -#endif /* MATRIXOPS_H */ - diff --git a/source/blender/blenlib/MTC_vectorops.h b/source/blender/blenlib/MTC_vectorops.h deleted file mode 100644 index 4fec93b37b9..00000000000 --- a/source/blender/blenlib/MTC_vectorops.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * vectorops.h - * - * $Id$ - * - * ***** 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 ***** - */ - -#ifndef VECTOROPS_H -#define VECTOROPS_H - -/* ------------------------------------------------------------------------- */ - -void MTC_diff3Int(int v1[3], int v2[3], int v3[3]); -void MTC_cross3Int(int v1[3], int v2[3], int v3[3]); -int MTC_dot3Int(int v1[3], int v2[3]); - -void MTC_diff3Float(float v1[3], float v2[3], float v3[3]); -void MTC_cross3Float(float v1[3], float v2[3], float v3[3]); -float MTC_dot3Float(float v1[3], float v2[3]); -void MTC_cp3Float(float v1[3], float v2[3]); -/** - * Copy vector with a minus sign (so a = -b) - */ -void MTC_cp3FloatInv(float v1[3], float v2[3]); - -void MTC_swapInt(int *i1, int *i2); - -void MTC_diff3DFF(double v1[3], float v2[3], float v3[3]); -void MTC_cross3Double(double v1[3], double v2[3], double v3[3]); -float MTC_normalize3DF(float n[3]); - -/* ------------------------------------------------------------------------- */ -#endif /* VECTOROPS_H */ - diff --git a/source/blender/blenlib/intern/matrixops.c b/source/blender/blenlib/intern/matrixops.c deleted file mode 100644 index 0f9fc65f016..00000000000 --- a/source/blender/blenlib/intern/matrixops.c +++ /dev/null @@ -1,438 +0,0 @@ -/* - * - * Some matrix operations. - * - * Always use - * - vector with x components : float x[3], int x[3], etc - * - * $Id$ - * - * ***** 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 ***** - */ - -/* ------------------------------------------------------------------------- */ -#include -#include "MTC_matrixops.h" -#include "MTC_vectorops.h" -/* ------------------------------------------------------------------------- */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#if defined(__sun__) || defined( __sun ) || defined (__sparc) || defined (__sparc__) -#include -#endif - -#define ABS(x) ((x) < 0 ? -(x) : (x)) -#define SWAP(type, a, b) { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; } - -void MTC_Mat4CpyMat4(float m1[][4], float m2[][4]) -{ - memcpy(m1, m2, 4*4*sizeof(float)); -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4MulSerie(float answ[][4], - float m1[][4], float m2[][4], float m3[][4], - float m4[][4], float m5[][4], float m6[][4], - float m7[][4], float m8[][4]) -{ - float temp[4][4]; - - if(m1==0 || m2==0) return; - - MTC_Mat4MulMat4(answ, m2, m1); - if(m3) { - MTC_Mat4MulMat4(temp, m3, answ); - if(m4) { - MTC_Mat4MulMat4(answ, m4, temp); - if(m5) { - MTC_Mat4MulMat4(temp, m5, answ); - if(m6) { - MTC_Mat4MulMat4(answ, m6, temp); - if(m7) { - MTC_Mat4MulMat4(temp, m7, answ); - if(m8) { - MTC_Mat4MulMat4(answ, m8, temp); - } - else MTC_Mat4CpyMat4(answ, temp); - } - } - else MTC_Mat4CpyMat4(answ, temp); - } - } - else MTC_Mat4CpyMat4(answ, temp); - } -} - -/* ------------------------------------------------------------------------- */ -void MTC_Mat4MulMat4(float m1[][4], float m2[][4], float m3[][4]) -{ - /* matrix product: c[j][k] = a[j][i].b[i][k] */ - - m1[0][0] = m2[0][0]*m3[0][0] + m2[0][1]*m3[1][0] + m2[0][2]*m3[2][0] + m2[0][3]*m3[3][0]; - m1[0][1] = m2[0][0]*m3[0][1] + m2[0][1]*m3[1][1] + m2[0][2]*m3[2][1] + m2[0][3]*m3[3][1]; - m1[0][2] = m2[0][0]*m3[0][2] + m2[0][1]*m3[1][2] + m2[0][2]*m3[2][2] + m2[0][3]*m3[3][2]; - m1[0][3] = m2[0][0]*m3[0][3] + m2[0][1]*m3[1][3] + m2[0][2]*m3[2][3] + m2[0][3]*m3[3][3]; - - m1[1][0] = m2[1][0]*m3[0][0] + m2[1][1]*m3[1][0] + m2[1][2]*m3[2][0] + m2[1][3]*m3[3][0]; - m1[1][1] = m2[1][0]*m3[0][1] + m2[1][1]*m3[1][1] + m2[1][2]*m3[2][1] + m2[1][3]*m3[3][1]; - m1[1][2] = m2[1][0]*m3[0][2] + m2[1][1]*m3[1][2] + m2[1][2]*m3[2][2] + m2[1][3]*m3[3][2]; - m1[1][3] = m2[1][0]*m3[0][3] + m2[1][1]*m3[1][3] + m2[1][2]*m3[2][3] + m2[1][3]*m3[3][3]; - - m1[2][0] = m2[2][0]*m3[0][0] + m2[2][1]*m3[1][0] + m2[2][2]*m3[2][0] + m2[2][3]*m3[3][0]; - m1[2][1] = m2[2][0]*m3[0][1] + m2[2][1]*m3[1][1] + m2[2][2]*m3[2][1] + m2[2][3]*m3[3][1]; - m1[2][2] = m2[2][0]*m3[0][2] + m2[2][1]*m3[1][2] + m2[2][2]*m3[2][2] + m2[2][3]*m3[3][2]; - m1[2][3] = m2[2][0]*m3[0][3] + m2[2][1]*m3[1][3] + m2[2][2]*m3[2][3] + m2[2][3]*m3[3][3]; - - m1[3][0] = m2[3][0]*m3[0][0] + m2[3][1]*m3[1][0] + m2[3][2]*m3[2][0] + m2[3][3]*m3[3][0]; - m1[3][1] = m2[3][0]*m3[0][1] + m2[3][1]*m3[1][1] + m2[3][2]*m3[2][1] + m2[3][3]*m3[3][1]; - m1[3][2] = m2[3][0]*m3[0][2] + m2[3][1]*m3[1][2] + m2[3][2]*m3[2][2] + m2[3][3]*m3[3][2]; - m1[3][3] = m2[3][0]*m3[0][3] + m2[3][1]*m3[1][3] + m2[3][2]*m3[2][3] + m2[3][3]*m3[3][3]; - -} -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4MulVecfl(float mat[][4], float *vec) -{ - float x,y; - - x=vec[0]; - y=vec[1]; - vec[0]=x*mat[0][0] + y*mat[1][0] + mat[2][0]*vec[2] + mat[3][0]; - vec[1]=x*mat[0][1] + y*mat[1][1] + mat[2][1]*vec[2] + mat[3][1]; - vec[2]=x*mat[0][2] + y*mat[1][2] + mat[2][2]*vec[2] + mat[3][2]; -} - -/* ------------------------------------------------------------------------- */ -void MTC_Mat3MulVecfl(float mat[][3], float *vec) -{ - float x,y; - - x=vec[0]; - y=vec[1]; - vec[0]= x*mat[0][0] + y*mat[1][0] + mat[2][0]*vec[2]; - vec[1]= x*mat[0][1] + y*mat[1][1] + mat[2][1]*vec[2]; - vec[2]= x*mat[0][2] + y*mat[1][2] + mat[2][2]*vec[2]; -} - -/* ------------------------------------------------------------------------- */ - -int MTC_Mat4Invert(float inverse[][4], float mat[][4]) -{ - int i, j, k; - double temp; - float tempmat[4][4]; - float max; - int maxj; - - /* Set inverse to identity */ - for (i=0; i<4; i++) - for (j=0; j<4; j++) - inverse[i][j] = 0; - for (i=0; i<4; i++) - inverse[i][i] = 1; - - /* Copy original matrix so we don't mess it up */ - for(i = 0; i < 4; i++) - for(j = 0; j <4; j++) - tempmat[i][j] = mat[i][j]; - - for(i = 0; i < 4; i++) { - /* Look for row with max pivot */ - max = ABS(tempmat[i][i]); - maxj = i; - for(j = i + 1; j < 4; j++) { - if(ABS(tempmat[j][i]) > max) { - max = ABS(tempmat[j][i]); - maxj = j; - } - } - /* Swap rows if necessary */ - if (maxj != i) { - for( k = 0; k < 4; k++) { - SWAP(float, tempmat[i][k], tempmat[maxj][k]); - SWAP(float, inverse[i][k], inverse[maxj][k]); - } - } - - temp = tempmat[i][i]; - if (temp == 0) - return 0; /* No non-zero pivot */ - for(k = 0; k < 4; k++) { - tempmat[i][k] /= temp; - inverse[i][k] /= temp; - } - for(j = 0; j < 4; j++) { - if(j != i) { - temp = tempmat[j][i]; - for(k = 0; k < 4; k++) { - tempmat[j][k] -= tempmat[i][k]*temp; - inverse[j][k] -= inverse[i][k]*temp; - } - } - } - } - return 1; -} - -/* ------------------------------------------------------------------------- */ -void MTC_Mat3CpyMat4(float m1[][3], float m2[][4]) -{ - - m1[0][0]= m2[0][0]; - m1[0][1]= m2[0][1]; - m1[0][2]= m2[0][2]; - - m1[1][0]= m2[1][0]; - m1[1][1]= m2[1][1]; - m1[1][2]= m2[1][2]; - - m1[2][0]= m2[2][0]; - m1[2][1]= m2[2][1]; - m1[2][2]= m2[2][2]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat3CpyMat3(float m1[][3], float m2[][3]) -{ - memcpy(m1, m2, 3*3*sizeof(float)); -} - -/* ------------------------------------------------------------------------- */ -/* void Mat3MulMat3(float m1[][3], float m3[][3], float m2[][3]) */ -void MTC_Mat3MulMat3(float m1[][3], float m3[][3], float m2[][3]) -{ - /* be careful about this rewrite... */ - /* m1[i][j] = m2[i][k]*m3[k][j], args are flipped! */ - m1[0][0]= m2[0][0]*m3[0][0] + m2[0][1]*m3[1][0] + m2[0][2]*m3[2][0]; - m1[0][1]= m2[0][0]*m3[0][1] + m2[0][1]*m3[1][1] + m2[0][2]*m3[2][1]; - m1[0][2]= m2[0][0]*m3[0][2] + m2[0][1]*m3[1][2] + m2[0][2]*m3[2][2]; - - m1[1][0]= m2[1][0]*m3[0][0] + m2[1][1]*m3[1][0] + m2[1][2]*m3[2][0]; - m1[1][1]= m2[1][0]*m3[0][1] + m2[1][1]*m3[1][1] + m2[1][2]*m3[2][1]; - m1[1][2]= m2[1][0]*m3[0][2] + m2[1][1]*m3[1][2] + m2[1][2]*m3[2][2]; - - m1[2][0]= m2[2][0]*m3[0][0] + m2[2][1]*m3[1][0] + m2[2][2]*m3[2][0]; - m1[2][1]= m2[2][0]*m3[0][1] + m2[2][1]*m3[1][1] + m2[2][2]*m3[2][1]; - m1[2][2]= m2[2][0]*m3[0][2] + m2[2][1]*m3[1][2] + m2[2][2]*m3[2][2]; - -/* m1[0]= m2[0]*m3[0] + m2[1]*m3[3] + m2[2]*m3[6]; */ -/* m1[1]= m2[0]*m3[1] + m2[1]*m3[4] + m2[2]*m3[7]; */ -/* m1[2]= m2[0]*m3[2] + m2[1]*m3[5] + m2[2]*m3[8]; */ -/* m1+=3; */ -/* m2+=3; */ -/* m1[0]= m2[0]*m3[0] + m2[1]*m3[3] + m2[2]*m3[6]; */ -/* m1[1]= m2[0]*m3[1] + m2[1]*m3[4] + m2[2]*m3[7]; */ -/* m1[2]= m2[0]*m3[2] + m2[1]*m3[5] + m2[2]*m3[8]; */ -/* m1+=3; */ -/* m2+=3; */ -/* m1[0]= m2[0]*m3[0] + m2[1]*m3[3] + m2[2]*m3[6]; */ -/* m1[1]= m2[0]*m3[1] + m2[1]*m3[4] + m2[2]*m3[7]; */ -/* m1[2]= m2[0]*m3[2] + m2[1]*m3[5] + m2[2]*m3[8]; */ -} /* end of void Mat3MulMat3(float m1[][3], float m3[][3], float m2[][3]) */ - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4Ortho(float mat[][4]) -{ - float len; - - len= MTC_normalize3DF(mat[0]); - if(len!=0.0) mat[0][3]/= len; - len= MTC_normalize3DF(mat[1]); - if(len!=0.0) mat[1][3]/= len; - len= MTC_normalize3DF(mat[2]); - if(len!=0.0) mat[2][3]/= len; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4Mul3Vecfl(float mat[][4], float *vec) -{ - float x,y; - /* vec = mat^T dot vec !!! or vec a row, then vec = vec dot mat*/ - - x= vec[0]; - y= vec[1]; - vec[0]= x*mat[0][0] + y*mat[1][0] + mat[2][0]*vec[2]; - vec[1]= x*mat[0][1] + y*mat[1][1] + mat[2][1]*vec[2]; - vec[2]= x*mat[0][2] + y*mat[1][2] + mat[2][2]*vec[2]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4One(float m[][4]) -{ - - m[0][0]= m[1][1]= m[2][2]= m[3][3]= 1.0; - m[0][1]= m[0][2]= m[0][3]= 0.0; - m[1][0]= m[1][2]= m[1][3]= 0.0; - m[2][0]= m[2][1]= m[2][3]= 0.0; - m[3][0]= m[3][1]= m[3][2]= 0.0; -} - - -/* ------------------------------------------------------------------------- */ -/* Result is a 3-vector!*/ -void MTC_Mat3MulVecd(float mat[][3], double *vec) -{ - double x,y; - - /* vec = mat^T dot vec !!! or vec a row, then vec = vec dot mat*/ - x=vec[0]; - y=vec[1]; - vec[0]= x * mat[0][0] + y * mat[1][0] + mat[2][0] * vec[2]; - vec[1]= x * mat[0][1] + y * mat[1][1] + mat[2][1] * vec[2]; - vec[2]= x * mat[0][2] + y * mat[1][2] + mat[2][2] * vec[2]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat3Inv(float m1[][3], float m2[][3]) -{ - short a,b; - float det; - - /* first adjoint */ - MTC_Mat3Adj(m1,m2); - - /* then determinant old mat! */ - det= m2[0][0]* (m2[1][1]*m2[2][2] - m2[1][2]*m2[2][1]) - -m2[1][0]* (m2[0][1]*m2[2][2] - m2[0][2]*m2[2][1]) - +m2[2][0]* (m2[0][1]*m2[1][2] - m2[0][2]*m2[1][1]); - - if(det==0) det=1; - det= 1/det; - for(a=0;a<3;a++) { - for(b=0;b<3;b++) { - m1[a][b]*=det; - } - } -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat3Adj(float m1[][3], float m[][3]) -{ - m1[0][0]=m[1][1]*m[2][2]-m[1][2]*m[2][1]; - m1[0][1]= -m[0][1]*m[2][2]+m[0][2]*m[2][1]; - m1[0][2]=m[0][1]*m[1][2]-m[0][2]*m[1][1]; - - m1[1][0]= -m[1][0]*m[2][2]+m[1][2]*m[2][0]; - m1[1][1]=m[0][0]*m[2][2]-m[0][2]*m[2][0]; - m1[1][2]= -m[0][0]*m[1][2]+m[0][2]*m[1][0]; - - m1[2][0]=m[1][0]*m[2][1]-m[1][1]*m[2][0]; - m1[2][1]= -m[0][0]*m[2][1]+m[0][1]*m[2][0]; - m1[2][2]=m[0][0]*m[1][1]-m[0][1]*m[1][0]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat3One(float m[][3]) -{ - - m[0][0]= m[1][1]= m[2][2]= 1.0; - m[0][1]= m[0][2]= 0.0; - m[1][0]= m[1][2]= 0.0; - m[2][0]= m[2][1]= 0.0; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4SwapMat4(float m1[][4], float m2[][4]) -{ - float t; - int i, j; - - for(i = 0; i < 4; i++) { - for (j = 0; j < 4; j++) { - t = m1[i][j]; - m1[i][j] = m2[i][j]; - m2[i][j] = t; - } - } -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4MulVec4fl(float mat[][4], float *vec) -{ - float x,y,z; - - x = vec[0]; - y = vec[1]; - z = vec[2]; - vec[0] = x*mat[0][0] + y*mat[1][0] + z*mat[2][0] + mat[3][0]*vec[3]; - vec[1] = x*mat[0][1] + y*mat[1][1] + z*mat[2][1] + mat[3][1]*vec[3]; - vec[2] = x*mat[0][2] + y*mat[1][2] + z*mat[2][2] + mat[3][2]*vec[3]; - vec[3] = x*mat[0][3] + y*mat[1][3] + z*mat[2][3] + mat[3][3]*vec[3]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4CpyMat3nc(float m1[][4], float m2[][3]) /* no clear */ -{ - m1[0][0]= m2[0][0]; - m1[0][1]= m2[0][1]; - m1[0][2]= m2[0][2]; - - m1[1][0]= m2[1][0]; - m1[1][1]= m2[1][1]; - m1[1][2]= m2[1][2]; - - m1[2][0]= m2[2][0]; - m1[2][1]= m2[2][1]; - m1[2][2]= m2[2][2]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4MulMat33(float m1[][3], float m2[][4], float m3[][3]) -{ - /* m1_i_j = m2_i_k * m3_k_j ? */ - - m1[0][0] = m2[0][0]*m3[0][0] + m2[0][1]*m3[1][0] + m2[0][2]*m3[2][0]; - m1[0][1] = m2[0][0]*m3[0][1] + m2[0][1]*m3[1][1] + m2[0][2]*m3[2][1]; - m1[0][2] = m2[0][0]*m3[0][2] + m2[0][1]*m3[1][2] + m2[0][2]*m3[2][2]; - - m1[1][0] = m2[1][0]*m3[0][0] + m2[1][1]*m3[1][0] + m2[1][2]*m3[2][0]; - m1[1][1] = m2[1][0]*m3[0][1] + m2[1][1]*m3[1][1] + m2[1][2]*m3[2][1]; - m1[1][2] = m2[1][0]*m3[0][2] + m2[1][1]*m3[1][2] + m2[1][2]*m3[2][2]; - - m1[2][0] = m2[2][0]*m3[0][0] + m2[2][1]*m3[1][0] + m2[2][2]*m3[2][0]; - m1[2][1] = m2[2][0]*m3[0][1] + m2[2][1]*m3[1][1] + m2[2][2]*m3[2][1]; - m1[2][2] = m2[2][0]*m3[0][2] + m2[2][1]*m3[1][2] + m2[2][2]*m3[2][2]; - -} - -/* ------------------------------------------------------------------------- */ - -/* eof */ diff --git a/source/blender/blenlib/intern/vectorops.c b/source/blender/blenlib/intern/vectorops.c deleted file mode 100644 index 3bff5235cfd..00000000000 --- a/source/blender/blenlib/intern/vectorops.c +++ /dev/null @@ -1,166 +0,0 @@ -/* - * - * Some vector operations. - * - * Always use - * - vector with x components : float x[3], int x[3], etc - * - * $Id$ - * - * ***** 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 ***** - */ - -/* ------------------------------------------------------------------------- */ -/* General format: op(a, b, c): a = b op c */ -/* Copying is done cp */ -/* ------------------------------------------------------------------------- */ - -#include "MTC_vectorops.h" -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -void MTC_diff3Int(int v1[3], int v2[3], int v3[3]) -{ - v1[0] = v2[0] - v3[0]; - v1[1] = v2[1] - v3[1]; - v1[2] = v2[2] - v3[2]; -} - -/* ------------------------------------------------------------------------- */ -void MTC_diff3Float(float v1[3], float v2[3], float v3[3]) -{ - v1[0] = v2[0] - v3[0]; - v1[1] = v2[1] - v3[1]; - v1[2] = v2[2] - v3[2]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_cross3Int(int v1[3], int v2[3], int v3[3]) -{ - v1[0] = v2[1]*v3[2] - v2[2]*v3[1]; - v1[1] = v2[2]*v3[0] - v2[0]*v3[2]; - v1[2] = v2[0]*v3[1] - v2[1]*v3[0]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_cross3Float(float v1[3], float v2[3], float v3[3]) -{ - v1[0] = v2[1]*v3[2] - v2[2]*v3[1]; - v1[1] = v2[2]*v3[0] - v2[0]*v3[2]; - v1[2] = v2[0]*v3[1] - v2[1]*v3[0]; -} -/* ------------------------------------------------------------------------- */ - -void MTC_cross3Double(double v1[3], double v2[3], double v3[3]) -{ - v1[0] = v2[1]*v3[2] - v2[2]*v3[1]; - v1[1] = v2[2]*v3[0] - v2[0]*v3[2]; - v1[2] = v2[0]*v3[1] - v2[1]*v3[0]; -} - -/* ------------------------------------------------------------------------- */ - -int MTC_dot3Int(int v1[3], int v2[3]) -{ - return (v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2]); -} - -/* ------------------------------------------------------------------------- */ - -float MTC_dot3Float(float v1[3], float v2[3]) -{ - return (v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2]); -} - -/* ------------------------------------------------------------------------- */ - -void MTC_cp3Float(float v1[3], float v2[3]) -{ - v2[0] = v1[0]; - v2[1] = v1[1]; - v2[2] = v1[2]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_cp3FloatInv(float v1[3], float v2[3]) -{ - v2[0] = -v1[0]; - v2[1] = -v1[1]; - v2[2] = -v1[2]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_swapInt(int *i1, int *i2) -{ - int swap; - swap = *i1; - *i1 = *i2; - *i2 = swap; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_diff3DFF(double v1[3], float v2[3], float v3[3]) -{ - v1[0] = v2[0] - v3[0]; - v1[1] = v2[1] - v3[1]; - v1[2] = v2[2] - v3[2]; -} - -/* ------------------------------------------------------------------------- */ -float MTC_normalize3DF(float n[3]) -{ - float d; - - d= n[0]*n[0]+n[1]*n[1]+n[2]*n[2]; - /* FLT_EPSILON is too large! A larger value causes normalize errors in */ - /* a scaled down utah teapot */ - if(d>0.0000000000001) { - - /* d= sqrt(d); This _should_ be sqrt, but internally it's a double*/ - /* anyway. This is safe. */ - d = sqrt(d); - - n[0]/=d; - n[1]/=d; - n[2]/=d; - } else { - n[0]=n[1]=n[2]= 0.0; - d= 0.0; - } - return d; -} - -/* ------------------------------------------------------------------------- */ - -/* eof */ diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index 667a889b5fc..7301901aff5 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -39,7 +39,7 @@ editmesh_mods.c, UI level access, no geometry changes #include "MEM_guardedalloc.h" -#include "MTC_matrixops.h" + #include "DNA_mesh_types.h" #include "DNA_material_types.h" diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 953a055c9e5..73589371c4f 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -43,7 +43,7 @@ #include "BLI_blenlib.h" #include "BLI_arithb.h" -#include "MTC_matrixops.h" + #include "DNA_action_types.h" #include "DNA_armature_types.h" @@ -1327,7 +1327,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P mval[0]-= vc->ar->winrct.xmin; mval[1]-= vc->ar->winrct.ymin; - MTC_Mat4SwapMat4(wpd->vc.rv3d->persmat, mat); + Mat4SwapMat4(wpd->vc.rv3d->persmat, mat); /* which faces are involved */ if(wp->flag & VP_AREA) { @@ -1444,7 +1444,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P } } - MTC_Mat4SwapMat4(vc->rv3d->persmat, mat); + Mat4SwapMat4(vc->rv3d->persmat, mat); DAG_id_flush_update(ob->data, OB_RECALC_DATA); ED_region_tag_redraw(vc->ar); @@ -1724,14 +1724,14 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P else totindex= 0; } - MTC_Mat4SwapMat4(vc->rv3d->persmat, mat); + Mat4SwapMat4(vc->rv3d->persmat, mat); for(index=0; indextotface) vpaint_paint_face(vp, vpd, ob, indexar[index]-1, mval); } - MTC_Mat4SwapMat4(vc->rv3d->persmat, mat); + Mat4SwapMat4(vc->rv3d->persmat, mat); ED_region_tag_redraw(vc->ar); diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 57e7d897e24..3b6ca455b48 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -37,7 +37,7 @@ #include "IMB_imbuf.h" -#include "MTC_matrixops.h" + #include "DNA_armature_types.h" #include "DNA_boid_types.h" @@ -1124,7 +1124,7 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob Mat4Ortho(vec); wmMultMatrix(vec); - MTC_Mat4SwapMat4(rv3d->persmat, tmat); + Mat4SwapMat4(rv3d->persmat, tmat); wmGetSingleMatrix(rv3d->persmat); if(cam->flag & CAM_SHOWLIMITS) { @@ -1137,7 +1137,7 @@ static void drawcamera(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob if(cam->flag & CAM_SHOWMIST) if(wrld) draw_limit_line(wrld->miststa, wrld->miststa+wrld->mistdist, 0xFFFFFF); - MTC_Mat4SwapMat4(rv3d->persmat, tmat); + Mat4SwapMat4(rv3d->persmat, tmat); } } } diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c index f4242c70139..342acfe92b3 100644 --- a/source/blender/editors/space_view3d/drawvolume.c +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -38,7 +38,7 @@ #include "IMB_imbuf.h" -#include "MTC_matrixops.h" + #include "DNA_armature_types.h" #include "DNA_boid_types.h" diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c b/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c index 0fd95642be6..bdf5a1ce079 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c @@ -27,7 +27,7 @@ */ #include -#include "MTC_vectorops.h" + #include "../TEX_util.h" static bNodeSocketType inputs[]= { @@ -65,19 +65,19 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor if(magsq == 0) magsq = 1; - ndx = MTC_dot3Float(coord, ax); + ndx = Inpf(coord, ax); para[0] = ax[0] * ndx * (1 - cos_a); para[1] = ax[1] * ndx * (1 - cos_a); para[2] = ax[2] * ndx * (1 - cos_a); - MTC_diff3Float(perp, coord, para); + VecSubf(perp, coord, para); perp[0] = coord[0] * cos_a; perp[1] = coord[1] * cos_a; perp[2] = coord[2] * cos_a; - MTC_cross3Float(cp, ax, coord); + Crossf(cp, ax, coord); cp[0] = cp[0] * sin_a; cp[1] = cp[1] * sin_a; diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index df99d5f2843..73ff826994a 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -31,7 +31,7 @@ #include #include -#include "MTC_matrixops.h" + #include "MEM_guardedalloc.h" @@ -191,8 +191,8 @@ void RE_make_stars(Render *re, Scene *scenev3d, void (*initfunc)(void), if (re) re->flag |= R_HALO; else stargrid *= 1.0; /* then it draws fewer */ - if(re) MTC_Mat4Invert(mat, re->viewmat); - else MTC_Mat4One(mat); + if(re) Mat4Invert(mat, re->viewmat); + else Mat4One(mat); /* BOUNDING BOX CALCULATION * bbox goes from z = loc_near_var | loc_far_var, @@ -240,7 +240,7 @@ void RE_make_stars(Render *re, Scene *scenev3d, void (*initfunc)(void), done++; } else { - MTC_Mat4MulVecfl(re->viewmat, vec); + Mat4MulVecfl(re->viewmat, vec); /* in vec are global coordinates * calculate distance to camera @@ -829,7 +829,7 @@ static void autosmooth(Render *re, ObjectRen *obr, float mat[][4], int degr) /* rotate vertices and calculate normal of faces */ for(a=0; atotvert; a++) { ver= RE_findOrAddVert(obr, a); - MTC_Mat4MulVecfl(mat, ver->co); + Mat4MulVecfl(mat, ver->co); } for(a=0; atotvlak; a++) { vlr= RE_findOrAddVlak(obr, a); @@ -1280,19 +1280,19 @@ static void particle_billboard(Render *re, ObjectRen *obr, Material *ma, Particl VECADD(vlr->v1->co, bb_center, xvec); VECADD(vlr->v1->co, vlr->v1->co, yvec); - MTC_Mat4MulVecfl(re->viewmat, vlr->v1->co); + Mat4MulVecfl(re->viewmat, vlr->v1->co); VECSUB(vlr->v2->co, bb_center, xvec); VECADD(vlr->v2->co, vlr->v2->co, yvec); - MTC_Mat4MulVecfl(re->viewmat, vlr->v2->co); + Mat4MulVecfl(re->viewmat, vlr->v2->co); VECSUB(vlr->v3->co, bb_center, xvec); VECSUB(vlr->v3->co, vlr->v3->co, yvec); - MTC_Mat4MulVecfl(re->viewmat, vlr->v3->co); + Mat4MulVecfl(re->viewmat, vlr->v3->co); VECADD(vlr->v4->co, bb_center, xvec); VECSUB(vlr->v4->co, vlr->v4->co, yvec); - MTC_Mat4MulVecfl(re->viewmat, vlr->v4->co); + Mat4MulVecfl(re->viewmat, vlr->v4->co); CalcNormFloat4(vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co, vlr->n); VECCOPY(vlr->v1->n,vlr->n); @@ -1392,7 +1392,7 @@ static void particle_normal_ren(short ren_as, ParticleSettings *part, Render *re VECCOPY(loc, state->co); if(ren_as != PART_DRAW_BB) - MTC_Mat4MulVecfl(re->viewmat, loc); + Mat4MulVecfl(re->viewmat, loc); switch(ren_as) { case PART_DRAW_LINE: @@ -1401,7 +1401,7 @@ static void particle_normal_ren(short ren_as, ParticleSettings *part, Render *re sd->size = hasize; VECCOPY(vel, state->vel); - MTC_Mat4Mul3Vecfl(re->viewmat, vel); + Mat4Mul3Vecfl(re->viewmat, vel); Normalize(vel); if(part->draw & PART_DRAW_VEL_LENGTH) @@ -1621,8 +1621,8 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem } /* 2.5 setup matrices */ - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); /* need to be that way, for imat texture */ + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); /* need to be that way, for imat texture */ Mat3CpyMat4(nmat, ob->imat); Mat3Transp(nmat); @@ -1904,7 +1904,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem time= curlen/strandlen; VECCOPY(loc,state.co); - MTC_Mat4MulVecfl(re->viewmat,loc); + Mat4MulVecfl(re->viewmat,loc); if(strandbuf) { VECCOPY(svert->co, loc); @@ -2046,8 +2046,8 @@ static void make_render_halos(Render *re, ObjectRen *obr, Mesh *me, int totvert, float vec[3], hasize, mat[4][4], imat[3][3]; int a, ok, seed= ma->seed1; - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat3CpyMat4(imat, ob->imat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat3CpyMat4(imat, ob->imat); re->flag |= R_HALO; @@ -2058,7 +2058,7 @@ static void make_render_halos(Render *re, ObjectRen *obr, Mesh *me, int totvert, hasize= ma->hasize; VECCOPY(vec, mvert->co); - MTC_Mat4MulVecfl(mat, vec); + Mat4MulVecfl(mat, vec); if(ma->mode & MA_HALOPUNO) { xn= mvert->no[0]; @@ -2191,7 +2191,7 @@ static void displace_render_vert(Render *re, ObjectRen *obr, ShadeInput *shi, Ve } if (texco & TEXCO_GLOB) { VECCOPY(shi->gl, shi->co); - MTC_Mat4MulVecfl(re->viewinv, shi->gl); + Mat4MulVecfl(re->viewinv, shi->gl); } if (texco & TEXCO_NORM) { VECCOPY(shi->orn, shi->vn); @@ -2332,9 +2332,9 @@ static void init_render_mball(Render *re, ObjectRen *obr) if (ob!=find_basis_mball(re->scene, ob)) return; - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); - MTC_Mat3CpyMat4(imat, ob->imat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); + Mat3CpyMat4(imat, ob->imat); ma= give_render_material(re, ob, 1); @@ -2355,7 +2355,7 @@ static void init_render_mball(Render *re, ObjectRen *obr) ver= RE_findOrAddVert(obr, obr->totvert++); VECCOPY(ver->co, data); - MTC_Mat4MulVecfl(mat, ver->co); + Mat4MulVecfl(mat, ver->co); /* render normals are inverted */ xn= -nors[0]; @@ -2439,7 +2439,7 @@ static int dl_surf_to_renderdata(ObjectRen *obr, DispList *dl, Material **matar, if(orco) { v1->orco= orco; orco+= 3; orcoret++; } - MTC_Mat4MulVecfl(mat, v1->co); + Mat4MulVecfl(mat, v1->co); for (v = 1; v < sizev; v++) { ver= RE_findOrAddVert(obr, obr->totvert++); @@ -2447,7 +2447,7 @@ static int dl_surf_to_renderdata(ObjectRen *obr, DispList *dl, Material **matar, if(orco) { ver->orco= orco; orco+= 3; orcoret++; } - MTC_Mat4MulVecfl(mat, ver->co); + Mat4MulVecfl(mat, ver->co); } /* if V-cyclic, add extra vertices at end of the row */ if (dl->flag & DL_CYCL_U) { @@ -2597,8 +2597,8 @@ static void init_render_surf(Render *re, ObjectRen *obr) nu= cu->nurb.first; if(nu==0) return; - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); /* material array */ totmat= ob->totcol+1; @@ -2658,8 +2658,8 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset) dl= cu->disp.first; if(cu->disp.first==NULL) return; - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); /* material array */ totmat= ob->totcol+1; @@ -2701,7 +2701,7 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset) ver->flag = 0; } - MTC_Mat4MulVecfl(mat, ver->co); + Mat4MulVecfl(mat, ver->co); if (orco) { ver->orco = orco; @@ -2753,7 +2753,7 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset) ver= RE_findOrAddVert(obr, obr->totvert++); VECCOPY(ver->co, fp); - MTC_Mat4MulVecfl(mat, ver->co); + Mat4MulVecfl(mat, ver->co); fp+= 3; if (orco) { @@ -3050,9 +3050,9 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) me= ob->data; - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); - MTC_Mat3CpyMat4(imat, ob->imat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); + Mat3CpyMat4(imat, ob->imat); if(me->totvert==0) return; @@ -3136,7 +3136,7 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) ver= RE_findOrAddVert(obr, obr->totvert++); VECCOPY(ver->co, mvert->co); if(do_autosmooth==0) /* autosmooth on original unrotated data to prevent differences between frames */ - MTC_Mat4MulVecfl(mat, ver->co); + Mat4MulVecfl(mat, ver->co); if(orco) { ver->orco= orco; @@ -3357,13 +3357,13 @@ static void initshadowbuf(Render *re, LampRen *lar, float mat[][4]) shb->soft= lar->soft; shb->shadhalostep= lar->shadhalostep; - MTC_Mat4Ortho(mat); - MTC_Mat4Invert(shb->winmat, mat); /* winmat is temp */ + Mat4Ortho(mat); + Mat4Invert(shb->winmat, mat); /* winmat is temp */ /* matrix: combination of inverse view and lampmat */ /* calculate again: the ortho-render has no correct viewinv */ - MTC_Mat4Invert(viewinv, re->viewmat); - MTC_Mat4MulMat4(shb->viewmat, viewinv, shb->winmat); + Mat4Invert(viewinv, re->viewmat); + Mat4MulMat4(shb->viewmat, viewinv, shb->winmat); /* projection */ shb->d= lar->clipsta; @@ -3441,11 +3441,11 @@ static GroupObject *add_render_lamp(Render *re, Object *ob) BLI_addtail(&re->lampren, lar); go->lampren= lar; - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); - MTC_Mat3CpyMat4(lar->mat, mat); - MTC_Mat3CpyMat4(lar->imat, ob->imat); + Mat3CpyMat4(lar->mat, mat); + Mat3CpyMat4(lar->imat, ob->imat); lar->bufsize = la->bufsize; lar->samp = la->samp; @@ -3601,7 +3601,7 @@ static GroupObject *add_render_lamp(Render *re, Object *ob) lar->sh_invcampos[0]= -lar->co[0]; lar->sh_invcampos[1]= -lar->co[1]; lar->sh_invcampos[2]= -lar->co[2]; - MTC_Mat3MulVecfl(lar->imat, lar->sh_invcampos); + Mat3MulVecfl(lar->imat, lar->sh_invcampos); /* z factor, for a normalized volume */ angle= saacos(lar->spotsi); @@ -4225,7 +4225,7 @@ static void set_dupli_tex_mat(Render *re, ObjectInstanceRen *obi, DupliObject *d obi->duplitexmat= BLI_memarena_alloc(re->memArena, sizeof(float)*4*4); Mat4Invert(imat, dob->mat); - MTC_Mat4MulSerie(obi->duplitexmat, re->viewmat, dob->omat, imat, re->viewinv, 0, 0, 0, 0); + Mat4MulSerie(obi->duplitexmat, re->viewmat, dob->omat, imat, re->viewinv, 0, 0, 0, 0); } } @@ -4349,8 +4349,8 @@ static void init_render_object(Render *re, Object *ob, Object *par, DupliObject else if(render_object_type(ob->type)) add_render_object(re, ob, par, dob, timeoffset, vectorlay); else { - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); } time= PIL_check_seconds_timer(); @@ -4600,8 +4600,8 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp for(SETLOOPER(re->scene, base)) { ob= base->object; /* imat objects has to be done here, since displace can have texture using Object map-input */ - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); /* each object should only be rendered once */ ob->flag &= ~OB_DONE; ob->transflag &= ~OB_RENDER_DUPLI; @@ -4747,8 +4747,8 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp if(redoimat) { for(SETLOOPER(re->scene, base)) { ob= base->object; - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); } } @@ -5174,7 +5174,7 @@ static int load_fluidsimspeedvectors(Render *re, ObjectInstanceRen *obi, float * return 0; Mat4CpyMat4(mat, re->viewmat); - MTC_Mat4Invert(imat, mat); + Mat4Invert(imat, mat); /* set first vertex OK */ if(!fss->meshSurfNormals) return 0; diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c index a57e38f47c8..b5774d11799 100644 --- a/source/blender/render/intern/source/envmap.c +++ b/source/blender/render/intern/source/envmap.c @@ -51,7 +51,7 @@ #include "BKE_texture.h" #include "BKE_utildefines.h" -#include "MTC_matrixops.h" + /* this module */ #include "render_types.h" @@ -211,9 +211,9 @@ static void envmap_transmatrix(float mat[][4], int part) eul[2]= -M_PI/2.0; } - MTC_Mat4CpyMat4(tmat, mat); + Mat4CpyMat4(tmat, mat); EulToMat4(eul, rotmat); - MTC_Mat4MulSerie(mat, tmat, rotmat, + Mat4MulSerie(mat, tmat, rotmat, 0, 0, 0, 0, 0, 0); } @@ -231,12 +231,12 @@ static void env_rotate_scene(Render *re, float mat[][4], int mode) int a; if(mode==0) { - MTC_Mat4Invert(tmat, mat); - MTC_Mat3CpyMat4(imat, tmat); + Mat4Invert(tmat, mat); + Mat3CpyMat4(imat, tmat); } else { - MTC_Mat4CpyMat4(tmat, mat); - MTC_Mat3CpyMat4(imat, mat); + Mat4CpyMat4(tmat, mat); + Mat3CpyMat4(imat, mat); } for(obi=re->instancetable.first; obi; obi=obi->next) { @@ -267,7 +267,7 @@ static void env_rotate_scene(Render *re, float mat[][4], int mode) if((a & 255)==0) har= obr->bloha[a>>8]; else har++; - MTC_Mat4MulVecfl(tmat, har->co); + Mat4MulVecfl(tmat, har->co); } } @@ -280,22 +280,22 @@ static void env_rotate_scene(Render *re, float mat[][4], int mode) Mat3CpyMat3(cmat, lar->imat); Mat3MulMat3(lar->imat, cmat, imat); - MTC_Mat3MulVecfl(imat, lar->vec); - MTC_Mat4MulVecfl(tmat, lar->co); + Mat3MulVecfl(imat, lar->vec); + Mat4MulVecfl(tmat, lar->co); lar->sh_invcampos[0]= -lar->co[0]; lar->sh_invcampos[1]= -lar->co[1]; lar->sh_invcampos[2]= -lar->co[2]; - MTC_Mat3MulVecfl(lar->imat, lar->sh_invcampos); + Mat3MulVecfl(lar->imat, lar->sh_invcampos); lar->sh_invcampos[2]*= lar->sh_zfac; if(lar->shb) { if(mode==1) { - MTC_Mat4Invert(pmat, mat); - MTC_Mat4MulMat4(smat, pmat, lar->shb->viewmat); - MTC_Mat4MulMat4(lar->shb->persmat, smat, lar->shb->winmat); + Mat4Invert(pmat, mat); + Mat4MulMat4(smat, pmat, lar->shb->viewmat); + Mat4MulMat4(lar->shb->persmat, smat, lar->shb->winmat); } - else MTC_Mat4MulMat4(lar->shb->persmat, lar->shb->viewmat, lar->shb->winmat); + else Mat4MulMat4(lar->shb->persmat, lar->shb->viewmat, lar->shb->winmat); } } @@ -373,8 +373,8 @@ static void env_set_imats(Render *re) base= re->scene->base.first; while(base) { - MTC_Mat4MulMat4(mat, base->object->obmat, re->viewmat); - MTC_Mat4Invert(base->object->imat, mat); + Mat4MulMat4(mat, base->object->obmat, re->viewmat); + Mat4Invert(base->object->imat, mat); base= base->next; } @@ -393,18 +393,18 @@ static void render_envmap(Render *re, EnvMap *env) short part; /* need a recalc: ortho-render has no correct viewinv */ - MTC_Mat4Invert(oldviewinv, re->viewmat); + Mat4Invert(oldviewinv, re->viewmat); envre= envmap_render_copy(re, env); /* precalc orthmat for object */ - MTC_Mat4CpyMat4(orthmat, env->object->obmat); - MTC_Mat4Ortho(orthmat); + Mat4CpyMat4(orthmat, env->object->obmat); + Mat4Ortho(orthmat); /* need imat later for texture imat */ - MTC_Mat4MulMat4(mat, orthmat, re->viewmat); - MTC_Mat4Invert(tmat, mat); - MTC_Mat3CpyMat4(env->obimat, tmat); + Mat4MulMat4(mat, orthmat, re->viewmat); + Mat4Invert(tmat, mat); + Mat3CpyMat4(env->obimat, tmat); for(part=0; part<6; part++) { if(env->type==ENV_PLANE && part!=1) @@ -412,17 +412,17 @@ static void render_envmap(Render *re, EnvMap *env) re->display_clear(re->dch, envre->result); - MTC_Mat4CpyMat4(tmat, orthmat); + Mat4CpyMat4(tmat, orthmat); envmap_transmatrix(tmat, part); - MTC_Mat4Invert(mat, tmat); + Mat4Invert(mat, tmat); /* mat now is the camera 'viewmat' */ - MTC_Mat4CpyMat4(envre->viewmat, mat); - MTC_Mat4CpyMat4(envre->viewinv, tmat); + Mat4CpyMat4(envre->viewmat, mat); + Mat4CpyMat4(envre->viewinv, tmat); /* we have to correct for the already rotated vertexcoords */ - MTC_Mat4MulMat4(tmat, oldviewinv, envre->viewmat); - MTC_Mat4Invert(env->imat, tmat); + Mat4MulMat4(tmat, oldviewinv, envre->viewmat); + Mat4Invert(env->imat, tmat); env_rotate_scene(envre, tmat, 1); init_render_world(envre); @@ -503,13 +503,13 @@ void make_envmaps(Render *re) float orthmat[4][4], mat[4][4], tmat[4][4]; /* precalc orthmat for object */ - MTC_Mat4CpyMat4(orthmat, env->object->obmat); - MTC_Mat4Ortho(orthmat); + Mat4CpyMat4(orthmat, env->object->obmat); + Mat4Ortho(orthmat); /* need imat later for texture imat */ - MTC_Mat4MulMat4(mat, orthmat, re->viewmat); - MTC_Mat4Invert(tmat, mat); - MTC_Mat3CpyMat4(env->obimat, tmat); + Mat4MulMat4(mat, orthmat, re->viewmat); + Mat4Invert(tmat, mat); + Mat3CpyMat4(env->obimat, tmat); } else { @@ -678,20 +678,20 @@ int envmaptex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexRe /* rotate to envmap space, if object is set */ VECCOPY(vec, texvec); - if(env->object) MTC_Mat3MulVecfl(env->obimat, vec); - else MTC_Mat4Mul3Vecfl(R.viewinv, vec); + if(env->object) Mat3MulVecfl(env->obimat, vec); + else Mat4Mul3Vecfl(R.viewinv, vec); face= envcube_isect(env, vec, sco); ibuf= env->cube[face]; if(osatex) { if(env->object) { - MTC_Mat3MulVecfl(env->obimat, dxt); - MTC_Mat3MulVecfl(env->obimat, dyt); + Mat3MulVecfl(env->obimat, dxt); + Mat3MulVecfl(env->obimat, dyt); } else { - MTC_Mat4Mul3Vecfl(R.viewinv, dxt); - MTC_Mat4Mul3Vecfl(R.viewinv, dyt); + Mat4Mul3Vecfl(R.viewinv, dxt); + Mat4Mul3Vecfl(R.viewinv, dyt); } set_dxtdyt(dxts, dyts, dxt, dyt, face); imagewraposa(tex, NULL, ibuf, sco, dxts, dyts, texres); diff --git a/source/blender/render/intern/source/initrender.c b/source/blender/render/intern/source/initrender.c index 842adcf8520..d388e81a745 100644 --- a/source/blender/render/intern/source/initrender.c +++ b/source/blender/render/intern/source/initrender.c @@ -41,7 +41,7 @@ #include "BLI_blenlib.h" #include "BLI_jitter.h" -#include "MTC_matrixops.h" + #include "DNA_camera_types.h" #include "DNA_group_types.h" diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c index 75a2ab257f4..de3a50acddf 100644 --- a/source/blender/render/intern/source/pixelshading.c +++ b/source/blender/render/intern/source/pixelshading.c @@ -32,8 +32,8 @@ /* External modules: */ #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" -#include "MTC_matrixops.h" -#include "MTC_vectorops.h" + + #include "DNA_camera_types.h" #include "DNA_group_types.h" @@ -155,7 +155,7 @@ static void render_lighting_halo(HaloRen *har, float *colf) /* rotate view to lampspace */ VECCOPY(lvrot, lv); - MTC_Mat3MulVecfl(lar->imat, lvrot); + Mat3MulVecfl(lar->imat, lvrot); x= MAX2(fabs(lvrot[0]/lvrot[2]) , fabs(lvrot[1]/lvrot[2])); /* 1.0/(sqrt(1+x*x)) is equivalent to cos(atan(x)) */ @@ -553,7 +553,7 @@ void shadeSkyView(float *colf, float *rco, float *view, float *dxyview, short th VECCOPY(lo, view); if(R.wrld.skytype & WO_SKYREAL) { - MTC_Mat3MulVecfl(R.imat, lo); + Mat3MulVecfl(R.imat, lo); SWAP(float, lo[1], lo[2]); @@ -595,7 +595,7 @@ void shadeSunView(float *colf, float *view) VECCOPY(sview, view); Normalize(sview); - MTC_Mat3MulVecfl(R.imat, sview); + Mat3MulVecfl(R.imat, sview); if (sview[2] < 0.0) sview[2] = 0.0; Normalize(sview); @@ -678,7 +678,7 @@ void shadeAtmPixel(struct SunSky *sunsky, float *collector, float fx, float fy, calc_view_vector(view, fx, fy); Normalize(view); - /*MTC_Mat3MulVecfl(R.imat, view);*/ + /*Mat3MulVecfl(R.imat, view);*/ AtmospherePixleShader(sunsky, view, distance, collector); } diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c index 33085b98095..48305d31e10 100644 --- a/source/blender/render/intern/source/shadbuf.c +++ b/source/blender/render/intern/source/shadbuf.c @@ -26,7 +26,7 @@ #include #include -#include "MTC_matrixops.h" + #include "MEM_guardedalloc.h" #include "DNA_group_types.h" @@ -403,7 +403,7 @@ void makeshadowbuf(Render *re, LampRen *lar) wsize= shb->pixsize*(shb->size/2.0); i_window(-wsize, wsize, -wsize, wsize, shb->d, shb->clipend, shb->winmat); - MTC_Mat4MulMat4(shb->persmat, shb->viewmat, shb->winmat); + Mat4MulMat4(shb->persmat, shb->viewmat, shb->winmat); if(ELEM(lar->buftype, LA_SHADBUF_REGULAR, LA_SHADBUF_HALFWAY)) { /* jitter, weights - not threadsafe! */ @@ -673,7 +673,7 @@ float testshadowbuf(Render *re, ShadBuf *shb, float *rco, float *dxco, float *dy VECCOPY(co, rco); co[3]= 1.0f; - MTC_Mat4MulVec4fl(shb->persmat, co); /* rational hom co */ + Mat4MulVec4fl(shb->persmat, co); /* rational hom co */ xs1= siz*(1.0f+co[0]/co[3]); ys1= siz*(1.0f+co[1]/co[3]); @@ -714,7 +714,7 @@ float testshadowbuf(Render *re, ShadBuf *shb, float *rco, float *dxco, float *dy co[1]= rco[1]+dxco[1]; co[2]= rco[2]+dxco[2]; co[3]= 1.0; - MTC_Mat4MulVec4fl(shb->persmat,co); /* rational hom co */ + Mat4MulVec4fl(shb->persmat,co); /* rational hom co */ dx[0]= xs1- siz*(1.0+co[0]/co[3]); dx[1]= ys1- siz*(1.0+co[1]/co[3]); @@ -722,7 +722,7 @@ float testshadowbuf(Render *re, ShadBuf *shb, float *rco, float *dxco, float *dy co[1]= rco[1]+dyco[1]; co[2]= rco[2]+dyco[2]; co[3]= 1.0; - MTC_Mat4MulVec4fl(shb->persmat,co); /* rational hom co */ + Mat4MulVec4fl(shb->persmat,co); /* rational hom co */ dy[0]= xs1- siz*(1.0+co[0]/co[3]); dy[1]= ys1- siz*(1.0+co[1]/co[3]); @@ -858,7 +858,7 @@ float shadow_halo(LampRen *lar, float *p1, float *p2) co[1]= p1[1]; co[2]= p1[2]/lar->sh_zfac; co[3]= 1.0; - MTC_Mat4MulVec4fl(shb->winmat, co); /* rational hom co */ + Mat4MulVec4fl(shb->winmat, co); /* rational hom co */ xf1= siz*(1.0+co[0]/co[3]); yf1= siz*(1.0+co[1]/co[3]); zf1= (co[2]/co[3]); @@ -868,7 +868,7 @@ float shadow_halo(LampRen *lar, float *p1, float *p2) co[1]= p2[1]; co[2]= p2[2]/lar->sh_zfac; co[3]= 1.0; - MTC_Mat4MulVec4fl(shb->winmat, co); /* rational hom co */ + Mat4MulVec4fl(shb->winmat, co); /* rational hom co */ xf2= siz*(1.0+co[0]/co[3]); yf2= siz*(1.0+co[1]/co[3]); zf2= (co[2]/co[3]); @@ -1659,7 +1659,7 @@ static int viewpixel_to_lampbuf(ShadBuf *shb, ObjectInstanceRen *obi, VlakRen *v } /* move 3d vector to lampbuf */ - MTC_Mat4MulVec4fl(shb->persmat, hoco); /* rational hom co */ + Mat4MulVec4fl(shb->persmat, hoco); /* rational hom co */ /* clip We can test for -1.0/1.0 because of the properties of the * coordinate transformations. */ diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index 1a0edfd53ed..7541ce53073 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -29,7 +29,7 @@ #include #include -#include "MTC_matrixops.h" + #include "BLI_arithb.h" #include "BLI_blenlib.h" @@ -458,13 +458,13 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert if(texco & TEXCO_GLOB) { VECCOPY(shi->gl, shi->co); - MTC_Mat4MulVecfl(R.viewinv, shi->gl); + Mat4MulVecfl(R.viewinv, shi->gl); if(shi->osatex) { VECCOPY(shi->dxgl, shi->dxco); - MTC_Mat3MulVecfl(R.imat, shi->dxco); + Mat3MulVecfl(R.imat, shi->dxco); VECCOPY(shi->dygl, shi->dyco); - MTC_Mat3MulVecfl(R.imat, shi->dyco); + Mat3MulVecfl(R.imat, shi->dyco); } } @@ -1021,15 +1021,15 @@ void shade_input_set_shade_texco(ShadeInput *shi) if(texco & TEXCO_GLOB) { VECCOPY(shi->gl, shi->co); - MTC_Mat4MulVecfl(R.viewinv, shi->gl); + Mat4MulVecfl(R.viewinv, shi->gl); if(shi->osatex) { VECCOPY(shi->dxgl, shi->dxco); // TXF: bug was here, but probably should be in convertblender.c, R.imat only valid if there is a world - //MTC_Mat3MulVecfl(R.imat, shi->dxco); - MTC_Mat4Mul3Vecfl(R.viewinv, shi->dxco); + //Mat3MulVecfl(R.imat, shi->dxco); + Mat4Mul3Vecfl(R.viewinv, shi->dxco); VECCOPY(shi->dygl, shi->dyco); - //MTC_Mat3MulVecfl(R.imat, shi->dyco); - MTC_Mat4Mul3Vecfl(R.viewinv, shi->dyco); + //Mat3MulVecfl(R.imat, shi->dyco); + Mat4Mul3Vecfl(R.viewinv, shi->dyco); } } diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index 2f6f86e9a09..5e523199755 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -30,7 +30,7 @@ #include #include -#include "MTC_matrixops.h" + #include "BLI_arithb.h" #include "BKE_colortools.h" @@ -168,7 +168,7 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens) p1[0]= shi->co[0]-lar->co[0]; p1[1]= shi->co[1]-lar->co[1]; p1[2]= -lar->co[2]; - MTC_Mat3MulVecfl(lar->imat, p1); + Mat3MulVecfl(lar->imat, p1); VECCOPY(npos, p1); // npos is double! /* pre-scale */ @@ -180,7 +180,7 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens) /* rotate view */ VECCOPY(nray, shi->view); - MTC_Mat3MulVecd(lar->imat, nray); + Mat3MulVecd(lar->imat, nray); if(R.wrld.mode & WO_MIST) { /* patchy... */ @@ -1143,7 +1143,7 @@ float lamp_get_visibility(LampRen *lar, float *co, float *lv, float *dist) /* rotate view to lampspace */ VECCOPY(lvrot, lv); - MTC_Mat3MulVecfl(lar->imat, lvrot); + Mat3MulVecfl(lar->imat, lvrot); x= MAX2(fabs(lvrot[0]/lvrot[2]) , fabs(lvrot[1]/lvrot[2])); /* 1.0f/(sqrt(1+x*x)) is equivalent to cos(atan(x)) */ diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index c706c6ccc11..4d4a2c04808 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -30,7 +30,7 @@ #include #include -#include "MTC_matrixops.h" + #include "BLI_blenlib.h" #include "BLI_arithb.h" @@ -832,7 +832,7 @@ static int cubemap_glob(float *n, float x, float y, float z, float *adr1, float else { VECCOPY(nor, n); } - MTC_Mat4Mul3Vecfl(R.viewinv, nor); + Mat4Mul3Vecfl(R.viewinv, nor); x1= fabs(nor[0]); y1= fabs(nor[1]); @@ -925,7 +925,7 @@ static int cubemap_ob(Object *ob, float *n, float x, float y, float z, float *ad if(n==NULL) return 0; VECCOPY(nor, n); - if(ob) MTC_Mat4Mul3Vecfl(ob->imat, nor); + if(ob) Mat4Mul3Vecfl(ob->imat, nor); x1= fabs(nor[0]); y1= fabs(nor[1]); @@ -1648,13 +1648,13 @@ void do_material_tex(ShadeInput *shi) VECCOPY(tempvec, shi->co); if(mtex->texflag & MTEX_OB_DUPLI_ORIG) if(shi->obi && shi->obi->duplitexmat) - MTC_Mat4MulVecfl(shi->obi->duplitexmat, tempvec); - MTC_Mat4MulVecfl(ob->imat, tempvec); + Mat4MulVecfl(shi->obi->duplitexmat, tempvec); + Mat4MulVecfl(ob->imat, tempvec); if(shi->osatex) { VECCOPY(dxt, shi->dxco); VECCOPY(dyt, shi->dyco); - MTC_Mat4Mul3Vecfl(ob->imat, dxt); - MTC_Mat4Mul3Vecfl(ob->imat, dyt); + Mat4Mul3Vecfl(ob->imat, dxt); + Mat4Mul3Vecfl(ob->imat, dyt); } } else { @@ -2291,9 +2291,9 @@ void do_volume_tex(ShadeInput *shi, float *xyz, int mapto_flag, float *col, floa VECCOPY(co, xyz); if(mtex->texflag & MTEX_OB_DUPLI_ORIG) { if(shi->obi && shi->obi->duplitexmat) - MTC_Mat4MulVecfl(shi->obi->duplitexmat, co); + Mat4MulVecfl(shi->obi->duplitexmat, co); } - MTC_Mat4MulVecfl(ob->imat, co); + Mat4MulVecfl(ob->imat, co); } } /* not really orco, but 'local' */ @@ -2305,12 +2305,12 @@ void do_volume_tex(ShadeInput *shi, float *xyz, int mapto_flag, float *col, floa else { Object *ob= shi->obi->ob; VECCOPY(co, xyz); - MTC_Mat4MulVecfl(ob->imat, co); + Mat4MulVecfl(ob->imat, co); } } else if(mtex->texco==TEXCO_GLOB) { VECCOPY(co, xyz); - MTC_Mat4MulVecfl(R.viewinv, co); + Mat4MulVecfl(R.viewinv, co); } else continue; // can happen when texco defines disappear and it renders old files @@ -2639,7 +2639,7 @@ void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, f case TEXCO_OBJECT: if(mtex->object) { VECCOPY(tempvec, lo); - MTC_Mat4MulVecfl(mtex->object->imat, tempvec); + Mat4MulVecfl(mtex->object->imat, tempvec); co= tempvec; } break; @@ -2647,16 +2647,16 @@ void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, f case TEXCO_GLOB: if(rco) { VECCOPY(tempvec, rco); - MTC_Mat4MulVecfl(R.viewinv, tempvec); + Mat4MulVecfl(R.viewinv, tempvec); co= tempvec; } else co= lo; // VECCOPY(shi->dxgl, shi->dxco); -// MTC_Mat3MulVecfl(R.imat, shi->dxco); +// Mat3MulVecfl(R.imat, shi->dxco); // VECCOPY(shi->dygl, shi->dyco); -// MTC_Mat3MulVecfl(R.imat, shi->dyco); +// Mat3MulVecfl(R.imat, shi->dyco); break; } @@ -2783,12 +2783,12 @@ void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf, int ef dx= dxt; dy= dyt; VECCOPY(tempvec, shi->co); - MTC_Mat4MulVecfl(ob->imat, tempvec); + Mat4MulVecfl(ob->imat, tempvec); if(shi->osatex) { VECCOPY(dxt, shi->dxco); VECCOPY(dyt, shi->dyco); - MTC_Mat4Mul3Vecfl(ob->imat, dxt); - MTC_Mat4Mul3Vecfl(ob->imat, dyt); + Mat4Mul3Vecfl(ob->imat, dxt); + Mat4Mul3Vecfl(ob->imat, dyt); } } else { @@ -2799,12 +2799,12 @@ void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf, int ef else if(mtex->texco==TEXCO_GLOB) { co= shi->gl; dx= shi->dxco; dy= shi->dyco; VECCOPY(shi->gl, shi->co); - MTC_Mat4MulVecfl(R.viewinv, shi->gl); + Mat4MulVecfl(R.viewinv, shi->gl); } else if(mtex->texco==TEXCO_VIEW) { VECCOPY(tempvec, lavec); - MTC_Mat3MulVecfl(la->imat, tempvec); + Mat3MulVecfl(la->imat, tempvec); if(la->type==LA_SPOT) { tempvec[0]*= la->spottexfac; @@ -2817,8 +2817,8 @@ void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf, int ef VECCOPY(dxt, shi->dxlv); VECCOPY(dyt, shi->dylv); /* need some matrix conversion here? la->imat is a [3][3] matrix!!! **/ - MTC_Mat3MulVecfl(la->imat, dxt); - MTC_Mat3MulVecfl(la->imat, dyt); + Mat3MulVecfl(la->imat, dxt); + Mat3MulVecfl(la->imat, dyt); VecMulf(dxt, la->spottexfac); VecMulf(dyt, la->spottexfac); diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index 53a05dd0d67..3b3a8568933 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -42,7 +42,7 @@ #include "BLI_jitter.h" #include "BLI_threads.h" -#include "MTC_matrixops.h" + #include "MEM_guardedalloc.h" #include "DNA_lamp_types.h" From a46beac3f87ee78d6231b2f0038db31c50aa2315 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Sun, 6 Sep 2009 01:11:47 +0000 Subject: [PATCH 452/577] Rename Vec3ToTangent VecBisect3, since that's what it does. --- source/blender/blenkernel/intern/curve.c | 8 ++++---- source/blender/blenlib/BLI_arithb.h | 2 +- source/blender/blenlib/intern/arithb.c | 9 ++++----- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 709507a9b26..25af0cb5ce3 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -1903,7 +1903,7 @@ void makeBevelList(Object *ob) } /* this has to be >2 points */ else if(cu->flag & CU_NO_TWIST && cu->flag & CU_3D && bl->poly != -1) { - /* Special case, cyclic curve with no twisy. tricky... */ + /* Special case, cyclic curve with no twist. tricky... */ float quat[4], q[4], cross[3]; @@ -1924,7 +1924,7 @@ void makeBevelList(Object *ob) while(nr--) { /* Normalizes */ - Vec3ToTangent(vec, &bevp0->x, &bevp1->x, &bevp2->x); + VecBisect3(vec, &bevp0->x, &bevp1->x, &bevp2->x); if(bl->nr==nr+1) { /* first time */ vectoquat(vec, 5, 1, quat); @@ -1976,7 +1976,7 @@ void makeBevelList(Object *ob) nr= bl->nr; while(nr--) { - Vec3ToTangent(vec, &bevp0->x, &bevp1->x, &bevp2->x); + VecBisect3(vec, &bevp0->x, &bevp1->x, &bevp2->x); quat_tmp1= (float *)bevp1->mat; quat_tmp2= quat_tmp1+4; @@ -2014,7 +2014,7 @@ void makeBevelList(Object *ob) if(cu->flag & CU_3D) { /* 3D */ /* Normalizes */ - Vec3ToTangent(vec, &bevp0->x, &bevp1->x, &bevp2->x); + VecBisect3(vec, &bevp0->x, &bevp1->x, &bevp2->x); if(bl->nr==nr+1 || !(cu->flag & CU_NO_TWIST)) { /* first time */ vectoquat(vec, 5, 1, quat); diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h index 63b351016d4..86b626dabdf 100644 --- a/source/blender/blenlib/BLI_arithb.h +++ b/source/blender/blenlib/BLI_arithb.h @@ -270,7 +270,7 @@ void AxisAngleToQuat(float *q, float *axis, float angle); void RotationBetweenVectorsToQuat(float *q, float v1[3], float v2[3]); void vectoquat(float *vec, short axis, short upflag, float *q); -void Vec3ToTangent(float *v, float *v1, float *v2, float *v3); +void VecBisect3(float *v, float *v1, float *v2, float *v3); float VecAngle2(float *v1, float *v2); float VecAngle3(float *v1, float *v2, float *v3); float NormalizedVecAngle2(float *v1, float *v2); diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index 970d8f7d0de..c20794953b9 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -2969,17 +2969,16 @@ void VecRotToQuat( float *vec, float phi, float *quat) } } -/* get a direction from 3 vectors that wont depend - * on the distance between the points */ -void Vec3ToTangent(float *v, float *v1, float *v2, float *v3) +/* Returns a vector bisecting the angle at v2 formed by v1, v2 and v3 */ +void VecBisect3(float *out, float *v1, float *v2, float *v3) { float d_12[3], d_23[3]; VecSubf(d_12, v2, v1); VecSubf(d_23, v3, v2); Normalize(d_12); Normalize(d_23); - VecAddf(v, d_12, d_23); - Normalize(v); + VecAddf(out, d_12, d_23); + Normalize(out); } /* Return the angle in degrees between vecs 1-2 and 2-3 in degrees From 0a3694cd6ebec710da7110e9f168a72d47c71ee0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 6 Sep 2009 01:51:23 +0000 Subject: [PATCH 453/577] white space commit. (2 spaces -> tab). Was annoying to use a different editor for cmake only. theeth says this should be ok with gsoc and merges from branches. --- CMakeLists.txt | 674 +++++++++--------- extern/CMakeLists.txt | 6 +- extern/bullet2/CMakeLists.txt | 20 +- .../src/BulletCollision/CMakeLists.txt | 4 +- .../bullet2/src/BulletSoftBody/CMakeLists.txt | 2 +- extern/glew/CMakeLists.txt | 4 +- intern/CMakeLists.txt | 2 +- intern/audaspace/CMakeLists.txt | 38 +- intern/elbeem/CMakeLists.txt | 4 +- intern/ghost/CMakeLists.txt | 46 +- intern/guardedalloc/CMakeLists.txt | 4 +- intern/smoke/CMakeLists.txt | 6 +- source/CMakeLists.txt | 4 +- source/blender/CMakeLists.txt | 8 +- source/blender/avi/CMakeLists.txt | 4 +- source/blender/blenfont/CMakeLists.txt | 10 +- source/blender/blenkernel/CMakeLists.txt | 46 +- source/blender/blenlib/CMakeLists.txt | 12 +- source/blender/blenloader/CMakeLists.txt | 10 +- source/blender/blenpluginapi/CMakeLists.txt | 6 +- source/blender/editors/CMakeLists.txt | 52 +- source/blender/editors/screen/CMakeLists.txt | 40 +- source/blender/gpu/CMakeLists.txt | 4 +- source/blender/imbuf/CMakeLists.txt | 28 +- .../imbuf/intern/cineon/CMakeLists.txt | 16 +- .../blender/imbuf/intern/dds/CMakeLists.txt | 18 +- .../imbuf/intern/openexr/CMakeLists.txt | 20 +- source/blender/makesdna/intern/CMakeLists.txt | 6 +- source/blender/makesrna/intern/CMakeLists.txt | 42 +- source/blender/nodes/CMakeLists.txt | 26 +- source/blender/python/CMakeLists.txt | 16 +- source/blender/quicktime/CMakeLists.txt | 24 +- source/blender/readblenfile/CMakeLists.txt | 2 +- source/blender/render/CMakeLists.txt | 18 +- source/blender/windowmanager/CMakeLists.txt | 46 +- source/blenderplayer/CMakeLists.txt | 160 ++--- .../bad_level_call_stubs/CMakeLists.txt | 10 +- source/creator/CMakeLists.txt | 586 +++++++-------- .../gameengine/BlenderRoutines/CMakeLists.txt | 68 +- source/gameengine/CMakeLists.txt | 2 +- source/gameengine/Converter/CMakeLists.txt | 68 +- source/gameengine/Expressions/CMakeLists.txt | 14 +- source/gameengine/GameLogic/CMakeLists.txt | 20 +- source/gameengine/GamePlayer/CMakeLists.txt | 2 +- .../GamePlayer/common/CMakeLists.txt | 82 +-- .../GamePlayer/ghost/CMakeLists.txt | 74 +- source/gameengine/Ketsji/CMakeLists.txt | 70 +- .../Ketsji/KXNetwork/CMakeLists.txt | 20 +- source/gameengine/Network/CMakeLists.txt | 8 +- .../Network/LoopBackNetwork/CMakeLists.txt | 8 +- .../gameengine/Physics/Bullet/CMakeLists.txt | 34 +- .../gameengine/Physics/Dummy/CMakeLists.txt | 4 +- .../gameengine/Physics/common/CMakeLists.txt | 6 +- source/gameengine/Rasterizer/CMakeLists.txt | 18 +- .../RAS_OpenGLRasterizer/CMakeLists.txt | 24 +- source/gameengine/SceneGraph/CMakeLists.txt | 4 +- source/gameengine/VideoTexture/CMakeLists.txt | 50 +- source/kernel/CMakeLists.txt | 10 +- 58 files changed, 1305 insertions(+), 1305 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5000ecfac5c..7196049f964 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,11 +34,11 @@ IF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) MESSAGE(FATAL_ERROR "CMake generation for blender is not allowed within the source directory! Remove the CMakeCache.txt file and try again from another folder, e.g.: - rm CMakeCache.txt - cd .. - mkdir cmake-make - cd cmake-make - cmake -G \"Unix Makefiles\" ../blender + rm CMakeCache.txt + cd .. + mkdir cmake-make + cd cmake-make + cmake -G \"Unix Makefiles\" ../blender ") ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) @@ -76,7 +76,7 @@ OPTION(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation" OFF OPTION(WITH_INSTALL "Install accompanying scripts and language files needed to run blender" ON) IF(NOT WITH_GAMEENGINE AND WITH_PLAYER) - MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE") + MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE") ENDIF(NOT WITH_GAMEENGINE AND WITH_PLAYER) # For alternate Python locations the commandline can be used to override detected/default cache settings, e.g: @@ -95,421 +95,421 @@ INCLUDE(CMake/macros.cmake) #Platform specifics IF(UNIX AND NOT APPLE) - IF(WITH_OPENAL) - FIND_PACKAGE(OpenAL) - IF(OPENAL_FOUND) - SET(WITH_OPENAL ON) - ELSE(OPENAL_FOUND) - SET(WITH_OPENAL OFF) - ENDIF(OPENAL_FOUND) - ENDIF(WITH_OPENAL) + IF(WITH_OPENAL) + FIND_PACKAGE(OpenAL) + IF(OPENAL_FOUND) + SET(WITH_OPENAL ON) + ELSE(OPENAL_FOUND) + SET(WITH_OPENAL OFF) + ENDIF(OPENAL_FOUND) + ENDIF(WITH_OPENAL) - IF(WITH_JACK) - SET(JACK /usr) - SET(JACK_INC ${JACK}/include/jack) - SET(JACK_LIB jack) - SET(JACK_LIBPATH ${JACK}/lib) - ENDIF(WITH_JACK) + IF(WITH_JACK) + SET(JACK /usr) + SET(JACK_INC ${JACK}/include/jack) + SET(JACK_LIB jack) + SET(JACK_LIBPATH ${JACK}/lib) + ENDIF(WITH_JACK) - IF(WITH_SNDFILE) + IF(WITH_SNDFILE) SET(SNDFILE /usr) SET(SNDFILE_INC ${SNDFILE}/include) SET(SNDFILE_LIB sndfile) SET(SNDFILE_LIBPATH ${SNDFILE}/lib) - ENDIF(WITH_SNDFILE) + ENDIF(WITH_SNDFILE) - FIND_LIBRARY(INTL_LIBRARY - NAMES intl - PATHS - /sw/lib - ) - FIND_LIBRARY(ICONV_LIBRARY - NAMES iconv - PATHS - /sw/lib - ) + FIND_LIBRARY(INTL_LIBRARY + NAMES intl + PATHS + /sw/lib + ) + FIND_LIBRARY(ICONV_LIBRARY + NAMES iconv + PATHS + /sw/lib + ) - IF(INTL_LIBRARY AND ICONV_LIBRARY) - SET(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY}) - ENDIF(INTL_LIBRARY AND ICONV_LIBRARY) + IF(INTL_LIBRARY AND ICONV_LIBRARY) + SET(GETTEXT_LIB ${INTL_LIBRARY} ${ICONV_LIBRARY}) + ENDIF(INTL_LIBRARY AND ICONV_LIBRARY) - FIND_PACKAGE(Freetype) - # UNSET(FREETYPE_INCLUDE_DIRS CACHE) # cant use + FIND_PACKAGE(Freetype) + # UNSET(FREETYPE_INCLUDE_DIRS CACHE) # cant use - # No way to set py31. remove for now. - # FIND_PACKAGE(PythonLibs) - SET(PYTHON /usr) - SET(PYTHON_VERSION 3.1) - SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "") - # SET(PYTHON_BINARY python) # not used yet - SET(PYTHON_LIB python${PYTHON_VERSION} CACHE STRING "") - SET(PYTHON_LIBPATH ${PYTHON}/lib CACHE STRING "") + # No way to set py31. remove for now. + # FIND_PACKAGE(PythonLibs) + SET(PYTHON /usr) + SET(PYTHON_VERSION 3.1) + SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "") + # SET(PYTHON_BINARY python) # not used yet + SET(PYTHON_LIB python${PYTHON_VERSION} CACHE STRING "") + SET(PYTHON_LIBPATH ${PYTHON}/lib CACHE STRING "") - # FIND_PACKAGE(PythonInterp) # not used yet - # SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "") + # FIND_PACKAGE(PythonInterp) # not used yet + # SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "") - SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic") + SET(PYTHON_LINKFLAGS "-Xlinker -export-dynamic") - IF(WITH_SDL) - FIND_PACKAGE(SDL) - # UNSET(SDLMAIN_LIBRARY CACHE) - IF(NOT SDL_FOUND) - SET(WITH_SDL OFF) - ENDIF(NOT SDL_FOUND) - ENDIF(WITH_SDL) + IF(WITH_SDL) + FIND_PACKAGE(SDL) + # UNSET(SDLMAIN_LIBRARY CACHE) + IF(NOT SDL_FOUND) + SET(WITH_SDL OFF) + ENDIF(NOT SDL_FOUND) + ENDIF(WITH_SDL) - FIND_PATH(OPENEXR_INC - ImfXdr.h - PATHS - /usr/local/include/OpenEXR - /usr/include/OpenEXR - /sw/include/OpenEXR - /opt/local/include/OpenEXR - /opt/csw/include/OpenEXR - /opt/include/OpenEXR - ) - SET(OPENEXR_LIB Half IlmImf Iex Imath) + FIND_PATH(OPENEXR_INC + ImfXdr.h + PATHS + /usr/local/include/OpenEXR + /usr/include/OpenEXR + /sw/include/OpenEXR + /opt/local/include/OpenEXR + /opt/csw/include/OpenEXR + /opt/include/OpenEXR + ) + SET(OPENEXR_LIB Half IlmImf Iex Imath) - SET(FFMPEG /usr) - SET(FFMPEG_INC ${FFMPEG}/include) - SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale) - SET(FFMPEG_LIBPATH ${FFMPEG}/lib) + SET(FFMPEG /usr) + SET(FFMPEG_INC ${FFMPEG}/include) + SET(FFMPEG_LIB avformat avcodec avutil avdevice swscale) + SET(FFMPEG_LIBPATH ${FFMPEG}/lib) - IF(WITH_FFTW3) - SET(FFTW3 /usr) - SET(FFTW3_INC ${FFTW3}/include) - SET(FFTW3_LIB fftw3) - SET(FFTW3_LIBPATH ${FFTW3}/lib) - ENDIF(WITH_FFTW3) + IF(WITH_FFTW3) + SET(FFTW3 /usr) + SET(FFTW3_INC ${FFTW3}/include) + SET(FFTW3_LIB fftw3) + SET(FFTW3_LIBPATH ${FFTW3}/lib) + ENDIF(WITH_FFTW3) - SET(LIBSAMPLERATE /usr) - SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include) - SET(LIBSAMPLERATE_LIB samplerate) - SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib) + SET(LIBSAMPLERATE /usr) + SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include) + SET(LIBSAMPLERATE_LIB samplerate) + SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib) - FIND_PACKAGE(JPEG REQUIRED) + FIND_PACKAGE(JPEG REQUIRED) - FIND_PACKAGE(PNG REQUIRED) + FIND_PACKAGE(PNG REQUIRED) - FIND_PACKAGE(ZLIB REQUIRED) + FIND_PACKAGE(ZLIB REQUIRED) - # Could use ${X11_Xinput_LIB} ${X11_X11_LIB} too - SET(LLIBS "-lXi -lutil -lc -lm -lpthread -lstdc++ -lX11") + # Could use ${X11_Xinput_LIB} ${X11_X11_LIB} too + SET(LLIBS "-lXi -lutil -lc -lm -lpthread -lstdc++ -lX11") - IF(CMAKE_SYSTEM_NAME MATCHES "Linux") - # BSD's dont use libdl.so - SET(LLIBS "${LLIBS} -ldl") - ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") + IF(CMAKE_SYSTEM_NAME MATCHES "Linux") + # BSD's dont use libdl.so + SET(LLIBS "${LLIBS} -ldl") + ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") - IF(WITH_OPENMP) - SET(LLIBS "${LLIBS} -lgomp") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp") - ENDIF(WITH_OPENMP) + IF(WITH_OPENMP) + SET(LLIBS "${LLIBS} -lgomp") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp") + ENDIF(WITH_OPENMP) - SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing -DXP_UNIX -Wno-char-subscripts") + SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing -DXP_UNIX -Wno-char-subscripts") - SET(PLATFORM_LINKFLAGS "-pthread") + SET(PLATFORM_LINKFLAGS "-pthread") - # Better warnings - SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wdeclaration-after-statement") - SET(CXX_WARNINGS "-Wall -Wno-invalid-offsetof -Wno-sign-compare") + # Better warnings + SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wdeclaration-after-statement") + SET(CXX_WARNINGS "-Wall -Wno-invalid-offsetof -Wno-sign-compare") - INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ) + INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ) ENDIF(UNIX AND NOT APPLE) IF(WIN32) - # this file is included anyway when building under Windows with cl.exe - # INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake) + # this file is included anyway when building under Windows with cl.exe + # INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake) - SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows) + SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/windows) - # Setup 64bit and 64bit windows systems - IF(CMAKE_CL_64) - message("64 bit compiler detected.") - SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64) - ENDIF(CMAKE_CL_64) + # Setup 64bit and 64bit windows systems + IF(CMAKE_CL_64) + message("64 bit compiler detected.") + SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/win64) + ENDIF(CMAKE_CL_64) - SET(PYTHON ${LIBDIR}/python) - SET(PYTHON_VERSION 3.1) - SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}") - # SET(PYTHON_BINARY python) # not used yet - SET(PYTHON_LIB python31) - SET(PYTHON_LIBPATH ${PYTHON}/lib) + SET(PYTHON ${LIBDIR}/python) + SET(PYTHON_VERSION 3.1) + SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}") + # SET(PYTHON_BINARY python) # not used yet + SET(PYTHON_LIB python31) + SET(PYTHON_LIBPATH ${PYTHON}/lib) - IF(CMAKE_CL_64) - SET(WITH_OPENAL OFF) - ELSE(CMAKE_CL_64) - #SET(WITH_OPENAL ON) - SET(OPENAL ${LIBDIR}/openal) - SET(OPENAL_INCLUDE_DIR ${OPENAL}/include) - SET(OPENAL_LIBRARY wrap_oal) - SET(OPENAL_LIBPATH ${OPENAL}/lib) - ENDIF(CMAKE_CL_64) + IF(CMAKE_CL_64) + SET(WITH_OPENAL OFF) + ELSE(CMAKE_CL_64) + #SET(WITH_OPENAL ON) + SET(OPENAL ${LIBDIR}/openal) + SET(OPENAL_INCLUDE_DIR ${OPENAL}/include) + SET(OPENAL_LIBRARY wrap_oal) + SET(OPENAL_LIBPATH ${OPENAL}/lib) + ENDIF(CMAKE_CL_64) - IF(WITH_JACK) - SET(JACK ${LIBDIR}/jack) - SET(JACK_INC ${JACK}/include/jack ${JACK}/include) - SET(JACK_LIB libjack) - SET(JACK_LIBPATH ${JACK}/lib) - ENDIF(WITH_JACK) + IF(WITH_JACK) + SET(JACK ${LIBDIR}/jack) + SET(JACK_INC ${JACK}/include/jack ${JACK}/include) + SET(JACK_LIB libjack) + SET(JACK_LIBPATH ${JACK}/lib) + ENDIF(WITH_JACK) - IF(WITH_SNDFILE) - SET(SNDFILE ${LIBDIR}/sndfile) - SET(SNDFILE_INC ${SNDFILE}/include) - SET(SNDFILE_LIB libsndfile-1) - SET(SNDFILE_LIBPATH ${SNDFILE}/lib) - ENDIF(WITH_SNDFILE) + IF(WITH_SNDFILE) + SET(SNDFILE ${LIBDIR}/sndfile) + SET(SNDFILE_INC ${SNDFILE}/include) + SET(SNDFILE_LIB libsndfile-1) + SET(SNDFILE_LIBPATH ${SNDFILE}/lib) + ENDIF(WITH_SNDFILE) - IF(CMAKE_CL_64) - SET(PNG_LIBRARIES libpng) - ELSE(CMAKE_CL_64) - SET(PNG_LIBRARIES libpng_st) - ENDIF(CMAKE_CL_64) - SET(JPEG_LIBRARY libjpeg) + IF(CMAKE_CL_64) + SET(PNG_LIBRARIES libpng) + ELSE(CMAKE_CL_64) + SET(PNG_LIBRARIES libpng_st) + ENDIF(CMAKE_CL_64) + SET(JPEG_LIBRARY libjpeg) - SET(ZLIB ${LIBDIR}/zlib) - SET(ZLIB_INC ${ZLIB}/include) - IF(CMAKE_CL_64) - SET(ZLIB_LIBRARIES libz) - ELSE(CMAKE_CL_64) - SET(ZLIB_LIBRARIES zlib) - ENDIF(CMAKE_CL_64) - SET(ZLIB_LIBPATH ${ZLIB}/lib) + SET(ZLIB ${LIBDIR}/zlib) + SET(ZLIB_INC ${ZLIB}/include) + IF(CMAKE_CL_64) + SET(ZLIB_LIBRARIES libz) + ELSE(CMAKE_CL_64) + SET(ZLIB_LIBRARIES zlib) + ENDIF(CMAKE_CL_64) + SET(ZLIB_LIBPATH ${ZLIB}/lib) - SET(PTHREADS ${LIBDIR}/pthreads) - SET(PTHREADS_INC ${PTHREADS}/include) - SET(PTHREADS_LIB pthreadVC2) - SET(PTHREADS_LIBPATH ${PTHREADS}/lib) + SET(PTHREADS ${LIBDIR}/pthreads) + SET(PTHREADS_INC ${PTHREADS}/include) + SET(PTHREADS_LIB pthreadVC2) + SET(PTHREADS_LIBPATH ${PTHREADS}/lib) - SET(ICONV ${LIBDIR}/iconv) - SET(ICONV_INC ${ICONV}/include) - SET(ICONV_LIB iconv) - SET(ICONV_LIBPATH ${ICONV}/lib) + SET(ICONV ${LIBDIR}/iconv) + SET(ICONV_INC ${ICONV}/include) + SET(ICONV_LIB iconv) + SET(ICONV_LIBPATH ${ICONV}/lib) - IF(WITH_FFTW3) - SET(FFTW3 ${LIBDIR}/fftw3) - SET(FFTW3_INC ${FFTW3}/include) - SET(FFTW3_LIB libfftw) - SET(FFTW3_LIBPATH ${FFTW3}/lib) - ENDIF(WITH_FFTW3) + IF(WITH_FFTW3) + SET(FFTW3 ${LIBDIR}/fftw3) + SET(FFTW3_INC ${FFTW3}/include) + SET(FFTW3_LIB libfftw) + SET(FFTW3_LIBPATH ${FFTW3}/lib) + ENDIF(WITH_FFTW3) - SET(GETTEXT ${LIBDIR}/gettext) - SET(GETTEXT_INC ${GETTEXT}/include) - IF(CMAKE_CL_64) - SET(GETTEXT_LIB gettext) - ELSE(CMAKE_CL_64) - SET(GETTEXT_LIB gnu_gettext) - ENDIF(CMAKE_CL_64) - SET(GETTEXT_LIBPATH ${GETTEXT}/lib) + SET(GETTEXT ${LIBDIR}/gettext) + SET(GETTEXT_INC ${GETTEXT}/include) + IF(CMAKE_CL_64) + SET(GETTEXT_LIB gettext) + ELSE(CMAKE_CL_64) + SET(GETTEXT_LIB gnu_gettext) + ENDIF(CMAKE_CL_64) + SET(GETTEXT_LIBPATH ${GETTEXT}/lib) - SET(FREETYPE ${LIBDIR}/freetype) - SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2) - SET(FREETYPE_LIBPATH ${FREETYPE}/lib) - SET(FREETYPE_LIBRARY freetype2ST) + SET(FREETYPE ${LIBDIR}/freetype) + SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2) + SET(FREETYPE_LIBPATH ${FREETYPE}/lib) + SET(FREETYPE_LIBRARY freetype2ST) - SET(OPENEXR ${LIBDIR}/openexr) - SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/IlmImf ${OPENEXR}/include/Iex ${OPENEXR}/include/Imath) - SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread) - IF (MSVC80) - SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005) - ELSE (MSVC80) - SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc) - ENDIF(MSVC80) - IF (MSVC90) - SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008) - ENDIF(MSVC90) + SET(OPENEXR ${LIBDIR}/openexr) + SET(OPENEXR_INC ${OPENEXR}/include ${OPENEXR}/include/IlmImf ${OPENEXR}/include/Iex ${OPENEXR}/include/Imath) + SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread) + IF (MSVC80) + SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2005) + ELSE (MSVC80) + SET(OPENEXR_LIBPATH ${OPENEXR}/lib_msvc) + ENDIF(MSVC80) + IF (MSVC90) + SET(OPENEXR_LIBPATH ${OPENEXR}/lib_vs2008) + ENDIF(MSVC90) - SET(QUICKTIME ${LIBDIR}/QTDevWin) - SET(QUICKTIME_INC ${QUICKTIME}/CIncludes) - SET(QUICKTIME_LIB qtmlClient) - SET(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries) + SET(QUICKTIME ${LIBDIR}/QTDevWin) + SET(QUICKTIME_INC ${QUICKTIME}/CIncludes) + SET(QUICKTIME_LIB qtmlClient) + SET(QUICKTIME_LIBPATH ${QUICKTIME}/Libraries) - SET(FFMPEG ${LIBDIR}/ffmpeg) - SET(FFMPEG_INC ${FFMPEG}/include ${FFMPEG}/include/msvc) - SET(FFMPEG_LIB avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0) - SET(FFMPEG_LIBPATH ${FFMPEG}/lib) + SET(FFMPEG ${LIBDIR}/ffmpeg) + SET(FFMPEG_INC ${FFMPEG}/include ${FFMPEG}/include/msvc) + SET(FFMPEG_LIB avcodec-52 avformat-52 avdevice-52 avutil-50 swscale-0) + SET(FFMPEG_LIBPATH ${FFMPEG}/lib) - SET(LIBSAMPLERATE ${LIBDIR}/samplerate) - SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include) - SET(LIBSAMPLERATE_LIB libsamplerate) - SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib) + SET(LIBSAMPLERATE ${LIBDIR}/samplerate) + SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include) + SET(LIBSAMPLERATE_LIB libsamplerate) + SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib) - IF(CMAKE_CL_64) - SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 ) - ELSE(CMAKE_CL_64) - SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm) - ENDIF(CMAKE_CL_64) + IF(CMAKE_CL_64) + SET(LLIBS kernel32 user32 vfw32 winmm ws2_32 ) + ELSE(CMAKE_CL_64) + SET(LLIBS kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid ws2_32 vfw32 winmm) + ENDIF(CMAKE_CL_64) - SET(CMAKE_CXX_FLAGS_DEBUG "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE) - SET(CMAKE_CXX_FLAGS_RELEASE "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE) - SET(CMAKE_CXX_FLAGS_MINSIZEREL "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O1 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE) - SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE) - SET(CMAKE_C_FLAGS_DEBUG "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE) - SET(CMAKE_C_FLAGS_RELEASE "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE) - SET(CMAKE_C_FLAGS_MINSIZEREL "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O1 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE) - SET(CMAKE_C_FLAGS_RELWITHDEBINFO "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE) + SET(CMAKE_CXX_FLAGS_DEBUG "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE) + SET(CMAKE_CXX_FLAGS_RELEASE "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE) + SET(CMAKE_CXX_FLAGS_MINSIZEREL "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O1 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE) + SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE) + SET(CMAKE_C_FLAGS_DEBUG "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /D_DEBUG /Od /Gm /EHsc /RTC1 /MTd /W3 /nologo /ZI /J" CACHE STRING "MSVC MT flags " FORCE) + SET(CMAKE_C_FLAGS_RELEASE "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob2 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE) + SET(CMAKE_C_FLAGS_MINSIZEREL "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O1 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /J" CACHE STRING "MSVC MT flags " FORCE) + SET(CMAKE_C_FLAGS_RELWITHDEBINFO "/D_CRT_NONSTDC_NO_DEPRECATE /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /wd4800 /wd4244 /wd4305 /O2 /Ob1 /DNDEBUG /EHsc /MT /W3 /nologo /Zi /J" CACHE STRING "MSVC MT flags " FORCE) - IF(WITH_OPENMP) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /openmp ") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp ") - ENDIF(WITH_OPENMP) + IF(WITH_OPENMP) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /openmp ") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /openmp ") + ENDIF(WITH_OPENMP) - SET(SDL ${LIBDIR}/sdl) - SET(SDL_INCLUDE_DIR ${SDL}/include) - SET(SDL_LIBRARY SDL) - SET(SDL_LIBPATH ${SDL}/lib) + SET(SDL ${LIBDIR}/sdl) + SET(SDL_INCLUDE_DIR ${SDL}/include) + SET(SDL_LIBRARY SDL) + SET(SDL_LIBPATH ${SDL}/lib) - SET(PNG "${LIBDIR}/png") - SET(PNG_INC "${PNG}/include") - SET(PNG_LIBPATH ${PNG}/lib) + SET(PNG "${LIBDIR}/png") + SET(PNG_INC "${PNG}/include") + SET(PNG_LIBPATH ${PNG}/lib) - SET(JPEG "${LIBDIR}/jpeg") - SET(JPEG_INC "${JPEG}/include") - SET(JPEG_LIBPATH ${JPEG}/lib) + SET(JPEG "${LIBDIR}/jpeg") + SET(JPEG_INC "${JPEG}/include") + SET(JPEG_LIBPATH ${JPEG}/lib) - SET(TIFF ${LIBDIR}/tiff) - SET(TIFF_INC ${TIFF}/include) + SET(TIFF ${LIBDIR}/tiff) + SET(TIFF_INC ${TIFF}/include) - SET(WINTAB_INC ${LIBDIR}/wintab/include) + SET(WINTAB_INC ${LIBDIR}/wintab/include) - IF(CMAKE_CL_64) - SET(PLATFORM_LINKFLAGS "/MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ") - ELSE(CMAKE_CL_64) - SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ") - ENDIF(CMAKE_CL_64) + IF(CMAKE_CL_64) + SET(PLATFORM_LINKFLAGS "/MACHINE:X64 /NODEFAULTLIB:libc.lib;MSVCRT.lib ") + ELSE(CMAKE_CL_64) + SET(PLATFORM_LINKFLAGS "/NODEFAULTLIB:libc.lib ") + ENDIF(CMAKE_CL_64) - SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ") + SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ") ENDIF(WIN32) IF(APPLE) - IF(CMAKE_OSX_ARCHITECTURES MATCHES i386) - SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.x.i386) - ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386) - SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-6.1-powerpc) - ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386) + IF(CMAKE_OSX_ARCHITECTURES MATCHES i386) + SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-8.x.i386) + ELSE(CMAKE_OSX_ARCHITECTURES MATCHES i386) + SET(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/darwin-6.1-powerpc) + ENDIF(CMAKE_OSX_ARCHITECTURES MATCHES i386) - IF(WITH_OPENAL) - FIND_PACKAGE(OpenAL) - IF(OPENAL_FOUND) - SET(WITH_OPENAL ON) - ELSE(OPENAL_FOUND) - SET(WITH_OPENAL OFF) - ENDIF(OPENAL_FOUND) - ENDIF(WITH_OPENAL) + IF(WITH_OPENAL) + FIND_PACKAGE(OpenAL) + IF(OPENAL_FOUND) + SET(WITH_OPENAL ON) + ELSE(OPENAL_FOUND) + SET(WITH_OPENAL OFF) + ENDIF(OPENAL_FOUND) + ENDIF(WITH_OPENAL) - IF(WITH_JACK) - SET(JACK /usr) - SET(JACK_INC ${JACK}/include/jack) - SET(JACK_LIB jack) - SET(JACK_LIBPATH ${JACK}/lib) - ENDIF(WITH_JACK) + IF(WITH_JACK) + SET(JACK /usr) + SET(JACK_INC ${JACK}/include/jack) + SET(JACK_LIB jack) + SET(JACK_LIBPATH ${JACK}/lib) + ENDIF(WITH_JACK) - IF(WITH_SNDFILE) - SET(SNDFILE /usr) - SET(SNDFILE_INC ${SNDFILE}/include) - SET(SNDFILE_LIB sndfile) - SET(SNDFILE_LIBPATH ${SNDFILE}/lib) - ENDIF(WITH_SNDFILE) + IF(WITH_SNDFILE) + SET(SNDFILE /usr) + SET(SNDFILE_INC ${SNDFILE}/include) + SET(SNDFILE_LIB sndfile) + SET(SNDFILE_LIBPATH ${SNDFILE}/lib) + ENDIF(WITH_SNDFILE) - SET(PYTHON_VERSION 3.1) + SET(PYTHON_VERSION 3.1) - IF(PYTHON_VERSION MATCHES 3.1) - # we use precompiled libraries for py 3.1 and up by default + IF(PYTHON_VERSION MATCHES 3.1) + # we use precompiled libraries for py 3.1 and up by default - SET(PYTHON ${LIBDIR}/python) - SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "") - # SET(PYTHON_BINARY "${PYTHON}/bin/python${PYTHON_VERSION}" CACHE STRING "") # not used yet - SET(PYTHON_LIB python${PYTHON_VERSION}) - SET(PYTHON_LIBPATH "${PYTHON}/lib/python${PYTHON_VERSION}" CACHE STRING "") - # SET(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled - ELSE(PYTHON_VERSION MATCHES 3.1) - # otherwise, use custom system framework + SET(PYTHON ${LIBDIR}/python) + SET(PYTHON_INC "${PYTHON}/include/python${PYTHON_VERSION}" CACHE STRING "") + # SET(PYTHON_BINARY "${PYTHON}/bin/python${PYTHON_VERSION}" CACHE STRING "") # not used yet + SET(PYTHON_LIB python${PYTHON_VERSION}) + SET(PYTHON_LIBPATH "${PYTHON}/lib/python${PYTHON_VERSION}" CACHE STRING "") + # SET(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled + ELSE(PYTHON_VERSION MATCHES 3.1) + # otherwise, use custom system framework - SET(PYTHON /System/Library/Frameworks/Python.framework/Versions/) - SET(PYTHON_VERSION 2.5) - SET(PYTHON_INC "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}" CACHE STRING "") - # SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION} CACHE STRING "") # not used yet - SET(PYTHON_LIB "") - SET(PYTHON_LIBPATH ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config CACHE STRING "") - SET(PYTHON_LINKFLAGS "-u _PyMac_Error -framework System -framework Python") - ENDIF(PYTHON_VERSION MATCHES 3.1) + SET(PYTHON /System/Library/Frameworks/Python.framework/Versions/) + SET(PYTHON_VERSION 2.5) + SET(PYTHON_INC "${PYTHON}${PYTHON_VERSION}/include/python${PYTHON_VERSION}" CACHE STRING "") + # SET(PYTHON_BINARY ${PYTHON}${PYTHON_VERSION}/bin/python${PYTHON_VERSION} CACHE STRING "") # not used yet + SET(PYTHON_LIB "") + SET(PYTHON_LIBPATH ${PYTHON}${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config CACHE STRING "") + SET(PYTHON_LINKFLAGS "-u _PyMac_Error -framework System -framework Python") + ENDIF(PYTHON_VERSION MATCHES 3.1) - SET(GETTEXT ${LIBDIR}/gettext) - SET(GETTEXT_INC "${GETTEXT}/include") - SET(GETTEXT_LIB intl iconv) - SET(GETTEXT_LIBPATH ${GETTEXT}/lib) + SET(GETTEXT ${LIBDIR}/gettext) + SET(GETTEXT_INC "${GETTEXT}/include") + SET(GETTEXT_LIB intl iconv) + SET(GETTEXT_LIBPATH ${GETTEXT}/lib) - IF(WITH_FFTW3) - SET(FFTW3 ${LIBDIR}/fftw3) - SET(FFTW3_INC ${FFTW3}/include) - SET(FFTW3_LIB libfftw) - SET(FFTW3_LIBPATH ${FFTW3}/lib) - ENDIF(WITH_FFTW3) + IF(WITH_FFTW3) + SET(FFTW3 ${LIBDIR}/fftw3) + SET(FFTW3_INC ${FFTW3}/include) + SET(FFTW3_LIB libfftw) + SET(FFTW3_LIBPATH ${FFTW3}/lib) + ENDIF(WITH_FFTW3) - SET(PNG_LIBRARIES png) - SET(JPEG_LIBRARY jpeg) + SET(PNG_LIBRARIES png) + SET(JPEG_LIBRARY jpeg) - SET(ZLIB /usr) - SET(ZLIB_INC "${ZLIB}/include") - SET(ZLIB_LIBRARIES z) + SET(ZLIB /usr) + SET(ZLIB_INC "${ZLIB}/include") + SET(ZLIB_LIBRARIES z) - SET(FREETYPE ${LIBDIR}/freetype) - SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2) - SET(FREETYPE_LIBPATH ${FREETYPE}/lib) - SET(FREETYPE_LIBRARY freetype) + SET(FREETYPE ${LIBDIR}/freetype) + SET(FREETYPE_INCLUDE_DIRS ${FREETYPE}/include ${FREETYPE}/include/freetype2) + SET(FREETYPE_LIBPATH ${FREETYPE}/lib) + SET(FREETYPE_LIBRARY freetype) - SET(OPENEXR ${LIBDIR}/openexr) - SET(OPENEXR_INC ${OPENEXR}/include/OpenEXR ${OPENEXR}/include) - SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread) - SET(OPENEXR_LIBPATH ${OPENEXR}/lib) + SET(OPENEXR ${LIBDIR}/openexr) + SET(OPENEXR_INC ${OPENEXR}/include/OpenEXR ${OPENEXR}/include) + SET(OPENEXR_LIB Iex Half IlmImf Imath IlmThread) + SET(OPENEXR_LIBPATH ${OPENEXR}/lib) - SET(FFMPEG ${LIBDIR}/ffmpeg) - SET(FFMPEG_INC ${CMAKE_SOURCE_DIR}/extern/ffmpeg) - SET(FFMPEG_LIB avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore) - SET(FFMPEG_LIBPATH ${FFMPEG}/lib) + SET(FFMPEG ${LIBDIR}/ffmpeg) + SET(FFMPEG_INC ${CMAKE_SOURCE_DIR}/extern/ffmpeg) + SET(FFMPEG_LIB avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore) + SET(FFMPEG_LIBPATH ${FFMPEG}/lib) - SET(LIBSAMPLERATE ${LIBDIR}/samplerate) - SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include) - SET(LIBSAMPLERATE_LIB samplerate) - SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib) + SET(LIBSAMPLERATE ${LIBDIR}/samplerate) + SET(LIBSAMPLERATE_INC ${LIBSAMPLERATE}/include) + SET(LIBSAMPLERATE_LIB samplerate) + SET(LIBSAMPLERATE_LIBPATH ${LIBSAMPLERATE}/lib) - SET(LLIBS stdc++ SystemStubs) + SET(LLIBS stdc++ SystemStubs) - SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing") - SET(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime") + SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing") + SET(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime") - IF(WITH_OPENMP) - SET(LLIBS "${LLIBS} -lgomp ") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp ") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp ") - ENDIF(WITH_OPENMP) + IF(WITH_OPENMP) + SET(LLIBS "${LLIBS} -lgomp ") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp ") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp ") + ENDIF(WITH_OPENMP) - SET(SDL ${LIBDIR}/sdl) - SET(SDL_INCLUDE_DIR ${SDL}/include) - SET(SDL_LIBRARY SDL) - SET(SDL_LIBPATH ${SDL}/lib) + SET(SDL ${LIBDIR}/sdl) + SET(SDL_INCLUDE_DIR ${SDL}/include) + SET(SDL_LIBRARY SDL) + SET(SDL_LIBPATH ${SDL}/lib) - SET(PNG "${LIBDIR}/png") - SET(PNG_INC "${PNG}/include") - SET(PNG_LIBPATH ${PNG}/lib) + SET(PNG "${LIBDIR}/png") + SET(PNG_INC "${PNG}/include") + SET(PNG_LIBPATH ${PNG}/lib) - SET(JPEG "${LIBDIR}/jpeg") - SET(JPEG_INC "${JPEG}/include") - SET(JPEG_LIBPATH ${JPEG}/lib) + SET(JPEG "${LIBDIR}/jpeg") + SET(JPEG_INC "${JPEG}/include") + SET(JPEG_LIBPATH ${JPEG}/lib) - SET(TIFF ${LIBDIR}/tiff) - SET(TIFF_INC ${TIFF}/include) + SET(TIFF ${LIBDIR}/tiff) + SET(TIFF_INC ${TIFF}/include) - SET(EXETYPE MACOSX_BUNDLE) + SET(EXETYPE MACOSX_BUNDLE) ENDIF(APPLE) IF(CMAKE_SYSTEM_NAME MATCHES "Linux") - SET(BINRELOC ${CMAKE_SOURCE_DIR}/extern/binreloc) - SET(BINRELOC_INC ${BINRELOC}/include) + SET(BINRELOC ${CMAKE_SOURCE_DIR}/extern/binreloc) + SET(BINRELOC_INC ${BINRELOC}/include) ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") @@ -534,10 +534,10 @@ set(OPENJPEG_LIb extern_libopenjpeg) # Blender WebPlugin IF(WITH_WEBPLUGIN) - SET(GECKO_DIR "${CMAKE_SOURCE_DIR}/../gecko-sdk/" CACHE PATH "Gecko SDK path") - SET(WEBPLUGIN_SANDBOX_MODE "apparmor" CACHE STRING "WEB Plugin sandbox mode, can be apparmor, privsep, none") + SET(GECKO_DIR "${CMAKE_SOURCE_DIR}/../gecko-sdk/" CACHE PATH "Gecko SDK path") + SET(WEBPLUGIN_SANDBOX_MODE "apparmor" CACHE STRING "WEB Plugin sandbox mode, can be apparmor, privsep, none") - SET(WITH_PLAYER ON) + SET(WITH_PLAYER ON) ENDIF(WITH_WEBPLUGIN) @@ -555,7 +555,7 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ${CXX_WARNINGS}") # better not define flags here but this is a debugging option thats off by default. IF(WITH_CXX_GUARDEDALLOC) - SET(CMAKE_CXX_FLAGS " -DWITH_CXX_GUARDEDALLOC -I${CMAKE_SOURCE_DIR}/intern/guardedalloc ${CMAKE_CXX_FLAGS}") + SET(CMAKE_CXX_FLAGS " -DWITH_CXX_GUARDEDALLOC -I${CMAKE_SOURCE_DIR}/intern/guardedalloc ${CMAKE_CXX_FLAGS}") ENDIF(WITH_CXX_GUARDEDALLOC) #----------------------------------------------------------------------------- @@ -574,6 +574,6 @@ ADD_SUBDIRECTORY(source/creator) #----------------------------------------------------------------------------- # Blender Player IF(WITH_PLAYER) - ADD_SUBDIRECTORY(source/blenderplayer) + ADD_SUBDIRECTORY(source/blenderplayer) ENDIF(WITH_PLAYER) diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 019cd9de28b..44e47aaf88d 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -25,17 +25,17 @@ # ***** END GPL LICENSE BLOCK ***** IF(WITH_BULLET) - ADD_SUBDIRECTORY(bullet2) + ADD_SUBDIRECTORY(bullet2) ENDIF(WITH_BULLET) IF(CMAKE_SYSTEM_NAME MATCHES "Linux") - ADD_SUBDIRECTORY(binreloc) + ADD_SUBDIRECTORY(binreloc) ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") ADD_SUBDIRECTORY(glew) IF(WITH_OPENJPEG) - ADD_SUBDIRECTORY(libopenjpeg) + ADD_SUBDIRECTORY(libopenjpeg) ENDIF(WITH_OPENJPEG) ADD_SUBDIRECTORY(lzo) diff --git a/extern/bullet2/CMakeLists.txt b/extern/bullet2/CMakeLists.txt index edb6b9c525f..2e2d8920781 100644 --- a/extern/bullet2/CMakeLists.txt +++ b/extern/bullet2/CMakeLists.txt @@ -27,16 +27,16 @@ SET(INC . src) FILE(GLOB SRC - src/LinearMath/*.cpp - src/BulletCollision/BroadphaseCollision/*.cpp - src/BulletCollision/CollisionShapes/*.cpp - src/BulletCollision/NarrowPhaseCollision/*.cpp - src/BulletCollision/Gimpact/*.cpp - src/BulletCollision//CollisionDispatch/*.cpp - src/BulletDynamics/ConstraintSolver/*.cpp - src/BulletDynamics/Vehicle/*.cpp - src/BulletDynamics/Dynamics/*.cpp - src/BulletSoftBody/*.cpp + src/LinearMath/*.cpp + src/BulletCollision/BroadphaseCollision/*.cpp + src/BulletCollision/CollisionShapes/*.cpp + src/BulletCollision/NarrowPhaseCollision/*.cpp + src/BulletCollision/Gimpact/*.cpp + src/BulletCollision//CollisionDispatch/*.cpp + src/BulletDynamics/ConstraintSolver/*.cpp + src/BulletDynamics/Vehicle/*.cpp + src/BulletDynamics/Dynamics/*.cpp + src/BulletSoftBody/*.cpp ) ADD_DEFINITIONS(-D_LIB) diff --git a/extern/bullet2/src/BulletCollision/CMakeLists.txt b/extern/bullet2/src/BulletCollision/CMakeLists.txt index 4b4304f43b0..ddc806a3e6a 100644 --- a/extern/bullet2/src/BulletCollision/CMakeLists.txt +++ b/extern/bullet2/src/BulletCollision/CMakeLists.txt @@ -211,13 +211,13 @@ ADD_LIBRARY(BulletCollision ${BulletCollision_SRCS} ${BulletCollision_HDRS}) SET_TARGET_PROPERTIES(BulletCollision PROPERTIES VERSION ${BULLET_VERSION}) SET_TARGET_PROPERTIES(BulletCollision PROPERTIES SOVERSION ${BULLET_VERSION}) IF (BUILD_SHARED_LIBS) - TARGET_LINK_LIBRARIES(BulletCollision LinearMath) + TARGET_LINK_LIBRARIES(BulletCollision LinearMath) ENDIF (BUILD_SHARED_LIBS) #INSTALL of other files requires CMake 2.6 IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) INSTALL(TARGETS BulletCollision DESTINATION lib) - INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.h") + INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.h") ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) diff --git a/extern/bullet2/src/BulletSoftBody/CMakeLists.txt b/extern/bullet2/src/BulletSoftBody/CMakeLists.txt index dbd87afea38..fe31d2bee71 100644 --- a/extern/bullet2/src/BulletSoftBody/CMakeLists.txt +++ b/extern/bullet2/src/BulletSoftBody/CMakeLists.txt @@ -34,7 +34,7 @@ ENDIF (BUILD_SHARED_LIBS) IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) INSTALL(TARGETS BulletSoftBody DESTINATION lib) - INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.h") + INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.h") ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5) IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK) diff --git a/extern/glew/CMakeLists.txt b/extern/glew/CMakeLists.txt index eea34488e17..26d10a6ca9f 100644 --- a/extern/glew/CMakeLists.txt +++ b/extern/glew/CMakeLists.txt @@ -27,11 +27,11 @@ SET(INC include src) IF(UNIX) - SET(INC ${INC} ${X11_X11_INCLUDE_PATH}) + SET(INC ${INC} ${X11_X11_INCLUDE_PATH}) ENDIF(UNIX) SET(SRC - src/glew.c + src/glew.c ) BLENDERLIB(extern_glew "${SRC}" "${INC}") diff --git a/intern/CMakeLists.txt b/intern/CMakeLists.txt index f33ce6a893c..9efd1a6ee7c 100644 --- a/intern/CMakeLists.txt +++ b/intern/CMakeLists.txt @@ -38,7 +38,7 @@ ADD_SUBDIRECTORY(opennl) ADD_SUBDIRECTORY(smoke) IF(WITH_ELBEEM) - ADD_SUBDIRECTORY(elbeem) + ADD_SUBDIRECTORY(elbeem) ENDIF(WITH_ELBEEM) ADD_SUBDIRECTORY(bsp) diff --git a/intern/audaspace/CMakeLists.txt b/intern/audaspace/CMakeLists.txt index 1b48de3190b..587ef30979b 100644 --- a/intern/audaspace/CMakeLists.txt +++ b/intern/audaspace/CMakeLists.txt @@ -25,38 +25,38 @@ SET(INC . intern FX SRC ${PTHREADS_INC} ${LIBSAMPLERATE_INC}) FILE(GLOB SRC intern/*.cpp intern/*.h FX/*.cpp SRC/*.cpp) IF(WITH_FFMPEG) - SET(INC ${INC} ffmpeg ${FFMPEG_INC}) - FILE(GLOB FFMPEGSRC ffmpeg/*.cpp) - ADD_DEFINITIONS(-DWITH_FFMPEG) + SET(INC ${INC} ffmpeg ${FFMPEG_INC}) + FILE(GLOB FFMPEGSRC ffmpeg/*.cpp) + ADD_DEFINITIONS(-DWITH_FFMPEG) ENDIF(WITH_FFMPEG) IF(WITH_SDL) - SET(INC ${INC} SDL ${SDL_INCLUDE_DIR}) - FILE(GLOB SDLSRC SDL/*.cpp) - ADD_DEFINITIONS(-DWITH_SDL) + SET(INC ${INC} SDL ${SDL_INCLUDE_DIR}) + FILE(GLOB SDLSRC SDL/*.cpp) + ADD_DEFINITIONS(-DWITH_SDL) ENDIF(WITH_SDL) IF(WITH_OPENAL) - SET(INC ${INC} OpenAL ${OPENAL_INCLUDE_DIR}) - FILE(GLOB OPENALSRC OpenAL/*.cpp) - ADD_DEFINITIONS(-DWITH_OPENAL) + SET(INC ${INC} OpenAL ${OPENAL_INCLUDE_DIR}) + FILE(GLOB OPENALSRC OpenAL/*.cpp) + ADD_DEFINITIONS(-DWITH_OPENAL) - STRING(REGEX MATCH ".*ramework.*" FRAMEWORK ${OPENAL_INCLUDE_DIR}) - IF(FRAMEWORK) - ADD_DEFINITIONS(-DAPPLE_FRAMEWORK_FIX) - ENDIF(FRAMEWORK) + STRING(REGEX MATCH ".*ramework.*" FRAMEWORK ${OPENAL_INCLUDE_DIR}) + IF(FRAMEWORK) + ADD_DEFINITIONS(-DAPPLE_FRAMEWORK_FIX) + ENDIF(FRAMEWORK) ENDIF(WITH_OPENAL) IF(WITH_JACK) - SET(INC ${INC} jack ${JACK_INC}) - FILE(GLOB JACKSRC jack/*.cpp) - ADD_DEFINITIONS(-DWITH_JACK) + SET(INC ${INC} jack ${JACK_INC}) + FILE(GLOB JACKSRC jack/*.cpp) + ADD_DEFINITIONS(-DWITH_JACK) ENDIF(WITH_JACK) IF(WITH_SNDFILE) - SET(INC ${INC} sndfile ${SNDFILE_INC}) - FILE(GLOB SNDFILESRC sndfile/*.cpp) - ADD_DEFINITIONS(-DWITH_SNDFILE) + SET(INC ${INC} sndfile ${SNDFILE_INC}) + FILE(GLOB SNDFILESRC sndfile/*.cpp) + ADD_DEFINITIONS(-DWITH_SNDFILE) ENDIF(WITH_SNDFILE) SET(SRC ${SRC} ${FFMPEGSRC} ${SNDFILESRC} ${SDLSRC} ${OPENALSRC} ${JACKSRC}) diff --git a/intern/elbeem/CMakeLists.txt b/intern/elbeem/CMakeLists.txt index 8b8a3000efd..e541d334086 100644 --- a/intern/elbeem/CMakeLists.txt +++ b/intern/elbeem/CMakeLists.txt @@ -30,11 +30,11 @@ FILE(GLOB SRC intern/*.cpp) ADD_DEFINITIONS(-DNOGUI -DELBEEM_BLENDER=1) IF(WINDOWS) - ADD_DEFINITIONS(-DUSE_MSVC6FIXES) + ADD_DEFINITIONS(-DUSE_MSVC6FIXES) ENDIF(WINDOWS) IF(WITH_OPENMP) - ADD_DEFINITIONS(-DPARALLEL=1) + ADD_DEFINITIONS(-DPARALLEL=1) ENDIF(WITH_OPENMP) BLENDERLIB_NOLIST(bf_elbeem "${SRC}" "${INC}") diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt index 3d588ecfd00..9128e923e19 100644 --- a/intern/ghost/CMakeLists.txt +++ b/intern/ghost/CMakeLists.txt @@ -29,30 +29,30 @@ SET(INC . ../string) FILE(GLOB SRC intern/*.cpp) IF(APPLE) - LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerWin32.cpp") - LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemWin32.cpp") - LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowWin32.cpp") - LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerX11.cpp") - LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemX11.cpp") - LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowX11.cpp") + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerWin32.cpp") + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemWin32.cpp") + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowWin32.cpp") + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerX11.cpp") + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemX11.cpp") + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowX11.cpp") ELSE(APPLE) - IF(WIN32) - SET(INC ${INC} ${WINTAB_INC}) - LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCarbon.cpp") - LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCarbon.cpp") - LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCarbon.cpp") - LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerX11.cpp") - LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemX11.cpp") - LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowX11.cpp") - ELSE(WIN32) - SET(INC ${INC} ${X11_X11_INCLUDE_PATH}) - LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerWin32.cpp") - LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemWin32.cpp") - LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowWin32.cpp") - LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCarbon.cpp") - LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCarbon.cpp") - LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCarbon.cpp") - ENDIF(WIN32) + IF(WIN32) + SET(INC ${INC} ${WINTAB_INC}) + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCarbon.cpp") + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCarbon.cpp") + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCarbon.cpp") + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerX11.cpp") + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemX11.cpp") + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowX11.cpp") + ELSE(WIN32) + SET(INC ${INC} ${X11_X11_INCLUDE_PATH}) + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerWin32.cpp") + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemWin32.cpp") + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowWin32.cpp") + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_DisplayManagerCarbon.cpp") + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_SystemCarbon.cpp") + LIST(REMOVE_ITEM SRC "${CMAKE_CURRENT_SOURCE_DIR}/intern/GHOST_WindowCarbon.cpp") + ENDIF(WIN32) ENDIF(APPLE) BLENDERLIB(bf_ghost "${SRC}" "${INC}") diff --git a/intern/guardedalloc/CMakeLists.txt b/intern/guardedalloc/CMakeLists.txt index b29837fac7d..40ca35632d7 100644 --- a/intern/guardedalloc/CMakeLists.txt +++ b/intern/guardedalloc/CMakeLists.txt @@ -32,6 +32,6 @@ BLENDERLIB(bf_guardedalloc "${SRC}" "${INC}") # Override C++ alloc optional IF(WITH_CXX_GUARDEDALLOC) - FILE(GLOB SRC cpp/*.cpp) - BLENDERLIB(bf_guardedalloc_cpp "${SRC}" "${INC}") + FILE(GLOB SRC cpp/*.cpp) + BLENDERLIB(bf_guardedalloc_cpp "${SRC}" "${INC}") ENDIF(WITH_CXX_GUARDEDALLOC) diff --git a/intern/smoke/CMakeLists.txt b/intern/smoke/CMakeLists.txt index 0db6acb683f..8ed7a7c9115 100644 --- a/intern/smoke/CMakeLists.txt +++ b/intern/smoke/CMakeLists.txt @@ -29,12 +29,12 @@ SET(INC ${PNG_INC} ${ZLIB_INC} intern ../../extern/bullet2/src ../memutil ../gua FILE(GLOB SRC intern/*.cpp) IF(WITH_OPENMP) - ADD_DEFINITIONS(-DPARALLEL=1) + ADD_DEFINITIONS(-DPARALLEL=1) ENDIF(WITH_OPENMP) IF(WITH_FFTW3) - ADD_DEFINITIONS(-DFFTW3=1) - SET(INC ${INC} ${FFTW3_INC}) + ADD_DEFINITIONS(-DFFTW3=1) + SET(INC ${INC} ${FFTW3_INC}) ENDIF(WITH_FFTW3) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 4764caddf6a..4adc51bcb15 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -28,9 +28,9 @@ ADD_SUBDIRECTORY(blender) ADD_SUBDIRECTORY(kernel) IF(WITH_GAMEENGINE) - ADD_SUBDIRECTORY(gameengine) + ADD_SUBDIRECTORY(gameengine) ENDIF(WITH_GAMEENGINE) IF(WINDOWS) - ADD_SUBDIRECTORY(icons) + ADD_SUBDIRECTORY(icons) ENDIF(WINDOWS) diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt index a9e3d50211f..703c5acd8a2 100644 --- a/source/blender/CMakeLists.txt +++ b/source/blender/CMakeLists.txt @@ -42,18 +42,18 @@ ADD_SUBDIRECTORY(render) ADD_SUBDIRECTORY(blenfont) IF(WITH_OPENEXR) - ADD_SUBDIRECTORY(imbuf/intern/openexr) + ADD_SUBDIRECTORY(imbuf/intern/openexr) ENDIF(WITH_OPENEXR) IF(WITH_DDS) - ADD_SUBDIRECTORY(imbuf/intern/dds) + ADD_SUBDIRECTORY(imbuf/intern/dds) ENDIF(WITH_DDS) IF(WITH_QUICKTIME) - ADD_SUBDIRECTORY(quicktime) + ADD_SUBDIRECTORY(quicktime) ENDIF(WITH_QUICKTIME) IF(WITH_PYTHON) - ADD_SUBDIRECTORY(python) + ADD_SUBDIRECTORY(python) ENDIF(WITH_PYTHON) diff --git a/source/blender/avi/CMakeLists.txt b/source/blender/avi/CMakeLists.txt index 4738ea14292..4e48b689055 100644 --- a/source/blender/avi/CMakeLists.txt +++ b/source/blender/avi/CMakeLists.txt @@ -27,8 +27,8 @@ FILE(GLOB SRC intern/*.c) SET(INC - . ../../../intern/guardedalloc - ${JPEG_INC} + . ../../../intern/guardedalloc + ${JPEG_INC} ) BLENDERLIB(bf_avi "${SRC}" "${INC}") diff --git a/source/blender/blenfont/CMakeLists.txt b/source/blender/blenfont/CMakeLists.txt index bc03e69eb88..844a6899bf5 100644 --- a/source/blender/blenfont/CMakeLists.txt +++ b/source/blender/blenfont/CMakeLists.txt @@ -25,17 +25,17 @@ FILE(GLOB SRC intern/*.c) SET(INC - ../../../intern/guardedalloc ../blenlib ../makesdna ../editors/include - ../blenkernel ../../../extern/glew/include . - ${FREETYPE_INCLUDE_DIRS} + ../../../intern/guardedalloc ../blenlib ../makesdna ../editors/include + ../blenkernel ../../../extern/glew/include . + ${FREETYPE_INCLUDE_DIRS} ) IF(WITH_INTERNATIONAL) - SET(INC ${INC} ${GETTEXT_INC}) + SET(INC ${INC} ${GETTEXT_INC}) ENDIF(WITH_INTERNATIONAL) IF(WIN32) - ADD_DEFINITIONS(-D_WIN32 -DUSE_GETTEXT_DLL) + ADD_DEFINITIONS(-D_WIN32 -DUSE_GETTEXT_DLL) ENDIF(WIN32) BLENDERLIB(bf_blenfont "${SRC}" "${INC}") diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index 17079205423..68aed2b0184 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -27,57 +27,57 @@ FILE(GLOB SRC intern/*.c) SET(INC - . ../../../intern/guardedalloc ../../../intern/memutil ../editors/include ../blenlib ../makesdna - ../render/extern/include ../../../intern/decimation/extern - ../imbuf ../avi ../../../intern/elbeem/extern ../../../intern/opennl/extern - ../../../intern/iksolver/extern ../blenloader - ../nodes ../../../extern/glew/include ../gpu ../makesrna ../../../intern/smoke/extern - ../../../intern/bsp/extern ../blenfont - ../../../intern/audaspace/intern - ../../../extern/lzo/minilzo - ../../../extern/lzma - ${ZLIB_INC} + . ../../../intern/guardedalloc ../../../intern/memutil ../editors/include ../blenlib ../makesdna + ../render/extern/include ../../../intern/decimation/extern + ../imbuf ../avi ../../../intern/elbeem/extern ../../../intern/opennl/extern + ../../../intern/iksolver/extern ../blenloader + ../nodes ../../../extern/glew/include ../gpu ../makesrna ../../../intern/smoke/extern + ../../../intern/bsp/extern ../blenfont + ../../../intern/audaspace/intern + ../../../extern/lzo/minilzo + ../../../extern/lzma + ${ZLIB_INC} ) IF(WITH_BULLET) - SET(INC ${INC} ../../../extern/bullet2/src) - ADD_DEFINITIONS(-DUSE_BULLET) + SET(INC ${INC} ../../../extern/bullet2/src) + ADD_DEFINITIONS(-DUSE_BULLET) ENDIF(WITH_BULLET) IF(WITH_OPENEXR) - ADD_DEFINITIONS(-DWITH_OPENEXR) + ADD_DEFINITIONS(-DWITH_OPENEXR) ENDIF(WITH_OPENEXR) IF(WITH_OPENJPEG) - ADD_DEFINITIONS(-DWITH_OPENJPEG) + ADD_DEFINITIONS(-DWITH_OPENJPEG) ENDIF(WITH_OPENJPEG) IF(WITH_DDS) - ADD_DEFINITIONS(-DWITH_DDS) + ADD_DEFINITIONS(-DWITH_DDS) ENDIF(WITH_DDS) IF(WITH_QUICKTIME) - SET(INC ${INC} ../quicktime ${QUICKTIME_INC}) - ADD_DEFINITIONS(-DWITH_QUICKTIME) + SET(INC ${INC} ../quicktime ${QUICKTIME_INC}) + ADD_DEFINITIONS(-DWITH_QUICKTIME) ENDIF(WITH_QUICKTIME) IF(WITH_FFMPEG) - SET(INC ${INC} ${FFMPEG_INC}) - ADD_DEFINITIONS(-DWITH_FFMPEG) + SET(INC ${INC} ${FFMPEG_INC}) + ADD_DEFINITIONS(-DWITH_FFMPEG) ENDIF(WITH_FFMPEG) IF(WITH_PYTHON) - SET(INC ${INC} ../python ${PYTHON_INC}) + SET(INC ${INC} ../python ${PYTHON_INC}) ELSE(WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) + ADD_DEFINITIONS(-DDISABLE_PYTHON) ENDIF(WITH_PYTHON) IF(NOT WITH_ELBEEM) - ADD_DEFINITIONS(-DDISABLE_ELBEEM) + ADD_DEFINITIONS(-DDISABLE_ELBEEM) ENDIF(NOT WITH_ELBEEM) IF(WIN32) - SET(INC ${INC} ${PTHREADS_INC}) + SET(INC ${INC} ${PTHREADS_INC}) ENDIF(WIN32) BLENDERLIB(bf_blenkernel "${SRC}" "${INC}") diff --git a/source/blender/blenlib/CMakeLists.txt b/source/blender/blenlib/CMakeLists.txt index a0bf2367b98..4ed9eb4b007 100644 --- a/source/blender/blenlib/CMakeLists.txt +++ b/source/blender/blenlib/CMakeLists.txt @@ -27,20 +27,20 @@ FILE(GLOB SRC intern/*.c) SET(INC - . ../makesdna ../blenkernel ../../../intern/guardedalloc ../include - ${FREETYPE_INCLUDE_DIRS} - ${ZLIB_INC} + . ../makesdna ../blenkernel ../../../intern/guardedalloc ../include + ${FREETYPE_INCLUDE_DIRS} + ${ZLIB_INC} ) IF(CMAKE_SYSTEM_NAME MATCHES "Linux") SET(INC - ${INC} - ${BINRELOC_INC} + ${INC} + ${BINRELOC_INC} ) ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") IF(WIN32) - SET(INC ${INC} ${PTHREADS_INC}) + SET(INC ${INC} ${PTHREADS_INC}) ENDIF(WIN32) BLENDERLIB(bf_blenlib "${SRC}" "${INC}") diff --git a/source/blender/blenloader/CMakeLists.txt b/source/blender/blenloader/CMakeLists.txt index 7bdffdedc05..d31a85ab208 100644 --- a/source/blender/blenloader/CMakeLists.txt +++ b/source/blender/blenloader/CMakeLists.txt @@ -27,11 +27,11 @@ FILE(GLOB SRC intern/*.c) SET(INC - . ../../../intern/guardedalloc ../blenlib ../blenkernel - ../makesdna ../readblenfile ../include ../makesrna - ../python ../../kernel/gen_messaging - ../render/extern/include - ${ZLIB_INC} + . ../../../intern/guardedalloc ../blenlib ../blenkernel + ../makesdna ../readblenfile ../include ../makesrna + ../python ../../kernel/gen_messaging + ../render/extern/include + ${ZLIB_INC} ) BLENDERLIB(bf_blenloader "${SRC}" "${INC}") diff --git a/source/blender/blenpluginapi/CMakeLists.txt b/source/blender/blenpluginapi/CMakeLists.txt index 856fb931e9d..1c5e2697c01 100644 --- a/source/blender/blenpluginapi/CMakeLists.txt +++ b/source/blender/blenpluginapi/CMakeLists.txt @@ -27,12 +27,12 @@ FILE(GLOB SRC intern/*.c) SET(INC - . .. ../../../intern/guardedalloc ../blenlib ../imbuf ../makesdna + . .. ../../../intern/guardedalloc ../blenlib ../imbuf ../makesdna ) IF(WITH_QUICKTIME) - SET(INC ${INC} ${QUICKTIME_INC}) - ADD_DEFINITIONS(-DWITH_QUICKTIME) + SET(INC ${INC} ${QUICKTIME_INC}) + ADD_DEFINITIONS(-DWITH_QUICKTIME) ENDIF(WITH_QUICKTIME) BLENDERLIB(bf_blenpluginapi "${SRC}" "${INC}") diff --git a/source/blender/editors/CMakeLists.txt b/source/blender/editors/CMakeLists.txt index c40b18ea099..066d42e723e 100644 --- a/source/blender/editors/CMakeLists.txt +++ b/source/blender/editors/CMakeLists.txt @@ -27,64 +27,64 @@ FILE(GLOB SRC */*.c) SET(INC ../windowmanager - ../editors/include - ../../../intern/guardedalloc ../../../intern/memutil - ../blenlib ../makesdna ../makesrna ../blenkernel - ../include ../imbuf ../render/extern/include - ../../../intern/bsp/extern - ../../../intern/decimation/extern ../blenloader ../python - ../../kernel/gen_system ../readstreamglue - ../../../intern/elbeem/extern - ../../../intern/ghost ../../../intern/opennl/extern ../../../extern/glew/include ../../../intern/smoke/extern - ../../../intern/audaspace/intern - ../nodes - ../gpu - ../blenfont + ../editors/include + ../../../intern/guardedalloc ../../../intern/memutil + ../blenlib ../makesdna ../makesrna ../blenkernel + ../include ../imbuf ../render/extern/include + ../../../intern/bsp/extern + ../../../intern/decimation/extern ../blenloader ../python + ../../kernel/gen_system ../readstreamglue + ../../../intern/elbeem/extern + ../../../intern/ghost ../../../intern/opennl/extern ../../../extern/glew/include ../../../intern/smoke/extern + ../../../intern/audaspace/intern + ../nodes + ../gpu + ../blenfont ) IF(WITH_GAMEENGINE) - ADD_DEFINITIONS(-DGAMEBLENDER) + ADD_DEFINITIONS(-DGAMEBLENDER) ENDIF(WITH_GAMEENGINE) IF(WITH_INTERNATIONAL) - ADD_DEFINITIONS(-DINTERNATIONAL) + ADD_DEFINITIONS(-DINTERNATIONAL) ENDIF(WITH_INTERNATIONAL) IF(WITH_OPENEXR) - ADD_DEFINITIONS(-DWITH_OPENEXR) + ADD_DEFINITIONS(-DWITH_OPENEXR) ENDIF(WITH_OPENEXR) IF(WITH_OPENJPEG) - ADD_DEFINITIONS(-DWITH_OPENJPEG) + ADD_DEFINITIONS(-DWITH_OPENJPEG) ENDIF(WITH_OPENJPEG) IF(WITH_QUICKTIME) - SET(INC ${INC} ../quicktime ${QUICKTIME_INC}) - ADD_DEFINITIONS(-DWITH_QUICKTIME) + SET(INC ${INC} ../quicktime ${QUICKTIME_INC}) + ADD_DEFINITIONS(-DWITH_QUICKTIME) ENDIF(WITH_QUICKTIME) IF(WITH_FFMPEG) - SET(INC ${INC} ${FFMPEG_INC}) - ADD_DEFINITIONS(-DWITH_FFMPEG) + SET(INC ${INC} ${FFMPEG_INC}) + ADD_DEFINITIONS(-DWITH_FFMPEG) ENDIF(WITH_FFMPEG) IF(NOT WITH_ELBEEM) - ADD_DEFINITIONS(-DDISABLE_ELBEEM) + ADD_DEFINITIONS(-DDISABLE_ELBEEM) ENDIF(NOT WITH_ELBEEM) IF(WITH_PYTHON) - SET(INC ${INC} ${PYTHON_INC}) + SET(INC ${INC} ${PYTHON_INC}) ELSE(WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) + ADD_DEFINITIONS(-DDISABLE_PYTHON) ENDIF(WITH_PYTHON) IF(WIN32) - SET(INC ${INC} ${PTHREADS_INC}) + SET(INC ${INC} ${PTHREADS_INC}) ENDIF(WIN32) # TODO buildinfo IF(BF_BUILDINFO) - ADD_DEFINITIONS(-DNAN_BUILDINFO) + ADD_DEFINITIONS(-DNAN_BUILDINFO) ENDIF(BF_BUILDINFO) BLENDERLIB_NOLIST(bf_editors "${SRC}" "${INC}") diff --git a/source/blender/editors/screen/CMakeLists.txt b/source/blender/editors/screen/CMakeLists.txt index 7429f45c00f..ad7770e12fa 100644 --- a/source/blender/editors/screen/CMakeLists.txt +++ b/source/blender/editors/screen/CMakeLists.txt @@ -30,49 +30,49 @@ FILE(GLOB SRC */*.c) SET(INC ../../windowmanager - ../../editors/include - ../../../../intern/guardedalloc ../../../../intern/memutil - ../../blenlib ../../makesdna ../../makesrna ../../blenkernel - ../../include ../../imbuf - ../../render/extern/include ../../../../intern/bsp/extern - ../../../intern/decimation/extern ../../blenloader - ../../../kernel/gen_system ../../readstreamglue - ../../../../intern/elbeem/extern - ../../../../intern/ghost ../../../../intern/opennl/extern - ../../nodes + ../../editors/include + ../../../../intern/guardedalloc ../../../../intern/memutil + ../../blenlib ../../makesdna ../../makesrna ../../blenkernel + ../../include ../../imbuf + ../../render/extern/include ../../../../intern/bsp/extern + ../../../intern/decimation/extern ../../blenloader + ../../../kernel/gen_system ../../readstreamglue + ../../../../intern/elbeem/extern + ../../../../intern/ghost ../../../../intern/opennl/extern + ../../nodes ) IF(WITH_INTERNATIONAL) - ADD_DEFINITIONS(-DINTERNATIONAL) + ADD_DEFINITIONS(-DINTERNATIONAL) ENDIF(WITH_INTERNATIONAL) IF(WITH_OPENEXR) - ADD_DEFINITIONS(-DWITH_OPENEXR) + ADD_DEFINITIONS(-DWITH_OPENEXR) ENDIF(WITH_OPENEXR) IF(WITH_QUICKTIME) - SET(INC ${INC} ../../quicktime ${QUICKTIME_INC}) - ADD_DEFINITIONS(-DWITH_QUICKTIME) + SET(INC ${INC} ../../quicktime ${QUICKTIME_INC}) + ADD_DEFINITIONS(-DWITH_QUICKTIME) ENDIF(WITH_QUICKTIME) IF(WITH_FFMPEG) - SET(INC ${INC} ${FFMPEG_INC}) - ADD_DEFINITIONS(-DWITH_FFMPEG) + SET(INC ${INC} ${FFMPEG_INC}) + ADD_DEFINITIONS(-DWITH_FFMPEG) ENDIF(WITH_FFMPEG) IF(WITH_PYTHON) - SET(INC ${INC} ../../python ${PYTHON_INC}) + SET(INC ${INC} ../../python ${PYTHON_INC}) ELSE(WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) + ADD_DEFINITIONS(-DDISABLE_PYTHON) ENDIF(WITH_PYTHON) IF(WIN32) - SET(INC ${INC} ${PTHREADS_INC}) + SET(INC ${INC} ${PTHREADS_INC}) ENDIF(WIN32) # TODO buildinfo IF(BF_BUILDINFO) - ADD_DEFINITIONS(-DNAN_BUILDINFO) + ADD_DEFINITIONS(-DNAN_BUILDINFO) ENDIF(BF_BUILDINFO) BLENDERLIB_NOLIST(bf_editors "${SRC}" "${INC}") diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt index 4d376f47d91..85f4233a251 100644 --- a/source/blender/gpu/CMakeLists.txt +++ b/source/blender/gpu/CMakeLists.txt @@ -27,8 +27,8 @@ FILE(GLOB SRC intern/*.c) SET(INC - . ../blenlib ../blenkernel ../makesdna ../include - ../../../extern/glew/include ../../../intern/guardedalloc ../imbuf) + . ../blenlib ../blenkernel ../makesdna ../include + ../../../extern/glew/include ../../../intern/guardedalloc ../imbuf) BLENDERLIB(bf_gpu "${SRC}" "${INC}") diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt index 76dd2afebdc..5eb98151c14 100644 --- a/source/blender/imbuf/CMakeLists.txt +++ b/source/blender/imbuf/CMakeLists.txt @@ -27,35 +27,35 @@ FILE(GLOB SRC intern/*.c) SET(INC - . ../makesdna ../../../intern/guardedalloc ../../../intern/memutil ../blenlib - ../avi ../blenkernel - ${JPEG_INC} - ${PNG_INC} - ${TIFF_INC} - ${ZLIB_INC} - ${OPENJPEG_INC} + . ../makesdna ../../../intern/guardedalloc ../../../intern/memutil ../blenlib + ../avi ../blenkernel + ${JPEG_INC} + ${PNG_INC} + ${TIFF_INC} + ${ZLIB_INC} + ${OPENJPEG_INC} ) IF(WITH_OPENEXR) - ADD_DEFINITIONS(-DWITH_OPENEXR) + ADD_DEFINITIONS(-DWITH_OPENEXR) ENDIF(WITH_OPENEXR) IF(WITH_OPENJPEG) - ADD_DEFINITIONS(-DWITH_OPENJPEG) + ADD_DEFINITIONS(-DWITH_OPENJPEG) ENDIF(WITH_OPENJPEG) IF(WITH_QUICKTIME) - SET(INC ${INC} ../quicktime ${QUICKTIME_INC}) - ADD_DEFINITIONS(-DWITH_QUICKTIME) + SET(INC ${INC} ../quicktime ${QUICKTIME_INC}) + ADD_DEFINITIONS(-DWITH_QUICKTIME) ENDIF(WITH_QUICKTIME) IF(WITH_FFMPEG) - SET(INC ${INC} ${FFMPEG_INC}) - ADD_DEFINITIONS(-DWITH_FFMPEG) + SET(INC ${INC} ${FFMPEG_INC}) + ADD_DEFINITIONS(-DWITH_FFMPEG) ENDIF(WITH_FFMPEG) if(WITH_DDS) - ADD_DEFINITIONS(-DWITH_DDS) + ADD_DEFINITIONS(-DWITH_DDS) ENDIF(WITH_DDS) BLENDERLIB(bf_imbuf "${SRC}" "${INC}") diff --git a/source/blender/imbuf/intern/cineon/CMakeLists.txt b/source/blender/imbuf/intern/cineon/CMakeLists.txt index 53cd161634b..8b28086016b 100644 --- a/source/blender/imbuf/intern/cineon/CMakeLists.txt +++ b/source/blender/imbuf/intern/cineon/CMakeLists.txt @@ -27,14 +27,14 @@ FILE(GLOB SRC *.c) SET(INC - . - ../../../blenkernel - ../../ - .. - ../../../blenlib - intern/include - ../../../../../intern/guardedalloc - ../../../makesdna + . + ../../../blenkernel + ../../ + .. + ../../../blenlib + intern/include + ../../../../../intern/guardedalloc + ../../../makesdna ) BLENDERLIB(bf_cineon "${SRC}" "${INC}") diff --git a/source/blender/imbuf/intern/dds/CMakeLists.txt b/source/blender/imbuf/intern/dds/CMakeLists.txt index 842f53bd88b..dc45afb9f5b 100644 --- a/source/blender/imbuf/intern/dds/CMakeLists.txt +++ b/source/blender/imbuf/intern/dds/CMakeLists.txt @@ -27,18 +27,18 @@ FILE (GLOB SRC *.cpp) SET(INC - . - ../../../blenkernel - ../../../makesdna - ../../ - .. - ../../../blenlib - intern/include - ../../../../../intern/guardedalloc + . + ../../../blenkernel + ../../../makesdna + ../../ + .. + ../../../blenlib + intern/include + ../../../../../intern/guardedalloc ) if(WITH_DDS) - ADD_DEFINITIONS(-DWITH_DDS) + ADD_DEFINITIONS(-DWITH_DDS) ENDIF(WITH_DDS) BLENDERLIB(bf_dds "${SRC}" "${INC}") diff --git a/source/blender/imbuf/intern/openexr/CMakeLists.txt b/source/blender/imbuf/intern/openexr/CMakeLists.txt index 21792086774..33681da55af 100644 --- a/source/blender/imbuf/intern/openexr/CMakeLists.txt +++ b/source/blender/imbuf/intern/openexr/CMakeLists.txt @@ -27,19 +27,19 @@ SET(SRC openexr_api.cpp) SET(INC - . - ../../../blenkernel - ../../ - .. - ../../../blenlib - intern/include - ../../../../../intern/guardedalloc - ../../../makesdna - ${OPENEXR_INC} + . + ../../../blenkernel + ../../ + .. + ../../../blenlib + intern/include + ../../../../../intern/guardedalloc + ../../../makesdna + ${OPENEXR_INC} ) IF(WITH_OPENEXR) - ADD_DEFINITIONS(-DWITH_OPENEXR) + ADD_DEFINITIONS(-DWITH_OPENEXR) ENDIF(WITH_OPENEXR) BLENDERLIB(bf_openexr "${SRC}" "${INC}") diff --git a/source/blender/makesdna/intern/CMakeLists.txt b/source/blender/makesdna/intern/CMakeLists.txt index 6024799f852..1fb63156f26 100644 --- a/source/blender/makesdna/intern/CMakeLists.txt +++ b/source/blender/makesdna/intern/CMakeLists.txt @@ -33,9 +33,9 @@ ADD_EXECUTABLE(makesdna ${SRC} ${INC_FILES}) # Output dna.c ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dna.c - COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesdna ${CMAKE_CURRENT_BINARY_DIR}/dna.c ${CMAKE_SOURCE_DIR}/source/blender/makesdna/ - DEPENDS makesdna + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dna.c + COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesdna ${CMAKE_CURRENT_BINARY_DIR}/dna.c ${CMAKE_SOURCE_DIR}/source/blender/makesdna/ + DEPENDS makesdna ) # Build bf_dna library diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index a1f42fbccb3..709c5d017ec 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -32,59 +32,59 @@ LIST(REMOVE_ITEM DEFSRC ${APISRC}) STRING(REGEX REPLACE "rna_([a-zA-Z0-9_-]*).c" "${CMAKE_CURRENT_BINARY_DIR}/rna_\\1_gen.c" GENSRC "${DEFSRC}") SET(SRC - makesrna.c - rna_define.c - ${DEFSRC} - ${APISRC} - ../../../../intern/guardedalloc/intern/mallocn.c - ../../../../intern/guardedalloc/intern/mmap_win.c) + makesrna.c + rna_define.c + ${DEFSRC} + ${APISRC} + ../../../../intern/guardedalloc/intern/mallocn.c + ../../../../intern/guardedalloc/intern/mmap_win.c) INCLUDE_DIRECTORIES(../../../../intern/guardedalloc .. ../../makesdna ../../blenkernel ../../blenlib ../../windowmanager ../../editors/include ../../imbuf ../../render/extern/include .) FILE(GLOB INC_FILES ../*.h ../../makesdna/*.h) IF(WITH_GAMEENGINE) - ADD_DEFINITIONS(-DGAMEBLENDER) + ADD_DEFINITIONS(-DGAMEBLENDER) ENDIF(WITH_GAMEENGINE) IF(WITH_OPENEXR) - ADD_DEFINITIONS(-DWITH_OPENEXR) + ADD_DEFINITIONS(-DWITH_OPENEXR) ENDIF(WITH_OPENEXR) IF(WITH_OPENJPEG) - ADD_DEFINITIONS(-DWITH_OPENJPEG) + ADD_DEFINITIONS(-DWITH_OPENJPEG) ENDIF(WITH_OPENJPEG) IF(WITH_DDS) - ADD_DEFINITIONS(-DWITH_DDS) + ADD_DEFINITIONS(-DWITH_DDS) ENDIF(WITH_DDS) IF(WITH_QUICKTIME) - ADD_DEFINITIONS(-DWITH_QUICKTIME) + ADD_DEFINITIONS(-DWITH_QUICKTIME) ENDIF(WITH_QUICKTIME) IF(WITH_FFMPEG) - SET(INC ${INC} ${FFMPEG_INC}) - ADD_DEFINITIONS(-DWITH_FFMPEG) + SET(INC ${INC} ${FFMPEG_INC}) + ADD_DEFINITIONS(-DWITH_FFMPEG) ENDIF(WITH_FFMPEG) IF(NOT WITH_ELBEEM) - ADD_DEFINITIONS(-DDISABLE_ELBEEM) + ADD_DEFINITIONS(-DDISABLE_ELBEEM) ENDIF(NOT WITH_ELBEEM) IF(WITH_FFTW3) - ADD_DEFINITIONS(-DFFTW3=1) + ADD_DEFINITIONS(-DFFTW3=1) ENDIF(WITH_FFTW3) IF(WITH_SDL) - ADD_DEFINITIONS(-DWITH_SDL) + ADD_DEFINITIONS(-DWITH_SDL) ENDIF(WITH_SDL) IF(WITH_OPENAL) - ADD_DEFINITIONS(-DWITH_OPENAL) + ADD_DEFINITIONS(-DWITH_OPENAL) ENDIF(WITH_OPENAL) IF(WITH_JACK) - ADD_DEFINITIONS(-DWITH_JACK) + ADD_DEFINITIONS(-DWITH_JACK) ENDIF(WITH_JACK) # Build makesrna executable @@ -93,9 +93,9 @@ TARGET_LINK_LIBRARIES(makesrna bf_dna) # Output rna_*_gen.c ADD_CUSTOM_COMMAND( - OUTPUT ${GENSRC} - COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesrna ${CMAKE_CURRENT_BINARY_DIR}/ - DEPENDS makesrna + OUTPUT ${GENSRC} + COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesrna ${CMAKE_CURRENT_BINARY_DIR}/ + DEPENDS makesrna ) # Build bf_rna diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt index bba96adf25e..df2567142ca 100644 --- a/source/blender/nodes/CMakeLists.txt +++ b/source/blender/nodes/CMakeLists.txt @@ -26,32 +26,32 @@ FILE(GLOB SRC intern/*.c intern/CMP_nodes/*.c intern/SHD_nodes/*.c intern/TEX_nodes/*.c) SET(INC - . ../../../intern/guardedalloc ../editors/include ../blenlib ../makesdna - ../render/extern/include ../../../intern/decimation/extern ../makesrna - ../imbuf ../avi ../../../intern/elbeem/extern - ../../../intern/iksolver/extern ../blenloader - ../blenkernel ../../../extern/glew/include ../gpu - ${ZLIB_INC} + . ../../../intern/guardedalloc ../editors/include ../blenlib ../makesdna + ../render/extern/include ../../../intern/decimation/extern ../makesrna + ../imbuf ../avi ../../../intern/elbeem/extern + ../../../intern/iksolver/extern ../blenloader + ../blenkernel ../../../extern/glew/include ../gpu + ${ZLIB_INC} ) IF(WITH_OPENEXR) - ADD_DEFINITIONS(-DWITH_OPENEXR) + ADD_DEFINITIONS(-DWITH_OPENEXR) ENDIF(WITH_OPENEXR) IF(WITH_QUICKTIME) - SET(INC ${INC} ../quicktime ${QUICKTIME_INC}) - ADD_DEFINITIONS(-DWITH_QUICKTIME) + SET(INC ${INC} ../quicktime ${QUICKTIME_INC}) + ADD_DEFINITIONS(-DWITH_QUICKTIME) ENDIF(WITH_QUICKTIME) IF(WITH_FFMPEG) - SET(INC ${INC} ${FFMPEG_INC}) - ADD_DEFINITIONS(-DWITH_FFMPEG) + SET(INC ${INC} ${FFMPEG_INC}) + ADD_DEFINITIONS(-DWITH_FFMPEG) ENDIF(WITH_FFMPEG) IF(WITH_PYTHON) - SET(INC ${INC} ../python ${PYTHON_INC}) + SET(INC ${INC} ../python ${PYTHON_INC}) ELSE(WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) + ADD_DEFINITIONS(-DDISABLE_PYTHON) ENDIF(WITH_PYTHON) BLENDERLIB(bf_nodes "${SRC}" "${INC}") diff --git a/source/blender/python/CMakeLists.txt b/source/blender/python/CMakeLists.txt index 7700e6bc2aa..7abec566505 100644 --- a/source/blender/python/CMakeLists.txt +++ b/source/blender/python/CMakeLists.txt @@ -27,23 +27,23 @@ FILE(GLOB SRC intern/*.c) FILE(GLOB GENSRC generic/*.c) SET(INC - . ../../../intern/guardedalloc ../blenlib ../makesdna ../makesrna - ../blenkernel ../editors/include ../windowmanager ${PYTHON_INC} - ../../../extern/glew/include + . ../../../intern/guardedalloc ../blenlib ../makesdna ../makesrna + ../blenkernel ../editors/include ../windowmanager ${PYTHON_INC} + ../../../extern/glew/include ) IF(WITH_OPENEXR) - ADD_DEFINITIONS(-DWITH_OPENEXR) + ADD_DEFINITIONS(-DWITH_OPENEXR) ENDIF(WITH_OPENEXR) IF(WITH_QUICKTIME) - SET(INC ${INC} ${QUICKTIME_INC}) - ADD_DEFINITIONS(-DWITH_QUICKTIME) + SET(INC ${INC} ${QUICKTIME_INC}) + ADD_DEFINITIONS(-DWITH_QUICKTIME) ENDIF(WITH_QUICKTIME) IF(WITH_FFMPEG) - SET(INC ${INC} ${FFMPEG_INC}) - ADD_DEFINITIONS(-DWITH_FFMPEG) + SET(INC ${INC} ${FFMPEG_INC}) + ADD_DEFINITIONS(-DWITH_FFMPEG) ENDIF(WITH_FFMPEG) ADD_DEFINITIONS(-DWITH_CCGSUBSURF) diff --git a/source/blender/quicktime/CMakeLists.txt b/source/blender/quicktime/CMakeLists.txt index 95969878cf1..ac503bb62cb 100644 --- a/source/blender/quicktime/CMakeLists.txt +++ b/source/blender/quicktime/CMakeLists.txt @@ -27,18 +27,18 @@ SET(SRC apple/quicktime_import.c apple/quicktime_export.c) SET(INC - . - ../quicktime - ../makesdna - ../../../intern/guardedalloc - ../blenlib - ../blenkernel - ../avi - ../imbuf - ../imbuf/intern - ../blenloader - ../render/extern/include - ../include + . + ../quicktime + ../makesdna + ../../../intern/guardedalloc + ../blenlib + ../blenkernel + ../avi + ../imbuf + ../imbuf/intern + ../blenloader + ../render/extern/include + ../include ) SET(INC ${INC} ${QUICKTIME_INC}) diff --git a/source/blender/readblenfile/CMakeLists.txt b/source/blender/readblenfile/CMakeLists.txt index dc4a8f5636d..ded4a1e00cf 100644 --- a/source/blender/readblenfile/CMakeLists.txt +++ b/source/blender/readblenfile/CMakeLists.txt @@ -27,7 +27,7 @@ FILE(GLOB SRC intern/*.c) SET(INC - . ../blenloader ../blenloader/intern ../blenkernel ../blenlib ../makesdna ../../kernel/gen_messaging + . ../blenloader ../blenloader/intern ../blenkernel ../blenlib ../makesdna ../../kernel/gen_messaging ) BLENDERLIB(bf_readblenfile "${SRC}" "${INC}") diff --git a/source/blender/render/CMakeLists.txt b/source/blender/render/CMakeLists.txt index ad96b9db166..3284f7ea79a 100644 --- a/source/blender/render/CMakeLists.txt +++ b/source/blender/render/CMakeLists.txt @@ -27,24 +27,24 @@ FILE(GLOB SRC intern/source/*.c) SET(INC - intern/include ../../../intern/guardedalloc ../blenlib ../makesdna - extern/include ../blenkernel ../imbuf - ../include ../../kernel/gen_messaging ../blenloader - ../../../intern/smoke/extern - ../makesrna + intern/include ../../../intern/guardedalloc ../blenlib ../makesdna + extern/include ../blenkernel ../imbuf + ../include ../../kernel/gen_messaging ../blenloader + ../../../intern/smoke/extern + ../makesrna ) IF(WITH_OPENEXR) - ADD_DEFINITIONS(-DWITH_OPENEXR) + ADD_DEFINITIONS(-DWITH_OPENEXR) ENDIF(WITH_OPENEXR) IF(WITH_QUICKTIME) - SET(INC ${INC} ../quicktime ${QUICKTIME_INC}) - ADD_DEFINITIONS(-DWITH_QUICKTIME) + SET(INC ${INC} ../quicktime ${QUICKTIME_INC}) + ADD_DEFINITIONS(-DWITH_QUICKTIME) ENDIF(WITH_QUICKTIME) IF(WITH_FFMPEG) - ADD_DEFINITIONS(-DWITH_FFMPEG) + ADD_DEFINITIONS(-DWITH_FFMPEG) ENDIF(WITH_FFMPEG) #TODO diff --git a/source/blender/windowmanager/CMakeLists.txt b/source/blender/windowmanager/CMakeLists.txt index 26d4ab20356..cb2fc92a1b6 100644 --- a/source/blender/windowmanager/CMakeLists.txt +++ b/source/blender/windowmanager/CMakeLists.txt @@ -27,52 +27,52 @@ FILE(GLOB SRC intern/*.c) SET(INC . - ../editors/include - ../../../intern/guardedalloc ../../../intern/memutil - ../blenlib ../makesdna ../makesrna ../blenkernel - ../include ../imbuf ../render/extern/include - ../../../intern/bsp/extern - ../../../intern/decimation/extern ../blenloader - ../../kernel/gen_system ../readstreamglue - ../../../intern/elbeem/extern - ../../../intern/ghost ../../../intern/opennl/extern ../../../extern/glew/include - ../nodes - ../gpu - ../blenfont - ${OPENGL_INCLUDE_DIR} + ../editors/include + ../../../intern/guardedalloc ../../../intern/memutil + ../blenlib ../makesdna ../makesrna ../blenkernel + ../include ../imbuf ../render/extern/include + ../../../intern/bsp/extern + ../../../intern/decimation/extern ../blenloader + ../../kernel/gen_system ../readstreamglue + ../../../intern/elbeem/extern + ../../../intern/ghost ../../../intern/opennl/extern ../../../extern/glew/include + ../nodes + ../gpu + ../blenfont + ${OPENGL_INCLUDE_DIR} ) IF(WITH_INTERNATIONAL) - ADD_DEFINITIONS(-DINTERNATIONAL) + ADD_DEFINITIONS(-DINTERNATIONAL) ENDIF(WITH_INTERNATIONAL) IF(WITH_OPENEXR) - ADD_DEFINITIONS(-DWITH_OPENEXR) + ADD_DEFINITIONS(-DWITH_OPENEXR) ENDIF(WITH_OPENEXR) IF(WITH_QUICKTIME) - SET(INC ${INC} ../quicktime ${QUICKTIME_INC}) - ADD_DEFINITIONS(-DWITH_QUICKTIME) + SET(INC ${INC} ../quicktime ${QUICKTIME_INC}) + ADD_DEFINITIONS(-DWITH_QUICKTIME) ENDIF(WITH_QUICKTIME) IF(WITH_FFMPEG) - SET(INC ${INC} ${FFMPEG_INC}) - ADD_DEFINITIONS(-DWITH_FFMPEG) + SET(INC ${INC} ${FFMPEG_INC}) + ADD_DEFINITIONS(-DWITH_FFMPEG) ENDIF(WITH_FFMPEG) IF(WITH_PYTHON) - SET(INC ${INC} ../python ${PYTHON_INC}) + SET(INC ${INC} ../python ${PYTHON_INC}) ELSE(WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) + ADD_DEFINITIONS(-DDISABLE_PYTHON) ENDIF(WITH_PYTHON) IF(WIN32) - SET(INC ${INC} ${PTHREADS_INC}) + SET(INC ${INC} ${PTHREADS_INC}) ENDIF(WIN32) # TODO buildinfo IF(BF_BUILDINFO) - ADD_DEFINITIONS(-DNAN_BUILDINFO) + ADD_DEFINITIONS(-DNAN_BUILDINFO) ENDIF(BF_BUILDINFO) BLENDERLIB_NOLIST(bf_windowmanager "${SRC}" "${INC}") diff --git a/source/blenderplayer/CMakeLists.txt b/source/blenderplayer/CMakeLists.txt index 76a1a405698..62064e31d59 100644 --- a/source/blenderplayer/CMakeLists.txt +++ b/source/blenderplayer/CMakeLists.txt @@ -29,24 +29,24 @@ MESSAGE(STATUS "Configuring blenderplayer") SETUP_LIBDIRS() IF(WITH_QUICKTIME) - ADD_DEFINITIONS(-DWITH_QUICKTIME) + ADD_DEFINITIONS(-DWITH_QUICKTIME) ENDIF(WITH_QUICKTIME) IF(CMAKE_SYSTEM_NAME MATCHES "Linux") - ADD_DEFINITIONS(-DWITH_BINRELOC) - INCLUDE_DIRECTORIES(${BINRELOC_INC}) + ADD_DEFINITIONS(-DWITH_BINRELOC) + INCLUDE_DIRECTORIES(${BINRELOC_INC}) ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dna.c - COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesdna ${CMAKE_CURRENT_BINARY_DIR}/dna.c ${CMAKE_SOURCE_DIR}/source/blender/makesdna/ - DEPENDS ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesdna + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dna.c + COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesdna ${CMAKE_CURRENT_BINARY_DIR}/dna.c ${CMAKE_SOURCE_DIR}/source/blender/makesdna/ + DEPENDS ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/makesdna ) IF(WIN32) - ADD_EXECUTABLE(blenderplayer ${EXETYPE} ${CMAKE_CURRENT_BINARY_DIR}/dna.c ../icons/winblender.rc) + ADD_EXECUTABLE(blenderplayer ${EXETYPE} ${CMAKE_CURRENT_BINARY_DIR}/dna.c ../icons/winblender.rc) ELSE(WIN32) - ADD_EXECUTABLE(blenderplayer ${CMAKE_CURRENT_BINARY_DIR}/dna.c) + ADD_EXECUTABLE(blenderplayer ${CMAKE_CURRENT_BINARY_DIR}/dna.c) ENDIF(WIN32) ADD_DEPENDENCIES(blenderplayer makesdna) @@ -56,89 +56,89 @@ FILE(READ ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt BLENDER_LINK_LIBS) SET(BLENDER_LINK_LIBS ${BLENDER_LINK_LIBS} gp_common gp_ghost blenkernel_blc) IF(CMAKE_SYSTEM_NAME MATCHES "Linux") - SET(BLENDER_LINK_LIBS ${BLENDER_LINK_LIBS} extern_binreloc) + SET(BLENDER_LINK_LIBS ${BLENDER_LINK_LIBS} extern_binreloc) ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") IF(UNIX) - # Sort libraries - SET(BLENDER_SORTED_LIBS - gp_ghost - gp_common - bf_string - bf_ghost - bf_rna - bf_blenkernel - bf_blenloader - bf_blenpluginapi - bf_blroutines - bf_converter - bf_ketsji - bf_bullet - bf_common - bf_dummy - bf_logic - bf_rasterizer - bf_oglrasterizer - bf_expressions - bf_scenegraph - bf_IK - bf_moto - bf_kernel - bf_nodes - bf_gpu - bf_imbuf - bf_avi - kx_network - bf_ngnetwork - bf_loopbacknetwork - extern_bullet - bf_guardedalloc - bf_memutil - bf_python - bf_gen_python - bf_blenlib - bf_cineon - bf_openexr - extern_libopenjpeg - bf_dds - bf_readblenfile - bf_dna - bf_videotex - bf_blenfont - bf_audaspace - blenkernel_blc - extern_binreloc - extern_glew - ) + # Sort libraries + SET(BLENDER_SORTED_LIBS + gp_ghost + gp_common + bf_string + bf_ghost + bf_rna + bf_blenkernel + bf_blenloader + bf_blenpluginapi + bf_blroutines + bf_converter + bf_ketsji + bf_bullet + bf_common + bf_dummy + bf_logic + bf_rasterizer + bf_oglrasterizer + bf_expressions + bf_scenegraph + bf_IK + bf_moto + bf_kernel + bf_nodes + bf_gpu + bf_imbuf + bf_avi + kx_network + bf_ngnetwork + bf_loopbacknetwork + extern_bullet + bf_guardedalloc + bf_memutil + bf_python + bf_gen_python + bf_blenlib + bf_cineon + bf_openexr + extern_libopenjpeg + bf_dds + bf_readblenfile + bf_dna + bf_videotex + bf_blenfont + bf_audaspace + blenkernel_blc + extern_binreloc + extern_glew + ) - IF(WITH_QUICKTIME) - SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} quicktime) - ENDIF(WITH_QUICKTIME) + IF(WITH_QUICKTIME) + SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} quicktime) + ENDIF(WITH_QUICKTIME) - IF(WITH_CXX_GUARDEDALLOC) - SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_guardedalloc_cpp) - ENDIF(WITH_CXX_GUARDEDALLOC) + IF(WITH_CXX_GUARDEDALLOC) + SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_guardedalloc_cpp) + ENDIF(WITH_CXX_GUARDEDALLOC) - FOREACH(SORTLIB ${BLENDER_SORTED_LIBS}) - SET(REMLIB ${SORTLIB}) - FOREACH(SEARCHLIB ${BLENDER_LINK_LIBS}) - IF(${SEARCHLIB} STREQUAL ${SORTLIB}) - SET(REMLIB "") - ENDIF(${SEARCHLIB} STREQUAL ${SORTLIB}) - ENDFOREACH(SEARCHLIB) - IF(REMLIB) - MESSAGE(STATUS "Removing library ${REMLIB} from blenderplayer linking because: not configured") - LIST(REMOVE_ITEM BLENDER_SORTED_LIBS ${REMLIB}) - ENDIF(REMLIB) - ENDFOREACH(SORTLIB) + FOREACH(SORTLIB ${BLENDER_SORTED_LIBS}) + SET(REMLIB ${SORTLIB}) + FOREACH(SEARCHLIB ${BLENDER_LINK_LIBS}) + IF(${SEARCHLIB} STREQUAL ${SORTLIB}) + SET(REMLIB "") + ENDIF(${SEARCHLIB} STREQUAL ${SORTLIB}) + ENDFOREACH(SEARCHLIB) + IF(REMLIB) + MESSAGE(STATUS "Removing library ${REMLIB} from blenderplayer linking because: not configured") + LIST(REMOVE_ITEM BLENDER_SORTED_LIBS ${REMLIB}) + ENDIF(REMLIB) + ENDFOREACH(SORTLIB) - TARGET_LINK_LIBRARIES(blenderplayer ${BLENDER_SORTED_LIBS}) + TARGET_LINK_LIBRARIES(blenderplayer ${BLENDER_SORTED_LIBS}) ELSE(UNIX) - TARGET_LINK_LIBRARIES(blenderplayer ${BLENDER_LINK_LIBS}) + TARGET_LINK_LIBRARIES(blenderplayer ${BLENDER_LINK_LIBS}) ENDIF(UNIX) IF(WITH_PLAYER) - ADD_SUBDIRECTORY(bad_level_call_stubs) + ADD_SUBDIRECTORY(bad_level_call_stubs) ENDIF(WITH_PLAYER) SETUP_LIBLINKS(blenderplayer) diff --git a/source/blenderplayer/bad_level_call_stubs/CMakeLists.txt b/source/blenderplayer/bad_level_call_stubs/CMakeLists.txt index fea19d90ed0..502b374a318 100644 --- a/source/blenderplayer/bad_level_call_stubs/CMakeLists.txt +++ b/source/blenderplayer/bad_level_call_stubs/CMakeLists.txt @@ -27,14 +27,14 @@ FILE(GLOB SRC stubs.c) SET(INC - . - .. - ../../../source/blender/makesdna - ../../../source/blender/makesrna + . + .. + ../../../source/blender/makesdna + ../../../source/blender/makesrna ) IF(WITH_INTERNATIONAL) - ADD_DEFINITIONS(-DWITH_FREETYPE2) + ADD_DEFINITIONS(-DWITH_FREETYPE2) ENDIF(WITH_INTERNATIONAL) BLENDERLIB_NOLIST(blenkernel_blc "${SRC}" "${INC}") diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index f563dec9575..1256881182b 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -27,56 +27,56 @@ SETUP_LIBDIRS() INCLUDE_DIRECTORIES(../../intern/guardedalloc - ../blender/blenlib - ../blender/blenkernel - ../blender/editors/include - ../blender/makesrna - ../blender/makesrna/intern - ../blender/nodes - ../blender/include - ../blender/blenloader - ../blender/imbuf - ../blender/renderconverter - ../blender/render/extern/include - ../blender/makesdna - ../blender/gpu - ../blender/windowmanager - ../kernel/gen_messaging - ../kernel/gen_system - ../../extern/glew/include + ../blender/blenlib + ../blender/blenkernel + ../blender/editors/include + ../blender/makesrna + ../blender/makesrna/intern + ../blender/nodes + ../blender/include + ../blender/blenloader + ../blender/imbuf + ../blender/renderconverter + ../blender/render/extern/include + ../blender/makesdna + ../blender/gpu + ../blender/windowmanager + ../kernel/gen_messaging + ../kernel/gen_system + ../../extern/glew/include ) IF(WITH_QUICKTIME) - ADD_DEFINITIONS(-DWITH_QUICKTIME) + ADD_DEFINITIONS(-DWITH_QUICKTIME) ENDIF(WITH_QUICKTIME) IF(WITH_OPENEXR) - ADD_DEFINITIONS(-DWITH_OPENEXR) + ADD_DEFINITIONS(-DWITH_OPENEXR) ENDIF(WITH_OPENEXR) IF(WITH_PYTHON) - INCLUDE_DIRECTORIES(../blender/python) + INCLUDE_DIRECTORIES(../blender/python) ELSE(WITH_PYTHON) - ADD_DEFINITIONS(-DDISABLE_PYTHON) + ADD_DEFINITIONS(-DDISABLE_PYTHON) ENDIF(WITH_PYTHON) IF(NOT WITH_SDL) - ADD_DEFINITIONS(-DDISABLE_SDL) + ADD_DEFINITIONS(-DDISABLE_SDL) ENDIF(NOT WITH_SDL) IF(CMAKE_SYSTEM_NAME MATCHES "Linux") - ADD_DEFINITIONS(-DWITH_BINRELOC) - INCLUDE_DIRECTORIES(${BINRELOC_INC}) + ADD_DEFINITIONS(-DWITH_BINRELOC) + INCLUDE_DIRECTORIES(${BINRELOC_INC}) ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") MESSAGE(STATUS "Configuring blender") IF(WIN32) - ADD_EXECUTABLE(blender ${EXETYPE} creator.c ../icons/winblender.rc) + ADD_EXECUTABLE(blender ${EXETYPE} creator.c ../icons/winblender.rc) ELSE(WIN32) - ADD_EXECUTABLE(blender ${EXETYPE} creator.c) + ADD_EXECUTABLE(blender ${EXETYPE} creator.c) ENDIF(WIN32) @@ -86,210 +86,210 @@ SET(TARGETDIR ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}) IF(WITH_INSTALL) - IF(UNIX) - ADD_CUSTOM_COMMAND(TARGET blender - POST_BUILD - MAIN_DEPENDENCY blender - #COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/plugins ${TARGETDIR}/ - #COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/text/* ${TARGETDIR}/ - ) - ENDIF(UNIX) + IF(UNIX) + ADD_CUSTOM_COMMAND(TARGET blender + POST_BUILD + MAIN_DEPENDENCY blender + #COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/plugins ${TARGETDIR}/ + #COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/text/* ${TARGETDIR}/ + ) + ENDIF(UNIX) - IF(UNIX AND NOT APPLE) - ADD_CUSTOM_COMMAND( - TARGET blender POST_BUILD MAIN_DEPENDENCY blender - COMMAND rm -Rf ${TARGETDIR}/.blender - COMMAND mkdir ${TARGETDIR}/.blender/ - COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.bfont.ttf ${TARGETDIR}/.blender/ - ) + IF(UNIX AND NOT APPLE) + ADD_CUSTOM_COMMAND( + TARGET blender POST_BUILD MAIN_DEPENDENCY blender + COMMAND rm -Rf ${TARGETDIR}/.blender + COMMAND mkdir ${TARGETDIR}/.blender/ + COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.bfont.ttf ${TARGETDIR}/.blender/ + ) - IF(WITH_INTERNATIONAL) - ADD_CUSTOM_COMMAND( - TARGET blender POST_BUILD MAIN_DEPENDENCY blender - COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/.blender/ - COMMAND cp -R ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/.blender/ - ) - ENDIF(WITH_INTERNATIONAL) + IF(WITH_INTERNATIONAL) + ADD_CUSTOM_COMMAND( + TARGET blender POST_BUILD MAIN_DEPENDENCY blender + COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/.blender/ + COMMAND cp -R ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/.blender/ + ) + ENDIF(WITH_INTERNATIONAL) - IF(WITH_PYTHON) - ADD_CUSTOM_COMMAND( - TARGET blender POST_BUILD MAIN_DEPENDENCY blender - COMMENT "copying blender scripts..." - COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/ui ${TARGETDIR}/.blender/ - COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/io ${TARGETDIR}/.blender/ - COMMAND find ${TARGETDIR} -name "*.py?" -prune -exec rm -rf {} "\;" - ) + IF(WITH_PYTHON) + ADD_CUSTOM_COMMAND( + TARGET blender POST_BUILD MAIN_DEPENDENCY blender + COMMENT "copying blender scripts..." + COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/ui ${TARGETDIR}/.blender/ + COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/io ${TARGETDIR}/.blender/ + COMMAND find ${TARGETDIR} -name "*.py?" -prune -exec rm -rf {} "\;" + ) - # Copy the systems python into the install directory - # Scons copy in tools/Blender.py - ADD_CUSTOM_COMMAND( - TARGET blender POST_BUILD MAIN_DEPENDENCY blender - COMMENT "copying a subset of the systems python..." + # Copy the systems python into the install directory + # Scons copy in tools/Blender.py + ADD_CUSTOM_COMMAND( + TARGET blender POST_BUILD MAIN_DEPENDENCY blender + COMMENT "copying a subset of the systems python..." - COMMAND mkdir ${TARGETDIR}/.blender/python # PYTHONPATH and PYTHONHOME is set here - COMMAND mkdir ${TARGETDIR}/.blender/python/lib/ - COMMAND cp -R ${PYTHON_LIBPATH}/python${PYTHON_VERSION} ${TARGETDIR}/.blender/python/lib/ + COMMAND mkdir ${TARGETDIR}/.blender/python # PYTHONPATH and PYTHONHOME is set here + COMMAND mkdir ${TARGETDIR}/.blender/python/lib/ + COMMAND cp -R ${PYTHON_LIBPATH}/python${PYTHON_VERSION} ${TARGETDIR}/.blender/python/lib/ - COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/distutils - COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/lib2to3 - COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/idlelib - COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/tkinter - COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/config + COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/distutils + COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/lib2to3 + COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/idlelib + COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/tkinter + COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/config - COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/site-packages - COMMAND mkdir ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/site-packages # python needs it. + COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/site-packages + COMMAND mkdir ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/site-packages # python needs it. - COMMAND rm -f ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/lib-dynload/_tkinter.so - COMMAND find ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION} -name "test" -prune -exec rm -rf {} "\;" - COMMAND find ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION} -name "*.py?" -exec rm -rf {} "\;" - COMMAND find ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION} -name "*.so"-exec strip -s {} "\;" - ) + COMMAND rm -f ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/lib-dynload/_tkinter.so + COMMAND find ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION} -name "test" -prune -exec rm -rf {} "\;" + COMMAND find ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION} -name "*.py?" -exec rm -rf {} "\;" + COMMAND find ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION} -name "*.so"-exec strip -s {} "\;" + ) - ENDIF(WITH_PYTHON) + ENDIF(WITH_PYTHON) - ADD_CUSTOM_COMMAND( - TARGET blender POST_BUILD MAIN_DEPENDENCY blender - COMMAND find ${TARGETDIR} -name .svn -prune -exec rm -rf {} "\;" - ) + ADD_CUSTOM_COMMAND( + TARGET blender POST_BUILD MAIN_DEPENDENCY blender + COMMAND find ${TARGETDIR} -name .svn -prune -exec rm -rf {} "\;" + ) - ENDIF(UNIX AND NOT APPLE) + ENDIF(UNIX AND NOT APPLE) - IF(APPLE) - SET(SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blender.app) - SET(SOURCEINFO ${SOURCEDIR}/Contents/Info.plist) - SET(TARGETINFO ${TARGETDIR}/blender.app/Contents/Info.plist) + IF(APPLE) + SET(SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blender.app) + SET(SOURCEINFO ${SOURCEDIR}/Contents/Info.plist) + SET(TARGETINFO ${TARGETDIR}/blender.app/Contents/Info.plist) - ADD_CUSTOM_COMMAND( - TARGET blender POST_BUILD MAIN_DEPENDENCY blender - COMMAND cp -R ${SOURCEINFO} ${TARGETDIR}/blender.app/Contents/ - COMMAND cp -R ${SOURCEDIR}/Contents/PkgInfo ${TARGETDIR}/blender.app/Contents/ - COMMAND cp -R ${SOURCEDIR}/Contents/Resources ${TARGETDIR}/blender.app/Contents/ - COMMAND cat ${SOURCEINFO} | sed s/VERSION/`cat ${CMAKE_SOURCE_DIR}/release/VERSION`/ | sed s/DATE/`date +'%Y-%b-%d'`/ > ${TARGETINFO} - COMMAND rm -Rf ${TARGETDIR}/blender.app/Contents/MacOS/.blender - COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/.blender/ - COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.bfont.ttf ${TARGETDIR}/blender.app/Contents/MacOS/.blender/ - ) + ADD_CUSTOM_COMMAND( + TARGET blender POST_BUILD MAIN_DEPENDENCY blender + COMMAND cp -R ${SOURCEINFO} ${TARGETDIR}/blender.app/Contents/ + COMMAND cp -R ${SOURCEDIR}/Contents/PkgInfo ${TARGETDIR}/blender.app/Contents/ + COMMAND cp -R ${SOURCEDIR}/Contents/Resources ${TARGETDIR}/blender.app/Contents/ + COMMAND cat ${SOURCEINFO} | sed s/VERSION/`cat ${CMAKE_SOURCE_DIR}/release/VERSION`/ | sed s/DATE/`date +'%Y-%b-%d'`/ > ${TARGETINFO} + COMMAND rm -Rf ${TARGETDIR}/blender.app/Contents/MacOS/.blender + COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/.blender/ + COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.bfont.ttf ${TARGETDIR}/blender.app/Contents/MacOS/.blender/ + ) - IF(WITH_INTERNATIONAL) - ADD_CUSTOM_COMMAND( - TARGET blender POST_BUILD MAIN_DEPENDENCY blender - COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/blender.app/Contents/MacOS/.blender/ - COMMAND cp -R ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/blender.app/Contents/Resources/ - COMMAND cp -R ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/blender.app/Contents/MacOS/.blender/ - COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/blender.app/Contents/Resources/ - ) - ENDIF(WITH_INTERNATIONAL) + IF(WITH_INTERNATIONAL) + ADD_CUSTOM_COMMAND( + TARGET blender POST_BUILD MAIN_DEPENDENCY blender + COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/blender.app/Contents/MacOS/.blender/ + COMMAND cp -R ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/blender.app/Contents/Resources/ + COMMAND cp -R ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/blender.app/Contents/MacOS/.blender/ + COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/blender.app/Contents/Resources/ + ) + ENDIF(WITH_INTERNATIONAL) - IF(WITH_PYTHON) - ADD_CUSTOM_COMMAND( - TARGET blender POST_BUILD MAIN_DEPENDENCY blender - COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/release/ui ${TARGETDIR}/blender.app/Contents/MacOS/.blender/ - COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/release/io ${TARGETDIR}/blender.app/Contents/MacOS/.blender/ - COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/.blender/python/ - COMMAND unzip -q ${LIBDIR}/release/python.zip -d ${TARGETDIR}/blender.app/Contents/MacOS/.blender/python/ - COMMAND find ${TARGETDIR}/blender.app -name "*.py?" -prune -exec rm -rf {} "\;" - ) - ENDIF(WITH_PYTHON) + IF(WITH_PYTHON) + ADD_CUSTOM_COMMAND( + TARGET blender POST_BUILD MAIN_DEPENDENCY blender + COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/release/ui ${TARGETDIR}/blender.app/Contents/MacOS/.blender/ + COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/release/io ${TARGETDIR}/blender.app/Contents/MacOS/.blender/ + COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/.blender/python/ + COMMAND unzip -q ${LIBDIR}/release/python.zip -d ${TARGETDIR}/blender.app/Contents/MacOS/.blender/python/ + COMMAND find ${TARGETDIR}/blender.app -name "*.py?" -prune -exec rm -rf {} "\;" + ) + ENDIF(WITH_PYTHON) - ADD_CUSTOM_COMMAND( - TARGET blender POST_BUILD MAIN_DEPENDENCY blender - COMMAND find ${TARGETDIR}/blender.app -name .DS_Store -prune -exec rm -rf {} "\;" - COMMAND find ${TARGETDIR}/blender.app -name .svn -prune -exec rm -rf {} "\;" - ) - ENDIF(APPLE) + ADD_CUSTOM_COMMAND( + TARGET blender POST_BUILD MAIN_DEPENDENCY blender + COMMAND find ${TARGETDIR}/blender.app -name .DS_Store -prune -exec rm -rf {} "\;" + COMMAND find ${TARGETDIR}/blender.app -name .svn -prune -exec rm -rf {} "\;" + ) + ENDIF(APPLE) - IF(WIN32) - FILE(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} WIN_SOURCE_DIR) + IF(WIN32) + FILE(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} WIN_SOURCE_DIR) - ADD_CUSTOM_COMMAND(TARGET blender - POST_BUILD - MAIN_DEPENDENCY blender - COMMAND if not exist \"${TARGETDIR}\\.blender\" mkdir \"${TARGETDIR}\\.blender\" - COMMAND if not exist \"${TARGETDIR}\\.blender\\locale\" mkdir \"${TARGETDIR}\\.blender\\locale\" - COMMAND if not exist \"${TARGETDIR}\\.blender\\ui\" mkdir \"${TARGETDIR}\\.blender\\ui\" - COMMAND if not exist \"${TARGETDIR}\\.blender\\io\" mkdir \"${TARGETDIR}\\.blender\\io\" - COMMAND if not exist \"${TARGETDIR}\\plugins\" mkdir \"${TARGETDIR}\\plugins\" - COMMAND copy /Y \"${WIN_SOURCE_DIR}\\bin\\.blender\\.Blanguages\" \"${TARGETDIR}\\.blender\\\" - COMMAND copy /Y \"${WIN_SOURCE_DIR}\\bin\\.blender\\.bfont.ttf\" \"${TARGETDIR}\\.blender\\\" - COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\bin\\.blender\\locale\\*.*\" \"${TARGETDIR}\\.blender\\locale\" - COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\scripts\\*.*\" \"${TARGETDIR}\\.blender\\scripts\" - COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\ui\\*.*\" \"${TARGETDIR}\\.blender\\ui\" - COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\io\\*.*\" \"${TARGETDIR}\\.blender\\io\" - COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\plugins\\*.*\" \"${TARGETDIR}\\plugins\" - COMMAND copy /Y \"${WIN_SOURCE_DIR}\\release\\text\\*.*\" \"${TARGETDIR}\" - COMMAND copy /Y \"${WIN_SOURCE_DIR}\\release\\windows\\extra\\python26.zip\" \"${TARGETDIR}\\\" - ) + ADD_CUSTOM_COMMAND(TARGET blender + POST_BUILD + MAIN_DEPENDENCY blender + COMMAND if not exist \"${TARGETDIR}\\.blender\" mkdir \"${TARGETDIR}\\.blender\" + COMMAND if not exist \"${TARGETDIR}\\.blender\\locale\" mkdir \"${TARGETDIR}\\.blender\\locale\" + COMMAND if not exist \"${TARGETDIR}\\.blender\\ui\" mkdir \"${TARGETDIR}\\.blender\\ui\" + COMMAND if not exist \"${TARGETDIR}\\.blender\\io\" mkdir \"${TARGETDIR}\\.blender\\io\" + COMMAND if not exist \"${TARGETDIR}\\plugins\" mkdir \"${TARGETDIR}\\plugins\" + COMMAND copy /Y \"${WIN_SOURCE_DIR}\\bin\\.blender\\.Blanguages\" \"${TARGETDIR}\\.blender\\\" + COMMAND copy /Y \"${WIN_SOURCE_DIR}\\bin\\.blender\\.bfont.ttf\" \"${TARGETDIR}\\.blender\\\" + COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\bin\\.blender\\locale\\*.*\" \"${TARGETDIR}\\.blender\\locale\" + COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\scripts\\*.*\" \"${TARGETDIR}\\.blender\\scripts\" + COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\ui\\*.*\" \"${TARGETDIR}\\.blender\\ui\" + COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\io\\*.*\" \"${TARGETDIR}\\.blender\\io\" + COMMAND xcopy /E /Y \"${WIN_SOURCE_DIR}\\release\\plugins\\*.*\" \"${TARGETDIR}\\plugins\" + COMMAND copy /Y \"${WIN_SOURCE_DIR}\\release\\text\\*.*\" \"${TARGETDIR}\" + COMMAND copy /Y \"${WIN_SOURCE_DIR}\\release\\windows\\extra\\python26.zip\" \"${TARGETDIR}\\\" + ) - FILE(TO_NATIVE_PATH "${LIBDIR}" WIN_LIBDIR) + FILE(TO_NATIVE_PATH "${LIBDIR}" WIN_LIBDIR) - ADD_CUSTOM_COMMAND(TARGET blender - POST_BUILD - MAIN_DEPENDENCY blender - COMMAND copy /Y \"${WIN_LIBDIR}\\release\\python31.zip\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\gettext\\lib\\gnu_gettext.dll\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\png\\lib\\libpng.dll\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\sdl\\lib\\SDL.dll\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\zlib\\lib\\zlib.dll\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\tiff\\lib\\libtiff.dll\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\python\\lib\\python31.dll\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\python\\lib\\python31_d.dll\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\pthreads\\lib\\pthreadVC2.dll\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\samplerate\\lib\\libsamplerate-0.dll\" \"${TARGETDIR}\\\" - ) + ADD_CUSTOM_COMMAND(TARGET blender + POST_BUILD + MAIN_DEPENDENCY blender + COMMAND copy /Y \"${WIN_LIBDIR}\\release\\python31.zip\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\gettext\\lib\\gnu_gettext.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\png\\lib\\libpng.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\sdl\\lib\\SDL.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\zlib\\lib\\zlib.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\tiff\\lib\\libtiff.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\python\\lib\\python31.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\python\\lib\\python31_d.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\pthreads\\lib\\pthreadVC2.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\samplerate\\lib\\libsamplerate-0.dll\" \"${TARGETDIR}\\\" + ) - IF(WITH_INTERNATIONAL) - ADD_CUSTOM_COMMAND(TARGET blender - POST_BUILD - MAIN_DEPENDENCY blender - COMMAND copy /Y \"${WIN_LIBDIR}\\iconv\\lib\\iconv.dll\" \"${TARGETDIR}\\\" - ) - ENDIF(WITH_INTERNATIONAL) + IF(WITH_INTERNATIONAL) + ADD_CUSTOM_COMMAND(TARGET blender + POST_BUILD + MAIN_DEPENDENCY blender + COMMAND copy /Y \"${WIN_LIBDIR}\\iconv\\lib\\iconv.dll\" \"${TARGETDIR}\\\" + ) + ENDIF(WITH_INTERNATIONAL) - IF(WITH_FFMPEG) - ADD_CUSTOM_COMMAND(TARGET blender - POST_BUILD - MAIN_DEPENDENCY blender - COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avcodec-52.dll\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avformat-52.dll\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avdevice-52.dll\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avutil-50.dll\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libfaac-0.dll\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libfaad-2.dll\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libmp3lame-0.dll\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libx264-67.dll\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\swscale-0.dll\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\xvidcore.dll\" \"${TARGETDIR}\\\" - ) - ENDIF(WITH_FFMPEG) + IF(WITH_FFMPEG) + ADD_CUSTOM_COMMAND(TARGET blender + POST_BUILD + MAIN_DEPENDENCY blender + COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avcodec-52.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avformat-52.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avdevice-52.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\avutil-50.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libfaac-0.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libfaad-2.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libmp3lame-0.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\libx264-67.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\swscale-0.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\ffmpeg\\lib\\xvidcore.dll\" \"${TARGETDIR}\\\" + ) + ENDIF(WITH_FFMPEG) - IF(WITH_SNDFILE) - ADD_CUSTOM_COMMAND(TARGET blender - POST_BUILD - MAIN_DEPENDENCY blender - COMMAND copy /Y \"${WIN_LIBDIR}\\sndfile\\lib\\libsndfile-1.dll\" \"${TARGETDIR}\\\" - ) - ENDIF(WITH_SNDFILE) + IF(WITH_SNDFILE) + ADD_CUSTOM_COMMAND(TARGET blender + POST_BUILD + MAIN_DEPENDENCY blender + COMMAND copy /Y \"${WIN_LIBDIR}\\sndfile\\lib\\libsndfile-1.dll\" \"${TARGETDIR}\\\" + ) + ENDIF(WITH_SNDFILE) - IF(WITH_JACK) - ADD_CUSTOM_COMMAND(TARGET blender - POST_BUILD - MAIN_DEPENDENCY blender - COMMAND copy /Y \"${WIN_LIBDIR}\\jack\\lib\\libjack.dll\" \"${TARGETDIR}\\\" - ) - ENDIF(WITH_JACK) + IF(WITH_JACK) + ADD_CUSTOM_COMMAND(TARGET blender + POST_BUILD + MAIN_DEPENDENCY blender + COMMAND copy /Y \"${WIN_LIBDIR}\\jack\\lib\\libjack.dll\" \"${TARGETDIR}\\\" + ) + ENDIF(WITH_JACK) - IF(WITH_OPENAL) - ADD_CUSTOM_COMMAND(TARGET blender - POST_BUILD - MAIN_DEPENDENCY blender - COMMAND copy /Y \"${WIN_LIBDIR}\\openal\\lib\\OpenAL32.dll\" \"${TARGETDIR}\\\" - COMMAND copy /Y \"${WIN_LIBDIR}\\openal\\lib\\wrap_oal.dll\" \"${TARGETDIR}\\\" + IF(WITH_OPENAL) + ADD_CUSTOM_COMMAND(TARGET blender + POST_BUILD + MAIN_DEPENDENCY blender + COMMAND copy /Y \"${WIN_LIBDIR}\\openal\\lib\\OpenAL32.dll\" \"${TARGETDIR}\\\" + COMMAND copy /Y \"${WIN_LIBDIR}\\openal\\lib\\wrap_oal.dll\" \"${TARGETDIR}\\\" - ) - ENDIF(WITH_OPENAL) + ) + ENDIF(WITH_OPENAL) - ENDIF(WIN32) + ENDIF(WIN32) ENDIF(WITH_INSTALL) ADD_DEPENDENCIES(blender makesdna) @@ -299,108 +299,108 @@ FILE(READ ${CMAKE_BINARY_DIR}/cmake_blender_libs.txt BLENDER_LINK_LIBS) SET(BLENDER_LINK_LIBS bf_nodes ${BLENDER_LINK_LIBS} bf_windowmanager bf_editors blender_render) IF(WITH_ELBEEM) - SET(BLENDER_LINK_LIBS ${BLENDER_LINK_LIBS} bf_elbeem) + SET(BLENDER_LINK_LIBS ${BLENDER_LINK_LIBS} bf_elbeem) ENDIF(WITH_ELBEEM) IF(CMAKE_SYSTEM_NAME MATCHES "Linux") - SET(BLENDER_LINK_LIBS ${BLENDER_LINK_LIBS} extern_binreloc) + SET(BLENDER_LINK_LIBS ${BLENDER_LINK_LIBS} extern_binreloc) ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") IF(UNIX) - # Sort libraries - SET(BLENDER_SORTED_LIBS - bf_windowmanager - bf_editors - bf_decimation - blender_BSP - bf_ghost - bf_string - blender_render - blender_ONL - bf_python - bf_gen_python - bf_blenkernel - bf_nodes - bf_gpu - bf_blenloader - bf_blenpluginapi - bf_imbuf - bf_blenlib - bf_avi - bf_cineon - bf_openexr - bf_dds - bf_readblenfile - blender_bop - bf_kernel - bf_decimation - bf_elbeem - bf_IK - bf_memutil - bf_guardedalloc - blender_CTR - bf_moto - bf_windowmanager - bf_editors - bf_blroutines - bf_converter - bf_dummy - bf_bullet - bf_smoke - bf_minilzo - bf_lzma - bf_common - bf_ketsji - bf_logic - bf_rasterizer - bf_oglrasterizer - bf_expressions - bf_scenegraph - bf_moto - bf_blroutines - kx_network - bf_kernel - bf_ngnetwork - extern_bullet - bf_loopbacknetwork - bf_common - bf_moto - bf_python - bf_gen_python - extern_binreloc - extern_glew - extern_libopenjpeg - bf_videotex - bf_rna - bf_dna - bf_blenfont - bf_audaspace - ) + # Sort libraries + SET(BLENDER_SORTED_LIBS + bf_windowmanager + bf_editors + bf_decimation + blender_BSP + bf_ghost + bf_string + blender_render + blender_ONL + bf_python + bf_gen_python + bf_blenkernel + bf_nodes + bf_gpu + bf_blenloader + bf_blenpluginapi + bf_imbuf + bf_blenlib + bf_avi + bf_cineon + bf_openexr + bf_dds + bf_readblenfile + blender_bop + bf_kernel + bf_decimation + bf_elbeem + bf_IK + bf_memutil + bf_guardedalloc + blender_CTR + bf_moto + bf_windowmanager + bf_editors + bf_blroutines + bf_converter + bf_dummy + bf_bullet + bf_smoke + bf_minilzo + bf_lzma + bf_common + bf_ketsji + bf_logic + bf_rasterizer + bf_oglrasterizer + bf_expressions + bf_scenegraph + bf_moto + bf_blroutines + kx_network + bf_kernel + bf_ngnetwork + extern_bullet + bf_loopbacknetwork + bf_common + bf_moto + bf_python + bf_gen_python + extern_binreloc + extern_glew + extern_libopenjpeg + bf_videotex + bf_rna + bf_dna + bf_blenfont + bf_audaspace + ) - IF(WITH_CXX_GUARDEDALLOC) - SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_guardedalloc_cpp) - ENDIF(WITH_CXX_GUARDEDALLOC) + IF(WITH_CXX_GUARDEDALLOC) + SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_guardedalloc_cpp) + ENDIF(WITH_CXX_GUARDEDALLOC) - IF(WITH_QUICKTIME) - SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_quicktime) - ENDIF(WITH_QUICKTIME) + IF(WITH_QUICKTIME) + SET(BLENDER_SORTED_LIBS ${BLENDER_SORTED_LIBS} bf_quicktime) + ENDIF(WITH_QUICKTIME) - FOREACH(SORTLIB ${BLENDER_SORTED_LIBS}) - SET(REMLIB ${SORTLIB}) - FOREACH(SEARCHLIB ${BLENDER_LINK_LIBS}) - IF(${SEARCHLIB} STREQUAL ${SORTLIB}) - SET(REMLIB "") - ENDIF(${SEARCHLIB} STREQUAL ${SORTLIB}) - ENDFOREACH(SEARCHLIB) - IF(REMLIB) - MESSAGE(STATUS "Removing library ${REMLIB} from blender linking because: not configured") - LIST(REMOVE_ITEM BLENDER_SORTED_LIBS ${REMLIB}) - ENDIF(REMLIB) - ENDFOREACH(SORTLIB) - TARGET_LINK_LIBRARIES(blender ${BLENDER_SORTED_LIBS}) + FOREACH(SORTLIB ${BLENDER_SORTED_LIBS}) + SET(REMLIB ${SORTLIB}) + FOREACH(SEARCHLIB ${BLENDER_LINK_LIBS}) + IF(${SEARCHLIB} STREQUAL ${SORTLIB}) + SET(REMLIB "") + ENDIF(${SEARCHLIB} STREQUAL ${SORTLIB}) + ENDFOREACH(SEARCHLIB) + IF(REMLIB) + MESSAGE(STATUS "Removing library ${REMLIB} from blender linking because: not configured") + LIST(REMOVE_ITEM BLENDER_SORTED_LIBS ${REMLIB}) + ENDIF(REMLIB) + ENDFOREACH(SORTLIB) + TARGET_LINK_LIBRARIES(blender ${BLENDER_SORTED_LIBS}) ELSE(UNIX) - TARGET_LINK_LIBRARIES(blender ${BLENDER_LINK_LIBS}) + TARGET_LINK_LIBRARIES(blender ${BLENDER_LINK_LIBS}) ENDIF(UNIX) SETUP_LIBLINKS(blender) diff --git a/source/gameengine/BlenderRoutines/CMakeLists.txt b/source/gameengine/BlenderRoutines/CMakeLists.txt index 42e270d0fe7..ee15fd99ed5 100644 --- a/source/gameengine/BlenderRoutines/CMakeLists.txt +++ b/source/gameengine/BlenderRoutines/CMakeLists.txt @@ -2,43 +2,43 @@ FILE(GLOB SRC *.cpp) SET(INC - . - ../../../source/kernel/gen_system - ../../../intern/string - ../../../intern/guardedalloc - ../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer - ../../../source/gameengine/Converter - ../../../source/blender/imbuf - ../../../intern/ghost/include - ../../../intern/moto/include - ../../../source/gameengine/Ketsji - ../../../source/blender/blenlib - ../../../source/blender/blenkernel - ../../../source/blender/blenfont - ../../../source/blender/editors/include - ../../../source/blender/windowmanager - ../../../source/blender - ../../../source/blender/include - ../../../source/blender/makesdna - ../../../source/blender/makesrna - ../../../source/gameengine/Rasterizer - ../../../source/gameengine/GameLogic - ../../../source/gameengine/Expressions - ../../../source/gameengine/Network - ../../../source/gameengine/SceneGraph - ../../../source/gameengine/Physics/common - ../../../source/gameengine/Physics/Bullet - ../../../source/gameengine/Network/LoopBackNetwork - ../../../source/blender/misc - ../../../source/blender/blenloader - ../../../source/blender/gpu - ../../../extern/bullet2/src - ../../../extern/glew/include - ${PYTHON_INC} + . + ../../../source/kernel/gen_system + ../../../intern/string + ../../../intern/guardedalloc + ../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer + ../../../source/gameengine/Converter + ../../../source/blender/imbuf + ../../../intern/ghost/include + ../../../intern/moto/include + ../../../source/gameengine/Ketsji + ../../../source/blender/blenlib + ../../../source/blender/blenkernel + ../../../source/blender/blenfont + ../../../source/blender/editors/include + ../../../source/blender/windowmanager + ../../../source/blender + ../../../source/blender/include + ../../../source/blender/makesdna + ../../../source/blender/makesrna + ../../../source/gameengine/Rasterizer + ../../../source/gameengine/GameLogic + ../../../source/gameengine/Expressions + ../../../source/gameengine/Network + ../../../source/gameengine/SceneGraph + ../../../source/gameengine/Physics/common + ../../../source/gameengine/Physics/Bullet + ../../../source/gameengine/Network/LoopBackNetwork + ../../../source/blender/misc + ../../../source/blender/blenloader + ../../../source/blender/gpu + ../../../extern/bullet2/src + ../../../extern/glew/include + ${PYTHON_INC} ) IF(WITH_FFMPEG) - ADD_DEFINITIONS(-DWITH_FFMPEG) + ADD_DEFINITIONS(-DWITH_FFMPEG) ENDIF(WITH_FFMPEG) BLENDERLIB(bf_blroutines "${SRC}" "${INC}") diff --git a/source/gameengine/CMakeLists.txt b/source/gameengine/CMakeLists.txt index f546a31fb2e..5a1887bd6c3 100644 --- a/source/gameengine/CMakeLists.txt +++ b/source/gameengine/CMakeLists.txt @@ -41,5 +41,5 @@ ADD_SUBDIRECTORY(Physics/Bullet) ADD_SUBDIRECTORY(VideoTexture) IF(WITH_PLAYER) - ADD_SUBDIRECTORY(GamePlayer) + ADD_SUBDIRECTORY(GamePlayer) ENDIF(WITH_PLAYER) diff --git a/source/gameengine/Converter/CMakeLists.txt b/source/gameengine/Converter/CMakeLists.txt index f16e9e169ab..257ca856b2c 100644 --- a/source/gameengine/Converter/CMakeLists.txt +++ b/source/gameengine/Converter/CMakeLists.txt @@ -27,40 +27,40 @@ FILE(GLOB SRC *.cpp) SET(INC - . - ../../../source/kernel/gen_system - ../../../intern/string - ../../../intern/guardedalloc - ../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer - ../../../intern/audaspace/intern - ../../../source/gameengine/Converter - ../../../source/gameengine/BlenderRoutines - ../../../source/blender/imbuf - ../../../intern/moto/include - ../../../source/gameengine/Ketsji - ../../../source/gameengine/Ketsji/KXNetwork - ../../../source/blender/blenlib - ../../../source/blender/blenkernel - ../../../source/blender/windowmanager - ../../../source/blender - ../../../source/blender/include - ../../../source/blender/makesdna - ../../../source/blender/makesrna - ../../../source/gameengine/Rasterizer - ../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer - ../../../source/gameengine/GameLogic - ../../../source/gameengine/Expressions - ../../../source/gameengine/Network - ../../../source/gameengine/SceneGraph - ../../../source/gameengine/Physics/common - ../../../source/gameengine/Physics/Bullet - ../../../source/gameengine/Physics/Dummy - ../../../source/gameengine/Network/LoopBackNetwork - ../../../source/blender/misc - ../../../source/blender/blenloader - ../../../source/blender/gpu - ../../../extern/bullet2/src - ${PYTHON_INC} + . + ../../../source/kernel/gen_system + ../../../intern/string + ../../../intern/guardedalloc + ../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer + ../../../intern/audaspace/intern + ../../../source/gameengine/Converter + ../../../source/gameengine/BlenderRoutines + ../../../source/blender/imbuf + ../../../intern/moto/include + ../../../source/gameengine/Ketsji + ../../../source/gameengine/Ketsji/KXNetwork + ../../../source/blender/blenlib + ../../../source/blender/blenkernel + ../../../source/blender/windowmanager + ../../../source/blender + ../../../source/blender/include + ../../../source/blender/makesdna + ../../../source/blender/makesrna + ../../../source/gameengine/Rasterizer + ../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer + ../../../source/gameengine/GameLogic + ../../../source/gameengine/Expressions + ../../../source/gameengine/Network + ../../../source/gameengine/SceneGraph + ../../../source/gameengine/Physics/common + ../../../source/gameengine/Physics/Bullet + ../../../source/gameengine/Physics/Dummy + ../../../source/gameengine/Network/LoopBackNetwork + ../../../source/blender/misc + ../../../source/blender/blenloader + ../../../source/blender/gpu + ../../../extern/bullet2/src + ${PYTHON_INC} ) BLENDERLIB(bf_converter "${SRC}" "${INC}") diff --git a/source/gameengine/Expressions/CMakeLists.txt b/source/gameengine/Expressions/CMakeLists.txt index dffd13f64ff..439a50852a7 100644 --- a/source/gameengine/Expressions/CMakeLists.txt +++ b/source/gameengine/Expressions/CMakeLists.txt @@ -27,13 +27,13 @@ FILE(GLOB SRC *.cpp) SET(INC - . - ../../../source/kernel/gen_system - ../../../intern/string - ../../../intern/moto/include - ../../../source/gameengine/SceneGraph - ../../../source/blender/blenloader - ${PYTHON_INC} + . + ../../../source/kernel/gen_system + ../../../intern/string + ../../../intern/moto/include + ../../../source/gameengine/SceneGraph + ../../../source/blender/blenloader + ${PYTHON_INC} ) BLENDERLIB(bf_expressions "${SRC}" "${INC}") diff --git a/source/gameengine/GameLogic/CMakeLists.txt b/source/gameengine/GameLogic/CMakeLists.txt index a1dce49e14b..601585f79d6 100644 --- a/source/gameengine/GameLogic/CMakeLists.txt +++ b/source/gameengine/GameLogic/CMakeLists.txt @@ -27,20 +27,20 @@ FILE(GLOB SRC *.cpp Joystick/*.cpp) SET(INC - . - ../../../source/kernel/gen_system - ../../../intern/string - ../../../source/gameengine/Expressions - ../../../source/gameengine/SceneGraph - ../../../intern/moto/include - ../../../source/gameengine/Rasterizer - ${PYTHON_INC} + . + ../../../source/kernel/gen_system + ../../../intern/string + ../../../source/gameengine/Expressions + ../../../source/gameengine/SceneGraph + ../../../intern/moto/include + ../../../source/gameengine/Rasterizer + ${PYTHON_INC} ) IF(WITH_SDL) - SET(INC ${INC} ${SDL_INCLUDE_DIR}) + SET(INC ${INC} ${SDL_INCLUDE_DIR}) ELSE(WITH_SDL) - ADD_DEFINITIONS(-DDISABLE_SDL) + ADD_DEFINITIONS(-DDISABLE_SDL) ENDIF(WITH_SDL) BLENDERLIB(bf_logic "${SRC}" "${INC}") diff --git a/source/gameengine/GamePlayer/CMakeLists.txt b/source/gameengine/GamePlayer/CMakeLists.txt index 134f8fce3b2..7b4fa4892df 100644 --- a/source/gameengine/GamePlayer/CMakeLists.txt +++ b/source/gameengine/GamePlayer/CMakeLists.txt @@ -28,5 +28,5 @@ ADD_SUBDIRECTORY(common) ADD_SUBDIRECTORY(ghost) IF(WITH_WEBPLUGIN) - ADD_SUBDIRECTORY(xembed) + ADD_SUBDIRECTORY(xembed) ENDIF(WITH_WEBPLUGIN) diff --git a/source/gameengine/GamePlayer/common/CMakeLists.txt b/source/gameengine/GamePlayer/common/CMakeLists.txt index da99087c917..c865cf5ce25 100644 --- a/source/gameengine/GamePlayer/common/CMakeLists.txt +++ b/source/gameengine/GamePlayer/common/CMakeLists.txt @@ -25,50 +25,50 @@ # ***** END GPL LICENSE BLOCK ***** SET(SRC - bmfont.cpp - GPC_Canvas.cpp - GPC_Engine.cpp - GPC_KeyboardDevice.cpp - GPC_MouseDevice.cpp - GPC_RawImage.cpp - GPC_RawLoadDotBlendArray.cpp - GPC_RawLogoArrays.cpp - GPC_RenderTools.cpp - GPC_System.cpp + bmfont.cpp + GPC_Canvas.cpp + GPC_Engine.cpp + GPC_KeyboardDevice.cpp + GPC_MouseDevice.cpp + GPC_RawImage.cpp + GPC_RawLoadDotBlendArray.cpp + GPC_RawLogoArrays.cpp + GPC_RenderTools.cpp + GPC_System.cpp ) SET(INC - . - ../../../../intern/string - ../../../../intern/ghost - ../../../../intern/guardedalloc - ../../../../intern/moto/include - ../../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer - ../../../../source/kernel/gen_system - ../../../../source/kernel/gen_messaging - ../../../../source/gameengine/Converter - ../../../../source/blender/imbuf - ../../../../source/gameengine/Ketsji - ../../../../source/blender/blenlib - ../../../../source/blender/blenkernel - ../../../../source/blender - ../../../../source/blender/include - ../../../../source/blender/makesdna - ../../../../source/gameengine/Rasterizer - ../../../../source/gameengine/GameLogic - ../../../../source/gameengine/Expressions - ../../../../source/gameengine/Network - ../../../../source/gameengine/SceneGraph - ../../../../source/gameengine/Physics/common - ../../../../source/gameengine/Network/LoopBackNetwork - ../../../../source/gameengine/GamePlayer/ghost - ../../../../source/blender/misc - ../../../../source/blender/blenloader - ../../../../source/blender/gpu - ../../../../extern/glew/include - ${PYTHON_INC} - ${PNG_INC} - ${ZLIB_INC} + . + ../../../../intern/string + ../../../../intern/ghost + ../../../../intern/guardedalloc + ../../../../intern/moto/include + ../../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer + ../../../../source/kernel/gen_system + ../../../../source/kernel/gen_messaging + ../../../../source/gameengine/Converter + ../../../../source/blender/imbuf + ../../../../source/gameengine/Ketsji + ../../../../source/blender/blenlib + ../../../../source/blender/blenkernel + ../../../../source/blender + ../../../../source/blender/include + ../../../../source/blender/makesdna + ../../../../source/gameengine/Rasterizer + ../../../../source/gameengine/GameLogic + ../../../../source/gameengine/Expressions + ../../../../source/gameengine/Network + ../../../../source/gameengine/SceneGraph + ../../../../source/gameengine/Physics/common + ../../../../source/gameengine/Network/LoopBackNetwork + ../../../../source/gameengine/GamePlayer/ghost + ../../../../source/blender/misc + ../../../../source/blender/blenloader + ../../../../source/blender/gpu + ../../../../extern/glew/include + ${PYTHON_INC} + ${PNG_INC} + ${ZLIB_INC} ) BLENDERLIB_NOLIST(gp_common "${SRC}" "${INC}") diff --git a/source/gameengine/GamePlayer/ghost/CMakeLists.txt b/source/gameengine/GamePlayer/ghost/CMakeLists.txt index 377d765af85..d50784cb967 100644 --- a/source/gameengine/GamePlayer/ghost/CMakeLists.txt +++ b/source/gameengine/GamePlayer/ghost/CMakeLists.txt @@ -25,49 +25,49 @@ # ***** END GPL LICENSE BLOCK ***** SET(SRC - GPG_Application.cpp - GPG_Canvas.cpp - GPG_ghost.cpp - GPG_KeyboardDevice.cpp - GPG_System.cpp + GPG_Application.cpp + GPG_Canvas.cpp + GPG_ghost.cpp + GPG_KeyboardDevice.cpp + GPG_System.cpp ) SET(INC - . - ../../../../intern/string - ../../../../intern/ghost - ../../../../intern/guardedalloc - ../../../../intern/moto/include - ../../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer - ../../../../source/kernel/gen_system - ../../../../source/kernel/gen_messaging - ../../../../source/gameengine/Converter - ../../../../source/blender/imbuf - ../../../../source/gameengine/Ketsji - ../../../../source/blender/blenlib - ../../../../source/blender/blenkernel - ../../../../source/blender/readblenfile - ../../../../source/blender - ../../../../source/blender/include - ../../../../source/blender/makesdna - ../../../../source/blender/makesrna - ../../../../source/gameengine/Rasterizer - ../../../../source/gameengine/GameLogic - ../../../../source/gameengine/Expressions - ../../../../source/gameengine/Network - ../../../../source/gameengine/SceneGraph - ../../../../source/gameengine/Physics/common - ../../../../source/gameengine/Network/LoopBackNetwork - ../../../../source/gameengine/GamePlayer/common - ../../../../source/blender/misc - ../../../../source/blender/blenloader - ../../../../source/blender/gpu - ../../../../extern/glew/include - ${PYTHON_INC} + . + ../../../../intern/string + ../../../../intern/ghost + ../../../../intern/guardedalloc + ../../../../intern/moto/include + ../../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer + ../../../../source/kernel/gen_system + ../../../../source/kernel/gen_messaging + ../../../../source/gameengine/Converter + ../../../../source/blender/imbuf + ../../../../source/gameengine/Ketsji + ../../../../source/blender/blenlib + ../../../../source/blender/blenkernel + ../../../../source/blender/readblenfile + ../../../../source/blender + ../../../../source/blender/include + ../../../../source/blender/makesdna + ../../../../source/blender/makesrna + ../../../../source/gameengine/Rasterizer + ../../../../source/gameengine/GameLogic + ../../../../source/gameengine/Expressions + ../../../../source/gameengine/Network + ../../../../source/gameengine/SceneGraph + ../../../../source/gameengine/Physics/common + ../../../../source/gameengine/Network/LoopBackNetwork + ../../../../source/gameengine/GamePlayer/common + ../../../../source/blender/misc + ../../../../source/blender/blenloader + ../../../../source/blender/gpu + ../../../../extern/glew/include + ${PYTHON_INC} ) IF(WITH_FFMPEG) - ADD_DEFINITIONS(-DWITH_FFMPEG) + ADD_DEFINITIONS(-DWITH_FFMPEG) ENDIF(WITH_FFMPEG) BLENDERLIB_NOLIST(gp_ghost "${SRC}" "${INC}") diff --git a/source/gameengine/Ketsji/CMakeLists.txt b/source/gameengine/Ketsji/CMakeLists.txt index c91a3771b45..01d369bc7a9 100644 --- a/source/gameengine/Ketsji/CMakeLists.txt +++ b/source/gameengine/Ketsji/CMakeLists.txt @@ -27,45 +27,45 @@ FILE(GLOB SRC *.cpp) SET(INC - . - ../../../source/kernel/gen_system - ../../../intern/string - ../../../intern/guardedalloc - ../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer - ../../../source/gameengine/Converter - ../../../source/blender/imbuf - ../../../intern/ghost/include - ../../../intern/moto/include - ../../../source/gameengine/Ketsji - ../../../source/blender/blenlib - ../../../source/blender/blenkernel - ../../../source/blender/python - ../../../source/blender/python/generic - ../../../source/blender - ../../../source/blender/include - ../../../source/blender/makesdna - ../../../source/gameengine/Rasterizer - ../../../source/gameengine/GameLogic - ../../../source/gameengine/Expressions - ../../../source/gameengine/Ketsji/KXNetwork - ../../../source/gameengine/Network - ../../../source/gameengine/SceneGraph - ../../../source/gameengine/Physics/common - ../../../source/gameengine/Physics/Bullet - ../../../source/gameengine/Network/LoopBackNetwork - ../../../intern/audaspace/intern - ../../../source/blender/misc - ../../../source/blender/blenloader - ../../../source/blender/gpu - ../../../extern/bullet2/src - ../../../extern/glew/include - ${PYTHON_INC} + . + ../../../source/kernel/gen_system + ../../../intern/string + ../../../intern/guardedalloc + ../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer + ../../../source/gameengine/Converter + ../../../source/blender/imbuf + ../../../intern/ghost/include + ../../../intern/moto/include + ../../../source/gameengine/Ketsji + ../../../source/blender/blenlib + ../../../source/blender/blenkernel + ../../../source/blender/python + ../../../source/blender/python/generic + ../../../source/blender + ../../../source/blender/include + ../../../source/blender/makesdna + ../../../source/gameengine/Rasterizer + ../../../source/gameengine/GameLogic + ../../../source/gameengine/Expressions + ../../../source/gameengine/Ketsji/KXNetwork + ../../../source/gameengine/Network + ../../../source/gameengine/SceneGraph + ../../../source/gameengine/Physics/common + ../../../source/gameengine/Physics/Bullet + ../../../source/gameengine/Network/LoopBackNetwork + ../../../intern/audaspace/intern + ../../../source/blender/misc + ../../../source/blender/blenloader + ../../../source/blender/gpu + ../../../extern/bullet2/src + ../../../extern/glew/include + ${PYTHON_INC} ) IF(WITH_SDL) - SET(INC ${INC} ${SDL_INCLUDE_DIR}) + SET(INC ${INC} ${SDL_INCLUDE_DIR}) ELSE(WITH_SDL) - ADD_DEFINITIONS(-DDISABLE_SDL) + ADD_DEFINITIONS(-DDISABLE_SDL) ENDIF(WITH_SDL) BLENDERLIB(bf_ketsji "${SRC}" "${INC}") diff --git a/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt b/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt index d9a9fc54f4b..b89b0dcff9f 100644 --- a/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt +++ b/source/gameengine/Ketsji/KXNetwork/CMakeLists.txt @@ -27,16 +27,16 @@ FILE(GLOB SRC *.cpp) SET(INC - . - ../../../../source/kernel/gen_system - ../../../../intern/string - ../../../../intern/moto/include - ../../../../source/gameengine/Ketsji - ../../../../source/gameengine/GameLogic - ../../../../source/gameengine/Expressions - ../../../../source/gameengine/SceneGraph - ../../../../source/gameengine/Network - ${PYTHON_INC} + . + ../../../../source/kernel/gen_system + ../../../../intern/string + ../../../../intern/moto/include + ../../../../source/gameengine/Ketsji + ../../../../source/gameengine/GameLogic + ../../../../source/gameengine/Expressions + ../../../../source/gameengine/SceneGraph + ../../../../source/gameengine/Network + ${PYTHON_INC} ) BLENDERLIB(kx_network "${SRC}" "${INC}") diff --git a/source/gameengine/Network/CMakeLists.txt b/source/gameengine/Network/CMakeLists.txt index 933f0550d0b..1e467a7d08d 100644 --- a/source/gameengine/Network/CMakeLists.txt +++ b/source/gameengine/Network/CMakeLists.txt @@ -27,10 +27,10 @@ FILE(GLOB SRC *.cpp) SET(INC - . - ../../../source/kernel/gen_system - ../../../intern/string - ../../../intern/moto/include + . + ../../../source/kernel/gen_system + ../../../intern/string + ../../../intern/moto/include ) BLENDERLIB(bf_ngnetwork "${SRC}" "${INC}") diff --git a/source/gameengine/Network/LoopBackNetwork/CMakeLists.txt b/source/gameengine/Network/LoopBackNetwork/CMakeLists.txt index 0b958920dc5..18e3d8ef496 100644 --- a/source/gameengine/Network/LoopBackNetwork/CMakeLists.txt +++ b/source/gameengine/Network/LoopBackNetwork/CMakeLists.txt @@ -27,10 +27,10 @@ SET(SRC NG_LoopBackNetworkDeviceInterface.cpp) SET(INC - . - ../../../../source/kernel/gen_system - ../../../../intern/string - ../../../../source/gameengine/Network + . + ../../../../source/kernel/gen_system + ../../../../intern/string + ../../../../source/gameengine/Network ) BLENDERLIB(bf_loopbacknetwork "${SRC}" "${INC}") diff --git a/source/gameengine/Physics/Bullet/CMakeLists.txt b/source/gameengine/Physics/Bullet/CMakeLists.txt index 7b7fb508ebd..da885122a4f 100644 --- a/source/gameengine/Physics/Bullet/CMakeLists.txt +++ b/source/gameengine/Physics/Bullet/CMakeLists.txt @@ -27,23 +27,23 @@ SET(SRC CcdPhysicsEnvironment.cpp CcdPhysicsController.cpp CcdGraphicController.cpp) SET(INC - . - ../common - ../../../../extern/bullet2/src - ../../../../extern/glew/include - ../../../../intern/moto/include - ../../../../intern/guardedalloc - ../../../kernel/gen_system - ../../../../intern/string - ../../Rasterizer - ../../Ketsji - ../../Expressions - ../../GameLogic - ../../SceneGraph - ../../../../source/blender/makesdna - ../../../../source/blender/blenlib - ../../../../source/blender/blenkernel - ${PYTHON_INC} + . + ../common + ../../../../extern/bullet2/src + ../../../../extern/glew/include + ../../../../intern/moto/include + ../../../../intern/guardedalloc + ../../../kernel/gen_system + ../../../../intern/string + ../../Rasterizer + ../../Ketsji + ../../Expressions + ../../GameLogic + ../../SceneGraph + ../../../../source/blender/makesdna + ../../../../source/blender/blenlib + ../../../../source/blender/blenkernel + ${PYTHON_INC} ) BLENDERLIB(bf_bullet "${SRC}" "${INC}") diff --git a/source/gameengine/Physics/Dummy/CMakeLists.txt b/source/gameengine/Physics/Dummy/CMakeLists.txt index 4bd29e7779b..d613bf8fd14 100644 --- a/source/gameengine/Physics/Dummy/CMakeLists.txt +++ b/source/gameengine/Physics/Dummy/CMakeLists.txt @@ -27,8 +27,8 @@ SET(SRC DummyPhysicsEnvironment.cpp) SET(INC - . - ../common + . + ../common ) BLENDERLIB(bf_dummy "${SRC}" "${INC}") diff --git a/source/gameengine/Physics/common/CMakeLists.txt b/source/gameengine/Physics/common/CMakeLists.txt index 41b2687fe38..a34bd19d400 100644 --- a/source/gameengine/Physics/common/CMakeLists.txt +++ b/source/gameengine/Physics/common/CMakeLists.txt @@ -27,9 +27,9 @@ SET(SRC PHY_IMotionState.cpp PHY_IController.cpp PHY_IPhysicsController.cpp PHY_IGraphicController.cpp PHY_IPhysicsEnvironment.cpp PHY_IVehicle.cpp) SET(INC - . - ../Dummy - ../../../intern/moto/include + . + ../Dummy + ../../../intern/moto/include ) BLENDERLIB(bf_common "${SRC}" "${INC}") diff --git a/source/gameengine/Rasterizer/CMakeLists.txt b/source/gameengine/Rasterizer/CMakeLists.txt index 143209f5a54..51d1f5001dd 100644 --- a/source/gameengine/Rasterizer/CMakeLists.txt +++ b/source/gameengine/Rasterizer/CMakeLists.txt @@ -27,15 +27,15 @@ FILE(GLOB SRC *.cpp) SET(INC - . - ../../../source/kernel/gen_system - ../../../source/blender/makesdna - ../../../source/gameengine/SceneGraph - ../../../intern/string - ../../../intern/moto/include - ../../../extern/glew/include - ../Expressions - ${PYTHON_INC} + . + ../../../source/kernel/gen_system + ../../../source/blender/makesdna + ../../../source/gameengine/SceneGraph + ../../../intern/string + ../../../intern/moto/include + ../../../extern/glew/include + ../Expressions + ${PYTHON_INC} ) BLENDERLIB(bf_rasterizer "${SRC}" "${INC}") diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt index fe3d0f6aeea..f2b97bedb2f 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt @@ -27,18 +27,18 @@ FILE(GLOB SRC *.cpp) SET(INC - ../../../../source/kernel/gen_system - ../../../../intern/string - ../../../../intern/moto/include - ../../../../source/gameengine/Rasterizer - ../../../../source/gameengine/Ketsji - ../../../../source/gameengine/SceneGraph - ../../../../extern/glew/include - ../../../../source/blender/gpu - ../../../../source/blender/makesdna - ../../../../source/blender/blenkernel - ../../../../source/blender/blenlib - ../../../../source/blender/blenloader + ../../../../source/kernel/gen_system + ../../../../intern/string + ../../../../intern/moto/include + ../../../../source/gameengine/Rasterizer + ../../../../source/gameengine/Ketsji + ../../../../source/gameengine/SceneGraph + ../../../../extern/glew/include + ../../../../source/blender/gpu + ../../../../source/blender/makesdna + ../../../../source/blender/blenkernel + ../../../../source/blender/blenlib + ../../../../source/blender/blenloader ) BLENDERLIB(bf_oglrasterizer "${SRC}" "${INC}") diff --git a/source/gameengine/SceneGraph/CMakeLists.txt b/source/gameengine/SceneGraph/CMakeLists.txt index 0409b8c0ac4..2ac52be938e 100644 --- a/source/gameengine/SceneGraph/CMakeLists.txt +++ b/source/gameengine/SceneGraph/CMakeLists.txt @@ -27,8 +27,8 @@ FILE(GLOB SRC *.cpp) SET(INC - . - ../../../intern/moto/include + . + ../../../intern/moto/include ) BLENDERLIB(bf_scenegraph "${SRC}" "${INC}") diff --git a/source/gameengine/VideoTexture/CMakeLists.txt b/source/gameengine/VideoTexture/CMakeLists.txt index 255d0907101..935c5a2c292 100644 --- a/source/gameengine/VideoTexture/CMakeLists.txt +++ b/source/gameengine/VideoTexture/CMakeLists.txt @@ -27,34 +27,34 @@ FILE(GLOB SRC *.cpp) SET(INC - . - ../../../source/gameengine/Ketsji - ../../../source/gameengine/Expressions - ../../../source/gameengine/GameLogic - ../../../source/gameengine/SceneGraph - ../../../source/gameengine/Rasterizer - ../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer - ../../../source/gameengine/BlenderRoutines - ../../../source/blender/include - ../../../source/blender/blenlib - ../../../source/blender/blenkernel - ../../../source/blender/makesdna - ../../../source/blender/editors/include - ../../../source/blender/imbuf - ../../../source/blender/python - ../../../source/blender/gpu - ../../../source/kernel/gen_system - ../../../intern/string - ../../../intern/moto/include - ../../../intern/guardedalloc - ../../../extern/glew/include - ${PYTHON_INC} + . + ../../../source/gameengine/Ketsji + ../../../source/gameengine/Expressions + ../../../source/gameengine/GameLogic + ../../../source/gameengine/SceneGraph + ../../../source/gameengine/Rasterizer + ../../../source/gameengine/Rasterizer/RAS_OpenGLRasterizer + ../../../source/gameengine/BlenderRoutines + ../../../source/blender/include + ../../../source/blender/blenlib + ../../../source/blender/blenkernel + ../../../source/blender/makesdna + ../../../source/blender/editors/include + ../../../source/blender/imbuf + ../../../source/blender/python + ../../../source/blender/gpu + ../../../source/kernel/gen_system + ../../../intern/string + ../../../intern/moto/include + ../../../intern/guardedalloc + ../../../extern/glew/include + ${PYTHON_INC} ) IF(WITH_FFMPEG) - SET(INC ${INC} ${FFMPEG_INC} ${PTHREADS_INC}) - ADD_DEFINITIONS(-DWITH_FFMPEG) - ADD_DEFINITIONS(-D__STDC_CONSTANT_MACROS) + SET(INC ${INC} ${FFMPEG_INC} ${PTHREADS_INC}) + ADD_DEFINITIONS(-DWITH_FFMPEG) + ADD_DEFINITIONS(-D__STDC_CONSTANT_MACROS) ENDIF(WITH_FFMPEG) BLENDERLIB(bf_videotex "${SRC}" "${INC}") diff --git a/source/kernel/CMakeLists.txt b/source/kernel/CMakeLists.txt index ac759393326..3aea2b9bcb0 100644 --- a/source/kernel/CMakeLists.txt +++ b/source/kernel/CMakeLists.txt @@ -27,11 +27,11 @@ SET(INC gen_messaging gen_system ../../intern/string ../../intern/moto/include ../../source/blender/blenloader ) FILE(GLOB SRC - gen_messaging/intern/messaging.c - gen_system/GEN_HashedPtr.cpp - gen_system/GEN_Matrix4x4.cpp - gen_system/SYS_SingletonSystem.cpp - gen_system/SYS_System.cpp + gen_messaging/intern/messaging.c + gen_system/GEN_HashedPtr.cpp + gen_system/GEN_Matrix4x4.cpp + gen_system/SYS_SingletonSystem.cpp + gen_system/SYS_System.cpp ) BLENDERLIB(bf_kernel "${SRC}" "${INC}") From 51aa207d200d2cef1cdc7f4e90a6a0f7a4b31c8e Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 6 Sep 2009 07:22:32 +0000 Subject: [PATCH 454/577] 2.5 Anim Bugfixes: * Rotation order code should be more correct now. Previously was only shuffling axes, and was also doing some evil things to provided that that it shouldn't have been doing, which was causing some flipping issues. * Built-in keyingsets for 'visual' options should now be more correct. The old code had typos, giving wrong array indices to start from. --- source/blender/blenlib/intern/arithb.c | 55 ++++++++++--------- source/blender/editors/animation/keyingsets.c | 14 ++--- source/blender/editors/transform/transform.c | 8 +-- 3 files changed, 41 insertions(+), 36 deletions(-) diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index 9d67ac50108..7a4aaa1a858 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -2835,9 +2835,9 @@ void EulOToQuat(float e[3], short order, float q[4]) double ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss; double a[3]; - if (R->parity) e[1] = -e[1]; + if (R->parity) e[1] = -e[1]; // xxx watch it! - ti = e[0]/2; tj = e[1]/2; th = e[2]/2; + ti = e[i]/2; tj = e[j]/2; th = e[k]/2; ci = cos(ti); cj = cos(tj); ch = cos(th); si = sin(ti); sj = sin(tj); sh = sin(th); @@ -2874,12 +2874,11 @@ void EulOToMat3(float e[3], short order, float M[3][3]) double ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss; if (R->parity) { - e[0] = -e[0]; - e[1] = -e[1]; - e[2] = -e[2]; + ti = -e[i]; tj = -e[j]; th = -e[k]; + } + else { + ti = e[i]; tj = e[j]; th = e[k]; } - - ti = e[0]; tj = e[1]; th = e[2]; ci = cos(ti); cj = cos(tj); ch = cos(th); si = sin(ti); sj = sin(tj); sh = sin(th); @@ -2908,17 +2907,17 @@ void Mat3ToEulO(float M[3][3], float e[3], short order) { RotOrderInfo *R= GET_ROTATIONORDER_INFO(order); short i=R->i, j=R->j, k=R->k; - double cy = sqrt(M[i][i]*M[i][i] + M[j][i]*M[j][i]); + double cy = sqrt(M[i][i]*M[i][i] + M[i][j]*M[i][j]); if (cy > 16*FLT_EPSILON) { - e[0] = atan2(M[j][k], M[k][k]); - e[1] = atan2(-M[i][k], cy); - e[2] = atan2(M[i][j], M[i][i]); + e[i] = atan2(M[j][k], M[k][k]); + e[j] = atan2(-M[i][k], cy); + e[k] = atan2(M[i][j], M[i][i]); } else { - e[0] = atan2(-M[k][j], M[j][j]); - e[1] = atan2(-M[i][k], cy); - e[2] = 0; + e[i] = atan2(-M[k][j], M[j][j]); + e[j] = atan2(-M[i][k], cy); + e[k] = 0; } if (R->parity) { @@ -2944,21 +2943,28 @@ static void mat3_to_eulo2(float M[3][3], float *e1, float *e2, short order) { RotOrderInfo *R= GET_ROTATIONORDER_INFO(order); short i=R->i, j=R->j, k=R->k; - double cy = sqrt(M[i][i]*M[i][i] + M[j][i]*M[j][i]); + float m[3][3]; + double cy; + + /* process the matrix first */ + Mat3CpyMat3(m, M); + Mat3Ortho(m); + + cy= sqrt(m[i][i]*m[i][i] + m[i][j]*m[i][j]); if (cy > 16*FLT_EPSILON) { - e1[0] = atan2(M[j][k], M[k][k]); - e1[1] = atan2(-M[i][k], cy); - e1[2] = atan2(M[i][j], M[i][i]); + e1[i] = atan2(m[j][k], m[k][k]); + e1[j] = atan2(-m[i][k], cy); + e1[k] = atan2(m[i][j], m[i][i]); - e2[0] = atan2(-M[j][k], -M[k][k]); - e2[1] = atan2(-M[i][k], -cy); - e2[2] = atan2(-M[i][j], -M[i][i]); + e2[i] = atan2(-m[j][k], -m[k][k]); + e2[j] = atan2(-m[i][k], -cy); + e2[k] = atan2(-m[i][j], -m[i][i]); } else { - e1[0] = atan2(-M[k][j], M[j][j]); - e1[1] = atan2(-M[i][k], cy); - e1[2] = 0; + e1[i] = atan2(-m[k][j], m[j][j]); + e1[j] = atan2(-m[i][k], cy); + e1[k] = 0; VecCopyf(e2, e1); } @@ -2975,7 +2981,6 @@ static void mat3_to_eulo2(float M[3][3], float *e1, float *e2, short order) } /* uses 2 methods to retrieve eulers, and picks the closest */ -// FIXME: this does not work well with the other rotation modes... void Mat3ToCompatibleEulO(float mat[3][3], float eul[3], float oldrot[3], short order) { float eul1[3], eul2[3]; diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 15d47211615..2639d49b5be 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -801,24 +801,24 @@ static bBuiltinKeyingSet def_builtin_keyingsets_v3d[] = /* Keying Sets with Keying Flags ************************* */ /* Keying Set - "VisualLoc" ---------- */ - BI_KS_DEFINE_BEGIN("VisualLoc", 0) + BI_KS_DEFINE_BEGIN("VisualLoc", INSERTKEY_MATRIX) BI_KS_PATHS_BEGIN(1) - BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN, "location", INSERTKEY_MATRIX, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM) + BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN, "location", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM) BI_KS_PATHS_END BI_KS_DEFINE_END, /* Keying Set - "Rotation" ---------- */ - BI_KS_DEFINE_BEGIN("VisualRot", 0) + BI_KS_DEFINE_BEGIN("VisualRot", INSERTKEY_MATRIX) BI_KS_PATHS_BEGIN(1) - BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN|KSP_TEMPLATE_PCHAN_ROT, "rotation", INSERTKEY_MATRIX, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM) + BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN|KSP_TEMPLATE_PCHAN_ROT, "rotation", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM) BI_KS_PATHS_END BI_KS_DEFINE_END, /* Keying Set - "VisualLocRot" ---------- */ - BI_KS_DEFINE_BEGIN("VisualLocRot", 0) + BI_KS_DEFINE_BEGIN("VisualLocRot", INSERTKEY_MATRIX) BI_KS_PATHS_BEGIN(2) - BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN, "location", INSERTKEY_MATRIX, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM), - BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN|KSP_TEMPLATE_PCHAN_ROT, "rotation", INSERTKEY_MATRIX, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM) + BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN, "location", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM), + BI_KSP_DEFINE(ID_OB, KSP_TEMPLATE_OBJECT|KSP_TEMPLATE_PCHAN|KSP_TEMPLATE_PCHAN_ROT, "rotation", 0, KSP_FLAG_WHOLE_ARRAY, KSP_GROUP_TEMPLATE_ITEM) BI_KS_PATHS_END BI_KS_DEFINE_END }; diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 370e98ebd07..1f568be3e10 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1738,12 +1738,12 @@ static void constraintRotLim(TransInfo *t, TransData *td) eul[1]= tdi->roty[0]; eul[2]= tdi->rotz[0]; - EulToMat4(eul, cob.matrix); + EulOToMat4(eul, td->rotOrder, cob.matrix); } else { /* eulers */ if (td->ext) - EulToMat4(td->ext->rot, cob.matrix); + EulOToMat4(td->ext->rot, td->rotOrder, cob.matrix); else return; } @@ -1796,7 +1796,7 @@ static void constraintRotLim(TransInfo *t, TransData *td) TransDataIpokey *tdi= td->tdi; float eul[3]; - Mat4ToEul(cob.matrix, eul); + Mat4ToEulO(cob.matrix, eul, td->rotOrder); tdi->rotx[0]= eul[0]; tdi->roty[0]= eul[1]; @@ -1804,7 +1804,7 @@ static void constraintRotLim(TransInfo *t, TransData *td) } else { /* eulers */ - Mat4ToEul(cob.matrix, td->ext->rot); + Mat4ToEulO(cob.matrix, td->ext->rot, td->rotOrder); } } } From fb649d5824ccccca544c905209ba64340dc1bded Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sun, 6 Sep 2009 13:20:05 +0000 Subject: [PATCH 455/577] * cleaning up warnings (mostly windows). A collection of other warning fixes too (undefined function, assuming int, etc.) This compiled fine with scons/msvc and scons/mingw (gcc 4.4.0). Please test and report any problems. --- intern/iksolver/intern/TNT/tntmath.h | 4 ++- intern/smoke/intern/tnt/tnt_math_utils.h | 4 ++- intern/string/STR_String.h | 4 +++ source/blender/blenkernel/intern/image.c | 5 +++ source/blender/blenkernel/intern/packedFile.c | 8 +++++ source/blender/blenkernel/intern/pointcache.c | 18 +++------- source/blender/blenkernel/intern/sound.c | 2 +- source/blender/blenlib/BLI_fileops.h | 2 -- source/blender/blenlib/BLI_winstuff.h | 31 +++++++---------- source/blender/blenlib/intern/bpath.c | 34 ++++++++++--------- source/blender/blenlib/intern/fileops.c | 14 ++++---- source/blender/blenlib/intern/storage.c | 15 ++++---- .../blender/blenloader/intern/readblenentry.c | 9 +++-- source/blender/blenloader/intern/readfile.c | 7 ++-- source/blender/blenloader/intern/writefile.c | 14 ++++---- .../editors/armature/editarmature_generate.c | 1 + .../editors/interface/interface_icons.c | 1 + source/blender/editors/mesh/meshtools.c | 1 + .../editors/space_buttons/buttons_ops.c | 1 + source/blender/imbuf/intern/anim5.c | 6 ++++ source/blender/imbuf/intern/hamx.c | 10 +++--- source/blender/imbuf/intern/iff.c | 7 ++-- source/blender/imbuf/intern/thumbs.c | 20 +++++------ source/blender/imbuf/intern/writeimage.c | 8 ++--- source/blender/python/intern/bpy_interface.c | 11 +++--- .../readblenfile/intern/BLO_readblenfile.c | 1 + .../blender/windowmanager/intern/wm_files.c | 2 +- .../Converter/KX_ConvertProperties.cpp | 10 +++--- source/gameengine/Ketsji/KX_PythonInit.cpp | 14 ++++---- source/gameengine/VideoTexture/SConscript | 1 - 30 files changed, 143 insertions(+), 122 deletions(-) diff --git a/intern/iksolver/intern/TNT/tntmath.h b/intern/iksolver/intern/TNT/tntmath.h index 5773900caf9..55a79e2aba0 100644 --- a/intern/iksolver/intern/TNT/tntmath.h +++ b/intern/iksolver/intern/TNT/tntmath.h @@ -35,7 +35,9 @@ // conventional functions required by several matrix algorithms - +#ifdef _WIN32 +#define hypot _hypot +#endif namespace TNT { diff --git a/intern/smoke/intern/tnt/tnt_math_utils.h b/intern/smoke/intern/tnt/tnt_math_utils.h index 6e14a1d9b90..f6aad8eaf38 100644 --- a/intern/smoke/intern/tnt/tnt_math_utils.h +++ b/intern/smoke/intern/tnt/tnt_math_utils.h @@ -4,7 +4,9 @@ /* needed for fabs, sqrt() below */ #include - +#ifdef _WIN32 +#define hypot _hypot +#endif namespace TNT { diff --git a/intern/string/STR_String.h b/intern/string/STR_String.h index a5e7a0721ec..d8023a06f81 100644 --- a/intern/string/STR_String.h +++ b/intern/string/STR_String.h @@ -54,6 +54,10 @@ using namespace std; #include "MEM_guardedalloc.h" #endif +#ifdef _WIN32 +#define stricmp _stricmp +#endif + class STR_String; typedef unsigned long dword; diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index eb8872c43a5..cdb175ed661 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -38,6 +38,11 @@ #include +#ifdef _WIN32 +#define open _open +#define close _close +#endif + #include "MEM_guardedalloc.h" #include "IMB_imbuf_types.h" diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index 3e47c1006e5..bd0b1a5e36e 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -63,6 +63,14 @@ #include "BKE_packedFile.h" #include "BKE_report.h" +#ifdef _WIN32 +#define open _open +#define close _close +#define read _read +#define write _write +#endif + + int seekPackedFile(PackedFile *pf, int offset, int whence) { int oldseek = -1, seek = 0; diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 3e429749953..912acc4786f 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -67,23 +67,13 @@ /* needed for directory lookup */ +/* untitled blend's need getpid for a unique name */ #ifndef WIN32 #include -#else - #include "BLI_winstuff.h" -#endif - -/* untitled blend's need getpid for a unique name */ -#ifdef WIN32 -#include -#else #include -#endif - -#ifdef _WIN32 -#ifndef snprintf -#define snprintf _snprintf -#endif +#else +#include + #include "BLI_winstuff.h" #endif static void ptcache_data_to(void **data, int type, int index, void *to); diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 06ef8a23142..2d5d8dad7a8 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -250,12 +250,12 @@ void sound_free(struct bSound* sound) void sound_unlink(struct bContext *C, struct bSound* sound) { - bSound *snd; Scene *scene; SoundHandle *handle; // XXX unused currently #if 0 + bSound *snd; for(snd = CTX_data_main(C)->sound.first; snd; snd = snd->id.next) { if(snd->child_sound == sound) diff --git a/source/blender/blenlib/BLI_fileops.h b/source/blender/blenlib/BLI_fileops.h index d2dd40b21a5..0c1cdbc4d3a 100644 --- a/source/blender/blenlib/BLI_fileops.h +++ b/source/blender/blenlib/BLI_fileops.h @@ -36,8 +36,6 @@ #ifndef BLI_FILEOPS_H #define BLI_FILEOPS_H - - void BLI_recurdir_fileops(char *dirname); int BLI_link(char *file, char *to); int BLI_is_writable(char *filename); diff --git a/source/blender/blenlib/BLI_winstuff.h b/source/blender/blenlib/BLI_winstuff.h index fad45f1b6c3..b46ebebacd5 100644 --- a/source/blender/blenlib/BLI_winstuff.h +++ b/source/blender/blenlib/BLI_winstuff.h @@ -65,24 +65,7 @@ extern "C" { #endif -# ifndef _WIN64 - #ifndef M_PI - #define M_PI 3.14159265358979323846 - #endif - #ifndef M_PI_2 - #define M_PI_2 1.57079632679489661923 - #endif - #ifndef M_SQRT2 - #define M_SQRT2 1.41421356237309504880 - #endif - #ifndef M_SQRT1_2 - #define M_SQRT1_2 0.70710678118654752440 - #endif - #ifndef M_1_PI - #define M_1_PI 0.318309886183790671538 - #endif -#endif - +#define _USE_MATH_DEFINES #define MAXPATHLEN MAX_PATH #ifndef S_ISREG @@ -92,6 +75,18 @@ extern "C" { #define S_ISDIR(x) ((x&S_IFMT) == S_IFDIR) #endif +/* defines for using ISO C++ conformant names */ +#define open _open +#define close _close +#define write _write +#define read _read +#define getcwd _getcwd +#define chdir _chdir +#define strdup _strdup +#define lseek _lseek +#define getpid _getpid +#define snprintf _snprintf + #ifndef FREE_WINDOWS typedef unsigned int mode_t; #endif diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index 6c89afe7173..cadf8d2bdd1 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -26,6 +26,24 @@ * ***** END GPL LICENSE BLOCK ***** */ +#include +#include + +#include +#include +#include +#include +#include + +/* path/file handeling stuff */ +#ifndef WIN32 + #include + #include +#else + #include + #include "BLI_winstuff.h" +#endif + #include "MEM_guardedalloc.h" #include "DNA_ID.h" /* Library */ @@ -53,23 +71,7 @@ //XXX define below from BSE_sequence.h - otherwise potentially odd behaviour #define SEQ_HAS_PATH(seq) (seq->type==SEQ_MOVIE || seq->type==SEQ_IMAGE) -/* path/file handeling stuff */ -#ifndef WIN32 - #include - #include -#else - #include "BLI_winstuff.h" - #include -#endif -#include -#include - -#include -#include -#include -#include -#include #define FILE_MAX 240 diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index 0228032df01..e7dc9b0eb1f 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -31,27 +31,29 @@ #include #include +#include +#include +#include + +#include + #include "zlib.h" #ifdef WIN32 -#include "BLI_winstuff.h" #include +#include "BLI_winstuff.h" #else #include // for read close #include #endif + #include "BLI_blenlib.h" #include "BLI_storage.h" #include "BLI_fileops.h" #include "BLI_callbacks.h" -#include -#include -#include - #include "BKE_utildefines.h" -#include #include "BLO_sys_types.h" // for intptr_t support diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index 7cbef85b938..cdc5cec705f 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -33,13 +33,6 @@ #include #include -#ifdef WIN32 -#include "BLI_winstuff.h" -#include -#include -#include -#endif - #ifndef WIN32 #include #endif @@ -82,6 +75,14 @@ #include #endif +#ifdef WIN32 +#include +#include +#include +#include "BLI_winstuff.h" +#endif + + /* lib includes */ #include "MEM_guardedalloc.h" diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index 33641a0b004..1c21c1817e6 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -32,13 +32,14 @@ #include #endif -#include "BLI_storage.h" /* _LARGEFILE_SOURCE */ - #include #include #include #include + +#include "BLI_storage.h" /* _LARGEFILE_SOURCE */ + #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" @@ -67,6 +68,10 @@ #include "BLO_sys_types.h" // needed for intptr_t +#ifdef _WIN32 +#include "BLI_winstuff.h" +#endif + /** * IDType stuff, I plan to move this * out into its own file + prefix, and diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 6a26a71ee3d..0c4835a79b7 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -29,11 +29,6 @@ #include "zlib.h" -#ifdef WIN32 -#include "winsock2.h" -#include "BLI_winstuff.h" -#endif - #include #include // for printf fopen fwrite fclose sprintf FILE #include // for getenv atoi @@ -46,6 +41,8 @@ #include // for MAXPATHLEN #else #include // for open close read +#include "winsock2.h" +#include "BLI_winstuff.h" #endif #include "DNA_anim_types.h" diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index c4a94660932..a22e4f66c8d 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -72,23 +72,23 @@ Any case: direct data is ALWAYS after the lib block #include #endif +#include +#include +#include +#include +#include + #include "zlib.h" #ifndef WIN32 #include #else #include "winsock2.h" -#include "BLI_winstuff.h" #include #include // for getpid +#include "BLI_winstuff.h" #endif -#include -#include -#include -#include -#include - #include "DNA_anim_types.h" #include "DNA_armature_types.h" #include "DNA_action_types.h" diff --git a/source/blender/editors/armature/editarmature_generate.c b/source/blender/editors/armature/editarmature_generate.c index 6c0eab16af0..d327ed34839 100644 --- a/source/blender/editors/armature/editarmature_generate.c +++ b/source/blender/editors/armature/editarmature_generate.c @@ -30,6 +30,7 @@ #include #include +#include #include "MEM_guardedalloc.h" diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 549164c23a1..6c4110c8c37 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -34,6 +34,7 @@ #else #include #include +#include "BLI_winstuff.h" #endif #include "MEM_guardedalloc.h" diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 2ef1d3b214d..4aa99820a6e 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "MEM_guardedalloc.h" diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 60480a9f165..1567f393d87 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -74,6 +74,7 @@ #include "ED_curve.h" #include "ED_mesh.h" +#include "ED_particle.h" #include "RNA_access.h" #include "RNA_define.h" diff --git a/source/blender/imbuf/intern/anim5.c b/source/blender/imbuf/intern/anim5.c index b6f29b6a145..4fe4217cd2c 100644 --- a/source/blender/imbuf/intern/anim5.c +++ b/source/blender/imbuf/intern/anim5.c @@ -31,6 +31,7 @@ #include "BLI_blenlib.h" /* BLI_remlink BLI_filesize BLI_addtail BLI_countlist BLI_stringdec */ + #include "imbuf.h" #include "imbuf_patch.h" @@ -46,6 +47,11 @@ #include "IMB_anim5.h" +#ifdef _WIN32 +#include +#include "BLI_winstuff.h" +#endif + typedef struct Anhd{ unsigned char type, mask; unsigned short w, h; diff --git a/source/blender/imbuf/intern/hamx.c b/source/blender/imbuf/intern/hamx.c index 2f32d155407..258c196fcdf 100644 --- a/source/blender/imbuf/intern/hamx.c +++ b/source/blender/imbuf/intern/hamx.c @@ -31,11 +31,6 @@ #include "BLI_blenlib.h" -#ifdef WIN32 -#include -#endif - - #include "imbuf.h" #include "imbuf_patch.h" #include "IMB_imbuf_types.h" @@ -46,6 +41,11 @@ #include "IMB_ham.h" #include "IMB_hamx.h" +#ifdef WIN32 +#include +#include "BLI_winstuff.h" +#endif + /* actually hard coded endianness */ #define GET_BIG_LONG(x) (((uchar *) (x))[0] << 24 | ((uchar *) (x))[1] << 16 | ((uchar *) (x))[2] << 8 | ((uchar *) (x))[3]) #define GET_LITTLE_LONG(x) (((uchar *) (x))[3] << 24 | ((uchar *) (x))[2] << 16 | ((uchar *) (x))[1] << 8 | ((uchar *) (x))[0]) diff --git a/source/blender/imbuf/intern/iff.c b/source/blender/imbuf/intern/iff.c index c3695173068..5fd823e78c1 100644 --- a/source/blender/imbuf/intern/iff.c +++ b/source/blender/imbuf/intern/iff.c @@ -29,14 +29,15 @@ * $Id$ */ -#ifdef WIN32 -#include -#endif #include "BLI_blenlib.h" #include "imbuf.h" #include "imbuf_patch.h" #include "IMB_imbuf_types.h" #include "IMB_iff.h" +#ifdef WIN32 +#include +#include "BLI_winstuff.h" +#endif unsigned short imb_start_iff(struct ImBuf *ibuf, int file) { diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c index 86ca43824f3..6053c5556f1 100644 --- a/source/blender/imbuf/intern/thumbs.c +++ b/source/blender/imbuf/intern/thumbs.c @@ -39,31 +39,29 @@ #include "IMB_thumbs.h" #include "IMB_imginfo.h" - #include "md5.h" +#include +#include +#include +#include +#include +#include +#include + #ifdef WIN32 #include /* need to include windows.h so _WIN32_IE is defined */ #ifndef _WIN32_IE #define _WIN32_IE 0x0400 /* minimal requirements for SHGetSpecialFolderPath on MINGW MSVC has this defined already */ #endif #include /* for SHGetSpecialFolderPath, has to be done before BLI_winstuff because 'near' is disabled through BLI_windstuff */ -#include "BLI_winstuff.h" #include /* getpid */ #include /* chdir */ +#include "BLI_winstuff.h" #else #include #endif -#include -#include -#include -#include -#include -#include -#include -#include - #define URI_MAX FILE_MAX*3 + 8 static int get_thumb_dir( char* dir , ThumbSize size) diff --git a/source/blender/imbuf/intern/writeimage.c b/source/blender/imbuf/intern/writeimage.c index 7e1120bf3e4..b3af727190a 100644 --- a/source/blender/imbuf/intern/writeimage.c +++ b/source/blender/imbuf/intern/writeimage.c @@ -29,10 +29,6 @@ * $Id$ */ -#ifdef WIN32 -#include -#endif - #include #include "BKE_global.h" @@ -71,6 +67,10 @@ #include "IMB_bitplanes.h" #include "IMB_divers.h" +#ifdef WIN32 +#include +#include "BLI_winstuff.h" +#endif /* added facility to copy with saving non-float rects */ short IMB_saveiff(struct ImBuf *ibuf, char *name, int flags) diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index a935b517f77..a85bcd011a6 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -28,11 +28,6 @@ #include #include -#ifndef WIN32 -#include -#else -#include "BLI_winstuff.h" -#endif /* grr, python redefines */ #ifdef _POSIX_C_SOURCE @@ -48,6 +43,12 @@ #include "bpy_ui.h" #include "bpy_util.h" +#ifndef WIN32 +#include +#else +#include "BLI_winstuff.h" +#endif + #include "DNA_anim_types.h" #include "DNA_space_types.h" #include "DNA_text_types.h" diff --git a/source/blender/readblenfile/intern/BLO_readblenfile.c b/source/blender/readblenfile/intern/BLO_readblenfile.c index 40a991ad702..5672b9f4cb2 100644 --- a/source/blender/readblenfile/intern/BLO_readblenfile.c +++ b/source/blender/readblenfile/intern/BLO_readblenfile.c @@ -43,6 +43,7 @@ #ifdef WIN32 #include // read, open +#include "BLI_winstuff.h" #else // ! WIN32 #include // read #endif diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 3921da4f062..a6e38a61e0f 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -37,8 +37,8 @@ #define _WIN32_IE 0x0400 /* minimal requirements for SHGetSpecialFolderPath on MINGW MSVC has this defined already */ #endif #include /* for SHGetSpecialFolderPath, has to be done before BLI_winstuff because 'near' is disabled through BLI_windstuff */ -#include "BLI_winstuff.h" #include /* getpid */ +#include "BLI_winstuff.h" #else #include /* getpid */ #endif diff --git a/source/gameengine/Converter/KX_ConvertProperties.cpp b/source/gameengine/Converter/KX_ConvertProperties.cpp index 5e8d6f3cbf0..1c22d2a0600 100644 --- a/source/gameengine/Converter/KX_ConvertProperties.cpp +++ b/source/gameengine/Converter/KX_ConvertProperties.cpp @@ -32,26 +32,26 @@ #include #endif -/* This little block needed for linking to Blender... */ -#ifdef WIN32 -#include "BLI_winstuff.h" -#endif #include "DNA_object_types.h" #include "DNA_property_types.h" /* end of blender include block */ + #include "Value.h" #include "VectorValue.h" #include "BoolValue.h" #include "StringValue.h" #include "FloatValue.h" #include "KX_GameObject.h" -//#include "ListValue.h" #include "IntValue.h" #include "SCA_TimeEventManager.h" #include "SCA_IScene.h" +/* This little block needed for linking to Blender... */ +#ifdef WIN32 +#include "BLI_winstuff.h" +#endif void BL_ConvertProperties(Object* object,KX_GameObject* gameobj,SCA_TimeEventManager* timemgr,SCA_IScene* scene, bool isInActiveLayer) { diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 9e81bcb3871..298d485aaaf 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -32,11 +32,6 @@ // directory header for py function getBlendFileList #include -#ifndef WIN32 - #include -#else - #include "BLI_winstuff.h" -#endif #ifdef WIN32 #pragma warning (disable : 4786) @@ -80,8 +75,6 @@ extern "C" { #include "InputParser.h" #include "KX_Scene.h" -#include "NG_NetworkScene.h" //Needed for sendMessage() - #include "BL_Shader.h" #include "KX_PyMath.h" @@ -111,6 +104,13 @@ extern "C" { #include "BLI_blenlib.h" #include "GPU_material.h" +#ifndef WIN32 + #include +#else + #include "BLI_winstuff.h" +#endif +#include "NG_NetworkScene.h" //Needed for sendMessage() + static void setSandbox(TPythonSecurityLevel level); // 'local' copy of canvas ptr, for window height/width python scripts diff --git a/source/gameengine/VideoTexture/SConscript b/source/gameengine/VideoTexture/SConscript index 0d3e495f3e2..119bd1c9954 100644 --- a/source/gameengine/VideoTexture/SConscript +++ b/source/gameengine/VideoTexture/SConscript @@ -25,6 +25,5 @@ incs += ' ' + env['BF_PYTHON_INC'] if env['WITH_BF_FFMPEG']: defs.append('WITH_FFMPEG') incs += ' ' + env['BF_FFMPEG_INC'] + ' ' + env['BF_PTHREADS_INC'] - defs.append('__STDC_CONSTANT_MACROS') env.BlenderLib ( 'bf_videotex', sources, Split(incs), defs, libtype=['core','player'], priority=[300,205], cxx_compileflags=env['BGE_CXXFLAGS']) From 3d64d65ad9c43f82bd4b9241b4a7fdde0fd12000 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sun, 6 Sep 2009 14:32:02 +0000 Subject: [PATCH 456/577] * clean out some warnings (unrefenced vars mainly) --- intern/audaspace/FX/AUD_DoubleReader.cpp | 2 +- intern/audaspace/FX/AUD_PingPongFactory.cpp | 2 +- intern/audaspace/OpenAL/AUD_OpenALDevice.cpp | 14 +++---- intern/audaspace/SDL/AUD_SDLMixerReader.cpp | 2 +- intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp | 8 ++-- intern/audaspace/intern/AUD_C-API.cpp | 42 ++++++++++---------- intern/audaspace/jack/AUD_JackDevice.cpp | 8 ++-- 7 files changed, 39 insertions(+), 39 deletions(-) diff --git a/intern/audaspace/FX/AUD_DoubleReader.cpp b/intern/audaspace/FX/AUD_DoubleReader.cpp index 181e394da98..8d3afbf2f1d 100644 --- a/intern/audaspace/FX/AUD_DoubleReader.cpp +++ b/intern/audaspace/FX/AUD_DoubleReader.cpp @@ -47,7 +47,7 @@ AUD_DoubleReader::AUD_DoubleReader(AUD_IReader* reader1, AUD_THROW(AUD_ERROR_READER); } - catch(AUD_Exception e) + catch(AUD_Exception) { if(reader1) { diff --git a/intern/audaspace/FX/AUD_PingPongFactory.cpp b/intern/audaspace/FX/AUD_PingPongFactory.cpp index a030d581b1a..8b72afe05e7 100644 --- a/intern/audaspace/FX/AUD_PingPongFactory.cpp +++ b/intern/audaspace/FX/AUD_PingPongFactory.cpp @@ -46,7 +46,7 @@ AUD_IReader* AUD_PingPongFactory::createReader() { reader2 = factory.createReader(); } - catch(AUD_Exception e) + catch(AUD_Exception) { reader2 = 0; } diff --git a/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp b/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp index f94b11a11b8..b33afa2b955 100644 --- a/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp +++ b/intern/audaspace/OpenAL/AUD_OpenALDevice.cpp @@ -544,13 +544,13 @@ AUD_Handle* AUD_OpenALDevice::play(AUD_IFactory* factory, bool keep) if(alGetError() != AL_NO_ERROR) AUD_THROW(AUD_ERROR_OPENAL); } - catch(AUD_Exception e) + catch(AUD_Exception) { alDeleteSources(1, &sound->source); throw; } } - catch(AUD_Exception e) + catch(AUD_Exception) { delete sound; AUD_DELETE("handle") alcProcessContext(m_context); @@ -648,19 +648,19 @@ AUD_Handle* AUD_OpenALDevice::play(AUD_IFactory* factory, bool keep) if(alGetError() != AL_NO_ERROR) AUD_THROW(AUD_ERROR_OPENAL); } - catch(AUD_Exception e) + catch(AUD_Exception) { alDeleteSources(1, &sound->source); throw; } } - catch(AUD_Exception e) + catch(AUD_Exception) { alDeleteBuffers(AUD_OPENAL_CYCLE_BUFFERS, sound->buffers); throw; } } - catch(AUD_Exception e) + catch(AUD_Exception) { delete sound; AUD_DELETE("handle") delete reader; AUD_DELETE("reader") @@ -1051,13 +1051,13 @@ bool AUD_OpenALDevice::setCapability(int capability, void *value) if(alGetError() != AL_NO_ERROR) AUD_THROW(AUD_ERROR_OPENAL); } - catch(AUD_Exception e) + catch(AUD_Exception) { alDeleteBuffers(1, &bf->buffer); throw; } } - catch(AUD_Exception e) + catch(AUD_Exception) { delete bf; AUD_DELETE("bufferedfactory") delete reader; AUD_DELETE("reader") diff --git a/intern/audaspace/SDL/AUD_SDLMixerReader.cpp b/intern/audaspace/SDL/AUD_SDLMixerReader.cpp index ec61f99f02d..0a47e36533a 100644 --- a/intern/audaspace/SDL/AUD_SDLMixerReader.cpp +++ b/intern/audaspace/SDL/AUD_SDLMixerReader.cpp @@ -87,7 +87,7 @@ AUD_SDLMixerReader::AUD_SDLMixerReader(AUD_IReader* reader, specs.rate) == -1) AUD_THROW(AUD_ERROR_SDL); } - catch(AUD_Exception e) + catch(AUD_Exception) { delete m_reader; AUD_DELETE("reader") throw; diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp index d70a9c25bcb..0384ba5e0e6 100644 --- a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp +++ b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp @@ -119,7 +119,7 @@ AUD_FFMPEGReader::AUD_FFMPEGReader(const char* filename) // find audio stream and codec m_stream = -1; - for(int i = 0; i < m_formatCtx->nb_streams; i++) + for(unsigned int i = 0; i < m_formatCtx->nb_streams; i++) if((m_formatCtx->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO) && (m_stream < 0)) { @@ -146,7 +146,7 @@ AUD_FFMPEGReader::AUD_FFMPEGReader(const char* filename) m_specs.format = FFMPEG_TO_AUD(m_codecCtx->sample_fmt); m_specs.rate = (AUD_SampleRate) m_codecCtx->sample_rate; } - catch(AUD_Exception e) + catch(AUD_Exception) { av_close_input_file(m_formatCtx); throw; @@ -188,7 +188,7 @@ AUD_FFMPEGReader::AUD_FFMPEGReader(AUD_Reference buffer) // find audio stream and codec m_stream = -1; - for(int i = 0; i < m_formatCtx->nb_streams; i++) + for(unsigned int i = 0; i < m_formatCtx->nb_streams; i++) if((m_formatCtx->streams[i]->codec->codec_type == CODEC_TYPE_AUDIO) && (m_stream < 0)) { @@ -215,7 +215,7 @@ AUD_FFMPEGReader::AUD_FFMPEGReader(AUD_Reference buffer) m_specs.format = FFMPEG_TO_AUD(m_codecCtx->sample_fmt); m_specs.rate = (AUD_SampleRate) m_codecCtx->sample_rate; } - catch(AUD_Exception e) + catch(AUD_Exception) { av_close_input_stream(m_formatCtx); av_free(m_byteiocontext); AUD_DELETE("byteiocontext") diff --git a/intern/audaspace/intern/AUD_C-API.cpp b/intern/audaspace/intern/AUD_C-API.cpp index 995d4c5f99e..7a624aa53fd 100644 --- a/intern/audaspace/intern/AUD_C-API.cpp +++ b/intern/audaspace/intern/AUD_C-API.cpp @@ -116,7 +116,7 @@ int AUD_init(AUD_DeviceType device, AUD_Specs specs, int buffersize) return true; } - catch(AUD_Exception e) + catch(AUD_Exception) { return false; } @@ -204,7 +204,7 @@ AUD_Sound* AUD_bufferSound(AUD_Sound* sound) { return new AUD_StreamBufferFactory(sound); } - catch(AUD_Exception e) + catch(AUD_Exception) { return NULL; } @@ -218,7 +218,7 @@ AUD_Sound* AUD_delaySound(AUD_Sound* sound, float delay) { return new AUD_DelayFactory(sound, delay); } - catch(AUD_Exception e) + catch(AUD_Exception) { return NULL; } @@ -232,7 +232,7 @@ extern AUD_Sound* AUD_limitSound(AUD_Sound* sound, float start, float end) { return new AUD_LimiterFactory(sound, start, end); } - catch(AUD_Exception e) + catch(AUD_Exception) { return NULL; } @@ -246,7 +246,7 @@ AUD_Sound* AUD_pingpongSound(AUD_Sound* sound) { return new AUD_PingPongFactory(sound); } - catch(AUD_Exception e) + catch(AUD_Exception) { return NULL; } @@ -260,7 +260,7 @@ AUD_Sound* AUD_loopSound(AUD_Sound* sound) { return new AUD_LoopFactory(sound); } - catch(AUD_Exception e) + catch(AUD_Exception) { return NULL; } @@ -278,7 +278,7 @@ int AUD_stopLoop(AUD_Handle* handle) { return AUD_device->sendMessage(handle, message); } - catch(AUD_Exception e) + catch(AUD_Exception) { } } @@ -299,7 +299,7 @@ AUD_Handle* AUD_play(AUD_Sound* sound, int keep) { return AUD_device->play(sound, keep); } - catch(AUD_Exception e) + catch(AUD_Exception) { return NULL; } @@ -360,7 +360,7 @@ AUD_Handle* AUD_play3D(AUD_Sound* sound, int keep) else return AUD_device->play(sound, keep); } - catch(AUD_Exception e) + catch(AUD_Exception) { return NULL; } @@ -376,7 +376,7 @@ int AUD_updateListener(AUD_3DData* data) if(AUD_3ddevice) return AUD_3ddevice->updateListener(*data); } - catch(AUD_Exception e) + catch(AUD_Exception) { } return false; @@ -391,7 +391,7 @@ int AUD_set3DSetting(AUD_3DSetting setting, float value) if(AUD_3ddevice) return AUD_3ddevice->setSetting(setting, value); } - catch(AUD_Exception e) + catch(AUD_Exception) { } return false; @@ -406,7 +406,7 @@ float AUD_get3DSetting(AUD_3DSetting setting) if(AUD_3ddevice) return AUD_3ddevice->getSetting(setting); } - catch(AUD_Exception e) + catch(AUD_Exception) { } return 0.0; @@ -424,7 +424,7 @@ int AUD_update3DSource(AUD_Handle* handle, AUD_3DData* data) if(AUD_3ddevice) return AUD_3ddevice->updateSource(handle, *data); } - catch(AUD_Exception e) + catch(AUD_Exception) { } } @@ -443,7 +443,7 @@ int AUD_set3DSourceSetting(AUD_Handle* handle, if(AUD_3ddevice) return AUD_3ddevice->setSourceSetting(handle, setting, value); } - catch(AUD_Exception e) + catch(AUD_Exception) { } } @@ -461,7 +461,7 @@ float AUD_get3DSourceSetting(AUD_Handle* handle, AUD_3DSourceSetting setting) if(AUD_3ddevice) return AUD_3ddevice->getSourceSetting(handle, setting); } - catch(AUD_Exception e) + catch(AUD_Exception) { } } @@ -481,7 +481,7 @@ int AUD_setSoundVolume(AUD_Handle* handle, float volume) { return AUD_device->setCapability(AUD_CAPS_SOURCE_VOLUME, &caps); } - catch(AUD_Exception e) {} + catch(AUD_Exception) {} } return false; } @@ -499,7 +499,7 @@ int AUD_setSoundPitch(AUD_Handle* handle, float pitch) { return AUD_device->setCapability(AUD_CAPS_SOURCE_PITCH, &caps); } - catch(AUD_Exception e) {} + catch(AUD_Exception) {} } return false; } @@ -510,7 +510,7 @@ AUD_Device* AUD_openReadDevice(AUD_Specs specs) { return new AUD_ReadDevice(specs); } - catch(AUD_Exception e) + catch(AUD_Exception) { return NULL; } @@ -525,7 +525,7 @@ int AUD_playDevice(AUD_Device* device, AUD_Sound* sound) { return device->play(sound) != NULL; } - catch(AUD_Exception e) + catch(AUD_Exception) { return false; } @@ -540,7 +540,7 @@ int AUD_readDevice(AUD_Device* device, sample_t* buffer, int length) { return device->read(buffer, length); } - catch(AUD_Exception e) + catch(AUD_Exception) { return false; } @@ -554,7 +554,7 @@ void AUD_closeReadDevice(AUD_Device* device) { delete device; } - catch(AUD_Exception e) + catch(AUD_Exception) { } } diff --git a/intern/audaspace/jack/AUD_JackDevice.cpp b/intern/audaspace/jack/AUD_JackDevice.cpp index 445e68e1a9a..4d8ab93d672 100644 --- a/intern/audaspace/jack/AUD_JackDevice.cpp +++ b/intern/audaspace/jack/AUD_JackDevice.cpp @@ -35,7 +35,7 @@ int AUD_JackDevice::jack_mix(jack_nframes_t length, void *data) { AUD_JackDevice* device = (AUD_JackDevice*)data; - int samplesize = AUD_SAMPLE_SIZE(device->m_specs); + unsigned int samplesize = AUD_SAMPLE_SIZE(device->m_specs); if(device->m_buffer->getSize() < samplesize * length) device->m_buffer->resize(samplesize * length); device->mix(device->m_buffer->getBuffer(), length); @@ -44,10 +44,10 @@ int AUD_JackDevice::jack_mix(jack_nframes_t length, void *data) float* out; int count = device->m_specs.channels; - for(int i = 0; i < count; i++) + for(unsigned int i = 0; i < count; i++) { out = (float*)jack_port_get_buffer(device->m_ports[i], length); - for(int j = 0; j < length; j++) + for(unsigned int j = 0; j < length; j++) out[j] = in[j * count + i]; } @@ -105,7 +105,7 @@ AUD_JackDevice::AUD_JackDevice(AUD_Specs specs) if(jack_activate(m_client)) AUD_THROW(AUD_ERROR_JACK); } - catch(AUD_Exception e) + catch(AUD_Exception) { jack_client_close(m_client); delete[] m_ports; AUD_DELETE("jack_port") From 62138aaa5a7f931fa2ddb4815f755413111cceb0 Mon Sep 17 00:00:00 2001 From: Arystanbek Dyussenov Date: Sun, 6 Sep 2009 15:13:57 +0000 Subject: [PATCH 457/577] Python part of multidim. array support for RNA complete. Multidim. arrays can now be modified at any level, for example: struc.arrayprop = x struc.arrayprop[i] = x struc.arrayprop[i][j] = x struc.arrayprop[i][j][k] = x etc... Approriate rvalue type/length checking is done. To ensure all works correctly, I wrote automated tests in release/test/rna_array.py. These tests cover: array/item access, assignment on different levels, tests that proper exceptions are thrown on invalid item access/assignment. The tests use properties of the RNA Test struct defined in rna_test.c. This struct is only compiled when building with BF_UNIT_TEST=1 scons arg. Currently unit tests are run manually by loading the script in the Text Editor. Here's the output I have: http://www.pasteall.org/7644 Things to improve here: - better exception messages when multidim. array assignment fails. Those we have currently are not very useful for multidim. - add tests for slice assignment --- release/test/rna_array.py | 279 +++++++++++++ .../blender/blenloader/intern/readblenentry.c | 5 +- source/blender/makesrna/RNA_access.h | 1 + source/blender/makesrna/SConscript | 3 + source/blender/makesrna/intern/SConscript | 3 + source/blender/makesrna/intern/makesrna.c | 1 + source/blender/makesrna/intern/rna_access.c | 33 +- source/blender/makesrna/intern/rna_define.c | 2 + source/blender/makesrna/intern/rna_internal.h | 1 + .../makesrna/intern/rna_internal_types.h | 8 +- source/blender/makesrna/intern/rna_main.c | 24 ++ source/blender/makesrna/intern/rna_mesh.c | 2 +- source/blender/makesrna/intern/rna_test.c | 188 +++++++++ source/blender/python/intern/bpy_array.c | 387 +++++++++++++++--- source/blender/python/intern/bpy_rna.c | 298 +++++++------- source/blender/python/intern/bpy_rna.h | 13 +- tools/btools.py | 6 +- 17 files changed, 1041 insertions(+), 213 deletions(-) create mode 100644 release/test/rna_array.py create mode 100644 source/blender/makesrna/intern/rna_test.c diff --git a/release/test/rna_array.py b/release/test/rna_array.py new file mode 100644 index 00000000000..9b7c65ff017 --- /dev/null +++ b/release/test/rna_array.py @@ -0,0 +1,279 @@ +import unittest +import random + +test= bpy.data.test + +# farr - 1-dimensional array of float +# fdarr - dynamic 1-dimensional array of float +# fmarr - 3-dimensional ([3][4][5]) array of float +# fdmarr - dynamic 3-dimensional (ditto size) array of float + +# same as above for other types except that the first letter is "i" for int and "b" for bool + +class TestArray(unittest.TestCase): + # test that assignment works by: assign -> test value + # - rvalue = list of float + # - rvalue = list of numbers + # test.object + # bpy.data.test.farr[3], iarr[3], barr[...], fmarr, imarr, bmarr + + def setUp(self): + test.farr= (1.0, 2.0, 3.0) + test.iarr= (7, 8, 9) + test.barr= (False, True, False) + + # test access + # test slice access, negative indices + def test_access(self): + rvals= ([1.0, 2.0, 3.0], [7, 8, 9], [False, True, False]) + for arr, rval in zip((test.farr, test.iarr, test.barr), rvals): + self.assertEqual(prop_to_list(arr), rval) + self.assertEqual(arr[0:3], rval) + self.assertEqual(arr[1:2], rval[1:2]) + self.assertEqual(arr[-1], arr[2]) + self.assertEqual(arr[-2], arr[1]) + self.assertEqual(arr[-3], arr[0]) + + # fail when index out of bounds + def test_access_fail(self): + for arr in (test.farr, test.iarr, test.barr): + self.assertRaises(IndexError, lambda : arr[4]) + + # test assignment of a whole array + def test_assign_array(self): + # should accept int as float + test.farr= (1, 2, 3) + + # fail when: unexpected no. of items, invalid item type + def test_assign_array_fail(self): + def assign_empty_list(arr): + setattr(test, arr, ()) + + for arr in ("farr", "iarr", "barr"): + self.assertRaises(ValueError, assign_empty_list, arr) + + def assign_invalid_float(): + test.farr= (1.0, 2.0, "3.0") + + def assign_invalid_int(): + test.iarr= ("1", 2, 3) + + def assign_invalid_bool(): + test.barr= (True, 0.123, False) + + for func in [assign_invalid_float, assign_invalid_int, assign_invalid_bool]: + self.assertRaises(TypeError, func) + + # shouldn't accept float as int + def assign_float_as_int(): + test.iarr= (1, 2, 3.0) + self.assertRaises(TypeError, assign_float_as_int) + + # non-dynamic arrays cannot change size + def assign_different_size(arr, val): + setattr(test, arr, val) + for arr, val in zip(("iarr", "farr", "barr"), ((1, 2), (1.0, 2.0), (True, False))): + self.assertRaises(ValueError, assign_different_size, arr, val) + + # test assignment of specific items + def test_assign_item(self): + for arr, rand_func in zip((test.farr, test.iarr, test.barr), (rand_float, rand_int, rand_bool)): + for i in range(len(arr)): + val= rand_func() + arr[i]= val + + self.assertEqual(arr[i], val) + + # float prop should accept also int + for i in range(len(test.farr)): + val= rand_int() + test.farr[i]= val + self.assertEqual(test.farr[i], float(val)) + + # + + def test_assign_item_fail(self): + def assign_bad_index(arr): + arr[4] = 1.0 + + def assign_bad_type(arr): + arr[1]= "123" + + for arr in [test.farr, test.iarr, test.barr]: + self.assertRaises(IndexError, assign_bad_index, arr) + + # not testing bool because bool allows not only (True|False) + for arr in [test.farr, test.iarr]: + self.assertRaises(TypeError, assign_bad_type, arr) + + def test_dynamic_assign_array(self): + # test various lengths here + for arr, rand_func in zip(("fdarr", "idarr", "bdarr"), (rand_float, rand_int, rand_bool)): + for length in range(1, 64): + rval= make_random_array(length, rand_func) + setattr(test, arr, rval) + self.assertEqual(prop_to_list(getattr(test, arr)), rval) + + def test_dynamic_assign_array_fail(self): + # could also test too big length here + + def assign_empty_list(arr): + setattr(test, arr, ()) + + for arr in ("fdarr", "idarr", "bdarr"): + self.assertRaises(ValueError, assign_empty_list, arr) + + +class TestMArray(unittest.TestCase): + def setUp(self): + # reset dynamic array sizes + for arr, func in zip(("fdmarr", "idmarr", "bdmarr"), (rand_float, rand_int, rand_bool)): + setattr(test, arr, make_random_3d_array((3, 4, 5), func)) + + # test assignment + def test_assign_array(self): + for arr, func in zip(("fmarr", "imarr", "bmarr"), (rand_float, rand_int, rand_bool)): + # assignment of [3][4][5] + rval= make_random_3d_array((3, 4, 5), func) + setattr(test, arr, rval) + self.assertEqual(prop_to_list(getattr(test, arr)), rval) + + # test assignment of [2][4][5], [1][4][5] should work on dynamic arrays + + def test_assign_array_fail(self): + def assign_empty_array(): + test.fmarr= () + self.assertRaises(ValueError, assign_empty_array) + + def assign_invalid_size(arr, rval): + setattr(test, arr, rval) + + # assignment of 3,4,4 or 3,3,5 should raise ex + for arr, func in zip(("fmarr", "imarr", "bmarr"), (rand_float, rand_int, rand_bool)): + rval= make_random_3d_array((3, 4, 4), func) + self.assertRaises(ValueError, assign_invalid_size, arr, rval) + + rval= make_random_3d_array((3, 3, 5), func) + self.assertRaises(ValueError, assign_invalid_size, arr, rval) + + rval= make_random_3d_array((3, 3, 3), func) + self.assertRaises(ValueError, assign_invalid_size, arr, rval) + + def test_assign_item(self): + # arr[i] = x + for arr, func in zip(("fmarr", "imarr", "bmarr", "fdmarr", "idmarr", "bdmarr"), (rand_float, rand_int, rand_bool) * 2): + rval= make_random_2d_array((4, 5), func) + + for i in range(3): + getattr(test, arr)[i]= rval + self.assertEqual(prop_to_list(getattr(test, arr)[i]), rval) + + # arr[i][j] = x + for arr, func in zip(("fmarr", "imarr", "bmarr", "fdmarr", "idmarr", "bdmarr"), (rand_float, rand_int, rand_bool) * 2): + + arr= getattr(test, arr) + rval= make_random_array(5, func) + + for i in range(3): + for j in range(4): + arr[i][j]= rval + self.assertEqual(prop_to_list(arr[i][j]), rval) + + + def test_assign_item_fail(self): + def assign_wrong_size(arr, i, rval): + getattr(test, arr)[i]= rval + + # assign wrong size at level 2 + for arr, func in zip(("fmarr", "imarr", "bmarr"), (rand_float, rand_int, rand_bool)): + rval1= make_random_2d_array((3, 5), func) + rval2= make_random_2d_array((4, 3), func) + + for i in range(3): + self.assertRaises(ValueError, assign_wrong_size, arr, i, rval1) + self.assertRaises(ValueError, assign_wrong_size, arr, i, rval2) + + def test_dynamic_assign_array(self): + for arr, func in zip(("fdmarr", "idmarr", "bdmarr"), (rand_float, rand_int, rand_bool)): + # assignment of [3][4][5] + rval= make_random_3d_array((3, 4, 5), func) + setattr(test, arr, rval) + self.assertEqual(prop_to_list(getattr(test, arr)), rval) + + # [2][4][5] + rval= make_random_3d_array((2, 4, 5), func) + setattr(test, arr, rval) + self.assertEqual(prop_to_list(getattr(test, arr)), rval) + + # [1][4][5] + rval= make_random_3d_array((1, 4, 5), func) + setattr(test, arr, rval) + self.assertEqual(prop_to_list(getattr(test, arr)), rval) + + + # test access + def test_access(self): + pass + + # test slice access, negative indices + def test_access_fail(self): + pass + +random.seed() + +def rand_int(): + return random.randint(-1000, 1000) + +def rand_float(): + return float(rand_int()) + +def rand_bool(): + return bool(random.randint(0, 1)) + +def make_random_array(len, rand_func): + arr= [] + for i in range(len): + arr.append(rand_func()) + + return arr + +def make_random_2d_array(dimsize, rand_func): + marr= [] + for i in range(dimsize[0]): + marr.append([]) + + for j in range(dimsize[1]): + marr[-1].append(rand_func()) + + return marr + +def make_random_3d_array(dimsize, rand_func): + marr= [] + for i in range(dimsize[0]): + marr.append([]) + + for j in range(dimsize[1]): + marr[-1].append([]) + + for k in range(dimsize[2]): + marr[-1][-1].append(rand_func()) + + return marr + +def prop_to_list(prop): + ret= [] + + for x in prop: + if type(x) not in (bool, int, float): + ret.append(prop_to_list(x)) + else: + ret.append(x) + + return ret + +def suite(): + return unittest.TestSuite([unittest.TestLoader().loadTestsFromTestCase(TestArray), unittest.TestLoader().loadTestsFromTestCase(TestMArray)]) + +if __name__ == "__main__": + unittest.TextTestRunner(verbosity=2).run(suite()) + diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index 1c21c1817e6..9cd45a268da 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -32,14 +32,13 @@ #include #endif +#include "BLI_storage.h" /* _LARGEFILE_SOURCE */ + #include #include #include #include - -#include "BLI_storage.h" /* _LARGEFILE_SOURCE */ - #include "MEM_guardedalloc.h" #include "BLI_blenlib.h" diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 98205d17ef3..4107c1346e5 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -586,6 +586,7 @@ PropertyUnit RNA_property_unit(PropertyRNA *prop); int RNA_property_flag(PropertyRNA *prop); int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop); +int RNA_property_multidimensional_array_length(PointerRNA *ptr, PropertyRNA *prop, int dimension); int RNA_property_dynamic_array_set_length(PointerRNA *ptr, PropertyRNA *prop, int length); char RNA_property_array_item_char(PropertyRNA *prop, int index); unsigned short RNA_property_array_dimension(PropertyRNA *prop, unsigned short dim_size[]); diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript index c2790927cef..845abf636e2 100644 --- a/source/blender/makesrna/SConscript +++ b/source/blender/makesrna/SConscript @@ -37,4 +37,7 @@ if env['WITH_BF_LCMS']: if env['WITH_BF_GAMEENGINE']: defs.append('GAMEBLENDER=1') +if env['BF_UNIT_TEST']: + defs.append('UNIT_TEST') + env.BlenderLib ( 'bf_rna', objs, Split(incs), defines=defs, libtype=['core','player'], priority = [165,20] ) diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript index 9234efa2a5d..569f0547731 100644 --- a/source/blender/makesrna/intern/SConscript +++ b/source/blender/makesrna/intern/SConscript @@ -71,6 +71,9 @@ if env['WITH_BF_OPENAL']: if env['WITH_BF_JACK']: defs.append('WITH_JACK') +if env['BF_UNIT_TEST']: + defs.append('UNIT_TEST') + makesrna_tool.Append(CPPDEFINES=defs) makesrna_tool.Append (CPPPATH = Split(incs)) diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index bb7b6cbcd37..907eba4018f 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -1991,6 +1991,7 @@ RNAProcessItem PROCESS_ITEMS[]= { {"rna_sequence.c", NULL, RNA_def_sequence}, {"rna_smoke.c", NULL, RNA_def_smoke}, {"rna_space.c", NULL, RNA_def_space}, + {"rna_test.c", NULL, RNA_def_test}, {"rna_text.c", NULL, RNA_def_text}, {"rna_timeline.c", NULL, RNA_def_timeline_marker}, {"rna_sound.c", NULL, RNA_def_sound}, diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index e71dcc2a586..f37fa01480c 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -557,14 +557,24 @@ int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop) int RNA_property_dynamic_array_set_length(PointerRNA *ptr, PropertyRNA *prop, int length) { - if (prop->setlength) - return prop->setlength(ptr, length); + /* length 0 is not allowed */ + if (!length) + return 0; + + if (prop->getlength) { + if (prop->setlength) + return prop->setlength(ptr, length); + else + /* length cannot be changed */ + return 0; + } else prop->arraylength= length; /* function parameters only? */ return 1; } +/* used by BPY to make an array from the python object */ unsigned short RNA_property_array_dimension(PropertyRNA *prop, unsigned short dimsize[]) { if (dimsize && prop->arraydimension > 1) { @@ -573,6 +583,25 @@ unsigned short RNA_property_array_dimension(PropertyRNA *prop, unsigned short di return prop->arraydimension; } +/* Return the size of Nth dimension. */ +int RNA_property_multidimensional_array_length(PointerRNA *ptr, PropertyRNA *prop, int dim) +{ + unsigned short i; + int len; + + if (dim == 0) { + len= RNA_property_array_length(ptr, prop); + + for (i= 0; i < prop->arraydimension - 1; i++) + len /= prop->dimsize[i]; + } + else { + len= prop->dimsize[dim - 1]; + } + + return len; +} + char RNA_property_array_item_char(PropertyRNA *prop, int index) { const char *vectoritem= "XYZW"; diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 69e6698bd3b..e415304ab6c 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -1046,6 +1046,8 @@ void RNA_def_property_multidimensional_array(PropertyRNA *prop, int arraylength, prop->arraydimension= dimension; + /* TODO make sure dimsize values are sane */ + if (dimension > 1) memcpy(prop->dimsize, dimsize, sizeof(dimsize[0]) * (dimension - 1)); } diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 13cc2ae9017..7de80843f27 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -157,6 +157,7 @@ void RNA_def_sensor(struct BlenderRNA *brna); void RNA_def_sequence(struct BlenderRNA *brna); void RNA_def_smoke(struct BlenderRNA *brna); void RNA_def_space(struct BlenderRNA *brna); +void RNA_def_test(struct BlenderRNA *brna); void RNA_def_text(struct BlenderRNA *brna); void RNA_def_texture(struct BlenderRNA *brna); void RNA_def_timeline_marker(struct BlenderRNA *brna); diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index d706fd5ac19..2bd89dbd3bf 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -39,7 +39,12 @@ struct bContext; struct IDProperty; struct GHash; +#ifdef UNIT_TEST +#define RNA_MAX_ARRAY 64 +#else #define RNA_MAX_ARRAY 32 +#endif + #define RNA_MAX_ARRAY_DIMENSION 3 /* Function Callbacks */ @@ -134,11 +139,10 @@ struct PropertyRNA { PropertySubType subtype; /* if an array this is > 0, specifying the length */ unsigned int arraylength; - /* these, if non-NULL, override arraylength */ + /* if non-NULL, overrides arraylength. Must not return 0? */ PropArrayLengthGetFunc getlength; /* if NULL, length cannot be changed by a user */ PropArrayLengthSetFunc setlength; - /* used only for dynamic arrays for now, default 1 */ unsigned short arraydimension; /* dimension sizes for dimensions greater than 1, first dimension size is not specified */ unsigned short dimsize[RNA_MAX_ARRAY_DIMENSION - 1]; diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index 82e460ea57d..344135acaff 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -219,6 +219,18 @@ static void rna_Main_wm_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) rna_iterator_listbase_begin(iter, &bmain->wm, NULL); } +#ifdef UNIT_TEST + +static PointerRNA rna_Test_test_get(PointerRNA *ptr) +{ + PointerRNA ret= *ptr; + ret.type= &RNA_Test; + + return ret; +} + +#endif + #else void RNA_def_main(BlenderRNA *brna) @@ -276,6 +288,18 @@ void RNA_def_main(BlenderRNA *brna) } RNA_api_main(srna); + +#ifdef UNIT_TEST + + RNA_define_verify_sdna(0); + + prop= RNA_def_property(srna, "test", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "Test"); + RNA_def_property_pointer_funcs(prop, "rna_Test_test_get", NULL, NULL); + + RNA_define_verify_sdna(1); + +#endif } #endif diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index f7235db49a5..efd0046d827 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -1182,7 +1182,7 @@ static void rna_def_mtface(BlenderRNA *brna) RNA_def_property_ui_text(prop, "UV 4", ""); RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); - prop= RNA_def_property(srna, "uv", PROP_FLOAT, PROP_XYZ); + prop= RNA_def_property(srna, "uv", PROP_FLOAT, PROP_NONE); RNA_def_property_multidimensional_array(prop, 4 * 2, 2, uv_dim); RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_dynamic_array_funcs(prop, "rna_MeshTextureFace_uv_get_length", "rna_MeshTextureFace_uv_set_length"); diff --git a/source/blender/makesrna/intern/rna_test.c b/source/blender/makesrna/intern/rna_test.c new file mode 100644 index 00000000000..bfaf318018a --- /dev/null +++ b/source/blender/makesrna/intern/rna_test.c @@ -0,0 +1,188 @@ +/** + * $Id: rna_test.c $ + * + * ***** 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. + * + * Contributor(s): Arystanbek Dyussenov + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/* Defines a structure with properties used for array manipulation tests in BPY. */ + +#include +#include + +#include "RNA_define.h" +#include "RNA_types.h" + +#include "rna_internal.h" + +#define ARRAY_SIZE 3 +#define DYNAMIC_ARRAY_SIZE 64 +#define MARRAY_DIM [3][4][5] +#define MARRAY_TOTDIM 3 +#define MARRAY_DIMSIZE 4, 5 +#define MARRAY_SIZE(type) (sizeof(type MARRAY_DIM) / sizeof(type)) +#define DYNAMIC_MARRAY_DIM [3][4][5] +#define DYNAMIC_MARRAY_SIZE(type) (sizeof(type DYNAMIC_MARRAY_DIM) / sizeof(type)) + +#ifdef RNA_RUNTIME + +#ifdef UNIT_TEST + +#define DEF_VARS(type, prefix) \ + static type prefix ## arr[ARRAY_SIZE]; \ + static type prefix ## darr[DYNAMIC_ARRAY_SIZE]; \ + static int prefix ## darr_len= ARRAY_SIZE; \ + static type prefix ## marr MARRAY_DIM; \ + static type prefix ## dmarr DYNAMIC_MARRAY_DIM; \ + static int prefix ## dmarr_len= sizeof(prefix ## dmarr); + +#define DEF_GET_SET(type, arr) \ + void rna_Test_ ## arr ## _get(PointerRNA *ptr, type *values) \ + { \ + memcpy(values, arr, sizeof(arr)); \ + } \ + \ + void rna_Test_ ## arr ## _set(PointerRNA *ptr, const type *values) \ + { \ + memcpy(arr, values, sizeof(arr)); \ + } + +#define DEF_GET_SET_LEN(arr, max) \ + static int rna_Test_ ## arr ## _get_length(PointerRNA *ptr) \ + { \ + return arr ## _len; \ + } \ + \ + static int rna_Test_ ## arr ## _set_length(PointerRNA *ptr, int length) \ + { \ + if (length > max) \ + return 0; \ + \ + arr ## _len= length; \ + \ + return 1; \ + } \ + +DEF_VARS(float, f) +DEF_VARS(int, i) +DEF_VARS(int, b) + +DEF_GET_SET(float, farr) +DEF_GET_SET(int, iarr) +DEF_GET_SET(int, barr) + +DEF_GET_SET(float, fmarr) +DEF_GET_SET(int, imarr) +DEF_GET_SET(int, bmarr) + +DEF_GET_SET(float, fdarr) +DEF_GET_SET_LEN(fdarr, DYNAMIC_ARRAY_SIZE) +DEF_GET_SET(int, idarr) +DEF_GET_SET_LEN(idarr, DYNAMIC_ARRAY_SIZE) +DEF_GET_SET(int, bdarr) +DEF_GET_SET_LEN(bdarr, DYNAMIC_ARRAY_SIZE) + +DEF_GET_SET(float, fdmarr) +DEF_GET_SET_LEN(fdmarr, DYNAMIC_MARRAY_SIZE(float)) +DEF_GET_SET(int, idmarr) +DEF_GET_SET_LEN(idmarr, DYNAMIC_MARRAY_SIZE(int)) +DEF_GET_SET(int, bdmarr) +DEF_GET_SET_LEN(bdmarr, DYNAMIC_MARRAY_SIZE(int)) + +#endif + +#else + +void RNA_def_test(BlenderRNA *brna) +{ +#ifdef UNIT_TEST + StructRNA *srna; + PropertyRNA *prop; + unsigned short dimsize[]= {MARRAY_DIMSIZE}; + + srna= RNA_def_struct(brna, "Test", NULL); + RNA_def_struct_sdna(srna, "Test"); + + prop= RNA_def_float_array(srna, "farr", ARRAY_SIZE, NULL, 0.0f, 0.0f, "farr", "float array", 0.0f, 0.0f); + RNA_def_property_float_funcs(prop, "rna_Test_farr_get", "rna_Test_farr_set", NULL); + + prop= RNA_def_int_array(srna, "iarr", ARRAY_SIZE, NULL, 0, 0, "iarr", "int array", 0, 0); + RNA_def_property_int_funcs(prop, "rna_Test_iarr_get", "rna_Test_iarr_set", NULL); + + prop= RNA_def_boolean_array(srna, "barr", ARRAY_SIZE, NULL, "barr", "boolean array"); + RNA_def_property_boolean_funcs(prop, "rna_Test_barr_get", "rna_Test_barr_set"); + + /* dynamic arrays */ + + prop= RNA_def_float_array(srna, "fdarr", DYNAMIC_ARRAY_SIZE, NULL, 0.0f, 0.0f, "fdarr", "dynamic float array", 0.0f, 0.0f); + RNA_def_property_flag(prop, PROP_DYNAMIC); + RNA_def_property_dynamic_array_funcs(prop, "rna_Test_fdarr_get_length", "rna_Test_fdarr_set_length"); + RNA_def_property_float_funcs(prop, "rna_Test_fdarr_get", "rna_Test_fdarr_set", NULL); + + prop= RNA_def_int_array(srna, "idarr", DYNAMIC_ARRAY_SIZE, NULL, 0, 0, "idarr", "int array", 0, 0); + RNA_def_property_flag(prop, PROP_DYNAMIC); + RNA_def_property_dynamic_array_funcs(prop, "rna_Test_idarr_get_length", "rna_Test_idarr_set_length"); + RNA_def_property_int_funcs(prop, "rna_Test_idarr_get", "rna_Test_idarr_set", NULL); + + prop= RNA_def_boolean_array(srna, "bdarr", DYNAMIC_ARRAY_SIZE, NULL, "bdarr", "boolean array"); + RNA_def_property_flag(prop, PROP_DYNAMIC); + RNA_def_property_dynamic_array_funcs(prop, "rna_Test_bdarr_get_length", "rna_Test_bdarr_set_length"); + RNA_def_property_boolean_funcs(prop, "rna_Test_bdarr_get", "rna_Test_bdarr_set"); + + /* multidimensional arrays */ + + prop= RNA_def_property(srna, "fmarr", PROP_FLOAT, PROP_NONE); + RNA_def_property_multidimensional_array(prop, MARRAY_SIZE(float), MARRAY_TOTDIM, dimsize); + RNA_def_property_float_funcs(prop, "rna_Test_fmarr_get", "rna_Test_fmarr_set", NULL); + + prop= RNA_def_property(srna, "imarr", PROP_INT, PROP_NONE); + RNA_def_property_multidimensional_array(prop, MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize); + RNA_def_property_int_funcs(prop, "rna_Test_imarr_get", "rna_Test_imarr_set", NULL); + + prop= RNA_def_property(srna, "bmarr", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_multidimensional_array(prop, MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize); + RNA_def_property_boolean_funcs(prop, "rna_Test_bmarr_get", "rna_Test_bmarr_set"); + + /* dynamic multidimensional arrays */ + + prop= RNA_def_property(srna, "fdmarr", PROP_FLOAT, PROP_NONE); + RNA_def_property_multidimensional_array(prop, DYNAMIC_MARRAY_SIZE(float), MARRAY_TOTDIM, dimsize); + RNA_def_property_flag(prop, PROP_DYNAMIC); + RNA_def_property_dynamic_array_funcs(prop, "rna_Test_fdmarr_get_length", "rna_Test_fdmarr_set_length"); + RNA_def_property_float_funcs(prop, "rna_Test_fdmarr_get", "rna_Test_fdmarr_set", NULL); + + prop= RNA_def_property(srna, "idmarr", PROP_INT, PROP_NONE); + RNA_def_property_multidimensional_array(prop, DYNAMIC_MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize); + RNA_def_property_flag(prop, PROP_DYNAMIC); + RNA_def_property_dynamic_array_funcs(prop, "rna_Test_idmarr_get_length", "rna_Test_idmarr_set_length"); + RNA_def_property_int_funcs(prop, "rna_Test_idmarr_get", "rna_Test_idmarr_set", NULL); + + prop= RNA_def_property(srna, "bdmarr", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_multidimensional_array(prop, DYNAMIC_MARRAY_SIZE(int), MARRAY_TOTDIM, dimsize); + RNA_def_property_flag(prop, PROP_DYNAMIC); + RNA_def_property_dynamic_array_funcs(prop, "rna_Test_bdmarr_get_length", "rna_Test_bdmarr_set_length"); + RNA_def_property_boolean_funcs(prop, "rna_Test_bdmarr_get", "rna_Test_bdmarr_set"); + +#endif +} + +#endif /* RNA_RUNTIME */ + + diff --git a/source/blender/python/intern/bpy_array.c b/source/blender/python/intern/bpy_array.c index 669cccb7011..9db4b20d011 100644 --- a/source/blender/python/intern/bpy_array.c +++ b/source/blender/python/intern/bpy_array.c @@ -30,33 +30,65 @@ #include "BLI_string.h" +#include "BKE_global.h" + #include "MEM_guardedalloc.h" -typedef void (*ItemConvertFunc)(PyObject *, char *); -typedef int (*ItemTypeCheckFunc)(PyObject *); -typedef void (*RNA_SetArrayFunc)(PointerRNA *, PropertyRNA *, const char *); +#define MAX_ARRAY_DIMENSION 10 -/* Ensures that a python sequence has an expected number of items/sub-items and items are of expected type. */ -static int pyrna_validate_array(PyObject *seq, unsigned short dim, unsigned short totdim, unsigned short dim_size[], - ItemTypeCheckFunc check_item_type, const char *item_type_str, char *error_str, int error_str_size) +/* convenient way to access array dimension size */ +#define DIMSIZE(a) (dimsize[a - 1]) + +typedef void (*ItemConvertFunc)(PyObject *, char *); +typedef int (*ItemTypeCheckFunc)(PyObject *); +typedef void (*RNA_SetArrayFunc)(PointerRNA *, PropertyRNA *, const char *); +typedef void (*RNA_SetIndexFunc)(PointerRNA *, PropertyRNA *, int index, void *); + +/* + arr[3][4][5] + 0 1 2 <- dimension index +*/ + +/* + arr[2] = x + + py_to_array_index(arraydim=0, arrayoffset=0, index=2) + validate_array(lvalue_dim=0) + ... make real index ... +*/ + +/* arr[3]=x, self->arraydim is 0, lvalue_dim is 1 */ +/* Ensures that a python sequence has expected number of items/sub-items and items are of desired type. */ +static int validate_array_type(PyObject *seq, unsigned short dim, unsigned short totdim, unsigned short dimsize[], + ItemTypeCheckFunc check_item_type, const char *item_type_str, const char *error_prefix) { int i; - if (dim < totdim) { + + /* not the last dimension */ + if (dim + 1 < totdim) { + /* check that a sequence contains dimsize[dim] items */ + for (i= 0; i < PySequence_Length(seq); i++) { PyObject *item; int ok= 1; item= PySequence_GetItem(seq, i); if (!PySequence_Check(item)) { - BLI_snprintf(error_str, error_str_size, "expected a %d-dimensional sequence of %s", (int)totdim, item_type_str); + /* BLI_snprintf(error_str, error_str_size, "expected a sequence of %s", item_type_str); */ + PyErr_Format(PyExc_TypeError, "%s expected a sequence of %s", error_prefix, item_type_str); ok= 0; } - else if (PySequence_Length(item) != dim_size[dim - 1]) { - BLI_snprintf(error_str, error_str_size, "dimension %d should contain %d items", (int)dim, (int)dim_size[dim - 1]); + /* arr[3][4][5] + DIMSIZE(1)=4 + DIMSIZE(2)=5 + + dim=0 */ + else if (PySequence_Length(item) != DIMSIZE(dim + 1)) { + /* BLI_snprintf(error_str, error_str_size, "sequences of dimension %d should contain %d items", (int)dim + 1, (int)DIMSIZE(dim + 1)); */ + PyErr_Format(PyExc_ValueError, "%s sequences of dimension %d should contain %d items", error_prefix, (int)dim + 1, (int)DIMSIZE(dim + 1)); ok= 0; } - - if (!pyrna_validate_array(item, dim + 1, totdim, dim_size, check_item_type, item_type_str, error_str, error_str_size)) { + else if (!validate_array_type(item, dim + 1, totdim, dimsize, check_item_type, item_type_str, error_prefix)) { ok= 0; } @@ -67,13 +99,15 @@ static int pyrna_validate_array(PyObject *seq, unsigned short dim, unsigned shor } } else { + /* check that items are of correct type */ for (i= 0; i < PySequence_Length(seq); i++) { PyObject *item= PySequence_GetItem(seq, i); if (!check_item_type(item)) { Py_DECREF(item); - - BLI_snprintf(error_str, error_str_size, "sequence items should be of type %s", item_type_str); + + /* BLI_snprintf(error_str, error_str_size, "sequence items should be of type %s", item_type_str); */ + PyErr_Format(PyExc_TypeError, "sequence items should be of type %s", item_type_str); return 0; } @@ -85,7 +119,7 @@ static int pyrna_validate_array(PyObject *seq, unsigned short dim, unsigned shor } /* Returns the number of items in a single- or multi-dimensional sequence. */ -static int pyrna_count_items(PyObject *seq) +static int count_items(PyObject *seq) { int totitem= 0; @@ -93,7 +127,7 @@ static int pyrna_count_items(PyObject *seq) int i; for (i= 0; i < PySequence_Length(seq); i++) { PyObject *item= PySequence_GetItem(seq, i); - totitem += pyrna_count_items(item); + totitem += count_items(item); Py_DECREF(item); } } @@ -103,40 +137,103 @@ static int pyrna_count_items(PyObject *seq) return totitem; } -static int pyrna_apply_array_length(PointerRNA *ptr, PropertyRNA *prop, int totitem, char *error_str, int error_str_size) +/* Modifies property array length if needed and PROP_DYNAMIC flag is set. */ +static int validate_array_length(PyObject *rvalue, PointerRNA *ptr, PropertyRNA *prop, int lvalue_dim, int *totitem, const char *error_prefix) { - if (RNA_property_flag(prop) & PROP_DYNAMIC) { - /* length can be flexible */ - if (RNA_property_array_length(ptr, prop) != totitem) { - if (!RNA_property_dynamic_array_set_length(ptr, prop, totitem)) { - BLI_snprintf(error_str, error_str_size, "%s.%s: array length cannot be changed to %d", RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), totitem); + unsigned short dimsize[MAX_ARRAY_DIMENSION]; + int tot, totdim, len; + + tot= count_items(rvalue); + totdim= RNA_property_array_dimension(prop, dimsize); + + if ((RNA_property_flag(prop) & PROP_DYNAMIC) && lvalue_dim == 0) { + /* length is flexible */ + if (RNA_property_array_length(ptr, prop) != tot) { + if (!RNA_property_dynamic_array_set_length(ptr, prop, tot)) { + /* BLI_snprintf(error_str, error_str_size, "%s.%s: array length cannot be changed to %d", RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), tot); */ + PyErr_Format(PyExc_ValueError, "%s %s.%s: array length cannot be changed to %d", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), tot); return 0; } + + len= tot; } } else { /* length is a constraint */ - int len= RNA_property_array_length(ptr, prop); - if (totitem != len) { - BLI_snprintf(error_str, error_str_size, "sequence must have length of %d", len); + if (!lvalue_dim) { + len= RNA_property_array_length(ptr, prop); + } + /* array item assignment */ + else { + int i; + + len= 1; + + /* arr[3][4][5] + + arr[2] = x + dimsize={4, 5} + DIMSIZE(1) = 4 + DIMSIZE(2) = 5 + lvalue_dim=0, totdim=3 + + arr[2][3] = x + lvalue_dim=1 + + arr[2][3][4] = x + lvalue_dim=2 */ + for (i= lvalue_dim; i < totdim; i++) + len *= DIMSIZE(i); + } + + if (tot != len) { + /* BLI_snprintf(error_str, error_str_size, "sequence must have length of %d", len); */ + PyErr_Format(PyExc_ValueError, "%s sequence must have %d items total", error_prefix, len); return 0; } } + + *totitem= len; + return 1; } -static char *pyrna_py_to_array(PyObject *seq, unsigned short dim, unsigned short totdim, char *data, unsigned int item_size, ItemConvertFunc convert_item) +static int validate_array(PyObject *rvalue, PointerRNA *ptr, PropertyRNA *prop, int lvalue_dim, ItemTypeCheckFunc check_item_type, const char *item_type_str, int *totitem, const char *error_prefix) +{ + unsigned short dimsize[MAX_ARRAY_DIMENSION]; + int totdim= RNA_property_array_dimension(prop, dimsize); + + /* validate type first because length validation may modify property array length */ + + if (!validate_array_type(rvalue, lvalue_dim, totdim, dimsize, check_item_type, item_type_str, error_prefix)) + return 0; + + return validate_array_length(rvalue, ptr, prop, lvalue_dim, totitem, error_prefix); +} + +static char *copy_values(PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, unsigned short dim, char *data, unsigned int item_size, int *index, ItemConvertFunc convert_item, RNA_SetIndexFunc rna_set_index) { unsigned int i; + int totdim= RNA_property_array_dimension(prop, NULL); + for (i= 0; i < PySequence_Length(seq); i++) { PyObject *item= PySequence_GetItem(seq, i); - if (dim < totdim) { - data= pyrna_py_to_array(item, dim + 1, totdim, data, item_size, convert_item); + if (dim + 1 < totdim) { + data= copy_values(item, ptr, prop, dim + 1, data, item_size, index, convert_item, rna_set_index); } else { - convert_item(item, data); - data += item_size; + if (!data) { + char value[sizeof(int)]; + + convert_item(item, value); + rna_set_index(ptr, prop, *index, value); + *index = *index + 1; + } + else { + convert_item(item, data); + data += item_size; + } } Py_DECREF(item); @@ -145,21 +242,15 @@ static char *pyrna_py_to_array(PyObject *seq, unsigned short dim, unsigned short return data; } -static int pyrna_py_to_array_generic(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, char *error_str, int error_str_size, - ItemTypeCheckFunc check_item_type, const char *item_type_str, int item_size, ItemConvertFunc convert_item, RNA_SetArrayFunc rna_set_array) +static int py_to_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, ItemTypeCheckFunc check_item_type, const char *item_type_str, int item_size, ItemConvertFunc convert_item, RNA_SetArrayFunc rna_set_array, const char *error_prefix) { - unsigned short totdim, dim_size[100]; + unsigned short totdim, dim_size[MAX_ARRAY_DIMENSION]; int totitem; char *data= NULL; totdim= RNA_property_array_dimension(prop, dim_size); - if (!pyrna_validate_array(py, 1, totdim, dim_size, check_item_type, item_type_str, error_str, error_str_size)) - return 0; - - totitem= pyrna_count_items(py); - - if (!pyrna_apply_array_length(ptr, prop, totitem, error_str, error_str_size)) + if (!validate_array(py, ptr, prop, 0, check_item_type, item_type_str, &totitem, error_prefix)) return 0; if (totitem) { @@ -168,7 +259,7 @@ static int pyrna_py_to_array_generic(PyObject *py, PointerRNA *ptr, PropertyRNA else data= param_data; - pyrna_py_to_array(py, 1, totdim, data, item_size, convert_item); + copy_values(py, ptr, prop, 0, data, item_size, NULL, convert_item, NULL); if (param_data) { if (RNA_property_flag(prop) & PROP_DYNAMIC) { @@ -186,50 +277,236 @@ static int pyrna_py_to_array_generic(PyObject *py, PointerRNA *ptr, PropertyRNA return 1; } -static void pyrna_py_to_float(PyObject *py, char *data) +static int py_to_array_index(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, int lvalue_dim, int arrayoffset, int index, ItemTypeCheckFunc check_item_type, const char *item_type_str, ItemConvertFunc convert_item, RNA_SetIndexFunc rna_set_index, const char *error_prefix) +{ + unsigned short totdim, dimsize[MAX_ARRAY_DIMENSION]; + int totitem, i; + + totdim= RNA_property_array_dimension(prop, dimsize); + + /* convert index */ + + /* arr[3][4][5] + + arr[2] = x + lvalue_dim=0, index = 0 + 2 * 4 * 5 + + arr[2][3] = x + lvalue_dim=1, index = 40 + 3 * 5 */ + + lvalue_dim++; + + for (i= lvalue_dim; i < totdim; i++) + index *= DIMSIZE(i); + + index += arrayoffset; + + if (!validate_array(py, ptr, prop, lvalue_dim, check_item_type, item_type_str, &totitem, error_prefix)) + return 0; + + if (totitem) + copy_values(py, ptr, prop, lvalue_dim, NULL, 0, &index, convert_item, rna_set_index); + + return 1; +} + +static void py_to_float(PyObject *py, char *data) { *(float*)data= (float)PyFloat_AsDouble(py); } -static void pyrna_py_to_int(PyObject *py, char *data) +static void py_to_int(PyObject *py, char *data) { *(int*)data= (int)PyLong_AsSsize_t(py); } -static void pyrna_py_to_boolean(PyObject *py, char *data) +static void py_to_bool(PyObject *py, char *data) { *(int*)data= (int)PyObject_IsTrue(py); } static int py_float_check(PyObject *py) { - return PyFloat_Check(py) || (PyIndex_Check(py)); + /* accept both floats and integers */ + return PyFloat_Check(py) || PyLong_Check(py); } static int py_int_check(PyObject *py) { - return PyLong_Check(py) || (PyIndex_Check(py)); + /* accept only integers */ + return PyLong_Check(py); } static int py_bool_check(PyObject *py) { - return PyBool_Check(py) || (PyIndex_Check(py)); + return PyBool_Check(py); } -int pyrna_py_to_float_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, char *error_str, int error_str_size) +static void float_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, void *value) { - return pyrna_py_to_array_generic(py, ptr, prop, param_data, error_str, error_str_size, - py_float_check, "float", sizeof(float), pyrna_py_to_float, (RNA_SetArrayFunc)RNA_property_float_set_array); + RNA_property_float_set_index(ptr, prop, index, *(float*)value); } -int pyrna_py_to_int_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, char *error_str, int error_str_size) +static void int_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, void *value) { - return pyrna_py_to_array_generic(py, ptr, prop, param_data, error_str, error_str_size, - py_int_check, "int", sizeof(int), pyrna_py_to_int, (RNA_SetArrayFunc)RNA_property_int_set_array); + RNA_property_int_set_index(ptr, prop, index, *(int*)value); } -int pyrna_py_to_boolean_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, char *error_str, int error_str_size) +static void bool_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, void *value) { - return pyrna_py_to_array_generic(py, ptr, prop, param_data, error_str, error_str_size, - py_bool_check, "boolean", sizeof(int), pyrna_py_to_boolean, (RNA_SetArrayFunc)RNA_property_boolean_set_array); + RNA_property_boolean_set_index(ptr, prop, index, *(int*)value); +} + +int pyrna_py_to_array(PointerRNA *ptr, PropertyRNA *prop, char *param_data, PyObject *py, const char *error_prefix) +{ + int ret; + switch (RNA_property_type(prop)) { + case PROP_FLOAT: + ret= py_to_array(py, ptr, prop, param_data, py_float_check, "float", sizeof(float), py_to_float, (RNA_SetArrayFunc)RNA_property_float_set_array, error_prefix); + break; + case PROP_INT: + ret= py_to_array(py, ptr, prop, param_data, py_int_check, "int", sizeof(int), py_to_int, (RNA_SetArrayFunc)RNA_property_int_set_array, error_prefix); + break; + case PROP_BOOLEAN: + ret= py_to_array(py, ptr, prop, param_data, py_bool_check, "boolean", sizeof(int), py_to_bool, (RNA_SetArrayFunc)RNA_property_boolean_set_array, error_prefix); + break; + default: + PyErr_SetString(PyExc_TypeError, "not an array type"); + ret= 0; + } + + return ret; +} + +int pyrna_py_to_array_index(PointerRNA *ptr, PropertyRNA *prop, int arraydim, int arrayoffset, int index, PyObject *py, const char *error_prefix) +{ + int ret; + switch (RNA_property_type(prop)) { + case PROP_FLOAT: + ret= py_to_array_index(py, ptr, prop, arraydim, arrayoffset, index, py_float_check, "float", py_to_float, float_set_index, error_prefix); + break; + case PROP_INT: + ret= py_to_array_index(py, ptr, prop, arraydim, arrayoffset, index, py_int_check, "int", py_to_int, int_set_index, error_prefix); + break; + case PROP_BOOLEAN: + ret= py_to_array_index(py, ptr, prop, arraydim, arrayoffset, index, py_bool_check, "boolean", py_to_bool, bool_set_index, error_prefix); + break; + default: + PyErr_SetString(PyExc_TypeError, "not an array type"); + ret= 0; + } + + return ret; +} + +static PyObject *pyrna_array_item(PointerRNA *ptr, PropertyRNA *prop, int index) +{ + PyObject *item; + + switch (RNA_property_type(prop)) { + case PROP_FLOAT: + item= PyFloat_FromDouble(RNA_property_float_get_index(ptr, prop, index)); + break; + case PROP_BOOLEAN: + item= PyBool_FromLong(RNA_property_boolean_get_index(ptr, prop, index)); + break; + case PROP_INT: + item= PyLong_FromSsize_t(RNA_property_int_get_index(ptr, prop, index)); + break; + default: + PyErr_SetString(PyExc_TypeError, "not an array type"); + item= NULL; + } + + return item; +} + +#if 0 +/* XXX this is not used (and never will?) */ +/* Given an array property, creates an N-dimensional tuple of values. */ +static PyObject *pyrna_py_from_array_internal(PointerRNA *ptr, PropertyRNA *prop, int dim, int *index) +{ + PyObject *tuple; + int i, len; + int totdim= RNA_property_array_dimension(prop, NULL); + + len= RNA_property_multidimensional_array_length(ptr, prop, dim); + + tuple= PyTuple_New(len); + + for (i= 0; i < len; i++) { + PyObject *item; + + if (dim + 1 < totdim) + item= pyrna_py_from_array_internal(ptr, prop, dim + 1, index); + else { + item= pyrna_array_item(ptr, prop, *index); + *index= *index + 1; + } + + if (!item) { + Py_DECREF(tuple); + return NULL; + } + + PyTuple_SetItem(tuple, i, item); + } + + return tuple; +} +#endif + +PyObject *pyrna_py_from_array_index(BPy_PropertyRNA *self, int index) +{ + int totdim, i, len; + unsigned short dimsize[MAX_ARRAY_DIMENSION]; + BPy_PropertyRNA *ret= NULL; + + /* just in case check */ + len= RNA_property_multidimensional_array_length(&self->ptr, self->prop, self->arraydim); + if (index >= len || index < 0) { + /* this shouldn't happen because higher level funcs must check for invalid index */ + if (G.f & G_DEBUG) printf("pyrna_py_from_array_index: invalid index %d for array with length=%d\n", index, len); + + PyErr_SetString(PyExc_IndexError, "out of range"); + return NULL; + } + + totdim= RNA_property_array_dimension(self->prop, dimsize); + + if (self->arraydim + 1 < totdim) { + ret= (BPy_PropertyRNA*)pyrna_prop_CreatePyObject(&self->ptr, self->prop); + ret->arraydim= self->arraydim + 1; + + /* arr[3][4][5] + + x = arr[2] + index = 0 + 2 * 4 * 5 + + x = arr[2][3] + index = offset + 3 * 5 */ + + for (i= self->arraydim + 1; i < totdim; i++) + index *= DIMSIZE(i); + + ret->arrayoffset= self->arrayoffset + index; + } + else { + index = self->arrayoffset + index; + ret= (BPy_PropertyRNA*)pyrna_array_item(&self->ptr, self->prop, index); + } + + return (PyObject*)ret; +} + +PyObject *pyrna_py_from_array(PointerRNA *ptr, PropertyRNA *prop) +{ + PyObject *ret; + + ret= pyrna_math_object_from_array(ptr, prop); + + /* is this a maths object? */ + if (ret) return ret; + + return pyrna_prop_CreatePyObject(ptr, prop); } diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 8ba3b5f8732..f2ffd5e0358 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -130,6 +130,70 @@ Mathutils_Callback mathutils_rna_matrix_cb = { (BaseMathSetIndexFunc) NULL }; +PyObject *pyrna_math_object_from_array(PointerRNA *ptr, PropertyRNA *prop) +{ + PyObject *ret= NULL; + +#ifdef USE_MATHUTILS + int type, subtype, totdim; + int len; + + len= RNA_property_array_length(ptr, prop); + type= RNA_property_type(prop); + subtype= RNA_property_subtype(prop); + totdim= RNA_property_array_dimension(prop, NULL); + + if (type != PROP_FLOAT) return NULL; + + if (totdim == 1 || (totdim == 2 && subtype == PROP_MATRIX)) { + ret = pyrna_prop_CreatePyObject(ptr, prop); + + switch(RNA_property_subtype(prop)) { + case PROP_TRANSLATION: + case PROP_DIRECTION: + case PROP_VELOCITY: + case PROP_ACCELERATION: + case PROP_XYZ: + if(len>=2 && len <= 4) { + PyObject *vec_cb= newVectorObject_cb(ret, len, mathutils_rna_array_cb_index, FALSE); + Py_DECREF(ret); /* the vector owns now */ + ret= vec_cb; /* return the vector instead */ + } + break; + case PROP_MATRIX: + if(len==16) { + PyObject *mat_cb= newMatrixObject_cb(ret, 4,4, mathutils_rna_matrix_cb_index, FALSE); + Py_DECREF(ret); /* the matrix owns now */ + ret= mat_cb; /* return the matrix instead */ + } + else if (len==9) { + PyObject *mat_cb= newMatrixObject_cb(ret, 3,3, mathutils_rna_matrix_cb_index, FALSE); + Py_DECREF(ret); /* the matrix owns now */ + ret= mat_cb; /* return the matrix instead */ + } + break; + case PROP_EULER: + case PROP_QUATERNION: + if(len==3) { /* euler */ + PyObject *eul_cb= newEulerObject_cb(ret, mathutils_rna_array_cb_index, FALSE); + Py_DECREF(ret); /* the matrix owns now */ + ret= eul_cb; /* return the matrix instead */ + } + else if (len==4) { + PyObject *quat_cb= newQuaternionObject_cb(ret, mathutils_rna_array_cb_index, FALSE); + Py_DECREF(ret); /* the matrix owns now */ + ret= quat_cb; /* return the matrix instead */ + } + break; + default: + break; + } + } +#endif + + return ret; +} + #endif static StructRNA *pyrna_struct_as_srna(PyObject *self); @@ -288,58 +352,7 @@ PyObject * pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop) int len = RNA_property_array_length(ptr, prop); if (len > 0) { - /* resolve the array from a new pytype */ - PyObject *ret = pyrna_prop_CreatePyObject(ptr, prop); - -#ifdef USE_MATHUTILS - - /* return a mathutils vector where possible */ - if(RNA_property_type(prop)==PROP_FLOAT) { - switch(RNA_property_subtype(prop)) { - case PROP_TRANSLATION: - case PROP_DIRECTION: - case PROP_VELOCITY: - case PROP_ACCELERATION: - case PROP_XYZ: - if(len>=2 && len <= 4) { - PyObject *vec_cb= newVectorObject_cb(ret, len, mathutils_rna_array_cb_index, FALSE); - Py_DECREF(ret); /* the vector owns now */ - ret= vec_cb; /* return the vector instead */ - } - break; - case PROP_MATRIX: - if(len==16) { - PyObject *mat_cb= newMatrixObject_cb(ret, 4,4, mathutils_rna_matrix_cb_index, FALSE); - Py_DECREF(ret); /* the matrix owns now */ - ret= mat_cb; /* return the matrix instead */ - } - else if (len==9) { - PyObject *mat_cb= newMatrixObject_cb(ret, 3,3, mathutils_rna_matrix_cb_index, FALSE); - Py_DECREF(ret); /* the matrix owns now */ - ret= mat_cb; /* return the matrix instead */ - } - break; - case PROP_EULER: - case PROP_QUATERNION: - if(len==3) { /* euler */ - PyObject *eul_cb= newEulerObject_cb(ret, mathutils_rna_array_cb_index, FALSE); - Py_DECREF(ret); /* the matrix owns now */ - ret= eul_cb; /* return the matrix instead */ - } - else if (len==4) { - PyObject *quat_cb= newQuaternionObject_cb(ret, mathutils_rna_array_cb_index, FALSE); - Py_DECREF(ret); /* the matrix owns now */ - ret= quat_cb; /* return the matrix instead */ - } - break; - default: - break; - } - } - -#endif - - return ret; + return pyrna_py_from_array(ptr, prop); } /* see if we can coorce into a python type - PropertyType */ @@ -511,7 +524,7 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *v int len = RNA_property_array_length(ptr, prop); if (len > 0) { - char error_str[512]; + /* char error_str[512]; */ int ok= 1; #ifdef USE_MATHUTILS @@ -526,21 +539,10 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *v return -1; } /* done getting the length */ - - /* for arrays we have a limited number of types */ - switch (type) { - case PROP_BOOLEAN: - ok= pyrna_py_to_boolean_array(value, ptr, prop, data, error_str, sizeof(error_str)); - break; - case PROP_INT: - ok= pyrna_py_to_int_array(value, ptr, prop, data, error_str, sizeof(error_str)); - break; - case PROP_FLOAT: - ok= pyrna_py_to_float_array(value, ptr, prop, data, error_str, sizeof(error_str)); - break; - } + ok= pyrna_py_to_array(ptr, prop, data, value, error_prefix); + if (!ok) { - PyErr_Format(PyExc_AttributeError, "%.200s %s", error_prefix, error_str); + /* PyErr_Format(PyExc_AttributeError, "%.200s %s", error_prefix, error_str); */ return -1; } } @@ -733,82 +735,84 @@ int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *v return 0; } -static PyObject * pyrna_prop_to_py_index(PointerRNA *ptr, PropertyRNA *prop, int index) +static PyObject * pyrna_prop_to_py_index(BPy_PropertyRNA *self, int index) { - PyObject *ret; - int type = RNA_property_type(prop); - - /* see if we can coorce into a python type - PropertyType */ - switch (type) { - case PROP_BOOLEAN: - ret = PyBool_FromLong( RNA_property_boolean_get_index(ptr, prop, index) ); - break; - case PROP_INT: - ret = PyLong_FromSsize_t( (Py_ssize_t)RNA_property_int_get_index(ptr, prop, index) ); - break; - case PROP_FLOAT: - ret = PyFloat_FromDouble( RNA_property_float_get_index(ptr, prop, index) ); - break; - default: - PyErr_SetString(PyExc_AttributeError, "not an array type"); - ret = NULL; - break; - } - - return ret; + return pyrna_py_from_array_index(self, index); } -static int pyrna_py_to_prop_index(PointerRNA *ptr, PropertyRNA *prop, int index, PyObject *value) +static int pyrna_py_to_prop_index(BPy_PropertyRNA *self, int index, PyObject *value) { int ret = 0; + int totdim; + PointerRNA *ptr= &self->ptr; + PropertyRNA *prop= self->prop; int type = RNA_property_type(prop); - - /* see if we can coorce into a python type - PropertyType */ - switch (type) { - case PROP_BOOLEAN: - { - int param = PyObject_IsTrue( value ); + + totdim= RNA_property_array_dimension(prop, NULL); + + if (totdim > 1) { + /* char error_str[512]; */ + if (!pyrna_py_to_array_index(&self->ptr, self->prop, self->arraydim, self->arrayoffset, index, value, "")) { + /* PyErr_SetString(PyExc_AttributeError, error_str); */ + ret= -1; + } + } + else { + /* see if we can coorce into a python type - PropertyType */ + switch (type) { + case PROP_BOOLEAN: + { + int param = PyObject_IsTrue( value ); - if( param < 0 ) { - PyErr_SetString(PyExc_TypeError, "expected True/False or 0/1"); + if( param < 0 ) { + PyErr_SetString(PyExc_TypeError, "expected True/False or 0/1"); + ret = -1; + } else { + RNA_property_boolean_set_index(ptr, prop, index, param); + } + break; + } + case PROP_INT: + { + int param = PyLong_AsSsize_t(value); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "expected an int type"); + ret = -1; + } else { + RNA_property_int_set_index(ptr, prop, index, param); + } + break; + } + case PROP_FLOAT: + { + float param = PyFloat_AsDouble(value); + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, "expected a float type"); + ret = -1; + } else { + RNA_property_float_set_index(ptr, prop, index, param); + } + break; + } + default: + PyErr_SetString(PyExc_AttributeError, "not an array type"); ret = -1; - } else { - RNA_property_boolean_set_index(ptr, prop, index, param); + break; } - break; - } - case PROP_INT: - { - int param = PyLong_AsSsize_t(value); - if (PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, "expected an int type"); - ret = -1; - } else { - RNA_property_int_set_index(ptr, prop, index, param); - } - break; - } - case PROP_FLOAT: - { - float param = PyFloat_AsDouble(value); - if (PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, "expected a float type"); - ret = -1; - } else { - RNA_property_float_set_index(ptr, prop, index, param); - } - break; - } - default: - PyErr_SetString(PyExc_AttributeError, "not an array type"); - ret = -1; - break; } return ret; } //---------------sequence------------------------------------------- +static int pyrna_prop_array_length(BPy_PropertyRNA *self) +{ + if (RNA_property_array_dimension(self->prop, NULL) > 1) + return RNA_property_multidimensional_array_length(&self->ptr, self->prop, self->arraydim); + else + return RNA_property_array_length(&self->ptr, self->prop); +} + static Py_ssize_t pyrna_prop_len( BPy_PropertyRNA * self ) { Py_ssize_t len; @@ -816,10 +820,10 @@ static Py_ssize_t pyrna_prop_len( BPy_PropertyRNA * self ) if (RNA_property_type(self->prop) == PROP_COLLECTION) { len = RNA_property_collection_length(&self->ptr, self->prop); } else { - len = RNA_property_array_length(&self->ptr, self->prop); + len = pyrna_prop_array_length(self); if (len==0) { /* not an array*/ - PyErr_SetString(PyExc_AttributeError, "len() only available for collection RNA types"); + PyErr_SetString(PyExc_AttributeError, "len() only available for collection and array RNA types"); return -1; } } @@ -840,14 +844,15 @@ static PyObject *prop_subscript_collection_int(BPy_PropertyRNA * self, int keynu PyErr_Format(PyExc_IndexError, "index %d out of range", keynum); return NULL; } + static PyObject *prop_subscript_array_int(BPy_PropertyRNA * self, int keynum) { - int len= RNA_property_array_length(&self->ptr, self->prop); + int len= pyrna_prop_array_length(self); if(keynum < 0) keynum += len; if(keynum >= 0 && keynum < len) - return pyrna_prop_to_py_index(&self->ptr, self->prop, keynum); + return pyrna_prop_to_py_index(self, keynum); PyErr_Format(PyExc_IndexError, "index %d out of range", keynum); return NULL; @@ -894,7 +899,7 @@ static PyObject *prop_subscript_array_slice(BPy_PropertyRNA * self, int start, i start = MIN2(start,stop); /* values are clamped from PySlice_GetIndicesEx */ for(count = start; count < stop; count++) - PyList_SetItem(list, count - start, pyrna_prop_to_py_index(&self->ptr, self->prop, count)); + PyList_SetItem(list, count - start, pyrna_prop_to_py_index(self, count)); return list; } @@ -947,8 +952,8 @@ static PyObject *prop_subscript_array(BPy_PropertyRNA * self, PyObject *key) return prop_subscript_array_int(self, PyLong_AsSsize_t(key)); } else if (PySlice_Check(key)) { - int len= RNA_property_array_length(&self->ptr, self->prop); Py_ssize_t start, stop, step, slicelength; + int len = pyrna_prop_array_length(self); if (PySlice_GetIndicesEx((PySliceObject*)key, len, &start, &stop, &step, &slicelength) < 0) return NULL; @@ -974,13 +979,12 @@ static PyObject *pyrna_prop_subscript( BPy_PropertyRNA * self, PyObject *key ) { if (RNA_property_type(self->prop) == PROP_COLLECTION) { return prop_subscript_collection(self, key); - } else if (RNA_property_array_length(&self->ptr, self->prop)) { /* arrays are currently fixed length, zero length means its not an array */ + } else if (RNA_property_array_length(&self->ptr, self->prop)) { /* zero length means its not an array */ return prop_subscript_array(self, key); - } else { - PyErr_SetString(PyExc_TypeError, "rna type is not an array or a collection"); - return NULL; - } + } + PyErr_SetString(PyExc_TypeError, "rna type is not an array or a collection"); + return NULL; } static int prop_subscript_ass_array_slice(BPy_PropertyRNA * self, int begin, int end, PyObject *value) @@ -991,7 +995,7 @@ static int prop_subscript_ass_array_slice(BPy_PropertyRNA * self, int begin, int begin = MIN2(begin,end); for(count = begin; count < end; count++) { - if(pyrna_py_to_prop_index(&self->ptr, self->prop, count - begin, value) == -1) { + if(pyrna_py_to_prop_index(self, count - begin, value) == -1) { /* TODO - this is wrong since some values have been assigned... will need to fix that */ return -1; /* pyrna_struct_CreatePyObject should set the error */ } @@ -1002,13 +1006,12 @@ static int prop_subscript_ass_array_slice(BPy_PropertyRNA * self, int begin, int static int prop_subscript_ass_array_int(BPy_PropertyRNA * self, int keynum, PyObject *value) { - - int len= RNA_property_array_length(&self->ptr, self->prop); + int len= pyrna_prop_array_length(self); if(keynum < 0) keynum += len; if(keynum >= 0 && keynum < len) - return pyrna_py_to_prop_index(&self->ptr, self->prop, keynum, value); + return pyrna_py_to_prop_index(self, keynum, value); PyErr_SetString(PyExc_IndexError, "out of range"); return -1; @@ -1682,7 +1685,7 @@ PyObject *pyrna_prop_iter(BPy_PropertyRNA *self) if (ret==NULL) { /* collection did not work, try array */ - int len = RNA_property_array_length(&self->ptr, self->prop); + int len = pyrna_prop_array_length(self); if (len) { int i; @@ -1690,7 +1693,7 @@ PyObject *pyrna_prop_iter(BPy_PropertyRNA *self) ret = PyList_New(len); for (i=0; i < len; i++) { - PyList_SET_ITEM(ret, i, pyrna_prop_to_py_index(&self->ptr, self->prop, i)); + PyList_SET_ITEM(ret, i, pyrna_prop_to_py_index(self, i)); } } } @@ -1781,6 +1784,8 @@ PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *data) /* resolve the array from a new pytype */ ret = PyTuple_New(len); + /* kazanbas: TODO make multidim sequences here */ + switch (type) { case PROP_BOOLEAN: for(a=0; aptr = *ptr; pyrna->prop = prop; + + pyrna->arraydim= 0; + pyrna->arrayoffset= 0; return ( PyObject * ) pyrna; } diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h index d65849ad8a4..d006b168f45 100644 --- a/source/blender/python/intern/bpy_rna.h +++ b/source/blender/python/intern/bpy_rna.h @@ -55,6 +55,10 @@ typedef struct { PyObject_HEAD /* required python macro */ PointerRNA ptr; PropertyRNA *prop; + + /* Arystan: this is a hack to allow sub-item r/w access like: face.uv[n][m] */ + int arraydim; /* array dimension, e.g: 0 for face.uv, 2 for face.uv[n][m], etc. */ + int arrayoffset; /* array first item offset, e.g. if face.uv is [4][2], arrayoffset for face.uv[n] is 2n */ } BPy_PropertyRNA; /* cheap trick */ @@ -92,8 +96,11 @@ void pyrna_alloc_types(void); void pyrna_free_types(void); /* primitive type conversion */ -int pyrna_py_to_boolean_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, char *error_str, int error_str_size); -int pyrna_py_to_int_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, char *error_str, int error_str_size); -int pyrna_py_to_float_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, char *error_str, int error_str_size); +int pyrna_py_to_array(PointerRNA *ptr, PropertyRNA *prop, char *param_data, PyObject *py, const char *error_prefix); +int pyrna_py_to_array_index(PointerRNA *ptr, PropertyRNA *prop, int arraydim, int arrayoffset, int index, PyObject *py, const char *error_prefix); + +PyObject *pyrna_py_from_array(PointerRNA *ptr, PropertyRNA *prop); +PyObject *pyrna_py_from_array_index(BPy_PropertyRNA *self, int index); +PyObject *pyrna_math_object_from_array(PointerRNA *ptr, PropertyRNA *prop); #endif diff --git a/tools/btools.py b/tools/btools.py index 580a457e3a0..7cadab992b8 100755 --- a/tools/btools.py +++ b/tools/btools.py @@ -91,7 +91,7 @@ def validate_arguments(args, bc): 'BF_BSC', 'BF_CONFIG', 'BF_PRIORITYLIST', 'BF_BUILDINFO','CC', 'CXX', 'BF_QUICKDEBUG', 'BF_LISTDEBUG', 'LCGDIR', 'BF_X264_CONFIG', 'BF_XVIDCORE_CONFIG', - 'BF_DOCDIR'] + 'BF_DOCDIR', 'BF_UNIT_TEST'] okdict = {} @@ -386,7 +386,9 @@ def read_opts(cfg, args): ('BF_CONFIG', 'SCons python config file used to set default options', 'user_config.py'), ('BF_NUMJOBS', 'Number of build processes to spawn', '1'), - ('BF_MSVS', 'Generate MSVS project files and solution', False) + ('BF_MSVS', 'Generate MSVS project files and solution', False), + + (BoolVariable('BF_UNIT_TEST', 'Build with unit test support.', False)) ) # end of opts.AddOptions() From 952fa6d1c182fafa1f2a9133809a2b58ad7a91c2 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Sun, 6 Sep 2009 16:58:14 +0000 Subject: [PATCH 458/577] 2.5/Paint: * Fixed some bad UI pointed out by letterrip. People had made some quite bad changes (duplicating buttons, adding UI for non-existent features, even deleting UI for existing features!) --- release/ui/space_view3d_toolbar.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py index 0b7ccb15d6c..8a42d9683f8 100644 --- a/release/ui/space_view3d_toolbar.py +++ b/release/ui/space_view3d_toolbar.py @@ -342,9 +342,6 @@ class VIEW3D_PT_tools_brush(PaintPanel): col = layout.column() - if brush.sculpt_tool != 'LAYER': - col.itemR(brush, "anchored") - if brush.sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'): col.itemR(brush, "flip_direction") @@ -352,8 +349,6 @@ class VIEW3D_PT_tools_brush(PaintPanel): col.itemR(brush, "persistent") col.itemO("sculpt.set_persistent_base") - col.itemR(brush, "rake") - col.itemR(brush, "sculpt_tool") # Texture Paint Mode # @@ -426,24 +421,29 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel): brush = settings.brush texture_paint = context.texture_paint_object + if context.sculpt_object: + if brush.sculpt_tool != 'LAYER': + layout.itemR(brush, "anchored") + layout.itemR(brush, "rake") + + layout.itemR(brush, "airbrush") + col = layout.column() + col.active = brush.airbrush + col.itemR(brush, "rate", slider=True) + if not texture_paint: layout.itemR(brush, "smooth_stroke") col = layout.column() - col.itemR(brush, "airbrush") - col.itemR(brush, "anchored") - col.itemR(brush, "rake") + col.active = brush.smooth_stroke + col.itemR(brush, "smooth_stroke_radius", text="Radius", slider=True) + col.itemR(brush, "smooth_stroke_factor", text="Factor", slider=True) layout.itemR(brush, "space") row = layout.row(align=True) row.active = brush.space row.itemR(brush, "spacing", text="Distance", slider=True) if texture_paint: - row.itemR(brush, "spacing_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") - - layout.itemR(brush, "airbrush") - col = layout.column() - col.active = brush.airbrush - col.itemR(brush, "rate", slider=True) + row.itemR(brush, "spacing_pressure", toggle=True, icon='ICON_BRUSH_DATA', text="") class VIEW3D_PT_tools_brush_curve(PaintPanel): __label__ = "Curve" From 6a301de3eb0e4021d892708ead17c55900682e47 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 6 Sep 2009 19:18:12 +0000 Subject: [PATCH 459/577] users on blenderartist reported uncompressed TGA loading worked for them where compressed didnt. --- release/io/engine_render_pov.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release/io/engine_render_pov.py b/release/io/engine_render_pov.py index c3165d22540..02b8aab4c42 100644 --- a/release/io/engine_render_pov.py +++ b/release/io/engine_render_pov.py @@ -616,7 +616,7 @@ def write_pov_ini(filename_ini, filename_pov, filename_image): file.write('Display=0\n') file.write('Pause_When_Done=0\n') - file.write('Output_File_Type=C\n') # TGA, best progressive loading + file.write('Output_File_Type=T\n') # TGA, best progressive loading file.write('Output_Alpha=1\n') if render.antialiasing: From 7064f6c5d88e17406df1c7c8d1fec20364571084 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Sun, 6 Sep 2009 19:51:57 +0000 Subject: [PATCH 460/577] Mathutils fix: Vector.reflect * correct function for reflection and moving it to arithb.c * note: 2.5 has an already more elegant solution for it (still wrong, but the code is cleaner). Therefore the merge may need to be manual in that case. Specifically in 2.5 we are doing: if(!BaseMath_ReadCallback(self) || !BaseMath_ReadCallback(value)) return NULL; And there we don't need to create a VectorObject *mirrvec; only to get the values. Code used to test it: http://www.pasteall.org/7654/python * YoFrankie script probably needs to be fixed too. --- source/blender/blenlib/BLI_arithb.h | 1 + source/blender/blenlib/intern/arithb.c | 23 +++++++++++++++++++ source/blender/python/api2_2x/vector.c | 31 +++++--------------------- 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h index 86b626dabdf..0c3ec40f16d 100644 --- a/source/blender/blenlib/BLI_arithb.h +++ b/source/blender/blenlib/BLI_arithb.h @@ -270,6 +270,7 @@ void AxisAngleToQuat(float *q, float *axis, float angle); void RotationBetweenVectorsToQuat(float *q, float v1[3], float v2[3]); void vectoquat(float *vec, short axis, short upflag, float *q); +void VecReflect(float *out, float *v1, float *v2); void VecBisect3(float *v, float *v1, float *v2, float *v3); float VecAngle2(float *v1, float *v2); float VecAngle3(float *v1, float *v2, float *v3); diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index c20794953b9..e7a31e37581 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -2981,6 +2981,29 @@ void VecBisect3(float *out, float *v1, float *v2, float *v3) Normalize(out); } +/* Returns a reflection vector from a vector and a normal vector +reflect = vec - ((2 * DotVecs(vec, mirror)) * mirror) +*/ +void VecReflect(float *out, float *v1, float *v2) +{ + float vec[3], normal[3]; + float reflect[3] = {0.0f, 0.0f, 0.0f}; + float dot2; + + VecCopyf(vec, v1); + VecCopyf(normal, v2); + + Normalize(normal); + + dot2 = 2 * Inpf(vec, normal); + + reflect[0] = vec[0] - (dot2 * normal[0]); + reflect[1] = vec[1] - (dot2 * normal[1]); + reflect[2] = vec[2] - (dot2 * normal[2]); + + VecCopyf(out, reflect); +} + /* Return the angle in degrees between vecs 1-2 and 2-3 in degrees If v1 is a shoulder, v2 is the elbow and v3 is the hand, this would return the angle at the elbow */ diff --git a/source/blender/python/api2_2x/vector.c b/source/blender/python/api2_2x/vector.c index a7e00e2878a..6a0107142c1 100644 --- a/source/blender/python/api2_2x/vector.c +++ b/source/blender/python/api2_2x/vector.c @@ -277,19 +277,14 @@ PyObject *Vector_ToTrackQuat( VectorObject * self, PyObject * args ) /*----------------------------Vector.reflect(mirror) ---------------------- return a reflected vector on the mirror normal - ((2 * DotVecs(vec, mirror)) * mirror) - vec - using arithb.c would be nice here */ + vec - ((2 * DotVecs(vec, mirror)) * mirror) +*/ PyObject *Vector_Reflect( VectorObject * self, PyObject * value ) { VectorObject *mirrvec; float mirror[3]; float vec[3]; - float reflect[4] = {0.0f, 0.0f, 0.0f, 0.0f}; - float dot2; - - /* for normalizing */ - int i; - float norm = 0.0f; + float reflect[3] = {0.0f, 0.0f, 0.0f}; if (!VectorObject_Check(value)) { PyErr_SetString( PyExc_TypeError, "vec.reflect(value): expected a vector argument" ); @@ -302,27 +297,13 @@ PyObject *Vector_Reflect( VectorObject * self, PyObject * value ) if (mirrvec->size > 2) mirror[2] = mirrvec->vec[2]; else mirror[2] = 0.0; - /* normalize, whos idea was it not to use arithb.c? :-/ */ - for(i = 0; i < 3; i++) { - norm += mirror[i] * mirror[i]; - } - norm = (float) sqrt(norm); - for(i = 0; i < 3; i++) { - mirror[i] /= norm; - } - /* done */ - vec[0] = self->vec[0]; vec[1] = self->vec[1]; if (self->size > 2) vec[2] = self->vec[2]; else vec[2] = 0.0; - - dot2 = 2 * vec[0]*mirror[0]+vec[1]*mirror[1]+vec[2]*mirror[2]; - - reflect[0] = (dot2 * mirror[0]) - vec[0]; - reflect[1] = (dot2 * mirror[1]) - vec[1]; - reflect[2] = (dot2 * mirror[2]) - vec[2]; - + + VecReflect(reflect, vec, mirror); + return newVectorObject(reflect, self->size, Py_NEW); } From a6466883250037a502ef2415dcb8e2acc3e9766f Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Sun, 6 Sep 2009 20:59:06 +0000 Subject: [PATCH 461/577] SVN maintenance. --- source/blender/makesrna/intern/rna_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/makesrna/intern/rna_test.c b/source/blender/makesrna/intern/rna_test.c index bfaf318018a..988c8f8a539 100644 --- a/source/blender/makesrna/intern/rna_test.c +++ b/source/blender/makesrna/intern/rna_test.c @@ -1,5 +1,5 @@ /** - * $Id: rna_test.c $ + * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** * From 84448173c39317a71a3f9456b5885c3eb653d675 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sun, 6 Sep 2009 23:15:43 +0000 Subject: [PATCH 462/577] 2.5 - Rotation Order Tweaks * Copy Rotation constraint should now work ok with this new code again. Previously, it was the only thing that really went beserk when the typos were still uncaught. * Fixed one other case of a potential case where typos would cause problems. * Made changing the rotation order setting perform conversions of the current rotation to an equivalent representation in the other orders/forms. This is done at RNA level, so maybe not that great for switching representations while animating? --- source/blender/blenkernel/intern/constraint.c | 3 +- source/blender/blenlib/intern/arithb.c | 4 +- source/blender/makesrna/intern/rna_pose.c | 62 +++++++++++++++++++ 3 files changed, 65 insertions(+), 4 deletions(-) diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index e6e65ebd614..0f7767a1808 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -1558,8 +1558,7 @@ static void rotlike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta VECCOPY(loc, cob->matrix[3]); Mat4ToSize(cob->matrix, size); - //Mat4ToEulO(ct->matrix, eul, ct->rotOrder); - Mat4ToEul(ct->matrix, eul); // the version we should be using causes errors... + Mat4ToEulO(ct->matrix, eul, ct->rotOrder); Mat4ToEulO(cob->matrix, obeul, cob->rotOrder); if ((data->flag & ROTLIKE_X)==0) diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index 7a4aaa1a858..2e60fbba4c9 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -2835,10 +2835,10 @@ void EulOToQuat(float e[3], short order, float q[4]) double ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss; double a[3]; - if (R->parity) e[1] = -e[1]; // xxx watch it! - ti = e[i]/2; tj = e[j]/2; th = e[k]/2; + if (R->parity) e[j] = -e[j]; + ci = cos(ti); cj = cos(tj); ch = cos(th); si = sin(ti); sj = sin(tj); sh = sin(th); diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 6c951b5a1b7..c5297f7b7fa 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -130,6 +130,67 @@ static void rna_PoseChannel_euler_rotation_set(PointerRNA *ptr, const float *val VECCOPY(pchan->eul, value); } +static void rna_PoseChannel_rotation_mode_set(PointerRNA *ptr, int value) +{ + bPoseChannel *pchan= ptr->data; + + /* check if any change - if so, need to convert data */ + // TODO: this needs to be generalised at some point to work for objects too... + if (value > 0) { /* to euler */ + if (pchan->rotmode < 0) { // FIXME: need a define for this + /* axis-angle to euler */ + float m[3][3]; + + /* convert to 3x3 matrix, then to euler + * - axis angle is stored in quats + */ + VecRotToMat3(&pchan->quat[1], pchan->quat[0], m); + Mat3ToEulO(m, pchan->eul, value); + } + else if (pchan->rotmode == PCHAN_ROT_QUAT) { + /* quat to euler */ + QuatToEulO(pchan->quat, pchan->eul, value); + } + /* else { no conversion needed } */ + } + else if (value == PCHAN_ROT_QUAT) { /* to quat */ + if (pchan->rotmode < 0) { // FIXME: need a define for this + /* axis angle to quat */ + float q[4]; + + /* copy to temp var first, since quats and axis-angle are stored in same place */ + QuatCopy(q, pchan->quat); + AxisAngleToQuat(q, &pchan->quat[1], pchan->quat[0]); + } + else if (pchan->rotmode > 0) { + /* euler to quat */ + EulOToQuat(pchan->eul, pchan->rotmode, pchan->quat); + } + /* else { no conversion needed } */ + } + else { /* to axis-angle */ + if (pchan->rotmode > 0) { // FIXME: need a define for this + /* euler to axis angle */ + float q[4]; + + /* convert to temp quat, then to axis angle (since stored in same var) */ + EulOToQuat(pchan->eul, pchan->rotmode, q); + QuatToAxisAngle(q, &pchan->quat[1], pchan->quat[0]); + } + else if (pchan->rotmode == PCHAN_ROT_QUAT) { + /* quat to axis angle */ + float q[4]; + + /* copy to temp var first, since quats and axis-angle are stored in same place */ + QuatCopy(q, pchan->quat); + QuatToAxisAngle(q, &pchan->quat[1], pchan->quat[0]); + } + } + + /* finally, set the new rotation type */ + pchan->rotmode= value; +} + static void rna_PoseChannel_name_set(PointerRNA *ptr, const char *value) { Object *ob= (Object*)ptr->id.data; @@ -439,6 +500,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) prop= RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rotmode"); RNA_def_property_enum_items(prop, prop_rotmode_items); + RNA_def_property_enum_funcs(prop, NULL, "rna_PoseChannel_rotation_mode_set", NULL); RNA_def_property_ui_text(prop, "Rotation Mode", ""); RNA_def_property_update(prop, NC_OBJECT|ND_POSE|ND_TRANSFORM, "rna_Pose_update"); From f5e80e7a80feb4b516792b961c2310210536aef8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 7 Sep 2009 04:52:42 +0000 Subject: [PATCH 463/577] Operator docstring patch from Ron Walker, added console operator docs too. --- release/ui/space_console.py | 4 ++-- source/blender/editors/interface/view2d_ops.c | 11 +++++++++++ source/blender/editors/space_view3d/view3d_buttons.c | 1 + source/blender/editors/space_view3d/view3d_edit.c | 2 +- source/blender/editors/space_view3d/view3d_header.c | 1 + source/blender/editors/space_view3d/view3d_select.c | 4 ++++ source/blender/editors/space_view3d/view3d_snap.c | 7 +++++++ source/blender/editors/space_view3d/view3d_toolbar.c | 1 + source/blender/editors/space_view3d/view3d_view.c | 3 +++ 9 files changed, 31 insertions(+), 3 deletions(-) diff --git a/release/ui/space_console.py b/release/ui/space_console.py index dbf202f924c..136082a285a 100644 --- a/release/ui/space_console.py +++ b/release/ui/space_console.py @@ -108,7 +108,7 @@ def get_console(console_id): class CONSOLE_OT_exec(bpy.types.Operator): ''' - Operator documentatuon text, will be used for the operator tooltip and python docs. + Execute the current console line as a python expression. ''' __idname__ = "console.execute" __label__ = "Console Execute" @@ -385,7 +385,7 @@ def autocomp(bcon): class CONSOLE_OT_autocomplete(bpy.types.Operator): ''' - Operator documentatuon text, will be used for the operator tooltip and python docs. + Evaluate the namespace up until the cursor and give a list of options or complete the name if there is only one. ''' __idname__ = "console.autocomplete" __label__ = "Console Autocomplete" diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index f3610769d17..3e009884dee 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -257,6 +257,7 @@ void VIEW2D_OT_pan(wmOperatorType *ot) { /* identifiers */ ot->name= "Pan View"; + ot->description= "Pan the view."; ot->idname= "VIEW2D_OT_pan"; /* api callbacks */ @@ -305,6 +306,7 @@ void VIEW2D_OT_scroll_right(wmOperatorType *ot) { /* identifiers */ ot->name= "Scroll Right"; + ot->description= "Scroll the view right."; ot->idname= "VIEW2D_OT_scroll_right"; /* api callbacks */ @@ -351,6 +353,7 @@ void VIEW2D_OT_scroll_left(wmOperatorType *ot) { /* identifiers */ ot->name= "Scroll Left"; + ot->description= "Scroll the view left."; ot->idname= "VIEW2D_OT_scroll_left"; /* api callbacks */ @@ -396,6 +399,7 @@ void VIEW2D_OT_scroll_down(wmOperatorType *ot) { /* identifiers */ ot->name= "Scroll Down"; + ot->description= "Scroll the view down."; ot->idname= "VIEW2D_OT_scroll_down"; /* api callbacks */ @@ -442,6 +446,7 @@ void VIEW2D_OT_scroll_up(wmOperatorType *ot) { /* identifiers */ ot->name= "Scroll Up"; + ot->description= "Scroll the view up."; ot->idname= "VIEW2D_OT_scroll_up"; /* api callbacks */ @@ -575,6 +580,7 @@ void VIEW2D_OT_zoom_in(wmOperatorType *ot) { /* identifiers */ ot->name= "Zoom In"; + ot->description= "Zoom in the view."; ot->idname= "VIEW2D_OT_zoom_in"; /* api callbacks */ @@ -611,6 +617,7 @@ void VIEW2D_OT_zoom_out(wmOperatorType *ot) { /* identifiers */ ot->name= "Zoom Out"; + ot->description= "Zoom out the view."; ot->idname= "VIEW2D_OT_zoom_out"; /* api callbacks */ @@ -857,6 +864,7 @@ void VIEW2D_OT_zoom(wmOperatorType *ot) { /* identifiers */ ot->name= "Zoom View"; + ot->description= "Zoom in/out the view."; ot->idname= "VIEW2D_OT_zoom"; /* api callbacks */ @@ -958,6 +966,7 @@ void VIEW2D_OT_zoom_border(wmOperatorType *ot) { /* identifiers */ ot->name= "Zoom to Border"; + ot->description= "Zoom in the view to the nearest item contained in the border."; ot->idname= "VIEW2D_OT_zoom_border"; /* api callbacks */ @@ -1297,6 +1306,7 @@ void VIEW2D_OT_scroller_activate(wmOperatorType *ot) { /* identifiers */ ot->name= "Scroller Activate"; + ot->description= "Scroll view by mouse click and drag."; ot->idname= "VIEW2D_OT_scroller_activate"; /* flags */ @@ -1363,6 +1373,7 @@ void VIEW2D_OT_reset(wmOperatorType *ot) { /* identifiers */ ot->name= "Reset View"; + ot->description= "Reset the view."; ot->idname= "VIEW2D_OT_reset"; /* api callbacks */ diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index c854de8e54d..39e90a37b3f 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1451,6 +1451,7 @@ static int view3d_properties(bContext *C, wmOperator *op) void VIEW3D_OT_properties(wmOperatorType *ot) { ot->name= "Properties"; + ot->description= "Display the properties panel."; ot->idname= "VIEW3D_OT_properties"; ot->exec= view3d_properties; diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index a7ea19e49f9..bbcee0415f8 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -1895,7 +1895,7 @@ void VIEW3D_OT_manipulator(wmOperatorType *ot) /* identifiers */ ot->name= "3D Manipulator"; - ot->description = ""; + ot->description = "Manipulate selected item by axis."; ot->idname= "VIEW3D_OT_manipulator"; /* api callbacks */ diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index b6159cf4314..45b0ea41215 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -252,6 +252,7 @@ void VIEW3D_OT_layers(wmOperatorType *ot) { /* identifiers */ ot->name= "Layers"; + ot->description= "Toggle layer(s) visibility."; ot->idname= "VIEW3D_OT_layers"; /* api callbacks */ diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 5c6a22f5157..42954e09060 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -756,6 +756,7 @@ static int view3d_lasso_select_exec(bContext *C, wmOperator *op) void VIEW3D_OT_select_lasso(wmOperatorType *ot) { ot->name= "Lasso Select"; + ot->description= "Select items using lasso selection."; ot->idname= "VIEW3D_OT_select_lasso"; ot->invoke= WM_gesture_lasso_invoke; @@ -1534,6 +1535,7 @@ void VIEW3D_OT_select_border(wmOperatorType *ot) { /* identifiers */ ot->name= "Border Select"; + ot->description= "Select items using border selection."; ot->idname= "VIEW3D_OT_select_border"; /* api callbacks */ @@ -1593,6 +1595,7 @@ void VIEW3D_OT_select(wmOperatorType *ot) { /* identifiers */ ot->name= "Activate/Select"; + ot->description= "Activate/select item(s)."; ot->idname= "VIEW3D_OT_select"; /* api callbacks */ @@ -1831,6 +1834,7 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op) void VIEW3D_OT_select_circle(wmOperatorType *ot) { ot->name= "Circle Select"; + ot->description= "Select items using circle selection."; ot->idname= "VIEW3D_OT_select_circle"; ot->invoke= WM_gesture_circle_invoke; diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index 2e5696170e2..73b70ccb532 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -555,6 +555,7 @@ void VIEW3D_OT_snap_selected_to_grid(wmOperatorType *ot) /* identifiers */ ot->name= "Snap Selection to Grid"; + ot->description= "Snap selected item(s) to nearest grid node."; ot->idname= "VIEW3D_OT_snap_selected_to_grid"; /* api callbacks */ @@ -680,6 +681,7 @@ void VIEW3D_OT_snap_selected_to_cursor(wmOperatorType *ot) /* identifiers */ ot->name= "Snap Selection to Cursor"; + ot->description= "Snap selected item(s) to cursor."; ot->idname= "VIEW3D_OT_snap_selected_to_cursor"; /* api callbacks */ @@ -715,6 +717,7 @@ void VIEW3D_OT_snap_cursor_to_grid(wmOperatorType *ot) /* identifiers */ ot->name= "Snap Cursor to Grid"; + ot->description= "Snap cursor to nearest grid node."; ot->idname= "VIEW3D_OT_snap_cursor_to_grid"; /* api callbacks */ @@ -821,6 +824,7 @@ void VIEW3D_OT_snap_cursor_to_selected(wmOperatorType *ot) /* identifiers */ ot->name= "Snap Cursor to Selected"; + ot->description= "Snap cursor to center of selected item(s)."; ot->idname= "VIEW3D_OT_snap_cursor_to_selected"; /* api callbacks */ @@ -870,6 +874,7 @@ void VIEW3D_OT_snap_cursor_to_active(wmOperatorType *ot) /* identifiers */ ot->name= "Snap Cursor to Active"; + ot->description= "Snap cursor to active item."; ot->idname= "VIEW3D_OT_snap_cursor_to_active"; /* api callbacks */ @@ -1069,6 +1074,7 @@ void VIEW3D_OT_snap_selected_to_center(wmOperatorType *ot) /* identifiers */ ot->name= "Snap Selection to Center"; + ot->description= "Snap selected items to selections geometric center."; ot->idname= "VIEW3D_OT_snap_selected_to_center"; /* api callbacks */ @@ -1135,6 +1141,7 @@ void VIEW3D_OT_snap_menu(wmOperatorType *ot) { /* identifiers */ ot->name= "Snap Menu"; + ot->description= "Display snap menu."; ot->idname= "VIEW3D_OT_snap_menu"; /* api callbacks */ diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index c87dd0b7948..58248f675da 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -322,6 +322,7 @@ static int view3d_toolbar(bContext *C, wmOperator *op) void VIEW3D_OT_toolbar(wmOperatorType *ot) { ot->name= "Toolbar"; + ot->description= "Toggles toolbar display."; ot->idname= "VIEW3D_OT_toolbar"; ot->exec= view3d_toolbar; diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index de8166b372b..808d1635b37 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -415,6 +415,7 @@ void VIEW3D_OT_setcameratoview(wmOperatorType *ot) /* identifiers */ ot->name= "Align Camera To View"; + ot->description= "Set camera view to active view."; ot->idname= "VIEW3D_OT_camera_to_view"; /* api callbacks */ @@ -1395,6 +1396,7 @@ void VIEW3D_OT_localview(wmOperatorType *ot) /* identifiers */ ot->name= "Local View"; + ot->description= "Toggle display of selected object(s) seperately and centered in view."; ot->idname= "VIEW3D_OT_localview"; /* api callbacks */ @@ -1562,6 +1564,7 @@ void VIEW3D_OT_game_start(wmOperatorType *ot) /* identifiers */ ot->name= "Start Game Engine"; + ot->description= "Start game engine."; ot->idname= "VIEW3D_OT_game_start"; /* api callbacks */ From 183c8e0a0a82f260c4db250f4b04bb3f650618c3 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 7 Sep 2009 07:42:12 +0000 Subject: [PATCH 464/577] no functional changes, use hole rather then dutch 'gat' for bevel lists and made some comments English. --- source/blender/blenkernel/intern/curve.c | 10 +++++----- source/blender/imbuf/intern/anim5.c | 10 +++++----- source/blender/include/BIF_oops.h | 2 +- source/blender/makesdna/DNA_curve_types.h | 2 +- source/blender/src/editlattice.c | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 25af0cb5ce3..a1ad5347f7e 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -1783,14 +1783,14 @@ void makeBevelList(Object *ob) bl= blnext; } - /* STEP 3: COUNT POLYS TELLEN AND AUTOHOLE */ + /* STEP 3: POLYS COUNT AND AUTOHOLE */ bl= cu->bev.first; poly= 0; while(bl) { if(bl->nr && bl->poly>=0) { poly++; bl->poly= poly; - bl->gat= 0; /* 'gat' is dutch for hole */ + bl->hole= 0; } bl= bl->next; } @@ -1842,7 +1842,7 @@ void makeBevelList(Object *ob) sd1= sortdata+ (a-1); for(b=a-1; b>=0; b--, sd1--) { /* all polys to the left */ if(bevelinside(sd1->bl, bl)) { - bl->gat= 1- sd1->bl->gat; + bl->hole= 1- sd1->bl->hole; break; } } @@ -1852,7 +1852,7 @@ void makeBevelList(Object *ob) if((cu->flag & CU_3D)==0) { sd= sortdata; for(a=0; abl->gat==sd->dir) { + if(sd->bl->hole==sd->dir) { bl= sd->bl; bevp1= (BevPoint *)(bl+1); bevp2= bevp1+ (bl->nr-1); @@ -2033,7 +2033,7 @@ void makeBevelList(Object *ob) } QUATCOPY(quat_prev, quat); /* quat_prev can't have the tilt applied */ VECCOPY(vec_prev, vec); - + AxisAngleToQuat(q, vec, bevp1->alfa); QuatMul(quat, q, quat); QuatToMat3(quat, bevp1->mat); diff --git a/source/blender/imbuf/intern/anim5.c b/source/blender/imbuf/intern/anim5.c index b6f29b6a145..2437d0d9568 100644 --- a/source/blender/imbuf/intern/anim5.c +++ b/source/blender/imbuf/intern/anim5.c @@ -204,12 +204,12 @@ static void anim5decode(struct ImBuf * ibuf, uchar * dlta) { int *ofspoint; uchar **planes; - /* samenstelling delta: - lijst met ofsets voor delta's per bitplane (ofspoint) - per kolom in delta (point) - aantal handelingen (noops) + /* composition delta: + list with ofsets for delta' s by bitplane (ofspoint) + by column in delta (point) + number of operations (noops) code - bijbehorende data + associated data ... ... */ diff --git a/source/blender/include/BIF_oops.h b/source/blender/include/BIF_oops.h index 2375a918d0e..c35acf584f1 100644 --- a/source/blender/include/BIF_oops.h +++ b/source/blender/include/BIF_oops.h @@ -61,7 +61,7 @@ struct Oops *add_test_oops(void *id); /* incl links */ void add_texture_oops(struct Material *ma); void build_oops(void); struct Oops *find_oops(ID *id); -void free_oops(struct Oops *oops); /* ook oops zelf */ +void free_oops(struct Oops *oops); /* also oops themselves */ void free_oopspace(struct SpaceOops *so); void new_oops_location(struct Oops *); int oops_test_overlap(struct Oops *test); diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index 88c03a41160..60dba9ce018 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -61,7 +61,7 @@ typedef struct Path { typedef struct BevList { struct BevList *next, *prev; int nr, flag; - short poly, gat; + short poly, hole; } BevList; /* These two Lines with # tell makesdna this struct can be excluded. */ diff --git a/source/blender/src/editlattice.c b/source/blender/src/editlattice.c index 06b092a30ac..a65c51c76f6 100644 --- a/source/blender/src/editlattice.c +++ b/source/blender/src/editlattice.c @@ -25,7 +25,7 @@ * Contributor(s): none yet. * * ***** END GPL LICENSE BLOCK ***** - * i.t.t. wat de naam doet vermoeden: ook algemene lattice (calc) functies + * what the name suggests: also general lattice (calc) functions */ #include From 10c18d72f49738d6b4caef3bfff7af87927e5d26 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Mon, 7 Sep 2009 09:43:04 +0000 Subject: [PATCH 465/577] * Another handful of brilliant new icons by jendryzch --- release/datafiles/blenderbuttons | Bin 179274 -> 182512 bytes .../editors/datafiles/blenderbuttons.c | 11309 ++++++++-------- source/blender/editors/include/UI_icons.h | 14 +- .../editors/space_image/image_buttons.c | 8 +- source/blender/makesrna/intern/rna_brush.c | 4 + source/blender/makesrna/intern/rna_gpencil.c | 2 +- source/blender/makesrna/intern/rna_modifier.c | 2 +- source/blender/makesrna/intern/rna_scene.c | 8 +- 8 files changed, 5726 insertions(+), 5621 deletions(-) diff --git a/release/datafiles/blenderbuttons b/release/datafiles/blenderbuttons index 98c321cd954437b619c43da2298b1b581381b6c7..79d6138e3f03e8b9a805e383f9560da48d27daaa 100644 GIT binary patch literal 182512 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 tEVGbFgd_)?a?i+I3k>uW~u8yF=kD3#{ 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

-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 Date: Mon, 31 Aug 2009 18:17:06 +0000 Subject: [PATCH 374/577] Part 2 of the 2.49b commit. We now should freeze and tag! --- source/blender/src/splash.jpg.c | 12322 +++++++++++++++--------------- 1 file changed, 6161 insertions(+), 6161 deletions(-) diff --git a/source/blender/src/splash.jpg.c b/source/blender/src/splash.jpg.c index 547b23b40db..58dba6b1c4c 100644 --- a/source/blender/src/splash.jpg.c +++ b/source/blender/src/splash.jpg.c @@ -1,6167 +1,6167 @@ /* DataToC output of file */ -int datatoc_splash_jpg_size= 197158; +int datatoc_splash_jpg_size= 197165; char datatoc_splash_jpg[]= { -137, 80, 78, 71, 13, 10, - 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 1,245, 0, 0, 1, 26, 8, 2, 0, 0, 0,135, 56, 89, 17, 0, 0, 0, 9,112, - 72, 89,115, 0, 0, 11, 19, 0, 0, 11, 19, 1, 0,154,156, 24, 0, 0, 0, 4,103, 65, 77, 65, 0, 0,174,211,164,123,114, 68, - 0, 0, 0, 32, 99, 72, 82, 77, 0, 0,110, 39, 0, 0,115,175, 0, 0,246,112, 0, 0,129,232, 0, 0,107,215, 0, 0,226,170, - 0, 0, 48,131, 0, 0, 21, 42,251,118,133,113, 0, 3, 1,156, 73, 68, 65, 84,120,218, 98,252,255,255, 63,195, 40, 24, 5,163, - 96, 20,140,130, 97, 7, 0, 2,136,133,138,102,253,249,249,253,223,203,235,127, 63, 63, 99,150, 50,102, 19,148, 28, 13,220, 81, - 48, 10, 70,193, 40, 24, 64, 0, 16, 64,140,212,106,191,255,249,241,237,247,230,124,150,143, 55,128,236,255, 12,204,127, 52, 35, -217,204, 18, 89, 88,217, 70,131,120, 20,140,130, 81, 48, 10, 6, 4, 0, 4, 16, 19,181, 12,250,255,242, 26,164,112, 7, 85, 26, - 12,127, 89,174, 45,249,190,171,121, 52,124, 71,193, 40, 24, 5,163, 96,160, 0, 64, 0, 81,173,124,255, 39,168,248,155,153, 7, -216, 25, 0, 35, 16,193,246,116,255,151,205,165,127,190,127, 30, 13,229, 81, 48, 10, 70,193, 40,160, 63, 0, 8, 32, 70, 42,206, -175,254,120,126,243,239,193, 54,150, 79,119, 17,141,122, 6,134,191,156,162, 76,206,237,156, 82, 26,163, 97, 61, 10, 70,193, 40, - 24, 5,244, 4, 0, 1,196, 72,245,245, 51,159,143,205, 99,189, 50,159,225,255, 63, 68,211,158,145,229,183,106, 16,183, 69, 50, - 11, 39,207,104,136,143,130, 81, 48, 10, 70, 1,125, 0, 64, 0, 49,210, 98,125,228,143, 59,135,255,238,111, 96,250,247, 3,218, -134, 7,227, 63,156, 18, 44,110,237,156,146,234,163,129, 62, 10, 70,193, 40, 24, 5,116, 0, 0, 1,196, 72,163,245,239,223, 95, -221,251,191,187,138,225,243, 35,132,208,127,134,191, 76,236, 76, 86, 37,220,186,222,163,225, 62, 10, 70,193, 40, 24, 5,180, 6, - 0, 1, 68, 84,249,254,237,195,235, 63,119, 14,253,120,126,249,255,159, 95,196, 27,205,252,235, 51,215,251,179,176, 38, 60,130, -248, 99, 90,194,111, 18, 60, 26,244,163, 96, 20,140,130, 81, 0, 7,255,254,253,251,254,253,251, 71, 48, 0, 50, 88, 88, 88,254, -252,249,195,205,205, 45, 36, 36,244,245,235, 87, 70, 70,198, 31, 63,126,124,251,246, 13, 82, 98, 75, 72, 72, 8, 11, 11,179,179, -179,227, 55, 19, 32,128, 8,151,239, 31, 46,237, 96, 58,209,195,252,247, 27, 68, 61,156, 96, 64,110,153, 99, 99,162, 9, 33,217, -243,255,175, 94, 18,191, 77,218,104,140,142,130, 81, 48, 10, 70, 1, 16, 0,203,244,135, 15, 31,242,241,241,241,242,242,242,240, -240,176,177,177, 1, 11,244,143, 31, 63, 29, 63,126, 76, 89, 89, 89, 76, 76,140,131,131,131,133,133, 21, 40,200,196,196,248,239, -223,255, 47, 95,190, 60,124,248, 0, 88,244, 75, 73, 73, 1, 5,113, 25, 11, 16, 64, 4,202,247, 95, 63,127,124, 91,224,203,242, -247, 43, 3, 35,169, 14,254,143, 89,214,255, 71,106,201,255,145, 48,231,245,106, 97,225,228, 29,141, 90,234, 2,120,132,226,137, -245,145,224,134, 81, 48, 10,134, 74,179,253,237,219,183, 79,158, 60, 49, 48, 48, 0,230, 23, 96,217,253,251,207,223,175,223,126, -222,185,255,114,223,190,189, 26,106, 10,110, 46,118,236,108,172, 64,193,191,255,254,255,252,249,231,219,143, 95, 63,126,254,225, -229, 98, 23, 18,228,190,127,239,174,176,176, 16,176, 33,143,203,112,128, 0, 98, 33, 42,183, 34, 10,107,244,236,202,136,209,110, -255,143,213, 0,140,246, 60,243,243, 19,159,151,199, 50, 59,212,240, 41,153,140,198, 49,229,229, 41, 16,124,248,250,227,194,131, -215,144,178, 85, 79, 78, 88,128,155,131, 9, 88,215,195, 0, 29,138,111,136, 51, 46, 60,120,245,225,235, 79, 32,131,166,110, 24, - 5,163, 96, 24,128, 63,127,254, 60,120,240,128,149,149, 85, 87, 87, 23,152, 65,158,191,250,120,227,206,139, 7,143,223, 60,124, -244,252,209,131, 91, 92, 60, 2,191,152,127, 10, 8, 63,248,249,235,239,171,183,159,190,125,255,245,251,247,223, 63,192, 98,254, -255,127, 54, 86, 22, 89, 25, 17, 1,142,239,114,114,114,120,204, 7, 8, 32,194,227, 51,223, 30, 95,250,115,105,197,175,175, 31, -153, 88, 89,177, 20,240,159,158,177,124,125,140,117,180,230, 55,155,240,127, 1, 57, 14,126,201,127,191, 62,253,120,243,148,237, -219, 35,198,255,127,224,101, 61,220,214,127,186, 73,130,246,233,104,166, 94,186,241, 96,235,249,187, 14,186,138,198,106,178,108, -108,172, 67, 40,182,110, 61,120,190,243,226,125, 75, 85,105, 11, 61,101,186,213,255,139, 14, 93,155,186,235,226,165, 71,111,145, -197,229,132,121, 34,173,212,178, 93,245,132,120, 57,153,153,153,169, 82,194, 66,138,239,210,165, 71, 58, 35,173,244,229, 69,153, -192, 0, 34, 14,172, 93, 74,150, 28,222,124,238,222,199,111,191,144,221,144,238,172,147,235,174, 15,116, 0, 92,241, 40, 24, 5, -163, 0,152,101,222,189,123,247,250,245,107,110,110,110, 89, 89, 89, 96,153,125,226,236,189,157, 7, 46,189,127,243,250,243,231, -215, 92,220,252, 95, 62,127,144, 85,212,178, 50, 86, 97, 98,102,190,126,251, 57,166, 9,192,220,244,246,213, 51, 39, 71, 43, 27, - 19, 5, 22, 22,236, 57, 11, 32,128, 40, 90, 63,243,238,236, 70,166, 83,253, 76,255,126, 34, 23,237,255, 25,152,126, 75,219,115, - 24,132,115,202,232, 48,179, 32,250, 7,127,190,127,249,126,125,231,239,115, 11,152,127,188,130,171,133,216,253, 95, 59, 86,208, - 41, 23,217,228,221, 71, 47,120, 78,218, 1, 84, 35,192,198,116,170, 45, 86, 73,142,192,105,101,249,147, 86,223,253, 8,114,134, -151,158, 98,150,191,245,128, 68,216,179, 23,175,108,107,150, 62,253,250, 27, 88, 7,206,138,177,143,243, 50,167,138,177,223,190, -255,216,126,241, 1,144, 33,203,207, 97,166,169,112,238,230, 35, 35,117, 68,141,253,254,203,119,183,182,245,151, 30,189,193,165, -157,143,147,109, 83,145,151,145,146, 56, 11, 48, 9,128,155,210,148, 56,230,222,203, 15, 22,181, 43,128, 37,248,166, 34, 79,123, - 45, 89,160,153,192,130, 27, 40, 14, 44,244,221,219,215, 35,151,236,200, 64, 71, 70,104,115,177,183, 8, 63, 55,196, 13,163,121, -123, 20,140,240,146,253, 45, 24,176,177,177, 1, 73,126,126,254, 63,127,254,157,188,240,224,232,241,211,156,236,156,255, 25, 25, -248,248,132,128,170, 24,153, 89,228, 36,249,213,212,213, 46, 93,127,241,247,239, 95,244,130, 27, 12, 94,191,122, 42, 38, 38,157, - 20, 97,205,195,141,125,162, 21, 32,128,200, 60, 63,242,231,151, 15, 95,143,204, 96,190,179, 1,109, 64,230, 55,135, 4,139,117, -177,136,166, 45, 22,155, 56,121,120,141,130,255,104,186,127, 62, 56,137,241,246, 6,148,246,254,149,197,159,132,228,248, 12,252, - 81, 4,193,133,255,135, 95,127,127,252, 36,188,104,231,196,205,167,103, 94,129,102,128, 21, 5, 7,108, 64,255,223,191,255, 79, -128,133, 59,246, 33, 42,242, 1, 23, 39,135, 36,203, 95, 96, 92, 78,221,124,156,155,153,177,107,193,246, 21,237, 25,240,132, 18, - 58, 97, 43,114,225,174, 41,201,207,199,201,250,233,251,239,235,207, 63, 66,251, 87,223,127,249,245,109,219, 80,224,110,162, 34, - 5, 47,142,201, 3,192,186, 36,124,226, 86, 72, 33,254,235, 23,176,171,248, 27, 98,218,131,215, 31,145, 11,119, 62, 14, 86, 77, - 41,126, 32,227,228, 61,168,195,174, 60,121,231,211,179,229, 96, 77, 0, 40, 25,140, 22,241,195, 11,124,249,250,243,238,253,215, -112,174,178,162, 40,176,172,217,181,239,218,177, 83,119,173,204,148,221,156,180, 72, 50,141, 72,141,104,150, 74,136,241,137,139, -241,145,231,254,187, 15, 94, 47, 94,113,162,161,194, 23,191, 93,250, 58, 50,212, 10,177, 7, 15, 30, 0,179,143,146,146, 18, 48, - 47,112,115,113,223,186,125,107,253,150,163, 60,252, 18,146,114, 26,192,252,241,255, 31,168,248,224,229,227, 84,146,224,224,224, -226,218,176,105,167,172,130, 38, 19, 19, 51,184, 76,135,244,128,255,255,254,253,243,199,143,111,111, 95, 61, 23, 17,147,150,145, - 20,192, 85,184, 3, 1, 64, 0,145, 83,190,127,123,245,240,235,166, 34,182, 31, 79,209,196,127,113,201,243, 4, 77,229, 20, 16, -129,150,245,191,127,239, 61,121,109,203,165,251,130,220,156,206, 26,210,214, 70,234,172,172,172,192, 82, 94,208,163,234,237,215, -183,204,207, 14, 51, 32,141,204,255, 62, 54,225,151,134, 43, 27, 7,215, 80,175,155, 25, 24,168, 63,202,204,195,195, 13, 36,181, -100,132, 22,108, 59,166, 41,129,168,192,128, 5,235,225, 27,207, 32,108,115, 37,145,206, 96, 35, 57, 17, 94,200, 80, 12,176,180, -109,220,120,110,205,153,135,144, 34,190,115,243,185, 37, 89,194,224,201,119, 50,155,240,255,254,253, 75,153,181, 7, 62, 4,244, -231,207, 95,160, 8,100,192,189,100,201, 97,120,225,158,235,172,145,239,162, 9, 25,141, 1, 86, 51,115, 15,221,156,176,251, 26, - 80,252,234,211,247,109, 27,207,212, 4,154,193,135,227, 71, 75,198,225, 1,128,101, 95, 67,199, 38, 68, 90,229,102, 47,201,117, -255,242,237,231,197, 43,143,245, 72, 47, 19,137,212, 8,177, 84, 95, 71, 22,194, 37,163, 34, 65,216,248, 5,100, 35,166,248,186, - 45,231, 47, 93,121, 2, 44,247, 33,118,173, 95,146, 69,149,150,251,163, 71,160, 45, 65,106,106,106,192, 44,240,225,195,167,109, -219,182,187,123,122, 91,218,114, 94,185,245, 76,132,159, 75, 84,136, 71, 94, 86, 68, 86, 74, 72, 12,152,145,153,152,158, 60,121, -250,248,169,230,227,167,207,249,248,133,254,254,253, 3, 90,237,242,229,211,175, 95, 63,216, 56, 56,129, 36,232,156, 94, 22, 38, -125, 29,124,227,239, 0, 1, 68,114,249,254,233,206,201,159,123, 27, 89,126,189,133,159, 63, 0,201,169,255,152, 56,184,220, 26, -224,133,251,142,227,151,171,150, 29,188,250,250, 43,164,204,235,220,126, 65, 73,248, 64, 95,180,189,151,149, 46, 80,132,223,179, -238,203,202,184,255,159,159,195, 87,212, 48,254,254,242,253,226, 6, 54,243, 40,244,226, 18, 44,255,236,229,155, 77, 39,110, 60, -124,253,241,195,247, 63,192, 48,146, 17,226,246, 48, 86, 53,209, 84, 64, 81,248,255, 63, 90,211,249,205,187,143,107, 14, 94,220, -113,249,193,213, 7,175,222,126,251,197,201,194,172, 32,193,239,162,167,152,236,106, 44, 39, 41,130,203,131,251,207, 92,223,116, -234,214,201,187,207, 56,216,217, 12, 20, 36, 2,205, 84,109, 13,212,208,212,220,188,247,116,221,137,235, 79,222,125,251,241,239, -191, 32, 59,179,162,164,160,135,129, 18, 59, 11, 19, 3,194, 9, 8,135,188,251,240,105,241,222, 11,155,207,220,186,251,242,227, -151, 95,127,217,153,153,100,132,185,237,117,149, 18,157, 13, 52,228,196,177,186,225,240,133, 91,221, 27,142,223,124,242, 6, 24, -201,103,102, 22,114,115,178,255,255,255, 79, 78,148,159,143,157, 77,150,159, 3,174, 76, 78,152,247,112, 93,144,119,247, 22, 55, -109,169,238, 48, 19, 96,115, 0, 84,131,130, 27,200, 92, 92,255,166,196,219,157,184,183,238,201, 59, 80, 20,236,188,242,244,205, -199, 47,146,172,172,204, 96, 64, 70,186, 44, 89,114,104,203,185,251,136,226,254, 63,180,112,191,255,234, 35, 92, 60,200, 72,182, -192, 85,139,157,157, 29,216,241, 4,218,194,195,195, 80,233,111,242,236,227,143, 85,167,238, 1,101,231, 28,188, 81,234, 5, 29, -136, 31, 45,223,135, 31,104,168,240,155, 62,239,192,203, 87,159,128, 45, 98,204, 38, 57,164,105, 31,232, 99,120,236,228, 93, 96, - 33, 14, 26,235,187,255, 26,216, 52,118,115,212,178, 50, 87, 6,106, 89,191,249, 60,144,251,229,235, 15,252, 26,149, 21, 68,129, -138, 25,161, 54,250,162, 41, 6,214, 46,174,142, 90,192,230,252,209, 83,119,131,124, 12, 33,226,192,166, 61, 68, 4,200, 5, 22, -217, 64,110,102,146, 61,208,174, 93,251,175, 1,185,112, 19, 22,175, 60, 1,233, 19, 0,107, 23,160, 94,160,212,139, 87, 31,129, -165, 60, 15, 23,123,108,132, 37, 80,252,226,149, 39,187,247, 95, 3,106,132, 84, 39, 64,147,129,238,129,248, 2,232, 60, 98, 26, -248,207,159, 63,255,251,247,175,162,162, 34, 48,253,191,123,247,121,203,230,205, 22,150,182, 92,156, 60, 62, 46,122,198,186,114, -194, 66, 60,156,236,108,192, 60,138,200,224,114, 50, 1, 30, 44,187, 15,177,158, 61,127,233,223,191,191,156,156,188, 28,220,220, -188, 2,194,156, 92, 60,204,204, 44, 64, 67,190,125,122, 46,196,139,175, 12, 7, 8, 32,210,202,247,183, 71, 23, 49,156,155,197, -252,255,247,127,120,201,206, 8, 45,201,254,233,196,112,203,104, 66,148,205,219,124, 36,119,217,209, 63,255, 81,230, 82,239,189, -249, 18, 48,113,107,223,235, 15, 57,254,182, 44, 92,252, 76,214,229,127,182,231, 35,183,123,127,156, 91,204,143, 92,190,195,116, - 55,175, 60,184,229,234,211,111,127,144,202,205,255, 12,245, 27, 78,133,153, 40,205,206, 13,224,225,230,100,192, 54, 38,178,225, -224,185,180, 57,187,223,124,255, 3, 23,249,240,231,207,139, 7,111, 79, 60,120,219,189,229,108,178,163,118,103,130, 59, 23, 39, -199,149, 91,143,138,151,236,131, 40,200,182,215,156,184,227,252,193, 7,239,224, 21,215,161, 59, 47, 39,237,185, 20,107,174, 50, - 51, 55, 0, 50,205,251,237,251,143,210,153,155,231,159,184,251,231, 63, 74, 83,189,112,233,225, 72, 3, 89, 72,117,196,136,228, -156, 61,167,174,166,204,218,249,252, 11,210, 16,211,159,127,175,159,125, 60,255,236,252,148, 93,231,107,253, 76, 43, 34,157,129, - 98,215,110, 63,154,180,227, 60, 68,222, 68,134,175,120,245,201,239,127, 65, 70,136,177,130,134, 50,148,229, 65,211, 15, 42, 10, -210,152, 99,112, 6, 10, 98,155,138, 60, 37,249,216, 57, 57,217,129, 37, 59,164, 96,133, 53,177,255,120,235,203,207,220,127, 13, -194,189,244,232,141,168, 0, 47, 43, 43, 43, 25,133,251,194,131, 87,167,238,186,132, 85,118,211, 89,196,113,114,121,206,154, 64, - 7,112,112,112,192,157, 1, 76,205, 21,126,198,144,242, 29,216,156,223,114,254, 65,144,185,218,232, 16,205,240,108,200, 63,120, -253,245, 43,168,224,134, 20,193,240, 66,115,221,230,115,144,193, 19, 96, 51, 25, 88,250, 3, 75, 67,228,246, 50,144, 61, 67, 49, -166,161,125, 19, 80, 28, 88,142,127,249,250,147, 24,141,174, 14, 90,144, 2, 23,194, 5,202, 46, 94,121, 60, 54,220, 18, 88,224, - 2,219,218, 5,153, 46,139, 87, 28,135,148,239,192, 66, 31,210, 27, 0,137,248, 26, 1,171, 19, 96, 37, 4,113,225,221,251,175, -130,124,140,128, 12,136,177,144,202, 6,200, 0, 42, 0,150,233,112, 23, 2,221, 48,189, 99,147,181,153, 50,208,100, 96, 65, 15, -148, 2,218, 5, 49, 25, 88, 1,196,133, 91, 94,188,250, 4,168,101, 70, 95, 12,254,240,249,241,227,199,151, 47, 95,128, 45,119, - 96,201,241,225,227,247,189,123,246,106,104,104, 9,139,138, 3,115, 3, 7, 59,171,162,156, 40,214,172,247,239,239, 95, 29, 85, - 33, 6, 70,147, 55, 31,190,113,114,112,178,179, 51,179,179,177,240,114,177, 11, 10,112,241,242,112,178,177,168, 61,125,250,148, -143,143, 23, 87,163, 13, 32,128,136, 45,223,255,124,255,252,102,107, 51,235,179, 3,200, 99, 16,240,214,234, 95,102, 94, 94,195, - 16,136,202,107,119, 30, 23, 44, 63,250,251,223,127,140,129, 11, 16, 40, 91,126,196,217, 80, 77, 83, 78,156, 79,205,234,205, 9, -117,198,247, 55,225, 6,177,252,124,253,245,209,101,110, 57, 93, 84, 61,255, 87, 93,124,140,106, 6, 20,172, 58,115,239, 85,219, -242,189,173, 73,152,174,221,114,248, 66,228,212,237, 63, 65,110, 96,100,103, 98,140,183, 86, 51, 82,149,254,246,227,215,154, 99, - 55,142, 61,120, 3, 20,159,182,247,202,155, 79,223,151,151, 71,124,250,246,115,207,181,167, 16,255,156,186,253,252,211,159,127, -140, 12,140, 98,236,192, 70, 38,227,115,104,221,240,127,241,201,219,156,140,235,166, 21,133, 3, 57,153, 19,214, 46, 59, 15, 63, -116,225, 63,114, 51,116,249, 5,136, 56, 35,220,153,199, 47,221, 9,155,180,245,235,239,127,224, 81,105,230, 76, 7, 29, 69, 25, -145,175,223,126,110, 63,123,103,207,205,231,127,192,181,148, 0, 47, 87,134,143,229,235,119, 31,230, 31,185, 6,209,184,140,137, -241,199,223,127, 88,189,140, 89,190, 3,227,213, 88, 89, 18, 88,140, 66,216,144,214, 49, 92, 86,128,135, 3,121,122, 0, 14,136, -111, 62, 67, 22,204,164,207,217,135, 75,246, 8,108,128, 72, 90,144, 75, 78,132,151, 13, 12,128,181, 8,196, 25, 64, 82, 69, 82, - 72, 86,152,231,241,219, 47,160, 0,185,253,194,207, 88, 9,232, 90,200, 32,210,104,153, 56,156, 0,176, 0,133, 23,244, 72,205, -234,171, 64,210,218, 92, 5, 52,226,177,249,220,209,147,119, 32,131, 42,153, 73, 14,192,102,123, 73,237,106, 96,209, 12,108, 89, - 3,203, 86,160,154,146, 92, 55, 96,123, 25, 98, 14, 46,141,192, 18, 22, 88, 58,127,248,248,109,247,129,107,235,183,156,135, 91, -228,230,164, 13, 25,162, 57,118,242,206,213,235,207,176,186, 48, 54,220, 2,100,242,126, 80,187, 27,168, 12, 88, 31, 0,221,192, -205,205, 14, 52, 31, 50,200,115,233,234, 19, 72, 19, 30,168, 0, 84, 43, 92, 97, 0, 86, 18,144, 90, 4,232, 72, 96,245, 3,169, - 51, 94,190,254, 4,233, 88, 0, 45,133,152, 0,113, 45,126,112,251,246,109, 89, 89, 89, 72, 69,178,103,239, 30,126,126,126, 57, - 5,101,118, 86,102, 46, 46,156, 77,174, 47,159, 63,127,253,250, 85, 94, 94, 86, 67,147,247,193,227,183,192, 86,211,207, 95,127, -190,127,251,253,233,235,143, 79,159,127,188,125,247, 21,216, 8, 20,230,251,251,236,217, 51, 25, 25, 25,172, 25, 10, 32,128,136, - 42,223,191, 62,190,250,121, 71, 45,203,183, 39,240,102, 59,122,225, 45,166,195,193, 39, 8, 97, 47,216,119, 1, 81, 60,161, 15, -180, 48, 0, 91,254, 51,183,159,158,144,238, 3, 50, 71,222,238,255,187, 27, 40, 85,220,211,139,176,242,253, 63,242,102,168, 24, - 51,165, 66, 31,115, 5, 41,225,223,127,254,158,190,253,172,124,201,129,171, 47, 63,128,198, 82,110, 62, 91,115,232, 66,136,157, - 1, 82, 89,248,255,231,207, 95,213, 75, 15,252,132, 86, 48,255,235,253,140, 43, 98, 60, 32,230,231,248, 89, 59, 87,205, 59,124, -239, 21,208, 11,171, 78,223, 73, 63,123,131, 13, 82,239,129,213,126,250,253,207, 65, 73,164, 38,204,206,214, 64, 21,216,198,220, -118,236,138, 95,255, 38,136,236,146, 83,247,250,126,252, 60,113,245,254,178,243, 15,161,243, 72, 2, 92,221, 49,246,198,106,210, -188,220, 92, 79, 94,189,159,186,227,236,172,131,215, 81,154,238, 12, 12,213, 75,246,126,249, 13,154,248,102,101,100, 92, 91,224, -103,103, 8, 61, 91, 45,199,223, 38,162, 99,197,186,243,160, 97,141,170, 21,135,162, 29,244, 25,144, 22,149,255,248,251, 63, 88, - 95,182, 60,208, 90, 78, 82, 8,127, 33, 8, 31, 79,135, 47,127, 68, 83, 15, 41, 85,225,229, 47,164,112, 39, 41,211,222,127, 5, -154, 59,133,176, 53, 37,249,225,211,182,240,242,253,195, 55,104,131, 75, 70,128,139, 25, 6,224,117, 12,144, 1,228,202,193,202, -247,171,207, 62, 0, 11,119, 82,235,152, 81, 48, 36,192,250, 37, 89,187,246, 93, 3,182,100,129, 5, 52,100, 64, 3, 82,150, 65, -134,203,129, 36,124,184, 28,210, 40,230,225,102,151, 16,227, 7,150,239, 16, 17, 37, 69,148, 6, 44, 46,141,192,194, 93, 95, 71, - 6, 82,230,194,199,103, 26, 58, 54,115,195,230, 24,121,184, 57,136, 26,118,255,250, 19,121, 74,246,216,201,187,221,147,119, 2, - 27,248,129, 62,134,144,230, 57,150,105, 48,152,201,220,220,236,164, 6, 14, 36,217,115,113,113,253,248,249,231,204,153,179,191, -127,124, 55,178,119, 2,230, 90, 62, 62, 14, 60, 90, 94,189,126,253,235,247,111, 97, 97,225,119, 31,190, 61,120,242,246,227,167, -239,127,254,252, 67,148, 48,224,130,248, 31, 3,247,159,219,247, 69, 68, 68, 56, 57, 57, 49, 13, 1, 8, 32,194,229,251,155, 83, -235,254,158,232,103,254,247, 3,169,112, 71,202,153, 96, 38,139, 0, 98, 40,252,244,189, 23,200,187,157, 48,139,147,211,183,161, -237, 95, 86, 65,201, 95,168, 42,152, 62,191,196,104,241, 51,184,169, 75,204, 45, 10,101,129, 45,181,244, 18, 17,210,146, 23, 87, -207,159, 9,110, 22, 51,172, 58,122, 29, 84,190,255, 71,140,123, 95,189,251,228,242,107, 68,185,166, 34, 33,188,251, 20,162, 22, -209,148, 20, 4,150,239, 16,181,235, 78,221,138,176,212,132,219,228,168, 34,177,165, 33,134,131, 3, 26,226, 94, 86, 58,102,107, - 14,157,122,252, 30, 52, 44,243,247, 63, 48,184, 87, 31,191,254, 31,230,249,133,121,190,230, 58,208, 21,238,154,188, 60, 83,178, -101,223,126,249,177,230,236, 61,120,208,220,121,248,244,200, 3,232,108,164,180, 0,199,207, 63, 12,187, 79,223,132, 59, 67, 70, -136, 7,226,243, 47,191,254,110, 63,115, 75,156, 19, 62, 94,241, 63, 88, 79,110,113,121, 36, 11, 11, 81, 85, 47,254,185,202, 35, - 55,159, 35, 26,215,194, 60,164,238, 51, 66, 94, 48, 3, 44,220, 23,167, 88,155, 52,111,195,172,185, 49,235, 27,116, 23,194, 18, -204,147,247,223,128,193, 8,153,152, 29, 45, 16,135, 25, 0,150,185,144,150, 59,242,114, 14, 96,155, 23, 88, 70, 67,134,197,129, - 69, 57,176,129, 12, 31,129, 65,148,155,224,193, 16, 96, 19, 24, 88,118,195, 7,196,137,209,136, 92, 91, 0, 53, 2, 27,215,224, -181, 46,175,228,100,132,224, 53, 4,242,128, 62,154, 22,160,107,129, 85, 5,100, 76,233,197,235, 79, 64, 27,129, 13,124,100, 91, -144,245, 2, 29, 9, 52, 25, 40, 11,116, 18,100, 16, 31, 94, 51, 17, 3,126,252,248,241,230,205,155,237,219,119, 8,139, 72,190, -121,245, 74,223,192, 24,152, 79,248,120,241, 21,238, 79, 30, 63, 6,146, 26, 26, 26, 95,191,253, 58,124,242, 22,176,193,142,200, - 52,192, 28,197, 8,109, 52,255,254,245,235,238,203,247,198, 70,191,177,150,239, 0, 1,132,175, 16,249,253,243,199,139,173, 93, - 28,143, 54, 51,161,103,103,216, 40, 51, 60,123, 35,229,104, 14,118, 86,164,145, 27, 44,128, 29,118, 41,235,223, 63,127,208,178, - 57,211,223,175,152, 99, 0, 33,150, 26,104,133,157,130,148,168,145,172,208,201,135,160,129,242,235, 15,208, 87,254,159,190,255, - 2,153, 27, 54,125, 39,142,162,145,225,202,227, 87, 12,150,154, 8,149,150,234,240,194, 29, 2, 4,249,121, 24,192,229, 59, 52, - 5, 63,120, 1,174,143, 24, 85, 5,216,225,133, 59, 28, 68,217,106, 3,203,119,248,224,213,211,183, 8,191, 60,120,255,221,187, -123, 45,174,112,190,247,236,181,184,146, 56, 60,104, 35, 28,244,137, 44,220, 9,228,183,135,175, 31,189,133, 94,158,229,170, 41, - 9,105, 74, 19, 95,184, 35, 47,152,225,227,100,237, 10, 53, 17,230,197,183,186,233,201,135,111,184,164, 62,126,135, 78, 63, 60, -125,255, 13, 62, 70, 52, 90, 32, 14, 51, 0, 95, 69, 3, 25, 7,135,176, 51,147, 29,186, 39,237, 60,122,242, 14, 16, 65,138,126, -101, 69, 49,140,118, 49, 59,164, 52, 71, 94,135, 67,140, 70, 56, 0,150,236,245, 29,155, 50,138,150,124, 5, 13,226,139,133, 5, -154,236, 63,124,163,164,118, 53,104,236, 1, 71,173, 16,228, 99, 4,236,106, 0, 75,106, 96,169, 13,238, 34,200,172,223,124, 14, - 50, 94, 4,239, 40, 0, 59, 34,192,158, 1,100,248,222,205, 73,235,216,169,187,153, 69, 75, 32,141,247,204, 36,251,233,243, 14, - 18, 31, 56,175, 95,191, 22, 19, 19, 99,102,102, 83, 82, 82,253,249,243,199,215,175,159,248,248, 20,129, 29, 93, 92,195,158,111, -223,190,101,102, 97, 17,229,227, 7,230,217,107,183,158, 2, 11,119,112, 83, 9, 60,223,249, 15,178,156, 4,218,120,250,246,237, - 51, 80,246,225,211, 79,130, 2, 88, 86,136, 2, 4, 16,206,114,228,199,135,215,239,183,212,176,189, 62,251, 15, 92, 91, 32,236, -102, 98,255, 39,105,206,252,244, 16,114,193,254,255,251, 59,184, 2, 11, 21,169, 61,144,241,175,255, 88,134,144,129, 28, 7, 45, -104,111,235,239,183, 79,255, 81,135,111,254, 51, 48, 97,182, 12,181,101,177, 44, 50,225,231, 1,150, 53,160,162,231,215,159,191, - 48,197, 80,245,159,191,126, 39,106, 9,250,127, 96,220,127,135,116, 49, 32,190,208,149,151, 64,175, 2,152, 64,251,191,224,103, -170,253,248, 5, 29,145, 23,192, 86,241, 42,139,242, 51,192,215,240,252,255,127,239,237,199,255,255,255,163,173,150,100,196,114, - 42, 15,195,183,159,191,145,122, 58,255, 85,196,248, 41,207,108, 64,171,167,236,188, 8,231, 38,216,168, 64, 22,191, 19, 57,177, - 9,212,158, 58,107, 15,124, 97,204,210, 84, 91, 61, 57, 97,172,115,179,214,234,146, 71,110, 61,135,148,221,192,234, 68,131,139, - 11,173,236,254,240,245,199,229,199,111,145,171,141,209,194,125, 56, 1, 96,209,220, 80,225,135,204, 5,150,197,192, 82, 18, 88, - 62, 66,150,165,207,232,139, 1,182,148,191,124,249, 9, 41, 70,129,236,192, 47,134,202,224,209,152,216, 8, 11, 8,219,202, 92, - 25, 50,228, 2,212,242,226,213, 39,130, 26,209, 44,133, 40, 6,154,192,195,195, 14,180, 23, 40, 50, 29,168,247,254,107,160, 57, -192,154, 6,216,244, 6, 22,202,112,245, 64, 75,129, 34, 64, 45,202, 74,162, 64,195, 33, 85, 11, 80, 87, 79,115, 40,196,106,136, - 22,136,153, 64, 17,160, 2,136,153,160,181,146, 96,247, 64,150,202, 64,204,193,116, 12, 38,248,254,253,251,159, 63,127,128, 45, -241,159, 63,255,255,254,253, 91, 86, 70,230,253,187,215,192,182, 22, 46,245,159, 63,129, 0, 48,183, 10, 10, 10, 60, 3,173, 71, -122,133,104,174, 3, 75, 20, 38,164, 65,239,255,255,158, 63,125, 32, 35,171,242,230, 45,246,107, 80, 1, 2, 8,123,249,254,241, -246,201, 47, 59,235,153,127,189,249, 15, 29,144,129,102,200,191,108,130, 60,158,237,204, 76,140, 95,159, 30, 68, 46,131,127, 61, - 60,129,168,120, 61, 77,167,238,190,240,254,251,111,172,253,120, 1, 14,150,100, 55,232,129, 51,191, 31,159,102, 70,205,235,127, -153,185, 49,138,247,255,143,223,127,177,192,112,225,171,119,208,129, 96, 78, 54, 52, 47,252, 23,224, 67,220, 18, 37,207,195, 86, - 21,110,135, 43, 28,133,161, 29, 73,232, 82, 24,110, 14, 22, 28, 21, 1,116,149, 16, 23,176,107, 2,118,239,171, 79, 88, 58,125, -159, 80,123,130,178, 66,252,112, 95,152, 43,137, 39, 56,232,224,114,134,142,172,232,207, 47, 95,225, 5, 60, 55, 39, 27,229,185, -238,194,131, 87, 75,143, 66,135,131,130,140,228, 20, 68,249, 32,115,158,196,180,223, 33, 11,102,150, 28,129, 14,106,117,134, 24, -235,201,137,128,143,175, 99,193, 28, 29,242, 49, 84,232, 4, 79, 79, 1, 65,211,198, 11,139, 50,156,129,157, 74,228,115, 11, 38, - 35, 85, 51,163, 96,248, 1, 96,105,142,185, 52, 80, 28,117,195, 17,164,124,196,207,134, 27, 66,140, 70,172,150, 34,139,192, 21, -136, 99,200,194,205,129, 51,160, 42, 97,110, 22,199,240, 5,166, 94,100, 54, 86,199,160,140,115,190,127, 47, 36, 36,196,204,204, -242,231,239,143, 79, 95,126,126, 2,118, 98, 25, 89,190,126,253,202,195,195,131,150,239,128,213,192,215,175, 95, 62,188, 7, 77, - 46, 42, 40, 40,124,254,242,243,224,177,155,127,129, 77,162,127,240, 28, 7,106,191, 67, 51, 49, 35,195,199,247,239,132,132,196, - 57, 56, 57,180,213,165,176, 90, 13, 16, 64, 88, 74,180, 87,135, 23,253, 57, 61,141, 9,180, 8,146,145, 17,105, 44,230, 47,191, -170,128,127, 47,183,136,212,231,151, 15,209,199, 85,126,189,255,116,105, 27,159,158, 23,144, 45, 38, 34,184,182, 40, 48,160,123, -237, 39,112,107, 23, 89, 37, 15, 27,243,226, 12, 15,105,113,208,105,103, 31,159,220,100,124,126, 10,237, 88,178,255, 60, 98,152, -237,247, 89, 59, 79,135, 58, 24, 32, 91,183,255,204,181, 11,207, 63, 65,218,201, 38, 42, 82,240,186, 12, 58,140,174, 33, 3,103, -191,252,250,203,215, 84, 93, 66, 84, 8, 89,175,190,138,140, 16,172, 47,115,236,194,109, 44,189, 12,228,233, 3, 72,147, 28, 28, -162,182, 26,114,199,238,131,246,100, 62,252,240,125,243,145,139,190, 54,250,200,106, 39,111, 61, 9,107,236,131,128,129,130, 24, - 59, 19, 3,100,154,247,237,199, 47, 41,158, 40,149,212,241, 75,183,101,197,132,100, 36,160, 7,191, 29, 60,113, 9,201, 9,148, - 54,111,129,109,228,180,217,123, 32,108, 62, 14,214, 60, 23, 77,200,186,120, 98,198,103,128, 94, 56,112,237, 49,124,193, 76,181, -143,110,184,185, 18, 59, 24, 96,234, 5,138,232,203,139,234,200, 8, 93,121, 2,234,192,237,186,250, 44,119,209,145,246, 8, 75, - 49, 1,232,130,173,201, 59, 47,180,111, 60, 3, 87, 15,116,204,104,129, 56, 10, 70, 26,120,249,242,165,190,190,254,171, 55, 95, -158, 62,127, 15,204, 66,204,204,108,175, 63,126,253,248,241, 35, 48,143,252,255,247,239,215,239,223, 31, 63,126,248,252,249, 51, - 48,223,127,255,241, 3,152, 79, 37, 36, 36,126,124,252,248,237,219,247,139,160,147, 9,254,193,198, 18, 16, 99, 50,224,113, 0, -208,208,194,143, 31, 95, 36,164, 20,197,132,121,132,133,184,177, 90, 13, 16, 64,232,189,245,151,135, 22,252, 57, 57,145,225, 31, -100,133, 59,164,120, 3,141,150,254,149,115, 19,139,158, 3, 44,220,129,162,188,226,242,191, 56,164,254,195,198, 68, 32,232,235, -145, 73,127,190, 66,219,212,182, 6,170,167, 58, 18, 61,181,100,224,181, 7, 59, 19,163,151,182,212,177,166, 24, 79,107, 80,153, -248,231,247,175,175,251,251, 24,254,255,133, 89, 0, 41,158,255,115,202, 24, 98,182,157,247,222,122,145,216,179,242,210,205,135, -111,222,190,127,240,248,249,170,221,167,226, 39,109, 2,251, 21,228,198, 72, 91,109,244, 14,163,130,180, 55,172, 58,253,241,239, -127, 80,199,202,243,183, 64,139, 94, 62,127,254,178,124,215, 73,191,238,117,170,217, 83,235, 23,238,120,242,226, 45,162, 98,248, -255,159, 64,169, 10, 14,218,104,103,163,255, 48,197, 9,211,183,205,221,118,226,201,179,151,175,223,188,187,118,251, 81,214,164, -181, 43,193, 75,107, 96, 6,253, 23, 17, 22,136,180, 80,131, 24,124,231,205,151,212, 9,107,222,125, 0, 13,237,125,255,241,115, -237,190, 51,190,157,107,244,139,102,181, 47,219, 3,228,194, 45,248,255,159,129,242,161, 11,160, 11, 39,237, 56, 15,223,104, 26, -111,173,172, 40,198,207,198,198, 70,204,170,115,200,106,200,240,137,208, 73,212, 96, 99,185, 20, 59,117, 72,225,206, 10,222, 27, -133,169, 5, 40, 56, 53, 1,209, 67, 90,125,250,190, 81,205, 26,143,142,141,110,109,235,185, 19,166, 85, 44, 63,134,172, 88, 67, -146,111,116,243,234, 40,160, 22, 0,175,136,127,130, 44, 2,228,226,153,134,197, 4,164,170, 39, 15, 72, 74, 73,253,250,253,247, -197,139, 15,144,116, 15,204,134,108,236,188,215,174,223,184,116,233,226,181,235,215, 95,189,122, 5, 44,180, 5, 4, 4, 21, 20, - 21,245,244,244,116,116,116,128, 69,191,136,136,200,250,205,187,158, 60,127,135,220,108,135,150, 44,160, 85,241,160,124,247,224, -238, 53,126, 65, 81, 96, 13,161,173, 38,197,198,138,125,236, 1, 32,128, 80, 68,191,191,123,241,251,244, 12, 70,212,145, 98,208, - 57, 55,166, 89, 98, 86, 49,200,135,133,177,235, 71,254, 61,209,131, 58,200,244,250,213,186, 98,225,192, 62,118, 30, 80,211, 88, - 89, 86,124, 83, 99,194,155,119, 31, 30, 61,127, 11, 44, 24,164,197, 5,132, 4, 5, 16, 29,150,125, 83, 24, 95,157,249,143,122, - 49,200, 31, 14, 9, 14, 73, 21,228,178, 6,194, 96,101,100, 88,120,236, 38, 16, 97,186, 62,220, 72,222,217, 76, 7,101,244, 29, - 76,205,202, 13,180,175,154,127, 27,178,230,250,254,107,163,138,133,138,188,108,239,190,255,249, 4, 90, 93,196,240,245,247,191, -230,141,167, 36,249, 57, 51, 2,236, 49,122, 11, 56,134,103,192, 64, 75, 65,162,208, 85,191,127,247, 69,160,216,135, 31,127,210, -231,238, 70, 87,139, 90,112,245,166,120, 93,126,244,250, 12,120,244,121,254,145,235,203,142,221,144,228,102,125,251,253,207,103, -160, 51,192,214,117,109, 62,229,160,171, 96,169,171,194,192,192,192, 64,165, 81,233,251,175, 62,182,109, 56, 13, 97,107, 74,242, - 23,184,106, 65, 22,164, 19,211,120,255,240,245, 7,176,225, 15, 89, 48, 99,174, 36,218, 29,102, 10,212, 11,223,143,138,235,144, - 35, 35, 37,137, 73,177,214, 53,107, 78,125, 2, 15,202,125,250,254,235,216,237, 23, 88,205,215,146, 20, 24, 61,159, 96, 20, 80, - 11, 96,158, 28, 0,228, 54, 84,248, 17,127, 86, 12,169,234,201, 3, 76,140, 76,175,223,124,254, 7, 89,120,248,159,225,247,239, - 95, 15,239,223,150,150, 18, 51, 52, 52, 70, 62, 28, 23, 88, 0, 0,123,222,191,255,252, 21, 19,151,254,248,225, 29, 23,183,216, -211,151, 47, 4,133,196, 64,197, 57,120, 44,133,145,137, 9, 88,154,255,249,243,235,215,207, 31, 31, 63,189, 19, 16, 18,227,230, -226, 85, 83, 6,205,115,224,178, 26, 32,128, 80,202,247,191,239, 30, 50,252,251,245, 31,105,133,251, 95, 78, 9,110,231,106, 97, - 77,244, 19, 25, 5,205,130, 95, 94, 88,204,244,253, 37,114,177,198,248,234,252,235,249, 65,188, 78,149,252,218,206, 16,113, 17, - 33, 1, 32, 66,214,248,227,211,251, 55, 59,218,153, 31,237,193, 44, 68, 89,212, 60, 89, 88,177, 12, 61, 79, 12,183,108,217,118, -254, 25, 98,200, 27, 90, 14, 38,152, 41, 77,206, 11, 65, 8,254, 71,108,112,149, 20, 21, 60,209,157, 86, 50,119,235,242, 99, 55, -127,128, 71, 72,238,127,250, 9,113, 37, 27, 35,163,171,150, 84, 85,160,149,149,145, 22,102, 9,142,165,108, 71, 93, 10,212,150, -228, 9, 36,167,236,185,248,251, 63,202,106, 37,113, 46,214,106,111,131,188,213,167,145,117,243,241,114,239,106,138,175, 91,178, -123,222,129,171,223,254,252,253,249,247,255,131, 79,136,198,130,189,146, 72, 71,162,187,169,150, 50,102, 71,129,194,145, 25,248, -105, 48,157, 33, 70,144, 13, 71,196, 52,222,129,122,193,167,149,189,133, 84, 12,211, 99,205,129,101, 58,164, 98, 0,181, 24,254, -253, 67, 41,223,193, 34, 64, 0,153,179,141,179,211,178, 82, 17,239,220,114, 30,216,126, 71, 54, 51,200, 8,116, 56,198,186,115, -208, 21,177,102, 74, 34,163,231, 19,140, 2,208,102, 84,240, 73, 3,144,197, 42,144,165,138, 60, 92,236,152,130, 12,224,243, 97, -128,229, 47,176,149,253,242,245, 39,136, 44, 68, 25,114, 27, 28,162, 29,249, 8, 26,200,225, 1, 18,162,124,144,153, 91, 30, 30, -118, 72, 75,223,205, 81,139,135,155, 29,190,148, 19,222, 15,216, 5,222,230, 13,180, 8,104, 50, 80, 22, 50,233, 10,153,230,133, -203,194,151,222,195,101, 95,192, 14, 99, 0, 74, 65, 38,150,177,250,247,205,155, 55, 12,204,252,144, 82,132,137,153,249,225,195, -123,160,205, 63, 74, 26,255,254, 51,126,255,241,251,251,247,223, 64,167,126,251,254,243,231,239,191, 63,190,253,254,245,251, 15, - 80,150,149,233,139,140, 4,251,155,247,140, 31,222,191, 17, 18, 22, 7,230,182,159,192, 50,253,195,155,111, 95,190,112,112,113, -241,240,242,139,139,203, 0,115,167,144, 0,151,158, 6,190,202, 9, 32,128, 80,206, 7,254,249,249,253,235,153,110, 12,255,255, - 66,138,236, 63,130, 58,162,161, 19,184,248,133,176,234,124,125,112,214,239,211, 51,177,155,170, 21, 41,230,154,207,130,177,220, -226,243,227, 27, 31, 54,149, 48,127,199,178,187,236, 63, 35, 43,127,252, 6, 30, 17, 73, 88, 10,120,123,233, 22,180, 80, 48, 1, -175, 68,108, 89,178,107,231,185,187,215, 62,252, 16,101,103, 54,144, 17,204,243, 54,247,118, 64, 92, 12,114,236,204,149,175,224, - 69,120,146, 98, 66, 58,234, 10,112,241,143,159, 62,175,218,127, 97,243,201,107,111, 62,126,101,103,101, 81,147, 22,206,244, 50, - 55,208, 70,244, 18,222,127,248,116,230,202, 29,152, 69, 42,104,107,140, 46,221,184,255,242,205, 7, 8,219,193, 92, 7,190,128, -228,212,149,187,141, 75,119, 95,120,244,238,203,239,127,178, 60,108,182, 90,210, 13,241, 30,252,188, 60,135,207, 64, 15, 3, 80, - 83,144,146,151, 65, 44,251,121,250,252,213,188, 61,231,143, 94,190,243,225,243, 79,110, 78, 22, 85, 41,145,120, 39, 3, 75, 68, - 5,195,240,250,237,251, 11,215, 31, 64, 42, 18, 75, 67, 13, 30,110,114,206, 89, 3, 70,229,196,237,231,202,151, 29,133,112,115, -157, 53,138, 61,116, 57,193, 0,190,161, 20,143,222,148,153,187,225,115,170,144,115, 40,129,237, 14, 70, 80, 81,204, 4, 61,136, -226,255,255,163,183, 94,192, 21, 8,112,179,235,203,137,118, 69,219, 64,198,109,254,128,218, 21,160, 67, 37, 15,223,124,246, 15, - 60,104,104,161, 44, 10,108,209,219,118,108,131,180,235,165, 5,184, 14, 87,122,114,115,115,115,113,113, 1,187, 80,135,111, 60, -189,244, 16, 52,153, 33, 39,194,231,103,162, 36,192,197, 62, 90,240,141, 16, 0, 44,124, 23,175, 60,190,120,102,114,207,228, 93, - 64,110, 73,174, 91,108,250,220,216,112, 75,172,130,211,231, 29,232,105, 9, 5,150,170,235, 55,159,131,200,114,115,179,103, 38, -217, 67, 74,118,200, 41, 99,192,178,117,221,230,115,153, 73, 14, 64,197,192,246,248,250, 45,231,191,124,253, 1, 20,223,181,239, - 42,196, 4, 96,201, 27,232,107, 4, 52,193,202, 92,197, 10,124,210,128,155,147, 54,216, 37, 87, 75,115,221,129, 10,128,138, 33, -219, 80,103,244,197,100, 20, 45,129, 44,199,132,156, 51, 3, 89,103, 9, 84, 0,180, 2,168,184,123,242, 78,136,172,156,140,208, -230, 29, 23,225,230,224,233, 7,156, 60,121,138,131, 71,252,255, 63,102, 96, 38, 2,150,223,103, 78, 31,211, 55, 48, 17, 23, 23, -254,250,245,199,179,151,159,254, 35, 95,117, 7,107, 89,243,240,114, 11,243,253,126,250,236,229,249,203,143, 88, 88,216,127,253, - 2, 54, 83,255,243, 11, 8,241,242, 9, 49, 51, 49, 3,219, 85,192, 12,205,193,198,106,102,168, 32, 37, 33,128, 39,168, 1, 2, - 8,165,253,206,206, 43,200,233, 88,245,249,240, 52,166,191, 63, 25,229, 44,197, 61, 42, 57,120,113,106, 22, 48, 9,123,113, 97, - 25,211,175, 79,152,227, 18, 12,215,150, 61,191,187,155, 85,209,134, 77, 82,155,131, 87,240,231,215, 79,191,222, 61,253,253,236, - 34,195,171,139, 76,224,254, 1,150,242, 69,217, 3, 94,184,131,107,111, 97, 87, 49,148, 75,167,122,115, 66,122,113,123,195,202, - 4,251,234, 20,126, 62,222, 84,127, 91, 32,194,165, 17, 88,160,187,218, 24,225,146,213,211, 80,196, 42,110,166,163,188,181, 29, -203,245, 29,174, 54,134, 88,213, 75, 75,138,213,198,186, 51, 48,184,227,178, 72, 84, 88,208,213, 70,144,138, 35, 51,210,130, 92, - 73, 54,170,196, 55,222,129,101, 55,188,112, 7, 2,180,125,170,152, 0,174, 0, 88,166,179,179,179, 67, 90,250, 64, 91,128,164, -139,158, 34,124, 17,228,212,253,231, 63,193, 86, 82, 5, 25,129,206,139,135, 56,102,243,217,187,169,179, 16,163, 91,165, 75,216, -103,167,187,248, 25, 43,143,150,125, 35, 1, 0,203,193,233,243,126, 2, 91,226, 23,175, 60, 6,182,142, 33,187,138,112, 9,130, - 26,242,247, 94, 67,142,241, 58,118, 18,116,228,139,155, 35,202,148, 27,100, 23, 43, 72, 22,124,102, 0,228, 60, 25, 96, 89, 15, -217,130, 4, 17, 44,201,117,135, 20,190,151,192,103,132, 1, 11,101, 72, 13, 1, 44,151, 95,188, 6,149, 96,174,142,144, 3,109, - 30, 67,142, 33,131, 28,159, 0, 49, 13,216, 84, 7, 22,250,144,134,252, 49, 36, 89, 96, 77,131,108, 14, 30,255,138,138,138, 92, -188,114, 75, 72, 88,130,139,147,231,194,133, 83,162,226, 18,130,130,252,192,236,242,242,205,103,196, 18,106, 70,164,189, 68,255, - 25,190,124,254,250,255, 31, 43, 47, 23,187,187,179,249,133,235,207,129,237, 95, 38, 38, 22,200,250,119, 1,126, 14, 73, 49,126, -113, 81, 62,208,237,104,132, 22, 44, 0, 4, 16,250,168,188,176,113, 32, 16, 17, 19, 73,172,220,192,162,177,254,243,214, 98,228, -193,107,120, 57,207,244,227,245,223,235,235,191, 3, 17,246,161,105,148, 65,143,191,220,178,146, 30,165,163,233, 30, 94,212,146, - 49,124,129, 62, 50, 19,108, 36,204,199,133,124, 20, 12, 65, 75,201,115, 42,100, 63, 42,164,212,134,108,161,130,239, 96,186,240, -224, 85,207,118,232,169,100,124, 28,172, 73,182,106,240,227, 45,237, 53,165,107,131,204,237, 52, 65, 39,166, 77,222,113,113,211, -217,187, 37, 75, 14,143,150,239, 35, 4, 64,214, 29,238,218,127, 13,114,240,192,186, 45,231, 33, 34, 88, 5,129,220,151,175, 65, -133,126,108, 4,232, 36, 47,208, 81,236,185, 50, 88,205,132, 12,236, 64,134,110, 32, 5, 49, 3,120,113, 58,218,241,191,192, 98, - 26,237, 44, 4, 32,128, 28,101, 35, 33,198, 15, 89,210, 14, 63,129, 0,178,250, 30,186,110, 18,188, 75, 22, 46,139,213, 28,172, - 64, 86, 86,246,215, 95,142,107, 87,111,188,250,247,252,231,207, 31, 10,242, 74,162,194, 60, 87,111, 62, 7, 31, 54,128,122,224, -236,127,232, 58, 25, 38, 38,198,103,207, 94, 8,242,115,152,154, 42,254,250,195,114,247,193, 43, 46,110, 54, 89, 73, 33, 89, 41, - 65, 33, 1,110, 38, 38, 98,203, 7,128, 0,162,104,159, 36,191,150,227,143,183, 5,191,143, 79,192, 82,102,227, 40,202, 49,193, - 95, 14, 49,225,160,137,172,156, 60,163,233,254,204,189,151,247, 94,126, 8, 49, 87,101, 32,241,102,106,200,154, 25,248, 89,240, - 9, 86,202,214,106, 18,240,121, 81, 34,141,250, 56, 39,237,199,143, 31,192,246, 56,124,156, 29, 77, 35,176, 28, 87, 44, 91, 3, - 97, 47, 76,180, 4, 90, 1, 52, 31,121, 48, 29,114, 18, 14,196, 61,239,191,124,143,158,134,104,161,231, 56,171, 11,241,114,194, -167,121,229, 69,249,106,130,204, 63,124,251,121,233,225,235, 92, 15,125, 96,249,254,240,245, 39, 32, 2,138,143, 38,131,145,209, -132,151,133,140,168, 48,128,142,138, 60,110, 5, 62, 71, 12,171, 32,176,188,158, 62,239, 0,176,165,108,109, 6, 58,143, 12, 82, -232, 67, 6,220, 81,134, 82,193,103, 6, 64, 6,247,129, 36,252,192, 94, 96,147, 31,179, 38,128, 31,102,192, 0, 59, 29,161, 36, -215,141,135,155, 29,249,218, 16,200, 64,191, 4,244, 0,203, 39, 64,211,224, 86, 64, 0,228,160, 2,184, 57,248,154,194,172,172, - 98, 34,252,127, 53,181,128, 5,186,128,160,200,239, 95, 95,159,191, 98,251,246,253, 23,142,188, 12,218, 86,249,250,245,139,159, - 63,191, 11, 8,136, 92,187,245, 66, 79, 75, 90, 77, 73,140,155, 11,216, 17, 39,249,100,111,128, 0,162,116, 31,188,184,109,220, - 59, 46,190, 47,251,218, 24,255,255, 38, 67,251, 95, 81, 19, 17,207, 42, 30, 9,197, 97,214, 0,199, 47, 8, 44,224, 48,213, 0, - 69,238, 60,127,127,239,213, 71,200,254, 32,200, 34, 19,136, 50, 72, 1,138,118,171, 53,114,225,139, 54, 50,147, 15, 94, 51,131, -171,112, 71, 62, 33, 0,126, 34, 13,208, 70, 96,203,154, 3,216,223, 99,101, 5,150,227,184,186, 8,112, 54, 19, 51, 19,252, 40, - 96,160, 70,204,139,182, 83,103,239,125,244, 6,186,167, 78, 83,146, 47,217, 86, 13,222,153, 0, 42,190,248,240, 53,176,193,126, -232, 58,202,226,182,135,111, 70,203,247,145, 2, 32,173,108,200, 24, 8,228,192, 94, 92,130,144, 98, 90, 95, 91, 6, 82,178, 67, - 78, 41, 88,188,226,132, 30,120, 46, 20,200,206, 40, 90,194, 0, 62,135, 32, 51,201,126,215,190,171, 64, 53,192,150, 62,100, 92, -254,238,253, 87,200,103,147, 65,128,155,147, 86, 67,251, 38, 96, 85, 1, 41,151, 33,102,102, 22, 45, 1,146,144, 94, 2, 68,217, -209, 83,119, 33,247,123, 0,171,150,158,201, 59, 33,253,131,216, 8, 11,248, 80,140,171,163, 22, 80, 28,110, 14,126, 32, 36,200, -205,207,199,249,225,227,119, 65,126,174,123,247,110,191,123,250,151,153,153, 21,114, 85, 19,228, 48, 25,208,242, 71, 38,208,170, - 69, 96, 86,252,248,225,237,159, 95,191,100,101,149,255,255,255, 39, 45,201,207,206,198,194,206, 70,102, 65, 13, 16, 64,140, 84, -217, 44,254,229,201,181,247, 59,154,254,191,189, 73, 66, 33,200, 46,200,101, 91, 36,106,236, 51,252, 70, 87,210,103,239,113,210, -150, 13, 49, 87, 89,115,242,206,222,171,143,167, 37, 58,172, 61,117,103,246,190,171,130,220,236, 41,142, 90, 64, 41,175,206, 77, - 10,162,188,247, 95,127,154,154,232,176,238,212,221,189, 87,159, 40,137,241, 1,217,158,157, 27, 13,229, 69,155, 67, 65, 11, 87, -122,182,158,223,119,229,177,162, 24, 95, 75,152,165, 16, 15,135,103,199, 70, 32, 27, 88,250, 7,155,169,164, 58,233, 64, 6, 67, - 32,165, 42,176,216,117,107, 91, 7,111,188, 79,139, 54,243, 54, 84,224,226,226,130,236, 56,197, 44,121, 75,151, 28,158,178,235, - 34, 63, 23, 91, 91,152, 69,172,173, 38,252, 94, 86,200, 34, 25, 60,233,225,207,159, 63,252, 41,179, 32,236,165,169,182, 78,186, -242,156,156,156,104, 77,120, 6,140,169, 90, 62, 14,214, 37,169, 54,134,138,226, 16, 39, 1,189,246,241,251, 47,245,130, 5,192, -198, 59,176, 52,143,179,213, 4, 50, 38,239,184, 0, 84,185,187, 58,200, 78, 83,102,180,236, 27, 9, 0,249,210, 59,200,138, 20, -120,243, 25, 77, 16,153, 13,105,182,195,219,239,220, 64,145,251,175,121,120,216, 33,199, 12, 64, 22,198,192, 15, 72,120,241,234, - 19,228,184, 2,100, 65,248, 18, 29,200,193, 3,160,147, 9, 96, 38, 3, 13,129, 44,152,129,168, 7, 86, 24,240,133, 58, 16, 89, - 52, 43, 32,109,252, 23,224,238, 2,176, 58,233,105, 9, 69, 94,213,131, 7,188,125,255,117,253,166,125,252,252,194,188,252, 2, -136, 49,119,208,176, 59,104,180,243,253,219, 55, 63,127,254,144,146,150,103,102,102,210, 84,149,144,149,166,104, 90, 14, 32,128, - 24,169,117, 24,200,159,223,191,223,238,155,246,243,210, 82,134,127,132, 27,242,127, 37,172,197,124,235,184,133,196,134, 95,194, - 5,134,231,204,221, 23,187, 54,159,189,210, 25,169, 83,190,188,200,203, 64, 81,148, 47,102,218,238,137,177, 54, 15, 94,127,234, -223,113,233, 82,123,152, 92,254,226, 4, 59,141, 36, 59,141, 15,223, 64,151,163,110, 42, 2,237,251,117,210,150,201, 91,116,248, -254,171, 79,155,138,189, 38,236,184, 52,239,224,245, 73,113,182,235, 78,223,125,240,230,243,150, 18, 31,238,164,153,133, 30,250, - 10, 34, 60,249, 75,142, 30,174, 11, 50, 83,145,132,156,196,139,182,102, 70, 67,130,175,198, 71, 15, 62,173, 10, 90,253,130, 52, -241, 1, 44,211,183,156,127,128,188,161,116,125,129,187,147,142, 60,174,189, 75,152,229, 59,119,194, 52, 8,123, 89,186,157,179, - 46,168, 22, 1,234, 69, 43,220, 39,110, 59, 87,190,252, 40, 92,164, 35,216, 48,210, 82, 21, 88, 19, 64, 58, 7,192,202, 0, 88, -154,151, 44, 57, 4, 44,220, 79,181, 70, 66,150,205,176,199, 76, 26, 45,223, 71,193,208, 2,192,130, 30,216,201,144, 16,227, 7, -246, 18,172,204, 85, 32, 19,173, 68, 22, 17,192, 92,125,224,208, 73, 96,131,138, 9,116, 13, 19, 19,184, 16,254,247,251,247,175, -159, 63,126,138,136,136,137,136, 74, 2, 91, 90,154,106, 18,242, 50, 66, 20,174, 36, 6, 8, 32, 22,106,249,150,133,149, 85,220, - 61,255,135,101,220,143,123, 71,191,221, 62,240,227,233,101,230,159, 47, 81,124,197,196,241,151, 71,134, 83,222,140, 75,221,133, - 87, 94,143,153,133,101,184, 70,124,178,163,118,229,202, 99, 61, 91,206,189,255,250, 51,214, 74,101,226,206,203, 64,193,121, 7, - 65, 75, 39,129,109,213, 51,119, 65,193,226,103, 32,167, 39, 43, 4, 44,236, 10, 61,245,129,197,122,130,157,186,189,134,164,188, - 8, 15,100,124, 6,216,234, 7,138,216,169, 75, 0,139,212,192,137, 59,127,255, 6, 85,153,118,234,226,118,234,146,192,242,253, -237,167,111, 64,113,160, 94,200,245,120,240,145, 25, 32,184,241,226, 83,204,156, 35,184, 28,102,173, 42,129, 86,153, 31,186,254, -212, 86, 93,138, 90,107,210,129,238, 41, 94,124, 16,249,166, 39, 96,225, 30,110,174, 12,217, 1, 11, 95,198,243, 17,124,184, 32, -176,100,135, 20,238, 15, 95,127, 26, 45, 44, 70,193,144, 3,192,126, 6,100,170, 0,126,168, 25,177,109,106, 70, 70, 21, 69,209, -159,191,140, 31, 63,123,251, 23,233,170, 12, 38,208, 40, 41,168,197, 6,204, 37,106, 42, 18, 10,178,194,148, 59, 18, 32,128,168, - 92,200,114,240, 9,114, 24,248, 8, 24,128, 70, 93,190,125,250,240,251,243,123,134, 63, 63, 24,152, 89, 25, 88,216,216,249,132, - 57,184,184, 71, 66,196, 3,227,175,216,203,160,118,245,201,186, 0, 99, 96, 97, 13,108, 53, 11,112,177,245, 70, 88,240,114,176, -124,250,254, 91, 65, 20,116, 65, 54,228,196, 32,160,202, 36,123,205, 56,107, 85,195,154, 53,250,178, 66,208, 43,100,255,255, 87, - 16,225, 61,255,224, 13,176, 14, 63,255,240, 13,144, 13,153,240,252, 7,187, 18,235, 63,248,238, 83,160, 44, 48, 57, 32,175,153, - 33,220,109,250,247, 87, 22,245,156, 10, 41,126, 14,106, 29,232, 8, 52, 36,180,127,203,102,164, 59, 90, 33,133, 59,176,217,142, - 92,184,131, 42, 42,240,178,153,139, 15, 95,167,206,218, 45, 47,194,183,232,240,117,136,248,131,215,159,237, 52, 71,203,141, 81, - 48,148,138,120,178,245,170, 43,139, 51, 51, 49, 62,126,241,158,225, 31, 98,136, 6,216,206,226,226, 96,147,147, 22,194,179, 37, -149, 36, 0, 16, 64, 52,108, 68,115,241, 9, 48,240, 9,140,180, 40,135,204, 85,166, 56,234,204, 61,112, 45,209, 78, 3,216, 52, - 78,118,208,122,240,230,179, 73, 3,232, 22,164,250, 64,227, 2,119, 61, 32,131, 25,180,146,144,249,209,187,175,182,205,235, 63, -124,253,233,160, 41,165, 47, 39,114,241, 49,232,184, 9,160,246,166, 16,179,184, 25,123, 5, 51,230, 3, 11,247,249,105,142,144, -150, 53,100,245, 33,216, 10,104, 65,121,224,218, 99,248,176, 59,113,101, 48, 67,173,175,193,213,167, 31,174, 61, 3,109,218, 10, - 50,146, 11, 51, 83, 34,175,217,206, 12, 59, 33, 18, 25, 84,250,155, 0, 59, 4, 31,191,255,210,146,226,135,156, 58, 9,105,185, -163,205,244,218,105,202,228,122, 24, 76,222,113, 97,209, 33, 80,201,174, 47, 47,106,111,167, 9,100, 79,217,121, 33,110,180,128, - 31, 5, 35, 3, 0, 27, 60, 26,170, 18, 64, 68, 83, 91, 0, 2,136,113,244, 48,110,170, 3,200,170,240, 63,127,254,192, 79,202, - 5,138,252,254,253, 27,216, 82, 70,190,225, 8, 50, 42, 2, 57, 20, 20,210, 66,135, 47,155,129,207,118, 66,180, 96, 30,216, 2, -212, 11, 57,173, 23,168,247,231,207,159,191,126,253, 2, 50, 8, 23,202, 96, 0, 52,234,200,205,231, 60,236, 44,218,210, 2,104, -215, 97, 19,104,254,255,253, 11,244,197,247,239,223, 33,254,130,107,132, 47,239, 1,138,159,185,243,236,205,199,175,102,138,194, - 64, 65,248, 93,172, 88,151,241,128, 22, 68,190,249,196,207,197, 14, 44,223,193, 35, 69, 79,128,109,249,209,245, 51,163, 96, 20, - 80, 17, 0, 4,208,104,249, 78, 19, 0, 41,154, 33, 59,149,208,150,166,192, 11,107,172, 82,152,226,200, 37, 62,242, 74,115, 72, -243,249, 47, 12,224, 90,212,136,220,177,128,235,130,219, 8,217, 80, 74,228, 26,121,120,189, 5,169,117, 48, 47, 12,129,184, 4, - 88, 7,128,199, 16,153,224, 10, 70, 79,155, 25, 5,163, 96, 64, 0, 64, 0,141,150,239, 52,108,197,163,113,177, 46, 96,199, 37, -142, 44,133,245,224,117,100, 53, 68, 70, 34,178, 46,228,122,130,248,242, 23, 82,235, 32, 87, 24,104,139,103,224, 10,144,171,147, - 81, 48, 10, 70,193,128, 0,128, 0, 26, 45,223, 71,193, 40, 24, 5,163, 96,120, 2,128, 0, 26,109, 94,141,130, 81, 48, 10, 70, -193,240, 4, 0, 1, 52, 90,190,143,130, 81, 48, 10, 70,193,240, 4, 0, 1, 52, 90,190,143,130, 81, 48, 10, 70,193,240, 4, 0, - 1, 52, 90,190,143,130, 81, 48, 10, 70,193,240, 4, 0, 1, 88,187,186,220,168,129, 24,108,143,103, 9,213, 2,106,133,212,138, - 71,144,122,135, 62,115,128, 94,184, 18, 47, 28,163, 7, 0,196, 3, 85,219,221,109,230,207,248, 39, 19,178, 93, 81, 85,208,149, -118,146,108, 38, 30,219,177,163,149,242,217, 31, 30, 65,220, 65,145,241,197, 36,246,134, 39,214,167, 30, 35, 58,119,224,116,102, -160, 85, 46, 69, 91,213, 51, 58,200, 34, 76, 99, 8,145,172, 66, 55,200,168,184, 58, 36,227, 14, 10,104, 40, 15,230, 98, 28,124, - 92,149,188,180, 25, 63,236,196,123,226,205,121, 20, 6,194, 20,128, 85, 8,160, 8, 32,221,129,128, 17, 8,168, 49, 98, 36,149, -165,136, 61, 50, 78, 62,153,160,179, 64, 54,170, 15, 30,116, 85,110, 85,230,213,211,119,167,155,116,127,183,221,184,101,222, 44, -162, 91, 75,184,111, 53, 67,251,120,246,233,250,219,181, 40, 93,148, 80,177, 52,209, 89, 36,121,209, 41,116,176,139, 28,162, 19, -118,169,129,221, 6,101, 69,143, 49,124, 56,167,187,109,218,140,188, 73,109,151,107,170, 45, 23,181, 87, 76, 36,230,147,245,219, -203,207, 23, 95,174,190,238, 26,140,169,222, 62,236, 30, 98,205,204, 57,226,155,245, 16,197, 94,241, 56,139,102, 20,181, 18,138, -229,218, 82, 43, 23, 22, 51,197,112,241,140, 56, 66,157,107,236, 76, 0,180,205, 41,165, 54,254,252, 37,247,164,100, 3, 91,234, -151,101, 48, 92,102, 51, 58, 94,167,153, 89,190,142,255,179,207, 11,250,219, 71,239,235, 7, 26, 26,151,220,234,211, 97, 35,107, - 28,209,235,204,185,246,153,252,220,120,155,117,128,227,225,248,102,188, 57, 4, 3,253, 27,132, 64,107,208, 32,164,150, 95,209, -234,100,253,254,199,237,247,176, 88,180,175,130,216,205,239, 49,192,139,130, 68,168,207,208, 31,247,108,193, 71,251, 78,252, 32, - 33,252, 52, 71, 48,204,249,176, 47, 30,193,195,154, 15,156,134,243, 98,142,130, 10,150,176,136,222,132, 28, 15,111,208,242,255, -160,101,165, 95,104, 28, 95,115, 46, 3, 91,253, 29,226, 18,239,235, 27,159, 51, 37, 53, 25,122, 86,134,168,165, 28,180,210, 49, -174, 26,131, 28,228,146,139, 2,113,115,146,112, 44,121, 76,185,180, 84,107,209, 98,145,166,233,111, 41, 53,251, 91,212,226,133, -106,254, 99,141, 52,140,117,180,123,227, 73,215,244, 25,224,209, 60,185,171,245, 60, 70, 61,235, 79, 41,110, 54, 97,122,190,116, -218,207, 41,212,101,109,252, 75,156,255,207,135,247,163, 20, 95, 78,248,111, 1, 88, 59,183,165, 6, 97, 32, 12,103, 19, 40,142, - 85, 59,125, 1,223,255,201,156, 81,199,241,194,169,165, 57,173,255, 46, 9,165,165,104,103, 44, 23, 20, 8,228,176,252,251,237, - 94,208,132,254, 67,118,158,244,106, 52, 54,169,161,201,212, 87, 90,225, 46,164,208, 82, 71, 85, 1, 21,238, 70,177,174, 43, 68, - 0,180, 78,254, 15, 35,224, 5,136,149,248,196, 40, 12, 33,128,214, 49, 10,123,240,138,114,138,168, 15,106, 64, 41,101,149, 24, -240,103,132, 90,104, 4, 92, 19,150, 77,248,222, 74,219,109,171,218,213,235, 82,239,128, 56, 13, 6, 40,112,134,100, 10, 0, 42, -243,247,142, 8, 75, 89,158,197,175,220,159, 47, 89, 94,230,245,164, 34,147,200, 9,138,245, 33,160, 34,232, 49, 11, 34,129, 86, -116, 58,113,145,197,233,138,174, 52,217, 59,141, 81,206,108,159,233,245,179,223,121,246, 57, 31, 32,245,204,192,119, 14, 24, 39, -120, 33,211, 18,108,182,143, 47,239, 31,232, 49,117,246,190,115,155,117,183, 93,183, 79, 15,238,174, 67,136, 48, 62,144,239,109, - 47,164, 22, 27, 55, 78, 2, 85, 74, 1, 3, 96,244, 39, 75, 68,129,138,123,184, 80, 26, 62,129,167,125,244,253,219, 87,191,247, - 81, 98, 73, 98,229,187,126, 37,207, 53,164,161,105, 24, 55,209, 49,184, 93,224,251, 25,209,120, 70,225, 63, 41, 79, 87,115,153, -150, 33, 78,183,224,251,220,211, 70,132,184,227, 98, 59,180, 60, 16, 30, 13,194, 11, 70, 56,133, 59, 45,242,215, 56,186, 98, 16, - 73,252,107,122, 27, 78, 27,186, 64,246, 66,195,234,177,240,144, 97, 13, 98,171,103,120,173,206, 46,187,188, 53, 21,234, 18, 13, -108,113, 97,245, 31,146,116,199,142,185, 91,161, 1, 29, 9,160,233, 21, 6,211, 32,123,115,173, 96, 29, 76,215,109,133, 3,215, -172, 4,252,221,202, 31,246, 1, 46,148,162, 7,219, 65,247,228,133,248,184, 0, 93, 66,156,146, 45, 77, 71, 90,114,179, 26,101, -101, 39,115,121,112, 42,249, 20, 13,124,231,225, 56,107,114, 56,170, 23,222,218, 82,187, 59,124,147,248,132,218, 65, 23, 85,170, -126,122,142,248, 95, 82,153, 37,137,218, 89,152,156,107,146,111,148,148,156,109, 63, 2,208,118,118,187,109,195, 48, 20,150,104, -217, 10,150,166,104, 46,138,162,215,125,255, 39, 91,209, 98, 75,139,194,113, 36,245, 28, 82,114,188, 37, 46, 54, 12, 3,114, 97, - 4,209,143, 77,242,240,147, 17,137,255,138,237, 48,213, 38,196,247,233,253,138,184,183,147,141,169,177, 86,254,219,190,161, 41, -248,105,155, 53,121,152,120,160, 91,152,184, 67,216,131,116,161,135, 7, 12,116, 6, 2, 61,127,210, 65,211,233, 68, 46,107, 22, - 13, 32,249, 78, 83, 70,177,108,235,234,127,173, 69,150,186,178, 68,174,236, 92, 67,116,185, 8, 98, 41,146,203,195,221,227,243, -207,239,169, 18,152,113,186,173, 32,114, 18, 58, 62,188,213, 36,158, 91,120,172, 23, 46, 25,154,241, 50,159, 0, 38,230,170,115, - 35,117, 80, 91,157,222,179,241,175, 78,246, 76,251, 53,196, 43,191,179, 12, 23,197, 99,242,161,184,219,161, 76,222,189, 8,251, -193,232, 57,133, 97, 40,183, 60, 99, 23, 13, 79,247, 79,123, 60, 52,100,142, 62,186,221,183,208, 15, 93, 12,204, 93,232,127,139, - 73,238, 48,175, 30, 61,142,163,127,251, 40,167, 99,250, 24, 5,243, 2,165,116, 89, 7,241, 18,153, 53, 83, 62,129,153,221,136, -124, 20, 52,229, 9,159,177,230,178, 68,170, 57, 43,130, 21,150,241,229,186,227,249,185, 18,185, 95,240,200,126,179, 63,140, 7, -172, 29,190,246,162, 40,155, 41,143, 51, 28, 93,101,243,175,197,125, 54,233,174,191, 57,168, 55,194, 58, 39,205, 70,127,245,178, - 18,242,146,126,101,110,191, 62, 98, 91,152,174,189,247, 52, 6,228,245, 93,220,191,142,175,229, 15,196,221, 47, 70, 91, 19,247, - 53,190,163,225,106,171,172,225,208,249,235,216, 62,111,147,211, 21,118,211,251,102, 89,185,144,152, 26, 69, 85,167, 69,183,175, -217,198, 59,213,121,177,202, 46,174,210,156,208,143,237,142,164, 38,185,138,240,206, 86,231,122,208, 6,120, 46,244,208,214,126, - 24,250, 13,183, 57,199,136,107,120,240,118,123,115,120,251, 49, 5, 8,251,145,237,178, 41, 46, 17,137,157, 5, 22,117,247, 37, - 47,151, 40,179,192,115,238,234, 70,136,101, 68,101, 98,176,229, 6,239, 21,203, 41, 73,224,253,108, 83,203,220, 61,142,240,210, -111, 98,136,104,125, 76, 71, 87,170,168,144,132,172,246,176,182,107,125,148,115,118, 92, 87,118,185, 0,243,223,220,169,252, 31, -102, 95,142,242, 41, 0,105, 87,215,219, 32, 12, 3, 99,135, 16,232,180, 73,235,255,255,131,211, 94,214,170, 27,133, 66,178,179, - 29, 88, 87, 86, 52,109,111,124, 4, 2,137,115,190, 59, 41,201,127,241, 29, 67,247,253, 50,206,189, 95,246, 97, 46,253,106,216, - 46,191, 41,211, 92, 74,127,147,102, 91, 93, 67,197,168, 61,240,132,115, 49,102, 42,157, 64, 47,232, 46,235, 81, 1,111, 2, 94, - 20, 67,131,231,198, 52, 14, 93, 7,212, 83, 26, 60,130,133,226,173,160,152,162,204, 40, 89, 46,201,234,176,240, 29, 74,165, 0, -159,215,119,243, 12,183,232,200, 67,119,156,100,237, 47,195,226,180, 76, 24, 77,150,185,146,246,179,149,102,183,139,187,243,216, - 41,203,157,117, 52,235,202, 97,242,152,174,221,175,145,144,253, 44,157, 53,232, 69, 32,178,237,169, 75,197,221, 33, 75, 98,230, - 22,225,199,166,215,254,227,101, 28, 78, 41,131,225, 52,109,243,212, 4,164,137, 64,244,208,186, 32, 30, 11,141, 98,247, 36,105, - 41, 79,117,237,235, 40,252,105, 2, 49, 23,181, 32,190,140, 84,147, 24,100, 28,167, 53,209, 5,199, 67, 62, 15,147,215,252, 55, - 73,141,162, 22,106,246,146,159, 64,117, 80,186,142, 57,247,162, 81, 22, 69,205,137,149,243,144,126,177, 54, 32, 90,120,226, 66, - 67,190, 98,178,252,220, 85,136,218,209,225,252,182, 70,237,200,113,144,109,120,175, 54,118, 79,231,141, 40,199,149,157,111,187, -169, 91,242,199, 90, 25, 44, 85, 28, 47,167, 27, 46,188,126, 97,244,205, 48,245,235, 68,149,140, 4,255,150,212, 91,194,219, 98, -241, 52,251, 90, 0,247,245,103,111,128,251, 92,152,188,227,181,216,219,200,124,222,184,105, 33,224,247, 61,153, 98,194, 20, 33, - 98,206,140, 86,156,221,204,147, 10, 85,191, 98,161,166, 82, 73,124, 62, 42,186, 92,149,184,138,108,219,135,157, 52,165,176, 13, - 5, 87, 80,126,153,131,237,213,139, 20,239,181,226, 32,190,140,175, 67, 21,154, 10,216,222,196,166, 13,177,133,222,125,222,239, -251,190, 7,189,119, 22,197,184,132,240, 68,196, 87,178,106,170, 56,190,164, 70,139, 32,180,168,119,167,102,175,129,124,105, 2, -113, 86, 83, 6,128, 92, 0, 20,148,116,202, 29,207,126,139,124, 15, 46,145,179, 41,225,156, 13,199,125, 2,156,136, 99,147,165, -164,221,211, 1,204,133,144,217, 78,169,217,125,135,120, 27, 11,249, 39,100,207,247, 53,208, 99,124, 4,239,161, 77, 91,230,111, -136,127, 19,136,159, 2,144,118,109, 59,106,195, 80,208,231,216,216,161, 41, 44,171,221,125,104, 87,253,157, 85,255,255, 1, 9, -245, 15, 42, 30,118,165, 0, 1,199,113,207,197,129,208, 80,161,182, 8,129,100, 7, 80,236, 57,227,153,177, 18,104, 20,241,127, - 86,137,194,209,131, 46,214, 5,210, 26,205, 61, 48,248, 57,153, 46, 98, 15, 57, 0,135, 60,196,104,175,192, 66, 98,114,177,109, +137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, + 72, 68, 82, 0, 0, 1,245, 0, 0, 1, 26, 8, 2, 0, 0, 0,135, 56, 89, 17, 0, 0, 0, 9,112, 72, 89,115, 0, 0, 11, 19, + 0, 0, 11, 19, 1, 0,154,156, 24, 0, 0, 0, 4,103, 65, 77, 65, 0, 0,174,211,164,123,114, 68, 0, 0, 0, 32, 99, 72, 82, + 77, 0, 0,110, 39, 0, 0,115,175, 0, 0,246,112, 0, 0,129,232, 0, 0,107,215, 0, 0,226,170, 0, 0, 48,131, 0, 0, 21, + 42,251,118,133,113, 0, 3, 1,163, 73, 68, 65, 84,120,218, 98,252,255,255, 63,195, 40, 24, 5,163, 96, 20,140,130, 97, 7, 0, + 2,136,133,138,102,253,249,249,253,223,203,235,127, 63, 63, 99,150, 50,102, 19,148, 28, 13,220, 81, 48, 10, 70,193, 40, 24, 64, + 0, 16, 64,140,212,106,191,255,249,241,237,247,230,124,150,143, 55,128,236,255, 12,204,127, 52, 35,217,204, 18, 89, 88,217, 70, +131,120, 20,140,130, 81, 48, 10, 6, 4, 0, 4, 16, 19,181, 12,250,255,242, 26,164,112, 7, 85, 26, 12,127, 89,174, 45,249,190, +171,121, 52,124, 71,193, 40, 24, 5,163, 96,160, 0, 64, 0, 81,173,124,255, 39,168,248,155,153, 7,216, 25, 0, 35, 16,193,246, +116,255,151,205,165,127,190,127, 30, 13,229, 81, 48, 10, 70,193, 40,160, 63, 0, 8, 32, 70, 42,206,175,254,120,126,243,239,193, + 54,150, 79,119, 17,141,122, 6,134,191,156,162, 76,206,237,156, 82, 26,163, 97, 61, 10, 70,193, 40, 24, 5,244, 4, 0, 1,196, + 72,245,245, 51,159,143,205, 99,189, 50,159,225,255, 63, 68,211,158,145,229,183,106, 16,183, 69, 50, 11, 39,207,104,136,143,130, + 81, 48, 10, 70, 1,125, 0, 64, 0, 49,210, 98,125,228,143, 59,135,255,238,111, 96,250,247, 3,218,134, 7,227, 63,156, 18, 44, +110,237,156,146,234,163,129, 62, 10, 70,193, 40, 24, 5,116, 0, 0, 1,196, 72,163,245,239,223, 95,221,251,191,187,138,225,243, + 35,132,208,127,134,191, 76,236, 76, 86, 37,220,186,222,163,225, 62, 10, 70,193, 40, 24, 5,180, 6, 0, 1, 68, 84,249,254,237, +195,235, 63,119, 14,253,120,126,249,255,159, 95,196, 27,205,252,235, 51,215,251,179,176, 38, 60,130,248, 99, 90,194,111, 18, 60, + 26,244,163, 96, 20,140,130, 81, 0, 7,255,254,253,251,254,253,251, 71, 48, 0, 50, 88, 88, 88,254,252,249,195,205,205, 45, 36, + 36,244,245,235, 87, 70, 70,198, 31, 63,126,124,251,246, 13, 82, 98, 75, 72, 72, 8, 11, 11,179,179,179,227, 55, 19, 32,128, 8, +151,239, 31, 46,237, 96, 58,209,195,252,247, 27, 68, 61,156, 96, 64,110,153, 99, 99,162, 9, 33,217,243,255,175, 94, 18,191, 77, +218,104,140,142,130, 81, 48, 10, 70, 1, 16, 0,203,244,135, 15, 31,242,241,241,241,242,242,242,240,240,176,177,177, 1, 11,244, +143, 31, 63, 29, 63,126, 76, 89, 89, 89, 76, 76,140,131,131,131,133,133, 21, 40,200,196,196,248,239,223,255, 47, 95,190, 60,124, +248, 0, 88,244, 75, 73, 73, 1, 5,113, 25, 11, 16, 64, 4,202,247, 95, 63,127,124, 91,224,203,242,247, 43, 3, 35,169, 14,254, +143, 89,214,255, 71,106,201,255,145, 48,231,245,106, 97,225,228, 29,141, 90,234, 2,120,132,226,137,245,145,224,134, 81, 48, 10, +134, 74,179,253,237,219,183, 79,158, 60, 49, 48, 48, 0,230, 23, 96,217,253,251,207,223,175,223,126,222,185,255,114,223,190,189, + 26,106, 10,110, 46,118,236,108,172, 64,193,191,255,254,255,252,249,231,219,143, 95, 63,126,254,225,229, 98, 23, 18,228,190,127, +239,174,176,176, 16,176, 33,143,203,112,128, 0, 98, 33, 42,183, 34, 10,107,244,236,202,136,209,110,255,143,213, 0,140,246, 60, +243,243, 19,159,151,199, 50, 59,212,240, 41,153,140,198, 49,229,229, 41, 16,124,248,250,227,194,131,215,144,178, 85, 79, 78, 88, +128,155,131, 9, 88,215,195, 0, 29,138,111,136, 51, 46, 60,120,245,225,235, 79, 32,131,166,110, 24, 5,163, 96, 24,128, 63,127, +254, 60,120,240,128,149,149, 85, 87, 87, 23,152, 65,158,191,250,120,227,206,139, 7,143,223, 60,124,244,252,209,131, 91, 92, 60, + 2,191,152,127, 10, 8, 63,248,249,235,239,171,183,159,190,125,255,245,251,247,223, 63,192, 98,254,255,127, 54, 86, 22, 89, 25, + 17, 1,142,239,114,114,114,120,204, 7, 8, 32,194,227, 51,223, 30, 95,250,115,105,197,175,175, 31,153, 88, 89,177, 20,240,159, +158,177,124,125,140,117,180,230, 55,155,240,127, 1, 57, 14,126,201,127,191, 62,253,120,243,148,237,219, 35,198,255,127,224,101, + 61,220,214,127,186, 73,130,246,233,104,166, 94,186,241, 96,235,249,187, 14,186,138,198,106,178,108,108,172, 67, 40,182,110, 61, +120,190,243,226,125, 75, 85,105, 11, 61,101,186,213,255,139, 14, 93,155,186,235,226,165, 71,111,145,197,229,132,121, 34,173,212, +178, 93,245,132,120, 57,153,153,153,169, 82,194, 66,138,239,210,165, 71, 58, 35,173,244,229, 69,153,192, 0, 34, 14,172, 93, 74, +150, 28,222,124,238,222,199,111,191,144,221,144,238,172,147,235,174, 15,116, 0, 92,241, 40, 24, 5,163, 0,152,101,222,189,123, +247,250,245,107,110,110,110, 89, 89, 89, 96,153,125,226,236,189,157, 7, 46,189,127,243,250,243,231,215, 92,220,252, 95, 62,127, +144, 85,212,178, 50, 86, 97, 98,102,190,126,251, 57,166, 9,192,220,244,246,213, 51, 39, 71, 43, 27, 19, 5, 22, 22,236, 57, 11, + 32,128, 40, 90, 63,243,238,236, 70,166, 83,253, 76,255,126, 34, 23,237,255, 25,152,126, 75,219,115, 24,132,115,202,232, 48,179, + 32,250, 7,127,190,127,249,126,125,231,239,115, 11,152,127,188,130,171,133,216,253, 95, 59, 86,208, 41, 23,217,228,221, 71, 47, +120, 78,218, 1, 84, 35,192,198,116,170, 45, 86, 73,142,192,105,101,249,147, 86,223,253, 8,114,134,151,158, 98,150,191,245,128, + 68,216,179, 23,175,108,107,150, 62,253,250, 27, 88, 7,206,138,177,143,243, 50,167,138,177,223,190,255,216,126,241, 1,144, 33, +203,207, 97,166,169,112,238,230, 35, 35,117, 68,141,253,254,203,119,183,182,245,151, 30,189,193,165,157,143,147,109, 83,145,151, +145,146, 56, 11, 48, 9,128,155,210,148, 56,230,222,203, 15, 22,181, 43,128, 37,248,166, 34, 79,123, 45, 89,160,153,192,130, 27, + 40, 14, 44,244,221,219,215, 35,151,236,200, 64, 71, 70,104,115,177,183, 8, 63, 55,196, 13,163,121,123, 20,140,240,146,253, 45, + 24,176,177,177, 1, 73,126,126,254, 63,127,254,157,188,240,224,232,241,211,156,236,156,255, 25, 25,248,248,132,128,170, 24,153, + 89,228, 36,249,213,212,213, 46, 93,127,241,247,239, 95,244,130, 27, 12, 94,191,122, 42, 38, 38,157, 20, 97,205,195,141,125,162, + 21, 32,128,200, 60, 63,242,231,151, 15, 95,143,204, 96,190,179, 1,109, 64,230, 55,135, 4,139,117,177,136,166, 45, 22,155, 56, +121,120,141,130,255,104,186,127, 62, 56,137,241,246, 6,148,246,254,149,197,159,132,228,248, 12,252, 81, 4,193,133,255,135, 95, +127,127,252, 36,188,104,231,196,205,167,103, 94,129,102,128, 21, 5, 7,108, 64,255,223,191,255, 79,128,133, 59,246, 33, 42,242, + 1, 23, 39,135, 36,203, 95, 96, 92, 78,221,124,156,155,153,177,107,193,246, 21,237, 25,240,132, 18, 58, 97, 43,114,225,174, 41, +201,207,199,201,250,233,251,239,235,207, 63, 66,251, 87,223,127,249,245,109,219, 80,224,110,162, 34, 5, 47,142,201, 3,192,186, + 36,124,226, 86, 72, 33,254,235, 23,176,171,248, 27, 98,218,131,215, 31,145, 11,119, 62, 14, 86, 77, 41,126, 32,227,228, 61,168, +195,174, 60,121,231,211,179,229, 96, 77, 0, 40, 25,140, 22,241,195, 11,124,249,250,243,238,253,215,112,174,178,162, 40,176,172, +217,181,239,218,177, 83,119,173,204,148,221,156,180, 72, 50,141, 72,141,104,150, 74,136,241,137,139,241,145,231,254,187, 15, 94, + 47, 94,113,162,161,194, 23,191, 93,250, 58, 50,212, 10,177, 7, 15, 30, 0,179,143,146,146, 18, 48, 47,112,115,113,223,186,125, +107,253,150,163, 60,252, 18,146,114, 26,192,252,241,255, 31,168,248,224,229,227, 84,146,224,224,224,226,218,176,105,167,172,130, + 38, 19, 19, 51,184, 76,135,244,128,255,255,254,253,243,199,143,111,111, 95, 61, 23, 17,147,150,145, 20,192, 85,184, 3, 1, 64, + 0,145, 83,190,127,123,245,240,235,166, 34,182, 31, 79,209,196,127,113,201,243, 4, 77,229, 20, 16,129,150,245,191,127,239, 61, +121,109,203,165,251,130,220,156,206, 26,210,214, 70,234,172,172,172,192, 82, 94,208,163,234,237,215,183,204,207, 14, 51, 32,141, +204,255, 62, 54,225,151,134, 43, 27, 7,215, 80,175,155, 25, 24,168, 63,202,204,195,195, 13, 36,181,100,132, 22,108, 59,166, 41, +129,168,192,128, 5,235,225, 27,207, 32,108,115, 37,145,206, 96, 35, 57, 17, 94,200, 80, 12,176,180,109,220,120,110,205,153,135, +144, 34,190,115,243,185, 37, 89,194,224,201,119, 50,155,240,255,254,253, 75,153,181, 7, 62, 4,244,231,207, 95,160, 8,100,192, +189,100,201, 97,120,225,158,235,172,145,239,162, 9, 25,141, 1, 86, 51,115, 15,221,156,176,251, 26, 80,252,234,211,247,109, 27, +207,212, 4,154,193,135,227, 71, 75,198,225, 1,128,101, 95, 67,199, 38, 68, 90,229,102, 47,201,117,255,242,237,231,197, 43,143, +245, 72, 47, 19,137,212, 8,177, 84, 95, 71, 22,194, 37,163, 34, 65,216,248, 5,100, 35,166,248,186, 45,231, 47, 93,121, 2, 44, +247, 33,118,173, 95,146, 69,149,150,251,163, 71,160, 45, 65,106,106,106,192, 44,240,225,195,167,109,219,182,187,123,122, 91,218, +114, 94,185,245, 76,132,159, 75, 84,136, 71, 94, 86, 68, 86, 74, 72, 12,152,145,153,152,158, 60,121,250,248,169,230,227,167,207, +249,248,133,254,254,253, 3, 90,237,242,229,211,175, 95, 63,216, 56, 56,129, 36,232,156, 94, 22, 38,125, 29,124,227,239, 0, 1, + 68,114,249,254,233,206,201,159,123, 27, 89,126,189,133,159, 63, 0,201,169,255,152, 56,184,220, 26,224,133,251,142,227,151,171, +150, 29,188,250,250, 43,164,204,235,220,126, 65, 73,248, 64, 95,180,189,151,149, 46, 80,132,223,179,238,203,202,184,255,159,159, +195, 87,212, 48,254,254,242,253,226, 6, 54,243, 40,244,226, 18, 44,255,236,229,155, 77, 39,110, 60,124,253,241,195,247, 63,192, + 48,146, 17,226,246, 48, 86, 53,209, 84, 64, 81,248,255, 63, 90,211,249,205,187,143,107, 14, 94,220,113,249,193,213, 7,175,222, +126,251,197,201,194,172, 32,193,239,162,167,152,236,106, 44, 39, 41,130,203,131,251,207, 92,223,116,234,214,201,187,207, 56,216, +217, 12, 20, 36, 2,205, 84,109, 13,212,208,212,220,188,247,116,221,137,235, 79,222,125,251,241,239,191, 32, 59,179,162,164,160, +135,129, 18, 59, 11, 19, 3,194, 9, 8,135,188,251,240,105,241,222, 11,155,207,220,186,251,242,227,151, 95,127,217,153,153,100, +132,185,237,117,149, 18,157, 13, 52,228,196,177,186,225,240,133, 91,221, 27,142,223,124,242, 6, 24,201,103,102, 22,114,115,178, +255,255,255, 79, 78,148,159,143,157, 77,150,159, 3,174, 76, 78,152,247,112, 93,144,119,247, 22, 55,109,169,238, 48, 19, 96,115, + 0, 84,131,130, 27,200, 92, 92,255,166,196,219,157,184,183,238,201, 59, 80, 20,236,188,242,244,205,199, 47,146,172,172,204, 96, + 64, 70,186, 44, 89,114,104,203,185,251,136,226,254, 63,180,112,191,255,234, 35, 92, 60,200, 72,182,192, 85,139,157,157, 29,216, +241, 4,218,194,195,195, 80,233,111,242,236,227,143, 85,167,238, 1,101,231, 28,188, 81,234, 5, 29,136, 31, 45,223,135, 31,104, +168,240,155, 62,239,192,203, 87,159,128, 45, 98,204, 38, 57,164,105, 31,232, 99,120,236,228, 93, 96, 33, 14, 26,235,187,255, 26, +216, 52,118,115,212,178, 50, 87, 6,106, 89,191,249, 60,144,251,229,235, 15,252, 26,149, 21, 68,129,138, 25,161, 54,250,162, 41, + 6,214, 46,174,142, 90,192,230,252,209, 83,119,131,124, 12, 33,226,192,166, 61, 68, 4,200, 5, 22,217, 64,110,102,146, 61,208, +174, 93,251,175, 1,185,112, 19, 22,175, 60, 1,233, 19, 0,107, 23,160, 94,160,212,139, 87, 31,129,165, 60, 15, 23,123,108,132, + 37, 80,252,226,149, 39,187,247, 95, 3,106,132, 84, 39, 64,147,129,238,129,248, 2,232, 60, 98, 26,248,207,159, 63,255,251,247, +175,162,162, 34, 48,253,191,123,247,121,203,230,205, 22,150,182, 92,156, 60, 62, 46,122,198,186,114,194, 66, 60,156,236,108,192, + 60,138,200,224,114, 50, 1, 30, 44,187, 15,177,158, 61,127,233,223,191,191,156,156,188, 28,220,220,188, 2,194,156, 92, 60,204, +204, 44, 64, 67,190,125,122, 46,196,139,175, 12, 7, 8, 32,210,202,247,183, 71, 23, 49,156,155,197,252,255,247,127,120,201,206, + 8, 45,201,254,233,196,112,203,104, 66,148,205,219,124, 36,119,217,209, 63,255, 81,230, 82,239,189,249, 18, 48,113,107,223,235, + 15, 57,254,182, 44, 92,252, 76,214,229,127,182,231, 35,183,123,127,156, 91,204,143, 92,190,195,116, 55,175, 60,184,229,234,211, +111,127,144,202,205,255, 12,245, 27, 78,133,153, 40,205,206, 13,224,225,230,100,192, 54, 38,178,225,224,185,180, 57,187,223,124, +255, 3, 23,249,240,231,207,139, 7,111, 79, 60,120,219,189,229,108,178,163,118,103,130, 59, 23, 39,199,149, 91,143,138,151,236, +131, 40,200,182,215,156,184,227,252,193, 7,239,224, 21,215,161, 59, 47, 39,237,185, 20,107,174, 50, 51, 55, 0, 50,205,251,237, +251,143,210,153,155,231,159,184,251,231, 63, 74, 83,189,112,233,225, 72, 3, 89, 72,117,196,136,228,156, 61,167,174,166,204,218, +249,252, 11,210, 16,211,159,127,175,159,125, 60,255,236,252,148, 93,231,107,253, 76, 43, 34,157,129, 98,215,110, 63,154,180,227, + 60, 68,222, 68,134,175,120,245,201,239,127, 65, 70,136,177,130,134, 50,148,229, 65,211, 15, 42, 10,210,152, 99,112, 6, 10, 98, +155,138, 60, 37,249,216, 57, 57,217,129, 37, 59,164, 96,133, 53,177,255,120,235,203,207,220,127, 13,194,189,244,232,141,168, 0, + 47, 43, 43, 43, 25,133,251,194,131, 87,167,238,186,132, 85,118,211, 89,196,113,114,121,206,154, 64, 7,112,112,112,192,157, 1, + 76,205, 21,126,198,144,242, 29,216,156,223,114,254, 65,144,185,218,232, 16,205,240,108,200, 63,120,253,245, 43,168,224,134, 20, +193,240, 66,115,221,230,115,144,193, 19, 96, 51, 25, 88,250, 3, 75, 67,228,246, 50,144, 61, 67, 49,166,161,125, 19, 80, 28, 88, +142,127,249,250,147, 24,141,174, 14, 90,144, 2, 23,194, 5,202, 46, 94,121, 60, 54,220, 18, 88,224, 2,219,218, 5,153, 46,139, + 87, 28,135,148,239,192, 66, 31,210, 27, 0,137,248, 26, 1,171, 19, 96, 37, 4,113,225,221,251,175,130,124,140,128, 12,136,177, +144,202, 6,200, 0, 42, 0,150,233,112, 23, 2,221, 48,189, 99,147,181,153, 50,208,100, 96, 65, 15,148, 2,218, 5, 49, 25, 88, + 1,196,133, 91, 94,188,250, 4,168,101, 70, 95, 12,254,240,249,241,227,199,151, 47, 95,128, 45,119, 96,201,241,225,227,247,189, +123,246,106,104,104, 9,139,138, 3,115, 3, 7, 59,171,162,156, 40,214,172,247,239,239, 95, 29, 85, 33, 6, 70,147, 55, 31,190, +113,114,112,178,179, 51,179,179,177,240,114,177, 11, 10,112,241,242,112,178,177,168, 61,125,250,148,143,143, 23, 87,163, 13, 32, +128,136, 45,223,255,124,255,252,102,107, 51,235,179, 3,200, 99, 16,240,214,234, 95,102, 94, 94,195, 16,136,202,107,119, 30, 23, + 44, 63,250,251,223,127,140,129, 11, 16, 40, 91,126,196,217, 80, 77, 83, 78,156, 79,205,234,205, 9,117,198,247, 55,225, 6,177, +252,124,253,245,209,101,110, 57, 93, 84, 61,255, 87, 93,124,140,106, 6, 20,172, 58,115,239, 85,219,242,189,173, 73,152,174,221, +114,248, 66,228,212,237, 63, 65,110, 96,100,103, 98,140,183, 86, 51, 82,149,254,246,227,215,154, 99, 55,142, 61,120, 3, 20,159, +182,247,202,155, 79,223,151,151, 71,124,250,246,115,207,181,167, 16,255,156,186,253,252,211,159,127,140, 12,140, 98,236,192, 70, + 38,227,115,104,221,240,127,241,201,219,156,140,235,166, 21,133, 3, 57,153, 19,214, 46, 59, 15, 63,116,225, 63,114, 51,116,249, + 5,136, 56, 35,220,153,199, 47,221, 9,155,180,245,235,239,127,224, 81,105,230, 76, 7, 29, 69, 25,145,175,223,126,110, 63,123, +103,207,205,231,127,192,181,148, 0, 47, 87,134,143,229,235,119, 31,230, 31,185, 6,209,184,140,137,241,199,223,127, 88,189,140, + 89,190, 3,227,213, 88, 89, 18, 88,140, 66,216,144,214, 49, 92, 86,128,135, 3,121,122, 0, 14,136,111, 62, 67, 22,204,164,207, +217,135, 75,246, 8,108,128, 72, 90,144, 75, 78,132,151, 13, 12,128,181, 8,196, 25, 64, 82, 69, 82, 72, 86,152,231,241,219, 47, +160, 0,185,253,194,207, 88, 9,232, 90,200, 32,210,104,153, 56,156, 0,176, 0,133, 23,244, 72,205,234,171, 64,210,218, 92, 5, + 52,226,177,249,220,209,147,119, 32,131, 42,153, 73, 14,192,102,123, 73,237,106, 96,209, 12,108, 89, 3,203, 86,160,154,146, 92, + 55, 96,123, 25, 98, 14, 46,141,192, 18, 22, 88, 58,127,248,248,109,247,129,107,235,183,156,135, 91,228,230,164, 13, 25,162, 57, +118,242,206,213,235,207,176,186, 48, 54,220, 2,100,242,126, 80,187, 27,168, 12, 88, 31, 0,221,192,205,205, 14, 52, 31, 50,200, +115,233,234, 19, 72, 19, 30,168, 0, 84, 43, 92, 97, 0, 86, 18,144, 90, 4,232, 72, 96,245, 3,169, 51, 94,190,254, 4,233, 88, + 0, 45,133,152, 0,113, 45,126,112,251,246,109, 89, 89, 89, 72, 69,178,103,239, 30,126,126,126, 57, 5,101,118, 86,102, 46, 46, +156, 77,174, 47,159, 63,127,253,250, 85, 94, 94, 86, 67,147,247,193,227,183,192, 86,211,207, 95,127,190,127,251,253,233,235,143, + 79,159,127,188,125,247, 21,216, 8, 20,230,251,251,236,217, 51, 25, 25, 25,172, 25, 10, 32,128,136, 42,223,191, 62,190,250,121, + 71, 45,203,183, 39,240,102, 59,122,225, 45,166,195,193, 39, 8, 97, 47,216,119, 1, 81, 60,161, 15,180, 48, 0, 91,254, 51,183, +159,158,144,238, 3, 50, 71,222,238,255,187, 27, 40, 85,220,211,139,176,242,253, 63,242,102,168, 24, 51,165, 66, 31,115, 5, 41, +225,223,127,254,158,190,253,172,124,201,129,171, 47, 63,128,198, 82,110, 62, 91,115,232, 66,136,157, 1, 82, 89,248,255,231,207, + 95,213, 75, 15,252,132, 86, 48,255,235,253,140, 43, 98, 60, 32,230,231,248, 89, 59, 87,205, 59,124,239, 21,208, 11,171, 78,223, + 73, 63,123,131, 13, 82,239,129,213,126,250,253,207, 65, 73,164, 38,204,206,214, 64, 21,216,198,220,118,236,138, 95,255, 38,136, +236,146, 83,247,250,126,252, 60,113,245,254,178,243, 15,161,243, 72, 2, 92,221, 49,246,198,106,210,188,220, 92, 79, 94,189,159, +186,227,236,172,131,215, 81,154,238, 12, 12,213, 75,246,126,249, 13,154,248,102,101,100, 92, 91,224,103,103, 8, 61, 91, 45,199, +223, 38,162, 99,197,186,243,160, 97,141,170, 21,135,162, 29,244, 25,144, 22,149,255,248,251, 63, 88, 95,182, 60,208, 90, 78, 82, + 8,127, 33, 8, 31, 79,135, 47,127, 68, 83, 15, 41, 85,225,229, 47,164,112, 39, 41,211,222,127, 5,154, 59,133,176, 53, 37,249, +225,211,182,240,242,253,195, 55,104,131, 75, 70,128,139, 25, 6,224,117, 12,144, 1,228,202,193,202,247,171,207, 62, 0, 11,119, + 82,235,152, 81, 48, 36,192,250, 37, 89,187,246, 93, 3,182,100,129, 5, 52,100, 64, 3, 82,150, 65,134,203,129, 36,124,184, 28, +210, 40,230,225,102,151, 16,227, 7,150,239, 16, 17, 37, 69,148, 6, 44, 46,141,192,194, 93, 95, 71, 6, 82,230,194,199,103, 26, + 58, 54,115,195,230, 24,121,184, 57,136, 26,118,255,250, 19,121, 74,246,216,201,187,221,147,119, 2, 27,248,129, 62,134,144,230, + 57,150,105, 48,152,201,220,220,236,164, 6, 14, 36,217,115,113,113,253,248,249,231,204,153,179,191,127,124, 55,178,119, 2,230, + 90, 62, 62, 14, 60, 90, 94,189,126,253,235,247,111, 97, 97,225,119, 31,190, 61,120,242,246,227,167,239,127,254,252, 67,148, 48, +224,130,248, 31, 3,247,159,219,247, 69, 68, 68, 56, 57, 57, 49, 13, 1, 8, 32,194,229,251,155, 83,235,254,158,232,103,254,247, + 3,169,112, 71,202,153, 96, 38,139, 0, 98, 40,252,244,189, 23,200,187,157, 48,139,147,211,183,161,237, 95, 86, 65,201, 95,168, + 42,152, 62,191,196,104,241, 51,184,169, 75,204, 45, 10,101,129, 45,181,244, 18, 17,210,146, 23, 87,207,159, 9,110, 22, 51,172, + 58,122, 29, 84,190,255, 71,140,123, 95,189,251,228,242,107, 68,185,166, 34, 33,188,251, 20,162, 22,209,148, 20, 4,150,239, 16, +181,235, 78,221,138,176,212,132,219,228,168, 34,177,165, 33,134,131, 3, 26,226, 94, 86, 58,102,107, 14,157,122,252, 30, 52, 44, +243,247, 63, 48,184, 87, 31,191,254, 31,230,249,133,121,190,230, 58,208, 21,238,154,188, 60, 83,178,101,223,126,249,177,230,236, + 61,120,208,220,121,248,244,200, 3,232,108,164,180, 0,199,207, 63, 12,187, 79,223,132, 59, 67, 70,136, 7,226,243, 47,191,254, +110, 63,115, 75,156, 19, 62, 94,241, 63, 88, 79,110,113,121, 36, 11, 11, 81, 85, 47,254,185,202, 35, 55,159, 35, 26,215,194, 60, +164,238, 51, 66, 94, 48, 3, 44,220, 23,167, 88,155, 52,111,195,172,185, 49,235, 27,116, 23,194, 18,204,147,247,223,128,193, 8, +153,152, 29, 45, 16,135, 25, 0,150,185,144,150, 59,242,114, 14, 96,155, 23, 88, 70, 67,134,197,129, 69, 57,176,129, 12, 31,129, + 65,148,155,224,193, 16, 96, 19, 24, 88,118,195, 7,196,137,209,136, 92, 91, 0, 53, 2, 27,215,224,181, 46,175,228,100,132,224, + 53, 4,242,128, 62,154, 22,160,107,129, 85, 5,100, 76,233,197,235, 79, 64, 27,129, 13,124,100, 91,144,245, 2, 29, 9, 52, 25, + 40, 11,116, 18,100, 16, 31, 94, 51, 17, 3,126,252,248,241,230,205,155,237,219,119, 8,139, 72,190,121,245, 74,223,192, 24,152, + 79,248,120,241, 21,238, 79, 30, 63, 6,146, 26, 26, 26, 95,191,253, 58,124,242, 22,176,193,142,200, 52,192, 28,197, 8,109, 52, +255,254,245,235,238,203,247,198, 70,191,177,150,239, 0, 1,132,175, 16,249,253,243,199,139,173, 93, 28,143, 54, 51,161,103,103, +216, 40, 51, 60,123, 35,229,104, 14,118, 86,164,145, 27, 44,128, 29,118, 41,235,223, 63,127,208,178, 57,211,223,175,152, 99, 0, + 33,150, 26,104,133,157,130,148,168,145,172,208,201,135,160,129,242,235, 15,208, 87,254,159,190,255, 2,153, 27, 54,125, 39,142, +162,145,225,202,227, 87, 12,150,154, 8,149,150,234,240,194, 29, 2, 4,249,121, 24,192,229, 59, 52, 5, 63,120, 1,174,143, 24, + 85, 5,216,225,133, 59, 28, 68,217,106, 3,203,119,248,224,213,211,183, 8,191, 60,120,255,221,187,123, 45,174,112,190,247,236, +181,184,146, 56, 60,104, 35, 28,244,137, 44,220, 9,228,183,135,175, 31,189,133, 94,158,229,170, 41, 9,105, 74, 19, 95,184, 35, + 47,152,225,227,100,237, 10, 53, 17,230,197,183,186,233,201,135,111,184,164, 62,126,135, 78, 63, 60,125,255, 13, 62, 70, 52, 90, + 32, 14, 51, 0, 95, 69, 3, 25, 7,135,176, 51,147, 29,186, 39,237, 60,122,242, 14, 16, 65,138,126,101, 69, 49,140,118, 49, 59, +164, 52, 71, 94,135, 67,140, 70, 56, 0,150,236,245, 29,155, 50,138,150,124, 5, 13,226,139,133, 5,154,236, 63,124,163,164,118, + 53,104,236, 1, 71,173, 16,228, 99, 4,236,106, 0, 75,106, 96,169, 13,238, 34,200,172,223,124, 14, 50, 94, 4,239, 40, 0, 59, + 34,192,158, 1,100,248,222,205, 73,235,216,169,187,153, 69, 75, 32,141,247,204, 36,251,233,243, 14, 18, 31, 56,175, 95,191, 22, + 19, 19, 99,102,102, 83, 82, 82,253,249,243,199,215,175,159,248,248, 20,129, 29, 93, 92,195,158,111,223,190,101,102, 97, 17,229, +227, 7,230,217,107,183,158, 2, 11,119,112, 83, 9, 60,223,249, 15,178,156, 4,218,120,250,246,237, 51, 80,246,225,211, 79,130, + 2, 88, 86,136, 2, 4, 16,206,114,228,199,135,215,239,183,212,176,189, 62,251, 15, 92, 91, 32,236,102, 98,255, 39,105,206,252, +244, 16,114,193,254,255,251, 59,184, 2, 11, 21,169, 61,144,241,175,255, 88,134,144,129, 28, 7, 45,104,111,235,239,183, 79,255, + 81,135,111,254, 51, 48, 97,182, 12,181,101,177, 44, 50,225,231, 1,150, 53,160,162,231,215,159,191, 48,197, 80,245,159,191,126, + 39,106, 9,250,127, 96,220,127,135,116, 49, 32,190,208,149,151, 64,175, 2,152, 64,251,191,224,103,170,253,248, 5, 29,145, 23, +192, 86,241, 42,139,242, 51,192,215,240,252,255,127,239,237,199,255,255,255,163,173,150,100,196,114, 42, 15,195,183,159,191,145, +122, 58,255, 85,196,248, 41,207,108, 64,171,167,236,188, 8,231, 38,216,168, 64, 22,191, 19, 57,177, 9,212,158, 58,107, 15,124, + 97,204,210, 84, 91, 61, 57, 97,172,115,179,214,234,146, 71,110, 61,135,148,221,192,234, 68,131,139, 11,173,236,254,240,245,199, +229,199,111,145,171,141,209,194,125, 56, 1, 96,209,220, 80,225,135,204, 5,150,197,192, 82, 18, 88, 62, 66,150,165,207,232,139, + 1,182,148,191,124,249, 9, 41, 70,129,236,192, 47,134,202,224,209,152,216, 8, 11, 8,219,202, 92, 25, 50,228, 2,212,242,226, +213, 39,130, 26,209, 44,133, 40, 6,154,192,195,195, 14,180, 23, 40, 50, 29,168,247,254,107,160, 57,192,154, 6,216,244, 6, 22, +202,112,245, 64, 75,129, 34, 64, 45,202, 74,162, 64,195, 33, 85, 11, 80, 87, 79,115, 40,196,106,136, 22,136,153, 64, 17,160, 2, +136,153,160,181,146, 96,247, 64,150,202, 64,204,193,116, 12, 38,248,254,253,251,159, 63,127,128, 45,241,159, 63,255,255,254,253, + 91, 86, 70,230,253,187,215,192,182, 22, 46,245,159, 63,129, 0, 48,183, 10, 10, 10, 60, 3,173, 71,122,133,104,174, 3, 75, 20, + 38,164, 65,239,255,255,158, 63,125, 32, 35,171,242,230, 45,246,107, 80, 1, 2, 8,123,249,254,241,246,201, 47, 59,235,153,127, +189,249, 15, 29,144,129,102,200,191,108,130, 60,158,237,204, 76,140, 95,159, 30, 68, 46,131,127, 61, 60,129,168,120, 61, 77,167, +238,190,240,254,251,111,172,253,120, 1, 14,150,100, 55,232,129, 51,191, 31,159,102, 70,205,235,127,153,185, 49,138,247,255,143, +223,127,177,192,112,225,171,119,208,129, 96, 78, 54, 52, 47,252, 23,224, 67,220, 18, 37,207,195, 86, 21,110,135, 43, 28,133,161, + 29, 73,232, 82, 24,110, 14, 22, 28, 21, 1,116,149, 16, 23,176,107, 2,118,239,171, 79, 88, 58,125,159, 80,123,130,178, 66,252, +112, 95,152, 43,137, 39, 56,232,224,114,134,142,172,232,207, 47, 95,225, 5, 60, 55, 39, 27,229,185,238,194,131, 87, 75,143, 66, +135,131,130,140,228, 20, 68,249, 32,115,158,196,180,223, 33, 11,102,150, 28,129, 14,106,117,134, 24,235,201,137,128,143,175, 99, +193, 28, 29,242, 49, 84,232, 4, 79, 79, 1, 65,211,198, 11,139, 50,156,129,157, 74,228,115, 11, 38, 35, 85, 51,163, 96,248, 1, + 96,105,142,185, 52, 80, 28,117,195, 17,164,124,196,207,134, 27, 66,140, 70,172,150, 34,139,192, 21,136, 99,200,194,205,129, 51, +160, 42, 97,110, 22,199,240, 5,166, 94,100, 54, 86,199,160,140,115,190,127, 47, 36, 36,196,204,204,242,231,239,143, 79, 95,126, +126, 2,118, 98, 25, 89,190,126,253,202,195,195,131,150,239,128,213,192,215,175, 95, 62,188, 7, 77, 46, 42, 40, 40,124,254,242, +243,224,177,155,127,129, 77,162,127,240, 28, 7,106,191, 67, 51, 49, 35,195,199,247,239,132,132,196, 57, 56, 57,180,213,165,176, + 90, 13, 16, 64, 88, 74,180, 87,135, 23,253, 57, 61,141, 9,180, 8,146,145, 17,105, 44,230, 47,191,170,128,127, 47,183,136,212, +231,151, 15,209,199, 85,126,189,255,116,105, 27,159,158, 23,144, 45, 38, 34,184,182, 40, 48,160,123,237, 39,112,107, 23, 89, 37, + 15, 27,243,226, 12, 15,105,113,208,105,103, 31,159,220,100,124,126, 10,237, 88,178,255, 60, 98,152,237,247, 89, 59, 79,135, 58, + 24, 32, 91,183,255,204,181, 11,207, 63, 65,218,201, 38, 42, 82,240,186, 12, 58,140,174, 33, 3,103,191,252,250,203,215, 84, 93, + 66, 84, 8, 89,175,190,138,140, 16,172, 47,115,236,194,109, 44,189, 12,228,233, 3, 72,147, 28, 28,162,182, 26,114,199,238,131, +246,100, 62,252,240,125,243,145,139,190, 54,250,200,106, 39,111, 61, 9,107,236,131,128,129,130, 24, 59, 19, 3,100,154,247,237, +199, 47, 41,158, 40,149,212,241, 75,183,101,197,132,100, 36,160, 7,191, 29, 60,113, 9,201, 9,148, 54,111,129,109,228,180,217, +123, 32,108, 62, 14,214, 60, 23, 77,200,186,120, 98,198,103,128, 94, 56,112,237, 49,124,193, 76,181,143,110,184,185, 18, 59, 24, + 96,234, 5,138,232,203,139,234,200, 8, 93,121, 2,234,192,237,186,250, 44,119,209,145,246, 8, 75, 49, 1,232,130,173,201, 59, + 47,180,111, 60, 3, 87, 15,116, 12,172, 81,255,243,224,141,251, 70,138, 98,138,212,232,172,140,130, 81, 48,152,193,203,151, 47, +245,245,245, 95,189,249,242,244,249,123, 96, 22, 98,102,102,123,253,241,235,199,143, 31,129,121,228,255,191,127,191,126,255,254, +248,241,195,231,207,159,129,249,254,251,143, 31,192,124, 42, 33, 33,241,227,227,199,111,223,190, 95, 4,157, 76,240, 15, 54,150, +128, 24,147, 1,143, 3,128,134, 22,126,252,248, 34, 33,165, 40, 38,204, 35, 44,196,141,213,106,128, 0, 66,239,173,191, 60,180, +224,207,201,137, 12,255, 32, 43,220, 33,197, 27,104,180,244,175,156,155, 88,244, 28, 96,225, 14, 20,229, 21,151,255,197, 33,245, + 31, 54, 38, 2, 65, 95,143, 76,250,243, 21,218,166,182, 53, 80, 61,213,145,232,169, 37, 3,175, 61,216,153, 24,189,180,165,142, + 53,197,120, 90,131,202,196, 63,191,127,125,221,223,199,240,255, 47,204, 2, 72,241,252,159, 83,198, 16,179,237,188,247,214,139, +196,158,149,151,110, 62,124,243,246,253,131,199,207, 87,237, 62, 21, 63,105, 19,216,175, 32, 55, 70,218,106,163,119, 24, 21,164, +189, 97,213,233,143,127,255,131, 58, 86,158,191, 5, 90,244,242,249,243,151,229,187, 78,250,117,175, 83,205,158, 90,191,112,199, +147, 23,111, 17, 21,195,255,255, 4, 74, 85,112,208, 70, 59, 27,253,135, 41, 78,152,190,109,238,182, 19, 79,158,189,124,253,230, +221,181,219,143,178, 38,173, 93, 9, 94, 90, 3, 51,232,191,136,176, 64,164,133, 26,196,224, 59,111,190,164, 78, 88,243,238, 3, +104,104,239,251,143,159,107,247,157,241,237, 92,163, 95, 52,171,125,217, 30, 32, 23,110,193,255,255, 12,148, 15, 93, 0, 93, 56, +105,199,121,248, 70,211,120,107,101, 96, 25,202,198,198, 70,204,170,115,200,106,200,240,137,208, 73,212, 96, 99,185, 20, 59,117, + 72,225,206, 10,222, 27,133,169, 5, 40, 56, 53, 1,209, 67, 90,125,250,190, 81,205, 26,143,142,141,110,109,235,185, 19,166, 85, + 44, 63,134,172, 88, 67,146, 15, 50,193, 43,157, 61, 55,106,242,246,251,164,204, 80,141,130, 81,128, 6,192, 43,226,159, 32,139, + 0,185,120,166, 97, 49, 1,169,234,201, 3,146, 82, 82,191,126,255,125,241,226, 3,164,125, 4,204,134,108,236,188,215,174,223, +184,116,233,226,181,235,215, 95,189,122, 5, 44,180, 5, 4, 4, 21, 20, 21,245,244,244,116,116,116,128, 69,191,136,136,200,250, +205,187,158, 60,127,135,220,108,135,150, 44,160, 85,241,160,124,247,224,238, 53,126, 65, 81, 96, 13,161,173, 38,197,198,138,125, +236, 1, 32,128, 80, 68,191,191,123,241,251,244, 12, 70,212,145, 98,208, 57, 55,166, 89, 98, 86, 49,200,135,133,177,235, 71,254, + 61,209,131, 58,200,244,250,213,186, 98,225,192, 62,118, 30, 80,211, 88, 89, 86,124, 83, 99,194,155,119, 31, 30, 61,127, 11, 44, + 24,164,197, 5,132, 4, 5, 16, 29,150,125, 83, 24, 95,157,249,143,122, 49,200, 31, 14, 9, 14, 73, 21,228,178, 6,194, 96,101, +100, 88,120,236, 38, 16, 97,186, 62,220, 72,222,217, 76, 7,101,244, 29, 76,205,202, 13,180,175,154,127, 27,178,230,250,254,107, +163,138,133,138,188,108,239,190,255,249, 4, 90, 93,196,240,245,247,191,230,141,167, 36,249, 57, 51, 2,236, 49,122, 11, 56,134, +103,192, 64, 75, 65,162,208, 85,191,127,247, 69,160,216,135, 31,127,210,231,238, 70, 87,139,218,192,237, 77,241,186,252,232,245, + 25,240,232,243,252, 35,215,151, 29,187, 33,201,205,250,246,251,159,207, 64,103,128,173,235,218,124,202, 65, 87,193, 82, 87,133, +129,129,129,129, 74,163,210,247, 95,125,108,219,112, 26,194,214,148,228, 47,112,213,130, 44, 72, 39,166,241,254,225,235, 15, 96, +195, 31,178, 96,198, 92, 73,180, 59,204, 20,168, 23,190, 31, 21,215, 33, 71, 70, 74, 18,147, 98,173,107,214,156,250, 4, 30,148, +251,244,253,215,177,219, 47,176,154,175, 37, 41, 48,186,121,117, 20, 80, 11, 96,158, 28, 0,228, 54, 84,248, 17,127, 86, 12,169, +234,201, 3, 76,140, 76,175,223,124,254, 7, 89,120,248,159,225,247,239, 95, 15,239,223,150,150, 18, 51, 52, 52, 70, 62, 28, 23, + 88, 0, 0,123,222,191,255,252, 21, 19,151,254,248,225, 29, 23,183,216,211,151, 47, 4,133,196, 64,197, 57,120, 44,133,145,137, + 9, 88,154,255,249,243,235,215,207, 31, 31, 63,189, 19, 16, 18,227,230,226, 85, 83, 6,205,115,224,178, 26, 32,128, 80,202,247, +191,239, 30, 50,252,251,245, 31,105,133,251, 95, 78, 9,110,231,106, 97, 77,244, 19, 25, 5,205,130, 95, 94, 88,204,244,253, 37, +114,177,198,248,234,252,235,249, 65,188, 78,149,252,218,206, 16,113, 17, 33, 1, 32, 66,214,248,227,211,251, 55, 59,218,153, 31, +237,193, 44, 68, 89,212, 60, 89, 88,177, 12, 61, 79, 12,183,108,217,118,254, 25, 98,200, 27, 90, 14, 38,152, 41, 77,206, 11, 65, + 8,254, 71,108,112,149, 20, 21, 60,209,157, 86, 50,119,235,242, 99, 55,127,128, 71, 72,238,127,250, 9,113, 37, 27, 35,163,171, +150, 84, 85,160,149,149,145, 22,102, 9,142,165,108, 71, 93, 10,212,150,228, 9, 36,167,236,185,248,251, 63,202,106, 37,113, 46, +214,106,111,131,188,213,167,145,117,243,241,114,239,106,138,175, 91,178,123,222,129,171,223,254,252,253,249,247,255,131, 79,136, +198,130,189,146, 72, 71,162,187,169,150, 50,102, 71,129,194,145, 25,248,105, 48,157, 33, 70,144, 13, 71,196, 52,222,129,122,193, +167,149,189,133, 84, 12,211, 99,205,129,101, 58,164, 98, 0,181, 24,254,253, 67, 41,223,193, 34, 64, 0,153,179,141,179,211,178, + 82, 17,239,220,114, 30,216,126, 71, 54, 51,200, 8,116, 56,198,186,115,208, 21,177,102, 74, 34, 16, 51, 71,203,166, 17, 61, 94, +241,234, 19,228,164, 1,200, 98, 21,200, 82, 69, 30, 46,118, 76, 65, 6,240,249, 48,192,242, 23,216,202,126,249,250, 19, 68, 22, +162, 12,185, 13, 14,209,142,124, 4, 13,228,240, 0, 9, 81, 62,200,204, 45, 15, 15, 59,164,165,239,230,168,197,195,205, 14, 95, +202, 9,239, 7,236, 2,111,243, 6, 90, 4, 52, 25, 40, 11,153,116,133, 76,243,194,101,225, 75,239,225,178, 47, 96,135, 49, 0, +165, 32, 19,203, 88,253,251,230,205, 27, 6,102,126, 72, 41,194,196,204,252,240,225, 61,208,230, 31, 37,141,127,255, 25,191,255, +248,253,253,251,111,160, 83,191,125,255,249,243,247,223, 31,223,126,255,250,253, 7, 40,203,202,244, 69, 70,130,253,205,123,198, + 15,239,223, 8, 9,139, 3,115,219, 79, 96,153,254,225,205,183, 47, 95, 56,184,184,120,120,249,197,197,101,128, 57, 73, 72,128, + 75, 79, 3, 95,229, 4, 16, 64, 40,231, 3,255,252,252,254,245, 76, 55,134,255,127, 33, 69,246, 31, 65, 29,209,208, 9, 92,252, + 66, 88,117,190, 62, 56,235,247,233,153,216, 77,213,138, 20,115,205,103,193,200,198,159, 31,223,248,176,169,132,249, 59,150,221, +101,255, 25, 89,249,227, 55,240,136, 72,194, 82,192,219, 75,183,160,133,130, 9,120, 37, 98,203,146, 93, 59,207,221,189,246,225, +135, 40, 59,179,129,140, 96,158,183,185,183, 3,226, 98,144, 99,103,174,124, 5, 47,194,147, 20, 19,210, 81, 87,128,139,127,252, +244,121,213,254, 11,155, 79, 94,123,243,241, 43, 59, 43,139,154,180,112,166,151,185,129, 54,162,151,240,254,195,167, 51, 87,238, +192, 44, 82, 65, 91, 99,116,233,198,253,151,111, 62, 64,216, 14,230, 58,240,130,233,212,149,187,141, 75,119, 95,120,244,238,203, +239,127,178, 60,108,182, 90,210, 13,241, 30,252,188, 60,135,207, 64, 15, 3, 80, 83,144,146,151, 65, 44,251,121,250,252,213,188, + 61,231,143, 94,190,243,225,243, 79,110, 78, 22, 85, 41,145,120, 39, 3, 75, 68, 5,195,240,250,237,251, 11,215, 31, 64, 42, 18, + 75, 67, 13, 30,110,114,206, 89, 3, 70,229,196,237,231,202,151, 29,133,112,115,157, 53,138, 61,116, 57,193, 0,190,161, 20,143, +222,148,153,187,225,115,170,144,115, 40,129,237, 14, 70, 80,107,155, 9,122, 16,197,255,255, 71,111,189,128, 43, 16,224,102,215, +151, 19,237,138,182,129,140,219,252, 1,181, 43, 64,135, 74, 30,190,249,236, 31,120,208,208, 66, 89, 20,216,162,183,237,216, 6, +105,215, 75, 11,112, 29,174,244,228,230,230, 22, 16, 16, 96,143,153, 4, 20,153,154,228,244, 1,220, 59, 86, 20,227,115,210,145, + 19, 36,125,219,200, 40, 24,138, 0, 88,248, 46, 94,121,124,241,204,228,158,201,187,128,220,146, 92,183,216,244,185,177,225,150, + 88, 5,167,207, 59,208,211, 18, 10, 44, 85,215,111, 62, 7,145,229,230,102,207, 76,178,135,148,236,144, 83,198,128,101,235,186, +205,231, 50,147, 28,128,138,129,237,241,245, 91,206,127,249,250, 3, 40,190,107,223, 85,136, 9,192,146, 55,208,215, 8,104,130, +149,185,138, 21,248,164, 1, 55, 39,109,176, 75,174,150,230,186, 3, 21, 0, 21, 67,182,161,206,232,139,201, 40, 90, 2, 89,142, + 9, 57,103, 6,178,206, 18,168, 0,104, 5, 80,113,247,228,157, 16, 89, 57, 25,161,205, 59, 46,194,205,193,211, 15, 56,121,242, + 20, 7,143,248,255,127,204,192, 76, 4, 44,191,207,156, 62,166,111, 96, 34, 46, 46,252,245,235,143,103, 47, 63,253, 71,190,234, + 14,214,178,230,225,229, 22,230,251,253,244,217,203,243,151, 31,177,176,176,255,250, 5,108,166,254,231, 23, 16,226,229, 19, 98, +102, 98, 6,182,171,128, 25,154,131,141,213,204, 80, 65, 74, 66, 0, 79, 80, 3, 4, 16, 74,251,157,157, 87,144,211,177,234,243, +225,105, 76,127,127, 50,202, 89,138,123, 84,114,240,226,212, 44, 96, 18,246,226,194, 50,166, 95,159, 48,199, 37, 24,174, 45,123, +126,119, 55,171,162, 13,155,164, 54, 7,175,224,207,175,159,126,189,123,250,251,217, 69,134, 87, 23,153,192,253, 3, 44,229,139, +178, 7,188,112, 7,215,222,194,174, 98, 40,151, 78,245,230,132,244,226,246,134,149, 9,246,213, 41,252,124,188,169,254,182, 64, +132, 75, 35,176, 64,119,181, 49,194, 37,171,167,161,136, 85,220, 76, 71,121,107, 59,150,235, 59, 92,109, 12,177,170,151,150, 20, +171,141,117,103, 96,112,199,101,145,168,176,160,171,141, 32, 21, 71,102,164, 5,185,146,108, 84,137,111,188, 3,203,110,120,225, + 14, 4,104,251, 84, 49, 1, 92, 1,176, 76,103,103,103,135,180,202,129,182, 0, 73, 23, 61, 69,248, 34,200,169,251,207,127,130, +173,164, 10, 50, 2,157, 23,143,188, 8, 39,123, 30,226,216, 3, 96,225,190,173, 34,208, 8,247, 26,231, 81, 48,108, 0,176, 28, +156, 62,239, 39,176, 37,126,241,202, 99, 96,235, 24,178,171, 8,151, 32,168, 33,127,239, 53,228, 24,175, 99, 39, 65, 71,190,184, + 57,162, 76,185, 65,118,177,130,100,193,103, 6, 64,206,147, 1,150,245,144, 45, 72, 16,193,146, 92,119, 72,225,123, 9,124, 70, + 24,176, 80,134,212, 16,192,114,249,197,107, 80, 9,230,234, 8, 57,208,230, 49,228, 24, 50,200,241, 9, 16,211,128, 77,117, 96, +161, 15,105,200, 31, 67,146, 5,214, 52,200,230,224,241,175,168,168,200,197, 43,183,132,132, 37,184, 56,121, 46, 92, 56, 37, 42, + 46, 33, 40,200, 15,204, 46, 47,223,124, 70, 44,161,102, 68,218, 75,244,159,225,203,231,175,255,255,177,242,114,177,187, 59,155, + 95,184,254, 28,216,254,101, 98, 98,129,172,127, 23,224,231,144, 20,227, 23, 23,229, 3,221,142,198, 65,160, 43, 12, 16, 64,232, +163,242,194,198,129, 64, 68, 76, 36,177,114, 3,139,198,250,207, 91,139,145, 7,175,225,229, 60,211,143,215,127,175,175,255, 14, + 68,216,135,166, 81, 6, 61,254,114,203, 74,122,148,142,166,123,120, 81, 75,198, 8, 53,250,200, 76,176,145, 48, 31, 23,242, 81, + 48, 4, 45, 37,207,169,144,253,168,144, 42, 4,178,133, 10,190,131,233,194,131, 87, 61,219,161,167,146,241,113,176, 38,217,170, + 65,150,241,192,181, 7,155,171,166, 56,234,188,255,250, 99,206,254, 43,251,174, 60,246,234, 88,127,189, 47, 97,180, 21, 63,236, + 1,100,221,225,174,253,215, 32, 7, 15,172,219,114, 30, 34,130, 85, 16,200,125,249, 26, 84,232,199, 70,128, 78,242, 2, 29,197, +158, 43,131,213, 76,200,192, 14,100,232, 6, 82, 16, 51,128, 23,167,163, 29,255, 11, 44,166,209,206, 66, 0, 2,200, 81, 54, 18, + 98,252,144, 37,237,240, 19, 8, 32,171,239,161,235, 38,193,187,100,225,178, 88,205,193, 10,100,101,101,127,253,229,184,118,245, +198,171,127,207,127,254,252,161, 32,175, 36, 42,204,115,245,230,115,240, 97, 3,168, 7,206,254,135,174,147, 97, 98, 98,124,246, +236,133, 32, 63,135,169,169,226,175, 63, 44,119, 31,188,226,226,102,147,149, 20,146,149, 18, 20, 18,224,102, 98, 34,182,124, 0, + 8, 32,138,246, 73,242,107, 57,254,120, 91,240,251,248, 4, 44,101, 54,142,162, 28, 19,252,229, 16, 19, 14,154,200,202,201, 51, +154,238,207,220,123,121,239,229,135, 16,115, 85, 6, 18,111,166,134,172,153,129,159, 5,159, 96,165,108,173, 38, 1,159, 23, 37, +210,168,143,115,210,126,252,248, 1,108,143,195,199,217,209, 52, 2,203,113,197,178, 53, 16,246,194, 68, 75,160, 21, 64,243,145, +231, 75, 33, 39,225, 64,220,243,254,203,247,232,105,136,249,231, 28,103,117, 33, 94, 78,180, 69, 56,192,194,221, 9,156,153,129, + 5,189, 70,209, 66, 96,255, 99,238,190, 43, 37,190,198,163, 41, 97, 4, 52,225,101, 33, 35, 42, 12,160,163, 34,143, 91,129,207, + 17,195, 42, 8, 44,175,167,207, 59, 0,108, 41, 91,155,129,206, 35,131, 20,250,144, 1,119,148,161, 84,240,153, 1,144,193,125, + 32, 9, 63,176, 23,216,228,199,172, 9,224,135, 25, 48,192, 78, 71, 40,201,117,227,225,102, 71,190, 54, 4, 50,208, 47, 1, 61, +192,242, 9,208, 52,184, 21, 16, 0, 57,168, 0,110, 14,190,166, 48, 43,171,152, 8,255, 95, 77, 45, 96,129, 46, 32, 40,242,251, +215,215,231,175,216,190,125,255,133, 35, 47,131,182, 85,190,126,253,226,231,207,239, 2, 2, 34,215,110,189,208,211,146, 86, 83, + 18,227,230, 2,118,196, 73, 62,217, 27, 32,128, 40,221, 7, 47,110, 27,247,142,139,239,203,190, 54,198,255,191,201,208,254, 87, +212, 68,196,179,138, 71, 66,113,152, 53,192,241, 11, 2,203, 65, 76, 53, 64,145, 59,207,223,223,123,245, 17,178, 63, 8,178, 52, + 5,162, 12, 82,128,162,221,106,141, 92,248,162,141,204,228,131,215,204,224, 42,220,145, 79, 8,128,159, 72, 3,180, 17,216,178, +230, 0,246,247, 88, 89,129,229, 56,174, 46, 2,156,205,196,204, 4, 63, 10, 24,168, 17,243,162,237,212,217,123, 31,189,129,238, +169,211,148,228, 75,182, 85,195,223,153, 0,150,245,213, 43,143,238,189,250,104,180,124, 31, 9, 0,210,202,134,140,129, 64, 14, +236,197, 37, 8, 41,166,245,181,101, 32, 37, 59,228,148,130,197, 43, 78,232,129,231, 66,129,236,140,162, 37, 12,224,115, 8, 50, +147,236,119,237,187, 10, 84, 3,108,233, 67,198,229,239,222,127,133,124, 54, 25, 4,184, 57,105, 53,180,111, 2, 86, 21,144,114, + 25, 98,102,102,209, 18, 32, 9,233, 37, 64,148, 29, 61,117, 23,114,191, 7,176,106,233,153,188, 19,210, 63,136,141,176,128, 15, +197,184, 58,106, 1,197,225,230,224, 7, 66,130,220,252,124,156, 31, 62,126, 23,228,231,186,119,239,246,187,167,127,153,153, 89, + 33, 87, 53, 65, 14,147, 1, 45,127,100, 2,173, 90, 4,102,197,143, 31,222,254,249,245, 75, 86, 86,249,255,255,127,210,146,252, +236,108, 44,236,108,100, 22,212, 0, 1,196, 72,149,205,226, 95,158, 92,123,191,163,233,255,219,155, 36, 20,130,236,130, 92,182, + 69,162,198, 62,195,111,116, 37,125,246, 30, 39,109,217, 16,115,149, 53, 39,239,236,189,250,120, 90,162,195,218, 83,119,102,239, +187, 42,200,205,158,226,168, 5,148,242,234,220,164, 32,202,123,255,245,167,169,137, 14,235, 78,221,221,123,245,137,146, 24, 31, +144,237,217,185,209, 80, 94,180, 57, 20,180,112,165,103,235,249,125, 87, 30, 43,138,241,181,132, 89, 10,241,112,120,118,108, 4, +178,129,165,127,176,153, 74,170,147, 14,100, 48, 4, 82,170, 2,139, 93,183,182,117,240,198,251,180,104, 51,111, 67, 5, 46, 46, + 46,200,142, 83,204,146,183,116,201,225, 41,187, 46,242,115,177,181,133, 89,196,218,106,194,239,101,133, 44,146,193,147, 30,254, +252,249,195,159, 50, 11,194, 94,154,106,235,164, 43,207,201,201,137,214,132,103,192,152,170,229,227, 96, 93,146,106, 99,168, 40, + 14,113, 18,164,202,129,204,175,110,175, 8,116,130,101,191,158,205,103,129,229, 59,144, 11, 20, 28, 45,254,134, 61, 64,190,244, + 14,178, 34, 5,222,124, 70, 19, 68,102, 67,154,237,240,246, 59, 55, 80,228,254,107, 30, 30,118,200, 49, 3,144,133, 49,240, 3, + 18, 94,188,250, 4, 57,174, 0, 89, 16,190, 68, 7,114,240, 0,232,100, 2,152,201, 64, 67, 32, 11,102, 32,234,129, 21, 6,124, +161, 14, 68, 22,205, 10, 72, 27,255, 5,184,187, 0,172, 78,122, 90, 66,145, 87,245,224, 1,111,223,127, 93,191,105, 31, 63,191, + 48, 47,191, 0, 98,204, 29, 52,236, 14, 26,237,124,255,246,205,207,159, 63,164,164,229,153,153,153, 52, 85, 37,100,165, 41,154, +150, 3, 8, 32, 22,170,196, 22,143,140, 22, 71,252,226,183,251,166,253,188,180,148,225, 31,225,134,252, 95, 9,107, 49,223, 58, +110,161,225, 57,153,102,164, 32, 90,181,226,168,159,161, 28,144, 44,242, 50,216,117,241, 65,230,220,253, 19, 99,109, 30,188,254, + 20, 57,121,231,165,246, 48, 96,161,159, 96,167,209, 16,104,114,251,217,187,234, 85,199, 55, 21,129,246,253,254,254,253, 91, 65, +132,247,220,253, 87,192, 56,238,221,122,126,222,193,235,147,226,108,215,157,190, 27, 57,121,251,150, 18, 31,160,150, 66, 89,125, +127, 67,249,236,249, 7,244,100,133,204, 84, 64,115,209,144,193,110,228,145, 25, 13, 9, 62, 62, 78,182,147,247,222, 64,155,213, + 76,140,200,103, 7, 1,203,244, 45,231, 31, 0, 11,119,208,104,204,183, 95,217, 11, 14, 73, 9,112, 58,233,200,195, 87,199, 19, +127,181, 19,104,101, 13,120,180, 29,179,112,159,184,237, 28,242, 84,109,149,183,142,190,188, 40,100,135, 20,158,197,239,247, 95, +131, 38,108,149, 70,183,179,142, 12,128,188,167, 31,206,192, 42,200, 64,196,209, 2,152, 42,145, 15, 72, 64, 17, 68,149,197,122, +240, 0, 68, 16,232, 24,113,212,222, 6,154,105,192,130, 30,216,201,144, 16,227, 7,246, 18,128,109,124, 34, 11,119, 80, 91, 94, +128,203,193,206,226,192,161,147, 31, 62,188, 97, 2, 93,195,196, 4,110, 84,253,251,253,251,215,207, 31, 63, 69, 68,196,100,100, + 65, 43, 20,212,148,197,100,164, 4, 40, 12,103,128, 0, 98,161, 86,132,177,176,178,138,187,231,255,176,140,251,113,239,232,183, +219, 7,126, 60,189,204,252,243, 37, 74,203,145,137,227, 47,143, 12,167,188, 25,151,186, 11,175,188, 30, 51, 11,203,112, 77,187, +201,142,218,149, 43,143,245,108, 57,247,254,235,207, 88, 43,149,137, 59, 47, 3, 5,231, 29, 4, 45,157,252,240,237,231,153,187, +160, 96,241, 51,144, 3, 22,211,192,242,174,208, 83, 63,111,209,225, 4, 59,117,123, 13, 73,121, 17, 30,200,248, 12,184, 2, 80, +183, 83,151, 0, 54,153, 3, 39,238, 4, 22,253, 64, 45,118,234,226,118,234,146,249, 75,142,190,253,244, 13, 40, 14,212, 11,185, + 30, 15, 62, 50, 3, 4, 55, 94,124,138,153,115, 4,151,195,172, 85, 37,208, 26,231,135,174, 63,181, 85,151,162,214,157,121, 64, +247, 20, 47, 62,136,124,211, 83, 71,176, 97,184,185, 50,100, 7, 44,158,101, 60,192,128, 90,123, 18,116, 80,132,161,194,232,250, +153, 81, 48, 52, 0,176,160,135, 76, 21,192, 15, 53, 35,182,109,196,200,168,162, 40,250,243,151,241,227,103,111,255, 34, 93,149, + 1,105, 50, 1, 51, 17, 48,151,168,169, 72, 40,200, 10, 83,238, 72,128, 0,162,114, 33,203,193, 39,200, 97,224, 35, 96, 0, 26, +117,249,246,233,195,239,207,239, 25,254,252, 96, 96,102,101, 96, 97, 99,231, 19,230,224,226, 30, 9, 17, 15,140,191, 98, 47,131, +218,213, 39,235, 2,140,129,133, 53,176,213, 44,192,197,214, 27, 97,193,203,193,242,233,251,111, 5, 81,208, 5,217,144, 19,131, +128, 42,147,236, 53,227,172, 85, 13,107,214,232,203, 10, 65,175,144,253,255, 31,216,144, 63,255,224, 13,176, 14, 63,255,240, 13, +144, 13,153,240,252, 7,187, 18,235, 63,248,238, 83,160, 44, 48, 57, 32,175,153, 33,220,109,250,247, 87, 22,245,156, 10, 41,126, + 14,106, 29,232, 8, 52, 36,180,127,203,102,164, 59, 90, 33,133, 59, 7, 7, 7,174,194,189,122,229,209,224,251,170,239,191,253, +152,187,239, 10,176,136,119,210,145, 77,113,210, 25, 45, 56, 70,193, 16, 42,226,201,214,171,174, 44,206,204,196,248,248,197,123, +134,127,136, 33, 26, 96, 59,139,139,131, 77, 78, 90, 8,207,150, 84,146, 0, 64, 0,209,176, 17,205,197, 39,192,192, 39, 48,210, +162, 28, 50, 87,153,226,168, 51,247,192,181, 68, 59, 13, 96,211, 56,217, 65,235,193,155,207, 38, 13,160, 91,144,234, 3,141, 11, +220,245, 64, 67, 43,160,177, 13,230, 71,239,190,218, 54,175,255,240,245,167,131,166,148,190,156,200,197,199,160,227, 38,128,218, +155, 66,204,226,102,236, 21,204,152, 15, 44,220,231,167, 57, 66, 90,214,144,241, 16,176, 21,208,130,242,192,181,199,240,145, 25, +226,202, 96,134, 90, 95,131,171, 79, 63, 92,123, 6,218,180, 21,100, 36, 23,102,166, 68, 94,179,157, 25,118, 66, 36, 50,168,244, + 55, 1,118, 8, 62,126,255,165, 37,197, 15, 57,117, 18,210,114,199, 58,211,171, 40,198, 15,236,124, 0,139,120, 8, 23, 88,178, +183,132, 91,143, 22, 25,163, 96,132, 0, 96,131, 71, 67, 85, 2,136,104,106, 11, 64, 0, 49,142, 30,198, 77,117, 0, 89, 21,254, +231,207, 31,248, 73,185, 64,145,223,191,127, 3, 91,202,200, 55, 28, 65, 70, 69, 32,135,130, 66, 90,232,240,101, 51,240,217, 78, +136, 22,204, 75,151,128,122, 33, 11,201,129,122,127,254,252,249,235,215, 47, 32,131,112,161, 12, 6, 64,163,142,220,124,206,195, +206,162, 45, 45,128,118, 29, 54,129,230,255,223,191, 64, 95,124,255,254, 29,226, 47,184, 70,248,242, 30,160,248,153, 59,207,222, +124,252,106,166, 40, 12, 20,132,223,197,138, 89,184,239,187,242,216, 80, 81, 76,144,155,125, 31,120,109, 50,132, 61,154,114, 70, +193, 40,160, 46, 0, 8,160,209,242,157, 38, 0, 82, 52, 67,118, 42,161, 45, 77,129, 23,214, 88,165, 48,197,145, 75,124,228,149, +230,144,230,243, 95, 24,192,181,168, 17,185, 99, 1,215, 5,183, 17,178,161,148,200, 53,242,240,122, 11, 82,235, 96, 94, 24, 2, +113, 9,176, 14, 0,143, 33, 50,193, 21,140, 30, 40, 54, 10, 70,193,128, 0,128, 0, 26, 45,223,105,216,138, 71,227, 98, 93,192, +142, 75, 28, 89, 10,235,193,235,200,106,136,140, 68,100, 93,200,245, 4,241,229, 47,164,214, 65,174, 48,208, 22,207,192, 21, 32, + 87, 39,163, 96, 20,140,130, 1, 1, 0, 1, 52, 90,190,143,130, 81, 48, 10, 70,193,240, 4, 0, 1, 52,218,188, 26, 5,163, 96, + 20,140,130,225, 9, 0, 2,104,180,124, 31, 5,163, 96, 20,140,130,225, 9, 0, 2,104,180,124, 31, 5,163, 96, 20,140,130,225, + 9, 0, 2,104,180,124, 31, 5,163, 96, 20,140,130,225, 9, 0, 2,176,118,117,185, 81, 3, 49,216, 30,207, 18,170, 5,212, 10, +169, 21,143, 32,245, 14,125,230, 0,189,112, 37, 94, 56, 70, 15, 0,136, 7,170,182,187,219,204,159,241, 79, 38,100,187,162,170, +160, 43,237, 36,217, 76, 60,182, 99, 71, 43,229,179, 63, 60,130,184,131, 34,227,139, 73,236, 13, 79,172, 79, 61, 70,116,238,192, +233,204, 64,171, 92,138,182,170,103,116,144, 69,152,198, 16, 34, 89,133,110,144, 81,113,117, 72,198, 29, 20,208, 80, 30,204,197, + 56,248,184, 42,121,105, 51,126,216,137,247,196,155,243, 40, 12,132, 41, 0,171, 16, 64, 17, 64,186, 3, 1, 35, 16, 80, 99,196, + 72, 42, 75, 17,123,100,156,124, 50, 65,103,129,108, 84, 31, 60,232,170,220,170,204,171,167,239, 78, 55,233,254,110,187,113,203, +188, 89, 68,183,150,112,223,106,134,246,241,236,211,245,183,107, 81,186, 40,161, 98,105,162,179, 72,242,162, 83,232, 96, 23, 57, + 68, 39,236, 82, 3,187, 13,202,138, 30, 99,248,112, 78,119,219,180, 25,121,147,218, 46,215, 84, 91, 46,106,175,152, 72,204, 39, +235,183,151,159, 47,190, 92,125,221, 53, 24, 83,189,125,216, 61,196,154,153,115,196, 55,235, 33,138,189,226,113, 22,205, 40,106, + 37, 20,203,181,165, 86, 46, 44,102,138,225,226, 25,113,132, 58,215,216,153, 0,104,155, 83, 74,109,252,249, 75,238, 73,201, 6, +182,212, 47,203, 96,184,204,102,116,188, 78, 51,179,124, 29,255,103,159, 23,244,183,143,222,215, 15, 52, 52, 46,185,213,167,195, + 70,214, 56,162,215,153,115,237, 51,249,185,241, 54,235, 0,199,195,241,205,120,115, 8, 6,250, 55, 8,129,214,160, 65, 72, 45, +191,162,213,201,250,253,143,219,239, 97,177,104, 95, 5,177,155,223, 99,128, 23, 5,137, 80,159,161, 63,238,217,130,143,246,157, +248, 65, 66,248,105,142, 96,152,243, 97, 95, 60,130,135, 53, 31, 56, 13,231,197, 28, 5, 21, 44, 97, 17,189, 9, 57, 30,222,160, +229,255, 65,203, 74,191,208, 56,190,230, 92, 6,182,250, 59,196, 37,222,215, 55, 62,103, 74,106, 50,244,172, 12, 81, 75, 57,104, +165, 99, 92, 53, 6, 57,200, 37, 23, 5,226,230, 36,225, 88,242,152,114,105,169,214,162,197, 34, 77,211,223, 82,106,246,183,168, +197, 11,213,252,199, 26,105, 24,235,104,247,198,147,174,233, 51,192,163,121,114, 87,235,121,140,122,214,159, 82,220,108,194,244, +124,233,180,159, 83,168,203,218,248,151, 56,255,159, 15,239, 71, 41,190,156,240,223, 2,176,118,110, 75, 13,194, 64, 24,206, 38, + 80, 28,171,118,250, 2,190,255,147, 57,163,142,227,133, 83, 75,115, 90,255, 93, 18, 74, 75,209,206, 88, 46, 40, 16,200, 97,249, +247,219,189,160, 9,253,135,236, 60,233,213,104,108, 82, 67,147,169,175,180,194, 93, 72,161,165,142,170, 2, 42,220,141, 98, 93, + 87,136, 0,104,157,252, 31, 70,192, 11, 16, 43,241,137, 81, 24, 66, 0,173, 99, 20,246,224, 21,229, 20, 81, 31,212,128, 82,202, + 42, 49,224,207, 8,181,208, 8,184, 38, 44,155,240,189,149,182,219, 86,181,171,215,165,222, 1,113, 26, 12, 80,224, 12,201, 20, + 0, 84,230,239, 29, 17,150,178, 60,139, 95,185, 63, 95,178,188,204,235, 73, 69, 38,145, 19, 20,235, 67, 64, 69,208, 99, 22, 68, + 2,173,232,116,226, 34,139,211, 21, 93,105,178,119, 26,163,156,217, 62,211,235,103,191,243,236,115, 62, 64,234,153,129,239, 28, + 48, 78,240, 66,166, 37,216,108, 31, 95,222, 63,208, 99,234,236,125,231, 54,235,110,187,110,159, 30,220, 93,135, 16, 97,124, 32, +223,219, 94, 72, 45, 54,110,156, 4,170,148, 2, 6,192,232, 79,150,136, 2, 21,247,112,161, 52,124, 2, 79,251,232,251,183,175, +126,239,163,196,146,196,202,119,253, 74,158,107, 72, 67,211, 48,110,162, 99,112,187,192,247, 51,162,241,140,194,127, 82,158,174, +230, 50, 45, 67,156,110,193,247,185,167,141, 8,113,199,197,118,104,121, 32, 60, 26,132, 23,140,112, 10,119, 90,228,175,113,116, +197, 32,146,248,215,244, 54,156, 54,116,129,236,133,134,213, 99,225, 33,195, 26,196, 86,207,240, 90,157, 93,118,121,107, 42,212, + 37, 26,216,226,194,234, 63, 36,233,142, 29,115,183, 66, 3, 58, 18, 64,211, 43, 12,166, 65,246,230, 90,193, 58,152,174,219, 10, + 7,174, 89, 9,248,187,149, 63,236, 3, 92, 40, 69, 15,182,131,238,201, 11,241,113, 1,186,132, 56, 37, 91,154,142,180,228,102, + 53,202,202, 78,230,242,224, 84,242, 41, 26,248,206,195,113,214,228,112, 84, 47,188,181,165,118,119,248, 38,241, 9,181,131, 46, +170, 84,253,244, 28,241,191,164, 50, 75, 18,181,179, 48, 57,215, 36,223, 40, 41, 57,219,126, 4,160,237,220,118, 26,134, 97, 48, +156,184,105, 83,177,131,232, 5, 66, 92,243,254, 79, 6, 98,130,110,154,122, 72,130,255, 56,233, 10,107, 39, 16, 66,218,197, 84, + 45,135,214,246,239,207,213,146,252, 21,219,217, 84,181,177,167,225,180, 32,238,121,103, 99,104,172, 28,255, 45, 87, 96, 10,124, +242, 98, 77,108, 38,110,224, 22, 34,238, 44,236,134, 10, 83,178, 7, 84,112, 6, 0, 61,126, 82,176,166,195,137,148,143, 89,212, + 48,201, 23, 49,101, 4,201,182, 42,253,215,154,104,174, 43,115,228,242, 74,101, 68,167,171, 32,166, 64, 62, 60,222, 63,189,126, +188,184, 68, 96,194,233, 82, 65,120, 71,112,124,246, 86,145,120, 44,225,145, 94, 80, 50,100,227,121, 60, 1,158,152, 74,206,205, +169, 3,218,170,226, 61, 11,255,198,201, 94,104, 63,133,120,226,119, 28,195, 5,241, 24,180, 9,106, 95,133, 65,171, 55, 66, 63, + 60,186,119,166,170,194, 30,123,236,114,195,241,225,185,225,135,198,153,163,180,106,119,103,202,170,176, 6,185,139,251,223,240, + 36,119, 60,175,146,123,236, 58,125, 60,135,177,119,231,142,120, 94, 76, 41,133,143,131,104,178,200,154,206,143,204,204,170,227, +124,100, 98,202, 35, 60,227,152,203, 28,168,230,162, 8,114,176,140, 14,203,142,167,167,147,200,245,140, 71,154,186,105,187,150, +107,135,219, 94,100,169, 30,124, 55,193,209, 34,155,223, 22,247,201,164,187,114,219, 70,111,100,235,140, 49, 27,253,234,101, 37, +203,139,251,202,220,122,125,196, 92,152,174,189,247, 20, 6,196,247,123,219, 28,186, 67,248,129,184,235,217,104,107,226,190,198, +119, 48, 92,106,229, 99, 56, 20,122, 25,219,167,101,114,177,194,206,122,159, 45, 75, 87, 18,147,162, 40,233, 52,197,229,107,178, +240, 46,234, 60,201,201, 46, 42,209, 28,193,143,229,142, 40, 37,185,132,240, 74,170,115,217,120,212,144, 41, 89, 91,203,170, 42, +107, 44,115,198, 14,163, 21,123,240,102,179,109,143,239,131, 97, 97,239,209,206,139,226, 2,145,208,153,193,161,238, 58,248,121, +137, 50, 9, 60,230, 30,221,136, 99,153,163,210, 33,216,124,134,247,132,229,144, 36,230,125, 47, 83,243, 88, 61,206,225, 21,175, + 88, 99,185,117,239,122, 21,146,168,128,132,228,236,225,216, 46,247, 17, 46,217,113, 93,217,233, 10,204,191,185, 83,248, 31,102, +159,143,242, 41, 0,105, 87,215,219, 32, 12, 3, 99,135, 16,232,180, 73,235,255,255,131,211, 94,214,170, 27,133, 66,178,179, 29, + 88, 87, 86, 52,109,111,124, 4, 2,137,115,190, 59, 41,201,127,241, 29, 67,247,253, 50,206,189, 95,246, 97, 46,253,106,216, 46, +191, 41,211, 92, 74,127,147,102, 91, 93, 67,197,168, 61,240,132,115, 49,102, 42,157, 64, 47,232, 46,235, 81, 1,111, 2, 94, 20, + 67,131,231,198, 52, 14, 93, 7,212, 83, 26, 60,130,133,226,173,160,152,162,204, 40, 89, 46,201,234,176,240, 29, 74,165, 0,159, +215,119,243, 12,183,232,200, 67,119,156,100,237, 47,195,226,180, 76, 24, 77,150,185,146,246,179,149,102,183,139,187,243,216, 41, +203,157,117, 52,235,202, 97,242,152,174,221,175,145,144,253, 44,157, 53,232, 69, 32,178,237,169, 75,197,221, 33, 75, 98,230, 22, +225,199,166,215,254,227,101, 28, 78, 41,131,225, 52,109,243,212, 4,164,137, 64,244,208,186, 32, 30, 11,141, 98,247, 36,105, 41, + 79,117,237,235, 40,252,105, 2, 49, 23,181, 32,190,140, 84,147, 24,100, 28,167, 53,209, 5,199, 67, 62, 15,147,215,252, 55, 73, +141,162, 22,106,246,146,159, 64,117, 80,186,142, 57,247,162, 81, 22, 69,205,137,149,243,144,126,177, 54, 32, 90,120,226, 66, 67, +190, 98,178,252,220, 85,136,218,209,225,252,182, 70,237,200,113,144,109,120,175, 54,118, 79,231,141, 40,199,149,157,111,187,169, + 91,242,199, 90, 25, 44, 85, 28, 47,167, 27, 46,188,126, 97,244,205, 48,245,235, 68,149,140, 4,255,150,212, 91,194,219, 98,241, + 52,251, 90, 0,247,245,103,111,128,251, 92,152,188,227,181,216,219,200,124,222,184,105, 33,224,247, 61,153, 98,194, 20, 33, 98, +206,140, 86,156,221,204,147, 10, 85,191, 98,161,166, 82, 73,124, 62, 42,186, 92,149,184,138,108,219,135,157, 52,165,176, 13, 5, + 87, 80,126,153,131,237,213,139, 20,239,181,226, 32,190,140,175, 67, 21,154, 10,216,222,196,166, 13,177,133,222,125,222,239,251, +190, 7,189,119, 22,197,184,132,240, 68,196, 87,178,106,170, 56,190,164, 70,139, 32,180,168,119,167,102,175,129,124,105, 2,113, + 86, 83, 6,128, 92, 0, 20,148,116,202, 29,207,126,139,124, 15, 46,145,179, 41,225,156, 13,199,125, 2,156,136, 99,147,165,164, +221,211, 1,204,133,144,217, 78,169,217,125,135,120, 27, 11,249, 39,100,207,247, 53,208, 99,124, 4,239,161, 77, 91,230,111,136, +127, 19,136,159, 2,144,118,109, 59,106,195, 80,208,231,216,216,161, 41, 44,171,221,125,104, 87,253,157, 85,255,255, 1, 9,245, + 15, 42, 30,118,165, 0, 1,199,113,207,197,129,208, 80,161,182, 40, 2,100, 7,161,196,115,198, 51, 99, 37,161,179,136,255, 51, + 75, 20,142, 30,116,177, 78,144, 86,111, 15,110, 48,248, 57,153, 46, 98, 15,217, 1,135, 60,196,104,175,192, 66, 98,114,177,109, 18,199,204,248,126, 37,190,170,124,240,161,154, 17,111,229,188, 88,174,168,141,200, 61, 43,211, 22,245,156,213,134,205, 8, 39, -224,101,190, 52, 3,210, 76, 89, 84, 4,104, 8,104, 69,126,156,175,182, 84, 32, 94, 46,191,148,120, 8,100, 30,137, 55,163,168, - 5,179,170,151,192,180,216, 9, 64, 53,185,147,243, 84,181,142,138,161, 78,230, 28, 7, 4, 8,251, 64,153,111,182, 40,210,205, - 69,193,156,175, 54, 70,126,215,218,231,197,203, 33,238,131,115,252,180, 44,161,222,227, 97, 27,119, 63,154,237,166,253,248,217, -146,212,166, 46, 26, 62, 95,161, 3,130, 94,194, 67,155,154, 93,223, 52,121,215,230, 83, 4,217,131, 64,194,109, 60, 82, 87,238, +224,101,188, 52, 3,210, 76, 89, 84, 4,104, 8,104, 69,126,156,175,182, 84, 32, 94, 46,191,148,120, 8,100, 28,137, 55,163,168, + 5,179,170,151,192,180,216, 9, 64, 53,185,147,227, 84,181,142,138,161, 78,198, 28, 7, 4, 8,251, 64, 25,111,182, 40,210,205, + 69,193,156,175, 54, 70,254,215,218,231,197,203, 33,238,131,115,188, 89,150, 80,239,241,176,141,187, 31,205,118,211,126,252,108, + 73,106, 83, 23,157, 62, 95,161, 3,130, 94,194, 67,155,154, 93,223, 52,121,215,230, 83, 4, 89,131, 64,194,109, 60, 82, 87,238, 34,166,196,233, 58, 39, 73,157, 61, 29, 33, 70, 72,137,149, 82, 8,102,181,192,199, 21,124,174,241,233,193, 61, 62,216,101, 13, - 21,169,119,167,251, 30,198,123, 87, 5,110,217,127,236,105, 48, 82,241,178, 26,183,159,105, 33,155,137, 92,157,208, 77,121,255, -178,252,218, 12,240,189,193,124,188,246,229,187,121,244,248,136, 40, 14, 96,204,137, 52,230,180, 78,116, 57, 77, 35,236, 79, 88, - 81,123,207,245,255, 71, 81,242, 15,213, 2,163,112,198, 12,132, 88,219, 58,177,203,130,177, 13,155,178, 42,140, 42, 31, 39,238, -113,164,214, 97,116,240, 85, 8, 14,131,114,186,118,124, 25,110, 77, 10,220, 62,145, 51,185, 51,230,237,165, 11,207, 58, 88, 13, -174, 50,123, 9, 86,108, 73, 44,133, 15, 97,248, 91, 25,208,186,226,167,113,178,207,131, 86,233, 91,234, 79, 98,154, 66,250, 42, - 93, 36, 13,149,143,136, 65,119, 84,234,150,184,221, 83,165, 83,205, 59,122,181,129,164,205,235,235,183,183,183,239,155,245,250, -120, 60,152,225, 62,169, 89, 19, 89,170,113, 22, 93,189,236,198,177, 26,226,101,134,190,138,227, 85,137,241,213,244,147, 58,180, - 86,229, 35,151, 50, 23,164,238,172, 41, 27, 40,142,113,238,234, 96, 61,169, 70, 77, 28,132,199,137,224, 59, 73,126, 46, 50, 2, - 46, 22,187, 31,227, 31,202, 58,250,251,180,226, 61,190, 84,207,215,115,242,159,224, 90,230,155, 91,224,209, 22,242,193,109,215, -254, 45,185,211,227,151, 0,164, 93, 77, 79,219, 64, 16,245,172,189, 14, 95, 38,141, 34, 46, 52,151,246, 80,245, 31, 20, 1,226, -183, 32,113,172,196, 95,224, 71,246, 4, 71, 80, 15, 85,148, 22, 9,133,160,205,218,203,188,153, 93,219, 68, 4,130,154, 68,209, - 42,182, 44,239,238,236,155, 55,239, 69,235,255,194,119, 21,100, 90,218, 46,237, 96, 84,141, 81,155, 6,211, 19, 36, 82, 21,205, -129,144,144,187, 37,126, 36, 8,248, 43, 47,185, 80, 51,150,212, 88,149,233, 41,203,173,106,111,127, 88,125,218, 30,236,158,159, - 95,220,220, 92,207, 31, 31, 73,183,213, 77,240,163, 3, 47,106,124, 29, 3, 93,102, 48,143,187,119, 21,219,118,143, 75,173, 60, - 25, 59, 9,220,131, 34, 62, 37, 93, 80, 75,104,189,201,228,215, 54, 12, 40,203,122,217,210, 82,204,138, 60, 64, 43,180,142, 46, -100,255,160,181, 60, 40,170,193,252,195,250, 17,146, 19,100, 32, 32,252, 41,190, 75,207,225,120, 26, 14,106,178,198, 28, 12,198, -191,231,211,153, 91,220, 46,254,254,154,255,185,243, 15,179,108,241,100,195,206,112,235,112, 92, 29,142,118,135, 3,203,185, 49, - 23,179, 84,222,146, 55, 24,212,114, 51,176, 92,220,112,199,137, 65,252,137,177,222,145,115, 92,113,114,225,138,129, 53, 16,220, -169,180, 96,250, 73, 36, 37, 91, 6,190, 22, 7,115, 0, 93,225, 40, 54,206,161,130,229,217,225,234, 43,151,228,229,188,207,162, -137, 37,175, 90,108,171,206,236, 36, 69,204,144, 25,234,106, 30,234, 19,106,145,216, 10, 62,141,193,253, 93, 55,233,221,163, 6, - 76,223,250, 94, 37,190, 34,205, 43,184,127, 25,127,189, 95,252,235, 31,242,193, 55, 27, 43,254, 89,180, 46, 55, 5,119,122, 41, - 89, 44, 1,238,217, 10,236, 70,232,237, 89, 83,235,148,156, 20, 96,175, 10,238, 43, 75,140,214, 11,248, 68, 29, 34,173,235, 72, - 31,220,251,186, 48,165,172,210,221,185, 73, 25, 64,101, 85, 44,141, 16, 55,178, 48,210, 6, 47, 83, 14, 39,191,198, 6,165, 6, - 2,175, 48, 45,119,146,162, 26,200, 30,148,195,241, 42, 96, 80, 22,209,221,130,199, 85, 59,213,104,116,240,121, 50,249,113,116, -244,243,234,242,251,241,183,211,147,179,251,233, 3,159,198,248,225,156, 7,236,214,117,218,135, 3,196, 26,213, 39, 47,113, 2, - 86, 48,172, 27,136,247,120,118,187,248,181, 86, 76,167, 2, 12, 8,230, 93, 19,123, 76,237,158, 28, 8,223,101,195,215,245,226, -179,225, 56,103, 41, 89,203,212,161,109,202,179, 60,143, 5,238,100,149,226,232,200, 88, 99,235,208,188,229, 85,116,159, 94, 90, -142,238,112,167, 22,191,237, 84,121,252,171,164,249, 40,184,243,235, 89, 0,202,174,102,199,105, 24, 8,123,236,216, 38,217,203, -118,247,194,162, 10, 33, 14,188, 2, 44,111, 3,119, 94,139, 27,112,131,231, 64,236,133, 27, 72, 92,144, 88, 85,148,230,255,199, - 59, 63,118, 27,186,109, 5,109, 21, 69, 74,212,196,246,204, 55,223,204, 55, 74,142,226, 59,156,250, 69,155,131,200,235, 4,211, -133,221, 38, 98,206,206, 78,128,141, 75,171, 76,178, 0, 90, 92,193, 32, 18, 57,131,145, 66, 48, 68, 78, 64,169, 23, 5, 96,138, - 0,210, 75, 99,158,191,120,249,250,205,171,143, 31, 62,225, 74,140,152,116,225, 90,171,180,210,137, 97, 10,200, 68,107,138,178, - 45,101,153,206,100,200,199, 77,170,243,135, 88, 40,100,230, 33,193, 29, 84,110,243,229,229,114, 93,175,101,210,165,230,206, 22, - 16,101,244,232, 99, 26,230,243,100,168,151, 69, 63, 90, 92, 85, 77,117,253,236,250,219,175,239, 19, 91,202,227,139,101, 73,101, - 21,234,141, 9, 81,248,161,193, 33,160, 35, 86, 55,211,240,123, 36,146,254,181,252,121,211,252,184,213,155,210, 14,202,234, 51, -239,115,239, 11,231,115, 36,236, 20,234, 8,214, 45,186, 3,231,162,214,106, 71, 58,148,118,214, 60,200,120, 95,131,227, 30,152, -220, 89,159, 41,103, 69,138, 6,159, 25,188, 94,219,171,178, 10,235, 50,180, 29,244, 67,232,123,133,212,126, 83, 77,117,173,171, -122,106,234,208, 52,208,182, 35, 14,111, 24, 85,211, 78, 53, 63,122, 18,239,184, 65,254, 63,144,136, 37,178,106,136,143, 32,155, - 56, 76, 7,188,212,121,113, 81,117,165, 20,223,112, 94,144,112,209, 73,169,143, 33,196,158, 10, 73,156,255,227,131, 52,124, 12, -127, 85, 69,158, 92, 62, 93, 49,100,143,241, 13,149, 72,147,139,132,164,251,246,137,224,158,132,235, 93,164,249,199, 27,240,198, -115,120, 62,144, 79,236, 21, 64,238,147,247,148,188, 2, 28,240,160,136,185,206,228,152, 43, 36,223,134,131,202,252,125,154,191, -109,149,217,186,216, 9,151,156,245,201,192, 17,248,159,169,169,187,126, 7,149,216, 12,215,100, 16,180,183,242, 24,163, 29,164, - 33,232, 16, 41,187, 48,250, 29,136,179, 91,101,178,207,164, 74, 83,131,154, 22,158,196, 95,165,211, 81,218, 6, 9, 6,210, 56, -193, 5, 88,147, 57, 4,120, 98,240,222,163,189,131,174,202,170,176,103, 80,171,247,111,223,221,124,249,188, 90,221,254, 41, 55, - 93, 91, 15,212,212, 53,136,220, 47,165, 93, 97,130,154, 55,148, 5, 24,214,104, 51,116, 17,227,241, 31,109, 78,148, 37,192,195, -197,213,186,222,128,146,182,137,153,128, 15, 97, 81,156,119,125,199,192, 17, 44, 50, 76,227,250,177, 99, 76,144, 10, 85,152, 83, -120,244, 54, 54,145,105, 15, 72,121,226, 96, 94,129,220,195,244,211, 80, 12, 51, 9, 71, 31,207,192, 82, 60, 56,101,213,199, 14, -221, 9,192,218,181,237,180, 13, 4,209,181,215, 38, 38, 80, 8,173, 42, 85, 34,130,143, 64, 8, 85,234,255,191,240,128, 80, 21, -149, 87, 30,122, 81, 73,161,133,196,187,107,123,119,153, 51, 99,147,139,176,197, 67, 35, 69,137,180,137,175,179,103,207,156, 57, - 26,191,226,159, 73,182, 86,160,161,141,138,212,254, 18,136, 45,125,110, 9,123, 39,236,169, 54,113, 99, 78, 32,208, 47,141,113, -117,219, 15,151,105,188,172,252,154,208, 43,195,125, 34, 24,219,161, 95, 94,124,254, 66, 67,223,102, 51, 34,178,214, 26, 83,150, -166, 42,125, 93,163,139, 33,241,107,206,115,216,221,196,234, 79, 71, 46,248,152, 96,194, 84,128, 72,160, 94,198,131,153,144, 17, -225, 26,178,115,150,222, 52, 52, 69,173,226,128,121, 35,248,149, 42, 42, 42, 39, 32,165, 6, 59, 80,211,163,233, 94,177, 59,251, -126, 67, 39,196, 82,148,232,142, 80,162,156,119,127, 27,123,239,203,185,114, 77, 26,170,224,137,216, 28, 32, 4, 83, 34,167, 68, - 50,154,192, 24, 25,184,140, 3,218,163,153,219,100,180, 56, 73, 52,179,194, 20, 9,187,139, 29,250, 3,157,111,115,252,233, 35, - 69,252,221,159,251, 81, 54, 42, 29, 93, 7, 2,241,184,168, 66,202, 89,170, 6,209,135,127,128, 83, 96, 92, 10, 90, 9,248,113, - 34,209,213, 97,105,234,192, 8, 14, 29,159, 11,112, 62, 38, 85,132, 39,135, 70,242, 96,231, 63, 23,180,142, 86,168,187,114, 83, - 74,238,131, 73,111, 58,176,201,254,251,223,143,191, 34, 44, 25,210,205, 88, 67, 28,229, 34,214,166,251, 37, 14,187, 11,246, 71, - 7, 75,247,212, 39,209,208, 70,248, 54,165,235,117,206,208,239, 63,145,209,179,211,243,171,219,203, 55, 58, 19,214,220, 1,154, -229, 26,236,232,112,247,232,159,121, 40,242,194,214,118, 43, 12, 10,141, 80, 52,222,166,155, 64, 60,160,188,119, 14,203,220, 7, -183, 30, 86, 47,190,154,216, 3,238, 82, 77, 21,206,180,101,150, 28, 56,159,248,186, 5,105, 53,127,183,172, 50,155,130,251,202, -227,187,146,213,145,124,138,127, 54,109,157, 2, 73,135, 89, 73,139,230,252, 93,103,252, 33, 19,153, 37,122,217,133,176, 44, 14, -224,216,242,255, 68, 68, 27, 84,217,152,102, 19, 48,103,163, 28,109,166,137,222,208, 7,113,155,124, 50,249, 48, 61,153, 94,127, -189,174,240,172, 58, 99,172, 89,150, 4,241,206, 53,174,198,172,175, 16,142, 9, 46, 14,191, 52, 19, 65, 56,111,104,182,195, 18, - 28, 99, 49, 30,191, 27, 31,222,205,127, 44, 76, 73,196,223, 82,162, 26,144,139, 99,129, 80,158, 59,167,122, 49,191,214, 68,112, -112,173,145,237,181,254, 26,197, 62, 57,134,108, 41,156,116, 20, 7,115, 74, 49,200,134, 13, 47,141,250, 47,157, 81,251, 60, 57, -241,205,233,111,223, 97, 60, 11,192,217,181,237, 54, 17, 3, 81,123,214,217, 77, 90, 42, 65,185, 60, 32,158,203,191, 35, 30,248, - 17,126, 0,165,188,161, 86, 8,181,106,146,110,178, 27,219,195, 25,143,157,221, 92, 74,129,215, 72,118,178,235,241,153,153,115, -142, 99,247,119,198,220,147,179, 12,125, 71,182,217,230, 36,159, 99, 71,180,113,106,106, 43, 66, 10,218, 31, 18,220, 65,151, 21, -188,145,110, 75,147,176, 75, 43,165,156, 9, 23,176, 55,202, 13, 68,239,166,231,243,249,183,197,253, 29, 70, 97, 66, 44,209, 89, - 61,235,250, 77,200,178,198, 78,222,200,197, 80,150,118, 14,203,157,252, 25,233,186,144,125,249,226,213, 67,123,207,153, 47, 35, -189, 60, 67,201,253, 16, 89, 13,188, 57,124,135,119, 10,176,206, 85, 0, 37,189, 40, 89,204,217,137,177, 62,172,250, 37, 30,138, -146, 40,220, 24, 84,205,225, 33,108, 86,161,255, 25, 86, 43,183,237, 45,207,206, 38, 51,170,109, 32,249,231,116, 54,181,181,141, - 5, 56,218,118,157,200,155,100,180,158, 74,212,227,125,137,199,113, 54,113,129,226,212, 85,205, 68, 93,234,149, 17,245, 39, 96, - 91,116,221,246,195,251, 55, 31,175,174, 62,125,254, 2,220,197, 43, 14, 98,122,140,216, 66,120, 28,167, 44, 16, 91,113,100,250, -126, 98,209, 32, 48,170,117,252,182, 40, 55,129, 97, 23,208, 90,156,154,188,245,114,255, 83,116,146, 10,132,221,228, 8,168,115, - 77,205,104, 90,243,121, 0, 41,101,148, 50, 20, 34, 34,250,101,187,220,117,185,156,110,131,202,170,219,126,164, 98,171, 33, 57, -208,211, 74,229, 99,183,248, 3,127, 82, 80, 97, 47,144,233, 57, 86,231,107, 2,119, 58, 84,168,212, 39,241,228,216,113,223, 0, -112, 47,238,231,195,173, 11, 80, 64,135, 67, 35, 74, 42,229, 54, 79,207,113,155, 65,238, 34,206,116,150, 57,162, 68, 78,234,177, -169, 90,172,244, 75,101,160, 84,214,172,209,201,214,158, 26,201,166,172, 17,159, 40, 4,205, 88, 80,117,131,163, 99, 15,220, 7, -215,163,186, 26,185,144, 49,106,116, 43,200, 94, 12,205, 10,252, 90,204, 25, 21,207, 18,128,139, 7,173,216,227,180, 43, 72,188, -119,186,188, 93,242,150,213,163, 38, 84, 44,243, 41, 49,196,116, 96, 32, 17,236, 38, 86,221,186,253,126, 61, 71, 1,135,240, 21, -251,174,247,169,141,140, 73, 8,146, 78,241,162, 57,127,236, 90,173, 5, 17,222, 78, 5, 59,185,215,183,186,188,120,123,183,248, -117,249,250,221,205,237, 15, 12,168,235,186,223, 50,146,137,151,234, 4,104,132,152, 15, 40,156,250,126,131,185, 48,125,145, 76, - 7, 53, 91, 1,226, 40, 94,104,103,123, 99, 51,230,120,254,167,160, 62,198,241, 17,121,196,138,104, 97,127,146,157,134,143, 69, -193,166,179,255,226, 60,254, 45, 0,101, 87,176, 27, 53, 12, 68,109, 39, 78,154, 84,187, 61,160, 86, 72, 84, 85,191,128, 3, 23, - 16,136, 79,129, 35, 18,135,254, 19, 20,248, 27, 78, 85, 47, 69,170, 68,165, 10, 36,164,165, 91,218, 77,154, 56,246,116,102,236, -120,183,219, 77, 36,118,175,217,200, 78,236, 55,111,222,188, 89, 15,145,119, 57,240, 99, 25, 89,193,170,241,177,111,109, 96, 93, - 68,232, 34,205, 83,145,102, 50, 11,124, 2,168, 2,162, 5,190,132, 4,159, 47, 49, 83, 33, 42, 87, 45, 92,133, 57, 17,225, 27, - 35,106,176, 87,122, 58,216,117, 32, 52,110,182,235,127, 87,136, 44, 8, 86,123,211,167,191,103,151,136,114,157, 49,108, 11,113, -129, 10,201,104,204,164, 4, 46,100, 86, 58, 81,176, 50, 96,213, 71, 92, 78, 27, 48, 33,188,169,149, 47,189,120,101,155,190,132, -113,176,187,179,187, 83, 76,127,254,185, 88,119,186, 57,231, 99,137,227, 96,196,115,226,196,129, 45, 95, 55,205,237, 45,166,129, -210,206,237,226, 87, 59,175,210,174, 77,187, 98, 74,190,151, 39,248, 16,172,230, 27,128,177,164, 45, 41,202, 7, 37, 14, 16,233, - 49, 0,139,218, 4,165, 50,215, 42,203,147, 2,193,189, 80,185, 38,176, 37,207,188,147, 77, 3,228, 97,166,130, 33,188,126,254, -226,236,199,249,197,229,236,253,187,183,167, 39,103,223, 79, 78,203,188,160,200,147,192, 36,211,142,196, 45,242,194, 28,238, 63, - 91,212,213,236,234,250,232,227, 7,164, 63,159,190, 28,103, 91, 10,227, 12, 18,149,132, 52, 43, 71, 70, 73,107,239,112, 64, 13, -205, 11, 3, 23,238,149,132, 92,240,248,146, 52,238, 45,239, 9, 5, 31, 61,105,197,209,134,108,186,154,197,247, 65,196,236, 47, - 87,246,161, 81,114,147,232, 60,186,250, 1,236,163,232, 32, 55, 17,243,100,192,165, 6,203,252, 82,140, 91,217, 74, 93,214,166, -242,195,199,187, 53,180, 32,113,249,232,214,154, 56,169, 14, 58, 16, 75,145,190, 55,196,170,135,100, 7,209, 51, 53,176,241,112, -121, 41, 5,192,168, 56,174, 86, 28,232,225, 15,150,251,124, 14, 23,199,100,107, 50,175,255,174,116, 30,172,223,128, 53, 50,136, - 40, 31,249,160, 18,177,179, 80, 70,207,190,234,221, 80,177,154,154,242,187,246, 6, 20,217,115,243, 77,200,238,121, 92, 26, 88, -188, 8, 64,239,189,146,193, 49,217,195, 58,243,117,240, 13,128, 50, 54, 55,177,145, 46,229,168, 64,193,128,160, 27,159, 46,178, - 25,211,146, 3,152, 42,161, 29,230,231,200,216,219,198,208,169, 53,134, 15,202,161, 92,210,215,250, 19, 50,135, 49,233, 97, 99, - 52,201,191, 73, 86,230,219,101,185,141, 87,188,124,245,102,255,224,224,219,215,207, 8,252,116,102, 78,223,128,227,243, 96, 96, -247, 28,207,146,229, 22,185, 14,229, 94, 99,196, 8,100,216, 14,109,255,167, 55, 98,173,212, 49, 78,187,131,202,205, 76, 8,150, - 5, 27, 31, 96,104,165,185, 1, 4,135, 71,134,177,241,207,189, 0,172, 93,203,110, 19, 49, 20,245,245, 60,243, 40, 1, 65, 75, -131,202, 18,254, 2, 22,192,138,175, 66, 17, 95,128,202, 31, 32,193, 55,240, 88, 34,216,178, 66,160, 82, 42,218, 72, 93, 16, 74, - 90,230,145,241,216,230,222,107,155,132, 52, 21,173,196,172,178,136,228, 25,207,125, 28,159,123,142, 38, 62, 87,113,247,226,145, - 69, 36,229,124,113, 16,172,110,254, 28,151, 11, 66,159, 26, 95,144,104,107, 59,115,194, 35,178,173,106, 34, 28, 16,135,198, 42, - 74,100,146,198, 89, 55,238,174,119,174, 25,208, 19,117,244,171, 45, 37,201,153, 18,159,148,152,222,244, 42, 68, 85, 22, 73,154, - 81, 51, 23,102, 60,217,227,207, 28,181,204,154,145,136, 17,152,135,119,140,153, 87,176, 72,121,123,120,107,247,112,199, 73, 48, -157,236, 92, 88, 31,121,158,234, 2, 91,171, 38,149,169,178,196,190, 13,122,151,143,171, 19, 31,245, 26,209,193,165, 47,135,187, - 60, 34,146,139, 10, 85,139,201, 11, 45, 25,173, 44,163,120,230,220,172,147,232, 64, 52,209,211, 49,124,175, 69,219, 68,186, 63, -200, 7, 73,214,203,251,189, 78, 42,120,224,239, 38,190, 86,243,172, 83,104, 82,131, 74,145, 33,118,214,116,243,137,251,112, 18, -199, 61,139,108, 48,234,201,108, 27,133,169, 2, 30, 87,134, 91,195,106,166,191, 29,236,111,172,223,180,162,243,234,205,235,162, - 50,247, 31, 60,252,240,113,239,199, 20, 59, 85,164, 12, 57,119, 89,129, 44,174, 94, 25, 60, 26,141,118,119,190, 62,121,186,125, -231,238, 61,132,153,207,158,191, 64,252, 73,116, 54,107, 54,179, 52,174,105,131, 33,227,180,166,245,129,122,175,182, 80, 26,189, -214, 77,142, 78, 76, 18,101,184,219,210,106, 61, 15, 44, 19,166,255,127,125, 73,196, 4, 38,193, 4, 34, 94, 17,104,245, 98, 81, - 45,254,195, 69,250,200,180, 87, 52,133, 60,165, 47, 12,220,247, 10,203,107, 39,202, 43, 93,195,191, 32, 85,201,197, 29, 60, 5, - 23, 68, 80,164, 47, 84,171,156, 77,110,158,140,157, 82,211, 73,137,243,243, 15,234, 49, 96,206,110, 93, 0, 75,190,182, 83, 44, -191,157, 7,156,175, 18,180,227,100,229,177,211,234,167, 61,251, 17,194, 49, 22,124,149,231,187,196, 29,171, 84,197, 67, 42, 71, -172,207,197,237,193,246,237, 51,130,114,103, 94,220,101, 20,124,172,129,142,151,115,104, 79,148, 30,184, 94,192, 53, 54, 90, 54, -175, 46, 92,210,149,120,167, 54,112,162, 7,112, 58,131,152, 85, 55,188, 26,235, 99, 48,169, 65,209, 79,172,242, 24, 69,141, 34, - 38,134, 61, 77,216,100,149,109,219,235,107,155,227,201,190,155,186,225, 33, 82,184, 42,109, 89, 71,131,207,141, 77, 0,255,105, -178, 60,239,143,182, 31,191,123,251,126,227,229,102, 81, 28,227,242, 55,250, 91,159, 15, 62,225,106, 70, 33,190,106,112, 71, 27, - 86,209,231,105,183,158,149, 54,164, 55, 5,106, 8, 86,158,150,165,170, 41,207,163,146,133, 11, 64,246, 21,228, 98, 14, 89, 77, -203,234, 69, 58,126, 65,176,189, 20, 45,182, 53, 23,206,167,223, 2,176,118,237,186, 77, 4, 81,116, 94,158,245,174,147,181,113, -131, 40, 81,226,130, 18, 33,209,162,252,101, 42, 36,126, 0, 41, 74, 73, 65,133, 27, 26, 36, 10, 20, 18,137, 2,137, 42, 56, 33, -224,172,247, 53,195,125,204,190,156, 88,128,132, 27,219,251, 28,237,206,222, 61,247,158,115,102, 6,252,170,188, 27,220, 27,187, -177,238,122, 82,112, 42,112,101, 70, 99,210,135,183, 57,146,128, 36, 99,237,117,225,242, 10, 16,143,168,136,182, 18, 42,120, 75, -241, 57, 96,226,209,241, 61, 65, 35, 26,100,184,230,209,228, 97,106,211,181,207, 96,123,213,184,154, 49, 30,146,165,129,228,175, - 56,179, 29,124,161,224,210, 68,155, 98,237, 89,123,232,194, 40, 5, 45,196,128, 37,215,191, 86,212,251,176,164, 30, 20,153, 70, - 6,134, 39,112,176, 42, 47,115,216, 25, 41, 26, 47, 11,114, 48, 55,242,124,113,149,253, 80,140, 95,216, 31,215,210,184,222,135, - 89, 79,169,112, 1,255, 35,107,241,138,139,250,194,125,187,140, 87,241,196,236, 69, 49, 92, 4, 11,221, 67,152,186,134,252, 93, - 59,108, 48,164, 44, 58, 26,153, 73,162,246, 19,148, 42, 38,214, 24, 4, 46, 42, 47, 92, 89, 74, 88,121,117,157, 81,185, 27, 0, - 3, 44,148, 27, 52,250,168,178,226, 98,150,252,153,229,207,159, 62,123,178, 56,120,255,225,227,131,217,124,113,184,120,243,118, -121,248,248, 32, 77,167,145,141,206, 47, 62, 71,227, 81, 28,137,201,216, 64, 6,192, 29,246,232,197, 17, 36,247,175, 79, 78,207, -206, 62, 45,151,239,206,191,124,245, 78,195, 1, 21, 14, 63,128,141, 55, 90, 89, 43,103,177,153,166,122,111,162, 99, 27,138,189, - 21,146,170, 46,167,230, 16,155,133, 55,160,181, 8,180, 41,228,214, 16, 5, 35,109, 21,170, 42,235, 33,167,244, 63,231,108,154, - 39,243, 28,210,106, 14, 94,131,176,232,119, 74, 45,253, 95,121,200,239,165,173,106, 2,236, 4,127, 66,245, 73,111, 57,125, 24, -246,162, 25,202,169, 94, 99,228,159, 78,117,135, 29,237,234, 3,196,134,136,206, 33,200,210,242,198, 88,178, 99, 14,150, 46,116, -203,208,200,224, 48, 65, 96, 72, 85,112, 61,120, 69,169, 62, 96, 83,162,167,125, 20,236, 45, 85, 12,219,169, 8, 73,250, 8, 25, - 84, 50,244, 27,171,237,196,184,242, 8, 23,130,105, 51,211,215,207, 16, 54,106, 87, 49, 21,138, 59,208,217,227, 81, 34, 26, 73, - 43,114,163,180,141,119, 65,241,204,227, 98, 20,101,134, 94,213,138,194, 60,253,184,185, 93, 97,104,195, 96,206,108, 29, 19,108, - 72, 54,225,254, 24,132, 20,196,147,205, 38,219,151,233,171,227,151,168, 54,241,162, 40,242,239, 55,151, 53, 57,222, 49,128,160, -202,217, 83,122, 84, 79,227,217,109,190,238,112,115,128,149,225,137,175, 32,135,195, 11,224,188,148, 61, 74, 67,222,247,118,222, -166,186,225, 48, 99, 36,213,235, 93,130, 39, 49, 20,122,121,236, 63,126, 75, 70,133, 93, 11,130,147,239,251,195,133, 97, 7,217, - 63,126,126, 11, 64,217,213,244, 54, 13, 4, 81,207,174,237,236, 58,105, 82, 26, 72,133,138, 80,251, 11,128, 11, 7, 78,253, 27, - 72, 28,248,171, 5,132,132,224,128, 4, 72,168,151,138, 67, 69, 19,218, 40,105,172, 56,254,102,102,118, 29,187, 14, 70, 16,229, -148, 83,188,158,121, 51,243,230,205,236,159,241, 29,234,230, 81,211, 62,106,249,140,228, 13, 46,130, 91,116, 70, 51,163,132,198, -147,203,202,196, 44,134,104, 48,183, 86,162,235,242, 65,129,233, 97,112,166,154,155,212,162,112,134,106,255,190, 26, 47,146,101, - 73, 4,139,224,169, 3,160, 78, 8,191,140,170,195, 87, 96,148,222, 36, 28,117,205,245,114, 22,220,183,236, 33, 25,203, 72,143, -184, 83, 90, 52, 92,131,228, 59,102, 63,141, 1,122,171,230, 97, 22, 21, 31, 66,186, 54, 92, 25, 37,151,242, 20, 97,173,132,129, -222,195, 31,134,122,116,114,120,124,125,123, 83,201,233,201,105, 48,233, 62, 57, 56,254,186,184,184, 16, 51,232, 23, 67, 95,251, - 64, 82,127,229,187,218,119, 77,102,212,243,188,128,184, 65,215, 88,176,239,122,129, 30,253,154,133, 73, 38, 16,184,139, 12,242, -212,121, 56,153,188,126,245,178, 31,168,233,244,102,181, 90,227,169,184, 76,184, 35,254,210, 25, 56, 50, 38,138,166,236, 73,249, -236,201,211, 15, 31, 63, 33,232,158,190,120,254,229,219,231,123,195, 32,205,163, 71, 71,135,241,122,177, 92, 94,247,148,139,118, -178,142,203, 40,202,166,243,240,237,217,251,179, 55,239,230,171,245,213,108,254,227,242, 10, 95, 19,134,140, 56, 43, 34,202,135, -242, 36,227, 14, 43,134, 32, 32, 57,231, 38, 46,241, 27, 39,104,214, 24,117, 11,223, 21,225, 18,243, 62,200,183,183, 6, 86, 43, - 57,140,114,116,119,255, 12, 77,141, 91,167,109,241,195, 0, 59, 43, 7,186,168, 67,163,144,233, 50, 83, 76,222,161,115,116,182, -157, 35,181,228,137,237,110,204,191, 33,190, 73,138, 93,225,149,101,185, 51,118, 68,180,192, 65, 48, 94,167,161,216,137,100,176, -211, 52, 3, 7,254, 2, 10,119,135, 84,109,235, 1,192,113, 58,135, 99,133,168,165, 59, 78, 83,198,179,141,127, 21,112, 55,131, -173,104, 4, 25, 75,187,195, 86,118,102,166, 50,106,184,167, 34, 18,179, 31, 97,197,109,194,106,222,152, 71,149,194,150,183, 18, -120,130,194, 80, 52,204,189,152,190, 43,203,100,141,188,133,156,142,228, 50,142,240,165,223, 87,253,201,222,131, 52, 79, 31,143, -143,176,130,143,179,141,168, 31,150,200, 85, 74,114,208,205,227,152,111,129, 76, 18,170,215,121,192,154,144,128,231, 87, 33,175, -134,228, 75, 15, 93,133, 10,119,201,139, 77,168, 77,161,148, 62, 63,255,254,115,122,137,169, 0, 70,133, 77, 28,241, 50, 19, 90, -211, 97, 22,110,216, 13, 5,224, 12,244, 48,140,110,225, 46,190, 23,150,122, 7,133,238, 44, 37,201,163, 1,170,247, 8,205, 56, -218,213, 55, 98,116,160, 97,124, 86,238,130,104, 78,170,119, 27,155,246, 6,105,145,180,140, 68,139, 32, 99,119, 48,200,142,127, - 93,123,154, 43,227,255,251,252, 22,128,178,171,107,109, 34,136,162,221,217,217,236,102,179, 77,104, 49,248,160, 16,161,148, 66, - 5,171,130,244,165, 66, 31, 90,255,175, 63,162,250,160,111, 45, 82, 10, 62, 41,212, 34,178,105,154,237,126,206,140,247, 99,102, -179,109, 99, 84, 72, 32,217,144,100,179, 51,115,230,220,123,207,185, 89,133,239,182, 4,222,154,215, 58, 53,213,245,120, 4, 99, - 32,108,247, 47,217,247, 96,203,194, 75,105, 92, 33,162, 35,251,247, 90,131, 59,219,223,148,173,199, 91, 7, 4, 87, 56, 55,163, -141,113,252,232, 71,126, 69,223, 73,208,206, 12,158, 17, 30, 71, 95,187, 30, 18,246, 1, 1,140,118,118, 38, 59, 83, 97, 92, 97, - 39,224, 46, 99,112,112,231,201,206,236,246,154, 20, 50,108,222,104, 85,186, 46, 80,240, 52,213,126, 91,153,151,152,140,159,165, - 89,234,211, 14, 14, 63, 42, 43,111,211,155, 95,198, 18, 40, 36,239,163,254,176, 39,123,239, 47, 79,190,153,105, 36, 48,189, 94, - 85,216,242,165,204, 77,133,105, 16, 44,234,199,125, 25, 5, 1,144,119, 20,240,248, 16, 30,170,189,221,237,163,195,131,139,175, -103,195, 68, 14, 32, 48, 11, 97,255, 88, 43,234,249,108,150,190,124,181,123,124,248,118, 16,247,210,233, 79,224, 32, 33, 42,136, -200,202,138,125, 58,124,137,227,211,236,191,217, 59,191,248, 82,213,217,235, 23,207, 47,175,190,231, 69,182,189, 53, 57,249,240, -241,221,209,241,167,207,167,117,165, 40,142,198,107, 25, 72, 89,212,117,217, 52, 73, 63,164, 6, 31,232, 79,237,209, 26, 0, 90, - 19,160,101, 80, 12,128, 99, 68,184, 58, 97,182, 23,133, 46, 43, 84, 23,107,110,123, 6,139, 27,157, 73, 13,174, 53, 99, 87, 22, -227,251, 61, 39,170,233,168,128,187,204,221,216,134, 79,248,122,228,199,218,113,225,213, 81,235, 10,112, 95,138,215,255, 30, 6, -143,147,199,154,178,183,247,206,255, 79, 89, 82,209,201, 70,146,184,169,229,197, 11,162, 3, 39, 83, 96, 98, 7, 14,202,135,190, - 22,183,145,152,167,163,201, 53,246, 59,195,103, 81, 16,115, 50,231,225,217, 82,191, 23,227, 10,194, 84, 45,242,196,178,216, 98, -201,191, 29, 46, 60, 22,119,199,194,101, 77, 23, 67,227,121,173, 20,210,182,240,112, 66,175,133, 43,144,153, 59,242, 54,235, 18, - 17,164,144, 97,200,102,197, 10, 78, 51,201, 26,104,227,154, 56, 9,209,138, 38, 89,250,236,183,111, 97,118, 79,215, 7,104,245, -188,184, 1, 24,207,242,121,222, 20, 62,187,142, 48,156, 39,119, 34, 53,180, 3, 20,169, 53,166, 97,233,134,104,175,200,171, 77, -190,117, 86,181,216,179,222, 72, 54,169,197,147,226,169, 65,186,122,191,168, 74,160,128, 0, 2, 73,184, 62,157,167,180, 79,240, -231, 32,132,192,236, 86,120, 55,101,157, 27,215,104,204,176,223,188,227, 79, 5, 24,133,184,129, 11,218,157,237,217,235,244,218, -178,162,112,227, 80,142,145,157, 95, 34, 69, 44, 50,128, 36, 76, 74, 85,255,141, 85,224,134,163,141,186,139,239,128,164, 85,199, -236, 58, 44, 21,208,179,122,237,255, 29,173,191, 5, 96,237,122,126,147, 8,162,240,204,236, 44, 12, 11, 68, 8,120,106, 15,246, -100,107, 77,154, 26, 15, 38, 30, 60,217,164,241, 63, 53,241,234,255,160, 94, 26, 53,169,246, 82, 26,127,245, 96,164, 33,192, 44, - 11, 51,248,190, 55,179, 43, 16,154,104,226,158, 96, 67,178,187,240,222,247,126,125,223, 99, 11,190, 87,127,225,156,108,130,123, -160,189,195,118,220,130,231,162,252,240,153,202,148, 71,173,161, 56,217,119,101,255, 72,135,182,135,136,201, 66,153, 63,248,104, -143, 4,186, 60,109, 7,132,161, 53,175,238,102,189,209, 98,106, 41, 39,146,137,227, 29,141,232,234, 44, 93,196,116,142,239,176, -133,184,133, 49,182,171,152,184, 91, 41,152,160,153, 34, 92, 36,252,109,155, 59, 51,151, 83,248,207,231, 57,236, 79, 48,143,119, -169,162, 69, 34, 42,234,195,221,131,225,120,168,130,158,159,231,102,116,133,145, 29,134,132,196,121,215,111,245,181,214,118, 62, - 11,141,102,193, 69, 41,153,223,251,233, 96, 36,139, 76,153,208,220,247,172,166, 35,184, 52, 90, 19,188, 66,138, 7,113, 30, 42, -133,176, 58,141,204,235,225,193,225,243,147,147, 15,103,111,109, 62,165,104,131, 89,171,199,179,255,184,254,249,230,221,217,224, -234,235,163,163,163, 23,167,167,189, 94,239,203,213,247,225,104,170,181,104,103,105, 43,147,141, 58, 65,112,254,248,248,120,112, -121,249,107,120,179,119,111,207,249,244,252,243,224,233,147,103, 47, 95,189,222,223,127,208,239,116, 63,158, 95,104, 92,143,110, - 45,144, 44,224, 96,208,140,165,146, 98, 73, 90, 19, 13, 35, 90, 70, 53, 51,217, 54, 9,133, 22,122,222,177, 5, 61,129,252,216, -164,244, 49,193,126,139, 47,212, 82,105,155,219, 25,146, 37,193,229,114, 57,240, 91, 95, 66,232, 87, 40, 0,235, 68, 35,252, 48, - 77,141,148,132, 43,208,249,191,118, 37,255,227,145,138,148,170,114, 91, 76, 28, 56,112,232,219, 25, 72, 91, 23, 89,218,168,167, -141, 2,124,231, 45, 73,125,215,116,103, 43, 90,193,106,147, 76,249, 86,149, 72, 26, 53, 17,183,173, 40, 72,101,109,130, 38,239, -130,119, 22, 81,192, 44, 8,226, 9, 59, 42, 95, 88, 1,119, 95, 17,210, 4, 15, 27,120,236,182,113,111,145, 58, 16, 57,123, 81, - 70,136,206,135, 73,140, 7,235, 41, 74,244,101,149,186, 71,116, 47, 79,138,128,236,242, 79,201, 27, 21, 76, 48,210, 68, 68, 81, -119,212,175, 36,225, 5,232,182, 82, 4, 98,123, 18, 84,122,124,146, 61, 23,169, 93, 37,121,137,236,120,100,250, 28, 3,130,186, - 85,198, 26, 0,171, 52,106,188,122,132,204, 77,225,173, 10, 99,222,221,222,142, 45,108, 88,179, 74, 41,221, 28, 78, 63,143, 61, - 21,224,242, 34,184,124,128, 0, 89,237,181, 1, 11,203,118,154, 29,170, 3,200,193, 59, 89,167, 86,111,140, 39, 55,132,236, 90, -213,238,239, 28, 92,124,251,196,180, 72,135,120,193, 18, 88,136,103, 48, 16,243,220,199,141,179,144,150,105,242, 37,150,213,254, -129, 13,246,247,173,115, 75,169, 57, 96,207,228,138,196,172, 93,111, 85,162,117, 80,212, 92,225,183, 20,181,107, 69, 44, 68,145, - 43,181,239, 70,137, 23,220,142,192, 93,254,133, 48,112,235,241, 91, 0,206,174,166,183,105, 32,136,122,119,227,245, 71, 62, 74, - 19, 74, 17,170, 90, 5, 10,244,128, 64, 28,225,192,129, 3, 18, 55, 36, 46,252, 91, 46, 72,220,138, 42,132, 16,208, 86, 10, 80, - 53, 16,210,212,137,235,196,137,237,101,102,118,215, 73,160, 5, 68, 14,150,229, 72,107,217, 94,207,206,188,121,239,249, 79,241, -157,255,162,131, 64,219, 32,221, 55, 39,195, 47,218, 74, 22,192, 91,148, 19, 59,156,230, 49, 61, 96,220,138,178, 82,180, 42, 81, -150, 57, 38,205,230,166,112, 65,136, 15, 10, 55,137, 12, 86, 89,147,193,101,127,245, 75,124, 68, 39,194, 8,143,172,109,109, 9, - 65, 25,187,137, 41, 74,179,113,137, 6,107, 18, 18,237, 47, 68,180, 92, 2,252, 96, 46, 76,166, 19,152, 89,176,132, 78,179,244, -230,250,246,105, 50,228,165, 86,154,105,163,187,162, 31, 15,144, 52, 75,186, 90, 24,105,115,109, 43, 73,207,132,197,111,224, 82, -147, 89, 66, 43,185,186,127,253,222,143,168,135,128,148, 18,189, 98,216,147,163,102, 24, 54,170, 94,232, 85,234,129,223, 92,113, -155,117,185, 90,247, 27, 97, 5,242,226,208,199, 96, 43,189,138, 47, 93,218, 81, 82, 20,119,239,220,114, 24,118,134, 15, 14, 58, - 14,247, 54,174,110,118,190,126, 83,232, 77,227,194,204,143, 70,209,251, 15,239, 14, 59,251,219,237,173,167, 79, 30,111, 92, 91, -239, 30,119,123,131, 97, 28,163, 47, 88,255,116,178,115,123,231, 36, 26,125, 62, 58,190,212, 88,185,209,110,191,124,245,250,209, -195, 7, 31,247, 63,237,238,189,125,241,252,217,238,155,189,110,247,123,158, 59,213,208, 79,211, 12, 86, 28,100,172,209,194,136, - 93,142, 28, 15, 40, 14, 37, 45, 11, 3, 71,184, 72, 26,131, 91,232, 10, 86,149,162, 22,242, 0, 86, 17,201,124, 15,202, 50,238, - 74, 6,201, 3,148,182,196, 22,206,202,248, 94,218,165,150,220, 69,152,226,158,235,101, 75, 57, 41,254,213, 10,175, 64,124,156, -169, 44, 16, 65, 70,234, 30,126,177,185,227,127,199,119,233,200,156,188,136,216, 95,116,176,170,130, 64,173,171, 8, 18,165,150, - 15,214, 38, 68,220, 58, 31,189,209, 66,240, 5,168,199, 80,108,225,114,200, 91,171,176,111, 35, 35,240,189,208,214,163, 11,160, - 78,249,234, 22,133, 21, 7,232,113,242, 98,182,220, 60, 96,220,102,238,205,176, 53,153,141,169, 93,137,196, 83,221,168, 21,206, - 57, 12, 81,216, 86,189, 26, 61, 16,194, 10, 9, 60, 43, 84,153, 74,114,182, 44, 73, 81, 86, 57,191, 16,217,109,112, 87, 6,153, -177, 9,254, 92,193,164, 73, 42, 21, 45,227, 64,182,172, 96,198,106, 70, 24, 17, 56,210, 45, 17,177,209,150, 82, 20,226, 29,163, - 86, 44,173, 11, 48,123,131, 90,148,147,210, 2, 71,160,125, 81, 46, 6,112,206, 56,141,117,219, 48,215, 22, 96,216,248,209,182, - 4,112, 19, 72,205, 88, 24,185, 58,132, 65, 75, 81, 84,250,187,237,227,105, 2,193, 29,107, 78,206,171,178, 22, 37,131, 86,109, -109,116, 22,157,196,253,113,154, 80,233, 79, 21,129,197,223,169,105,103,104, 0,122, 30,167,179,180, 88,206,223,157,185,147, 18, -215, 86,207,150,160,199,200,124,201, 28,128, 97, 8, 84,113,202, 16, 71, 98,151,169, 86,228, 89,201,177,113,187, 42,230,235, 5, -251,157,174,179, 92,251, 58,206,130,237,232,191,171,190, 47,250,253, 20,128,180,107,105,109, 34,138,194,247,220,185, 51,147,116, - 82,234, 19,171,213,180, 32, 10, 10, 46,170, 46,164, 80, 23,130,238,138, 43,187,115,161, 43,197,255, 39,184,180, 96,125, 81, 53, - 8, 69, 20,139, 15, 84, 12,149, 54,113, 38, 51,153,201,204,245,158,115,238, 76,166, 82,171, 96,146, 85, 18,134, 9,185,247, 60, -190,239, 59,223,253,123,124, 31,255,102, 75,248, 0,207,166, 81,191, 6,129,211, 26,145, 52,132,224,120,139,123, 56,214,142, 6, -192,142, 93, 73,130, 59,120, 68,159, 85, 83, 68,190, 75,107, 91,225, 41,183,233, 54, 38, 92,127,210,159,252, 62,248, 49,202,135, - 12,149,229, 58, 47,255, 89, 59,112, 64, 49,159,215,129,144, 5,151, 30, 22,104,151,246, 37,120, 94,186,225,122,243,237,249,141, -205,247,102, 73,245,162,109,193, 44, 15,173, 93,199, 58,191, 43,170,176, 29, 42, 58,144,223, 55,205, 29, 32,199,203,170, 49,210, -201, 72,224, 64,217,139,250, 67,157, 81, 77, 3, 95, 27,221, 86,160, 14,152, 14, 48, 80, 65, 67,237,159, 82, 19, 77,197,222, 26, - 26,229, 14,114,148, 33, 11,145,164,168, 62, 65,161,116, 14, 89, 10, 11,151, 22,159,175,117,206,156, 58,183,246,242,205,209, 35, - 51,183,111,222,186,255, 96, 37, 74,244,144,224,239, 36,209,113, 92,124,249,182,249,248,105,231,197,171,245, 99,211,199,151,150, -174,207,206,204,126,252,220,221,250, 25,154, 28,115,178,125,162,213,244,223,190,251, 96,186,215, 11,231, 47, 62,124,244,100,174, - 61,231,122,141,149,213,103,158,231,223,187,115,247,242,194,226,242,141,229,171, 87,174,117, 94,175,111,124,234,198, 72,115,235, -193,176, 8, 7,163,126,156,135, 81,214,139,178, 56,214,209, 64,152,196, 71,195,222,133, 66,245,142,192,250, 93,177,252, 66,166, - 41,122, 73,166,195,180,223, 79,152,243,200, 11,224,248,110,250, 18,211, 18,113, 12, 18,214, 90, 19,247, 34, 47, 60, 79,250,128, - 41, 23, 87, 44, 38, 69,106, 81, 71,214, 52, 6,246,192,184,119,117, 11,128,127,240, 48, 48, 13,146,175, 80,104, 90,252, 65,198, - 38,109, 73,181,207,196,235,242, 59, 21, 39,100,247,149, 35,148,222, 57,124,168, 76,250,115,124, 78, 3, 78, 13,174,212,140,213, -212,130, 59, 51, 81,167,167,207,134, 73, 72,170,100,248, 93,107,179,103,223,162, 5, 11,151,236,205,164, 25,138,205,120,130,131, -189, 10, 97,199,133,228, 24, 71, 7,145,161,168,166,168,200, 94,141, 35,103,210,212, 18, 4,153,214, 7,107,199, 24,125,233,159, - 96, 7,145, 68, 25,220, 53,219,184,142,139,119,230, 72, 89, 54, 67,254, 46,244,169,164,100, 67, 85,145,182, 46, 74,146,119,158, - 77,127,170,218,121, 92,194,147, 83, 5,159,225, 64,136, 13,153, 8,160, 42,216,113,129, 15,118,176,222,147,108,255,104,163, 95, -101,141,129,153,145,180, 91,100,241, 75,207,220,250,196, 86,132,116, 73, 27,160,227, 99,150,108,135, 91,166, 56,207,112,218, 53, -137,147,216, 92,131,207, 49, 32,157, 0, 30,127, 96, 79,115, 16,197, 88,185, 75,244, 16, 0,212, 20,135,182,240, 68, 60,130, 2, - 14,128, 20,181, 28, 95,212,103,193,240, 13,167,178, 4, 98,157,255,161,224,112,156,197,146,225,232, 18,203, 49, 61,243, 84,112, -112,144,134,117,159, 11,189,219,100, 31,212, 6,157,254, 63,184,155,199, 47, 1, 24,187,154,214,182,129, 32,186,210,234,203, 73, -145, 27,219, 13,105,192, 7, 67,211, 30, 2,133, 66,207,201,239,235, 31,233,181,244,152, 67,161,237, 31,104, 15,166,105, 74,105, -112,161,216,212,137, 99,203,118, 34, 75,187,154,238,204,172,100,153,226, 16, 48, 6, 99, 35,100,118,244,102,118,230,189,183,222, -195,233,201, 80,243,251, 37,242,147,201,225,190, 7,178,160, 13,160,164,186,195, 68,131, 98,103, 45, 1, 10,117, 52,142,103,112, -216,186,107,218,168,173, 44, 76,217,197, 51, 51, 47,110,183, 23, 38, 1, 22,157, 40,190,204, 19, 84,151,101, 43,218, 22,107,238, -206, 17,151, 3, 47,107, 74,114, 95,202,228,118, 6,188, 58, 46,115,174,241, 77, 21,108, 45,160, 76, 60,165, 69,250,245,247, 23, - 50, 73,244, 41, 40, 75,255, 25, 76,215, 68, 9, 43, 27,241, 30, 11,170, 77,105,142,165, 40, 71,188,219, 8,221,222,147,222,249, -240, 66,160, 16,212,203,117,142,210, 90, 71, 14,228, 72,161, 45,175,143,169, 0,141,244, 32, 87, 78, 88,181,240, 37, 54, 46, 19, - 3,171,202,252, 53,103,169,116, 16,160, 5,166,193,140, 56,110,245,251, 63,143,158, 29,191, 56, 58, 62,251,244,121, 48,120, 51, -153, 47, 27, 65, 96,110, 55,144, 94,216, 8, 59,237,199,251,157,118,183,219, 61, 60,124,218,106,239, 53,227,189,211,147,158, 73, - 21,111,223,189, 79, 22,233,143, 95,127, 94,191,122,153,220,102,233,229, 48, 75,179,131, 78,167,127,254,237,121,175, 23,133,193, -217,135,143, 6, 18,174, 38,215,227,241,228, 38,153,253,189,158,174,104, 60, 26, 40, 29,250, 62,243,125,232, 73, 70,175, 30,178, -164, 71,248,114,136,200,126,151,225,174,149, 79, 55, 48, 32,152,229,197, 42,215,145,217,146, 9,174,162,112,162, 65, 58, 50, 64, -197,176,158,214, 35, 4,214,194, 82,145,217,201,143,243,191,180,186,176, 3,246,173, 4,112, 42,126, 93,125, 47,151, 50, 14,227, -249,166,228, 53,215,169, 73,162,174,216, 16,185,193,134, 80, 8, 63,206, 87,211,234,113,170, 44, 21, 13,208,104, 50, 32, 67,189, - 49, 90,200,173,205, 47,145,143,173, 51,185,118, 92,168,136, 49,214, 45,182,228, 4,219, 38,236,197,232,187,192, 42,222,173,137, -105,161, 6,206, 5,125,235, 25,188,168,192, 28,172, 73,157, 45,199,203, 38, 15, 48,216,133,126,164, 85,206,167, 5,212,208, 29, -202, 3, 68,236,149, 93,123,135,182,217,200, 64, 78,199, 24,108,223, 17,185, 53,105, 19,107, 63, 80, 66,110,231,186,124,176, 7, -111,173,203,172, 0, 22,130,209,197, 5,128,127,192, 5, 59,233, 17,133,205, 67, 64,211, 77, 97,135,174, 22,220, 93,182, 30,177, - 12, 28,233,121,108,207,135,245, 82, 57,201,164, 73, 26, 93, 83, 10, 81,121, 98, 32,166,187, 2, 79, 46,144,230, 73,118,168, 75, - 3,150, 38,183,214, 71,144,108, 3, 53,127, 10,203,196,253,214, 65,228,239, 12,174, 6,139,124, 73,220,101,104,238,182,198,179, - 17,119,116, 89,143,136,202, 37, 75,122,135, 50,128,177, 5, 0,101,198,167, 52, 67,138, 56, 1, 59,225,163,184,209, 28,221, 12, - 65,108, 88, 95, 75,100,255, 84,139, 75, 22, 83,181, 2, 31,185,103, 58, 37,127, 75,187, 12,187,232, 19, 57,205,116,122,183, 88, - 57,150, 77,178,149, 62, 95,151,107, 20, 15, 6,247,251,133, 78,255, 4,160,236, 90,122,155, 6,130,176,119,237,120, 19,215, 10, -162, 84,161,129,166, 7,144,106,169, 84, 92, 56,113, 64,192,129, 43, 66,156,185,112,224, 7,113, 68,252, 20, 46,168,160,138, 22, - 81,169, 17, 72,125,241,136, 8,105, 21,104, 20,226,168,241,123,217,153,221,181,157,166, 66,224, 75, 14,113,226, 56,222,121,236, - 55,223,124,243,143,250,192,124,182,155, 67,172, 13, 96,159, 64, 64,198, 7, 6,125,240, 38, 16, 96, 16, 74,193,126, 63,194,149, - 51,151,136, 59,205,139,111,100,138,112, 4,227, 47, 66, 16, 9,227,176,161, 35, 85,225, 37,151, 23, 90, 7,189,189, 20, 54, 65, -169,132,222, 21,133, 22,154,236, 39, 81, 66, 16, 78, 53, 36, 39, 82, 87,254,193,151,123,139,222,110,111,119,117,121,229,176,119, - 32, 41, 49, 69,217, 76, 5, 24,243,250,226,181,238, 73,151,114,153,206, 64,248, 49,181,178,130,183,228, 29, 13,142,253, 96, 20, -165,233,254,209, 33,108, 75, 77,132,251,169, 97, 19,115,144,140,125, 55,166, 17, 19,190,225, 84,220,225, 36,101,160,115,154, 37, -140, 34,197, 11,110,222,177, 45,241,250,236,233, 19,167,230, 62,127,241, 50, 20,238,223,160,243, 23,234,226,253,147,225,112,115, -243,195,131,123,119, 95,189, 94,111, 52,175, 92, 92,104,188,223,110, 95,170,187,247,239,220,126,252,232,225,234,205,181,126,191, -255,110,227,237, 78,187,253,249,107,103, 52,246, 39, 65, 28,194, 64, 35, 94,173, 88,189,227,174, 91,187,213,152,119, 87, 60,175, -213,186,218,108, 94,222,249,248,169,243,189, 51,231, 50, 70,233,250,198,155, 56, 78,196, 82,141, 50,226,176, 74, 77, 50, 25,208, -200,170, 34, 29,181,192, 22, 19,240,134, 4,201, 4,233,169,248, 85,156, 8,151, 45, 44, 72,228,239,226,100,102, 19,219, 52,156, - 10,169,215, 88,154, 88,223,116, 42,133, 90,170,168,193,167,140,111,234, 16,151, 10,227, 64,230,113,252,108,243, 77,177,128, 25, - 76,210, 9,104, 17,218,103, 23,104,241,217,115, 29,253, 40, 28,205,122, 42,146, 59,171, 66, 48,139,231,222,156, 23, 50, 0, 70, -217, 33, 50, 64,171,161,211, 12,139,200,128,210, 88,212,134,109, 59, 48,122,121, 73,113,174, 64, 81,132,207,154, 3, 77,133,223, - 88, 73,226, 58, 78,128,116,162,252,238, 28, 11, 34,170, 57,133,151, 38, 58,153,153,100,220,232, 54, 82, 90, 50, 73, 82,234, 63, -146, 23, 78,147, 80,206, 55, 40, 39,239, 18, 32,214,120,139,162,121, 72, 44, 38, 7,110, 68,252, 37,249, 93,254,205, 19, 20,130, - 98, 84,170,249, 42, 70,178,230,216, 80, 45,246, 46, 21,116,177, 39,144,230, 32, 50, 85,163, 0, 48,143, 87,173,221,170, 48,203, - 13,165, 82,160, 88,146,134,170,181, 82,220, 49,235,202, 23,197,123, 73,193,110, 49, 41,203,228,102,159,160, 36,175, 56, 19,135, -216, 64, 75, 95, 34,123,196,157, 74,245,198,210,218,214,151, 45, 85, 3,204, 52,136,193,101, 44, 5,248,246,199,175, 46, 69,238, - 62, 46, 88,152,241, 52,240,127,170, 65, 96, 74, 97, 56,195, 11,234,198, 93,165,151,199,165, 0, 31, 87,172, 95,116, 39, 8,253, - 70, 81, 52,204,134, 58, 54,168,193, 68,242,153,154,231,185, 92,205,106, 37,227,192,159, 98, 13, 36, 33, 81, 79, 9,254,201,108, -202, 2, 10,147, 57,179,199,205,254, 51,115, 23, 75, 58, 45, 13, 62, 43, 31,127, 4,224,236,234, 86,155, 8,162,240,206,206,236, -236, 38,187,217, 36,196,132,210, 90, 66,241, 5,188,243, 7,139, 88,181,224,155,136, 23,190,152,130, 47,160, 86, 8, 18,170,130, - 5,175, 68, 47,138, 52, 87, 90, 77, 91, 55,217,236,236,116,157,115,102,102,119,155, 6, 5, 33, 55, 73, 8,204,110,118,206,153, -115,190,159,179,236, 47, 70,106, 62,115,110,137,208, 91,144,213, 38,118, 36,119, 32, 15, 53, 98,109,141, 1,115,224, 74, 50,102, - 79,201, 6, 92, 46, 92, 35,255,119, 76,254,198, 42,198,213, 90, 36,149,224, 57,229, 30,229, 13,198,219, 60,140,253, 6,103, 92, - 56, 98,114,118, 52,253,125, 2,152, 24,146, 4,119,175, 63,250, 50,249, 12, 40, 37,230, 93,236, 27,200,192, 15, 49,199, 72, 35, -150, 70, 61,155,198, 1,225,184, 45,212, 25,119,129, 98, 57,128, 73,241,156, 80, 48,108,172,171,213,156,130,206, 30,222, 82,195, -234, 37,215, 6, 91,105,150,170, 63,115,154,252,210, 54, 67, 84,115,108,105,109,192, 84,225,188, 91, 28,249,140,171, 12,158,195, -164, 28, 85,188,184, 1,119,213, 7,170,246,108, 6,196, 99,240,192, 10,225,100,153,124,242,248,233,173,237,157,231,207, 94, 44, -178, 76,229,186,173,225,230,230,213,141,189,209, 88, 45, 97,247,193,253,151,123,111,239,221,217, 94, 95,223,120, 61, 26,171,107, -250,122,248,109,188,191,127,240,225,227,241,247, 31,113,220,234, 15,186, 30, 7, 39,131,217, 60, 97, 84, 70, 45, 96,188, 20, 50, -127,184,115,247,246,141,155,107,253,181, 87,111, 70,239, 15, 62,165,153,152,165, 51,220,143,160,119,189,210,241,186, 29, 63, 14, - 73,212,228,145, 15,144, 41,100,172, 2,220,199, 60, 36, 64,120,142,209,202, 2, 68, 12,155, 10,238,138,200,114,154, 23, 42, 31, - 12, 88,163, 31,168,208, 78, 58, 14, 61,156,156, 30,159,205,181, 41,252,185, 22,155, 97, 85, 27,250, 33, 98,146,117,131, 34,176, -247, 81, 55, 72,174,246, 20, 51,207,146,118,247,229,110,128,199,168, 98,165, 86,251,178,245, 45,249, 55, 99,157, 44, 49, 17,151, -126, 23,249,177,148, 34, 10, 98,145, 11,189, 63,177,172,204,173,103,142, 90, 60,131,138, 19, 24, 62,210,128,254,166,103, 74, 72, -197, 63,129, 21, 11,148,179, 94,148,109, 47,203, 17, 75, 54,176, 38,236,167, 32, 47, 34,151,201,234, 23, 42, 12, 82, 13,129,211, -188,144,115,123, 89,180,174, 72, 34,213, 32, 24, 29,220,169,101, 46, 87,244,152,234, 69,254,250,114,172, 25, 12, 49, 12, 5,109, - 32, 99, 92,218, 13, 24,165, 71,118, 96,153, 75,173,111, 1, 88, 79,187,214,128,213,152, 12,150, 45,123,235, 34,137,109,119,116, - 11, 35,204, 4,119, 2,222,176, 84, 99,170, 46,154,168,226,222,234, 69,221,184,217, 74, 22, 73, 57, 57,170, 82, 51,104, 74,188, -163, 79,136,249,207,228, 4, 3, 37,177,214,189, 22,193, 36, 78,101, 28,139, 90, 39, 61,160,169, 48,148, 47,120, 48,144,100, 45, -135,189,225,116, 54,181,129, 92,215, 34, 54,170, 90, 27,217, 82, 17,169,167,248,169,184, 17,135,237, 76,136, 74, 25,233,144, 85, -221,141, 50, 23,219, 26,139,144, 26,155, 88,150,210,145, 78,163,151,230,243,229, 89, 8,208, 12,148,182,231, 73,254, 15,142, 50, -161,114,213, 87,127, 4,160,236, 90, 86,163, 8,162,104, 85, 63,167,199,113, 34, 38, 8,130,171,184, 15,113,103,240, 15, 92,184, -208, 32,248, 77, 46,197,191, 48,130,139,136, 10, 42,146,133, 15, 4,191, 64,197, 4, 12,102,200, 76,102,210,239,169,135,247,222, -170,234,238, 25,135,128, 3,153,197, 16,154,238,174,170,123,111,157,186,231,156,139,234,247,166,115, 57,137,250,200, 43,195,158, - 25,243,124,232,241,166, 57,145,200,185,234, 5,189, 26,229,247,101,128,172,203,144,153, 78, 38,174, 98,205, 37,183, 14,111,164, - 34,217, 24,149,105,114,123,241,125,119,126, 15, 99,112, 46,196, 80,177, 53, 4, 37, 67, 58, 62,241,123,113,127, 86,206,160,198, -124,243,237,149,116,173,238, 38,183,225, 0, 16,184,166,152,229, 59, 80,192,194,180, 50,201, 78,225, 6,171, 26, 89,157,166,171, - 53,240,195,135,119,238, 63, 59,216,179,144,171,103,142,125,232,196,137,166, 35,252,215,225,232, 16,141, 50,144,189, 97,183,216, -232, 89,199,120, 14,227,193,233,208, 88,243, 99, 57, 85, 49,131, 90, 56, 78, 2,152,185,146, 98, 37, 10,235,248,150,200,139,168, - 78,130, 9,173,200,216,147,167,143,175, 94,217, 72,179, 73, 24, 33,161,227,250,181,245,233,217, 4, 98,205,246,214,214,207, 95, - 71, 89,145, 62,223,127,249,224,222,221, 65, 63,129,199,170,231,242,232,247,232,207,241,201,135,143,159,214,215, 46,223,220,188, -177,179,115,123,119,247, 81, 58,157,190,123,255,250,237,193,103, 33,234,188,202,247, 94,236, 79,102, 41,148,246, 85, 53, 39,247, - 19, 68,246,153,135,175, 29,222, 88,154,169,192, 83,144,143,162,144,104,101, 10,226, 41,228, 91, 40,177,145,252,129, 6, 41,154, -197, 86,160,217, 27,134, 65, 31, 22,161,102,121, 84, 68,138,165, 98,254,227,100,156, 9,113, 86,148, 92,198,165,200, 48, 14, 10, -179, 95, 54,101, 15,254,201, 5,226, 42, 29, 48, 34,208, 19,117, 17,240,127, 90,221, 27,224, 82,215,170,236,134,197, 37,249,108, -125, 97, 63,251,170, 13,105,151, 94,205, 33,148, 23, 85,102,142,115, 27,170,145, 81, 49,115, 58,207, 36, 28,196,120, 18, 67, 76, - 73, 57,133, 16,231, 82,210, 26,239,194, 32, 14,162, 97,138,168,142, 37, 59,120, 11,161,185,173,184, 23,246, 40,244,117, 41, 76, - 74,130, 86,224,194,147,124,220,110,227,219, 50,205,235, 70, 4,186, 22,102,147,237,205, 91, 95,191,127,241,169,150,165,200,165, - 58,188, 1,131,100, 64, 52,220, 24,167, 35, 31,125,189, 8,185,215,206, 19,210,196, 29, 82, 5, 88,189,128, 81, 38,215, 61,156, - 43, 28, 29, 94,172, 29, 73,213, 5,107,235,214,106, 49, 26,191, 43, 28,168,173,209,129, 1, 56, 60,214, 58, 16,154,174, 22, 67, -101,167, 61,177, 54,230,201,102,173,249,198,176,201, 44,186,118,208,160,130, 17,140,182,236, 4,180, 98, 96,198,115, 92,101,186, - 37,240, 82,146,160, 82,200,188,213, 60,199, 90, 77,178, 70, 9, 82, 35, 89, 87, 17,174,104,154, 61,181, 39, 57,189,101, 82,237, - 81,186,241,103, 54, 57, 12,126,136, 3,116,149, 25, 4,253, 82, 84, 66,214,218,154,112, 26,185, 29, 88,228,176,140,148, 57,100, - 37,246, 33,246,188, 65,238,161,170,146, 55, 16,143, 3, 33,148,131, 37,218,148, 13,183, 61,128,169, 85,158,115,238,242,144,155, -252,116, 23,106, 90,156,106,171,189,138,115, 47, 32,121,190,149, 34, 75, 75, 18, 52,255,229, 82,185,244,249, 43, 0, 99,215,247, - 26, 53, 16,132, 47,155,236, 93,146,163, 45,180, 22, 65, 31, 44,138,130, 79, 22, 65,255,231, 82,241,185,248,238,155, 8,138, 15, -214,135,226,111,148,114,245,106,239,146,236,109,178,235,124, 51,187,185, 84,165,250,124,129,228,102,119,103,103,190,153,249,190, -127,227, 51,244, 41,166,109, 88,160, 2,114, 62, 50, 55,223,162, 18, 5,196,112,110,127,220, 40,110, 82,188, 88,117, 43,197,249, - 60,121, 13, 76,177,122,225, 85,160,235, 26,198, 97,214,124,153,191, 16,126,138,152,200,121,105, 86,201, 88,243, 26,129,192,194, - 86, 12,186,216,173,124,251,188,153,167, 48,112,167,177,173,125,164,106,193, 65,109, 16, 72,122,110,161,117,220, 4, 31,176,200, - 80,112,141, 60, 73,180, 44,109,107,158, 60,127, 10,156,141,247, 13, 87,168,240, 88,161, 39,166, 53,120,119,172,245,210,178,129, -111, 29, 6,237,182,203, 45,157, 77, 62,206, 62,241,233, 65,103,216,153, 94, 92, 27,231,101,174,167,185,206, 50,112, 49, 82, 98, -160,179,145,214, 94,234, 83,194,251,135, 96, 87,233,151,175,143, 91,123,108,186, 36, 33,103,108,205,116,115,247,253,231,211,177, -206, 31,237, 63, 60, 56, 60,228,217, 44,119,119,111,239,250,206, 70,219, 89, 58, 1,150,243, 66,138,180,239,221,191,243,248,193, -254,102, 89, 60, 59, 58,122,251,238,228,235,183, 47,203,186, 86,172, 83,243,226,213, 27,107,219, 44, 77,139,137,134, 74,170,197, -220, 7,153,162,162,171,148,199,229, 40,104, 42,114,120, 9,178,201,100,130, 48,205, 41, 7,246,224, 17,192,165,105, 73, 49,125, -210, 53,160, 54,155, 45,205,247,179,249,210,218,139,202, 53,116,237,120, 19,244,207,224,170,171,160,171,192,192, 49,164, 48, 48, - 39, 12,243,214,180, 52,131,122,163,156, 28,233, 91, 87,127,236,185,114,188,177, 88,253,228,174,131, 36,137, 34, 56,195, 73,253, -161,142,135, 28,218, 20,115, 28,174, 15,240, 19,198, 82, 88,182,201, 95,177,165,195,149, 12,209,182,140,125,107, 44, 48,242, 5, -239,124,107,108, 19, 14, 32,162, 72,189,162,196, 46, 34, 48, 62,206, 82,174,133,233,188,187, 96, 28,166,135,128,200, 47,180, 80, - 47,247,129, 70, 38, 73,134,194,238, 17,200,192, 5, 86,217,154,219, 34,179,206,247,189, 24, 65,154,252,214,238,237, 15,167, 39, -201,192, 35, 4,174, 12,156,120,103, 76,163,250, 62, 98, 50,233,101, 14,215,222,110,185, 46, 40,156, 76,179,224,126,163,103, 87, -204,228,242,183,249,128,161,170,158,188, 76,242, 36, 21,137,195,124,164,124, 20,137,157, 72, 62,163, 2,243, 6,167,217, 12, 81, - 11,237,159,156, 88, 63, 28,158,146, 11, 42, 94, 6,146,133, 72, 0,171,250, 89, 39, 81, 85, 14, 67, 81, 1,131, 86,169,175, 87, - 21, 45, 54,204, 5, 14, 83, 32, 51, 50,191,158,178,139,167,232,130,158, 7,102,203,136, 14,192, 24, 32,169, 42,254, 77, 39, 18, -125,208, 24,115,191,229,112,177,112, 42, 83,178, 10, 73,254,124, 49,227,166,254, 81,189,170, 71,131,165, 12,252,239,120,154, 55, -185,139,145, 58,212, 58,153,139,132,139, 15,252,179, 68,150,108,180, 75, 13,174,241,133, 80, 83,112,235,142,193,100,157,169,246, -233,102, 6,199,141, 41,114, 97, 54,228, 38, 28, 59, 12,110,122, 21,192,244, 74, 23,255,255,178,198,191, 4, 32,236,138,149,155, -136,129,168,180,146,238,236, 11, 38,182, 19,146, 20,161,130, 6, 26, 10, 26, 10,126,129,142, 79,165,226, 15, 24, 10, 40, 24,140, - 73, 1, 4, 38,133,141,157,140,115,246,157,101,233, 14,237,174,238,198, 14, 36,148, 25, 79,206,231,145,180,218,125,251,246, 61, -125, 27, 82, 39,121,186,185,125, 81,130, 52, 57,188, 74, 46, 43, 41, 92, 91, 97,167,235,201,105,247, 20,205,143, 92,101,145,150, - 15, 56, 82, 83,193, 58,196,122,146, 82,161, 54, 40, 86, 95,113, 7,240, 16, 41,230,239,216, 79,215, 66,167,160,187,152, 77,194, - 34, 36,170,110, 25, 54, 3, 10,239,209,152, 43,181, 91,248,126,175,137, 42,172,144,144,199, 84,223, 8,163,197, 83, 70,241,136, -155, 62,209,124,151, 55,226,126, 54, 48, 74, 47,109, 78, 50,103,200,180, 15, 15, 78, 64, 31,247,143,174,242,203,199, 39,143,190, - 94,140, 13,232,167, 15,159,140,206, 71, 40,216,111, 76,168, 84,166,215,179, 40, 26, 73, 73,205,247,114, 34, 31,248,161, 73, 19, - 45,162, 75, 13, 96, 67, 50, 60,115,109, 81,209, 34, 81,194,201,202,109, 4,170, 14,160,122,151,162,217,140,176,226, 54, 51,112, - 52, 28,156,157,141, 95, 60,127,118,112,120,239,228, 56,123,253,234,165,119,240,101,252,201, 58,151, 11, 10,200,116,233,148,249, -234,205,187,247,111, 63,126, 8,101,192,226,186,180,133,239,119, 59,189, 44,237,117,196, 96, 79,163,121,119,165,195,109,134, 24, - 58,202,175,129, 13,129,199, 85,138, 86,198,160,252, 36, 46,193, 6,199,107,235,174,134,251, 29,147,105,133, 87,152, 7,239,212, -197,100,177, 40,221,108, 89, 22,228, 80,140,181, 21,225,129,180, 41, 43,182,245,168,176, 34, 72,216,197, 24,175, 58,217, 30, 5, - 33,119,161,143, 91, 68,142, 98,156,180,194,167,149,223,136, 58,109, 20,162,183,133, 13, 16,182, 6,236,198,223,176,231,230,153, - 17,215,148,121,225,207,194,175,254,254,158,104,181, 67,231,141,141, 98,194, 66,172,108, 30, 94, 56, 51,189, 21,249,243,181, 34, - 77,219,236,227,176, 61,200,113, 92,208,128,133,223,125,110, 88,193,148,208, 39, 78, 82,235, 80,246, 57,239,104,132, 85, 59,132, -119,120,214, 2,143,101, 55,233, 28,244, 14,127,206,206,135,123,195,249,114, 78, 84, 81,131, 17, 73, 18,140,143, 26, 69,208, 6, - 83, 38,126,253,152,126,131, 45,165,248, 86, 8,146,210, 19, 57,250,245, 25,120,190,187,174,254, 45,220, 38,229, 60,255, 13,209, -187,152,121, 47,117, 36,177, 72,214, 97,128,255, 74,182, 17,155,221,132,116,135,178,102,252,141, 10,154,115,132,205, 76,150,233, -150, 45, 21,141,187,107,130,236, 30, 5,121,192, 68,147, 51, 30, 26,151,244, 17, 11,191,138, 70, 51, 82,110, 11,209,196,129, 65, - 77,112,188,102,202,188,108,129,139,240,207,137,167,121, 35,230,240,132, 99,190,159,246, 47,139,121,164,173, 73,236, 90, 35, 56, - 72, 81, 24, 26, 7,212,104,125,215,100,199,138,248,219,254,134, 80, 11,215,102, 53,229,247, 4,165,150,155, 50,234,145, 83, 80, - 81,100,185,141, 48, 29, 71,143, 10, 65, 8, 80, 73,190, 94,196,160,143,139, 26, 50,158,216,165, 15,231, 4,193, 73,183,193, 9, - 82, 41,118, 49, 70,140,233,252, 62,133, 45,183, 17,184, 8,237,183,228,242,168,117, 19, 94, 14,145, 92,234,253,200,182,174,106, - 62, 21,173,109,239,221, 33,222,128,225, 89,138,187,173,137,255, 8,192,215,149,244, 54, 13, 68, 97,207, 56,246, 56,206,158, 84, - 74,171, 10,184,114,226,132,196,161, 55,254, 9, 23,126, 44, 18, 87, 4, 42, 84, 72, 20, 16, 75, 40,181,147,184,118,102, 50,204, -247,222,120, 73,160, 72, 81, 14,145, 21,203,242,204,155,183,124, 11,250,239,150, 78,230,206, 68,168,145,207,105,246,134, 20, 29, - 77,157,186, 83,201, 48,242, 80, 91,151,222, 84,139,100,206,121, 48,113,137,224,187,205, 13, 60, 62, 31,120,117,112,202, 14, 27, -103,204, 98,161,244,174,100, 28, 71, 42,141,210, 65,148, 74,138,189, 95, 54,159,239, 76,225,118,108, 86,100,154,165, 65,131,218, -183, 37,176,131,100,224, 34,152,173,149,237, 60,158,158,210, 6,166,194, 6,108, 82, 93,219, 66,162, 53,108, 32, 63,196,163,252, -105, 58, 9, 97,182, 33,220,171,221, 22, 27,139,239,173,133,184,144,184,113, 39, 60, 26,244,246,116,118,166, 65,130, 53, 76,225, -230,123,185,199,201,195,141,118, 49,209,132,112,163, 46, 3, 99, 2, 66,198, 0, 93, 94,149,200,113, 93, 52,143, 99,184,147, 40, - 21, 70, 42, 80,177,132, 98, 65, 34, 93,128,126,246,244,201,155,119,111, 31,158,159, 47,151,167,147,209,116, 62, 63,153, 79, 96, - 50,121,121,245, 17,204, 59,204,164, 65,229,194, 66,223,139,108, 13, 91,225, 65, 26, 71,253, 36,211,230,199,122,123,125,179, 89, -229,229,186,218,233, 18,185,142, 36,209,117, 88,209,146,121, 21, 50, 44, 23,158,132,232, 7,114, 40,197, 44, 82,203, 56,237,237, -100,158,217,252, 54,122,255,253,246,242,107,241, 97,245,251,215,182,202, 81,116,112,131,141,137,193,150, 16, 53,123,230,247, 97, -148,109, 2, 56,163, 2, 78,230, 74,147,196,157,115, 26, 94,225, 94, 70,245,255,149, 34,222,142, 26,239,140,230,193,209,139,231, - 47, 95, 95,189, 26,134, 35,109,171, 46, 66,192,214,225,230,232, 76, 24,170, 49,177,138,188, 72, 89, 36, 34,235, 71,244,226,144, - 52,107, 85,216, 7,238, 5,166,143,238, 21, 69,194, 59,158,227,166,186, 81,251,162, 82,170,209,198, 96,101, 17, 18, 68, 34,199, -230,127, 24,238, 72,183,195, 53,217, 49, 34,240,185,216, 19,246, 8,245,104,199,201,180,216,173,217, 42,215,101,117,253, 56,117, -203,252,103,254,141, 64,141,119,188, 55,112,177,239,156, 11,234,174, 88, 91,215,232, 15,102,143, 92,205, 46, 15, 72,164,194,182, -156,215, 22,126, 94, 23, 25, 45,253,187,245,169,111,194,174,119,222, 0,138,116,212, 31,185, 5,225, 5, 26,239, 17,187,105, 0, -146, 33,205,169, 84, 47, 50,123, 77, 30,188,196,234,103,200, 23, 42, 63,172,253,152, 61,144, 41, 22,247,200, 64,134, 54,169,100, - 73, 15,154, 86, 5, 94,116, 0,215, 32,238, 75,214,122, 10,188,105, 19,245,217,201,247,195, 91,206,132, 4,145, 36, 75, 62, 22, -130,146, 33, 15,183,124,235,143,119,183,167,145,138,147,201, 60, 43,114, 26, 71, 16, 20,213, 75,182,225, 33,106, 1,185,189,111, -189, 81, 25, 64,136, 22,140,200,204,161, 44,146,187,239, 98,184,216,148,107,247, 47, 23,143, 47, 62,173,174, 73,192,152,139,175, -125, 67, 76, 13, 61,131, 19, 63, 67,234,201, 84,169, 74, 49,166,110,112, 58,146, 7, 1, 72, 43, 71,201,212, 69,255,218,152,184, - 99,238, 25,136,229,228,108, 91,174, 91, 29,159,131,105,102,171, 27,212,164, 26, 44, 6,119,196,123, 18,199,230,127,226,111,166, - 72,247,147,200,216,116, 76, 43,239,155, 90,253, 17,128,175, 43,219,109, 27, 6,130,162, 72,137,162,175,216, 70,144, 62, 52, 65, -209,255,255,148,246, 19, 10,180, 64, 31,130, 4,177,128,196,178, 36,235, 32,187, 59, 43, 9, 82,147,246,217, 48, 45,209, 60,102, -103,119,103,216,223,131,102,108,159, 29, 41, 44,197,158,137,231,169,177, 89,115,202,148,133,144, 78, 7, 5,156,174,216,108, 46, - 64,127,198,100,247,235,123, 40,118,181,172,165, 31,112,246, 40,238,144,129, 13, 71, 0,153, 16, 65, 90, 11,107, 45,214, 86, 67, - 16, 87,219, 93,182,221,103, 59,199,230,229,254,251,243,183, 62,234, 26,198,190, 45,247,161,128,205, 4, 19,220, 79,161,133, 28, -220,147, 21, 1,132, 50,144,186, 9, 70,132,141,104,244,100,112,171,134, 46, 15,114, 59,116,139,208, 32,244,233,193,221,212, 77, -201,105, 31, 10,215,227, 20, 18,163,154,215, 61, 10,155, 52,159,177, 1,228, 50, 55, 53,247,104,160,166,191,248,180,125,174,215, - 77,172, 18,103, 76,221, 5,155,208, 87, 2, 16, 52,243, 36,146,104,200, 44, 1, 67,159,104,100,175,184, 61,151,181,143,104, 26, - 30, 62,223, 61, 62,229,116, 13,212,157,151,140, 13, 65,100,163,141,115, 54, 47, 61, 65,254, 26, 71,233,149,213,191,212,107,213, -208,156, 58,155, 90,107, 44,133,175,198,191,149,109, 93, 53, 4,219,185, 86, 81, 43,199,170, 40,126, 3,173,121,231,227, 93, 98, -191,108,217,123,254,173, 13,165,239, 79, 85,115,174, 56,132,152, 28, 84, 99,184, 24,166,202, 93,186, 98,144,242,241, 52, 83,174, -234, 74, 15,215, 3, 54, 26,100, 49,226, 8, 6, 8, 17,123, 80, 66,142, 24, 90,123, 1, 88, 71, 14, 29,238,118,218,218,155, 75, -115, 94, 30,208,129,121, 97,138,166,253,224, 68,218, 70,189,102, 36,238,211,153, 12,145, 44, 40,163,109, 75,247,247,200,205, 76, -171,235,225,248,245,119,254,107, 28,208,187,100, 83,183,151,127,213,206,251,143, 64, 13, 97,133,214, 95,163,209, 79,113,149,174, -233, 85,235,174,148, 75,154, 2, 39,130,192,152,145,247, 85, 60, 65, 20, 2,194,232, 36,204,250,192,190,137, 39,251,217,104,112, - 9,160,183, 70,221,189, 45,175,151,165,224,215,224,246, 37, 15,150,178, 45,148,111, 7, 86,103,150,195, 27, 31, 27, 43,109,241, -251,116,153,187,212, 21,213,235, 84, 25, 57,223,119,178,218,193,108,134,209,158, 94,161,115,105, 97, 23,255,183, 75,247,180,109, -199,234, 28, 65,215, 26,201, 84,233, 7, 84,122, 70,164, 8, 42,130,252, 60, 24,115,105, 50, 71, 41, 49, 10, 64,164,226, 12, 14, -212, 67, 86, 98,176, 73, 8,232, 34,225, 19, 92,206,113,236, 56,165, 82,190, 44,164,103, 85,220,227,227, 65, 67,152, 43,151,252, -221,254,147, 49,250,199,211, 79,176,154, 93,195, 40,131, 21, 65, 58,223, 31,118,199,151, 34,175,155,107, 23,196, 90,155,161, 71, - 63,181,176,131,172,103, 86, 93,168,153, 56,204,149, 27, 2,103,197,244,202,110,242,203,233,184,190,165,120,174,168, 10,122, 27, - 10,221,232, 70,164,167,200,207, 47,172, 37,207,110,150,134, 34,182, 17, 98,243, 88,116, 22, 49,129, 3,210, 74,170,199,104, 13, - 31, 86, 7, 86, 45, 84, 44,169, 45, 1,148,159,229, 38,233, 89,204,187,191,120, 94, 3, 19,162, 5,162, 25,185,123, 9, 11,134, -251, 38, 90,106,139, 74,234, 32, 6,223,168,102, 94, 34, 31,142,255,255,110,139, 63, 2,240,117, 45,187, 77, 3, 81,116, 60,182, -199, 14,129, 86, 34,128, 64,233, 2,248, 17,126,130, 29, 95,216, 21, 63,193, 63, 32,177,132,118,209, 82, 81, 22,113,236,218, 51, - 30,238, 57,119,156,216, 41,170, 20,101, 97, 37,118, 50,190,190,115, 95,231,156,228,223,103, 37, 59,187,180,149, 44, 91,154,218, -161, 67,204, 66, 5,172,130,204,225,240,171,133, 41,222,173,182, 46, 43, 64,224, 16, 21,112,172,149, 92,210,155,192,107, 74, 22, -140, 13, 92,182, 72,112,193,231,245,202,186,202, 33,120, 7,131,115, 81,221,117, 55, 63,238,191,139,113,180,192,164,120, 14, 7, -166, 30,184,188,175,171, 23,237, 67, 67,144, 50, 91,248, 58, 12,144,240,168,150, 84, 32, 12,169,153,222,129,167,203, 22, 32, 2, -123,243,241,234,246,151,203,179,237,203,139,191,205,189, 60, 88, 98,130, 23,155,237,186, 94, 93,223, 93,193,191,211,226,229,247, -125,249,244,249,242,219,215, 68,140, 0,155, 19,119,138, 89,171,145, 69,154,177,236,111, 95,223,236,154, 92,146,129,169,238,104, -148,217, 82,123,119,112,154, 5,180, 54, 12,212,248,144,220,186, 18, 40, 91,128,128,108, 9,104, 4,131, 8,185,220,186,198,122, -185,210,122,111,127,239,123,201, 68,247,131,111,186, 97,215,246, 64,156,154, 80,178,186, 66, 9, 97, 88,110,219,245,100,152, 65, -174,208,245, 99, 94,149, 76,228,229, 97, 24,100,183, 40,188, 57, 71, 61,223,189, 61, 63,115,220, 91,236, 88,180,161, 1, 69, 39, - 71,195,216,197,135,200, 1,177,218, 98,142, 85, 23,154, 64,212,163, 55, 42, 94,108, 24,204,147,205, 3,119, 75, 99,171,200,129, -171,132,137, 15,201, 75, 4,179, 16, 33, 74,131,224,207,235, 51, 89, 15,137,152,100,155,223, 15,205, 20, 73,132, 19, 84,222,161, -180,114, 16, 62,204,141,243,102,224, 64,186,231,241,196,120, 46,247,238, 33,180, 75, 92,223,255, 51,208, 25,217, 81,174,103, 32, -162,164, 22, 39,211, 66, 77, 80,255, 66, 60, 70, 44,167, 34, 57,137,218,250, 48, 32, 63,255,176,205,236,226,114,241,216, 60,120, -106,216, 65, 69,127, 40,217,123,162,165,164, 61, 58, 87,148,226,197,178, 41,141,160,162,104, 78, 64, 79,124,196, 19, 57,137, 99, -164, 40, 62,110,158,189,218,117,205, 24,147,114,200,130,249,108,233,214,167, 98,191, 86,217, 25,151,197,152, 4, 48, 41,180,145, - 27,173,140, 27,198,215,169, 13,138, 96, 28,232,115,245,216,200,134, 77, 42,191, 43,249,132, 50,100,179, 17,154,150, 74, 25, 28, - 57, 80, 23,121, 6,176,228,193,173,163, 28,202, 27, 10,124,211, 76,113, 59,163,144, 14, 94, 25,199,117,201, 92, 45, 6,224,105, -133, 18, 29,202,201, 58,223, 13,163,135, 86, 1, 81,202,100, 10, 99, 97, 17, 90, 54,248, 46,103, 25,151,108,165, 90, 91, 96, 89, - 53, 16, 6,233, 74, 39, 87,223,245,123,157,197,128,135,198,211,224, 45, 16, 45,189, 4,151, 32,157,198, 84,101, 96, 15,118,212, -253, 91,142, 52,125,171, 1,246, 72,249, 86, 9, 54,181,195,145, 41,194,109,210,114,154, 89,224,163, 17,129, 84,155,209,148, 49, -139,203,164, 53,206,104,247,226, 17, 54, 49,111,183,152,170,172, 90,194, 9,227,169,247, 79,254,253,253,230,195,245,159,159,225, - 73,154,250,127, 2, 16,118,109, 59, 78,195, 64,212,174,237, 56,105,170,180, 32,202, 10, 16, 66, 60, 33,241,255, 63,194,242,130, -128, 71,164,221,133,210,221, 54,105,220, 92, 28,239,204,216, 73,154,150, 10,245, 37, 82,147, 38,109,199,227,185,156, 57,103,162, -207,199, 47, 4,189, 60,215,156,156, 10,151, 4, 41, 22, 22,166,144, 73, 82, 21, 3,121, 63,234,118, 19,191, 94,170, 85, 94,151, -198, 54, 2, 29, 58, 26,132,151,125, 0,207, 53,115,100, 86,142,118,120,165, 33,210,209, 50, 73,163, 52,149,177, 96,221,151,237, -173,105,242, 44, 93,110, 14,155,198, 86,216,117, 68, 25, 27,218, 59, 7,113, 26, 62, 14, 85,207, 66, 71,104,212,246,197,220,208, -145,101,249, 66, 16,231,177,136, 16,203, 8, 54, 7, 47,170,224,135,224, 2,249,116,185,198, 32,158,202, 56,109,183, 72,230,135, -170,132,119, 73,172,221,145,106, 79,187,154,191,220,150,143,144, 73,128,147,110,162,226, 94,237,143,152,155,144,196, 7,181,248, -153,243,131,114,129, 23,147,178, 90,169, 53,143, 53,238, 61,200,203,216, 33,229, 58,124,207, 8, 37,196, 33,198,103, 11,141,237, -155,166,226,251,131,200,177,232,131, 59, 9,184, 83, 83, 53,149,109, 43,107,231, 90,164, 26,233, 61, 32,133, 1, 51, 47, 13,234, -139,193,229,240, 76,166,129,205, 2, 83,135, 22, 9,147, 61, 5, 54,228, 16,181,169,170, 34, 71,182,157, 84,105,184,118,165,147, - 37,164, 70, 56,110,198,149,211,198, 22, 84,135, 65,216, 17,119, 18,178, 8,239,190, 61,145,155, 96,210,116,198,179, 54, 99,148, -110,109,170,179,178, 46,224, 99,125,244,238, 60,190, 97,226,170,130,236,100,162, 18,162, 80, 15,118, 47, 66,179,116, 50, 95,237, -174, 96,121, 41,240, 87, 62,205,100, 39,188, 40, 33, 48, 98,161,169,197,123, 85, 69, 92,126, 92,213,174, 98, 35,204, 27,159, 65, -226,109, 85, 18,197,121,181, 63,163,153,188,166,122,218, 99, 90,102,108,196,128, 96,131,253,102,249,246, 97,119,151,197, 43,136, - 6,190,223,125, 59,197, 34,123,122, 57, 37,117,211, 30,217, 80, 70, 57, 89, 25,252, 95,248,229,115, 82, 26,161, 8,120,218, 12, -133, 89,223, 70,186,246, 19, 81,251,115,226,223, 49,191,116,164, 55,217,251,119,242,190, 51,162, 92,237,219,203,189,220, 7, 21, - 80, 92,104,108,162, 2, 9, 85, 84,169,112,138,225, 24, 4, 34,196,191, 40, 57, 30, 83,176, 45, 40,157, 13, 50, 23, 30, 21, 41, - 66, 77, 91,216, 0,101, 69,228, 10, 24,114,221, 30, 3, 44,177,235,229,250, 24, 5,239,195, 2,100,130, 4,244, 2, 68, 50, 12, -195,178,224,235, 96,237,120, 62,106,138,205, 49,131,108, 41,120,111,104,229,225, 65,231,222,175, 63,252,188,255, 1,183,163,172, -119, 6, 89, 46,182,146,209,136,113,103, 16,164,205,212, 19, 12,162,153, 46,226, 20,124, 58,220,238, 97,247,135, 35,242,213,174, -211,181,233,142,187,242,105, 49,207,108, 93,195,147,230,102,255, 42, 91,111,138,223,159,222,124,254,250,235,214, 35,185, 41, 81, -109,223,189,248,248,104,254,250, 81,252,109,249,212,147,177,187, 46, 72,123,143,168,251,179, 17, 36, 62,120,224,222, 12,224,124, -200, 33,164,140, 48,166,228, 3, 87,245, 37, 60,120,252,235, 79,164,181,252, 8, 4, 27, 52,181,221,133,194,251,127, 49,242,254, -180,103, 1,248,186,186,222,166,129, 32,104,159,125,113,156,164, 38, 69,162, 68,240, 80,120, 71,202,255,255, 17,133, 63,128, 16, - 66,160,170,129,126,208,226,218,103,159,239,216,217,189, 75, 28, 19, 33, 85,121,105, 20,199,206,222,222,236,222,206,204, 36,191, -167,255,212,122,233,100,130, 45,180, 68,163,153,181, 98, 80,202,251, 51,143, 60, 50,122,174,242,179, 77,177,161,188,211, 88,116, -124,153,194, 58, 32,142,240,224, 40,145, 83, 0, 80, 18,166, 80, 40, 10, 13,215,104,141, 70,141,250,246,244,249,230,249, 6, 12, -143, 4,178,111,200, 96,162,255,239,133, 88, 44, 49, 23,197, 84,185,133, 34,174, 1, 8, 37, 31,108,124,233,123,129, 0,157, 99, -106, 81,242, 56,220, 76,149, 90,149,171, 55,213,235, 31,247,215,180, 11,109, 47,183,119,143,183,247,127,110, 81,130, 72, 33,138, -195,167, 96,234,200, 84, 32, 80, 60, 59, 10, 55, 69,153,110, 85,247,181,112,113, 81, 80,229,174,173,234,199,153,193,125,131, 50, -157, 74, 51,138,226,147, 22,133,220, 44,215,155,142,125, 59,216,196, 3, 2,102,153,164,167,129,221, 75, 9, 19,100,202,149, 69, - 65, 43,175,133, 58,198, 48,131, 10, 15, 18,107,231,187,214, 58,186, 77,237,117, 59,164,176,144,244,137,177,157, 49,150, 62,162, -200, 17,141,142,189,227,251,158, 96,142,167, 61,138, 30, 87,223,117, 4, 89, 58,139,191,166,177,191,155,190, 54, 24, 62,211,202, - 87, 89,161,172,158,165,233,122, 14, 52, 35,165,137,101,117,112,110,202,176, 36,153, 19,213, 15,244,110,224,181,141,142, 26, 85, -208, 92,197,138, 7,165, 15, 94,148, 46, 18,255,170,121, 85,155,122,143, 29,210, 41,229,122, 56,182, 33, 62, 13,113, 5,254, 45, -195,192,226,120,243,240,204,252,246,235,197,249,187,139,247, 31,191, 94,209, 79,127,177,124,245,179,222,149,122,201,160, 38,100, - 26,218, 30, 8, 31,212,124,166, 26,101, 73,255, 47,216, 55, 29, 61, 24,203,120,241, 17,253,254, 32,234,128,223,195,129, 45, 15, -104,231,121, 78,193,137,131,154,196,211,165, 91,251,188, 44, 94,208,243, 30,159,140,142,148,129,125, 50,181,234,150, 81,118, 92, -229, 37,143, 60,166,251, 53, 61,253,134, 42,168, 45, 5, 77, 63,117,240, 63,245,194, 97,136, 30, 26,225, 46,124,180,254,101,127, - 61,153, 87,247,172, 18, 32, 22, 14, 89,166,217,149, 24,152, 58,135,124, 16,189, 2,247,100,180,235,228,130, 75,152,189,138, 33, -201, 18,239, 21,123, 28,149,196, 10,128,214,138, 97, 31, 83,108,250, 3, 55,195,161,200,193, 77,116,172,143, 44,227, 73, 1, 57, - 77,197,231,241,210,204,246, 44,167, 56, 73, 46, 41,211, 50,177,130,235, 54,129,231, 78,154, 51, 22,138, 95, 3,122,179, 56,223, -132, 36, 36, 93,142, 0,206,135,203,237,167, 47, 87, 92, 21,137,130,129,223,172,223, 94,223,125, 23,114, 64,140, 64,148,163, 82, -113, 84,229,250,201,212,221,208, 10,129,137,109, 85,157,214, 5, 97, 56,110, 53,130,195,221,195,150, 82, 28, 42,177,102,233,169, -157,205, 43, 2, 10,187,135, 29,225,177,186,111,147, 48,225, 29, 49,206,209,239,235,198, 77,194,133, 94,152,193, 12,135, 48,144, -229,130, 65,206, 64, 22, 30, 3, 29,127, 76, 56,147,238,103,168,107, 93, 18,185, 26,242,239,170, 60,127,104,126, 73,247, 47, 61, -205,174, 58,209,177,145, 55,253, 21,128,176,107,217,109, 34, 8,130, 51,179,111, 59,107,227, 56, 78,148,228,150, 19, 23, 68,196, -129, 3, 95,207,129, 63, 64,144, 27, 8, 4, 66, 65,198, 78,252, 90,143,247, 49,116,117,143,119, 45,108,137, 40,135, 40,209, 90, -206,120,166,167,250, 81, 85, 93,124,215, 39,101,172,247,160, 36, 56,216,160,218, 59,163,225,135,144,217, 10, 98,178, 14, 70,131, -227,113, 67, 67, 65, 37,186,205,110,179, 48, 45,189, 8,156, 52, 99,205, 94, 24, 58, 25,196, 73,233,162, 60, 77,123, 38,161, 29, -243,105,246,176,114,139, 48, 8,231,235, 25,238,115, 10,241, 4,235,188,214,123, 51,204, 70, 5, 84,255,109,171, 85,205,172, 66, -109,188,142,159, 84, 14,213,184,127, 94, 55,118,187, 43, 81,242, 3, 12, 49,160,151,250,150, 17,229, 93,200, 25, 67,214,119,166, -213, 64,232, 55,241,155,187, 87,159,191, 63, 68, 38,124,247,242,237,251,143, 31, 0,222,121,152,243,254,238,245,183,223, 63,158, -182, 11,168,139,112, 89,181,226,171, 91, 20, 44, 85, 80,149,163, 98,169,232,141,195, 32,187,172, 42, 90,130, 4,189, 8,216,177, - 2, 89,163, 24,205, 57, 71,173,138,186, 9,124, 43, 90,179,157, 36,140,100,105, 85,110, 38, 23, 17,197, 91, 84,114, 32, 86, 83, - 20,205,218,110,215,187, 29,237,210,188, 31, 77,242, 44,146,113,117,180,112,107,187,173,144, 71,243,175,214,150, 80, 72, 92,112, - 31,148, 2, 62,189,154,181,150, 94,102, 67, 55, 18, 4, 31,161,243, 14,136,131,115,172,210,164, 49,177,219,172,213,124, 85, 85, -182,201, 84, 48, 8,240,239,247, 76, 72, 23, 12,125,128, 27, 87,128, 37, 92,107,152,224,224,216,225,217, 26, 14, 9,248, 24, 36, - 33,246, 21, 50,134,146,245,190,136,145,133,153,148, 47, 83, 78, 36, 91,181,247, 99,113,164,182,128,184,199,227, 74, 31,149, 13, - 15,131, 32, 4,146, 53, 93,111, 5,159, 16, 63,155,145,198, 61,187,243,134, 68,251, 32,222, 82,138,252,182, 36,196,196,124,153, -147, 52,111,105, 91,185, 28,148,241,101, 75,198, 20, 35,239, 28,244,212, 69, 28,166,121, 50,156,173,167, 29,185,175, 19, 81,192, -245, 28,199,177, 24,206,180, 51,162,142, 25, 21,236,149,170, 15,135, 85,134,189, 23,207,197,147, 62,146, 25,233,132,142,165,142, -208,130, 54,119,196, 74,119, 18, 89,221,120,112, 57, 95,254,209,135,241,157,151,250,106,112, 61, 93, 61,118, 28, 2,237, 9, 83, -236,103, 35, 7, 83,115, 47,193,136,200,111,196,156,210, 40, 12, 35,238, 60, 81, 58, 24,195,149,212,247, 66, 83, 8, 81,235,145, -137, 46,243,228,162, 31, 76,206,226, 44, 2,183, 3,224,200, 40,200, 25,237,234, 85, 81, 63,111,213,220,186,231, 66, 79, 45,134, -106,185,157,206, 80,156,237,105, 27,241, 74, 83,222,164,201, 19, 89,157,145,152,208,142,187, 9, 94,166, 63,222,140,174,191, 60, -126, 85, 92,231,196,174, 83, 28,223, 57,202, 75, 65,166,100, 29, 25, 91,239,232,219,155, 67,104,137,184,194, 74,197,242,157,101, - 57,101, 69,115,192,228, 46, 19, 18,149,217, 70,180, 82,184,100, 14, 29, 90,140,157,241, 4,179, 86,251,168, 45,129,187,153, 12, -174, 86,118,185,177, 27, 86,174, 69, 73, 21,251,173, 44,248, 89,233,150,243,196, 55, 83, 90,219, 34,138,211, 93,222,121,132,179, - 93,135, 57,124,182, 40,144,252, 95, 71, 4,145,105,162,163, 65,112,225,188, 55,254,181,248,201, 85,181, 64,204,190,157,127,202, -157,116,177,255,239,215, 95, 1, 24,187,154,222,166,129, 32,234,181,189,235,196,105,154,180,165, 34, 10,109,175, 61, 32, 33, 33, -241, 19, 16, 7, 78,252,205, 30, 56,240, 39, 56,113, 65,170, 4, 7,132, 56,160,138,150, 32,112, 29, 39,177,119,237,101,222,140, -183,233,135,144, 80, 47,109,213, 86,105,108,207,190,153,121, 31,125,125,127,216,198, 42,117, 31,230,132, 41, 77,220,115,149,250, -129, 90, 34,197,158,153, 90,106, 58, 58, 88,173, 74,222,189,163,203,153,234,221,163,209, 28,166,172, 45,112,161, 97,142, 59, 29, -140,131, 4,105,210, 17, 50, 49,116,101,175, 63, 46,206, 55,160, 57, 71,214, 55,147,157,131, 69,113,229,162, 70, 8, 78, 62,164, -174,136,122, 34,238, 37, 33, 76,153, 98,226, 47,138, 55, 11, 16, 38,217,110,194,238, 22,224,115,211,177, 76, 53, 34, 65,135, 72, -197, 66, 83,113,167,219,154, 62,225, 61,254, 36,223,157,237, 61,254,126, 9, 77,211,132,112,104, 83,209,177,148,153,193,186, 94, -159, 30,157,254, 40,174,126, 45, 23,142, 53,217, 98, 26,205, 89,191,214, 98,139,132,145, 56,221, 88,179,233,188,172,139,206,212, -101, 86,194,176,203,182,138,165, 10,141,197, 25, 76,101,118,152,197,153,166,202, 11,173,228, 10, 57, 5, 62,136,103, 9, 83,227, -156, 27, 38,201,163,124,120,213, 53, 29, 91,245,121, 24,243,182, 21,189,148, 6, 69,150,106,251,124,154, 79,198, 73,170, 65, 96, -183,206, 91, 36, 5,131,224,149,153,132, 30,165,198, 69,229,146,192,135,134,138,149,110,195,149,229,119, 28,220, 26,234,142,168, - 58,215,206,215,120, 68, 34,109, 34,234, 19,172,133, 0,138,142,168, 77,221,137, 85, 22, 53, 86,206, 54,166, 77,119,210, 56, 79, - 77,110,140, 28, 84,141,229,176,121, 54,225, 70,149,119, 24,200, 99,158,150,152,181, 68,222,120,153,156, 80, 5, 73,157,119, 15, - 55,159,130, 69,238,102, 57,133,145, 98, 58,156, 77,143,191, 46, 62,211, 69, 28,233,113,101, 75,245, 79,251, 35, 21,132, 33,219, -205, 16, 19, 96,224,194, 90,246,120, 95,221,171,155,108,245,140, 45,107,134,144, 22,188,253, 58,201,109,187,209,160,226, 57, 94, - 93,246, 57,186, 55, 97, 70, 80,108, 36,250,201,254,201,183,159, 95, 66,204, 75,226,239,206, 52,251, 16, 59,129,182, 91,168, 20, -223, 78,252,136, 2,241,151, 67,115, 25,179, 9, 92, 21, 81,129, 16,232,152, 97,153,233, 12,142, 61, 16,100,222,156,124,173, 10, -222, 10,106,107,160,102,232,123,176,127, 8,143,216, 54,139, 67,162,211,120,144, 24,135, 45, 84,212, 7, 27, 97, 0,154,242,215, -146,177,164,241,136, 0,173, 19, 78, 55, 88, 55, 17,246,130,122,143, 49,123,108,148,222,215,233,108,172, 79,166,249,241,161, 57, -152,100, 8,113,230,177, 51,195,100, 40, 93,188,200,152,101, 76, 17,177, 23, 99, 27, 93, 47,221,197,159,238,178,208,139, 58, 90, -212, 54,230,145,178,239, 67, 2,197,147, 56, 22,230, 5,107, 86,227, 48,184,216, 74,142,195,130, 78,208,127, 39,195,119,180,237, -124,165,128,226,209, 95, 90, 42,253,185, 25,190,124,254,234,236,253,153,247,194,122, 8,101, 1,155,216,195,162, 42, 28,156,120, -149, 80,163,100,101, 73, 63,178, 55,222,255, 93, 21, 72,127, 99,186, 24,253,226,208,140,186,214,174,152, 33,218,219,140,243,255, - 40, 83, 23,134, 18,160,193, 83, 47, 77,231,222,198,210, 99, 93,247,163,155, 48,158,244,210, 54,121, 69,127,106,221,172, 6,233, -160,106,150,183,147, 15, 8,235,108, 44,174,172,209, 3, 58,213,170, 62,231,175,227, 15,246, 91, 84,234,254,116,197,119,175, 95, -188,121,247,225, 45,245, 84, 46,114, 79,231,207, 62, 93,156,135, 56,239,109, 60, 89,191,116, 69, 25,102, 77,238,255, 85,249,191, - 2,208,117, 45,203, 73, 4, 81,180,231, 61,204, 16, 36, 60, 12, 65, 99, 54,198,111, 72,249,225, 86,185,114,161, 11,183,254,128, - 86,202,128, 4, 34, 33,192,192, 60,122,166,189,231,118,143, 76,208,164, 42, 83, 44, 72,120,116,207,125,156, 62,247,156,255,196, -119,235, 25,111,109,167, 57, 58,136, 30,205,137,130,150,107,187,155,221, 26,157,157, 18,124,182,231,131, 36, 35,128, 35,116,227, - 46, 76, 14,149,104,123,237,113, 60,166, 43, 85,124,190,237,107, 59, 37,122,151,203,244,254, 87,114,255,152, 62,224,126,224, 49, -113,179,180, 16, 13,231, 86, 75,135, 11,165, 77,216,235,217,107,206,210,157, 86, 7,116, 37,248,126,241,102,174,212,184, 63, 78, -246,155, 28,130,250, 40,168,152,233, 5, 33,120, 14,235, 80, 51,134, 14,175,227,250,240,203, 67, 57,175,105,185, 20, 44, 4,244, -231, 64, 73,172,248,175, 36,163,130, 5,164, 93,165, 70, 39,138,170,120, 51,184,184, 58,191,250,240,237,163,235,121, 37, 78,122, -219, 89,153,166, 50,167,125,219,234,200,120, 72, 91, 38,203,115,181,195,185,178, 74,169,172,149, 10, 64, 38,196, 0, 4,100,175, - 97,118,234,122,244,176,210,248, 38,171,247, 8,251,211, 98,234,250, 62, 64, 78,174,117, 50, 89, 20, 96, 31,149,113,232,157,117, -163, 86,232,176, 33, 22,107, 86, 11, 25,120,118, 59, 10,109, 20,212,249,104, 52,186,126,127, 61,236,247, 62,127,249, 74,153,232, -251,205,207,201,237,173,235,249,236,155, 93,166,153, 76,246, 50,231,122, 39, 8,172, 0,100, 77,106,207,149,231, 9,106, 15, 50, - 41,182,137,216,236, 42, 45,110,179,167,140, 66,159,182,144,177,235,132, 20, 14, 88,120, 13,148, 82,250,133, 16,183, 98, 80,158, - 79,166,204, 4,185, 48,162,205, 13, 10, 23,147, 35, 79,178,124, 71, 29, 4, 5,141,113,119,116,179,252, 97, 31, 23,233, 70, 59, -196, 50, 7,179,205,112,166,142, 88, 98,161, 23,165,197,142, 94,162, 19,210, 66,211, 46, 42,105,231, 12, 78, 6,147,199,137, 14, - 21,212,123, 81, 59,172,229,201, 84, 61, 0,113, 26,245,182,251, 21,103, 29,214,221,109, 30, 59,170,227, 66, 94, 99, 47,244,159, - 41,232,229, 90,185,247,232, 52, 85,136, 90, 11,204,152, 52,214, 44,141,102,100,175,201, 27, 22,243,227,169,196,137,250, 20,121, -127,111,230,134,255, 12,144,171,188, 28,188,157, 61, 78, 51,185,167, 64,113,222,125, 53, 91, 78,109, 30,123,160,180, 25,123,241, - 58, 93, 61, 85, 15,212, 35,166,214, 97,232, 74,212, 34, 47, 6,159, 81,168,197,117,190, 81, 44,236,197,101,187, 62, 44,165, 54, - 15, 1, 29,165, 57,117, 66, 84,170,195,227,133, 74, 43, 40, 85, 88,116,165, 93,232,209,173, 58, 10,252,215, 47,226,119,103,225, -197, 48, 14, 2, 71, 3, 9, 88, 33, 13,248,224,194, 19,166,156,171, 24,247,192,169, 20, 93,169, 44, 0,150, 34, 43,125,157,175, -197,221,202,157, 37,238,170,168,114, 89,154,169, 81, 80,126,209, 64,170,167,210, 8,127, 23,220,240,157,193,138,212,233, 3, 38, -156,146, 5,125, 1,207, 50, 68, 72, 15,227, 8,140,219,197,122, 94,177,149, 27, 27, 82, 27,167, 61,131,209,152,142, 16,111,218, -228,100,134, 81,244,189,204, 42,114,120,206,105,171,191, 74, 31, 10,170,146, 44,227, 99,195, 1,187,172,145,247, 67,214, 6, 39, - 19,141, 15, 14, 14,168,224,211,238,101,165, 6,213,240,210,156, 62, 12,203, 18, 22,131,204, 37, 62,140,119,196, 65,156,164, 9, -127, 79,104,112,217,126,173,210,110, 83,148, 98,169, 63, 16,199,208, 61, 16,170, 94,251,229, 98,123,231, 90,154, 55,161, 63, 17, -194, 45, 27,132, 55,201,253, 21,173, 36, 20, 49,255, 97, 46, 60,247,243, 71, 0,186,174,118,181,137, 32,138,238,236,247,110,178, -177,177, 73,105, 10,165, 21,170,224,143,130, 84, 65,240, 13,196,135, 16,244,101,212, 39,210,103, 80,139,136, 63, 4, 21,173,162, - 41, 38, 45,113,235,102,191,103,188,247,204,238,166, 68,154,127, 33, 63,118,118, 51,123,231,220,123,207, 61, 71,243,103,140, 75, - 70, 89,226, 74,129, 49,213,158, 24,130, 69,219, 9, 34,197, 25,139,170,211,253,223,191,245,224,237,151,215, 22,236,119, 27, 27, - 23,101,134,174, 95,115,247,195,132, 36,155, 9, 16,237,176, 94, 23, 14,109, 46,109,104, 93, 50,232,202, 48, 88, 20,186, 38,163, - 26,193,119,217, 48,136, 34,127, 16,231,177, 45, 86,117,127,126,255,109,111,216, 31,158, 46,166, 30,187,114,107, 98, 45, 23, 15, -209, 44,226,201,139, 59,251,135,159,167,159,108,197, 48,126,224, 69,163,104,115,107, 48,250, 49, 63,161, 77,227,192,185,209,129, -240,251,181, 96,192, 98,241,152,204,212, 90,115,144, 51, 83, 93, 65,144,241,187,170,233,114, 55,119, 14,142,191,189,103, 51, 38, - 52,238, 37, 15, 13,138, 73,180,243,245,236, 4, 42, 5, 20,176,165, 77, 97,212, 46,135,155,130,107, 68,138,123, 74,113, 44,138, -210,170, 10,147,144, 61,225, 58, 2,205,227,254,228, 87, 50, 45, 25, 90, 90, 51,107, 97, 6,174,118,118,103, 41, 77,138,201, 70, -157,148,116, 57,107,123, 35,194,216, 17,102, 79,108,139, 18,212,144, 9,245,188,159,238,221, 61,122,252,228,233,222,237, 67, 66, -129,179,239, 31,199,147,221,139,249,236,197,179,231,111,222,125,168, 42, 43, 7,250,206,153,157, 87, 51,131, 21,181, 43,186, 37, -122,244, 97,207, 8, 61, 58,220, 84,186, 52,210, 76, 36, 25,203, 75, 20,218,105, 85, 1,245, 23,180, 64, 66, 56,101,104,112,183, -156,190, 86,156,185, 72,102,193, 55, 32, 8, 53,249, 70, 10, 4,213, 51,163, 83,203,230, 62,117, 5,153,117,199,246,179, 42, 53, -175,156,176, 91,119,154,166,135,124, 61, 28,157, 47,231,173, 70, 57,255,155,190, 19, 84, 85,222,243, 35,204,250, 11,185,114,216, - 64,207,159, 19,193,160,157,102,106,162, 6,165,134,116,232,238,141,111,156,255,153, 17,188, 18, 45, 65,160, 91,135,239,248, 73, -153,232,197,123,182, 7, 29,202,252,127,247, 37, 93,104, 53, 47, 85, 53,105, 1,174,235,177,108, 45,143,165,116,210, 90,188, 20, -130,255, 21, 76, 60,154,246, 25, 88,219, 24,219,213,244, 69,110,123,134, 94,148,149, 9,197, 78,215,113,105,123,107,207, 25, 46, -249, 97,116,187,172,203,203,109,225,182, 1, 96,174,113,111,186,248,206, 45, 83,200,110,210, 3,167, 91,150,117,129, 54,166,112, - 48,245,206,190, 46, 22,247,156,251,126,100,170,148,118,172, 11,173, 94, 78,153, 77,123,199,119,119, 55,130,131,173,222,254,118, -223,113, 91, 1, 62,126, 75,160,207,167,133,185,185, 31,229, 56,126,224, 6,125,179,215,183,109, 95,216,158,130, 37, 41,119,233, - 41, 75, 45,242, 34, 91, 38,113,156,254, 93,164,201, 69,150,167,241,133,250,121,230,253, 94, 6,211,172,176, 0, 86, 25,203, 27, - 22,142, 45,161,203,208, 58,198,180,249, 25,216,142, 40, 4,104,182,123,169,221,150,101,157,195,142,131, 47,196, 41,152, 4,175, - 70, 65,140,186,227,207,192, 91, 22, 30,241,162,105,236, 55,255,111,221, 78,234,210,111,219, 27,147,233,226,148, 19, 14, 12, 60, -176, 92,153, 38,209,104, 90,165, 46,181,180,141, 81, 29, 85,101,187, 93,192,204,215,236, 96,133, 1,230,170, 66,164, 38,216, 78, -137, 23, 24, 62,205,100,178,212,144, 92,182, 20, 75,240, 53,233, 46, 30, 30, 61,122,117,252,178,161, 91, 1,113, 11,185,146,134, - 88, 27, 61,107, 7,182, 68,215,129, 85,221, 41,216,141,115,173, 94, 22,185,238,168,115,245,231,159, 0,140, 93,203, 78,220, 48, - 20,181, 29, 59,113,156,100, 2, 12, 47, 1, 66,106, 65, 21, 21,234,170, 31,192, 15,148,191,232,162, 82,255,148,101,145,250, 5, -244, 65, 41, 12,204,123, 38,177,211,123,175,237,233,136,178,232, 46, 11,132, 50,227, 59,215,247,113, 30, 65, 95, 44, 9, 74, 74, - 33,200,252,228, 46, 89, 19,234,243, 10, 74, 89, 90, 88,219, 32, 85, 21,190,122,106, 48,189, 7,250,205,253, 13,186,159, 19,177, -121,101, 50,131, 30,205,254, 58,141, 74,143, 56, 30,134,211, 98, 86,103, 25, 57,110, 59, 58, 47,235, 37,159, 16,220,225,161,137, -212,122,249,106,198,232, 98,218,206,188,189,117,196,188, 7,235,212,147,189,211, 95,195,159,185, 42, 32,229, 17, 51,205,251,123, - 4, 43,153,251,209, 29,252,122, 20,173,239,225, 64, 23,243,233,254,230,238,116, 62,133,170, 0, 26, 11, 17,153,180,232,223,197, - 90, 82,226, 8,195, 59,223,135,186,224,207,192, 40,169, 89,232,185,190, 61,254,240,132, 65, 17,171,204, 58,175,111,135,183,116, -156,110,110,219,201,194,142,103,237,112,204,187,105, 53, 24,240,135, 65,119, 55,224,138,239,253, 30,141,151,150, 52,161,164, 90, -218,249,176,121,132, 23,128,242,159, 59,161,170,101, 94, 17,119, 36, 65,109, 54,194,145,177, 84, 66,115,151,244,140,210,248,246, - 82,103,210,228, 41, 71, 88,125,183,179,213,187,188,252,240,241,211,103,104, 39,220,252, 59,103,139,167,135,219,175,215, 87,199, - 39,167,189, 66, 95,127,185,170,123,186, 44, 36,250,124, 43,218, 58, 19, 55,203,181,190,152,146,172,147,200,207,106, 92, 42,187, -178,128, 46, 4,125,166, 74,109,222,159,191, 77, 92,247,240, 52, 18, 76, 65,107,106, 12, 52,167, 75,133, 24,141,196,155,162,101, - 8,255,193,200,134,103,200, 26,112,244,129,245, 72,133,118,131,176,141, 96,192,226, 35,143, 54, 46, 44, 87,166,117,110,141,109, -131,114,169, 43,133, 50,190, 6,109,244, 17,211, 34, 87,123,133, 98,196,139, 6, 2,102,209, 44, 68,180,164,128,144, 36,169,188, -150,210, 61,220, 98,173, 95,124,194,231, 48, 16, 6,110, 25, 44, 6, 33, 7,183, 51,137, 13,155,116,168, 89, 13, 79,146,192,252, - 40, 19,214,203, 55,160, 57,161,178, 2, 99,239,217,164, 61,200,145, 48,151,169,212, 51,104, 14,183,143,209,171, 19, 23,154, 24, - 11, 98, 45,185,123,201,189,158,169, 59,114,160, 21, 44,250, 60,118,236,236,240,124, 4,213, 15,114, 89,177, 14, 32, 52, 32,150, -181, 40,209, 46, 72,165, 48, 16, 19,162, 74,231, 90,157, 11, 89, 24,233,148,130,121, 60, 76,247, 87,104, 0, 51,187, 74, 82, 98, -237, 34, 9, 83,146, 3,178,196,117, 23, 86,232,154,188,195,140,228, 38, 85,149,130,102, 57,209, 10,158, 69,153,164, 7,133,121, -183, 83, 95,188,234, 95,156,245,223, 28,150, 91, 53,166,118,248,109, 40,232,104,179, 52, 77,113, 86,147,224, 2, 13,190,202,170, -216, 59, 42,247, 95,235,221, 35, 81,244,109, 82,206,108, 50,111,216, 24,154,194,165, 67,171, 94, 43, 27,161,121, 86,101, 27, 59, - 69,255,160,218, 62, 50,213,150,214,108, 35,159,212,106,150, 58,221,118, 26, 7,241,194, 15,187, 2,180, 38, 90,114,174,216, 92, -248, 7,219,101,127, 74,250, 98, 43, 85,181, 54, 56,233,185, 56,160, 96,177, 57,163,217, 16, 11,132, 12, 23,175, 87,254,162,144, - 17,101,235,241,108,226,109,130, 56,143,183,181,175,157, 57,135, 24, 38,136,101,199, 86,222,226,193, 23, 37, 12,213,144,201,134, - 46,164,155, 56, 87,192,169,189,243, 14, 32,148,214, 26,207, 73,166, 85,170, 37,120, 81, 80, 94,164,149, 96,208,198,128,226,178, - 69,241,226,240,239,130,185, 7,127, 65,106, 41,210,164,248,191, 32,153,240,186,207,137, 78,221,255, 43,145,253, 17,128,174,115, -233,109, 26, 8,226,184,189,118,214,113,146,186, 4,218, 34,218,170, 45, 80, 82, 64,156, 80,203,153, 15,194, 1,238,136, 3, 7, - 36,248, 52, 72,240, 81,144,184, 34, 40,162,168,226, 37,181, 73, 43, 26, 82,242,178,227, 93,239, 50, 15, 59,113, 42,113, 76,164, - 88,138,189,158,199,127,102,126,227, 59, 51,200, 39,158, 51,158,224,194, 36,201,157, 86, 83,205, 52, 9,208,248,223,152,121,145, -255, 4, 79,105, 33,174,161,104, 71, 45, 37,140,161,208,232,201, 52,102,184, 88,151,134,224,149,170,253,198,109, 70, 75,195,241, - 16, 37, 51, 75, 29,134,180,160,153, 17,254, 25, 59,208,249, 21,223,110,209, 1,102,139,110, 48,120,188, 96, 38,190,159, 28, 70, - 97, 19,194,159,132, 76,128, 51,227,249,208,123, 70,189,183, 46,227,104,172,217, 94,107,253, 56,253, 9,241, 96,213,151,216,222, - 72, 35,181,197,138,119,148, 11,203,107, 66, 77, 49,105,201,208, 27,120,156,173,213,157,147, 94,167, 26, 52,192,163, 48,239, 19, -158,253,210,242,106,162,179, 65,220,131, 11,172, 47,174, 55,130,232,160,179,191, 18, 93,237,141,112,221, 59,152,101, 8,178,186, -163, 14, 78,126, 99,248, 28, 66, 98, 91,245, 66, 72,163, 53, 70,247, 30,133,240,110,189,238,234, 64,192, 31, 79, 38, 36, 41,146, -189, 9, 36, 26,104, 42, 79,161, 39, 83, 42,131, 67,116,175,181,253,232,201,227,187,123, 15, 29, 71,170, 81,231,243,135,143,155, -215,183,222,188,126, 27, 86,131,243, 94,188,187,251, 32,106,212, 48,210,137, 29,130, 71, 98, 40, 35, 20,247,171,139,156,177, 13, -183, 59,213, 91,155, 27,119, 90,107, 25, 46, 48,178, 7,135,223, 50, 43,159, 63,125, 6, 15,253,197,171,151,221,126, 31,163,157, - 44,141, 26, 98,240, 39, 17,113, 69,138,104, 96,255,210,174,227, 9,121, 79, 56, 1, 90, 86,106,169,138,249, 30, 17, 63, 29, 45, -123,232,215, 99, 61,114, 75,143, 1,236,107,234,148,123,126,193,183, 35, 90,125,106,242, 43, 66,104,147,115,138, 98, 29,135,124, -217,153,116,131, 74,168, 38,127,128,205, 42,200, 34,142, 33,116, 44, 96, 97,130,224,218,125,100,211, 99, 59,157,102,195,236, 81, -187, 27,166,231, 62,231,208,166, 22, 46, 12,226,190,193,138,186, 79,105,138, 42,191, 91, 60,128, 93,102, 82, 26, 71,213,228, 2, -250,126,212, 9, 69,187,123,124, 81,144,177,188,118, 24,133, 27,200, 70, 39,184, 94,206,136,124, 74,223, 74, 95,194,231,118,247, - 8,220,161, 71, 43,169,121,233, 0,169, 85, 52,143, 79,141, 73,188, 69, 50,113, 98,194,127,137, 18,104, 10, 5,104, 26, 27,190, -136,109, 23, 57,196,199,184,204, 99,167, 81,113,143, 0, 74, 1,110,189,115, 67, 31, 28, 54,248, 6,132,185,162, 46, 9, 89,145, - 12, 55, 22,195,219, 43, 11, 55,174,213, 49,209, 37, 61, 36,205,140, 20,184, 8, 30,205, 58,214,164, 40,170,131, 76, 59, 8, 43, -205, 85,175,118, 73, 57, 98,156,232,164, 63,156, 76,224, 92, 40,159, 40, 0, 88,162,204,243, 90,139, 38,130,151, 54,129,135,128, - 75, 4,151, 27,107,205,112,105,220, 56, 63,141,126, 31,175,180,213,209,121,212, 78, 82,120,209,152,234,202,179, 0,198,206,153, - 40,184, 17,103,163, 51, 46,232,161,240, 65, 21,139, 48,168,238, 44,111,126,250,181, 79, 6,126, 74, 98,180,249,140,250, 28, 60, -154,251, 8,139, 88,129, 43,159,197, 52,154, 71, 97, 37,216,135,238,184, 71, 6,151, 97,192,180,160,195,152,113, 50,180,110, 49, - 5,235,206,198, 26, 24,205,233, 17,229, 94,185, 42, 85, 9,118,180, 89,155, 43, 86, 8,136, 10,182,174,220, 60, 56,254, 34,253, -202,253, 91,123,239,191,190,163,239, 13,175, 96,204,101, 39,107,193, 67,103, 25,210, 73,225,230, 40,157,149,209,217,246,127,131, -224,184, 36, 57,160,108,242, 34, 67,136, 44,109,198,178,142, 20, 21, 26,210,206,230,125,193,127, 67,248,127, 2, 48,118, 53,189, - 77, 3, 65,212,107,123,237, 56,205, 7, 85,147,166, 45, 18, 5,209, 11, 39,196,133, 11, 31, 23, 36,144, 80, 41,170, 56,194,165, - 18,252, 16, 16,167, 30, 57,128,248, 45, 8, 9, 10,173, 4, 72,112, 65, 66, 69, 72,136,168, 77, 73,218,144,218, 77,253,177,235, -120,153,217, 93,187, 41,112,224,220,216, 73,181,179, 59,111,103,222,188,103, 23,149,123,201,131, 70,230,221,200, 72,149, 30,172, - 33,142, 13,216,218,148, 70, 92,171,212, 75,137,144,204, 60, 74,152, 34, 47, 25,170, 27, 79, 38, 36,191, 77,213,208, 49, 58, 50, -162,134, 58,225, 99, 93,191, 3, 40, 44,197,111, 25, 21,228, 82,213, 58, 27, 55, 28, 87, 25, 15, 47,224,210, 72, 41,211, 83,232, -136,120, 32, 36,167,234,173,148, 39,232,249,160,205, 43,132,162,212, 25, 99,218, 85,154,141, 37,171,138,205, 90, 99,215,239, 33, -119,192, 48, 35, 22,203, 38,167, 37, 5, 21,180,193,223,108,125,118,123,208, 49,244,212,134, 72, 53, 51, 16, 11,105,117,183,190, - 27,236, 81,219,241,163,253,249,214,217,158,223, 5,200,116,239,238,253, 75, 75,215,158, 60, 90,221,120,255, 18, 82,250,118,127, -219,163,131,153,218,201, 83,141,211, 91,251,175, 97,115,193,182, 7,152, 32, 19, 30,166, 46,156,153,174,205,180,247,183, 8,225, -112,170,160,255, 39, 27, 14, 6,217, 46,231,120,117, 49, 72,204, 0,171, 50,204,100,200, 76,147,243,163,132,205,181,154,221,189, - 48,137,147, 7, 43, 43,183,150,239, 56,181, 22,252,119, 59,223, 63,183,191,109, 78,207,181, 96,251,181,219,221,135,143, 87,223, -174,189,162,116,170,223, 31, 1, 18, 27,198, 7, 16,124, 14, 4,130,237,216, 28, 61, 94, 57,195, 54,116,217, 41,253, 10,124,198, -140,197,235, 55, 23,111, 47, 5,131, 1,172,224,179,231, 79, 63,124,252,212,235,117,174,220, 88,190,120,225,252,139, 55,235,176, - 97, 57,150,109,204, 74,149, 4, 60,132,107, 51,188, 77,170,231,142, 36, 52,182,120, 22,219,196, 45,204,216,177,220,147, 9, 38, - 82,215, 1, 16, 73, 66,118, 88,196,221, 65, 50, 28,143, 62,215,114, 50, 77,236, 37,133, 21,154,137,109, 64,170,212,119, 73,118, -196, 73,151,219,217,130, 44, 94,176,119, 83, 45, 95, 90, 24,164,137, 67, 60,220, 21,242, 25, 81,203,101,249,249,145,240, 16, 30, -230,114, 62, 0,254, 10, 43, 50, 57, 49,185,254,101, 77,153, 60,160,112,244,216, 57,131,148,167, 81,150,195, 62,217,192, 23,228, -242,185,171,239,190,110, 8,110,152,228, 88,145, 4, 86, 7, 11,172,236, 80,169, 40,154, 40,119,101,225,158, 20,218, 44, 90,206, -103, 81, 74,120,200, 66, 19,229,164, 16,163, 87,221,154, 31,251,176, 28,112,106, 19, 44,208, 53,127, 6, 59,200, 74, 2,180, 97, -185,145,145,144,140,140,205,161,234,154, 73,150,123, 99, 41, 42,141,124,153,212, 73,148, 32, 8,229, 78,177, 9, 97,187,182,233, - 2,114, 71,159, 76,234, 89, 40,137, 1,192, 0, 86,226, 76,165,188,208,152, 88,152,173,158,168, 80,164, 27,194,157, 37, 54,100, - 33, 17, 49,126,201,177, 61,116,143,196,186,142, 46, 13,212,155, 20,246, 20,113,194,152,197, 33,147,109,126, 1, 31,163, 37,183, -228,202, 25, 17,116,119,192, 68,202, 18, 22, 50, 30,134, 44,226,105,156, 36,145,136,145,134, 3,167, 3,165,246,212,124,163, 58, -237,213,219,229, 31,125,103,167,212, 70, 35, 35,169,223,157, 42, 93, 72,229,233,161,133,119,244,112, 52, 81,242, 23, 90, 21,142, -113,182,217,217, 20,249,248, 40, 57,154, 14,250,163,131,130,139,166,156,208,243,137,100, 1,104,192,115,189, 0,205,218, 20,225, - 25,147,104,173, 84, 29, 66, 28, 10,197,110,149,142,158,150,148,199, 82, 77,240,124, 24,162, 82,170, 65,158, 9, 66, 31,158,245, - 28, 15,249, 57, 44,195,196, 9,143, 71, 67,249, 3,113, 39,195,253, 91, 94,254,164,158,136, 50, 95,149,173, 32,136, 1, 75, 90, - 65,195,218, 76, 56,101,248,133,177,136,144,158,240, 87, 45, 6,194, 0,222,144,171, 1,140,241,125,254, 49, 56, 33,198,205, 77, - 85, 44, 41, 6,154,249,223,142, 78,191, 5,160,236, 90, 86,163, 8,162,104, 87,119,245,187,123,222,154,193, 36,154, 4,130, 70, - 5, 7, 55,110, 92,136, 43,113,233, 66,252, 10,247,174, 4,245, 11, 92,185,240, 43,116,163, 1, 81, 4, 81, 17, 3, 42,130,142, - 16,117, 34, 62,152, 36,164,147,121,244,187,189,247, 86,101,166, 3,110, 36,139, 64, 32, 73,247,116,215,169,123,110,157,123,142, -244,159,105,185,135,200, 76, 3,110, 32,206,169,181, 84,179,155,150,110, 0,207,157, 20, 16, 80, 28, 52,136, 79, 49, 86, 62, 88, - 43,203,125,166, 3,213, 82,198, 60, 29,110,167, 18, 93, 28, 91, 51, 5,138, 65, 44, 75,179,116,223,170, 25,191,219,134,203, 80, - 66,158,238,235, 20, 4,173,195,167,224, 59, 85,162, 87,197,145,218,124,140,218, 16, 92, 63, 81, 58,166, 65, 71, 68,228,154,219, -200, 41, 89, 69,198, 90,208,194, 20,163, 76, 42,222, 75,165,215,223,200,179, 12,223,103,166,121,192,230, 1,179,208, 5, 10,171, -124,177, 99, 53,253,214,246, 96, 7,174,198,181,221, 68,132,123, 17, 35, 17,185, 22,195,112, 24, 68,195, 40,142,146, 20, 64, 21, -170,200,162,115,250,236, 66,103,101,237,197,171,222,198, 87,172,253, 25, 80,138,104,103,180,219,219,234, 17,162, 1, 77,118,108, -195, 27,132, 3,192,192,166, 63,179,185,135, 10,214, 81, 60, 64,249,121,145,140,105, 56, 51, 86,146, 17,203, 19, 58, 71, 14, 83, -145, 42,140, 79, 58,134,191,151,113,248, 79,183,110,222,134,210,206,180,172,235, 55,238,236,110,247,187,239,223,182,143, 46,125, -120,253,188,125,108,105,241,228, 57,175,222, 90,125,248, 96, 97,113,121,179,191, 61, 59,191,144,196,217,149,171,215,186,159,214, - 53,102,247, 55, 3,219,178,195, 16, 94,178, 34,142,243,163,115,243,157, 51,157,119, 31,187, 73,146,158, 58,177,252,232,241,147, -187,247,238,175, 62,125,246,249,203,143,173, 96, 84,179,253,243, 23, 47,107,217,120,237,205,203,122,197, 85,177,148, 80,224,170, - 96,145,196, 97,138, 41,155,138,104,157, 73, 91, 57,138,172, 44,228,177, 27, 86, 19, 8, 69, 97, 50,130,125, 14,224, 37, 47,166, - 67, 73,130,101,155,154, 41,247,224,124,210,139, 16,111, 3,234, 70, 84, 85,167,105, 76, 18,174,149,130,144, 44,221,204,243,164, - 60, 73, 77,137,198, 9, 59, 96, 66,169,202,227, 78, 50,114, 21,111, 42,160,158, 24,148,109,120,141, 40, 13,127, 7,191, 54,250, -223, 8, 83, 56,245, 33,139,162,152, 58,165,203, 14, 18,245,244,180,253,236,135,239,127,214,163, 34, 33,221, 56,181,157, 5,238, -107,162,199,138, 48, 65, 90, 67,244,122, 67,242, 74,243, 67,162,237, 10, 4, 55, 70,184, 87, 72,238,173,136, 79, 75, 24,107,103, -121,102, 25, 22, 92,240, 94, 24, 48, 1,227, 12,176,152,227, 61,170,236,128, 93,140, 24, 34,162,193, 83,241, 35, 49, 41,142,164, -147, 56,157,142,238, 78,176,141,112, 11, 88,161,174,185, 38,118, 99, 60,203,228,154, 93, 53,216,146,239, 93, 58, 62,115, 97,229, -240, 92,203,130,181, 28, 66,213,128, 29,134,130,196,145,170,197, 53, 76,128,177,116,196,110,110,136,112, 37,189, 57,167,213,103, -211, 76, 29,143,194,241, 16,222, 17,160,104,186,231, 89, 85,223,182,171, 14,247, 29,213,179, 85,215, 6,210,202, 61,199,172,121, - 30,108,152, 64, 96, 43,182, 1,181, 43,186,107, 96, 36,182,248, 66,245,128,211,244,234,158,203,119,148, 1, 15,168, 29, 37,238, -175, 96,147, 60, 91,196,109, 83, 55,155,126, 3, 71, 31,232,227,203, 41, 81,171,144,180,153,181,129, 73,168,108, 24,141,101,191, -116, 34,224, 17,152, 50, 73,213, 42,225, 15, 71,250, 98,133,232, 13, 46,107, 80, 32,124,138,140,133,192, 99,103, 88,245, 89,145, -106,168,122,224,132, 27, 76,149, 22, 52,204, 49,108,156, 89, 69, 90, 15,171, 47, 77, 72, 29,111,104,186,161, 91, 81, 18, 74, 35, - 20,218, 96,131, 17,122, 71,207, 84,218,221,159, 93, 81,214, 59,134, 75, 9, 7, 18,139,227, 12,224, 33,145,101,175, 72,242, 46, -121, 18,192, 67, 43, 79,156,194,239,114,110,160,119, 49,101,183,178,127,105,134,203,186,163,172,248,191,168,190,191, 2,240,117, -109, 61, 77, 4, 81,120,102,119,246,210,118,235, 22,196, 10,197, 18, 52, 88, 20, 10,104,228, 47, 24, 12, 33, 49, 49,250, 67,245, -193, 72,188,189, 27,162, 49, 81, 98, 20,125,192, 11,198, 64, 40,176,165,123, 31,207,101,183,133,196,152, 52,125,105, 31,166,157, -157, 57,223,156,249, 46,197,254,158,211, 49,164, 12,191,134,167,211,114,108,183,106,123, 39,131, 64, 24,236,149, 36,163, 60, 34, - 29,138,148, 82,254,147, 93, 47,135,237, 13,201,241,216, 20,230, 36,203, 42, 37, 69,153,145,141,157, 43, 91,185,196,219, 32,219, - 2, 38, 30, 81, 35,190, 76, 11, 51, 88,217, 97, 74,107,110,114,238, 79,239, 55,251, 97,193, 96, 96,245, 98,181, 36, 82,175, 81, -144,208,196,204,197,153, 94,191, 71, 70,102, 69,120, 36,251,213, 17,157, 64, 66, 89, 26, 68,167, 72,126,167, 60,248, 49,175, 1, - 43, 45,166, 0, 16,147,233,105, 34, 59, 12,122,100, 29, 99, 55, 27,151,131, 65, 63, 66,250, 9, 37,243,106,180,192,165,149, 44, -218,151,174, 4, 73, 24, 38,232,186,181,253,249,227,235,199, 79, 63,237,108,135, 81, 80,252, 72,205, 93,124, 19, 48,255,114,123, -121, 63,216, 63, 30, 28,205,183, 58, 63, 15,247, 0, 83,107,140, 3, 30, 48,189, 18,190, 8,143,142,239, 52, 18, 51, 54,171,121, - 5,158,116, 83, 21,106, 35,116,157,196,107,243, 26,192, 43, 33, 30, 61,124, 0,187,125,119,121,161, 98, 38, 47,159, 61,137,195, -190, 50, 68,119,101,117,124,234, 26, 12,252,203,251, 55,155,155,207,183,182,182,150,186, 93,248,165,107, 27,247,167,231, 22,155, -126,101,118,182, 5,245,104,125,125, 13,198, 84,173,168,197,249, 25,219,201,219,237,171,111,223,125,136,242,108,117,229,214,183, -221,221,237,157,175,105,146, 57,182, 85, 7, 32,167,242,245,141,187,190, 87,125,245,226, 41,192,207, 48, 33,197, 83,204,153,139, -104,191, 70,144,155, 71,174,203, 36, 50,132,175, 24, 38,135,119, 77, 60, 97, 70, 9,204,243, 51,213,223, 24, 66, 36, 71,185, 9, -121,230, 13,183,120,110, 46,103,212, 6, 97,137,133, 49,202, 76, 48, 81,217, 40, 50, 0, 86,176, 63,178,167, 35,165, 37,160,215, - 77, 86,250, 16,140, 90,114, 35, 98,165, 1,147,107, 81,164,162,166,232, 2, 56,207, 34,187, 19,131, 89, 50,118,186, 69, 12,171, - 20, 28,210,136, 50,160, 45,148,162,229,178,100,105, 81, 4, 52,142,186, 89,111,194,209,201,228, 14, 94, 25,177,196, 82, 68,234, - 84, 43, 98,116,240,177,148,185, 51,250,246,236,157, 78,171,243,227,224, 59, 35, 20, 34,176, 23, 14,188,136, 0, 41, 79,184, 8, -210, 32,104, 68, 87, 8,134, 60,231, 88, 53,178,174, 50,138,151, 38,230,130, 34,255,106, 66, 40,134,116, 77,147, 0,187,233,217, -118,221,181,107,174,242,108,167,229,170,141, 27,147,247,150,166,198, 60,213,143, 1, 1, 37,164,183,200,137,102,134,244, 54,199, - 82, 48,227,104,233,135,234,109,164,191,227, 18, 25,159, 22,141,150, 72,242,232, 52,138, 66,108, 46,163, 91, 72,205,129,119,168, -168,152, 33,160, 72, 39, 96, 83,125,115,149,112,109, 81,117,197,132,103, 54, 27,181,201,177, 9,191,230, 43, 43,134,135, 59, 74, - 57, 9, 6,139, 56, 28, 15,124,191,166,250,250,196, 60, 78,217,128,184, 20,158,143,174, 5, 51,100,104,165, 41,212,153,148,194, - 86,175, 79,117,246,131, 3,116,251,202,243,163, 62, 6, 6,243,174,206, 78, 80,186,188,173, 96,218,180,214,229, 69,141, 46,112, - 1,172,202, 83,228, 35, 22,158,246, 60, 49, 44, 26,130, 25,135,138, 69,219, 40,254,225,112,214, 36, 59,185,136, 26, 92, 70,189, -114, 1,138, 46, 59,132,139, 17,161, 83, 16,176, 59, 33,174, 21,123,147, 23, 34, 98,248, 51,240,124, 70, 69,250,230,244,194,175, -195,189,242, 3,118,215, 44,148, 25,178, 96, 49, 14,245,103,184,119,197,105,120,198,245, 22, 80, 20, 89, 88, 97,226,180,148,231, -179,183,228,168,247, 34,207,182, 61,245,121,218,130,254,175,156,239,175, 0,140, 93,201,110,211, 80, 20,245,248, 18, 59,118,156, -193,233, 64, 43, 64, 45,131, 0,169,106, 10, 8, 9,186,168, 90,186,228, 15, 16,226, 95,216,176,227, 39,128,111,232,166, 11, 36, - 86, 72, 44,168,132, 68, 37, 88,160,210,162,182,193,113, 28,215, 99,108,115,239,125,118, 27,132,144,144,178, 74, 34,103,240,123, -231,157, 59,157, 83,213, 87,185, 11,102, 89,219,194,108, 96,148, 4,126,232, 81,142, 14,245,175, 69,174,229, 94,221,160,243, 50, - 73,241,183,107,142, 80,186,214,218,230, 44,108, 15, 88,160,216, 96, 64, 5, 55,174, 80, 84, 22,211,176,183, 52, 23,203,156,204, -121,120, 82, 94,150,138,120,212,179, 40,192,157,118, 39,213,108,129,169,153, 97, 18, 1, 31,132, 5,193,235, 54, 84,184, 21,221, -179, 97, 75,179,128, 92, 75, 92,136,134, 18,235,212, 4,169,204,181,231, 78,220,227,181,165, 62, 64,150,161, 97, 94,213, 79,252, - 52, 70,213,117,174,173, 4, 31, 8, 7, 0, 80, 9, 55,244,250,203,125,199,119,142,221, 83, 86,211, 44,195,242,130, 49,217,152, - 80,212,159,165,163,112,100, 27, 51,227,112, 12,200, 7, 91, 1,226, 65,216,123, 1, 74, 85,240, 17, 91, 62, 4, 4,135,132,106, -104, 6, 4, 0,240,146,213,232,232,106,253,230,226,237,159,163, 35,248,185,247,150,239, 59,103,110,152, 6,176,216, 6,129,211, -108,234,114,115,162, 49,153,167,101, 17,216, 43, 75, 42, 93, 81,234, 76, 62,248,190,127,120,184,191,214, 95,125,243,250,173,221, -187,180,190,177,253,233,227,135, 27,253, 71,116,148, 71,175, 94,190, 24, 7,190, 84,164,207,158, 63,125,183,187,179,186,118, 55, -141, 71,186,166, 38,201,216, 25, 28,109,109, 63,190,126,109,185,213,106,110,110,110,237,237,237,205,218,115, 95,246, 63, 3,174, -245, 87,238, 4,254, 40,142, 71, 51,109,211,106,170,122, 93,142,130,248,225,131,117,251,202,173,247,187, 59,142,231,118, 44, 3, -192, 65, 17, 80, 77,190,161, 75, 65,152,194,230, 98,162, 70,165, 81, 60,189,177,247, 75,109,224,234, 76, 19, 85,209,138,202,109, -167,154,222, 40, 11,105, 85, 97, 16, 97, 58,175,196, 29,187,122, 47,158,196,121, 41,207, 61,109, 6,205, 27, 16,120,195,175,196, -112, 6,153, 1, 29,182,141, 30,156,142,231,221,244,200,170, 20,134, 68,185, 10, 14,184,104,140, 74, 79,210,142, 19,179, 12,135, -234,100, 76,238,103,216, 38, 11, 33, 69, 54, 1,194,202,109,164,132,202,232,147, 28,246,100,173,166,203, 34, 35,169, 72, 30,111, - 10,220,180,136,186,102, 35,184,155, 76,174,243,236, 46, 60,141,221, 41,112, 53,236,222, 65, 79, 44,178,141, 36, 28,166,239, 1, - 59,229,151, 63,248,118,242,181,210, 38,156,206,159, 22,127,228, 75, 17, 11,184, 20,228,185, 39,218,244,163, 16, 47,140,153, 74, -179,162, 92,196, 1,105,198,106, 36, 87, 9, 72, 13,135, 24,107, 48,217,212,128,137,171,109,133,109, 44, 46, 60, 89,233, 46,205, -155, 62,220,188,100, 66, 99,209, 57,183,154, 64,230,142,105, 25,212,189, 65,152, 3,114,129,231, 29,213,167,172,158,208,187,140, - 17, 37, 4,167, 17, 34, 49,146, 73,248,179, 84, 5, 3,150, 32, 18,156,177, 48,112,131, 35,207, 57, 24,185,135,158,247,195,207, -156, 64,139, 98, 52,236,209, 84,193,214,133,133, 14,155,239,216,245,154, 41,136,152,216,153,228,229, 70,151,228,122,203,210,196, -196, 27,230, 97,158, 75, 23, 70, 73, 85,214,148,204, 18, 32,196,190,108, 95, 29, 18, 57, 27,250,195,172, 44, 79, 20,220,198,144, -219,210,182, 77,251, 44,242,121,114, 47, 47, 23, 27,149,204, 8,244, 49,124,215, 77, 98,127, 69,163,102, 88, 70, 51, 66,148, 47, -120, 66,131,143,184,235, 53, 29, 32,126, 28,122, 18,217,130, 67,208, 25,103, 9, 80, 7, 96,234,212, 54, 36,195,101,103,155,243, - 0, 44,140,161,255, 45,149, 55,228, 58, 42,214,165, 93,163, 27,145,251,121,133, 94, 82,165,158,139,221,246,167,227, 19,248, 26, - 52,235, 7, 52, 66,202,121, 30,178,200, 43,213,160, 11,171, 87, 20,158, 83,107, 41,188, 13,226,203, 34, 23,196, 41,161, 21, 81, - 44,254,229,127, 38, 76,185, 65, 77,185, 81,138,255, 39, 1,255, 91, 0,198,206,164,183,105, 40,136,227,246,179,227, 37,117,235, -132, 44, 77, 55, 90, 84,169, 21,235, 1, 33,129,202, 9, 14, 32,132, 42, 56,241,213,144,224, 67,112,129, 11, 66,226,140,212, 3, - 42, 65, 52, 85,213,210,146,116, 73,147,198, 89,237,231, 56, 54, 51,243,236,164, 66, 61,112,141,100, 71,137,236,121,255,153,249, -207,111,198,254, 25,229, 18,163, 64,142, 81,190,180,119, 13, 43,209,114,248,207, 36,158,170,196,184,106, 73,150,175,162, 62,225, - 93, 6,195, 1,202, 94, 28, 45, 82, 99, 84,241,216,255,195, 88, 2,205,145,199,168,225, 9,238, 46, 2, 49, 17,136, 30, 90, 50, -206, 36, 61, 90,123,124,210,172,121,129, 23,137,249, 28, 9,233, 19,228,114,197, 75, 44, 99,138, 64, 48, 88,218, 86, 89, 66, 62, - 35,222, 5,100, 94, 46,119, 59,125,103, 54, 3,114,172,239, 15, 57,162,210,201,102, 3,239, 63,220, 4,164, 58,220,214, 50,172, -243, 78, 19,210,183,163, 70, 13,233, 22, 81,224,113,200, 59,197, 18, 35, 1,174,139,110, 47,223,173,212, 42,161, 28,143, 80,246, -120,183,135,213, 42,101,172, 90,196, 79,152,207,149, 64, 58,129,120, 15, 81,140, 7,231,221,198,169,115, 28,146,109,238,164,115, - 54, 99,102,114,211,249,141,245,135,191, 78,118,153, 49,226,136,249, 84, 48,213,193,213, 75,146,161, 43,166,198, 32,176, 90, 70, - 74, 55,244,118,187,123, 90,239, 28,236, 31, 86,246,246, 7, 3,126, 81,175,183,157,214,253,141, 39,194,211,246,229,211, 7,167, -221, 43, 20,231, 95,110,190,126,247,246,253,139,205, 87, 67,223,203, 46,172, 76,167,205,175,159, 63,110,255, 40,247,123,254,159, -218, 25, 72,205,218,241, 94,105, 46, 83,171, 30,104,134,116,107,237, 70,179,229,212, 27, 77, 72,240, 57,247,175, 47, 46,204,151, - 74,154,102,174,222,188,247,123,247,167,211,108, 61,127,246,116,107,171,140,190, 15, 72,162,117,197,227,240,192, 75,126,196, 9, -202,131,199, 34, 57,213, 2,194,233, 97, 48, 37,129, 17, 87,213,229,100,147, 45, 99, 41, 56,170,204,148, 9,239,210,114,110, 21, -153,113, 4, 75,114, 19, 88, 13, 2,172,105,208,225, 18,195, 35, 90,204, 94,199,214, 29,217, 81, 4,151, 70, 44,180,156,108, 40, - 69, 91,220, 40,138,167,230, 89,178, 57, 36, 42, 76, 23, 33,185, 84,153, 54, 99,218, 28, 43,164,194, 27, 30,101,204, 92,159,247, - 9, 24, 33, 17,124, 34,156, 49,179, 62,106,139, 72,140, 44, 65, 20,164,122, 40, 62,151,240,160, 46,229, 86, 58,184,200,141,116, - 50, 33, 37, 44,221,178,244, 41, 50, 23, 4, 98,113, 40,161,182, 34, 60, 48, 70, 65, 60, 53, 42, 69,134,154,134,131, 12,146, 6, -248, 92, 24, 39,199, 82, 85, 68,119,154, 71,101, 73, 81, 33, 97, 77,210,208,158, 52, 17,240, 44,246, 82, 48,150,204, 45,210,229, -140,184, 31, 68,229, 83, 48,190,227, 67, 98,233,170,165,107,102, 74,205,107,250,155, 59, 75,155, 15, 74, 16,114, 61, 78,150, 66, - 58,194, 68,135, 0,137, 76,170,162, 67, 6,131,226,157,120,191, 12,155,162,232, 63,208,116, 9, 18,193, 84, 90,242, 64, 26, 5, - 56,117, 10,233,155,134,219,245,224,111, 30, 52, 47,142, 42,213,157,250,232,187,155, 63, 84,230,170,172,112,172,228,106,145,189, -231,234,229,179,112,123,199, 41,127,171,246, 42,141,130,235,171,203, 25,105,189,104, 44,229,138, 18, 11, 58,156, 15,195, 40, 22, -176,178,153, 49, 13,207,109,117,112,221,128, 28, 51,139, 40,217,139,231,145, 48,146, 59,189,139,164,135, 42,254, 39,225, 97, 35, -219, 52, 98,102, 66, 62,130, 76, 4,215, 7,219,166,237,250,131,104, 82,177,144,243, 86,126,224,247,177, 53, 68, 77, 44, 92, 12, -130, 85,111,252,242,140,149,245,136, 90, 67,149, 45, 28,120, 20,182, 76, 65,172,162,205, 45, 6,154, 0,113,199, 58,170, 51,184, -143,157,182, 61,180, 63, 98,176,154, 49,236, 46,239,225,254, 28,164,186, 71,217,169,107, 40,180, 19,220, 35,109,130, 83, 33,182, -136,224, 48,107,207,181, 93, 7, 46,193, 78, 18,102, 1,104,213,215, 21,209, 11,141, 53, 56,186, 27, 48,123, 64,100, 83, 64, 46, -196,164,240, 78,238,160,113, 0,148,175,216, 70,153,176,239, 89, 74,209,169,152, 41,255,167,132,255, 43, 0, 93,215,210,155, 68, - 20,133,231,201, 12, 51, 64, 7,164,148, 86,173,173, 15,108,163,137,141,233,162,169,198,196,212,141, 59,211, 95,225,210,196,255, -224,175, 48,241,145,184, 53, 26, 95, 91,163,155,218,196,104,173, 93,105, 42,165, 47,154, 82,160,148,121, 0,243,240, 60, 40,165, - 54, 18, 22, 64, 96, 2,151,123,239,249,238, 57,223,249, 62,233,196,243, 99,111,134,144, 15,235,176,187, 49,247,189, 13,150,132, - 78, 8, 78,252,159,171, 95,183,231, 84,244,131,182,237, 58, 17,121,160, 70, 98, 64,191,132,130, 52,114,117, 82,172, 36,193, 73, -183,160, 75,141, 12,123, 34,150,166,110,226,177,154, 24,215,139,191, 23, 88, 87,216,208,226,152,239,142,196, 76,252,148,124,120, - 4,114, 90,142,139,213, 60,177,123, 26,161,115, 45, 15, 15,128, 2,184,248,160, 53, 84,220, 89, 59, 0, 36, 72, 76, 74, 31,233, -119,161,161,155, 15,238,222, 87,208, 57, 85, 54,245, 4,124,237,137,211,133,164,145, 32, 6, 81,232, 97, 45, 59,100,170,126, 64, - 59,196, 82,113, 57,107,229, 24,183, 90,102, 26,130, 54, 96,251,148,150, 76, 25, 41, 6,158,176,130, 0, 72,110, 84,182,202,245, - 77, 64,169, 1, 37,238, 73,161,135,232,166,232, 82,171, 86,155,149,134,211,120,185,248, 26,214,122,203,139,154, 54,210, 0, 89, -147, 68,228, 44, 21,137, 51,144,225, 6,185, 19,132,114,177, 84,134, 63, 98,173,180,250,230,221, 43,215,110,210, 24,119, 4, 42, -131,195,131,233,235, 87,139,171,191,170,213,157,150,103,195,254,211,216, 94,219, 44,150,182, 43, 7,223,151, 86,222,127,120,251, -233,243,199,199, 79,159,249, 62,236,203, 26,106,153, 42,200,160, 87,100,169,237,133,182, 19, 56, 94, 56, 59,115, 99,126,254,222, -202,207, 69, 24,165,203,147,163,215,166,198,231,238,220, 86, 20,173,213, 10,235, 13,127,125,219, 13, 40,115,162,138, 0,248, 20, - 77,137,241,185, 55, 38,233, 61,207,160,120, 44,193,122,181,114, 87,198, 22, 59,196,136,247, 2,251,134, 11, 35,179,103, 87,236, -214, 65, 31, 33, 10,179,111, 99,185,243, 50, 61,142,161,205, 11, 54,199,195,211,173,218,186,231, 55,169,148, 34, 81, 79, 3,146, -160,146,241,116,207,127,148,142, 14, 6,202,131, 10, 18,172,174,222,244, 43,239,239,240, 22,188,239, 86,249,224,140,100,115, 69, -247, 58, 54,173,109,245,194,240,132,143,150,131, 66,195,171, 41,120, 54, 50,176,120, 67, 99, 78,204,125,204,151,103, 18,131,165, -202, 31,248, 41, 3,134,149, 77, 12, 89, 70, 6,253,158, 2,175,102,215,186, 96, 36,146,184,248, 0, 23,130, 41, 39,247,120,108, -146,232,249,142, 79, 74,162,128,226,217, 92,250,200,163,154, 12, 32,224, 21,216,250, 21,204, 8, 70, 49, 69,206,152, 25,142, 64, -221, 18, 33, 75, 29,144,102, 11, 92, 36,109,100, 44,195, 50, 84,236,188,199,175, 70, 77,124,228, 39,140, 84,224, 68,220,210, 20, - 53,174,106,178, 20,203,203,218,195,155,147,115,211,163, 29, 68,235,184,125,211,189,167,251, 27,193,200,170,128,202,145, 46,137, -227,204,221, 65, 1,123,190, 38, 7, 4, 51,133,231, 43, 33, 84,185,159, 85,145,201,134, 44,172,151,119,191, 46,111,252,240,207, -250,227, 51,198,224,152, 28, 51,209, 54, 70, 80,117, 89,131,128,151,206,230,206, 92, 44, 12, 95,153,170, 14,140,191, 88,112,159, - 63,250, 82,124,242, 13, 32,128,112,235,210,185,217,194,104, 30, 89,109,228,118,135,124,149,124, 33, 55, 18,215, 67, 10,184, 40, - 91,175, 91,128,136,201, 79,132, 85, 59,216,232,155, 8, 20, 76, 60, 15,176,201,145,188,235,152,116, 36,118,200,227, 12,167, 83, -219, 59, 12,132,252,241,104,207,221,165, 74, 42, 6, 39, 36, 75,160,100, 66,135,173,178, 53,228,253,115,133, 28,161,190,221,110, -142,164,243,221, 26, 12, 85,110,147,122,146,164,114,144,102, 74, 42, 14, 81,245, 96, 15, 46,145, 49,178, 2,170,128,236,179,200, - 22,123,205,214,109, 20, 25,148,250,234, 67, 0, 92, 0,194,146,113,138,146, 79,159,133,127, 86,215,205,128,168, 92,148,156,246, -221,118,171,207,160,229,136,231,232, 96,125,254,232,102,234, 41, 69, 82,254, 37, 76,242,196,225, 76,148,192,173, 66, 56,249,219, - 39,218, 53, 4,225,184, 72,244,241,216,240, 87, 0,178,174,228, 53,141, 40,140,207,162,227,140, 70,141, 53,141,137, 86,163,198, -132,210,157,210, 82, 40,129, 4, 90, 10, 33,135, 94,122,232,161,127, 77,255,157,210, 67,105,146, 83,104, 74, 67,160,189,180,144, -165,144,224, 37, 80, 4, 99,181, 46, 51,206,230,204,235,247,125,239, 25, 19,130, 50, 23, 69,103,121,239,125,203,251, 45, 87,243, -119,121,226, 52, 41,140, 75,194,209,180,129,198, 11,236, 98,119,100,252,198,158,137,176,200,146,175,123,250,200, 99,183, 60,241, - 57, 71,119,134, 68,203,146,132,155,170, 55,114, 99,154,158,138,103, 2,241, 83,114,113,166, 4,211,134,231, 86,240,242,124,143, - 48, 54,138, 58, 81,211, 71,174, 41,246, 74, 89, 0, 15, 44, 20, 2,150, 60, 32, 35,156,129,103,253,170, 50, 54, 47, 64,254, 8, - 74,176,191,126,182,209,234,181, 28, 50, 66, 35,165, 35,105, 38,153, 77,233,137,237, 95, 59,212, 23,129,105,169,245,135,131,223, -141,211,119,171,111, 15,206, 14,124, 18,214, 37, 29, 46,177,237, 67,247,120,100,185,118, 62,147,239, 88,109, 93, 51,218,102, 7, -241, 24,254,208,246,108,184,158, 82,182,104,186, 38,228,112, 40,136,192,148,245, 39,175,234,141, 58,156, 65, 24,202, 58,121, 1, -194, 29, 91,156,171,253,233, 54,112,220, 35,147, 21,149, 9,156,104,128,243, 78,133,204,157, 25,186,130,251,190, 24, 39, 20, 67, - 67,141,191,137, 33, 71,200,213, 25,195,133,114,225,254,237,165,159,251, 59, 78,255,124,111,111, 23, 6,211,218,234,243,135,143, - 30,231,114,179,229,234,226,247,111, 95, 62,125,252,176,181,185,105, 15, 77, 67,143,226,218, 37, 69, 44,199,143, 27,233,106,165, -182,255,227, 96, 48,148,138,249, 37,219,147, 15, 79,234,228, 20, 18,190, 88, 91,153, 47, 20,190,238,238,190,220,120, 3, 85,249, -241,225,113,181,186,252,121,107, 27, 81,228,126,104,251, 35, 40, 42, 97,226,187,142,203, 41,131, 16,149, 29,207,154, 77,231,135, -152, 23, 99,218,129,186, 54,132,131, 32,141, 17, 46,116,133, 15, 94, 83, 53,238, 29,140,201, 97, 24, 36,180, 41, 42,227, 68,244, -239,152,109, 56,166,180, 36, 58,240, 49,118,169, 7, 13, 11,247, 20,172,170, 23,185, 9,214,203,151, 90,130, 83,122,210,242, 48, - 90,140, 56,234, 70,226,174,208,116, 84,196, 54, 0, 82,220, 24,155,207,150,168,186,194, 62,111,207,250,103,104, 6, 85,120,168, - 59, 68,200,174, 64, 88,145, 41,220, 18, 73,177, 93,139, 35,216,161,158,139,107,241,142,213, 34,192, 67,140,176,164, 18,212,248, - 70, 12, 53, 73, 74,217, 5,211,238, 94,182,122,224,103,197, 41,239, 36,186, 25,142,249,186, 98,228, 32,111, 32,158,244,125,168, - 8,177,195, 11, 53,177,139,142, 66, 72,237,142, 69, 99, 2,178, 73,112, 45,126, 69,112,111, 29, 15, 69, 95,164,177,172,129, 66, - 17, 79, 37,201,235,168, 26, 38, 96,125,215,212,164, 36,191,127,179, 82, 94,127, 32,153,110, 4, 45,183, 8,232, 72,233,187, 68, -234, 44, 10,174,202, 8,154,140, 35, 8, 6,241,101,136, 95, 64,144, 32, 4,191,136,148, 43, 74,201, 12,249, 37,135, 4,182, 39, - 53,199, 32,176,122,189,147,122,163,159,188,151,175, 44, 15, 45,207,243,177,165, 0,213,158, 74,233, 61,196,220, 80,142, 56, 30, -170,195,148, 42,165, 66, 49, 55,117, 35,115,212,244,142,118, 78, 43, 42,211,158,222, 50,210,137, 68,223,181,134, 14,105,235, 49, - 21,242, 85, 95,110,118, 60,126,195,225,194,113,228, 48,193,232,226, 29,117,206, 50, 89,202,215, 98, 81,189, 99,118,239,150,238, -184, 35,223,166, 98,125,236,205,194, 72,243, 78,228,230,194,241, 85, 22, 46,202, 66,193, 94, 52, 30, 4,226, 30,183,187,232, 99, -152, 66,181,185, 69, 8, 24,205,238,185,224,166, 42,145,116, 34,221, 30, 52,209,163, 65,184,165,203,240,215,229,217,242, 95,179, -133,144,124,174,177,133, 36,187,248,205,212,220,192,235,139,209, 71,221, 35,142,236, 25,255,157,164,107,137, 70,231, 12,226,254, -208, 49,209, 30, 0, 30, 40,234,131,146, 24,133,204,216,196, 67, 94,172,171, 73, 35, 77,186,184, 1, 95, 99,145, 77, 66, 85, 5, -155,176,123, 25,124,135, 64,101,220, 63,164, 48, 29,207, 32,163, 28, 3,140,116,209, 51,185, 42, 7, 41,179,107,126, 32,112,248, - 47, 0, 85,215,177,219, 68, 20, 69,167,188, 41,111,154,187,211,228, 20, 22,192, 34, 8, 80, 0, 9, 33,144, 88,129,196, 47,240, - 79, 17, 31, 66, 22, 72,240, 7, 72,148, 77,136, 16, 82, 18,146, 40, 74, 66,138, 33,138,199,246, 84,123,204,189,247, 61, 59,206, - 42, 11,199,214, 88,190,229,220,118,206, 84,124,151, 37,176,108,137,142,198, 60, 94,177, 28, 8, 72,154, 54,120, 94,131, 54,105, -209,166, 77,143, 84, 29, 6,234, 77, 70,236,177, 54,252, 13,141, 18,117, 50, 64, 71, 38,128,129,207, 3,108, 95, 12,242,140,100, - 24,197, 91,179, 28, 23,110,133, 84,176,236, 63, 78, 95, 68,200, 79,197,152,238,219,149, 18, 15,226, 65,164, 93,255,162, 74,171, -186, 8, 16, 9, 50, 4,129, 29, 69,112,153,137,114,106,251,120,167,159, 70, 79,111, 63,250, 19,182, 53,170,202,163, 44, 10,227, - 30,182,103,153, 14,104,189, 18, 84,227, 44,169,184,149,157,211, 3,176,224, 94, 26, 97,229, 94,228,220,116,163, 44, 22,164, 66, -200,174, 49, 26,118,163,238,210,204,114, 39,234,180,106,139,144, 78, 83,100, 61,195,132,211,137,123, 67,154,101,141,242,162,222, -108,213,131,230,214,254, 22, 20,187,120, 91,111,216,115,213, 5, 72, 48,150,105,173, 46,174,238,253,221, 35, 98,213, 33, 56,139, -226, 22,182, 65, 96, 11, 69, 30, 84,206, 21,238, 64,172, 87,109,166,187,142, 26,184,154,239,168, 16,247,137, 98,167,176,172,145, -161, 15,118,183,127,110,108,124,216,220,220,132, 4,228,123,154,109,107, 15,158,189, 89,185,179,182,179,245,237,221,250,250,225, -241, 41,248,134, 97, 34,193, 89,150, 22, 73, 50,236,246,210,114,165,244,240,222,253,207, 95,190,130,193,207,207, 54,203,229,224, - 96,127,191, 90,230, 22, 67, 13, 69, 29,101, 88,210, 39,207, 95,159, 29,254,250,244,241,125,251,226,252,228,228,196, 50, 69,107, - 25, 80,144,222,108, 84,123,189, 56,203, 48,114, 1,250,112,205,210, 69,183, 93, 16,201,204,245, 81,130, 60, 27, 44, 0,206, 15, -105,220,130, 93, 56,186,228, 17, 56, 22,237,117, 50,191, 25,111,139, 32, 43, 8,158, 65, 13,166,183,120, 71,196, 0,209, 8,102, -194, 56,212,212, 27, 99, 57,139, 33,151, 25, 33,154,169,177,228,136,116, 76,201,159,176, 86, 34,241,116,176,174,171,254,101,154, -246,225, 17, 25, 51, 36, 69, 38,145,149, 17,181,137,100,206, 41,243,138,205,156, 44, 23, 29, 27,141,184, 34,112,119,220,212, 89, -134,205, 89, 44,252, 39,219, 19, 73,134, 27,159, 61,242,255,170, 91,131, 39,209,198,148, 5, 3,114, 63, 97,245,166, 97, 58,150, - 7,240, 5, 10,130,146, 87,129, 58, 93, 56, 17,157, 71, 73, 69,120,145, 2,179, 2,143, 65,133,109,207, 85, 22, 24, 51, 1, 75, -137,107,187,185,242,124,156,198,210,182,233, 15, 29, 35, 51,219, 64, 25, 38,207,178,116,221,121,181,178,244,242,237, 11, 37,112, -148,186,171,132,125,150, 15, 10,161, 3, 70,164,112, 66,106,213,102,204,133,188,100,155,168,177,158, 35, 3, 6, 49,131,170, 28, -170,214,214, 45,197,247, 48, 98,228,200,154,148,227,107, 16, 86,147,163,131,227, 43, 99,101,249,238, 90,146, 0,174,231,220,230, -196, 69,137,235, 8,196,245,129,149, 28,238,222,104,140,251,190, 19,148, 44,238,207,206,212,152, 31,124,255,113,198,127,159, 85, - 31,207, 91,117, 15, 66,124,183,159,224, 90,189,162, 6, 53,214, 63, 74, 46,243, 76,151,250,210, 98, 21,125,228,154,220,179,189, - 8,225,145,210, 40, 55,118, 79,247, 28, 30,128, 99, 94,116,218,200, 78, 74, 67, 87,169,142, 61,158,153, 59,182,143,146,181,130, - 46,163,144,225, 97, 60,201,152,240, 75,139,112, 38,210, 61,166,250, 90, 80, 3, 64,150,102,169, 24, 2, 33, 15,168,198, 28,203, - 69, 24, 65,244,192,240,143,240,213,195,184, 3, 32, 0,188, 49,224,165, 8, 27, 65,104,145,255,194,243,225,120, 53, 11, 2,149, -107,187, 0,199,134,242,166,143,150,192,200,176, 73, 83, 16,219, 63, 56,177,195,187, 57, 60, 57, 1,243, 7,224, 88,226,229, 56, -239, 79, 36,136,177,178, 47,134,144, 9,228,208, 72,232,181, 76, 29,147,210, 10, 74, 46,217, 16,112,207,184, 19, 38, 29,186, 34, - 20, 2,175,163,107,106,232,155, 33,126,210, 69,215,198, 13,156,255, 2, 80,117, 45, 61, 77, 68, 81,120, 94,157, 14,211,161, 51, - 29,166, 60,154,130, 13, 2, 38, 4, 23, 24, 23,254, 8, 13, 63,207, 45, 59, 23,238,220, 24, 18, 18, 37, 81,211,152, 24, 69, 13, -186, 48,172,160,133, 54,165,143,233,188, 95,158,115,238,157,162, 59, 10,233, 45,153,158,123,158,223,247,157,210,191,203, 18,255, - 21,141,152,114,132, 34,231, 78,173,137,210,222, 52,238,175, 86, 80, 75, 65,226,203, 99,114, 54, 19,101,156, 32,200, 7,170,178, - 70,251, 72,243,197,138, 88,118, 43,153, 58,155,248, 79,255,148,253, 13,158,201,147,237,103, 35,119,144,145,116, 52, 35,172,102, - 8,170,169, 48,217,126,169, 44,123,139,114,135, 33,161,212,216, 10,107,129,140, 56, 33, 12, 99, 86,174,204,198,119, 64,196, 14, -162,185,109,216,224,148, 19, 52, 38, 74,225, 69,113,103, 99, 7,202, 43,120, 57,241,221,148,184,139,237,149, 86,203,218, 24,123, -119, 40,236,130,169,122, 62,114,239,252, 36,130, 28, 13, 78,235,143,251,164,127,148,153, 53,107,197,116,252, 8,105, 53,105,193, - 24,204,152, 68,192,105, 65, 24, 52,106,182, 85,107, 64, 84,128,160,194, 58, 75,144, 20,128,125,232,186,121,252,229,245,166,186, -117,250,254,109,203, 90, 31,249, 99, 36,139, 4,115,248,247,163, 52,190,188,185,132,195, 15,218, 7, 61,247,198,174, 54, 2,213, - 71, 6,109, 6,198, 32,197, 81, 49,243,178,152, 72, 65,138, 88,137,147, 34, 77,149, 32, 68,209, 37, 28, 83, 43,185,166, 22,211, -153,119,213, 27,160, 47,193,105,172, 50,115,179,159,231,191,150,228,236,209,254,222,171,227,151,215,189, 30, 92, 63, 47, 72, 61, - 47,245, 33,250,225,110, 88, 28, 86,218,150,177,187,179,253,233,115, 23,108,126,217, 48, 58,157,205,139,139, 11, 73, 86,133, 66, -190,190, 25,126, 59,255,254,226,249, 81,103,239,113,247,236,164,219,253,216, 31,222,249,126, 22,135,121,152,176,237, 78,121,211, - 90,134, 16, 53, 24,142,209,157,229, 50, 34,214,147, 64, 16, 74,114, 57,223, 83, 92, 84,229, 42, 60, 31, 42, 33, 69, 85, 89,130, -152,193,208,193, 82, 57,114, 95,176,213,196,210, 55, 83,230, 66, 82, 89,121, 78, 87,171, 82, 80,243, 13,156, 35, 78,195,248, 34, -198,123,217,108,214, 92,150, 22, 61,107,178, 49, 68,250, 43, 10, 4, 23,200, 20,249,104,178, 64, 13,242,195,206,211,137, 63,134, -139,141,108, 85, 74,165, 37,198,233,160,238,246,138,225,192,169,144,115, 33, 17, 73,128, 60, 23,238, 97, 35,205, 99, 36, 82,197, - 62, 38,143,164, 81,195,171, 79, 82,162,226,224, 91,145, 87,202, 5,159, 21, 18, 84, 20,157,136, 99, 27, 14,100, 12, 33,194, 80, -210, 76, 72,161, 32,152, 7, 51, 12, 3,100,161, 4,140, 42,235, 95,248, 34, 52, 51,198,245,184,188,135,239,134, 51,194,252,240, -137,171,135, 43,223,242,114, 38,201,156, 59, 87,146,129, 50, 75, 87,225, 71,225,104,183,253, 64, 40,134, 95,167,170, 82,151, 91, -138, 48,245, 37,184, 22,216, 94,196, 72, 43,227, 86, 94,105, 9, 66, 77, 77,175,168, 50, 56,255, 0, 61, 28,238,236, 69,255, 94, - 85,229,173,135, 66, 77, 67,155,142,146, 34,140,162, 36,142,130,200,157, 78, 7,179, 74,173,185,255,238,195,233,201,217,155,243, - 31,159, 6,183,125,203,112,108,219, 97,200, 21,108,225,224,234, 28, 72,140,144,254,106, 53, 77,236,114, 40, 90,173,110,218, 78, -227,207,173,159,253,190,106, 30,174,169,203,186, 50, 14,230, 81, 12, 15,172,162,169,226, 60,191, 28,185,124, 88, 65,243, 42,188, - 74, 80, 35, 98, 59, 38,101,116,135, 48,142, 32,119, 78,200,119,171,106,181,105,174, 87, 85,213, 3,207, 40,146, 52, 21,162,150, - 83, 40,223, 83,234, 54, 66, 96, 70,165, 54, 18,106,133, 0, 80,215,234,200, 48, 72, 83, 83,183, 16, 68, 75,245, 59, 91, 97, 8, -207,144, 42,134, 98,205, 92,243, 98, 15, 18,175, 57,124,233, 89, 2, 65, 29, 62,182,174,155, 34,117, 35, 36,154,216,194, 13,133, - 67, 2,130,238,172, 90,171,179,208,109, 59,155,182,222,152,248, 83,198,244, 68, 9, 62,244,123, 5, 19,144,208, 53,131,218,111, - 60, 20,149,176,125,174,234,175, 98,241,151,192,135,114, 55,197,242, 83, 50, 95,211,176,253,112, 86,220,247, 63,184,160,191, 84, -202, 7, 72, 92, 14,169,100, 1,163, 80,176,217,178, 90, 99,127, 34, 46,118,247,114,183, 94,252, 79, 8,189,119,250,127, 5,160, -235,234, 90,155, 6,163,112,146, 53, 73,211, 52,237,218,178, 58,252,152,236, 3,101, 42, 50,189, 28,234,127,240, 70,216, 31, 16, -188,244,239, 8, 94, 8,187, 16, 84, 6, 42,138,119, 34,130, 58, 81, 68,111, 68,102,157, 48,221,218,181,179,109,154,143, 38, 75, -235,115,206,105, 90, 21,100,151, 13,109,150,188,239, 57,207,121,207,115,158,103, 20,223,153, 50, 60,114, 90, 45, 59,101, 59,227, -232,170,209,139,220,146, 83, 9,185, 33,150, 40, 99,109, 40,222, 59, 36, 65,167,135, 84, 89,196,216, 15,120,166, 61,190, 87,246, - 42, 36, 13,175,132,135,213,139,185,146, 73, 72,200, 32,135,226, 84,251, 78, 82, 20,192,172,232, 67,201, 46, 63,117,244, 12,246, - 97,215,239, 8,149, 50,245,153,165,227,111, 84,190,216,255,196, 72, 37, 90,113,134, 39,108, 99,201, 46,211, 68,112,238, 75, 77, -205, 67,219,131, 74,190, 10,244,196,102,170, 44, 95,167,202, 57, 15,173,122,210,225, 75, 14, 89, 25,123,216, 13,220,253,222, 1, -175, 12,148, 66, 78,217,169,116,124,220,255,208, 13,122,109,191, 43,230,118,248, 20,144,191,225, 54, 81, 81, 38,169, 10, 58,143, -218,170,121, 43,223, 79,162,182,223,166, 59, 97, 50,237,220,204,201, 70,187,137,149, 26,162, 44,112,221, 76,221,184,183,177, 94, -111,238, 90,166,133, 82,160, 90,156,105,123, 29,238,149, 17, 18, 75,212, 33, 18,242,133,133,149, 90,125, 43,178,176,210,105,239, -225,139,145, 67,188,144, 4,182,113,141,141, 74, 88,215,178, 68,117, 80, 1,217,144, 91,189, 0,245,189,202, 74, 48,138, 8,124, -227,135,251, 97,191, 90,157,189,126,227,230,179,199, 79,214,239, 62,192, 83, 7,176, 35,124,195,170, 70, 60,207,130,208,128,202, -192, 92, 93,189,188,245,117,135,189,113,244,133,249,165,215,111,223,163, 14,203, 89,122, 54,163,160,116,191,182,182,230,148,103, - 31,221,191,221,216,111, 33, 50,116,123, 73,183, 23, 70, 17, 21,249, 22,130, 71,222, 88, 92,152,255,240,233, 51,112, 64,194,174, - 80,150, 89, 20,235, 86,153, 36,207,154, 54,118, 5, 96, 98,217,153,161, 38, 7, 53,168,227, 73,181, 57,233,249,255,229, 19, 41, - 56,100, 32, 38, 46, 10, 13,130,179, 42,183,216, 5,169, 98, 72, 45, 4, 88,178,234,165,115,140,196, 78,137, 85,227,118, 43, 77, - 80,170,153,132, 22,152, 66,186,111, 52,177,161,176, 83,133, 65, 66,164,124,152,203,173,176, 92,116, 24, 24, 70, 14,152,202, 64, - 77, 66,163, 88, 1, 2,129, 54,106,182,209,239, 16,124,165,217,209, 4,185, 65,130,175,154,154, 36,171,130, 54, 82,105, 89,236, - 23,199,204,115,107,142,240, 96,201,174,224,186, 32, 14,125,252,177, 40, 21,183,118, 75,204,145, 31,233, 67, 13,184,198, 24,243, - 70,241, 37,209,160,159,254, 35, 44,234,198,210, 76,127, 24,119, 78,196, 74,166, 70, 7, 79,196,243,211,169, 11,162,103,117, 29, -217,244,234,233,227,166, 57,253, 42,156,251, 94,143, 23, 47,218, 74,167,163,133,132,209,145,254, 85,166, 23, 91,186,225,216,150, -157, 55, 73,167, 58,138, 67,132, 52,242,193, 35, 64,131,135,144, 61, 54,175, 20, 44,186,155, 48, 74,188,176, 23,246,125,207,111, -181,218, 47, 63,110,223,121,120,235,233,230,243,189,221, 90,237, 71,109,243,203,187, 23,111, 54, 14,189,120,121,233,188, 97,232, -196,109,193, 93,200,112,201, 84,166, 92, 41,169,136, 6,212,151,193,109, 25,197, 66,113,123,207, 53,190,253,156, 94, 57, 98,105, - 83, 81,211, 3,198,192,165,150,161, 53,118,251, 1,123, 22,138,254,199,200,226, 99, 16,139,241, 99, 16,251, 41,151,122, 40,103, -238,110, 64,220, 68,108, 49, 89,237,162,159,114,233,220,149,157,214, 14, 22, 6, 5, 31,130,203, 3,233,177, 47,159, 56,219, 34, - 25, 50,138, 24,220, 68, 37,242, 52,242, 61,106, 89,141, 84,187,135,128,170,109,175, 13,208, 22,240, 9,240, 24, 53, 32,171, 33, -110,224, 77, 97,169, 32, 67, 88,166, 77, 39,108,204,199, 79, 72,232, 34, 6, 2, 16, 23,117,141,181,214,228,112, 95, 56,227,248, - 90, 92,204, 42, 81,244, 2, 11, 86, 1, 72, 78,180,235,228, 37,227, 33, 75,183,120,236,186, 58,177, 99, 69, 76,227,236,174, 77, -240,203, 80,253,151, 75,165, 49,209,106,180,102, 80,219,253,242, 15, 82,163,246, 33,183, 52, 84,146,199, 25, 12,254,215, 95,253, - 45, 0, 91,215,178,211, 68, 20,134,207, 76,219,105, 75,111,216, 78,161, 84, 48,186, 48, 49, 49, 17, 47,137,241, 9,136,134,141, -137,225, 5, 76,186,144,119, 33, 62,128,110,124, 12, 93,187,193,133, 27,118, 32, 81, 20, 2, 8, 21, 74,103, 58, 51,103,152,142, -255,247,157,105, 33,198, 46,155, 52,211,158,211,243,159,255,242, 93, 12,254, 93,153, 6,191,249,222,242, 31,157,107,116, 64,215, - 28,253, 9, 48,208, 32, 19, 40,243,163,202,198,185, 82, 31, 45,180,150,238, 47, 45,239,159,238,201,189,234, 99,201,240,164, 60, -175, 80,248, 51,113,198, 51,140,134,212,233, 45, 68,242, 87,206, 8,126, 89,107,222,168, 57,155,179, 44,191,174,239,157,122,193, -192,154,168,229, 25, 38,140,100, 85,247, 22, 31, 92,140,206,225,219, 66,109,104,227,209, 8, 89, 84, 40, 29, 88, 22, 37,202,167, - 64, 73,115,198,194, 48,160, 80,176,233,203,243, 34, 77,104,137,113, 5, 80,176, 13, 43,177, 62, 83,239, 54,187,251,253,131, 1, - 92,125, 19, 26,202,208,124,212,200, 27,209, 97,221, 24,253, 38,134,153, 67,252,109,215, 93, 58, 30, 28,117,111, 44,202, 69,120, -120,126, 12,194, 23,215, 80,202, 40,121, 88,171,218,246,227,225,183,221,237,195,147, 3,137,251, 26,210,213, 81, 2,175, 63, 73, -203,199,121, 9, 82, 16, 70,141,229, 77, 29, 75,126,237,231,170,182, 28,185, 32,196,193,139,233,194, 42,143, 44,231, 10,118, 98, - 7, 33,228, 64, 57,124,178,128,196, 4,233, 41, 37, 95, 73,210,153,148,182,150, 8,253,189, 94, 79, 54,112, 99,227,237,147,229, - 71,191,143, 14,201, 0,130,203,153, 20,129,177,134, 72,164, 68,105, 41,111,215,223,172,175, 60, 95, 89,123,245,114,117,245,197, -101,228,111,126,217, 44, 21,161,206, 51, 10,244, 66,123,126,237,117, 79, 37,241,135,119,239, 79,135, 17, 85, 79, 18,199,130, 24, -153,241,139,174,151,202,161,175,191, 31, 28, 23,114, 69,148,240,105, 18, 74,112,164,143, 95, 14,116, 4, 77,214,122, 42, 1, 81, -174,121,123, 10,250, 82,214,191,147,159,204,228,224,202, 31,198,192,113, 51,128, 57, 73,105,166,151,106, 3,162, 78,169, 25,179, -137, 6, 27, 55, 54,140,132, 12, 43, 60,197,212,160, 41,202,130,156,220, 78,142, 1, 82, 66, 52, 50, 16, 13,246, 78,226, 8,249, - 35,220, 77,148,249, 85, 30, 17, 36, 90, 21,140,197, 40,201,207, 44,204, 48,230, 32,182,147,217,174, 90,116,161,201,163, 17,127, -169,221,198, 28,218,244,224, 76,200,218, 70, 68,118,167,161, 14,169,152,143, 4,144, 13, 93,204, 10, 37,127,143,129,180, 67, 98, -212,153, 93, 64, 32, 32, 5,111,210,116,204,148,148,166,120, 72, 18,169, 82,183,214,146, 7, 73,224,148,115, 84, 42,204, 84, 74, - 85,246, 63,199,236, 26, 35,121, 7,210, 81,174, 43,201,175,108,251,161,235,198,243, 79,207, 84,209,243,245,173,162,237,180, 19, -213,247,168, 47,135,122, 82,118,183, 38,159,111, 53, 85,165,146, 4,129, 47,233,177,134,205, 41,192,147,168, 8,243,141,206, 45, -244,118,242,240, 31, 72, 36,181,241, 61,111, 56,218,218,222,253,248,249,211, 88,123,119,171,234, 78, 69,117,203,170,229, 40, 73, -112,190,238,108, 73,110,255,120,249,153, 83,130,164,129, 83,148, 98,187,224, 20, 11,205, 78,211, 98, 3,128,195, 76, 48,167,235, -179,245, 95,251,231,183, 93, 75,221,172, 58,253, 81, 16,201, 37,170, 74,229,220,143,157,179,129, 84,207,144, 44,118,100,131,185, -224, 0,202, 38,202,116,255,233, 34, 73,198, 56,213, 18,128, 54,208,252, 41,182, 17, 49, 0,222, 48,255,243,100, 15, 23, 48, 61, -161,212,181,204,225,228,236,136,132, 60,182,118,105, 53,104,131, 13, 27,101,211, 32,139,218, 88, 84, 43, 54, 81, 72,130,146,172, - 13, 74,135, 52,113, 0, 69,206, 55, 43,238, 69,116, 17, 73,196,179,149, 91,107,123,145,135, 54,163,201,200, 51, 88,223,148,170, -111,160,125,120,181,171,109,169,251,107,165, 26, 88,108,146,140,150, 27,218, 56,184, 18, 17,163, 97,173, 48,213, 80,176,174,187, -125, 1,128, 48,137,230,178,255, 82, 34,132,144, 0, 73, 51, 31, 44,149, 9,215,167,147,238,228, 4,212, 56,149,202,176, 56,135, -111, 5,122,100,228,122,254, 27,226,255, 10,192,214,213,244, 38, 17, 69,209,199, 99,152, 25,102,166,237,240, 85, 10, 72,211,104, -109, 34,213, 6, 77, 12, 11, 87,238, 93,152,184,241, 71,152, 24,127,143, 27, 87,254, 19, 93, 24,173,105, 45, 77, 26,235, 23, 77, -106,169, 22, 10, 76,203,192,192,140,231,222, 55,208, 46,220, 17, 8,240, 6,222,220,123,206,125,247,158, 19,207, 55, 33,207,112, -250, 96,115,250,132,252,227,181,251,195,158, 58,135,140,213, 63, 52,147,115,140,106, 91,166,196, 5, 18,250,243,244, 80, 29, 80, -171,240, 58,101,117, 79, 41, 84, 75, 12, 21, 55,168,201, 86,211, 61, 53,176, 39,174,154, 60,227,143,157,147, 79,174,162, 72,169, -252, 51,137,187,221, 91,171,255,237,181,241,201,167,131,147,113,232, 43, 29,253,220, 98, 97,189,184,129, 8, 18,198,197,211, 4, - 31,223,113,247,177,144,197,133,101, 80,102,134, 99,177, 53,176,178,159, 76,198,254,145,241,148,138,154, 84,164,128, 64, 71,233, - 58, 82,250,152,109, 70,241, 63, 24,134,149,100, 26,192,163,138, 20,154,149,230, 6, 16, 19,126,229, 9, 55,182,112, 8, 64,132, - 5, 3, 31,113,121,135,156, 28, 26,183, 31,238, 29,237,227,211,203,185, 74,110, 49,215,241,186,212, 24, 46,249,240,134, 97,105, -192,210, 87, 92, 22, 8,129, 35,106,229,187,157, 33, 21,109, 82, 66,115,114,164,252,103,235, 41,215,214,236,180,102,232,132,139, - 10,142,225,166, 53, 51,157, 0,118,214,212, 16,165, 70, 23,162,235, 9,220,250,166, 46, 12,242,167, 18,195,203, 73,227, 65,227, -233,179,231, 88,210,239,214,225,171,151, 47, 62,125,120,223,233,246, 16, 16, 72,124, 36, 68,124,167,190,206, 0,228, 59, 24,127, -255,214,220,254,248,238,243,246,135,253,189,221,157,221,157,211,179, 19, 16,237, 96, 18, 13, 46,253,251,245,173, 71,143,159,180, -190, 54, 95,191,121, 43,166, 64,232, 92,225, 4,145, 31, 81, 36, 0, 17, 95,118,237,131, 31,199,158,231,211, 57, 24, 85, 6,217, -127,155,147,244,205,149,141,206,224,204, 49, 23,167, 12,171,231,243,214,242,154, 81,217,204,215,151,182,103,198, 2,229, 26,202, -196, 92, 73,140,138,205, 69,183,132,219, 3,248, 32, 98, 87, 78,229,141,200,123, 41,153,152, 43, 51,177, 62, 23, 16, 58,169,181, -196, 30, 61, 4,106, 73, 48,148, 70, 58,117, 45, 73, 7,161,105,178,213,166, 18, 52,187,204,197, 58, 7,116,187, 77, 65,150, 53, - 94, 54,189, 19,168,141, 68,160,121, 55, 7,108, 9,135,213,108,173,214,219,231,237,153, 73,232, 12,107,241,210, 65,215, 44, 61, -141, 8, 73, 83,199, 92,111, 85,206,156, 82, 41,103, 51,135,198,119,229,173,172, 31, 12,101,220,225,174, 84,241, 4,113, 14,164, -243, 9, 77,201,129,164, 98,169, 97, 24,196,253, 93,156,236,150, 28, 55, 8, 64,133,101, 37, 87,233,121, 61, 32, 6, 42, 60, 74, -234,208,224,163, 93,130,126, 43,153,138,239, 95,232,196, 75, 36,246, 0, 53, 70,138,177,105,151,138, 27, 13, 37, 85,116,116,212, -189,117,199, 17,157, 46,217, 60, 78,148,195,184,182, 84,200,139,181,117, 97,101,162, 62, 88,101,159,218, 32, 3,206, 99, 4, 88, -228,114,161, 44,220, 5,108, 38, 92,222,228,220,235,116,189, 78,175,255,165,185, 47,123,199, 85, 83, 20,117,225, 36, 69, 54, 41, - 50, 41,225,104,212,173,213,108, 29,172,230,171,155,155,117,252,228,166, 97, 24,184, 24, 51,149, 47,231, 1, 52, 72,133, 38, 69, -146,196,120,160,102,191, 47, 90,199,217,218,162,230,135, 65,159,240,141,233,164,100, 91,254,234,247,163,248,223,157,112,189,133, -198,197, 71,220, 18,139, 39,107,213, 77,188,234, 13, 47, 74,217,146, 31,248,216,101,213,236, 13,203,196,117,232, 35,242, 80,141, -240, 24,223, 80, 91,173,245, 46,187, 4, 53,176, 89,147,164,114, 95,114,203, 0, 28, 58, 18,135, 72, 84,178, 85,106, 90,227,193, -220,180,158,118,237,204,130,237, 34, 91, 91,186, 99, 27, 22,194,183,242, 97, 99, 87, 18, 26,168, 12,249,228, 31,132, 30,193, 61, -226,141,133,149,120, 99,143, 89, 91, 34,140,253,249,226, 99, 33,133, 51, 98, 13,101, 46,193, 96,157,120, 29,247, 87,126,169, 48, - 24,158,143,198, 35,197,240,184,120, 19,205, 20, 76,163,217,140,147,140,174,244,165,229,117, 46, 27,132,129, 18, 98,153,113, 87, -122, 15, 13, 62,178,110,249,245,182,201,185,124, 0,151,233,137,113,206, 10, 50,255, 9,241,255, 4, 96,235, 90,122,155,184,162, -240,153,183, 61,143,248,145,132,152,150,132,128, 64,162,139, 10,241, 43, 42, 36, 22,253, 3,253,109,221,116, 83,169, 59,118,168, -170, 20,117,209,150, 69, 11, 34,230, 41, 82,176,101,130,237, 56,241,140, 61, 30,103,158,156,239, 92,187,166, 85,189,178,172,235, -177, 53,247,206,121,126,231,251,214,252, 98,218, 74, 60, 62,205,151, 45,127,219, 47,125,180,182,208,208, 80, 37,148, 10,220,226, - 50,107,135, 38,184, 56, 84, 94, 41, 62, 91,203,133,251,102, 3,164, 65, 14,160,127,117,237,235,215,167, 47, 16,122, 8,191,154, -177,118,128, 13,175, 29, 45, 38, 21, 41,198,171,255,145,112,187,218,190, 54, 56,239,191, 27,157,240,207,240, 86, 13,206,122,120, -114, 96, 28,203,113, 52,154, 45, 34,133, 33, 53,244,141, 19,147, 70,165, 51,156, 13, 17,224,136, 65, 80, 14, 87, 40,176, 57,237, -202,116, 3,255,186,144,144, 64,244,187, 56,170,130, 68,134, 95, 11,112,140, 80,222, 38, 17, 93, 2, 56, 45, 92,134,142,225, 34, - 24, 44, 69,196,136, 13,122,134,154,187, 40,217,149,157,230, 23,163,240, 99, 14, 74,180, 84,117,210, 56,118, 59,122,126,132,129, - 26,195,232,157,245,250,147,190, 48,103,150, 55,246, 14,199,209, 25, 31,181, 74, 95,211, 76, 20,165, 93,119,111,236,221,124,125, -250, 82,147,146, 42, 95, 62,240, 12,243,146, 68,169, 68, 7,245,245, 82,207, 80,106, 16, 29, 87,228,227,160, 8,215, 68, 51, 4, -236,175, 96,165,162,178, 48,160,212,148, 19,199,223,247, 31, 60,160, 45,239,233,207, 15, 79, 94, 29,255,248,195,247, 81,120,110, - 3,208,130, 0,159,192,112, 84, 74,178,194, 54, 76,123,252,184,155,229, 32, 92,229,200,143, 31, 75,203, 66, 63,210, 52,203, 86, -160,221,187,123,155, 40,239,254,245, 71,221, 46,154, 13, 11,221,164, 74,155, 67,162, 16,105,104,163,110,245,250,227,225, 89,200, -187,205, 15,132, 99,250,109, 63, 56, 61, 31,168,253, 58, 25,190,212, 81,115, 95,174, 25, 11, 96, 37,159,245,158, 40,203,206,105, - 92, 94,165,174,229, 9, 93, 48, 76,121,203,223, 13, 69,106,135,189,139,239, 52,166, 9,208,171,192,210, 96,212,133,143, 74,173, -200,147,253,246, 65, 80,247,187,131,174, 2,183,215,141, 58, 27, 77, 9, 7,140,120, 57,175, 86,165,124, 67,249,240, 18,168,249, -235,156, 81,225, 24,152,142,107,187,188,184,225,181, 72,106,169, 2,112,230, 36, 58,187,221,185,243,118,248, 70, 0,136, 74, 19, -186,248,178,121,208,159,188,247,164,250,135,185,243,100,122, 17, 79, 68, 2,253, 51, 4,130,156, 47,148, 33,202, 34, 78,102,174, -227,214, 44,182,242,139,255,232, 79,241,157,228,235,164, 89,202, 79,169, 9,254, 32,170,100,172, 87,104,167,116,161, 72, 84,122, - 76, 58,116,110,104, 69,202, 7,234,205, 44,117,157,122, 14,241, 24,164, 17,152,230,204, 82, 83,215, 55, 96, 58, 9,204, 76,205, - 78,146,153,174,138,178, 82,219, 5,205,181, 94,117,246,239, 81,174,255,246,251,163, 95,255,124,244,247, 96,112,119,251,187, 43, -157, 70,117, 49,229, 45,183, 73, 11,124,143,110,221,161,189,171, 20, 46,200,241, 96, 85, 75, 33, 8,147,243, 89, 85,201,108, 26, - 6,241, 21, 10, 28, 32,234, 13, 61, 77,243,139,249,101,153, 68,135, 46,141, 82,234,198, 20,151,212,177,232,192,161, 67,116,103, -105,113, 78,191, 28,253,116,255,155,111,125, 15,134,220, 48, 76,155, 3, 95,223, 50, 50,225, 1, 70,106,101,207, 38,209,114, 30, -183,118,154,227,161, 77,227, 57, 53,157,173,173, 90, 25,177,187, 37,203, 45,149,228,119,170, 88,126,149,199, 22,182, 78, 69,120, -213,237, 31, 3,183, 74, 36,243,234, 48,118, 31, 46, 62,168,145,105,222,130,253,221,235,156, 3,157,140,223, 61,123,127, 28,184, -190, 18, 85,226,251, 80,233, 43,249, 4,126,241, 13, 76,210,152, 67,177, 93,111, 39,185, 68,173,140,111,126,219,223, 6,174,151, -170,105, 28, 42, 41, 50, 53,175,146,175, 52,227, 53, 33, 20,194,229,148, 18,200, 74,230, 64,202, 65, 90,241,143,106, 55,222,112, -140,143,193,207,203,197, 26, 61,130, 66,193, 86,176, 51,137, 70,242, 21, 54,167,197,110, 99,239,227,244,116, 61, 19,162, 72,136, -181,122,205, 91,136,106, 24,175,106,123, 45,213,249,251, 76,113, 67, 83, 56,185,127, 11, 33,168, 15,149,177, 84,195, 37,213, 58, - 36, 80,227, 20, 24,127, 5,102,118, 67, 19,191, 89,163, 94,159, 4,160,234, 90,122,154,136,162,240,237, 76,231,209, 41,109,105, - 74,107, 65,229, 97, 68,141, 4, 99, 98,226, 3, 3, 11,227, 6,137,137,137, 75,127,154, 91, 23,186, 48, 1, 99,112,103,162, 63, -194,133,137, 65,147, 22, 44, 76,233,116,218, 78,103, 58, 47,207,119,238,180, 8, 27, 22,148, 73,239,220,123,207,249,206,235,251, - 50,252, 78,176, 93, 14,127,211,250,200, 19,250,177,143,230,110,230,158,167,207, 26,104,200,167, 72,105,194,164,111,201,227,219, - 91, 4, 34, 48,198, 57, 43,248, 94,200, 17,100, 25,118, 66,223, 9, 84,173, 85,182, 47, 76, 91,194,242, 71, 1, 93,212,156,178, - 90,191, 49, 10,134,146,106, 40,155,231,133, 30, 16, 92,174,235, 57,244, 48, 30,100,167, 99,233,192, 2, 22, 42, 32, 60,136, 88, - 64, 81,234, 36,193,149, 34, 70,155, 50,131,228,150, 23, 86,200,212,210,247, 96,111, 6, 11,144,231,191,114,165, 27,217, 37, 3, -100, 38, 82,249, 25, 70,103,235,214,163, 32,153, 52,231,155,246,160, 23,160, 15, 16,166,149,110, 90,199, 57, 77,153,196,124,128, -121, 57,209,172, 54,251, 35, 55, 68,150, 64,177, 10,112, 6,244,114, 26,213, 38, 61,170, 86,170, 51,215,138, 32, 88,199, 35,172, -170,152, 82,178,208,187,122,189,251,230,220,182,187,131,110,200,106, 33,153, 18, 1,194,207, 4,132,230, 35, 71, 58,105,144,198, -165,232, 83,177,242,202, 92, 33, 87,182,212,154,165, 47, 20,180, 18, 69,190, 41, 65,112, 12,216,168,240, 52,105, 48,193,237, 25, -251,160,113,244,104,123,124, 8,165, 18,110, 91,106,212,191,125, 62,124,255,225, 99,223,241,143,126,183, 66,127,162,147, 49,200, - 35, 10, 34,148,153,196, 41,173, 13, 97,153,174, 21, 12, 3,225,148,150,183, 12, 77,103,189, 77,203, 80, 44, 83, 41, 22,180,251, -155,247,170,229,226,167,131,253,191, 39,103,113,146, 27,143,195,209, 8,216, 17, 12,180,116, 6,130,228,248,212, 5, 91, 3,146, -217,113,192,149,207,116, 38,139,192,105, 81,110, 10, 39, 11, 85,166,168,147,252, 95, 86,153,100,117, 14, 58,130,139,243,139,174, -215, 39,180, 71, 43,237, 14,207,184,236,141,127, 65, 14,132,209, 77, 38, 16, 4,168,130,152,221,241,122,184, 48,220, 2,175, 43, -122,146, 37,214,125, 54,163,115, 96,240,144,188,248,104,229, 50, 36, 86, 30,195,238,139,122,165, 49,244, 7, 49,243, 40,140,193, -240,149, 99, 90, 18,141, 94,252,205,107,119,219,246,159,114, 1, 80, 78,206, 25, 81,204,225, 7, 94,173,212,112,189,158,204,198, -128, 70, 98, 54, 80,152,165, 80,176,167, 58,122, 69,244,136, 37,160,125,104,182,229,166, 51, 39,211,116,186,130,246, 19, 68, 54, -105,202,242, 76,224,248,157,196, 81, 78, 92,232, 91,200,144, 37,143, 78,127, 69, 2, 57, 40,190, 32, 60, 34,136,128,134, 28, 93, -213, 70,193, 32,149,220, 73,233,180,109,128,175, 50, 65,126, 19, 84, 16,161, 76,202,233, 80,193,142,150, 42, 75,207,158,190,218, -255,242,246,240,235, 59,225,245,162, 73,188,110, 36,235, 79, 54,195,147, 30,189, 78,180,217,172,174,137,245, 59,130, 27, 15, 82, -119,208,183, 59, 4,236,113,212,163,204,208,155,197, 74,165, 60, 47,202,166,208,243,138, 51, 62,181,123,173,174,227,157, 28,133, - 99,247,192, 22,223,135,226,103, 32,218, 62,240,251, 50,133,140,170,240, 83,209,234,217,207,183,247,174, 92, 93, 68,125,195,212, -138,229,185,124,211, 18, 90, 78,152, 8, 97, 98,119,228,245, 6,180,141,186, 6,242,134,138,223, 81,139,134, 58,142,100,134,217, - 63, 15,127, 28,119,185,217,151,171,103,204, 54, 70, 33, 81, 44, 36, 64, 69,159, 12,178,139,216, 88, 28,158, 90,169, 74,223,183, - 81,110, 68, 44,229, 68,183, 79, 87, 13,242,217, 47, 30,236,182,237,118, 16, 6, 38,129, 78,110, 45,245, 2,207,204,235, 43,245, - 53,119,232,188,124,184,215,168, 52,126,117,142,232, 41, 59, 27,219, 69, 3,253,111,116,138,182, 55,118, 90,231,199,180, 35,215, - 23, 86,233,242, 96, 82, 50,139,160, 16, 71,200, 44, 12,109,118,213,170,134,172,254, 42,164,223,225, 44, 95,214,148,137,217,139, - 2,185,240, 8,245,219, 12,177, 66, 14, 51,242,232, 23,104,106, 0,240, 85,200, 15, 12,186, 88, 14,127,130,211,110,152,165, 98, -197, 46,156, 40, 83, 55,104, 45,134,102,114,253, 38, 17,211, 68,165,108, 22,160,141,142, 80, 44, 20,178,145,132, 29,141, 52,240, -233, 37, 20, 63,203,131, 92,110, 76, 23,255, 37,131,232,231,159, 0, 92, 93, 89, 79, 19, 81, 24,189,157,153,118, 58, 91, 59,180, - 69, 54, 13, 9,196, 37, 16,183,132, 24,141,137,154,232, 79,244,151,248,194,139,137,190,251, 98, 12,196, 0, 69,192,165,180, 80, -232, 50,211,118,246,241,124,223, 29,132,248,212,151,166,203,189,243,237,231, 59,231,202,191,107, 85,216,216,106,107, 13,254,183, -204, 36,139,220,206, 15, 37, 49, 47,172, 40, 76,166, 78,197, 65, 21,217,170, 45, 28,119,219,231, 94,159,178,173, 92,240, 76, 95, -143,210, 98, 82, 36, 65,163, 5, 18,185,164,192,171,200,200,194,156, 54,106,221,116, 81, 31,193, 90, 46,198,231, 87,197, 43, 25, - 49,203,167, 81,122,141,212, 50,229,102,191,236,183,193,162, 86,154, 52, 47,150, 91,103,168,182, 36, 85,211,250,226, 61, 4, 64, -201,235, 33,101,122,134, 62,222, 35, 92,226,107, 38,145, 57,187,106, 61,187,251,226,232,252,135,100,236,207,105,213,165, 44,137, -155,121,179, 33,179, 13,203, 11, 38, 62, 21,101,190,107,207, 85,136,251,174,234, 5,211, 40, 67,246, 4,243,169,112,121,152,122, -179, 9,173,170,243,225,227, 86,166, 72, 13,242,204,159,142,240,107,253,112, 2,107, 68,249, 12,195, 70, 34,147,114, 86,132, 63, -100, 27, 52,142,255,186,247, 37, 8, 67, 98, 19, 75,115,124,151,212,178,102,126, 81, 82,185, 51,116,130,106,241, 19,162,168,153, -237,143,130, 44, 80,179,137,154, 76,212, 60, 82, 45,197,116,205,106,203, 49, 92,211,152,183,107, 78,217,212, 51,205, 86,213,154, - 80,107,154,102,106, 42, 62, 83, 45,104, 29,196,225, 65,251,251,254, 30,254,163, 91,211,203,196,228,152,149,137,105, 43,139,225, - 14,241,203, 34, 82, 41,102,188, 68, 49,214, 64, 16,173,106,112,196,138, 67, 70, 77,145,195,247,146,221,157,131,207, 31, 63,237, -183,143,240, 92, 33,132, 48,191, 78,174, 43,121,211,212, 42,229,236, 87, 55,154,193,171,167, 44, 58, 94, 8, 86,146,159,194,249, -192,237, 82, 3, 7,101, 18,107,136, 80,181,199,119,162, 22, 59,220,130, 56,224, 74, 57, 13,202,132, 48,170,136, 44,196,163,196, -249,114, 9,238,149,248, 50,185,218,125,188,250,164, 55,234, 20, 59,229,255,120,155, 81,178,113, 76,185,229, 46,195,181,193, 32, - 41,204,227,196,137, 8,143, 0,115, 18,152, 75,232,143, 40,176,141, 26, 78,120,117,126,173, 59,232,144,110, 23,140, 36,142,173, -138,133,175, 35, 86,169, 44,237,141, 78,241,116,109,222,126,212, 27,116,184,129, 71,235,199, 72,198,135,147,129,132, 21, 80, 95, - 91,211,241,153,142,110,195,252,175,155, 75, 10,171, 63,167,180,234,188,212, 88,246, 3, 95, 33,233, 12,130, 63, 74,250, 35,198, - 99,210, 68, 7,167, 65,194, 6, 44, 79,129,108,131, 33,204, 33,183,248,133, 82, 76, 35,148, 43, 86,115,193,171,176,196,186, 17, - 51, 36,159,205, 36,171,104, 58, 7, 74, 10,236, 26,245,237,200,168, 73,203,155, 26, 26, 49,109, 42, 33,101,230, 37, 38, 60, 4, -175, 54, 95, 39,105,240, 97,251,253,134, 45, 30,184,162, 89, 22, 90, 52,219,122,251, 50,235,245,225, 84,108,199, 18, 79,183, 68, -189, 78, 28, 3,211, 36,243,252, 97,255, 52, 40,240,145, 82, 87, 61, 43,149,141, 70,173,161,154,134,168,155,196,186,121, 54, 58, -236,245,199, 23,221,163,254,112,123, 44, 36,250,218,227,154,253,161, 37, 44, 85, 76, 51,209,241,196,155,231,239,214, 55,238,163, - 54,212,225,162, 22,234, 98,142,123, 0,227, 40,185, 28, 39, 81, 72,224, 10,106,195, 83, 4,170, 14, 79, 52,199, 32,224, 47,110, - 28,153,245, 32,252,118,220, 87,120, 11,137, 1, 0,178,213, 94, 72, 40, 73,253,106,137, 84,194,233,161, 4,165, 27,135,239,142, - 9, 40,169,112,166,184,212, 92,232,123, 23, 97, 24, 12,166, 3, 83,183,150, 26, 75, 81, 20, 54,237,230, 74,243, 14, 30, 66,127, -230, 91,186,121,124,118,178,220, 92,254,115,254, 19,151,181,223,105, 95,248,253,197,250,194,165, 63,216,253,189,131,144,128, 20, -196,181,221, 9,117,123, 74, 50, 54,200, 68,197, 50,236,132, 17,180,179,100,134, 0, 40, 73,102,184,113, 75,190,145,100,102,217, - 91, 33,105,136,210, 88, 41,238, 83, 58,102, 38, 24, 82, 72,123, 50,205,227,149,198,237,131,238, 30,197, 95, 81,172, 31,203,209, -122, 76, 83,220, 2, 71, 24, 16,110,135,217, 21,210, 92,118,241,243, 27, 35,213,150,211,154,240, 72,175,116,205,110,159,219,122, -141, 1, 96,133, 90,138,114, 53,138,189, 1,145, 44,253,231,226,229,203, 95, 1,152,186,146,222,182,141, 48, 58, 28,145, 34, 69, - 73,150,183, 36,181,108, 56, 73,235, 0, 69,155, 30,122,110,255,115, 15,237, 33,183,244,210, 91,129,102,113, 27, 35, 8,144, 52, -150, 45, 57,182, 37, 75,162,196,109, 56,236,123,223,136, 70,111,130,109, 88,228,172,223,242, 22,255,222, 29, 6, 75,244,223,233, - 39, 54, 78,119, 15,175,238, 46,164,166,194,168, 28, 33,115, 90, 82, 86, 44, 41, 86,216,185,123,253,221,130, 26,121,149,183,145, -223, 51,186,165, 15,182, 14,191, 44, 39,172,203,184,116, 66,109, 40,235, 30,221,151,104, 88,140,207,113,212, 69,254,139,189,189, -211,221,191,169, 39,149,232,235, 75,130, 19, 96,110, 10, 98, 66, 17,209,229,174,142,217, 64,127,212,247,199, 63,142,254,250,173, - 22,250,213,178, 22,151, 28,107, 63, 76,222, 75, 30, 98,181, 72, 2,187,161,198, 51, 93,207, 39,178,122,188, 69,186,248,253,239, -151, 72,157, 42, 10, 66, 80, 39,100, 69, 80, 60, 9,216,157, 40,194,125,254,234,211, 91,105,198, 40, 76, 54,222,232,244,243, 59, -217,111, 92,100,156,123,199,175, 85,206, 68,178,133,207,200, 54, 10, 49, 71,167, 17, 90, 16, 74,185,134,245,156,162,174,188, 42, -143, 91, 49, 62,159, 12,159,141,167, 19,156, 77,248,159,233, 44,237,197,125,250, 91,181, 60, 28,212, 73,126,193, 92,208, 86,157, -118,247,122,113,245,108,248,205, 44,153,183, 21, 98,234,248,167,111,127,126,241,234,215,101,166, 22, 89,201,177,104,145,227,152, -124,190, 57,218, 57, 89,155, 91,227, 77,135,251,241,195,237,184, 31,245, 25, 67, 82, 80, 92, 27, 67, 74,148,248, 2, 33, 27,173, -214,189,160, 50, 56,254, 12,226,110,155, 83,190,110, 69,156, 27,226, 73, 47,167,195,158, 71, 85,100,202,184,213,129,182, 33, 30, -200,110, 68,102,241, 83, 54,202, 34,109,108,138,156,173,139, 16, 72,216, 31,149, 37, 33,192,171,116, 47,168,223,143,210,146,165, -161,128,130,107, 84, 13,176,120,193,188,202,145, 1, 96,215, 37,212,155,163,237, 60,121,138, 2, 10,230, 3, 18, 2,108, 28, 95, - 81, 38,200,115,218,166,171,108, 37,138, 61, 4, 95, 25,178,251,210,163,221,195,241,221, 37,198,249,108,116, 42,185,138,252,161, -246,113, 64, 19,123,174,105,187,252,252,233, 15,167, 31, 95,183,233, 68,165,165,217,197, 97,199,201,128,179,165,168,112, 7, 91, - 95,104,138,113,216,195, 97,122,118,254,198,121,102,224, 16, 92,107, 27,132,237,176, 14,211, 60, 21, 22, 2,139,149,255,140,222, - 96, 52,152,228,121,222, 86, 56,200,202, 85, 24, 4,248,206,146, 22, 72,190,132,210, 89,106,138,189,173,131,105,130, 16,196,123, -188,127,140, 36,140,200, 72,202,196, 75, 13, 93, 25,191,102, 29,127, 43,218, 94,102,139,134,171,193,146, 11,169,243,165, 21, 85, - 3, 43,220,189, 18,239, 18, 82, 3, 69,115,203,208,117,128,104, 83,182,254, 52,194,133, 30,174, 37,135, 16,195, 3, 15,186, 59, -201,122,145, 23,105, 99, 83,225, 9, 11,181, 46,234, 76, 17,126, 34,246,100, 90,164, 10, 36,252,193, 65,125,244,224,248,143, 63, -127, 57,110,177, 5, 58,175, 84,132,247, 40, 19, 69,209, 8,221,193,168, 15,135,234,224,145, 42,156,218, 55,219,179,174, 10,114, -239, 59, 74, 88, 68,178,152,206,150, 95,221,116,212, 94,172,118,251, 59,131, 24, 65,140,241, 59, 51,171,141,178,129, 16,193,113, -196,206, 69, 13,188,235,171, 46, 46, 24,114,218,173,223,143,124,228,143,237,128, 18, 52,120,137,235, 84,153, 82,208, 21,156, 51, - 42, 52, 98, 85, 44, 91,200,170,112,172,171, 40,196, 21,209, 46, 75,172,180,237, 40, 90,152,116,163, 7, 86,253, 79,145, 80, 36, -197,197,188,116,141, 95, 98,181, 99, 34, 16, 59,102, 6,249, 40,150,131,254,250,209,201,229,108, 60,186, 62,247, 85,128,200, 44, -208, 65, 86,172,199,179,201,147, 7, 79, 61,178,198,219, 87,243, 9, 29, 5,130,240,203,108, 60, 79,238, 30,110, 99, 6,167,131, -206,224,249,147,239, 46,110, 47, 17,228,176, 93,111,171, 85,182, 60, 27, 77, 49,230,123,253,253,236,110, 93,107,103, 96, 67,156, -140, 83, 8,108,104,210,174, 47, 40, 66,231, 72,179,136, 6,118, 21,104,223, 39,216,103,211, 2,181,247,204, 37, 98,187,233, 85, -112,121,123,142, 0, 92, 82,246,194, 85,250, 58, 65,188, 34,202,220, 33,110,154,118,176,251,150,166, 66,173,155,170,140,150, 93, -237,188,126, 55, 80, 94,185, 37,210,124,105, 93,203, 82, 10, 53,181,128,106,170, 13,243, 67, 53,248, 72,175,110,140, 43,238,153, - 82,255, 9,192,213,181,236, 54, 13, 68,209, 25,219,177,199,118,211,216,105, 30, 45, 45,173, 2,168,106, 23, 32, 4,136, 10,137, - 71, 43, 86,240, 7,176, 97, 1, 72,124, 26, 95,193,130, 13, 66,168,162, 69, 32, 80, 21,104, 69,219, 52,105,146,230, 81,219,117, - 98,199,230,222, 59,166, 84,172,179,137, 61, 51,215,231,220, 57,247, 28,137,223, 19,129,182, 6,140,108,234, 82, 50, 59, 36, 65, - 18,187, 48,138, 66, 5, 85,232,226,240,228, 16,155, 62, 92,254,165, 68, 33,163,165, 65,128,115, 40, 42,203, 68,250, 26, 87,209, -157, 3,157, 16,227, 98,190,232, 97,235, 80, 93,172,212, 6,193, 9,177, 96,207,214,167,224, 49,150,231, 87,209,157, 7,243, 25, -162,236,166, 42, 83,137, 82,179, 73, 65, 41, 94,253,104,135, 76,198, 51,134, 98,225, 85, 85,132,185,149, 82, 30,207,101, 3, 79, -177,117,115,161, 84, 91,191,190,222,234,183,147, 73, 36, 12, 43, 70, 31, 31,245,188,149, 85,154,174, 4, 33, 48,235,164, 90,168, -158,134, 94,150,243,196,161,112, 7,205,193,241, 36, 51,173,207,156,232,101,242, 58,206, 55, 77,226,194,148,211,247,251,240, 59, - 16, 23,140,118,131,195,163,219,152, 64,141,178, 45, 92,175, 91, 87,110, 11, 67,248,161, 55,235, 94, 66, 9,144,170, 30,118, 15, -224,201, 37,104, 5, 32, 25,132, 62,249,130, 26,240,164, 64,226, 96, 31,220,185,186,182,211,252, 81, 48,221,238,217,201, 94,123, - 47, 78,198,183,107,119,201,255,168,111,229,140,162,229,194,235,191, 86,173, 89,194,106,244,246,161,102,124,233,215, 63,214,119, - 63,212,247,182,127, 31,236, 52,143,182,142,154, 63, 59,157,250,113,155,161, 12, 30, 96, 72,194, 13,107, 28, 33,208, 40, 8, 99, -198,178, 22,167,167,203,192, 0, 76, 81,177,196,172,101, 94,118,236,146,101, 20,128,205,106,128, 50, 82,224, 72,176,204, 80,169, -130, 16,209,125,140,205, 12,142,206,177, 42, 23, 34, 45, 76,165,121, 19, 0, 84,202,199,172,209, 8, 14,186, 1, 74,128,128, 14, - 72, 3, 39, 12, 42, 17,142,233,222, 91,126,208, 26, 30, 83,170, 6, 55, 48, 56, 8,248, 58, 42,204,132,102,234,134, 25,199,145, -146, 89, 68,100, 83,158,138,212,165, 2,199, 50, 29, 77, 81, 80,139,166,106,116, 25,133,213, 80, 0, 71,209, 40, 57, 80,198, 45, -164, 50, 64, 30,129,252,147,181,167,219,245, 45,132,173,210, 48, 68,242,119,248,119,201, 8, 77,190,209,114, 75, 0, 22,132,115, -235, 78,205, 0, 74,130,117,133, 37,155,115, 47,119,134, 45,168,170, 47, 30,191,250,252,107, 19,165,218, 36, 92,159, 45, 46,148, -243,101, 47,240,201,154, 10, 83, 76,201,199, 52,148,151,104, 99, 12,212,197,171, 88,160,113,168,201, 73, 83,192,248, 40,234,192, -182, 17,198,155,204, 57,243, 80,119,112,252, 2,239,181, 34,158,254,157,166,145, 54,146,132, 76,128,230, 78,178,192,102, 84, 34, -186,246,140, 15,251,159,168,245,195,213,141, 32,196, 56,116,248,150, 88, 57, 75,106, 1, 97, 63,220, 88,186,185, 79,190, 8,179, -206, 2,214, 5,169, 30, 73, 1, 13,152,110,190, 4,251, 7,205,242, 80, 74,133,167, 21,133,145, 60,209, 57,127,180,114,239,211, -230,219, 57, 45,122,239,177,119,125,214, 28,177,121, 53,221,120,184,150, 14, 60,213,208,249,173,155,172, 84, 70,240,126, 54,102, -240,141, 30,156,246,218,141, 48,194, 68,221, 88,134, 36,209,110,215,109,199,210,114, 57,219,128,253, 13,252,180,121,216,110, 14, -189, 97,183,253,221,147,221,105,116,217, 93,214,217,125,151, 9,133,181, 70,172, 23,178,231,207, 94, 58, 43, 53, 6,165,220, 52, -228,140, 22,250,202, 27, 80,120, 21, 60,151, 26, 78, 20, 41,182, 8,142, 26, 90,111, 55, 87, 41, 49, 91,199,209,242,201, 36,232, -120,187,251,167,222, 4, 35,222, 51,143,132, 36,141, 57,221,183, 82, 45,115,109,199, 31,157, 17,156,242, 1, 36,189,126,242, 6, -222, 67,103,208,133,165,104,245,154,176,154,139,213,165, 83,168, 78,105,188, 80, 90,204,155,121, 0,248,237, 65,203, 15,209, 16, -184, 63,236,214, 42,181,185, 98, 85,211, 69,111,208, 1,140, 12, 31, 6, 91,183,190,254,254, 6, 44, 92,182, 89,228, 29, 15, 89, -144, 34,201,132,195, 8,199,124, 38, 95, 70,217,251, 56, 76, 50, 40, 47, 91, 53, 36, 73, 33,209,220,136,122, 6, 23, 47, 47,149, -127,137,234, 50,172, 0, 13, 62,131,216, 39,175,211, 40,205,230,150,101,131,135, 3,230, 82,168,255,192,206,189,145,201,172,132, -114,125, 21,118,161,178, 75,213,172, 28,187, 85,169,115, 66,166, 73,156,166, 55,210,127, 22,123,231,142,117, 23,144,250,127,205, -153,243,159,255, 8,192,213,181,180, 54, 17, 69,225, 59,115,103, 38,147, 73, 38, 77,155,180, 53,161, 85,172, 21, 31, 85, 68, 65, - 16,193,149, 27,193,189, 11, 93,248, 19,220, 8,254, 45, 65,252, 1,226, 66,161,180, 82,138, 45,138, 36,109,146, 54,109,146,102, - 30,201,100, 50,153,151,231,156, 59, 81,113,215,210, 69,195,220,155, 51,223, 57,231,123,100,243,153,130,106, 66, 67,132,240, 10, -211,236, 98, 97,149, 41,205, 95, 80, 98,214, 3, 87, 98,227,210, 13, 63,152, 8, 26, 89, 49,103,112,142, 17,104, 70, 46,143,242, - 63,241,104, 24,198,218, 38,164,224,162,193,142, 54, 13,200, 79, 74, 74,201, 5,144,211, 71, 79, 81, 6, 39,241,158,211,229,169, - 60,103, 50,207,243, 59,232,157,137, 61,157,162, 39, 25, 47, 88, 22,246, 6,197,188,137,201,135, 12, 0, 65,142,156,166,255,104, -155,208, 33,104,224,244, 26,103, 13, 56, 39,184,174,183,234,183,186,118, 87,180,183, 34,192, 30,157, 3,104, 71,226,248,163, 36, - 27, 0,226,170,117,158, 5,137, 71, 66,251,244,152,220,232,177, 37, 71, 3, 67, 13, 10,247, 8,199,127,178, 4,197, 87, 81,160, - 37,213, 28,207,169, 87,214,205, 66,121,132,146, 7,118, 58, 60,233,187, 3,180, 73,242,156,139,241, 5, 46, 84,147, 20,176, 60, - 42, 53,200, 22, 59, 68,177,114, 44,252,109, 48,121, 59,138, 26,131, 6,124,164, 90,185,238,250, 14, 2, 94, 18,122,244, 0,201, -166,233,213,213, 77,119, 58,130, 94,175, 53,108,182,172,134,156,170, 27,181,245, 68,179,224,171, 3,255, 27,218, 17, 55, 9,220, -153,119,238, 89, 77,123,184,123,218,249,212,104,236,180,218, 65,196,172, 89,120, 58,154,254,178,172,207, 71,157,253,238,217,135, -195,230,215,102,103,187, 55,248,230,218,251, 67,203, 10,166,143,215,107,245,165,210,162,174, 47,231,243, 38,207, 25,146,106, 72, -202,162,170, 20,101, 94,214,184, 1,125,134,170,192,119, 88,215,152,174,240,145, 29, 29, 54,236,142,237,139,117, 92, 44, 2,237, -105, 76,142,235, 95,153, 31,116,246,208,198,139,238, 17,102, 46,162,199, 41,190,240,176,240, 9,126,250, 60, 81,145,252, 84,196, - 24, 13, 41,107, 24,118,136, 18, 77,148,198,196, 44, 89, 49,151,225, 88,252,153, 23, 39,161,208, 4,102, 42,229,108,190, 45,237, -254,220, 33, 58,138, 12,224,174,190,184,102, 67, 47, 72, 60, 74,209,216, 98,114, 12, 14, 79, 19,168,146,208,170, 19,184, 97,208, - 95,235, 90, 1, 10,129,202,181,239, 71,251, 80,136, 85,232, 85, 8, 65, 89,227,225,221, 43,119,131, 40, 64, 77,147,196,171,197, - 42,224,113,210,197,204, 4,193, 92, 68, 62,160,130, 31, 3, 45,112, 73,130,162, 45,218, 20, 93, 91,221, 60,185,104, 11,129, 85, - 6,230,228,108,251,144,215, 13,130, 35, 72,244, 68, 54, 78,154,148, 40,137, 16,211,180, 2,143,148, 48, 88, 92,218, 23, 45, 51, - 87,240,195, 41,224, 83,232,146,123, 0, 57, 49,216, 44, 57,119,187, 18, 6,224,112, 64, 66, 81, 6, 34,201,138, 35, 10,253, 96, -140, 30,190,232,231,194,137, 25, 38, 43, 72,214,150, 75,154,246,232,250,131,230,222,199,169,196,222,219,108,152,178,179,152,221, - 54,249,243,103, 79,216,112, 44,175, 84,216,131,251,248,212,189,144, 77,124, 54, 9,103,174,227,246,219, 33,113, 91,133,159,167, - 80,108, 41,186,161,104,133, 18, 28,100,181,200, 76, 67,237,187,205,190, 19,185,125,107, 60,233,147,241,208, 37,206,158, 47,178, -173, 34,194,244,230,152,229, 75,213,215,111,222,177,229, 5, 44,232,240, 86,128,174, 1,126,200,113, 28,193,115, 92, 47,100,230, - 79,138,100,111,127, 41,234, 51,190, 86, 97, 57,149,168, 30,177,119,108,255,232, 56, 19,228, 17, 49, 50, 1, 67,164,170,202, 74, - 25,122, 23,108, 92, 72,210, 69,109, 95,189, 82,235,219,253,175, 7, 95, 90,131, 86,217, 92,184,115,249,102,173,178, 2,135,178, - 82,172,246,144, 86,199, 1, 35, 98,178, 2,149,187, 87, 79, 95,250,161,223, 30,156, 12, 39,184, 75,187,119,231, 97,247,180, 13, -183, 14, 30,242,234,210,234,185,221,123,247,226,237,205,181,173,227,222,209, 36,244, 1, 89, 6,209, 20,110,186, 23,192, 75,151, -195, 97, 77,102, 30, 57,188,139,100, 23, 86, 54,150, 34,180, 98,143, 5,191, 29, 58,108, 54,207,100, 22,244,113,150,254,111, 0, - 6,191,151, 75,213, 32,240,209,112, 70, 34,211,168,108, 65,147, 9, 77,179, 33, 27, 19,228, 89, 66, 61, 8,166, 21,168, 52, 26, -154, 71,168,100,178, 61,119, 31,158, 19,183, 36, 10, 94, 35,183, 55, 57, 77, 98,246,215,150, 78,146,255, 41,203,255, 44,105,255, -248,244,253,253,195,111, 1,184,186,150,222,166,177, 40,124,253,186,182,155,212, 9, 41, 41,180,208,150, 1,169,170, 40, 98, 1, - 93, 32,182,108, 88, 0,107,164,153,221,252, 71,196, 14,137, 5, 8, 86,136, 5, 26,164, 78, 59,130,180, 73,154, 87,237,216,142, - 29,199, 54,231, 59,215, 46,210, 72,221,181, 77,147,250,220,123, 94,223,163,186,223,153, 6, 70,205,124, 2, 73, 85, 16,180,157, -188,150, 10,209, 43,111,109, 92,224,211, 16, 34, 59, 26,215,197, 43,142, 17,199,180,125, 42, 90,117,136,141,108, 95,219, 9,147, -192,145,107,149,141, 3,221, 92,106,177,200,250,195,244,103, 61,215,227,186, 6, 47,213,110,118, 18, 96,149, 84, 6, 3,196,248, -134,183, 21, 38, 62,128, 50, 80,129, 87,174,123,122,109,233,141,212, 6,251,233, 34, 99,171,245, 92,109,172,202, 10,116, 8, 0, - 15, 34,159, 89, 9,244,204,206,103,231, 53,253, 69,165, 41,109,187,179, 29, 81, 12,149, 42,141,227,135,119,186,123,195, 96, 64, -133,182,180, 36,150,151,140,110,239, 52,174,251, 88, 30, 2,249,174,160,214,138, 89,174,176,112, 60,185,162, 54, 80,167, 75,124, - 6,223, 47,165,238,141,149, 3,189,103, 58,207,149,243,142, 40, 93,185, 22, 47, 99,166,152, 98, 9,238,185,237,136,171,248, 44, -163, 6,190, 92,163,239,166,201,206,198,238, 69,112,209,144, 13, 6,240,161, 20, 48,117,155,222,249,193,237, 7,223,206,190,222, -233,238, 7, 73,208,148,157,225,124, 56,142, 23,203,172,176,216, 15,213,150,194,146,176, 75, 86,126,155, 82,152,174, 97, 5,154, -248,114,252,223,201,176,255,243, 98,236,227,148, 20,185,101, 59,158,103, 83, 78, 0,197, 70, 27,132,139,143,199,103,147,176, 60, - 29,173,250, 1,203,125,165, 69,184, 2, 64, 38,165, 30, 60, 55, 50, 16, 64,202, 36, 41,253,203, 98,116,145,159,244,210, 97, 16, -177,114,139,178,110, 64,177,107,234, 20,136,121,211,245, 40, 85,115, 69,105,176,200, 70,169,118,146,182,229,218,216,119,173,116, - 69,133,214, 43, 3, 6, 54,200,194,120,193,212,192, 81,162,180,103, 96,252,178, 84,150, 14, 57, 79,150,213, 63, 77, 26, 78,229, - 29, 82, 55,142, 74,175,149, 94, 66,234, 14,157,225, 73, 56,186,138, 99, 77,201, 17,176,203, 54,176,204,114,141,167,171, 13,165, -230, 31,196,190,174,244,126, 5, 70, 70, 2, 87,240, 58, 53, 76,113,186,232, 79,123, 11, 42, 18,161,140,190, 74,243,213, 50, 77, - 33, 39,171,213,210,142, 56,124, 57, 6, 78,101,237, 37, 12,230,176,148,134, 69, 13, 1,147,233,240,153,154,204,231,186,146,203, -110,187,173,104, 17,138,223, 26, 82,152, 22, 98,250,169, 91,135,123, 15,199,254,200,115,240, 44, 74, 22, 41,212,117,115,153, 37, -211, 96,164,240,157, 90,181,108,192, 66,130, 5,103,216, 11,138,167,172,183, 55,118, 98, 40,226,105,138,188, 1,225, 48,129, 25, - 29,252, 61, 74,241,240,214,254,229,233,123,234,136, 63,197,162,193,130,115,143, 91,222,139,103, 79,180,249, 92,220, 63, 16,119, -239,138, 36, 19,139, 20,245,123,146, 37,179,145, 63, 25,100,106, 83, 89,172, 42, 73, 63, 96, 30, 76,171,209,150,101, 97, 83, 98, -191,217,110, 9,109,220,155,142,163,240,145,225,123,162,120,188,174,253,121,179,124,218,194,103,234, 45,196,247,137,120,249,252, -245,225,223,127, 9,232,106, 72,212, 2,166, 86,125,169,226, 93, 71,193, 41, 28,163,152, 77,198, 31,222, 93,223,223, 18,221, 54, - 18, 0, 75,194, 70, 39,211,247,199,231, 70,237,112, 93,178,154,222, 10,138, 23, 49,147,117, 42,192, 52, 29,240, 52,203, 54, 91, -155,116,183,186,146, 74, 14,115, 30,207,255, 29,156, 70, 73, 76,213,247, 56,154,189, 58,122,217,159,246,215,157,230,102,123,235, - 50,156,132,241, 98, 48, 57,167,180, 77,177,103, 11,217, 59,251, 33,184,144,178,165,123,111,235, 15,122,112,111, 62,191,253,222, -251,103,204,115,182,189,238,238, 52,156, 58,172,121, 78, 45, 66,156,198, 71,247,142, 40, 90, 50, 80, 38, 17, 57, 32,255, 50,190, - 86,209,160,121,166, 85,220,234,236, 94, 70, 51, 85, 47,182, 26,215, 82, 40,100, 80, 35,203,156, 80,248,179, 80,209, 29, 66, 60, - 18, 78,105,248,213,117,135, 50,166, 14,214, 78,205,237,110, 57,157, 20, 52,230,154,243, 33,196, 70,179, 11, 99, 43,116,192,162, -168,128, 51,229,255,188, 53, 40, 2, 93,179, 1,210, 75,101, 99,121,197,249,168, 54, 57,218,239, 37,235, 21,120, 70, 65,143,213, -148, 91,252, 18,128,173,107,233,109, 26,139,194,247,166,118,252,138,157,184,105, 83, 53, 64,105, 21,205, 84, 8, 10,165, 48, 84, - 3,236, 24,254, 0, 27,118,136,223,128,208,252,142, 89,240,111, 16,136,213,108, 25,141, 6, 88,192,204,208,210, 14,105,226,198, -118,252,182, 99,123,206, 57, 55,225, 37,164,170,139, 72,173, 31, 57,207,123,190,239, 59,130,191, 90, 27,138,217,111,247,109, 99, - 25,194, 22, 18,190,185, 4,241, 93,140, 38,145,132, 76,146,176,170,140,194,141, 13,244, 40,133,104,123, 8, 13, 33, 60, 12, 39, - 40,122, 49, 77, 61,129, 11,174, 4, 32,130,162,252,185,149, 77, 63,158,128, 77,195,159, 67, 45, 44,214, 16, 67, 13,180,214, 89, - 7,135, 39,114, 44,210, 65, 33,252, 33, 80, 31, 59, 3,174, 54,181, 27,131,155, 31, 78, 15, 62,157,109,126, 18, 96,227,115, 58, - 50, 26,136,132,106,203,124, 89,183, 85,197, 88,177, 86, 17,144, 67, 42,125,155,171,131, 24, 69,101,249,154,189, 30,162,215, 97, -109, 14,206, 79,196,208,185,140, 83, 75,183,252,208,219,221,218,131,155, 63,211,221, 24,186, 31, 69, 52,191,188,117,245,253,232, -111,120,174,157,243, 87, 62,226,135, 69, 27,101, 70,178, 26,207, 51, 10, 47,154, 72,146,108,234, 86, 10,169,162, 98,150, 97,151, -228, 47,219,103, 47,185, 52,116, 21,249,189, 99,118,135,254, 49,201,173,212, 98,229,138,174,234,121, 89,128,193, 65,209,241,211, -224,198,195,187, 15,158,253,249, 12,190, 8, 8,179, 96, 10, 89,153, 83, 49, 66,192,123, 73,238, 89,107, 89, 89, 52, 27, 77,168, - 64,211, 25, 34,186, 78,162, 56,137, 43, 63, 46,131,136,133, 97, 29, 69,117,154, 67,232,173,147, 12,121,219,141,154, 59,211, 16, - 92,161,183,172,217,109,195,130,126, 74, 85, 33, 48, 26,170, 44,163,188, 14, 54, 89,154,140, 90, 24, 27, 22, 92, 43,134,212,146, -196,178, 27, 20, 78, 48,117,220,120, 56,137,142,198,254,209, 56, 56, 26, 77, 15, 71,254,193, 56, 56,158,248, 97,154, 67,153,131, -104, 61, 92, 46,197, 69,154,166, 58,126, 70,164, 30,156, 40,146, 2, 45, 47, 27,115,133,114,184,207, 21,163,135, 74, 76,104, 97, - 75, 96,238, 89,153,217, 70, 55, 39,178,177, 56,104, 70, 72,126, 89,252,122,239,241,171,247,175,107,154,168,227,198, 55,146, 87, -133, 26,106, 86,101,221, 86, 79,150, 36,104,207,161, 92,104, 54, 21, 40,117,193, 15,117,165,149,206,226,182,218, 1, 39,132, 10, -182,165,154, 25, 2,111, 24,137,223, 98,139,143,164,237,196,173,197, 68,133, 45, 73, 40,158,165, 64,169, 11,191,123,118,191,163, -119,112,133,192,172, 72,139,196,110,117,224,114,152, 6, 80, 88,177, 9,126, 14, 6,188, 98,174, 34, 65,175,174, 84, 73, 39, 44, - 92,181,179,113,237,116, 58, 86,112,135,157, 6,161, 89, 83, 52, 63,114,119, 54,175, 66,235,166,171,184,103,124, 46,152, 35, 30, - 29, 81, 97, 41,251, 82,183,157,207, 81, 6,240,206,156,192, 33,224, 52,228,255,156, 0,163,156,126,112,122, 10,207, 69, 51,158, - 82, 80,210, 33,235,236,110,236,121,225, 68,148,138, 68,155, 74,224,219, 21,138,146, 84, 19, 83,219, 75,234,214,208,165,220,190, -176, 31,252,243, 28,226,223,239,152, 89, 48,190,223, 31,244,111,253,124,137, 21, 57,187,118,133, 89, 54, 30,206, 68, 57,139, 51, - 6,175,111,244, 95,232,141,102, 52, 40, 38,129,135,133, 30,125, 85, 42,134,197,151,224, 86, 16,187,202,206,116,251,105,241,118, - 24,200,153,123,183,149, 93,110,213, 23, 45,156,158,255,155,214,127, 57,172,221,238, 61,250,237, 9, 27,172, 99,124,111,200,223, -209,162,149, 72, 64, 80,145, 39, 79, 95,168,217, 88,191,184,201,108, 13, 63,164,173,190,241,155,209, 31, 71, 30,237, 28, 71,229, -252, 5, 19, 84,140, 56,185, 80,238,162,131, 8,102,106,173,211,216, 75,178, 56, 47, 10,200,235, 96, 6,120, 58,215,212, 58,166, -237,120, 14,116,161, 40,206, 82,205, 78,220, 19,134, 7, 86,208, 59,240,177,239,252,178,119,231,229,187,151,219,103,127,220,223, -222, 63, 28,125,176,116,115,120,122,226,134, 30,252,135,235, 63, 92,135,250, 29, 46,177,190,124, 14, 26,110,108, 22,107, 22, 36, - 83,120, 33,120,154,138,253, 57, 35, 2, 93, 13,205,132,161, 91, 21, 70, 54,132, 84,161,252, 53,175, 53, 4, 95,132,243, 5, 28, -245,124,147, 1, 20,178,186,106,153, 40,152, 19,193, 35,224,136,133, 68,162,192, 40,210, 44,105, 32,171, 93, 76,122, 48, 8,164, - 72,171,230, 95,108,190,131,114, 42, 69,225,154,197, 26, 66, 48, 6,154,249,149,223,192, 97,138, 10,183,180, 44, 22,194,240,197, - 66,108,254, 85,136,255,172,208, 52,135,118,241,133, 4,205,255, 2,208,117, 45,187,109, 27, 81,116, 40,206, 80, 18,101,138,182, - 30,136, 20, 59,178, 93,195, 85,144, 54, 73, 19, 7,136,211, 46,130, 34, 8,144, 44,188,200, 42,139,254, 74,209,125,255,160,191, - 80,160, 63,208, 93, 23,221,116,215, 38, 14,210, 2,181, 27,203,174,100,209,178,100, 61, 76, 82,124,230,158, 25,202, 13, 16,244, - 3,108,105, 70,119,238,156,123,231,220,115,178,249, 85,134,186, 59,162, 88,172, 89, 53, 41, 45,206,101,155, 27,109,234,162, 40, - 65,198, 75,211,175, 87, 90, 83,202,224, 82, 3, 68,232, 98,185, 84,129,229,152,160, 51, 80,144, 10,218,186,105,148,148,146,178, -208, 33, 52,253,242,241, 55,251, 71,175,232,252, 16,188,122,248,233,163,238,224, 36,235,228,235, 20, 0,133,243,153, 19, 64, 25, - 23,255, 33, 82, 3, 41, 57,189, 92,180, 61,120, 40,207,193,127, 79, 23, 66, 5, 90, 38,184,172,120,169, 20,161,123,143, 94,244, -135, 61,169, 17,175,209,198,209, 47, 33, 11,219,104,181,178, 38,132,209, 25,188, 83,157, 77,217,248, 78, 50, 72, 38,169, 31,153, - 41, 59, 76, 57, 92,250,160,238,168,231, 71,243,195,254,225,103,173,219,206,164, 31,196,241,240,114, 84, 70,146,180,157,177, 67, - 81,101,230, 45,219,180, 47, 32, 15,155,214,202, 13,169, 19,153,206, 99, 47,149,198,204,141,229,166, 23,186, 62,158, 54, 35,130, -165,224,198,196,208, 47,245,231, 46, 1,119,203, 92,206,131,139,237,211,229,188, 90,105, 16, 24,113, 70,125, 90,227,147,187, 79, -127,252,245,167,178, 89,222,172,111,210, 81,165, 84, 78,193,212,170,110,160,117, 35, 29, 29, 59,131, 3, 47,240, 39,254,136,238, - 45,218, 10,171,104, 5,220, 71,181,164,167,130, 99, 97, 33,196,119,210, 32,132,241, 30,213,185,148,190,133,224,117,171,100, 24, -194, 52,140, 21,194, 60, 5,221, 40,242,178, 52,216, 44, 9,141,146, 59, 28,127,120,174,160, 9, 12,228, 83, 89,138, 22, 65,217, -151, 2,144,208, 6, 72,165,254, 66,162,138, 75, 74, 40, 34,196,156, 99,114,127,243,171,206,217,209, 21, 97, 88, 48, 81, 54, 87, -148,255,153,218, 76,138, 13,202, 23, 69, 65, 16, 27,102,117, 50,208, 19,218, 52,229,238, 45,135, 66,233,146, 75,120,142,111, 55, -111, 17,120,167, 11, 30,179,199, 76,252,213,125,203,113, 44, 21,197,149,209, 77, 6,171, 0, 76,108, 7, 65, 56,191,211,186, 55, -113, 39,170, 61, 74,223,137,138, 42,170, 24,230,145, 43, 79, 96,156,231, 5, 24, 50,196, 49, 91,196, 4, 90,127,137,154, 40,193, - 58,224, 72,147,134,237,213,118,119,120,226,122,147,177,127,209,168,172,230,128,149, 48,185, 73, 43,161, 26,220, 20,166, 23,121, -161,236,179,211, 61, 68,139,191,179,190, 67, 23, 3, 33,104,250, 2,253,241, 41,100, 26,133, 65,105,135,192,157,139, 81,198,184, - 63,234,129, 24,131,103, 52, 28, 13,216,140,164, 0, 61, 75,104,185, 64,104,140, 67,154, 87,207,104,108, 25,205, 82,151, 54, 99, -224,215, 23,242, 69,202,249,166,177,148, 61, 68,107, 84,161,250, 85,171,174,170, 88,217,116, 74,157,233,169,244, 36,145, 47, 75, - 80,234,101, 28,200, 29,189,172, 21,179, 26,196, 30,231,204,160, 35,105,216,113,228,127,253,249,151,163,222,235,182, 54,253, 39, -226,199, 1, 43,176,244,187,221,246,218,118,139, 45,153,236,254, 14,146, 0,129,119, 36,119, 66,241,151,147,127, 15, 93,247,146, - 45,172,116, 64,133, 72,149,222, 48, 90,210,162,100,231,146,164, 72, 27,218,180,141,134,109, 13,252,223,135,243,233,197,184,192, -216,225,101,242,247, 44,218, 63, 35,188,106,126,251,253, 15,230,222, 19,217,203,230,255, 51, 15,143,159, 52,252,227, 77,247,151, -159,111,220,251,132,109,214,152,105,224,212, 71, 0, 72,231,191, 29,239, 15,102, 58,210,187,244,153, 75,149,159, 75,230,189, 71, - 91,189,126,109, 99,134, 51,155, 98,142, 44,205,230,219,149,181,179,224,249,173,230, 86,239,252,148,246,102,247,139,199,185, 56, -126,123,242,103,213,174,231,228, 16,211,133, 59,162,163,212, 57, 59,166, 63, 63, 29, 59, 7,221,131,218, 74,253,120,208,161, 88, -213,225, 32,110, 52,110,172,131, 66, 39,237, 20, 9,191, 43,225, 35, 10,248,231, 15,158,117,156, 35, 53,105, 68,159,187,221,188, - 57,241,166,195,217, 64, 66,230,248,230,218,237,193,216, 73, 37, 65, 94, 1,103, 16,226,101, 99, 67,234,229,193,207, 14, 20, 3, - 40,215,224,129, 48, 89, 52,101,212,235, 75, 40,221, 37, 53, 41, 34,148, 53, 44,217,194, 87, 80, 81,184,254, 51,216, 5,159, 8, - 19,234, 31,232, 15, 47, 28,130,241,218,100,153, 22, 76, 3,175,104,145, 87,216, 93,145,178, 22,131, 84, 31,101,121,237,189, 0, -124, 93,219, 78, 26, 81, 20,157,155,140, 48, 80,174,138,130, 10,216, 24, 77,107,171,166,233, 83,147,190, 52,105,210,183, 62,250, - 5,253,137,254, 68, 95,251, 5,237, 87,244, 23,154,104,236,139, 87, 82,111, 48, 32, 50, 48,204,192, 92, 78,247,218, 7,232, 75, -211, 55, 35,193,113,102,206,217,123,237,125,246, 90,107,198, 95,197, 80,193,152,128, 26, 45,110, 40,217,134,115,241,144, 88,122, - 31, 91, 11,105, 90,116,158,239,210,114,165, 7, 10, 17,125, 66,144, 20,218, 68,136,112, 16,249, 76, 33,231,188,204, 14, 59,180, - 57, 79,154,199,244, 3, 79, 98, 41,118,255, 14,131,243, 59,111, 59,131, 86, 44,217,254,236,235,196, 34, 12, 19, 30,116, 3,185, -192, 52, 48,152,200,231,162,234, 94,253,160,235,118, 21, 49, 55,190, 65,185, 77,137, 97, 57, 87,253,213, 60, 26,142,134,134,206, - 10, 24,124,225,181, 66,109,132, 14,123,252,234,233,235,148,145,236,129,222, 70, 41,198, 96,254,177,144,178,110,202, 76,144, 52, - 22, 76,181,101,251,189,144,103,180,232,165,250,193,100, 37, 87,233, 14, 59, 56, 57,141,198,142,231,208, 95,160,128,110,247,219, - 82,197, 12,193, 75,210, 28,152,158,155, 79, 23,237, 65,155,222,226,179,141,221,253,250,254,233,253,233,251,131, 15,231,183,103, -132, 88,185, 16, 17,235,197, 42, 86,158,219,163,183, 66,181,161, 51, 26,108, 85,112,158,124,210, 60,114,188, 62,219,216, 26, 93, -167, 77,153,166,144, 46,150,243,101,186, 23,123, 96, 47,101, 43, 24,191, 33,236,160,197,148, 47,253,136, 98,144, 43, 12, 17,224, -116, 83, 13, 89,249,158,161,179, 66, 33, 30, 20, 79,140,212,243,147, 84, 12,140,150, 8, 61, 73,128, 38,101,104,166,158, 0, 69, - 91, 24, 60, 68, 77, 32,121, 65, 19,102,100,249, 2, 93,163, 32,138, 60,223, 99, 30, 59,224, 99,222,170, 82,141,133,186, 20,109, -169, 48,101,192, 83,152, 62,251,221,185,138,226,233, 48, 20, 45, 35,180,216, 35,246, 87, 97,238, 69,122,241,137,199, 70, 57, 82, -160, 13,225, 62,145,202, 89,185,161,215,135,107, 37, 26,220, 82,125, 2,180,100,186,211,164,105,161, 57,163,234,148,189, 8, 2, -163,189, 51, 99, 16,233, 51, 67, 58,214,237, 10, 30,220,142, 23,184, 89,171, 32, 71, 33,105, 11,241,222,192,167,249, 84,142, 82, - 50,253,158,160, 7, 93,165,154, 91,163,250, 0, 68,237,116,137, 0,148, 14,239, 61,170, 53, 3, 80,121, 34,216,111, 38, 88, 35, -158,246,121, 42,145, 66,129,175,225, 0,192,133, 49, 11,232, 23,244, 47, 45, 64, 18, 29,242,212,132,241,109,231,158, 71,241,208, -231,166,219,132,238, 2, 38,145, 1,128,234,229,205,250,114,195,118,108, 86, 71, 16, 84,194, 98,122,138,219, 8, 84,198, 61, 14, -187, 58, 14,249, 45,202,250, 44,124, 63,133, 38, 66,157,219, 99,171,114,236, 24,103,185, 49,212, 49, 49,241, 22,133,132, 36,122, -195,110, 66,151, 2,162, 82, 57, 67,155, 14, 68, 67, 23, 91,147, 29,163,132,110,122,147, 65, 33,179, 36,130, 0, 30,147, 90,168, -138,201, 94,125,103,109,185, 60,190,252,249,166,164, 21, 13,237,133, 22,127, 58,124,167, 36,211, 74,109, 69,217,218, 70, 91,102, - 20,240,225,234, 68,244,122,253,219, 75, 60, 17,110,188, 51,120, 23,154, 36,236,227, 77, 6,139, 86,198, 72, 36, 19,113,108, 24, -186,178, 94, 42,173,230,115, 78,112,220,143,154,237,199,150, 23,157, 57, 97,163,241,242,243,151,175,217,195,143,156,185,245,255, -185, 6, 93,223,156,126,251, 94,105,228,204,253, 6,198,114, 76, 93,170,107, 42,254,248,250, 71,243,220,245, 52, 54,243,101,249, - 15,236, 73, 20,151,102, 42, 36,240,203, 70, 31, 17,219,102,203,248,128,230, 8,243,252, 27,229,198,205,195,221,102,185,118,217, -106,210,151, 78, 46,142,111, 58,183,207,107,187,244, 45,122, 68, 84,247,108, 44,213,250,238,195, 0,103,236,121,136, 17,137,152, - 96, 56,165, 82,104,100, 65,135, 89, 45, 81,149,236,142, 46, 90,231,178,251,186,181,186, 77,105, 59,155,204, 94,180,174, 64, 64, -229,203, 24,134, 73,145,221,101, 50, 26,197, 20, 42,239,168,128, 24, 7, 35,200,239,207, 92,152, 88, 51, 21,152, 81, 58,207,201, -172, 44,203, 33,169,219, 50,111,140,139,185,238,169,208,132, 50,247,209,198, 98,207,152, 25,130,103,210,122,138,150, 1, 27,234, -154,233,197,180, 23,248,255,118,232,136,149, 49, 11,180,104,127,161,253, 92, 1, 68,204,162,188, 58, 83,113,157,118,121, 36,243, -226,143, 0,116, 93, 75,107,212, 80, 24,205,123,146,105, 50,201, 56,118, 30,125, 76, 75,165,138,197, 10, 22, 92, 8, 5, 65, 11, -186,171, 11, 69, 55, 46,221,184,112,225, 47,114,225,218, 63, 32,184,243, 15,136, 20, 65,173, 20,235,224,212, 62, 38,147, 52,147, -100,242,240, 59,223, 77,109, 55,194,108,135,188,238,253,238,249, 30,231,156, 42,190, 19, 44,224, 86,164, 82, 86, 28, 89,108, 39, -208, 97, 20, 93,168,118,208,162, 10,147,128,121,186, 37, 55, 12, 41,184, 76,103, 44,135, 29,108, 75, 2,170, 66, 4, 78, 85,141, - 54,225, 92, 22, 23,172, 67, 17,187,160,176, 85,131, 79, 55, 24,151, 65, 52, 10, 98, 95,147, 49,220,170, 67,128,206,192,160, 27, -165,210,220, 97, 48,107,117,250, 99,158, 87, 90, 47, 67,127, 40,132, 55,207, 77,165,164,210,212,105, 25,154, 56, 66,140, 26,133, - 89, 3, 82,203, 5,235, 95,106, 4,199,226, 36, 62,244,135,132,202,255,153,154,168,112,222,202, 77,179,158, 36,137,152,202, 97, -252, 94,232,186,185,117,115,139,194, 40,229,104,244,188, 20,170, 34, 10, 40,150, 77, 7, 50,161, 63,215,110,158, 68, 20,223,245, -203, 94,119, 99,229,118, 38,101,112, 17,226,119, 72,169, 70,191,189, 76,185,203, 40,162,181, 8, 97,113, 74,122,104,209,252, 30, - 13,119,135,223,114,204,154,103, 42,189, 52, 57,163,213,230, 57, 45,194,161, 78,205, 78,203,233, 92,115,126,112,178, 47,196, 46, - 88,230, 1, 68, 89,102, 63,129, 11, 59, 28, 15,101, 69, 59,157, 96, 10,147,194,144,109, 57, 86,205, 58,142, 14,184, 89,157, 19, - 96,101,243,109,142, 67,133, 80, 53, 18,198,148, 66, 78,218,104, 57,152,108,131,142, 60,171, 53,164,185, 50, 74,202,105, 34, 39, -116, 97,136,102, 9,113,227,228,146, 68,183,237,107, 18, 52,237, 42,143, 31,230, 52, 50, 62,149,166,194,223, 27, 42,219,152, 58, -151, 43, 77, 44, 88,224, 2, 47,103,153,138, 1,251, 92,150,171,150,145,161, 26,144,138, 84, 96, 72, 38,180,243, 10,158, 42,161, -116,141, 80,194,172,219,133, 27,131,196,213,111, 89,157,117,219,227, 9,129, 44, 5, 2, 29,232,163, 20,103, 78,236, 24,193, 42, -170,166, 98,201,130,145,104,123,210, 74, 64, 17, 70,168, 12, 87,131,107,248,120,108, 20,128,174, 56,106,189, 69, 30,103, 17,221, - 70,198,202, 61,204,168, 42,233,186, 43,221, 85, 33, 53,213,241,122,132,124, 99,150,125,190,214, 95,255,117,184,215,107, 46,208, -255,231, 91, 11,126, 56,178, 96,190, 67, 56, 37,231,141,170,210,163, 17, 74, 90,106, 47, 31, 7,199, 42, 6,192, 12, 65,209,160, -253,229,212, 27, 1, 96,221,145,112, 40,196, 9, 11,249,148,172,144,139,134,229,249,225, 81,194, 45,101, 12, 90, 64,205,194,164, -207, 7,229, 19,133, 14,188,153,174, 75, 73, 94,216,107,206, 99, 9, 49,133, 85,229,202,236,105, 18,205,152,245,205,181,205,175, -131,239, 66,220,128, 34, 47,219,196,227,112,106, 55, 58, 17, 59,127,170, 60, 76,105,215,108, 77, 85,226, 52, 84, 68,218, 15,183, - 15,213,211,236,167,143,159,191,255,240,174,175,197,183, 60,125,206, 80,174,110, 63,196, 40,203,245, 43, 82,171, 67,167,162,148, -164,248, 69,113,186,191, 27,142,254,160, 54,147,229, 66,219, 85, 45,217,224, 12,149, 34,180,175, 96, 46,232,184,116, 45,147, 9, -123,210, 98,179,211,241,186,153, 54, 72, 37,221,110,191,120,242,106,251,229,107,125,109, 85,202, 38, 18,232,165,181,255, 6,247, -221,189, 47,111,222,182,156,188,121,119, 93, 90,242, 36,219, 96, 15,223, 76, 34,232, 57, 60, 24,124,140,246,146,128,128, 46,115, - 21, 97,222, 66,200, 58,206, 83,209, 15,144, 49,221,212,227,112,140,157, 75, 49,253, 36,244,209,114,208,106,254,233,248,193,198, - 61, 74,190, 32, 20,200,100,195,197,214,130,219,239,169, 5, 68,108, 54,111,220,249,244,227, 51,136,205,121,249,232,254,179, 69, -175,179,243,115, 39,136,198,163,137, 79,239, 45, 76, 67, 90, 50, 33,108,118, 84, 10,160,168,191, 7, 71,104,131,151, 41, 65, 46, - 56, 91, 8,202, 61,114,140, 76,168, 16, 54,234,222,132, 89,108, 83,238,144, 87,122, 3,149,155, 77,233, 88,205, 9, 4, 54, 36, -250, 16,148,146, 78,167, 25,184, 75,152,134,148, 47,216,149,158,219, 16,139,149, 75,177, 20, 35,124,132,234, 64,149, 71, 63,203, - 53, 93, 7,149,198, 56, 69,101, 50, 19,149,106,174,204, 21, 23, 13, 87,133, 41,240, 69, 71, 99,249,220,227, 81, 62,147, 50,170, - 60,125,105,235, 85,112,190,172,204, 98,255, 10, 64,213,245,253, 38, 13, 70,209, 22, 90,104,161,116, 10, 12,152,147,196,172, 35, - 44, 51,209,105,226,140, 15,250,104,226,163, 62,152,204,127,207,196,127,192, 23, 19,223,124, 52,234,156,209, 23,151,109,137,211, -169,211,209, 82, 40, 45,237, 87,234, 61,247, 43,184,237,185, 11,133,246,187,247,220, 31,231,156, 60,190,179,225,228, 98,155, 51, -183, 74,165, 7,144,160,114,103, 6, 23,151, 83,213, 82,165, 92,170,114, 29, 13,252, 78, 25,146,142, 43,160, 16,216,249, 26, 70, -100,154, 17, 74,143, 11,102,156,214, 76, 43,156, 70, 20,170,232,122, 41,219,164,162,186, 52, 8,121,209, 79, 63, 12,128,178,209, - 96, 73,169, 28,131, 12,136, 16,226, 90,199,241,121,159, 76, 71,125,170, 54,237, 14, 86,227, 97,213,134, 59,160, 3, 70, 79, 14, -113,132, 11, 8,198,238,232,157, 65,211, 7, 93, 37, 74, 67, 37, 86,191, 78,206,235,130, 81,146,108, 82,124,153,120,115,153,125, -164,168,253,159,251,116,104,165, 79, 12,108,134,216,224,107, 28, 79, 40,190,255, 30,158, 90,104,135,165,167,222,175,195,211,131, - 49,229,124,153, 28, 88,143,226,254,245, 7,239,246,223,234, 26,239, 26,113, 43, 17,252,172, 52,109, 45,181,235,118,211, 11, 60, -250, 34, 4, 73, 8, 51, 18,232,142,227, 92, 32,158,222, 95, 86, 22, 84, 55,187, 55,220,224,108,187,183,237,141,135, 59,247,119, -190, 15, 78,160,213,197,218, 89,116,219,183,123,119, 70,129, 31,196,163,141,238,230, 15,247,248,182,115,247,123,248,181,140,101, - 83, 1, 57, 86, 93,146,118,185, 83, 40,139, 90,202,234,197,172, 89, 51,235,181,242,165, 90,201,208, 41, 22, 20,133, 90,140,102, -153, 92, 72,164, 75, 52,132,101, 42,182,146,167,143,159, 29, 30, 30, 37, 49, 60, 39,145, 87, 4, 52,150, 85, 86,237,107, 88, 45, - 58, 33,151, 43, 77,200, 42, 97,185, 33,149,154, 21,237,165, 43,163,200,111, 84, 26, 65, 18,106,232,138,228,179, 16,137, 79, 11, - 28, 22, 51,101, 49, 74,165,136,102,201, 31, 57, 4,137,159, 0,178, 41,113, 26,193, 34, 28,155, 40, 34, 84, 62,157, 78,232, 37, -180, 13, 91, 10,180,214,209,163, 8,121, 49, 33,119,178,131,193, 13, 47, 26,208,127, 90,229,154,228, 36,207,201, 65,179,220,243, - 8,156, 34, 41,184,152, 73,229, 41, 13, 34, 15, 8, 91,163,201, 40,134, 49, 34,246, 0,131,208, 47,194,173, 55,254,246,231, 72, -210,251, 77,195,116, 71,131,181,182, 99,148, 76,170, 71, 69,154,107,132, 73, 50, 97, 34,166,216, 11,226,217,175,148, 12, 76,249, -243,224, 4,157,138, 75, 80,132,174, 83, 24,176, 43,168, 93, 88,199,134,234,160,168,160,204,221,146,120,155,104,198,219, 33,154, - 92, 6, 67,175, 55, 97,161,177, 76,135, 87,101, 41,138, 41,111,165,171,141, 85, 89, 92,250,227,161,101, 84,153, 53,163,174, 54, -186, 3, 31, 11, 66,203,118,187, 97, 47, 19, 56,224,153,182,144, 6, 41,224,121,209,103, 65,159, 11, 13,208, 51,247,228,222,214, - 93,231,230,246,203,215,175,188, 73,218,176,235,235, 79, 30,226, 39,234,247,149,138,133,181, 25,128,119,161, 12,254, 76,142, 15, -232, 6, 42,205,213,140, 50,107, 50,101, 87,208, 76,227,204, 91,212, 88,234, 99,150,130,217,108,217, 58,157,122, 58, 16,150, 73, - 33,190,209,109,245, 53,211,143,162,227,179,191,250,116,118, 57, 46, 20,166,116,210, 20, 80, 85,117,109, 65,155,201,255,194,177, -255,250,205,222,139,231,173,150,222,126,116, 75,217,104, 43, 37, 99,110,198,156, 18,100, 80, 62, 29,124,120, 63, 26,204, 66,172, - 34,164,169,211,219,234, 44,119,161,134, 10, 86, 55, 87,128, 10, 61,172, 64,240,161,166, 7,231, 49,119,157, 21,208,209, 73,217, - 61,220,115, 86,214,126,184,191, 64, 12,196,100,197,216, 94,191,245,241,235,174,231,187,244,106,249,147,241, 70,183, 79,117, 54, - 21,208,159,143,190,196,169,112,218,107,220, 0, 44, 82,173,108,155,182,211,113,220,192, 29,134,163, 37,163, 70, 96,208, 13, 60, -171, 12,205,140,205,171,215,185,100, 20,240,246, 82, 21,103,165, 71, 53, 52,211, 51, 11,232, 43,168,105,169,160, 17, 78,197,124, - 37,239, 18, 35, 10,136, 89,204,179, 87, 30,242,171,153,105, 84,232,205, 19,121,168,252,223, 96, 89,116, 78, 84,166, 55,134, 32, -139,240,176,156,135, 20,244,130,197,224,131, 39,114, 61, 82, 74,210,131, 41,153,137,115,172,212, 5,188,157,219,214, 94, 80, 41, -187,160,252,174,230, 42, 77,153,188,162, 90,182, 9,247,252, 19,128,170,107, 91,106, 26,138,162, 39,151, 38,105,146,150, 6, 40, - 45,133,222,184, 15,131,162,142, 51,242,232,163,175,254,143,126,142, 15,126,132,175,206,160, 3,204, 0, 62,136, 92, 68, 6, 42, -104,105,154,166,105,154, 75,227,222,251, 36, 3,242, 88,232, 76, 90,206,217,151,181,215, 94, 43,157,175,170,170, 65,178, 77, 9, - 49,181,101, 46,162, 3, 85,249, 4,189,231,101,126,202, 75,186, 5,141, 45,221, 91, 54, 83,156,221,168,109,117, 7,127,122, 72, -105, 16,147,204,170, 13,154,110, 66, 60, 82, 78,157, 31, 6, 16,205, 33,196, 19, 43,130, 28,115,104, 45,118, 66,155,238, 11,179, -245,158,123, 15,223, 41, 68, 25, 20,221,142,124,200, 63,112, 7,188,145, 75, 53,154, 64, 54,202, 49,129, 15, 16,184,101, 26,104, -224,116, 75, 65, 49,250, 8, 55,215, 89, 76,227,236,113, 74, 85,163, 85, 38, 83, 43,172,215, 54,161, 63,128,184, 44,144,116,233, -192,183, 33,120,197,156,152, 65,231, 5,158,182,168, 79,241,189, 42,153,200, 29,104, 19, 52,129, 64, 89,222,217,124,133,164,142, - 40, 32,199,202, 92,132,106, 39, 34,183,227, 34, 56,100, 98,230,139, 56, 52,131,120,141, 60, 63, 92, 61,129,124, 14,117,248,180, - 57,115,217,253,217,152, 89,182,189, 46, 28,216, 28, 77, 87, 40, 76, 8,188,222,212, 84,220,222,132,166,210,241, 7, 55,247,157, - 81,228, 75,146, 4, 41,164, 62,215,116, 61,167, 98,213,170,214, 2, 4, 23,232, 12, 66, 33, 90,156, 89,104,204, 46, 13,195,193, - 32,188, 22, 69,197,113,131, 49, 41,243, 6,120, 61,210,233, 53, 5, 52, 84,152,180, 76, 93, 35,109, 50, 77, 19, 13, 36,171,137, -130, 34, 20, 13, 73, 87,224, 22, 35,210, 26, 96,175, 17, 31,238,237, 17, 67, 60,135, 68, 41, 44,230, 16, 97,132, 32, 2,231, 12, -174, 13,138,198,163,195,159,160,228,116,196,205,137,177,138,190,198, 73,130, 11, 26,116, 34, 11,198, 20,177,197, 5, 77,214, 84, - 37, 47,164, 36, 1,220, 48, 39,210,135, 72, 86,236, 28,207, 97,229,169,121,204, 25,166,133,108,153, 73, 82, 41, 85,116, 85,119, - 32,255, 77, 66, 46, 86, 19,227,106,179,224,141, 28,120, 61,224,202,192, 9,231, 81, 74, 98,230, 90, 73, 37,115,194,221,112,200, - 89, 27,143, 89,201,180,160,159,165, 41, 22,129,212,162,108,228, 13, 20,171, 82,161,145,209, 71,193,240,105,243,185,161,234,148, -116,171,228,228,142, 39, 19,130,153,133, 82, 83, 97,165, 52,119,121,119, 78,224,143, 48,109, 78,243,101, 84, 14,222,135, 56,160, -120,248, 73, 72,205,168, 85, 94,129,199,134,192, 42,203,232,209, 12,229, 11,109,177,138, 60,223,103,157,114,138,185, 35, 38, 25, - 71,216,180,200,136, 51,228,208, 76, 57, 78, 29, 12,176, 99,138,182, 26, 79,182,219,207, 92,207,117, 70, 54,220, 5, 44, 2, 16, -110,194,143,107,187, 61,190, 22,230,249, 14,178,140,226,177,150, 83,161,146,230,250,184,227,208, 75,200, 49,184,100,148, 17,197, - 78, 38,253,206,205,155,119,239,219,229,149,131,227,179,205,213,122,237,245, 54,211,100,214,106, 49, 89, 65,228,125, 20,179,193, -144, 93,124,247,237,110, 34,229,244,242,226,120,216,143,224,254,146,112,160,196,253, 15,113,219, 10,106,254, 24, 81, 26, 21,250, -141, 2, 23,146, 69,122, 12, 84, 13,173,242,102,117, 78, 9,252,111, 39, 71, 95,246,191,254,254,113,166,216, 67,189, 31, 72,142, -207,238, 6,172,219,103,118, 63,186,186,178, 63,127, 57,254,240,177,115,180,187,241, 98,169,252,246, 37,107,215,224,128,100, 78, -112, 68,198,116, 29,246,233,116,247,210, 11,177,172, 96,245, 82,189,247,183,115,126,117, 98, 15,123, 70,222,132,236, 5, 21, 12, -132, 20,168,178, 57,180,204,165, 1,139,186, 53, 10,135, 88, 17,170,198,250,194, 26, 36,216, 95,119,151,203,181, 53, 56, 99,144, - 50,175,161, 81,119,123,205,106,243,188,115,209,110,172,206, 87, 26, 5, 53,127,120,113,104, 21,167,225,183, 16, 46,122,110,247, -214,190,133,127, 7,252,217,206,198,206,254,233, 1, 28,120,232, 95, 85, 69,131, 34, 6, 7, 99,140, 65, 37, 7,133,149,129, 81, - 5,151,182,225, 45, 18,147,114,138, 58, 14,112,141, 95, 87, 77,207,247,176, 73,205, 64,151,152, 10,127, 90,197,225, 42, 64, 40, - 50, 59, 14, 67,120,126,138, 66, 73, 6,146, 60, 90, 46,165,207, 3, 61,125,170,152,155,249,169, 18, 73, 36, 78, 50, 77, 96,202, -184, 18,201, 20, 7,255, 59,226, 61,112,100,146, 7, 65,130, 84,225, 56,147,218,226,203, 83,236,145, 16, 55,227,195,234,127, 2, - 48,117,101, 61, 77,132, 81,116,182, 78,167, 29,134, 78,103,170, 84, 44, 66, 93, 16,121,112, 11, 18,226,155, 47, 62, 26, 19, 19, -125, 48,254, 80,159, 93,131,146,248,162, 9, 81, 43, 46,128, 5,161,204, 66,103,159,122,207,253, 6,241, 21, 18, 38,204,124,223, -185,219,185,231, 84,250,239, 37,243, 43, 39,220,158, 43,202,170, 69,159, 11,117,108, 86, 61,165, 99, 74,111,132, 32,204,177, 58, -244,190, 34,138,153,209,136, 46,124, 82,164,103,172, 25,194,253, 58,107,190,243,124, 21, 79, 94,158,187,217,115,251, 20, 33,177, - 35,143,120,112,246,194,204,194,193,104,159,253, 84,148,214,148, 19,198, 71, 65, 28,208,237, 53,116, 3, 10,232,138, 58, 78,177, -249,237,143, 61,246,230, 17,145, 8, 13,119,104, 85,230, 17,111, 27, 97,246,197,170,192, 25,179,224, 77, 58, 25, 4,163, 20, 93, - 5,193, 80,228,156, 81, 18, 13,253,161, 15,170, 37, 22,255, 96,243,132,158,154, 82,237,204, 11, 55, 76, 76,227, 84,166, 19,100, -244, 61,177, 49, 44, 43, 5, 62, 85,188,249,107,115,207, 27,210,215,162,138, 73, 48,156,132, 15,115,183,221,187,117,105,117,232, -237,252, 9, 14, 93,211, 45,132, 74,178, 4,195, 38,161, 50, 74, 64,137,181, 53,185,212, 52, 52, 40, 40,126, 16, 10,180, 76,251, -193,218,195,193,239, 65,152,120,192, 62, 69,165,103, 81, 22, 78,135,140,170, 31,148,252,101,222,172,155,245,122, 3, 66, 25, 25, -248,191, 16, 78, 81, 48,128,162, 87,241,105,248, 94,146, 53,219, 50,100, 37, 3,255, 19,136, 83, 80,242, 4,174,164,204,222,111, -136,155,229,172,109, 73,152,215,201,208,196, 46,149,184,144, 48, 1, 40,149, 44,153, 4,227, 44,103,112, 39, 96,108, 72,186,170, -213,112,197,208, 1, 69,170,233, 90,103,254,120,251,231,157, 57,186, 72, 89,154,222,190,180,182, 51,218,166,204,133,251, 90,213, -184, 72, 40,218,169,156, 27,208,123,166, 35,222,162,212,187, 72,162,108, 12,249,176, 34,235,119, 23,109,179, 29,199, 49, 11,180, -202, 76, 29,211, 5,245, 91, 97, 14,229, 82,111, 57,140, 60,138,229,112,194,226,142,182,176, 90,102,225,150, 9, 21,115,142,233, - 6,148,221, 16,130,215,160,144, 88,176, 72, 39, 68, 69,171,224, 88,157,115,180,137,184, 57, 35,216, 80,211,141, 22, 93, 6,170, - 42,166, 26, 54, 36,233,117, 42, 19, 99, 48,103, 20, 93,215, 52, 66,112, 58, 54, 80,155,226,166, 10,132,240, 64,191,145,207,217, -221,237,131, 95,220, 76,197, 31,143, 88,130, 74,158,156,234,138,157, 40,194,115,117, 36,149, 70,173, 65, 39, 51,157,164,244,242, - 9,139,155,122,179,215,185,224, 69,135,178,208, 21,228,243, 33,164,198,121,238, 42, 9,123, 79,238, 75,169,236,100, 93, 67, 98, -161, 96,119, 75,229,235,189,239, 15,193,229,144, 74,138, 79,113, 26, 11,211, 53,181,242,153,171,244,145,193,164,204,177,244, 72, -191,245,209, 66, 4,253,136, 16,208, 64,232, 77,203, 50,210, 20,185,174,235,126, 48,186,109,117,123,207, 30,223, 93, 92,155,189, -222,145, 26,153, 52,101, 64, 80,172,102, 80, 41,138,245,209,239, 95, 39,187,223, 9,128,232, 36, 39,222, 97, 30,135, 98,213, 70, - 80, 50,161, 59, 13,116,135, 1, 49,197, 11,185, 72, 40,131,210, 27, 83,146,176,192, 54, 84,232, 22,204, 58,157,171,115,203, 87, - 22,250, 29,171, 76,194,157,237, 47,159, 63,110, 12, 54,222,109,190,121,245,115, 99,253,199,235, 23, 91,111, 95, 30,239,125,235, - 95,155, 89,122,180,214,184,127, 83,178, 28, 9, 91,174,202, 73, 39, 32,151,168, 94,220,218, 28, 61,247,215,143, 66,157,203, 79, - 47, 14, 34,244,175, 40, 35, 49, 40,184, 30, 6, 71, 4, 53, 97, 60, 62, 33, 66, 87,171,253,170,166,197,108,118, 72, 21,143, 59, -237, 14,189,223,199,105, 84, 87,245, 32, 10, 41,127,114, 44,187,109, 58,244,127,121,199,254,222,209,126, 28,141,159,222,123,210, -235,244,118, 15,160, 51,232, 88,238,157,203, 43,243,221, 5,199,116, 6,195,193,234,226,202,198,215, 15, 55, 46, 94,223, 29,237, - 82,128,111, 91,109, 42,208, 49, 61,146,145, 64, 96, 82, 87,171, 55,107,205, 32, 14, 39,172, 70,199,208, 91,176,213, 85,121,170, -173,197, 67, 38, 6, 78,241,147,178,202,231,153, 3, 13,171, 18, 64, 12,230, 19, 21,196, 87, 90, 70, 18, 85, 99,182, 73,104,224, -255, 51,227,146,254,209,220, 43,157, 1,174, 76,241,208, 92,158, 40, 39,230, 8,255,103,241,242, 41, 51,166, 82, 10, 86, 41,167, -201,203,100,190,211, 39, 40,158, 54, 90, 41,187,213,139,102, 13,161,162,109,185, 81, 50,254, 43, 0, 87, 87,211,219,182, 21, 4, -159,248, 37,138,148,104, 90,178, 28, 69,178,227,196,150,213, 26, 72,130, 32, 78,155,246, 84,244, 28, 20,232,169,127,177, 64,127, - 65,211, 99, 47, 45, 2,228,208, 91, 99, 35, 40,106,197, 78, 12,249,155,166,196, 47,145,157,217, 39, 25, 65, 1,223,100, 80, 34, - 31,223,238,236,190,157,153, 69,124, 39,163,188,202,132,107,163,187, 52,170,110,186,130,240, 74,223,243,165, 41,198,168,143,251, -111,185, 1,181, 76, 85,153, 34, 50,214,172,188,204,182,123,187, 0,161, 36,205, 48, 55, 44,164, 51, 39,215,167,215,241, 37, 48, - 47,137, 39, 85, 14,192,117, 60, 25,203,221,112, 75,144,163, 37,237,108,135, 24,217,205,242,140,178, 83,228,178, 87, 90, 49,172, - 18,158,174,215,240,241, 21,200,165,213,242, 8,110,249,212,176, 85,108,215,146,249,185, 18, 27,207, 0,102, 7, 14,193, 98,111, -117, 31, 32,128, 86, 68,181,166, 12,107, 34,100,167,150,233,104,195,159,185,152, 76,154, 34, 63, 93,178,231, 37,149,181,201, 94, -170,158,110, 67,188,188,215,238, 19,101,115,244,155,235,172, 22, 46,183,234, 42,190, 24,159, 29,101, 98,195, 38, 67, 59, 73,179, - 65, 22, 53, 86, 5,155,119,181,217, 6,214,230,240, 76, 49,171, 83,174, 39,225,117, 77, 19,175,200,187,241,223,253,246, 96,183, -255,229,199,203,147, 21, 47,160, 84,105, 61,160, 44,190,141,215,119,134,136,121,155, 69, 97,179,141,208, 54,137,206, 95,142,190, - 9, 90,193,197, 20,225,163,218, 88,223,152,213, 62,184,142,213, 9,235,165,153, 81,191, 92,196,121, 68, 4, 83,149,213, 66,217, -124,150,148,247, 2,207,114,172, 6, 13, 93,137,221,115, 36,137,178, 18, 58,127,141,193, 93, 12,127, 29, 75, 53, 42,207,170, 57, - 41,253, 78,101, 28,205,176,166, 73, 28,103, 81, 52,139, 72, 14,170, 56,249, 19,167, 83, 92,100,165,177,154, 20,169, 46, 92,238, -175, 14,166, 66, 63,193, 74,181, 91, 93, 60,183,105, 22, 3,188,183,220, 80, 36,241,212, 85,116,113, 25,159, 55,189,144,225,213, -118,189,122, 43,203,103, 40,254, 80, 23,127, 49,216, 59, 62,251,247,226,102, 18,250,107,248, 25, 90,204, 94, 31, 18,152,166,141, -252,228, 59, 13,172, 8,243, 40, 45,146,145,144,109, 14, 59, 21, 44, 32, 7,157, 77,241,231, 99, 95,202, 18,239,231, 52, 7, 34, - 45,155,245,128, 13, 49,146,170, 82,154,214,137, 22, 56,246,100,224,175, 32,226,239,220, 31,253,115,122,176, 22,172, 35,119,216, -156,202,245,113, 77,158, 92,168,106,173,217, 29,109,238, 89,134,115, 27, 71,226,127, 65,193, 34, 44, 95,191,189, 49, 37, 57,101, -186,217,217, 66, 57,207,211,126, 93,200,178,142,224, 79,214,212, 92,219, 48, 57,181,105,219,231, 55,103,115, 17,150, 98, 23,165, -217,185,161,111,129, 18,190,180,248,125, 26, 86, 83,135,200,178,212,141, 31,147,162, 81, 78, 41,227,155, 60,142,178, 40, 90, 27, - 37,184, 53, 99,179,187,245, 98,103,255,104,114,100,104, 58,149,170, 33,205, 3,208,219,164,148, 6,216,128,190,227,225,106, 8, -100,168, 27, 82,122, 27,165,162, 42,138,119,139,114, 0,136,227, 39,135,135,251,225,186,181,214, 81,205,177, 50, 10,148, 54,202, - 71, 30,247,216,159, 25,143,213,209,161, 74,102, 60,150,231, 51,205,131,222, 67,182, 10,242, 84, 58,239, 74, 15,107, 50,190,115, - 12,158, 33,222, 0,222,242,188,154, 47,162,240,148,229,179,148,103,169,176,161, 30,132,238,168,223,123,190,243,232,249,112,247, -201,195,225,211,193,246,227,193,214,179,141, 71,223, 14,183, 95,237, 15,126,124,233,125,245, 84,117,123, 10, 16,130,189,135,106, -217,127,166,157,151, 58, 30,171,223, 15,254,248, 75, 93,169,212,183, 60,154, 75, 9,149, 20,183, 70, 37,159,134, 95,210,248, 48, - 85,139,145,150, 82, 51, 12,139, 90,153,229,121, 37,100,178,121,141, 74, 80, 89,177, 96,164,183,188, 0,127,192,133,173, 32,124, -127,250,126,167, 55,196, 59, 14, 48,244,235,219,215,199,103, 31,247,247,190, 62,248,112, 0,164,127,157,196,111,222,253, 25, 77, -111,127,120,245,211, 47,191,253, 60, 26, 12, 79,206, 63,137,237,237, 28,245, 98,148, 78, 83,250, 47,210,123, 93,143,193,124,247, -248,251,211, 43,252, 67,134, 20, 62,231, 1,161,131,199, 82, 72,173,169,229,113, 76,170, 3, 21,255,159, 81, 95,234,244, 98, 77, -215,131,222,165,200, 25, 25,159,217,148,225, 99, 84,177,145,200,127,222,185,119, 85, 36, 3,133, 58,236,220,105,208,125,102,100, -186,240,110, 82,119, 33,125,169,207,107, 46, 38,112,137,180, 92,195, 77, 10,164,202, 27,253, 81, 69,127, 61,205, 94, 37,158,168, - 91, 54,162,211,127, 2,112,117, 37,187, 77, 4, 81,176,199, 61,251,120, 73,108,131,226,108, 4, 20, 41, 72, 64,196,118,224,200, - 5,129,196, 71,115,130, 3,119, 14, 44, 74, 32,193, 68,206, 98, 71,241,140, 61,227,217,168,122,109, 3, 66,242,193, 7, 59,206, -244,188,121,175, 94,191,234,170, 85,126, 87, 13,128,184,173,238,157,132,181, 49, 23,213, 61, 79,152, 51, 21,137,116,249, 76, 36, -131, 40,209, 37,123,214, 37,201, 15, 85,229,161,145,201, 83, 52, 53, 64,132,166,201, 50,205,133,177, 21,171,164,148,161,233, 0, -214, 11,156,136, 46, 72, 50, 53,175, 87,206,108, 66,143,179, 60, 27, 25,193,155,102, 55,127,212,248, 68,127,161, 16,133,191, 22, -138, 30, 77,118, 12,173,114,121,192, 85, 84, 99, 43, 74, 70,136, 90,139, 47,155, 21,165,137,139,131, 77, 64,197, 56,149,177,137, -181,210,237,163, 57,131,101,227,215,118,123,123,147,217,132, 36, 1, 75,137,138, 55,133,224, 75, 97,218, 25,146, 12, 30, 66,228, - 50, 50,229, 85,253,250,233,235,190,136,185, 55,148,109,228,188,128,118, 53, 85, 29, 1,107,250,179, 60,193,178, 20,244,113, 77, -128,121,146, 92,216, 53,210,161, 33, 51,182,131,245,100, 17,251, 66, 31, 18,231,144,234,232,226, 8, 23, 12,180, 2, 80,207,237, - 8, 10,158,144, 39,183, 63, 56, 64, 74, 26,142, 79,145,229, 17, 85,168,115,103,215, 67,132,111,169,138,209, 12, 40, 47, 71, 66, - 9, 92,103,194, 35, 78,108, 19, 22, 21,105,239,233, 2,232,184, 90, 0, 85,210,118,183, 28, 32,179,121, 78, 20,104,223, 83,116, -237,224,161,144,170, 25,232, 78,212,192,211,234, 59, 86,232, 42,223, 87,141,204, 77,242,152,105,167,178,178, 50,147, 77,199, 66, - 43,215,112, 66, 16,193, 40,132,156, 22, 52,172, 84,152,160,156, 58,138,190, 18,214, 83,104,211,220,110,106,133,107, 40,207, 77, -183, 57, 69, 42,164, 53, 18,249,217,154, 99,149, 64,116,105, 60, 20,179,181,104, 13,183, 27,145,135,194,207,148,166,157,132,130, -218,181, 88, 74,217,190, 77, 23, 61,143, 36,171,185, 88,253,229,102,110,185,228,137,113,248, 92, 71, 97,187,139,228,171,234,140, - 34, 51, 66,226,108,168,151, 15, 94,205,178,120, 58,187, 14,253,136,189,147,162,143, 16,131,157,171, 92,118,194,110,156,221, 92, - 78,175, 88,147,122,219, 72,169,123,131,253,179,241,137,205,233, 8,174,185, 70, 61, 94,143,214, 63,126,126, 15,228,139,178,167, -151,222,169, 53, 25, 44,182,189, 57,216,126,243,240,149,239,186, 39,151,167, 79,239, 62, 79, 50,142,133, 68, 78,167, 54,221,140, -184,209,233,192,139,226,249, 84,172, 54,235,157,254,238, 85,124, 41,103,244,168, 63,133, 15,136,150, 53, 15, 63,122, 20,182, 68, - 42, 55, 38,159, 11, 99, 37, 97, 60,223,165,163, 79, 35,158,144,226,185,135,227,243, 99,145,214,177, 54, 58, 27, 21,165, 16, 19, - 81,169, 85, 18,208, 37,190,139,213, 6,196,161,250, 7,139,153,177, 50,224, 47,105, 71,251,174,149,214,243,243,163,111,247,219, - 29,231, 64, 30, 56,228, 98, 96,152,121,166,126,158,168,147, 99, 53,157, 34, 98, 24, 35, 69,142, 2, 18,246, 55,203, 52, 41,209, - 87, 73,195,107, 91,130,220,241,215, 28,238,202,186, 26,152,160,208,101,170, 61, 95, 53,219,168,111,203,151, 43,130, 32,174,195, -202,209,109,171,193, 45,181, 51,104,236,237,232,221,109,107,176,165, 58, 61,165, 91,130,217,245,106,103, 88,220, 77,248,202,213, -104,168,190,124, 42, 63, 44,222,157,161, 73, 42,218,228, 92,205,113, 41,121, 94, 4,126,136, 4, 20,103, 73, 59,104, 2,110,227, - 65,107,134,205, 94,171,143, 55, 27,221,173, 89, 58,163,103,167,197,125,212,200,141,112,103, 81,194, 17, 45,104,136,199,241, 24, -139, 15,176, 21,182, 58,248,255,198,215, 23,111, 95,188,229,249,137,186,140,231,201,225,254,227, 31,163,239, 89,177,104, 2,152, - 46,230,168,148,163,225,176,215,185,253,232,238,225,175,241, 16, 17,131,152,199,199, 80, 30,162, 32,196,155,181,168,203,164,111, -213, 95,127,125,193, 77, 65,195,199, 70, 16, 88, 68,187,244,191,149,178, 19, 5,132,101,232,228,204, 17,107,101,253, 47,227,101, -142,127, 94, 39,147, 39,247,158,141,111,198,106, 53,222, 20, 30,181,146, 77, 48,203,168,164, 27,147, 33,163,240, 44,204, 27,155, -251,160,255, 56,169, 46,197,121,172,122,133,244,113,215, 61,102, 39,227,247,241,143,210, 36,207,208, 53,150,230, 70,226,215,246, -183,168,176,233, 41, 56, 31,250, 45, 0, 89,215,178,219, 52, 16, 69,199,175,216, 78,226,150, 52, 37,109, 90, 74, 42,181,129, 22, -129, 42,177, 96,129, 4, 11, 88, 3, 66, 98,197,159, 32,190, 7,246, 44,144, 16, 63,192,130, 34, 64, 72, 44, 16,143,242,104, 27, -154,151, 19,199,175,113,236,112,238,181, 83,144,144,178, 72,164,214,137, 61, 51,231,158, 59,115,239, 57, 5,190,131,236,208,106, - 28,119, 0,208, 42,167, 12,100, 68,105,150,145, 56,247,198,191,137, 77,147, 55, 78, 2, 12,153, 9,154,166, 28,214,178, 51,213, - 58, 82,215,194,154,149,109, 58,178,124,127, 84,136,181,122, 43,163,186, 46, 35,162, 35, 99,133, 85, 91,147,138,233, 88,164,148, - 18,177,244,229,108,177,122, 6,243,206, 39,125,184,105,204, 2, 76,133,206, 98, 30,142,184, 63, 59,101,161, 78,117,158,165,207, -184, 97, 20,137,219,220,213, 25, 83,137,253,184,115, 13, 43, 85,249,213,255,137,159,180, 96, 46,112,211, 63, 2,128,206,158,235, - 34,162,234,242,212, 54, 45,208,240,140,170, 12, 51,245,212, 60,135,142, 97,201,165, 15, 68,117, 28,186,121,122,216, 92,218,120, -255,245,109,103,212, 5,147, 13,147, 32, 23, 33, 1, 30,153,166, 69,109,168,105, 76,144, 68, 34,183,179,189,221,171,143, 30, 62, -126,246,234, 25,160,159, 28,232,185,111, 19, 28, 52,175,179,196, 79,141,211,105,144,132,200, 99, 72,252,207,176,183, 87,218,199, -227, 99,204, 63, 76,220, 97,224, 14, 2,215, 13,250, 24, 67, 64,207,245, 75, 55,239,221,122,240,238,243,155, 85, 80,230, 20, 49, - 21, 97, 70,242,237,170,131,113, 52,137,178, 88,178,198, 29, 31, 64,197,128, 31,228, 80, 9,153, 77,213,202,101,252,153, 81, 66, -224, 81,184, 4, 80, 11, 83,164,153, 10,213, 59, 34, 47,147, 41,130, 1, 65, 96,168,211,150, 20,167,159,120,148,119,174,221, 63, -232,124, 35,116,162, 75,106,101,171,204,102,226,126, 17,124, 69, 33,149, 65,226,171, 6,181, 11,173, 45,157, 15,177, 26, 43, 53, -215,239,227,153,128,224,204, 10,135, 97, 58,215, 4,136,128, 47, 3,197,194,200,239, 79,250,105,154, 44, 57, 13,201,140,126, 99, -169, 69,165,149, 92, 61, 86, 49,171,151, 91,123,248,136, 75, 97, 65,182,155,187,185, 76,216,245,157, 27,199,195, 78,126,132,131, -111,111, 56,141, 31,189,131, 40, 10, 73, 32, 77,136,197,106, 13, 43,188, 59, 58,241, 98,111,107,109,167,235,158,144,239, 37,149, -198,159,157, 38, 9, 30,215,102, 99,243,242,230, 94,207, 61,153,178, 62,229,208,235,130,101,119,134,135, 69,206,203, 3,237, 71, -222, 81,255, 16, 1,102,189,126, 94,202, 8,228,128,133,127, 85,140,212, 86,227,194, 86,123,251,233,203, 39,135,189, 95, 24,165, -178,105, 15,125, 82,161, 2,154,147,223, 17, 50, 95, 10,117, 25,130, 31,240, 23, 40, 91, 41,145,101,199,112, 50, 96,157, 3,245, -172,179,194, 97,190, 90,210,180,220,175, 7,255, 91, 54,172, 69,167, 6, 44,139,231,106,148, 26,232,142,174, 43,124, 10,188, 94, - 91,151,108, 22,154, 36, 81, 73,165, 86,117,214, 41, 21,245,234,242,149,214,149,145, 63, 74,167,210, 52,204,187,215,238, 2,119, - 72,151,128, 56,217, 76,201, 69, 19, 8,147, 41,163,197,250, 50, 45,211,155, 70, 85,183,211,186,189, 77, 59,174,128,224, 84, 10, -215, 21,221,174,240, 2, 17, 99,248,177,182,100,166, 25,186,237,196,227,190,244,186,185,190, 43, 27, 96,208,229, 12,141,106, 25, -168,154,141,230,168,106,224,102,147, 0, 75, 87, 56, 14, 41,204, 32,239, 35, 23,130, 92,139, 80,227,215,233, 27,173,184,173, 98, -223, 51,155, 35,123,254, 38, 17,195, 35,241,241,157,248,228,237,191, 54,212,202,106, 69,183, 6,147,158,174, 24,237,181,139, 39, - 30, 89, 39,174,214,154,157,193,239, 17,213, 83, 32,139, 13,164,148,236,119,122, 46, 78,146,120, 26, 86,172,133,148,229,202,195, - 56,194,141,111, 55,219,152,162,147,200,183, 13, 27, 75, 62,150,177,231,143, 12,234,145,140,119, 54,118,158,239,191,176, 12, 11, -121,192,199,239, 31, 6,193,208, 52,192, 30,192,141,108, 47,158,248,210,239,123,189, 47,199, 95,232,216, 76,204,144, 95,130,175, -172,212,155,203,206,242, 17,137,130, 80, 63, 60,119,202, 41, 44,254, 44,162, 68,166,133, 9, 10, 89, 3,230,251,230, 8,144,160, -179,114, 94,252, 42,138,186,252, 83, 31, 46, 54,239, 83, 85, 76, 57,139,244, 7, 83,106, 47, 96,254,202,155,196,212, 27,193, 54, -120,122,174, 21, 73,135,157, 84,130,137, 25, 88,116,146,254,107,144,109, 83, 89, 96,170, 83, 87, 60, 97, 73,197,102, 77, 5,173, -100, 82,165, 64,114,170,100,240,215,208,248,255, 87,110,224, 42,148, 63, 2, 80,117, 45,189,141, 83, 97,244,198,118,236,196,143, - 56, 15, 79,136,250, 24,202, 8, 49, 29,141, 4, 2,177, 65,176, 69, 72,108,249, 35,176, 65, 98,195, 47, 67,131,152, 1,137, 21, - 12, 66, 5, 22, 21,243,162, 77,155,166,173, 19,199,174, 29,199, 54,231,124,119, 50, 12, 82, 23,145, 90,165,137,124,191,115,191, -199,249,206, 33,190,203, 75, 75,147, 57,101,233, 78,203,151, 81,139,185,169,185, 65,235, 57, 46,139,101,221, 95, 86, 77,219,176, - 17,219, 56,217, 25,219,121,172, 76, 45, 41,171,181,221,182, 72,108, 35,233, 72,168,233, 88,174,197,171,143,190, 20,111,239,222, - 67,249, 3,160, 23, 9,111, 91,102, 32,109,113,178, 47,115, 25, 77,244,220,254,167,239,125,254,231,233,145,105,188,188,207, 28, -209, 13,150, 45,171,214,150,197,196, 4, 48,232, 4,196, 32,250, 12,105,102, 93, 99,201,138,191,205,101, 19, 63, 10,199,227,112, -188, 31,209,243,193,239,134,105,145,118, 44, 7,159,182,109, 57,113,118,141,136, 58,120,227, 96,142, 59, 86, 90,192,122, 31, 26, - 23, 15,206,246,233,226,212,161,202, 11,157, 76,104,170, 39,172,147, 5,178, 84,132, 26, 62,173, 97, 68,189,201, 60,157,149,178, -150, 69,139, 35, 42,222,217,201,114,245,232,241,195,178, 41, 43,131,238,160,100,170, 50,126,172,142,205, 44,149,124, 30,145, 35, - 23,155,210,102, 85,166,243,228, 2,215,140,109, 57, 31, 29,126,242,245, 23, 95,254,248,215,207,200, 10,129,122,166,221, 94,230, -203, 31,126,123, 48, 12,199, 81, 24, 93,165,115,211, 44, 0, 23, 0,247,190,111, 86, 98,218,129, 83, 67,205,182,170, 1, 6,118, - 58, 6,146, 87,214,232,166,186, 61,234,181, 72, 97, 52, 54, 69,109, 74,232, 39, 21, 69, 28, 80,162,228,235,106,177, 44,243,124, -131,199,137,242, 29,152, 66, 79, 72,202, 30,213,199,211, 99,218,217, 40,189,136,208,202, 40,177,105,104,169,103,124,214,144,221, -237, 74,211, 48,163,254,248,112,247,254, 31,255, 28,225,183, 52,218,149,148,182, 33, 93,218,246,108,159, 51, 38, 54,145, 91, 78, -219,213,219, 5,131,110,148,109,178,192,241, 20, 25, 53,238, 89,124,194, 89,142, 44, 46, 2, 76, 81, 74,207,226,115,139,195,210, -234, 50, 57, 71, 58,143,100,237,197,252,153,232, 12,115,247, 21,223,244,134,229,160,227, 5,254, 55, 95,125,251,224,209,119,123, -209,237,140,171,200, 52,210, 76, 86,177,177,229, 16,148,180, 68,103,114, 23,103,241,244,226,133,239,134,148,212,183, 28, 1, 46, -163,239,141,122,204,188, 88,255,225,113, 32,102,145, 86, 35, 67,156, 45,207,241,175,251,110, 31,127,121,157, 92,118,109,231,228, -234,228,201,243,227,161, 63, 34, 83,208,104, 47,210, 37, 96,189,145,113, 49,141,179,131, 8,160,140, 43,109,103,184,143,107, 9, -199,140, 27,149,173, 86,224,134,210, 89, 66, 45,149, 73,135,156,147,111,129, 77, 67,251,182,227,194,195,151,181, 90,214,173,112, - 92, 0,100,233, 69, 95,105, 25, 19,224, 84,199,212,236,236, 90, 40,167, 84,211,195,209, 90, 21,171,211,235,233,222, 96,103,145, - 47, 7,221,193,147,217, 83, 0, 25,240,183,223, 29,176,230,227, 58,180, 54,172,111,104, 95,131, 50,220,164,134,195,189,176,183, -255,217,161,146, 62,166,196,117, 91,197, 9,247, 87,139, 66,229,192,120,229,239,223,245, 38,111,118,130, 81,149,173,170,117, 42, - 21, 23, 25,126, 22,251, 51, 36, 92, 18,217,219,114,253,224, 60, 33,103,202, 19,181,201,149,239, 41,183, 75,182,140,165,254,111, - 50,247,122,135,226, 85,182,190,217,190,192,207,141, 58,255, 91, 29,253,174,210,164,250,101,242,253,201,101,150, 95, 33, 22,104, - 1, 91,111,230,241, 37, 21,104,170, 58, 78, 23,195, 96,232,119,189,139,100,174,123,209, 53, 85, 82, 74, 60, 77,217,200,103,195, - 70,167,125,111, 77,238,156, 93, 79,113, 83,205, 22,179,130, 73,131,147,228, 9,130,125, 24, 68,136,220,244, 38, 43,235,245, 59, - 59,119,251,193,208,179, 93,139, 3, 24, 7,239,214, 35,129, 59, 91, 23,197,110,180,135, 55,161,204, 47, 64,105,179,246,188,225, -135,239,127,252,211,175, 15,119, 6,147,148, 91,178,133,112,117,234,173, 10, 77,109, 41,243,221,131, 15,206,226,169, 94,228,235, - 88, 46, 50,165,162, 44,180,238, 17,146, 6,139,198,170,210, 3, 85,173,173,160, 87, 45, 2,121,146,161,106, 67,108, 67, 79, 49, - 58,136,110,156,132,178, 41,180, 46,168, 54, 14, 21,218,175, 90,203, 56,234,213, 10,170, 30, 59,142,122,183,214, 84,183,247,202, - 42,119,108,215, 22,185,242,151, 34,210, 91, 35,199, 45,176,191,254, 44,244,104,241, 63,155, 39,252,226, 95, 1,152,186,150,221, -166,129, 40, 58,158,216,206,251,209, 66, 31,160,166,144,166, 8, 74,161, 84,165, 84,128,144, 16, 18, 18, 98,193,215,192,158,111, - 96,219, 37, 18,252, 6, 98,129, 0, 33,186,131,150,151,196, 43,144, 38,196,105, 18,191,234,177, 61,220, 51,227, 10, 22,149,170, - 74,141, 29,251,206,157, 59,247,156,123,206, 81,127, 70,149,108, 10, 19,209,222,234,101,112,242, 18,176,178, 0,103,197, 98,236, - 30, 72,157, 74, 17,197,162, 57,187, 52,156, 56,218, 75,158,101,237,150, 12,201,213, 96,163,158, 5, 0,201, 18,134, 57,244,100, - 35,103,242,231, 82,107,131, 94, 82,163, 84,215,240,148,128,189, 78, 4, 29, 6,116, 75, 34,138,227,111,131,111, 2, 18,193, 74, -245, 87,106, 25, 54, 68,162,118,151,162, 63, 0,173,146, 9, 21, 95,104,198,168,172,191,218, 92, 31, 7, 35,186, 86,165, 88,107, - 78, 53,251,147, 30,157,146,246, 71,189,254,164,175,142,183,244,230,228,181,179, 55,122,195, 46, 69,140,197,243,148, 14,168, 70, -147, 74,226,198,228,102,163, 6, 70, 32,157,220,105,111,207,155,246,196,159, 44,204,182,194,195, 16,251, 74,170,188, 87, 12,118, -243,226,237,217,250,204,143,193,119, 74,250,116,243, 2,172, 24, 0, 42,166,109,135, 18,189,254,128, 10,244, 84,107, 73, 51,136, - 55,176,212,178,204,233,210,148, 43,124, 63, 9,212, 40, 68,170,236,149, 57, 45, 34,202,187,181, 82,213,224,214,206,215, 55,148, -124, 63,237,127,180, 11,249, 90,185,190,214, 90,163,231,121,230,212,217, 92,129,159,107,175, 72,102,246,157, 46,231,232, 75, 22, -243,182, 51,241, 1, 41, 42,135, 74,197,125,151,154, 5, 79,193, 31, 28,138,230, 84, 77, 57, 74, 43,113,102,105,248, 34, 55,160, - 31,136,208, 26, 22, 54,112,105,153,105, 41, 79,107, 13,214,122,237,153,115, 65,228,195,135, 58,213, 99,244, 72,250,154, 4, 75, -139, 36,211,241, 87, 35, 96, 84,216, 1, 61,150, 73,115,166,181,243,249, 53, 50, 23,207, 21,236, 82, 12, 20, 8,170, 44,180, 20, -195,228,240, 68,125,126,174,113,114,132, 73,174,148,110, 2,250,174,197, 26,165,236,205,165,173,189,206,238, 70,251,234,196,167, -106, 52,206, 25, 48,107,164,189,109,101, 97,181, 51,128, 45,151, 9, 20, 4, 30,155,232,174, 67, 36, 15,117, 95,181,220, 64, 31, -132,115, 42,220, 92,207,123,254,226, 25, 93,215,131, 56, 29,122, 8, 32,101,114, 67,131,151,182,105, 25, 74, 89,151,254,151,146, - 35, 60,132, 37, 91,156, 89, 92, 93,188,208, 31,247, 48,234,141, 10,215, 70,186,194,196, 19, 45, 63,227,210,210,101, 47,244,195, -200,227,202, 28, 58, 18,130,190,197,218,233,245,253,131, 95,148,229,168,200,105, 20,107,110,224,106,218,189, 82,111, 85,170,223, -161, 79,149, 38,154,236,177,160,156, 24,198,129,169, 42, 39,250,204,233,114,157,118,116, 58,252, 81,213, 15,150, 48,167, 71,102, - 22,193, 70,147,202, 7, 28, 87,161,120,160,223,143, 87,166, 87, 22,206, 15, 92,135,206,196,245, 66,173,154,175,140,129, 94, 36, -186,105,147, 83, 75,137,194, 27, 35, 90, 6, 87, 98,124,128,254,128,117,231, 76,166,193, 55,109, 58, 33,229,213, 51,215, 21,207, -199,166,109,218, 2, 33,158, 69,145,184, 82,169,178,229, 99, 72, 0, 96, 26, 21,153,227, 48, 55,160,228,158,134,161, 81, 40, 91, -179, 77,192,130,176, 55,147,225,168, 7,104, 8,253,119, 12,201, 2,217, 64,239, 9,238,174,104,187, 91, 28,138, 96, 38, 45,123, -143,121, 99, 36,235, 98,137, 81,244,252,175,106,149,101,147,244,191,154, 61, 57, 2, 84, 5,147, 3,246,101,151,125,250,192, 18, -159,237,230,223,188,141,251,177, 79, 31, 15,141, 70,213,149, 85, 78, 26,217, 80,180, 23,249,180,213, 37, 90, 27, 26,132, 35, 8, -180,101,216, 59, 71,221,163,197, 9, 14, 92,138,174,228,222,214,221,119, 63,222,183,230,218, 94,128, 57,149,237,135, 79, 59,191, -191,190,218,123,233,139,112,228, 58,221,131,110,231,207,247,129,231,140,189, 49,135,147,132,216, 31,118,161,246,154,130,230, 65, - 33,148, 3,207,170, 66, 57,225,198,173, 59,247,183, 31, 60,121,244,120,126,122,190, 51,248, 69, 95,236,242,242,230, 79,136,199, -197, 74, 45, 24,245,202,208, 27, 10, 52, 90,235,244, 22, 34,133, 56,130,127,130, 54,157, 73,183, 63, 87,135, 39,129,208,186, 96, - 70,214,103,159,170, 28, 59, 20,161,169,203,100, 40, 98,225, 36, 10,241, 97,184, 51,134, 22,248,126, 76, 67, 8, 50,205, 68, 35, -245, 89, 74,121, 61,254,211,235, 85,163,154, 73,172,164, 82, 83, 41, 64,238,210, 13,160,244,200,187,248, 8,136,204, 20, 50,180, -233, 47,207,136,203,149, 66, 85,141, 6,131,172,249, 87, 0,166,174,101,183,105, 32,138,142, 29,231,225,184, 73,156, 54, 9, 21, - 40, 52, 17, 80,136,160,188, 4, 82, 17,170, 88,176,101, 1, 95,192, 15, 32, 62,131, 37, 31,193,146, 63, 96, 5, 59, 22,172, 64, -168, 1,245, 69, 66,161, 78,168, 29,146, 56,142,199, 79,238,153, 73, 42,150, 81,163,218,153,153,123,230, 62,207, 57,195,119, 77, -112, 82, 23,165, 32,159,148,139, 92,106, 80, 33,219, 31, 11, 97, 17, 76,112,136,107, 99,228,218,132, 0,203, 14,157,116,201, 85, -137,191,209,225, 38,255,119,107,227, 54, 20, 91, 2,126,189,117,179, 81, 65,222,131,254,225,137,243, 43, 2,169,147,159,198, 8, -121,144, 77, 43,154,232,151, 32,127, 57, 8, 22,165,134,255,154,251,171,197, 53, 32, 14,108,141, 0, 19, 68,196, 20, 91,133,232, -117, 73,165,168,166,146,102, 78, 39, 22,237, 95, 85,176,190, 89, 99,139,236,220, 92,169,105, 11, 26, 31, 89,249, 70,170, 46, 76, - 99,193,213, 23, 19,136,211,145, 50, 13,179,164,155, 51, 62, 41,229,202, 46,199,152,131,174, 21, 30, 92,123,184,111,237, 61,190, -245,248,219,113,215, 67, 71, 96, 74,190,124,217,168,238,246,191,246,237, 94,197, 88,149,114,219,117,115,221,241, 29,224, 66,243, -230,151,225,238, 32, 30, 57,170,231,169,115, 59,153, 56,161, 59,139, 60, 13, 6,153,246,157, 99, 29,137,112,168,187,145,137, 26, -121,163,179,222,177, 92,139,214,155, 54,128,222,132, 39,225, 52,240,200, 55,124,182,253, 52, 82,194,189,225,145, 23,251,149,178, -169, 23,140,238, 97,119,231,222,206,249,246,165, 94,255,251,170,153,230,114, 44, 84,253, 88, 17,221, 84,226,134,150, 50, 98, 97, -156, 4, 60, 13,230, 97, 93, 47,145,255,149,207,130, 25, 61,147,128,122,204, 75, 34,180, 88,160, 36, 72, 6, 75,239, 64, 54,155, - 76,108,242,225, 51,246,248,143, 23,204, 64,146,158, 45, 68, 81,172,193,219, 85, 86, 75,146,192, 7,213, 68,169, 4,134, 4, 23, -200,253, 21, 90,153,193,248, 36,131,177,100, 77,214,198, 49,159,188, 24, 62,194, 62,145, 67,100,187, 67,220, 67,133, 21,218,136, - 57,159,211,105,166, 61,221,190,182,189,219,251,218,172,183,134, 99, 11,227, 17,105,124,239,242,253,195,223,123,228, 44,147,113, -134,162,167,184, 81, 89,199, 73, 99,104, 43,164,243, 94,210, 43,244,160, 5,107, 69, 28,147, 53,202,168, 13,140,240,228, 80, 75, -230,107,224,161, 40,161, 96, 4, 47,127,229, 66, 39,138, 56,121, 21,175,158,191,254,126,220, 29,207,198,135, 39,135, 92, 72,232, -145, 5, 18,250, 19,132,249, 28,158,215, 86,235, 78,127,216, 3, 15, 40, 65,185,146,217,218,184,209, 27, 30,132, 9,121, 47, 20, -110,250,232,135,203, 25, 20, 66, 81, 92,184,148, 20,150,211, 35,216, 64,242,253, 41,168,162, 15, 77, 72,143,205, 64, 69, 32,100, - 76,232,182,128, 16,143,176, 3, 25,196, 8,228, 74, 95, 60,121,121, 52,232, 7, 17,146, 93, 20,254,238,116, 30,217, 19, 7, 21, -102,166,153, 43,149,159,118,111, 6, 82, 45, 73, 44,151,145, 98, 38,180,158,205,213,139, 30, 66, 1, 38,200,121,132,226,156,160, -158, 84,165,134,167,162,108,212, 90, 19,239,175, 53,250, 61, 7, 21, 4,129, 59, 22, 35,175,101,167, 73,224, 30,216,157,205, 58, -171, 27, 0,143, 57,103,163, 41,240,157,243,148, 7,140,162,195,242, 26,126, 23,208,221,227, 66, 99, 22, 52,174,170, 42,241, 61, -135, 78, 26, 13, 73,246,172,186,204,185,171, 72,203,196, 1,115, 71,204,117,208, 3, 67,103, 57,151, 95,230,100,206,202,167, 18, -229, 37,220,251, 44, 61,101,214, 62,219,237,178,129,133,158,106, 87,115,222,235, 31, 28,167, 32,238, 67,201,155, 46,244,198,229, -117,133,161,124, 65, 54, 40,238, 47,193, 78, 47, 73, 94, 41,144,242, 56, 47, 22,138,180,212, 66,129, 15,182, 76,151,113,183,255, -141,190, 64,184, 33,170, 59,211,183,239,222,252,176,126, 20, 33,155,172,110,158,223,244, 67,174,231,244, 86,163, 53,153, 79,174, - 94,216,164, 61, 93, 51,106,110,224, 6, 96, 82,226, 12,227,102,250,216,251, 11,150, 45,103, 84,210,171,159, 63,126, 58, 62,237, -209, 51,107, 43,141,163,225, 17,221, 43,173,115,237,118,173, 13,117, 61, 69,169, 26, 85,215,119, 35,201,107,178,108,121,161,151, -187,221,190,235,205,103,127,166, 3,176, 33, 9, 47,252, 76, 47, 61,155,201,161,139, 47, 17,212,169,106,166, 92, 48, 35, 49,175, - 32, 82, 46,197,139,141,141,177, 7,190, 88, 58, 34,157,230,117,182,240, 95, 83,122,144, 47, 84,237,196,104,137,100, 76,148,254, -191, 68, 95, 89, 68,100, 11,202, 84, 38, 84,251, 82, 41,139,141, 79,245, 82, 13,178, 1, 75, 10,121, 76, 41,229, 81,184, 14,196, -204,221, 63, 1,120, 58,151,222, 38,174, 40,142,207,120,222,143,140, 61,198, 15,220, 36, 78, 0,131, 40, 68, 74, 40,233, 38,176, - 4, 85,173,212, 86, 85,213, 5, 59,250, 21,186,235, 87, 97, 5,203, 74, 5,193,162, 69,162, 32, 4, 98,209,138,240, 16,160,138, -146, 56,224, 70,121,186, 78,108,103,198,177,227,121,244,127,206,117,216, 57, 94, 68,215,115,207, 61,247,252,207,156,243, 59,178, - 69, 47, 15,241, 0, 53,132,180,182,230, 12,168,146,142,206,155,107,102, 67,106,218, 28, 13,198,214, 84,163, 90,168,133,131, 14, -247,235, 71,169,232,168, 26, 97,240, 25, 2, 66,225,176, 44, 70,141,208,116,218,152, 2,111,108, 87,193, 43,117,123, 59,216,200, - 49,211,135,213,246,162, 96,166,250,217,235,247,207,196,216, 99,238,122,133,106,118,250,132,184,201, 8,242,176, 60, 2, 9, 36, -146,104, 90,225,216,210,210,168, 35,220, 49, 29, 92,233, 56, 30,204,153, 78, 29,221, 41,122, 69, 4,131,142,238,134, 81,120,110, -250,243,149,141,101,124, 3, 79,180,180,249,142,239, 79,146, 75,162,251,134,171,131,224,178, 41,135, 67,129,231, 48,132, 5,240, -241, 85,121,217, 99,176, 27, 28, 87,194, 10, 30,236,127, 90, 61,107, 27,238,171, 15, 47,225,142,109,221,222,227,120, 42,101,224, - 55,254, 73, 57, 59, 49,225,143,183,204,222,195,165,199, 8, 73,217,227,136, 81,131,137, 52, 2,243, 81,174,156,202, 77,241, 44, -201, 14, 76, 59,163,209, 27,200,193,192,200,168,167, 10,199,176,248, 97, 26,125, 51,251, 85,163,189, 6, 7,209,216,253,119,190, -118,126,225,252,194,165,159,190, 16,251,244,219,181,223,183, 26,155,191,222,191,113,188,116,208,143,210, 87,141,102,187,215, 15, -136, 63, 41,176,198,196, 18,160,202,130, 4,167,120,255,226,116,197,181, 13,248,129,193, 1,229, 4,178,174,181,210,239, 15,225, -187,105, 22, 43, 37,220, 97,117,182,154,234,225,196,106,247,131, 68, 57, 55,218,192,169,226,137,229,245,183, 34,124,240, 76, 31, - 7,227,117,227,165,152, 34,161,168, 90,193, 59,186, 27,108,199,113, 12,197,147,115,243,120,230,220,245,147, 32,216,255,126,225, -135, 59,127,221,130,181, 16, 2,151, 83,249, 89,215, 31,247,171,111, 86, 95, 40,204,191, 82,101,213, 52,236, 78,184, 51,126,100, -170,236,151, 94,212, 23, 33,251, 39, 75, 83,239,183,235, 80, 48,134,110,230,189,210, 17,215, 95,172, 63, 53, 53, 85, 36,129,152, -251, 16,215, 42,167,151, 55,222,137,160, 6,207, 31,122,156, 56, 45, 81,255,187,133, 43,191, 60,186,254,229,252,183,143,223,220, -135, 22,132, 94, 70, 76,100,168, 22, 67,110, 18,147, 91,154, 53, 69,155, 59, 54, 15,123,153, 61, 62,247,224,249, 31, 51,211, 51, - 79,254,126, 66, 51, 8,228,184,228,149,119,130, 22, 60,187,165,185, 16, 46, 30,219, 54, 68, 12,226,110,162, 0,166, 82, 48,232, - 50,202,144, 65, 60,212,104,150,112,226,149,156, 44, 33,163,211, 4,247, 68,135,185, 37,130, 33, 92,206,150,119,122,187,220,190, - 20, 49, 76, 68,177, 85, 27,151, 14,252, 21,150,221,108,175,121, 86, 14, 46, 56, 71, 9,156, 24, 49,184,202,136,176,172, 69,204, -181, 74,238,104,179,211,172, 22,170,141,102, 67, 85,148,176, 31,178,106, 39, 36, 53,214, 25, 30,236,205, 85,103,219,251, 93, 92, - 84, 91,221,173,136, 32,204, 42,214,217,234,182,176, 58,242,199, 4, 67,198,237, 34,235,154,108,106, 4,206,119, 73,195,103, 46, -158,253,186,216,252,243,194,207,151,165,162, 45,117, 2,105,179, 41, 53,219, 82,123, 47,234, 6,177, 57,102, 76,158, 97, 4,153, - 28,172,254, 19,174,175, 40, 60, 96, 73, 33, 31,158,209, 84,162,255, 51,195, 93,163,248, 93,215,216,197,243, 55,172,151, 40,231, -131, 63, 45, 71,202,251, 82, 33, 47,249, 57,250,156, 49, 15,251,155, 34, 41, 25, 72, 65, 71,250,175, 37,181,218, 84,183, 19, 69, - 98, 12, 68,122,219,188,249,182, 59, 80,169, 96, 60, 30,245, 28, 70,124, 72,136,198, 5,211,201,218, 89,252,244,245, 54,105,235, - 33, 95,144, 56,171, 8,216,161,182, 38, 11,213,181,214, 42, 12,213,177, 28, 60, 29, 28,226, 33, 77,231, 8,248, 62,137, 15, 89, - 46,202,143,151,175,222, 93,188,231,123,121,216, 82,173,114,178,190, 81,231, 20, 66,172, 27, 54,118, 18,183,117,204,112, 8,102, -126, 83,242,199,181,115,216, 35, 74, 69, 18,221, 54, 30,115, 33,220,183, 41,227,192,181,236, 2,154,132,231, 12, 1, 89,114, 43, -187,253, 14,171, 82,241,142,137,204, 84, 64,178,169,121,141,232, 26,212,145, 68,232, 8,238, 14,129, 9, 67, 43,200,212, 44,217, -203,200,135,153,249, 36,169,125,114,186,190,185,244,241,205, 41,205,215,225,153,124, 17,165,113,100,146, 10, 36, 91, 18,158, 47, -148,240, 0,155,143,158,149,194,117, 67, 51, 82, 30,254, 71,181, 27,105, 4,247,165,103,104,162, 39,162, 49, 46,106, 23, 27, 32, -216, 75, 92, 66, 44,170,144, 14,171, 75,254, 23,128,169,171,233,113,155,138,162,207,118,236, 73, 50,147,169, 67,154,143, 78, 51, - 73,153, 1, 81, 80,171, 82,129, 16,234,134, 5,236,134, 13, 98,199, 95,232,239, 67, 66, 72, 84,106, 23,172, 16, 21, 51,162, 85, -129,142,210,137,243, 49,137, 19,219,177,227,239,216,220,115,237, 65, 72,179,138, 38, 31,239,249,221,247,206,185,239,222,115, 74, -252,206,130,192, 16,196, 33, 88,138, 72,203,119, 1,228,156, 82,230,167, 56,162,226, 44, 93,185, 11,162,141, 53,173,206,151, 12, -255, 83,187, 87,160,154, 84,211,170,232, 17,151, 37, 22,239,149,245,253,230,131,193,163,153, 53,237, 53,143,232,108,128,215,101, - 26,108, 1, 27,179,165, 53,227,154,210,178,157,165,148, 52,230, 19,252,191,194, 35, 26,102, 99, 79,167,233, 81,113, 86, 71, 68, - 46,224,219, 39, 67, 52, 24,110, 80,172,169,122, 88,215,189,173,211,111, 15, 93,223,102, 81,242,124, 97, 95, 19, 18,167,184,245, -160, 12, 87, 42,135,220,110,180, 63, 61,249,204,143,130, 4, 86,244, 96,205, 57,107,177,118,110,117, 30,159,126,113,121,253, 55, -219,168,226,234,140, 34,159, 86, 17, 5, 11, 33,104,250, 49, 65, 26,194,112, 89, 72,133, 36, 50, 17,234, 12,202,245,114, 38, 11, - 63,113, 70,249,165, 17, 27,135,245,250,126, 77,227,108,175,132,128, 0,209,102,165, 84, 73, 99,108, 69,155,109, 37, 87, 17, 54, -177,148,250,187, 32,202, 19, 63,246,198,182, 49,182, 38,147,245,236,217,219, 95, 47,230,127, 93,174, 71,116,172, 94,217,198, 38, -116,166,231,198,171, 23, 23,123, 52,238,141,250,106,244,231, 59,211, 80,115,249,195,110,117,234, 58,180,186,144,156, 86,216, 86, -134, 45, 32,138, 42,114, 26,227,160, 81,239,213,106,132,239,181, 84,168,137, 80,133,100,135,169, 21,196,174, 31, 67,125,141,198, - 22, 38, 7,185,114,237,109, 10,224,207, 88,105,103,109, 33, 91,127, 71,239,123,129, 67,255,178,112,103,123,184,185,130,243, 49, - 55,106,163,211, 16,224,118, 23,219,222,154, 14, 39, 58,134,233, 17, 60, 28, 60,254,229,226,167,246, 65,175, 84, 5,128, 8, 16, -130, 3,174,214,117,189,219, 60, 98, 21, 1,120,210, 19,164,154,172,141,249,122,138,185,145,101,218,238,251,239, 13,118,136,174, -173,229, 66,157,113, 27,123, 68,136, 43, 10,244,233, 14,107, 77,122,197,246,215,180, 14, 32,225,128,242, 0, 46, 61,202,176, 63, - 78, 87,227, 77,232, 62,188,247,136,160, 43,205,106, 91,239,210, 97, 71, 76,145, 88,209,247, 79,126,184, 90,142, 52, 78,143,152, -206, 98,188,184,210, 20,184,249,152,206,202,245, 55, 79,207,158, 62, 63,127,190,163, 51, 22,125,155,210,105,239,116, 97, 79, 63, - 25, 62,248,250,171,111,206, 95,255, 65, 1, 63,104, 15,233, 71, 10,248,226,222, 42, 68,144, 42, 44,143,122,210,125,159, 98, 91, -223,111,133, 81,112,246,249,183, 10, 42, 95,163,219, 7, 45,244,196,101, 9,109,211,119,155,119, 29, 52, 61, 33,225,205,141, 42, - 89, 16,194,181,150,120, 9,124,221,165,188, 81,109, 4, 73,116,220, 58,118,139, 42, 79, 5, 82, 75,117,173, 26,224,214,216,183, - 3,155,102,251, 94,119,184,114, 77,133,137,186, 42, 85, 2,126, 92, 51,107, 62,181, 38, 26,179, 64,220,232,196, 33,173,106,232, - 28, 68, 94,171,209, 78,160,196, 80,106,224, 43,220,162, 84,211, 26,114, 22,153,155,145,153, 68,119,222,184,205, 39, 67,132,188, -181, 21, 27,159,240,123,130,247,251, 10,193,163,138, 26,175, 22,222,252, 31,214, 17,225, 26, 59,118,166,174, 48,219, 69,146,189, - 16,112,215,248,175, 34,151,187, 60, 17, 64,108,244, 20,159,137,216,110,133,101, 9,115, 9,120,190,156,136,229, 84, 44, 12, 49, - 55,196,248,157,152,205,133,227,138, 56, 42,197,199,104, 75,253, 89,251,241,220, 87,235,149,211,131,214,190,162,234,106,245,254, -209,253,181,183, 78,185,107,145,150,223,160,221,167,145,110,184,129,238,198,129, 23,224,158,102,239,187, 47,207,126,123,251, 50, -193, 77, 53,209,143,136,192,175, 5,109,247,168,236,146,206,196,199,199, 31, 93, 59, 75, 10,204,223, 47, 95, 46,157, 57, 65,123, - 38,236, 40, 18, 33, 96, 10,117, 13, 41, 11,147,176,163,119,130,208, 39, 84,190,114,204,147,222, 7, 65,228, 15, 59, 67,211, 49, -137, 25,208,148,210,119, 82,124,208,135,167,220,214,192,250, 31,196,122, 97, 35,234, 5,158, 75, 65, 17, 71,226,102,235,204, 10, -227, 51,174,132,161, 7,135,173,185,176, 67,224,166,135,226,134,144,208, 92,209,229, 7, 90, 6,255, 82,192,110,199,183,224,132, -161,224, 14,155,243,142,200,135,241,180,171, 85,181,138,108, 7,225,191, 66, 16, 58,191,241,219, 45, 43, 12,101, 38, 61,184,126, -208,160,150, 1,156,122,164,247, 77,119, 73,171, 93,211,106, 49, 26,247,164, 2,115,148,178,195, 55,217,247, 34, 83, 68, 47,253, - 43, 0, 77,215,210,218, 68, 24, 69,103,146, 73,102,166, 73,154, 52,237,180,241,217, 90, 31,104,209,138,182, 98,197,199, 82, 92, -232, 78,244, 71, 8,254, 20, 23,254, 1, 17,220, 42, 72,193, 74, 65, 16,220,169, 84, 67, 45, 72,209,182, 65,211,152, 38, 77, 39, -153,204, 43,243,136,231,222,111, 10,217, 4,194,132,153,185,223,125,158,123,206, 33,126,102, 40, 52,233,233,114,172, 66,226, 79, - 21,166,230,167, 23, 26,157,186, 36,224, 59,169, 68,111,214, 9,237,132,228, 42,225,180,161,242, 5, 49, 47, 35,103, 7,177,207, -101, 31, 87,129,129,215, 48,235, 98, 10,102, 58, 7,182,107,193, 5, 20,114,163, 48,127, 30, 42, 19,203,144,145,159,204,102,116, - 46, 72, 99,209,218, 23, 45, 26,214, 90, 35,152, 57,142,193,189,171, 15,182, 16,253,184,247, 7, 83,198,125,162, 52, 30,146, 54, - 47,114,127,255,220,209,243,219,205, 95,212, 5, 75,137,174,172,160,103, 34,222,109,102, 2, 34,109, 15,188,251, 70,103,215,246, -122,130,148,158, 84,168, 50, 90, 24, 7, 77,179,209, 52, 73, 20, 70,180, 60,202,196, 3,236,150,115,134,237,117,253,192,117, 17, -141,252,126,200, 11,210, 36,110, 17, 5, 94,236, 69,130,128,152,206,134,220,215,144,130, 51, 35,183, 88,102,227, 57, 65, 74,192, -187,197,178,136, 24,170,146, 66, 16, 45,166, 49,240, 71,161, 61, 33,114,247,170,164,107, 4, 78,200,164,241, 19, 59,114, 90,254, - 65,221,106,124,217,169, 46,175,189, 95, 94, 91,121,177,252,106,181,186, 82,221,169,186,129, 77,115,213,161, 95,239,218, 50,243, -146, 43, 25, 28, 0,158,120,193, 35, 40, 44, 94, 30, 75, 89, 41,117,249,184, 49, 99, 20,141,113, 36,115, 8,239,202,184,138,240, -136,171,135,163, 48,179, 1,109, 65,247, 41,181, 87, 35,102, 71,147, 19,152, 21, 44, 85,211, 24, 51,131,154, 70, 44, 55,139,252, - 97,218,152,237,186,102, 24,210,210, 16, 28, 58, 92,127,165,120,180,109,183, 17, 71,247,237, 22, 35, 64, 82, 99,249, 49,155,200, -220,229, 4, 24, 71, 88,251,176,160,229, 81,235,224, 1,226, 9,239,117,155, 52,123, 79,192, 78,212, 58,116, 6, 14,203,168,146, - 21,227,180,215, 90, 59, 55,230,238,184,196,229,233, 60,188,245,240,219,214, 87, 45,147,227,148,153, 6, 54,188,136,143,226, 82, - 42, 21,198, 81, 83,247, 29,107,163,182, 14,135,142,183,223,195,153,145, 83,186, 66, 37, 66,173,185, 61,136, 8,110,120,164,124, -252,201,253,167, 11,119, 23,191,127,254, 54, 64, 74, 22, 6,112,184, 87,238, 47,238,254,220,245, 3,167, 88, 16,187, 48, 38,238, -255,212,228,236,219,143,175,241, 66,166,167, 78, 35,116,225, 69, 95, 59,115,125,223,106,177,162,108, 78, 75,171,112,138,136, 52, - 49,175,248,193, 26, 97, 39, 45, 22,171, 34, 63,194,189,146,146, 62,102,249, 93,121, 40, 11,153,179, 74,169,114,241,196, 60,114, -154,158,211,211,179, 42, 27, 4,101,236,249,172,190,215,221,155, 49,102,104,249, 37,142, 74,185, 18,141,235, 89, 63,137,182,246, - 6,110,219,218,231,205,172,145, 20, 75, 11,113, 29,169,223,186,112,179,113,208, 16,112, 64, 78,105, 67,252, 17,210, 2,158, 55, -210, 70, 55,123,118, 70,219,137,102,102, 52, 80, 85,125, 60,111,248,177,183, 99,185, 75,161, 34,205, 77, 72, 29, 75,178,250,146, - 71,228, 8, 3,207,117,205,150,211,110, 56,157, 58, 9,201,202, 98,194,119,168,114, 75,151, 99, 4,164,194,254,157, 62, 44,217, - 65, 94, 62,147, 80,254, 50, 60,147,239,137,233,193, 80, 17,194,247,121,158,228,249, 52,194, 13,121, 19,121,200,236,182,105, 94, -181,248, 84,144, 59, 23,163, 98,225,229,247,119,207,215, 63, 60,171,174,190,169,109,252,104,254, 62, 63, 90, 41,169, 57, 63, 70, - 25, 26,247,136,195, 46,228, 5,147, 33,203, 65, 14, 43, 99, 71, 96, 60,184,235,127,230,158,217, 55,231, 78, 94, 66, 46, 76,211, - 84, 86,239, 66,154, 72,174,144,207, 35,158, 85,121,164,140,212,194,243,188, 71,183, 31,255,109,255, 69, 44,135, 21, 45,157, 93, -154, 42, 79,214, 90,127,136,112, 62, 12, 28,215, 62,102,156,216,220,221, 52,138, 19, 77,147, 58, 42,125,175, 15,123, 19, 92,140, - 18,139,214, 32,240, 19,253, 3,117, 18, 34, 61,163,195,113,249,204, 29,116, 40,209,116,216, 44, 30,198, 66,164,134,248,113,105, -210, 67,168,247,188,158,143,121,225,153,201,124,184,153, 38, 37,205, 12,122, 90, 52,124, 68, 66,152, 86,216,161,115, 71, 90, 81, - 24, 76, 35,190,198, 44,126,144, 22,184, 22,142, 17,236, 80,185, 25,195, 21,237,136,170, 9,160, 29,179,151,208,108,181,231,246, - 16, 28,131,200,247, 19, 4,179,128,242, 36,126, 29,199, 10,102,128,180, 73, 78, 49,224, 91,146,254, 11,192,211,181,244, 54,113, - 70,209,177, 61,227,177, 61,227,137, 51,113, 66, 18, 59, 33,180, 38, 64, 27, 96, 1, 8,209, 69,133,120,108,187,105, 89,177, 9, -191,134,127,208,127,208, 93, 85,169,221,244, 23, 84,168,106, 21, 85, 77, 91, 90,136, 16,113,130,157, 24,219,243,126,120, 30,158, -222,115, 63,131,228, 85,236,248, 49,115,239,253,238,227,220,115, 4,126,166, 36,186, 63, 2, 44,136,147, 13,156, 12,179,137, 63, -142, 65,180,141, 15,107,214, 76,242, 34, 10, 81, 87, 54,175,223,249,244,206,209,217, 43, 70,148,163, 26, 96, 33, 41, 44,155, 49, - 75, 12,200,129,121,138, 34,173,183, 54, 88,191, 41, 96, 78, 36,132,221,132,181, 50, 4,147,113, 1,240, 89,195,139, 93, 25, 52, -249,216,120,204, 88, 31,131,254, 61, 73,163, 26, 31,170,100,206,166,214, 62,157,190,173, 48,155, 94,190, 16,139, 78, 69,241, 3, - 6, 78,186,133, 73, 44,139, 82, 4,113, 22, 53,150, 86,173, 3,255, 46,232,179,138,162, 81,215,233, 7,164,120,166,208,235, 6, -253, 21,155,129,176,103,153,106, 97, 70, 43,161,147, 56, 3,174,142,234,131, 40,227,169,170,144, 45,226, 54, 44,174,109,199,220, - 94,210, 90,222,204,226, 29,196, 82, 42, 23, 88,228,159, 87,120, 14, 73,133, 30,133, 54, 28,114, 20,139,139, 76, 48,224, 23,224, - 4,228,101, 72,177,147,204,106, 86,101, 40,156,226, 6,151, 22, 51, 22,152,140,112, 52,212,192,144,109,200,149,249,188,156, 36, -146, 19, 5, 86,224, 14, 93,251,141, 55,254,227,108, 52,240, 2, 59, 73,173,217,204, 73,178, 32,161,220,132, 30,168, 67,233,149, -210,188,100,133,137, 27, 37,178,218,252,253, 36,248,119,234,244,125,255, 52,136,198, 81,220, 49,174, 13, 66,200,155,125,185,251, -184, 82, 82, 71,225, 80, 41, 55, 4,210, 9,196,145,204,227, 50, 75, 3, 64, 31, 10,244, 1,200,145, 90,250, 10, 0, 12,209,148, -215, 64,180, 52,203,206, 28,138, 53,160, 75,219, 93,191,138,192, 45,229, 77,181, 25, 1,131,161,136,210,135, 87, 48,208, 91,227, -182,105, 72,247,244,230,206,173,219,189,187, 47,251,127,105, 53, 3, 29,253,178, 76,206,147, 64, 75,179, 74, 49,136,145, 26,234, -155,243, 87,148,236,255,115,242, 39,165,243,148, 38,255,118,244, 43, 93,148, 85, 99,237,233,131,125,242,134,222,250, 46,160, 50, -177,141,128, 91,173,187,129,189,255,213,126,255,236,152,206, 99,224, 70, 42, 42, 61,168,222,234, 46,119,111,239,222, 61,159,158, -147,245, 83,128,126,241,247, 47, 86,127,162,200,178,217, 92,177, 3,251,193,253, 71, 63,124,247,189,174, 25,189,238,229, 43,155, - 61,203,157,108,183, 47, 57,177, 59,152,244,233,135,127,243,197,147,145, 61, 26,217, 67,144,149, 94,186,177,183,179,247,242,221, -127,126,226,197,204,192, 81, 85, 26,116,114,146,145,212,149, 26,172, 34,205,186, 43, 59,144, 3,193,249,132,145, 67,206,151,144, -236,136,210, 5, 63, 10, 78,198,199,150, 55, 98, 30,214, 68, 90,180,101, 1,159,165,200, 2,195, 40, 50,178,240,182,209, 38,171, -190,190,189, 71,102,252,248,198,163, 38,172, 17,117,207,179,135,207, 14,143, 15,123,107,159,116,204,141,177, 75, 87,190,240, 66, - 7,172,218, 56,117, 0, 44,185,208,186,192,209,181, 2, 82,238, 60, 99, 33,160, 98,169,177, 76, 17,106,195,188, 24,165, 62,185, -167, 12, 78,161, 40, 45, 23,242, 32,216,186,183, 37,249, 1,227, 35, 99,138,238, 32,148, 6,243, 91,194,162,193,112,148,178,160, -235, 4,136,175, 36,218,255, 11,224,141,252, 97,196, 74,201,187,250, 1,255, 14,124,100,193, 47,224,150,140, 32,143, 40,125,100, - 35, 95,104, 65, 73,156,104, 32,125, 57, 88,237, 31, 84,191, 61,252,249,235, 31,159, 31,188,127,235,132, 65, 91,169,191,143,166, - 71,246,233, 79,195, 35,163,166,247,244, 54, 57, 87,204,189, 89,209,112, 23,196,174, 78,232,177,223,101, 97, 2, 64,157,229, 79, -187,171,157,137,107, 69, 89,210,210, 12,202, 39, 38,254, 84,164,154,110,232,213, 85,232, 73, 80,248,123, 61,120,221, 80, 41, 77, -196,200,135, 2, 55, 29,198,168,254,107,205,173,181, 29,214, 83,243,175,110, 94,163,119,160, 42,191, 4,114,148, 84, 8,249,210, -183,133, 2, 33,184, 17,213,100,158,127,182,245,249,185, 51, 36,243,195,100,155,251, 10, 24, 56,169,106,202, 39,186, 16,167, 3, -138,102, 14, 89,224,156,151, 11,153,141, 35,231, 62, 51, 93,157, 50,125, 7,208, 41, 86,170,166,102,154,250,114,138,245, 64,222, -216,131,191, 51,228, 15,141, 46,232, 88,154,186, 73,102,176,210,108, 23,210, 98, 61, 91, 96, 44,121,120, 83,112,177, 43,233,170, -214,168,130,147,191,179,188, 65,111, 64,213, 94,133, 43, 54,186, 99,138,172, 24,245, 37, 58,135,218, 75,235, 64, 76, 22, 41,152, -218, 20, 64, 39, 85, 69,141,243,136,155,210,115, 49,129,253, 95, 0,166,174,165,183,141, 42,140,122,124,231,101,143, 61,227,177, - 29,187,149,157, 72,233, 67, 8, 68, 35, 36,132,196, 6, 33,177, 64,149,186,175,138, 64,252, 1,246, 72,176,231, 31,240, 71,186, -100,195,170, 45,168, 42, 72, 8,137,166,109, 2, 21, 73,112,130,243,168, 61,158,151,237,241,112,206,119,109,137, 77,148, 44,236, -220,185,247,206,247, 60,223, 57, 27,126, 2, 13,209,151, 69,175, 91,186,228, 90, 90, 15,188,210, 10, 44, 83,161, 12, 89,141,163, - 81,148, 70,179, 60, 98, 76,186, 66,136,232,192, 22,207,151,169, 36,254,172, 7,213,145,146,153, 38,110, 19,162,194, 57,156,140, - 65, 62,124, 67, 42,110, 48,112, 28,108, 33, 50,103,209,160,141, 72,179, 69, 12, 3, 87, 72,137,243,122, 56,208,164, 66,184,217, - 53,219,131,155,245,107,254,201,229,209,114,195, 89,136,199, 39, 95,246, 34,213,157, 92, 24, 92,169,255, 22,125,191,135,188,140, - 51,171,202,218,221,218,197, 3,167,121,140,163,138,178,217,205,254,173,176,222,198,145,227, 17, 91,245,246, 36,165,254,148, 83, -117, 74, 82, 36, 22,210,143,174, 12, 66, 78, 45,138,186, 54, 11, 83,134,142,111, 55, 35,201,228, 78, 64, 38,101,187,199,151, 71, -204,186,216,229, 53, 60, 95, 5, 29, 43,128, 39,177, 77,215, 85,174, 83, 69,200,226,218,100, 90,175,187,172,213,152, 2, 86, 86, -178,108, 67,190, 79,216,190, 86,107,205, 92,163, 90,209, 2,222,133, 6, 45,233, 9, 57, 46, 71,113,234, 82,201,255, 81, 50,194, - 98, 58,146, 1, 88, 50,179,168, 36, 59, 18, 45, 78,228,177,180,172,133, 65,133,111,188,193,167,113,242,250,252, 77,160, 66,219, - 96,247,208, 67, 10,105, 84,242, 50,199,234,146, 69,226, 59,173,195,241, 33,252, 2,226,148,142,215, 93,224,125, 95,201, 53,144, - 99, 47, 68, 43,252,157,225,157,209, 20,241, 93,217,109,118,113,220,184, 94, 8,183, 75,241,165, 8, 88, 62,251,232,203,195,179, -131,243,232,188, 20,194, 44, 44, 6, 78, 2, 55, 4, 59,179, 34, 68,157, 72, 21, 98,135,200, 99,182,192,126,142, 46,142,216, 66, - 20,101, 21,223, 11,194,102,123,203,239, 15,187, 59, 12,243, 17, 51, 45, 51,199,106,124,112,251,195, 36, 79,187,205,142,235,212, -242,121, 70, 16,116, 62,251,121,255,209,241,248,111, 36,242,167, 87, 39,120, 35, 8,177, 16,238,160,103,251, 79,115,145, 77, 16, -157,144, 66, 52,126,157,150,215, 61, 26,255,137, 47,220,237,221,188,255,201,131,192, 13,226,121,124, 37,132,142,142, 66, 30,163, -166, 17,161,208,179,108,226,152,222,171,127, 94,126,251,197, 55,143,127,123,132,152,174,237,133,207,143,255, 64, 40,253,246,173, -119,183,251, 59, 63, 61,127,114, 48, 58, 32,156, 70,169, 45,255, 58, 59,168,156,127, 46, 61,171,129, 23, 9,238, 39, 89,206,236, - 42,213,159, 53, 65, 30, 76, 73, 80, 35,146, 74,233,204, 81,225,241, 21, 34,253,126, 56,192,142, 94,107,245,226, 52, 25,178, 50, -195,126,154,204,142,146, 39,117, 16, 14, 9,240,152,142,211, 60,123, 53,122,137,157,204, 68,143,247, 98,122, 25,103, 49, 78,119, -146, 76,122, 65,127, 26, 79, 4,241, 93,193,110,227, 14,239,116,118,206, 72, 92,204, 73,228, 65,123, 27, 70,173, 89,107, 18,230, - 47,220,168, 41,231, 96,113, 9,178,162,200, 56,134,106,170, 56, 91,190,191, 55,168,152, 75,132,240,101,146,206,231,243, 5,217, - 71,215, 93, 40, 17, 22,221,168, 70, 85, 52,150, 19, 23,142, 23, 84,195,181,105,205,181, 77,119, 76,145,223,147,114,141,210,253, -236,234,255, 32,121,107,162, 59,249,201,226,113,165,134,207,122,149, 31,234, 47,158, 46,190,223,255,241,187, 95, 31,246,172,230, -215,239,221,251,106,239,211,207,223,250,248,238,224,142, 85, 26,191, 95, 28,252,114,246,162,168, 90,123,173, 33, 13,149,105,167, - 50,109, 46,185, 53,109,253,141,107, 55,224, 44, 11, 50, 97, 24,112,204,216, 70,130,167,233, 67, 12, 88,127,100,147,182, 34,245, -180,196,182,158, 86,197,105,184,245,134,237, 33,126, 23, 81,102, 58,214,116,153,199,121, 52,158,252,139,191,122,205,222,235,241, - 95,176, 51, 88,169, 95,247,225, 0,132, 85, 38,150,145, 55,188,153,132,111,193,167,156, 77, 78,169, 45, 32, 53,106, 13, 42,135, -165, 14,235,161, 52,222,248,212,248, 29,151, 10,182,142,243,234, 90,156, 81,102,151,164, 61,206,220,130, 98,245, 85, 85,200,185, -164, 57,135,179,130, 90,232,185, 53, 68, 54, 38,211,247, 82, 9,185,150,197,100,222, 66,146,221,246, 59,211, 52, 82,236, 49,218, -122, 34,105,131,144,100, 30, 13,195,189,221,221, 62,125,115,114,133, 48, 47, 79, 45,137, 21,197,118,240, 24, 97, 24, 97, 60,147, - 60,210, 5, 76, 25,255, 91,227, 35,215,130, 33, 27,254,247,255, 4, 32,234,106,122,154,136,162,232,124,182,157,105, 25, 75, 74, -181, 45, 37, 49, 80, 32,196, 4,163, 49, 42, 42, 9,137, 27,127,129,113,165,254, 17, 99, 92,185,244, 31,248, 31, 92,155, 16, 55, -186, 34, 16, 23,106, 92,152, 54,138,148, 22,134, 97, 58,175,211,249,232,180,158,123, 95,193, 93, 67,210, 50,243,222,187,247,157, -251,117,206,229,124,211, 20,240,132, 85, 29,168, 57,137, 6, 49, 72, 30, 51,187,236,217,185, 80,187,164,139, 31, 24,205,212,114, - 82,102, 90, 42, 46,225,176, 44,215, 90,103,193,105, 99,190,233,141,188, 52,163, 70, 2,169, 12, 43, 19, 73,175,222,188,254,180, -187,171,177, 13,164,140,114,105,166,127,174,162,147,102, 27, 73,175,193,156,176,214, 49, 17,111,210,202,177,222,252,152,187, 27, -169, 75,167, 88,152,195,243, 0, 50,145,148, 26,223,122,120,195, 32, 12,100, 88, 88,159,111, 54, 42,139,158,192,221, 48,246,132, - 71,217, 55, 77,135,115, 89, 95,220, 16, 35,193,116, 46, 58,182,156,152,209,166,114, 12, 74,231,227, 62,145, 1, 14,254, 23,124, - 16,162, 30,160,123,146,134,224,106,203,132,199,172, 56,160,161,125, 26,166, 66,145, 98,155, 76, 98, 88,169, 91, 90, 78,161,237, - 2, 52, 85,103,127,134,179,140,163, 41,157,199, 81, 26, 37, 99,169,133, 70,200,141,117, 46,166,146, 13,111, 74,110, 3, 95,180, -115,134,109, 25,150,109,206, 1,160,194, 97,228,141,130,101,218,128,130, 54, 93, 24, 84,253, 50,184, 82,105, 50,251, 19, 61,176, -154,142, 85,196,214,184, 43,177,186, 9, 98,152, 12,230,173,101, 50,237,163, 25, 83, 77,199,249,235, 6,253, 35,225, 29, 5,193, -209,192, 63,241, 7, 81, 28,157, 71,126, 50, 73,143, 7,221, 76, 73,136,144, 89, 83, 99,196, 42, 56,209,234,164, 81, 94,194,123, -217,164,126,181,112,103,245,222,215,206, 62, 23,254, 73, 13, 21,241,126,194,236, 67,119, 87,238,247,252, 30, 78, 46,224, 48,238, -218, 98,190,244,124,231,229, 65,123,223,164, 9, 74,131,185,189,114,210,119, 0, 46,225, 93,225,139,137,158,124,146,193, 8,231, - 9,206, 15, 75,182, 3,216,235, 13,253,190,127, 44, 34, 30,250,229,229,192,254,118,122,191, 40,161,169, 27,216, 38,149, 28,119, - 86, 43, 55,184,138,163, 61,190,249,228,119,191,189,185,124,187,127,126,140,179, 95,117,170, 81, 28, 94,175,181,198, 60,242, 86, - 42, 56, 0,245,113, 18,250,163, 65,171,222, 10,163,200, 23,110,217, 42,227,181,168,102,206, 34, 12,176, 76,199, 40, 13,105, 12, -114,122, 46,220, 51,225,226,195,193,207, 61,119,224,194,173,215, 43,141, 83,166,204,253,219,237, 28,246, 14,111, 44,109,226, 62, -192,147,135, 81, 24,166, 68,186, 48, 81,169, 89, 62,161, 73,184, 20,251,131, 95,182,114,121, 74,100,115,171, 51,156,114,129, 10, -254, 82, 35,147, 32,139, 70,212,243, 70,154,140, 72,100,220,204,115,157, 45,102, 14, 83,226,145,103,228, 24,211,108, 29, 86, 12, -119,182, 73,119, 33,126, 41, 78, 19,203,204,227,217,176,139, 52, 5, 29,139, 81, 60,122,180,241, 16,215,143,136, 67,234,234, 97, - 51,241, 2, 87,106,206,134,145,144,210,228,196, 83, 79,205,238,154, 83,112,184,126,150,135, 69,100, 68, 28, 68,147, 51, 91,107, -215, 20,199, 80,220,129, 26,197, 70,165,142,219, 49, 37,118,226,255, 52,104, 26, 83,208, 72,162, 29,109,102,171, 76,176,175,177, -128,170,105, 40,150,174, 88, 57,197, 50, 56, 21,200,137,120,153,126, 80, 24,191,207,132,161,217,254,164,178, 74, 81, 85,198, 5, -229, 99, 57,232,214,222,183, 63,191,221,251,176,122,165,241,110,231,197,246,245, 77, 55, 14, 69,154, 32, 56,188, 85, 93, 89, 46, - 86,191,244, 59, 63,206,218,216,172, 53,231, 42,172, 50, 33, 14, 39,202,115,225,249,225,127,251,131, 83, 73,198,201, 19,136,170, - 63, 12,152,215, 65,221, 90,127,128, 19,211, 15, 78,224, 83,113, 24,224,205, 19,174,200,202,126, 42,160, 4, 41,116, 7,192,199, -148, 33,204, 95,164,235,136,189,112,122,101, 98, 89, 82,189,192,216,177, 29,205,133, 38,224, 63,246, 90,162,218,153,147, 34,117, -151, 84,146,202,169,172,213,199, 73,133,152,211, 98, 83,217,152, 79, 21, 86, 38, 82,151,163,241,154,122,225,231,201,186,179,103, -219, 79,191,255,249, 38,167, 49,121,174,158,134, 28,225, 33, 76,102, 42,204, 3,246, 98,231, 17,194,235,170, 85, 40,205,217,165, - 48,164, 62, 93,167, 88,166, 38, 87,117,198, 54, 42,123,114, 97, 5, 34, 17,196,227,196,125,189,179,114, 41,251,238,140, 51,123, -188,104, 26,187, 21,110,115,100,108, 61,145,129,197, 69,113,212,206, 21,255, 9, 64,212,181,244, 54,113,133,209,153,241,188, 60, -246,100,236,144,196,164, 65, 14, 46, 50,132,150, 5, 42, 74,211,254, 7,150,252, 17, 86, 93,117, 85,126, 13, 91,196,130, 21, 66, - 2,117,219, 69, 82,216, 32,133, 68, 81, 98,226,120, 50, 99,143,231,229, 25,115,206,119, 29,144, 34,111, 98, 89,247,249,221,243, -189,206, 89,217,119,122,232,139, 34,165,153, 91,189,206,170,118, 71, 19,109, 1,197,212,184,210, 21,103, 5, 36, 83,172, 98,196, -197,246, 11,131,182,231,120,209,252, 26,139,107,139,176, 4, 95,185, 21,207,146, 89,150,249,135,119,239,201,157,194,246, 9, 30, -116,140, 27,158,190, 80, 29,148, 34,211,195,175,165,228, 23, 51,180, 85, 54, 89, 31,244,134,211,244, 90,180, 71,168,234, 73,137, - 40,245,196, 73, 0,148, 75, 79,225, 67,109,119,243,238,201,248, 11,217,130,216, 7, 91,171,126, 11,153,103, 61,142, 47, 99, 41, - 1,138,179,184,101,147, 77, 80,161,209, 74, 20,144, 43, 50,250,227,158,144, 6,235,225,157, 95,175,102,151,128,255,105,206,251, - 3,152,153, 20, 51,233,183,212,164, 89,180,192,124, 25, 11,214,151,107,110,215,192,105,239,224,102,178,123,136,198, 85,170, 15, -165,178, 70,136,210,201, 10,205,109,100, 11,147,213,104, 1,223,226,246,219,100, 11,113,128, 33, 93,219, 35,222,135,113,183,252, -182, 21,120,214, 90,139,134, 94, 25,119,147,230,220, 96,184, 30,183,193,178,220,166,217,246,204,166,203, 85,115, 76,162, 29, 83, -234,150,225,181, 45, 43,172,176, 94, 43,202,116, 38, 30,168,193,172, 3, 8, 88,246, 82,181,236,139,222, 88, 82,102, 73, 89,204, -230, 89,156,230, 81,150,133, 73, 18,211, 64, 84,216,120,211, 48,162, 52,218, 31,252,142,197,137,178,232, 60, 60,207,181, 2, 70, -167, 92, 46, 60,215,127,184,243,203,233,228, 11,236,108,152, 76,112,208, 3, 39,152, 48, 25, 91, 97,152, 71, 39, 71,240, 3, 56, - 68,195, 98,149,238,146,138, 80,152,156,239,182, 73,234,217,112, 50, 41,157, 84,202,142,212, 42, 99,206,144,181, 68, 42, 70,199, - 54, 19,194, 94, 22, 2,219, 34,143, 7, 59,248,116,255,233,255,167,135, 42, 44, 73, 50,187,134,153, 23,249,101, 52, 26,199, 35, -120,105, 73, 62, 31,108, 15,147,116, 6, 96,190,168, 84, 81,154,222,147,232, 31, 28, 97,156,237, 40, 9,241,187,247,122,247,186, -190,127, 60, 58,198, 73,243,155,237,205,206,102, 56, 13, 31,221,127,212,239,247,207,207, 47, 26,178,184,179, 36,249,251,249, 63, -111,222,190,102,193,101, 93,176, 80,157,105, 12, 11,179, 56,187, 58, 83, 66,151, 58, 53, 78,177, 69,182,244, 34, 47,200, 90,106, -183,218,174, 31,120,157, 36,157,118, 73,209, 94, 99,120,130, 43,165,177, 78, 55, 91,142,199,165, 96, 82,154, 76,223, 77,211,158, -165, 83,219,180,240,215,235,246,120, 74, 55,118,139, 69, 62,252,105,136, 85, 2, 4,105,176, 28, 89,131,205,218,191,255,228,240, -248,136,154, 68,123,127, 0, 12,116,154,116,106,129, 55, 47,174, 47, 56,170,186,252,237,231,199,211,249, 44,240,218,212,144,173, -181,117, 63, 0, 22,161, 66, 8, 19, 39, 94, 94,165,174,105, 19, 30,194, 63,144,210,154,157,205,189, 34,155,252,185,187,161,247, - 28,237,234, 26, 19, 50,182,135,203, 50,207,162,177,160,118,222, 46,213,233,173,204,181, 33,124,181,186, 18,115, 82,248, 29,159, -142,232,172,183, 93,114,193, 59,148,140, 18, 92,175,254,251, 61, 56, 76,231,113,213, 81,133,183,228,204,169, 95,181, 62,124,154, -127,206,199,127,253,251,178,163,187, 47, 14,158,221, 14,182,194, 60,139,231,115,204,101,171,179, 17,151, 89,191,181,213,247,186, -239, 71, 31,255,187, 58,221,187,117,119,221,242, 22, 26, 67,223, 15,118, 30, 76,179,100,146,132, 79, 6,143,199, 73,168, 16,128, -240,163, 44,215,219,235,216,187,195,147, 35, 28, 84, 9, 88, 47, 6,189,193, 87, 42,243, 1,144,249,112, 89,130,230, 26,188,189, - 94,192, 22, 98,197, 71, 2,152, 79, 59, 94,151, 7,195, 3,160, 64, 33,214, 32, 92, 83, 13,237, 77,145,234, 5,242,184, 97,197, -248,193,174,174,171,128, 17,150,136,129, 6, 67,249,175,240,119, 41,144, 64,115,239,212,210, 30,212,208, 45,156,156,134,176,234, -242,230, 73,122, 19, 95, 24, 77, 70, 64, 0,188,235,124, 46,196, 56,240,212,153,242, 9,228,110,109,223,218, 41,107, 88, 18, 27, -155, 71, 49,122,114, 22, 25, 66,101,152,227,216, 4, 94,160, 8,183, 53, 9,163, 85,213,141, 87,175, 64,165,228, 82, 49,101,178, -126,145, 74, 76, 1,116,237, 70,186, 79,213, 83,254, 16,255, 54,132, 13,236,155, 0, 60, 93,203,110, 27,101, 24,181,231,226,185, -218,227,113,210, 88, 77,220,210,139, 90, 42, 72, 55,128, 20,177, 65,162,155, 46,186, 70,130, 61,240, 16, 44,216,240, 24, 60, 66, - 95,129, 23, 96,129, 68,165,170, 18, 36, 21, 84, 69,113,236,248,146,177,231,226,185,247,156,111,198,108, 44,217, 25,219,147,223, -255,255,125,231,187,157,211,218,119, 60,149, 9,157,122,127, 5,105,119,164,154, 72,218,251,186,157,220, 33,255, 12,150,207,119, - 14,162,116, 35, 41, 99,121,167, 80, 76, 70,100, 89, 82, 27,237, 49,233,209,172, 96,214, 40,103,161, 26,136,190, 11,194,159,158, -240, 5, 50,151,126,228,221, 14, 17, 87,114,147,105, 66,234, 85, 54,148,129,101,213,228,204,249, 10, 64, 77, 41,161, 16,252, 31, - 59,243,186,245,126,104,139,158, 12,135, 83,164, 58,106, 32,161, 40,222, 44,162,101, 83,179,253,127,246, 2,247, 68, 58, 89,206, -236,228, 61,218, 76, 61,151, 82, 6,126,227,106, 47,148,169,200,255,120,124, 48,169,229,160,222,196, 65,243,102,216, 74, 81, 28, -132, 1,101,110,139,205, 42,244, 59, 44, 65,231,157, 84, 51,235, 74,215,163,184, 74,243, 58,217,149,187,180,146,108, 33,214, 71, - 53, 12,160, 48,197,160, 40,186,210, 20, 85, 0,240, 13,162,117, 34,113,211, 64,248,210,117, 96,208, 97, 60,122,226,247,169, 19, -212, 21,234, 46, 38,121,100,128, 16, 27,129,253,200,236, 74,169, 26,178,191,174,136, 89, 43,182,193,107,240,216,119, 53,215,213, -134, 3,221,181,117,215,209, 44,184, 7, 83,241, 92,205, 48, 85, 11, 95, 1,235, 2,103, 66,249,109,178,243,232,134, 74,213, 62, -216, 49,155, 3, 44,149, 10,252,158, 7,217, 54,200, 67, 0,132,191, 23,255,174, 83,233, 53, 82,107, 93,167,138,244,189,195,251, -216,247,179,237,204,232, 89, 35,107,132,237, 8,107,206, 59,237,106,247,142, 30, 46,194,153,129,224, 82,248,182,112,171, 4,239, -100, 53,194, 82,155, 48,178,192,158, 64,166,156,238,211,200, 43, 73, 94, 79,230,179,212,170,219,232,161, 75,121,174,165, 32, 82, - 88,244,128, 47,233,185,128,225,255, 45, 47,129,227,109,211,109,114,223, 34,199,173,103, 34,118, 8, 75, 77, 26, 78,171, 15,115, -207,140, 36, 63,160, 56,242,199,240,102,235,237,170, 18, 88,149,229,201,243,179, 23,239,102,239, 16,240, 94,223, 44,190,255,230, -135,215,127,189,178, 40,216, 20,205, 22,243,197,226, 26,152,163,161, 11, 62,116, 15,159,124,242,233, 31,127,254,142,191, 2, 16, -192, 82, 23, 66,150,121,236, 31,207, 54, 87, 88, 72,199,116,216, 53, 81, 87, 63,125,247,243, 63,151,231, 20, 6, 96, 61, 52, 7, -112,198,142,197,149,158,227, 1,217,124,125,250, 85,156,238, 96,118,119, 89,170, 74,193,172, 35, 65,198,100, 52,241,156, 1, 2, -240, 82,132,175,176, 43, 54, 73,112, 96, 15,167,171, 41, 34,158,233,250,234,236,209, 23,231,211, 11,133, 85, 46,198, 52, 23,211, -183, 73,186,195, 58, 46,183, 43,192,180, 53,229, 33,217, 50, 40,167,189, 31,198,225, 60,152, 11, 31,122,225,112, 76, 55,108,169, - 82,187,106,217, 41,238,248, 19,128,135, 91,222, 45,120,122, 93, 81,198,163,147,112,183, 76, 51,106,138,126,126,226, 27,119, 29, -218,247, 52,133,247,143,215,179,124, 23, 43, 45,215,101, 75, 30,217,114, 85,182, 40,190,101, 54,164, 49,208,133, 54,242,163,131, -206,157, 81,103, 96, 19,197,247,164,202,170,236,231,155,234, 61, 19, 45, 14,146,165, 16,233,191,241, 47, 94,166,175, 55,122,173, -196, 63,254,246,235,229,118,249,203,217,183,143, 15, 39,215,113,136,239,203,178,204,239,251,215,193, 42, 2,182, 46,203, 7,222, - 56, 76,118,231,219,247,239,147,248,217,237, 39, 64, 45, 81, 18,127,249,241,103,219, 36,154,223,204,129,201, 40,219, 73,138, 55, - 41,229, 10, 31, 20, 96,248,120, 56,206,138, 66, 40, 59,171,171,213,229,208,133, 9, 74, 92,203, 5, 62, 96, 12,100, 90, 8,131, -130,120, 3, 79,220,212,135,226, 60,134,189, 88,134,171, 56,143,196, 34,119,164,243,133, 89,242,211,187, 79,223, 94, 93,136,194, - 65,221, 78,101, 74,178, 90, 82,165,213,241,232,100, 60, 60,202,139,162,111, 57,194, 63,216, 9,226,224,244,254,211,213,102,221, -112,163,106, 36,173,227,124,108, 41, 44, 85, 66,158,207, 12, 44,176,145,239,248, 73, 78, 69, 64, 44,210,192, 30,226,104,176,184, -202, 51,173,249, 3,191, 97, 6,179, 77, 59,175, 75,207, 27, 50, 77,157,241,128,224,174, 60,211, 29,245,125, 32, 12,236,229, 38, -171, 32,109, 43,178,196, 34, 17, 5, 76,216,200, 71, 83, 10,187, 72,107,209,246, 2, 4,132, 15,108, 6,165,100, 24,168,101,174, -217,243,152,241,247,250, 32, 0, 81,215,178,219,182, 17, 69, 71,124,191, 68,201, 15, 49,134,242,176,156, 54, 6,156, 86,155, 32, - 64, 17, 32, 11,163,155, 22, 8, 16,160,219,126, 87,191,163,139,238,138, 46,218,117, 22,105, 80, 20,233,170, 73, 29,199, 85, 28, - 75,178, 40, 81,148, 70, 18,197,158,115, 73, 55,240,202, 0, 77, 15,201, 59,247, 53,231,158,243,191,127,175,251, 53,234, 19,205, - 77, 53,144,166,170, 2, 14,158,199,179, 5, 84, 68, 32,227,102, 93, 65, 70, 9,164, 65,230, 30, 86,114,227,176,182, 10, 58, 25, -122, 28, 18, 11,220, 8, 81,212,227, 70,202,241,106, 66,188,116, 61, 71,122,216,137,110,253,123,125, 81,177,168, 22,212,150, 99, -179,222,117, 2, 24, 14, 62,207, 97,114, 68, 22,102, 6, 69,193,180,172,114,114, 65,136,192,115,213,131,151,163,106,147, 3, 18, -194,205, 11, 91, 95, 23,250,203,187,125, 92,149,147,171, 40,246, 41,173,169,229,216,218, 89,175,180, 44,222,205,121,204, 75, 20, -109, 28,197,142,205, 3, 88, 85, 83, 93, 98, 83,141,144,165,194, 17,146, 39, 68, 40,198,150,122,190, 41,138,138,189, 19,238, 76, - 85,120, 68,197, 59,226,233,218,113,100,134,248,165,108,162, 6,115, 76,159,222,220,108,250,150,235,163,156,181, 44, 81,225,116, -237, 6,220, 52, 60,190,131,117,152, 50,193,194, 76, 95,232,204, 40,119,106, 20, 36, 28, 64, 21, 70,118,144,154,158,110, 91, 34, -193,119, 73,137, 98, 89, 53, 31, 17,163,161,165,234,157, 87,200,228, 76,131,168, 18,220,223,240,108, 65, 46,211,128,100,154, 83, - 74,230,138,204,153, 68,187, 38,175,193,218,130,208, 12, 35, 4, 0,150, 20,176, 51,105, 38,162, 16,177, 72,121,111, 72,166, 79, -136, 17, 60, 71, 62, 93,100,227,108,246, 62, 29, 76,151,233,110,208,110,251, 49,178,206, 69,177,204, 86,243,110,124, 27,235, 24, -164, 23,194,215,171, 28,199,197, 6, 56,104,119,239, 38,189,124,193, 17,158,141,212, 50,194, 99, 67, 81, 27,138,209,224, 81, 77, - 43, 14,154,148, 84, 21,154,101, 34,207,216,118,152,213,131,103,162,166, 5, 35,193, 71,132,243,197,218,180,214, 8,145,120, 24, - 17, 99, 50,201, 42,181,200, 28,219, 67,176,239,118,238, 32,101,219,109,182,241, 71,199,221, 99,252,119,234, 91,205,174, 42,194, - 50,189, 89,127,243,228,219,151,127,189,124,216, 59, 89,174, 86,233,120,130, 91,141,102, 35,230,227,101,177,223,222,199,222, 70, - 20,153, 47,103,147,252,250,247, 87, 47,226, 48,134,219, 69,185,237,187, 94,130, 52, 63,155, 92, 77, 47,159,127,245,221,249,240, -124, 55,222, 75,179, 9,156,236, 79, 47,126,108,249,173,241,116,184, 23, 39,196, 86, 26,102,132,210,139,187,154, 42, 32,177, 23, -191,249,248,247, 81,114,127,146,141, 45,182,236, 59,156,152,207, 83,248, 2, 84,165, 83, 36, 10, 20, 13, 79, 12,121, 51, 77,175, -233, 57, 46,202,240,105, 62,129, 47, 59,104,223, 58,190,253,240,195,104, 16,133, 77,178, 23, 80,199,166, 92,173,116,119,247, 96, -182,200, 34,152, 81,169,216, 70, 95,228, 21, 44,186,127,216, 63,187,250, 7,134,189, 21,221, 52,177, 13, 98,201, 16,138,200,241, -199,234, 86, 35,172, 94, 79, 63,208, 48, 44,194,249,251, 7,251,205,207, 2, 53, 76,183, 90, 47,210,161,206,166, 50,215, 44,184, -174,106, 6,255, 6, 84, 71,250, 16, 37, 63,156, 53, 23,204,251, 78,168,176, 6,195, 83,157,150, 74, 58, 42,138, 84,100,124,162, -211, 42,148,170, 85,160, 77, 21, 89,188,236, 23,127,252,234,206,159,185,238,198,209, 15,127,252,252,219,197,235,239, 31,156, 62, -191,255,248,114,145, 19,236,192, 83, 80,114, 18,248,142, 27,248,193, 12, 9, 17,158,104,167,247,235,251,215,151,249,224,100,175, -119,250,249,227, 65, 58, 66, 77,255,118,112,134, 12,224,235, 71,167,203,165, 70,210,109,144,110,196,129,103, 39,252,167,208, 40, -158,216,169, 51, 42, 36, 72,121,152,220, 27,206,174, 8, 72,223,108,119,130, 24,185,127,210, 74,240,113, 67,199,155, 47,115, 10, -234,202,161,221,154,115,203, 5, 2, 54, 69,230, 37, 12,163,118,124,115,249, 86,221, 32,196,101,248,198, 45, 27, 85,202, 39, 39, -101,196, 57, 56, 8,171,182,176, 71, 16,159,186,214, 79,251,167,231, 31,207,214,172,216, 56, 36,197, 81, 46, 42,178,154,244, 33, - 6, 7,185,159, 61,122,246,110,120,206, 49, 37,214, 67,116, 94,251,113,178,212, 11, 27,207, 64, 70, 85,191,197,185,247,109, 24, -134,129, 31,126,209, 59,233,221, 59, 66, 18, 59,154,140,109,242,117, 19,156,157,206,211, 27,234,120,130,171,152, 39, 21, 53,166, -145, 71,187, 54,197,148, 35, 47,188,153,150, 96, 80,193,189,145,179, 34, 96, 16,148, 40,121, 96, 89,183,240,203,186, 11,223,104, -252, 39, 0, 77, 87,211,219, 56, 21, 69,109,191,196,118, 29,199, 78,227, 38,109,153,182,204, 48, 29,205, 20, 10, 72, 51, 12, 18, -130, 34,132, 16, 43, 70,108, 17,140, 96,193, 18,126, 2,127,130, 37, 63,128, 13, 11,118,136,245, 72,108, 16, 31, 3, 83,164, 50, -180,106,160,153,180, 77,219, 73,210, 36,254,136,253,108,115,238,125,153, 93,148,200, 73,236,247,238,231, 59,247,156,185,190, 7, - 35, 97,230,141, 27,230, 5,179,230, 74, 57,207,112,249,112,193,113, 30,171, 81,142,181,224,133, 48, 33,238,192,187, 55,222,194, -182,235,143,122, 60,157, 72, 44, 46, 74, 39, 65, 50,119, 4, 11, 99, 82, 42, 7, 11,135,235,111,184, 77,236,117,155, 78, 95,171, -140,132,201,149,174,167,154,105, 34,150,159, 12,142, 96,118,206,125, 82, 77,249,217, 44,153,207, 87,113,101,169, 38,173,168, 32, - 98, 94, 26,124,207,214,149,109, 88, 38, 62,198,218, 99,211,101,212,246, 77, 73, 44,141,156,169, 96, 9, 39,185,181,246,106,111, -208,229, 35,204,226,206,230,235,167,131, 83, 86, 74, 99,153, 24, 26,103,201,177,238,205,218, 82,221, 33, 99,131, 79, 81,106,229, -108, 72, 85, 58,162,148, 4,139, 52,212,188,108,133, 79,210, 28,189, 98, 11,236, 31,179,170, 47,192,188, 42,186,101,226,125,252, - 60, 85,208,179, 84,163,140, 55, 85,203, 68,218,100, 40, 66,114,210, 2, 45, 73,172, 86,178,102, 94, 81,102,153,158,102,153, 99, -153,247,222,127,239,179,143, 62,217,121,227,205, 89, 90, 28, 28, 30,199, 49, 42,208, 10,211, 73,171,197,230,172,131, 65, 59, 12, -188, 21,136, 40,248, 23, 52,180, 67, 21,141, 80,117, 28, 53, 11,115,141,135, 84,141,186, 45, 92,108, 7,139, 49,213,120, 15,129, -137,200,225, 8,172,201, 88, 39,195,180,104, 30,157, 81,161,138,180,145,177,113,186,201, 28,129,162,176,244,204,208,206,211,209, - 73,116,126,112,113,128, 80,183,230,175,225, 46,131,122,112,153,140,137,182, 41, 79,171,204,189,188,228, 7,117,211,199,198, 24, - 70, 3, 24, 67,173, 90,115,109,239,254,187,159,254,121,248, 59, 12, 82, 16, 11, 51,235, 59,106,250, 76,198,184,124, 18,143, 81, -231, 50, 69,174,128, 81, 81, 7,143,230, 66,169, 65,153,164, 48,234,168,238,120, 46,201,116, 80,163, 51, 39,143,224, 44,186,193, - 70,123, 67, 74,217, 57,254, 71,176,185,194, 17,193, 77,195,239,243, 12, 55, 73, 34, 52,156, 6,150,182,211,237,196,179,233,209, - 89, 39, 74, 38,255,157,116, 94,185,113,251,124,208,231, 3,116, 18, 29,243, 60,191,144, 5, 50, 68,131, 32,161, 11, 95,126,248, -197,195,253, 95, 97, 84,171,139,207,181, 23,219,189,139, 99,164, 35,143,187,123, 40, 74, 38,225,152, 64, 95, 50, 22, 90,229,238, -230, 29,148,116,184,164,110,211, 19, 69,146,136, 84, 49,112, 3,152, 43,162,176,193,147,244,185,204,153,205,180,164,214,188,161, -175, 7, 27,184,133,132,100, 82, 52,226,221, 99,250, 26, 73, 99, 41, 22,252,209,214,149,155, 47,109,108, 63,121,218, 27, 69, 35, -196,185, 52, 75,174,175,110, 50, 29, 66,241,193,107,247, 30,117, 30, 5,245,165,254,101, 63,165,180,209, 88,176, 29,220, 32,105, - 89,240,126, 70, 40,178, 42,182,204,102,220, 87,169,172,120,237, 48,157,142,195,225, 36, 25, 75,162, 79,145,130,230, 39, 17,236, -137, 74,240,118,219,243,110,249,240,239,132,251, 39,249,179,242, 25,150,174,228,108,189,156,167,237,138,153,143,117, 56, 4,159, -185, 82, 79,102,152,126,251,205, 79, 15,127,216, 77,126,220,155, 62,216, 15,112,201,173,235,196, 5,159,243,208,123,206, 45, 10, -179, 66, 26, 79,163, 88,251, 46,125,240, 75,249,199,229,209, 74,163,113,112,118,248,213,207,223,175, 46, 44,127,253,246,231,151, - 50,137,114,233,219, 86,191,119, 81,141,244,108,162,153,169, 24,140, 46,146, 50, 11,252,197,165, 90, 3, 85,228,111,195,253,163, - 40,250,248,197,157, 39,195, 19, 58, 59,181,136,144,252,223,179, 46,226, 43,171, 78, 80,195,139,180, 53, 52, 37, 15, 42, 34, 30, -242, 84, 88, 29,215,114,175,181,175, 33,220,134, 89, 24,198, 33, 76,155,116, 87, 10,141,105,166,204, 22,124,253,116, 88,232,115, -224,160, 87,243,223,217,222,249,187,251, 24,143,130, 41,251,241,247,171,140, 43, 39,156,234,178,215, 74,137,113, 79, 42,102, 24, - 60,240, 48,158,224,245, 50, 81, 6,197,240,111, 73, 26,239, 29,253,133, 61, 41,120, 74,141,132,193, 40,102, 35, 77, 20, 52, 93, -143,140,173,148,157,211, 67, 69,187, 59, 39,146,211, 5,146, 90,162, 65,181, 93,199,116,214, 91,207, 15,194,167,200, 72,182,214, -111, 34, 73, 95,105,172, 52,151, 91, 47, 95,221,222,221,223, 21, 74,213, 78,157,174,170,182, 38,219,164,111, 53, 80,154,148, 74, - 34,173, 44, 16, 84, 38,201, 20,123,172,224, 27, 80, 16, 32, 20,163, 72,164,154,110,107,146,142,169, 87,145, 23,198, 28,193, 74, -188,170, 77,167,137,120,243,191, 0, 68, 93, 75,111, 27,101, 20,245,120,198,158,151,103,198,241, 43, 78,129, 58, 86, 92, 33, 64, -180, 68,188, 68, 37, 88, 80, 40, 98,197,166,101,197, 14,169, 66, 2,169,155,138, 95,192,154,159,193,142, 13,107, 22, 84, 44, 10, - 2, 33,136, 16, 2,210, 68,169, 99, 50,142, 31,241,216,227,121,207,216,156,123,199,106,178,139,100,203,154,249,238,119,239, 57, -223,119,239, 57, 27,252, 46, 82, 31,247,165,235, 19, 34, 18, 4, 4,128, 37, 78,163, 75, 27, 64,118,242, 75,201,137,120,202, 42, - 99,165,254,244,120,226,130, 63,146,227, 54,181,100, 82,240, 21, 11,185, 41,156, 80,228,163, 34, 82,101,194, 50,128,122, 3, 35, - 99,159,211,148, 83,224,146,170, 3,171, 72,226,153, 85,154,154, 17,144, 11,232,200,133, 66,110,117,217,114,202, 38, 15,134,106, -241, 5,101,150,207,238,242, 76, 51,181, 0, 99,109,198,124,235,141,231, 85, 21,157, 66, 84,216, 44, 30,254,176, 96,248,149, 69, -232,130, 13,208,253, 37,121, 78, 75,231,243, 17,248, 26,157,111,139, 98,174,249,144,107,196,251,177,231,250, 78,198, 32, 61,203, -205,183,240,128,212,204, 72, 3, 1,192,152,217, 58, 33, 40,205,197, 81,213,164,170, 85, 2,129,193, 2,151,203, 66, 69, 19,149, - 18,235,172,242,156,119,153, 14, 36,214,248, 15,164, 45, 78,185, 15,139,140,176,217, 88,183, 40,233,114, 25, 80,218, 80,149, 74, -133,228, 88,239,127,246,233, 59,111,189,250,232,231, 31,183, 76,249,147,187, 31, 55, 76,253,232,248, 8, 8, 12, 65,161,240,229, -237, 6,100, 49, 29, 43,229,115, 17, 84, 56,114,161, 32, 30, 39,229,203,115, 58, 61, 65,246,151,153, 55, 72,200, 5, 4, 87,240, - 89, 93,149, 44, 67, 50,117,145,124,156,196, 34,115, 18,230,231,148,160, 89, 51,176,132, 82, 46,211,177,142, 76,101, 10,239, 73, - 4,145,193,130,169,200, 72, 82, 81, 19, 11, 58, 82,157, 7, 68, 63,152, 12,240, 2,119,235,221, 78,109, 87, 83,116,228,154,199, -246,191,246,220,126,239,250,237, 69, 48,163, 54, 50, 81,156, 46, 39, 23,174,131,200,243, 67, 98,108,216, 54, 65, 20, 4,137,119, -181,214, 33, 85, 53, 50,119, 84, 42,170, 25, 69,161, 76, 1, 19,119, 91,123, 4,117,185,239, 30,197,169,109, 93,145,117,217,247, -188,118,237,153,185,239,196, 89,224, 6,206,104, 62, 68,150,143,211, 16,101, 8,155,202, 80, 13, 63,166,249,192,102,165,201, 61, -154, 34,133, 34,221, 71,211,245, 38, 66, 28,216, 28,193,114,255,203, 7,206,204, 25, 15,135, 8,176,115,199,158,204,198,216, 27, - 85,189,122,109,167,135,252,251,235,225, 47, 9, 17, 91, 1,108,250,200,126, 12, 66,128,132,139, 87, 14,114,137, 58,228, 5, 75, -242,143, 42,172,251,211,211, 21, 91,209,146,119,157, 36,133,129,183, 99, 93,161,228, 88, 88,219, 23,131,155, 47,222, 60, 29,247, -121, 65,214,117,171, 69,157, 12, 89,134,215,210,107,245,226, 44,121,243,249,215,158,216, 39,220, 18,135, 28,155, 6, 73,184,165, - 85,203, 98,249,224,228, 96, 30, 44,194,216,223,239,238, 15,103,231,128,252,212,127, 25,121, 79, 70,131,134, 81, 95,250, 11, 26, -254,101,115,194,109,179,165,148,228, 32,242,168, 1, 73,181,240, 73,112, 80,214,155, 37,181,158, 32, 14,106,218,150, 38,107,187, -205,174, 27,204,121, 24, 66,108, 88,237, 36, 38,147,228,151,141, 74,237,149, 90, 97,234, 8,132,153, 88,165,104, 19,237,249,245, - 97, 46,191,192,163, 26, 79,109, 40,176,139,228, 18,138,210, 55,223,253,209,247, 19,171,101,156, 37,241,201,217,100,167, 63, 53, -159,171, 23,158,173,211,189,107,146, 50,108, 87, 8,182, 63,234, 31,125,251,219,106,214,251, 61,138, 64, 19, 27,197,242,215, 7, -223, 31, 58,131, 7, 55,238, 52,117,211,118,166, 98, 92,232,136,221, 15,239,125,113,253,171,143,110,124,126,251,133,187,239,238, -183,223,206,254, 94,252, 53,252,211, 73,150, 47, 85,187, 15,207,254,177,253,255, 26, 69,171, 46,107, 72, 5, 53,179,234,199,228, -190, 77,136, 70, 40,110, 52, 16,217,139, 7, 17, 21, 68, 97,158,136,176, 16, 40,123, 51,111, 54, 93, 76,105,212,145, 4,170,196, -124,154,149,233, 8, 89, 81,215, 64,149, 66,247,218,118,143, 84,243, 66,191,179,221,233,143, 78,187,237,189,241, 98,148, 11, 21, - 26,106, 69, 43,145, 79,139,227, 94,168,248,117,210,157, 73,115, 1, 0,190,221,165,252, 3, 20,216, 52,119, 38,203, 17, 49,112, -234,219, 46,231,105, 80,100,189, 32,210,170, 76,227, 45,114,152, 10,174,182,186, 62,137,219,208,248,210, 27,123,175,219, 51,155, -143, 87, 9,155,145,179, 71,197, 84,100,197, 15,189,117,113,237,120, 11,124,253,116, 56,184,245,254,173,135, 63,253,176,112, 93, - 93,171,208, 69, 11,213,140,220,167, 33,159,147,205,176,214,204,113, 87,168, 16, 6,203,153,160,204,148,201, 53,250,131,227,243, -195, 92, 98,108, 25, 81, 97,243, 64,136, 5, 26,141, 70,106,101, 95,160, 85, 9,216, 63, 77,169, 71, 92, 16,254, 23,128,169,171, -233,109,163,138,162, 51,227, 25,127,127, 55,198,205, 36, 49, 41,150, 34,144,144,160, 69, 72, 32, 85,145, 88, 33, 33,181, 32, 85, - 66, 2, 22, 84, 44, 88,128,132,196,130, 21, 66, 98, 83, 86, 44,186, 65,226, 71,176, 41,252, 3, 16,180, 5, 81, 8, 80,167,180, - 77, 93,130, 90,215,113,252, 17,143,237,241,204, 60,123, 56,231,190, 32,216, 38, 25,231,205,243,187, 31,231,190,123,207, 57,246, -239, 74, 42, 4,255,159, 74, 69, 56,162,194,195,127, 21, 27, 83,199, 0,105,210,212, 12,102,250, 85,109, 56,119,100, 94,106,177, -132, 17,228,146,128, 51,200,214, 41,123, 29, 8,231, 3,165,108,151, 36,226, 73, 89, 73, 37, 9,207, 74,113,101, 52, 27,196,162, -144,128,189,131,195,245,213, 12, 79,105, 25, 89,225,122, 12,165,190, 71,124, 1,131, 17,218, 97,118,152,193,101, 57, 78, 10,222, - 18,159, 10,220,196, 43, 86, 17,219,197,145, 85,138,247,189,248,166,115, 78, 86, 36,191, 57, 4, 65,245,168,197,194,113,210, 88, - 38, 0, 7,220, 13,146,113,242,110, 47,244,152,177, 20,223, 98, 77, 79,121,220,153, 84,204, 20,240, 96, 42,153, 19,245, 22,130, - 59,209,212, 14,205, 99,234,133,130, 50, 84, 62,155, 46,159,160, 25,102, 83,240,239,236, 97,112, 28,185, 89,229, 23,202, 38,118, -199,193,242,168,254,152,118, 12,199,177,121,161,154,182,138,120, 56,235,228,179, 70, 41, 23,215, 42,137, 98,222, 40, 22,146, 31, -126,240,254,231,151, 47,127,119,237,167, 27, 59,191,239,239,223,127,237,252, 43,181, 74,254,230,110, 75,111, 44, 35,245,146, 6, -157,182,109, 64, 4, 38, 23, 42, 14, 2,195,135,255, 8,204, 89, 40,116,236,172,218, 24, 73, 96, 16,135, 23, 36, 41, 22,255,132, -175, 53,182,148,178,224,196,252, 57,173,210,224, 80,139, 84,119,180, 30, 27,103,233, 18,188, 7, 78, 57, 5, 4, 88, 44, 44,147, -200,164,157, 98,150,241, 32,159,195,154,245, 45, 2, 67,128,178,226,185, 21,204, 44, 5, 20, 76,238,198,216,216,235,239, 77, 66, - 32,104,211,173,184,215,238,124,239,249, 19,150,209,163, 57,142,232,197,151,222,254,250,199, 43, 88,255,201,106, 67,234,108,172, - 10, 30,249,195, 5,201,153, 51, 75,161, 90,100,242,107,153, 56,127,227,233, 81, 17,185,117,166, 52,241, 61, 30, 33,181, 60,247, -250,185,206, 30,160,152,194, 79, 52,127, 45,142,201, 4, 86, 97, 51, 96, 35, 39, 96,131, 26, 9,230, 40,159, 22, 17, 62,231, 51, -164,167, 15, 42,185,218,246,211,219,183, 31,222,178, 69, 86,237,207, 95, 90,215,119,174,158,217,122,190, 59,236, 52,221, 45,216, -253,152, 26,141,211,238,176, 91,202,149,120,165,143,239, 23, 7, 92, 56,184, 61,146,241, 70,235, 43,143, 15, 61,226,229, 96, 25, -212,114, 53,153, 99, 44, 5, 1,114, 70,188,230, 73, 21,145,234, 11,182,180, 88, 70, 72, 56,206, 62,121,118, 48,238,123, 51, 15, -200,102,181,234,158,114,159,104,212, 27,253,225, 1,206,221,126,175,141, 88, 2, 36,129, 3,230, 80,219,210,130,121,191,185,125, - 97,231,222, 31,216, 52, 78, 2, 38,136,207,240,250,171,213, 53,236,216,179,205, 51, 65, 24, 33, 86,193,128,181,134, 39,233,231, - 98,179,239, 29, 78, 3,223, 74, 8,247,142, 10,240,223,221, 74,157,146,144, 72,167,156, 20, 54,208, 15,103,210, 38,192,116, 18, -161,183,152, 46,227, 87,107,181,141,209,116,248, 76,185, 80, 61, 93, 49,122,163, 24, 88,146,140, 35, 11,105, 33,145,180, 88,192, -169, 80, 13, 91,186, 80,115,204, 3,141,135,243,169, 86,171,123,229,215,125,192, 46,165, 34,132,163,167,214,203,141,122, 33,137, - 51,132, 44, 42, 45,211,121, 11,219,248,225,239,221, 47,191,253,249,234,221,208,180,123, 97,195,139,252, 76, 34,209,155,120,159, -221,248,102, 45,179,250,197,203,239,221,234,220, 75,206,138,111,124,114,201,253,244, 57,115,148,190,254,209,205,223, 62,190,221, -254,234, 96,195, 61,181,249,206,233, 23, 42,175,246,255,106, 41,123, 30, 43, 99,103,120, 23,135,238,197,122, 19, 43, 27, 76,143, - 76,173,235,168, 29,142,232,223, 46,164,160,164,133,180, 96,212, 54,199,154, 24, 6,240,119,110,117, 93, 72,144, 76,227,223, 78, - 16, 77,109,178,148, 62,200,121, 16,172,158,112,219, 7,247, 97,194,135,227,193,104, 58,232,141,123, 82, 3,224,137,194, 54,206, -163, 96, 60, 27, 25, 34,221,204,170, 50,245, 78,132,110,207, 48, 31, 43,212, 57,229, 78,102,236,177, 80, 66,114, 13,165, 76,153, -126, 38,214, 51, 49,134,248, 40, 50,134,114, 8, 22,190,155,141,100, 36,180,120, 48,120,168,123,106, 86, 10,188, 87,247, 2,111, - 50,159, 30, 77,198,176, 57, 96, 95, 96,148, 82,169,186,217,216,124,235,210,187,221,221,206,160,215,155, 71,225,204,159, 34, 61, -218, 90,219,122,116,216, 97,145,129,165, 78,139, 44,211,194, 52, 0, 12,129,228,184, 89,111,118, 71,143,144,108,180, 15,218,164, - 89,100,147,133, 16, 49,105,221, 95,195, 98, 2, 36,132,137,240, 4, 27,216,153,101,168,181,212,255, 17,128,170,235,249,109,155, - 12,195,254, 18,219,113, 28,219,177,157, 31,237,166, 36, 48,212, 13,117,233, 86, 74, 39,164,110,244, 0,154, 54, 52,117, 8,109, - 7,196, 14, 72,149,118,225, 47, 96,103, 46, 99, 39,196,133, 3, 92, 16,112, 67, 28, 24, 32, 14, 28,144, 2, 8, 52, 4,108, 29, - 37,210,196, 58,154,210,161, 38, 77,210,216, 78,108,199,177,189,247,125,221, 78, 67,170,170, 42,178,170,124,142,243,124,207,243, -126,239,251, 60, 9,190, 31,140,183, 62,225, 59,169,203, 5, 0,202,255, 87,228,163,199, 23, 60, 54, 44, 70, 23, 95, 94,234, 59, -187,240,219, 71,163,148, 0,214,156, 21, 49,205,131,237,147, 76,236,217,135,187,172,169,218,202,217,139,119,239,221, 1,213,117, -176,153, 96,181, 10, 52, 14, 69,112,164, 19, 53, 77,217,226,241,241,202,201,174,213, 33,108,157, 96,209, 31, 79, 47, 1,166,209, -135,129, 75,162, 11, 67,180,235,196, 58, 26, 33, 8, 67, 47, 80, 13,187, 39, 73,127, 82, 40, 4, 96,115, 8,248,114,162,182, 0, - 95, 57, 46,181,111, 42,143,168,141, 35,156,248,130,140, 25,187, 1, 25, 61, 80,124, 56, 23, 15,199,174,161,154,123,163,126,242, -194,129, 93, 27,126, 53,114,162, 82, 54,167, 16, 89, 50,113, 94, 23, 39,212,105, 20, 6, 12, 0,119,100,115,131, 97, 60,116,162, -129, 19, 58, 78, 52, 28, 69,174,139, 94, 4, 64,180, 99,156,118, 67,117, 41,138, 64,243, 99, 89, 18, 46,189,122,121,249,197,243, -141,159,238,200,146,249,230,149,213, 15, 62,252, 56,136,132, 40, 22,239,111,108,111, 63,236, 94, 93,125,203,119,195,159,111,253, -193,161, 46, 3,128,142,210, 17,141, 63,115, 88,102,161,222,128,148,134, 93,149, 44, 39, 49, 17,235,239, 44, 35,128, 84, 74,131, -116,128,165, 4, 88,214, 79,177,144,209,113, 46, 47,225,164, 29, 21, 68, 0,245,113,106, 28,241, 90,206,166,241, 96, 86, 22,114, - 50, 15,128, 14,114, 36,135,244, 29,229, 2,151,140,137, 69,200,133,147, 52,162, 56,196,233, 45,127,156, 10, 97,183, 96,177,195, -252,206,176,147, 99,146,153, 43,218,129,149,227, 85,216,188, 41,203, 2,207,177, 97,181,151,206, 92,254,161,217, 40,105,229,122, -181, 14,212, 24, 22,110,168, 37,248,136, 96,247, 29,147, 93, 40,242, 11,158, 31,250, 35,158,246,126,219,179, 46,156, 90, 25, 7, - 0,112, 30, 60,202,235,183,215,139,218, 84,215,238,228,209, 48, 46,162, 72, 94,126,218,172,216, 78,143, 10,241,209,200,119,128, - 61, 0,213,128,235, 83,228, 95, 4, 16,170,201,121, 80,243,235,173, 63, 61,223, 61, 59,127,254,229,231,150, 27,119, 27,167,235, - 75,205, 86, 51,138, 2,216,215, 71,190,109, 40,230,213,115,171,107,255,172, 47,227,116,232, 54,176, 63, 74, 93, 64, 75, 34, 12, - 6,241,236,246, 96, 7,158, 25, 32,197,150,103, 81,199, 33,166,130, 44, 28,153, 31,142, 71,189, 65, 47,136, 38,207, 76, 31, 1, -166,143,190, 49, 59, 27,237, 65,119,171,219,154,210,203,240,255,187,131, 46, 31,177,221,126,123,224,237, 37, 50,119,233,217, 37, -144, 26,165,124,145,230,110,108, 88,114,115,243,158,161,234, 56, 33, 18, 79,230,106,115,160,214,125,223,239,219,253, 11,167,206, -173, 61, 88, 51, 21, 3,176, 6, 89,152,156,159, 96,231,190, 48, 91,153, 85,164,156,237, 90, 25,148, 94,130, 42, 41, 5,173,248, -218, 11, 23,111,111,192,197, 58,112, 32,157,218,138, 78, 84,235, 15,123,255,149,180, 18,104, 26,216, 50,128,149,217, 78,135,227, -179,117, 65, 40, 62, 95,224,122, 22, 27,251,216,210,157,228, 8, 50,202,113, 72,186,182, 41, 80,252,192,179,144, 70,245,104,214, -242,102,227,190,158, 17, 22, 15,231,159, 46,104, 37, 37,107, 72,146,145, 3,170, 10,132, 93,228,188, 52,247, 99,235,183,247,190, -251,252,139, 91,127, 15, 28, 81, 19,242, 98,158,177,163,138, 90, 92,156,158,185,254,235, 87,205,254,131,107,243, 87,210,176,185, - 57,236,141, 79,222,225,102,185,239,143,254,242,238,251,215, 23,221,147,243,167,231, 38,125,255,237, 79,111,124,246,209,183,175, -191,244,202,204,177, 51,131,205,191,132, 84,248,205,191,191,183, 92,107,165,178, 48, 10,104,242,145,138, 21,112, 19, 76, 85,183, - 92, 27,222,165,174, 24, 79,149,170,112,223,224, 15,248, 92, 0, 13,108,207, 73,106,229,128, 39,158, 71,157, 57, 90,153,145, 83, - 55,186, 31,114,152,104,136,241,170, 19,127, 7,123,108,176,144, 93,198,211, 17,137, 38, 6,112,221,138,164, 84,139, 53,184,225, - 66, 42,153,120,199,220,203,162,106, 6,232, 70,133,146, 6, 54,206, 41,227, 16,136,170,140, 32,213, 10,181, 61,119, 79,226,129, - 98, 9, 56,163,176,239, 7, 64, 14, 4, 44, 1, 89,126,223,165, 5,229, 3, 74,162,138, 89,133,165,120,120,192,139,177,163, 25, - 49, 35,101,240, 71, 6, 2,197,139, 0, 32,157,221, 78, 33,206,127,125,243,203,225,112,132,163, 63, 84,240,105,247,219, 64,169, - 75,106, 25,158, 34, 34,219,220,204,225, 99, 32,136,179,188, 12, 79,205, 86,103, 51, 38,239, 73,244,130, 77, 75,101,253, 16,232, - 57,246,132, 9, 60, 29,125, 97,233,162,168,150,182,122, 45,154,174,194, 55,250, 72, 0,170,174,174,183,109, 50, 10,219, 78,147, -216, 78, 98, 55,109,178,166, 13, 97,237,214,178, 45,157,134,128,176,105, 18,140, 1,210, 16,162,160,169,119, 92, 34,174,198, 5, - 84, 8, 36,238, 16,183,252, 9,110,166,113,135, 4, 72,252, 0, 42,168, 80,165,106, 76,221,186,118, 75,187,245, 35, 29,142,243, -225,196,241, 71,252,241,114,206,121,211, 33,174, 45, 37,214,107,251,156,231,156,243,156,231,193,248,206,215,154, 68,145,157, 88, -226, 34,118,198, 85, 14, 64,159, 18,234,241,138,255,147,123, 30,117,136, 70,169,159, 9, 68, 26, 69,199, 15, 56,107,137, 73, 80, -239,160,197, 48, 11,184,156,165,112, 98,184, 7, 37,240,230,246,223, 36,185, 46, 17, 79, 81, 34,114,126, 48, 51, 81,177,108,130, -243,226,127, 5, 4, 4,119,236,243,177,145, 16, 38, 57,210, 1, 80, 9,166,180,178, 19,216,124, 65, 20,202,118,116, 74,146, 53, -200, 16, 99, 82,146,118, 79,176,180,243,136, 1,173,171,227,254, 16, 37, 76, 26,237, 67,118, 50,120,124,126,227, 34,119,185, 35, -183,216,116, 18,112,106, 2,125,118, 2,236,204, 12,220,193,220,212, 89, 44, 44,112,132, 2, 24, 92,165,113,177, 3,181, 2, 78, - 23,112,204,202, 20, 85,182, 61, 40,198,165, 36,106,236, 73, 67,146,194,227, 19, 99, 28,178, 71,156,111,139, 7,203, 53, 0,185, -101, 22, 96,145,107,111,188,185,242,205,247,231, 22, 95, 49,143,235, 90, 54,187,120,241,226, 15,183,239, 16,166, 16, 33,242, 61, -170, 63,105,153,198,151, 95,124,190,179, 83,223,217,221,195, 81, 43,122, 99, 98,125,152, 83,164,172,154,208,179,146,154,150, 50, -170, 72,139,195,212,202,162,237, 18,132,161,113, 2,206,207, 67, 59, 81,119, 56,244, 1,159, 12, 0,109,218, 1,128,119,136,251, -142,203, 28, 7,141, 62, 80,250, 35, 70, 70, 96, 70,133,176, 40,170,138,168,202, 34,109,159, 82, 62, 68,201,120,162, 64, 83, 64, -192,173,241,136, 13, 67,226, 98,146,220, 2, 74,187, 42, 98,164, 64, 32,237,159,155,168,190,125,233,218,221,253, 13,200,172,101, -189,108,121, 86, 86,209,122, 3,231,176,181, 63,157, 47,175, 63, 94, 75,167, 32, 34, 51,122, 94,132, 69,208,124, 46,167,200, 50, -110,253,197,209,116,190,226, 96, 63,145, 65, 64, 55, 44,163, 82,152,245, 67,215, 13,156, 86,239, 31, 9,149,123,253,235,151,222, -178,250, 86,140,194, 71,166,158,157,128,192, 7,207, 11, 48, 47, 0, 55,163,211, 72,208,126,254, 24,154,160,203,190,239, 37,136, -172,121,243,234, 71,107, 15,255, 52,187, 29,192, 1, 7,173,195, 16,221,168,169,148, 30,186,114, 82, 89,189,191, 90,173,156, 95, -221, 90, 69,123,172, 48,210, 85,173, 54,127,229,168,125,212,119,173, 79, 63,188,181,177,253,215,187,175,222, 88, 88, 56,191, 83, -223,132, 3, 9,224,255, 66,239,184,221,128, 24, 90,212, 38,219,125, 83,147,245, 71, 71, 15, 27,237, 70, 33, 87,168, 86, 94,170, -205,215,234,141,199, 3,215,158,204,141, 39,144,124,213, 5,236,180, 84, 91, 50,186,207, 14,154, 7,182,107, 85, 95,188, 0,239, - 12,142, 10, 73,155, 98,110,234, 12, 74,217,188,190,180,249,244,126,128,164, 82,177,148, 47,193,221, 50, 52,179,124,134,190, 26, - 66,252,193,107,239,195, 63,250, 81,208,236, 26, 25, 57, 3,192, 16,158, 22, 68,127, 27, 71,223,237,123,123,119, 35, 98,197,122, - 80,154,198, 65, 38,165,238,155, 79,199, 18,252,197, 38,123, 16, 49,158,155,169, 66, 28, 92, 84,132,226,213, 83, 66,183, 39,132, - 67, 17, 73,105,225,115,191, 22, 44,146, 73, 84,129, 19,234,185, 39, 80,132, 20,126,201, 50, 3,167, 29,159,157,204,235,105, 72, -253,114,110, 76,157,204, 77,104, 47,204, 8,133,130, 96, 56,127,220,254,253,206,111,235, 91,221,190,151,134, 58, 90, 82, 32,240, -136, 90, 16,149,154, 78,183,101, 53,191, 93,255,165,144, 42,174, 84,223,235,244,226,143,127,250, 78,128, 76,119,157, 29,219, 79, - 62,251,241, 86,249,171,105,101, 62, 85, 90, 46, 44,127,114,227,193,207,247,222,249,117,121,101,225,235,133,151,175,152, 71, 27, -107,199,219, 45,207,188, 60, 85,205, 37, 83,112, 38,156, 62,235,134, 46, 84,111,124,173,156, 74, 46, 3,190,196,130, 94,236,185, - 61,200,175,144,234,224,211,134, 40,111, 59,125,168,224,243,185,252,229, 11,181, 7,251, 91,200, 0,140, 2,184,164, 36,229,217, - 83,167, 59,118, 39,226, 98,113, 44,234,251,240, 25, 12, 71,233, 12,181,148,253, 46, 18,106,137, 81,195,189,178, 4,134, 14, 89, - 35,197, 78, 68,197, 54,185, 1,147,212, 92,224,249, 30,173, 2, 6, 39,206,188,188,157, 21,243,194,129,111,253,143,103,199, 81, -200, 4, 27,160, 12,117, 23, 56,243,114,180, 2, 36,208,142, 35,106, 58, 97,151,153,177,211,229,217,180,172,236,238,237, 10, 68, - 58, 15, 3,236,204,208,213,200,114,104,209, 82, 64,193, 25,211,106, 82,125,192,184,191, 38,218, 39,208,143, 2, 68, 0, 56, 82, -210,103,236,192,230, 70, 79,240,230,228, 20,173, 82,156,107,246, 12, 36,233, 99,214, 73,168,104,120, 16,253, 43, 0, 81,215,243, -219, 54, 25,134,227,216, 77,236,216,233,226, 52,212, 9,237,250, 51, 73, 87,180,193, 90, 13,181, 18,211, 0, 9,184,236, 48, 64, -156, 55, 14, 28, 57, 84, 72,156,224, 80, 33,132,224,200,223, 48, 1, 23,142, 8, 49,168, 16,168,155, 0, 49,212,195,196,143,178, - 54,144,174,105,179,252,182, 19, 59,113,220, 56, 60,239,235, 68,220, 29, 59,246,247,125,239,251,124,239,247,188,207, 51,174,191, - 83,163,121,224, 46, 55, 18,232,197,142,155,100,246,250,157,168,164,156,249,212,254, 35,145,124, 74,224,144, 57, 36,169,108,182, - 40, 11,196, 35, 3,137, 48,214, 54,161,178, 76,143, 72, 47,126, 64,185, 34,205,225,179,190, 79,134,236, 10, 17, 18,165,200, 92, -106,161,238, 52,184,171,149,162,138,229,152,116, 96,202,174, 26,227, 67, 84,250, 3,236,134,229, 13,199,158,224, 65, 83, 89, 68, -146,169,109, 21,187,233,228,108,217,122, 44, 50,207,140,109, 36,169, 3,126,200, 84,182, 41,205,192, 59,117,221,182, 47,248,225, - 81,193,145, 61, 75, 4, 31,155, 18,143,141,132, 70,188, 87,202, 61,248,153,215,231,202, 23,117,129,177,232,166,101,155,182,219, - 65,174, 2,164, 97, 54,183, 79,187,215,192, 31, 83, 28,138, 98, 40,243,164, 66, 38, 27,228, 73, 54, 68, 82,139, 70, 68,160,233, -152, 18, 6, 52,166, 19, 87, 98,182,144, 45, 14,155, 91, 50,175,152, 44, 46, 9, 52, 25, 73,237,249,171,235, 3,215,250,252,179, -219,139,243,243,186,158,248,118,103, 71, 85, 21, 53, 42,105,114, 68, 85, 34,133, 98, 65,153, 16, 95,191,113,125,247,238,143,248, -109, 52, 42,113,136, 23, 88,226,141, 78,107, 17,175,123,110,168,109,251, 64,102,129, 14, 68,128,235,113, 49,130,250, 51,171, 79, -125,242,225, 7,239,110,109,189,241,234,141, 43,107,235, 64, 13, 71,197, 99,199,233, 17,213, 28,201,154,106,183,146,166, 72, 9, -172, 93,146,240, 18,144, 10,113,183,174, 27,194,252,247,104,114, 10,140, 49,199,254, 47, 44,245, 7,180, 44, 71,200,255,129,234, -156, 68,131,230,126,102,209,251,183,126, 84, 56, 57, 64, 80,203,167, 87,123, 3, 7, 57, 6, 1,186, 88, 59,224,206, 58, 39,117, - 46,101,118, 90,172,160, 66, 91, 77,224, 29, 36,126,210,119, 35, 81,137,254, 48,140,231,246,130,157, 23,144, 72,173, 93,109,118, -170, 24,214,185,212,124,221,174,147,244, 82, 84, 41, 86,138,216, 72,229, 50, 23, 42, 86,153,123, 71,109, 22,137,237, 55, 59,245, - 1,101, 51, 34,234, 44,165,115,221,158,131,168,221,238,118, 76,187, 85, 56, 57,196,216,173,231,215, 45,199, 90, 76, 47,166, 19, - 6,182,171,236,180, 46, 36,227, 58,114, 6,230,135,233, 52,103,146, 51,237,110, 59, 63,179,178,119,120, 31, 49, 2,219,249,251, -251,191, 0, 80,151, 42,165, 82,185, 68,140, 41, 62, 81,199, 76,195, 34, 41, 19,169,241, 89, 64,105, 35,149,206,157, 95,209, 36, -185, 63,240, 74,181,163, 92, 38,187,127,188,143,248,187,253,214, 71, 63, 63,216, 93, 91,186,140, 5,121, 92,125,132,172,186,145, -187,178,148,201,255,245,232,143, 73, 57,238,244, 28,108,150, 55,243, 27, 88,123,149, 86,229,225,233, 67,187, 71,129, 9, 55, 71, -120,217, 88,217, 92, 54,178,166, 99,225,179, 96,136, 30, 55, 79,237,190,189, 58,147, 39, 78,180,235,144,248, 59, 23,127, 49,210, -248,236,215, 46, 93,173,182,170,200,197,146, 64,238,193, 73, 45,169,107, 9, 46,221,186,212, 66, 73,254, 51, 79,212,154,135,115, -153,167,215,212,116,236,162, 31,178, 58, 33,207, 19, 16, 63,184,214, 65,157,171, 76, 62, 37,238, 2,147,178, 70, 42,133, 12,122, -136,132,236,198,100, 53,166, 77,170,138, 22, 79, 38,245,132,174,199, 85,185, 85,173,223,249,238,183, 59,191,254,249,119,211,242, - 36, 9,105,196,101,107, 68, 57, 34,197,194, 10,226,123, 68, 20,126, 58,249,231,135,211,189,155,203, 47, 45, 74, 83,175,109,191, -143,155, 87,111,153,234,150,124,254,203,121,251,251,198,206,246,167,223,124,117,187,240,245,238,165,206, 11, 47,126,124,173,244, -197,241,155,247,222,121,239,185,183,179, 98,250, 65, 99,111,175,126, 48, 61, 57,123, 81,159,118,128, 44,168,228,225, 47, 27, 11, - 38, 75,240,231, 51,203,140,109,196,204,212, 44, 66, 10,198, 23, 89,214,236, 90,212, 83, 74,205,117, 84,226, 75,159, 51,238,254, -126,143,196, 61, 38, 34, 24,151,190, 7,136,224, 86,205, 26, 86,243, 43,151, 95, 46,213,203,186,170, 51,161,221, 15,143,107,235, -184,115,214,200,226, 59,211,135, 24, 14, 16, 25, 47,204,174, 52, 58, 45, 60, 59, 16,119, 70, 48,153, 16,194,201,120, 10,176, 90, -215,244,185,233,133,166,213, 24,121, 31,177, 12, 37,235, 67, 72,134,110, 32,187,111,102, 55, 75,205, 83,159,164, 17,252,192,218, - 9,215,197,228, 56, 57,184,134,165,132, 70, 38,215,252, 18,129, 45, 31, 85, 30,168, 59, 41, 36,212,106, 21, 22,149,161,222, 30, -170,160,113,147, 51,251,153,144,206, 38,181, 61,159, 13,104,169,249, 28, 95,249,198,255, 27,119, 8, 67,155,138, 66,140,146,249, - 34, 76,158,154, 89, 9, 5,200,159, 95,146, 37, 10, 66,255, 9, 64,212,181,244,182, 81,133,209,241, 99,102,252,152,241,196, 37, -113, 29,135,218, 74, 8, 14, 36, 21,164, 64,216, 20,168,154,150,170,170, 80,164, 22, 85, 44,186, 98, 1,252, 1, 54, 72,221,176, - 70,176, 67,160,246, 15, 32, 33, 86, 72,168, 72, 44, 42, 89, 66,170, 2, 82, 90,129, 80,226,144, 98,108,167,118, 98,123,252,152, -241,188,239,240,157, 59,137,144,178,115,252,184,119,238,247,188,231,156,239,196,191,199, 49,246, 87, 98, 39,218,146, 49,110,135, - 62,151,144, 4,194,120, 38, 51, 75,137, 21,215, 83, 1,143, 75,224,192,126,198,201, 99,112,112, 49, 17, 25,174,231,112, 1, 99, - 33,186,192, 17,254,247,160,140,235,149,211,217,144,150,139, 85, 58,229, 83, 27,140, 3,250,132, 87, 22,214, 59,195, 78, 2,187, - 76,107,242,163,227, 23,240, 27,122, 8,224, 48,191,144,155,167,100, 28, 14,221,181, 5, 78,204,112, 92,211,180, 38,244,227, 71, -214,136, 27, 97,130, 79, 28,225,115,203, 89,176, 84,172,234,211, 30, 21,245,208,227,143,100,122,195, 8, 20, 26, 33,134, 80, 52, - 49,193, 87,229, 28,218,172, 16,243,163,162, 73, 21,133,100,192,131,228,169,194, 62,111, 27, 97,216, 94,152,146,210, 92, 78, 4, - 55, 29,232,205, 37, 96,102, 73,150,149,164,132,229, 50, 74,138,205, 41, 5, 93,148,102,252, 98, 18,115, 44,165, 36,121,121, 65, - 73, 39,146, 18,224,137,228,154,193, 30,196,136, 7,232,189, 60,109,182,127,173,213, 30, 60,248,233,247,157, 63,175,108, 94,214, - 20,229, 97,237,161,150,149,101, 41,158, 74, 37, 84, 14,141,111, 55,159, 94,187,122,105,106,140,159,117,218, 20,215, 47,172,174, -140,199, 35,242, 76,241, 16,108, 44, 50, 88,211,246, 13,139,162,104,232,121,161,227,241,203, 91, 62,193,253,140,154,187,247,205, -215,163,145,113,239,254,253, 90,173, 70,155,250,254,214,123,119, 62,184,217,106,213, 13,163,175, 41, 41,144,187,229,184,132,137, - 23,244,255, 81,229, 65,158, 61,180, 93,144, 40, 40, 98, 75,224, 80,199,114, 89, 42, 23,146,106,134, 74, 75, 0,243, 57,253, 0, -120, 51, 31,153, 32,190, 46,112,153, 53,101,174, 31,234,150, 41, 81,197, 19, 12, 7,211,190,195,156,130, 82,180,124,183, 90,122, -121, 72,233, 38,212,228, 97, 6,224, 98,112,174,176,152, 16,125, 15, 67,180, 41,114,159, 50,100, 80, 60, 41, 41,176,198, 67, 46, - 9,174,155,131,226, 76,233,195,119, 63,254,183,219, 32,231, 69,133, 20, 57, 86,221,232,173,148, 86,245, 73,159,234,131,197,194, - 11,244,112, 69, 62, 21,107,233,236,242, 65,103, 95, 83,242, 22, 40,139,126, 86,202,221,186,121, 91,239,235,173,227, 67, 19,218, - 24, 78,185,112,174, 63, 58,122,123,237,157,158,126, 68, 81, 71, 77,101,185,178,154,160,202,234,139,229,234,246,222, 35,122,120, -100,192,182,239,154,182,129, 64, 26, 3,203, 47, 4, 45, 5,140,167, 84, 82, 22,144, 66, 26,231, 43,231,159, 28, 60,198,208, 90, -199,238, 13,143,201, 62, 65,169, 85,103,139,149,202,160,215,221,254,235,209,209,176,123,241,165,141,189,214,223, 20,209,181,140, -150, 87,206,212, 15,119, 95, 91,186,112, 54, 95, 24,154, 67,242, 2,229,185,115,187,173,122, 18, 56,165,176, 60, 87,145,161, 73, -208, 31, 27,163,253,195,221, 70,183,241,198,242,235,237, 94,147, 22,117, 99,227, 58,185, 18,203,177, 75,249,121, 9, 84,246,164, -229,152,182,231,192,230,129,185,114, 0, 8, 99,236, 57,117,150, 2,128, 97, 27,185,180,170,102, 20,202,118,149,116,150, 22, 75, -251,237,186,147,137,211,123, 94, 96,133, 13, 77,176,166,130,103, 11,152, 21,199, 56,125, 36, 34,102, 70,112,180, 56,239, 71, 10, -145, 86, 9,109,139, 66,241,215, 91,136,251, 9, 89,200, 21,210,197,209,180,115,240, 79,231,183,253,230, 78,179,123,236, 56, 46, - 20, 41,169, 36, 15, 44, 68,113, 92, 74, 41, 41,113, 94,153,125,115,249,246,100,220,251,242,241,207, 71,182,254,233,210,214,197, -203,119,178,159, 20,238, 46,126,190, 94, 89,213,190,213,186, 63, 52,190,251,234, 11, 91, 9,210,170, 18,230, 98, 79,246,127,121, - 53,190,185,245,209,141,187,223,127,214,254, 35,216,186,114,171,219,216,254,241,112, 39, 72,200,215,231, 87, 12, 15, 98,141, 65, - 44, 92, 44,148, 59, 3,242,203, 51,150,109,210,186,144, 77, 91,147,180,152, 94, 43,175, 61,211, 59,192,248, 70, 8,111, 14,105, -187,180,250,214,110,187, 46,138,128,149,229, 51,218,196, 53,231,120, 89, 79, 25, 64,253,176, 30,128, 85, 71,111, 71, 25,196, 25, - 63, 96,159,210,145,211,178, 90,127,124, 44,162,101, 73,217, 73,181,222,222, 11, 4,159,242,177,171,235,155, 84,207, 1,201, 19, -130,128, 77,167,118, 98,143,209, 75,240,121,234, 25, 48, 73,146,171, 37, 10, 6, 3,142, 18, 4, 56, 53,186,192, 71,163,143,159, -105,170, 30, 24,212, 84,125,158, 39,129,164, 29,139, 18,248, 72, 8, 78,160,167, 95,198,196, 36,207, 38,163, 6, 20,199,227,127, -148,116, 6,124,126, 23,218, 75,140,130,150,142,219, 8,118,170,203,119,210, 35,143, 11,241, 19,254, 82, 24, 49,120,240, 26,228, - 70, 2,191,148, 95, 24, 65,176, 26,190,151, 15, 76,245,121, 71, 46,246,159, 0, 68, 93, 75,111, 27, 85, 24, 29,219,243,244, 99, - 60,118, 28, 39,105,235,164,105, 2,132, 60,160,152, 68, 36, 36, 69, 52, 34,145,216,181, 18,236,144,248, 3,108, 64,130,101,196, -178, 98,197,130, 13,187, 10, 36,144, 64,236,232, 2,164,174, 10, 2, 9, 36, 54,109, 48, 84,173, 99, 7, 59,126, 76, 38,142,237, -120,158, 30,115,190,123, 19, 88,121, 54, 51,158,185,143,239,126,231,187,231,158,243,127,124, 15,152,223, 99,136,145,116,174, 0, -198, 43,236, 84,108, 96, 92, 31,225, 66, 70, 72,184,240,233,162, 71,227, 87, 18,149,190,219,139,147, 55, 8,167,114,115,187,165, -115, 36,128, 79, 32, 19,134,169, 5,179,219,110,116,234,200,130,137, 61, 25,178,201,108,211,113, 68, 77, 73,226,223, 73,195,132, -241,131,144,161, 63, 51,185,160, 72, 42,224, 88, 16,184, 62,242, 84,198,180,193, 99, 53, 89,225,252,107,182,126, 18,212, 82,165, -248,112,196,111, 68,203,106,167,103, 22, 89, 41, 50, 53,206, 64, 24,146,149,179,164,121, 8,208, 92,232,146, 31, 60,102,177, 6, -119,225,133, 85, 5,216,194,183,221, 62,169,243, 8,172, 11, 89,145, 69,147,147, 36,192, 54,164,193,193, 77, 27,216,167, 80,245, - 71,162, 98,142, 66, 28, 87,137,196,233, 85,137,118, 62, 73,177, 17,125,230, 8, 14, 98, 46,214, 41, 63,106, 59, 64,124,100, 2, - 79,198, 52,177, 8,185,151,138, 17,153,184,174,209,141, 87, 54, 86, 95, 90,251,233,151,223, 95, 46, 22,103,174,206,127,243,221, - 61, 63,140,133, 67, 49, 28,146, 25, 67, 48, 20,155,173, 78,241,197,162,174, 27, 15,126,254,117, 44,155,249,228,206,157,118,243, -168, 82,173,196,227, 50,219,119,229,108,122, 18,161,193,133,134, 38, 0,122,192, 27, 8,195,245,181,235, 55, 54, 55,246,246, 62, - 42,151, 75,182, 99, 85, 42,127,253,120,255,123, 4,244,183,110,191, 89, 42,253, 22, 87, 71, 89, 67, 82, 20,188, 51,219,219,103, - 71, 69,201,180, 71,140,158, 43, 73,176,116,142,163, 13,102, 83, 16, 9, 25, 92, 64,118, 65, 42,129,148,118, 83, 25,138,232,152, -204, 59,139,100,241, 36,113, 16,161,157,156,148,164,166, 36,221, 11,221,148,146, 44,155,143,105,223,151, 54,176,135, 76,138,150, -136,170, 88,233, 0,137,182,175,223, 44, 55,171,140,154, 70, 71,234,209,182,151,178, 87,108,111,144, 84, 18,104,224,237, 23,118, -240, 72,179,107,150,170,251,164,171, 69,110,150, 71,205, 78, 61,157, 52,204, 78, 3,235,132, 24,147, 79,186, 38,211,121, 38, 10, - 17, 0,143,235,145,155, 74,167,127,252,236,229,133, 74,243,192, 58, 49, 35, 62,117, 25,102, 17, 38,106,223,177, 55,151,214,231, - 46,205,233, 73, 3, 8,228,105,171,204, 60, 2, 71,173,147, 6,226,230,250,115, 27,200, 30,242,153, 92,181, 85, 81, 21,126, 66, - 0,171,149, 80,200, 77, 99, 4,203, 49, 25, 15,105, 88,245,173,229, 45, 77, 82,254, 49,107,249,204, 68,111,208, 69, 3,220, 88, -217,180, 78, 45,164, 29,245, 86, 61, 36,131, 61,225,181,165,173,102,167,129, 52, 60,167,143,249,158, 91, 51,235,152,171,142,231, - 30, 52, 42,125, 7, 95, 71,192,165,107,159, 98, 44,208,129, 91,118, 86, 20,128,117,101,118, 25,216,108,113,122,241,207,195,125, - 12,201,164,146,106,119, 90, 3,187,135,183, 42,140, 95, 57,104, 30,120, 46,109, 89,239,174,237,174,206,175, 62, 61,122, 2, 76, -152,215,199, 0,225,185, 53, 51,134, 50, 66,127,143,114,127, 62,161,252,158,125, 76,199,218,226,227, 51,130, 55,245,234, 56,201, -249,250,110, 4,195, 56, 18,158, 91,113,252,231,178,199,102,118,200, 78, 93, 80,135,162,139,172,185,253, 35,227,193, 97,187,212, -246, 13, 63,226, 71,219, 21,171,215, 15, 2,155,204, 41, 17,211,113, 65, 26,152, 72, 39, 92,230, 65,152, 82,100,160,202,154, 25, -109,245,172,207, 75, 63,172,167, 87,222,155,127,187,112,247,230,221, 55,190,253,234,241,151, 31,126,253,129, 48, 38,220,123,247, - 83, 53,163, 21,244, 73, 45, 38, 27,162,222, 25,245, 74,143,238, 47,239,236,108,246,183,223,255,227,157,189,233,143,175, 26,217, -207, 30,125, 97,133,225,173, 66,209, 29, 57, 76,198, 53,125, 54,232,219,158,155,142, 39,207, 92, 7,171, 35,176, 32,226, 53,121, - 58, 50,231, 9, 78, 91,103,100,111,170,175, 30, 30,215, 60, 4, 46, 81,101, 38,221,153,116,220,168, 35,155, 38,109, 3, 2,206, -207, 95, 94,244, 3,119,105,102, 9, 17,185, 56, 95,236,219,131,180,166,207, 77, 92, 35,136,233,217,164, 58,142,108,218, 31, 32, -149, 4, 36,202, 27, 19, 15,171, 15, 89,181,134,204,153,153,241, 56,242, 51,113, 50, 61,133, 60,224,245, 91,187, 79, 74,127,103, -211,185,250,113,205,245,108,180,153, 79,210,179, 68,141, 61, 99,132, 46, 46,226,133, 81,193,214, 99, 98,103, 25,137,236,132,145, - 23, 70,140,231, 77, 36, 17,146, 43, 33,178,242, 8, 19,202,197,170,159, 75,229,128, 62, 73,171,142,196,133, 2, 22,187, 72,251, -143, 68, 34,169,116, 17, 17,248,246, 50,247, 61, 26, 93,132, 95,198,129, 51, 18, 70, 38,145,117, 2,155,251, 66,159, 14, 58,124, -229,158,205,207, 2,232, 80,122, 58, 26,106,114,226, 95, 1,168,186,150, 30,183,169, 40, 28,191,237, 56,177,227, 73, 38,175,105, -103,162, 36,109,209,244,161, 14,163,182, 44,202, 2,209,194, 2, 85, 45,136, 5, 18,130, 10,132,202, 15, 96,129, 64, 98, 7, 93, -177,103, 9,127, 0,216, 32,209, 5, 35,218, 25, 80,233, 6,177, 64,213,116, 74,105, 75,160, 73,243,118,252, 72, 98,199, 9,223, -185,206, 2,164, 40,155, 56, 81,124,143,239, 57,223, 57,247,156,239,227,255,163, 4, 30,167,231, 76,250, 97,249, 48,208,125, 82, -111, 72,226,127, 66,174, 49,242,130,223, 31,120, 3, 55, 28, 33,162, 99,169,131,104, 18, 67,247, 36,213, 97, 88, 14, 67,127, 8, - 96, 60, 42,103,203,127,247,254, 66, 48, 19,168, 82, 76,117, 20,153, 26, 0,120, 82, 24, 73,240,254,212, 13,130,113,204,156,192, - 10,214,194,126,243,238,208,235,199, 76, 57,172,204, 26, 31,113, 34,175,153, 2, 77, 11,130, 72, 29,147,132, 72, 18,126,232, 81, -189,133, 84, 61, 41,222, 2,136,225,223,198,211,173, 36,252, 22, 6, 20,153, 24,105,126,196, 86, 6, 43,194, 40,252, 67,210,247, - 8,124,199,183, 1,133, 42,133,163,140,112,156, 53,145,179, 97,170,128,209,112, 51, 81, 2, 58,123, 32, 4,203,210,100,226,198, -154,133, 27,185, 10, 16, 28,144,174, 42,176,161, 83,145, 7,182, 37,150,164, 57, 77, 54, 49, 11, 45, 82, 26,151, 73, 9,166,129, - 28, 95,200,232,184,140, 35, 90,126, 17,119, 23,181,155,173, 11, 47, 94,200, 91,230,238,238, 94,185,144, 63, 86, 41,233,248, 84, - 97,225,157,138,113, 33, 86, 98,181, 80,226, 56,101, 48,244, 95,189,124, 37,119,184,122,233,149,215, 16, 74,166,126, 4,207, 12, - 88, 7, 24,110,234, 98,126, 69, 41,231,213,114, 86, 62,132,247,162, 92, 92, 85, 74,133,180,109,119,224,149,107,149,242,199, 31, -126,112,253,250,103,231,158, 61,117,235,199, 27, 88,236,173,147,199, 3,114,211, 92, 20,136,211, 41,117, 88, 34,192,135, 84, 97, -103,240,159, 6,197, 56, 85,150, 0,202, 52, 69,164,102, 59,129, 87,197, 5,178, 10, 93, 21,140,164,104,165,196,140, 46,153, 41, - 41, 5,144,172,203,102, 90,206,173, 40, 57, 75, 51,224,186,146, 74,164,205,135,115,219,159, 57,147,249,248,169,247,143,169,102, -144, 30,105,178,198,113, 66,181, 80,195,151, 4,198,233, 10,123,181,250,109,198,177, 57, 79, 39,211, 73, 37, 41,203, 90,223,237, -193, 82, 93,183,139,165,222,189,123,179, 61,108,107,138,238, 79, 61,160,230, 83, 27,155, 72,122, 17, 84, 21, 49, 9,231,126, 40, -187, 65,253,191,164, 38, 17,169,162,186,125,228, 76,163,247,152, 14,220,124,219,210,179,219,181,109, 92,249,180,221,196, 79,193, -147,194, 76,200,175,177,101,190,187,115, 35,148,136, 94,175,227,116, 11,153, 66,189, 80,129,125,129,194,116, 89,191,189,127,251, -113,251,209,195,214, 35,142, 29, 79,241,188, 68,195,144,211, 49,130, 10, 18, 2,215,119, 44,221,128,215, 56,104,220,191,245,251, - 94,173, 88, 71,134, 22, 4,158, 70, 99,194, 74, 49, 83, 0,188,242, 70,253, 21, 35,135,212,250,196,250, 49, 0, 47, 62,138,224, -145,115,134,181,185, 94,175, 23,171,139,249,172,158,223,224, 23,209, 51,107, 71,158,244,155,185, 84, 22, 48,224,234,203,111, 87, -139,235,237, 1,178, 88,239,183,251,191,218,126, 31, 16,222, 76, 26,212,140,187, 88,156, 57,126, 86, 97,179,154, 7,141,123, 69, -115,117,173,180,126,118,235,249,131,198,254,215,123,223,192, 83,192,143, 20,173, 50,220, 83, 56,139,181, 13,248,146, 85, 92,203, -173,189,116,250, 34, 41,231, 76,124,182,245,231,164,220,129,221, 41, 38, 24,199,175, 24, 83,199,136, 82, 66, 16, 99, 78,224, 37, - 4,100,119, 77, 12,115,176, 7, 63, 91,252,209,117,127,110, 63,112,230,212,226, 51, 36,160,150,240,231, 64,235, 36, 15,131,236, - 46, 88,176,200, 30,197, 10,145, 36, 72, 13,168,137,133,200,202,242, 78,243, 30,126,237, 82,254,116,237,218,235,209,157,196, 59, - 59,111,188,123,254,253,196,249,196,206,229, 47, 37, 67,233, 5,147,143,126,249,234,205, 31, 62,127,239,230, 23, 13,199, 15,164, -168,245,237, 79, 23, 63,121, 78, 78,100,175,125,255,105,238,232,185,138,150,159,250, 61,123, 22,170,188, 12,159,236, 76,156,225, -100, 36, 73,194,136, 68,183,105,170, 60,107, 88,105, 69, 87, 4, 25, 15,204, 86,245, 36,205,242,113, 36,180,192,196, 50, 40,150, -203,108, 88,186, 51,234,226,229, 77,189, 88,145,132, 81, 47,136,205,193,147,158, 59,128, 65,177, 97, 31,182, 30,132,164,131, 48, -110, 13,137,247, 34,155, 92,169, 23,235,212, 35, 59,153,136,172,110,227,250,182,169, 26, 18,155,184, 94,246,165, 80, 65,134, 26, - 37,105,200,227,207, 22,182, 73,223,233,225, 81,217, 60,124,226,234, 11,111, 1,148, 32,105, 24, 17,179, 35,143,231, 57, 37,167, -225,213,219,195, 14, 86, 53,111,228,177, 96,125,167,139, 28,162,227,118,136,163,153,209, 14,215,242,245,142,221, 30,186,182,231, - 59,240, 65,182, 75, 7, 69,192, 43,228,116,168,239, 99,102,105, 25, 25,240,113, 1, 16,166,148,204,210,210, 57,179, 88,158, 84, - 52, 93, 51,168,189, 74, 49,102,164,107, 56,118,199, 35,137, 83,150,245, 18, 54, 94, 12, 27, 33,188, 5,100,174,121,140,132,255, - 21,128,168,115,137,109,163,138,194,240,120,102, 60, 51,182,199,111,198,142, 83, 39,177, 13,184,233, 67,105, 19,161, 54,180, 85, - 89,176, 97,209,125, 43, 36, 4, 75,246, 72,236, 80, 97,133, 16, 66,108,144, 64,236, 42,182,116,129, 64, 44, 64, 65,130,164, 16, - 9,132,170,134, 87,139, 20, 72,147, 38,177, 61,113,198, 30, 63,199,158, 49,231, 63, 55, 9, 91, 43,138, 61,115,239, 61,231,220, -243,248,254,147,248, 29,249, 56,178, 47, 25, 51, 43, 51,169, 74, 69,155, 45, 79, 1,160, 34,227,255, 95, 93,149,196,236, 33, 28, -138, 21,207,211, 69, 88,131,166,104,224, 31,137,244, 65,127,149,167, 61,133, 34,171,194, 67,186, 90,163, 83,231, 66,160,224,128, - 2, 34, 17,136,142,126,209,211, 47, 29,195, 20, 36, 48, 25,208, 17, 44,244,213,142,175, 11,104, 63, 82,194,185,212, 84,148, 15, -191,112,222, 50,183, 58,197,116,115, 26,149, 58,151,177, 98,200, 4,176,138, 94,144,139, 79,129, 71,113,226,187,216, 1,122, 99, -192, 51,227,209, 52, 19, 17, 16,243, 28,118,155,205,110,131,161,228, 82, 68, 53,170,197,121,122,107, 71, 40, 73,238, 47, 63,150, - 58,132,227,129,116,184,223,115, 6, 54,121,254, 66, 62,134, 36,123, 24, 26,167,138, 76,151, 53, 89,128, 4, 56,150,226,177,166, -137, 64,196, 76, 88, 62, 1,221, 47, 67,174,208,180,218,205,115,103,171,197,233,252,202,119,223, 94,122,110, 81, 11, 43, 15, 31, - 61, 18, 3,171, 18, 24,212,163,133,115,243,183,110,222,252,242,139,187,253,174,123,251,157,219, 31,125,240,254,229,229,229,218, -222,222,230,227,109, 21, 96, 0, 31, 86,111,226,105,106, 96,104,129, 6,129, 43,116,220,211, 89,142, 24,234,149,107,215,239,173, -221, 51,140,200,171,175,189, 94,168, 44,207,156, 74,174,172,124,115,186,122,222, 48,204,181,245,251,126, 16, 30,141, 5,201, 85, -230, 73, 88, 52,147, 49,240, 7,115,139, 60, 1,139, 60, 15,126,191, 63,241, 70,194, 10,156, 80, 99,209,122, 25,213, 21,114, 93, - 98,122, 22,221, 59,225,144, 25,149,227,166,172,199, 67,180,103,129,166,151, 21,140,165, 76,252, 84, 36,211,245, 92, 10, 37, 48, - 84,130,250,178,108,198, 18,118,251, 96, 76, 49,190,145, 52, 52,253,160, 85,215,128,228,209, 98,168,152, 37, 41,138,167, 69,135, - 27, 13,133,210,241, 52,133,165,244,191,154,110, 83, 83,148,238,208,165, 35,173,201,250,112,220, 35, 7, 4,249,133, 65,103,206, - 42,237, 29, 62,161,131,120, 42, 91,220,111,213,154, 29,135,246, 33, 35,188,163,100,178,200, 61, 84, 10,229,234,236,153,243,103, - 23,103,175,156,249,113,117,149, 30,216,118,234,170, 26,110,182, 15, 83,102,114,199,222,245,198, 67, 58,135,182,107, 83,184, 64, - 63,114, 46, 87,202,167,115,123,135,251,244,118,102,159,154,163, 79,104,177,208,173,129,130,249,104,204,202,215,134, 28,161, 0, -112, 99,115,195, 74,100,182, 26,219,180, 81,233,235,158,153, 42,175,255,181,206,205, 27, 48,130,233, 72,154,204,183,149,200, 38, - 99, 73,178, 56, 75,149,133, 6,148, 70, 90,165,153,106,127,212,255,249,207, 95,218,253,206,229,211,151,232, 90,227,116, 28, 5, -164, 38,223,237,117,232,235, 10,169, 92,189,181,111, 59,141,165,242, 5,238,135, 25,215, 15,118,123,237,246, 8,186,193,170, 3, - 62,244, 48, 99,166,154, 93,135, 30,159,243,230,126, 84, 55, 94,186,248,226,247,191,255, 64,207, 66,215, 14, 90,174,100, 36, 69, - 49, 93, 53,170,231,175, 77, 73,253,190,228,121, 56, 16, 33,102, 70,138,145,247,224,136,206, 45,210,160, 62,199,239, 19, 95,217, -111, 36,106,222,144,108,155,231,135,210,122, 34,162,217,143, 29,151,236,251, 0,184, 80, 16, 3,134,244, 22, 24,175, 37,230, 18, -233, 47,162,134,108, 41, 51, 31,110,172, 30,122,238, 39, 23,222,200,190,183,248,242,210, 43,187,189,230,231,119,239,116, 62,253, -109,115,235,254,103, 59,171,119,254,248,234,121,171,116, 99,246,162,239,247, 63,126,248,117, 33, 93, 76, 59,157,167,111,188, 16, -255, 53,243,238,223,111,190,125,253,173,157, 39,255,172,217, 63, 45,230, 23,114, 58, 45,223, 68, 57,226,117, 9,197,139, 80, 50, -158, 48,181, 72,207, 27,248,128,149,122,117,231, 64,216, 93, 81,137,189, 58,127,149, 94, 11, 93,119, 56,152,148,172,132, 69,139, -130, 99, 8, 29, 45,137,174,251, 40,173, 15,122, 61,138,148, 19,217,128, 83,221,244,240, 67,192,195, 37,238,202, 11,158,205, 87, - 40,144, 31, 51, 7,148,182, 34,172, 7,186, 15, 1,133,246,241, 97,136, 35,226, 18, 5, 13,245, 90, 45,101,162, 30,163,134,195, - 20,194, 63,248,247,129,174, 27, 19, 48,207,135,130,193, 0,249, 17,145, 51,225,110,149, 1, 72, 18, 2, 10,128, 10, 92, 4,129, - 80,116,171,190, 5,113, 40, 58, 35,156,147, 25, 12,250,160,164, 5,220, 65,131,180,155, 69,215, 86,216, 40, 9, 24, 21,161,134, -196, 60,102, 85,197,204,221, 0,154,239, 12,139,166,168, 72, 76,210,186, 16,168,242,201,215, 77,103,139,110, 31,187,162,146, 43, -207, 89,229, 93,123, 91, 69,207,139,255,159, 0, 92, 93, 75,111, 27, 85, 20,158, 25,199, 51, 30,103,252, 24,199,174,237,144, 52, -161, 41, 1, 53, 41, 78, 19, 12, 45, 47,169,145, 88, 65, 75,149,240,144, 88,128,216,241, 11, 16, 27, 88, 68, 2,177, 66,108,216, - 34, 30, 18, 20, 9, 36,246, 64, 68, 87,172, 72, 42,213,105,147, 10,147,166, 36,105, 82, 26, 63,198,206,204,120,230,142,205,249, -206, 56,141,132,151,246,104, 60,154,123,239, 57,223,121,125,223, 49, 63, 1,211,164, 5, 54,228, 10,189, 48, 32, 96, 36, 47,254, -215, 23,143, 17, 3, 20, 90,209,189,142,220,179,172,116, 2, 95, 58,134,246,204,238,197,114, 76,180, 41, 7, 85,157,238, 6,110, -128,176,158,115, 20, 44,244,152, 26, 43,252, 80, 28,144, 49,114,244, 58, 98,170,238, 35, 93,133,178, 38,115, 2,247, 95,151,212, -239,134, 21,150,107,177, 70, 40, 86, 42, 84, 32, 7, 72, 23,174, 17, 79, 90,118,163,159, 77,228,198,198,168, 18,229,170, 90,191, - 84,219, 87, 39, 15,205, 21,134,191,209, 42,200, 50,231, 48,189, 20,220, 13, 49,113, 57,197,116,105, 61, 93,183,235,126, 23,244, -197,160,153, 12, 4,217,202, 99,121, 25, 78, 87, 82,200, 70,187, 32,107, 26, 61, 84,204,209,142,226, 7, 82, 56,193,196,188,119, -189,136, 20, 50,202, 65, 16,141, 44,182,237,118, 15, 15, 9, 94, 1,185,130,168, 36, 16,219,119,255,126,245,242, 43,169,164,118, -107,227,250,115,207,206, 85, 55,174, 15, 68,187,244, 75, 33,151,121, 99,113,225,237,119,222, 93, 89, 89,185,122,245,135,215, 22, -174, 60, 50, 50,182,180,244,113,177, 56, 60,123,238,220,175,191, 45,147,231, 84,186,242,220,204,204,216, 8,133,182, 67,166,145, - 73, 39,211,169,244, 16, 25, 74, 85, 29,116,237,222,197,249,151,111,175, 87,215, 42, 27,186,166, 78, 78,140,110,254,117,103,249, -151,223,203, 79,157,167, 96,227,218,181, 63, 6, 20,205,131,152, 37, 11,232, 69,250,226,218,132, 92, 5, 70,177,144, 79,167, 99, -236,249,136,219, 21,176,248, 50, 21, 65, 84,137,199, 36, 67,135,202,143, 22, 37,251,174,128, 18, 28, 44, 12, 72,127,106,228,222, -116, 89,143,225,237,210, 86,176,218, 78, 76,142,130,210, 79, 82, 90,157, 38,185, 63,193, 83,202, 40, 92, 48,159,115,222, 44, 96, - 56, 80,142, 16, 38, 34, 83, 27,101, 38, 6,250,219,189,250, 94, 54, 85,160, 11,146,144, 25, 81,118,107, 56,165, 22,184, 3, 5, -156, 8,235,199,147,161,247,124,159,118,151,105,152,167,242,167, 86,171,127,134, 19, 24,116,108, 36,112,236, 1,148,208,153, 36, -132,219,114, 44, 58, 84, 19,197,199,111,110,173,217,162,115,101, 97,241, 96,235,193,173,234, 13,120,238,160, 75, 16,207, 34, 91, - 41,220,100, 44,209, 68,206, 4,222,220, 21,182, 11,245,143, 58,173, 90, 66, 55, 48,117, 37,201,205,118, 99, 40,153,163,213, 36, -124, 61,108, 22,204,184, 73, 16,175, 52, 93, 58,243,194,108,176,111,215, 90,117,250,178,104,230,125,225,154,208,225, 11,201,170, -122,100, 26,138,233, 66, 49, 83,168,108, 85,200,136, 86,239,111, 90,110, 27, 82,112,116,147,116,161,237, 52, 71,179, 35,166,145, -170,220,169,144, 99, 59,123,114,106,251,254,246,139,103,159, 47,141, 77,217,126,167,222,120,240,228,163,165,213,205, 85,109, 64, -107,216, 22, 40,177,208,181,229,122, 61, 65, 80,157,182,168,166,197,201, 63,209,235, 31, 63, 49, 78, 75,176, 83,191,119,115,231, -182,227, 30,146,191,108,161,169,151,108,181, 77, 72,100, 44, 18, 27,190,144,165,136, 87, 66,155,118,192, 44,190,253,158, 2,150, -144, 12, 5,223, 37,142,222,144,114,145,125,245,159, 90,170, 73, 7,185,171, 76,142,206,136,246,110, 68, 61,216,181, 92,116,181, - 6,221, 78, 0, 86, 20, 92,204,237,222, 62, 87, 33, 19,154,154,212,212,123,174,245,245,122,165,172,142,126,240,249,151,206,158, -120,235,139,215,191, 90,248,126,250,210, 99,203,159,126,251,201,250, 79,107,181,205, 15,203,111,150,242,167, 83,131,137,103,242, -147, 19,241,252,103, 55,126, 44,106,217,151,158, 88, 44, 63, 61,183,244,243, 71,239, 37,223, 79,100,229,111, 54,190, 59,147,159, -158, 74,145,103, 18,202,195,166, 63, 60,104, 55, 54,160, 57, 62,132,229, 67,181,104,229,161,166, 50, 83, 11,236, 32, 85,226,106, - 81,149, 80, 41,172, 60,186, 18, 29,136,167,113,103, 75,198,200,112,158, 0, 92,140,134,158, 40,159,158,181, 64,104, 8, 92, 23, -150, 31,200, 46,253,219, 58, 32,104, 45,129, 61, 70,167,205,232,116,192, 95,203,124,100,130, 21,229,144,190,106,195,215,162,135, - 65,141,170,180, 4, 1,235, 56,162, 5, 62,160, 7,243,122, 71,147,152, 97, 2, 91,102,223, 9, 14, 56, 25,148,139,185,196,137, - 54, 43, 11,121, 20,218,121,157,249,210,124,117,191,170,160,136, 5,152, 6, 40, 69,182,253,104,146,214,233,216, 2,105,153,144, -240, 44,100,115,236, 73,253,204, 48, 82,179,190,239, 13,234,137,241,220,248, 78,109, 91,230,233, 60, 8, 48,176,240, 29,178,127, -140,220, 14,157,246,126,131, 51, 84,172, 59,241,159, 0, 84, 93, 75, 76, 27, 87, 20,157,241,119,108,143, 33,224, 4, 25, 2, 73, -156, 15, 42,136,162,198,142, 13, 89,144,152, 46,250, 17, 69, 68, 73,182, 81,149,125,151,149, 74, 54,169, 88,118,213, 5,234,170, - 89,147, 42,202, 34, 74,212, 42,171, 86, 40, 11, 20,201,136, 32,146,242,181, 45,138, 1,127,176, 61,129,241,252, 60, 51,238,189, -247, 77, 34,199, 43, 75,150,173,241,155, 55,231,222,251,238,185,231, 56,254, 30,204,218,137,145, 23, 57,206, 25, 39,192,177, 39, -142,227, 63,113, 76,167, 17, 50,122,134, 1, 25, 76,154,176,193,201,183, 54,244, 71, 13, 29,191,136, 86, 80,104,182,104, 57,126, -130,237,252, 74,174, 61, 28,224,185,200,249, 72,172,114,130, 10,215,236, 67,122,211,150,121, 59,232,236,248,203,178,126, 5, 99, - 62, 49,248,134,228, 8,254, 34,224, 99, 88,232,208, 49, 91,180,131,222,160, 24,232, 48, 12,149,241,245,105,209, 49, 41,104,209, - 65, 1, 20, 1, 72,181,105,153,196,111, 65,169, 3,108, 70,147, 15, 92, 25,109,122,240, 84, 10,253,131,120,180, 10, 51,144,113, -143, 34, 57, 16, 96,162,167,206,226,240,164,139,247,187, 67,126, 18,100,135,251, 14,121,174, 6,185,141,193,153, 38,175,104,216, - 3,211,154,166,162, 90,186,134,247,191,161, 89,104,153, 10, 33,135,200,148, 36,187,224, 58, 40,214,182,183,243, 83,223,124,119, -225,252,224,200,104, 34,191,179,155,205,239,193, 79,141, 12,141,140,143,141,191,120,254,124,225,143, 39,128,161,179, 15,102,159, - 61, 93,200,230,183,234,213,202,244,204,244,230,191,239,228, 19,169, 83, 20,239,204, 76, 79,166,211,241,209,209, 84,106, 44,149, - 74, 78, 76, 76,164,211, 95, 38,175, 37,110,220,156,140,246, 70,107,149,210,242,202,242,234,155,213,151,127,254,245,106,113,241, -189, 44,223,190,117,251,168, 90,126,247,118, 45, 36,250,125, 30,100,194, 64,222,109,163,112, 95, 11, 37, 18,109, 64, 73,216,223, - 44, 0,243,164,159, 67, 18, 63,228, 90, 73,242, 73, 60,169,190, 65,205, 8, 91,156, 11, 10,124, 56,200, 9, 66, 11, 50,247,206, -176, 75, 0, 68,247, 33,132, 83,230,131, 26,155, 46, 11,155,208, 77,124,138,220,140, 79, 11,181,148,106, 42,210,113, 13, 42,101, - 30, 73,253, 72,206,133, 72, 49,121,245,171,157,131, 45, 64,237,238,112, 4,214,185, 43,212,157, 43,229, 80, 74,222,227,135,245, -199,206, 39, 41,126,232,166,122, 49,122, 25,194,176,224,243,194, 74, 14,246, 13,102, 15,178,201,228,248, 97, 97,223,230, 97, 67, - 55,206, 70, 6,246,235, 5, 26,229,199, 84, 67, 55, 84, 49, 40, 86,234,149,225,161,225,245,141,181,163, 92,105, 99,103,237, 88, -174,163,255,223,113, 53,253,121,186, 88, 47, 37,174, 92,157, 74,125,155,217, 90, 33,107,121,148,147, 51, 81,125, 90,247, 83, 75, -211,166, 42,134, 4, 89,105, 3,243, 28,212,203,215,135,198,142,164,170,169, 24,153,215, 75, 0,175, 69,233,240,116, 71,183, 36, -215, 1,253,206,245, 95,210, 27,120,110, 78,182, 54,103, 78,133, 58,214, 11, 27, 3,145, 62,184,126, 69, 83, 99, 61, 3, 53, 5, -202, 11, 55,100,103, 62, 4, 44,237, 77,110, 21, 77, 14,188, 94,168,235,225,201,221, 45,237,254, 87,217, 43, 86, 15,227,151,227, -213,247, 21, 21, 47,195, 75, 46,222, 30, 0,119, 64,183,216,153, 11,101,169, 12, 87, 24,242, 7, 12,114,182,170,201,117, 5, 21, - 17,220,128,115, 16, 45, 6, 78,199,234,114,217, 67,250, 4, 46,206,114,107,218,208,205, 94,136, 14,136,239,200,118,177, 63, 48, -118,217, 88,135, 99,237,140, 85, 26, 65, 24,103,136,171, 37,184,101, 56, 46, 84,150, 42,227, 61,209,162,190,123,212,128,184,130, -167,159, 38, 89,211,178, 41,216, 38,125, 17,150, 38,232,241,118, 6,130, 93,130,235,159,124,241,167,216,189,248,252,215,223, 39, -238,101,213,253,199,153, 71, 39,243,153,159,255,254, 45, 35,231, 30,198,239,134, 4,159,212, 60, 1,104, 83, 57,253, 11, 0, 38, -169,182, 80, 88,186,239, 79,118,253,120,233,215, 95,126,151,100,207, 15,137,251,115,203,115,253,221, 87, 38, 35,231, 36,171,193, -115, 31,133,206,240,140, 2, 42, 45, 8,237,168, 27, 67,174, 38, 22,181,136, 93, 45,206,225,119, 18, 31, 8,176, 24, 29, 2, 90, - 40,166, 79,138,100,142,237, 18,228,191, 33, 1, 69,229,116,203,144, 21,185,183,171,103,125,111,147,228,180, 92,108, 30, 42,128, -202,220, 1,114,112, 67,238, 53,211,129,104,199, 42, 0,135,207,250, 7, 81,252,142,119, 59, 41,175,109, 17,166, 97,173,192, 35, -107,185, 83,113, 20,203,201, 41,130, 65,189,211,226, 0, 76,111,202, 90,131,177, 63, 16, 76,173,102,174,152,163,192,218, 34,239, - 32, 14,118, 62, 49, 90,108, 38, 19,105, 51, 66,185,131,144,204,182,156, 20,249,108, 8,177,144,113,138,128, 46, 90, 83, 41,212, -246,169,201,137,169,111, 24, 71,240, 52,219, 57, 81,199,195, 12, 40, 20, 20,181,129,146, 84,244,250, 95, 0,178,206, 45,198,137, - 50,138,227,211,206,116, 58,211,105,103,182,180,179,237,238,178,247,134,203,118, 23,221,184,139,132,136,160, 98, 98, 98, 98, 98, -130, 62,193, 3, 36,132, 23,158, 73,240,141, 24, 19, 19,195, 3,111, 10, 24,125,215,144, 37,236, 62, 0,137, 15, 96,150, 68,225, - 5, 84, 86,151, 66,157,189,245,126,153,157, 94,102, 58, 23,207,249,190,182, 49,154,244,161,153,135,185,126,223,249,254,231,124, -231,252, 78,159,255, 78, 91,161,122,253,224, 59,109,151,215,195,191,211, 44, 20,150, 34, 97, 93,198,241,122,182,222,235, 53,217, -253,151, 69,118, 97, 8,162,233,103,104,214, 51,243,159,223,255,109,125,209, 40,146,154, 5,182, 15, 63, 67,124, 7, 43,146,147, -208,237, 5,166, 47,195, 89,196, 58,139,150,107, 83,219,129, 81, 3, 66, 89, 99,104,223, 7,215, 30,218, 51, 90, 54, 10,232,225, - 82,162,154,231, 5, 56,129,210, 78,226, 17, 85,149,147, 53,163,226, 58, 52, 33, 18, 70,140, 77,140, 63, 66,130, 38, 7,167, 73, -250, 16, 12,104, 11, 89, 5, 20, 13,129,115, 8,243,155,224,211,130,115, 67,202, 33, 88,208,183, 97, 65, 84, 20,220,127,231,112, -147,147, 85,194,136, 24, 19, 48, 37, 30,198, 37,162, 34, 21, 41, 16,149, 56, 37,204,201, 97, 78,137, 4,224,143, 24,192, 86, 47, - 60,239, 23, 5,127,173, 94,126,252,228, 87,215,178, 36, 41, 82,171, 26,207,215,214,193,170,110,109,111, 60,252,249, 97, 38,147, -129,103, 76, 77,143,207,165,103,111,220,252,118,104, 80,133,155,159,157, 57, 48, 50,172,254,241,252,105,179,109, 62, 88,125,244, -195,173,165, 91, 75, 43,203,203,119,239,220,185,123,255,222,253,229,219, 75,173,134, 49, 54, 49,137, 45, 32,246,142, 45,188,177, -152,218, 55, 99, 89, 78,181,102,140,143, 78,156, 57,123,254,250,215,223,253,246,103,182,186,219,105, 17,165,106,163,201,238, 49, -125, 24, 18, 85,193,184, 8, 2, 24, 88, 68, 76,250, 9,207, 13,151,109,236,180, 20,244, 73, 2, 27, 18, 60, 57,226,151, 66,140, - 36, 98, 47, 11,144,206,176, 78,240, 65,134,236, 73,248, 44, 11,253,122, 28,114,188,195,154,193,132, 52, 28, 10, 72,245,102, 25, - 92, 75, 58,248,100,113,192,236,180,143, 30,125,107, 44, 53,170,101, 55,224,130,224,111,110, 21, 54,193, 2,137, 1, 73,111, 86, - 64,191,111, 85, 52, 7,121,188,130, 31, 19, 12,204, 78,199,129, 11,193, 23, 28,129,153,111, 84, 75,122, 49,185,103, 8,190,241, -139,220, 11,129, 21,230, 23,231,243, 90, 62, 38,199, 91,166,161,155, 58,213,242,176,114,165,199,211,185, 90, 1, 70,136, 24, 8, -197,135, 85, 77,203,194,193,169,196,228,102, 65,107, 88,134, 44, 41, 37,189, 4,162,117,109,251,175,213,223, 87, 65,209, 95,248, -224, 92,102,231,101, 7, 35, 86, 20, 72,138,210, 9,201,152, 88,146,206,189, 61,119,108,125,107, 61, 41, 39, 54,138, 27,207, 94, - 61,179, 9,206, 9,236, 78,122, 98,230,239, 92, 22, 44,172,196,135,242,181,252,107,233,197,151,218,186,196, 11, 45,187, 13, 70, - 92, 8, 74,170, 28,215, 74,155,224,209, 31, 62,184,240,254,235,199, 87,215,126,217, 27, 27, 43,212,243,224,200,130, 15, 26,226, - 96, 34, 74,213,102, 29,204, 4, 92, 5,116,217,187, 39, 62, 42,230, 54,171,141, 42,234, 9, 31, 51,168,196,131, 28, 47,240,161, -143,223,251,212, 51,173,242,110,197,104, 27,162, 32,165,134,167,178, 5,141,212, 95,227,108,133,119, 5, 38, 12,188,141, 58, 2, -242, 56, 85, 73, 88,118,195,207,249, 84,134,219,255,206, 40,195, 97,118, 20,145,106,148, 21,136,154, 13,247,151,187, 32, 25,207, - 38, 49,117,108,152,220,138,242,145, 35,160, 69,109,167,101, 57, 94,148,109, 21,172,109, 29,183,212, 61, 11, 57,189, 46,209,106, -164, 6, 5,167, 12, 70,245,144,116,196,243, 97,129, 63, 20, 11,159, 62,247,121,112, 36,113,234,139, 83,223,188,121,115,126,118, -238,251,171, 95, 94,203,174,124,118,248,147,168, 32,236, 98, 17, 9,237, 11,130,233, 55, 11,177,169, 31,179, 63, 69,235,225,227, -151, 63,124,114,253,233,202,206,242,165, 19, 23,175, 60,250,106, 64, 30, 60, 25,159,172,217, 77, 90,142,137, 11, 43, 38,253, 96, -155,198,122,187,129,247,225,103,122,157,158,186, 54,132,166, 82, 83, 24, 11,152, 14,158,231, 65, 16,195,219,136, 41,113,189,165, -211,248,240,190,228,116, 38,151,193, 22,213, 62,111,187,188, 67,192,153,221, 19, 81,154,155,213,193, 76,155,228, 64, 18,180, 48, -211,107, 96, 71, 74, 29, 29,212,118,142, 89,174,151, 7, 66, 81,240,142, 97,241, 8, 32, 52,137,202,109,111,215,212, 77,155,176, -205,145, 34,201,208, 76,101,143, 38,197,147,187,131, 35,132, 70,215,233,149,130,118,155,171, 18,114,170, 27,100,131, 9, 57, 9, - 14, 34, 46, 71, 4, 47, 79,131, 15,221,135,235, 23, 87, 50,221,251, 33, 5, 83,109,234,218,168,114, 2,247, 23, 17,130, 45,131, - 31, 76,178,189,253,211,201, 84, 69, 47,185,216,208,205,162,137, 82,212,192,254, 35, 0, 89,215,210,219,196, 25, 69,103,198,243, -242, 99, 98,143, 1,199,128, 18, 71, 8,147,130,148,178,224, 89,169,155, 46,168,132,144,248, 21,172, 88,241, 11,104, 37,216,118, - 83,241, 18,168,170,170,110, 88,118,137, 42,177,168,130, 32,130,240,134,162, 4,168, 72,128,188, 60,118,252,152,204,196,246,120, - 62,206,189,223,152,148,214,202,194,177,199,246,188,190,123,207,125,157,163,166,169, 16,147,232, 55, 41, 91,212,159, 91,110, 36, -161,142,255,242,145, 48, 3, 15,211, 39, 95, 90,121, 85,249, 15, 98,255, 76, 39,243,191, 23, 5,205,214, 27,196,218, 19, 71, 91, -249,125,149,201, 97,146, 79,197,204, 49, 34,249, 44, 57, 71, 60, 12, 0, 52,206, 40,194, 3, 3, 55,241, 13, 68, 94, 95, 48,221, -189, 66, 2, 70, 89,203,180,136, 25, 92,229, 68,132, 80, 16,128,167, 20,109,212,221,217,242,215,153, 49,110,248, 53,236,135,178, -150,163, 27,102,203,111,224, 37,156, 65,156,187,183,203,115, 9, 9,147,194,230, 15,161,183,229, 8,165,167, 83,197,217,192,253, -125,236, 96, 89,183,180,129,208,194, 94, 44,197, 19,164,238, 76,208,143,104,176,154,233,177,177,153, 97, 10,182,131,228, 70,168, -185,144,148, 58,128, 23, 52,146,125,236,119, 45,152, 73,221,128,217,165,225,111,234,173, 37,177, 36, 34, 1, 84,181, 29,133, 17, -236,216,207, 87,174,122,158, 7, 40,247,242,217,139, 27,191,253, 26,132, 93,106, 89,165,161, 8, 34,212, 52,137,110, 12, 75,161, -127,233,242,229,191, 95,190,154,254,235,142, 91,220, 54, 14, 75,191,119, 79,165, 82,209, 17,106,165, 51, 15,103,238,157,191,112, - 17,171,229,251, 19,223, 29, 57,116,120,118,246,225,244,189,187, 41,226,241,192,122, 30,116, 35,209,167, 2, 15,214,146, 48,216, -135,115,175, 46,129, 10, 74,178, 99,231,201,234, 19,138,147,250, 96,172,122, 13,232, 65,247, 80,164, 14,240, 36,236, 10,132, 41, - 1,188, 58,119,152,227,240,202,113,126, 95,105,234,201,135, 71,248, 52,183,106,209,184, 25, 76,188,155,113,231, 62,190, 66, 96, -131, 72, 11, 17, 37,139, 42,232, 92, 15, 76,186,155,220, 76,209,107,175,193,215,178,152,198, 38, 11,169, 11, 93, 49,199,118,140, -175, 53, 87,176,206, 77,221, 60, 92, 61,242,104,126,118,188, 52,209,232,120,176,236, 68,176,159,178,195, 94, 72,249,116,183,220, -232,212,178,182,147,179,115,245,118,125,106, 98, 10,231,109,126,105,142,146,114,164,147,162,150,183,151,219,237,118,221,247,138, - 57,247,192,216,228,211,119,207,221,116, 62,236,245,154,155,141,141, 96, 67,176,238, 21,220, 0, 54,182, 82,166,147,118, 16,234, -173, 52, 62,192,106,184, 89, 55, 37, 16,183,233,114,106,241,192,238,234,219,229,215, 92,231, 84,129,144, 38, 74, 21,195, 52,222, -215, 22, 1, 2, 13,221,128, 87,184,253,228, 54,245, 50, 10, 92, 98, 10,223, 38,119,239,107, 5,205, 90,103, 29,219, 23,156,162, - 99,229, 70, 50,206,204,252,125,156,235,180,157, 65, 0, 10, 27,132,163, 35, 18,127, 88,237,148,133,155,137,169,159, 8, 99,246, -185, 31, 3,191,235,228,242,171,141,101, 30,149, 84, 71, 11,165, 77, 46, 2, 19, 49,145, 74,228, 51, 88, 41,142,157,141, 69,160, - 27,218, 87,131,212,169,139,199, 21, 61, 80, 26, 77,165, 27,208,196,132,252,235, 15, 20, 34,115, 4,174,232,135,196,130, 55, 32, -121, 83,160,153,166,251,216, 43, 91,233,130, 31, 52, 96,195, 38, 11,254,139,245,215,173,144, 26, 59,122,220, 63,195,186, 63, 48, - 42, 36,139, 12, 51,141, 43,154, 79,155,149,252,136,155,201, 25, 74,116,116,255,233, 63, 31, 7,231,166,127, 18, 15,132,247,251, -173,111,175,157, 25,117, 71,207,126,125, 34, 80,162, 78,224,235,178,233,139,218,205,244, 9,167,244,227,253, 63,222,173, 46, 45, -204, 45,222,250, 97,230,228,205,111,196, 89, 49,246, 75, 53,179,173,120,253,208,233,197,176, 38, 89,109,113,188,182,157,238,248, - 29,248, 18,211,178,125,191, 29,145,158, 53,183,136, 83,174,137, 88,176, 72,219,154, 64,155,106,155,217, 40, 34,130,129,186, 95, -199, 46,239,221, 85,125,179,252, 15,163, 55,170,177,215, 58,181,227,213, 99, 43,173,149,133,181,247,178,164,204, 98, 83, 49,219, - 98,141,175, 81, 47, 41, 12,254, 27, 59,139,184, 90,174, 46,120, 11,146,172, 16,239, 3,221, 3,173,227, 39,168,233, 80, 51, 55, -200, 31, 8,230,147,144,253,120, 9, 56,166,124,192,128, 26,137, 1, 46,183, 59,178,217, 41,150, 68, 16,169,132,231, 39, 49,154, -154, 38,251, 12,165,140,238,240, 27,152,253,149, 70,117, 88,138, 0,232,145, 52,165, 98, 26, 79,147,111, 69,146, 60, 56,102,117, -231, 88,184,217,130,223,221, 32,205, 72,250, 95, 12, 67,147, 33, 91,131,166,125, 18,128,177,179,233,109,163,138,194,240,157, 79, -207, 56, 83, 39,113,155, 56, 56,196,168, 13,109,196,135,132, 16, 44, 16, 82, 5, 98, 81,118,116,129,216,193, 15, 64, 72,176, 40, - 66, 72,101,131,216, 33,254, 68,133,144, 42, 85, 44,186,128, 61,155,210, 64, 22, 96,154, 52,106, 72, 34,218, 20,236,120,236,177, -199, 30,207,120,230,206, 29,206,123,239,184, 91,240,214,214,100,124,125,115,230, 61,247,156,243,188,102, 25, 68, 89, 57,164,250, -127,130,251,147,119,243,146,163,206,180,185,202,214,231,111, 22,236, 63, 94,115,116, 33, 69,118,249,192,153, 99,232, 97,164, 11, - 98,184,145,137, 68, 29, 22,145, 22,163,223,149,116,103, 73, 28, 99,186, 3, 2,109,172, 34, 2,230,212,225,240,137, 26, 58,250, -242, 81,236, 44,148,237,225, 48, 26,168,108, 64, 57,223, 57,150,251,201,213,143,190,254,254, 27,202,145, 13, 12,151, 50, 89,190, -200,231,220, 83, 49,141, 6, 76,166, 79,221,225,227, 94,216,149, 94,136, 42, 1,192, 39,161,106, 37,255, 18, 92,126,116,236, 88, -191,237, 14,158,223, 92,209, 44, 10,197, 66,218,221,225,249, 12, 37, 88, 86,151, 53,145,241, 81,156,151,127,159,149, 60,100, 52, -147, 40, 50, 36,206,247,237, 41,252,189, 57,134,155, 13, 33, 63,165,225,164, 32, 7,176,225,159,211, 96,101,121, 41,141,249,103, -215, 62, 31,134, 99,196, 65,189, 0, 69,192, 32,245,100,200,161, 69, 73, 10, 34,149, 54,227,253, 94, 16,244,253, 95,119,182, 81, -150,128, 47,184,112, 42,206, 83,107,141,245,141, 86,251,143,123, 85,219,186,180,217,188,254,229, 23,204,108,188,241,230,229,135, - 31, 31,159, 6, 62,221, 66, 52,205,149, 53,176, 65, 97, 20,103,234,232,234,197,190,130, 1,167,129,210, 49, 60,224,138, 56,197, - 92,107,197,102,174, 3, 63,147, 25,114,117,220, 42, 23,168, 33,147, 34,194,253,160,118, 2,153,146,240, 98,148, 71,251,157,223, -233,199,171, 56,149, 56,201,159, 93,219, 58,238, 30, 69, 73, 68,129, 44,133,147, 28, 39,193,174,108, 11, 92,138,157,210,228, 33, -156, 12,117,221, 28, 76,124,250,103, 33, 81, 60,138, 3, 90,126,199, 6,255,108,198,209, 5,136,250,191, 16, 31,188,245,254,237, -187,183, 87,235,171, 71,189,131, 37, 24,144,178,179,222,185,238,176,243,238,235,239,125,247,211,183, 54,170,187,130,100,145, 14, -219, 54,207,115,189, 61, 32, 10, 56,105,231,120, 54, 13,163,209, 52,137,159,107, 93,218, 57,152,156,248, 39, 36,232,234,181,122, -251,209,189, 70,173,209, 11,251,158,189, 16, 3,107, 12, 86, 31, 73,236, 23, 91, 47,220,127,180,103,234, 6, 93,100,193,114, 40, -238,147,226,166,212,141,196, 65, 14,168, 97,145,114,110, 90, 22,143,147,141, 70,171, 55,246, 73,176,175,215, 55,232,145, 99,154, - 86,251,176,189,232,158, 73, 41,229, 47, 50, 90,132,115, 75,107,195, 40,240, 3,159,118,132,231, 46, 95, 88,125,122,231,176, 77, -123,248,237, 87,175,132,201,248,238,238,118, 21,180, 53,240,121,178, 44, 51,165,189,139,231,156, 33,245,119,232, 31,231,209,200, -171, 46,218,172, 24, 70,180, 36,113,179,190,238,143,251,156, 39,157,160, 35,251,117, 11, 73,109, 42,108,203, 73, 51,202, 78,234, - 97,148,200, 35, 8, 89, 22,167,109,238,152, 20,115,228, 17,188,146,221, 12,204, 39,198,141, 92,130, 11,159,180, 30,104,250,140, - 79, 70,131, 32, 21,250,249, 5,207,207, 78, 73,157,206,184, 58,147, 41,241, 46, 66,169,219,210, 60,153,182, 68, 17, 38,169,109, - 1,127,255,243,254, 15,181, 42,187,245,242, 87,236, 21,118,227,195, 31,255,202, 6,215,182,174,246,211, 97,154,171, 62,159,121, -207,182, 38, 6,124,244,206,198, 75,159,118,183,217, 29,113,229,242,107,236, 38, 99, 61,246, 76,117,115, 63,125, 24, 9, 73,247, -147,156, 75, 56,188,175,157,223, 61,108, 83, 82,213, 58,219,220,139, 39, 74,184,107, 10, 3,171, 6,113,241,204,208,234,176,205, -227,203,181,149, 7,221, 63,155,203,235, 39,131,199,199,157, 35, 6, 75, 60,147, 52, 63, 45, 59,173,255, 47, 7, 59, 10,155, 93, -182, 0, 50,165,181,153, 99,161,207, 61, 75,102,106,212, 75, 70, 48,213,245,129,175,124,255,239,125,183, 2, 63,122, 64,144,228, -252,232, 86,243,226,157, 7,125, 90,202, 69,135,182, 74, 44,202,222, 22, 57, 21, 34,175,206,193,130,136,233, 18,166,129,208,221, - 11,123, 50,173, 4, 0, 18,140, 22,137, 75,171,227,196, 41,171,185, 30, 37, 25,121,150, 43,115,236,121,141, 19, 58, 84,181,167, -171, 64,183,232,214,102, 89, 58,129,167,246,220,238, 91,113, 98, 52,181, 2, 69,128,186, 35,116,182,144,195,178, 42,178,146, 78, - 37, 57,114, 58, 70,178,248,175, 0,132, 93,201,110,211, 80, 20,181,147, 56, 99, 83, 59,166, 77,210,132,161, 5, 85,180, 42, 66, -101, 6, 9,104,133,144, 0,193, 2,137, 37,136, 61, 18, 31,192,150,223, 64, 44,216,178,101, 11,130, 14, 8,150,136,161, 42,106, - 81, 11,129,130,154,198,129,212,177, 99, 63, 79,220,243,158, 91, 84, 88,144,172, 18, 69,242, 16,191,251,206, 61,247,222,115, 98, -254, 61,220,201,157, 68, 59,164, 8,254,255,218,210,135,150,165,191,168,250,127, 94,219, 94,188,242,142, 76, 96,187,246, 26, 31, - 81, 47,232, 61,102, 19,204,193, 76, 26, 64, 3,163,148, 92, 24, 42,161,198,205, 61, 18,163,152,152,199,161,124,174,247, 27,241, - 62, 21,174, 4, 16,186,129, 27,223,177,120,159,194, 72,216,252,194, 75,104, 62,114, 15, 79,250,134, 34,160, 22, 87, 86, 19, 62, -186,170,165,248, 46, 65,134, 66,138, 69,236, 68,137, 35, 1,155,196, 32,164, 69,237,236, 29, 24,193,156, 20,220,247, 2,215,246, - 39,119, 15,168, 16, 98, 6, 10, 38,132,232,241,134, 77,250,227,184,146,105,130, 62, 50, 58, 21,134,160,201,160,129, 22, 49, 46, -102, 47,182,228,228,150, 68, 47,116, 80,124,153,193, 60, 28, 68, 1,191, 77, 49, 48,152,158, 58,251,124,230, 5, 97, 38,184,215, -242,132, 20,250,195, 78,224,185,161, 7, 53, 23,176,130,174,235, 53, 86, 86,141, 86,171,103, 89,197,190, 66,158,146,145, 98, 54, -151, 77,210,154,239, 89,235,125,121, 41,147,199,233,239,175,215,250,251,146,175,230,102,230,230, 95, 59,110,228,123,176, 24,142, -120,206, 65,215,153, 67, 95, 60, 88,142, 44, 4,109, 48,179,154, 81, 32,235, 72,135,240, 56,217,198,221, 38, 65,197,248, 62, 72, - 93,151, 1,185, 67, 82, 16, 11,141, 43,209, 11,135, 72, 60,245,161, 18,160, 72,131,166,121,207,105,163, 69,140,206, 53, 40, 96, - 30, 71, 37,228, 78,113,187, 82,170, 81, 84, 50,186, 77,173,176,203,216,108,166,211,153,138, 54,148, 77,101,221,128, 13,233,149, -195,195,147, 63,218,223,185,175, 58,182,216,225,193, 17, 10,109,195,213,125, 31, 86,223,127,105,126,246, 96,196,163, 12,151, 71, -218,102,115,114,255, 17, 10,223,179, 11,179,140, 57, 90, 65, 63, 58,122,242,214,133,155,239, 86,223,209, 46,249,173,245, 53, 8, - 2,181, 79, 39, 24,149,150, 21,130, 57, 63, 77, 99,177,177,168, 23,117,199,181, 8, 56, 91, 14, 42,174, 87, 79, 94, 54, 58, 29, -173,168,209,205, 82,243,253, 7,106,163,191, 76,200, 19,210,147, 48, 88, 44,159, 30, 59,245,195, 88,211, 74,131, 73, 69, 89,249, -182, 20, 32,102,165,234,165,218,245,211, 87, 10,123,170,165, 40,243,101,163, 65,143, 19,236,244, 48,113,234,210,137, 53, 59,173, - 51,227,167,166, 39,167, 58,129,223,220,248, 94,213,202,131,106,153, 64,232,212,237, 27,198,210,218,250,230, 70, 2,174, 61,142, -101,155, 31, 27, 75,180,248,134,244, 58, 37,142,163, 67, 7, 44,215, 46, 23, 7, 40,170,182, 58,173,146,170,195, 83, 34,153,236, -185,189, 74,169,138,102, 56, 69,161,236, 91, 43,150,218,102, 27, 22,199,129, 79,169,219,120,125,188,109, 26,188, 82, 77,121,100, - 7,234,147, 9,121, 76,201,237,190, 88,131,219, 53, 34,187, 96, 50, 57,142, 17,224, 46, 12,147,113,113, 21,133, 75,194,227,178, -151,238, 70,227, 25, 37, 87, 85,164, 98,170,181,108,174,109,246,208,142,237,137,198, 2,196,135,128,203,149,242,137, 22,161, 47, - 46, 67,237, 43, 37,166, 58, 40,135,145, 37, 59,253,166,249,248,201,131,183,207,142, 85, 15,141,237,170,119, 24,119, 20,145,132, -113, 55,252, 9,184, 82,135, 60,166,238,121,180,252,244,218,190,227,245, 75, 7,239, 63,188,127,183,114,239,229,175,217, 69,246, -233,206,196, 52,101, 30,166,211,147,185,227,207,198,207,117,112,214,114,136,158, 43,148, 16, 34, 78, 51,133,116,201, 21,173, 74, -113, 77, 56, 1,117,153,109, 58,166,209,109,211,111, 44, 6,217, 6, 17, 25,250, 11, 42,242, 63,192, 55,137,114,181, 92, 42, 99, - 49, 59, 20,243, 27, 82,200, 69,252, 9,254,123, 92,219,174, 43,197, 87, 36, 24,100, 17,228, 1,174, 79,140, 66,190,130,227,106, - 16, 89, 13, 99,173, 63,175, 18, 10, 65, 29, 94, 22,230,179, 80,206,175,234,117,211,234,136,240,119,110,226,252,231,230,138,208, -192,220,106,110, 12,163,120, 32, 28, 7,112,225, 60,234, 89,172, 23,242, 22,146, 63, 64, 90,138,253,153,163,173,177, 76,122,219, -158,141,190, 44, 72,150, 74,193,182,183,202, 14, 54,132,239,206, 65, 36,140,186,249, 90, 65, 43, 10,212,225,225, 61,161,252, 22, -128,172,107,233,105,227, 10,163,243,240, 60, 60, 99,140, 31,137, 49,193, 38, 74, 42,161, 42, 69,149, 18, 54,109,164,168,149,218, - 69, 23,149,154,110,194, 47,232,162, 93, 85, 73,254, 64,164,254,151,172,179,200, 31,168, 80, 90, 26, 22,125, 36, 4,136,192,194, - 56,197,140,103,240,216, 51,158,183,125,251,125,223, 29, 83,148,176, 2, 3,134,153,123,231,220,243,189,206,201,241, 61, 19,254, - 23,153, 97,151,232,187, 42,104,211,121,115, 36,251, 32, 63,243, 30,154,179,203,128,253,193,207, 94,204, 97,173, 45,223,178, 49, -225, 46,136,239,191,141, 56, 15, 38,102,176,108, 5, 81, 73,178,100,150,167, 80, 16,193,231,137, 32,222,157,137, 44, 30, 2,243, - 4, 75,216, 44, 23, 25,227,234, 50, 84, 26, 43,208,222, 67,192,101,228,152,142,119,109, 70, 98,234, 98, 74,211,101,168, 14,150, - 77,195,200,159,205, 39, 7,216,165, 43,231,132, 37, 47, 61, 11,172, 92,172,197,104, 4, 35,233,154,233,248, 3, 69,194, 71,167, -108,212,135,193,104,183,103, 15,189,212, 20, 10, 21, 85,185, 89, 45, 27,178, 82, 45,168,166, 68,114, 94,196,127, 82, 66,106,120, -138,100,106,251, 50, 20, 25,101,191,240, 80, 39, 96,229,127, 12,130, 56, 52,252, 20, 84, 89, 84,200,173,163, 8,220,171, 40, 1, -102,245, 58, 29,199, 57,167,137, 9,248,146, 37,209, 20,194,234, 48,201, 66,248,135,162,116, 18,199,158,159,165,217,244,204,114, -123,167, 22, 28, 36, 64,255,163, 24, 14, 0, 68,127,145, 21,208,244,134,187,230, 6,209,206,246,139,231,207,159,109,239,108,107, - 42, 43, 25, 36, 88, 64,223, 35, 93, 55, 70,210, 52,124,142,130, 41,138,204, 37,248,177, 13, 21,182, 1, 78,160, 97,155, 16,132, - 38, 8,247, 92,113,126,134, 50, 75, 69, 21,189, 68,203, 26,106,100, 26,154, 84, 82,209,213, 4, 54, 85,232,163,108,220,106,253, - 6, 80,239, 90,169, 41, 98,107, 93, 54, 10, 92,108,110,161, 37,138,210, 8, 66,233,113,128,122,235,147,208,103,100,118,227,134, - 35, 67,209,173,161,101,251,206,181,202,242, 8, 13,136,101,136,204,206, 39, 67, 47,112,179, 41, 59, 30,116,238,223,253, 14, 7, -208,103,204,241,172,143,154, 31,119,250,157,191,187,127, 37,179,184,128,162,152,234, 97,255,237,239,251,219, 73, 18, 55,171, 77, -165,160,160,161,146,177,112,116,122, 8, 20,161, 93,191,254,227,253,159,182,254,249, 21,229, 71, 68, 73, 47, 20, 57, 39,220, 61, -126, 3,159, 12,253, 1, 92,120,156,134, 3,183, 95, 47,227,220, 41,192, 0,240,241,206,233, 81, 24, 5,186,172,106,240, 43,178, - 14, 44,161,125,101, 5,222,124,235,213,214,105,247, 24,216,189, 53,178,214, 90,107,155,247,190, 63,248,247,109, 99,177, 17, 37, - 97,101,161,246,199,193,142,237, 88,214,160,183, 82,111,117,237,222,167,119, 62,239,159,189,211,237,108,239,221, 94, 66,204, 24, -150,236,250,210, 42,128,227, 56,242,191, 90,255,226,117,119, 23,238,177,235,187,186,102,216, 99,187,177,120, 53,202,146, 40,141, -151, 22,151, 32,228,183,198,103,240,250,230,183, 63,172,148,106, 47, 15,118,106, 11,245,199, 15, 30,253,246,234, 5,128, 58,185, -205, 69, 11,232, 36,229,163,105, 11, 4, 92,146,240,153, 97, 86,190,105,230,153, 87,192,119,105, 94,174, 99,100,205, 65, 52, 73, -164, 81,181,148,164,147,208,115, 62, 84,154,250,185,199,142,118,221, 19,123, 18,163, 76, 32, 25,111, 50, 74, 53, 8,185,164,176, - 64,237,231,136,236, 36,133, 45,163,235, 36, 58,222,201, 10,138,114,235,153,146,110,180, 43,183,107,141, 44,213,134,113,114,165, -114, 53,142, 35,116, 42, 39, 51,111,172,100, 9, 98, 85, 55,158,238,191,108,148,155, 95, 62,252,250,201, 47, 79, 54,107, 63,159, - 76,247,183,130, 63, 31, 92,219,232,163,151, 3,117,115, 75,121, 18, 22,207, 34,210,122,169,150,170,139,102,197, 15,124,192, 41, -224, 10,176,119,111, 46,223, 56,115, 29, 78, 90,205, 98, 73,215, 52, 63,158,112, 58,134,182,227, 9,214, 90, 97,197,225, 26,198, -161,231,197,147, 86,189,101, 20,205, 32, 9,111,181, 62,193,137,185, 17,218,131,164, 44,195,249, 71,137, 59,155,210,230, 23,115, -187,123,184, 43, 93,187,139, 58, 43,116,171, 40,135,131,221,122, 49,245,219, 80, 22,152, 11, 46, 78,201,211, 21, 94, 68, 99, 16, -199, 27,134, 73, 72, 39, 25, 14, 8,182,235,109,110,104, 51,227,165, 69,146,114, 35,151, 91,129,123, 52,241, 15,137, 55, 21,210, -202,148,180,146, 89, 52,225, 80,207, 93,175,243, 49,124,222, 83, 78,205, 63,146,116,129,197,162,144, 87,156,197,139,210, 37, 62, -211,128, 33,234,250,234,186,227, 57,255, 9,192,214,149,244, 54, 13, 6, 81,219,177, 63,175,177,147, 38, 93, 40,208, 37, 8, 65, - 11, 20, 84,202,165,136, 11, 66, 85,225,192, 25,113,225,128,132,132, 56,240, 27,250, 7,248, 41, 72,220,185, 85, 85,145, 56,128, - 64,136,110,162,123,146,182,113,221, 44,118, 18,215,142,153, 25,219, 21, 21, 85, 43,245,146, 58,222,190, 55, 51,223,188, 55, 47, -193,247, 48, 37, 65,158, 65, 28,169,105,185, 11,193,253, 66,136,135, 51, 27,210, 6,220, 83, 28,177, 38, 9, 50, 77, 37,251,135, - 37,147,162, 57, 28, 14,240,113,192, 24,242,252, 86,124,217,255,101,250,105,164, 75,168,153,220,249,238,108,207,148, 45,159,114, -109, 52,103, 73, 43, 42,244,233, 22, 25,118,138,226,123,164, 24, 5, 3, 13, 37, 70,250, 75,142,103, 39,140, 43, 20,108,226,204, - 27,200, 28,209, 75,179,211, 64,162, 44,128, 23,209,252,179,170,233, 39, 13,116,254, 92, 11,129, 79,100,173, 52,100, 85, 32,193, - 49,206,198,241,195, 46, 14,107,141,248,137,225,153,178,115, 84,110,184, 91, 71,206,239, 74,115,223,110, 4, 0, 19, 93, 56,199, -208,100,170, 37, 10,151,116,101, 56,171,228, 69,169,136,174,139, 2,173, 42,142, 33,109, 3,190,191,151,193, 45, 23, 28,123, 0, - 39,174, 50,136, 31,156,138,187,175, 17,110,124, 3,196, 75,194, 73,253, 56,150,177,201, 0,250, 74,148,213,112, 76,183, 46, 73, - 89, 69,210,228,140,169,200, 56, 81, 82,103,150,206,250, 76,156, 45,163, 67, 97, 15,255, 27,139,110,105,122, 18, 73, 94, 57,116, -209,149,201,168, 16,126,120, 17, 89,207, 1,117,216, 2, 84,131,136, 52,158, 3,160, 89, 81,120, 93,147, 24,185, 80, 97,173,135, - 74, 75, 78, 86, 4, 93,133, 95,236,170,105,170, 96, 89, 66,222,144, 52, 61, 99,232,162,174, 98,152,232,161,118,191,231,119,184, -118,187, 23,249, 92,208, 60,141,181,114, 94, 27,197,135,110,167,105,106, 57, 67,205,118,124, 87, 72, 88, 15,128, 14,106,213, 41, -247,155, 3, 7,199,229,216, 54, 51,118, 13,131, 63,147, 35, 83, 76,144,118,237, 77,133, 41, 40,107,136,162,183, 79,223, 45,175, - 44,121,167,174,198,180,141,189,117, 72,130, 0, 88, 35, 36,123, 84,225,152,128,119,163,197,146,221,172,121, 62,206,252,131,207, - 0,128, 2, 74, 14, 23, 46,223, 29,191, 13, 75,189,225, 54,187, 65,183,234, 84, 62, 45,125,156,155,158,223, 58,220,154,189, 49, -187, 93, 67, 79, 6, 83,193, 91,136,202, 38,114, 79,133, 24,163, 48,180, 10,184, 54, 56,254,230,233,235,149,157,213,233,235, 51, -168,201, 96, 50, 20,226,240, 21,144, 41,247,155, 5,183, 83,135,115,131,195, 86,235, 21,120,217,246,237,242,222,225, 46,164,237, -213,147, 3, 72,244,160,188,187, 95,186, 7,151,147, 51,172, 19,180,115,106,172,173,253,124,246, 96,110,121,245, 43, 4,232,137, -145, 91, 99,197, 49,200, 58,247,236,138,135,218,153,128,137,162,227,214,115,122,126,180,120,165,152, 43,148,237, 50,156,179, 79, - 76,176,150,219,108, 7, 29, 40,209, 96,197, 46,126,251, 12,161, 8,110, 95,171,211,250,254,231, 7, 10, 30,225,181, 12,130,201, -145,155,187,181, 29,120,141,135,242, 87,187, 65, 29, 39,127, 24, 3,214,227, 34, 39,161, 48, 53,182, 92, 74, 55, 80, 9,226,169, - 92,207, 16,134, 97, 50, 11, 1,155, 63, 93,117,182,126, 57,219, 27,142, 83,111, 7, 1, 70, 1,106,225,162,104,143,192,153, 56, -233,240,242, 48, 68,118, 81, 99,146,193, 68, 67,150,117,198,208, 10, 0,138, 67,242, 39,160, 96, 18,182,184,154,192, 59, 83,197, - 41,171,111,252,192,222, 70, 30, 44,174,180,120,112, 58, 63,168, 90, 75,219,107, 30,207,191,124,255, 98, 97,225,195, 67,253,121, -157,223, 92,116,191,188, 42, 61,106,135, 45, 62, 29, 89, 76, 25,107, 47,103,228, 36,156, 21,138,114, 83,184,234,128, 10, 91,120, -148,134, 98, 66,241, 80,107,213, 34,116, 85, 13,243,217, 62,120, 22, 62, 18,181, 41, 19,167,156, 16,214,235,177,123, 12,145, 47, - 68, 10, 91,128, 29, 26,220,235,240,202, 39,251,181,102, 13,175, 13,189, 37,178, 94,183,157,216, 29,113,177,134,171, 71, 91, 36, - 66,226, 88, 40,196,174, 40,200,218, 58,106, 30,242, 81, 38,222, 56, 72,186,213,116,103,195,152,212, 72,148,113,226,239, 97,251, -138,156,176, 57,175,221, 34, 3,203,116,255, 57,158, 58,150, 12, 65,193,111, 41,104,125,216,218,229,207, 30, 15, 36,218, 33, 36, - 0, 1, 45,132, 94, 58,154, 82, 99, 6,148, 64, 79,238,204,175, 87,214,104, 30,112,218,120,229, 18,123,166, 51,116, 71, 78, 36, -178,242,253,125,123, 15,162,194, 95, 1,232,186,150,158, 38,162, 40, 60,247,222, 97,166,143, 97,250, 16, 16,144, 90,197, 16,208, - 64, 66, 64,220,232,198,141,107,247,174, 92,153,248, 23,220,186,208,157,191,194,196,157,137, 27, 55, 26,216,104, 66, 92,160, 18, -162, 64,128, 86, 69,104, 43,175, 9,125,204,148,185,158,239,220, 22, 95, 49, 97,217,208,219,121,220,123,206,249, 94,192, 87, 33, -248,180, 76, 95,243,171,252, 63,249,115,239, 62,221,239,244,127,134, 51,250,159,177,140,248, 27,140, 61, 61,147,255, 48, 57,248, -189, 9,144,191,225,174,242, 63,179,160,238, 34,165,236, 2, 6,178, 11, 0, 72,115,217, 48, 8,199, 15,118,109,218, 18, 17,146, -171,184,108,215,124, 25, 88,187, 12,185,141,161,239, 97,118,169, 28, 47,153,173, 81,137, 4,182,126,147, 1,180, 95,122, 43,101, - 78, 75, 41,115,112,173, 3, 90, 66, 47, 82, 91, 68,105, 59,145,114,211,105, 55, 77, 15, 37,109,216,142,114,135, 50,133,111,193, - 6, 61,199,218,128, 28, 28,153, 64,207, 53, 85, 72,147,131, 87, 43,193,186,109, 71,249, 84, 10, 27,186,208,169,164,114,225, 57, -140,178, 40,160,211, 0, 78,246,192,101, 34,234,224, 0,103,177, 83, 6,187,116, 59,204, 54, 87, 74,133,237,152,253, 75, 37,214, -224, 0,235, 84, 72,151,101,160,133,107,158,216,106,155,213, 82,125,173,184,155,238, 56, 19, 73,173,108,201, 30,116,130,117,184, -104, 99, 16, 13,200,243, 25,227,172, 13, 43,107,205,140, 95,205,201,215, 14,140,116,192,141, 4, 68,204, 68, 73, 54, 91,118, 57, -143,153,185,186,241,113,221,170,115,230, 57, 27, 64,139,136,195,143, 29, 97, 57, 90, 7,123,170, 25, 91,251,152, 63,210, 57,228, - 83,121, 30, 35,219,190, 1, 65, 50, 22,209,211, 62,105, 9,182, 10, 72, 56,238, 96,118,248,107,173, 84,232, 43, 86,131,154,197, -100,204,132,219, 27,134,245,172,151,163, 51, 96, 63,168,156,241,251,169, 9,136, 57,140,184, 7,140,102, 53,146, 59,151,114, 83, -229,106,169,109,233,115,185,225,245,237, 85, 90,195,232,208,120, 24, 53,168, 4,166, 15,123,137,116,189, 85, 47, 12, 92,220,218, -133,172,127,170, 56, 21, 52,130,126,191,239,250,229,185,167,243,207,252,148,255,165, 90,166, 42,137, 94,104,186, 22,103,179, 3, -212, 39, 69, 58, 62, 60,218, 67, 57,118, 18,209, 77,188,123,251,222,252,219,151, 74, 11,140,221,165,172, 28,236,230,146,153, 76, -218,223,253,241,157,238,198,236,165,105,218,206, 60, 55,181,184,246,110,180,191,184,189,183,227, 39, 61,186,216,183,102,110,190, - 89, 89,220,216,217,240,210,112, 22,227,216,101, 70,202, 80, 22,168,190, 76,159, 99,187,165,234, 6,221,181,185,177,233,149,210, -106,216,166, 39,167, 39,231,101,242,153,129,229,210,135,153,209,217,247,165,143, 55,174, 92,123,181,180,192,121,114, 54, 85,215, - 73,142,228,166,155,113,225,108,113,115,119,107, 98,100, 98,109,251,179, 45, 93, 86, 26, 65, 12,236, 33, 49, 46,118, 16,174, 39, -243,126,246,160, 85,187,147,191,112,254,225,152,229, 9,248,207, 28, 55,172,136, 33,214, 70, 4, 39,185, 70,136,191,227,208,170, - 71,113, 51,132,162,164,133, 32,154,231, 75,229, 74, 0,176,200,184, 12, 73, 46, 47,149, 0,225,146,179, 96, 56, 60, 23,246,130, - 32, 26, 8,142, 14, 6,115,204, 68, 71,219,194, 24,129, 1, 13,130, 18,138, 90,199, 86, 94, 14,215,131,243,251,113, 59,193,105, -196,112,219,131, 67,159, 24,239, 45, 60, 90,124,177, 89,139,151,154, 11,131, 98,236,254,200,195,186,251,233,241,246,147,215,183, - 30,212, 26, 85,163, 99, 55,185, 53, 33, 67,249,204,206,196,219,224, 37,122,171, 65,213, 48,225,169,165, 99, 29, 33,102, 31,144, - 10,129,243,118, 98, 90, 13, 38,163,232,216, 48, 14, 45,118,136,229,241, 55, 91, 55,114, 47,194,196,106,102, 88,199,186,131,141, -117, 4, 83,173,168, 53, 89,156, 92, 46,175, 80,127, 96,144, 80,124, 7,254,137,149,113,253, 35, 36,105,168, 22, 52,146,172, 13, -138,145,138,102,190,202,140, 83,248,132, 48, 99, 20,102,181,136,174, 97,173,109,113,186,104, 39, 71,197,184, 16,119, 74, 71, 45, - 79, 67,248, 76,198, 22,143,244, 5,255, 52,214,232,243,190,230, 8,247,176,121, 64,101, 25, 32, 13,197,240, 30,215,182,116, 62, - 29, 53, 64, 30, 75, 67,214,103, 1, 64, 50,195, 38,169,169,252, 11,163,230, 79, 1,216,186,150,157,166,162, 40,218,123, 79,239, -243,180,189, 5,164,136,162, 1,140, 70,226, 35, 26,140, 26, 7,134,200,192, 31,112, 96,140, 81, 7, 78,253, 0,227, 68,127, 67, - 63, 8, 13, 17, 38,198, 0, 21,131,202, 35,165, 64, 95,247,253,116,239,125, 14, 84, 19,146, 14, 58,104,111,155,123,207, 89,103, -237,215, 90,146,191, 39,146, 41,159, 2,238,134,106, 96,105,177, 24,126,192,196,181,133,119,229,234,217, 57, 56, 66,149, 33, 88, -255,247, 58,181, 36,171, 74,134, 14,172,217,204,255,175,221, 42,195, 19,162, 40,147,100,110,113, 90,153, 86,156, 83,101, 85,230, -174, 79, 20,234,149,147,120, 70,100,190,168,130, 14,108, 2,194,186, 8,130,181, 92,198, 67, 98, 92, 87, 92, 25,150, 40,144, 47, - 63,242,178, 60,134, 19, 18, 8,102, 16,249, 98, 62, 14,104,160, 16,203, 71, 69, 4,140,119, 52,199, 26, 65, 99, 63,165,244,246, -201,187,230,206, 38, 73, 35,164,186, 6, 55, 71, 11,224, 10,192, 85,227,192,100, 53,224, 89, 98, 54, 75, 65,147, 83,184,136, 6, - 60,185,227, 29, 28,185,221, 94, 16,236,118,221, 67, 47,109,187,236,119,103,240,171,235,109,180,188,221,158,246,167,219,119, 35, - 64,198, 10,203,185,215, 15,181,172, 52,194,180,134,165, 3,188, 85,138, 18, 7,174, 29,167, 26,101, 1, 45,134,118,134,104, 84, -174,146,173, 67,138,105, 81,192,187,106, 69, 1,226,143, 54,129,212, 44,134,242, 38,122, 78,201,244, 66,163,153, 16, 83,101,176, - 69, 18,216,201, 17, 58, 18, 98,155, 56, 57,246,145, 11, 47, 22, 87,147,172,132,231, 18,170,249,203,222,170, 56, 37,157,153, 18, -139, 16,202, 83,223, 47, 69, 94, 30, 70,121, 16,230, 97,136, 46,131, 88,196,198, 60, 24, 54,140, 2,178,192, 15,217,170, 50,201, -141, 65, 55,235, 6,106, 63, 56,194,158,156, 20,157, 43, 80, 64,148,122,106, 85, 86, 46,104,152, 0,162,155,138, 85,195,145,141, - 52, 9,147,216,177, 71, 15, 7,109,161,149,103,106, 28, 78, 97,199,174,145,118, 5,240,113,195,210,172,170,229, 88,166,141, 79, - 42, 77,159, 45, 60,229, 58,255,178,177,124,127,238, 1, 96, 34, 28, 89,110,216, 55, 13, 27,246, 63,112, 49,122,154,217,243, 23, - 47,191,174, 44,163, 75, 3,134, 75, 41,160,179,161,235,223,183,191, 45,173,125, 38,113,240, 16,246, 38,144, 78,136,225,252,208, -197,226,103,255, 64, 43, 27,131,160, 7,207,113,166, 49, 29,198,225,214,206,143,137,234,248, 86,107, 11,162, 64, 13, 91, 84, 20, - 8,255,227, 56, 0, 52, 49,116, 0, 44, 6,212, 30,147, 75, 10,155,158,184, 8, 31, 3, 22,230, 6,110, 19,190, 53, 50,177,223, -111,199,121, 74,129,118, 5,246, 9, 64, 70,171,187,111, 24, 16,190,153,119,175,220, 89,223, 94,135,213,117,126,108,170,110, 59, -135, 88, 79, 46,194, 36, 0,110,184,120,125, 97,115,175, 25, 70, 65,171,179,255,248,246, 34, 64, 57,122,149,152,252,230,244, 13, -248,255,176,216,184,201, 97, 51, 3, 80,194,249,132, 74, 56,121, 10,119,105,166, 49,147, 36, 49,154, 38,178,178,195, 71,235,124, - 60, 76,221,249, 51,243,252, 94, 86,114, 24,197,110,249,241,158, 44,228, 27, 17,211, 17,184, 41,164,100, 99,233,108,109,167,215, - 11, 18, 89,125, 68, 94,129,235, 10, 3, 61,134,115, 27, 56, 54, 65, 14, 89,186,138,247,162,140, 10,193,104, 63,160, 51,114, 14, -192, 30,174, 82, 89,145, 78, 74,148,226, 83, 19,165, 55,105, 55,120,245,178, 27,116, 24,105,172, 11, 35, 67,174, 27,205,206,222, -207,182,247,230,253,235,143, 31, 62, 77,153,215, 10,173,191,228,175,188,186,244, 48,201, 61, 49,226, 34, 89,156,212,177, 34,145, - 19, 20,138, 73,102,207,205,246,252, 1,205,150, 23,244,223, 17,135,184, 89,197,220, 58,193, 69, 42,114, 25, 2,116, 73,166, 80, - 0, 56,185, 65, 8, 74,141,124,176,144, 25, 89,156, 98,167, 94,154, 66,136,144,215,237,250,163, 91, 11,171,155,171,138, 42,155, -101,143,105,107,225, 69, 62,121, 13,145, 70,173,136,140,137,193,115,189, 18,147, 36,175,204,224,203, 42, 71,241, 47, 22,138,172, -128,236,245, 64,155,160, 26, 94, 36,207,167,198, 46,120,241, 64, 80, 95,135, 59, 38, 51, 13, 3,187, 1, 17,184,237, 42, 22, 5, -233,183, 50,108, 97,138,105,168, 74,149,103,132, 50, 12,198,196,140, 43,185, 6,162, 66, 34, 32, 21, 90,120,167, 9, 90,215,102, -201, 95, 1,248,186,150,213, 38,162, 48, 60,247,204, 37,153,180,147, 72, 59,109,189,208, 88, 11,138,224,198,133,160,130,130, 11, - 31, 65,151,174,117,229, 78,112,227, 83,184,240, 21, 92,248, 8,162,104, 81, 80, 20,169, 86,109,189,165,182,166, 77,167,185, 76, -230,146,153, 51,254,223, 57, 73, 13,130,118,213, 66, 18,210,228,156,239,252,231,255,191,203, 65,255,157,201, 19,125,231,201,202, - 61,195, 14, 97,147,245,120,198, 37,202,244, 67,224,254,159,142,205, 63,170,239,131,122,255, 96, 38, 60,217,184,151, 71, 67, 2, - 60,138, 77,246,195,229,191, 26, 56, 66, 41, 54,158, 59, 23, 19,183,129,145, 80,149, 43, 32,192, 0,132,235, 50, 70,150,182, 81, - 65, 40,183,196,120,120, 22,166, 61,150,102, 14,134, 49,125,172, 73, 30,211,195, 0,223,252, 93,129,250,194,114,186,167, 35,206, - 9,236, 36, 44, 3, 2, 14, 25,168,154, 61, 89,125,220,139,193,250,162,149, 79, 79, 49, 53, 83,146, 52, 7,103, 67, 95, 83, 75, -237,254, 14,173,255, 20,145,152, 80,193,193,252, 72,117,145,215,147, 70,183,174,223,121,249,246,185,141,111, 55,201,216,128, 49, -157, 22,200,145,250,137,173,206,102,111, 56,252,213, 31,108,133,221, 66, 63,212, 28,236,181,210,172, 25,198, 63,187, 9,196,233, - 4,121,146, 82,146,101,215, 80,235,166, 94,183, 74,117,179, 52, 69,191,219,165, 74, 73,153,114, 84,203, 40, 12,218,196,130, 28, -193,253, 6, 50, 80,216,152,136,113, 40,113, 31, 52, 78, 49, 42,168,234,183, 45,197,113,232, 90, 42, 91,150, 98,232,146,165,171, - 54,154, 66,136,244,171,152,138, 37, 20,165, 84, 96,243, 44,113, 80,129,248, 49, 25,209,193, 16,179, 36,205,251, 4, 99, 97,158, -166,176,174,148,184,205,189,165, 41, 86, 73,166,178,189,108, 72, 71, 29,107,189,185,255, 37,232,197, 89,136,203, 8,207, 38, 84, - 97, 27,128,238,161, 12,238, 16, 29,126,153,239,205,215,221,218, 78,176,205, 10,161, 70, 41, 16, 71,160, 80, 49, 50,165,242, 45, - 48, 28, 70,170,106, 92,187,124,109,101,245,169,176, 33, 11,122, 59,220, 21, 86,166,143,116,101,109,133,243, 57,243,173, 96, 51, - 73, 98, 42,183, 79, 29, 59,189,219,105,193,100, 56,220, 3,134,228, 57,129,187,107, 87,227,116,112,172,209,184,112,246,210,250, -215, 79,180, 96, 42,102,149, 54,120,173,236, 65,100,148,192,185, 8,101, 47, 29, 30,244,200, 44,158,247,252,253,238, 46, 33, 17, -225, 5,189, 14,221, 57, 90,221, 22,253,239, 75,115,141,153,105,127,121,126,233,219,246, 23, 93, 85, 47,158,188,112,216,155,249, -240, 99,205,208, 84,191,234,151, 45,155, 78,110, 91,183,206,159,187,186,241,109, 53,197, 24, 92, 63, 90, 63,178,219,105,195,226, - 49,234, 17,142,127,220, 90,243,167,231,250, 81,247,202,153, 75, 15,159, 61,162, 3,137, 10,255,160,191,135, 60,153, 40,164,226, -189, 86,169,237,238,183, 61,215,251,177,211,164, 55, 25, 13,195,101,200,106, 54, 5, 40,181,123,129, 72, 64,147, 49,242,113,105, -159,119,224,132,126,188,106, 87,185,175,242,190,166,169,174, 89,161,186, 50,207,163,120, 24, 88,186,195,122,219,139,151,103,165, -186,129,109, 36, 8, 44, 92,231, 62, 82,223, 40, 2, 64,177, 98,180, 34, 39, 92, 46, 59,246,251,239,193, 94,156, 42,130,104,204, -103,161, 58,214, 12,106, 28, 56, 67,195, 7, 74, 85,228,226, 32, 3, 72,225,105, 18,101, 77,243, 44,243,240,244, 20,183, 82, 47, -116, 30, 80, 44,122,194,244, 69,184, 48,204,156, 15,144, 33,174, 21,104,182, 84,233,169,141,217,133,215,205,141, 55,237,205,219, -119,111,222,191,247, 96,193, 60, 41,235,221, 23,233,187, 27,139,231,233,134, 55,110, 95, 40,226,150,207, 68,117, 44,177, 25,111, -182, 19, 98,120,147,194, 14, 77,168,206,160,104,241, 61,159, 22, 6, 79,239,227, 96, 15, 35, 44,206, 31,102, 60,150,152,241, 81, -155, 84,140,212,231,227,142, 55, 23,142, 22,130,235,177,188,176,220,131,174, 21,182,225, 97, 26,190,250,252, 6, 74, 28,196, 54, -229,185,224,170,112,236,161,162,111,113,166,241, 51,104, 74,220,163,176, 24, 67,165,101, 56, 81, 6,238,188,235, 84, 19,110,252, - 59,166,209,255,233, 77,112,215,241,113, 3,133,176,219,172,208,141,132, 94,173,213,161,141, 14, 27, 12,198,219, 96, 97, 18, 70, - 80, 75, 65,152, 66,112, 1,146,187,196,201,222,133,236, 85,106, 81, 26,249,222, 92,151,118,193,159, 9,171, 44,236,126, 21,105, -100,153,131,238, 59, 21,173, 40,243, 49, 18,160,191,127, 11, 64,216,181,244, 52, 17, 69,225,123,231,213, 78, 95, 67,167,229, 41, - 40, 96,108, 98, 76, 52, 81, 2, 97,225,194,184, 52,110, 12, 46,140, 27,253, 1,238,220,155,248, 35,140,191,200, 24, 23, 18, 34, -132, 4, 36, 66,132, 2,182,165,180, 50,239, 41,245, 59,231,182,162,209,232,174, 77, 38, 51,153,185,231,241,125,231,158,251,157, -139,250,187,246,199,249,163,254,223,240,248,127,113,250,191,203,244,234,182,166,180,168,206,192, 60, 65,210,104, 43,224, 2,110, -148, 30, 38, 38, 30,226,203,250,177,186,141, 47, 56,104,110,185,184,195,111,187,185,220, 11, 54,216,129,254,117,188, 20,155, 8, -105, 24,224,253, 0,109, 60,154,200,172,196, 51,240,248, 76, 66,167,241,177,132,100, 46,249, 76,129, 84, 41,184, 30,162,150,130, - 13, 37,130,233,144,196,152,198,163, 93,233,118, 36,179, 78,202, 60,131,126,123, 3,225,251,225,226,163,181,189, 85, 18, 33, 34, -153,142,120,178, 60,221,236, 28,243, 30, 61, 8,102,148, 82, 10, 78,253,196, 79,146,228,253,250, 59, 56, 97, 2, 32, 2,251, 19, - 44, 59,209,139,143,187,251,150, 94,140,123,161, 99, 87, 76,195, 58,241,143,168,198,135,128,174,185,254,185,151, 10,189, 19,247, -190,197,113,195, 55,142, 67, 26,229,213,134, 11,203, 62,216, 99, 78, 51, 93, 51, 51, 90,200, 59,166, 89, 50,178,217,190, 81,144, - 32,234, 38,126,216,186, 73, 70,153,202,148,166,247,200, 40,232, 81,199, 75, 66,111, 59, 16,163,227, 70,107, 66, 94, 86,159,181, -221, 69, 33,139,208,143,160, 47, 73, 64,216, 32,163, 34, 85, 46, 22,106,202,153, 70,206, 2, 70, 35,141,154, 10,176, 71,222,116, -138,134,155,183, 74,182, 81,176,145, 33,100, 86,147, 96, 27,142, 52, 63,237,181,118,219, 30, 11, 12,113, 15, 27,187,208,148, 59, -227,100,203,176,221,197,218,242,206,241, 54, 62, 45, 28, 21, 17, 42,151,161, 73,123, 83,229,153,162, 77, 20, 10,107, 1,152, 60, - 57, 50, 13,192,110, 25,182, 31,123,173,110, 11,142, 71,161, 95,104, 83,213, 75, 9, 9,241,171, 18,129, 94,201, 87,252,216,183, -179,118,109,250,122,215,239, 32,140, 34,127,172,220,123, 92,181,171,251,173,125,138, 74, 6, 76, 60, 90,170, 45,175,109,174,110, -110,111, 8,154, 67, 96,193,123, 29, 58,112, 24,146,146, 19,119, 18,227,134,160,180,112, 75, 93, 13,129, 35,158, 74,237, 49, 88, -199, 92, 38,255,236,254, 83,207, 63,107,122,237,175,141,189,207,245,173,170, 51, 54, 51,126, 69,246,210,179,192,135, 45,141, 59, - 99, 7,237,195,152, 69, 53,225,177,219, 59,235,120,202,157,107,183,247,155, 7, 65, 20,129, 29,193, 30,138,118,105,194, 29, 59, -104, 29,157, 69,223,253, 48,108,158,157,176, 94, 96, 52, 63, 57,219,234,144,198,172, 31, 69, 32,170,174, 59,177,242,224,201,238, -151,109,188,212,168, 83,165, 66, 1,225, 47, 27,215,243, 8, 26,129, 28, 54, 63, 62, 71, 5,232, 94, 58, 85,153,196,211,235,167, -117,228, 54, 36,146, 83,191, 13,124,135, 7, 5, 44,149, 3, 19, 54, 45, 83, 15,253, 27,119, 47,139, 57,155,157,173, 47, 84,227, -149,236, 15,230,247, 12, 0,160, 2,202, 18,224, 92, 88,230,135,245,195, 48, 61, 87,212, 77,137,192,240, 97, 55,146,140, 86, 85, -133, 30,103,107,174, 78, 83,125,218,194, 39,149, 70, 33, 99,205, 84, 70,140,172,113, 18,146,214, 83,134,107, 48, 63, 69,163, 82, - 17,232,158,221, 78,224,239, 26, 40,203,114,109, 97,175,113, 16, 4,254,206,105, 99,163,217,120,249,234,197,155,215,111,175, 22, - 22,132,209,253,152,108, 61,159, 93,138,250, 30,247, 55,255, 12,161,130,155,250, 75,220,179, 46, 3, 82,140,225,115, 37,180,115, - 68,242, 57, 97,156,130, 66, 69, 9, 89,183,194,236, 10,143,223,156,189, 85,111,215,129, 85,202,165, 81,164, 85,158,238,163, 36, -201,197,224,168, 40,137, 80,141, 80, 48, 21,231,141, 78,147, 14,223,168,173, 73,169,151,139,101, 22,181,181,227, 56, 1,101, 39, - 72,199,227, 53,224,206,141,110, 75, 92,244,175, 43, 41, 71, 96, 17, 18, 63,136, 82,240, 39, 43, 78, 67,197,146, 88,254,224,162, -161,133,255,171,137, 10,244,233,129,208,177,172, 39, 94,203,205,187, 81, 28, 43,186, 1,196, 45,135,114, 79,170, 79,105,216, 91, - 71,244,194,208, 76, 47, 14, 34,154,249,144, 14,234, 19,218,144,143,105, 98,120, 48, 72, 93,222,163,156,161,162,162, 20, 63, 4, - 96,236,218,122,162,134,130,112,123,122, 78,111,219,101, 23,150,203,162, 18,162,129,152,152, 16,223,140, 60, 24, 30,124, 50,254, - 5,253,111,196, 7,227, 31,192,240,164,137, 9,241, 1, 68,137,107, 36,220,228,190,184, 23,216,238,173,237,182,123,234,204,180, -236,106, 2,137,240, 68,114, 18,218,133, 51,243,205,204, 55,223,199, 7, 56,253,166,205,210, 91,127, 84,149,255,253,138,111, 58, -223, 35,175,150, 97,115, 31,227, 93, 52, 56,163,171, 8,108,225, 6,194, 83, 6,125, 47,192,172,254, 79,167, 94,189,149,126,121, -157,150,136, 77, 19,167,155,183,177,197,109, 20,213,145, 73, 46,102, 16,178,187, 81, 7, 5, 37, 52, 1,225,183,199,250, 72,230, - 75, 68, 42, 83,199,131,164,193, 66, 19,255, 24,251,248,232, 34,162,200,156, 51,218,104, 55, 98,106,158, 49, 84,240,244,225,175, -254,246,211, 27, 56, 9, 53, 17, 57,214,250, 7,149,125, 20,192, 81,217,136,149,175,119,107, 40,190, 22,226,180, 68, 69,161, 21, -169, 49, 40,241,116, 15,157,112, 73,155,142,218,228,174,143, 75, 88,101,247,156, 28, 92,113,225, 19,210,111, 55, 66,125, 34, 0, -109,156, 22,142, 66,165,211,239,107,165,166,123,116,217,242, 37,246,224, 56,150,201,202,136,101,230, 76, 49,155,205, 78,103, 51, -182,109, 27, 76,155, 48,140,122,208,131,187,101,197,220,128,135, 87, 80,232, 18, 66,118, 43,162,220,226, 73,168,255, 66, 17, 26, - 38,215, 5, 62, 0, 71,147, 18, 20,237,176,109,178, 47,135,215,136, 88, 15,192, 67,136,220, 47, 63, 68, 6, 3,128, 1,168,202, - 61,244, 6,163,143, 38,130,192,132,112, 18,158, 48,111,235, 83,142, 81,107,120,235, 7, 87, 80,223, 67,121, 48, 61, 54,179,125, - 94, 34,132,132, 89,238,176,122,128,251, 71,161,247,227,248,251,157,177,123,245,102, 53, 70, 57, 86,120,120,221,151,126,189, 83, - 53,152, 97,162,245,182,177, 48,243,104,251,228, 39,192,103,210,228,227, 87,205, 58, 45,175,121, 89, 43, 7,255,228, 16,253,209, - 76,145, 46,231,126,101, 15, 45, 85, 59,205,202,213,111, 67, 88,168,193,107, 90,203,171,203, 15,138,115, 77,175, 9, 32, 23, 53, -177,226,112,235,104, 75, 55, 76,146, 24,212,225,216,104,166, 32, 4,191,186,104,248, 97,240,250,249,171,195,243, 67,244, 9, 97, -234,198,238, 6,220,234, 54, 90, 36,115, 71,100,187,136, 3,160,224, 8, 87, 54, 86, 91,109, 23, 18,207, 92,241,190,161,242, 66, - 97,106,105, 97,233,107,105,237,164,126, 22,248,190,103, 6, 0, 96,159, 62,124, 18,244,123, 27, 59,155,142,229,232, 81,124, 92, - 57, 53, 13, 59,177, 31,122,185,248, 98,229,243,251,189,139,195, 98,190, 8,183, 15, 18,188, 11,245, 25, 83,230,139,243,139,143, -151,206, 62,188,131, 95, 87,112, 70,243,179, 83,141,179,203, 94,167,229,152, 25, 72, 63,229,122, 25, 34, 81,185, 86,206, 59, 89, -157,241, 92, 38,235,133,189, 46, 57,132, 65,110, 40,228, 10,141, 22, 6,116,174, 48, 72, 96, 71,181, 35,194,133,172,227,183, 38, -199,238, 78, 76, 77,255,218, 95,135, 26,179,195, 45,101,199, 85,158,141, 35, 72,239,235, 24,223, 53, 28,125, 32,163,134, 15, 92, -218,168, 91, 32,208,187,160,245,173, 10,149,153,174,177,144, 66,188,140,211, 89, 29,163,149, 61, 85,202,248,239,139, 15, 48, 71, - 83, 45, 33,144, 80, 43,180,227,142,219,172,123,128,123, 50, 56,177,193,111,193, 18, 64,164, 10, 17, 77, 10,211, 31,159,189, 60, -221,133, 79,233, 99,105,141, 1,134, 50, 16, 73,154,138,141, 35, 80, 37,118,120,182,133,218,165, 38, 81,246, 73, 69, 21,105, 7, -100, 77,134, 36, 98,110, 25,166,223, 15, 0, 16, 36, 46, 2, 50,101,127,168,100, 38, 76,251,180,105,224, 70,194, 50, 25,189,245, -191,236,109, 10,206,161, 36,247,221,138, 76, 54,252, 83,216,174,164,158, 68,112, 24,201, 20,177, 36, 23,176,235, 81, 31,213,192, -114,184,246,216, 14,154,196,140,148,113, 58,104, 37,147,185,129,179, 68, 98,108,136, 7,112, 10, 66,137, 4,121, 53,137,235,133, - 58,232,134, 37,246,158, 41,103, 63,145,245, 75, 24, 66, 18, 96, 31, 73,184, 74, 84,117,228, 90,197,173,106,228,164,118,205,230, - 75,138, 13,124, 1,183,235,226,204, 76,134, 67,138,100, 60,236,104,171,169,250,128,146,152, 99, 3, 16,129, 87,169,161,249,184, -250, 71, 0,202,174,165,181,137, 40,140,206,220, 59, 51, 73,166, 77,155,198,166, 47, 40,182, 69, 20, 41, 45, 86,197,125, 65, 10, -110,252, 3, 93,250, 59, 4,255,136, 8,234, 90, 16, 92,117, 33, 8,182,116,161,162,216,151, 85, 90,232, 51,105,210, 71, 94,243, -200, 60,226,119,190, 59,169,173,136,232, 50,179,153,201,204,189,231,126,143,243,157, 99,156,147, 41,245,127, 67,246,191,211,219, -255, 19,246, 47, 65,127, 71, 69, 18,232, 15,113, 2, 12,254,234,237, 63,116, 95,127,235,238, 94,100, 54,234,234,220, 76,244,116, - 58,126, 84, 62,122,102, 33,152, 93,204, 11, 99,149, 5,224,143,219,246,240,222, 99, 65, 59, 39, 17, 89, 22, 74, 69, 63, 78, 91, - 89,168, 20,176, 56, 92,135,171, 36, 78,170,229,233,137, 59,223,247,214, 41,188,130,124,165, 48,184,223,132,187, 56,129,203, 69, -125,157, 82,129,166, 95,247,131, 86, 41, 56, 68,212, 35, 2,197,138, 66, 1, 83,147,240,196,198, 58,132,166, 31,146,142, 48,209, -151,227, 46,168,174, 38,212,132, 30, 73,184,174, 70,104, 0, 72,124,126,201,114,214,109, 17,229,109,208, 85,107,173,152,110, 64, -225,161, 19, 68, 4, 70,197, 88,251, 22, 86,212,105, 78, 72, 57, 53,152,163,135,215, 51, 22,129,171, 1,163,119,105,185, 96,168, -217, 66,246,102, 82,215,179, 89,148,191, 53, 12, 56, 35,194, 38,220,129, 52,154, 17,186,113,213, 67,248,227,129,148, 36,130, 64, -227, 85,205, 99,117, 44, 70, 5, 50, 89, 11, 77, 84, 83,189, 36, 93,235,183, 83, 61,166,229,250,241,210,218,209, 81,195,151, 50, -109,155, 86,165, 94,220, 60,128, 64, 57,116,174, 1, 11, 2, 24,237, 57,182, 97, 55,252, 70, 29,190, 60, 33,157,124,116,100,214, -188, 26, 12,117, 91, 94,166,203,110, 56, 85, 10,207,221,192,107, 6, 14,101,160, 41, 97,206,205,204, 45,111, 44,209, 21,101,178, - 83,172, 30, 58,158,123,110,131,206, 81,188, 18, 31, 69, 96, 70,177,121,221,107,218, 86,247,252,236,252,147, 23,143, 39,175, 78, - 18,100,247,103, 11, 20,254, 83,254, 34, 89, 94,166, 84, 45, 18,238, 31,211, 22,130, 44,157,246,116,225,153,196,208,131, 63, 90, - 24,203,160, 94, 25, 58,190,211,215,149, 31,238, 27,222,220,223,192,234, 49,204,226, 89, 41, 99,164, 7,115, 67, 3, 61, 67,235, -187, 43,187,229,157,175,155, 31, 70,114, 35,174,239,216,102,250,238,181,153,197,213,197,207, 91, 95, 70,251, 71,233, 39,140,112, - 83,221,133,158, 43,180,254,106, 78,157,190,203,199,141, 79,150,105,165, 77, 43,214,194,253,242, 33,180,196,233,169, 53,153, 77, -117,191,126,247,138, 94,187, 97,203,253,242,193,120,215,141,237,202,202,203, 55,207,239, 79,207, 26, 56,141,130,158, 76,246,168, - 86, 49,205,212,195,123, 15,222,175, 45,123, 94, 53,103,247, 86,106,229,219, 19,183,118, 43,123,148,181, 80,252, 78,193, 94,119, - 10,121,143,100, 36,225, 4,168, 85, 24, 24,226, 90,115,219, 51,187,182, 23,246,198, 31,221,212, 8, 76,163, 38,143,213,241, 2, - 23, 28,194,163, 73, 15,195, 39,173,215, 68, 53,122,245,244,237,242, 14, 92, 19, 52, 5,125, 29, 22, 56, 55, 32, 47,214,107, 21, - 87, 15,150,150, 82,228,179,182, 76,155,167,174, 19,226,236,151, 60,120,139,204,141,123,249,172,104,203, 62,238,174, 91,206,217, - 83, 21,168, 13, 10,102,172,200,136,163,108,181,239,155, 90, 96,105,198,158,183, 19,177, 72,142, 96,167, 42,157,187,160,122, 28, - 33,157,142,180,227,250, 49,109, 24,250,155,161, 16,227,249,177, 31,165, 45, 31,213,107,216,128,133, 24,225, 64, 17, 38, 86,170, - 11, 24,239,132,203, 39,187, 73,130,179,223,142,227,115,148, 76,130,110,229,112, 68,223, 8,252, 61,202, 91, 12, 10,138,149,171, - 55,183, 76, 53,204,117,133, 97, 35,170,227, 9,184,181,250,139,163,216, 78, 74, 58,237,196, 56, 45,177,245,166, 60, 0, 10,174, - 32,248, 26,249,108, 63, 45, 27, 27, 35,114, 77, 53,219,101, 36,190, 75, 42, 55, 18,106, 44,134,153, 32,186,227, 53, 85, 81, 58, - 82, 46,129,160, 84,176,121, 26, 71, 49,231,108,252,142,229, 18,159,182,151,133, 0,196, 5,189,155,196,208,186, 29,159, 53, 79, -184,185,130, 75, 63, 5, 96,237, 90,118,155,134,130,232,181,175,157,216,206,195, 73, 31,105, 80,131,154, 86, 32, 1, 43, 22,172, -248, 4, 36, 86,252, 0,159,198, 23,176, 64, 8, 9, 16, 91,132,218, 74, 81, 23,133,180,106,105,211,144, 71,243,110, 28,199,241, -155,153,185, 78, 10,130, 13, 18, 63, 96, 39,215,115,207,156,121,157, 81,216,191,208,246,255, 10,241,191,189, 34,205, 81, 17,222, -193,141,222, 50, 85,167, 67,150, 40,157,161,157, 8, 93,255,232,111, 16, 31, 51,101, 37,112,150,213,242, 0,149,168, 28,249, 43, -149,167,227, 18, 45,240,120, 80,145, 80,184,136, 33,132, 15,195,112, 89,225, 70,227,132, 11,143,197,138, 16,117, 53,237,200, 18, - 57,152,162,110,166, 84,189, 63,189,102,180,171,226,232,162, 6,112,179,179, 89,109, 14,154,194,105,210, 24,161,236,163, 33,168, -240,182,201, 98, 76,141,126,162, 29, 83, 42,231,203,224, 30, 40,145,238,145,168,134, 68,173, 20, 76,252, 29,145, 90, 10,104, 88, - 25,235,154,136,226,212,106, 12, 96,192,248, 94,225, 81,115,122,142,138,147, 44,224, 1,188, 2,119,122,147,144,122,164,208, 98, - 6, 46,150,204,211,244, 61,231,162,190, 20,214,135, 99,157,187, 56,201, 73, 15, 70, 70, 35, 99, 15, 7,248, 55,136, 12, 0,251, -239, 23,139,213,124,174,128,213,133,172, 41, 97,238, 5,184, 60,202,241,179, 96,230,120,150, 20,207,177,139, 40,160, 44, 17,205, - 94,225,117,197,205, 3,161, 1,220,139,131,155,202,166, 56,240, 71,219,241,247,191,247,135, 22, 56, 79,135, 75, 41,207,179,103, -254, 68, 87,115, 70, 42,215, 26, 93,193, 89,107,170, 54,119,157,192, 95, 0,192, 25, 90, 1, 44, 30,127, 18,118,172,240,201,108, - 36, 43, 10,249, 98,184,155,108,183,188,119, 61,238, 30,158, 29,192,101,184, 83,168, 56,254,252, 99,237,253,220,155, 11,233,130, -129,213,167, 50,154, 14,174,138,246,107,235, 54,106,146, 68,128,203,224,228, 12, 45,219,191,233,192, 39, 72,105,250,219,253, 55, - 27,197,173, 77,179,132, 66, 28,161,159,104,177, 70,129,170, 26, 41, 73,129,248, 54,159, 89, 91,120,118, 74, 81,192,210, 30,222, -125, 80,111,124,157,204,134, 94, 64,221,156, 44, 28, 90, 3, 96,217,102,166,104, 57,211,242, 90,165, 51,104, 64,232,109,187,211, -211,246,137, 71,219,111,224,215,204, 92, 91,227,234, 78,185,218,232, 54, 56,231, 47,158, 62,127,253,249, 93, 49, 95,116, 93,183, - 51,110,183,111,186,178,136,252, 36,185, 53,234,160,170,109,228,111,100,214,225,154,162,228,108,236,101,211,102,123,212,133, 88, -161,144, 41, 0, 97,223, 45, 85, 43,114,241, 8, 69,221,248,151,179,131, 74,105,103,100,141, 33, 20,240,176,234,236, 52,122, 87, - 99,123, 2,254, 24,224, 27,190,254,143, 65, 11,231,221, 89,132,132,131, 73,134,106, 80,151,119, 36,166,223,195,192,175,159, 30, - 42, 16,234,225, 68, 72,175, 57,140,182, 95,125, 74,189,124,198,208,148, 38, 76, 33,188,224,148,217, 70, 34, 0,120,158, 97,181, -238,197,135,243,163,122,111,232,184,192, 3,176,170, 65,122, 65,161, 47,224, 33,105,193, 90, 13, 30, 82,186, 19, 55,243, 85, 54, -242, 11, 57,154, 90, 22,224, 42, 64,164,138, 0, 25, 11, 49, 54,209,166, 6,102,167,144, 85,166, 21, 47,154, 89, 88, 92,209,140, -249,194,131,155,165,201,105,207, 11, 53, 29,119, 99, 77,216,108, 91,171,236,207, 61, 51,157, 15, 34, 23, 23,213, 98,224,155, 55, -141,204, 73,231, 50,183, 94,158,143,250, 56, 68, 43, 56,123, 20, 97, 69,132,252,206,147,123,143,107,151,199,112,229,182,204,210, -113,235, 27,201,193,209,190,164,128, 4,234,101, 22, 96, 54,143,248,124,156,164,115,197, 16,110,124,219,142, 1,161,155, 98,166, -205,190,219,139,150,248,200,101,196, 16,148, 21,210,178, 16, 1, 12,103, 55,178, 20,175,100,105,111,153,181, 40,252,210,202,177, -164,163,143,142, 11, 30,152, 73,227,144,115, 90,209,108,215, 17, 44, 19,248, 13, 88,160, 31,186,162, 60, 26, 75, 75,233,175,213, - 80,167,196,198,214,152, 45, 55,160, 51, 49,251,200,150, 98, 5, 2, 4, 89,162, 72,243, 71,203, 73, 34, 7, 41, 37,195,255,232, - 29, 40,114, 78,116, 24,127, 10,192,216,149,236, 54, 17, 4,209,158,221,179,197,139,108, 39, 81, 18, 5, 36,132, 64, 66, 66,226, - 0,124, 2,119, 62,129, 11, 7,238,124, 4,191,192, 31, 32,113, 65, 8, 78,112, 68, 17, 10,203,129,147, 67,130, 9,177,177, 51, - 30,143,103,245,108, 61, 84,117,143,147, 0, 18,226,226,147, 61, 35,207, 84,191,126,213,245,234,149,252, 15, 40,255,159,230, 85, -156, 19,200, 84,231,255,127,254,254,247, 23,152,221, 32, 78,153,101, 41, 6, 68, 88, 86, 15,168, 37, 92, 9, 43,150, 23,132,152, - 23,175,202, 44,201,170,213,201,187, 20,227, 76,194, 66, 60,187, 39, 31, 12, 91,137,188, 83,105,213, 14, 80,101, 40, 31,169, 84, -217,100, 83,119,249,115,225,174, 97,104,136,178,219,189, 52,241,198,188,208, 1,241,234,198,128,215, 30,238, 19, 98, 37,227,148, - 87,184,190,216,182, 58,144, 26, 83, 28,104,167, 82,108,239, 76,241, 61,139,133, 34, 41, 16,140,138,214,192, 74, 11,170, 22,133, -177, 55, 34, 76, 74,203, 38,165, 0,234, 2,140,102,220,142,129, 59,160,178,212,183, 4, 18,177,196, 90, 36,106,209,105, 90, 27, -183, 30,120, 78, 33,164,170,100,224,122,198, 51,198, 85,133, 68,252,109,251,230, 4, 11,123,230,177,148, 65,194,146,132,114, 90, -179,174,242,194, 91, 68,202, 38, 4, 89,116, 12,219,123, 6,172,131,137,208,141, 6,112,240, 94,115,109,221, 48,182, 76,243,198, -102,207, 54,180,158,161, 1,222, 51,179, 70, 33,197,181, 78,225,237,160,199,125, 65, 1,111, 7,163,224,240,196,119, 22,212,141, - 2, 77,182,238,221,188,255,106,255, 25,192,159, 34, 26, 64,226, 32, 24,166,139, 73,201,206, 59,113,124, 54, 22,169, 84, 8,186, - 28,235, 16,153, 36,194,227,202,253,216, 55,117, 59, 78, 22,186,102, 3, 93,157,199,174,143,233, 39,202,171,225,153, 76, 23, 35, -156, 67, 96,182,104,161,181,205,182, 23,123,144, 74, 3,137, 14,146,133,199,186, 22, 27,170,201, 88, 42,214,209, 0,172, 41,237, -192, 79,117,205, 4,208,220, 31,188,191,186,125,125,127,240, 65,150,181, 56,241, 37, 73,211,117, 99,137,201, 89, 21,101, 81,219, -110,103,217, 82,194,119,132, 11,182,189,214,209, 26, 22,182,125, 66, 24,224,216,188,203,227,217,177,138, 61, 2, 74,150,103,195, -201,183,142,221,156, 7, 46,236,187,170,165,154, 13, 28, 49, 97,169,141,187,215,238,188,253,244,230,116, 49,105, 27, 77,216,192, -158,191,123, 57,243, 79, 45,228,221,101,183,217, 3,120,193,164, 1,101, 75, 82,202, 78, 81,202,130,246, 59,253,131,233,119, 67, -213,156, 48,172, 42, 31,190,163,169,154,166,232, 39, 14,142,145, 98, 22, 81,152,177,165,105, 50,113,126, 0,154,227,144,101, 65, - 60, 93, 56,128, 47,216, 97,202, 82, 22,184,160, 27,185, 16, 48,139,208,195,126, 70, 96, 18,177,135,119,201, 75,180,243,224, 1, - 76, 10,219,232,123,201,228,246,198, 21, 55,220,123,244,248,197,195, 47, 71,183,158, 60, 32,100,131,136, 30, 49, 34,162,138, 4, -246,231, 38, 35, 81,175, 7,123, 79,247,135, 65, 90, 66,230,161, 43, 73,176,156,204,253, 52,203, 53, 85,150,108, 11,197,245,244, -188,138, 40,176,121,158, 0,226, 59,173,230,102,207, 74,242,116, 25, 23, 18,202,204,240,120, 94, 98, 13,242, 84,170,164,146,249, - 68,113,175, 21,180,143, 22,229,170, 60, 25, 13, 41,149, 32,187, 74,210, 57, 44,114, 83, 54,188, 52,106,239,172, 65, 72, 6,196, -237, 55,208,245,190,101,217, 93,187, 53,244, 66, 72, 84,225,239,207,162,185, 46, 43,157,238,166, 73,201,177, 59, 70,165, 12, 83, - 61, 71,105,204,138,138,213,200,157, 70, 89,178,204,178,153,239,228,204,243, 11, 79,116,105,105, 26,214,238,250,238,199,163,207, - 34,225,224, 94,159,227, 51,190,125, 54,252,141,174,116, 34,249, 52,156, 10,228,156,138,195, 39, 50, 57, 1, 21, 77, 73,221,198, - 68,254, 4,119,254,123,190, 95, 16, 97,187,187,229,248, 14,132, 58,252,107,224,254, 95,127, 30, 66,108,178, 6,186,122,217,197, -121,196,189,126,185,157, 31,183, 46,129, 61,177,224,210, 77, 6, 83, 72,161, 8, 63, 24, 67, 18, 42, 67, 4,150, 75,194,148,199, - 53,200, 87, 85,237,255,200,180,151,186,162, 39, 69, 34,212, 98,148,149, 50,165,190, 35, 79, 17,106,128,252, 37, 0, 97,215,178, -219, 52, 20, 68,239,245,243,218,113,156, 71,211, 54,141,170,162,130, 0, 9, 65,197, 2, 36, 36, 36,190,128, 37, 43, 22,124, 13, - 43,182,236,248, 1, 96, 77,197,170,176, 42,130, 86, 64,161, 72, 5,148, 66, 95,132,208, 36, 77,155,167, 19, 59,182,153,153,235, - 20,138,132,234,110,235,186,190, 55,153,123,102,230,204, 57,218, 41,213,147,211, 46, 29,107,229,209,127,136,140,167, 95,242,228, - 17,186, 13, 1, 77,186, 0,134,236, 79,100,151, 87,128, 6,123,127,167, 11,199,146,238, 10,145,223,229,236, 0, 39, 83, 57,146, -213, 59,249,100,203, 72,245,253,110, 98,103, 34,123,167,180,239,144,101, 39, 92, 81, 58,126, 53,236,233,117, 13,213,218,252, 85, - 30, 43, 80,199, 74,210, 31,145,150, 38, 49,149,140,226,201,204,244,198,222, 6,209, 75, 61, 31, 66,223,184, 17, 2, 59, 51, 12, - 81, 40,219, 27, 14,114,206, 68,123,208,142,227, 17,209, 21,185,180,155, 9,240, 7, 94, 38, 12, 56,121,139, 51,210, 42, 80,152, -176,153, 78,211, 68,148,254,161,124,141,142, 14,221, 58,245, 17, 44,164, 37,132,130, 39,234,134,124, 52, 66,154, 35,202, 97,146, -246,150, 92, 14, 85, 77,114, 20,148,135,151, 13, 40, 64,227, 36,209,203, 36, 97, 88, 46, 88, 4,187, 69,236,119,161, 70, 26,182, -168,252, 48,110, 68, 65,163, 90,255, 28,132,232,197, 7,191,108,232,182, 45, 82,186,238, 10,211,113,236,172,208, 75,134,221,244, -130, 86,111, 56, 12, 2, 26, 13,198,190,141,202, 76,120,100,111,208,124,182,242,152, 18, 11,184,187, 55,240, 3,200, 3, 12, 93, -120, 72,195, 68,226, 90,103,208,134,127, 51,227,228, 33,200, 66,158,128, 77, 36, 92,215,168,235, 1, 50, 66,240, 53,244, 7,181, -206,126,162,227, 70,118,222, 16, 73, 1,233,207,228,103, 43, 7, 63, 32,137, 22,166,232, 99,175, 59,112,237,172, 23, 12,108,145, -129,133,149, 69,212,180, 72,123,104,204,139,204,234,142,119, 8,135,199,116,118, 6,112,116,237,168,106,153,118,193,157,220,174, -109, 69,104,215,160,194,241, 25,196,193,185,226,249, 55, 95, 95, 21,243,165,102,171, 33,132,120,249,225, 69,222, 41,104,232, 44, - 15,169,149,178,189,255, 45,109, 58,128, 16,133,106,112,156, 69, 84, 90,189,150,134, 75,140, 1,119,126,242,204,141, 11,215, 23, - 87, 23,151,222, 47, 77,103, 10,185, 84,214,181,221, 90,171, 6,231, 22,108,195,181,133,155,147,169,236,242,250, 50,108, 86,187, -210,129,187, 92, 52,247, 56, 64, 34, 34,142, 43,155, 25,203,129,151,130, 87,176, 12,177,127,180,143,181,133,144,188,179, 85,245, -234,217,133,225,200,127, 91,126,167,113, 99,110, 98,246,211,238, 23,115, 20, 66,148,167, 33,122, 31, 43,116,244, 33, 71, 74, 99, - 52, 66, 90, 48, 9, 43,162, 51, 37, 11, 51,182,155, 36, 67, 10, 10, 96,193,247, 32,109,185, 5, 43,227,140,182, 86, 90, 59,123, -186,250,224,225,243, 59, 79, 95,223,190,127, 87,220,187,197, 88,137,105, 3, 20, 29, 99,189,224,209,234,242,147, 53, 56, 84, 13, -161,123, 97, 88,175,181, 87,215,183,123,140, 77, 51,150, 99,204,184, 98,198,145,116,240, 76,198, 94, 1,109,216,154,118,169, 52, - 97, 9,181,221, 71,223, 9, 19,141, 80,105, 98,137, 37, 66,189, 84, 10, 1, 56,128,176, 29, 33, 27,231,112,139, 57,162, 4, 90, - 97,213,195, 42,102, 53,140,103, 29,183,225, 29, 21,231, 47, 51,236,200,118,115, 70,174, 30,212, 75,234, 69,141,113,159, 84, 35, - 73, 75,139,101,221,124,115,119,179,118, 88, 15, 20, 78,114, 2, 81, 72,243,180, 40,238,193,248, 78, 99, 23,162, 58, 67,255,166, - 56,159,206,195,199, 3,178,174,242,207, 50,236,212,218,247,143,136,220, 73, 52, 38,102, 73,201,125, 92,188, 77, 2, 78, 49, 87, -130,189,195, 42, 60, 4,131,113, 56,156,114,167,106,221,134, 20, 39, 32, 2,190, 36,175, 68, 73,124, 79,116,119,144, 97,201,147, -224,142,111, 92,105, 86, 66,137,151,153,252, 2, 34,208, 36,221, 2,137,169, 20,105,237, 9,171, 52, 87,152,219,171,239,106,154, - 6, 57, 34,192,124,196, 1,244,103,121,242,252, 40, 30,203, 87,218,134,240,123,125,206,147, 20,255, 24,182, 31,171, 83,186,169, -172,215,242,216, 9, 70,140,242, 15, 29, 81, 94,191, 5, 96,236, 90,118,155, 6,162,232,140,199, 99, 39, 77,157,244, 9, 10,109, - 72,165,150,242,168,170,118,133, 64,128,212, 47, 64,236, 16, 27,182,252, 2, 44,187,224, 7, 96,201, 15,176, 64,192, 55, 32,181, - 21, 84, 44,144,138, 4,148,135, 72,165, 16,151, 54,143,214, 77,236,216,227,225,222,107,167, 88, 80, 9,164,174,170, 72,150,103, -146, 51,247,220, 57,247,156, 19,244,239,255, 15,238,232, 14,166,163, 19, 27, 53,252, 95,152,206,211, 37,192, 15,162,206, 36, 14, - 51, 98,118,254,247,199,141, 63,193, 29, 22, 49, 78,156,100,120,234,200,147, 20, 28,212,130,231,233,133, 3, 67, 51,176,136, 80, - 62, 15,248, 18, 81, 20,137,206, 88,208, 83,121, 66,113,227, 40,209,209, 52,238,156,140, 17,101, 77,234, 7,151,187,116, 39,138, -167,162, 16,150,149,139,209,160, 35,164,155,216,248,216, 51,130,178, 9, 99, 64, 34, 4, 90,172, 98,144,127, 64,237,221,210, 0, - 75,129, 39, 85,144, 99,145, 68,221,184, 70, 41,147,101,161,132,222, 6,110,160, 67,169, 35, 11, 7, 87,185,141,166,144,202, 84, -202, 4,240,183, 12,155, 52,224, 86,206,132,202, 74, 22,242,214, 88, 73,150, 74, 98,196, 17,163, 37,233, 12,227,248,168,193, 4, -176,102, 0, 50,165, 4,182, 49, 25,169, 55,113, 48,197,224,192, 51, 81,168, 76,234,100,148,189,113,146,231, 99, 94, 0, 60, 31, - 42,117,248,179, 36, 62, 0,158,131,129, 76,166, 0,122,223, 99,170, 19,246,221,158,247,253,160,233,121,129,101, 90,120,162, 36, -209,204,100, 73,146,100,181,161, 11, 13,118,249,101,159,162,159,177,167, 44,236,195, 46, 14, 92, 40,186,255,130, 77,232, 5,222, -245,139, 43, 36, 75,199,178, 72,160,114, 90,164, 78,170, 90, 79, 56, 19, 80,255,226,116,174,204, 17,104,171,233,177, 42,172, 94, -212, 71, 99, 91, 32,100,240, 14,176, 66, 29,175, 83, 30, 47,187,173, 31,152, 13,133,186,253, 68,195, 26, 47, 86, 23,127,182, 93, - 88,240,133,202,210,254,225,254,217,211,213,237,250, 71, 88,137, 32,236,211,149, 56, 7,182,110,153, 54,252,180,234,205, 58,217, -209,132,240,187, 18,134,188, 60,127, 21, 56,248,129,223, 17,192, 29, 21, 26, 2, 43,218,205,196, 44, 69, 81, 44, 9, 96, 49, 37, - 68,114,103,104,120,102,114,102,253,195, 6,166,193, 72,121,228,119,225,104, 25, 41, 56,231,202,179,161,138,108, 83,110,188, 95, -223,113,107,203,115,203, 95,220,111,192,181,225,197,209,248, 27, 77,232,112,160,209,243,189,202,248, 84,163,189, 11,236, 1,222, - 40,111, 13, 9, 46,128, 25, 0, 42,193, 78,212,118,107, 23,166,206,215,118,119, 34,173, 90, 94,123,190, 60,215,104,187,125, 88, -129, 24,155, 75,240,229,129,175, 8, 28, 60,213, 73,116, 49, 99,169, 11,109, 12, 7, 76, 28, 71,194, 52,155, 94, 19, 74,129, 75, -103, 23,128, 3, 97, 14, 7,172, 96,239, 96,116,168,254,186,225, 66, 49,124,171, 27, 57,123,221,181,151,155,141,213,103,123,111, -182, 42, 97,208,122,254,142, 61,253,180,246,106,187,103, 99,211, 60,196, 84, 85, 93,109,118,239,239,119,238, 48,118,147,177, 77, -198,222, 74,227, 76,193,246, 9,183, 20,176, 55,160, 32,195,249,165,202,164, 50, 96, 71,250,210,228,142,105,230,164,137, 65, 2, -100,141, 72,161,189,169, 42,153, 19, 96, 2,226, 91,166, 81,202,219, 54,179,106,123,133, 8, 77,107,204, 36,134,193,136,140, 71, - 91, 47,110,175,220,189, 49,123,101,245,201,234,189,169, 7,143,221,135,213, 82,229, 90,241, 84, 27,205,132,121, 63, 68,211,132, - 14, 94,119, 11, 63, 82,227,197, 81, 32, 85, 45,212,167,197, 73, 52, 88, 68,165, 58,206,115,192,118,234,104,122,162,242,185,241, -149,200, 77,146, 84, 71,118, 37,177,206,160, 93,156,133, 18,248, 23,112,166,100, 74, 53, 51,180, 31, 31, 6, 71, 44, 53, 33, 75, -134, 4,126, 79,224,232,129, 35,187, 30,116,122,116,154, 44,193, 83,169, 36, 31,152, 75,167, 70,108,199,226, 67, 62, 16,149,242, -174,143,102,159,197, 66,209, 15,125, 84,194,164,142,109, 73,229,153,130,123, 34,210, 15,194,128,242,245,120,166,120,103,199,217, - 91,176,251, 30, 53,238,105, 80,199, 48,178,163, 63,196, 15,178, 96,251, 75, 0,206,174,101, 55,137, 40, 12,159, 57,115,165,204, - 48, 12, 32,180, 67,211,212, 40,144,168, 81, 55,198,244, 9,234,194,173, 11,223,192,173,111,226,198,173,235,190, 65, 19, 99,188, - 36,221, 20,141,177,105,172,212,218,212, 88, 13,148, 22,152, 50, 3,204,133,153,241,255, 15, 67, 29, 19, 99,140, 27, 66,200,228, -204, 97, 46,223,127,255, 62,225,255,220,246,191,224,120,218, 78,200,188, 18,132, 46,249, 61,187, 18,167,134, 84,255,229,164,233, -185,214,121,143, 60,199, 68,130,184,170,177,114,220,251,202,165, 38, 97, 85, 69, 3, 68, 5, 28,193, 81, 99,180, 25, 51,118,207, -120,226, 79, 18,132, 38,100, 65,202,250,168,176, 30, 94,116,227, 48,182, 32,180,177, 33, 83,240,194, 56, 96,222,117, 52,171,224, - 37,235, 99,115, 18,117,189, 17, 56, 84, 57, 94, 84, 51, 57,111,120, 6,102, 10, 34,196,156,146,183,253,243, 89,170, 47, 35,169, - 24, 94, 33, 37, 36,106,161,192,151,129, 16,198,156,196,104, 26, 49,208,102,140,242, 44,121, 2,107, 3,246,179,187, 41,240,216, -132, 78,177,175,142,195, 30, 2,102,190, 51,178,160,100, 4,198,215, 2, 49, 29,132,195,177, 40, 19,145, 70,163, 49, 4,230, 49, - 19,106,167,138, 4, 70, 0,183, 6, 0, 42,241,140, 70,117,202,158, 79,137, 17,255, 98,183, 3, 97,180,245,248,140, 4, 72,237, -139,106, 71,178, 12,192,129,219,112, 93, 14,121,202, 88,165, 90, 4,219,130, 68,186,176, 19, 26, 96,202,140,165, 26,167, 76,218, - 44, 64, 94, 11,166,125,129,253, 8,178,136, 61, 97,170,146,207,202, 26, 64,213, 82, 97, 21,204,231, 97,187, 5,255,125, 60,177, - 99, 86,225, 96,137, 17,244, 33,182, 62,190, 6,239, 85, 66,234, 75,202,230, 26, 66,184, 39,224,161,123,161,215,106,127, 42,169, - 37,128,188,190,115, 26, 49,106,184,190,115, 38,112,130, 53,177, 20, 65, 1,200, 91, 42, 46, 3,234, 85, 75, 70,235,251, 62, 90, - 43, 81,138, 81,233, 16,130, 83,136, 30,236,183, 7, 77,128,251, 59,181,181,158,115,106,168, 70,167,223, 6,171, 5, 17,155, 63, -182,192,174, 0, 76,148,115,149,238,240, 4,142, 84, 51, 11, 19,215,163,130, 16, 6, 65, 78,215, 94,237, 60,135,139, 0,126, 80, -103,216, 17,147,153, 28, 46, 35,168,166,177, 8,239,225,192,233,151, 13, 83,161,226,153,221, 1, 43,102,141,206,155, 7,205,181, -198,221,189,163, 93, 31,173, 46,191,190,118,111,227,197, 6,156,162, 81,173,235, 56,166, 52,184,106,214, 44,215, 46,235,165,147, - 65, 23, 59,154, 73,124,227,242, 77,123,100, 45, 26,139,123,199,251,102,201, 4, 12,242,167, 62,141, 99,184, 20,171,149,149,129, - 67, 43,122,165,168, 21,183, 63,111,191,220,125, 3,207,106, 73, 45,130,157, 61, 60, 57, 4,231,174,172, 27,148,138, 96,138,126, - 88,109,215,245,134,209, 16,169,140, 48, 17, 10,246, 95, 41, 40,133,142,213,129,139,105,187, 78, 62,171,215,205,198,251, 47,239, -242,154, 30,132, 28,236,164, 86,208, 58,129,133,210, 17,224, 44,139,242,125, 44,195,144,199,132, 60,217,220, 89,223,106, 61,186, -213,184,189, 84, 55,151, 11,199,182,131,141,162, 24, 10,146, 77, 23, 37,236,193,121,127, 70,200, 83, 56,186, 61,184,166,103, 33, - 14,244,167, 88, 51,188,110, 22,203,122,102,236,121, 18, 79, 12, 77, 86,100,158, 17, 23, 33,244,135, 33,135,140,193,209, 76, 31, - 34,201, 99,227,227, 77,169, 34,136,133,236,130,139, 33, 47,242,148,193, 39,143, 69,222, 88, 36,162, 77, 38, 15,107, 15,200, 7, -124,195, 12, 33, 31,120,195, 2, 54,222, 83, 8,103,235,213, 43,142, 55, 57,234,126,131, 21,123, 99,108, 75,239, 58, 61,207, 7, -204, 7, 15, 2,171,246, 62,130,252,148, 41,189, 79, 97, 3, 37,237, 18, 74, 42, 38, 18, 26, 28, 19,151,140,231,234,163,105,122, - 68,238, 98, 12,127, 46, 16,146,128, 82,152,252, 74,211,181,189, 40,230, 82,189, 29, 23,191,113,243,101,162,185,224, 93,196,198, -175, 80, 55, 40,250,165, 68,148,102,221,154,101,213, 89,163, 28, 43, 86,247,135,125, 3, 11, 60, 54,211, 9, 9,231,251,156,213, - 9, 18,249,167,138, 97,182,251,237, 56,201,200,179,204,123, 2,238,113,210, 10,153, 84, 16,102, 85,188,100, 20,246,143, 24,252, - 83, 0,214,174,166,167,137, 40,138,206, 71,223,155,233, 76,235, 88,104,139,130, 20, 2, 41, 98, 52,129, 64, 72,140,137, 43,163, -254, 3, 99, 98, 98,226,202,191,224,207,240, 71,184,214, 5, 27, 89,168, 44, 52, 36, 38,178, 49,209, 5, 31,242, 93, 10, 45,181, - 67,203,204,155,143, 62,239,125,111,166, 34,186, 52,108, 8,105, 74,166, 51, 61,247,220,251,206, 57, 23,243, 9,224,229, 93, 37, - 84,254, 43,184,203,223,169, 70,229,116,229, 66,230,123, 86,183, 88,236,241, 52,110, 62, 75,108, 85, 14,170,254,218,244,116, 1, -217,229,225,178, 56,254, 79, 3, 75,147, 34,121, 62, 23, 77,150,102, 85,237,135, 21,167, 55, 58, 17, 40, 37,252,253,247,220,141, - 64, 31,137,252, 29,161, 28, 64,216, 38,240, 52,119,164, 13, 36,221, 6,134, 49,228,106,255,108, 31,227,130,117, 49, 78, 80,203, -206,200,161,187,107, 17, 11,104, 38,238,117,195,105, 9,202,169,165,149, 27,240, 50,180,161,197,150,128,157, 17, 4, 90, 77,189, -213,194,186, 30,163, 2,221, 36,128,239, 40, 29,214, 51, 98,145,183,200,147, 71,177, 5,213,156, 60,112,118, 65, 20, 52, 30,137, -200, 70,177, 31, 53, 14,165,133, 3,111,190,230,121,226, 97,137,162, 0,153, 65, 8, 77, 60,116,198,184,119, 24,111, 1, 74, 77, -100, 31, 8,111, 28,192,231, 46, 44, 31,148, 34,193,135,247, 10, 98, 25,243, 12, 28, 86, 33,186, 2,127, 54, 13,124,101,140, 2, -121, 14, 95,221,179, 70,116,153,228,124, 22, 15,231, 42, 65,236,237,159,236,141,151,171,199, 39,117,184, 95, 10,210, 40,244,215, -217,120, 62,134,174,111, 47,196, 9, 21,209,141,128,121,162, 27, 74,154, 26, 77,168, 6,180,148, 29, 3,180, 29,181,235,102,198, - 48,168,229, 7, 29,184,162,153,241, 89,104,153,129,140,231,178, 54, 26, 20,116,114, 10,160, 76,115, 29,168,166,170, 50,228,148, -218, 93, 23, 96, 93, 16,106,185,145,134, 27,212, 24,204,193,215,123, 31,157,126, 60, 30, 30, 24, 61,114, 15,101,118, 28,124,136, - 66, 37, 37,131, 1,228,214, 47,252,185, 55,123,127,113,229, 13, 69,137,184, 41, 98, 67,112,146,141,147, 6, 33,107,147,162, 5, -185,144, 0,218,158, 75,102, 14,202,107,193,114,226, 8,104,122, 8,148,217, 34,134, 69, 76, 32,213, 7,205, 3,130, 13, 17,116, - 84,154, 72,134,192,249,129,220, 49, 52, 86, 30,107,184,205,133,169,249, 72, 83,150,191,188, 7, 40,156,171, 46,140, 15,141,190, - 93, 93, 42,228, 7,136, 74,214,107,107,112, 9, 69,167,236,250, 46, 99,190,136, 85, 84, 43,165,202, 94, 3,247,242,220,158,158, -251,113,184,221, 60,109,193, 21, 64, 3, 1, 8,158,207,230,197, 65,136,127,227,218,212,215,237,239, 35, 80,129, 66,175,254,243, -120,172, 92,129, 43,219,168,173,217,134, 21,246,152,158,136,191, 50,143,167, 7,151, 15, 62,125,222,111,212, 24,219,241,109,239, -204,175, 41, 12,167, 55,126,116,167, 88,120,245,224, 73,219, 39, 35,197,173,111,205, 22, 0,124, 23,250,156, 40,126,189,229,126, -108,251, 81,134,251,204,103,103,221, 40,100,207, 39,175, 0,213,176, 40,157,175, 20,117,138,137, 26, 5,155,230,105, 70, 90, 63, - 68,254, 41, 60,111,106,200,161, 92,114, 15,131, 85,197, 9, 84, 98,121,213, 1,220,203, 78,222, 80,244,189,102,171, 86,191,190, -203, 34,138, 57, 40, 40, 3,152, 48, 71, 31, 46,189,224,239,248,206, 98,115,242,229,204,135,185,149,187,171,149,167, 55, 31, 61, -155,184,181,217,105, 20,115, 78,196,163, 86,199, 85, 48,241, 73,166, 20,160,125,181,228,148,215,235,219,248,239,224, 78, 96,170, - 62,218, 74, 0, 54, 3, 20, 37, 51, 46,250, 12,220,224,142,103,170,194,254, 36, 37, 43, 80,135,120, 31,220, 37,150,196, 23, 44, - 62, 92,225,253, 33,206,111, 44,239, 37,150, 40, 53,149, 42,246,100, 94,165, 96, 90, 60, 57,109,198,210, 0, 37,217, 99, 94,245, -106,117,163,190, 41,166, 58,242,192,130, 11,245, 50, 90,181, 77, 98, 66, 69, 47,229, 75, 64,186, 89,232,159, 55,240,240,115, 51, - 25,158,172,205,139,165, 72,179,151,134,175,136,109, 11,189,100,113,181,250, 7,140,202,206, 73, 52, 76, 82, 91,255, 15,170,252, - 75, 0,210,174,156,183,137, 32, 10,123, 79,239,250,218,245,149, 40,241, 38, 8,145, 68, 65, 38, 8,129, 16, 5,135, 20, 34,148, - 34, 63, 3,137,146,130,142, 46,127,128,154,158,154, 38,226, 71, 80,128,148,138, 2, 69, 20, 78, 72,156,216,137,143,189,103,175, -225,189, 25, 95,208, 34,165,112, 20,219, 89,123,230,189,121,239,237,119,204,231, 51,255,153,220,255,153,170,240,212,188,160, 64, -176, 56,120,161, 9,157,132, 22,255, 61, 65,190, 89,188, 8,114,167, 51,144,110,142,163, 71, 57,235, 14,189, 47, 32, 66, 24, 40, - 84, 96, 19, 30,137,235,218,149, 53, 35, 97,139, 50, 81, 18, 91, 52,123,101,149,105,189,188,228, 67,247, 55, 99,247, 78, 25, 20, -240,208,208, 77,254, 39,126,158,151, 52,195,157,144,196,184,226,134,168, 72,200,189,226,220, 95,120,205,253,219, 15,221,192,206, - 43, 5,248, 63,176, 97,189,200, 65,190, 28, 26,101,224,226, 97,233, 34,114,179, 22, 42, 22, 21, 27, 98, 38,202, 16,183, 77,153, - 68, 42,142, 32, 37,164,119, 75,178,174, 41, 69,200, 22,178,204, 36, 61, 36, 4,201,163,139, 1, 62, 1,182, 73, 20,198, 77,163, - 82,200,171,246,216, 97, 30,221, 90, 6,241,135,247,180, 36,180,250, 99, 82,190,172, 85,148,117, 89,170,154,121, 67,167,138,152, - 30,188,124,241,254,221,219, 87,207,159,246,122, 87,221,254, 80, 65,244,136,192, 38,154, 40, 87,131,168,115,252, 56,136, 6,103, -201,150,162,111,132,132, 53, 59, 78,133,100,252,129,182,154,239, 58,120, 50,137, 51, 47,164,196,131,224, 84,226,148,220, 56, 55, -182,103, 67, 0,105, 82,161,111,247, 56,137, 88, 87,208,223,220,137, 60, 18, 65, 51,157,114,101, 42, 85,206,227,167,160, 81, 54, -151, 64,194,114,131,205,132,160,250, 83, 16,179, 8, 7, 42,134, 37,156, 13, 37, 88,253,238,240,226,205,254,235,111, 39,223,211, - 44,137, 82,210, 44, 47,147, 24,201, 98,240,146,136,132,112,213,144,238,239,172,108, 13,156, 62,101,249, 29,243,106, 78, 26,249, -131, 28, 19,101,224,246, 17, 16,131,123, 15,246,127, 15, 78, 55, 87,183,123,163,139,138, 94,133, 69,209, 20, 29, 85,159, 24,220, -175,168, 22,221,208,151, 36, 57,136,124,230,226, 43, 48,209,157, 52,206, 18, 21, 37, 71,144,165, 9,173, 24, 28, 36,144, 40, 21, - 89,113,252,177,200, 60, 77,242,170, 58,246, 6, 30,241, 29,223, 30,184, 3, 88,221,157,245, 54,100,127, 55,116,217,240,149, 66, -171,106, 53,172, 74, 1, 54,143, 7, 13,199,217,245,121,231,178, 99,213,215,116, 93,235,217,215,199,191,142,225,204,131,239,186, -172, 85,158, 61,222, 51,107,203, 39,167, 63,225,208,106,175,181, 55, 90, 27,171,181, 86,189, 82,133, 47,115,169,218,128,205,118, - 57,236, 71,232, 77, 97,194, 91, 5, 49,129,190, 4,109, 35,147,168, 59,186,130,210,117,232,141, 93,196, 17,208,161, 55, 26,162, -221, 4, 58,139, 65,195, 32,178,155,119, 26, 85,118,183,114,199,151,231,231, 78,224,199,241,118, 97,197, 50,205,166,166,149,100, - 1, 78, 5, 69,212,119,215,219, 25, 13,134, 89,207,142, 99, 77,146,145,213,142, 96, 35,209,144,245, 38, 52,134, 36,116, 9,148, -245,217, 78,189,244,168,213,188,219, 50,203, 5,209, 50, 85,171, 90,168,149,212,162, 46,162,240,156, 44, 48, 71, 51, 30,174, 34, - 35,162,115, 41,109, 28, 63,195, 74,168,130, 92, 43,106,107,117,227, 71,167,239,103, 36,159,214,186, 33, 83,184,197,186, 76,118, - 3,242,229,236,235,225,199,195, 79, 31,142,186, 29,123,179,214, 58, 26,125, 62,176,158,200, 66, 18,160,161, 93,128,126,167, 40, -222,139, 23, 70,178, 40, 78,211, 48,141,161, 47, 65, 3, 99, 40, 97,104, 18,162,187, 77,100, 84,234,118,224,196, 40,115, 73, 25, - 25,146,194,209, 83,212,208,175, 14, 22,228,222,173, 54,108, 87, 12,113, 94,217,207,241, 6,139, 52, 26,220,172,185,108, 38, 42, -240,215,109,202, 85,115,197, 70, 31,115, 58, 85,247,157,235, 37,208, 41,158, 40, 67,173,167, 88, 83,242, 14,241,195,136,176,156, -148, 88,181, 53, 23, 77,134,217,240, 30, 97, 0,184,207, 57,154, 83,149,212, 70,185,225, 48,123,116, 94,219, 79, 51, 59,157, 64, - 34,179,201,192,158,161, 56, 83,166,157,144, 78, 46,143,185,100,230,152, 30,191, 48,225,116,114, 76,253, 76, 12, 81,156, 41,220, -207, 82,223, 31, 1, 88,187,114,222, 38,130, 40,188,179,183,119,189,137,131, 19,146,128, 19,142, 24, 17, 2, 2, 20, 34, 26, 16, - 66, 28, 66, 52,252, 3, 10,132, 16, 8, 36,132,132,232,104, 41,105,248, 15,208,240, 19,104, 41,104,136, 16,132, 16, 33, 14, 67, - 78,199, 78,178,182,247,240,236,201,123,207,187,193, 18, 45,157, 37,219,205,211,204,187,230, 59,254, 79,126,255, 55,215, 75,125, - 92, 83, 49,151,100,220, 53, 3, 97, 25,195,153,245, 25,242,253,117,230,203,183, 45, 44,255,175,184,251, 85,254,108, 77, 27, 63, -104,142, 85, 19, 90, 96,145, 60, 24, 33, 26,210, 95,118, 89,127,189,193,224, 81,145,239, 51, 10, 39,176,168,165, 23,187, 81, 64, -252,180, 4, 50, 8,109,240,147, 46,250,151,167, 61, 31,200,172,150,231,164,183, 4, 33,177,241,250,206, 10, 92,108, 47,114, 85, - 89,245,208,198, 37, 38,206, 2,185, 15,136,153, 66, 39,100,156,202,222, 97,102, 18, 5, 87,150, 36,150,225, 40, 33,183, 22, 13, -197, 42,224,214, 27, 65, 42,112, 47,227, 20,237,147,209,164, 5,107, 54,138,237,137, 12,154,243, 27,215, 47,191,126,245,242,246, -157,123, 51,213,234,194,194,151,141, 6,170, 11,225, 82, 69, 79,160, 69,130, 27,205,185, 8,253,162,174, 74,134, 33,115, 30, 59, - 78,124,247,214,221,135, 15,158,236,236,116, 70, 71,199, 32,184,139, 75, 95,116, 53,181,160,132,104,130, 89, 80,112,163,143,104, - 7,129, 7, 33, 20, 24,175, 11, 53,135, 13, 15, 21, 93,199,197, 37, 78, 42,133,248,120,140,142,225, 65,128, 90,127, 48, 76,147, -196,134,160, 68,154, 33,233, 66, 36,106,146, 65,110, 27,126, 27, 13,172,113, 75,163,203,150,219,117,224, 84,181, 60, 4, 12, 16, - 25,152,141, 88, 99, 14,239, 4, 84,194,201,138, 25,167, 17, 67, 53, 85, 85, 71,234, 16, 46,124, 3, 68, 34, 33, 50, 93,204, 64, -197, 66,172, 48,249, 99,237, 83, 24,241, 98, 97,224, 88,229, 56,252,102,187,211,180, 61,155,135, 30,244,233, 60,116, 33,195, 4, -100,109, 60, 96, 88,221,192,131,243,110, 42,134,174, 24, 3,186, 69,230,218, 62, 36, 80,200,191,245,118,189,227,182,182,218,155, -112,242, 35, 84, 66, 76,160, 18,107, 10,105, 77, 39,136,134, 34,165,226,224,226,201,171,136,232, 71, 61, 55,244, 21, 52,212,162, -165, 89, 62,162,200, 35, 36,213, 11,233,185,153, 11,123,138, 37, 30, 5, 72,221,101,108,223,208, 62,215,247, 6,205,193,179,213, - 51,227,165,177,179, 71,230,126, 53,151, 75, 70,113,203,181, 77,221,156, 26, 61,220,236,108, 79, 12,239,111,116, 26,231,103, 47, - 45,253, 94, 20,101, 41, 65, 34, 50, 90,180,107,178,234, 67,142, 34, 62,203,186,189,254,181,182,184,178, 94,131,134, 26, 46,238, -233,195,167,230,127,124,248,177,241,253,103,189,102,123,173,205, 22, 84, 47,182,229,108, 83,235,200,102,171,179,171,219,107,211, - 19, 71, 57, 15, 52,136, 30,106,163, 35,146, 86,200,149,105,119,101, 77, 42,229,131,189, 55, 91, 93, 96,215, 78, 20, 62,172,110, -214,125,223, 14,184, 41,153, 80,205, 97,248,244,163,168,205,187,203,142,123,121, 66, 88,234,124,123,191,182,241,166,182, 12,127, - 24,179, 44, 89, 76,187, 49,251,102,243, 38,247, 86,218,157,118,200,203,162,120,127,174, 58, 61,110, 76,150,213,201, 61,133,242, -128, 6,129,134, 81, 37,243,119,237,249,138,244,166, 97,252,128, 74, 6,138, 44,193, 81, 52, 53,217, 82,148,189,165,194,244,161, -145,182,195, 63,175, 54,177,215,143,138,107, 62, 52,239,201,232,224,184,156,136, 11,205,229,249,198,206,211,103,143,159, 63,122, - 49,103, 94,217,146,107,111,221,119, 55,167, 46, 76,237,175,172, 52, 54, 18,194,176,147,190, 6, 17,174, 19,116,169,134,132, 24, -166, 9,196,217, 9, 92,212,224,139,131,145,210,120,195,110,194, 76,131, 23,146,176, 50, 49, 57,163,226,164, 69, 2,153,117, 4, -161,155, 97, 28,103, 76,221,204,118,148,245,203,167, 83,239,153, 26, 10, 10, 76, 66,106, 24, 50,134, 16,159,157,231,119,135, 59, -112,174, 38,135, 39,219,112,102, 8,202, 65, 6,160, 73,254,104,151, 77,144, 80,177,160, 43, 71,227, 95,145, 28,104, 34, 68,208, - 67,187, 32,102,162, 6,189, 77,130, 72,171, 24, 18,230, 11,221, 36,205,120, 86,121,102,239, 77, 2,140,229, 15,218,164, 9,132, - 29, 89,165,124,192,118, 91, 36,233, 30,247, 28,117,122,137, 48,217, 5,143,167,100,152,158, 17,248,255,213, 31, 72,255, 8,192, -217,181,180, 54, 17, 69,225,153,201,244,206,100, 38,175, 54, 73,155, 62,172,210, 46, 68,164,136, 40, 86, 91, 16,235,171,116,171, -155,138, 5, 21,252, 1,226,198, 86, 10, 82,172,160, 86,220,248, 27,220, 11, 86, 20, 4,139,219, 34,138, 82,211,151,109,218,216, - 87,250,176, 73,218,100,222, 19,207,185,119,210,135,232,198, 77, 8,116,146, 78,102,230,158,251,157,243,157,243,125,255, 25,223, -249,127, 56,239, 9,123, 34,251,222,106,212, 95,177,190, 39,215,190, 59, 43,189,251,215,242, 54, 32,240,229, 16,143, 52, 61,199, -108,105, 4,193,155,208, 96,196,132,195,166,126, 89, 9,131,130, 24, 68,207,180, 47,194, 41,255, 39,129,178,166,251,115, 12,108, -148, 52,118,206,162,172, 69,204,197, 2,113, 34,202, 58, 34,184, 29, 3, 17,220, 66,227,161,154, 34, 64, 63, 74, 36, 1,178, 67, - 80,142,217,150,187,171, 91, 15, 96, 86,244,151,112, 14, 3,235,140,126, 73,210,121, 72,120,241, 38, 19, 34,134, 20, 18,196,230, -112, 81,146, 81,170, 9,246, 96, 3,141,210, 56, 17, 69,180, 5, 63, 28, 16, 32, 17, 85,174, 10, 34, 74,106,168,142, 12,244,223, - 31, 30,126,253,246,205,240,249,142,142,174,206,206,201,201,241,133,165, 21, 1,123,251,124, 84,234, 13, 35, 53,173,227,251,116, -195,222,202, 27, 55,186,187,123,186,175, 61,126,254,244,209,208,208,135,145,145,169, 31,211,182,165,117,180,181,222,234,185,198, -217,230,207,116, 58, 18, 9, 61, 25, 24,236,186,120,105,108,236, 91, 65,211,164, 10,241,225,189,187, 15,250,122, 57,199, 72, 78, - 36, 67, 42,241,188, 8, 75, 28, 65,214, 12,246, 24,188,173,176,158, 81,227, 69,179, 32, 38, 66,120,210, 45,131, 10,231,243,140, -151,134, 69, 24, 11,196,242, 58,132,123,116,224, 43, 26,133,198,104,211, 90, 46, 3,231, 5, 24,156, 47,211, 22,138, 28,160,182, -233, 16,158,173,171,237,221,233, 76, 10,155,172,233,252, 20,128,146, 88,184, 26, 94,233,253,226,240, 61,199,165, 50,179, 91,219, -185, 10,145, 68, 3,113, 42,186,109, 50,201,126,248,126,148,196,227,113, 38, 5, 30, 1, 52,176,183,117,205, 49, 32, 4,155,182, - 85, 27,169, 93,207,175,162, 90,128, 63, 44, 19, 63, 44, 78,139,142,167, 1,212,132,227, 67,106, 68,183,182, 96, 37,147, 10, 9, -226,254,244,226, 56,108, 3,186,165,159,104, 62,181,176, 49, 7, 33,163,104, 98,251,150, 76,148, 11,199,206, 37,231,191,103, 11, -155,139,107,105,147, 85,122, 57, 62,167,109, 82,114, 30, 18,154,226,252,234,124,162,178,246,203,236, 87,120, 78,178,133, 44,124, -231,218,246, 90,193,208,224,226,152,142,253,105, 98,244, 64,188, 17,178, 4, 88,146,137, 72,117, 75,235,217,185,212,148, 97, 25, - 76, 75, 69, 33, 74,208, 31,146,136, 2,207, 85,219,145,211, 99,115,201,165,236, 50,205,123,152,156, 56,118,175, 67,176,160, 63, - 86,155,207,164,117,219, 90,220, 88,130,220, 37,172, 70, 26,226,141, 40,108, 75, 47,100, 93, 52, 1, 25,131, 95,194,193,108,212, - 97, 54,114, 2,103, 43,129,202, 88,201, 62,217, 94,189,178,188,158,213,140, 77,200, 28, 93, 94,179,177, 91,182,232,152,155,122, - 81,179,220,203,245,137, 90, 85,106, 73,168, 65,128, 7, 14, 87,163,194,201,248, 98,138,242,126, 38, 51,147,203, 42,190,210,205, -195, 13,207, 58,143,158,105,130,156, 66,174, 10,201,168,255, 12, 64, 6,213,129,217,172, 39,239,185, 53, 83,106,145, 9,204, 65, - 54, 8, 73,100, 64, 34, 97, 69,172, 9, 41,245,135,162,156, 74, 62,142,206,234,148,191,241,185, 34, 17, 14,174,195,213,182,173, - 0,239,127,151,250, 28,115,155,111,247, 95, 31,236,123,113,167,185,247, 85,246,229,172, 61,119, 37,113, 60, 83,252,149,215, 10, - 46, 85,130,100,244, 41,188,162, 69, 53,186,166, 56,176, 86,240,242,226,142,237, 26,244,128,130,169, 37,170,234,242,216,133,226, - 6,229, 32, 85,185, 40,178,201, 91, 22, 51, 72, 5,129,207,209, 58,134, 87,142,103,182,209, 46,245,231,115,153,215, 52, 50, 82, - 6, 45, 94,194,175,144,116,175,126,226,201,199, 64,220,205, 1, 18,199,134, 26, 44,139,215, 71,235,225,131,134,101,122,229,120, - 10, 95, 28, 44, 97,122,166,121, 20, 42, 32, 1,230,141,222, 9, 30,127,139,131, 87,216, 1,196, 10, 12,229,160, 78, 43, 60,212, -118,133, 41,101,120, 69, 33,183, 76,223, 66,106,178,165,229,177,167,205, 41,253, 97,121, 90, 78, 53,184,168, 26, 21,125,196,116, -116, 70, 42,236,139,238, 52,167,249, 45, 0,105,215,242,211, 68, 28,132,187,175,110,183,187,219,165,143, 32,149,130, 16,208, 72, - 12, 42, 33, 18,245, 34, 32, 70,241,113, 50,122,225,100, 60,249, 8, 68,188,105, 60,152,104, 34,122,241,194,159,224,149,120, 48, - 38, 30, 37,162, 72, 66,124,159,136, 81, 81, 35,150,176,180,108,187,191,118,183,219,117,102,182, 69,144,163,215, 77,147,118,183, - 59, 51,223,252,230,155,239,251,223,252, 30, 36,119, 5,138, 55, 82, 89, 42,155, 85,192,184,205, 25,253, 95,132, 78, 35, 12, 94, - 14, 41, 17, 94, 47,227, 42, 41,191,126, 61, 84,199,236,245,210, 20,152,244, 2, 50, 14,254, 61,158, 56, 24,124, 82, 75, 65,223, - 26, 72, 40,173,215, 9, 63, 20,156,186,113, 94,221,180,132, 11,109,221,210,173,229,110,110, 75, 1, 2, 12,192, 92, 91, 37,129, -233,186, 61,174,223,104,164,179,249, 95,129,112, 82,109, 99,130,216, 58,104,245,199, 9,244, 49,156,190, 16,119,203, 23,112,251, -199,143,235,178,162,225,192,148,167, 61, 84,145,134,221, 72, 56, 65,177, 57,158, 28,156, 81,123, 0,229,218,101, 30,176, 15,128, -122, 69,174,170, 74,200, 41, 21,134,143, 15, 52,103,210,247, 38, 30,204,205,191,155,121, 53,123,168,239,224,224,145,254,143,159, -222, 88,107,102, 88,146,170, 85,161, 66,179, 30, 40, 54,142,235, 47,175, 20,206,157, 57, 53, 54, 58,126,119,226,254,212,147,103, -208, 81, 71, 20, 81, 18,253, 84, 66, 29,189,114,121, 96,240, 68,123,199,206,169,199, 79,251,122,251, 46, 93,187,222,190,171,107, -105,241,219,235,249,183,137,134,228,248,216,104, 75, 91,107, 92,147,167,167,159,151,113, 41, 16, 33,138, 16,152,156, 19, 29, 19, -210, 14,114,112, 28,223,119,185,136,168, 58,110,153,136, 70, 53,250, 47, 46, 14, 34,129,193,133, 20, 67,146, 70,104,213,228, 97, - 28, 66,152,121, 81, 57,134,218,156,142, 29,204, 88, 92,244, 29,193, 46,229, 75,246, 51,115,138, 56,120,230, 67,186, 28, 67, 7, - 90, 49,108, 57, 22, 32, 47,192,206,165,114, 17,174,192, 3,147,194, 18, 29,220,121,221, 59,246,114,156,176,198,114,212, 71,121, - 36,165,128, 99, 12, 37, 28, 65,195, 82, 98, 74,192,251,221,160,198, 85, 89, 63,127,113,100,238,229, 44,148, 76,228,158,186,142, - 22,213,237, 50,148,191,114, 58,217,156, 47,172, 0,242,221, 22,111,206,219,104,220,129, 13, 10,249, 88,194,215,193,239, 73,234, - 88, 87, 82,177, 70, 8, 91, 40, 15,191,204,159, 56, 6,193,150,139, 30, 7,134,174,215,209,212, 97,163,136, 96,216, 33, 14, 79, -111,231, 62, 69,138,124, 55,127,144,239, 46,110, 31, 66, 55,153,212,227, 69,167, 4,245, 38,207,114,112,227, 75,185,236,194,194, -251, 98,137, 65,246,129,231,131, 38,200,118, 14,146, 53,244, 49, 78,213,205,230,150, 1,158,227, 90,130, 20,214, 85, 3, 85,230, -229,232,106,209,130,103, 11, 21,162,232, 22,144, 49,197, 11,201, 88, 98,141, 21,172, 18,160,251, 44,137,195, 8,109, 77,237, 75, -230,111, 0,155,128, 31, 49,120,189,146, 72,227,248,168,210,176,163, 90,233, 58,214,108,152, 5,168, 46,174,235, 21, 42,206,226, - 90, 97,209,178, 76,219, 94, 97,120,112, 49,178,187,101,127, 90, 75,104, 34, 99, 94, 90,143,115,130,200, 92,167, 65, 84, 62,254, - 48, 47,244,100, 30,158,238, 62,123,184, 45,189, 93,147, 99, 34, 30, 29, 18,199, 70,172,233,241,109, 32,147, 5, 1, 41, 32,103, - 0,128,130, 42, 3,114,151, 12, 53,156,130,122,208,146, 12,181,166, 62,188, 88,248,178,108, 1,218,135, 52, 13,193,104,218, 6, -243,188,161,158,129,182,120,230,206,204,163,225,254,147,195, 7,134,110, 79, 78,222,234,188,122,243,235,141,164, 22,235, 51, 50, - 89, 27,217,253, 14, 49,179, 16,191, 35, 57,160,130, 30, 35, 94, 37, 44,171,144, 97,161,224,185, 53,137,118, 31,250,102, 72,245, -171, 44, 31,140, 31,109,136, 25, 86,164, 12, 30, 80,200, 81,137,132, 58, 36, 66, 35, 53,130,164,175,202,170, 22,137,176, 82, 73, -226,197, 61,153, 61, 57,203,164, 93,214,154, 64, 47, 36,247, 32,231, 24, 81,131,149,109, 67, 49,112, 30,190,126,219,104,196, 87, -101, 21, 22,236, 52,209, 98, 9,130,106,200, 56, 9, 53, 85, 44, 91,180,148, 80,221,232,199,244,215, 72, 2,194, 72, 20,143,118, - 15, 65, 13, 13,104,240,117,106, 62, 2,156, 42,157, 16,214, 53,203,124, 61, 98,144,155,185, 75,188,143,128, 14, 90, 35,231,111, -112,203,224, 2, 60, 0, 97, 5,239,213,250,122,110,136,175,111, 3,213,147,253, 31, 1, 72,187,158,159,166,225, 40,222,118,221, -218,110, 93, 7, 99, 3, 7,168, 35, 1, 61, 24,163, 96, 60,112, 83, 19, 61,120, 81, 76,188,121, 86, 99, 36,222, 77,140,241, 47, -144,139, 7,163, 71, 98,162,241,230, 69, 61, 24, 19, 18, 2,152,120, 81, 8,200,175, 0, 3, 54,112,172,108, 93,215,118,237,183, -190,247,190,131, 96,226,205, 11,151,166, 25,109,250,125,239,243,222,251,188,207, 71,254,255,177, 42,201,126, 50, 55,244,196,127, -169,183,139,255,238,223,224,125,100, 29,214,148,132,136, 33,118,184, 2, 46,230, 29, 49,214, 16, 15, 57, 49,137,104,210, 70,219, - 16,190,205, 68,242,225,168, 27,227,193,179,152,214,158,200,165,211, 48,157, 74, 36,123, 26,240,109,130, 16,151, 60,249, 98, 20, - 3,196, 7, 87,136,124,253,151, 51, 96,120,100,166, 34, 30,200, 78,162,109, 8,122,198,187,180, 6,134,241, 13, 2, 90,201, 44, -228, 59,251,215,118, 87, 67,242,107,245, 57, 41, 8, 59, 18,126,200,142, 40, 18, 75,129,196,163, 35, 41,100, 39, 84, 56, 30, 33, -149, 79,200,209,246, 14,228,162,209,205,142, 80, 15,170, 56,201,188, 85,133,116, 63,128,242,183,111,142,192,197,203, 87, 46,189, - 25, 31,135, 7,235,201,101, 45,107,247,249,216,179,209,135,247, 31, 61,184,243,226,229,171,205,173,114, 40, 40,136, 75, 68,185, - 14,176,173, 90, 59,119,230,236,147,199, 79,223,189,127,251,249,203,215,118, 35, 30,141,224,108,212,107, 50,148,231,142, 39,165, -152,114,172,179,219,208, 53,145,121, 77,171, 34,163,156,124, 0,181,130,174, 6,229,210,122, 79,111,166,110,253, 78, 37,177,194, -128,127, 12,238,162, 70, 23,186,176,210, 9, 9,229,152, 16, 85,133,170, 21,216, 94,149, 43,241,225,204, 62, 8, 91,219,196, 98, -232,186, 13, 17,149, 49, 80,137, 23,146,110,189, 81,203,182,231, 74,149, 77,203,173,122,126,204,136,183,153,246, 30, 30, 88,252, -170,177,192,199, 49, 6, 42,136,161,130,163, 43, 57, 2,138,246,217, 90, 52,225,250, 13, 37, 18, 59, 92,130, 71,221, 20,198,178, - 70,219, 74,113,137,183, 35, 3, 34, 27,196,225,168,135, 68, 13,151, 88, 20, 48,191,172,192, 25, 27,204, 15,253, 92,255,177, 82, -252,181, 52, 54, 15,111, 19,210, 76, 66, 51, 6, 79, 95,152, 90,152,132,252,122,190,239,226,236,198, 44,224, 98, 72,178, 0,136, -180,168,230,133, 46, 45, 91, 69, 80,105,144,161,189,215,190, 85,129, 74, 8,155,233,204,255,182, 56, 5, 40,158, 83,229,250,115, - 3, 59,102, 17,242,141,174,104, 52, 58, 11,211,201, 14,199,109, 44,151, 86, 11,229,109,172, 81,136, 2,197,181, 77,160,204, 41, -154,174,235, 57,149,208,116,124, 63, 66, 86,218,105,221,216,183, 45, 27,144,169, 8,225,190,228,120, 46, 60, 87, 91, 34, 5, 81, -222,180,171, 97, 68, 66, 55, 71,230,236,163,100,141, 32, 57, 82, 54,149, 85,100,117,163, 92,240,253,166, 97,164, 0, 53,171, 49, - 93,139,153, 39,114,125,197,221,109, 72, 27,112,248, 23, 10,243,183,134, 71, 22,183,150,230, 54,230, 18, 74, 92,143, 27,158,103, -225,251,141,168,125, 70, 32,244,180,119, 13,157,188,209,155, 28, 92, 75,127, 47,236, 76,174,149, 38, 54,253,229, 74, 75,244,117, -187,102,159,234,200, 47, 20,119,218, 81,146, 16,208, 61,228,193, 32,147,145, 95,223, 27, 78,247, 27,200,112,193,158, 21,195,191, - 62, 58,156,161,182, 1,162,137, 64, 66,225, 53, 40, 30,169,145,142,118, 29, 98,139,120, 32,241,166,124, 68,210, 84, 33,103, 8, -221,153,181, 79,115, 51, 11, 91,138,170,194, 87,228,161, 37,135,237,251,141,122,179,241, 97,230,227,128,158, 55,133,202,232,213, -187,194,132,160, 11,153,206,148,188,227,172, 92, 63,126, 13, 78,145,195,184, 9, 31, 25,146, 96,194,100, 70,220,128, 32,110,122, -251, 77, 76,135, 62,149,187,248, 85, 16, 83,140,117,165,115,155,149, 45,194,251, 76,100,173,110,110, 92, 81,242,153,252,108, 97, -150, 52,142, 15,212,106, 14,120, 28, 62,223,254,134,194, 61,240, 86,118, 87,155, 45, 46, 59,141,214, 25,141,255, 69,142,221, 68, - 53,170,229,210, 61,181,109,139, 70, 50, 2, 13,143, 5,139,246,245,196, 86, 31,133,219,193, 98, 85, 86,169,149,201, 30,190,229, -249,160,107, 41, 8,247,212,206, 33, 47, 9,137,155, 36,251,211,139,211,156,204, 77,216, 8, 95, 93,192, 91,248,232, 63,101,192, -215, 85,119,170,240,187,166, 93, 38,142, 6, 22, 31,212,147,105,105,221, 28,238, 24,113,131, 86,106, 58, 64, 76, 67, 87, 6,244, -159,226,215,217, 17,123, 38,186,243,143, 0,156, 93,219,107,211,112, 20, 78,154,164,205,173, 77, 91,186, 91,101, 43, 78,145,213, - 61,120,163, 40, 34, 27,226,188,224,196,127,194, 63,100, 47,162, 8, 42, 40, 40,190,249,162,224,133,233, 94, 28,226,152, 47, 62, -137, 56,134,224,132,137, 91, 59,183, 98,183,118, 77,219,180, 77,155,180,241,156,147,164, 19,246,230, 75,161, 16,146, 38,205,239, -252,190,115,206,119,190,239,127,240, 59,187, 79,177,221,217,163,207,239,171,240,251,223,124,143, 86,206, 7,233, 52, 44,205, 8, - 26, 27,107,195,173, 49, 77,234, 61,246, 84, 52,123, 72, 63, 64, 18, 4, 33,142,145, 5, 70, 20, 80, 87, 69, 86, 5, 45, 4, 25, - 33,206, 82,211, 92, 27, 2, 45,100,124,243, 68,211, 96,123,181,122,183,199, 75,236, 26, 34,175, 8,182,231,121,184, 55, 0, 27, -150, 53, 52,249, 35,175,122,111,138,138,142,128,213,238, 16,133, 69,224,120, 11,123,242,108,165, 94,166,135, 27, 96,124, 45, 62, -108,109, 3, 34,101, 93,114, 33,235,139,163, 16, 86,103,152,152, 38, 75,146, 64,234,149, 88, 49,162,233, 63,135,166, 52,145,125, -168, 72,108, 88,229, 21,137, 83, 69,116,182,163, 9, 79,136,239,194,149, 11,151,175, 78, 95, 91,254,186,244,236,197,107,164,129, -144, 53, 73,126,167,242,115, 53,123,126,242,226,225,131,233,149, 31,171,186,174,135,130,128,218,172,174,109, 77,156,201,220,191, -125,115,113,113,225,222,163,199, 8,169,120, 1,155, 50, 29,167,101,117, 43,134,153, 74, 14,167,199,198,231,231,223,189, 95,248, -216,172, 55, 70, 83,131, 27,185, 95,115,115,111,224,106, 1,206, 54, 42,250,238, 78,225,213,236,236,250,198,182,101,115,173, 22, - 90,117, 3,100,178,108,200, 33, 0, 74, 59,144,222,227,124,178,217, 65, 54, 63,122, 31,119, 92,224, 65, 8,222,115,156,233,146, - 89,172, 87,152,164,182, 80,221,172,187,253,126,216, 41,169,114,210,130, 40, 79, 7,119,130, 60,198, 77, 27, 13,117, 81,164,129, - 92,195, 24,148,120,179, 77, 77,142,163,137,146,133,188, 96,215, 29, 13,226, 30, 60,173,146, 94, 4,196, 61,220,151,210, 27, 58, - 44,120,139, 36,151,109,172,179, 90, 17, 41,170, 73,145,114,189, 12, 40, 24,128, 12, 18,144, 56, 78, 10, 41, 2, 36, 4,205,106, -185,182,139,226,218,172, 19, 87, 19,219,149, 60, 97, 7, 14, 48, 93,211, 52, 68, 81,137, 40, 17,145, 23,189,177, 17,248,111, 56, - 30,192, 50,121,221, 53,176,245, 29,148,162, 74,220, 68,181, 12, 22,221,141,109, 43, 38, 71,221,146,238, 86,121,203, 34, 78, 78, - 88, 14, 91, 22,252, 66, 38,213,119,144,135,109,208,233,106,138, 86,208,113,128,126, 40,145,204,140,101,178,127, 54, 84, 81,134, -203, 2, 24,207,109,163, 71,235,120, 42,189, 94,200,186, 12, 43, 41,168, 84,205, 90,127,100, 0, 93, 35, 2,206,161,228,145,146, - 81,134, 0, 4,155, 4,132, 25, 3,133,122,112, 93, 67,240,202,239,230, 91,182, 85,107, 84,225,133,135,128,114,244, 64,122,179, -148,223,169,149, 54, 75, 91,154,170,169, 18,228, 85, 77,155,100,126, 97, 21,159,148,248,196,244, 8,106, 70,198,130, 90, 50, 50, - 54, 20,205, 36,212,201, 99,167,238, 62,125, 50,115,253,236,183,207,203, 95,114,197, 27, 19,167,203,213,182,137,141,150, 54, 60, -142, 19,163, 67,233, 75,105, 41, 29,103, 20,142, 9,161,188, 31, 42, 9,243,110,131, 44,224, 17,160,112,242, 8,189, 89, 56, 28, -219,192,128, 30, 20,224, 81,195,171, 43,132, 68,129, 87, 69, 86,147,152, 84,130, 73,245, 23, 62,124,127,185,176,226,208,120, 5, -102,171, 88,123,178, 98,252, 72,169,141, 1, 0, 18,238,183,107,159, 30,222,122,176,244, 60,187,182,250,123,106,112,234, 78,110, -230,220,192,113, 53,192, 26,216,162, 64, 62, 25,124,138, 33,153, 74,112, 40,156,105,218,109, 49, 40,193,182,106,180,234, 54, 89, -121, 96,175, 10, 64, 27,238,214, 6, 41,176,203, 49, 37, 10,233, 78,135, 56, 14, 5,200,114, 28,223,231,211, 21, 1, 38, 61, 1, -154, 51,183, 90, 88, 96,196,184,130, 19, 27,254,112,235,158,224,172,103,145,138, 6,138,197, 90,145,241,116,194,240, 29,137, 72, -154,141,132,225,142,219, 79,234, 73,128,209, 75,220,237, 21,191, 59,100,225, 68,140,199,128, 87, 80, 32, 68,228, 96, 97,199,244, - 9,239, 84,177,241, 8, 58, 24,242, 97,141,144,162,120, 39, 10,183,105, 26,112, 18, 76,151,233,114,190,115, 72,175, 1, 28,248, -167,195,232, 1,203,174, 55,200,229,247, 5, 60, 34, 61,158,255,175, 0,148, 93,203,107, 19, 65, 24,159,221,205,206,100, 51,102, -179,105,154,182,150, 90,170,130, 10, 85, 65, 65,188, 41,234,217,139,130, 21, 4, 81,161,244, 15,208, 83, 47, 94,196,179, 55, 79, - 30, 68,252, 11,172,130,224, 77,188,212, 23,130,158,108,141,212,119, 95, 73, 54,187,217,157,221,201,174,223, 55,155, 71,149, 34, - 8, 33,228,144, 77, 54,155,157,153,239,247,205,239,241,127,252, 72, 78,185,162,150, 39,127,133,172, 26,100, 11,229,112,187,201, -189,247, 90,223,210, 35,234, 86,249, 6,140, 58,212,172,234,221, 93,120,178,181,161,141, 6,230,153, 38, 44,147,170,102,125, 24, -170,153, 5,152,229, 25,210,215,154,114,179, 37, 93, 45,235, 95,170, 36, 81,100, 41,169,107,154,100,206,253,136, 18,176,249, 14, -227, 25, 89,240,218,192, 91, 24,109, 66,243, 37, 79, 52,179,139, 88, 46, 12,213,219,155,138,249, 66, 80,209,131,253,129,200, 32, - 57, 12,237,213,254,165,198, 85, 10,218,180, 43,230, 35,186, 73, 13,184, 3,166, 70, 43,188,196,189, 40, 74,115, 68, 17, 7,160, - 16, 67,171,244, 60,211,113,151, 80, 89,206, 40, 72,130, 40, 69, 68,169,140, 83, 17, 68, 38, 51,170,206,208,218,198,166, 16,210, - 48, 77,197,230, 68,144, 22, 75,113,236,200,129,185,217, 57,198,172,133,133,167, 47, 94,191,161, 6, 61,115,250,212,204,249,243, -139, 47, 23,111,222,186, 29,202,152, 82, 83,185, 63,198, 57,244,251, 79,124, 95, 88,140,237,157,156,168,125,253,134,109, 16,211, -112,138,220, 48, 18, 41, 5,165, 84, 68,157, 32, 4, 4,172, 5,161, 76,240,236, 50, 86, 32, 34, 33,169,220,181,177,120,128,251, -214, 76, 98, 47, 14, 93,101,133, 45, 59, 73, 95,169,221,231,162,162,216,154, 97, 29,156,116,254,216,139, 81,188, 14,135, 87,220, -112, 19,254, 9, 10, 64,197, 4,144,128, 18, 51, 24,165,217,134,103,182, 27, 93,182,202,110, 80,135,226,221,230, 14,207,243,149, -245, 21,180,165,213,153,129, 84, 31,230,161, 90,149,156, 56,120,230,249,251,103,197,130,221, 10,176,125, 49, 98,143,192,145,117, -127, 3, 64,116, 61,168,219,121, 7,144, 28,148,177, 1, 64, 1,106,185,200,155,150,147,163,187, 97,150, 10,164,175,230, 74,173, - 98, 87, 83,140,200,176,106, 63, 63,193, 7,195, 82,177,230,174, 14, 23,171,240,206,118,232, 41,211,177, 68, 79,117,228,164, 26, -180,128, 94, 49, 18, 78,137,211, 29,109,225,193, 42,197,114,152, 98,229, 20, 74, 20, 87,208, 8,138, 95,101, 92,172,181,195, 32, -111,154, 65, 20,194,225, 83,163, 83, 75, 63, 62,162, 98, 86,203,149,237,138,219,118, 67,108, 88,117, 42,246, 48,103,214,151,245, -239,251,199,247,173, 53, 87,225,132, 97, 38, 26,117,198,154, 42,108,182,238, 53,213, 64, 36,147,149,137, 80, 10, 76,214,182,203, - 81, 36,224, 47,203,226,182,212,221, 8, 95,129, 19, 36, 38,202, 14,239,218,104,173, 21, 25,255,222,248,165, 8, 5, 68, 17, 91, - 17, 14,134, 29,121,173, 90,157,190,115,156, 52, 91, 68,248, 68,198,164, 17, 18,215, 39, 95, 55,200,236, 13, 50, 50,253,224,202, -165,203,247, 31, 79,151,121,153,210, 49,110, 13,197,226,250,185, 11,251, 46, 30, 37,162, 70,178, 93, 91, 25, 1,252,193, 71,140, -124, 74,124,192,130, 31, 41, 97,115,156,116, 83, 27,244,222,208, 52,149,196, 35,111, 16,187, 64,118, 58,240,188,252,240,213,189, - 39,239, 12,150, 43,193, 15,134,107,134,196, 92,184,163,224,240, 61,203, 13, 86, 54,249,226,234,231, 71, 43, 31,226,165,245,249, -147,119,247,179, 67, 86,169, 49,243,246,236,252,225,171, 2, 80, 28,218,131,171, 30,117,154, 20, 57,247, 3,159, 50, 6,232, 80, -166,178,104,149, 90,194, 11, 35,152,239, 84, 46, 70,182, 1,139,145,197, 26,114,156, 66, 15,170, 52,228, 43,147, 78,211,111, 64, - 5, 6, 75,117,128,205,150,190, 16,105,187, 73, 73,207, 98,171, 7, 42,168, 44,251, 71, 51,250,138,161,158, 33,153,146, 83,193, -202, 4, 21, 70,208, 9, 49, 77,138,200,204,155, 62,233,217,201, 15,120, 53, 90, 58, 86,218,169,212, 9,105,223,231,182,155, 61, -217,255,162, 4,150, 63, 88, 29, 45,192,112,217,231,119, 20, 18,130,197,205, 52,204, 49,103,188,182,190,172, 39, 0,169, 11,126, -164, 18,101,211,191, 90,235,106, 27,164, 27, 27, 58, 32,252,104, 3, 21,171,214, 11,207, 32,191, 5,160,236,106,122,154,136,162, -232,155, 78,167, 51,237, 76,237,148, 82,138, 16, 52, 6,197,165, 26,191,162,198,133, 11,221,224, 82,113,239, 15,208,149, 27, 99, -226,206,165, 27,227,210, 16, 19,130, 97,161, 38,184, 55,193,152, 72, 52,113, 65, 98, 74, 0, 45, 33, 64,161, 80,166, 31,211,233, -124,143,247,222,215, 22, 48, 38,198,132,174, 40, 83,242,122,223,189,231,221,119,238, 57,255,151,223,117, 5, 22,186,201,243,187, -240, 39, 51,242,159,201,157, 31, 96,176, 91, 18, 68, 61,187,215,168,215, 26, 23, 89,236,128,158, 48,158, 58, 36,148, 46, 97, 97, - 71,155,158, 58, 81,212,124, 39, 3,106,140,175,132, 40,231,149,188,156, 16, 43,237, 77,178, 49,100,212,207, 66, 2, 17,108, 66, -159,243, 86,121,138,199,137,106,156,143,143,132,253,166, 76,216,241, 45,161, 91,145, 40, 28, 56, 50, 88,105,108,198,208, 77,139, -127,217, 17, 59,124,175,241, 87,137, 30,236, 14,193, 73, 34,112,137, 25,137,220,204,209,194,216,234,222,207,211, 67,185,225,163, -250,142, 5, 56,137,137,113, 8, 68,128,237,130,170, 98, 71,215, 48,253, 54, 10, 35,138, 0,130,208,172, 74,194, 67,162,135,238, -105, 0,101, 1,193,161,151,120, 66,194,154, 37,137,164, 85, 0, 27, 88,198, 98,211,223, 55, 48,113,231,238,245,171, 55, 72,142, - 44,130, 44,240,126,118,118,122,230, 29,228, 2, 77, 69, 52,234,121,161,105, 57,212,191, 12,249, 34,194,195, 69,186,117, 70, 70, - 27,164, 96,228, 67, 98,101,133,189,226,194, 27,209, 98, 76, 16, 37, 12, 32,248, 43, 84, 36, 38,157,108, 8, 9,128, 74,142,135, -123, 40,176,156,168, 77,194, 34,216, 41,100, 8,161, 16,214,113,114, 13,242, 10, 52, 73,115,176,217,139, 33, 4,169, 16,254, 55, - 7,105, 69,184,188,253, 90,206,104,213, 97,227, 13,103,143, 3, 12,183,156, 6,252, 86, 22,225, 52, 47,183, 61,147, 68,171,209, - 4,110, 95,224,148,114, 7,234, 82, 73, 10, 50, 19, 92, 62,132, 29,144,188,119,128,164,118,234,155, 15,102, 10, 53,106,163, 43, - 36,221, 60,210,127,252,220,216,153,111,197,239, 91,245,245,184, 24,111, 57,173, 39, 19, 79,167,230,166, 74, 91, 37,188,100,243, -160,242, 37, 56,234,191, 56,118,121,161,180, 64, 30, 32,168,255,142, 83, 39,177, 48,167, 14,192, 39, 86,205,157,219, 23,198,171, - 53, 99,169,188,168,167,178,199,242, 35,139,107,197,209,194,137,181,202,234, 96, 95, 97, 99,103, 93,142,163,155,226,217,209,243, -203,107, 63,224, 57, 95,138,159,179,233, 62,203,177,168, 11, 32,168, 74,202,245,189,177,161, 83,155, 70,217,180, 91, 50, 30, 92, - 92, 45,165,193, 34, 25,102, 45,151,214, 93,156, 18, 80,171,102,213,178, 45,212, 83,171,111, 3, 82,133,122,102,187,166,139,197, -209,215, 85,125,215,172,202,177,120, 38,173,251,190,103, 90,200,177, 67,251, 59, 65,208,147, 58, 0,216, 82,101, 5, 22, 31,135, - 3, 18,138, 26, 79,214,237, 58,178, 89,176,116,229,154,237, 93, 69,140, 65, 5,184, 21,215,110,190,188,198, 60,147,193,210,193, - 55,101,217,172,217, 14,139, 43,243, 75,236,237,122,253,249,167,175, 7,163, 55,207, 88,197,217,102, 9,131,205, 79, 50, 49,129, - 26,100,112,136,131,228,110,187,204,241,240,199,134, 92,143,184,151, 91,192,247,114, 11,102,118,136, 99, 25, 39,238, 88, 86, 5, -216,206,170,173,185, 23, 31, 95,207, 21,149,148, 12, 85, 90,146,196, 40,140, 53, 60,191,108,186,203,181,230,162,209,130, 8,130, -122,233, 4,238,196,240,253,153, 15,175,238, 93,122, 60,121,229,217,131, 95, 15,223,212,166, 31,157, 28, 47,219,123,252,198,146, -252, 37, 67,174,247, 11,197,219,116,224, 25, 72,241, 13,136,164, 70, 19,172,232,183,227,147,250, 16, 66,142,174, 79, 19, 64,207, -148,146, 46, 27,101, 44,136,252, 52, 73,183,164, 20,165,225, 1, 13,166, 14, 89,183, 75,253,232, 56,163,194, 91,149,132, 34,139, -201,166, 83,239,136, 10,116,211, 59, 32,131,141,189, 45,220, 26, 2,119, 1,100, 92, 6, 63,136, 56,163,166, 35, 42,201,122,183, -115,221,100,152, 73,101,146, 82,114,187, 1,101,152, 16, 62,137,167,116, 7,116,104,136, 70,224, 2,136, 29,179, 61,222,136, 39, -129, 25,120,146,168,201, 42, 32,128,110,146,140, 14,245,195,187, 89,139, 26,200,135,140,143,216,254,212, 15,190,126, 11,192,217, -181,180, 54, 17, 69,225, 59,175, 36, 51,147, 71, 77, 72,155,151,182,180,181,136, 80, 5,119,174,220, 20, 92,136,123, 65,252, 9, - 46,220,232,202,157, 27, 65,253, 25, 22,244, 23, 8,174, 20, 20, 69,169, 84, 93,105, 91,219,218,230,157,102, 50, 73,230,102,102, - 50,227, 57,231, 78,108,213, 34,232, 46,144, 48,147,185,115,239,121,124,231,156,239,251,159,249,166, 99,131,247,240,144, 66,224, - 79,227,142,191,194, 6, 85,106,101,201,153,249,102,191, 38,253,202, 5, 25, 34,206,110, 14,125, 71, 10, 35,166, 8,141,233,212, -237,137,129, 69,192, 38,202,170,148,246,136,230, 72, 5,191, 81,116, 69, 79, 39, 50,121, 61,215,116,170,237, 81,155, 81,183, 55, - 82, 81,250, 67, 74,243,253,137, 15, 15, 5,190,255,179,193, 62,192,206, 69, 8, 49, 98, 96,116, 8,225,157, 12, 49, 75,242, 63, -209, 95, 82,255,139,194,125,135,106, 80,248, 88, 56,243,162, 72,149,108,102,121,161,208,224,156,123,216,212, 26, 83, 21,161,183, - 24, 79,224,174,131,131,131,140,197, 72,210, 24,198, 49,184,149, 57, 15, 69,155, 8,198,194, 72, 75, 19,249, 98,132,194,145,242, - 20,199,157, 32,202, 76, 38,148,202,201, 82, 97,186, 56,242,188,173,173,221,189,106, 35, 80,112, 50, 20,118, 31,202, 84, 6,224, - 39,112,178, 63,169,203, 38,216, 24, 77, 4, 6, 76, 64, 72, 40, 51,140,125,139,130, 72, 91,242,105,115,146,140, 3, 46, 40,134, -237,112,192, 93, 76, 56, 61, 44,134,226,123,208, 98,140, 31,112, 23,135,170, 16, 39, 54, 19, 25,172,121, 8,115, 28, 9, 68, 68, -224,166, 36,171, 36, 4, 43, 5,145,166, 37, 35, 79,137,144,142,170, 65,204, 59, 54, 98,166,130, 28, 76, 14,158,159, 64,210, 19, - 70,159, 91, 56, 75,140, 44,111,178,194,162,108,152, 46,171,248, 99,183,146,175,236,183,246,117, 20,203,246, 52, 89, 93, 44,158, -174, 29, 84,185,203, 33, 7, 23,181, 44,200,189,178,169,108,189, 91,133,149,135,172, 22,110,167,131,221, 83, 20,107, 96, 33,158, - 99,183,251,238,208,136, 25,144, 47, 35, 37, 14, 31,192,177, 4,247, 3,239, 87,160, 67,196,214,137, 71,189,148, 41, 15,220,190, -237,244,242,169,105,172, 7,140, 6,217,228, 9, 85, 86, 91,221,198,169,153,138,101, 91, 55, 46, 93,127,252,114,181,148, 41,192, -114, 45,205,157,125,179,254, 34, 17, 55,102,210,249,134, 85,203,165,242,125,199,134,184,123,177,184,176, 89,221,128, 85,130,152, - 67, 85, 85,176, 62,197, 92,113,202, 72,127,218,254,236, 33,107,174,152,185, 9,231, 11,243, 95,246, 55, 97,123,204,230,102, 55, -234, 27,229, 92,105,175, 3,207,104,122,196, 15, 7,246,107, 74, 79,117,135, 61, 13,103,221,176, 53, 16,252,147, 25, 55,224,191, - 65, 40, 63,112,236,165,210,210,247,214, 46, 60, 20,164, 41,117,171, 86,206,150,155,118, 29, 59,148,226, 49,124,189,114, 80, 26, - 73,183, 30,172,176,156,203,236, 30, 36,113,204,225,172,207,217,118,227,222,234,235,187, 31,170,191,237,221,219, 23, 47,220,127, -245, 30, 63,109, 63, 98,221, 62,150,171,124, 82,103, 5, 43, 15, 27,116, 36, 34,119,212, 64,139,252, 47, 73, 62,146,252,163,138, -198,221,208, 89, 33,195,210,201,206,211,181,203,119,158,188,227, 56, 40,171, 17, 61,128, 31,252,109, 44,253, 90,246,102,167,171, - 61,187,250,240,252,243,149,177, 94,191, 82, 92,182,252,225,185,185, 51,111,191,174, 9, 74, 37,138,174,144, 31,212,245, 70,142, -195,167,103, 43,245,111, 59, 16,236, 80,171, 10, 78, 45,197,180,120,199,110, 11, 74, 93, 2, 97,200, 55, 72,146, 75, 26,117, 82, - 68, 28, 45, 8,198,177,140, 6,107, 56, 64, 46,101, 37, 42,119, 70,108,238, 68, 82, 35, 71,245, 66,210,134,160,130, 2,218, 26, - 26, 15,161,126, 13,200,186,214,119, 62, 34, 71, 44, 41,217,141, 73,114, 37, 8, 35,236, 71, 0, 40,224,233, 91,189,230, 17,142, -128, 8, 48, 39, 0, 62, 20,245,232, 9,211, 25, 11, 15,253, 1,201, 80, 17,113,141,132, 42, 46,190,168,154,134, 82, 56, 17,174, -154, 76, 66, 29,129,207, 35,240, 58,234, 40,153,180,230, 31,199, 8, 3,247,248, 33, 0,101,215,178,219, 52, 16, 69, 61,169,227, - 87,156,164, 33, 73,213,138, 86,148, 34,209, 5,176, 67, 98,129,212, 74,116, 13,191,192, 15,240, 51,172,216,243, 1,252, 1, 44, - 88,118, 11, 8, 16,106,213, 71,154,180, 77,154, 38,245, 43, 25,199, 30,238, 99,156,242, 18, 8, 41, 82,148, 40,158,204,216,115, -239,156,185,115,239, 57,255, 23,127, 23,127,146,207, 46, 21,117,255,127,113,238, 5,133, 47,206,241, 88,134, 63,119, 72,183, 10, -131,132,181, 89, 48, 67, 15, 34,119,116,108, 38, 93, 75, 21,150,138,235, 17, 4,113, 66,102,186,108, 21,143,200, 36,198,182,243, -182,187, 12,118, 21,165, 33,107,158, 8,241, 11,237, 78,190, 64, 45,207, 67, 10,152,124, 50, 35,162, 74, 22, 20, 43, 66,255,191, - 33,245, 66,197, 91, 19, 17,253, 88, 56, 69,170, 2,164,157,134,202, 57, 44, 1,164, 88,194, 26, 60,142, 84,178, 84, 54,173, 73, -138,105, 69, 11,120, 24, 8, 40, 30,128, 57, 38,150,163, 34,169,129,106, 80, 40, 92,137, 43, 3,172, 19,128, 32, 8,100, 43, 84, -191,155,162,179,103, 25, 49, 74,159,226, 61, 28,137,233,244,135,225,151,189,206,254, 65,119, 20, 74,240,157, 14,138,154,102,148, - 99, 71,138,193,120,123, 48, 90, 10, 95, 72,104, 39,133, 61, 45, 2,115, 42,136,194, 9,149, 81,158, 12,248,122, 19,249, 12, 74, - 22, 50,210,224,132,180, 22, 68,153, 35, 76,168,168, 37,240,112, 88, 41, 19, 64,116, 36, 73,237,207,130,193, 53,253, 38,192,240, -154,131,213,170,122,154, 10,146,218, 18,112,185,141,207,131, 43,150,169,196, 12,190, 97,180, 82,119, 26, 6,114,242, 36, 44,151, - 6,127, 98,219,158,111, 87,199, 81, 0,216, 51,150, 19, 54, 19,226,112,102, 90, 13,124,127,250,240,217,167,227,207,142,101,101, - 89,234,216,149,222,101, 55,145, 9, 27, 3,116,183,226,214,162, 73, 8,174,156, 45,129,161, 61, 60, 13,128,243,112,241, 85,124, -201, 18, 72,148,225,158,243,209,122,195,111,221, 94,186, 51, 8,206,215,155,235,163,104,196, 50,197,101,203, 89,116,145, 18, 4, -182, 2,139,126,125,189,189, 49, 8, 6, 83, 57,169,186,181,105, 58,217,126,176,125,120,118,116, 60, 56,129,177, 67,107,176, 80, -118, 78,143,224, 94,194,114, 62,197,147, 82,133,225, 29,132,240, 42,140,163, 18, 49, 78,123,174,231, 58,200, 38,214, 15,134,157, -126,215,115,253, 25, 49,254, 83,118,116, 62,142,175, 50, 26, 66, 63,232,111,222,188,123,120,222,105, 85,155, 65, 60,246,108,151, - 8,110,115,219,242, 80, 57, 38,199,236,148,138,227, 95,132, 67,192,251,146, 84,231,192,234,107,149, 69,179, 84, 6,215, 6,187, -165,118,189,125, 17, 12,224, 55,211, 52,134,181,215,130,254,123,205,147,112,248,216,176,236,157,101, 84,211,102, 77, 27,112,111, -117,119,107, 99,105,181,118,175, 59, 10,122,193,216,130,141, 56,202, 23,171,163, 78,239,197,253,229,210,106,205,200,122,134,144, -232,205, 85,174, 73, 87,216, 26, 48,255, 81,160, 55,119,193,155, 91, 70, 21, 94,182,209,240,140, 27,190,177,214, 50, 54, 87, 12, -105,188,124,254,250,201,171,119,221, 89, 62,151,235,201,255, 69, 57,242, 49,217,221, 83,187,111, 14,222,127, 72,222,214, 77,123, -205,109,197, 89,114, 56,232,224,105, 22, 2, 14, 51, 85,210, 54,221,181,230, 45,152, 87, 65, 28, 60,218,217,218,255,250, 13, 48, - 0,226, 31,170,101, 73,228, 36, 19, 60, 5,117,166, 35, 41, 2,169, 86,117, 41,154, 94,229, 44,236,103,232,116, 67,248,176,210, - 88, 25,134, 35,109,252, 90,206, 73, 11,111, 87,172, 42,152,223,140,248, 5,132, 46,122, 98, 75,194,240, 36,220,231,211,241, 25, -135,178,241, 96,220,111, 80,176, 84, 82,251,121, 94,248, 98,228,174, 17,215, 5,177,154,253, 80, 92, 7,154,153,195,114,110, 50, -106,206, 87, 73,201,155,224, 37,224,241,193, 36,212, 25,241,220, 11, 62, 19, 96, 90,130, 95, 4,243,114,237,224, 11,233, 11, 67, - 15,170, 96, 28,155, 3,254,239, 2,144,118,237,186, 81, 67, 65,244,250,113,109,239,203,187, 49,217,144,132, 37, 68,162, 64, 10, - 66, 10,162,163, 68, 32, 90,106,248, 17, 42, 10,254,131, 26, 33, 26, 58,126, 2, 65, 17, 68,151, 68, 9, 81, 72,236, 60,216, 93, - 59, 94,175, 95,204,153,107,111, 18,146, 6,177,173, 31,242,250, 94,207,156,153, 57,115,230,223,240,187,118, 29,138,159,101, 87, - 56,145,162, 95, 57,185,202,204, 24,151,111,112, 65,217,231,175,147, 9,211, 90, 44, 31,150,213,242,183, 74,103,161,150, 34,192, -142,195,220, 33, 83,152,142, 38, 75, 97,180, 12,155, 98,231,142,213,241,154,222,209, 36,216,139,246,208, 34,203,133,127,238,122, -200,234, 60, 90,161, 22,143,126,110,163, 55,138, 79,217, 43, 93,171,125, 89,218,210, 70, 95, 95,158,213,117, 12,205,177, 26,113, - 18, 41, 67,159, 99, 48,134,198,196,218,226,193,202,195,141,221,111,232,202, 38,123,109, 19,112, 75, 13,221, 64, 83,170,174,119, - 28,107,185,223, 51, 28, 11,225, 55, 90,153, 9,215, 16, 42, 98,237, 12, 81, 54,154, 86,167,101, 66, 74, 29, 9, 37,248, 54,213, -126, 75, 27,136,176, 57,109, 96,189,146,182,224,119,170, 17,222,215, 98,178,180, 88,127,205,132,234, 0,220,131, 45, 53,213, 36, -148, 36, 5,135,249,168,165, 27, 34,183,145, 27,197, 33, 71,106,182,196,112,135, 36,193, 63,157, 80,128,159,235, 0, 33,162,112, - 44, 52,155,131, 92,156, 0,249, 75, 93,183,108,116, 85,167, 60, 0,237,108,138,179,218, 13,121, 24, 12,163, 4, 68, 33,164,103, - 17, 39,151, 74,161,159, 11,164, 23, 87,180, 44,138,243, 56,145, 63, 33,118,137,172, 3,174,234,222,220,139, 95,245, 13,211, 81, -211, 48, 91,178, 73,183,155, 64,157, 6, 74,106,147, 52, 18, 24,247,220,228,198,116,178,185, 13,168,155,228, 24,153,203,196,107, - 93, 73, 2, 41,238,130, 3,131, 91, 48,153, 38,183, 76,153,178,224, 42, 43, 20,162, 52, 74,139,101,154, 22,178, 25, 38, 36,207, - 20, 11,128,174,238, 52,221, 48, 26,151, 74, 70, 66,148,203,189,129, 63,220,167, 77,229,182,186,210,208, 70,209,152,124,225,218, -202,125, 2,227,203,222,210,142,191, 99,131,245, 35, 25,228, 9,242, 73,244, 90,201,244, 47,205,245,105, 15,254,248,249,125,174, -133,178,240,157,249,213,109,127,155, 30,213,107,121,228,114, 40, 80, 88,156, 91, 8, 70,199,243, 40,237, 30, 12,110,172,108,249, -155, 11,189,155, 39,225,137, 98, 63,208, 29, 32,115,102,200, 48, 30,153, 60, 21,146, 2, 17,186,208, 37,167, 21,135,228, 15, 64, -177,101,138,249,192, 27, 4, 67,159,219,231, 10,242, 79,152,238, 91,150,171,139,119, 41,138,154,230,152,173,149,165, 83,112, 0, -116,225, 72,163,221,112,143, 66,255,105,247,214,139,183,235, 98,189, 43,252, 99, 49, 26,139,233, 20,160,187,204,126,125, 58,125, -254,238,243, 70,176,127,117,187,127,121,249,228,209,155,103, 98, 18, 11,131, 43,236,180, 91,167, 41, 96,123,174,248, 26, 58, 15, -126, 2, 54, 17,182, 37,188, 38, 96,251,110,248,225,245,199, 87,239,191,230,255, 61, 1,226,158,123,251,113,127, 45,202, 98, 90, - 92,138,156,188,102,111, 51,216,154,205,216, 22, 44,246,230,152,178,221,118, 15,126, 7,130, 9, 51,220,219, 9, 46, 77,109,223, -233,209,156,104, 50, 70,223,134,202,186,114,246, 67,229,174,153, 28,163,230, 14, 26, 85, 71, 88,133,128, 75,122, 99, 82,151, 13, -105, 19,106, 1,124,230, 29, 66,159, 36,249,209,163,161,207, 3, 33,200,103,244, 15, 67, 12,127, 71, 88,141,132, 64,218,118,186, -103,147, 48, 41, 50, 37,153, 89,212, 86,123, 38,130,192,100,233,138, 68, 58,203, 23, 92,196,236, 74,177,184,146, 37, 20, 74,199, -141, 77,116,165, 77, 89,115,102,202,234,146, 90,244, 70, 87,130, 4,181, 85, 85, 10,126,231, 37,215, 75,201,100, 38,128,253, 17, -128,180,107,215,141, 26,136,162,126,172,215,175,141,157, 23, 73, 72, 32,209, 70, 68, 17, 17, 13, 73, 77, 69,197, 79,240, 1, 72, - 72,124, 7, 21, 13, 8, 36, 26, 90, 74, 42,132,160,164,130,150,130, 20, 8, 82, 36, 33,171, 40,251,178,119,237,241,120,184,231, -206, 44,187, 10, 52, 8,105, 27,239, 67,178,175,118,102,206,189,247,220,115,254, 25,191, 91,127, 20,103,208,147,176,156,208,141, -217, 64,245, 18,138,119, 77,154, 48,227, 8, 50, 3,147,103,207, 36,211,110, 69,114,110,121,236, 77,129, 18,138,152,156, 67,142, -225,191,187, 46,190, 64,127,127,126, 49, 55,215,195,244,156,167,251,200, 75,241, 21,161,196, 72,228,174,129,241, 6,193, 43,211, - 76, 81, 60,173, 84,131, 52,106,169, 75, 93,211,217,206, 47,179, 68,166,109, 19,148,182,241, 19,220,234, 74,186,158,151,153, 7, -229,119, 0, 8, 90,192,122, 75, 3,147, 4,137,191,163,197,150, 8,134, 86, 74,246, 71,227,229,208,107, 95,155,243, 60, 2, 64, -141,200,131,187,105,218,106, 38, 45, 55,246,161,120,206, 2,165,182,199,233, 11, 10, 41,178, 70,161,102, 12,207,175, 74,212,190, -227,134, 32,202, 99,166,116, 60, 42,179, 81, 69,161, 14, 60, 39,246,189,216, 3,174, 98,157, 39,184,219, 4,174,138, 2,130, 86, -110, 74,199,157,139, 71,107,178,100, 31,123,116, 57, 90,238,216,150,108, 95,102,201, 70,195,105, 5, 20, 55,102, 23,163, 5,168, - 34,122,199,199, 32,162, 35,161, 14, 56, 31, 82,166, 1,143,156,254, 96, 60, 24, 10,109,205, 51, 89,112,186, 48, 99,155,240,240, - 53,179,142,167,195, 13,136, 7, 24, 55, 42,137, 22,139,106,148,132, 11, 76,119,148, 90, 19,137, 66, 23, 54,131,170,170,208,213, -100,153,248, 86,144,212, 76,126,208, 13,244, 38, 90,115, 13, 33,170,246,218,118,203,143, 25, 92, 7, 2,131,202, 6, 92,194,163, - 18,211, 85, 96,178, 46,196, 4,169, 64,147,167,208,101, 69, 78,171, 38,231,137, 24,197, 79, 71,216, 31,188,102, 45,181, 7,127, -234,116, 84,230, 13,156,191,158, 2, 87, 78, 97, 76,145,253,148, 65,215, 81, 96, 52, 18,120,239,244, 59,148,216,109, 44,173, 99, - 96, 19, 76, 53, 61, 6, 97,173, 38,171,205,166,127,218, 61, 62,235,158, 83, 14,118,176,189,255,163,115,148, 23,217,193,206,254, -225,241, 97,228, 69, 89, 57, 44,235,146,242,155,139,188, 95,138,113, 33,138, 48,108,165, 81,178,185,220,190,200,128,196, 41, 14, -173, 48,165,141,126,119, 99,183,151,247,246, 54,247, 78,186, 63, 33, 29, 46,198,124,170, 73,122, 28,186, 37,205,144,174, 42,217, -205,187, 82, 49,156,183,161,154,199, 58, 19, 96,115,150, 85, 65,187,210,141,181,157,206,224,148,157,240, 26,244,105, 94, 12,111, -111, 29,124, 62,249,250,224,241,139,187,178,185,178,117,213, 90, 72,129,151,190,103,249,187,111,119,158,188,254, 50,232,253,117, - 93, 63,127,120,207,110, 19,138, 23,140,214, 21,116,136, 2,122,249,214,156, 7,223,116,194,236, 73,104,205,211,182,158, 88,215, - 41, 51,168,223, 63,122,115,235,254,203, 15, 71,254,167,183, 31,159,190,122,246,159,251, 59,109,232, 55, 23,183,122,197, 48,142, -230,206,123,103,112,178, 36,156, 94,171, 41, 88,112,108,202, 66,135,227,140, 48, 36, 33,244,222,104, 0, 22,167,100, 46,188,226, - 12, 5,132,102,161,171,177,181, 86, 17,182,141,241, 81, 61,153, 90,101,216, 44,185,116,206, 46,174,188,248,203,162,204,171, 28, -106, 95, 82,166,209, 92, 41, 74, 94,233, 85, 14,105, 60, 91,178, 96,217, 16, 30, 3,178, 54,181, 20,108,190,148,113, 86,154,177, -206,194, 78,202,158,114, 92,112,133, 27,170,229,196, 69,149, 25,152, 90,158,163,158,209,174, 49,153, 69,173,117,199,204,244,142, - 41,221,176,235, 20,179, 98,108, 93,141, 55, 5,240,217,202, 58,183, 7, 39, 14, 79,245,239, 1, 81,101, 84,198,185,150, 64,171, -230,151, 0,156, 93,203,110,211, 80, 16,245,181,125,175,237, 36,110, 66,154, 56,105, 17,108,138, 88, 84,106,197, 7, 84,170, 64, -234, 79,177,229, 15, 88,243, 21,136, 13, 11, 64,149,186,164, 2, 9, 85, 72, 21,221, 20, 74,223, 37,177,147,216,142,147,152, 57, -115,109,210,168, 43,170, 86,173,186,168,228, 56,206,204,153, 59,231,113, 79,252,190, 8,222,121, 80, 48,204,146, 1, 89,124, 6, -111,113, 34, 23,202,119, 25, 7, 35,110,251,253, 90,172,186, 38, 12,203,249, 30,197,249,148, 70,238,146,179,197, 74,217, 42, 85, - 43, 91, 47,165,149, 80, 10, 90, 34,219, 1, 89, 75, 41, 75, 42, 83, 58, 56,228, 85, 71,209,129,114,100,148, 32, 60, 19,167,210, -156, 12,172, 27, 0,149, 53, 42, 68, 85,199, 39, 40,164,201,168,119,138,123,185, 34, 89, 80,213,150,233,181,229,245,139,194,217, -102,126, 28,165, 67, 95, 17, 21,143,104, 24,147,208, 58,225,120,201, 74,219, 78,195,219,218,236,180,154,222,112, 60, 73,198, 70, - 24,103,244, 51,138,167,233, 76,164,208,202,240,202, 10, 40, 44, 87, 18, 55,147,166,113,170, 13,212, 40, 36,234,191,192,210,149, -186, 86, 54,165,114, 14, 61,161, 77, 31, 0,122, 10,241,130, 76, 62, 47,100, 94, 45, 26,140, 99, 9,216, 98, 27, 56,120,193,125, -227, 9,155,240,187,109, 9, 42,134,244, 55, 56,247, 56, 37,200,134,227,108,148,106,144, 35,198, 19, 24, 68,166,250, 27,190,124, -216, 34,229,115,211, 58,141,183, 33,113, 10,147,158,224,216, 3, 61,187,248, 80,130,196, 19,164,164,221,118, 97, 45,222, 89,253, - 88,243, 47, 12, 61,193,210, 42, 93, 45,181, 67,141,197,181, 65,159,153,107,219, 12, 11,110,251, 26,155, 20,145, 43, 38,103,215, - 3,177,208, 44,213,173,175,252,188, 57, 46, 5,177,128, 97,158, 83,179, 77, 59,130,143, 60,219,249,178,104,176, 66,205, 96, 10, -133,109,219,111, 93, 70, 23,154,183, 48, 43,104,178,133,224,161,234,214,134,201,208,100,162,132,163, 28,223, 5,235, 38,155,192, - 25,216, 18,114,194, 65,113, 82,202,205, 71,155, 55,209,159, 40,238,209,197, 38, 48,192, 1, 59,106,173,251,228,199,217,161, 52, -237,192, 15, 58,205,224,240,228,144,110,237, 32, 30,112, 98,187,170, 85, 42, 73, 58,166,214, 65, 29,197, 81, 30, 1,127,101,187, -167,215,191, 30,182, 30, 35,155,151, 77, 95, 7, 73, 68,115,198,243,141, 23, 95,142,246,175, 7,224,255,140, 16,123, 0,236,209, -240, 26,253,164,199, 89,193, 80, 87,208, 72,234, 42,119,107, 99, 43,171,138,221, 79,239,233,146,248,154, 69,123, 41, 56, 11,207, -151, 28,122, 21,132,244,179,237,245,237,253,163,207,116,235, 58,141,110,156,246,236, 60,125,253,245, 67, 63, 75,255, 47, 67,109, -239,149,241,212, 55, 70, 3,206, 98, 49,176,104,141, 50,227, 38, 1, 45,185,234, 2,176,215, 61,195,168, 24,151,253,221,151,239, -118,222,124,212,197,226,129,215, 60,120,187,183,186,179,126,239,202,174, 12,187, 41,107,207,150,215, 28, 41,105,106, 88,174, 52, - 17,195, 82,173, 95,133, 87, 88, 97, 21,231, 68,232,229, 12, 47,102,144,103,228,211,166,223, 58,239,157,210, 51,216,174, 7, 97, - 28,246,227,176,216,176, 17,188,171,211,192,116,209, 1,131,229,183, 6,120,255,142,176,129, 72,196,172,237, 7,221,198,202,247, -147,111,204,183, 97,145, 96,169,111,202,203,178,101,137, 57,175,134,255, 75, 43, 75,217, 75, 70,235, 48,244, 2, 75,103, 70, 21, -100,244,114,118, 53, 96,155, 65,143, 60, 53,123,192,187, 97, 79,136,185, 5,177, 35,193,234,230,252, 22,189,177,158,186,210, 5, - 25, 34,211,188, 15,157, 49,133, 47,191,210, 24,101,131, 9,250, 77,129,222, 23, 11,175, 57,215, 9, 21, 9, 78,119,222,211, 28, -214,224,127, 5,224,236,220,117,155,136,130, 48,124,246,230,245,122,189,190, 96,156,152, 68, 8, 9, 36, 26,138, 20, 64, 65, 17, - 10, 90,122, 16, 60, 3, 13,143,192, 11,240, 24,116, 72,116,180,145, 66,137, 72,138, 8, 36,138,196, 9, 36,142,157,196, 27,249, -146,141,119,189,103,153,127,102, 29,115, 17, 66,161,179, 92, 29,175,207,206,204,153,243,207,247, 95, 34,190,255,217,156, 1, 39, - 75, 57,177, 62,191,152, 86,101, 4, 88,129,113, 46, 22, 95, 25,253, 98,187, 52,199,168, 43,134, 23,226,144, 53,253,173, 75, 99, - 40, 59,225,197,152,185, 16, 94,140, 35, 51, 27,235, 20,155,112,155,245, 51,108, 47,160,108,207,118, 81,206,155, 78,201, 65, 28, - 51, 12,183,225,215,218,163,157,126,212,163,231, 15, 67, 13,248, 14,225,141, 69,249,163,114,252,155,133, 86,177, 29,243,248,242, -197,211,151,234, 48, 3,233,191,213, 27,116, 76,101,254,155, 88, 60, 87,162,242, 21,188,227, 37,105, 84, 46,214,198,201,152,193, -141, 10,115,170,150, 16,207,204, 7,183, 23,105,129, 17, 5, 81,180,190,169, 18,115,130,160,104, 50, 85, 1, 66, 55, 80, 38,212, - 36,129,200, 19,112,165,120,234,160, 12,215, 22, 83, 23,224,228, 13,224,161,129, 70, 46,247, 58, 74,150,229, 83, 80,193,241, 5, -231, 23, 76, 51,185, 24,235,213, 19,125, 58,161,116, 0, 57,177,107,155,113,166, 41, 3, 78,210, 20,198,128,153,209,170, 7,235, - 91,187, 83,200, 36,161,250,202,205,225,181,140,253,113, 52, 79, 69,193, 37,192,188, 84,170, 20,116,106,116, 22, 20,235,244,250, - 97, 21,185,223, 45,187, 38,202,155,163, 24,180, 0, 2,204,112, 54,224,102, 74,134, 20,137,130,220, 36,184,208,137, 51, 25, 57, -239,117, 74, 2,202,152,232, 96,112, 58, 82,126, 33,128,204, 6,130, 31,155,221,204,232,253, 42, 20,221, 34, 85,226,205,202, 98, -146,196, 71, 35,168, 3,105,121,208, 50,107,208,135,132,247,125,247,230,189, 79,237,143,180,180,107,181, 86,127,116,114,198, 66, -114, 14,241,115, 99,199,140, 61,211,175, 4,141,211, 81, 8,155,111, 12,222,195, 57,147,242,242, 82,125,105,247,104,231,197,211, -151,239,215,222,125,239,239,219,220,111,164,205, 92, 46,250,103, 73,228, 57,176, 88,161, 13, 69, 95,174,220, 88,217,220,222, 92, -189,243,112,231,112,155, 74,164, 86,163,121, 24,246, 6,227,129,235, 20,170,165,234,222,113,187,228,248,244,135, 80,193, 30,120, -149, 24,252,247,168, 86,170,140, 99,248, 20, 6, 94, 21,189,183,132, 18,134, 85,246,168, 96,140,104,207,132,103, 33, 6, 43, 44, -179, 84,224,171, 84,101, 80,140,131,147,209,240,148, 78, 9,180,137, 10,224, 84,242, 4, 52,253,253,166,144, 72, 1,132,160,180, -196,150, 70,169,197, 94,192,215,107,139,111,191,172,109,132,223, 46, 27,103,223, 60,190,255,236,245,115, 21, 24, 80,221,156, 12, - 85,120,174,122, 19,245,181,175, 6,147,141,118,103,235, 96,176,208,170,238, 31,143, 94,125,248,188,167,230,103,116, 87,185, 39, -235,219,229,213,229,255,142,239, 79,110, 61,162, 68,181, 80,111,118, 7,221, 78,191,203,231, 57,237,187, 30,253,198,113, 4,107, - 89,105, 43,171,153, 91, 93,202, 19, 39,144,206, 24,122, 10, 56, 13,182, 85,179,210,164,143, 32, 55,112,177, 54,133,206,213, 16, - 27,169,108, 54, 64, 36,215, 58, 18, 62,225, 51,147, 38,128,134,178,111,210,108,138, 29, 5,246,114, 99,249, 32,236,228, 29,144, - 92, 58, 32, 55,180, 90, 10,157, 41,183, 84, 68, 33, 76,203,104, 4, 13, 58,138,165,220,162,241, 93, 31, 74,220,124,210, 41,147, -110,164, 49,131,147, 49, 84, 59, 71,138,101,185,110, 30,178,190,171, 65,171, 59,236,228,167, 97, 45,205,119, 97, 21,104, 49, 2, -204,235, 71,253,151,169,162,159, 84,139, 38,119,151,102,185, 32,215,171,255, 16,128,179,107,217,109, 26,136,162,158, 25, 63,242, -170,211, 54, 81,157,150,130, 74, 10, 66,145,144,120, 75,172,216,240, 1,124, 1, 95,196,103,240, 3,108, 89,179,232, 10, 80, 87, -136, 86, 2,162,136, 52, 52, 38,143, 38, 78,108, 39, 30,115,239,157,177,155, 20, 22,168,202, 67, 81, 54,137,147,153, 51,247,113, -238, 57,255,139,239,127,131,123,154, 49,103,152,134, 93,165, 55, 64, 77, 60, 42,148, 74, 99,213, 75, 41,199, 68,192, 2, 81,192, - 90,116,177, 32, 42,112,153,163,101, 79,234, 22, 29,177,136, 12, 22, 25, 11,161,105,234,168,158,158,106,241, 25,161, 36,218,225, - 68,177,232,120,128, 69,238,112,184, 91, 38,160, 28,250,130, 98,149,198, 17,118,181,224,250, 97,191, 51,251, 14,167, 37, 4, 68, - 18,217, 84, 72,142, 12, 84, 95, 55,213,157, 20, 60, 72,210, 40, 95, 62,121,240, 14, 91, 90,146,180,244,170, 2,244,191,216,239, -153,208, 25,189,230, 26,198, 56, 25, 11, 83,205,138, 6,203,224, 58, 81, 13,219, 82, 46, 80,120,167,173, 72, 26,217, 36,168,163, -103,143,101,222, 14, 70, 37, 22,210,117,196, 82, 56,185,250,145, 85,135, 96, 14, 26,105,226, 68,120,173, 88, 50,172,229,121, 48, -159,202,120, 24, 69,144,244, 4, 81, 50, 10,162,139,105,104,104,197,198,149,242, 89,217,121,241,228,113, 56, 25,110,152,124,183, -134,126, 63, 71,199,200,163, 72,176,235,151,208,184, 8, 49, 34,209,246, 73,245,157,180,211, 60,101,178, 89,161,202, 96,213,242, -246,239, 73, 95,169,106,100,131,191,105,110,222, 38,117,183, 8, 87, 57,122,149,161,195,136,185, 36,135, 29,116,248,162,188,184, -185,115, 8, 65, 24,192, 31, 67, 95, 67, 81,119,189,254,184, 87, 45,111,141,130,129,154, 14, 35, 59, 46,124, 60, 61,124,246,249, -219, 71, 83,213,160,177, 77,197, 93,199,157,196, 0,250, 24,170,147,105,138,166, 95, 41,190,172, 45,236, 80,249,126,232,146, 27, -110,200,187,123,247, 78,187, 39, 36,235,125,185, 7, 72, 38, 68, 66,208, 20, 37,113,195,221,157, 97,234,141,135, 40,100, 3,240, -243,254, 26,247, 60,183,113,179,126,235,184,253, 9, 62,164,117,163,117, 54,252,137, 46, 74, 36, 66,105, 98,223,101, 9,207, 7, - 94,115, 26,160, 61,239,217, 8,149,199, 61,183, 6, 95,243,254,126,235, 75,247,171, 63,246, 85, 78, 7,239,108,149, 54, 7,193, -240,246,206,193,143,243, 54, 64, 63,170, 26, 16,105,181, 92,132,101,111, 64, 78, 64,196,161, 20, 86, 47,192, 13,113,242,210, 74, - 97, 3, 37, 83,184, 88,162,132, 63,220, 18,170,173,113,117,185, 0,100,131,139,225,126,125, 15,101,238, 57, 55, 45, 65,176,145, -164,122,212, 12,254,252,197,219,147, 15,215,131,218,151,110,229,205,171,231,143, 30, 52,141, 5, 51,186,112,252,205, 94,191, 63, -122,215,247,175,204,170,151,108,200, 78,116,137,187,106,215, 70,145, 15, 11, 83, 26,241,245, 62,244,225,246, 29,175, 80,157,203, - 24, 14, 39,136,207, 18,136, 66,184,174,146,195, 90, 2,180,109,247,219, 28, 19,208, 34,108,225,121,172, 24,113, 58,112,198, 95, -126,179,209,241, 59, 82,149,104,116, 79, 19, 57, 92, 73, 22,164,208,191,159,147, 42,180,177, 53,231,138,193,145, 42,157, 89,114, - 63, 83,138, 95,210,182,156,104, 17,115,182,174,103,206, 46,185, 50, 18,253, 26, 36, 69,216,137,146,131, 87,253, 90,128, 99, 91, -148,144, 22,156,179,209,211,149, 81,210,156, 99,198, 50,199, 38, 93,161,129,235, 21,228, 57,193, 51,100,167, 26, 14,203,171, 32, -138,230,103, 71,113,184,234,114,177,102,174,205,214,224,245, 74, 51,241,143, 0,148, 93,203,110,211, 64, 20,245,140,103,108, 39, -105,156,132,180,165, 60,186, 64,170, 16, 72,221,161,126, 1,159, 1,124, 7, 11, 22,124, 34, 98,129, 4,155,194,142, 71, 32,194, -137, 29,219, 99,123,134,251, 24, 91,105, 41, 2,164,202,139, 42,113, 38,206,204,157,115,239,156,123,206, 63,197,247, 27,229, 5, - 60,161,109,112, 15,241,127,222,172, 36,248,205, 5,150, 47,216,223, 21,224,172,229,234,113,170,142, 74,151,149, 93,206, 41, 42, - 17, 99,144, 96, 42,252, 38,225,195,186, 38,192, 46,201, 42, 24,175, 68,244,128,121,160,165,142, 49, 0, 42,120, 77, 18,198,137, -198, 42,205, 36, 62,200, 76,118,153,125,224,254, 55, 60, 20,116,116,202,234,122, 77, 31, 50, 44, 23,156,244,249,244, 71,244,167, -255, 88, 73,176,222, 84,229,138, 87,137, 12,174,113,107, 28,203,224,180,174,193, 92, 64,162,202,143,244, 34, 7, 36, 15, 76,155, -157, 66,240,142,216,150,228, 76,232, 13,248, 15,233, 72, 63,158,235, 23,210,195,127,185,215, 82, 49,208,172,156,167,247, 32,199, - 70, 97,213, 66,226, 38, 29,141,162,213,174, 96, 73, 23,184,212, 6, 59,243, 60,143, 64, 50,205, 23, 62, 83, 77, 81,182, 81, 63, -189,120, 82,149,133,104,118,182,203,179,181,249,188, 70, 94, 14, 9,244, 5,228,196,212, 27, 22,116,130,200, 73,142, 9,142, 54, - 96,205, 58,158,191, 93,172,199, 40,167,181, 91, 99, 28, 70,159, 19, 49,132,248,129,108, 11,119, 98, 5, 2,180,214, 66,151, 62, -116, 96,139,112,191,164,250,152,179, 76, 0,162,197,101,181,210, 29,105, 3,208,147,196,132, 10, 6, 1,169,119, 93, 23, 85, 11, - 79, 50,140,117,220, 52,245,124,188,220,214,153, 24,152,103, 65, 95,193,241,205, 35, 34, 86,201,113,122,184,202, 86,117, 91, 15, -142,148, 44,214, 13,113, 92,135,186,168,115,223,133, 72,197,107,248, 98,179,233, 60,223,229,233, 40,133, 17,194,108, 41, 77,169, - 81,202, 61,201,107,116,104, 81, 74,157,159,158,191,189,124,115,119,126,250,163, 88,245,100, 80, 71, 20, 41, 57, 63, 88,196, 48, -242,182,131,219,158, 44,238,124, 93,127, 9, 81, 45,206,141, 34, 0, 16, 5,121,248, 74,254, 17,225, 62, 6, 25, 17, 34, 29,205, -115, 52,107,196,159, 49, 77, 14, 96,107,105,219, 6, 6,134,134,148, 2,123,101,201,171,164,232,229, 72,236,225,116,105,172, 1, - 68, 82,153,146, 8,209,193,189,197,125,216, 5,209,137, 11, 55, 3, 3,137, 11,158,231,239,157,222,177, 17, 11,236,253,239,190, -191, 79,148,130, 39,148,163, 65,128,205,155,186,234,154,109, 99,118,228,143, 97,237,223, 45,124,206,162,164, 13,237,170, 50, 5, -189, 54, 86,104,239,133,245,103,148,217,193,133, 99, 76,203, 40,113, 44,210,194,102, 15,111, 63,126,246,226,249,235,151,175,196, -177,248,223,248,190,140,166, 23, 71,143, 16,207, 57, 57, 27, 77, 55,213,150,136, 94, 33,246,169, 32,210,210,212, 42, 12,107, 5, -109,218,106,212,192, 8,184, 72,194,229, 17, 24, 82, 67, 36,114,152,111,144,250, 0,124, 14,168,129, 3,150,251,131,147,179, 79, -223, 62,178,125, 27, 67, 22, 64, 18,232,227, 88,253,148,126,133, 56,127,208,218,247,157,223, 68, 49,116, 67,139, 19,227,118,206, - 24,110,165, 75, 0,105,128,244, 81, 14,133,211, 95,193,138, 84, 66,252, 33,114,134,216, 32,157,108,202,141, 87,148,239,173, 92, -221,128,217,251, 69, 55,141,103,133,217,176,144, 14,155, 66,141,162, 73,222, 22, 19, 53, 46,174, 58,100,244, 22, 37,215,135,109, -247, 74, 58,191, 4,224,236, 90,118,155, 6,162,168,199,227,216, 73, 28,229,213,208, 80, 16, 66, 66, 66, 98,139, 84, 22,124, 60, - 72,136, 47, 96,193,174,136, 8, 40, 37, 36, 77,136,227,183,199, 30,238,185, 99,187,142,218, 13, 72,221, 85,137,237,241,228, 62, -206,156,123,142,243, 79,176, 76, 23,121,215,141,231,134,213, 81, 20,192, 65,182,116,205,152,227,131,133, 47,175,163,107,238, 41, -181,212,136,135,214,244,201,132, 84, 91, 74, 11,115,163,178,185,132,236, 40, 71,114, 28,150, 40,141,249, 15,138, 84,224, 31,130, -106, 72,223,152,177,207,167,104,160,183,182,125,233,170,255,220,167,242,151,166,189,208,218,122,232, 61,181,159,116,192,162,165, - 82, 46,111, 83, 0,178, 58,108, 76,184, 98, 96,116, 26,140, 24, 4, 58,118, 71, 54,110, 95,150,237,209, 47, 7,232, 70, 69,109, -168, 80,236, 54,105,219,141, 64,134,161,134,212, 1,126,226, 45, 14,217,150, 23,148, 91, 2,100,121, 0, 56,149,131,143, 10,135, -194, 4,101, 7, 47,164, 98, 67,137, 93,148, 83,201, 34, 7,162, 44, 89,220,197,238, 77,198, 30,212,105,139,114,234, 15,166,190, - 95,168,236, 98,121,190,249,177, 10,246,234,215, 14, 92,122, 85,128, 37,161, 89,210, 5, 92,202,186, 55, 68,222,227, 39, 48,214, - 49, 44,112, 43,152,112, 36, 36, 5, 35, 10, 55,245, 11,178,165,174,202,142, 90, 54,183,209,182,227, 58,189,180, 76, 12,208, 77, -181,204,194, 95,110,195,117, 65,249, 15,121,141,193, 18,221, 64, 89, 66, 40,120, 9, 10,109,170, 83,148, 45, 72,127,127,194,173, -105,111, 92,199,165,232,140, 35, 74,149, 24,181,119,115,186, 53,116,168,185, 86,204, 63,170, 55, 97,156,135,223,182,241,168, 63, -234, 58, 55, 48,193,185,234, 99, 8,153, 27,112,141,230,142,246, 73,174,114, 28, 28,128, 41,193, 60, 55,152,125,239,206,198,203, -221,113,227,247,125,145, 0,124, 85,133, 10,162, 80,233,114, 27,173,217,200, 5,158,160,203,217,147, 40, 13,169,140,154, 14,199, -171,205, 87, 7, 86, 45,242,152, 4,158,219, 75, 97, 37,104, 69,105,162, 97,196,136,200,195, 45, 3,174, 69,139,226, 97, 4,247, - 96, 90, 33,102,248, 21, 73, 22,211,190, 85, 54, 88,179, 51,127,118,136,246,103,227, 5, 69,180, 36, 75,158,206,159,209,243, 70, - 89, 92,162,185,194,217, 33,173,198,227,233,249,207,253, 53,122,142,188, 80, 50,159, 13,166, 81, 26,163, 31,108, 16, 27,174, 39, -141,239, 52, 93,110,112,155, 30,251, 56,139,178,125, 33, 39,125, 15,225,222,194, 17, 45,108, 69, 5,189,151,220,233,249,175, 94, - 60,255,240,249, 83,146, 38, 18,148, 98,232,217, 30, 85,145,194,233, 69, 95,229,233,137,193, 27, 70,142,149,129, 22, 80, 13,168, -187,113,161, 88, 7,193,234,176, 57,220,190,251,248,254,237,235, 55,255, 81,191,103,149, 26, 13,253, 52,130,109, 58,237, 46, 99, - 93, 13,153, 66,214,143, 59, 38,140,245,105,106,124,138,146,241, 16,102,140, 72, 85,101,230,126,120,242,137,145, 19, 65,219, 32, - 51,113,179,103,203, 71,243,139, 47, 55, 87,244, 63, 46,213,245,229,203,203,155,253,250,122,247,189,198, 12,153, 9,209, 6,116, -155,195, 50,211,225,106,146,119,213, 29, 3, 53, 7,114,134,163, 44,140, 72,184,254, 29,172,185,108,183,235, 6, 87,212,102,172, -214, 9, 79,253,132, 93, 77, 11,151,232,180,210, 13, 8,108, 30, 85, 48, 53, 65,212,136,143,249,142,176, 8, 40,169, 79,134,115, -150,168, 67,196,143, 88, 82, 24,148,144,234,142,247,221, 70,164,242, 94,196,239, 26, 87,253, 21,128,179, 43,217,109, 26,138,162, -126,207,142, 29, 39,206,156,166, 32, 90, 90,129, 84, 36, 36, 86,236, 89,194,138,191,224,227,248, 4,118, 44,145,250, 1, 72,116, -133, 82,134,210,212,153,236, 56,158,205, 61,247,121, 72, 89, 85,100,153, 73,201,243,245, 29,207, 61,199,248, 15,121, 38,113,111, -103, 85,145,247, 22,149,164,170, 81, 98,225,121,236, 93, 52, 99,138,166, 69,196, 8,111,128,100, 76,198,201,128,220,178,121, 93, - 24, 0,243,136,186,203,160,151,221,118, 69, 14,204,141, 93,164, 81,104,184, 75,166, 44, 5,219, 11, 68,140,209,122,103,180,140, - 48, 53, 61, 42,118, 18,172, 64, 21, 75, 68,229,221,107,165, 46, 89, 99,143,170,228, 61,123,128, 32,120, 69,224,163,246,105,217, -226, 81,205,150,140, 88,252,243,200, 3,243,178, 62, 82, 94,202, 59, 10,163,101,145, 29, 82, 69, 75,190, 44, 13, 67,150,167,148, -172,173,205,138, 96, 89, 86, 31, 76, 37,101, 12,151,190, 72,254,148,145,153, 35, 1,125, 42,229, 62, 49, 14, 65,151,148,167, 82, - 89, 66, 57, 47,221, 0,155,253, 62, 73,149, 86,148,180, 90,200,182,218,166,121, 52,104, 71, 1,157, 97,114, 58, 61,190, 56,127, -220, 31, 58,102,203, 8,109,251,187,231, 50,128, 12,112, 0,172,123,169, 44,151, 87, 67, 40, 69,146,220,147, 1,151, 3,255, 23, - 86, 83, 83, 84,121, 5, 24,203, 48, 47, 41,213,172,232,195,142, 61, 96,230,128,162,225, 3,197, 55,165,162,198,147,106,210,110, -219,210, 23,149,137,151, 11, 3,150,217,181,117, 11,139,121,226,223, 10,143,215,252, 48, 17, 24, 59, 83,242,122,144,204, 53,200, -169,237,135,189,177, 23,120, 26, 35,147,168, 40,161,194,227,116,116,246, 99,121, 77, 46,111,214, 63,158, 67,160, 81,163,108,186, -228,219, 46, 45, 7,179,153,148,135, 94,234,230, 45,233,176, 52, 6,231, 72, 83,104, 65,144,236,216,144,116, 6,175,138,136, 28, -132, 16, 23,179, 23,223,126,127,165,232,242,236,232,249, 54,218,110,253, 53,218,109, 20,174,210,184,215, 25,108,130, 13, 88, 98, -210, 66, 55,129,113,116,253, 59,141, 91, 0, 74,175,142, 14, 99,208, 25,144, 69, 46,214,139,118,155,106,106,236, 1,100,153,207, -213, 23, 40, 43,116,230,228, 25, 57,227,165,239, 38, 9, 40,226,188,112, 67,207,108,130,173, 0,195, 32,232,207, 82,228,199, 49, -253,226, 56, 15,135,206,196, 11, 86, 63, 87,191,232,210,196, 73, 36,233,210,199, 69,127, 50, 60,153,158,204,111,175,193,190,194, -132,173,148,217,244, 76, 42,173, 86,100, 23, 79,156, 71, 87,203, 27,214,114,145, 42,193,129,150, 10,244, 2,121, 27, 80, 10,138, -142,175,158,158,125,120,255,238,229,249,236,227,167,207, 19,211, 54,208,244, 3,160, 23, 43,120,236,120,226, 44,119,147, 56, 76, -211, 47,139,155, 24,187, 29, 90, 3,215, 19,135,120, 98,163, 63, 26,144,125,116,133,253,246,245,155,131, 44,234,161, 15, 63,221, -123,209,110,214,155,144, 37,135, 57, 64, 74,170, 59, 97, 74,157,206,132,243, 62, 53, 1,130,165,182, 76,203,177,250,183,254, 45, -147,189,227, 70, 33,115, 29, 58, 99,170,219,130,112, 71, 69,172, 10,115, 20, 41,231,119,115,186, 61,122,237,238, 62, 10,233,109, -151, 87,151, 12,255,208, 11,113,160,205,161, 18, 39,158,200,140, 58,163,245,206, 21, 8,207,247,244,170,181,106,114,169,250,150, - 37,237, 12,187,147,170,144, 40,212,119,228, 53,144, 81,171,157,138,104,242,105,141,183,196, 48, 62,227,254, 96,227,217, 21,199, - 65,165,191,170, 24,100, 0, 29,202, 93,223, 85, 10,171,138,189,148, 14, 38,206, 34,181, 32,217,144,136,149,126,163,217,110,205, -235,136, 82,117,135,254, 10,192,216,181,244, 54, 17, 3, 97,239,203,187,117, 18, 30,109, 41,165,165,173,160, 74, 91, 14,220,144, -144,248,183,252, 11, 78,156, 81,185,241, 16, 15,169, 52,106, 90, 9, 74,178, 73,154,100,211,236,174,109,230,225,236,166, 8,164, - 74, 57, 68, 81,228,172, 29,123,102, 60,243,205,247,133,183, 49,235,226, 95,108, 4,139,154, 42, 39,199, 61,199, 14, 70, 56, 65, - 12,231,109,224, 45,227,101, 28, 23, 0,166, 39, 16,175,140, 45, 53, 24,130,149,122,110,107,120, 3, 47, 76, 64,222, 85, 56,121, -166,154,255, 29, 89,119,177, 5,135,196, 68, 49, 61,205,146, 25,150,168, 78, 40,198, 37,189, 66, 36, 63, 24, 35,177, 20,198,112, -173,184, 53,200, 82, 81,211, 80, 44,209, 77,220,112,176,203,117, 2, 62, 11,246,127, 62,143,242,213,186,158, 88,189,208,248,202, -137, 37,220,181,107, 81, 79,154, 21,132,100,247,104, 82,134, 21,254,108, 18,169, 18,155, 86, 52, 39,181,204,242,190, 98,136, 55, -210,118, 80, 55,174, 71,106,127, 96,233, 53, 73, 22, 97,113, 56,204,230,229,215,225, 4,174,222, 94, 20,123,216, 87, 4,187, 57, -184,171,164, 68,102, 6,175,225,135, 74, 69, 66,202,231, 7, 79, 35,169,227,192, 7,163, 63, 31, 93, 79,103, 37,222, 60, 92,194, - 22,172,177,149, 86, 53,131,102,232, 39, 9,217, 1,159, 10, 92, 87,229, 32,205,251,196,163, 18,104,199,211,131,156,126, 84, 44, -176,142,132, 89,211,149,148,242,155,180,255, 80,186,214,242, 63,207, 96, 93,171,187,189,206, 74,184,130,121,103,207, 86, 80,171, -235, 60, 43, 60,132,226,135,156,240,112,183, 85, 74,105,209,252,247, 55,246,187,189, 51, 24,112, 58,155,160, 89,180, 84, 73,195, -226,128,175,226, 70, 73,236, 82,231,253, 14,140, 56,203, 39,195, 44,226, 77,182,179,190, 11, 22,159, 58, 6,145, 84, 18,140, 53, - 12,199,114,104, 44,116,131,204,225, 30,220,234, 48,151, 50,198,108, 9, 22,102,225,199, 11, 91,142,178, 33,124,105,154, 79, 96, - 89,206, 7,231,176,235, 58,189, 78, 64,201, 28, 48, 46,202,151,115,115, 13, 33,219,131,230, 26, 60,237,225,246,225,241,247,119, -176,135, 7,227, 20,158,229,101,251,197,241,201,123,240, 7, 84,210, 40,145,191, 72, 4,237,199,109, 37,213,233,229, 41,132,228, - 79, 54, 14,190, 92,124, 54, 84, 74,201,209,129, 22, 5, 74, 24,218,149, 72,129, 93, 6, 23,130,202,148,216, 19, 31, 17, 67,225, - 21, 27, 16, 44, 43, 51,254, 65, 32,157, 4,248,140,205,123, 15,127,141, 80,136,252,132, 8, 53, 81, 59,204,115, 92,165,196,161, - 88, 82,129,222, 68,129, 92,141,239,156, 77,251, 16,194, 27,214,180,168,161, 0,120, 38, 97, 29,126, 92, 94,124,235,116, 63, 93, -254,252, 48,248,189, 41, 27,177,143,138, 96, 42,138,154,161,108, 37, 50, 14,240, 42,188, 5,239, 67,217, 43,242,143, 61,164,207, -244,168, 13, 71,219, 27, 50,118, 82,196,162, 41,118,182,183, 76,168,197, 81, 2,159,188,125,253,230, 81,123,247,217,171,163,219, -155,120, 3, 43, 95,102, 37,241,118,193, 82, 20,212,160,159,163,104, 78, 21,158, 17,106, 69,160,180, 20, 65,101, 48,148, 34,202, - 95,132,191,130,219, 43,117,161,133, 94, 42,246,113, 85,148, 96, 96, 6,183,149, 13, 22,120, 56,193, 46,128, 2, 1, 35, 22,168, - 66,131, 25, 51,171, 3,215, 27, 90, 33,229, 42,117,110,235, 8, 42,249,236, 18,255, 29,216, 96,149, 40,120,128,140,246, 24, 12, -118,191,177,150,142,241,206,189,214, 90, 79,167,169,173,200, 8,248, 18,224,210, 25,102, 65,238,104, 88, 87, 96,225, 18,248,100, - 85, 72, 13,127,111,117,239, 44, 61,117,173, 80, 92, 30, 96, 43,102,106, 93,210,133, 68,201, 95, 86,154, 51,252,110, 22,127, 4, -160,236, 74,122,148, 8,194,104,117, 55, 13,205, 54,192, 32,203, 56,204,104, 60,248,123,253, 47,158,188, 27, 19, 15, 30,212,152, - 49, 49,144, 89, 18,134,129,129,102,105,104,122,171,242, 91,170, 88, 34,154, 8, 55, 72,122,171,174,111,125,223,123,185,127,155, -245,191, 25,119,195,242,200,236,200, 36, 88,164, 5,106, 73,231, 82,232,214,133,109, 10,239,216, 53,112,248,209, 96, 36, 75,163, -170, 60,138,206,232, 78,219, 44,129, 67, 23,141, 4,238,182, 33, 36,179, 52,150,134, 71, 67, 24,176, 65, 39,194,252, 20,118,128, -179, 70,158,104, 81,116,145,252, 4,182,194, 44, 94, 38, 18,147, 53,204,133,147,144, 43, 16, 7, 64,191,211, 1,134, 50,158, 80, - 25, 29, 47,221, 46,166,161, 28, 56,148,117, 34, 15, 58,234, 54, 27,148,134,230,180, 97,101, 93,102,118,102,178, 82, 45,189, 34, -109, 30,106, 96,121,201, 67, 32,169, 38,121,150, 34, 19, 90,216, 91, 34,230,175,184, 77, 2, 7,252,162,147,229,133, 39,101, 12, -113,224, 83, 28, 85,107,197,235, 74, 13,130, 97,240,123,176, 43, 54, 81,226, 74, 71, 69,118,185, 96, 85,243, 56,246,133,162, 25, - 56,127,151, 21,171,213,237, 42,254,214,127,132, 39,150,226, 39, 70, 56, 86,230,149,212,153,107,229, 80,166, 68, 46, 3,216, 5, - 16,149, 34, 50,189,220,241,122, 23,197,203, 95,193,207, 40, 11,193,216,161,245,176,144,221, 63,219, 61,122, 11, 76,103,232,240, - 53,146, 63,175,151,207,225,247,121, 48, 37,170,235, 2, 77, 5, 83,161, 29,156,110,150,149,220, 42,118,115,137,174, 29,190, 16, -133, 5,161,143, 98,217,185, 28, 21, 76, 84,171,218,158,111, 22, 44, 99,115, 59, 25, 48,203,147,133,136, 32, 79,133,184,115,214, -209, 10, 78,214,169,181, 71,254, 35,164, 71, 30,162, 96,237, 48, 89, 47,195, 5,118, 91,149,122,120,190, 51,124,122, 72, 86,110, -241,240,160,165,185,151, 25,190, 11,171, 81,204,151,192,154, 95,158,247,102,235, 41, 34, 35,147, 77,194, 19,237, 74,119,210,130, - 45, 98,207,131,112,197, 47, 4,166, 75, 68,202, 3,119, 9,145, 59, 44,200,167,155,143, 68,147,130,122,187,105,148, 14,231, 99, - 92, 97, 34, 12,225,169, 55,199,113,225,249,222, 60,124,201, 57,232,156,186,141,118,170,146,193,104, 32,205,102,164, 82,137, 32, -186, 30, 30, 40,176,225, 54,123,141,235,219,231, 62,242,236, 88,170, 91,127,233, 47,167,112,180, 49, 77, 54,213, 75,205,229,102, - 62,244,135,229, 66, 57,198,206, 4, 78, 53,216,182,126, 63,109, 65, 67,103,106, 11, 57, 4,146,156,101,233,219,230, 21,216,247, - 20,217,105,181, 6, 52,201,134,226, 29, 38,168,155,154,125,157, 12,222,189,255,240,249,254, 7,218,104, 88, 91, 8,222,113,168, -194, 41,216,110, 35,242, 94, 84, 32, 54,200, 19, 0, 69,189,170,212,190, 79, 70,166,209,119, 28,187,195,121, 69, 12,111,199,235, -171,107, 77, 61, 44,172, 32, 88,189,233, 94,252, 87,137,102,186,242, 59,103,205,221,240, 96, 62,231,182,106,173,254, 83, 31,197, -235,227,109,130, 53, 46,193,250,105,146, 25,144, 48,207,197,233,188,130,227,165, 89, 56,223, 46,148,201,158,143,180, 47,176,112, - 23,238,229,220,132, 78,183,181, 9, 76,181,219, 35,178, 26,177, 8,125, 66, 71, 72,166, 88, 63, 4,206, 33,214, 14,108,140, 52, - 42,110, 24,113,235, 62,134, 46, 31,113,119, 70,234,158, 40,252, 49, 94, 78,132,250, 3, 91,205,158,132,162,111, 29,207,217, 16, -144,213,252,245,108,231, 50,229, 94,155, 91,221,207,238, 36, 21,128, 12, 95,150, 98, 80,166,117, 58,240, 52, 71, 80,123,132, 60, -175,213,111, 1, 40,187,186,214,166,161, 48,156,156,124,158, 52, 93,167, 93, 55, 5,189, 80,135,130,168, 56, 17,241, 70,255,133, -255,192, 75,127,151, 55,130,224, 47,112, 12, 20, 68, 4,175,100,140, 93,140,185, 41,155,149,174,105,147, 38,105,147,227,251,188, -111, 50,170,187, 18, 66, 97,109,215,143,211,243,126, 63,231,121,212,127, 17, 18,180,214,109,206,157, 59,221,186,140,102, 1,140, -193, 10, 59, 42,142, 85, 55, 82,221,142,211,141, 28,237,131, 86,203,245, 12,237, 23,159,254,244,128,117,241, 92,186, 81, 30,116, -120,109,233,199,128, 78,247,156, 78,129,174,128, 50, 79, 76,125, 93, 3,119,239, 72,101,192,132, 51,192,161, 48,253, 46,163, 74, - 28, 24, 54,159,243, 71, 58,221, 72,183, 24, 27,157,107,238,226,245, 87,214,133, 11,174,129,193, 90,194,252,127,113,109, 80,245, - 47, 47, 19,101,253,190, 19,202, 42,185,224, 50,116, 47,180,226, 47, 94,141, 90,235, 90, 60, 88,134,160,154,166,128, 99,230,119, - 52, 84,109,249, 48,105,145, 66, 21, 68, 34, 59,207,231,155, 75,148, 3,248, 46, 25, 77,164,101, 34,240, 91, 3,204,123, 41,219, - 43,116,221, 65,164,181,227,155,185, 59,207,157,122,230,155, 50, 72,210, 58, 70, 13, 27,240, 30,178, 41,234,157,156, 14, 33, 39, - 59, 74,118, 62,124, 54,140, 40, 39,111,126,255,218,163,171,209,102,183,234, 21,243, 98, 92, 36,179,138,234,128,140, 2,225,172, -154,229,139, 44, 43,167,227, 98, 20, 40,255,118,239, 14, 18,108,200, 79, 43,218,136, 18,178,123,225,138, 66,111, 77,218,233, 88, - 90, 46,114,173,113, 54, 34,143,105,184,251,230,129,132,145,235, 12, 11, 58, 38, 32,214, 40,161,157,201, 28, 27,248,110, 89, 49, - 97,193,109,104,107,112, 82,164,126,165,195,154,169,162, 4, 72,202,169, 60, 86, 44,159, 23,148,132,157,140,143,121, 64,106, 40, -117,125,112,227, 33,243,180,148,244, 10,171,157,190, 76, 89, 90,205, 93,133,204,142, 66, 93,153, 9, 15, 22,228, 6,193, 13, 0, -244, 14, 3, 52,225, 62,158,221,125, 94,128,186, 82, 77,138, 73,201,115,206, 86,183,184, 81, 48, 14,124, 48,181, 61,222,124, 18, - 6,154,226,241, 36,159, 96, 70,199,182,163, 32, 11,230, 14,122, 27,244, 35, 92,138,215, 60,207, 63,252,125,136,162,204,182,103, -249, 84,123,218, 6,187,108, 78,233,255,198,234, 21,223,163, 45,164,182,191,109,239,253,216,147, 57, 59, 5,170,200,215,229,162, -160,112,200,178, 12, 24,129, 80,184, 13, 92,189,123,188, 75, 91,142,108,131, 62,249, 89,122, 22,133, 49,251,111, 59,214,241,156, -115,115,178,175, 56,136,201,104, 98,221,145,105, 4, 79,121, 80, 5, 27,196, 12, 83,178,151,165, 72, 31,248,157,235,157, 62,216, -195,129, 63,198,150, 2, 61, 2,115, 63,131,211,221, 54,244, 30, 9, 72, 28, 40, 1,183, 10, 3, 70,135,108, 81,156, 21,249, 48, - 79,143,210,228,231, 52, 97,145,116, 83, 44, 22,235, 94,184, 18,117, 68,242, 89,253,229, 73, 56, 5,181,230, 7, 95,246,135,211, -209,247,211,227,163,175, 7,244,216,251,143, 59,175,223,189,165,135,182,182,158,134,122,181,197, 97,252,147, 58,186,145, 30,220, -186,121,239,229,139, 87, 59,111, 62,245,245,101, 7,195,109,159, 27,151, 56, 49,130,189, 1,167,128, 49, 12,115, 93,227, 16, 94, - 9, 13, 61,244,229, 41, 88, 86,236,235, 51, 64,117, 25, 43, 89,155, 22,144,222, 30, 8,109,245, 52,205,178,101, 53,137,176, 32, -226,219,210,160, 18,195,106, 44, 78,134, 12,205,177,169,246,255, 61, 5, 16,109, 37,160, 97, 6, 72,214,208,249,210, 13,118,165, - 81, 22,182,134,147,211,186,109, 43,183, 76, 4,102,233,221,107,102, 27, 65,100,170, 4, 69, 98,192,118, 41,113,183,110,248,125, -228, 60,150, 48,127, 52, 20,145,109,104, 18, 46,131,165, 52,148,193,162, 75, 95,154,239,177,106,115, 78,232,204, 79,254, 35, 0, - 95,215,210,218, 68, 20,133,231,206, 35,243, 72,211, 73, 76,169, 77, 83, 75,105, 5, 45, 46, 44,186, 22,193,181, 75, 87,234,162, -136,184, 18,127,162, 75, 95,136, 40, 21,164, 18, 41,181, 32, 36, 41,109,211,121,221,121,220,185,158,115,238,204, 52, 85, 49, 12, -100, 51, 33,115,239,156,115,238,121,124,231,124,250,255, 45, 59, 57,176,170,189,104,222,184, 27,236, 34, 57,131, 12,215,224,229, -185,204, 51, 53, 11, 34,157,160, 8,130, 98,134,152,132,210, 29,122,107,125,183,111,226,204,115,203,179, 61,100, 15, 5, 71, 65, -218, 45, 13, 65,141, 38, 78, 65, 36,208, 31,166, 32, 12,197, 88, 88,179, 56, 89, 42,151,100, 82, 54,159, 50, 22, 42, 42,192,176, -148,170,140, 90,149,202, 38,167,194,160, 41,228,240,168,169,136,195,252, 84, 16,162, 96, 18,254, 42, 74, 53, 76,188,238, 25, 83, - 36,135,151, 42, 16, 20,105,154,206,252,210, 81,243, 41,113, 4,135, 19, 23,121,148, 39,108,222,107,249,183,125,151,196,205, 46, -198,225, 84,252,137,163,172,135,239,211,168, 10,196,202, 10,166, 53, 36, 46,229,165, 11, 75, 96,245, 71,145,207,148,178, 78,110, - 35, 25,152, 80,118, 22,188, 74,158,139, 40,198, 43,137, 33,116,149, 57,135,136,148,117, 28,208,127,211,177, 53,216,107,183, 5, - 86, 69, 11,206, 38,223,190,142,162, 56, 53, 88,213,167,241,113,255,203,201,241, 44, 42, 56, 50,153,148,160,202,130, 4, 16,191, -114, 77,164, 34,229, 5,172, 63,232, 89,189, 69,179, 71, 79,205, 56,150, 4,209, 39,206,178,148,232, 4,212, 36,103,166,160, 64, -142, 97,227,104,123,124, 57,224,236,151, 25, 22,202, 52,226,168,106,129,235,143, 99,144,117,194, 66, 17, 89,138, 78, 80, 98,250, -185,126,165,189, 68, 0, 65, 93,117,216,234,106,124,100, 29, 3,193, 14,224, 96, 31,157,217,134,109,235,246, 85,127, 0,174,241, -135,239,239, 36, 97, 74,121, 22,130, 87,251,151,208,234, 75,157,190,161, 53, 8, 55,217,245,186,219,195,237,237,225, 77, 73, 72, -158, 92,164, 63,198, 35,240,215,176,158, 75, 34,224,210,216,156,198, 50,192, 50, 61,203,131,195,230,112,122,144,166, 73,157,142, - 66, 46, 26,234, 6, 40,121,154, 77,102, 99,208,210,159,199,135,109,167, 77, 61, 0,186,215,106,131, 64, 70, 89, 72, 19,148, 81, - 53, 64,230,179, 60, 67,254, 39, 16,126,211,116, 44, 7,100, 9, 14,245,245,165,245, 69,215,223, 90,217,244,189, 69,158, 39, 29, -223,127,244,240,201,116, 54, 69, 63, 17,222,105,138, 7, 94,150,167,231,124,134, 8, 93,166,135,113, 20, 37,193,160,191, 2, 97, -218, 36, 64, 78,243,128, 39, 92, 80,129,145,114,182, 11,118, 27,179, 67,148, 18, 43,201,129,140,139,236, 90,119, 85, 96, 38, 90, - 86,194,143,164,166, 76,157, 81, 52,251, 25,124,219, 76,217,234, 2,137, 60,132,160, 12, 15, 28, 99,113,202,199, 97, 52, 1,113, -145, 96, 79,241,246, 59,253,101,234,101,107,184,238,101, 51,110,106,224, 14, 54,238, 94,223, 25,110,221,222,188,177,182,179,177, -236,173, 62,184,127,111,247,229, 46,108,200,167,247,111, 95, 61,126, 81,223,137, 12,111,252,156,127,126,189,183,214,185, 21, 29, - 68, 81, 60, 25,189,217,123,254,244,217,209,254, 17,196,100,240, 38, 64,197,176, 50,164,149, 60,231,103, 88,122,113, 78,162, 83, -108, 28,101, 10,117,142,129,160,239,246,156,150, 35, 36, 25,125,202,110, 40,170,210,234, 12, 80, 6,180,177,203,149, 14,177, 11, -253,172,202,154, 13, 2,184,186,167,129, 62, 10, 20, 54, 11,115,250,110, 79,181,229, 41,128, 27, 28, 36, 9,132,184,132,142,196, -122, 46,185,100,158,211,174, 49,151,180,195,130,254,130,169,127,199,205,204,101, 65,120, 88,217, 92,213,243,168,100,189, 84, 29, -170,196, 81, 73,150,189,113, 27,225,237, 44, 56, 29,165, 4,216, 36, 36,217,124,135, 14,173,163,154, 28,175, 88, 97,155,171,172, -167,154,149,115,182,255,183, 0,132, 93,203,110,211, 64, 20,245,140,147, 58, 73,235, 80,212, 22,181, 85,186,233, 6,181,176, 97, -193,227, 15, 88, 32,241, 53,176,228,123, 16, 27,118,252, 0, 18, 18,160, 74, 93,176, 0, 9, 81, 41, 33, 73,227,198,169,155,120, -108,199,175, 49,247, 97, 59, 45, 15,145, 69, 36,203,146,101,143, 61,247,125,206,249,127,253,189,221,176, 20, 66,236, 42, 94,145, -178, 38, 83, 6,212, 68,138, 40,187,166,141, 2,205, 34,169, 90, 12, 16,123, 38,110,234,154,161, 56,222, 62, 50,108,227,204, 63, - 83,137,178, 36, 70, 70,185,196,105, 69,236, 40,195, 39,141, 92,200, 57,226,230, 11,238, 38,240, 28, 56, 24, 50,109, 33, 11, 77, -205, 2, 79, 30,128,251,139, 52,178,202, 25,120,132,192,250, 6,241, 32,173,109, 52,219,176,136,125,117,150, 19,119,168,166, 65, - 24, 8, 47,117,206, 34, 40, 90,148,171, 80, 38, 47,162,214,243, 32, 45, 93,227,183, 86, 48,181, 14, 33,158,202,210,236, 79, 42, -180,127, 20,120, 74,135, 46,145,136, 79,139,107,156,107,152,222, 23,200,107, 1, 15,145,162,231, 16, 37,192,161,242,177,178,170, -213,233,170, 83, 80, 9,196,176, 85,198,101,110, 72,184, 50,206,180,192,195,111,117, 91, 4,158, 38,129,195, 38,146,253,118, 52, -108, 96,179, 99,129,133, 77, 45,115,109,127,111,215, 95,132,219,182,173, 46,166, 3,199, 73,225, 44,198,100, 56, 43,218,149,183, -177,185,132, 50, 76,102,202,112,104, 66, 85, 83, 17, 93, 35, 1, 58,188,190, 28,165, 47,123,118,239,171,231, 34,159, 51, 33,114, -137, 76, 38,167, 80,153,132,180, 5,231,171,162,179,190,145,248, 9,223,117, 65,185, 14, 87,229,145,109, 33,203, 89,178, 83,144, -182, 9, 1, 29,120,102, 8,147, 96, 63,154, 35,145, 92, 81,201, 40, 74,142, 39,164,161,117, 13, 9,198, 66,252, 82,193,225, 84, - 77,236,150, 29, 70,138, 24, 25, 52,121,223,154, 44, 97,245,131, 52,226,250,208,216, 60,154,123,161,135, 89, 8, 82, 64,103, 73, -172,195,116,218, 16, 66, 84, 45,114,180,107, 16, 65,175, 89, 45,179,189,136, 17, 92,234, 42, 23, 46, 16, 36, 17,111, 21, 73, 38, - 3,251,186, 69,218,105,172, 47,145,135, 93,146,160,128,118,253, 41,135, 62,142,239, 48, 90, 23, 22,170, 73, 53,162,177, 55,134, - 19,150,176,112,200, 93, 8, 21,242,109, 47,251, 23, 3,136,129, 38,222, 68, 45, 3, 88,246, 43,239,242,237,187,215,132,131, 48, - 14,119, 15, 79,127,156, 50,133, 38, 15,239,181,173, 22, 35,147, 71,179,177, 73, 80,222, 56,139,239, 29, 28,143,103,163, 40, 9, - 25,192,131,242, 32, 20,232,101, 84,128,134, 27,133,135, 61,218,189,219,159, 59,253,197, 68,211,112, 84,110,172, 0,238, 76, 21, -117, 25,135, 21,212, 28, 95,138,198, 22,145, 36,160,191,240,147,120,162, 22, 12,179, 8,179,108,143,148,108,145, 28,159,112, 85, - 44,105, 12,129, 67,158,230,152, 64, 27,198,119,103,208, 92,111, 25,161, 17,132,193,167,147,147,157,222, 62,124,197,206,183, 33, -239,187, 39,247, 31,125,252,242,225,217,195,167,167,111, 62,159,159, 95,189,122,249, 98,116, 53, 82,239,131,173,238,230,227,231, - 15,126, 14, 33,251, 49,238,108,236, 92,168, 41,236, 88,240, 54, 16,164,131,101, 71, 22, 96, 10, 31,240, 34, 40,227,131,114, 46, - 81,180, 36,144,156,193, 84,187,186,226,100,212, 43,193,162,178,193, 88,150,219,152,136,171,184,209,246,173, 43, 52, 55, 48,149, -213,193,173,206,230,185, 23,204,130, 25,141,115,153, 55, 10,176, 5,227, 34,113,210, 57,208,241, 20,133, 92,114,174,160,144, 31, - 64,197,199, 20, 25,164,152,249, 92,244,182, 14,134,238,160,248,123, 27, 79,212,230, 90,214,213,121, 81,218, 2,248, 35,153, 10, - 60,132,108, 15, 94,116,182, 66,134,179,133, 40,171,244,245,131,107, 99,213, 97,212,171, 41, 24,244,255,191, 4,160,235,218,118, -155, 6,130,168,215,123,177, 19, 59,206,165,137, 41, 72,129, 22,209, 86,226, 82,169, 72, 72,252, 0,223,193,115, 95,248, 6, 36, - 62, 2, 1,253, 7, 94,248, 0, 30,144,144,144, 80, 37, 30, 64, 8, 21,149,182, 20,209,166,165,181, 19,219,185,216,203,206,236, -198, 73,139,136,242,150,200,241,122, 99,207,153,153, 51,231,216,255,171,198,204,122,220,227,196,158, 35,236, 19, 67, 85, 52, 51, - 77,192,144,181, 61, 79, 4,129,240,125, 86, 19,196,197,186, 10,224,250, 5,214, 12,189,144,131,242, 87,112, 63,220,184,217, 88, - 81, 87, 7,212,124,168, 83, 1,239,151,138, 67,132, 32,142,144, 66,221, 6, 42,113,166, 80,189, 97, 54, 88,215, 49, 44,236,168, -252, 81,184,196,229, 68, 48, 32,188,131,102,170,186,173, 0,137, 0, 77, 5,196,103, 80,197,139, 84,152,240, 84, 78,109,147,221, -120,103, 92,100,208, 56,132,148, 20,186,151,197, 68, 79,141, 21, 40,162,175, 81,188,197, 84,182,193, 43,179, 74,190,233, 21,203, -127, 76, 59,172,236, 2,114,159, 53, 98,103,238, 45,151, 63,149, 56,160,236,217,243,114,254,198, 57, 0, 52,188, 0, 50,207, 49, -232, 75,107,247, 98,174,225, 91, 38,116,101, 45, 17, 68, 8,138,153,129, 44, 40,161, 19, 89,243, 88, 43,176,175,182, 89,187,201, - 59, 77,218,172,211, 70,128,155, 94,216,119,215,214,174,180, 59,205, 90,157,244,211,189,159, 7,100, 24,209,225,159, 73,122, 58, - 72, 78,162,228,244,112,244,173, 71,190,166,116,199,117,247,124,183, 39, 88,106, 3,181,131,169, 31,225, 24,182, 1,213,163,129, - 61, 7,205, 72,163,153,109,172,205,137,197,128,187,230, 9,206, 75,255,224,104,112,106,193,156,130, 61, 29, 73, 53, 54,126, 30, -247,169,150, 76, 6, 17, 5, 10, 24,214,162, 18, 89,240, 0,245,129, 29, 74,253,170,135,157,116, 20,132,197, 45,241,157, 26,103, -206,229,176, 9,129, 68, 70, 89,156,227,184,192,234,181, 85, 50,189, 86, 56, 37,144, 19,227,194,163, 53, 94,117, 14,132, 26,203, -104,127, 11,195, 18, 24,109,253,106,128, 49, 19,228, 4, 58,181, 14, 4, 12, 32,161,203,245,238,122,148,157, 33,115, 14,158,135, - 97, 61, 92,240, 91,184,146,226,193,234, 67,117, 22,130, 59, 75,225,173, 59,221,117, 5,237,113,124,166, 80,160, 92,251, 34,163, - 4,172, 94,115,174, 14,219, 93, 88,170,185, 1, 38,253,178, 21,180, 45,115, 57,128,196,168, 22,156,140,210, 28, 8, 30, 63,112, - 66,199, 18,142,195, 57, 95,108, 45,170,239,124,252,190,173, 85, 31,140, 34, 56,145,113, 26, 39,105,210,207, 84, 90,128,122, 58, -136,245, 62, 31,124, 81, 65,139,115,209,242, 27, 48, 43,142, 86,144, 14,227,129, 2,242, 92,168,189, 59, 78,250,111,119,183,119, -146,227,216, 26, 69, 50,139, 45,245, 44, 31,166,214, 40,195,247,208, 82, 11,102,241, 0, 82,159, 17,234,176, 26,113, 92,221,177, -132,146, 78,126,158,101,189,193, 32, 27,143, 85,152, 23,148, 46,249,117,105,166, 41,209, 12, 13, 77,205,136,205,195, 0, 42, 48, -189,253,163,252, 4, 38,213, 7,214,121, 64,157,246, 4, 26,197,242, 56,246,169,120,182,249,244,253,167,119,203,141,181, 55, 31, - 94,223,126,116, 79,172,240, 62,235, 63,127,245,114,243,241,147, 27, 27, 93,117,222, 47,182,182,234, 85,239,119,255,200,116,176, - 12, 88, 37,184, 13, 5, 12, 99,195,223,165,168, 56, 85, 68,173, 68,115,100, 11, 67,107,209, 35,159,185,174,170,228,210, 80,193, -116,138, 50, 5,239,134,244,162,199,248,180, 12,248, 69, 28, 47,141,210, 0, 90, 68,252, 58, 59, 84,167,113,189,179, 76,136,117, - 1,118,227,216,176,195,170, 10,149,143, 39,168,134,143,118,128, 82,215,229, 33,201,206,107,149, 6,148, 51, 11, 67, 36,221,239, -237,202, 18,188, 23,211, 99,153,119, 65,244, 29, 15,222,111,198, 78,212,184,150, 35,160,203, 49,138,170, 87,156, 69,216, 57,159, -181, 12, 75,205,167,146,126, 62,153, 62,220,229, 28, 75, 77, 78, 5, 96,254, 10, 64,216,185,245, 52, 17, 68,113,124,103,187,219, -217, 75,233,133,109,161,128, 33, 24, 1,225, 65, 69, 19,149, 68, 31,252, 0,198,248,137,124, 49,126, 6,159,253, 2, 62,249,102, -252, 2,146, 64, 64,193,128,165,133,162,216,218, 45,183,109,187,221,219,140,115,102,118, 75, 11,137,164,111,125,106,103,207,158, -219,156,243,255,221,112,191, 42,143,234, 0,163, 24,123, 45, 37, 99,145, 50,150,245, 18, 46, 78,103,102, 60, 18,116, 65, 36, 83, -214, 72,218,144, 53, 83,205, 26,204,224,128,237, 29, 34, 20,104, 40, 61, 99, 78,143,227,226,193,249, 79,135,246,212, 8,152, 22, - 68,134, 61,180,128, 15,235,177,195, 85, 96,107, 84, 78,234, 24,168,214,129, 77, 14,138,210, 32,144, 14, 20, 10,216,142, 17, 44, - 62, 8, 0, 33, 40,208,166, 13,149,133, 10,181, 27,116,107,157, 35, 63,236, 83, 78,113,138, 72, 96,229,203,127, 78,127, 67, 75, - 67,204,103, 72,177,106,155,128,201, 5, 65,128,110,158,135,252,207, 36, 17,205,107,227,110,224,250, 81,255,186,139,119,184, 70, -241, 32, 26,168, 41,204, 75,182, 72,166,116, 88, 56,243, 42,230, 80,196, 99, 30,155,153, 31,217, 57,218,140,175,213, 99,253, 10, - 34, 18, 97, 41, 22,174,148, 35,102,107, 0,149,133, 30, 14, 59, 23, 16,125, 68, 48, 88, 20, 6, 44,138,234,219, 59, 63, 88,141, -215,180, 91,223,107, 77,204, 51, 11,143, 80,150, 99,247,227, 85, 38,169, 3, 7, 75, 20,169,175,227,126,222,132,254, 74,232,103, - 72, 84, 80,144,134, 88,184, 69, 26,139,169, 93,210,135, 74, 12, 0,136,116, 32,172, 74, 96,189,192,161, 60, 35,134, 27, 69, 94, -188, 11, 34, 55, 95,194, 19,246,202,147, 50,167,161,200,170,200,166, 12,172, 49, 87, 53, 63,181, 88,105,236,113,116, 43,236, 7, - 48, 95,201,188, 60, 16, 79, 40,177, 50, 48, 36,231, 71,158,227,158, 74, 98,221, 73,220, 88, 39, 39, 69, 57,236,155,242,218,104, -239,120,119, 96,244,115,197, 57,187,123,210, 77, 72, 8, 40, 57,195, 98,110,162,125,222, 18,196, 84,167,231, 68, 81,128, 6, 37, - 18,149, 92,226,246,206, 92, 19,155, 42, 64, 39,220,181,234, 90, 58,165, 90,217,146,101,150,182,234,235,130,100, 45, 46, 48,107, -141, 42, 59,124,215,235,217, 23, 45, 4,215,248, 6,236,184, 99,204, 82,242,114,161,108, 59, 54,212, 40,220, 94,217, 31,233, 5, -110,165,185,203, 2,249,234,226,234,254,113,229,151,125, 40,226,202, 45,107,182,113,222,240,189,126,138, 75, 66, 83,206,176,101, - 79,124,229,246,189,141,131,173,147, 78, 91, 72,173,101,245, 28,123,165,173,177,226, 5,123,177,225,230, 25, 25,186, 49,149,157, -100,143,245,176, 89, 23,228,222,156,153,191,232, 57, 88,209,125,152, 88,247,244,148, 50, 57, 86,250, 92,251,186,214,174, 92,179, -213,212,208, 96, 23,138,251, 49,146,224, 5,197, 27,167,193,232, 8, 6,159,101,136, 20,137,180,221,142,166, 40, 22,136, 68,163, - 7,133, 98, 29,116,152, 17,151,130, 8, 89, 44,193, 74,154,197,254,217,217,153,250,102,245,209,202,125, 63, 37,187,127,237,187, -185,133,249,133, 59, 62,150,202, 82,105,125,111,123,107,227,219,199,245, 79,111,222,191,101,238,207, 66, 19, 99,216, 90, 90, 94, -126,242,252,241,210,195,197, 87,175, 95,190,120,250, 76,202, 72,205,205,230,151,119, 31, 42,103, 7, 10, 31,100,135,174, 11,124, - 66,222,124,138,124,232,118, 65, 60,117, 89,217,197,123,155, 56,109,244,196,182, 26,141, 21,195, 97, 10,150, 7, 41, 51,109,250, - 33, 32,238,146,212, 74,128,181,227, 38,134,192,146, 20,244,130,221,105,211,161,188, 42,238, 4, 74,137,182, 55,183,242,106,115, - 31, 10, 77, 52,186,154,206,126, 8,176,114, 73,188, 52,194,227,182,134,181,174,215, 33,252,229,180, 59, 45,222, 49,139, 17,174, - 34,147, 79,132,204, 57,224, 80,112,232, 46,137,128, 8,230,128, 70,156,140,144,243,144, 7,170, 88,220, 84,120, 27, 98,184,189, - 32,198,128, 46,203,145, 43,144,170,129,180, 23,124,253, 79, 0,186,174,100,183,105, 32, 12,207,120, 79,236, 56,141, 67,105, 27, - 53,168, 66,138, 84, 33, 42, 78,112,224, 1,122,231,204,137,247,224,194, 43,240, 22,220,184,192, 17, 9,169,112, 64, 72,112,105, - 43, 33, 84, 82, 90,209, 84,105,130,155,216,177, 29, 47,195,252,255,216,142,211,208, 91,148, 40,113,188,204,252,219,183, 44,248, -171,255,237,196, 47, 27,239, 65,109, 39,231,147, 85, 84,128, 1,107,236,134, 93,115, 44,181, 57,139,125, 47,118,249, 46,175, 17, - 89,151,116, 67,209, 85, 5,146,116, 71,183, 52,205,192,236,155,134, 73,166, 0, 16,120, 62,156, 13,231, 89,112, 61,231,229,112, - 44, 21,211,121,184,189, 36, 45,180,192,196, 56, 65,172, 49,168,244,192,189, 1, 60,200,116, 13,144,239,138,198,119,120,120, 63, - 29,207, 39,243,116, 70,208, 90, 2, 25,148, 34, 7,137, 83,148,192, 45,200,243,108,181,233,206,150,176,146,116, 5,107,148,159, -125,117, 70,145, 45,208, 50, 66,233,129,221, 18, 36,228,197,196,117,113, 32, 73, 90, 9, 25,180, 34,191,198, 72,178,115,167,215, - 31,157, 20,135,195, 60, 23,100, 89,176, 21, 6, 83,108, 80,153,209, 97, 58, 77, 55, 58, 14,200,254,202, 84, 85,129,254,165, 40, -116, 30,131, 65,145,201,148,200, 79,236,154, 86,203,210, 6,203,222,126, 61, 86, 10, 28, 85,138,255, 63,174, 16,181,228,202,139, - 4,219, 29,186, 74, 76,149, 56, 90,219,150,183,187,230,174, 47, 69,191,220, 35, 47,116,145,106,150, 21,181, 8,102, 35,128, 4, -130,164,200, 54, 29, 94, 66,250,225, 12,117,113, 4, 85, 9, 90,201,155,173,173,179,209,111, 65,187,167,185,100, 19,172,203,186, -209,104,153,173, 32,242,175,131, 9,255,108,115,109,235,210,189,192,141, 11,246, 71, 67, 49, 64, 3,178,100, 69,231, 16, 38, 88, -252,150,110,133, 73,136,152,198,210,179, 6,211, 49,138,109,187,156, 39, 69,240,130, 65,140,209, 20, 3,132,186,160,117,139, 1, - 5,105,201,237,186,227,130, 5, 35,146, 51, 42,246,109,194,192,139,159,161,109, 53,199,211,145,208, 12, 42,101,107, 48,114,178, -194, 56, 29,178, 28,219,108, 78,130,137, 44,218,113, 84,218, 89,191,223, 31,158,200, 8, 26,227,153, 53,191, 4, 29,167, 59,158, - 94,249, 81, 14,241,228,135,217,127,180,127,112,124,192,127,141,127,215,157,140,227, 52,126,216,221, 59, 60, 63,148, 80,189, 18, -159, 36,214,219,232,157,143,206, 96,176,156,132,173,250, 26,143,136, 25, 21,100,106,160,237,160,139, 34,132, 85,129, 39,229,133, -137, 46, 41, 87,147,191,239, 7,223,138,167, 46, 37,139, 87, 43, 80, 11,184,211, 26, 96,127,153, 84,180,124, 83,188,243,113,153, - 32, 86,225,235, 38,145,214,116,163,107, 53,119,157,245,143,195,139, 51,111,154,128, 77, 49, 91,145,233, 96,238,233,240,233,131, -199, 71,126,255,243,155,119, 31, 62,125,121,249,250,213,205, 5, 49, 35, 63,190,255, 60,253,115,202, 31, 97, 99, 80,115, 7,110, -114, 55,118, 58,237, 39,219,123, 47,158, 63,187, 98, 30, 47, 79,163, 56,106,168,246,229,116,128, 30,172,177, 44,235, 81, 6,246, - 12, 8,138,207,176, 27,153,116,218,247,206, 1, 59, 75, 74, 78, 17,203, 81, 39, 2,126,205, 36, 74, 87,233,139,164,220,116,137, - 32,158, 80, 86,194,105,150, 25,246,101,223,142, 84, 4, 19,151,101,101, 51,171,222,244, 2, 15, 13,165, 0,135, 47,248,229, 98, -183, 18, 74,197, 2,175,116,195,116,163, 0,164,195, 2, 50, 84,147, 1, 95, 41,188, 37,169,132, 88,211,168, 89, 65, 20,128, 32, -102, 49, 47,204,114,248, 79, 42,128,120, 89, 30,153, 22,201,123,129,160, 41,217,154, 16, 1,255, 9,192,215,181,244, 52, 17,133, -209,219,185, 51,183, 51,125, 17, 4, 75,136, 9,109,116, 67,194,142,173, 91, 98, 98,252, 19, 44,140, 11,119,110,140,127,193,133, -104, 26,140,137,143,224, 74, 97,171,127, 66,183,136,184, 33, 85,144, 20,104, 59,165,244, 53,109,231,229,247,125,119,230, 50, 20, -100,215, 69,155,102,230,206,156,239,121,206,185, 14,223, 19,183, 73,233,250,114, 57,237,228, 56,209,212, 76,200,245,136,107, 46, - 49,148,132,162, 33, 43,212, 77,205,204, 25, 25, 72, 49,242, 70, 46, 45, 44, 75, 55, 77,221,194, 62,126,224,121,216, 15,247,161, -242,202,234, 6,252,164, 53,234, 56, 94, 23, 98,131,227, 57, 3,183, 71,246,230,100,164,129,100,181, 8, 81,177, 80, 8,137, 21, -207,208,126,113, 97,174,116, 64,204,227, 20,229,125, 4, 53,148, 9, 10,225,224,100,207,165,242,204,163,102, 34, 83,224,158,140, -112,225, 5,181,158,255,225,123,106,194, 43,252,210,226,252, 53,140,168, 40, 48,240, 9,139,214,232,175, 89,164,153,200,148,181, - 34, 2,150, 41,178,144, 78,182,122,245, 88,181, 24,129, 61, 96,158, 68, 46, 64,117,142,195, 58,158, 22, 40, 60, 80,152,205,251, - 92, 55,160,126, 65,233, 29, 72,182, 53,199,115, 29,215,207, 5,122, 14,105,221,126,105, 42,251,125,239,224,219,159,147, 76,220, -161,243,227, 37, 78,249,222, 27,244,102, 75, 8,163,151,158, 41,251,212, 44,199,185,118, 65,160, 76,108,232,139, 52, 79,251, 76, - 27, 32,205, 37,178, 56,137,237, 17,144, 65,134,193,131,172,226,105, 48,140,143,184,224, 22,156,166,244, 38, 40, 21,239, 28,159, -214,176,118,161,218, 56,150,221,150,131, 84,110, 25, 98,136, 74,135,225,121,174,164,105,116,242, 42,159,144, 13, 16,100,132, 45, - 20,203,251,245,223,144,254,226,151, 34, 26, 95, 42,149, 48,210,140, 59,234, 72,242,227, 90,180,194, 43, 12, 1, 25,247,217,160, -205,137, 85,102,144,253,136,210,133,150, 38,112,195,241, 0, 42,195,209,120,132,122,244,102, 86,154,104, 23, 11,115,141,110, 61, -150, 98,101, 58, 23, 83,217,130,221,179,105, 99, 63,138, 37,114,171, 7, 82, 13, 40, 83, 80,110,158, 58,212,202,165, 13, 66, 87, -163,115, 82,190, 89,254,219, 60, 4, 52,135,179, 3, 56,192,117, 50,120,242,209,245,109, 22, 2, 64, 24,250, 28, 93,174,104,204, - 18, 70, 23, 14,215, 55, 63, 61,127,100,215, 72,163, 74, 42, 58,104, 51,249,105,187,111,235, 76,202, 29,226,244, 73,195,234,205, -173,186,157,245,103,111,107,131,102,181, 86,189,127,119,229,195,151,141,202,167,151, 9,172,222, 96,139,171,172,121,200,154, 80, -241,236, 51, 6, 57,254, 14, 99,191, 24, 59,102,172,151, 64,183, 52,129,190,203, 18,242, 97,231, 54,126, 86, 1,110,232,153,235, -142, 70,253,215, 79,158, 63, 94,123,202, 26,142, 99,183,225,106,237,214,169, 27, 4,159, 55,183, 94,172, 87,118,127,108, 63, 92, -125,116,100, 55, 55,223,191,187,183,242,160,242,106,109,113,121,233,246,242, 82,208,238,107,183,242,242, 60,107, 63,107, 59,123, -187,253,225,112,176,221,133,248, 36, 58,238,199,175,111,198, 80,204,120,168,175, 9,183, 0, 55,166,176,223,225, 81, 77, 31,107, - 3, 72,165, 35,185,189,136,213,164,172, 35, 99, 53,141,104,232, 40, 29,152,162, 15, 60,193, 0, 10,175,216, 37,148,154, 75,151, -244, 90, 66, 45, 22, 35, 11,175,170,227,229,154, 77,188,228, 24, 89, 3, 50,149,182, 43,100,151, 44,164, 32,161,211, 18,198,139, -186, 55, 50, 51, 72,106, 11,189,148, 84,124,189, 96,187,167,246,184,112, 44, 79,157,153, 64, 6, 44, 41,152,166, 84, 13, 84,168, - 8,148,102,252, 36,115, 53, 69, 28, 29,246, 79, 0,194,174, 29,182,137, 32,136,238,222,207,118,236, 32, 39,113,164, 40, 63,133, - 52, 40, 18, 13, 40, 66, 52, 17, 10, 66,136, 2, 81, 81, 35,122, 4,164,164,160,160,161,162, 0, 41, 5, 5, 61, 5, 5, 20,208, - 19, 20, 66,151, 10, 68, 67, 67, 76,226,252,176,227,207,217,190,187,245,238, 50, 59,187,123,118, 12, 18,246, 73,150, 44,203,247, -217,187,153, 55, 51,111,222,120,255,101, 70, 74, 59,145,218,180,162, 96,138,198,162, 78, 21,157,219,185,119,210,181, 6, 66,141, -129, 19,137, 47,124,136, 31,123, 76, 53,226,199, 92,116, 57,135,200, 46, 75,131,196, 77,192,249,197,138, 15,199,193, 19,128,237, -159,202, 77,194,217, 53, 88,164, 24,205,172, 30,241, 40,166, 29,236,148,119, 77,175,130,237, 65,117,125,126, 80,219, 67, 70,170, -242, 96, 28,125, 39,147, 74, 7, 60, 78, 18, 97, 84, 34,184, 48,158, 93,232,188,232, 64,192, 34,254,174, 50,208, 62, 18, 79,161, -173, 35, 45, 1,127, 8,236, 83, 98,221,142, 49,137,255, 44,158, 72,103, 72, 97, 50, 5,130,132,204, 20,231,142,154,251, 58,253, -170,136, 5, 65, 14, 46, 87,134, 6, 81,210,142,149, 2,154,193,244,170,101, 41, 87,104,130, 97,178, 10, 66, 88,162,196, 28,141, -148,190,154,243,231, 49,148, 59, 2,187,207,152,236, 70,162, 19,241,209, 17,103, 34,155, 25,203,101,191, 84, 42, 74, 16, 27,227, -112,119, 64,153, 33, 77,210, 37,182,189, 77, 34,126,227,182,210,155, 69,207,229,217, 74,156,112,146, 46, 77, 50,174, 51,161,172, - 62,137,185, 27,208, 32,236,210, 24,201, 90,190,171, 82, 52, 68,177,126, 76, 7,151, 82,143, 51, 53,112,176,251, 78,173, 89,237, -113,166,169,180, 0,108,225,150, 5,195,148, 13,212, 92, 39,156,175,237, 82, 67, 81, 79,217,255,210, 25, 32, 50,251,110, 0,123, -197, 70,127,121, 80,175, 96, 98, 42,157,159,216,199, 73,122,162, 44,183,107, 52, 51, 54, 29,198,237, 48, 14,225,239,206,140, 20, -213, 84, 13, 91,225, 80,196,252, 84, 89, 3, 87, 19,108,110, 12, 71,136,178,101, 61,222,107,118, 26,205,168, 5, 33,120,204, 34, - 8, 40,139,249, 98, 39, 9,153,226, 25,178, 70,187, 14,159,227,163,227, 77, 8,201,213, 33, 41,206,214, 66,105,161, 92, 43,195, - 29,168,102, 39,226,140, 19,227,200, 5,169,156,236,251,158,251,187, 85, 75, 0,124, 96,177, 78, 79,134, 17, 0,220, 36, 61,170, - 31, 98,165, 26, 41,206,234, 14,119, 32,118,241,125,191, 19,181,225,196, 14, 27,135,165,226,100,193,203,237,158, 84,116, 25, 24, -194, 5,116,163,154,211, 65,116,231, 72, 36,249,205, 75,183, 86,214,174, 74,213, 18, 68, 30,173,147, 55, 47, 94, 47,158, 93, 95, -123,122, 31, 61,120, 76, 46,223, 37,175, 8,201,204, 18, 54, 75, 26,132,212,208,194,255,196,173, 12,219, 14,169,126, 37,114,139, -136,103,136,248,115,196,212, 98, 81,121,198,245, 98,149, 42,129, 69, 79,192, 47,234,203,254,237,199,119, 82,105,236,237,252,154, - 89, 90, 32,197,194, 52,153,130, 47,111, 84, 87,120, 24,110,111,126, 90, 93, 94, 30,159, 44, 46, 94, 60,127,251,193,157, 11, 87, -150, 51, 94,230,229,147,231, 91,155,219,247, 30, 63, 44, 87,118,151,230,207,205, 79,207, 93, 95,189, 70, 90,100,131,125,126,251, -254,221,199,141, 15,115, 99,165, 30,235,101,188,108, 35,106,233,241,166, 92,191, 41,210,204,169,126,198, 52, 28, 50,157, 53,136, -216,133,150,181,112, 81,242,212,146, 71, 76,239,157,153,174, 33, 77,229,210, 25,120,176, 69,202,104,163,131,214,112,192, 42,246, -205,228, 41,205,174, 52,178,193, 74, 80, 10, 25,105, 62,200, 3,172, 68, 17,114, 43,245,142,252,124,218, 87,106,239,155, 30,248, -201,113, 88,213,200,128,158,230,174, 59, 92,207, 48,213,109, 13, 18,158,145, 66, 80,170,181,143, 19,193,134, 98,126, 21,106, 34, -194,128, 5, 27,205,230,155, 74,177,117,184, 64,152,190,254, 8,192,216,181,235, 56, 13, 68,209,241,216,142, 95, 9,155, 21, 65, - 74, 4,226, 81, 32, 88, 10, 42, 10, 68, 69, 15,162,129,150,138, 79,160,164, 4, 33, 42,168,144,248, 6,126, 1, 9, 81, 65,177, - 43, 10,164,149, 22,216, 37,130,108, 36,164, 93, 32, 15,109, 28, 39, 99, 15,247,220,241,100, 13, 10,143, 20, 86,138, 56,137,157, -155,153,115, 31,231,156, 63,226,119,183,194, 20, 88,152,114, 24,194,162,203,167, 56,240,124, 14, 52,219,238,114,143, 75,153, 39, - 62, 43, 10, 4, 50,136,253, 56,244,104, 21,138,235, 94, 2,233, 21, 12,194, 65, 78, 0, 14,118, 82, 68, 30, 58,116,147, 60, 43, -208, 45,116, 14,102,233, 28,122,200,176, 8,165,192,165,133,126,172,198, 5,247, 68,141,163, 57,215,100,121, 2, 21, 87,167,176, - 57,176,189, 3,172,233,116, 9, 37,153, 50,204,254,183,165, 34,179, 46, 14,141,188,139,191, 80,184,116,133,218, 43,150,173,236, -116, 92,141,142,130, 7,241,203, 41,191,147,165,164, 88, 42,198, 92,110,222,132,212,148,163,172, 21,139, 25,126, 98, 9,154, 2, - 71,140, 40, 56,101,219, 72,114,227,223,101,228,202, 22,126, 16,118, 15, 60, 13, 53, 74,151,226,219, 95, 59,219, 46,226, 40,163, -187,133,145,108, 61, 87,122,146, 21,147, 84,117,146, 96,173,222,120,241,233,243,120,174, 78,120, 65,191,191, 11,213, 67,198, 66, -116, 91,211, 74,161,198,100,230,139,210,172,172,148,107, 98, 83,184,117,216, 63, 89,138, 49, 35,129,186, 15,221,155,154, 43,147, - 64, 30,107,200,154,215,217,236, 13, 10,171,200,154,179,197, 7, 74, 99,166,116,200,146, 30, 20,235, 4, 87, 67, 63, 84,180,198, - 19,106,150,172, 0,236, 56,148, 96,240,212, 78,110,186, 34,142, 29,129, 41, 12,142,213,165,190, 39,255,131,160, 60,193,157, 24, -165,173,175,165,100, 62, 47,189, 46,170, 37,245,176,145,205,210,209,116,100,140, 46, 91,141,214, 30,108, 48,173,151, 60, 4,241, - 33,200,101,185,177, 8, 36,147,201,139, 82,183, 85,235,101,110, 98,204, 96, 66,197,213,119,131, 56,136,211,108, 58, 87, 83, 32, - 10,237,212,188,144, 71,245, 41, 53, 57,213,251,214, 51, 13, 18,171, 24,110,102, 71, 17,125,148, 89,213, 67,108,207, 14, 44, 36, -115,163, 96, 69, 31,140,166,168,235,179,204, 36, 79, 71,129, 15, 5, 89, 0,152, 53,242, 48, 26,104,100, 28, 33, 81,152,208,213, -166,115,246,245, 5, 41,172, 1,146,151,116,173, 79, 40, 0,255,185,211, 23, 94,246,223,173,239,108, 84,163,237,203,171,238,201, -171,103,248,233, 17,113,109, 40,158, 90,164,190,194,187,183,131,202, 11,126,239,125, 33, 40,156,105,113,120, 46,196,147,187, 66, - 60, 6,243, 68,155, 26, 30, 30,161,244, 40,251,222, 79, 39, 1,101,219, 81,156, 82,252,100, 7,119,110,220,190,255,236,209,248, -199, 48,159, 21,205, 90, 4,126,111, 28, 53, 87,155,223,187,187, 23, 47, 95,121,179,254,250,120,187,163, 92, 49, 87,138,224,254, - 72,101, 15,239, 61,216,122,251,241,214,245,155,155, 31,182,222,119,183,183,191,238,244,247,186, 11, 96,116,169,125,126, 37,105, - 76,178,180, 25,172, 12, 38, 67,218,146,145,224, 11,101, 18, 65, 90, 14, 86,147,214, 96, 58, 50, 42, 19, 96,218,224,232, 86,144, -152,102,207, 24,101, 29,250,138, 74, 63, 85,148, 54,212, 86, 1,111,177, 64, 35,194, 88,222,192, 10, 75,230,149,153,150,255,208, -202,183,111,173,173, 39, 28,127, 9,109,180, 2, 13,202,174, 14,234,252,171,159, 87, 81,214, 53, 33,105,141, 63, 3, 55,202, 25, -185, 90,133, 59, 51,219,122,232,238, 7, 47, 67,233,129, 30, 81,169, 2, 47,144,168,169,207,252, 20,128,175,171,215,109, 34, 8, -194,187,123,183,190, 59, 59,142, 67,108, 67, 10, 66,148,136,164,161, 64,188, 0,143,192, 11,240, 22,148, 20, 20, 20,148,212, 52, - 52, 20, 60, 0, 84, 80, 33, 65, 79, 17, 33, 37, 10, 34, 9, 17, 86,112,126,128,216, 57,123,111,111,111,153,153,221,117, 44,217, -138,101, 89,246,234,206,119,167,217,157,153,157,249,230,155,152, 93, 23,118,159, 56,239,254,211,117,131, 10, 16,154, 40,212, 74, -217,144,177,117, 10,143,176, 86,132, 21,225, 37,200,164, 84,162, 16, 85, 84, 19,200,227,138, 45,227,104, 42,151, 70,101,181,122, -198, 83,228, 49, 68,102, 6,112,232,244,101, 49,204, 11,164, 15, 28,153, 17,174, 34, 18, 26,108,227,186,245,118, 34,107, 3, 61, -168,225,223,192,241, 22,171,247, 49,148,239, 26,145, 27,235, 41,248,173, 15, 29, 48,207,152, 53,181,110,249,245,137,212,104,134, - 92, 51,104,118,214, 74, 91, 23,227,127, 65,185, 79,186, 80,177,104,198, 90,206, 43, 46,179, 19,255,180,100, 37,220,171,140,147, -245,155,155,187,189,237, 80, 78,224,220, 55, 35, 38,180, 15,204,222,238,172,255, 58,251, 33,137, 50, 23,156,202,200, 86,157, 68, -140, 64,156,134, 55, 98,145, 38, 38, 46, 47, 65, 15, 15, 20,236,103, 75, 95, 58,141, 80,110,190,154, 53,190,236,247,246,207,135, -224,194, 39, 77,254, 96, 99,177, 80,216,105, 15,153, 38,181, 81,154,172, 98, 89,141,180,205, 13,230, 90,243, 16,124,215,129,141, - 8,190,255,165,136,141, 68, 50,122,180,228, 77,201, 64, 60,170,196,250,190, 68,162,155,126,116,110,215,187,199, 27, 93,249, 29, -155,237, 32,162,134,246,169,200, 85, 47, 92,173, 8,197, 95, 4,197,226,137, 11,144,114,241,150,165, 50, 3,103, 86,161,194,197, - 88,181, 20,241,106,103,245,240,244, 0, 78,110, 55,150, 79,135, 39,160, 79,101, 20, 99, 35, 74,202,119,193, 65,237, 70,251,247, -176,207,201, 4, 58,153, 84, 46, 29,195,108, 62,198,217,178, 84, 95,202,100,134, 52,100, 8, 56, 25, 58, 62, 97,183,138,155,105, - 75, 97,239,145, 64, 53,201, 28,185,171, 93,235,172, 33,118,141,134,107, 34,166,240,110, 53,205, 54,225,249, 52,184, 24, 87,133, -206, 11, 39,169,110,235, 86, 67, 54, 14, 79, 14,168,135, 56,219,239, 31, 10,170,248,119,213, 44, 20,165, 55,174,212, 5,129,140, - 90, 41, 93, 56,160,168,240,237,216,240,122, 35,149,231, 84,206,158,197,217,221,149,205,111, 63,183, 23,147, 58, 50, 49, 8, 10, -230, 50,222, 93, 88,134,135,186,211, 89,219, 59,222,131,217, 1,115, 47, 73,146, 63,131, 51,227, 97,211, 54,160, 39,162, 81,165, -106,150,237, 30,237,120,102,220,112,239, 31,190,126,124,254,228,197,179,151, 79, 25,235,178, 54, 99, 77, 18,243, 5, 99,155, 36, - 87, 19,126,246,200,146,131, 33,216,130,147, 86, 60,227, 0,215, 20,165,193,215,184, 42, 83, 24, 17, 17,149,143,144,225, 17,241, -235,119,111,224, 45,105,194, 60,126,248,168,217, 90,120,245,254,237, 34, 75, 96, 49, 94,216,124,235,254,189, 98, 30, 19,237,231, -157, 79,179,131, 32,232,246,194, 13,216,105,105,173,251, 69, 31,185,170, 81,197,152,122, 84, 87, 48, 85, 13,184,125, 18, 91, 53, - 9,106, 56, 18, 81, 19,152, 56, 70,139, 47, 66, 61, 59,102,219, 65,243,104,244,238,132, 38,120,191, 33,112, 53,207,210, 52, 87, - 3,206, 38,219,114, 59,191, 83,155,243, 34, 60, 28,197, 4,155,192,175,163,160,242, 89,168, 64, 19,198,188,135,226, 3,228, 1, -235,200,167, 1, 65, 87,196,142,115,148, 4, 65,247,132,211,174,240, 4, 17, 93, 31, 73, 52, 43, 53, 29,195,183,158, 13,219, 49, -202,147, 11,143,219, 65,195,175,152, 92, 29,184,209,231, 87,105,193,153,255, 2,240,117, 53,189, 77, 3, 65,116,119,189,235, 56, -113, 74, 62, 26, 65,219, 11, 82, 1, 9,206, 28, 56,243,243,144, 16,127,129, 27,127,168, 23, 40, 18, 31, 85,211,202,137, 83,183, -177,157,216,177,119,151,153,217,216,109, 34, 90, 41,183, 68,142,188, 31,111,223,204,190,121, 35,159, 0,247,182,107,182,216, 62, -154, 18,129,204, 37, 12,208, 13, 70, 52, 7,177,187,201, 20,174, 53, 45, 98, 4, 38, 6, 56,154, 57,139,218, 2,182,168, 74,215, -146, 99, 63,184, 14, 87, 48,166,119,171, 5,108, 72, 29, 12,200, 28, 85,146,151,140,116,122,117, 18,231,107, 13, 40, 0,123,129, - 1, 21,224, 67,222, 61, 9,143, 39,253,241, 52,187,158,175,103,138, 75,236,198,105, 96, 62, 75,109, 60,202,237,218,193,193, 36, - 45,150,212,255,204,180,221, 7,237,206,196,218,189,102, 35,251,158,154,255,155, 84,223, 11, 56, 30, 60,155, 7,246,161,156,237, - 36,214,158, 56, 51, 90, 83,225,251,171,239,103,221,113,178,142,191, 95,157,181,238, 11, 15, 34, 36,214,212,145,217, 56,185,132, -201, 89,193,209,104,109,159,102,228,119,134,213,137, 93, 97,147,181,145, 94, 29,229,241,199, 15,199, 54,196, 78, 79,204,211, 36, -159, 23,188, 20, 23,139,228, 44,158, 5, 82, 5, 74,172,138, 18,139, 22, 13,223,160,170, 29,251,104,247, 20, 64, 8, 74, 5,138, -138,109, 42, 93,104,188, 15, 41, 53, 91, 35,101,194,140,141,223, 84,112, 5, 13,157, 23,180,244, 36, 9,111,106,205,209, 19, 14, -155,113,242, 60, 99,175, 94,112,169,194,159, 81,129,192, 78, 29, 60, 48, 8,240, 59, 61,127,144,100, 49,173, 58,132,121,224,238, -200,111,209, 35,194,137,255,244,168, 55, 56, 26,158,252,138,206,225,255, 47,226,191,110,172,136,250, 19, 45, 96,117, 59, 27,240, -131,104, 25, 49,215,251,111, 27, 83,243,131,238, 8, 48, 29,104,251, 44, 69,220, 95,228,139, 64,118,169, 12, 80,224, 5,172,107, -109,195,209,160, 24, 16, 19,224,217,247, 58, 97, 16,222,230,137, 83,236,143,123,147,139,248,143,181,174, 12, 29, 8, 18,119, 23, - 72,173,123,199,214, 9,132,146, 39,206,149,145, 78, 96,115,125, 27,145, 49, 36,198, 15,192, 50,164, 84,101,185, 86, 42, 40,171, -181,161,125, 23,248, 93,120, 67, 64,118, 18,237, 49,222, 48, 70, 20,161, 11,138, 75, 4, 79,203,220,163,103,231, 69,126,126,245, - 3, 56, 62,121, 8,147,208,158,194,137,121,118, 3,124,112,154, 92, 34,179,193,106,166, 20, 77,101,129,130,111,210,109,177,110, -211, 88, 18,198,252,229,112,114, 50, 24, 47,231,153, 47, 85,141, 85,151,104, 79,117, 53,157,158,158,190,113,133,216, 0,188,248, - 25, 51,246,174,185, 51,218, 16,226,195,103, 65,115,236, 17,220, 55, 89,144, 61,239, 14,120,211,215,135,207,103,119,137, 59,192, -128, 99,105,163,134, 29, 31,182,237,242, 38,249,252,229,211,209,251,183, 95,249,183,254,104,104,224, 11,219,169,106,237, 91,159, -236, 84,201, 42, 65,215,143,249, 56,161, 86, 85,246, 22,233, 77, 90,172,250,157, 48,202,110, 11,106,153, 93,234, 10, 54,120, 97, -170, 18,109, 71, 49,102, 15,213,179, 97, 56,130, 21,141,171, 68,250, 2, 25,158,228,216,251,157, 52, 85,166,230, 90, 89,114,233, - 6,114,129, 75,176, 22,189, 0,157, 75,248, 70,108,157, 39,184, 59,100,205,110,190,196,237,123, 99, 27,158, 15,163,119,120,112, - 24,223,205,133, 16,108, 39,159,243,144,125,155, 54, 13,239, 50,101, 14,217,141,171,145,218,138, 94, 88, 35, 15,225,251, 74, 10, -187,195, 33,154, 74, 17,183,192,141, 67,121, 56, 77, 41, 70,123, 76,187,113, 79, 42, 27,197, 60, 5,226, 24,238, 99,248,168, 91, -125, 14, 1,253, 63, 1,248, 58,183,221,166,129, 32, 12,251,136, 93,187,164,117,105, 67, 43, 36, 42, 46,144, 16, 55, 84,189, 2, -137,151, 65,125, 30,174,184,229,105,184, 45, 15,128, 4, 8, 21,165, 74, 75, 91, 39, 78,136,215,235,236,129,153, 89,175, 15, 13, - 16, 89,185,201, 65,150,189,158,157,253,119,230,251,131,127, 7,247,110,115,181,101,187, 27,241,157,228, 84, 66, 32,145, 0, 78, -242, 46,206, 21,173,174,175,140,131,148, 54,172, 71,220, 15,140,224,157, 44, 48,203,186,204,171,188,228, 72,106, 46,234, 5, 85, -190,163,119, 56, 85,136,192,212, 28,166, 15, 82, 88,191,103,241, 8, 27,130, 2,200, 94, 30,238, 39, 89, 18,198,107,165,198,241, -227,216, 75,174,216, 20, 30,162,144,156, 63, 32,197,132,185, 29,198,117,142, 9,142, 41,141, 50,128,181,205,120,237,221,115, 10, -236,135,117, 11, 97,234,255,202, 8,193,184, 56,226, 24, 53,250,255,230,185,131,223,246, 63,235,255,121, 83, 41, 31,208,242, 93, - 18,136,102,201,102,132,115,104,245, 95,213, 82, 68, 58,216, 27,202,220,213,146,162, 78, 98,215,214, 1, 93,231, 64, 97,120,133, -209,155,186,242,234,226,251,209,254,225,193,163,189, 91, 94, 75,161, 18,207,255,116,113,249,245, 46, 79, 2, 63,245,181, 91,253, -102,176, 42,162,166, 20,114, 35, 86, 1,109,224, 68, 40,248,232, 16, 46, 93, 20, 86,144, 33, 72,103,197,229, 54, 54,163,171,165, -162,155,103,250,173,236, 1,185,119, 73, 72,249, 45,204,159,144, 42,150, 66,200, 38, 50,106,197,213,211,140,255,248, 37, 20, 21, -151,248, 68, 90,149,162, 46,228, 77, 87,255, 66,145, 50,242,225,201,175, 73, 91,112,210,104,167, 96,115,134,253, 53,174,173,118, -192,161,141,125,100,164,230, 75, 41,108, 17,132, 99,116, 21,109, 83, 7,114,125, 81,197,106,110, 40,222, 16,115, 95, 63,127,115, -254,237, 92,202,182, 7, 77, 91,140, 19,220,181,154, 64,102, 46, 36,131,117, 89, 27, 59, 1,120,104,114,118,107,160,146,186,249, -166, 28, 84, 58,120,222,222, 86, 22, 71,241,228,110, 98,111,175, 74,163,148,218,214, 33,153,231, 84,164, 37, 97,160, 18,150, 49, -220, 73,119,167,121, 73, 6, 17,166,215, 6,207,147,252, 16,145, 89,100, 73,117,176, 22,117, 70,233,168, 40, 11,236,192, 68, 50, - 1,178,145,217,154, 35, 95,197, 35,222, 3, 86,142,153, 86,112, 13,179,241,138, 33,102, 89, 53,235,101,131, 93,106,104, 77,190, -149,110, 33,204,193, 73,190, 61,126,249,229,230, 39,162,247,252,166, 43,245,236,236,221,135,247, 31,141,196,226,108,147, 14, 15, - 99,104, 66,178, 12,156, 77,235,182,244,130, 86,106, 48,147, 51,199,250, 40,123,253, 62,144, 56, 12, 78,143,158,204, 42,180, 40, - 92,235,174,233, 78,144, 12, 2,139,209, 93,234, 84,227, 6,230,229, 32,216, 72, 25,163, 47,114, 31, 37,111,250,255,189,102,124, -241,249,122,241,183, 79,154,218, 77,215,143, 33, 9,153,215,115, 56, 14,178, 87,135,227,147,181,204,165,184,246,201,168,208, 15, - 35,136,105,232,217, 39,152,192,165,146,167,201,154, 67,106, 81, 66, 66,166, 24,206, 1,202,194,184,104,135,195,163,208,116, 79, - 48, 81, 86,196,193,161, 32,132,217, 51,183, 38, 74,142, 53,215, 83,125, 22, 97, 19,171,141, 35,171,106, 30, 97, 56,142,199,207, -166,249,101, 45,185,171,221,225,246,158,163,135,121,251,128, 45,217,213, 70, 54, 72,250,141, 16,239, 54, 33, 74,110,204, 11,221, - 78, 58, 66,192,176, 60, 65,202,222, 70,162,251, 71, 0,194,174,101,183,105, 32,138,206,195,246, 56,205, 67,128,132, 88, 0, 10, -170,132,232, 14,177,169,248, 13,216,241, 29,124, 69,249, 6,254,132, 21,251,178, 64, 98, 3,164, 72,105, 43, 65, 28,218, 82,227, -196,246,100, 60,195,220,123, 29,103,210, 32,200, 34,203,200, 73,198,215,231,158,123,238, 57, 17,219,192,198,173, 89, 51,223, 10, -184,104,163,147, 17,188,183, 37,222,215, 16,141,200,125, 45,182,119,120,147, 3,111,227, 65,158,111, 63,251,178,223, 79,246,148, -236,245, 35, 37, 32, 12,207, 63,207,139, 92,255, 6, 7, 65,223, 3, 90,160,162,181,135, 59, 43,248, 88,180,241,146, 74,198, 35, -217, 19,201, 80, 65,168,121, 47,137, 19,143, 43, 35,153,104,107,177, 63,147,189,120,248, 68,141,178,122, 54, 95,204, 98, 22, 59, - 65, 6,249, 30, 34, 10,215, 78, 48,204,206, 87, 97, 97,101,119, 91,142,248,124,205, 65,217, 0, 79,111,132,166,104, 2, 69,174, -179, 60,232,206,194,145,233,223, 20,143,161,182,157,188,160, 48,144, 75,116,202,152,205, 4,155,119, 62,156,172,157, 94,216,210, -217,148, 1, 87,174, 9, 90, 81, 51,139,205,244,157,152,221, 30,196,163, 84, 14,192, 28,221, 28,127,152,156,251,206, 52,138,174, -181, 94, 0, 79, 3, 88,205, 65,148, 43,228, 70, 25, 37, 93, 4,155, 18,181,245,109,147, 72, 37, 43,160,145,133, 74, 13, 62,156, -144,164, 8,190,224,154,201, 85,227,171,189, 76,208,137,186, 4,133,147,173,160, 79,100,123, 2,160,189,194, 7,154,241,141, 20, -238,151,233, 6, 40,248, 97, 34,141, 71, 76, 13,191,119, 43,250,113,109, 99,170,210,156,173,208, 5,198, 74, 52, 44,160,153,134, -100,160,192,193,196, 6, 96, 45,116, 69,174,220,219, 35,105, 87, 80,186, 86,183, 65,230,130, 31, 16, 41,121, 9, 34, 35,178,211, -164,179, 15,248,122, 50,155,144, 78,128, 5,109,172,104,119,172, 4,170,225,160,213, 29,168, 65,109,106, 68,247,187, 41, 92, 78, - 69, 10, 90, 52,186,149,173,187, 92, 92,142,123,227,224,137,141,131, 3, 0,224,218,241,118, 54, 91,154,178,130,157,117,247, 29, -247, 84, 45, 54,232,139,154,254, 46,174,141,233,110, 33,211,106, 93, 45,114,235,118,144,142,242,229,175, 52, 86,144,227,108,180, -182, 70, 52,162,145, 60, 1,255, 78,244,233,236,216, 86, 82, 65, 99, 96, 34, 17, 18,162, 11,132,167,240, 7,206, 78, 47,178,215, - 47, 95, 77,231,231,239,166,159,232,106, 15,247,159,222, 63,120,116,244,246, 8,155,177, 4, 14, 13,193,135, 37,190, 63, 91,127, -171, 51,198, 50, 36,103,192,131,134,181, 7, 13,236, 37, 54,199,121,148,164,159,127,102,121, 85,170, 88, 25,204, 40, 2,124, 8, -114, 45,137, 26, 39,155, 62,222,159,190, 63, 38, 87, 39,114,161,199, 72,250, 6,180, 47,214,164, 50,170,254, 87,226,255,253,122, -112,247,160, 40,178,139, 2,146, 84,231, 87, 31,251,227, 23, 15,159,191,169,243, 47, 98,113, 2, 75,144,254, 40,206,207, 76,149, -187,252,132,149, 95, 33,176,198, 95, 21, 4,175, 53,130,182,157,200,225,144,217,142, 49,185, 41,150,105,133, 33,118,109,211,200, -175,150,232, 86, 6,131, 48,219,202,216,131,106,192,185,235, 88,188, 78,146,231, 58,207, 71,230, 78,179,111,150,250, 66,190,197, - 12,220, 48,238,177,129,246, 46,192,131,107, 33, 76, 88,226, 69,192, 65,216, 29, 86,103,251,161,209,128, 15,121, 71, 72,181,213, -251,143, 0,148, 93,191,139, 19, 65, 20,158,153,157,157,205,230,199, 37,103, 17,229, 56,173,188,127,192, 66, 4,209,194, 66, 56, -176,177,187, 70,193,255,192,194,202,198,206, 82, 44,172,173,180,184, 78, 14,177,176, 23, 27, 57,131, 34, 8,130,228, 68, 65,115, -254, 72,118, 55,183,217,205,206,140,243,222,204, 38,187,145, 43,108, 66,216,133, 13, 76,118,190,247,190,121,223,251, 30,175,246, - 49,173,128,123, 21,217, 43,197, 85, 28,135, 12,128, 3, 17, 67, 17, 23, 34, 13,107,231,132, 11,194, 13, 80,132, 44, 4, 49,128, -199, 53,101, 57, 88, 90,105,157, 3, 9, 13, 25,215, 8, 91,185,243, 34, 52,185, 19,179, 37,251, 57, 1,163, 65, 64,107,110, 80, -213,100,251,254, 26,209, 61,248, 73,223, 92, 52,105,152, 79,189, 38, 21, 13, 95, 29,169,226, 84,184,209,100,225, 48, 57,240, 21, - 7, 8,147,216,155, 79,114, 84, 81, 50, 85, 95, 9, 90,211, 59, 58, 31,249,210, 86, 44, 64, 99, 72,123, 14, 81,242, 26, 70, 23, - 59,136, 45, 44, 59,255,213,171,147, 99,168,103, 29,225,129,224,163, 85,134, 87,119,245, 1,169,169, 91, 55, 59, 79, 21,190,135, - 12, 42,119,102,123,140,235,207, 22,192,176,105,191, 73,214, 91,188, 19,240, 66,179, 44, 83,227, 92, 69,153, 9,153, 50, 53,224, -132, 1, 64, 99, 12,232, 10, 47, 20,134, 9, 65, 50, 6,147, 94,225,180, 82,181,209, 36, 41, 80,122, 38, 73, 92, 64,148, 22,158, -110,121, 38,211, 87, 1,116,235,171, 89, 1,183,124,170, 27,146, 8,170,103,115, 0, 52,159, 88,221, 40,172,171,249,236,162, 73, -150,240, 88,219, 32, 34,230, 66, 73, 74, 78,119,197, 40,202, 8, 52, 43,121,118,251, 27, 86, 30,240, 86,156,199, 56, 85,150, 34, -240,197,118,205, 59,141, 78,191,119,242,219,175,175, 74, 21,245, 26, 5,165, 43,246,205,213,110, 13, 76,179, 12,201,195,134,100, - 32, 37, 78,129, 70, 1,139, 81,154,178,154, 46, 45,118, 24, 84,165,148,156,102, 83,147, 56,195,155, 71,193,220, 35,158,197,216, - 47,193,172, 22,130, 35,190,187, 14, 50, 68,225,225,207,225,146, 99, 81, 61,153, 77,136, 43,250, 86, 12,114,209, 64, 92, 90, 73, -157, 46, 79,248,137, 94, 22,234,244,114, 88,132,185,243, 59, 25,155, 43,135,209, 8,114, 16,179, 68, 66, 96, 59,143,186,118,238, -234,171,143,175,231, 96, 31, 1,143, 17, 76, 88,179, 44,106,223, 73,102,183, 61,179,210, 10,133,116,208,100, 75, 39,194, 94,146, - 37,135,105,252,248,197,222,147,187,247,245,102,111,247,217,243,237, 27,215,183, 46, 93,216, 62,127, 5,194, 10,109, 64, 88, 44, - 48,194, 72, 60, 47,159,150,209,230, 51, 33, 63,240, 93, 97,165,118, 10,242,252,133, 64,142, 90,161, 42,144, 11, 41,185, 97, 42, -196,227, 74, 54, 61, 80,106,194, 36,123, 47, 40,228,188, 31,174,147, 54,127, 63,120,235, 76, 0, 80, 35,205,192,205,198, 9,214, -206,246,186, 95,162,116,231,242,206,102,255,204,238,155,189, 15,159,246,255, 23,223, 15,190, 15, 30,221,121,122,251,193, 45, 28, -158, 67,134,131,135, 91, 55,239,173,109,244,139,232, 34,201,226, 34, 75,130,228, 15,105, 53,149,151,167,239, 94,202,209,208, 22, -103,212,209, 84,195,228,202, 84, 78, 35, 53, 25, 21,121, 44, 77, 22,131,200, 44,181,166,213,201, 61,238,207,164,139,157,239, 6, -184, 81,185,172, 85, 86,206,104,172,223,178,174,251, 28,184,126,163,242, 52,134,209, 99, 78,110, 93, 67, 21, 78,235, 94, 22,115, -237, 85, 91, 38,176,178,142, 58,196, 91,231, 14, 86, 58,144,213,242,146,154,223, 97,101, 62, 82, 77, 20,250, 87, 0,202,174, 93, -183,137, 32,138,206,204,206, 62,252, 72, 44, 39,136, 40, 6, 98, 68,135,160, 8, 82, 10,132, 4,174, 40,248, 24,126,130,130,191, - 65,136,135, 82,240, 40,104,137,144, 18, 9,138, 20,177,100,160,192, 73, 76,236,245, 99,189,235,121, 48,247,206,142,189,113, 34, - 16,165, 37,123, 37,239,206,222, 57,115,238,185,231,240, 37, 78,167, 8,111, 93, 72, 30,155,187, 1, 35,163,138, 99,171, 52,180, - 67,180, 17,184,196, 0,168,226,224, 39,101, 80, 35, 36,109, 4,168, 47, 76,149, 8, 52, 18, 74,152,231,225, 83, 58, 49,197,148, -234,208,163, 17,171,128,177, 31,210, 86,156,120,214, 57,192,131, 34, 2, 98, 74, 40,125,138, 14,101,198,102,190, 41,103, 67, 64, - 67, 44,132,214, 10, 43, 49,131,124,188,177,200, 54,171, 27,230, 39,157, 97,155, 83, 30,152, 51,137,103,118,111,206, 96,107,192, -220, 33,186, 24,230, 47, 84, 92,183, 81,217,180, 22,165,202,126,101,164, 98, 43,154, 94,124, 95,233, 66, 85,167,243, 13,150,157, -211, 87,208,191,180,108,233, 37, 99,192,204, 97, 0,141,158,139,112, 79, 61,231,165,108,221,210,124,169, 98,161,198, 78,185, 56, -127, 60,117, 66,174, 24,216,110,110,153,169,196,166, 86,102,224,136,104,254,100, 50,163, 97, 68, 54,148,151,162,184,196,192, 99, -207, 35,181, 16, 98,131, 65,182,136,107, 7, 34,132,113, 99, 30,207,108, 71,139, 78, 4, 56,201,184, 65, 6, 3,168,225,113, 6, -104,181, 92,166, 0,213, 45, 95, 33,128,145,167, 83,224, 51,105, 9, 19, 42, 51, 73,202, 33, 45,161, 66,179, 22, 81, 3,146, 60, - 48,138,100,245, 26, 59, 60,102,137,176, 19, 40, 10,105, 40, 54, 21, 9,115, 55, 30, 89, 17,107, 88, 68,198,211,209,247,227, 73, - 65,240,126,177, 7, 50, 23,247,146, 66,216, 30, 32,177, 4,188, 34, 64,194,194,205,126, 14, 40,146,160, 31,143, 35,146,244,178, - 22,181, 8,117,132, 18,163,233,200,154, 77,197,201,217,181,181, 27,221, 65, 23,229, 23,186,121,245, 86,251,228,200,174,106,199, -190,177, 69,131, 93,219,227, 55, 6, 37,229, 10, 55,247,106, 40, 55,211,192,242,121,245,156,162,212,203,127, 74,218,218, 96, 74, - 54,178,240,104, 79,164,147,108,186,181,222,236,156,116,222,239,127, 0,127, 27, 16, 10,193,117, 3,238,103,208, 19,118,166,164, -202,242,237,208, 71,241, 2,223, 20, 86,136, 42,227, 60, 78,227, 74, 84, 53, 23,111,247,123, 79,159, 61,223,217,190,221,120,112, -231,221,238,238,195, 71,173, 46,201,106,193,250, 64,140, 0, 57,217,250,110,158,107, 3, 23,147,125,221,215, 16,188,167,144,160, -230,232,144, 94, 46,119, 6,218, 10,166,163, 34, 22,174,132, 33,182, 31,224,168,110,192, 56,158, 30,112, 4,131, 49,243, 70,214, - 74, 32,105,127,249,230,109, 25, 42,128, 93,198,112, 72,225, 32,252,162, 82,146,214,214, 93,189,210, 60,234,253,232,205,250, 95, - 63,125,217,255,118,112,239,241,246,255,150,248,189,195,189,214,206,147,143,159, 95,225,167,126, 60,254,121,243,254,117,115,125, -241,123, 85, 7,171,213,122, 35, 77,193,126, 33,218, 36,201,235, 23,242,236, 84, 12, 78,211,179, 95,114,216,203, 38,177, 52, 7, - 44,228, 23,236, 97, 8,188, 79,152,159,202, 68,234, 60, 89, 25,214, 43,130,119, 39, 31,183, 90, 21, 97, 5,168, 26, 15, 95,104, -234,120,206,223,230, 66, 89,255,183,118,195,202, 91,130,160,146, 66, 98, 37, 93,106,250, 97,208, 88, 5, 98, 18,180, 44,160,120, -106,161, 21,135, 49,170,124,151, 41, 24,187, 43,103, 96,174, 23, 83,172,151,229,205,253, 17,128,178,107,217,109, 26,136,162,115, - 39,227, 56,105, 18,218,208,240, 16, 45,138,132,216, 0, 18, 59,254,130,175, 64, 66,221,246, 83,216, 35,129, 4,124, 1, 18, 75, - 88,177,160, 11, 84,177,161,136, 74, 77,121,180,170,168,154,164,117,226,196, 30,199,102,206,157,177,227, 68,101, 65, 86,177,228, - 88, 73,102,124,125,230,204,185,231, 44,249, 19,148,146,136,221, 38,172,162, 57, 51,199,253,115, 2,137,201,136, 79, 98,123, 51, -118,127, 20, 92,172, 80,160, 49,250, 86,189,198, 70,105, 58,179,205, 30, 4, 19,113,233, 34, 85, 11, 69,170,226,248, 8, 43,188, -241,216,182, 91,216, 40,105,169,120,186,171, 42,239,116, 92,171,174,128,186, 81, 6, 24,226,153, 81, 55,245, 60,131, 84,121,213, -111,175,198, 87,135, 81, 31,158,173,160,157,144,206,107,112,164,118,190,111, 84,180,234, 82,209,122,205, 24,173,233,183,146, 68, -143,211, 16, 9, 68,214, 35,156,172,185, 82,230, 8,183, 18, 79,159,111, 72, 72,186,132, 62,155,231, 28, 46, 62, 55,203,241, 94, -197,234,206,254,221,184,126,171,217,158, 78, 7, 21,178,135,179, 36,155,173,171,138, 25,204,126,174, 67,135,173, 27, 99,170, 6, -137,117, 31, 38,187, 28, 74,153, 14, 19,208,180, 54,222, 80, 66,113, 1, 95,102,179,138,106, 72,212,119, 85,201,124,225,188, 26, -235,158,181, 22, 55,147, 90,172, 41,165,243,224, 29,240, 48, 4, 5,171,253, 13, 13, 79,132,137,192,242, 72, 66,230,104,206, 74, - 82,105,128,121,187,110,238, 90, 25, 96,109, 99, 32, 27,252,203, 90, 62, 70,221, 12, 81,195,175, 84,125, 17, 39, 24,175,102, 77, -174,120, 85, 79,197,241, 76,122,196,211,145, 72,179,167,155,205,142, 95,128,228,172,116, 79, 11, 86, 29,114,126,151,151,189,224, - 30, 43, 85,221,175, 7,147, 11, 40,157, 83,219, 21, 43,109,137,103,195,110,121,187,211,253,117,250, 67,228, 88, 43,101,216, 72, - 84,118,131,114, 57, 36, 37,161, 49,149,154,141,233,168,127,108, 48,244,205,181,141, 88,235,131, 63, 61, 34, 71,232,165, 57, 40, - 42, 74,252,245,214,141, 65,116,161,227,200,222, 90,190,103, 30,112, 42,136, 70,178,124, 19,229,121, 58, 36,255,177,115,207, 63, -119,179,211, 29, 4,103, 97, 52,225, 4, 20,208,138, 63,207, 14,217, 82, 73, 72,154,227,182, 32, 30, 97, 89,225,114,202,138, 20, - 33,124,200,172,126,206,199,195, 24,177, 48,230, 1, 71,211,112, 84, 53, 51,163,230,103,169,247,101,239,240,243,238,247, 32, 25, - 63,218,120,216,238,116, 69,173,253,122,231, 37, 72,247, 61, 33,122, 66,108,114,125, 47,218,237,174, 8,241,128,201,119,139,235, -181,227,103, 96,116,159, 99, 33,243,197, 60, 54,154,199, 59,105, 27,126,157, 99, 43, 92, 45,147,240,222,221, 59,230,188,227,253, - 94,163,230, 67,131, 91,145,200, 24,195,238, 38,135, 69, 9,250, 54, 12,223,239,190,114,151,187,133,176,165,231,207, 94, 60,221, -126,242, 95,245,253,237,135, 55, 91,143,183,243,250, 46, 78,247,222,221,239,110, 33, 17,101, 96, 14,134,122,255, 60, 59, 57,145, - 71,191,167, 59, 31,131,175,159,226, 36,156,161,137, 91,155,233, 7, 70,184,214,156, 68,163, 44,143, 60, 98, 95,191,204,229,236, -217,216,120,235, 64,149, 35, 10, 87,242,157,179, 31,254, 28, 70,207, 89, 65,160,147, 19,205, 23,242,138, 98,106,177,154, 69, 94, -154,192,106, 47, 46,121,101,161, 51, 7,148,203, 1,203,128,230, 81,194,209,125, 14,245,216,137, 58, 99, 87, 92,145,148,176,119, -169,219,148,114, 85,203,210,182,192,242,235,175, 0,148, 93, 75,143,211, 48, 16, 30, 59,206,171,105, 75,150, 45, 15,237, 97, 1, -113, 64, 28,184,112, 88,137, 43, 71,126, 9,191,137, 59,191,132,223,128,184,237,242, 16, 90,218,125,182,105,218,188,108,227, 25, -219,105, 90, 78,244, 80,169,138,210, 72,150, 51, 51,158,249, 30, 98,200,206,133,195,230,187,243,203,118, 14, 74, 88,227,216, 19, -122,162, 73, 96,205,148,222, 88,117, 88, 14, 18, 15,188,232,177, 41,236,113,212,217, 96,242, 65, 83, 84,178,110,182, 98,135,218, - 11,168,104,159,124, 80,212, 87, 16,137, 93,147, 43, 19,138,139,153,228,193,131, 52,136,243,120, 68, 22, 77, 40, 65, 94, 52,109, - 22,134,153,121, 52,218,200,176, 45,162,169,244,201,248,180,168,151,102,245, 58, 45, 20,166, 58,213, 40, 28, 12,144, 61,135,222, - 9, 49,128,195, 27, 36,108, 50, 13,166, 38, 40,197, 73,180, 86,229, 98,251,187, 37, 75, 57, 23,123,152, 18, 0, 3,107, 64, 71, -109,165, 68, 33,165, 19, 84, 99,251, 16, 74,118, 56,218,222, 45,182, 30,246,247, 25,248,217, 5,131,174, 94,198,228,211,186,238, -154, 22,225, 93,240,148,124, 48, 82,143,104, 48,159, 25,135,113,196,183,146,149,192, 71, 36,113,132,112, 24,134,176, 69,242,119, -181,134,118,176,238, 0,251,182,100,140, 18,227,234, 17, 70,158,163, 84,219,116, 20,230, 35,196, 12,175,106,244,242,100, 86, 40, - 70,152, 76,169, 27,165, 43,218,237, 38, 13,228,204,108, 47, 85,118, 56,231, 51,123, 44,137, 88, 45,149, 9,211,230, 89, 73,100, - 34, 59,203, 66,222,144, 53, 22,102,123, 97,214,142,155, 91,179, 84, 4,228,135,155, 63,128,204,220,210, 2, 9,139,155,236,138, -157, 40, 79, 47, 29, 42, 66,168, 56, 28,163,199,216,192,226,249,152, 52,106,122,242,157,205,138,166,214, 46,235,210,108,245, 60, -203,111,139,219, 93,199,133,182,189,201, 7, 63, 23, 23,180,178,193, 30,135,117, 88,163,208, 31,205,198,143,110,202, 27,171,255, -106,143,108,218, 69,124, 2,170, 48, 62, 95,254, 65,126, 40,217,171,152,107,105,156,109,154,242,197,236,229,143,235, 11, 15,233, -129,171,226, 74,121,253, 18,108,187,183, 91, 42, 8,117,175,197, 72, 72, 80,139,145,212,100, 95,106,181, 85,249, 30, 44,142, 60, -230,190,207,207,177,244, 37,185,130, 36, 74,147, 32, 41,171,194, 73,161,225,183, 36,183, 3,138, 64,220, 28,112,211,163,113,142, -178,148,244,146,147, 95, 37,130, 8,208,182,201,225,231,156,242, 27, 78,188,132,152, 76,143,214,205, 38, 19, 79, 4,139, 58, 22, -164, 97, 50, 73, 30, 70,176, 57,254,242,241,246,236,195, 50,123,222,158,188,129,215, 12, 94, 1,188, 5, 48,145,249, 20,224,153, -163,176, 81, 81,223, 90,190,180,196, 89,175, 0, 85, 5,181, 46,234,251, 21, 2,176,136,190,139, 77, 66,238,157,212,216, 22,154, -247,103,239,204,109, 95,127,157, 23, 80, 22, 85, 25, 34,132, 81,108,229, 70,246,241,164,218, 32, 43, 91, 36, 45,114,217,170, 89, -248,248, 90, 46,254, 55,190,223,149,215,147, 81,214,255,172, 22,223,196, 29, 52,151,178,250,244,185,185,186,212,171,251,182,188, -107, 55,203,117, 49,175, 24, 66,195, 20, 35, 3,102, 9, 85,215,144, 69,176,114,104,105,171,179, 46,109, 45,143, 72, 86,233, 32, - 89,253, 59, 78,196, 84, 38,123,133, 23,175,180,222, 87,199,222, 9,219,199, 70,229,182,178,173,238,213, 40,154,172,171,146,239, - 53, 29,121, 31,129, 56, 19,230,216,141,163,116,255,192,158,174,204, 28,218,134,237,164,150, 92,203,210,247, 38, 15, 97, 63,157, -246, 52, 40, 6, 67,183, 62,248,183,132,255, 43, 0,101, 87,206,219, 68, 16,133,103,246,240, 58, 62,194,122, 77,228, 68,138,114, - 72,225, 8, 5,162, 2,126, 2, 29, 13, 21, 53, 18,145, 40, 64, 66,226, 23, 64, 1, 61, 69, 36, 26,122,154,136,134, 2,132, 68, -149, 50, 29, 33, 2,161, 16, 18,156,196,142,177,119,215,246, 94, 51,188,247,102,214,177, 81,132, 68,231, 98,189,247,206, 59,190, -239,125,159,117,150,114, 36,159,164,205, 48, 18,121, 39,124, 22,229,215,173, 2,183, 96, 73,181,181,225,181, 73,136, 51,162,106, - 52,170,163,166,138, 24,105, 21,144, 32, 45,214, 56,152,235, 33, 41,158,235,174,162,154,113,183,104,184, 67,161,196,169, 50,211, -160,109,224,202,171,216,190,231,126, 18, 35, 81, 1,142,147, 98,163, 51, 72,211,105,244,218,176, 42,248, 33, 20, 6, 73, 2, 39, -211,168, 44, 31,248, 95, 33,131,136,145, 24,130, 45, 95,140, 52,244,248,198, 16, 5, 78,222,209, 70, 40, 7,131,116, 88, 76, 11, -142, 81,242, 10,238,114,245,226,247,222, 14, 10, 6,229, 19, 49,114,204,120,111, 68,107,161,186,212,241,170,245, 86,239,144,159, -129,167,202, 51,167, 21, 70, 24,142,169,201,118, 74,133, 17, 81, 77, 8,137, 3,116,231, 67, 34, 55,188,188, 75,174, 85, 55,172, -163, 76,204, 8,194, 98, 57,175,218, 12, 2,103,130, 67, 47,216,149,131,236, 49,206, 88,152,226,237, 46,144,109, 82,130,107, 13, -110,237,153, 52,178,148, 49, 7,249,167, 18,237,172, 76,195, 45,218,110,197, 30, 70, 98,103,191,127,220,141, 59,201, 41,232, 12, - 5, 65,173, 98, 45,214,167, 22, 27, 83,126, 38,187, 1,153,246,162, 72, 11,122,146, 38,232,178, 5, 43,172,225, 19,193,175,132, - 85,149, 17, 9,218,173, 1, 97,128,135,130,187, 4, 23,167, 92,150,139, 70, 42,120,194,165, 91,230,200,218, 20,152,185, 23,157, - 18, 68,145, 65, 20,162, 7,163, 82,107,209,227, 8,240, 38,196, 72, 93,167,167, 98,163,255,156,108,118,247,103,166,103,187, 65, - 59,206,129,171,124,210, 2, 75,176,142,127, 98,232, 86, 24,161,100, 80,239, 73,229,226, 55,106, 37,234, 90,144, 50, 34,253,133, -112, 83,143,169,183,125, 88,220,179,115,229, 90, 15,221,248, 84,254, 61, 49,205,164, 75,114, 74,225,188, 74,227, 36,108,193, 62, -246,218, 63,104,133, 53, 72, 78, 11,235,119,111,202, 59, 65,139, 71,126,234,158,156, 41, 24,146,234, 81, 4, 87, 88, 70,122, 53, -182,101, 46,212,150,154, 65,115, 48, 12,181, 18, 79, 62,251,125,121,126,245,243,254, 54, 33,111,216,215,233, 71,195, 8,217, 9, - 16,173,145, 24, 42,201, 37,133,220,103, 17,222,154,171,205,199,105,212,242, 91,216,243,226,248,148, 77,166,108, 26,117, 76, 83, -244,126,178, 65, 81, 30, 2, 44,236,247,168,252,165, 25, 67,120, 5, 68,124, 99,225,234,251,157, 15,237,225, 58,227,235,165,161, - 51,247,107,222, 61, 94, 9,223,186, 34,187, 38,140,155,129,221,232,212, 27, 98,209, 99, 87, 24,219,132, 93,110, 33,156,102,162, - 97, 48,153,157,137,246,246, 55,227,210,236,196,171,126,216,219, 59, 56,232, 5, 62, 92,241,239, 44,120,253,124,253, 33,119,234, -188,242,241,211, 59,248,235,227,187,107, 91,187, 95,158,174, 61,185,126,231, 22,220,222, 42,179,158,221,127, 84,182,138, 38, 36, -120,180, 80,180,211, 99,216,199,131,219,247, 94,110,188,250,175, 37,126,245,194,202,232,183,115,180,219,125,241, 38,106,254,236, -108,109, 74,147,100, 98,147, 40,142,250, 73, 28,210, 28,125,134, 90,241,153,194, 4, 5,217, 49,168, 27,164,101, 32,115,210, 75, -110,186, 51,154,113, 33,183, 73,149, 56,241, 73, 93, 41, 49,166,202, 59, 6, 79, 74,241,247,146,202, 33, 90, 43,102,157, 60, 85, -178,193,100,226,124,185,222, 10,142, 84,122,167, 9,149, 84,233,169,208,174, 13,169,198, 14,103,141, 58,197,234, 44,115,162,189, -170, 69,149,254,204,120,242, 46,255,137, 6,254, 17,128,177,107,231,109, 26,138,194,190,215,143,184,137,221, 52,105, 43,167, 74, - 4, 42,229, 81, 84,216,248, 13,252, 4, 70, 38, 6,216, 89, 96,228,223, 32,132,196, 14, 44,136,133, 1, 49, 48,208,161, 84, 13, -165,208, 71, 30, 36,182,227,231,245,229,156,115, 99,167, 18, 20,177, 69,201, 18,251,218,231,245,157,239,251,140, 11,192, 65, 86, - 25, 42,169,246,145,188, 23, 16,224,183,141, 58, 87,102, 13,115, 50, 25, 47, 84,147,140,173, 61,122, 5,240,243,125, 42, 22,238, -166,165,155, 16,166,107,220, 52,185, 13, 41,118,146, 4, 2,101,197,224,220, 81, 6, 12,199, 49, 40, 89,195, 99,242, 70,128,234, -179,166, 35,165,194,101, 70,202,164,205, 49,192,195, 21, 54,184, 65, 84, 70,220,246,139, 10, 9,241, 14,178, 88, 82, 36,174,229, -224,156,135, 25, 70, 65,254,111, 5,177, 27,231,222, 39, 74, 71, 28, 94, 26,136,149,112,214, 17,125, 70,253,210,164,192, 5,136, -142,182,222,117, 46,245,131,125, 86,178,219,168, 92, 18, 21,254, 33,203, 36, 12, 87, 54, 68,181,144,185,128, 81,213,254,147, 5, - 26,251, 43, 33, 77, 45,100,145,188, 21,237,138, 34,251, 71, 51, 9, 86, 77,211, 36,150,184,153,214,173,179,205,181, 6,180, 65, -126,144, 56, 75, 40,246,170,148, 9, 8,133,198,205,244,188, 60, 52, 28,191,208, 79, 57,101,109, 65,230,180, 8,208, 25, 8, 6, -145,235, 42,230,209,164,224, 94,173,182,234, 24,253, 65,120, 48, 74,252, 76, 6,212,123,103,231,197, 19,252,252,179,239,111, 30, -250,183, 47,215,175,245, 92, 40,121,194, 40,254, 21,138, 52,199,123,183,100,105,245, 28, 58,169, 98, 28,107,179,140,242,147,197, -212,220,106,173,206, 66,129, 19,124,219, 68, 50, 62, 35, 20,225,116,154,111,117,204,195, 1, 58,136, 27,120, 46, 81,154, 87, 23, -161,214,186,185,218, 65, 65, 9,123,195,240, 90, 27, 71,131, 67,165, 26,228, 45,119, 79,166, 63,169, 76, 41,103,223,154, 92,180, -184,188, 98,132, 48,185,240,232,197, 39,187,116,168, 85, 34, 81,146,145,247, 99,187,177, 50,141,124, 21,232, 85, 89,142,117, 90, - 46,220,154, 51,133, 74, 25,129,124,182,222, 36,130, 43, 29,146,183,178, 17,165,161, 31, 5,142,237, 98, 97, 78,194, 34,185,204, -106,102, 13, 27, 5,145,171,253, 9,244,210, 44, 27, 51,220,233, 50,204, 8, 2, 74,142, 75, 34, 16, 16, 91, 78,123, 48, 25,232, -196,115,129, 27,184,127,182,135,214,113, 28,138, 93,150,137,197, 50,202,238,209,151, 57,107, 82, 96,170, 71, 51, 3,221,146,130, -152, 95,178,216,242,110, 28,156,237,145, 17, 7,226, 30,253, 65,159,225,180, 77,119,109,183, 64, 72, 60,146,243,213,116,174,210, -157, 50, 69, 80,110,101,205,250,114, 46,224,223,100, 92,249, 57, 18,102, 32,178,248,217,189, 71,175,239,190,122,240,228,241,199, -239,123,199,193, 48,138,229,183,241, 7, 26,202, 60,215,236, 70,199,237,222,146,142,247,163, 59,222, 77, 5,227,161,151,126,245, -123, 22, 52,109, 58,190,175,144,200,219,219,215, 45, 45,135,122,171,203, 58, 55,175,108,237,236,108,247,122, 94,251,206, 85,125, -181, 9,165,192,106,171,181,230,117, 58,205,238,134,211,134, 12,154,103, 25, 60, 38, 38,116, 29,204,130,252,112,252,254,211,201, -100,214, 16,122,219,114, 82,106, 93,109,211,138,130,217,187,151,111,239, 63,125, 72,241,253,127,109,184, 91,141, 86, 60, 26, 45, - 26,190, 60, 57,125,243, 34, 8, 38,153, 22, 35,189, 17,110, 96, 33,112,164, 8,239,126, 50, 67,236, 72,166, 90, 65,164, 15, 82, - 41, 36,164,154, 2, 98,233,234,164,205, 53,169,170,183,152, 28,248,184,177,100,187, 83,114, 14,128, 35, 14,179,240, 66, 7, 60, -237,207, 77,150, 69, 73, 92, 6,247, 57,188, 68,114, 26, 98, 20, 14,209,251,178,164,166,206, 37,114,164, 90,124, 85, 69, 7, 43, - 42, 59, 10, 66,249, 89,165, 19, 69,196, 50,248,162, 97, 59, 16, 66,199,179,225, 57, 56,191,212,204,146,242, 31,171, 30,191, 5, - 96,236,220, 90,155, 8,162, 56, 62,183,221, 77,179,109,218, 36, 53,241,210, 22,131, 98,209, 42, 34, 85, 31,124,240,193,175,224, -103,240,195,249,224,171, 15, 94, 80,144,162, 47, 34,130,208, 34, 18,173,109, 68, 98, 75,154, 38,217,203,236,206,140,115,206,236, -166, 13,125, 41, 44,228, 6,217,100, 47, 51,103,206,249,159,255, 15,252, 9, 40,116,173, 41,122, 70, 13,137, 47, 57,178,117,184, - 7, 30,133,240,164, 33, 26,104,186, 45, 28,222,155, 57,217, 1, 36, 86,237,116,170,156,200, 95, 35,153, 4,137, 16, 96, 20,141, -246,201,144,109,183, 91, 43,108,217, 25, 98,127,244,219, 6,236, 30,168,241,153,143,139, 86,252,187, 60, 4,227,111, 1,214, 5, -220, 7,174, 40, 97, 1,199,120,151,177,208,131,136,222, 94,140, 21,193, 35,176, 46,161,169,202,142,210, 72, 48,113,152,236,253, -141,250,169, 74, 18,149, 72,157,100,174, 33,214, 20,161, 25, 30, 0,158, 3,180, 55, 71, 45,138,253, 94,129,191,159,135, 44,188, - 88,109,119,199, 59,133,203,205,137,165, 59,210,150, 28, 37,174,108,239,154, 86, 36, 92,245, 26,144, 61,154, 36,106, 50, 99, 18, - 52,227, 22,132,237,154,121, 98,255, 61,100,201, 17, 50,235, 51,154,164,177,157,159,154,132,220, 88,246,175, 93, 90, 24, 68,170, - 63,204, 38, 82,123,220,216,205,158,234, 49,212,251, 97, 64, 71,172,156, 35,187, 64, 80, 34,128,181,130,197, 47,156,225,236,168, -230, 99,120,235,161,250, 90,129, 38,152, 52,171, 65,167,238,245, 14,226,159, 71, 73,132,213,181, 8,245,205, 73, 25,191,187, 27, -203,199,146,219, 60, 33,151, 23,249,253,235, 75, 43,237,208, 70, 65,253, 35, 57,156, 40,208,200, 64,245,143,198,216, 79,169, 96, -167,104, 96,201,104,189, 10,168,103,251, 34, 55,224,212,220,168,242,192,158, 66,193,171, 1,253,184, 19,255, 27, 67, 8, 37, 21, - 76, 75,153, 2, 3,254, 86,109,181, 55,216, 43,108, 81, 81, 38,164, 93, 87, 42, 10,215,156,171, 35, 65, 29,203,172, 85, 91, 65, - 44,183,227,172,171,169,150, 89,110,205,202, 60, 98,169, 43,133,143, 26,243,205, 68,142, 37,240,255, 32,114, 7, 94,106,217, 75, - 98, 10, 71, 61,220, 47,117,151,165, 59,209,110,233, 91,172,208,209,159,206,108,172,222,234,246,187,247, 58, 15,182,119,191, 78, -228,164, 0, 15, 81, 90,245,231,143,227,129,179, 82,112, 28, 83,160, 92,228,106,109,185,211, 27,236, 99, 18,160,144,211, 27, 28, -184,237,163, 71, 5, 68,143, 58,115,247,185, 42, 59,197,174, 52, 87,123, 7,187,149, 74, 40,101, 66,241,142,192,226,186, 1,211, - 14,232,211,134, 67, 95,175,212, 83, 35,179, 44,117,166,149, 69, 20,229,120,136,184,134, 6,129, 26,120, 14,113, 7,149,244, 33, - 35,206,124, 4, 86,182, 23, 91,135,209, 16,186, 96,153,104, 55, 91,154,138,227, 40, 75,153,157,146,234, 27,181,155,207,238, 62, - 37, 75,228,195,214,151,231,159, 95,190,238,111,253,136,190,195,117,153, 31,216, 47,173, 5,115, 74,231, 30,149,128, 89, 64, 23, -204, 80, 47,248, 62,220,124, 40,108, 3,213, 3,207,149,111,215,145, 18, 38, 66,152,124, 42,190, 8,188, 40,142, 71,163,161,141, -153,189,192, 19,130, 13, 39,195, 49,166,242,231, 72,240,184,221, 25,169,244, 16,186, 16, 32,204,250, 53,248,243,233,197, 27,118, -181,254,112,115, 19, 83, 64,231,146, 78,222, 94,217,104, 47, 92,120,187,253, 30, 29,128,107,235,107,119, 36,138, 48, 41, 34, 21, - 40,146,147,114,153, 60, 89,127,244,234,219, 59, 88, 11, 1,239, 1,105, 78,170,228,129,231,174,128,170,205,233,206,196, 19,117, -163,113,173,252, 12,157,136,220,165,133,230,192,116,234, 52,224,128,204,211, 78, 84,122, 42,133,123,118, 68,117,110,169,166,208, - 53, 20,224,200,147, 86, 36, 61, 69,133,144,146,208,102, 74,251, 73, 83,162,191,137,153,173,231,153, 66,246,195,176,203,157,234, -115, 13,238,197,123,255, 5,160,236, 90,114,163, 6,130,104,219,237,111,198, 73,156, 47,201, 16, 5,144, 16, 74, 4, 75, 36,110, -144, 5, 18, 43,118,220,129, 53,119, 96,205, 29,184, 3,123,144, 16, 18, 2, 33, 36, 68, 80, 64, 40, 65,129, 76,102, 50,227,177, -221,110,127,154,170,234,246,196, 9,217, 48,139, 89, 89,182,218,174,238,250,189,122, 15,207,119, 90, 97,221,242, 97,154,251,159, - 43,104, 91, 40,233,227,144,146,181,203,131,136,245, 42, 28, 67,229,196,152, 97, 11, 4,115, 52,164,163,138,175,201,224,144,144, - 90, 68,117, 72,200, 52, 47, 22, 70, 85, 43,193,146, 13, 39,114,118, 74,196,120,184, 21, 93,226,194,195,220,144,129, 57, 57,120, - 87, 8,225,109, 47, 66,147,113, 21,150,240,124,184, 18, 44,216,113,120,173, 12,114,168,166, 34,208,168, 16,162, 42,100,147, 29, -166,223,202, 90,138,186,192,201,102,156,192,175,244, 76, 25, 21, 81, 49, 0,175, 16,130, 89, 17, 32, 20,158,225,114, 34,201, 9, -172, 96, 99,110,227,168, 56,148, 85,170,176, 45, 84,119, 1,175,151,121, 33,206, 9,222, 88, 39,211,103,236,202,161, 99,173, 61, -100,107, 69, 42, 36,154,193,202,184,231,135,220,155, 78, 78, 66,219,186,187, 25,110,175,247,166,162, 62, 30,201,145, 0, 55,167, - 34, 27,139,127, 96,150, 73,219,192,135, 96, 31, 25, 53, 9, 4,208,104, 82, 92, 42,187,187,182, 46,215, 98, 54,144, 85,232,101, -165,178, 28,174,150, 61,190,187, 58, 55, 74,228,247, 97, 54, 65,241, 99,100,143,129,197,143, 21,194, 35,244,177,174,217, 34, 67, - 50, 14,135,202, 53,155,177,189,123, 35,222,185, 21, 15,198, 69,154,229, 73, 94, 79, 10, 52,165, 84, 42, 65,166, 20, 82,230, 6, -193,109, 28,240,158,143,159, 39,111, 44,209,128, 55,226,107,145, 13,135, 62,216,136,172,212,155, 47,133,144, 8, 62, 40, 80, 34, -147,149,200, 21,165,109,214,240,222,195,223, 66,176,152,203,156,166, 10, 44,126,145, 98,233,210, 64,154, 25, 71, 50,216,228,127, - 24, 84,153,225, 27, 38,148, 14,182,112, 72, 71,132, 20,125,219, 17,109,172,111, 90, 84, 13, 33,184,189, 22, 87, 83,157,150, 9, - 92,228,186,224,233,185,172,203,126,220, 31,166,131, 52, 75, 80, 0,196,178,100, 41, 72, 82,197,184, 7,184,121,232,247, 38,233, -168, 86, 90,168, 14, 86, 84,185,142, 87,150,101, 59,129,165,137,135,148,207,125, 8,165, 97,113,113, 24, 83, 86,110,177,182, 27, - 1, 15,246,137,189, 50, 10, 22,132, 76,117, 66,108, 99,211,137,228,196,181,215, 67, 16,148, 75,229, 78,157, 59,107, 70, 16,174, -233, 28,112, 84, 16, 3, 46,184, 2, 82, 97,112,172, 28, 92,194,131,219,247, 63,254,248,164,249,183,112,138, 21,183,158, 67,123, -207, 5,147,129, 87, 80, 90, 16,220, 56, 57, 54, 62, 87, 30,109,237, 61,190,179,231,111,218,172, 96,227, 15,205,207, 45,251,245, -111,246,238,215,225,254,112,127, 40, 6,220,143,220,181,123,121, 19,156, 14,191,202,233,113,149, 79, 84, 50,184,193,231, 31, 46, -250,235,243, 78,146,177,131, 60,121, 59,126, 85,177,113, 38, 79,242,242,172,193, 56,164, 49,157, 57,139,175,122,219,152,118,216, -243,215,120, 63,112,214,206,228,251,229,165,163, 97, 33, 51,171,153, 10,113, 64,141,150,151,207, 95, 60,121,246,212,131,184,167, -188,154,171,178,251,153, 33,172,222, 89,189,249,249,207, 62,182,132,221,168, 31, 95, 87,142,219, 38,131,166,137,142,252,240,149, - 64, 78, 90, 26,159,166,147,189, 50,146, 62, 38,100,175,205,118,234,128,162,148,154,129,217, 88,109, 6,120,148,186, 32, 41,131, -165,248,106,134,106,236,156,239, 93,142,151, 75, 49,157,197,102, 85, 20, 2,164,112, 91, 67, 77, 52, 97, 70,155,137,178,115,129, - 17,173,126,174,169, 5,140,254, 67,203,107, 53, 43, 25, 95, 28, 56,253,175,195, 29,126,127, 5,160,235, 90,122,162,134,162,240, -185,125, 13,237, 76,103, 24,134, 71, 0, 19, 55, 6, 68,194,130,173,137,174,253, 11,254, 7,215,186,214,191,224,194,189, 11, 19, - 55,252, 15, 55,248, 72, 52, 38,188, 66, 98,120, 9, 2, 45,109,153,222,222,214,251,157,219,130, 3,152, 89, 53, 51,233,180,183, -189,231,124,231,245,125,181,125,191,185,125,106, 66, 2,132,212, 40,224,176, 76,182,190,236,174, 24,183, 25,134,107,252,160,208, -183, 0, 97, 95,112,254, 9, 22,141, 64,154, 23,174,162, 96, 85, 29, 54, 66, 44, 82, 3,156, 2, 87,209,246,218,158, 53,150,200, - 11, 36, 82,109,115,102, 13, 16,176, 8, 45, 80, 96,163,173,190,163,113,186, 3,176, 27, 8,207,247, 90, 2, 82, 30,122,219, 90, - 46, 3, 23,188, 73, 70,166,153,157,184,118, 36, 7,105, 52, 44,139,221,243, 31,146,100, 86, 36, 89,161, 77,205,144, 89,136,139, - 74, 92,201,157,192,202,228, 36, 57, 14, 2,133,189, 75, 46,215,139,220, 73,127,230, 92, 29, 39, 69,204,149, 23,230,125, 19,215, -186,227, 55, 44,251,255,155, 34, 71, 83,240,205,159, 98,251,242, 35, 69,188,192,148,249,142,146, 94, 89, 46,207, 6,253,158,159, -100,114, 63,202, 53,224,213,183, 27,194,179,209, 73, 94,230,224, 99,132,139, 86, 28,106,162, 43,168, 38, 0,175,165, 10, 48, 38, - 46,160,123,162, 15, 19,197, 10,143, 36,186,142,152,240,172,241,150,221,113,188,245,163, 36, 1,103, 3, 50, 77,147,129, 53, 21, -184, 81, 82,110,167,210,116, 60, 7, 60,177, 24, 32,150, 32, 29, 84,107,172, 21,186, 52,219,243, 86, 23,122, 51, 83,225,175,223, - 26,239,229,167,105,145,230,168, 57,166, 60, 94,174,157,161,203, 38, 94,191, 1, 93, 95,187, 89,145, 42, 35,130,132,130,120, 11, -192, 81, 76,133, 86,148,169,207, 27,242, 18,162, 45, 64,241,185, 68, 42,137,137,129, 12, 57,145,201, 62,226, 51,232, 76, 30,199, - 39,246,104,223,204,200,140, 32,221, 90,206,106,164,147,216, 40,136,153,141,132,125, 36, 76, 18,172, 70, 76,250,199,131,238, 32, - 78,163,249,254,252, 14, 20, 54, 56,203, 14, 78, 62, 63,205,181, 99, 42,170, 70,162,141,203, 66,152,137,129,194,148,176,199, 92, -175,237,119,143,163, 67,139,223, 88, 85, 72,212,155, 0, 1,209, 38, 7, 9, 42,175, 61, 8,251, 27,135,155,216,185,170,110,225, -188, 26,156,227, 44,186,109, 53,179, 47, 26,157, 44,206, 45,125,219,253,210,239, 76,100, 82,102, 50,117,174, 61, 1, 82,210,184, -114,163, 42,205,183, 96, 82,182,136, 1,248,107,108, 64,163, 55,222, 28, 57,220,108,224,176,190,141, 11,176,133, 73,175, 78,203, -151,170,240,108,104,159,241,234, 90, 70,202, 19, 92,163, 8, 91,133,190,230, 56,151,165,176,115, 97, 15,201,150,149,123, 63, 92, - 88, 26, 44, 62,246, 87, 87, 94, 77,211, 10, 95,211, 17, 8,131, 55,247,104,251,140,214,247,105,253,130, 34,165,209, 22, 61,152, -163,135,211,244,180, 79,203, 19,244,103,155,214,190,210,251,159,180,151, 82, 28, 75,153,159, 85, 5,152,217,203, 98, 40,100,105, -229, 39,190, 19,248, 82,106,244, 96,171, 44, 59,255,158, 29,188,123,243,236,201,199, 79,107, 59,167, 7,123,116,249,250,249,139, -151, 31,222, 62,234,222,219,138, 15, 93,215,203,193, 36,168,110,209,111, 85,198, 50,114,159, 38, 2,187,208, 25,211, 11, 11,165, - 32,207,135,187,178,140, 26, 66, 77,193,101,168,193,160, 0,162, 12, 77,117,201,234, 17,172, 5,162, 12, 21, 85, 77, 28, 76, 85, - 85,221,162, 30, 65,226,171,233,142, 25,153,184, 96,115, 43, 76, 35, 71,205, 39, 83,209, 63,167, 16, 84,149,119,241,182,155, 7, -107,210,218,104, 59, 66,221,220, 2,155, 66, 77, 16,212, 40, 41,179,152, 84,101, 4,189,185, 76,203,184, 82,137, 70,167,217,111, - 5,217,104, 39,229, 85, 51,222,245, 52,236, 29,198,253, 14,146,149,191, 2,208,117, 37,187, 81, 3, 65,180,187,221,118,123,236, - 25,156,132,132, 75, 16, 72, 4,144,136, 0,113, 64,130, 3, 7, 46,112,201, 95, 32,241, 53,220, 56,241, 1,156,248, 2,206, 8, -174,108, 18, 72, 17, 72, 64, 16, 4, 80, 50,100,108,143,215,105, 55, 85,213, 61, 75, 22,164, 57,204,209,234,165,186,234,213,171, -247,228, 73,146, 41, 83,252,157, 78, 63,197, 37, 4,251, 20, 15,108, 41,109,179, 33, 27, 8, 3,207, 81,187, 38,132,162,114, 50, - 69,243,167, 94, 98, 40,112,194, 32, 91,243, 20,247, 67,137, 94, 78,121, 59, 68,168, 7,170, 82,124,112,177,199, 68,156, 75, 11, - 40, 11,235,101, 38, 89, 64, 34, 72,232, 96, 19, 32, 5,135, 43, 43,157, 41,156,166,127,163, 59,159,194, 60, 84, 12,131, 64,201, - 9,214, 24, 28,203, 97,178, 88,232,132,107,151, 31,162,185, 64,133, 17, 76, 40,101, 32,214, 17,134, 29, 73, 95,137,210,134,211, -121,120, 71, 93,194,220,159,152, 96, 22, 8,152,169,141,147,244,184, 57,241,233,238,152, 19,172,135, 21, 16,172,175,150,198,232, -247,134,224, 20,167,169, 95, 90, 39,214,247,229,165, 85,213,143,189, 81, 86,167,181,134, 60, 55,144, 60,242,189, 88, 26,200,184, -123, 74, 42,164,144,243, 18, 59,175,148,128, 81, 96, 68,231,107,186,181, 13,157, 91,109,211, 9,195, 26,114,207, 20,136,254,242, -172, 33,232,166,110,172,219,125,205, 80,219, 19, 54,108, 99,189,199,117,160,183, 15, 10, 52, 14, 69, 88, 38, 98,114, 61, 12,140, -175,191, 20,117,169,113,173,199, 85,251,125,183, 24,196, 97, 18,203,220,180,170,230,181, 48, 49,148, 57, 8,130, 33, 23,126, 76, - 26,159,202, 99, 7,117,183,194, 69,213, 64,177,236,102,240, 52,245,126,139,170, 27,132,222,181, 13,254,230, 51, 4,118, 36,116, -118,182,105, 64,179,151, 29,233, 76,118,142, 6,216, 33, 34,121, 84, 93,143,219, 89,187,238, 48,184, 57,179,116,159,169,128, 82, -229,187, 64,140, 50,118, 92,205,193, 45,112, 80, 79,247,151,135,249, 94, 81,229,145,138,118,134, 59,168,203, 65, 73, 21,124,103, -213, 20,198,121, 77,205,199, 5,113,223, 32, 96,146, 77, 7,242,178,234,124,117,176, 54,204,135,244, 60,123,119, 54,111,191,248, -240,146, 26,156,136, 68,142,171, 17, 60, 15,144,134,247,194,126, 6,251,171,157,187,150, 13,238,130, 40,100,142,152,204, 77,221, - 54,239,191,189,131,237, 72,139, 17, 60,210, 82,240, 25,255, 88, 88, 77, 41,171, 17, 19, 38,227, 42,101,142,138,231,185, 46,132, -237, 72,184, 63,179,142,220,220,209,193,222, 85,184, 50, 80, 12, 89, 33, 82,242,156,193, 27, 4, 71, 34,137,146, 20, 91,220, 16, - 61,116, 20,242,162,107,225,203,224, 48,196,152,250,171,180,253,249,122,191,185,123,246,214,211, 63,108,119,159,141, 2,166,206, -176,115, 9,187,121,157,221,227,236,254,108,245,245, 33, 7,131,149, 43,236,193, 22,219,220,102,239, 63,177,189,191,126, 90,172, -101, 37, 75, 26,182, 60, 97, 89, 10,165,244,249,116,140, 54,128,240,235,213, 90,132,113, 89,189,189, 26,110, 61,124,245,104,251, -227,243, 11, 27, 23,253, 27,151,159, 61,126,242, 53,251,177,212, 75, 90,114,139,176, 52, 38,107,196, 4,239, 92,228, 99, 99, 76, - 33,125, 14, 75, 20,136,216, 40, 71, 72,112,132, 10,162, 83,189,228,215,232, 55, 22, 85, 11, 99, 17, 46, 75, 39, 99, 8, 82,128, -177, 70,120,211,164,120, 10,198,177,249,160,233,188, 39, 89,180, 37, 81,111,245,145,254, 25, 58,195,248, 97, 32,101, 86,229,226, - 63,137,186, 57, 54, 11, 43,156,136,141,103,220,251, 36,132,113,101, 13,209, 14,185,243, 76,192,144,170,148, 23, 18, 3, 5,174, - 63, 38, 66,149, 41,105, 53,224,128,208,220, 45,227,165, 29,132, 94,212,172,153, 50,121,244, 2,242,104,216, 49, 38,253,177,100, -243,159, 0,124,157,203,138, 19, 65, 20,134,171,170,171, 47, 73, 67, 50, 56,227, 5, 7, 28,193, 69, 64,131, 10, 46,196,149,111, -224,194, 7,112,229, 59,248, 0,190,133,111,227,194,149,162,120,193,157, 73, 64, 68,103, 24, 52, 49,157,164,187,171,171,202,250, - 79, 85,103,210, 50,186,155, 33, 36, 36,157,212,233,115,249,207,247,203,238, 98,230,174, 44, 50,112,222,195,128,149,241, 92,244, - 27,235, 81,128,129,214, 0,208,151, 21, 13,244, 39,212, 21, 34,209,125,100, 36,109,134,251,201, 38,120,131,254,151,170, 44, 81, - 6,232,128,234,214, 96,182,225,152,175,122,170, 57,156, 42, 16,175, 64, 5,112,127,186, 51, 93, 69, 24,250,149, 48,129,108,100, - 36,123, 90,247,177,216,141, 87,207,132,168,208,135, 33,221, 33, 69,117,113, 6,201,225,222,238,193,108, 55,156, 8, 95, 76,109, -153,140, 80, 90,158, 39, 5,241,190,187,211,128, 9,206, 59,116,208, 97,126,160,234, 77,165, 55,237,156, 4, 99, 82,201,125,219, -143,241,191, 23,104,188,235, 64,123, 13, 93,117,108, 53, 60,143, 60,101, 55,228, 99, 20,226, 25,223,203,101,154,138,239,115,213, -167, 40,213, 75,196,126,159, 19,161,135, 95,196,204,210,210,230,139,117,159,180, 82,182,108, 40,201,209, 64,251,186, 7,170,150, -187,133, 5, 59, 99, 55, 36,187,133, 2,199,128,235,170, 49, 3,230,191, 26,235, 1,128,158,109, 96, 10, 45, 38,197,237,163,225, -248, 48,159, 79,245,130,233,156, 69, 87,226,228,250,165,116,246,123, 93,211, 12, 30,216,153,181, 29, 46,235,227,147, 85,158, 67, -117,227,222, 89, 46, 80, 64,148,202,100, 17,174,154, 38, 2,107, 67,221,138, 90, 24,220,212,221,183,160, 33,236,145,134, 37,177, - 11,157, 56, 86,195, 30,191,119, 35,121, 59,169, 85, 35,124,130,138, 26, 33,104,144,192, 1,117,255, 40,226, 99,248, 75, 72,249, - 65, 74,188,142, 51, 61,105,212, 69, 59,153, 80, 74,154,118, 8,210, 49,214, 33,201, 30,190,144,200,134,228, 29, 7, 91,192,179, -205,212, 27, 65, 11, 0,136,189, 26,203, 26,174,206,148,194,106,107,119,247,249,194,134, 6,133,137, 10,190,198,124, 77, 79,244, - 15,159, 46,127, 26,132,102,218,116, 37, 83,239, 74,149,185, 11,238,155,185,148, 9, 42,248, 48, 34,179,100, 75,222,153, 96,181, -210, 75, 49, 62,186,243,126,246, 46,200,224,183,119,168, 22, 75, 1,103,193, 72,240,109,187, 54,124,160, 80,157, 8,242, 46,161, -170,210, 71,120, 78,125,101,200, 61, 48,158,163, 50,122,208,239,187,252,189, 40, 87,212,137,116,209, 48,155,151, 11,122,174, 59, - 80,122, 63, 31,156, 46, 23,169,132, 89,113,105,244,229, 94,242,109, 83, 63,146, 15, 71, 98,239,106,205, 94, 78,217,231, 30,171, -110,178,105,198,190, 16, 45,184,166,246, 29, 88, 53, 17,170,189, 49,131,196,198, 43,119, 93,110,126,127,196, 30,140,232,240,108, - 47,162, 33,190, 77, 65, 57,197,138,140, 67, 78,162,201,135, 91, 95,223, 60,158, 29,255,248,244,236,197,181,187, 50, 91,170,231, - 79,158,190,250,248,250, 48, 27, 42,208,193, 85,140,172, 49, 78, 56,246, 92, 82,224,218, 92,145, 30, 43, 79, 39,164,198,158,196, -162,145, 70, 89, 99, 69, 81, 46,139,178,240,227, 64, 15, 2,163,155,180,239,144, 19, 12, 92, 83,243,205, 67,130,184,207,235,121, -107,217, 22,124, 52,232,110,176, 53, 46, 53, 1, 71,113, 94, 57,158, 3,197, 92,252, 19, 58,184,179, 44,105, 58, 91, 47,225,247, - 73,125, 25,238,213,228, 84, 89, 74,228, 39, 92, 14,178, 11,123,233, 65, 34,226,178,174,138,102, 93, 53, 42,134,142,164,233, 69, -106,173, 87,149, 94,121,170, 57, 25,157, 91,182,141,145,188,243, 54,248, 57,105,187,253, 15,220,248,143, 0,124, 93, 93,111,211, - 48, 20,117,226,196, 77,214,177,129, 52,109,226, 1, 77,108, 19,111,136, 23,126, 2,255,147, 63,128,120,229, 63,240,196,135, 4, - 67,211,180, 7,208,144, 6,235,218, 46,109,147,216,177,185,231, 94,123, 42, 99, 76,170, 86,173,138,218, 40,177,111,142,143,207, - 61,167,184, 75, 57, 35,187,243, 98, 2,140,179,164, 15,232, 30, 56, 70, 66, 70, 99, 98,211, 69, 52,249,136,159, 0, 4,235, 52, -100, 61,126,112,185,131,210, 2, 16,215,243,217,121,195,122, 74, 31, 99,204,178, 68, 78, 97, 13, 57,112,228, 88,193,107, 79, 54, -134,135, 1,161, 5,238, 65,249,166,194,109, 0,154, 6,232, 70, 57,204,169, 2,122, 54,243,190,227,220,159,210, 6, 95,193,217, -149,192,101, 70,139,184, 34,211, 78,190, 58,228,241,103,130, 74,237, 84, 46,245,237, 57, 46,194,101,224, 18,159,113, 47,248,108, -152,250,192, 46,175, 73, 54, 67,175,235,197, 68,113, 36,116,242, 17,194, 4, 79,182, 98,225,150,195,123,106,161,186,105,112,147, - 53,154, 15,114, 42,252,108, 47, 68, 28, 73, 35, 58, 15, 87,141,221, 38, 20,149, 67,126,177,243,160,220,218, 40, 45,108,153,194, -114,128,145, 67, 7,191, 77,220,195, 81,129, 10, 65,151,120, 97,217,249, 63,120, 60, 43,121,163,103,133,176,148,232,102, 37,112, -110,225,248,175,149,205,162,200,117, 56,182,128,253, 49,119,199,159, 47,247,170,188, 46, 51, 3,254, 50, 52,218,189,191,104, 39, -173,159, 37, 11,120, 42,244,213,181,175, 39,118, 95, 3, 84, 16, 24,130, 44, 31,168, 74, 53, 61,218, 19,107,118,246,106, 3, 97, - 82,125, 62, 64, 63,243,104,164, 30,110,132,153, 85,139,158,254,213, 21,213, 14,208,238, 97, 92,231,207, 15,138,143,167,136, 64, - 15, 26, 23,129,217, 80,108,177, 12, 1,196,116, 89,104,132,223, 70,186, 57, 43,139,178,231, 12,182, 91,172,102, 88,107, 13, 12, -127,201,119,243,152, 40,154,173, 73,188,132, 45,226, 9, 59, 91,205,139,120,140,207,226,138, 1,220, 51,186,223,100,116, 10,116, - 22,207,125, 28,163,107, 51, 90,181, 43, 21,251, 84, 51, 2,143, 30,142, 15,248,234,227,239,223, 16,152, 42, 59,178,160, 10,101, - 23, 14,225,120,101, 14,197,150,232, 63, 77,102,164, 63,110, 77,139, 31,195,153,233,211, 79,103, 31,114, 81, 90,137,233, 30, 21, - 78, 31, 27,207, 53,147, 53, 90, 58,156,100,234,177,190, 51, 82, 79,124, 76, 5,139,202, 54,154,177,241, 16, 61,220, 59,152, 54, -151, 75,136,176,132, 96, 14,150,227, 92,229,225, 65,235, 6,157,228,190, 52,202,123,219,141,203,162,115, 29, 12,100,244,104, 58, -111, 54,199,249,139,221,125,154, 19,211,215,234,229,161, 58,175,213,245, 23,213, 31,169,230,153,234,198, 49,239,229, 34,121,150, -156, 40,245, 38, 37, 59, 10,110, 16, 55,105,241,195,216,132, 77,188, 58,220, 82,175,182, 56,218,247,167,250,117,162, 78,207,212, -238,111, 53, 50,171,183, 87,239,134,211,165,254,218, 5,215,244,253,226,233,147, 35,235, 44,161, 60,199,119,130,174,228,134, 25, - 95,181,115, 78,205,246,157,100,243,164, 40, 38, 47, 65, 72, 40,196, 24,135,177, 16, 51,177, 97, 76,133,224,251, 72,153, 8,128, -247, 9,201,199,183,104,200, 46,212, 96, 44,235,126,173, 57,229,158,142,211,108,182,156, 12,116,142,255,245,154, 85,255,246,252, - 39, 77, 10,111, 88,202,131, 23,197,189, 16,154,122,219,236,236,214,143,105,176, 35,128,206,182,160, 63,135, 30, 13,171, 42,226, - 55,154,106, 6,251,154,237,160,108,218,216,203,125,138,140,190,209, 13,223,225,116,172,194,253,182,245,127, 4, 32,236, 90, 91, -155, 8,162,232,204,236, 78,118, 19, 93, 83,124,180,241,139, 34, 42, 8,130,159,252, 46,254,118, 17,196, 63,224, 19, 65,164,172, -134, 66,140, 49,251,152,199,142,247, 53, 49, 69,138, 80, 74, 33,133,116,155,185,119,206,189,247,156,123, 32,105,152,203,219,196, - 8, 8,107,177,207, 22, 77,147,129,244,218, 24,214,175, 34, 95, 17, 71, 59,180,126, 29, 94, 2, 92, 48,171,225,171,172, 0,139, - 33,161,157, 37,110, 52, 55,230,200, 44,116,182,163,147, 90, 27, 31,136,229,182,240, 22,216, 85,228,247,213,218, 67, 77,128,227, - 32, 28,124,215, 84,163, 97,150,197,161, 19, 90, 77, 98,111, 19,215, 86, 26, 75,235, 56,160,158,129, 67,237, 38, 15, 17,216,238, -191,251, 68,222, 32,152,241,197,191, 41,223,222,135,253,105,178,130,108,134, 41,222, 0,130,128, 66,105, 31,127, 41, 41,178, 15, -130, 85,190,124,115,159,138, 56, 17, 58, 95,210, 82,209,104,157,101,186,250, 56, 22,153, 23,200, 63, 48,225, 29, 25,197, 44, 68, - 73,234,100,174, 1, 14, 47, 74, 61,183,133,173,237,181, 69, 9,224,235,124, 51,158,111,250,118,235,215, 59,239, 6, 63, 58,136, -128, 56,194, 83,121,188,188,230, 6,242,163,174,140,106,102, 26, 32,127,133, 13, 19,228,127,193,179,243, 10, 95, 77, 45,151,142, -162,110, 71, 41,165,204,201,189,207,248, 2, 94, 93,135,212, 78, 9,176,232, 58,166, 54,196, 54, 32,111,210,101,132, 82,146,117, - 76, 99,141,213,105,187,143,189,159, 28,249,224,250,144, 48,107, 79,178,181,162,214,105, 94,164,170, 32,201, 43,234,161,212,173, - 26,211,209, 0, 88, 57,170,166,134,207, 72,117, 46,141,147, 94,157,152,139,109, 68,213,189,214,182,184,206, 22,126,116,156,224, -128,216,229,226, 38,113,254,240, 95,229, 41, 69, 74,118,251,171,184, 32, 22, 74,129,160,115, 18,111, 63, 3, 21,186,247, 3, 65, - 98, 33,236, 42,246,114,196,243,195, 88, 21, 49,110,145,152,128,200,178, 35, 69,238,119,104,112,122,182, 92, 33, 6, 20,162, 35, - 85, 84,134, 44, 31, 83,112,112,175,202,208, 5, 63,105, 56,105,148,196,249,131,199, 63,168,178,117, 0,244, 98,224,114,170,198, - 48,208, 70,123, 28,228,113,211, 28, 93, 68,202,138,251,115, 71,207, 32,223, 78,151,171,193,119, 60,138,129,155, 67, 17,170, 48, - 25,130, 24,202,241, 40, 43, 97, 11, 89,195, 45,120,195, 81,195,113, 52, 43,102, 36, 88, 85, 70, 22,107, 40, 23,198, 30, 50,190, - 18, 53, 0,156, 8, 23, 66, 65,157,201, 66, 31,153, 83, 81, 90,220,245,187,128, 34, 97, 67, 75,101, 48,233,184,104,182,126,124, -254,242,217,141,199,106,243, 65,217,119,234,238,103,101,222,171,211,175,234,206, 79,245,227, 66, 13, 22, 19,125,175, 17,145, 31, - 76,104, 75, 58,105,117, 38, 95, 29, 56,124,240, 59,155,111,170,125,171, 62,190,158,202, 79,254, 97,103,158, 46,244,147,141,122, -113,255,209,171, 47,111,116,225, 12, 84,244,117, 5,101, 96,180, 54, 26,148, 65, 69,114,102,135, 51,182,168,155,110,232,120,179, -189,244,218, 18,167, 54, 81, 2, 78, 83,238,179, 8, 17, 14, 67, 27,128, 10,238,221,156,100,233,122, 98,229,121,158, 88, 38,177, -164,151,246,141, 44, 9,253,223, 22,129,203,219,216,137,186, 52, 93, 53,188,204,220, 10,125,105, 73, 23,145, 34,249, 28,162, 8, -191,196,126, 11,102,190,219,243,179,123,205,131,170,180, 67,112,123,223,255, 14, 3,178, 63,208,225, 14,162,220, 65,168, 57,156, - 85,185, 40, 27, 70, 10,150,205,106,113,230, 70,146, 85,101,231,145,246,250,252,211,109,191,138,199,115,176,237, 81,127, 4, 96, -235,218,121,155, 8,130,240,238,222,249, 30, 62, 91,128,133,132,132,162,132, 10,201, 29,162,165,231, 55,240, 99,248, 81, 72, 20, - 72, 52, 20, 52, 32,129,160,129,130, 84, 20,128,148, 0, 9,246,197,247,216,221, 57,230,177,123,190, 40,110, 83,228, 44,159,119, -246,155,153,239,113,200,159, 64,143, 68,159, 16,151,153,224,245,194, 58, 35,109, 40, 47,141,196,168, 32, 65, 64, 67,226, 89,250, -196,219,158, 14,160, 84, 51, 48,206,224,237, 4,157,132, 20, 89,162, 19, 76,101,234, 66, 79,231, 73,171,180,121, 52,166, 31, 82, - 78,112,200, 85,226,200,124, 48,164, 25, 34, 72,199,135,101, 52, 30, 53,142,102, 42, 46,211,249, 42, 47, 27,246, 46,167,190,158, - 53,153,151, 29, 86, 33, 55,165, 47, 78, 59, 18, 19,214,107, 49, 18,136,134, 13,192,148,158,140,138, 59,205,143, 32, 10, 92,163, - 93,160, 30,151,171,225,123, 8,152,125,255, 74,135,225,186,115,217,168,103,228, 97,172, 24,187,114,125, 31, 84, 81, 84, 0,112, - 43,107,150,233,176,154,153, 69, 69, 38,107, 23,141,109, 26,191,237,220,214, 14, 41,107, 85, 16,212,209, 25, 50,170,177, 52, 88, - 39, 88,141, 63,231, 12,107,186,233, 41, 35,141, 73, 27, 92,152,114, 46,128, 0,129, 29,223,196, 16, 62, 9,102,234,246,203,225, - 16, 33, 56,254, 8,236, 13, 14,175,143, 7, 21,129, 81,221,248, 63, 26,191, 88,252,244,252, 10,248, 41, 88,199,243, 20,145, 42, -137, 27,182, 94,223, 46, 13, 62,253, 14, 37,126,168,186, 5,196,245,228, 44,143, 37,190,247,155, 6, 11, 28, 45,205,157,211,121, -153, 60, 89,155,183, 95, 58, 34,193,170,142, 52,108, 41,121,146,144,213,149,239,234,182, 23,119, 26, 90,128,192, 62,199, 94, 79, -187, 72, 74,110,176, 62,106,182,241,195,212,221, 70,120, 19,139,124,222,180, 59,185,100,197, 25, 67,130,173, 53,111, 32,215, 71, - 15,191,253, 60, 29, 13, 6, 16,125, 0,157, 39,199,106,213, 73,151, 69,118,246,158, 11,110,146, 33, 48,207,230,255,176,105, 99, -174, 62, 93, 57,172, 46, 38,134,146, 73,251,193,150,121, 73, 38,239,224,218,222,153,144,208,148,112, 67,199, 51,100,128,142,124, -131, 37, 84, 86,134, 43, 32, 28, 56,188, 36, 47, 54,231, 82,114,103,132,254,169, 33,199,218,148,176,140, 77,226, 90, 89, 51, 40, -198,242,100,162,167, 24,219, 74,207, 48,207,138,166,239, 16,128, 39,102,156,151,146,225, 88,107, 91, 82,185,177,103,170, 54, 97, -252, 37,196, 77,230, 27,153, 56,110,212,162,169,209,194,206,160,197, 20, 94,150, 62, 55,217,167,205,199,151,175,214, 79,159, 63, - 62,126,166,142,191, 43,245, 90,189,120,163, 62,191,227,130,142,255,112,169,138,133,218,174, 84,117,164,202, 19, 53,127,160,182, - 11,108,198,213, 37,113,116, 84, 13, 49,228,225,183,114,103,244, 6,253,169,239,206,161,180,253,153, 69, 68,162, 30,221,243,191, -190,102,239,127,124, 40, 22,197, 5,158, 76, 60,168, 80,247,118,103,177,144,121, 70,240,131, 4,240,169,191, 49,225, 86,143,129, - 29, 49, 7,107, 8,128, 59, 76, 87,116,236, 53, 7,218, 78, 93, 9,155, 89,200,237,210, 37,197, 32,242, 24, 82, 26, 56, 9,135, -113,174, 62,108, 22,181,183, 78, 23,163,108, 61,209, 55, 77, 39, 57, 21,167,134,249, 16,252, 36,100, 72, 22, 88,211,125,111,120, -109,201,247,185,214,203,236,238,253,234, 36,211, 9,162,207,153,209, 85,146,144,194,111,240, 68,230,118, 59, 75,140, 15,218, 80, - 66, 92,154,230,204,102, 0,250,123,120, 30, 37,255, 89,128, 64,139,191,102,187,119, 99, 37, 16,147,225, 38,190, 5,255, 5,224, -235, 90, 86,156, 8,162,232,173,234,238, 60,122, 18,144,204,198,133,130, 4,193,197,224, 70, 65,220,234, 94,152,127, 17,252, 14, -119,126,131, 11, 23,254,130, 75,113, 20, 65, 97, 80, 70, 6, 97, 28,145,153, 73, 38,147,126,164, 83, 93,229, 61,183,170, 59,137, - 70,201, 46,105,146, 78,119,245,173, 83,183,206, 35,166,191, 93,210,155, 22, 77, 3,186, 93, 26, 13,187, 49,131, 14, 6, 83,203, -162, 46,197,255,200,200,192, 1,104, 40,109,175,167,227, 94,156, 38,120,210,133, 13,136,188,142,218, 66, 69, 90, 25,207, 37,111, - 44,188, 49, 66,240,181, 81,226, 1,176,164, 30, 11,193,159, 98,184, 47, 71, 93, 10,230, 36, 18, 84,198,232,207, 74,135,196,122, -170, 27,191,242,202,248, 22,102, 4,241, 43,186,158,147, 69,230, 54,205,251,125,198, 94,173,214,148, 0, 1, 5,168, 70,142,134, -203,234, 86,214, 58,237,237, 14, 2,166,166, 67, 21, 70, 94, 83,217,131,165,148,218,140,231, 94,171, 78,174,141,247,211, 33, 14, - 14, 98,206,221, 30, 93, 79, 9, 4,231, 4,148,228, 73,102,166,133, 49,181,203,192,220, 80, 48,232,211, 56,155,203, 37,218, 47, - 89,141,154,149, 51,250,229,127, 87,171, 42,170,241,142, 86,253,136,209, 46, 72,147,252, 49, 79,247,115, 73,228,168,164,136,123, - 19,192,214, 5, 86, 55,254, 10,186,177, 8,252,207, 34, 78, 55, 96,255, 44,135,141,140,197, 46, 28, 87,109, 73,110, 39,149, 9, -189,177,146, 53, 14, 95,234,105,225,134, 29,189,211, 81,131, 24,241, 45,217,210,117,156, 29,116,181, 88,159, 33, 72,132,239, 13, - 15,198,188,176,163,145,126,124, 55,121,251,117, 56, 43,231,125,225,120, 44, 84, 45,100, 1, 37,102,191,178, 38,146,134,130, 76, - 38,130,177,108,112,140,177,255, 60, 85, 40,236,138,170,224,113,151,118, 83, 7,162,125,165,125,164,181, 14,185, 10, 71,167, 71, -218,107, 61,229,161, 52, 72,114, 68,215, 54,152, 20,160,119,235,100,212, 65,159,209, 73, 0,165,231,197, 85,206,103,167,188,120, - 28,119, 62,214,137, 17,196,132,246, 81,101,166,243, 11,191, 16,148,164, 72,132, 5,138,152, 8,125, 67,158,108,224,125,182, 40, -219,168, 48, 64, 56, 30,203, 36,178, 51,172, 30,208,156,226,131,211, 36,157,139, 33, 65, 36,156, 28, 97, 36, 97,153,168,209,165, -140, 37,138,146,248, 66,241,105,150,139, 66, 54,226,212,104,176,251,243,242, 84, 41,106, 76,224,189,160, 78,249,205,100,217, 18, -208,146,137,162,107, 37,154, 47, 45,182,152,145,109,118, 44,162, 77,115,108,159,100,204,243,218, 98, 28,221,126, 50,190,247,225, - 13,125,124,109,110,237,197,119, 30,208,254, 67,218, 79,168,252, 70, 7,239,233,213, 33, 29, 28,211,143, 79,120, 72,246,174,209, -211,251,244,104, 76,135,223,233,249,103,250, 82,208,172,192,245,236,197,212, 79,104,236,104,160, 41,203, 34, 83,218, 19,115,126, - 76,179,151,147,119,153, 57,121, 49,126,118, 69,191, 46,204,153,227, 90, 1, 99,120,232,193, 80,212,141,241,180,101,116,165, 64, - 65,242, 26, 31, 87,251,226,110, 55, 28,211,197, 90, 77,114,115,125,204, 89,107,232, 40,104, 29,100, 25, 79,115,241,234, 83,111, -243, 64, 33,196, 45, 8,152,212,118, 61,146, 91,181,204,183,229, 58,217,149, 99,151,106, 81,208,218,129, 34, 85, 13,254,119, 42, - 4, 46,181,253, 25,111,229,130,165,117, 39,234,223,220,185,129,192, 57, 91, 79, 75,174, 91, 80,231,100,139, 44, 55,121,238, 10, - 33, 46,152, 37,180,231, 66,161, 8,191,204,136,174,195,223,105,169,157, 60,148,253, 51,242,211,109,146, 71, 60,183,195,110, 53, - 55,252, 45, 0, 95,231,146,219, 68, 16,132,225,234,199, 76,252,148,101,130,132,226, 72, 94,192, 22, 4,217,103,137,114, 4, 86, - 92,134,179,112, 0,118, 92, 1, 22,236, 88,176,204,138, 40,130,216,137, 31, 99,143,103,166,167,233,191,170,103,236, 24,132, 87, - 30,203,146,109,185,167,186,186,234,175,239,183, 71, 63,207, 71, 52, 90,155,234, 32,121, 31,216, 65,216,120,243,114, 1,105, 57, - 48, 27,117,107,156,105,248,120, 88,106,179,171,138,212,118,134, 73,207, 96, 76, 41, 9,217,120,120,101,227,193, 29, 66, 71, 8, - 84,104, 22, 8,162, 33, 39,179,219, 53,202, 78,142,149,145, 94, 85,141,155, 74,146, 96,241, 87,174, 8,203,247, 4,166, 67,186, -163,108,184, 15, 19, 99,251,166, 27,222,182,227, 33,210, 62, 56, 89,102,227,114, 2,254,208,153,104,194,232, 91,224, 87,131,203, -111,170, 51,109,215, 57,114, 27, 26,204,153,218, 11,217,155,251, 59,158,179, 77,140, 63,113,144,166, 73,160,188,214, 7,234,247, -122, 79, 46,219,127, 14,107, 70, 90, 99,128,113,151,158,117,117,199,232, 69,238,110,102,171,144, 55,174, 10,212,178, 75,209,164, - 43,186, 47,217, 38,137,239,200, 16, 85, 55, 62,174, 41,136,136, 42, 58,133, 48, 21, 60,128, 45,111,169, 80,179,192,181, 38, 82, - 65,164, 48,154, 55,127,159, 36, 29,169,240, 68,154, 75,245,223,248, 46, 35,209, 25, 43, 9,104, 7,242,251,210, 80, 71, 99,215, -233, 89,175,156, 94,131,230, 22, 46,125,138,110, 17,109, 11, 28,177, 84, 2, 57, 77, 5, 91, 87, 93,186,144,117,232, 36,129, 22, -104, 9,191, 10,212,212,126, 45,234,233, 19,243,250,121,246,229,135,115,245, 14,186,251, 16, 93, 25,157, 88,201,152,158,178, 33, - 81, 48, 90,108,139, 84,170, 77,191, 55,156,111, 30,184,108,254, 15,141,164,150,218,132, 97, 51, 17, 79,224,200, 67, 60,142,238, -181,230,163,165, 22, 12, 70,164,126, 55,246, 99,142,131,187,143,113,145,129,214,120, 22, 62,119,212, 27,205, 86,115, 9,184,164, -246, 66, 99,244,129,234,104, 49, 17,238,201,253, 72,149,215, 39,108, 30, 4,121, 3, 31, 10,207,199,103,243,213, 61,138, 71, 81, - 72, 43,217,187,151,110, 83,212, 51, 71, 93,187,103, 56,137,146, 88, 21,171,123, 70,139,213,154,139,128, 3,202,118,219,144,179, -135,213,142, 42,163,247,191,151,183,162,176, 85, 58, 30,166,149,111,109, 10,100,127,196, 16, 92,154, 26,152, 89, 26,150,125, 73, - 17,211, 71,206,181,111,199,235,165, 33,138,189, 0,245,209,183,250,138,102,116,241,138,108,101,127,222,249,207,107,160,151,244, - 5, 77,222, 81,239,138,222,111,233, 67,202, 76,201, 59, 26, 78,136, 94,176, 29,200, 55,186,252, 72,167, 55,244, 80, 80,153, 35, - 36, 91, 75, 83, 69,231, 3,178, 57, 77,234,228,205,120, 58,122, 74, 52,122, 25,150,227,247,235,219, 79,215, 95,179, 44, 3, 78, -168,230,137, 20, 87,150,200,182, 49,127, 36, 96,123, 68, 98,102, 79, 71,128,107,140,209,141,114, 93, 78,192,218, 14, 59,195, 25, -250, 97,237,100,144,244, 53,112,209, 77,251,121,201, 34,222, 56, 43, 20,133,125,190,229,254,213,135, 74, 19,181,239,133,186, 8, -103,105,211,224, 67,194,139, 8,243,212, 95,147, 77,109, 49, 70, 61, 18,206,196,175,202, 39, 49, 47,101,109,110,219,155,179,222, -180,107,187,185, 43,138, 98,147, 87,235,109,145,101,229, 6, 51,152, 97, 89,161,231, 5,171, 50,201, 3, 90, 48, 23,107,163, 43, -127, 80,134,240,143, 74,253,199,210,123,137,120,234, 72, 68,121,240,248, 35, 0, 93,231,178,219, 68, 16, 68,209,234,121,216,158, -241, 35, 9,196, 73, 88, 0, 17, 98, 3, 10, 31,193,255,177,231,127, 96,201,138, 5, 66, 66,138, 16, 34, 68,150, 2,241,120,108, -247,188,186,167,232,170,238,121, 56, 3, 81,150,177, 21,121,218,213,221,183,110,221, 19, 12, 14,239, 94,211,194,114, 61,253, 56, -152, 22, 74,238,171, 61, 79, 83, 90,126, 45, 79,220, 56,194, 17, 67,175, 53, 5, 1, 82, 99,142,176,176, 35,235,118,207, 73,149, -117,202, 26,185, 11,188,150, 70,142, 77, 51,147,222, 81, 83,176,175,121, 19, 58, 47,133,140,208, 38, 44,186,176,177,101,212, 56, -154, 5,164, 59, 7, 4,156, 84, 71,227,216, 92,140,205,106,217, 85,245, 34, 52, 95,138, 96,234,121, 63,170,212,154, 93, 69, 51, -208,142,131, 52, 71,236,170,153,223,195, 25,246,104, 27, 77,113, 71, 43,125,130,227,160,137,214, 45,234, 6,191,156, 65,146, 47, -225,194,229, 57, 91,158,123, 43,208, 67,151,153, 18,143,240,217, 66, 76, 60,248,147,228, 55, 91,149,113,240,185,165,164, 77,248, - 5,155,230,252, 79, 70,148,166, 94,171,134,147,103,202, 81,198,248,112,159, 82,127,237, 7,194,102, 32,254,203,178,249,231,245, -161,234,146,247, 30,182, 24,132,251, 63,248, 81,141,198, 90,240,238, 18, 1, 36, 26, 30,213, 24, 33,175, 62,129, 19, 64,105,238, - 25,218,147,140,127, 50, 85,126, 20,212,177, 22, 82, 96, 37,188,199, 17,173,208, 66,195,220, 39,171,138,141,133, 48, 87,180, 92, -193,237, 6, 79,102,222,219, 55,163,143, 95, 84,161,131,128,164,113,254,173,105,110,121,121,252,100,117,127, 59,157, 28,165, 89, -194,110,242,122,155,167,180, 47,114,160,150,195, 21,187,117, 79, 61,126, 55,130,128, 22,220,205,183, 96,119, 25,246,220,108,167, -176, 57,135,100, 84, 55, 7, 5, 31,152, 5,203,186, 85,155,148,135, 76, 51,231, 48, 41, 92,239,214,190,232,228,234, 38,110,136, -182,139,120, 20,203, 66,154,131, 75, 20,206,164, 57,165, 8,103, 73,204,171,194,226, 48, 60,182,162,167,251, 77, 20,142,101,185, -243,221,142, 36, 58, 12, 88,237, 82,161,173, 95,207,111,146, 5, 68,219, 28,182,173, 3,171, 1, 90,181,133, 45, 55,230,100,195, - 87, 83,122,110,243,201,172,160, 12,246, 10, 90, 65, 31, 6,174,104,194, 6, 61,191,249,253,179,205,238,235,172, 28,221,115,103, -122, 42,178,238,128, 20, 54,247,226,229,133,252, 5, 95,223,235,232,210, 95, 94, 42,121, 28,222, 7,112,183,130, 15,159, 9,186, - 11,175,204,170, 3,125, 14,245, 25, 25, 99,174,114, 90, 9,103, 87,112,241, 14, 94,155,154,180,135, 83, 9,170, 36,154,237,108, - 13,227, 5, 92, 38,240,244,132,156, 51,184,130,235,111,240,233, 59,158,167,243,165,127,122,231, 93,151,149, 57, 17,170,138, 56, - 5,154,109, 19, 84,215,231,241,194,124,146, 50,219, 90,143,170,179, 51,218, 22,169,211,226,221,144, 39,237, 12, 89,210, 80, 82, - 29,128,150,211,242,232, 9,234,106, 91,215,181,227,109, 56, 20, 42, 98,191, 47, 57, 56,246,214, 46, 45,177, 59,254,160,120, 72, - 90, 82,221,119,231, 96,108, 21,224,127, 49, 47,158,235, 31, 33,139, 52,172,173, 77,195,197, 60,152,234,186,148, 69,154,100,233, -190,218, 81,101,199,162, 36, 31,156,230,178,174,173,234,208,203,131, 4,238, 56,176,238, 77,245, 64, 33,252, 3, 72,210,155, 23, - 65,113, 72, 76, 24,230,208,252, 21,128,178,107,233,109, 26, 8,194,251,242, 35, 78,221,180, 21, 41,149, 42,161, 10, 9,169, 82, - 43, 14,220,144, 64,226,206, 25,113,226, 15,240, 7,249, 3, 21,226, 12, 10, 39,132,132, 74,120, 84,180,228,213, 36,235,120,119, -217,153,241,250, 1,185, 16,229, 18, 71,137,237,181, 53,158,249,102,190,239,171,248, 77, 45, 19, 15, 78,216,165, 79,180, 1, 76, - 98, 42,151, 57, 72,110, 58,131,123, 3, 77,159,218,240, 40, 84, 37, 2,199, 63, 1,199,236,171, 52, 18, 73, 36,208,159, 12, 18, -116, 91,216,114,229, 54,132,110,163, 25, 49,179, 85, 27,144, 8, 29, 8,136, 56,232,251,144,206, 61,114,243,176, 59, 33, 68, 95, -166, 42,138,123, 34,246,233,205, 32,206, 82,149,237, 37,253, 8,237,230,111, 13, 16,149, 11, 87,104,107, 63,220,188, 47,204,122, - 89,222,234, 82,175, 0,153, 55,144, 86, 34, 58,103, 2,205,173,117,117, 36,103,141, 72, 68,117,214, 33,184, 55,189,190,144,182, - 11, 66, 89, 29,239,120,124,252,205,203, 40, 89, 77,108,174, 22, 29, 6, 45,252,179,232,225, 29,238, 15,241,219,111, 61, 54, 96, -151, 75, 9,117,138, 63,200,241,227,154, 85, 26,221,181,160,112,132, 9,120,129, 95,213,116, 83,213, 66, 90, 92,144,148,137,112, -227, 52,232, 0,186,182,129,215,255,188,232,234, 36,181,231, 42,190,115, 95,131,227,201,204,144,190, 29,225,186,244, 36, 31,166, - 50, 6, 90, 14, 14, 7, 72, 31, 10, 65,131, 56,142,212, 78,204,178,158,152,104,174,173, 75, 99, 95,243, 73,205, 92, 22,241,187, - 3,185,210,246,237,200, 87,100,160, 66,105,161, 26,128,157,228,217,193,213,244, 39,225,150,120, 75,216, 88, 38, 2,169, 84,126, -229, 23,122,134,245, 83, 71,211,148, 28,203,176,131,170, 80,207,142,147, 27, 42,167,224, 46, 73,140,139,159, 29,159,143, 46, 63, -162, 98, 0, 36,136, 0,121,155,194,146, 94, 5, 22, 95, 36, 92, 97,183, 8, 59, 7, 89, 18,206, 78,143, 79, 71,151, 35,137, 67, -241, 4,236, 82, 23, 7,203, 8, 74,191, 57, 65,219,232,106, 70, 86,112, 45,179, 95,244,172,107, 28,127, 88,139,201,170,176, 5, - 21, 44, 94,169,121, 32, 43, 13, 62,108,178, 10,138,251,142, 55,246, 3, 21, 62, 67, 81, 4,236, 22,170,126, 3,202,248, 75,152, -146,136, 21, 24, 79, 71,161, 21,129,143, 28,212,234,195,192,230, 35,235,209,193,209,247,155, 95, 82,166, 43,107,158,236, 63,125, -245,252,181,251,204, 46,222,177,235,229,156,239,138,249, 94,210,123,172, 62,221, 99,203, 67, 54,190,207,174,177, 59, 34,115, 8, - 69,114, 7,219,127, 37,219,160,169, 75, 89,130, 16,133,209,240,176,200,190,192,159, 31, 94,176,225,143,133, 92, 78, 30, 13,216, -179,221,225,208, 36,241, 21,139,246,217,139, 55, 47, 65,143,200, 44,180, 1,143,247,141, 89,131, 41,171, 5, 37, 9, 31,240, 9, - 37, 67,241, 18, 10,238,150,162,105, 69,223,175, 6, 71, 92, 67,248,108, 88,141,238,100,120, 50,158,124, 21, 78,173, 54,203,192, - 99,114, 33,198, 59,190, 77, 34, 70,116, 3,180,170,103, 10,107,223, 54,195, 90,252, 2, 22, 84,189,254, 21, 36,104, 10,120,214, -153,106,133, 50, 18,102,102,240, 38,125,176,123,214,147,241, 84,207,166,235,201,180,152,195,116, 56,172, 28, 42,119, 96,100, 55, - 44,136,206, 55, 14, 80,162, 70,128,125, 49,108, 27, 96,213,117,113,224,250, 32, 93, 55,103,223, 66,103,253, 35, 0, 95, 87,176, -219, 52, 16, 68,103,215,142, 93,167, 77,169, 21,135, 20, 80,149, 83, 17,112,225,196, 55,240,183,112,226,198, 13,196, 1, 14, 21, -202,161, 21, 42, 32,164, 52, 41, 77,169,147,208,216, 74,156,236,178, 51,179,187, 78,105,213,168,167,180,117,172,205,238,120,102, -222,155,247,106,254, 12, 71, 58,238,185,135,228, 63,193,228, 25,107, 10,110,233, 40,106,211, 68,109, 83,180,138,144, 46,179, 53, - 27, 52,118,231,122,222, 84, 49,161,234, 63,237,224, 21, 33,132,188, 70, 75,138,117, 33, 35, 65,206,244, 59,180,235, 69, 19,231, -152,127,145,105,169, 68,247,178, 4, 61,163,163,144,158, 28, 38,215,155,175,150, 91, 33,234, 25,148,235,242,252,122,168,184,207, -167,205, 15,238,147, 53, 79,197,107,223, 93, 81, 27,208,157,244,152,136, 77,166,172,176,155,176, 16,184,251,206,164, 29, 42, 9, - 92,105,204,164,102,247,107, 78,184, 44,139, 42,224,176, 46,157,222,152,249,228, 56,208,175, 58, 98, 90, 84,167, 87,139,145, 70, -191,189, 45, 96, 59, 76,209,134,160, 13,225, 62,132, 49, 4, 68,131,209,129,163, 17, 43, 79, 93,119, 91,142,109, 24,184,160,100, -130,218,194, 57, 84,202,155, 1, 93,222,219,135,185,255,165, 28,250,234,165, 2, 52,216, 66,145,116,234,233, 96,155,236, 94,154, -237, 73, 24,175, 52,185,149, 9,229,212,190, 87,176, 29,225, 90, 87, 90,180, 34, 73, 65, 28,235,237,164,129,146,147,121,169,155, - 81,112,248, 56, 24,140, 77,129,142,122,210,152,173, 35,217,124, 78,203, 37, 56, 81,226, 1, 16,115, 12,144,160,178, 94, 48,161, - 84,187, 89,113,106,168,155, 11,198,113,152, 40,212,243,225,206,181,228,225, 9, 14,238,146,220,102, 91,201,131,243,124, 68,253, -104,193,225,213, 92, 55,221,222,123,126,240,194,148, 11, 36, 48,170, 54, 75,245,219,128, 60,171, 26,140, 9, 23, 69,156,204, 73, - 36, 52,204, 14,140, 19, 4,137, 36,251, 96,240, 0,139,211,236,182,169,129,240,104, 59, 55,141, 89, 67,202,182,112, 36, 75, 93, -129,253,103, 54, 89,145, 76,181,178, 85, 8,210,105,124,200,224, 99, 40,253, 96, 10, 61,161,236, 31,144,195, 9,217,174,226, 68, - 43,251, 91,210,170,216,158,144,174, 19, 21, 4, 57,180,106,239,118,166,197,108, 55,105, 85,171,245,183,242, 71,255,244,164,247, -168,247,242,245,222,179, 44, 62, 25,142,222,124,125,127,212,239,158,125,108, 22, 31,160,251, 25, 14,143,224,233,119,232, 14,160, - 56,134,230, 0,228, 37, 60,201, 33,155,194,254, 12,228, 16,210, 28,218, 51,200,254,192,195, 51,104,149,208,253, 53,203,254, 14, -210,101,209, 42,163,106, 2, 89,183,217,255,164,222, 30,191,251, 9, 95,204, 87, 89,225, 16, 75,165,212,194,228,240, 7,157,222, -100,126,101, 83,113,176, 41, 59, 41,162,113, 91, 94,123,185, 68,237, 50,110, 59,192,196,201, 59,238, 44,108, 82, 79,138,124,185, - 50, 71,126,105, 35, 59,189,175,107,110,184,118,101,180,226,131, 41,106,165,110,155, 45, 43, 15,173,121, 98,196,205,224,238,188, -157, 68,109,206,100, 47, 79,247, 46,100,221, 37, 19,172,227, 34,157,155, 36,236, 68,233, 78, 35,253, 61,191,188, 40,199,197,234, - 26, 39,234, 49,172,163, 40, 34, 11,229,174,111,129,189,158,130,231,106,205,224,174,135,212,127,170,150,155, 55,126,247,217,255, - 39, 0,105,215,178, 26, 69, 16, 69,171,186,186,166,123, 30, 61,142, 49, 19,178, 24, 33,154,149,136, 27, 63, 64,197, 95,115,239, - 23, 8, 34,238, 93,186,114,109,192,133,139, 8,234, 66, 80,130,198,134, 73,130, 78,232,103, 85, 87, 89,247,214,163,123, 2,186, - 49,129,132, 12, 51, 19, 58,233,190,125,238,185,231,158,179,133,223, 35,103,107, 9,227,209, 8,241,251,136,166,145,221, 47, 71, -113,146,118, 29,140, 14,148, 86,136, 1, 25, 25,252, 30, 27,228, 14, 99, 88, 48,122,196,173, 17,208, 1,193,162,140, 68, 7, 24, -136,222, 5,140,101, 23,143, 96,107,159,113,188,133, 88, 67,206,208,101,131,221, 13,131,144, 26,131,226, 57,136, 33,249, 78, 50, -203,120, 58, 51,159,241,184,233, 64, 70, 52, 97,113, 33, 65, 50,251,117,115,242,179,248,209,144,170, 16,149, 85,149, 34,120,239, - 44,126, 87,161,165, 25, 88,195, 6,203, 48, 91,209, 93, 70,149,213, 50, 88,213, 16, 37,195,125, 19, 22, 28,121,182,187, 52,234, -205,171,124,119,101, 61,100,157,232,251,222,117,125, 89,182,223, 74, 48,163, 19,136,193,111,192, 87, 54,161,124,202,216, 50,225, -217,136,225, 38, 42,169, 68,183, 46,235, 83, 85,175, 17,140, 75, 79,156, 41,175,128,212, 65,197,232, 79, 77,203,221, 39, 94, 10, - 25,248,250,255,255,176, 16,126,230,205,163, 37, 62,146,250, 65,174,198, 12,216, 57, 76,126,105, 10,178, 24,164,233,147, 40, 75, -227, 66, 27, 20,207,204,127, 72,226,216, 29,184, 51, 74,175,141,233, 70, 0,242,221,203, 56, 39,234,232,163, 44, 90,142, 91,185, -216,136,194, 61, 67, 47, 38,187,235,223, 57,154,244,224, 61,191,159,106,192, 95,127, 49,221, 61, 47,206, 24, 86, 99,120, 87,141, -133,156,134,218, 26, 49, 71,158, 69, 62, 1,152, 88,248,107, 5, 44, 18, 7,113,230,100, 48, 53,176,105, 43, 76, 41,112, 48,241, - 31,161, 91, 22,221,107,159,229,224, 20,200, 17, 26, 85, 6,211, 0,255,139, 66,108, 8,118, 11,168,172,236,173, 9, 7, 58, 43, -124,185,249,249, 46,120, 5,127, 98,254, 16,230,105, 86,180, 37,179,199,130, 92, 83,236,168,243, 64, 9,134, 48, 53,208, 84, 91, -119, 84, 68,253, 4,219, 92,224,114, 98,140, 69, 77, 32,245, 27, 88,157, 36, 30,153,170, 90, 54, 21,144, 24,170, 19,246,180,132, -231,196, 6, 75, 40,115,197, 49, 62,231, 75,193,179,157,197,193,195,213,131,251,183,111,141, 47, 41, 89,145,207, 57,121,125, 68, -222,124, 39,239,214,228,188,129,145,201,163,125,242,226, 49,217, 63, 36,199,199,228,233, 23,146, 11,216,129, 74,113,110,100,240, -123,181,145, 52,142,243,211,103, 93,253,158, 74,105,122,212, 92,159,220, 36,171,231,135, 47, 95,137, 39, 31,200,219, 78, 54,141, -170,164,170,219, 78, 72, 92, 20,151,144,179, 65, 61,141,110,215,244,157, 24,198, 87,246, 1,114, 87, 22, 0, 64, 5, 71,127, 79, -189,205,194, 99,101, 87,116,160,161, 84,131,185,234, 21,123, 71,119,221,135,155,186, 85,253, 14,178,120,244,128,229,240,189,196, - 80,186, 67, 8, 76,245, 65, 46, 85, 71, 61,195, 27, 81, 95,223,205,247,229,116,239,162,184, 56,200,238, 84, 77,253,171, 61, 19, -210, 84,118,129,176, 29, 8, 25,137,145, 90,180,119, 58,235,101, 57,180,119, 27,183,179, 22, 80,162, 93, 97, 11, 2,132,239,122, -193,232,223, 84,240, 46,116,246,143, 0,164, 93, 61,143,211, 64, 16,221, 93,175,147, 56,137, 34, 43,225,164, 35, 28, 18,232,160, - 57,157,160, 65,162,228,127,208, 82,241,127,248, 11,212,208, 81,210, 82, 81, 1,210, 73, 64,115, 10, 81,114,119,185, 64,176,207, -246,122,119,241,204,236, 58,107,233, 58,154, 52,150,236,141, 63,102,103,222,188,121, 79, 6,232,189,123,233,133, 91, 52, 98, 83, - 70,160, 58,130,155,137, 14, 34,187, 65, 36,139, 38,128,232,163,138, 64, 19,195,130,153, 82, 12,224, 17,152,221, 26, 44, 67, 92, -197,100,140,244, 47,108,237, 71,111,177,245, 90, 99,139, 47,130, 70,129,129,214, 93,179,254,230, 51,214, 90, 11,116, 54,238,113, -148,152,176, 38,175, 84,243,106, 54, 85,124, 81,171, 36, 2,199,190,178,174, 47,202, 53,228, 91,218,201, 57,180, 35,238,109, 56, - 23, 84,137, 7,162,179,220,209, 28, 24,120,176, 55,103,171,110,240, 99,185, 37,184,139,125, 78, 22,234,134,219,253,147,160, 91, - 88,239, 69,227,133,144, 73,146,206,163,149, 84,245,143, 92, 93, 32,192, 66,153,251,144,197,105, 36,167,177, 28,245,123,163, 88, -222, 25,247,134, 61, 57, 25, 66,105,210,108,125, 63, 87,219, 15,139,229,159, 46, 6, 68,105,123,236,151,173,125,150, 29,226, 57, - 54,232,163,178,255, 72,225, 67,187, 87,229, 65,121,186, 74,133,151, 24, 80,121, 81,179, 27,180,162, 3, 76,183, 41,177,141,200, -149,109,182,168,126,143,165,125,160, 65, 38,131, 88,128, 5, 51,155,142, 64, 21,224,104,194,183,153,217, 21,230, 94, 26,189,120, -194, 63,157,169,171,157, 68,206, 55, 38,199,202,140, 7,163,205, 14,179, 57,164,147, 90,186,173, 40,134, 14, 72, 84,145,113, 24, - 64,195, 98,143,145,127,238, 62,184, 11, 31,220,169,159,121,122,116,114,190, 89,208,240, 97,216, 16, 3,126,173,174, 34,100,194, - 90,118,155, 37,101,183,152, 49,172,213, 56, 10, 36,165, 44, 82,123,144,243,206,253, 26, 72, 66,149,100,165, 52, 78, 56, 69, 52, - 93,234,100,114, 90, 90, 27,250, 29,192,175,254,186,248,198,189,247, 51,168, 53,151,153,116, 12, 25, 39,240,231, 5,196,189, 98, -143, 15, 79,130, 88,149,180,189,128, 82,166,104,179,209,227,131,135,191,174,151,212,131, 44,170, 34, 47,115,106, 52, 55,231,159, - 79,239, 42,163,179, 34,223,230,187,154,163,176,133,176,135,233,172,200, 84, 44,212,239,106,253,126,253,241, 93,121, 54,152, 60, -234,157, 60,126,250,154,189,100,236, 85,243, 32, 22,172, 56,103,213,134,205, 31,224, 0,107,243,244,223,176,241,138, 21, 75, 86, - 22, 44, 83,176, 55, 39,208,226,144,135, 9, 43,185,152,142,198,243,209,193,241,240,254,243,217, 51, 33,213,151,236,237,247,235, -207, 53,128,239, 77, 88, 87, 26,247, 89, 0, 37,106,147,142,103, 23,127, 47,105,102,152, 72,235,198, 77,162, 82, 6, 73, 7,184, -155,212, 4, 60,143, 34,120,139,210, 80,223,142, 52,127,129, 58, 67,182,177,156,196, 73,187,246,199,182, 51,226,233,109,249, 88, - 71, 9,210, 4,161,175, 11,187, 59, 3, 13,189,247,245,176, 57, 50,103, 24, 42, 68,242,253,148, 65, 43,145,193,174,118,151,227, -126,154,240,120,167, 47, 65,136, 11, 73, 50,218, 49,247, 91, 66,178, 13, 29,160,130, 77, 5,196,218, 36,194,146,222,119,213,134, -255,134,116,180, 72,183,194, 6,213,123, 87,187,184,227, 25,248, 79, 0,214,206,101,183,105, 32, 10,195,115,177, 61,142,157,196, - 45, 20, 74, 17, 66,125, 6, 22, 93,240, 50,188, 22, 75,222,136, 69,145, 64, 72, 84,130,148, 5,174,162,144,230,210,196,246,216, -156,219, 56, 9, 41, 59,162, 74,105,147, 72, 81,237,196,243,159,115,254,249,126,212,239, 29,111,234, 17,185, 74, 92, 34,105,190, - 27,167, 7, 45, 81,170, 61,245, 16,120, 94, 74,107,145,233, 13,242,248, 50, 21,167,212,121,199,220, 62,144,222,157,174, 65, 68, -227,196,149, 4,132,226,147, 65, 60, 33,141,251, 51, 13,243, 88,100,191, 30, 45, 53, 90,240, 89, 17,246, 86,109,106,156,197,221, -155, 14,132,188, 53,160, 53,242,177,203, 65, 42, 92,228,197,200,101, 85, 75,166,208, 78,207,170,249,245,244, 26,254, 90, 55,171, - 13,242, 35, 97, 5,128,199, 41,217, 21, 15,187,103,194,217, 81, 56,161, 22, 79, 29,214, 16,166,237,187,240,127, 93,220, 3,230, - 73,237, 22,234,174,151,119, 59,100,115,168, 29,185,112,171,125,247, 60,173, 95, 71,254,227,239,122, 66, 79,231, 74,157, 96,230, -101, 52, 84,118,152, 36,167, 14, 33,226,163, 52,126,146,185, 19,103,179, 20,170,158, 40,113,113,238,220,167, 31,229,251,207,223, -110, 67, 67,188,217,113, 69, 15,144,161,126,239,247, 86,253,231,155, 9,133, 66, 31, 79,232,195,199, 37, 15, 19,221, 51,234, 44, -192, 97, 34,222, 27,122, 87,243,196, 22,169, 69,192,127, 26,189, 56,141,135,121,146,103, 80,109,233,186,229,121,151,191,157, 99, - 5,253,108,100, 19,211,125,191,219,126,153,168,135, 10, 59, 10,240,221, 77,162,124,185, 89,192,217,244,173,196,110,117, 34, 87, -131, 19, 36,180, 13, 13,211,184, 12,239,188, 35, 90,164,214,193, 13,105,104, 75, 84,220, 96, 82,118, 48,132, 83,196, 76,248,105, - 24,180, 77,236, 81, 29, 74, 46,243,216, 52, 66, 54,223,237,139, 34,120,121, 54,192,188, 55,138,170,165,222, 16, 35, 2, 57, 84, -196, 4,211, 53,172, 0,158, 6, 64, 82, 64,244,228, 99,246,197, 19,130, 12,133, 60, 39, 71,241, 58,193,174,105,102,149, 40,254, -191, 12, 67,133, 4,131, 76,221, 28, 33,134, 51,138, 3, 43,102,220, 12,163,237,121,113, 62, 93,148, 49, 5,170,199,216,167,137, - 4, 23, 69,227, 10,208, 69, 24,160, 16,197,171,237,186,242, 76, 45,194,160, 27, 88, 29,178,120,100,211, 66, 15,198, 23,103,151, -211, 65, 97,135,151,203,119,111,186, 43, 60,251, 25,249,101,249,208,240, 64,249, 45, 45,249, 47,149,186,167,116,191,113, 40,236, -182, 55, 74,151,234,235,135,153, 93,252, 44, 23,147,233,114,178, 90,253, 42,151, 55,213,102,254, 80,223,107,116, 70, 98,183,173, - 65,110, 30,190, 63,136, 57,107,109, 5, 18, 94,156,140, 7,178,189, 13, 56,127,145,224,173,160, 36, 2,243,145,243,112, 25, 19, -194,119,221,254, 20,148, 39, 96,199,159,231, 3,141, 44, 74, 94,155,127,238, 74,237,250,226,139, 47,238,143,226, 34,123,207,180, -230, 16, 83, 60, 41, 72, 35,128,235,248, 83,247, 42, 82,110,182,190,171,208,118,208,144,147, 94,224,181,210, 10, 57,176,123, 8, - 81,210, 8,190,130,107,116,234,189, 97,150,134,228,255, 29,155, 35, 61, 95, 84,247, 40,199,199, 41,172,112,251, 35, 0,105,231, -179, 27, 69, 12,131,241,216,153, 63, 45,173,160, 42, 72, 8, 36,184,112, 65,130,247,224, 69,121, 31, 84,245,136, 56, 0, 7, 68, - 69,183, 18, 67,119,102,118,146,152,216,142,179,179, 98,225, 66,143, 43,117,119,181, 73, 60, 95,236,207, 63, 55,107,184, 37, 88, - 61,185, 36, 13,217,171,222,141, 46, 36,251,127, 42,106,221, 27,217,201,201, 56,175,124,174,187,190,201,146,186,109,152,118,229, -151,124,174,101, 54,252,162,105,131, 2,180,151, 67,150,196,193, 93,190,166,118,168,129, 57, 92,100,125,153,178,227, 98,150,240, - 9, 34, 70,228,217, 65, 69,179,156,179,237,146,134,101,110,145, 95,235, 61, 12,236,111, 99,143,141,148,103, 8, 86,207,174,114, - 71,150,134, 48,114, 5,154,140,251,222, 45, 58,245,125,116,236,203,245, 88, 11,170,102,180,208,105, 20,222,213, 70, 68,176,170, - 3, 88,147, 22,172, 17,110,160,179,121, 57, 43,116,222,210,171, 19,186,186, 93,190, 28,102,183, 83,193, 74,129, 26, 45,117,133, -162,248,100,167,196,232,203,252, 43,191,126,254,228,221,102,120,255,253,102,249,251, 60,129,248,239, 57, 3,255,253,167, 5, 0, - 52, 21, 79,182,231,180,145, 74, 90, 48,184,251, 98,148,102,172,224, 21,127, 70,119, 51, 27,205, 47, 31,240, 46, 26,126,186, 97, - 8, 9, 71, 94,110,112,125,231,159, 62,244,103,190,219, 57,156, 2,116, 29, 62,123,220,131,159,191,110,166,124, 21,152,230,184, - 44, 83,219, 49, 27,112, 12, 89,101,179,253, 49,173, 64, 73, 88,129, 25, 98,249, 83,243, 52, 15, 98, 99,206, 15,152, 74, 21, 97, -194, 45, 81, 60,130, 55, 7,129, 55, 47,222, 94,127,190, 62,114,210,181,197,161,128,232,143, 6,119,161,159, 56, 87,159, 50, 26, -108, 16, 20, 85,227, 53,178,139,127,198,148,180, 0, 54, 34,131, 29, 60, 40,192,204,215,114,107,117, 85, 41, 12,137,155,129, 30, -157, 92,108,203, 13, 3, 43, 60, 68,119,144, 52,229,138, 4,179, 73,158, 8,229,233, 1,234, 4,149,186,145,186,119,116,222,206, - 52,223,171, 26,107, 80,177, 39, 82,190, 69,175,214,223, 4, 56,135, 37,236,238,149, 51, 74,114,201, 72, 44,201,220, 64,219, 54, - 97,147,154, 31,241,110,199,233,208,109,190,160,181, 18,220, 47,100,149,131,101, 8,243, 78,248, 32, 53,161, 58,174, 53, 89,157, -102,126,233,126,221,184,203,240,177,161, 79,113,249, 70,211,109,154, 55,103,158,207, 63, 67,242,185,154, 50, 50,183, 34, 50,168, - 39,241,237, 33, 71,250, 32,180, 71, 41,171,238, 71, 43, 69, 49,248,168, 44, 47,244, 24,170,225,207, 2,110, 82, 3, 37,152,224, - 55, 58,250, 58,204,253,185,159,221, 62,255, 94,220,162, 98, 48, 63,242,108,167,125,204, 37, 99,240,214, 55, 77,100,238,231,202, -124, 33, 51,218, 41,172, 95,110, 23, 57, 54,157, 78, 60,218, 59, 74,246, 34,153,244,166,106,128, 89, 37, 7,177,182, 71,162,193, - 39, 68,242, 22,255,187, 73,126, 52, 31,127, 25,233,103,244,236, 67, 20,240,225,128,104,253,224,223, 2,176,118, 53, 61, 78,196, - 48, 52, 31,211,204,116, 74,187,156, 22, 46,192, 34, 14,252, 6,126, 58,191, 3, 33,237,101, 57,176,172, 16, 5,164, 45,171,118, - 62, 18,219, 36,118, 50, 51,101,185, 32,113,232,181,157,180,169,253,108,191,247, 92, 61,202,108, 18,110,141,168,122, 35, 32, 26, -209, 98,218, 12,139, 50, 69, 20,146, 38,227,149,100,180, 91,169,120, 51,234,218, 56, 89,186,205,116,120,144,228, 28, 18,129, 32, -161, 38,118, 95, 74,137, 87,151, 5, 61, 17,221,115, 47, 21,179, 57, 50, 80,134,199, 90, 75,141, 22,195,195, 42, 13,226, 76, 4, -133,235,170,113,220,210,119, 54, 62, 9, 30,124,215, 84,110,235, 86, 29,132,175,167, 61,167,142,212,225,225,219, 67,103, 20, 6, - 33,189,243,210, 12,171,244, 12,215,120, 48, 53,178, 76, 81,130,187,154, 73,238,204,101,152, 24, 79,243,164,235,108,173,118,153, -171, 64,193, 6,140,248, 72, 59, 11,111, 91,186,187,247,159,104,110,103, 51,251, 69,167,209, 40,210,137,130,245, 28, 96,226,113, -124, 72,230, 74,171, 85,235,210,180,198,115,147,233,221,203,103,239,191,237,239,202,207, 67,255,142,190,241, 63, 69,121, 95,212, -231,211,117,116,124,215,186,242, 63,143,231,170, 97, 6,168, 15,125,170,235,234, 1,186,228,112, 0, 3, 51,225, 70,165,159, 88, -115, 3,120, 4,186,216,185,171, 23,187,234,114,227,146, 91, 0,253,234,225,199,125, 15,105,239,122,207, 40, 31,217,215,188, 25, -135, 45, 46,132,132,114, 43,145, 85,205, 98,171,251,234,242,234,246,251,103, 45, 78, 21,182, 10,224,207,157,228,211,235,195,237, - 71,154, 22,220,211, 92,126, 75,129, 78,150,227, 7,106,165,254,148,142, 48, 27,153,118,155,167,167,177,243, 97, 88, 22,248,201, -243,196,136, 38,137, 87,207,242,124, 87,232,251, 17,212,167, 30, 35, 79,246, 89,217,158, 63, 39,171,114, 64,154,233, 25,101, 34, - 77, 82,148,105,146,173,120,209,149,128, 71,195,130, 64, 18,143, 73, 18,228, 30, 63,145,138, 89,181,212, 48, 42,115,226,215, 77, -219,135,158, 13,141,149, 76,152,211, 3,138,237,108,238,103,224,118,125, 17, 47,250,254,240, 51, 94,176,166,110, 31,250, 94,242, -144, 15, 71, 3,214,251,181,209,155,214,134,174,201,222, 3, 83, 4,167, 66,220,114, 37,223,135, 34,147,150, 51, 28, 42,229, 35, -190, 83, 61, 37,129,249, 0,116,140,239, 25,171, 28, 15,199, 1, 7,196,152,193,253,155,231,175,175,191, 92, 75,116, 70, 81,242, -112, 47, 29, 10,164,227,249,170,200,182,164,203, 42,130, 29,157,213,168,106, 17,220, 5, 38,194, 76,170,153,128, 54,254, 61,153, -207,177,175, 72,158, 38, 93,146, 94,134,248, 50,177,164,105,181, 41, 46,172, 8,104,177, 75,153,178,134,209,100, 23,225,162,120, - 40,117, 70, 60, 26,240,126,185,164, 19,146,157, 91,158,123,212,144, 27, 30,106,225, 71,143,165,223,162,202, 16,143, 10,141, 28, - 75, 84, 54, 69,210,203, 14, 28,179,114,126,225,125,254, 40, 75, 77,223,198,111, 1,120,187,178, 21, 39,162, 32,218,251,205,196, -238,100, 70,153,121, 19,212, 39,241, 93,152,255,255, 5, 17, 70, 65, 68, 4,133,152,201,144,142,189,222,165,188, 85,117,171, 23, -193, 87,243, 20,210,157,164, 55,234,158, 58, 85,231,148,204,215,158,155,177,196, 5,141, 0,172,255,164,202,158, 53,186,165, 41, -145, 76,250,112, 6,129,113, 80, 77,193, 61,219,228,168, 71, 3, 28,150,229,159, 29,141,204, 59,171,137, 45, 71,120, 54, 69, 35, - 31,109, 28, 57, 36,240,218,138,207, 35,175,136, 25,254,127, 78,174, 11,232, 25,162,144, 31,247,201, 65,238, 35, 66, 66, 60,146, -255,181, 34, 65,213,147,255,206,161,125, 28, 81, 31,107,200, 85, 51, 56,131, 46,132,168,100,234, 24,217,137,119,115,233, 60, 70, -124,209, 2,196, 61, 73, 2, 18,169,119, 53,148,208, 22,193,125,182, 46,140, 22,134,116,139,203, 11, 40, 55,133,183,149,133, 1, - 62, 24, 55,113, 26,185, 92,115, 29,145, 81, 3,113, 46, 62,227,232,208, 58,217, 52,163,118,160,246, 70, 93,169, 66,229, 73,159, - 66,181,219,190,201,175,142,186,211,235,251,244,223, 94,201, 44,134,153, 15, 0,132, 23, 98, 46,126,148,247,220,216,163,104,235, -147,137, 60, 74,220,246,232,106,213,113,109, 39,137,238, 95, 85,175,171,221,151,239,245,195,169,249,124, 28, 62, 30,127,189,127, -217,221,191,123,161,114,117, 91, 58,221,155,199,139, 25, 70,232,125, 26,143,218,137,168, 84,205,245,198,135,133,189,157, 33, 9, -222,166,187,234,174,110,209,202,209, 67,220,111,135,175,164, 15,196,134,150,178, 40,159,186,147,244, 6, 67,165,202, 86,119, 84, -227, 68,144,111,157,147, 18, 39, 4, 91,246,128,186, 82,172,219,101,244,144, 58,145,192, 83,192,197, 14,156,237,243,223,221,121, -208,122,210, 89,197,161, 28,207, 18,170,152, 53,167, 41, 70,247,148,114,233,148, 1, 22, 13, 13, 66, 75, 94,220,213,227,146,188, -168,187,115, 44, 43, 76,236,130,178,249,210, 93, 82,170,247, 56, 38,200, 19,153,239,192,154, 88, 30, 30, 68,236,127,200, 18,169, -103, 4, 9,247, 52,140, 1,161,177, 17, 89,208,167,160, 85, 66, 32,121, 84, 86,248,195,210,214,176, 49,203, 77,121,125, 56,163, -209,241,185,189,120, 16,141, 3, 73,204,224,195,199,237,238,230,103,125, 66, 23, 40,212,217,250,221,235,184, 47,204,102, 15,251, -112,151,157,148,235,167,210, 61,200,162,238,100,171,147, 58, 16,106,217,243,198,233, 97, 72,252, 58,221,235,184, 55,208,140, 88, - 83, 29, 81,135,111,221,195,143, 79,150,202,213,228, 2,230,129, 41,202, 77,173,180,198, 64,152, 91, 40, 45,142, 17,231,111, 49, -172,195, 43,129,116, 39,200,125, 21,220,225,111,129,105, 12,139,134, 72, 88,184,144,174, 9,249,176,220,139, 59, 21, 76,220, 53, - 91, 9,185,127, 76,119,136,201,206,136, 44,209, 66,181, 55, 88, 22,115,110,129,231,131,131,147, 77, 8,196,116,114,228, 10,153, - 82,136,135, 85,177, 52, 73, 22,245, 0, 81, 29, 49,120,143, 23,158, 49, 65, 89, 73,169, 92,194, 12,249, 84, 81,148,181, 7, 4, -119,174,130,198, 31, 1, 72,187,150, 93, 39, 98, 24,154,215, 60,218, 10,170,123, 97,129,196,243, 19, 16, 44, 88,242,227,252, 4, -232,238, 17, 98, 9,151,150, 62,102,154, 38, 25, 19,219, 73, 38, 3, 98,129,216,116,211, 86,154,167,125,108, 31,159, 99,106,212, - 35, 19,126, 79,180, 66, 69,251, 5,141, 94,109,219, 7, 3, 70, 28, 15, 89,215, 20, 89, 46,218,180, 42, 86,219,125,139, 90, 99, -138, 30, 77, 36,204, 0, 37,103,143,245, 23,222, 97, 15, 92, 74,132, 36,164,202, 81,191, 26,104,192,108,150,140,101, 37, 2,110, - 84, 41,107,123,179,106,117,103,116, 12,124, 45, 90,214,144,154, 88,188,195, 78, 56,239,166, 78,244,187,203,142,183,224, 98, 82, -193, 55, 89,134, 37,223, 31,235,131, 32,231,105,134,170,231,212, 76,132,200, 93,169,156,210, 48, 49,235, 34,121,146,124, 88,150, -190, 77, 66,214,195,106,186, 98, 19, 41, 80, 78, 47, 55,174, 7,121,119,188,158,150,137,148, 25,238, 29,109, 33,155, 88, 80, 35, -147, 32,214, 34, 38,158,198,217,234,221,217,118,141, 89,119,230,166,239,111, 55,246,249,118,253,244,225, 90,220,143,101,200,249, -175,184,251,255,145,251,159, 15, 53,135,251, 43,125,118, 4,234,141,152, 21, 33, 44, 29, 42,211,231, 15,180, 81, 52, 82, 98,123, - 52,137,119, 47, 30, 15,123,169, 39,221, 75,109, 32,124, 19,226,195,215,147, 10,254,253,155,103, 79,182,189, 14,206, 89,255,249, - 30,187,179,158, 96,207,136,139,145, 99,211,160,181, 20, 84, 52,220,239, 71,156,200, 17,106, 38,148,138, 24,121,186,216,193, 94, - 25, 83,211, 78, 98, 8,146, 36, 33, 65, 38, 54, 47,224, 96, 96, 67,187,163, 39, 72, 20,150,244, 98, 18, 58,214,248, 71, 67, 70, -246,180,146, 52, 17, 97,252, 56, 28,251,110,229,124,152,210,146, 54, 80, 91,156, 89,139,188,110,165, 76,131,142, 55,220,254,111, -176,109, 24, 98,172, 31, 47, 35,131,251, 64,190,160,167,209, 18,173, 0, 50,245, 93, 38, 19,112,194, 56,164,112, 19,144, 63,144, -215, 84,216, 79, 18,213,242, 89, 18,152, 13, 35, 41,253,188,125,245,250,227,151, 79,140, 51, 88,210,140,221,193,226,133,216, 15, -123,106, 87, 98,187,134,108,203,240,152,136, 10, 34,209,241,131, 25, 64,164,234, 71,159,176, 59,255, 8,131,194, 29, 97,204, 70, - 78, 1,249,175, 41,112,210,202,110,110,188,248, 42,187,135,106,212, 95,190, 10, 69, 78,210,136, 65, 28,226,101,187,186,159,222, - 31,192, 71, 8,127, 65, 54,228,132,211, 69,122, 43,233,132,242, 40, 53,153,161,254, 22,220, 37,164,190,204,108,161,151,240, 41, -112,235, 83,134,188,143,154, 88,215,117, 23, 69, 46,122, 51,201,150,186,200,198,150,106,169,130,240,149,131, 93,233,201,228, 72, -176, 4,239, 51,197,165, 18, 98, 15, 69, 38, 39, 31, 6,143,224,240,151, 99, 56,172,213,141,102, 83, 40,194, 75,172,196, 1,243, - 52, 11,202, 42, 92,217,125,103,235, 33,138, 72, 97,233,139,192,199,138,150,168, 52,149,193, 32,172, 18,107, 83,102,233,202,191, -170, 72,254, 18,128,182,107,217,109, 27, 6,130, 92, 74, 10, 77, 59, 78, 91, 24,237,161, 64, 62,160,151,254, 63,208,143, 40,252, - 5, 65, 2, 36, 65,147,131, 83, 36,122,152,226,163,220, 7,101, 41, 70,209, 83,125,178, 13,195,150, 96,114, 57,187, 59, 59, 51, -213,103,116, 58, 13,255,208,242, 66, 22,191,204,136, 52,250, 98,107,234,188,127, 8,197, 71,154,158,192,100, 26,144,205, 82,123, -108, 93,249,134, 38, 3,105, 16, 17, 23,174,135,192, 7, 88,145, 67,129,197,152,176,152, 13,198,169, 97, 72, 91, 5,117, 0, 27, -149, 97,187,185,172,236,166, 54,182, 89,229,159,174, 1,149,203,134,228,107,224, 40, 30,243,109,134,209,117,161, 39,193,231, 64, -248,166, 16,244,229,216,208,172,201, 78,126,245, 90,205, 20, 77, 64,168,239,124,234, 44,229, 7, 64,195, 52,177, 48,169, 73, 72, -207, 93,195,137,177, 2, 37, 79,146,244,241, 2,210,215,205,104, 80,152, 34,222,156,157,246, 90,136, 74,168,226,210,163,122, 37, -166,168, 70,141,237,168,200, 43, 84, 91,164,123, 86, 79,117,123,213, 84,207,135, 28, 89,188,249,151,119,217,255,126,132,153,130, - 77,152,225,181,170, 68,121, 40,251, 92,151, 75,237,104, 59,241,253, 14,244, 50, 63,191,127,232,238, 30,221,205,107,247, 75,141, -109,129,252, 63, 30,134,205,250,249,251,183,207,198,152, 47, 91,119,123,112, 43, 64,187, 87, 71,107,162,243,234, 42,189,110,109, -142,203,198,249,161,162,177, 64, 36,114,165, 50, 15, 10,172,235,144,225,108,149,115, 32,154, 69,103,130,141,186,222, 93,239,239, -246, 84, 58, 99,212, 30,223,250, 28,217, 99,142,116, 94,192, 97,250,184,254,116,232, 95,242, 2,198,230,187,112,226, 2,185,176, - 72, 49,103, 12,206,245, 71,170,208, 11, 21,146, 85,227,200, 66,171, 70, 59,120,148,245,133,181, 93, 71, 42, 69, 90,107,243, 23, -229,224,142,176, 78, 76,239,229,211, 49,166, 9, 80,241,200, 59,123,112,106,214, 83, 97, 25, 61,153,165, 79, 90, 38,245, 57,132, -177,156,130,172,231,159,183,123, 93,122,237,197, 2,142,252,179,148,150,117, 43, 89,125,204,120,136,106,223,249, 34,194,227,239, - 39, 34, 26,224,125,230, 32,222, 30,251,196, 14,143,192,131,138,129,120,103, 36, 24, 17,199,252, 95,132, 25, 54, 79, 51,228, 59, -241,172,195,242,205, 48, 5,125,141,226, 37, 62, 30,131,114, 21, 50, 12, 48,171, 38,176, 23, 56,175,150,218, 12,117,224,130,112, - 73, 99,137,232, 73,148, 73,168, 27,119,134,220, 9, 74, 67,148,150,249,201,159, 67,130, 90,124, 31,220, 23,116,153,185,114,250, - 28,194, 47, 66,124, 90, 52, 96,207, 58,180,239,230, 69,185, 68,163,138, 9,182, 46,133,121, 62,177, 50,158,132,214,183, 31, 86, -187,202,153, 17, 37, 72, 88, 93,135,157, 38,167,163, 28, 10,139, 47,138, 39, 27, 69,152,138,232, 99,203, 36, 67, 82,200,203,102, -103, 97, 75,171, 11,173,137,222,194,203, 64, 6, 16, 48,141, 31,253,229,241, 71, 0,214,206,101,183,109, 24,136,162,164, 30,180, - 37, 71,129,209, 6,249,134,108,251,255,251,162,203,246, 3,218, 77,186, 73, 22,173,109,200,122, 81, 36,203, 59, 67, 74,148,211, - 2, 5,218,172,156, 69, 0,191, 66,206,220,185,115,110,145,108, 4, 72,185,136, 16, 33,195, 82,206,114, 62,136,189,118, 70,201, - 98, 87,150, 54, 74, 68,124,221,149, 20, 73,209, 67,130, 67,206, 0, 66,231,121, 77,144, 32, 12, 70,204, 40,173, 76, 78,154,251, -170, 86, 27, 42,120,151,131, 56,227, 21, 70,178,185,230, 88,195, 83,224,176,150, 59,127,212, 35,146, 58,167,164, 52,103,125, 71, - 61,103, 54,102,222,226, 25,118,186,133,200, 5,179, 2, 52, 47,222,108,222,138,110,146,171,153, 13,122, 45,122, 52,221,154,154, -205,254,247, 0,142,143,156,250, 69,199,161,166,130, 75,120,231, 54, 18, 55, 13,197,234,114, 84, 86,251, 70,215,223, 67,223,199, -121,250, 3,172, 83,135,178,215,209, 80,218, 92, 45,167, 10,101, 59, 49, 95,140,172,197, 12, 2,129,144,223, 46,125, 1,121,247, -255,152,217,255,253,148, 55, 91,194,129, 76, 60, 60,115,114,129,185,132,151,176, 72,159, 39, 33, 62, 62,255,108,123,247, 34,208, -211,244,188,218, 79, 15, 62,125,189,124,120,122,120,215,168,174, 83,119, 10,153,133,221,132,191,186, 82, 31,112, 30,196,251,195, - 84,169,199,215,235, 24,129,251, 81,178, 4, 63, 11, 39,226,190,170,253,215,239,236, 11, 70, 23,208,152,254, 27,249,249,249, 11, - 1, 6,150,222, 25,142, 70, 80, 45, 11,165, 39, 22, 24,229,160, 59,127,172, 53,213,177,215,253, 96,135,186,172, 15,251,230,220, -157,136,144, 30,208,178,113,148, 38, 57,135, 27,197, 54,138,253,224, 42,160, 13,211, 92, 27,125,223, 28, 47,167, 31,213,225,174, -239, 7,231,174,228,114, 9, 99,158, 0, 54,164,209,129, 11, 26, 13,211, 60, 88,227, 35,133,157,137,183, 72,253,201,248, 87,127, - 34,150, 89, 30,165,138,240,146,201, 4,202,105,134,246, 22,255,154,108,188, 24, 74,251, 43,242,157, 54,173,163,244, 21,186,188, - 28,229,146,132,173,127, 34, 1, 24,194, 21,102, 14,214,103, 36, 31,161,111, 18, 19,222,181, 78,100, 71, 52, 94,118, 3,164, 74, - 76,199,111,142,126, 60,246, 45, 23, 6,231, 8,242,242, 53,251, 8,112, 44, 22, 25,225, 8,148, 4, 18,112,108,186, 35,166,242, -178,145,186,106,214, 33,196,137, 53,119,123, 51, 50, 36, 61, 27,209,159,113,156,104,227,220,194, 46,136,129,191, 30, 82,201,180, - 24,119,191,249, 63,181,183, 27,161,226, 13,117, 50,204,102,243,181,102,181,209, 48, 17, 62, 53,127, 89,190, 78, 47,181,186,183, -211,168, 93, 8, 58, 94,173,150,193,171,194, 71, 80,190,104,238,164, 63,251,151,169, 69,130,161, 96, 7,109,153, 87, 77,241,216, -250, 27, 20,236, 10,168,127,165, 47, 8,133,106,177, 45, 99,156, 72,199,189,183, 63,191, 4, 32,238,106, 86,219, 6,130,240,174, - 37,217, 22,177,155, 6, 66, 66, 79,125,129,210,119,104, 79,125,140, 92,250,186,121,134, 64, 33, 52,144, 56,137,229, 88,218,255, -238,124,179, 90,109,144, 33,199, 10, 29,180,146, 48, 88,178,103,103,103,190,159,197,124,166,202,214, 97, 21,245, 57, 53,234, 93, -210, 8,107,104,118, 34, 39,188,248, 29, 52,189, 72,115,176,186,247,166, 33, 45,245, 5,152, 58,210,251, 4, 70,101,236, 26,145, - 41,168,145,146,138,158, 48,255,134,113,122, 66,182,161,121, 36,128,200,149,146,100, 90,235,117,187,104,183,171,179, 77, 67,150, - 52,168, 55,145,221,235,146,204,132, 5, 99,104, 3, 57,141,213,189,125,213, 88, 3, 66,244,198,242,172,226,115, 41, 77,134, 28, -159,229,164,163,192, 41,121,200, 26,238,156,197, 51, 76,141,194,110,146,130,202, 76, 68,230,124, 5,212, 92, 1,151,168, 70,124, - 17,187,112,145,185,239,206, 13,199, 64, 11, 99,169,156,188,183,238,100,163, 82,143,109, 73,133,196,182,195,219, 37, 89, 96,244, -243,148,112,123, 65, 82,123,127,131,185,179,131,243,102, 93,168,131,253,247,173, 76,220,108,177,151, 87,253,251, 97,222,110, 7, -245, 38,205, 61,140,129, 44,126,175, 45,118, 82,199,180,102,219,214, 95, 62,175, 63,173, 23,175,154, 84,125, 24,151,169, 64,242, -250,243,188,123,238, 30,170, 66, 86,122,194,135,225,255, 29, 35,242,211, 97,199, 46,234,105, 1, 39,211, 53,100,141,153, 41, 67, -169,211, 96,226,227, 15,117, 67, 6, 82,189, 81,223,190,126,239,205, 49, 30,144,150,122,112,187,238, 49,198,250,196,163,134, 41, -150, 44,168, 46, 19, 50,181,170, 47,183, 87,172,186,206, 88, 21,109,245,143,159,191,110,110,126,147, 60, 55,180,206, 70,241,122, -207,206,111, 20, 94,169, 30,159,124, 65, 49, 28, 61,229,200,171, 0, 83, 14, 69, 61, 11,111,175, 11,238, 36,143,113, 57,184,162, -244, 12,184,131,204,220,142,192,106, 97, 35, 75, 51, 13,131,223, 15,157,113,126, 89, 45,235,166,137, 31,109, 81,238, 70,205,212, -115, 46, 31,111,189,222, 94,129, 25, 78,231,207, 36,117,133,145, 38, 13,254, 33, 45,188,202, 38,170,127, 31,223, 67,113, 62, 37, -251, 7, 1, 5, 49,237, 98,132,136,207,129,192,108, 4,141, 6,103, 69,128, 97,232,144,208,161, 55, 49, 73, 64,240,242, 62, 39, -239,101,117, 60,132, 73,198,177, 40, 68,251, 19,181, 68,249, 81, 51,105,118,191,156,171,164,203,145,167, 90, 4,247, 48,231,191, -225,249, 87, 51,186, 68, 82, 42, 29, 81,210,116,168,204, 65,217,110, 83,157, 55, 98,213, 0,135, 82,161,165, 8,223, 21,214, 82, -100, 46, 7,226, 27,209,200, 26,184, 89,154,162,206,145, 93, 43, 40, 53,222,196,220,218, 41, 21,142,131,232,223,194,113, 31, 94, -180, 80, 43,209, 74,145,197,106, 79,219,145,252, 19,128,186, 43,107,113, 34, 8,194,213,221,115,244,132,136, 32, 46, 44,174,136, - 15,174,178,255,255,111,232,155,248, 38, 98, 64,214, 69, 86,204, 53, 87,166,187,237,170,234,154,195, 77,126,128, 97, 30, 2,147, -132, 48, 83,211, 85, 93,245, 29,179,254,140, 18,142,108, 82,211,197, 35, 22,212, 45,116,207,245, 58, 73, 54,227,234,150,199,120, - 42,113,188, 51, 37, 78,190, 19, 93, 64,209,221,194,152, 12,167,233, 96, 85,142,145, 77,223,113, 28,175, 62,149,195, 84,179,103, - 34, 3, 68,122, 26, 70, 87,198,218, 44, 30,149, 53, 69,188, 72,241, 9, 90, 23,101,102, 84,139, 52, 1, 53,102,252,248, 97,155, -233,111,191, 55,168,163, 60, 36, 82,155, 99, 77, 0,234,244, 41,207,219,223,160, 22, 67,151, 5, 73,113,164,141,176,203, 2, 83, -140,101,176,174,103, 92,161, 52,112,101,243, 68, 80,178, 25,162, 30, 79,221,238, 27, 7, 57,106,166,168, 19, 1,104, 30,207, 1, -201,221,140, 43,148,205, 60,189,134,244,132, 4, 22,109, 23,239, 61,108,145,185,153, 36,228,127,253,218, 5,120, 6,225, 53,192, -131,200,218,172, 41,225,197,235,112,168,221,203, 43, 19,171,240,187,235,106,127, 28,154,254, 84,251, 52,185, 69,255, 32, 15, 47, -194, 73,163,243, 32,140, 93,141, 17,168, 70, 96, 20, 20,241, 23, 7,122,218,240, 10,164, 77,141, 90,208,169, 85,135,111,170,194, -190,191,185,251,244,245, 99,124,255,101,243,217, 75,226,119, 88,182, 19,159,138,135,177, 19, 70, 98,233, 34, 0, 84,247,146,120, - 48, 67,179,200,156, 82,221,190,187,125,251,230, 38,102, 14,213,182,140,193,247, 41,169, 16, 6, 48, 41, 33, 38, 50, 33,181,221, -185,227, 16,202,220,174,202, 88,196,148,219,250, 17, 51,129, 27, 30,182,191,140, 73, 14,131,169, 83, 33,136, 17,226,111, 42,152, -118, 49, 76,221,196,176,229,113, 99, 22, 82,181,206, 85,250,182,219, 35,241, 4, 60, 18,140, 52,244,200, 96,213,228,179,128,245, -240,253,246, 62,137,238, 57,183, 27, 26, 29, 44,158,113,157,255,225,224,131,113, 43, 18,206,148, 5,113, 28,177,122,201,220, 66, - 98,167, 83,127, 32,252,140,245, 77,237, 93, 31,152,199,132, 24, 34, 36,191,197, 69,157,188, 34,240,129,178,121,222,244,199,144, -110,141,228,206, 52,206,188, 20,227,106,137,230, 62, 67,193,215,151,182,185, 10, 46,149,245,158,132, 0, 1,254,213, 19,159,180, -129,101, 12, 32,224,197, 73,105,221,204, 23,221, 39,168,121, 53,234, 34,144, 89,233,193,237,122,221, 85,102,237,124,222,162,131, - 71, 71,191,134, 75,188,230, 14, 8,205,246, 8, 87, 19,151,205, 78,193, 34,199, 5,193,142,199,232,109,252,193,135,254,213,234, -122,115,252,126,196,254, 37,198,203, 0, 67, 1,250,220, 63, 89,204,145,255, 10,192,220,213,244, 54, 13, 4,209,157,253,176,221, - 56,193,161,149, 42,209,194, 33, 18,247,170, 23,254,255, 29,238,237,161,145, 56,128, 4, 20,148,202, 10,113,253,177,187,236,204, -236, 58, 73, 99,169, 87,172, 61, 56,137, 98, 89,142, 51,126,243,230,205, 27, 57, 85, 36, 30,205, 46, 60,205,116,222,113,234, 36, -163, 51, 43,183,179, 34, 42, 25,123,123,216,180, 32, 3,148, 57,107,208,185,162, 13, 84,142,236,121,198, 45, 33, 90,202, 66,103, -103, 38, 47, 77, 94,200, 76, 5,224,160,168,103, 37,100,207, 40,149, 41,138,240, 57,240, 87, 53,134,119, 29, 64,186, 99,221,110, -135, 82,122, 44,169, 21,218, 44,178,236,110,115, 95,247, 53, 97, 34, 75, 35,250, 28,136, 84, 9,247,123,253, 59,241,167,105,145, -178, 51,226,110, 17, 57, 75,148, 71,122, 44, 78,209,255,138,185,119, 5,204,207,211,107, 26,151, 43, 33, 25, 70, 74,127, 32, 29, -117,253,147,229,209,121,225,201, 43,123,139,245,170,126, 10,249, 66,138,245, 25,237,228,180,211,166,171,223, 81, 56,107,146,178, -120,137,115,101, 93,251,154,105,251,255,191,141,119,222,119, 42,234,124, 42,244, 77,105,110,230,102, 53,215,111, 13,153,134,247, -126,251, 28, 50, 31,121, 94, 21, 1,200,191, 49,146,177,198,216,160,219,225,208, 12,153,134,107,129, 56,162, 72,221,204,204, 46, - 22, 23, 54, 85,233,152,101,230, 53, 68,116,130, 64, 24, 7, 92, 98,159,157,173,159,183,159,215, 95,176, 54,133,169,152, 82,228, - 75, 70, 61, 25,192,141, 50, 87,203, 43, 15,163,170,250, 8,185, 71, 28, 9,254, 79,253, 88,149, 75,102, 92,195,145,119,109,243, -238,253,245,221,253, 90, 43, 67,181, 77,203,121, 3,159,149,143,112,253,160,152, 24, 91, 98,241,142,108,135,118,179,221,252,218, -254, 28, 28, 3,118,226,112,173,224,129, 68, 46,242, 42,222, 69,234, 58, 74, 47,246,121, 73,156, 25,107,185,104, 57, 68, 67, 14, -182, 31, 68, 32,101,201, 32,221, 74,119,187,186, 37,207,125,108,252,195,166, 20,150, 76,198,135, 32,237, 5,148, 68, 38,143,238, -113, 51,172,227, 48,128, 62, 45,155,224,252,232,123,186, 87, 73,134, 72,243, 32,196,143,111,168,162,104, 81,215, 14,200,149,198, -138, 24, 0, 57, 85,162,229,148,109, 80, 15,126,120, 73, 15,100, 36,172, 25, 61,177,136,152, 12,252,147,225,236,229,187, 48, 13, -222, 95, 54,163, 76,128,253,232,168,124,125,254, 65,236, 67,167,132, 19,174,245, 52,184, 39,215, 4, 38,217,121, 72,103, 72, 13, -155,218,254,222,249, 39, 5, 33, 79,154, 87,178, 90,136, 42, 71,219,252, 51,156, 28, 35, 84, 47,186, 78, 52, 78, 14, 26,251, 21, -192,139, 99,125,119,122,154,135, 19,251,250,247,161, 44,202,213,226,227,165,188,156,161,239, 95,248, 9,186, 86,116,246,181, 32, -241, 79, 0,234,206,109,183,105, 32, 8,195,123,116, 99, 27, 18, 85, 45, 23, 84,168,125, 0,120,123,110, 16,239,129,122,131, 72, -165, 30, 36,160, 32, 66, 19, 31,210, 61,176, 51,227, 89,219, 81,196,125,111,146,171, 72,182, 99,143,103,103,255,255,251,129, 47, - 6, 14,120,173,243,220, 29, 49,143, 40,220, 98,219, 96,250,187, 74, 93, 77,231,113, 16,175,131, 57, 82,145, 82,116, 80,188,138, - 42, 70,229, 64,142,160, 37,187,198,113,188,168, 23,208,239, 23,150, 60, 26, 48,188, 1,215, 17,225,144, 10, 80, 64,130,194, 50, - 53, 65, 11, 11, 45,124,101,139,218,218, 62, 45, 51,141, 70, 10, 41, 60, 19,233, 18,148,186,232,195,238,118,183,110,124,131,247, -171,243, 48, 53,114, 56,221, 11,188,150,205,153, 47, 74,204,160,251,156, 88, 66,242, 97, 60,185, 1, 50, 43, 73,126,196,188, 89, - 46,238, 67, 10, 31,187,212,196, 68, 14,169, 33,218, 98,251, 61,184,116, 81, 86,232,181, 95, 26,249,215,249,135,153,180,102,240, -127, 90,254,180,172, 34,207,100,171,220,164, 91, 86,218, 92, 24,253,228,253,227, 49,148,243,203, 42,238,138,105, 57, 10, 77,143, -157, 11,151, 75,243,225,170,126, 93,153,189,243,181,150,239, 47,207, 34, 56, 53, 69,101,245,207, 63,251,190,117, 77,106, 37,184, -190,167, 31,190,213,126,181,124, 71,233,231,248, 63, 18,133,151,226, 46, 98,234, 73,155,126, 39, 14, 61,196,244,140,141,189, 27, -137,202,207, 94,157,167,239,211,250,180,217,111,229, 96,112,202,195, 30,146,159,139, 77,247,228, 67,224,241,129,228, 10, 17,137, - 51, 10,211, 25,154,203, 96, 52,168, 66,207,172, 81,246,102,253,237,211,231,143,198,154, 14,244,242,192,242,117,152,134, 78, 19, - 10, 2, 20, 77,140,176, 50,107,105, 80,193,128,243,125,142,125,226,221,255,204,137, 36, 71,215, 56, 90, 36, 70,178,228,253,161, -193, 94,157,129,130,195,198, 97,196, 48,118, 26,197, 64,150,199,237,175, 59,138,157, 78,135, 95,158,212,173,235, 35,109,211, 18, -223, 1, 80,173, 39,202, 20,182, 92,250,234, 66,233, 55,230, 10, 44,139,110,178,209,154,139,187,231,142,158, 74,228,243,189,112, - 95,132, 95, 95,171,205,215,231,205,111,209,108, 3,204, 42, 91, 76, 72,115,204, 11, 33,178, 67,156, 48, 24,163,156, 88, 3,197, -160,132, 57,200, 39,154,246,239,114, 14, 64,159,241, 13, 15,233,189,114,148, 72,234,255, 44, 13,142,229, 34,120,134, 14,181,253, - 22,161, 44,211,248,189,163, 78,168, 40,197, 1,185, 68,142,183, 94,204, 71, 18,176, 22,239,186,216,182,144,103,220,123,200, 89, -109, 9, 1, 79,155,195,104,242,159,213,117, 57,127,241,164,119,230, 99,247,195,168,114, 85,164, 55,196, 34, 85, 84, 92, 7,200, - 48,110,136, 28, 63,215,127, 2, 80,119,109, 59,109, 3, 65,116,111,118,154,208, 16,120,160, 85, 37,196, 51,255,255, 19,253,134, -138,138, 39, 20, 17, 72, 64, 65, 77,109,108,239,110,247,204,204,198,155, 80, 36, 94,121,140,148, 68, 78,236,157,157, 61,115, 46, -238, 13,148, 37,206, 42, 70, 56, 61, 96,159,244,177,125,241,219, 83,187,160,206, 32,144,129,160,175,180,128, 62, 54, 26,180,244, -232,146, 32, 28,153,218,180, 53, 65,223, 8, 70, 35, 76, 75,208,201,211,183,225,158,155,170,230,129,250, 68,213, 76,103, 78, 47, - 42,112, 33, 82,149,159,164,245, 83,187, 42,104, 11,121,180,115, 3, 73, 54, 28, 84,236,125, 31,155,135,230, 41, 93, 73, 15,222, - 21, 19,222, 7,202,206, 38,232, 85,198,210, 18,171, 77, 79,190,240, 18,116, 78,241,224, 35,188,225, 97,174,218,175,169,194, 16, -248, 64,118,204, 22,145, 70,240,248, 66, 33, 22, 41,135,246,185,111,184,106, 59,208,249, 99,234,223,239,195,113, 22, 76,225, 44, - 33, 99,150,147,140,213,232, 92,254,108,230,155,123, 0,211,200,180,125, 65, 94,210, 39, 46,238,123,190,188, 43, 78,181, 59,165, -126,110,186, 95,155,110,102, 17,244,122,253,109,126,118, 90,239,134,110, 49,119,149,117, 87, 23,211,229,186,213, 56,114, 70,198, -232,177, 62, 13,184,217,150,145, 49,214, 7,141,231, 51, 61,178,127, 67,252, 47,201,147,173, 0, 88,212,188,249,243,104,180, 59, -115,245,172,254,218,244,187,192,106, 12, 38, 83,107,225,110,164,247,205, 38,211,116,199,255,182,187, 98, 81,200, 19,129, 41,146, -199, 6,221,246,173,113,150, 60,217,253,151,249,236, 97,189, 74,197,180,123,125,253,126,254,227,118,249,219,211,240,210,135, 12, - 56,179, 83,138,246,194, 20,203, 30,199,120,240,113,109,164,104, 78, 31,177, 86,194, 71,163, 52,113, 65,179, 24, 27,143, 54,217, -109,198,116,210,244,152, 83,209, 36,149,230,177,150, 90, 31, 75,251, 25, 23,250, 94, 12, 88, 96,181,206,237,127,254,171, 96,197, - 58,248,208,182,157, 22,101,168,101,147,239, 8, 6, 35,168,169,112,193,218, 62,153,229,179, 90,159, 15,151,227, 41, 74, 21,204, -200, 82, 62,141, 90,127,163,194,106,169,182, 43,213,180,169, 19, 69,164,104,250, 45, 67,246, 85, 99, 28,138,119,210,176,119, 91, - 19,183,238, 24, 70, 96, 61,126, 32,133, 38,195, 49, 58, 91,175, 68,147,151,146,223, 99,227, 69,141,119,239,247,254,161, 48, 73, -125,251, 6, 10, 92, 17,113, 89,113, 73, 90, 31, 68,244,241, 68, 84,135, 35,202, 78,142, 71, 26,229, 84, 7,238, 70,177,224,224, -155, 67, 90,206,232,113,171,199,205,195,100,227, 1,116,171,169,145,189,107,110,136, 71, 15,175,238, 1,205,187, 32, 40,161, 8, -123, 56,234, 11,255, 9, 64,221,181,245, 52, 8, 67, 97, 90, 96,192,166,211, 68, 19, 19,159,124,247,255,255, 29,223,124, 80, 71, - 22, 7, 78, 24,180,181,231, 86, 10, 91,246,238,235, 50,146,149,193,215,211,115,190, 75,118,214, 69, 34,241, 54,187,116, 90,234, -253, 41,191,227,120,204,105,182,233, 54,133, 15, 13, 30,169,168,238,128,123, 13,158,189,192,114, 1,243, 11,244,206,240, 80,157, -146,123, 1, 21, 75,189,223, 15,146,188, 34,190, 34, 71, 85,186,206,217, 28, 76, 6, 1,151, 75, 72,194,204, 42, 52, 56, 56, 89, - 91,164,217, 77, 94,140,254,188,167,237, 73,251,210,168,133, 80, 99, 8, 17, 1,255,125,191,212, 1, 40,152,142, 75, 47, 53, 17, - 90, 0, 40, 45,223, 70,182, 82,118,129, 19,201, 29,116,205,169, 96,188, 51, 7, 9,154, 24,126, 42,146, 27, 79,224,174, 35, 95, - 78,141,246,196, 6, 4,230, 57,226,181,255,197, 72,222, 88,186,241, 43, 65,183, 82,194,230, 11,105, 46, 99,172, 32, 60, 2,107, - 33,185,119,248,133, 39,165, 63,177,120,255,215,224, 30,191, 54, 43, 1,250, 82,164,188,149,209,207,219,242,245,229,225,208, 3, -215,182,237,108,145,167,155, 77,241,120, 87,117,189,205,218,225,152, 88,106, 97,221, 87,235,195,240, 75, 71, 46,151,136, 5,191, -158,153,120,186,137, 73, 49,179, 98, 10,208,143, 8, 15,151,123,188,171,155,186,200, 86,110, 36, 37,169,194, 44, 59, 44, 54,248, - 77,132,228, 63,217,251,163,229, 96, 33,140,154, 80, 40,178,192,208,202,168, 17,124, 84,138,159,166,201, 87,185, 25,204,126,168, -119,135, 26,148, 45,214, 67, 28, 12,252,145, 25,137,166,183, 16,200, 35,141,115, 45,177, 64,138, 7, 58, 2,241,168,240,118, 65, -140,167, 92,228,148, 75,179, 39,131,228, 99, 69,228, 7,104, 14,105,246,210, 81, 98, 74,173, 89,248, 62,249,118, 33, 83,217, 95, -199, 88, 47, 1,119,196, 18,194, 1, 6, 6, 82, 24,171,199, 17, 82,184,154,125, 82,239,220, 59,224,251, 24,181, 50,212,124,220, -106,131,159,221, 91,159,124,125,232,227,183,237, 79,208,105, 24,205,109,146,181,176, 26,195,135, 40,203, 60, 70,106, 75, 45, 42, -219, 96, 6, 96,121,188,121,101,226,228, 2,159,196, 92, 22,107,171,248,255,159,185, 0,206,219, 50, 81, 84,225,149,103,215, 45, - 52, 80,103,141, 26,181, 24,247,134, 83,133,147,120,168,101,181,145, 68,167,172, 8,148,131,128, 58,230,142, 19, 11, 86, 2,148, - 98,178,146,198,198, 99,239,102,110,198,156, 92,120,113, 65,127, 2, 48,119, 45,201, 77, 3, 65,116, 62,146,108,227, 56, 78, 88, -192, 34, 85, 57, 2,247,191, 10, 39,128, 4, 87, 17, 27,108, 9,105,102, 26,189,238,233,201,200, 20, 84,150,120, 47,149, 74,178, -158,250,243, 62, 5,223,147,130, 97, 38,229,168,155, 79,100,162, 56,226, 55, 6,100, 47,199, 59,127,187,161, 22, 84,197,104, 36, -153, 90,246,152, 29,212,117, 44,223,214,174,143,243, 32,249, 70,192,150,212, 75, 38,161,211,184, 83,178,126,231,221,150, 99, 93, -187,166,217, 52,107,216,127, 59,186,184, 33,117,128,132,193,143, 56,113,227,226, 57,192,205, 27,243,212, 20,213,105, 19,181, 5, -132, 32,148,141, 8, 72,199, 85,160,186,112, 59,152, 88,227, 40,208,236,138, 6, 53,231,104,231, 4, 75,230, 8, 25, 87,109,213, -157,145,198, 69,183,108,172, 4, 39,103, 95,123, 28,154,191, 72,167,208,199,162, 86, 0, 49,219, 94,185, 53,123,229,138,136,188, -155, 35,226,120,191,234,180,231,205,254, 34,153, 18, 53,159,103,107,237,252,181,248,130,162,236, 13,181,204,255,253,115, 58, 73, - 95,105, 62,201, 59, 80,239, 16, 82,184,223,174, 62, 61,190,191,187,191,249,124,248,190, 1,159, 37, 53, 13,117, 93,123,127,211, -245, 63,167, 25, 37,218, 24,215,214, 62,236,218,113,181,239, 71, 79, 89,234,140,122, 53, 43, 87, 56,180, 61,147, 21,153,115,159, - 21,196,105,129, 15, 60,117,227,198, 13, 32, 10, 44, 7, 33,114,234, 1,167, 24,235, 71,141,140, 16,241, 36,143, 8,172, 53,246, -143, 36,102, 82,123, 60, 16,218,121, 70, 46,239,115, 0, 91,236, 87, 24, 3, 12,248, 8, 9, 69,240,230, 0, 43, 38,240, 24, 54, - 48,128,191, 70, 0, 45,210,128,149,249, 44, 65,151, 78, 93, 51,115,253, 78,106,212,129,191, 50, 91,251, 9, 66, 38,246,219, 39, - 94, 80, 75,246, 31,125,220,127,120, 58, 30,124,246,170, 22,255, 3,161, 33,130,177, 12,222,187, 13,146,193, 32,146,209, 66,254, - 21,167, 49,203, 57, 23, 77, 52,126,140,205,229,236, 79, 47,116,136,193,248,146, 97, 20,171, 66, 62,213,136, 63, 95,214,215,111, -230,229,217,156,143,102,232,109,152, 76, 8, 63,166, 75, 10, 33, 47,152,229, 62,137, 45,137,205,147,175,252,160, 84, 99,175,133, -110,161,189, 47,136, 43,105, 49, 75,191,222,175,254,131,244, 77, 75,182,143,173, 29, 90,232,175,243,253,186, 70,128,200,193,185, -105, 26,205,155, 95,198,165, 27,204,213, 65, 84,187, 1, 23,135,250,202,186,157, 90,219,174,186, 53, 66,228,249,238,138,137,111, - 37,118,149,245, 97, 82,164, 47,114,170, 84,134, 92,183,235,221,124,236,113, 56,213, 87,245, 91, 0,230,174,102, 55,109, 32, 8, -207,216, 94,131,237, 72, 41, 36,170, 84,169, 15,208,103,168,250,246, 81, 31, 33,135,230,212, 75, 42,161,166,150, 82,129, 13,172, -189, 27,207, 31,182, 41,228, 92, 78, 62, 96, 64, 88, 59,251,237,204,247,147,205,127,156,112,125,162, 56, 26, 69,245,112,233,101, - 3, 74,145,168,136,117,172,171,180, 42,161, 98,125,182,248,234, 16,192,234,213, 70, 63, 99,150, 63,228,236,117,154,202,224, 50, - 74,226, 37, 53,223,135, 82,233,144,162, 83,129,108, 6, 92,154,102,148,238, 6,135,215,190, 14, 11, 50,112,201,217,248,189, 44, -110,138,170, 92,221,173,158, 30, 31,201, 36,156, 76, 10,131, 76,204, 88,229,220,139, 21,165,185,134,169, 97, 56, 70,115,150,224, -152,159, 9, 79,198,188, 59,140, 32,164,209, 28,201, 73,180, 54,238,157,167, 28, 31,110, 42, 9, 52, 82,176,159,208,241,152, 70, -195,127,232,140, 79,232,219,145, 40,139, 60,239, 11,156,129,214,133, 33,247,130,233, 56, 44, 67,166,172,229,148,166, 46,244,233, - 13, 95,123,230,171, 57,126,231,199, 4, 54,125,104,223, 97, 5,252,247,176, 61,254,179,108, 58, 62,226, 0,253, 33,248,193,101, -183, 85,254,249,254,102,189,174,126,189, 54,219,198,123,143, 89,135,153,235,139,133,251,180, 94,116,219,163,247, 80, 98, 92,149, -174,129,252,231, 62, 79, 88,210,162,186,146,128, 39,113,198, 0, 23,190,126,249,246,253,199, 3,152, 18, 58,206, 18,230, 45, 5, - 40,170,152, 4, 53,153,205,104,121,106,182, 1, 98, 70,168,188, 9,121,248,225,226,122,230,242, 78,220,139, 1,216,164,234,205, - 16,250, 97, 9, 28, 59,145,101, 6,146,107,114,159, 91, 46,152, 90, 30,130,170,123, 64,246, 38,161,121,171,143, 62, 26,207, 70, -120,104,195, 91, 51,177, 26,198, 41,118,179,134,134,176, 24, 24,200,160,118,179,101,136,208,250, 67,136,221,136, 60,163,105,166, -134, 83,182, 40,190,197,143,144,138,131, 23,110, 15,232,112, 1, 43,183,100,222, 59, 81,206,232,158,227, 14,254,190,224,239,163, -135, 34, 26, 67, 38,204, 57,145, 99,127, 99, 3,248,242, 12,187, 58, 57,236,186,253, 14,134,103, 57,156,168, 67,212,156,171, 56, - 33, 28, 6, 21,189,155,169, 64, 82, 44,151,109,187,149, 52,186, 32,225,234, 48,109,201, 95,158,166,226,245,242,121,165,218, 78, - 17,241,165,240,186, 75,183, 40,167, 93,114,255,240,140,156, 27, 39,187,206,251,204,204,120,230,217, 91,184,178,241, 91, 28,247, -173,217, 90,161, 28,174, 36,181,226,110, 66, 93,115,110,157,104,254,199,141, 79,153, 82,246, 93,100, 21,213,181,134, 25,198,215, -155, 0,188, 93,201,110,219, 48, 16,229,144, 20, 45,185,182, 83, 56,135,162,189,164,183, 34, 64,190, 36,200,175, 5, 5,250, 79, -237,189,183, 30,138, 0, 65,210, 5,133, 99, 52, 86, 36, 75,150, 56,172,103, 72, 90, 75,146, 91,208,163, 15, 50,180,206, 12, 31, -223,162,123,189,141, 70, 94, 25, 32, 26, 95, 61, 67,202,168, 23,124,147, 77, 24, 63,163,188,201, 75,216, 78, 84,182,144, 51,205, -202,237, 16,140, 2,222,177, 78, 25,246,201,176,206,231, 49, 9,173,217,183, 90, 42, 50,121, 39,216, 67,177,114,121,183,170,239, - 11,100,186,173,150,251, 9, 46,181,217, 92, 47,142,142,151, 31, 78, 79,207, 47,206, 79,206, 78,174,190, 94,125,186,252,184,250, -243,139,130,153, 4, 90,194,133,226,203,195,142, 84,146,233, 78,145,193,228, 23,183,210, 5, 58,205,192,215, 55, 90,173,198,237, -211, 67,154,199, 96,251,116,244,140,194, 33,190, 49,184,176,148,167, 53,205,134,203,247,140,111,112,105,133,113,110,162, 33,235, -193,205,138,171, 63,176, 51,124,202,209,131,146,245,240, 10,200,186,194,208,119, 64,229,126,255,193, 25,110,156, 9,192,173, 21, - 15,164,113,253,223, 64,138,123,161,191,146,157,195,104, 71,202,245,123,200,192,148,255,172,197,153,195, 45,218,155,191,155,245, -174,109,144,194,156,108,219, 22, 21, 76, 83,125, 60,159,148,139,221,155,105, 98, 84,114, 93,232,159, 27,222,118,100,187,245,249, -228, 53, 33,248,117,249,246,232,221,143,245, 13, 48,131,248,243,183, 47, 36,123,150, 46,248,250,197,175,206,245,153,111,135, 53, -115,180,240,237, 77,210, 81, 50,121,224,182,116,129,175,189, 44, 24,209,137, 41,209, 79,163,138,104,143,232,109,237,180,114, 17, -105,103, 76, 70,120, 31,211, 32, 41,138,230, 55,190, 97,171, 16,230,196, 45,196, 99,223, 32, 14, 43, 15,144, 16,165, 59, 24,252, -125,145,166,184, 32,236, 87, 97,174,199, 8,175,112,134, 12,181,189, 85,126,199,115,136, 72,148,105,108,144,104, 97,240, 73,163, - 95,211,244,213,195,182, 96,117, 57,171,132, 8,186,215,196, 72, 80,146,174,134, 77,245,161,169,150,119,249,172,170,151, 80, 84, -239,219,239,113,247, 40,233, 25,209, 52, 67, 21,171,250, 45, 76,190,222, 86,247,162, 46,113, 87,179,201, 57,249,177, 6,130, 40, -118, 66,215, 8,188, 96, 64,147, 97,191,192,105,209, 35, 95, 46,226,218,110, 4, 47, 64,140,138,243,135, 63,201,116, 31,251,201, - 12,171,244, 8, 13, 26,189,231, 56,114,255,151,148,100,208,179,105,241,244,171, 1,219,146,206, 54, 51,233,254,236, 27,182, 76, -127,166, 73,140, 34, 82,195,178,205,131,116, 30, 51, 54, 82, 53, 68,145,131, 94,248, 30,153, 3,192, 83,117,200,117,133,222,142, -208, 33, 16,131,188,170,186,109,221,163,219,244, 79, 0,222,206,152,183,109, 24,136,194, 34, 69, 82, 86,156, 32, 54,138, 2, 93, -147, 37,104,182,110,221,251,231, 59, 20,237,223, 72,236,216,112, 91, 91,162,104,137, 87,222,241,200, 80, 77, 80, 20, 29,234, 65, - 35, 33, 89, 18,121, 58,126,239, 61,206,231, 83, 84,238,230, 14,117,146, 79,229,115,245,177, 6,135, 2, 72,114,225,198,134,119, - 19,108, 20, 64,161,112,187,146,170, 54,206,123, 35, 52, 26, 24, 72,133,213,189,212, 8,231, 16,167, 98,225,252, 52,236, 55,253, -118,227,182, 59,187,237,167, 19,102, 12,202,152, 38, 79,245,194, 52,246,182,239,186,227,251,251,251,219,143, 55,111,154,245,169, -179,135,239,135,193,145,133,244, 24,126,142, 62,127,145,120,227, 66, 44,189,197, 62,109,138, 38, 71, 30, 44, 91,128,189,121, 4, - 65, 47, 57,142,153, 81, 25, 37,162,113, 71,180,244,136, 29,247, 58, 73,155, 56, 3, 57, 27,245, 17, 55, 9,225, 90,142,231,211, -102,180, 45, 5,168, 26, 90, 47, 44,238, 69, 32,137,188,195, 62, 42, 55,154,175, 73,186,160,233, 51,199, 24,121,161,165,166,172, - 29,202,167,166,176, 80,236, 13,251, 86, 9, 13,114, 63,249,167,255,232, 73, 32,210,218, 94,182, 45,103,177, 0,255, 52,191, 87, - 5, 54,147,199,247,207,108, 40,160, 39,104,141,194,234,227,224,240,195,189,198,244, 57,173,196,114,161, 46, 23,250,170, 22, 3, - 52,159, 31,228,214, 74,222,210,194,255,181,110,212,197,201, 30, 67,105,252,211,254, 16, 73, 25, 71,247, 24,215, 0,173,154,240, - 72,196, 29,148,252,180, 67, 66, 36,184,121,151, 13,247, 50,103, 19,129,199,228, 95,200,152,185,103, 2,122,189, 92, 89,231,138, -240,237, 52, 43,248,204,219, 68,209, 80, 84,242,144,190, 13,143, 17, 74,164,224, 95,198,134,139, 20,136,228, 22,149,151, 35,246, -132, 77, 27,252,172,157,206,177, 33, 85,162,183, 4,167,139,177, 91, 53, 27, 41,224, 97,181, 92,133,145, 29,198, 35,123, 74, 62, -168, 50,159, 55, 33, 49,143,167, 99, 48, 1,188, 35, 47, 6,110, 12,133,151,209,168,230,178,189,114,161,106,146,106, 33,234, 15, -114,125,171,222, 65,101,204,249,220,189,189,123,252,212, 66,146,230,101,161,178, 44,228, 78,120, 49, 95, 43,245,237,139,181,187, -170,223,251,254,224,135, 30,156,133,209, 17, 31, 73,139,130,231, 25, 99,222, 90,161, 68,136,137,205, 7,161,156,227,210,163,228, -203,100,209,194, 47, 11,196,115, 83,102, 62, 44,252,185, 72,249,109,102,135, 23,192, 77,100,145,242, 18, 35,210, 22,254, 76, 41, - 12,213,117,187,114, 24, 55, 56,138, 89,148,219, 43, 35, 71, 2, 53,199, 4, 34,116, 68, 22,188, 34,161, 94, 83, 73,216,252,197, -235,149,118,144, 69, 25, 69,242,162,213,243,202, 80,191, 4,224,237, 74,118, 26,134,129,168,151, 56, 93, 40, 32, 56,241, 17,252, - 60, 32, 85,124, 3,127,192,137, 3,162, 7,150, 54, 52,221,210,196, 30, 60, 51,182,147,148, 10,193,133,123,218, 52,174,227, 89, -222, 50, 89, 47,236, 0,189,115,169,122,196,136,226,128, 93,203,249,239, 34,196, 6, 15, 39,204,157, 49,187,168,154,122,111, 11, - 58, 61,177,195,174, 53, 54, 6, 87, 77,142, 34, 90,165,136,167,133, 59,163,114,181,197,182,161, 83, 76,155, 36,208,146,116, 79, -254,138,218,135,244,204, 17,117,210,223,177,129,217,236,249,238,230,246,126, 58,253,248,152,175,215,203,114, 83,146,127, 52,189, - 21, 62,136, 88,134,218,210,192, 36, 65,174, 15, 16,189, 27, 72, 94,208,161, 85,169,196, 33, 96,178,153,162, 49, 17,146,169,238, -192,164, 87, 5,161,174,113,242, 80,158,150,220,199,168,106,240,143,167, 22,232,184, 45, 40, 91,151, 6,225,108,174,176,224,220, - 63, 62, 82,195, 90, 55,130,177, 86,147, 1,218, 97,249, 2,102,100,160, 33,171,192, 17,154,152, 59,237, 19,117, 3,198,154,177, -133,199,170,121,255,223, 46, 10, 68,190,230, 46,138,176, 76,199, 65,204,246,123, 68,191, 7, 3,184,112,209, 29,151,130,109, 88, -168,112,174,150, 62, 62,175,213,196, 53, 89, 78,125,185, 90,141,140, 67,207, 6,233, 78, 7,217,195,139,126,154,147,252, 26, 55, - 6,194,245,180, 13, 93,185, 41,104,240,139,108,241, 49, 25,100,155,128, 70,142,166, 66,121,170, 98, 88,156, 57, 27,162,203, 70, -128,232, 41, 71, 44,219, 6,101,122, 41, 47,143, 92,242,190,220,197,152,161, 82, 75, 1,201,141, 67,196,249, 29,112,146,157,249, - 96,131,194, 9,210,168, 65,236, 4, 81,206,106,233,171,108, 28, 63, 20, 71,135,137,128, 67,201, 40,153,161,196, 89,131,107,227, -199,113, 65, 74,248,148, 14,162, 58,118, 28,195,126, 60,123,144,193,124,181, 72, 37,166, 75,191, 50, 12,198,224, 58, 66, 20,235, - 2,130,225, 41,123, 15,227, 66,161, 37,252,182,212,122,232,175,186,206,175, 46,178,201,235,166,216,229, 53,212,106,191, 42, 27, -113,233,183, 2,228, 61, 9,107, 59,239,138,237,110,223,150,149,253,148,126,229,235,202, 17,221, 33,206,106, 99, 98, 18, 25,142, -200, 35, 84, 21,150,255,164,246, 49,167,241,157,156, 61,158,137,136, 28,132,110, 16,180, 61, 11, 56,146,189,195,239, 79,246,227, -181,186, 99,159,199, 30, 5,243, 27, 62, 43,196,114, 91, 68,122,221, 33,188, 43, 90,194, 76,104,157,245,156, 19,105,203, 14,117, -190,181, 21,221,238,175,253,215, 67,236,180, 11, 20,255,196,142, 20,226, 75, 0,222,174,100,167, 97, 24,136,122, 73,210,166, 20, -196,133, 35,226,255,191,132, 95, 64, 8, 9, 36, 4, 82, 1,161, 86,165,212,141, 99, 27,207, 98,199, 9, 8, 16, 7,122,171,170, -110, 25,103,214, 55,239, 85, 57,123, 75, 10, 83, 33,209, 19, 75, 30, 71, 56,236, 92, 18, 45, 41, 53,203,160,193, 14,103, 83,195, -224,209, 19, 84, 8, 48, 97,202, 3, 25,183,144, 86, 26,184, 53,123,210,204, 28, 52, 83,144, 72, 2, 22,146, 8,164,136, 42,197, - 26,209,243,218,185, 6,240, 1, 42,196,210,173,109,218,235,219,171,195,187,129, 13, 85, 7,234, 29,189,235,172,141, 21, 76, 7, -130, 48,129,214, 62, 66,169,109, 20, 24, 18,204,216, 35, 95,164,147, 36,116, 70, 73, 58,126,163, 98,146, 85, 18,184, 76, 84,192, -100, 46, 94, 80,151,195,212,155,195,131,103,104, 91,140,108,207,190, 35,209,131, 58,218, 76, 5, 11, 74,105, 96,177, 19, 13,138, - 33, 54,205, 84, 23,149,156, 53, 32,116,116, 52, 35,253,103,113,210, 64,242,110,192, 9,200,249, 92,180, 33,220, 63,153,155,253, -255, 57,247,236, 62,234,244, 35,151,233,169, 78,192,243, 67, 33,250,170, 11, 30,177,223,132,141,252,198, 62, 77, 32,150, 9,169, -214,147,122,184,245, 94,247,209, 95, 45,145, 82,173,149,125,163, 85, 52,175,233,236,229,195,238,238, 53,212, 53, 83, 92,228, 28, -133, 82, 1,199,164, 70,163, 67, 14,114, 31,152,183,150,104,201,162,192, 31,116,229, 21,203, 64,200,172,237, 33, 50,136, 32,165, -237,197,240, 37,172,214, 43,149,239,100, 63, 26,160,181,179,197,198,108, 96, 37, 36,201, 63,208, 98, 11,179,219, 16, 86, 23,229, -158,179,140,108,136,181,121,168, 82, 57, 77,199, 78, 78,192, 23, 42, 67, 49, 19, 87,110,242,244,146, 88, 45, 99,222, 5,113, 23, -232, 30, 53, 28, 84,133,171, 83,130,169,160,216,149,208, 52, 25, 95,169,170,198,216,131,202,163,189, 4, 87, 33,216, 37,212,174, -160,124,227,207,235,227,179,250,244,241,237,165,195,223, 96,118,214,238,214,189,184, 80,110,216, 89,157,116,189, 29,114, 2,201, -237, 86,185,189,112, 6, 25,108,122,146, 69,161,182, 85,198,254,112,163, 88,142,252, 84, 6,144, 88,100, 97,100,218, 56,134,192, -227,190, 59, 54,169,146, 1,229, 96,207,144,131, 5,163,110, 10, 57,236,239, 31, 35,207,142, 77,106, 63, 57,189, 24,199,191,220, - 78, 37,178, 70, 33, 63,129,224,253,244,243,133, 99,138,180,210, 29,231,162, 32,232,186,137,151,235,111,140, 35,197,133, 8,101, -145,237,127,250,239, 31, 2,144,118, 62,189, 9,195, 48, 20,175,147, 0,101, 69, 59, 76,187,177,227,190,255,215,217,101,211,110, -108,210,164,178, 13, 74, 75,219, 36,171,237,164, 73, 90,246, 71, 26,226,128,144, 64,136, 10,243,108,191,252,158,138, 95, 15,158, -111,207,215, 71, 4,104,176,117, 52, 83,143,228,226,145, 10,159, 74, 0,199,138, 7, 38, 95,243, 51, 52, 9,167,244, 25, 43,162, -160, 17,186, 48,152,168,237,230, 64,114,232, 2, 52,233, 89,252,188,104,219, 69, 47,185, 82,229,254, 77,210,250, 22, 25,116, 6, - 79, 32,226,112, 70,247,134,234,187, 75,206,246, 97,134,222,215, 25, 74,188,244, 74,193,245,193, 48, 6,155, 57,132, 55,128,203, - 88, 3, 27, 2, 86, 93, 25,144,236, 62, 22,209,172,139,186, 26, 34,252,213,180,158,222, 96,125,199, 14,186, 50,132,171,183,136, - 86,202,115, 85,180, 80,145,102, 91,146,222, 92, 43,200,135, 78, 24,129,105,156, 6, 1, 8,179,207,196, 26,236,161,108, 30,118, -167,103,109,154, 75,110, 72, 21,133,243,253,255,166,252,251, 72, 63, 42,145,254,190,164,178,219,210,182,160,160,162, 60,206, 85, -154, 31,117, 65, 22,177,198, 76, 42, 60, 69, 20, 46, 56,130,133,181,191, 40,173,238,101,167,142,162,199,234,220,192, 25,244,237, -240, 69,214,125, 89,101,184,129,199, 29, 40,163,132,146, 10, 40,201,253, 62, 87,186, 74,168, 98, 85,236,117,203, 73, 2,224,225, - 85, 48,209, 56,238,145, 25,254, 92, 5,140,235,173, 32,219, 83, 97, 40, 0, 18, 63, 69, 8, 69,179,217,235,251,206, 98,147, 73, -219, 94,195,121,161,134, 57, 98, 44, 3, 50, 50, 0, 67,208, 86,174,253,141,143,201,120,200, 88, 52, 12, 99,116, 48,121,194,242, -197, 74, 72, 57, 52,198,180, 16, 38,204, 17,233, 18,146,225, 68,102,160,136,101,114, 38,143,179, 11,103, 31,114,123, 65,128,235, -171, 77,189,175, 52,136, 9,113,207, 53, 22, 25,112, 49,190, 47,182,239, 93, 85,214,159, 56, 56,236, 13, 52,205,137, 74, 2,146, - 70, 52,255, 44,211, 85, 32,163,108, 7, 45,240,113,192,115, 26, 67,101,239, 58, 10,226,212,208, 35, 52,150,176, 8, 38,173,110, -169,121,207,184,197,234,221,205,118,181,204,159, 94, 30,249,112,140, 39, 36,135,178,158, 64,135,204,152,103, 17, 34, 56,236,239, -179,153,233, 63,140,159, 85, 92,184,173, 22,235,115,215,204, 37, 60,119, 16, 52,160,119,164,247, 89,151, 0,190,169,212,209,215, -101, 39, 11,250, 99,234,108, 49,223,159,176,157,235,244,249,170,217,252,205, 69,253, 37, 0,105,231,182,147, 48, 16,132,225,206, -178, 20,202, 33, 65,111,188,243,253, 31, 73,111,213, 24, 49, 4, 35,104,169, 61,236,216, 57, 45, 45,173, 49, 70, 30,128,208,102, -153,221,157,249,255,239,247,231,247,103,177, 38, 40,248, 11, 91, 25,120, 30, 67, 4,185, 48,115,226, 82,156, 61, 10,141,213, 5, - 73, 53,228, 12, 51, 13,176,150, 61,248,130,145,192,101, 57, 72,130,134,163,120, 39,231, 93, 80, 27, 22,179,208, 28,212,249,129, -155,226, 19, 25, 27, 19,168,168, 38, 86, 53,153, 71, 80,105, 73,236, 66, 48,181,140, 10, 49,241, 98,155, 53,155,146,153, 86,209, -242, 25,192,145, 78, 95,112,173,110,114,174,239, 18,179, 64, 7,164, 58,178,156,204, 50, 72, 79,210, 86,233,143, 42, 95,179,220, -133, 1,211, 16,103,137, 12,215,128, 91,159, 30,235, 47,207, 21,237, 80, 6,151,250, 44, 77,230, 51,191,206,166,155,165, 95,164, -190, 41,195,118,119,186,127, 56,222, 21,213,110,172,101,230,109,163,117, 29,244,238,255,207,236,181,161,111,166,220, 48, 33, 97, - 15, 37,120,210,193,100,237,208, 19, 15,142, 44,105,159, 37,215,125,126,248,212,124,234,222, 92,139,195,121,108, 55,254,102, 50, - 88,151, 96, 59,135, 52,172,218,141,100, 14, 56,229, 11,122,213, 64, 81,135, 50,161, 84,148, 67, 1,126, 14, 55, 27,255,178,163, -145, 68,195,165, 7,122, 82, 93,229,161,219,203, 54,126, 6,119,187, 37, 67,131,156,117, 65, 4, 95,244, 79,140, 39, 90,236, 29, -114,116,145,244, 69,114,248,235,165,216,208, 99,200,114, 30, 16,181, 65, 80, 46,185,178,189, 18,229,103,157,145, 42, 96,238, 89, - 48,231, 11, 67,100, 34, 10,170,179, 80, 45, 11,251,106,121, 93,135,170, 40, 10,199, 81, 8,164,143, 52, 47, 45,131,117,157,208, -196, 39,252,119,229,120,206,168, 26,151,197, 75, 5,102,149,173, 14,249,251,243,126,107, 67, 57,215,243,131, 42,128,189,189,109, - 55,237,193, 99,230,230,111,249,107,213,222,143,177,164,134, 81,145,151,139, 84, 31, 92,250, 48, 94,199,130,242, 69,140,167,229, - 59,193, 49, 15, 77, 69,205, 25, 36,122, 8,187, 27,137,222, 45, 3, 94,148,136,114,189,215, 4,161,229,216, 49, 87,243, 84,158, -246,143, 90, 81, 20,233,142, 99, 45, 20, 84, 9, 41,106, 22,182, 29,222, 67, 23, 35,156,252, 48,131,197,177,110, 76,211,215, 49, -199,207,169, 58,185, 97,123, 76, 6,244,128, 89,186, 34,123,132,198, 57, 71,142, 44,152,242,138, 12, 48, 16,165,186, 35, 53, 26, -134,194, 30, 28, 11,119,191,252, 1, 3,222,120,248,139, 63,230, 91, 0,210,174,100,167, 97, 24,136,218, 78,186, 35, 65, 17,119, -132,196,255,127, 18, 92, 16,170, 4, 69, 41,197,105,227,216, 30, 60,139, 83,119, 65, 2,209, 67, 15, 61,116,137, 58,206,204,155, -183, 20,252, 72, 49, 69, 6,115,154, 98, 33,109, 92,192,191, 87,142,138,164,176, 5,186,190, 38, 53,224,233,127,101, 6, 58, 57, -137, 47,180,224,150, 70, 21, 90,239,161,215,168,128,210,173,188,174, 42,196,241, 13, 43, 53,200,120, 19,173,128,243, 10, 84,214, - 65, 74, 12,240,208,226, 44, 50, 39, 63,200, 12,203,196, 77,131, 98, 39,137,229, 56,248, 50, 19,144, 87, 73,148, 44, 99,238,124, -184, 83,168,154,180,239,210,194, 35,196,130, 74,143, 64, 44,103, 80,181, 76,200, 66,182, 20,170,110,250,136,137,107,111, 72,104, - 26,101,233, 37,227, 89, 7,241,221,249,199,217,164,217,246,107,234,123, 58, 80,141,117,115, 8, 83, 5,187,157,223,173,245,106, -235, 94, 54,221,107,230, 36,152, 34, 23,233, 28, 49, 28,101, 88,227,159, 93,124,149, 77,111,248,206,113,171,212,117,205, 22,136, -122, 62,194,245,241, 30,210,156, 97, 22,228,246,230,131,234, 61,236,251,176,117, 48,216,220,237,133,224, 40, 64, 13, 28,221,169, -143,202,166, 46,248, 21,124,123,136,217, 54,242,138,206,122, 75, 54,136,181,199, 37,196, 24, 51, 3,234, 49,170, 35, 96,211,134, -229,162, 55,156,213, 61,128,133,121, 66, 56,248, 10, 29,237, 59, 53,133,210,113, 56, 24,241, 17,217, 57, 72,224, 23,230,203,168, - 83,236,229, 98,151, 84, 74,166,224,135,200,109,140, 14,211, 49, 79,136, 65,146,110,132,123,147,179, 58, 65,252,109,233, 86, 36, -226,111, 93, 86, 56,148,184, 46, 43,171,135, 61,107,122,222,216,198,176, 97,182, 62,128,165,185, 54, 13,131, 62,186,196,159,128, -175,188, 40,254,217,201,172,249,106,132, 26,156,253,201,179, 78,139, 12,148, 42,161,108,166,183, 91, 84,179,214,187,143,189,237, - 67,111,157,117,126,181,244, 51,111, 81,190, 11,115, 46,102,217, 18, 70, 80, 89,106, 66, 86,177, 81,121,251, 9,193,141, 83, 37, - 6,109,177,252,240, 53,177, 34, 8,146,192,193, 35,251,253,221,195,243,219,211,180,158,180,233,124,100,125, 21, 85,100,197,254, - 63, 74,182,220,170,112,242, 58, 76, 93,113,160, 10,130, 62,111,222,143,219,137,223,151,201,121,167,162, 47,137,162,160,152, 35, -112,233, 82,156,134,211,209,184,235, 59,254,206,233,135,164, 70,174,237,183,229,225,142,217,241,145,119,152,167, 64, 38, 20, 54, -150,229, 41, 95,112,122, 46,172, 94,255,122,178,243,227, 91, 0,210,174,100,167, 97, 24,136,198, 75, 8,165, 11, 66, 2,241, 5, - 92,248,255,239,224,192, 7, 32, 4,226,214, 10,148,180,205,230, 5,207,120,198,113,170, 74, 8,144,122,232,161,106,149, 38,126, - 30,207,188, 69,207,174,214,179, 83, 61,255,128,156, 65,115, 46,155, 66,143,109, 26,132,192, 23, 24,212,213, 1, 30, 89, 20,228, -197, 14,189,244,140,239, 54,181, 76, 36, 84, 25, 96, 61,128, 99,141, 36,232, 80,241,217, 55,206, 98,242, 24, 48,231,227, 36,128, -156,148, 92, 18,229,193,189,182,222,103,235, 16,104,244,208,228,156,198, 34,248,228,232,168,248,139,229, 17,181,218, 1,221, 33, - 87, 3, 94, 26,219,158,212,143,247,104,148, 16,182, 15, 25,101,129, 0, 25,177, 85, 21,151,161, 4,106,156, 88, 45,111,198,195, - 78, 99,222,102,143,127, 77, 0,226, 65, 20,247,112, 59,205,232, 47, 30, 23,171,167,182,142,150, 97, 97, 55,122,217,219,113,223, - 14, 28,114,164,241,243,130, 59, 48, 42,175, 72, 51, 33, 71,210,149,196, 79,142,255,168,220,147,251, 77,120,127, 43,196,117,233, -123, 33,199, 66, 84, 74, 44, 74, 89,234,112, 35,101,165,125, 87,200,149, 22, 11,136, 99,118,119, 90, 31, 59,183, 61,152,175, 22, -198,227, 29, 43,111,139,159,116,228,105, 68, 21,169, 23,138, 77,225, 21,199,248,193,196, 21, 26,187,190, 9,101,186,212, 75,232, - 45,131,243,102, 89,218, 99, 37,202, 74,116, 93,101,109, 36,165, 75,194,118,155, 98,176, 85, 78, 39,136,203, 0, 28, 10,217, 5, -154, 86, 14,249,154,250, 60, 30,236, 60,184, 19,242, 98,152, 53,247,152,208, 17,131, 79, 11,137,182,129, 1,161, 73,252,100, 25, -211, 19,247,198,209, 88,205, 39,238,197,180, 34, 85, 50,196,247, 83,241, 78,251,164, 87, 51,160,225, 60,200,100,170,131,147, 47, -210,184, 66,154,177,114, 28, 8,196,250,124,114, 77,117,130,216,254, 19,177, 4, 11,127, 57,133, 87, 80,230, 5, 52,112,128,156, - 99,193,204, 64,194,179, 14, 59,177, 31,141,115,173, 25,142,159, 31,235,182, 54, 53,184,186, 23, 27, 56,232,137,148, 84,132, 87, -165, 85,209,135,155, 22,206, 98,205,246,225,114,243,188,123, 31,135, 26, 25,163,152, 20, 98,209,222, 44,209, 76,241, 52,252,182, -125,133,234,216,116, 36,101,197, 46, 82,134,164,152,159,133, 14,239, 19,200, 48,152,241,233,139,185, 51,180,101,159, 20,239,194, -255,114, 81,156,116, 20,207,215,205, 51,186,165, 56, 97,223, 35,184,211,121, 4,134,203, 99,227,178, 28, 37, 76, 35, 60,123,246, -246,149,186,234,108,139,206,145,238,100,124,149,163,249,178, 90, 31,250, 38,231,182,253, 77, 19,243, 45, 0,103, 87,178,211, 48, - 12, 68,189, 80,210,210, 66,165, 8,245, 31,248,255,255,224, 3,144,184,114, 97, 19, 5,154,132,120,108, 60,155,235, 54, 69, 8, -110,189, 53, 78,236, 25,207,204, 91,206,234, 85,241, 91,131,106, 72, 12, 71,131,132,170,205,111,247,194,105,114,228,162,248,220, - 88,167,100,236,124,173,151,162,154,139,107,199,154, 31, 20, 81,233,170, 22,133,164, 68, 91, 1,215,140,224, 0, 52,223,246, 0, - 50, 13,227,209, 10, 85,194,156,231, 69,252,181,136, 95,179, 52,164,207,119,238, 61,107,152, 14,170, 73,166,242, 80,165, 22,141, -165,139,188, 33, 58,129,160, 37,115, 34,161, 51,104, 73,223, 3,167,183,108,230,144,162, 4, 40,178,211,213, 22,191, 95, 92,183, -225,109,139,253, 87,119,110,177,253, 8,196,172,204, 73, 3,192, 62,247,195, 77,187,238,195,242,126,220, 81, 89,137, 60,166, 94, - 49,130, 77,165,211,228,170, 64, 57, 83,101, 62,175, 49,108,166,183,224,255,181,104, 10, 90,145, 7,158, 13,245,100,150,206,109, - 26, 27,156,107,145, 91,102,182,144,235,106, 19,144,146,146,134,100,219, 57,194,230,208, 35,162,153,173, 22,126,125, 1,120, 99, - 75, 99,142,199, 86,229,139,253,164,188, 61,250,199,178, 29,125,245,131,245, 9, 64, 7,176, 51,250, 48, 99,180,195,200, 45, 87, - 67, 38, 68,230, 99, 59,172,175, 98,215,249,203,197,102,247,245, 14,199, 74,250,238, 20,237, 69,166, 68,130, 50,206,223, 51,152, -244,155,103,153,180, 4,232, 8,242,224, 44,105,141,102,120,211, 6,195,218, 48, 82,127,178,154,140,122,223,104,191,196,136,211, - 92,241,171,152, 4, 25, 43, 38,108, 54, 85,130, 57, 74, 46,146, 61,153,184, 13,138, 27,113,218,101,213,181, 72,226, 82,174, 39, -235,113, 56, 6, 2, 36,205, 44, 7,150,211, 7,200, 16,145, 51,227, 52, 71,154,180, 17, 73, 42, 22, 3,250,128,248,183, 24,122, - 66, 31, 51, 21, 42,245,159,241, 1,175, 39, 54, 71,249, 57, 10, 69, 33,125,214,201,235, 14,163,129, 23, 19,159,114,136,127,188, -125,189,131,177, 67,173, 16, 44,172, 25,113, 15,236,147, 42, 15, 20,147, 19,114,140, 43,154,145, 21,151, 80, 86,165,210,246, 21, -199, 41,150, 2,177,166,239,199,164, 46, 22,211,217,230,159, 78,135, 63, 13, 51, 23,250,220, 20, 58,147, 78,247,238,236,190,120, -170, 18, 64, 65,166,215,207, 89, 96, 32, 61,236, 42, 8,205,143, 79,222,161, 0, 74,142,242,171, 49,228,114, 58,252,155,240,248, - 45, 0,101,215,182,147, 48, 16, 68,119,182, 69,138, 4,163, 6,131, 47,242, 9,254,255,191,248,194,139, 26, 37, 26,229,106,235, - 94,236,220,150, 45,162, 34, 73, 19,194, 3, 45,203,118, 58,115,102,206, 57, 29,254, 42,152,253,142,252,161,167, 27, 72, 63,167, -203, 16, 83,104, 45, 48, 7, 80,209,107,118,170,229,158, 14,178, 46,168,205, 73, 67, 6, 44,185,206, 34, 74, 1,209,118,146, 59, - 69, 77,111, 71,174, 59,132,216,105, 26, 69, 61, 14, 38,187,217,192,159,202, 65, 4, 13,241,171,223, 43,189, 68, 58, 38,170, 22, -159,186,118, 88,177,107, 2, 2,130, 76, 41,110, 89, 40, 19,214,158,127, 80, 86,219,102, 27,196,228,129,122, 88,193, 39, 50, 10, - 26, 8, 14,175,123,203, 39,234,185,226,209,238,175,145,165,164,198,192,135,243,119,139,245,237,120,100,231,230,217, 53,168,140, -106,194, 50,211, 68,220,208,155, 74, 35, 38,227, 24, 28,238,171,172, 4, 75, 51, 39,246,255, 21, 89,218,103,125,106,153,242,120, -226,168,236,157,151,208, 39, 44,213,123,255,222,192,107, 27,218,105,161,122,133,233, 91,216, 52, 5,205,161, 23, 23, 67, 92,159, -209,176,127, 67,182,186, 69,216,218, 58,222,107,181,225, 85,234,210,127,203,121, 82, 99,211,239,132,159,228,121,224,148, 9,201, -224,126,237,218,103, 94,172,192, 87,193, 44, 29, 70, 80, 98, 18,152,222,192, 77, 46,235,135,249, 27,138,147, 82,178, 24,147,185, - 5,116,116,101,114,160, 51,118, 25, 44, 60, 32,169, 82,233,251,235, 71,120, 27,143,102,235,238,236,214, 79, 2,181, 71,121,114, -160, 10, 6,192,116, 60,157,189,204, 64, 0,201,148, 72,170,132, 72, 72,100,123,200,207,163,154, 24,137,120,165,211,145, 28,206, -147,144, 53, 21, 28, 54,118, 46,129,178, 6, 10,199, 44, 6,137,116,108, 28,194, 50, 2,252, 0, 13,210,196, 68,249,244, 73,182, -107, 55, 78,194, 77, 98,233,168,101,248, 47, 50, 2,209,170,182, 60, 89,185,245, 39,249,142,212, 36, 30,204, 63,197,111, 87,241, - 17, 55,168, 95,153, 80,161,119, 79,251,183,177, 14, 32,113, 96, 77,177, 49, 97,110,160, 89, 89, 28,124,104,111, 14,204, 95,137, - 6,192,237,102, 47,102,231, 42,223, 38,177, 36,166, 22, 89,200,220, 66, 66,220, 57,217,196, 92,151,121,103,119, 45, 11,236, 19, - 50,147,153,163,154, 35,130, 59,252, 49,144,162,175,171,179,201,124,241,148,161,222,240,251, 40,142, 94, 97,220, 87,140,212,224, -238,178,175,144,123,188, 56,173,253,230,167, 90, 33, 31,143,225, 93,141,162,249,241,176,207,207,145,145,225, 75, 0,202,174,100, - 55, 97, 24,136,218, 38, 64,145,104, 65,133, 3, 82,213, 75,213, 99,255,255, 99,122,224,210, 30,168, 18, 9,164, 36, 52, 78,188, - 52, 51, 99, 59,118, 9, 93, 56, 67, 20, 32, 30,143,223,188, 37,240,103, 40,143,148, 71,141,249, 15,184,127,156,128, 48, 28,100, - 3,233,132, 15, 1,135, 54, 36,157,249, 97, 4,244,194, 96,147, 72,214,222,228,210, 72,103, 46,139, 13,149, 6, 42,189, 75,181, - 87,156,199, 41,132,100,246,228, 83, 72, 92,201, 54,158,232,115,137,166,121,124, 51,108, 0,104,253, 56,129,100, 40, 64,149, 0, -135,207,156,188, 10,230,173, 40, 78, 4, 23,119,132,254, 9,111, 36,204, 83, 60,239,158,246, 31,175,148,107, 60,155,173,186, 73, - 1,155,129, 1,144,183,195,227, 38, 39,179, 17, 33, 78, 77,187, 47, 63, 95,118,235,195,177,206,207, 77,101,245,138,153,150, 25, -233,108, 67,220,157, 18, 62,211, 70,118,146, 34, 66,180, 67,207,222,253,147,129,206, 34, 73, 6,209,120,238, 0, 9, 20,155,153, -200, 50,216, 34,219,206,212, 74,183, 56, 34,171, 72,151,136,153,135,247, 82,109,167,236, 44,245, 82,216, 82,131,173,203,118,189, - 0,249, 81,103,143,178,153,226,111, 44, 35,133,250,181,177,149, 25, 97,143,185, 47,136,154, 56, 54,199, 39,231, 6, 15,122,125, -253, 94, 96,207, 87, 54,128,194,207, 57, 91,221,170, 34,107, 27,149, 81,210,180,178,108,179,220,156,170, 19, 77, 23,163, 34, 21, -246,115,107,198, 78,215,225,153, 4,221,166,137,215, 52, 9, 57, 92,148, 15,247,183,105,198,214,153,211, 64, 89,147, 87,185, 67, - 60, 6, 74, 70,194,109,196,178, 37,162,245,192,157,236,194, 65, 73, 19,175,160,230, 72,228,199,243,170,240,147, 33,150,144,105, -188, 85,149,197,104, 12,144,118,244, 23,127,220, 62,188, 21,239,152, 70,208, 47, 29,225,127,109,107, 19,140,200, 49,223, 67,175, - 46,124, 18,165, 95,173,168,226,193,204, 32, 4,189,117, 3, 31,233,251,119,210,100, 25, 66,157,140,172,117, 14,161, 98, 56, 16, - 7, 66, 27,140, 57, 50,167,194, 4, 7,168,146,241,162,148,245, 65,183, 74,107,105,192, 16, 89,163,253,190, 66, 22, 17, 35,171, -122, 30,249, 52, 71,206,230, 1,210,143, 8, 57, 60,197,152, 71,138,187,203,207,160,196,209,168,222,253,146,224,196,147,209,230, -112, 61,195, 4,191,224, 85,246,197, 61,197,100,236, 24,155, 62,252, 75,196, 30, 28,108,100,190,209,102, 46,239, 12,226,219,146, -226, 30,191,127, 56,111,242, 4,170,183,246,250, 6,245,151,215,151, 0,148, 93, 77, 79,195, 48, 12,181,147,142,109, 32, 62, 37, - 38, 33, 78, 92,198,145, 35,255,159,191,129,196, 17,161,137, 9,237,131,118, 75,210,154, 36,118,210,140, 49, 4,189, 79,237,154, -218,137,159,253,222, 99,254, 42, 19,154, 17,123,117, 62, 60,252,202, 14,221,177, 60, 4,225,119,101, 32, 94,178,116, 10,235,164, -231,218,253,180,129,177,183, 89,203,128, 15, 43,136, 37,198,202, 46,144,154,112,202, 60, 78,156,149,178,129, 71, 13, 72,164, 5, -132, 26,136, 42,202,225,196, 6, 86,164,170,106, 97,168, 42,177,135, 66, 41, 36,243,234,168, 36, 68,230, 67,192, 26,227,139, 90, - 29, 21, 36, 93, 91, 15, 32,184, 96, 71,229, 72,108,136,101, 49, 99,244, 2,205,141, 59,169,212,253,245, 89, 24,248,115, 97, 24, -212,223, 96, 20,234, 3, 25, 60,135, 2,132,201,122, 36,153,249,137, 69, 91, 53, 15, 81,225, 1,111,129,253,107,144,222,249, 37, -192, 4,212,213,160, 58, 27,235,145,166,181,131,218,118,111,166,125, 33,120,143,237,129,161, 52, 3, 84, 3,180, 0,152,181,176, -178, 84,217,208,195,190, 61,173, 38, 23,199, 90,235,247,133,125,251,220,186,162,183,211,254,115,155,129, 68,167, 26, 37, 92,158, - 39, 47,143, 66,229, 68, 71,138,137,196, 9,155,246, 53,196, 88,125,172, 42,118, 85,233, 98, 95,196, 6,238, 31,246,192, 38,100, -195,140,172,250,223,215,195, 28, 40,148, 5,225, 74,156, 6, 69,148, 32, 53,108,251,189, 1,233, 27, 70,143, 25, 47,241,143, 96, -172, 67,164, 50, 93, 21, 65, 34,240,159,226,224, 73, 14, 50,226,226, 43,242, 24,197,113, 4,164, 3, 20,233,169, 26, 11,179,236, -164,249,158,124,129,123,181,248,240,104, 91,103,167,183,211,249,114, 30,244,243,178,207,148, 80,171,178,245,199, 78,206,202, 57, -213,255,205,243,227,139, 46,232, 2, 56, 16,170, 56,135, 22, 13, 66, 35, 70, 45, 55,171, 64, 82,242,223,184,173,135, 55, 15,246, -238, 17,214, 13,109,116,176, 21,218, 4, 44,222,159,229,125,237,169,106, 48, 75,112,139,186,155,189,182,207, 79,214, 54, 93, 83, - 59,215,128,241,191, 54, 44, 27,201, 35,240,152, 52, 31, 10,148, 60, 97,185, 72, 59,174,135, 88,156,193,177, 24,163,254,249,212, - 92,146, 88,255, 64,251,148,182,171, 18,185,111,204,107,129,189,164,197, 94,234,248, 3,143, 79,170, 37,218, 77,238,165,232,193, - 33,115, 18, 93,168,134,133,104,213,213,184, 26,219,206,112,166, 26,234, 81, 75,142,126, 47, 52,254,115,125, 9, 64,217,153,236, - 52, 12, 3, 97,216,158,164, 75, 90, 16,251, 34, 33, 16, 39, 36,182, 3, 18,226,253,159,128,135, 64,244, 64,217, 10,148,144,197, -206, 96,143,215, 4,138, 74, 15, 61, 68, 85, 85, 53,246,239,120,252,207,247, 91,125,247, 22,225,134, 45, 90, 49,186,210,207, 23, - 31, 74,252,166,242,145,149,142,199, 53,252,184,188,229, 1,120,100, 52, 51,115,177, 49,130, 15,254,244,168, 53, 30,204,157,130, -214,124,128,224, 7, 51,166,120, 63,139,192,101,119,160, 41,190, 43,129, 79, 77, 14, 61, 79,110, 78,174, 39,207, 19,160,208,134, -198,150,248,173,107, 84, 93,172, 69,101,168,100,200,169,109, 23, 37,200,188,166,237,101,138, 68, 98, 38,112, 24,161,254, 64,189, -207,190,234, 82,202,211,157,181,195,141,113,150, 38,234,150,169, 73,217, 67,194,170,145,214,147,211,156, 39,238,184,181, 31,193, - 61, 58, 29, 37,240,159,135,119,112,167,154, 35,198,182,148,196, 39, 73,111, 0,195, 20,222,106, 53, 7,229,189,144, 15,132, 85, - 56,207, 6,151,155,131,227,245,236,104,181,127,182, 49,188, 88,205,174,198,217,150,132,169,168, 39, 66, 61,187,201, 17,192,241, -254,104,115, 37,251,154, 21, 79,111,213,148, 54, 31, 16,145,249,150,119, 41,248, 97, 42,162, 50,142,182,219,115,109,221,209,101, - 49,221, 58,161, 83,190,164, 14,234, 98,107,227,244,241, 61,181, 57, 27, 12,116,125,216, 25,120,177, 21,153,233,156,187,104,129, -233, 58,159,183,173, 29,248, 83,223,165,113,232,132,176, 77,196,214,252,100,109,250, 32,178,120,204, 53,172, 11,174,178, 91, 73, - 8,226, 17,100, 34,112, 46,130,184, 27,208,151,158,113,196,197,166,132, 61,238,152, 24, 33, 53, 50,198,220,234,139,149,172,212, - 31,240,242,249,194, 44, 40,213,246,128,217,190, 89,134, 46, 48,202, 60, 31, 53,166,244,196,125, 1, 1,213, 78,191, 16,212,158, - 66, 30, 27, 91,249, 39, 27, 61,238,245,183, 63,170, 60,151, 69, 41,107, 41,138,108,247,178, 60, 56,229,249, 92, 51,159,212,127, -175, 22,255, 82, 31,178,243,156,179, 28,139,247,215,102, 62,227,211, 59,121,119, 43,170,188,169,231, 88, 22, 58,140, 89, 19, 86, - 4,242, 40,248, 54,238, 60, 10,112, 72, 83,109, 15, 3, 22,221, 30,159,117, 8,238,173,135,119, 95, 21, 96,177,231,253,111, 42, - 1,183,196, 65,240,172, 17,174, 25, 42,137, 91,159,187, 18,191,156,178, 7,124, 2, 46,104, 46, 93, 40,136,109, 27,149,127, 9, - 10,180, 48, 31, 22, 40,226,160,143, 97,111, 68,139,120, 19,127,237,120,176,162,198,195,146,191,251, 91, 0,202,206,103,181,109, - 32, 8,227,187,179,146, 45, 69,142,131, 75, 3, 14, 61, 22, 31,122,239, 11, 20,250,254,135, 66, 31,160,180, 77, 28,136, 77,155, -198,146,119,165,157,169,246,175, 86, 82, 19, 82,227,131, 49, 24, 86, 94,239, 88, 51,243,205,239, 19,214, 26,219,185, 56, 14,183, -138,255, 92,112, 8,253,192, 95, 60,203,124,222,128, 78,154,207, 16, 44,117, 25, 79,232,248,144,142, 30,187,210,104,212,135,225, -168,209,203, 35, 19, 18, 18,119, 14,107,219,225, 78, 26,196, 6,124,156,114, 2, 7,121,119,138, 44,239,218,196,172, 16,158, 9, -127, 56, 73,223, 30,238, 76,163, 86, 8,141, 8, 65, 17,233,106,247,233,222, 44,179, 92,235,254,239,161,203,241, 17, 45,111, 64, - 18, 74, 91, 77,106, 25,151,150,235,148, 25,125, 1,237,165,250,126, 60,181, 29,110, 87,229,187,171,213,118, 85, 92, 45, 22, 21, -100, 43,130,140,160, 48,133,124,158, 71,219, 85,123, 87,219, 37, 94, 31, 81,113,168,103,228,188,231,110,147, 89,146, 7,188, 53, -241, 93,108,138,188, 90,230, 79, 45,237, 27,245,128,120,199,216,199, 98,249,233,253, 70, 84, 92,103,253,106,177,214, 84, 91, 77, -146,200, 97,119,189,254,252,102,243,229,240,251, 39,177,203,142,118,219,245,205,166,220,223,159,190, 29,207,143, 54, 95,199,153, - 68,242,127, 14,134,215, 2,137,144,193, 24,109,143, 53, 51, 93, 8,232,159,203,220,120, 57,246, 25, 79,145,139,227, 73,152, 82, -153,143, 4, 78, 26, 50, 46,192,167,254,215, 46,156, 88,164, 73,192,159,242,164,190,146,198,119,154, 12, 73, 57,207, 85,228,124, -106,139, 54,187, 76,156,166,236, 78,221, 62, 8,138,210,112,207,189, 85,187,215, 62,198,224,206,201,199,114,128, 32,235, 98,177, -253, 31,108,153,134,154, 39, 70, 80,141,117, 76,240,126,100,253,245, 20,139, 82,219, 64,144,152,255,185, 23,122, 92, 67, 48,111, - 95,150,235,218, 80,145, 45, 68,158,249,193, 80,230,201,149,188, 65,117,145,149,253,119,166, 58,101,176, 89, 40,171,235, 15,237, -205,142, 53, 79,172,213,164,206,198,122,168,105, 80,158, 65, 74, 89,255,234,234, 3,171,255,232,135, 31,250,254, 43,170,254,211, -103, 84, 70,255, 78, 90, 89, 88,102, 23, 23,197,130, 17, 46,122, 48, 3, 13, 45, 85, 22,183,148, 66,178, 20,230,191, 96, 4,179, -165, 49,151,244,133,226,140,158, 38,184,224,237, 2, 2,117,138, 59,156, 32, 4,184, 69,152,121, 79,149,238,248,124,221, 61,128, -113,112,172,173,156,208,140,135,159, 87, 37, 46, 90,106,231, 71,117,114,122, 40,100,155, 52, 99,200,152, 77, 23,102,130,127,146, -175,100,144,117,142,143,253,138,199, 95, 1, 56,187,154,221,182, 97, 24, 44, 74,142, 98,180,193,134, 2,197, 78,219, 83, 12, 24, -176,199,232,179,246, 65, 58, 96,247,222, 10, 12, 40,154, 37, 93,147,198,150, 69,150,164, 36, 71,118,186,162,104,144,131, 79,134, -109, 17, 20, 73,125, 63, 77,253,120, 53,105,208,190,170,143,172,170, 52,152,103,141,167,137,158, 74,243, 90,142,169,178,103, 70, - 34,231,165,101, 44,170,249,170,115, 39,202,169,162,216, 97, 84, 97, 18, 21,168,146, 5,133,139,220,154, 73,220, 64, 55,222, 24, -147, 20,248, 64,133, 72, 69, 88, 76,148, 39, 88,139,124,252,149,132,187,203,133,205,217, 64,237,111,116, 70, 40,176,226, 6,146, - 14,141,203,228, 11, 13, 3,103,155,117,183,246,226, 32,184,146,154, 71, 60,112, 82,198, 64, 4, 15, 50, 75,144,119, 88,170,162, -205, 94, 66, 91,152,242, 54, 9,105,105,186,255, 71,241,215,102,123,179,217,122, 99, 47,151,203,139, 70, 48,232,173,151, 45,245, -121, 64,136,161, 83,200, 16, 77,225,234,105, 98,163, 36,112, 19,166,192, 88, 91, 54, 0,156, 6,125,157,250, 99, 65,173,180,156, - 55, 23,174, 35, 90,119,113, 75,200,149,251,119,239,175,126,126,251,253,240, 55, 6, 35, 78,153, 34, 93, 41,239,207, 27,218,227, -129,219,235,253,234,211,234,135, 63,191,238,119,161,195,214,185,231,206,254,121, 12,187, 10,234,245, 97,227,145,166,122,181,182, -180,220,252,247,234, 33,192,171,114, 8,226, 61,252,217,155, 51,207, 23, 92,199, 52, 89, 17,169, 50,188,166,209,240, 13,138,109, - 83,233,234, 72,193, 88, 73,154, 72, 71,236,169,230,201,162,128,211,167,207, 44, 36, 78,238,103,237,121, 24,130,120,215,208, 76, -172, 10,102, 85,216, 52,186,170,111, 63, 66,100,202, 22, 2,199,206,225,104, 9,116,180,123,172,134, 0, 71, 58, 60,166,179,100, - 61,216,133,140, 24,182, 74,229,133, 26, 35,237,242,176, 70,225,144,137, 55, 59, 73,238,177, 70,219,143,188, 51,183,160, 36, 28, - 79, 5,168, 32,245,156, 37,212,211,110,176,183,187,187,175,254,203,210,249,206,245, 3, 56,174,202,105,179, 70,236,193, 31,184, - 20, 49, 11,111, 29, 7, 46, 4, 75,189, 0, 41,159,144,195,118,123,207,105,125,224,174, 34, 4, 33, 30,114,224,199,212, 72, 24, - 26,185, 74,134, 98, 85,143,205,102, 1, 66, 74,204, 31,218,166, 83,185, 52, 1,131, 2,235,196,255,160, 6,224,181, 82,135, 42, -218, 11,204,161, 50,185,125,194,136,126,209, 14, 40,157, 16, 20,169,253,113, 65, 11, 58, 96,228, 43,157,150, 83, 8,115, 56, 13, -213,179,157,250,145,249,142, 79,113, 47, 5,141,181, 3,162,125,107,219,120,171, 23,233, 67,127, 90, 71, 31, 4,155,247,222,223, -139, 0,180, 93, 75, 78, 2, 65, 16,237,238,249, 0, 26, 48,134, 27,152,152,184,240, 12,238,117,229, 33,188,165,137,137, 43,143, -224,194, 11,160,160, 32,195,175,153,233,110,187,170,250, 55, 12,113, 99, 92,178, 1, 38,208, 85,175, 94,191,122, 47,111,239, 31, -198, 22,162,143,205,254, 38, 94,159, 50, 50,166,233,182, 0,225,234,190,241,183,181, 78, 42,233,126,111, 82, 79, 58, 47, 0,207, -152,210, 16,162,120, 82,229, 41, 20,155,211,134, 20, 10, 10, 88,230, 15,132,161, 38,224,136, 84, 18, 69, 56,132, 7,127,100,161, -125, 45,128,247,202,130,152, 33,113, 95, 18,148, 78,137, 11,199,232, 45, 36, 50,231, 29, 8, 90,104,228,124,245,203,251,235,188, -222, 94,142,216,245,249,197, 90, 14,137, 37,175, 27,137, 22, 11, 57, 36,250,160,231,253,158,105, 59,197, 74,128,237,134,240,248, - 55,234,178, 75, 76,234,176,149, 99, 13, 15,171,166,178,182,128, 89,146, 94,222,107,225,201,149, 37,221,113, 48,201,203,116,135, -136,119,120,131, 84, 19, 30,192, 11, 85,246, 51,184, 86,229, 61,145, 13,138,188,218, 53,187, 6, 28,224,236,199, 61,220, 92, 77, -120,133, 30,104, 64, 84, 8, 28,161,106, 16,189,105,123,128, 55,210,188,205,150,243, 6, 64,199,184, 44,202,188,183, 88, 55,213, - 78,135, 93,255,191,120, 23,107,127,252,104, 76, 25,146,111, 1,249,165,122, 79,187, 28, 90,169, 56, 41, 66,242, 38, 6,184,184, - 42, 38,188,254,143, 37, 6, 50,222, 96,144,123,184,232, 9, 27,199, 95,112,157, 52, 0, 84, 66, 57,135, 16,146,135,243,149, 92, -185, 53,156,196,233, 48, 61,110,162, 35,123,228, 44, 86, 45,222,189,117,243,160, 39,114, 43, 65, 14, 0, 42, 25,113, 24,159, 76, -245,216,249, 23,208,162,159,119, 75,231,174,202,187, 4, 16, 58, 3, 88,216, 55,245,202,181,180,200, 4, 43,191,229,212, 30,255, -141,153, 45, 63, 98,138, 91, 12,181,134,197, 36,163,234, 44,231, 59,214, 76,213, 98, 92,158, 74,251, 71,182, 5, 93, 73, 83,125, - 89,240, 97,202,141,206, 75,244,136,234, 83,140,154,210,123, 86, 35, 27, 83,125, 42, 11,216,247, 53,216,255, 40, 72, 8, 71,221, - 38,169,120, 76,216,195,234,114,229,233,253,120, 26,120,148, 9,174,194,238, 23,106,134, 68,170,225,248, 85,171,232, 39, 29,125, -164,145, 80, 46, 6,126,151,126,127,116,123,119,255,252,244, 56, 95, 76,136,140, 71,224,119,128,190,117,248,221, 33,168,205, 52, - 7,101,153,183,237,136, 76, 11, 57, 68,240, 94,102, 5,131, 4, 71,186,200, 70, 66,178, 24,108,237, 20,197,248,209,199,248,191, - 48,159, 31, 1, 88,187,154,158,132,129, 32,186, 31, 96,193, 0,234,193,196,191,224,111,240, 98, 60,248,255,175,198,187, 38, 96, - 64,160,133, 66,187, 51,238,206,236,108,151,143, 72, 76, 36, 27, 66,202,161,165, 41,179, 51,111,222,188,103,206,157, 3, 79,150, -244,182, 78, 18,198,195,197,209,220,145,197, 82, 55,252,149,164,232,121,103,119, 89,103, 76,228,183, 29,166,166,153,203,186, 70, -193,199, 67,154,103,114, 80, 37,173,123, 4,232,138, 65, 76, 64, 93,244, 1,161, 22,126, 76, 0, 49,218,207,179, 21, 3,191, 3, - 70,185,110,226,153, 5, 83, 6, 94, 64, 87,179,105, 54,139,160, 74,168,222, 87,170, 63,152,186,128, 68, 50,233,147,246, 48,180, -156,111,248, 45,174, 71, 76,155, 1,113,250, 84, 55,212,131, 59,138,236, 58,196, 50,125, 67, 62, 57, 78, 10, 76, 36,245,224, 49, - 25, 54,177, 2, 87, 34, 68,178,105,253,254, 87, 56,207,100,121, 10,156,128,197, 38, 14,172,218,241, 85, 32,247,239, 29, 33,168, - 74, 61, 13,175,239,238,251, 31,139,106,179, 3,206, 19,235, 6,119,196,155,240,165,181, 79,198,160,117,179,245,246,205, 23,236, - 74, 61, 62, 76, 70,195, 98,185,170,155,186,105,255,227, 17,196, 44, 93,189,202,166,189, 90,178,234,245,183,205,177,116, 39, 6, - 21, 19,112, 86,119,141, 26, 45,234,219,192,158, 75, 52,209, 28, 9, 31,254,115, 75,194,233, 16,231,223, 84,148, 93,231,135, 72, - 96,191,136, 80, 67,130,116, 82,170,206,234,187,242,188, 5,231, 69, 76, 11, 29,101,165, 73,102,242,104, 22, 41,195,100,165, 59, -103,108,174,180, 44,136,186,128, 75,166,163,179,131, 76,148, 82,113, 42, 58,137,173,235,120,159,236,223, 23,181,235, 19,253, 49, -236, 74, 78,247,109, 49, 25,222,242, 81,217,245,180,142,123, 20,230, 94,122, 65,146,213,240,223, 15,200,205,132,188, 3, 3,227, - 55,148,111,141, 2, 82, 54,110,190,221,246,179, 45,173,233,107,219, 3, 87, 67, 57, 87,213,194, 84, 43, 91, 46, 77,185,106,171, - 89,189,157, 54,213, 28,203, 57,172,191,252,183,184,157, 7,183, 85, 22,235,246,217, 17,147, 35,147,182, 88,188, 3,128,135,158, - 26, 38,246,198,180,104, 37, 24, 1,164,105, 6, 0,141, 78,206,121,250, 36, 60,101, 73,231, 81,194, 75,191,253, 50,112,104,173, -125,126,121, 29,141,199,199, 58,117, 93,230,158,115, 55, 12,205, 48,234,163, 56,120, 54,184, 99, 7, 35,203,185, 76,193,219,126, - 27,167,116,212,176, 24, 37,130,141,175,135, 80, 93,134,254,207,132,224,191,191,126, 4,160,237, 90,114, 26,134,129,104,198,113, -170,148,150,130,144, 88,177, 64,226, 18, 44, 56, 19, 7, 64,226,176,192, 54,162, 63,154,230,227,218,131, 61, 99, 59, 78,105, 37, - 36, 68,151, 85, 85,165,141, 51,126, 51,126, 31,121,114, 27,129,211,155, 38,252,166, 73, 23,225,103, 80, 62, 65,148, 54, 64,202, -175,207, 60, 74,129, 16,192,228,227, 40,227, 76, 11,194, 77,119,243, 39,160,248,225,232, 6, 65, 45, 48,137,250, 2,193, 32,156, -146,129,111,239,194,165, 50, 61,135, 20,128,210,179,242, 93, 69, 96,254,179, 91,145,188,103,107,111,219,199,222,130, 12,159,166, -114,250, 52,191,221,214,213, 7,102,179, 12,106,233,242,135,229, 64,137,179,171, 49,183,235, 90,138,172, 81, 38,167, 73, 83, 48, - 5, 67, 62, 35,157, 4,143, 70, 17,254, 52,242,126,129, 89,158, 47, 74,105, 75,106,213,171, 70, 15, 54, 94,234,204,102, 14,199, -171,121, 96,151, 67, 82,208, 35,179,133,237,195, 90, 74, 64,164,146,103,155,103,119,199,238,111, 46,222, 62,183, 93,167,156,114, -140, 69, 92, 20,246, 0, 46,114, 8,237, 71,119, 10,223, 27, 85,101,217,163,144, 15,119,215, 22,122,172,150,173,235,194,147,212, - 14,243,135,250, 14, 73,176,184,167,132,146,192,109, 65,103,142,179, 2, 72,254,239,250, 34,165,115, 49,246, 12, 96,229, 61,115, -225, 77, 8,221, 66, 76, 41, 85, 30,140,113, 16, 92,170,223, 96,155,162,171,242,178,238,234,144,204, 16,153,214,225,187,217,167, -118,116,222, 15, 3, 51,135, 38,244, 62,182,213,143, 13, 13,131,106,244, 19,185,180,232,192, 56, 18, 44,234,111, 41, 63, 7, 7, -129,181, 97, 78, 45, 61, 5,192,109,136, 56,144,166, 84, 32,219, 25,198, 89,166, 27, 71,121,238,135,237, 30, 59,213,245, 22,101, -123, 61, 45, 99, 23, 31,114,165,131, 51,207,104,168, 0, 3, 93, 31, 7,141,151, 5,229,206, 82,128,198, 8,121, 45,117,175,117, -153, 79, 10, 40,116, 87,211, 94,160, 15, 34,235,165, 65, 41, 15, 28, 71,101,145,187, 33,147,247,253,214, 56, 91,224, 30,221,200, -158, 5, 5, 22,151,105,131,105, 50, 81, 58,109,254,145,174, 74, 46, 65,188,197,114,110,142,112, 25,112, 34, 66,120,206, 36,135, -179,132, 64,147,148,163,136,220,237, 85,178, 70, 32,161,197, 4,155,229,118,255,245,250,242,188,217,172, 89, 49, 51, 62,210, 57, -190, 66, 11, 37, 90,173,225,124,251,128,199,111,141,158,218,134, 26,172,244,181,220, 85,113,227,159, 23,243,181, 94, 37,199,232, -248,127, 16,254, 91, 0,210,206,166, 41, 97, 24, 8,195,187,105,164, 69, 20,245,230,232,140,122,242,175,248,255,143, 30,213,131, - 7, 29,133,161, 64, 63,146,172,201,110, 66, 91, 42,142,163,192,133,143, 67, 25,218,101, 63,222,125, 31,253,109, 64, 63, 64,201, -250,213, 49,184, 68,194,253, 85,148,151, 19,182,175,169, 79,230, 81,206,199,245,136,103,176, 82,193, 71, 50, 2,243,226,105, 52, -129, 65,134,204, 35,238,171,196, 36, 28, 90, 94,176, 10,173, 48,246, 15,179, 93,173,138, 28,231,217,158,138,196,173,131,243,122, -192,211,179,155,243,139,219,235,122,243,182,242, 63,118,161,209,118, 73,156,179, 13,111, 41,241,193,171,138,201, 56, 98,177, 43, -208,237, 15, 22, 32, 2, 11, 69, 32, 98,181,105, 14,234,106,150,171,137,122, 47,155,167,182,221, 14,253, 87,241,176,166, 74,165, -143,225,104,232,212, 79,231, 39,233,173,130, 27, 32,167, 58, 43, 50, 61,195,152,174, 44,170,250,241,229,115, 93, 53,219,154,182, - 97, 95, 17,142,132,218,108, 72, 19,110,106,251,218,218, 39,128, 59,128,135,251,203,233,201,148,154,106,181, 90, 47,201,150, 73, -178,249, 79,234,247,174,197,100,248, 8,253, 35, 71, 60, 86,225,225,239,211, 76,149,190,212,112, 56, 15,187,203, 24,154,198, 41, - 27,149,201,160, 4, 68, 38, 80,167,142,179, 4, 71, 55,196, 44, 65,199, 69,138,248, 32, 22, 61,136, 13, 58, 37, 80, 66, 92,154, - 22,216, 66, 76, 10, 36, 44,246, 43,232, 48,183,167,110,155, 42, 57,240,237, 58,237, 72,123,147,170,196,223, 0, 24, 83,220,162, - 49, 43,198,150,145,236, 88,197,149,212,164, 1, 8, 72, 14,127, 26, 26,197, 81, 30,146,250, 37,218,103, 72, 41,194, 35,218,221, - 52,170,131,151,237,130,187,165, 52, 7, 32, 1, 19, 59,193, 91,227,224,143,143,159,152, 80,137, 6,223,165, 76,129,105,117, 97, -230,147, 90,149, 80, 62,131,210,254, 53,151,229, 96, 56, 7, 16,253,165,109,157,217,250,176, 14,213,194,180, 85,240, 56, 48,161, -238,139, 22,154,221, 2,174,219,155, 69,143, 45, 27,211,213,167,242, 34,223, 84, 27,105,185, 7,203, 89,180,244,221,181,224,160, -231,114, 60,212,161,227, 96,209, 63, 53,106,133,199,200, 98,124, 25,169,250,111,185, 46,151, 90,199, 2,170,183,123, 47, 42,185, -177, 56,138,126,104,151,255,160, 95,196,225, 96, 64, 13, 58,175,188,212, 98, 27, 29,253, 80, 35,158, 48, 37, 79, 68,135, 19,187, - 63,100, 84,254,246, 37, 0,105,231,214,147, 48, 16, 68,225,157,109, 45,197,219,147, 81,140,250,143,252,249, 62,251, 98, 8, 49, -209, 24, 81,161,116,219, 93, 59,183,221,173,162, 96,124, 36,133, 0, 73, 51,221,153, 57,231, 59, 57, 31, 56,216,237, 1, 81,187, -123,137,241,123,194, 31,170,188, 18,237,184, 63,146, 77,135,225, 60, 59, 67,117, 61,200, 70,211, 66, 72,188,226,148,140, 24, 25, -111, 88,164, 9,106, 48,170,235,202,111, 22, 95, 40, 57,187,129, 99,138,217, 98, 71, 90, 73,126, 1, 99, 26, 95,135,147,104, 84, - 60,116,232, 20,233, 16,124, 19, 40,111, 94,158,183, 37,243, 79,142, 75, 3,173,101,133,201,134, 46,149,202,104,108,117,214, 60, -252, 54,103,224,234,168,174, 38,246,254,117,245, 64, 88,224, 94, 33, 98,253, 30, 14, 38, 24,183,105,249, 98,190,211, 41,252, 84, - 61, 83, 75, 18,191, 91,223,159, 86,211,139,250, 96,222,192,220,132,187,231,183,235,110, 61, 28,111,214, 67, 53,199, 94, 36,180, - 40, 63,196, 7,233,178, 53, 11,122, 32,157, 27,115,123,115, 57,155,157, 12,101,115,241,248,254,250,210,172,200,115,235,254, 93, -220, 77,150,235, 36,173, 6,198,240,218,154, 52, 51,135,214, 56, 15,165,133,179, 73,217, 58, 10, 84,228, 60, 55, 47,157, 60, 19, - 9,149,140, 78,227,245,144, 4, 49, 92,167,163, 87,137, 89, 49, 73,244, 98,162,213,200,235,221,152, 14,239, 94,145,143,194,111, -207, 4, 18,228, 93,142, 44, 85, 73,218, 6,157,123,131, 74, 62,252, 54, 51,123, 48,169,210, 71,139,131,100,109, 11, 33, 71, 54, -124,236,124,194,243,185, 21,192, 36, 7, 47, 33, 24,136,170, 60,200,163,136,195,194,169, 63, 20, 85,142,132, 70,198,200, 2,136, - 3, 76,208, 97,187,103, 90, 49, 72,134, 96, 18,146,163, 74,193,210,215,210,130,223,225,191,194, 5, 88,213,187, 15,223, 60, 97, -112, 95, 81,247,136,104, 26,238, 17,160, 49, 18,133,203, 14,125, 3,230,211,173,240,132, 19, 40,147, 8, 5, 30,212, 21,139, 65, -213, 87,182,114,157,139, 30,246,252,222, 1, 58,170,216,116, 33,108,218,141,205,214, 29, 63,202,179,199,118,160,108,240,237,225, -171,204,143,143,240,178,174,165,251,162, 47,120,252,195,154,109, 47, 40,171, 12,247,246, 13, 42,186,131,140, 93,196,233, 19,108, - 89,246,134, 92, 20,142,123,113,192,192,172, 70,231,239,141, 91,199,179, 89,161,168, 3, 97,173,103, 80,123,179, 71,225,253,101, -221,197, 31,252, 20,128,180,179,201,105, 24, 6,162,240,216, 77, 83, 40, 85,133,216,128,196,158, 67,112, 7,110,205, 21,216,118, - 7,170,186,169,248, 41, 16, 39,246,224,249,115,146,182, 82, 43, 33,117, 87, 41,149,210,228,121,230,205,243,231,106,172, 32,216, -187, 98,103,168, 60,158, 80,121,151,206,116,108, 84,229,157, 43,187,207,237, 28, 96,157,166, 91, 35,220,255, 84,226,155,172,184, - 71, 69,249, 37,216, 75, 59,243, 55, 29, 47,228,244, 82,249, 88, 88,122, 34, 22, 60,189,139, 46, 85, 26,160,242,242, 56,216,185, -246, 54, 79,163,235,250,137,185,127,118,250, 59,153,104,191, 58,209,133,138,137, 18,215,224,126,248, 12,213,153, 33, 7, 2,125, -232, 62,220,215,245,205,213,244,121,243,241, 54,184,109,237, 25,157,145, 31, 27,145,105, 16, 21,152, 14,241,175,134,175,233, 44, -131,184,107,225, 46,255,238,226,114,251, 25,214,241,123, 5,176,125,239,114, 63,177,228,247,169, 97,139, 97,199,173, 70,195,215, -124,116,245,211,195,109,189,188,184,170,225,183,105, 86,175,187,117, 67, 16,227,214, 90,132,255, 72,188,183,224,166,236,240,154, -131,191,240,176,156,230,178,189,202,234,249,149, 5,169,131,121,237, 23,115,255,178,113, 6,237, 19,191,141, 97,117, 32,167, 86, -160, 56,108,138, 64,212, 20, 13,255,133,195,170,201, 33, 30, 9,224, 75,102, 70, 23,117,173,226, 5,134, 5,234,189,187, 49,134, - 16, 75,149, 80,178, 94,252,224,165, 74,206,184, 86,169, 47, 17, 63,181, 27,176,140, 94,123,229,239,250,188, 55,225,204,148,254, -107,116, 92,139, 11,187,126, 15,143,184, 54,162,242,140,228,152,240,149, 69,226,185,211, 76,208, 83,242,205,153,113,160,120, 47, - 97,218, 50, 71,219,148, 93, 6,206, 38,101,194,221,160,237,189, 81,104,101,158, 66, 82,109,202,173,109, 75,232, 25, 10,241, 86, - 77,126,234, 35, 83, 66,232,126, 19,153,187, 77, 41, 96, 12, 24,118,194, 36,200, 69, 63,155,102, 81,241,106, 60,243,106, 83, 56, - 92,245,156, 69,244,198, 79,133,152, 51,238, 88,140, 99,191, 58, 78, 7,242,133,165, 85, 27, 15,192, 35,136,163,139,104,108,102, -250,115,163, 47, 75, 2, 98,105,101, 68,136, 98,234, 75,111,196,211,165,113, 60, 54,179, 4,167, 59, 54,225, 50, 47,141, 64, 88, -243, 9,209, 79, 28, 25, 91,109,152,236,167,123,112, 70,121,158,220, 73, 7,232,189,154,164,112,139,131,114,254,252, 62,185,242, - 85, 72, 42, 45,127, 2,144,118,237, 58, 13,195, 80,212,118,156,166, 52, 45, 45, 15,129, 84,193, 15,176, 32,177,244,199,249, 6, -118, 6, 70, 88, 0,137,231, 80, 41, 37,117,147,216,216,247, 94, 39, 78, 72,165, 72,180, 91,171, 14,174,227,227,251, 58,231,116, -235, 51, 67, 80,158, 13,141,229, 61, 95, 41,104,198,214, 40,143,204,181, 54,202,211,128, 77, 19,200,123,243, 87, 82,158, 67, 61, - 60, 30,152, 88,178,112,142,130,155, 62, 33, 57,252,149,243, 67, 64, 16, 16,154, 60,230, 73,154,207,190,101,133,130,148,166, 36, -137, 16, 34,204,249,249, 45, 55, 76,233,218,225, 32, 22,108,162,218,142, 25,164,192, 37, 32,159,132,248,119,141, 70,183, 4, 97, - 36,253,104, 79, 92,202,228, 50, 77,238,191,127,222,152,185,100,124, 53,153,223, 92,156,174,115,117,251,252,242,176,255, 79, 13, - 36,222, 8, 31,171, 96,207, 76,251,243,145,239, 88, 26,114, 80, 50, 69, 81,170,109,113,190,152, 92,157, 29,142, 62,205, 93,153, -191, 91,136,103,236, 85,183,246,210, 70,253, 43, 46,174,143,231,203,147, 89, 58,139,182, 54,156,207,244,211,199,230,241,107,179, -134,137,160, 49, 44,237, 63,245, 65, 78,118, 87, 4,238, 83, 38,142,132,152, 39,241, 34,137, 15, 98, 23, 30,218,172,217, 6,129, - 0, 21, 60, 87, 49, 36,175,188,110, 90,113,116, 53, 5,248, 8,192,221, 53, 11, 73,213,145,155,254,202, 40,111, 39, 64, 32,147, -145, 38,211, 76,101,168,135,209, 1,247, 46,255,211,235, 6, 58, 21,116, 3,243, 20, 38, 34,161,111, 97,176,126, 12,135, 81,248, - 58, 18,134, 32,120,121, 32,206,227, 68, 77,200, 79, 1, 78, 52, 76,108,145,151,142,241,158,170,160,236,216, 80,186, 49,231,128, -197,114,233,115, 89,195,125, 97,136,251, 10, 20,247,143, 35,116,156,177, 59, 5, 44,221,160,150,213,120, 16, 54, 28, 66, 22,145, -215,131,251, 26, 56,147, 54, 30, 23, 44, 42,149, 22,153,221, 49,163,119,218,201,222,184,190, 4, 92,174,206,125,161,178,231,192, -194,119,169, 44,202, 59, 66,147,123,186, 49,224,161,219,205,249, 16,247,197,157,184,105,154,234, 33,251,130, 0, 83,181, 61,129, -131, 57,231, 30,110,217,159,224,189,169,210,160,152, 57,233, 9,195, 50,117, 32, 69,215,158,224,116,205,151,195,241, 66, 21,249, -174,218, 14, 87, 43,235,212,242,164, 24, 89,172, 6,175, 18,166, 64,175, 92,114, 9, 12, 77,116,184,195, 75,181, 86,163,128,154, -109, 81, 96, 13,128,211, 90,112, 4,131, 6, 82,106, 21, 22, 61,232,202,105,178,135, 26,220,237,235, 87, 0,210,174,174,167,109, - 24,138,250,171,105, 74, 33,168,108,171, 54,132,196,222,224,157,255,192,191,231, 47,236, 5,169,211, 52, 9,150,174,105,155,196, -246,157,125,237,235, 56,140, 48,164,229,169,170,170, 42, 77,210,235,235,115,206, 61,103,192,103,212, 75,239,249,201, 42,255,126, - 62, 45,127, 57,214,255,249,182, 44,239,229,121,102, 96,105,147,127, 55, 12, 26,171,244, 63,230,177,107,183, 36,107, 23,100, 53, - 6, 83, 62,161,192, 82, 60, 56, 71, 4, 23, 45, 3,193,206,229, 12, 76, 95,235,205,170,100,243, 98,185, 63, 92,120, 13, 91,212, -185,164,171, 17, 74,138,160,216,141,168,100,112,103, 94, 42,249,179, 51,167, 50,122, 52,182,113,123, 5,123,170,101,120, 63,185, - 91,157, 63, 23,242,168,251, 71,211,175, 25,191, 59, 61,191,189,250,176, 92,205, 69, 39,239,229,101,249,248,227,193,232,169,107, - 40,147,123,119,134,207,244, 25,184,166,136,177,228,212, 32,135, 15, 55,204,238, 52, 60, 29,250,147,162, 95,159,151,235,101,113, -179,109,191,213,187, 77,219, 54, 62, 97, 13,206, 24, 95,201,217, 69, 81,124,169, 22,159,170,194, 42, 63,245, 94,239,187,162, 84, -155,103,253,244,220,212, 90, 55, 36,233, 49,236,191,142, 32,126, 63, 65,168,106,193,228,215,170,188,174, 22, 87, 31, 43, 37,196, -247,250,184,237, 52,104,243,203,232,101,201, 90,171,182, 7, 36,222, 57, 75, 3,154,233,246, 89, 54, 20,119,163,195,134, 47,133, -248,188,161,165, 27,170,131,251, 33,191,251, 38,230,100,199,225, 78, 75,226, 19,128,191,240, 48, 30,107,181, 31, 0, 68, 79, 36, - 95, 55,130,216, 3,200,219, 40,102, 62, 68, 76, 30,178,200, 51,150, 97, 20, 99, 30, 15, 45,213,209,248, 34, 22,230,208,125,200, - 49, 89, 71,172,148,240,163,185,194,213, 9,145,204,187,227,163,150,156,208,121, 76,209, 72,152, 76, 76, 53,195,206, 52,240,210, -144,130,134, 80,111, 26, 54, 63, 97,219, 16, 18,169, 36,215,174,201,181,252, 8,157, 0,217,185, 55,208, 34,200, 79,108, 35, 92, -102,113, 29, 12,110,145, 45, 78,148,245,184,107,182,196,100,240, 23,195, 28, 57, 92, 21, 10, 24, 36, 6,132, 27,138, 70,252,167, -140, 36,222,101, 24,131, 51, 48, 81,220,137,130, 49, 48,180,148,156,216,143,209,196,114, 64,126,195,183,238,218, 45, 3,251,234, -217,216, 9,224, 58,159, 40,196, 53, 85,227, 2,143, 99, 73,120,127, 92, 31,237,214, 67,116,161, 72, 35,205,131,175, 23,117,105, -150,152,124,223,207, 40, 62, 51, 30,245,114,207,153, 18,100,197,145,153,114,195,123,146, 50,243,227,143, 0,164, 93,203, 78,195, - 48, 16,204,230,161,182,162, 1,218,130, 16, 23,224, 6, 31,192,255,255, 6, 8,241, 3, 21,130, 22, 72,147, 54,137,189,120,237, - 93,199,105,194,169,183, 86,141, 34,185,137,199,246,236,236, 76,234,223,101, 53,232,134,135, 99,219,204, 83,212,113,157,188, 9, -130,155,107,235, 76,199, 62,213,178,145, 7, 91, 70,227,222, 67,153,196,244, 10,106,204,136,145,100,190, 21,181, 51,212, 19,111, -180, 99, 51, 57, 63, 73, 92,218,171,103,126, 93,142, 27,165,193,237,234,242,117, 71,142,113,179, 34,122, 90,149, 87,115,245, 93, - 44, 41, 93,202,167,108,163,152, 87,240,114,234,182, 40,172,194,155,232,160, 75, 30,162,204, 30,224,107, 89, 41,189,251, 35, 5, -242,197,241, 91,185, 55,159,111, 33, 51, 3,126,255,218,190,124, 98,213,144, 50,125,145,164, 55,170, 93,255,255,168,112,160, 30, -192,128,177, 81,129,130, 42, 13,200,156,134,234, 1,170,168,218, 77, 70, 49,182, 25,164,121, 62,125,190,152, 30, 40,206,214, 28, -179,241, 44,163,252,166, 6,205,106,143, 31,123,131, 31,102, 37, 32,235,126,243, 79,237,126,155,245, 79, 93, 71, 84, 36, 56,156, - 12,238,206,128, 33, 35,124,135,187,217,236,241, 58,191, 95,206,231,233,228, 97,149,147,169,108, 83,108,203,109,101,205, 1, 23, -211,108, 83, 0,109, 26, 19,135,229, 94, 71,235,233, 5, 62, 79,163,115, 32, 13, 12, 78,134,198, 9,113,119,218,239,204, 90,233, - 6,173,200,114, 1, 5,135, 3, 43, 44, 1, 34,231,103,141, 30,229, 65, 10,219,174, 97,202,193, 19,198, 46,152, 72,138,174, 74, - 32,153,121, 27,232,171,209,161,147, 86,162,223,239,200, 22,222, 49, 42, 4,188,113,239, 65,179,126,134, 26,130,168, 19,141, 72, -121,118,183, 18,223, 4, 91,119,102, 75, 87,123,204,229,196, 12,106,107,234,182,237, 28,132,100, 6,151,164,137,134,214, 78, 52, - 54,201, 57, 79, 46, 19,171, 40, 51,235,214,158, 98, 12, 42,208, 54, 48,214,198,110,162,226, 14, 97, 36, 61,184,185,170,198,134, -148, 51,246, 7, 91,150, 98,224, 81, 60, 70, 31,136,173, 3, 9, 19,116,168, 26, 1, 31,199,198,218,177, 17, 7, 50,115,125,172, -151,128, 97, 97, 19, 71,186, 50, 49, 12, 72,234, 7,130, 56,162, 74,123,123,119, 39,161,234,183,134, 33,244, 97,208, 23,134, 67, -202, 84, 72, 8, 22,200,198, 82, 47,141,172, 73, 98,106, 59,228,233, 75,156,138, 25, 89, 28, 46,226,174,165,173,147,133,219, 16, -120, 81,132,120,209, 9,138, 54,223, 49,120,168,199, 84,118,163,208,255, 39, 0,109, 87,179,147, 48, 16,132,103,183, 11,133,136, - 74,122, 50,241,228,193,151,240,253, 31,193, 39, 48,145, 72, 8, 65, 12,208, 82,186,179,238,204,236, 79, 41,226,197,200,133, 75, - 19,104,187,157,206,126,243,253, 12,249,145,182,231, 30,254, 15,133,126, 72,229,150, 7, 41, 86,121, 21,115, 95, 85,148,174,102, - 64,221,133, 4,108, 12,102, 96,116, 69,196,190, 3, 92,182,137, 86, 63,201,193,172,228,246,201,243,102,152,139, 65,166,228, 78, -191, 29, 54,114, 92, 13,240,186,134,151,201, 87,161,238,142, 86,142, 69, 70, 75, 57,102, 48, 80,251, 67,114, 39,113,250, 56, 0, - 88,128,117,196, 92, 97, 59,200,249,218,178,177,154,128, 54,180, 83,115, 11,139, 55,244,163,184,170,143,216,184, 3,118, 59,196, -134,132, 33, 68,154,148, 63, 92,244,200,148,182, 7,206, 92, 67,198, 84,207, 35, 62,177, 15, 77, 92,229, 91,232, 84, 7,229,190, -168,237,241,126, 68, 4, 32,195,171,137, 99,196,220,186,197,154,134,107, 84, 84,182, 29, 76,199,186,245, 39,110,116,219,158, 62, - 62,155,213,169,219,178, 62,203,254, 13,118,159, 50,193,223, 23,247, 74,153,231,249,236,105, 62, 45, 17, 22,203,189,133,195,251, -154,180, 69,123,219,249,247,156,175, 88, 51, 3,183, 19,127, 23,180, 88, 46, 39, 55, 68, 23,243, 93, 92,138, 4, 66, 81, 32, 14, -138,251, 64,222, 34,105, 69,189, 69, 16,198,143,156, 13, 3,177,121, 15,118, 99,217,188, 47,117,133, 42,242,111, 66,243, 17,251, -242, 80,227, 57, 89, 94,112, 36,129,157,197,207, 58,116,214,204,155,231,245,108,147,147,140, 74, 60,235, 24,148, 70, 70,243, 38, -181,240, 18,108, 68,136, 31,106,117,193, 54, 86, 17,221,214, 65,239,213,239,100,149,203,172,156,248,141,105,252, 10, 17,106, 20, -225,135,128,196, 40,246, 51,244,202, 40, 97, 92,156,236,158,135,126,190, 15,168,166, 85, 61, 46,118, 20, 85,203, 99,135,112,121, -165,198,251,235,197, 42, 17, 39,200,140, 13, 19, 99, 39,211,230,152,195,132,125,213,239, 57,108,166, 88,173, 46, 39,147, 97,116, -200,239, 3, 21, 29,132,127,225,167, 92,208,102,220, 21, 18,165,206,118, 53,131, 97, 0,158,111,172,134, 83, 93,119,105,198,127, -101,111, 65,149, 68,151, 35, 85, 52,182, 45, 98,101,247,157,129,113,162,145,114, 15,213,227,122,179,212,161,190, 27,149,188,244, -201,150, 99,212, 28, 27,201,182,102, 50, 27,211, 6, 53, 25,200, 33, 19,137,104, 58, 2,156, 88,153,189,148,208, 70, 93, 46,230, - 25,225,213,207,183, 0,164,157,205, 78,195, 48, 16,132,189,150, 19,104, 90,126, 36, 36,206, 8, 46,188,255, 3,193,165, 18, 7, -138, 34, 90,112, 27,199,246,226,245,218,137, 3,105, 85, 9,181,135,168, 61, 52,117, 35,119,119, 51,243, 77,226,207,244,211,102, - 7,127,197, 24,255,169, 40,225,140, 91,187,112,242, 5,152, 59,134,209,213, 13,165,137, 4, 51,169, 35,194,100,210,131,237, 16, - 40, 74,115,194, 9, 55, 64,246, 88, 37, 25,142,212,110,255, 78, 19,136,241,202,184, 23,254,122,185,248, 54, 99, 39,151,140,181, - 30,135, 20,169, 52, 51,138,227,252, 90,104, 71,214,108, 66,236, 70,217,159,236,104, 67, 7,150,186, 99, 74, 31,149, 13,233,208, -253,139,119,113,126, 18,118, 85,219, 58,187,241,126, 75,249,196,162,150,100,128,218,228, 49, 75, 21, 71,213,254,200,165, 61,243, -149,242, 2, 86, 83, 4,199, 48, 37,112, 57,238, 56,156,164, 54,222, 56,223,153,190, 53, 94,247,182,183,132,253,166, 68,113, 8, - 37,153,248,114,206, 56,177,219,155,245,206,188, 9, 90, 26,243,143,225, 12,135, 2, 54,145,132,243,188,104,158,110, 86,173,182, -235, 86,127,106, 99,173, 59, 80, 10,160, 57,244,246, 67,155,112,220,121,119,219,200,122, 81,191,182,138,221, 63,209, 13,153, 76, -112,254, 87,241,158,194, 61, 5,140, 96,210,249,139, 13,166, 88,164,177,106,202,118,161,162, 65,158,148,108,232, 75, 5,204, 96, -163,199, 81,232, 56,196,186,179,246, 92, 22,101, 69,230, 52,225, 16,121, 90,120,170, 10,124, 1,187,170, 51,100, 38, 7, 25, 99, -166,162, 74, 28,186,197,169,244,174,120,114, 95,201, 3,112, 70, 95, 37,143, 23, 20,160,122,166,114, 59,206, 76,130,196, 81, 41, - 2,226, 34,230,168, 38,241, 35,218,131,235, 28,241,220,113, 9,170, 67, 67,218, 71,154,198,216,104,247,234,137, 51, 99, 13,109, -238, 68,188,118, 20,219, 4,252, 81,158, 93,132, 69,135, 94,118, 46,144, 19, 63,211,210, 96,185,236, 88,202,131,161,248, 63, 24, - 12,183, 32,102,252,101,120,206, 77,193, 51,222,194, 57,157,200, 41,237,140,156,108,238,200,105,184, 52, 76,136, 64, 80, 9,170, - 34,237,145, 82,149,170,136, 80, 91,153,174, 83, 82,133,215,227,255,105,188, 91,157,230,169,212,170,133, 22, 54,148,246,225,135, -111, 46, 87, 97,217, 21, 19,110,145,211, 73,225,162,106, 32, 69, 17,224, 80,254, 62,220, 61,110,247, 45,111,142, 87,213, 85,228, - 77, 30, 61,225, 31, 1, 24,187,142,165,134, 97, 32,170,234, 16, 19,202,112,224,200, 39,240,255, 23,254,133,129, 11, 12,101,128, - 16,136,139, 86,104,139,100,197, 3, 36,158,220,237,216,210,106,203, 43,110,111,207,254,143,190,205,127, 66,193, 7,102,241,102, - 78, 19,136, 21, 35,129, 13,116,162,158,204,148,233, 95, 34, 22,222, 48, 72,129, 41, 78,210,157,141,145,231, 41,251,138,134,204, - 88, 65,126, 62,171,196, 76,215, 85,219, 60,246, 62, 45, 94, 71, 96,235,108,198,137,234, 68,144,251, 51,154,157,183, 36,147, 51, -167, 86, 63,245,146,122, 3,234,207,136, 0,100,157,197,123,163, 58, 52,165, 67,160,225, 67,213, 13,243,100,114,221,166, 67,188, - 71,178, 73,172,104, 80,182,122, 51,225,183,208, 9,179, 73, 83, 5,141,103, 13, 94, 66,172,199, 53,230,224,195,102,192,254,237, -210,165,227, 36,158,145, 24,239, 38, 0,201,123,161,219,170,183,168, 19, 48,104, 56,247,102,211,245,235,174,223,144,115,115,200, -110, 83,123,107,192, 95,131,251,146,126,151,202, 92,159,158,124, 3,220, 60,191,166,231,185, 80,118, 12, 38, 4,135,228,120,210, -218, 90,208, 32,233,216,171,179,133,191,127,115,221,168,210, 10, 7,202, 15, 41, 86,177, 85,118, 44,184, 38,238,187,234,162, 81, -149,211,177,154,124,103,230,159,189,132, 18,110,197,228, 4, 83,103, 41,186, 88,250, 38, 50,254, 43, 65, 54, 76, 53,121,101,197, - 83,146,125,157,203, 70, 16, 47, 39,109, 76,156,240,221,145, 21,232, 72, 29,172, 88, 8, 74,108,207,133, 0,173,102, 44, 68,153, -168,100, 35, 55, 0,180, 52,245, 77,156,111,222, 88, 81,151, 69, 6, 89,192,238, 32,222, 23,187,248, 34,140,236, 34,118, 22,119, -219, 32, 70, 96,151, 38,244,122,187,178, 43,213,125,245, 56,154, 24,186,254, 99, 28,155,246,104,241,174,183,192,195, 85,226,188, -210,215,160, 61, 8,196, 37,214,108,199, 6,188,159,138,155, 26, 76,211,105,144,182,135,154,168,169,197, 35,187, 82, 15,150,178, - 9,114, 6, 22, 97, 58,146,243, 80,182, 78,231,119, 96,172, 7, 35, 63,244,255, 52,165, 67,130,187,174,210,118, 37,227, 67, 77, -192, 24, 4, 65,226,208,221, 56,111, 44, 42, 85,162,230, 2, 38,163, 77,179, 48, 96,143, 92,211,186,182,181,173,183, 13,194, 2, -152, 67,165,144, 33,214,141, 91,156,136,162,188, 79, 58, 59, 81,105, 63,216,180, 18, 92,170,245,129,244,103, 60,114,227,229, 40, - 79, 55,191,123,185,197,187,209,171,248, 28,214,122,151, 25, 51,187,126, 4, 96,236, 90,118, 26,134,129,160,215, 78, 83,104, 11, -170, 56,130, 16, 71, 78,252,255, 55,112,231, 31, 56,241, 16, 42, 77, 19, 63, 22,239,174,237, 56,164, 45,156,171, 70, 81, 90, 79, -118,103,118,103,154,249,187, 14,142,129,227, 28,229,195,233, 4,144,255, 11,208,179,167, 94, 32, 30, 96,108,147, 48, 41,243,217, -237, 84,139, 77, 24,228,108, 46, 93,204,152,181,202,185,172,161,222,149, 43, 75,167,133,244,138,101,114,179,120, 10,151,235, 96, -173,194, 3,226,182, 93,188,251,235,207,222,113,120,172,198,178,115,160,146, 10, 86, 48,148,130,159,148, 22, 3, 63,195, 5, 56, -209,238, 33, 81,225,236,120, 51,242, 36, 3,119,157, 13,227,165,103,183,153, 38,155,161,175, 77, 4,247,230,126,179,124,251,136, -199, 42, 73,178,109, 54, 23,131,211,196, 72,152,182, 89,237, 52, 27, 79,190,216,229,185,154,129,212, 84,154,115,191, 10,216, 54, -122, 96,169, 48, 62,184, 29,239, 29,182,100,117, 24, 91, 71, 88,106, 8,206,247,214,117,206,147, 54,155,241, 29, 43,190, 46,252, -227, 0,201,205,172,216, 3,231,193,152,199,237,230,101,223, 63,119,135,144, 62,242, 20, 32,225,136,182,234,185,209,105, 21,182, - 0, 27, 99, 60,224,235,142,126, 99,207, 68,178, 56, 75, 72,165, 94, 91,195, 96, 80, 56,179, 71,146, 23,253,175,225,209,217,155, - 29, 36,236, 56, 77, 89,170, 90, 78,195,217, 41, 14,117, 87, 32,245, 3,105,170, 90,193,164,173, 31,249,229, 2,244,213, 18, 85, -252,203,165, 69, 58,204,105,216, 96,138, 56,200, 82,146,188, 22,216, 79,203,199,203,179,241,157,164,116, 67, 90,207, 57, 54,138, - 50,189,185, 82,222,162,112,241,169,108,167, 44, 99,201, 73, 3,133,211, 22,135, 19,160, 10,101,229,212, 62,118,179, 26,175,150, -107,176,148,115,211, 68,200,215, 97,231,190, 61, 72,149,131,217,130,216,103,131, 25, 79, 60, 31,207, 29,166,198, 24,106, 94,184, -120, 65,148,121,211,128,170,230,169, 96,220, 46,202,224,238, 43,187,250, 92,188,143,115,144,117, 90, 19,158, 0,119,252,187,164, - 60, 15, 71,231, 57,153, 26,220,147,207,191,204, 78,113,234,103,195,206,254, 82,179,115, 40, 28,241, 54,139,213,226,226,110,117, -187,109,111,180,214,131,179, 61,109,197,198,246,149, 20, 84,195, 12,215,165,185,184, 89,109, 35,244,199, 11,117,155,225, 16,186, -222,245, 95,246,171,179,253,183,219, 91,127,176, 20,141,203, 46,140,217, 60, 14,210,198,178,230,131,233,100, 2,103,244,187,158, -222,244,143, 0,148, 93, 93, 79,227, 48, 16,180,215,113,154, 22,161, 10,113,119,226,245,196, 11,255,255,153,255,129,196, 47, 0, - 33,116, 39, 33, 53,132,218,235,219, 15,111, 29, 82, 40, 92, 31, 83,169, 82,154,120, 61,158,157,157,233, 78,255, 13,254,168,202, -135,165, 2,210,127,135,103,255, 38, 29,239,170,211,153, 55, 58, 5, 76, 22,111, 16,190, 78, 92,103,218, 30, 45, 20, 19, 61,214, -209, 5,206,223,244,144, 62, 74, 78, 57, 36,103,214, 25, 12, 96,201,194,159,254,140,222,149, 31,145,190, 10,143,180,184, 38,122, - 74,217, 55,102,176,102, 6,233,225, 23,172, 31,207, 83, 39, 2,140,222,228,202,224,107, 19,178,179,172, 81,181,226,210, 68,105, -241, 90,193, 11,215,137,192,134, 63,189,148,191, 1,220, 54,194,213,121,252,189,137,247, 79,187, 94, 10, 98,154,205, 43, 77,182, - 51,229,175, 21, 81,245,184, 16,108,217,107,107,119,108, 81, 33,101,164, 59,166, 27, 78,101, 15, 33, 6,214,116,174,144, 7, 3, -214,220,181, 22, 57,136, 75,187,132,227, 91,254,235,178,102,198,238,222,187,158,157,134,240,222,148,154, 74,203,208,189,220,196, -225,250, 98,125,251,252,114, 39,234, 32, 61, 42,189,200, 94, 76, 91,206,192, 34,187, 66,160,101,237,202,166,248, 75, 7, 15, 83, -255,154, 25,243, 72,241, 0,105,169,112,121, 82,120,120, 32,103,230,149,202,207,130,231, 45, 73,233,227,183,174, 14,205, 41,119, -130,206,189,239,172, 30,203,180,221,146, 26, 22,192,205, 59, 99, 93, 87,138, 49,218, 28, 83,147,122, 89,138,118,157,246,241, 85, -112, 5,154,162, 83, 66,245,201,115, 26,255,165, 22,145,152, 51, 97, 62,121,145,169,186,107, 16, 29, 20,143,159,105, 67,102, 21, -179,117,167, 26,251,174,176,221,124,146,209, 53, 85,127, 89,246,189, 88,144, 41,225,221,110, 76,227, 4, 19, 1, 23,246, 72,103, - 63, 23,212, 60, 39,253,139,100, 10, 84,171,188, 56,253, 8,144, 71,165,229,237,215,173, 27, 44,218,131, 10,213,209, 28, 68,252, -130, 11,177,114,143, 85,229, 83, 74,139,163,106,110,239,166, 14,154, 25,123, 90,107,249, 20,193,242,255, 64,179,124, 21,158,115, -156, 32,196, 87,162,108,215,244, 68,135,126, 64, 68,166,101, 36, 1, 8,124,247,107,184,252,185,185, 90,193,138, 30,244, 72, 71, -232,156,247,108, 93, 89, 14,153,146,123, 36,224,149,164,125,135, 84,250, 99, 8, 66,179, 65,135,113, 11,219,117, 55,249, 28, 75, - 88,141,233,117,244, 28, 23,154, 92, 18,120,164,224,199,206,106, 46,168,220, 4, 44, 9,118,177, 66,255, 9,192,216,181,237,182, - 13,195, 80, 81, 78, 29, 39, 43,234,118,216,211,222, 7, 12,216,190,123,255,213, 14,123, 40, 90, 20,201, 46,137, 44, 75,226, 68, - 82,183,214,109,210, 32, 15,129,145,216,130, 29, 81,212,225,225, 57,175,227,239, 39,246, 54,248, 18,145,135,119, 67,240,240,158, -175, 65, 3, 52, 66,193, 38, 23, 23,203,123,232,106,188, 42, 49,119,221,175,227, 50, 9, 0, 13,232, 89,223, 40,219, 93,144, 84, -159,126,100, 64,239, 60, 24,241,152,140, 15, 74,103,218, 3,168,106,243,153,167, 84,154, 81,108, 59, 25, 31,213,160,237, 58,196, - 21, 89,246,209, 20,194, 36,239, 62,102,152,165,207,132,214,173,238, 98,194,126,159, 51, 47,202,250, 81,141, 29,140,208,253,218, -217,159,222,247, 28,247, 47, 73, 17,158,134,110, 50, 31,166,123,142,213,188, 85, 98,109,197, 35,229,181,205, 49,119,197,103,222, - 8,187, 22,195, 62, 40,195, 93, 49, 27,238,174,235,180,196, 71,176, 14, 31,103,255,164,220, 31,110,127,157,242, 34,209,202,197, -168,215, 36,170, 11, 73,102, 96, 64,166,103, 95,145,239,253,240,229,227,135, 31, 15, 79,183,188, 61,239,154,191,157,232, 19, 76, - 10,127,243, 28,118,212, 28,128,159,175,135, 59,179,241, 34, 3,135, 82,255, 67, 46, 99,251, 84, 47, 44,168, 71,110, 67, 66,213, - 98,200,181, 73, 6,159,235,128,135, 66, 8,148,254,166,202, 51, 89,222, 85, 72,138,147,112, 34, 31,132, 66, 91, 76,107, 3,234, -134,150,171,219,112, 83,196,194, 11, 82,159, 10,176,161,248, 88,230, 96, 1,201,134,140,174,173,235, 60, 43,190, 79,141,152,109, - 51,118, 57, 92,108, 47, 42, 73,198,167, 76,168,202,126,156, 1,162,169, 69,143, 3,178, 39,160,208, 57,174,106, 39, 96,157, 79, - 72,155,157,192,210,170, 12,238,139, 72, 31,134,134,112,153, 32, 39,121, 94,170, 34,241,184,100,245, 65,161,133,168,100,114,142, - 89, 25,158,201,150,170,154, 82, 97,181, 69, 44,193,221,171,183,189, 53,194,185, 80,223,212, 14, 49,156, 13, 76,139,224,174,114, -206,222, 17,142, 72, 61,190, 49, 85,143,161,121,220,220,132,217, 93, 16,123, 67,143,195,213,183,241,235,205,250,211, 63,107,246, - 36,121, 52, 89,111,231, 48, 31, 98,234, 78,164, 16, 25,165,103,249,231, 36,191, 19,239,230,193, 91,235,103,235,166, 57,196,204, -253,120,244,230,175, 59, 24, 55,237,113,103,212,129, 72,125, 68,187, 92,101,190,124,167, 26, 27,153,101, 15, 83,249,252, 95, 0, -206,174,101,167, 97, 24, 8,174,157, 71, 31,128, 56, 84,149, 64,226,140,196, 63,243, 73,252, 2, 7,196,137, 3, 2, 81,148, 54, - 73, 99,227, 89,175,157, 77, 91, 16, 32, 85, 61,229,208,196,174, 51, 59, 59, 59, 83,254, 67,244,162, 81,188,159,196, 10,255,140, -205,127,203,215, 43, 8, 47, 21,172, 77,254, 27, 82,213, 70, 23,118, 49,213, 48, 98, 99,195, 21,247,250,242,250,169,125, 28,212, -192,179,190,121,235, 84, 63, 22, 9,217, 16,127,149, 81, 90,195,185, 75,252, 54,133,120,182,176,131,115, 88, 60,107,147,123, 60, - 73,161, 59, 68, 26,136, 93,104,248, 15,138,249,201, 93,154,166,171, 24,249,118,156,242,193, 3,174, 46,212, 86,225, 21,114, 91, -207,235,174,125, 64,155, 19, 7, 40, 34,167, 91,247,220,130,184, 56,195,249,104,150,248,148, 27,218,119,200,172,151,148,143,236, -202,235,191,193,206, 58, 22,160, 77,115,179, 46, 14,214,166, 14,103,197, 35,237,225,225, 45,200, 46,249,233, 6,204,190, 67,119, -215,118,172,169,168,201,127, 58,122,167,253, 22, 89,108, 18, 42, 66,202,107, 62,207, 33,231, 18,193, 43,133,126,173,186,169,231, - 68,119,243,229,234,162,186,127,121,221, 40, 90,176, 87, 37, 96,147, 94, 60,251,148, 17,216,216,121, 51, 32,210,200,187, 76,194, - 74,248,173,216,196,104,219,148,163,134,192, 49,132,215,120,210,144, 75,230, 91,222,103, 30, 24,104,116,156, 31, 29,249, 39, 67, - 39, 71, 19,143,133, 19,194, 98, 35, 38, 53,101, 85, 48, 92,159,202, 55, 18, 5,193,163, 70,177,208,196,241, 30, 81,188,140,122, -112,184, 54,108,144, 92, 0,207,236, 78, 29,211, 89, 99,198,170,112, 99, 94, 43,226,105, 34,145, 83,172, 35, 66,172,134,145,222, -159,248,172,153,113, 41,157, 30,180,225, 43,123,246,246, 50,121,229,193,177,251,104, 12, 98, 76, 50,119,195, 72, 25, 73, 7, 55, -194,118,177,250, 75,220,134, 31,233,148,131,147, 93, 91,208, 36,185, 42,187,252,229, 56, 39, 81,210,171,195,221,100, 65, 78,146, -193, 28, 32,119,255, 55, 12,174,183,140,167,223, 54, 15, 79, 28,238, 22,117,102, 17, 51,161, 10, 91,133,239,221,182, 9,152,221, -216,242,106,113,179, 94,172, 62,250,221,166,125, 99,195,100,106,120,101,227,190, 46,216,151, 48, 41, 98,113,195,192,228, 97,221, - 13,156,219,194, 85, 85, 1,122,184,167,161, 67,146,162,169,108, 93,187, 89,231,187,129,250,158,250,176,105,102, 84,151, 16, 80, - 34, 7,151, 17, 70, 97, 68, 81,227,104,250, 88,226,207,254, 18,128,178,107,233, 73, 32, 6,194,211,238, 11, 65, 30, 27, 19, 19, - 36, 94,188, 17,163,255,217, 31,231,193, 11,106, 34,226,190, 58,210,153,206,108, 23, 1,245,194,149,165,192,244,235,215,239,209, -227,247, 63, 8, 96,142,139, 94,224, 55, 57,205,121, 20,127,234, 93, 34, 71, 0,183,115,170,165,195,246,137,107,214,105,168, 20, - 71,240,189,110, 55,230,192,218, 26,253,166,226, 31,123, 18, 50, 91,195,105,157, 60,146, 56, 27,185,229,188, 94,149,245,114,222, - 45, 22, 30,232,110,119, 22, 76,175,131,224,141,225,106,122,221, 52,141,117,159, 85,211, 2, 91, 69,232,143, 88,203,245, 38,134, - 81, 27,136, 0,218, 57,204, 93, 49, 90,103, 69,213,182,111,148, 97,192, 72,118, 1,176,132,244,214,100, 55,105,182,127,168,212, -251, 2,123,195, 12,246,181,141,231, 98, 66, 19,153,191,181,100,156,153, 72, 49,169, 76,122, 27,132,222,248, 69,146,139, 10,221, -206,171, 38,252,181, 78, 5,221, 22,112, 35,148,142, 22,127, 39,194, 82, 41,251,148, 10,107,164,168,252,130, 62,236,140,144,251, -227,120,178, 42,243,167,151,247,143, 40,216,242, 32,252,210,201, 42,213,244,168, 15,227,236, 25,167, 45, 95,147,107,204,180,106, - 31,195, 4,225,111, 48,160,235,232,212,114, 4,194, 71,182, 38, 68,173,107,160, 74, 95,132,152, 3,136,205, 68,161,244, 3, 15, -183, 81, 28,240,154,118,208,152,101,142,128,122,217,113, 84,223, 3, 86, 19, 7, 6,199,222, 30,197,171, 89,149, 78,152, 22, 85, -137, 76,123, 2,234,178,196, 80,125,112, 19,104,100, 22, 58,148, 80, 73,136,250, 44,251,101, 87, 87,100,204,129,200,117, 40,175, -149, 67,166, 12, 66, 63,109,120,117, 68,155,249,136, 97,177, 20,243,137, 66,244,169, 76,227,196,101,124, 56,156,194, 76,200, 27, - 85,184,163, 92, 86,128,184,200, 36, 17, 70,239, 71, 56, 78, 62, 30,238,186, 48,208, 13, 50, 12,240, 64, 98,112,234,206,223,252, - 91, 16,242,115,184,115,245,155,151,185,164, 38,219,227,247, 61,102,207,124,152, 19, 92,230,211,117,121, 95, 22,115,154,223, 48, - 41,198, 69,146,102,150, 25, 28,207,108,101,164,105,167,246, 68,103,101,154,176,246,198,121, 13,155,201,165,226,164,193, 46,152, -111, 61, 90, 79,118,190, 32, 17,153,238,239, 72, 49,153, 67,238, 9,106,194,193,234, 12,141,242,195,141,146,152,223, 2, 48,118, - 53, 61, 9, 3, 65,116,167, 31, 43, 8, 42, 9,225,134,137,158,253, 27,254, 67,127,159, 7, 79,106, 2,137, 81,160,197,118,118, -220,153,221,217, 22, 10,234,149,164, 41,109,183,179,175,111,222,155,247,183,126, 6, 78,225,113, 26,144, 54,166,119,247,135, 3, -151,206,161,248,127,132,139,170,146, 1, 66,189, 16,159,116, 84, 63, 7,250, 67,222,130, 76,125,124, 17,155, 17,100,112,194, 56, -145,246, 13, 33,177, 56,186, 40,247, 55,206, 58,196,155, 49,221,206,154,134,218,106,135,239, 91,243,213,154,137,109,150, 11,115, - 51, 42,158, 95, 17,212,157, 16,190, 67, 87,159,111,254,208,107,112, 50,167,131,113,225, 78,242, 61, 2, 52, 26, 75,129,254,142, -111, 40,171,156, 61,178,174,233,187,222,227, 44,183,143,179,249,196,218,157,195, 85,181, 71,164,105, 9, 83, 91,248, 43,250,172, -247,213,110,255, 33, 34,156, 86, 61, 29,141,174,203,223,239, 82, 26, 61,159,247, 50,198,242,158,216,198, 9, 37, 82, 27,248, 50, -110,100,224, 90,126,110,181,159, 21,236,196, 86,202,116, 43,252, 82,217,155, 24,147, 56, 34,167,103, 65,169,233,133, 98,249,137, -214,247,135,241,228,126, 49,122,122, 89,111,180, 15,225,206,116,101,211,229,248,147,214,229,101,133,156,181,157, 76,238, 49, 60, - 58,146,185, 9,136, 75, 28,203,209,202, 57,134,240,169,241, 40,164,110,170, 92, 24,205,147,166,155, 61, 73,135,101,232,104, 20, - 45,116,181,169,111,157, 58,148, 19,233, 71, 98,162, 65,210,131,194, 48,132,140,185,155,204,245,124, 48,221,236, 13, 65,241,134, - 95, 82,202, 29,132, 4, 39, 94,188, 33,132, 73,251, 0,240,155,186, 67, 85,237,226, 45, 5,205,167,232, 20, 9,166,203,135,137, - 60,184, 51,208,183, 21,165, 63, 60,112,207, 57, 74, 91, 72,232,118,118, 44, 82,148, 96,106, 54,134, 59, 8, 27, 63,133,217, 41, -226,244,168,197, 59,240, 31, 5,178, 34, 53, 84, 13, 82, 34,122,122,197, 29, 99,177,139, 71,181,157,130, 40,109,124,103, 87,154, - 25, 60, 58, 24,200,190,233,239,226, 78,226, 93,226, 46,138, 20,119, 78,110, 46, 88,211,110, 51,150, 90,208,237,213,114, 57,189, -187,128,108,211,122,204, 87,215, 18, 72,235,235,108,145,151,182, 44,243,166,222, 82,229,152,209,149, 57,150, 20,108, 51,113, 51, - 67,199, 11, 53,231, 14,140,216, 37, 4, 13,162,218,147,125, 41, 95,192,124, 77,235,214, 96, 41,121,107,193,192, 80,154,139,113, -230,203,200, 6,120,216, 14, 99, 48,212,136, 18,229,112,248, 52, 63, 2,112,118,109,173, 9,195, 96,180, 95,162,173,171, 55, 38, -142,237, 97,131, 33,178,151,189,236, 23,239,207, 13,198, 16,209, 33, 86,147,182, 73,150,219,151,166,213,141, 50,159, 68, 68, 45, -109,191, 28, 79,206,229, 47,252,222, 27,185,247, 18,200, 67, 15, 34,190,109, 28,104, 21,159,130, 87,193, 55,188, 16,222, 96,161, -228, 0,111, 35, 18, 94,247,106, 43,213,138,233,199,197,193,154, 8,244,200,200,179,250,126, 94, 79,210,170,100, 66, 79, 38, 19, -132, 34,146, 67, 45, 79,165,100, 60,121, 88, 82, 81,209, 35,119, 46,110, 63,124, 76, 96, 5, 85, 55, 9,231, 85,194, 76,204,146, -241,139,214,134,121, 80, 34, 98,171,105, 36,231,200,236, 85,114, 84,114,195,216,103,193, 38,131,193,235,221,116,189,156, 45, 38, -122,196, 37,187,130,127,159,248, 94,214,133,109, 87, 42, 45,137, 17,178, 1,122,154,140,104,100,113, 74,162,248,154, 80, 77,144, -162,251, 78,224, 28,183, 16, 64, 89,179,171,249, 82, 71,253,199,104, 93,226, 19,138,224, 61, 0,240, 12, 35, 7,198,118, 67,245, -113, 56,122,123,154,191,127,108,191,164,225,226,225, 23,203, 73,231,177, 2, 56, 15,111,125,239, 33, 1,159,172, 98,213,124, 38, -207,202,172,219,194,166, 11,133,152, 63,247,201, 77, 64, 81,167,238, 14, 71,140,196, 69,221,115, 11,246,196,139,208,240,215, 25, -238, 77, 15, 88,196, 0,168,164, 95,183,130,106,208, 61,180,185, 80,229,212, 93, 16,109, 30,121, 50,208, 92,223,190, 6,155, 56, -251, 29,174, 42,128,138, 79, 66,174,150,237, 66,104,145, 53,182,152,160, 68,108,156,159,113,201, 44,234,122,189,121, 20, 90, 12, -173,186,162, 3, 82, 46,231, 32,194,203, 16, 68,243, 49, 61,162,218,139, 76, 71,188,225,233,117,107, 82,181,187,179,173,200,100, - 21, 74,113,149,108,224, 57,120, 75,113, 7,185,131,112,125, 91, 23,204,131,138,182, 19,255, 97,193,187,172,206, 32, 23, 35, 8, -255, 20, 26,145, 59,177, 19, 73,143,117,170, 97, 59,161, 67,162, 97,123, 58, 48,231, 72,173,231, 47,171,217,179, 62,218,253,105, -183, 57,110,182,167,237,129, 31,206,101,193,196,153,215,140,137,146, 0, 25,209, 76,255,252,179,172,109, 68, 40,238, 18,251, 61, - 6, 83,210, 41,124,127,141,139,106,147,149, 6,241,216, 45, 67, 9, 25, 37,121,101,149, 16,122,220,231, 48,158, 12,166,139,116, -150,147, 92,191,159,171, 18, 43,243, 26,215, 11,162, 9,248, 17,128,181,171,233, 73, 24, 8,162,187, 45,109,193, 30,138,146,200, -193,131, 55,227,221,255, 31,239,254, 11, 15, 68, 37,193, 16,144, 82,186, 95,238,236,204,108, 63, 48,193, 24,111, 28,104,105,182, -203,236,155, 55,243,222,252,133,127, 31,161,248,228,167,174, 27,199, 67,248,206, 71, 89,254,134,136, 39,163,130,142, 31,164,217, -140,134,166, 89, 58,215,171,209, 72,114, 88, 74, 80, 47,152, 24,150,143, 16,123,137,163,159, 44, 76,211, 78, 28,146, 98,216,102, - 55,159,185, 5, 44,145,109, 26, 32,160, 81, 46,233, 79,222,214,136, 90,133,184, 38,245,234,179,189, 95,230,111, 91,155,102, 20, - 46,131, 47,132,191, 75,123, 80,226, 8,170, 37,216,251, 13,106,191, 25,116,231, 61,244,141, 75,124, 8, 36,120, 38,204, 86,164, -141, 56,189,239,212,203,110, 59, 7,117,171,191, 22,209, 39, 60, 84,139,202,247, 80,174,172,135,235,124,209, 64,216, 50,109,130, -179, 91,163, 84, 42,102,166,138, 90,169,224, 97,142,193,130, 70, 7,166,168, 13, 61,157, 1,227,195,239, 90, 14,253,121,207,212, - 87, 51, 81, 51,227,188,207, 49,138,247, 9,193, 82, 76,158,238,170,231,205,238, 85,187,156,183,132,190,100, 60,233,175, 45,167, -229,222,248, 29, 76,212,173, 9,135,184, 63,114,246,106, 83,235,227,162, 40, 13,152,114,178,158,117, 56, 97,121,212,216,195,237, -178, 76,221, 98, 93, 80,146, 1, 87,200,130,165, 27,119, 94,139,104, 72,192, 36,183, 29,160, 91, 27, 3,165, 27, 41, 92,236, 48, - 40, 36, 72,195, 81, 47,145,235,193,121, 77,185,181, 32,238, 36,136, 66,193,104, 64, 82, 78, 72,142, 82, 82, 50,102,193,201,113, -218, 98, 14,138,254,253, 1,239, 89,164,195, 7,197, 5, 84,125, 70,110,132,249, 36, 77,180, 13, 75,249,221, 88, 21, 55,250,195, - 98, 26,192,230,125,182,243,200,103, 11,179,174, 73,129,168,162, 17, 3, 46,123,101, 85,199,152, 29, 1,187,236,163,117, 97,105, - 81, 59,160,214,205, 68,103,209,114, 23,220,205,185,245, 74,132,237,246, 63,108,171,227, 82, 68,159,237,248,150, 29, 36,229, 73, -104,126,146, 76,203, 32,108,135,248,158,192,100,133,244, 97,254,120, 59,189, 81,230,180,218,125,172,235,245,151,170, 29, 24,200, -184, 76,230,133, 3, 51,146, 73, 98,148,105,253,247,139,116,118, 53,201,253,103,144,222,115,107, 16,206, 21, 11,201,166, 38, 31, - 81,168, 19, 65,232,215,192, 83,160, 47,132, 77, 69,122, 35,171, 70,168, 76, 22,101, 81, 93, 23, 85, 57,153,130,220,172,246,177, -171,209, 66,133, 38,109, 92, 19,139,181, 29,124, 89,223, 2,144,118, 62, 59,109,196, 64, 24,247,216,251, 47, 1,132, 82, 81,169, -226,202, 1, 9,222,255, 37,120, 6, 14, 61, 21, 65, 43, 82, 68, 67,214, 89,219,211,157,177,199,235,221, 72, 20,212, 91, 14, 81, - 86,177,189,159, 71,223,204,252,166,250,255,165,241, 69,133,156, 58,170,165,195,130,206,243, 25,137,199,163,219, 69,226, 15, 86, -121, 62,114,122, 58, 89, 98, 78, 38,126, 44, 83,160,200, 47, 35, 91, 39,108,221,254, 91,171, 78, 76,187,181,164, 36, 14,160, 49, -227,173, 75,109,147,207,175,212, 25, 92,177, 77,246, 76,140,119, 2,189,143,155, 73, 68,114, 36, 72,135,183,238,226, 84, 95,126, -241,143,191, 85,109, 18, 18,103,240,254,188,117, 63,246, 99,180, 11,107,214, 74,224,218,246, 92, 35,216,139, 65, 17,175, 4,155, -156,113,100, 22, 60,161, 61, 28,131, 22,182,244,121,148,123,215,114, 37, 73, 4,218,237, 37,148,206, 13, 7,248,153,141, 8, 69, - 1,184, 22,129, 94, 21, 12,247, 21,239,200,129, 30, 68,217,224, 54,157,102,158,173,192, 66,191,227,239, 7,225, 95, 70,193,107, -197,223,143,170, 29,165, 63, 22,204,108,148,185,186, 88,217, 14,239,190,191,113, 58,119, 54,183,228,157, 55,240,218, 40,171, 79, - 2,143,223, 20,183,152,196,253,165,127,184,183,244,111,234,195,174, 89,175, 53, 84,115,183, 97,209,190,136, 83,110, 20,197, 8, - 78, 87,120,193,222,146, 89,119,165,178,163, 52, 9,197, 9,190,101, 47,107,254, 81, 92, 86, 70, 47,162,200, 73, 50,117, 20,133, - 88, 69, 98,100,252, 94,194, 40, 9,118, 70, 37,147,149,110, 98,140,220, 95,206,108,194,212, 20,175, 51,126, 24,229, 76,164, 93, -128,194,226,159,229, 42, 75,194, 26, 63, 63,148,202, 62,119, 71,151, 67, 36, 66,226,231,138,140,179, 39, 22,225, 99, 71, 76, 43, - 88, 90,255, 83,226, 84, 0, 80, 65,189,163,236,229, 98,102,101,207,163,125,242,180, 92, 76,197,145, 30,114, 35,171, 40,251, 24, - 59, 67,224,130,158,127, 25, 44, 52, 53,211,116,189,239, 63,104,187,195,188,112,128,223, 62,157,135, 68, 82,111,170,166,130,153, - 10,234, 90,215, 21,245, 33,193,205,230,118,211,156, 31,130,255,249,250,235,105,247,240, 50,252, 25,148, 77, 94, 50, 66, 3, 45, -196,110, 25,196,222, 29, 44,169,124,219,128,217,171, 56, 18,148,247, 66,168, 65, 9,138,206, 65,122, 26, 35, 10, 9,236, 28,208, - 57, 94,138, 14,234,211,230,108,211,125,237,170,174, 54,218, 14,126,112,142,211,173, 30,151, 9,137,132,233,250, 43, 0,101, 87, -211,147, 48, 16, 68,103,233, 82,208,164, 96, 15, 24, 19, 79,198,120,240,226,255,255, 13,254, 15, 14, 26, 67,160, 86,186,173,237, -142, 59, 59,251, 85, 44, 26,184, 2,129,126,189,157,125,243,230, 61,121, 17,148,139,243, 82,152, 20,232, 97, 60,113,147,106,108, -254,198,117,140,156, 12, 21,197,242, 52,240, 24,163, 51,147,243,248,141, 60,108,204, 54,242,149,133, 5,122, 80, 3, 73, 86,182, - 45,188, 20,196,125,153,211, 87, 74,188, 93,232, 67,213, 31, 7,171, 60, 66, 88, 72,194,181,198,154,198,206,169,115, 65,155,168, -206,118,169,235, 14,190, 58,253,124,191,217,238,222,100,198,191,107,106,118, 61,124,235,154, 34, 39,221, 56, 99,155,140,251,178, - 86, 68, 89, 76,204, 60,179,129, 78, 23, 72, 19, 61, 33, 33, 83, 17,197, 49,228,177,200, 37, 44, 96,167,223,254,242, 84,188,147, - 68, 39, 57,230,109, 2, 11, 57,112,118, 18,196,104,192,156, 37,146,128, 87,190,108,233,147, 43,213, 36,177, 80,215,246,143,133, -180, 88,179,219, 40, 40,113, 80,222,109,138,215,170, 42,103, 54,252,214,174, 16,169,106,115, 82,194, 95, 2,172,151,229,142,204, -196,180,107,220,216, 71,191,109,247, 12,238, 79,166,186,151,179, 86,100,152,108,168,197,212,241, 58, 15, 85,107,244, 29,217,118, -215, 54, 15,108,195,104, 90, 50, 48,226,236, 37, 25,108, 14, 48,189, 19, 53, 8,136,222, 70,255,178,151,236, 7, 50,243,126,193, - 12, 92, 97,143,143,232,114, 75,156, 45,152,224,197,198,198,210,216, 65,143,224, 96,230, 88,106, 79, 70,226,175,153, 75,156,150, -244,132,101,128,137,166, 19,100, 23,167, 62, 93,254,188,185, 34,217,151,147,144,246, 39,226,232,193,196, 65,135,213, 81, 7, 88, -135, 1, 68, 34,120, 79, 26, 24, 56,170,187, 81, 36,200,238,167, 93, 48, 44, 39,190,217, 11,169, 51,140,247,195, 28,112, 34, 30, -111,250,213, 97,123,174,149,120, 78,185,151,176,243,110, 47,120,179, 92, 53,170,177,106, 25,105,202,100, 6,119, 3,247, 15,171, -199, 85, 94,152, 15,212,234,240,126,252,168, 8,220, 21, 71, 79, 51,124,153,175,204, 37, 45, 6, 54,236,153,228,143,104,158, 57, - 82, 74, 11, 50,126, 16,206,163,136, 37,121, 44,244,234,237, 96, 4,207,169, 57, 47, 31,212,222,165,163,175,177, 83,170,169,219, -125,145,175, 77,233,217,233,230,216,127,154,183, 22, 98,217, 96, 99,171,180, 12,252, 48, 49,223,120, 63, 2,144,118, 45, 59, 13, -195, 64,208,107, 59, 15,210,180, 32, 33,149, 59,156,249, 5,254,255, 11,248, 5, 4, 18,162, 45, 41, 37, 36,177,241,174,189, 78, -210, 52, 21,143,107, 14,137,228, 36,179,163,157,157, 89,253, 31,230, 14,243, 40,211,141,213,234, 83, 16, 63, 13,253, 81,114,192, - 65, 60, 13, 98,193, 86,194,200, 22, 49,105, 29,114,190, 51,111,234,233,105, 70, 38,146, 75,129, 75,129, 94, 62,240,180,220,155, -129,182,121,252,180,190, 5, 81, 16, 0,109,219, 94, 66,204, 58, 7,100, 86, 41,156, 79,207, 53,148, 18, 72, 56,221,181,164,121, -248,148, 15, 45,131,153,204, 67,243,158, 39,223, 59, 70,195,132,219,220, 12, 93,120,165,101,254, 75, 67,223, 72,153, 51,254, 33, -188,179,169,230,137,195, 88, 18,254, 16,255, 98, 7,174, 31,201,147,233, 30,103,243, 32,172,195,123, 96,223,104,196,165,146,131, -223,182, 14,121, 26,238,209, 80, 11, 83, 11,168,232, 72,243,176, 49, 60, 52,229,253, 23,148,209, 83, 86,184, 55, 92, 94, 93,232, -108, 5,251,237,215, 77, 41,171,218, 85, 68,147,216,161,243,232,180,173,238, 62, 79, 95,109,142,192,167, 56,115, 9,203,166, 88, - 8,251,160,224, 58, 77, 43, 80, 79, 80,146,150,110, 58,238,108, 31,121,158,173, 29,202,131, 71, 19,238, 28,198,210,115,246, 0, - 73,161,123,192,156,120,212, 29,142, 41, 49,221,143, 44,187,103, 80,158,151, 52,197,105, 31,114,192,200,216, 89, 12,163,146,220, - 62,140,190, 39,223,125,247,219, 94,163,227, 36, 50, 92, 1,179,193, 68,131,125, 82, 33, 96,198, 76, 85, 2,123, 22,220, 25, 88, - 97, 2,235, 48, 6, 65, 70,118, 98, 66,132,240, 67, 31,213, 72, 62,141,249,127,208,151,159, 16,125,111, 24,217,205, 40,196, 48, -166,205,216,227, 92,160,153,157, 66,179,163,144,198,194,239, 29,151, 81, 7, 33, 68, 18, 53,238,113, 67, 77, 53, 1,157, 74,237, -248,187,146,234,110,121,187, 94,172,107,199,159, 69,251,124,120,219, 54,187, 3, 50,119,195, 44,196,239,233, 82,153, 46, 50,108, -236, 26,104,101, 99,155, 6,215,154, 87,121, 82,116, 74, 53,109, 19,227,173, 99, 76, 63,101, 73, 96, 0, 10,165,224, 89, 19,162, -152, 12,249,160, 48,241,199,253,152,123,123,216,212, 27,170,152,238,214,120,224,133, 40,151, 42,173,186, 13,201,150,202,203, 72, -254, 24,191, 5, 32,237,218,118, 19,134, 97,104,156,164,148, 10, 52, 6, 47,155,180,111,216,255,127,214,152, 16,183,146,203,108, - 39, 78,211,174, 12,105, 60, 34,129, 84,154,228,216,177,143,207,177,207, 96,250,163,100,124,148,200,207,102,241,149,150, 63,192, - 84, 73, 53, 29,128, 44, 23,115,231,164,129,174,122,220,177, 74, 55,140,232,197, 19,225, 26, 8,193,248,230, 3,171,232,246, 62, -238, 43,186, 69, 24, 47, 44,137,177, 32,114, 97,184,212,152, 92,145,242,195, 82,235, 64, 51,252,224,179,175,179,114,153, 15,169, -148,184,105,167, 63,117,169,140, 82, 45,127, 52, 34, 53, 99,100,168, 53, 97,119,207,155,123,193,143,109,164,230,206,139, 1,204, -157,167,159,244, 18,114,250,255,140,228,141, 22,226, 34, 1, 6,223,201, 41, 51,220, 73,251,181,104,246,120, 42, 52, 41,238, 16, - 36, 64,215, 92, 76, 78, 98,186, 84,163,239, 68, 52,173,100,229, 24, 6, 22,140,239,155,181, 93,190, 52, 31,187, 37, 21,255,130, -191,122,178,109,246, 82,222, 81,115, 90,166,159, 6,142,205, 22,191,136,113,148,166,254,117,102,201, 97,240, 61, 97,110,210,116, -123, 12, 60,209,178,241, 91, 8, 85,198, 58,203,124, 29,198, 97,146,220,100, 77,146, 73,226,190,133,192,151,204, 93, 96,226,144, - 26,213,184, 38, 35,245,231,135, 51,235,127,161,124, 5,241,226,200, 1, 73,253, 52, 20, 21, 73,102,208,224,145, 54, 89, 61,193, - 12,228,236, 8, 37, 38,137,238,240,164,124, 52,211,180, 42,103, 33,252, 46,197,204,236, 16, 40, 19, 88,197,234,111, 84,194, 10, -131, 76,227, 72,237, 67, 21,100, 47, 97,114,140,236,249, 32,186,116, 29,137, 85,247,207,199, 56, 72, 14,148,241, 37, 97,126,210, - 68,219,164,224, 30,239,128,251,147, 51,171,241, 1,217, 35,102,245, 88,242, 98,241,164, 26, 6,214,168,198,234, 22,119,245, 91, -247,254,218,238,156, 15, 11, 99,190,206,135,254,118, 2, 74,143,232,117,185, 65, 11, 29, 23,208, 24,109, 17,226,153, 76,105,157, -187, 30,195,249,130,151,254,254,220, 54, 93, 50, 21, 48,114,245, 84,236,135,209,146, 27, 34, 91,107, 74,205, 57,228, 22, 8,177, -169, 33,119, 86, 18,118, 3,107,220, 83, 30,232,226,109, 13, 43,176,155,131,251,230,118,160,225, 39, 39,158,235,143, 0,164,157, -209,110,194, 48, 12, 69,227,144, 82, 84,152,152,216,195,164,241, 7,251,255, 31,154,144,246,138, 38, 86, 85, 91, 27,103,177, 19, - 39, 33,172,168, 18,125,167, 15,180,189,113,156,235,115,205,131,101,251,253,191,201,213, 80,195,122, 24,170,168, 68,106,171,164, -150,153,142,251,143, 65, 94, 2,235, 74,255, 2,211, 53, 33,145,254, 10,244,182,223,189, 95,102,130, 76, 83,105, 73, 75, 2,211, -194, 58, 10,238, 83,198,152,143,243,175,150,118, 33,153, 79,144, 80,186, 91, 78,227, 75, 55,255, 17, 69, 86,210,182, 78,185,216, -201,122,104, 11,255,162,102,191,141, 97,113, 15,147,174, 46,206,130, 66,203,207, 85,240, 6, 17,255,187,220, 39,144,178, 62,198, - 98, 3,209,210,109,189, 28, 3, 51, 51,129, 3,149,160,216,100,184,158,135,188,154,108,182, 81,111,164,236, 56,208,172,169, 11, -241,205, 77,236,224,211,167,216,178,102,245,254,135,180, 97, 89, 31,246, 29,142, 72, 44, 53, 7, 23,231, 58,171,190,110, 8,101, -225,122,215,234,176, 59,124,162,175,131,144,166,199,116, 38,124, 5,100,249,224,154,240,198, 39,138,216,220,108,151,176,117,227, - 9, 44,138, 5, 18,139,178, 61,226, 83,184,159,236,114, 44,179,168, 57,206,157, 84,231,121,153,229, 85,188,174,250,218, 74,186, - 75,209, 53,147, 75,120,149, 8, 99, 33,182, 8, 86,170,148,120, 33, 12, 95, 35, 21,211,201,110, 21, 64, 8,215, 1,142,184, 36, - 5,130, 62,198, 73,197, 8, 3, 8,125,172,122,175,147, 34,179, 49, 47,116,144,143,165,255, 81,246,108, 59, 18, 62,189, 43,118, -222,149,184,231,110,123, 50,224,223,138,187,154,169,220, 31,188, 52,232,227,243,241,116, 62,205, 72,156, 14,132, 25, 30,101, 50, -212,147,209,190,120,167, 48,201, 93,179,127,217,188, 14,104,159, 12, 13,228,197,116, 61, 66,136,154,112, 96,144,231, 47,192, 87, -251,190, 56,108, 90,227,133, 94,247, 99,223, 79,131,197,105,208, 19, 37,168, 19, 86,118,178, 57, 97, 19,164,125, 70, 0, 20,180, - 43,206,140, 11,111, 50,209, 84,195,201,180,229,101,128,181,145,189, 59, 76,106, 97,216,197,184,214,155,173,113,131,253,230, 40, -199, 21,251, 83,240, 79, 0,214,206,101,167, 97, 32,134,162,227,153,116,134,208, 22, 1, 18, 44,202,130,255,255, 39,214, 8, 33, - 1, 27,164,150,100, 30,196,246, 56,153, 60, 8, 32,232,186,149,146,168,113,236,235,220,115,171,255,186, 94,235,120, 50, 53, 43, -241,191, 37, 80,166,181,177, 12,138, 85,219, 4, 47, 63, 27, 46,211,200, 46, 63,255,120, 17,172,183, 72,137,129,155,218,237,157, -123,120,122, 67,238, 34, 51, 65, 8, 62,242, 18,171, 67, 21, 30,125,243, 46,122,212,164,101,246,194,236,229, 22,254, 36, 71,102, - 37,166, 78, 73, 92,106, 51, 84,228,174,236, 98,227,188,203, 8, 33, 44,172, 86,170,144,255,193,139,240,186,208,223,217, 89,186, -165,243, 39,120, 0,166, 13,216,204,150,194,209,129, 70,132,116,142,190,103,174, 49,186,143, 47,136,196, 77,219,196,112, 84,166, - 85,241, 82,214,241,158, 78, 4,114,204, 51, 22,102, 36, 95,123,100,132,221, 93,215, 77,211, 34,161,236, 35,188,158, 16, 47, 3, -178,107, 45,143,249, 94,169,219,250,226, 57,109, 43,202,173, 46, 28,164,189,145,105,168,231, 69,100, 79, 20, 89, 67,151, 42, 1, -100,167, 77,200,239,253,178, 61, 34, 59,214,164,106, 68,177, 8, 73,146,209,224,138,249,154, 94, 2, 69,255, 1,211, 85,177, 94, - 89, 32,149, 70,168,108,123, 78, 57,129, 38,101, 95, 83,159, 9,207, 49,171,228,214, 6, 9, 11, 13,156, 39,169, 10,210,232,183, - 55,197,218,215, 96,185,121, 31, 43, 51, 81,114,183,199, 43,138, 52,200, 47,179,167,234,100,246,153, 20,247, 28,228,145,219,187, - 56,238,220, 97,188, 74, 29,107, 50, 11,178,204, 34,107,239, 79,244, 90,138, 41, 89, 44,238, 42, 15,181,154, 37,108,252,139, 34, -232, 84, 27,176, 70,119,247,132,189,114, 7,103, 92,119,125, 44,152, 54,122, 74, 55, 1, 99, 42,135, 72,153, 54, 18, 20, 31,250, -167, 31,254, 28,223, 93,112,230,108,131, 38,154,110,244,247,164,210,168,189,221,243,142, 21,114, 43,216,251,117, 19,167, 77,160, - 54,132,206,167, 72, 77, 18,103, 99, 5,222, 54, 83,227,207, 11,240,108, 34, 12, 40,237,180,221, 17,214,102,119,244, 71,195,160, - 59, 5,159, 2,144,118,101, 59, 13,195, 64,208,187,235, 92, 84, 5, 85, 2,196, 3,255,255,111,240, 80,169, 28,109,115,216, 38, -187, 62,226, 64,210, 10,168,250, 80, 85,173,242, 16,123, 60,217,157,157,209,127,131,242,171,101, 25, 88,255,114, 41,239, 10, 46, -244, 58,212,117,163, 56,151, 41,218,212, 20, 13,146,106,209,217, 4,186,232,253,175,152,237,180, 81,235, 93, 34,222,111,170,110, -160,151,247,174, 41, 10, 27,100,100,124,129,189, 29,111,184,222, 26,123,116,131, 7,178,243, 15,205, 89,234, 82,154, 88,169,167, -232, 11,159,102, 92, 75, 33,239, 82,118,103,190, 32,194, 74,172,249,234, 35,152, 14,173, 74,182,148,215, 89,100,130,245, 74,222, - 91, 41,184, 83, 40, 4,225,201,103, 17,196, 56,145, 27,206,225,133,130,103, 46,112, 68,231, 94,186,127,103, 49,168,109, 52,183, -154,181,194, 70, 83, 59,152,218,130, 80, 9, 94,110, 31,108,183,224,197, 51,100,228,153, 99, 92,179,189,115,135,207,254,246,161, -220,109,202,215,125, 71,100, 26,226,166,182,206,162, 4,253,235, 81,169,231,102,123, 40,238,128,141, 38, 32,151, 83,101,211,152, -168,220, 76,122, 30,213, 20,179, 74,126, 72,149,136, 42, 11,246, 92,145, 24, 28, 23, 12, 87, 2,106,152,248,215,144, 81,103,191, - 41,237, 46, 69,198, 71,100, 79,150, 52,176, 72, 47, 96,246, 41, 58, 14,196,147, 50, 36, 51,216,137,194,131,210, 46,154,232,196, -136, 56, 20, 35, 0, 29,114,101,157,242, 34,105,192,204,103,195,174, 33, 55,224, 26,223, 89,139,238,228, 89,177, 9,220, 65,228, -152,110,178,206, 78,134,142,242,187, 5, 16,255,117, 66,105, 98,114, 94, 23,104, 39, 46,230,199,151, 12,100, 6,104,110,190,169, - 23,159,159, 52, 82,103,255, 21, 44, 6, 43, 59,200,197,219,167,133,227, 35,151,221,185,161, 90,112, 64, 7,236,154, 39, 2, 26, -161,180, 30, 9, 61,211,108,111,105, 69, 53, 86,133,170, 13, 90, 53,188,157, 85, 39,236,199,250, 32,111, 49,154,229, 70,151,207, - 35, 55,194,193, 79,174,173,134,146,104, 60, 33,122, 49,150,113,113,143,243,137, 1,222,150,142,211,179,180, 88,160,251, 1, 56, -132,172,255, 98,195,162,176, 41,217,130,201,162, 53, 5,150,142,160, 55, 71,239,106,254, 37, 0,105, 87,178,211, 48, 12, 68,227, - 37,105, 73,211, 74,244,128,184,113,232,255,255, 1,159,194,149, 30,128, 82,164, 22,234, 44,182,153,197,142,211,116, 65, 64,143, - 81,101, 69,206,120, 60,203,123,111,254, 24,191,255,216,143, 62,203,125,205, 82,173,230, 82,153, 39, 89, 96,175,168,224,175,121, -246,209,226,254,216, 11, 36,196,102,127, 6,118,240,145,104,135,246,151, 95, 94,179, 8,162, 86,119,213,116,117, 95, 61, 62,125, - 40,198, 68,248,212,153,134,213, 94,157,124,200, 85,219,216, 77, 28,117,116,118, 7,248, 11,212,177, 30,205, 50,100, 12, 49,100, - 6, 19, 53, 84, 17, 43,167, 41,148,158,101,114, 81, 96, 38,232, 80, 16,186,221,211,203, 28,174,106, 73, 14,143, 19, 83, 73, 23, -153, 88,160, 11, 81,198,163, 76, 35, 59,122,176,164,165, 18,168, 98, 39,213,156,218, 9,141,132,219, 5, 21, 49, 32, 83,153, 41, -100, 72,131, 41,149, 74,108,105,150,100, 33,188,173,101,109,186, 46,130, 32,192,237,195,197, 64,162, 58, 24,251, 99, 18, 32, 69, -215,185,183,237,161,168, 84,153,107, 10,118,176, 62,242, 25, 89, 84,252,131, 52, 98, 5,201, 80,181,220,138, 57, 24,163, 70,177, - 93,141,213, 25,140, 16,137, 11,233,109,194,201, 4,128, 69, 24,162,196,205,213,177,210, 99,136,247,201, 19,217, 48,108,111,200, -154, 15,206, 61, 42, 29,244, 84,154, 33, 90, 92,248,163, 85, 3,248, 59, 75, 10,211,126,128, 18, 16,151,187,217, 35,176, 34,225, - 99,152,185, 36, 36, 75, 70,147,112, 24,139,225, 57,126, 58,232, 61,113, 8,239, 33, 80, 64,117, 2,217,167, 1,246,202, 16, 0, -186, 51,240,175,178,159, 87,156,204,192, 31,159,155, 81, 73,212,133, 0, 39,114,140, 92,172,204,196,129, 39, 81,208,209,157,212, - 94,126,219, 4,242,105, 44, 98,144,254,117,125,205,125,192, 77, 61, 5, 98,142,250,192, 39, 73,246,255,156, 59, 4,224,173,173, -207,229, 4,204, 73, 8,194,122,132,121, 71, 78, 19,241, 84,117,169,110,167,186,116,116,239, 78,144,183,142,223, 25, 92,127,153, -231, 38, 43, 32, 38, 95,200,217, 84,223,172,205,186,205, 12,236,113,227,218, 46,115, 19,176,115,239,159,191, 94, 54,230,125,103, - 15, 4,160, 4, 87, 96, 27,103,224,192, 89,196, 78,117,112, 30, 73, 47, 84,208,100, 44,223,235,127,176, 68, 82,145,229,144, 43, -183, 56, 69, 2,252, 3, 31,135, 32,166, 42,144, 0,237,136, 6,205, 90,148,136, 47, 42,212, 68, 73, 81, 91, 83,200,226, 91, 0, -210,174,100, 55, 97, 24,136,218, 78,156, 5, 82,150, 3,234,169,135,138,255,255,158,222,122,163, 85,165,170, 5, 90,182,196,246, -212, 51,118,140, 19,150,110, 17, 39, 14,200, 24, 60,158,229, 45,255,234,207,252, 4,196,126, 54,196, 71, 18, 34,225,215,237,228, - 82,170, 47,241,220, 47, 3,205, 25, 73, 75, 30, 69,121,222,107,254,235, 54,189,253, 96,226, 14,247, 14,255, 31,117,171, 4,208, -123, 72,202,145, 77,115, 57,159, 85,139,149,121,120,222,230, 82,104, 39,168,215, 30, 5,142,113, 19, 30, 77,122, 47,129, 55,205, -147,151,232,188,216, 86, 10, 26, 91,166,205,226,155, 22, 39, 78,152, 72, 68,233,164, 24, 55, 69,149,224,176,126, 80, 8, 3,106, - 85,171, 61,131, 95, 25,107,220,208,107,156,242, 81, 38, 53,136, 66, 3,162, 33, 65,172,200,178,183,146, 72,217,205, 19,168, 73, -101,108,146,162, 42,190, 20, 54, 73, 65, 87, 49,138, 53,124, 39,108,105,130,132,142, 50, 1,155,140, 15, 82,190,174,147,181,210, - 27,131,224,150,224, 54,153,146,116,187,221,192,141,134,197,219, 97, 88, 37, 53,168, 12, 39,179, 88,251,187,203,172, 36,132,210, -173, 93, 82, 49,130,124,252,142,193,159, 73, 78,138,237,110, 0, 46, 64, 24, 97, 58,146,141,134, 69, 6, 90,218, 83, 51, 79,231, -156, 38,208, 53, 91, 61,119, 8, 78,170,208, 54,220, 91,200, 95,128, 81, 7,100,222,177, 12, 8, 28,227, 48,159,143, 64, 20,158, -209,202,174, 10,155,196,249, 31, 68,130,138,168, 61, 71, 66, 71,224,141,231,224,180, 69,195,157,215, 3, 53,124,157, 27, 6,247, - 46, 6,112, 53,253,196, 47,161,233, 62,114,195,105,211,133, 46,134, 80,222,191,132,120,156, 38,119,228,120, 33, 96, 16,161, 55, -155, 5,246,167,252,253, 4,219,195,163, 38,140, 97, 71,166, 37, 59,165, 47,177,203,201,251,249,121,221,119, 15, 85,156,254,128, - 30,244,225,114, 70,239,147,119,244,235,112,108, 85,228, 52,225, 27,211, 98,134,125, 16, 80, 58,229,123,174,101,234, 49, 66,104, -235,129,245, 54,242,140, 38,217,168, 76,230,235,102,185, 83,187,161, 44,171, 36,203, 81,122,100,249,250,249,178,213,136,142,119, - 45, 0,100, 62, 66, 83,104,108,217,107, 77,186,153,104, 35,132,253, 24, 25, 66, 22,216,162, 89,187,125,161,197,231,132,252,240, -237,120, 26,215,208, 58, 61,187, 28, 39,242,246,116, 41,251,225, 74,229, 50, 19, 8,242,131, 47, 1, 88,187,150,222,182, 97, 24, -108, 82,150,156,174,201,218, 98, 75,215,245,178,251,246,255,129,253,145, 29,119,111, 47, 69,209,184,141, 31,178, 56,146,146, 18, -187,246,130, 12,216, 49,135,196, 9, 34, 81,159,200,239,241, 31,244, 77,255, 4,228,231,222,241, 99,106, 84,180, 92,162,172, 39, - 92, 76, 13,159, 27,197,189, 19, 82, 77,196, 80,163,176,133,195,189,239,161,128, 59,112, 63, 10,218,145,103,232, 93,143, 38,159, - 81,239,243,169, 40,238, 93,245,253,238, 6,172,251,249, 75,105,239,154,139,169,115,107,204,252, 48,249, 88,126,227,239, 96,191, -149,197,173,239, 25,207, 62,159, 49,217, 31, 70,118, 49,229,145, 82, 73,122, 98, 83,108,217, 95, 25,220,126,168,154,174,247, 25, -227,159, 67,193, 54,185,223,205,175, 54,149,187, 93, 91, 36,190, 57, 66,223,209, 83, 75,107,229,138,181, 0,107, 71,215,150,107, -177,132,108,240,178,226,101,186,177,178,166,157,193,171,170,188,180, 42,209, 67, 6, 29, 12, 1, 68, 76,242,184,107,234,183,166, -110,253, 83,231,187, 65, 22,208, 10,112, 39, 36,162, 3, 79, 88, 66,106,235, 23,207,128,197,246,225, 99,192,173,129,141,167,149, -129,237,202, 52,102,179, 51,151,123, 81,243,104, 36,130,110,115,136,225, 13, 74,152, 33, 76, 41,114, 89,117, 15,195,177,133, 75, - 89,112,191,208,103,200,158, 90,169,237, 78, 71, 11,174,216,188,201,212,179,169,189, 73, 44, 52, 97, 90, 55, 96,108,219, 53, 89, -189, 11, 93, 2,252, 43, 85, 41,140, 74, 15,230, 84, 26, 97, 9,197,200,177, 67, 14,188,148,111,173,242,202,129, 3,117,204,160, -144, 34, 35,162, 21,151, 63,245, 95, 99, 34, 79, 38, 27,119, 2,156,126, 9,130,145,240,105, 54, 58,206, 55,228,144,131,253,142, -116,163, 89,113, 39,154,237, 94, 56, 53,107,155, 52,208,166, 7, 74, 62,110, 40,167,108, 39, 82,211,100,131,191, 11, 62, 93, 4, -239, 14,173, 4, 30, 45,135,179,156,216,119,195, 57,144, 52, 67, 11, 6,212, 12,170,133, 19,105, 36, 15,181,248,124,113, 47,233, - 51,161, 3, 44,187,224, 93, 97, 92, 16,251,200,146, 33,144, 49,168, 49, 5, 77,223,180,190, 69,116, 55,213,245,215,139, 47,252, -251,158, 95, 31,222,250,215,189,248,207,212, 94, 24,124, 62,106,230, 52, 51,121,104,169,147, 39, 37,230, 32,132, 1, 53,200, 77, - 26, 59, 54,186, 26,165,217, 82,186,255,148, 69,169,112, 80, 3, 63, 82,147,163, 52,122,207, 72, 22,111,217,130,139, 15, 13, 62, -153, 90,218,255, 17,128,181,171,233,105, 35, 6,162,182,199,206,238, 38,219, 18, 1, 61, 20, 9,245,196,145,127,222,255,210,115, - 15, 21, 18, 72,244,128, 16,129, 18, 54,201,218, 51,245,216, 94,199,155, 4,104, 37,142,137,162,100,181, 89, 63,143,103,222,199, -199,204, 87,255,171,144,207,162, 36, 89,122, 15, 36,158,131, 19,187,214, 37,180, 19,136,126,208,253,134,198, 66,170, 60,188,197, -108,174, 55, 80,107,194,157,165,107,162,169, 84, 23,166, 62, 39,229,255,173, 5,250, 50,217,227,172,155,177,247,150,254,210, 54, -151,223,230, 87, 93,255,253,199,111,143,117, 0, 60,179,115,168, 98, 44, 96,241,212,179,213,141,255,182, 95,168, 79, 65,124,117, -220,109, 94,139, 20,247,241, 46, 28,187,145, 38,133,219, 29,129, 49, 66, 75, 7,159,172,107,141,158, 55,149,234, 58, 26,136, 52, -254, 51,199, 66,156,115, 77, 33, 59,222,107,196,189,192, 27, 65, 47,137,117,147,238, 42, 55,130, 0,206, 90,125, 58,159, 26, 96, - 21,243,195,210, 35,171,245, 71,182,154, 69, 91,196,249, 50,192, 46, 14,134, 73, 64,202,195,186,209,234,164,153,180, 19,121, 50, - 99, 83,107, 14,132,212,166,169,180,169,140, 1,120, 92,116,143,127, 86, 87,247,207,243,101,247,208,173, 87,142, 52,135,254,240, - 10, 51, 64,179, 9,156,125,134,163,102, 82,129,156,214, 76, 14,126,105,235,159, 79,114,229,212,157,173,110,109, 32,119,250, 31, -141,198, 3,145,145, 27,165, 60,254,140,106,101,142, 81,194,130,161, 24,229, 64,219,222,202,152, 46,130,197, 56, 6,179,125,225, -144, 68,145, 18,221,112, 24,230, 97, 46, 8, 74,242, 6,101,224, 56,160, 22, 26,197, 12, 28,232, 80, 56, 49, 42, 82, 74, 19,142, -194,186, 0, 83,159,133, 82,180,187,139, 70, 98,177,132,103,242,173, 30,120,147, 36,182,153,125, 52,140,140,246, 55, 17, 85,208, -186,163, 97,143, 30,196, 65,228,228,187,148,132, 2,159, 25,217,115,200,117,206,162,221, 1,119,218,222,163,177, 81,122,106, 32, -189,177,238,101,106, 12,203,237,178,149,135,104,187,184,119,121, 84,180, 80,154,181,235,112, 92,176,199,151, 17,220,247, 39,225, -255,120,184,160, 87,183,166,120,194,240,181,186, 12,197,187,228,181,192,207,171,168,161,109,116,235,220,198, 98, 40,185, 1,131, - 96,148,181,145,126, 19,208,214,215, 67, 30,226, 85, 47,108, 79,254,234, 86,207,253, 2, 25,203,112,195,166,190, 12,107, 61,219, -249,166, 92,178, 56, 23, 13,111, 90, 54,131, 36,110,237, 67,120, 30, 40,101, 5,132, 64,149,208, 29, 50, 66,111,130,130, 57,236, -253, 42,116, 89, 77, 62,191,138, 36, 18, 10, 82, 78, 14, 5, 76, 37, 99,244,167,172, 84,253, 87, 0,214,206,109,167,109, 32, 8, -195,179, 7,175,109,154,164,196,149,138, 16, 69, 61, 75, 60, 1, 79,205, 61, 15,193, 93,239, 43, 85, 69,173, 26, 32, 96, 5,145, -216,241,102,167,158, 61, 56,107, 19, 4,149,250, 2,145,172,140,102,103,255,249,247,251,255,155,127,230,159,206, 0, 19,181, 99, -140,130,120, 30,157,219,187,111,109, 59, 11,143,245,206,127,183,127,216, 74,123,204,205, 83,193,252, 36, 8,232,184,249, 70, 47, - 91,249,231, 60,121, 43,210, 66,138, 84, 8, 37, 25, 79,146, 18,244,217,143,219,249,114,173,200,215, 4, 30, 75,109, 45,151, 33, -254, 15,183, 42, 17, 17,156,217, 31,224, 99,150,126, 65, 61, 3,189, 12,225, 71,171,231,138,204, 68,130, 41,247,166, 11, 51,135, - 58, 95,155,114,177,154,230,202,109,131,167,132, 17, 22,167,211,226,228,120,255, 98,118,125, 62, 43,231,182,227, 79, 0, 62, 2, - 47, 64,126,135,230,222,159,240,208,142, 13,239,149,156,188, 74,223, 29,140,243,118,246,168,116,145,233,117,157, 52, 68,184, 48, -141,230, 85, 59,170,115,154, 30,115, 50,245,194, 72, 74, 37,249, 40,149, 89,202, 95,103, 42,203, 85, 99,232,125,221,229,109,117, -245,243,250,242,102, 81, 46,235, 55, 35,117,124, 80,124, 61, 58,188,186, 91,174,234,166, 45,231, 84,182,149,141,163, 4,239,106, - 92, 32,215, 40,126,223,235, 95, 15, 88, 82, 61, 19, 27,137,130,152, 54,132, 81, 36, 17, 26,132,165,108,177,128, 20, 18,206,113, -215,125, 59, 6,217,221, 11, 40, 93, 95,232,232,192,189, 4, 11,239,216, 11, 34,178,195, 15,192, 83,195, 59, 11, 70,120,216,186, - 53,192, 68,205,100,216,222,241, 89,115,116,220, 44,123, 83,191, 69, 16,179,136,186,211, 49,103, 34, 42, 47,115,204, 45, 35,208, -113,225,185,143,111,103,172,147,209,177,167,169,176,248,130,225,192, 99,246, 35, 53, 5,195, 57, 17,190,191,239,217, 61,251, 58, -240, 0,108, 99,243, 66,115,199, 97,115,119, 9,168,102,248, 19, 60, 72,230, 62, 47,110,151, 4,139, 79,174, 88, 89,255,225,210, -112,120, 31, 28,179,149,109,238, 47, 17,106,186,238,159,139,236, 97, 83,189,220,186, 13,143,146,106,152, 7, 52, 58, 12, 57, 79, -236, 95,146,138,201,135,241,167, 21, 61, 71, 34,193,173, 49, 88,235,106, 79, 40,186,231, 58,172,166,141,195, 38,191,128,161,133, -184,161, 61, 42,197, 45,217,143,213,218,122, 28, 67,124,167,231, 85, 88, 3, 12,218, 59,176, 53,169,182,151, 86, 10, 18, 96,206, - 1, 32,109,249,216, 76, 15, 52, 17, 5, 79,135,181,188,203,230,113, 16, 82,247,218,156,116,121, 90,196, 36,130, 17, 51,135,246, -190, 68,153,100,127, 5,160,237, 90,114,219,134,129, 40, 73, 81,150,140, 70, 77,224, 24, 48,208, 58, 40,178,233,166,232, 5,178, -207, 5,114,190, 94,162,219,228, 4, 89,101, 93,160, 72,186, 40,208,124,225, 56,136,109, 72,161,134, 25,206,144, 50,105, 59,159, - 77,189,242, 66,254,209,212,112,222,204,155,247,244,255, 8,223,111, 94,179, 82,165,177,221,148,115,178,250,155, 81,155,125,129, - 44, 37, 18,245,202, 46,145,183, 41,213,109,217,137,205, 28, 93,201,224, 70,190, 88, 52,191,249, 48, 96, 23, 54,252,163, 0,178, - 76, 99, 22, 76,198, 7,190,214, 25,110,124,163, 60,116,178, 81,231,205,125,193,169,128, 71,169,247,156, 47,139,249, 75,189, 14, - 29,198, 89,197,250,108,248,166,148,176,161,200,119, 79, 35, 77,242, 94,140, 91, 49, 46,202, 89,189, 40,132, 29,170,178,206,196, -241,159,171,211,135,135,187,112,241, 45, 93,124, 88,228, 71,101,117, 50,157,204, 5, 20, 66,238,200, 60, 47,123,251,159,119, 15, -190,142, 38, 55,139,169,168,235,166, 86, 37,232, 22,182, 20,158,106, 98,160,112,103,102,185, 82, 79, 68, 80,252,136,251,183,175, -203, 18, 1,169,184,156,214,231, 23,183,215,147,199, 27,204,217,155, 22,119,115,213, 47,190,143,182,191,141, 7, 63,127,253,251, -113,118,126, 37, 28,221,119,232,166, 79,243,221,157,193,157,249, 48,135,220,201, 1,184,186, 61, 34,132,182,199,205, 81,124,102, -217,105, 90,197,116,111, 34, 1,208,200, 53,139,122, 73, 43,211, 50, 2, 79,236, 69,213, 18,176, 81,150,205, 47,130, 16,134,227, - 10,242,114, 94, 70,120,177,220,144, 32,218,200,208, 57,148,125,108,204,211,128,117, 57,235,181,124,227,221,148,140,224,167,100, - 92, 69, 86, 70,240, 20, 44,183, 93,172, 23, 66,229,138,156,244,133, 26, 21,140, 76,130,144,142,220,156, 98, 42,209,177, 70, 21, -207,182, 51,123, 6, 2, 36,102,105,176,224,106,157,190,137, 93, 46,116,167, 26,214, 29, 36,177, 67, 94,199, 63,106, 83,136, 12, -221,136, 73, 18,226,229,170, 2, 94,164,235, 32,151, 43, 12, 54,105,250, 66,154,232, 36, 84,200,119,202, 9,240, 35, 87,185,163, -157,184,193,186,122,197, 40,120,180,245,233,122,118,153,106,213,188, 22,159, 66,126,141, 89,157,170,122,149, 49, 24,127,179,189, -234, 75,137, 16,158, 44,197,230,160,102, 6,115,164,198,210, 39, 2, 97,101,141,177, 2, 52,121,125,200,150,112, 17, 89, 20, 2, - 83,104,232,160,236,130,187,151,116, 39,188, 14,116, 32,200, 76, 56, 98,158,113, 33, 94,182, 94,189,221,211,150, 24,103,105, 86, -224,244, 85, 55,246,128,107, 3,129,132,219,248,248, 11, 57,208, 35,128,112,243,137,238,174, 3,215, 22,120, 22,128,180,107,107, - 73, 32, 8,163, 51,187,234,238,154, 21,164,221, 40, 9,242,193, 30,138,138,192,168,254,113,127, 34,232,177,199,232, 37,130,162, -204, 36,211, 50, 75,215,205,157,253,154,251,206,152, 69,145, 44, 34,226,138,224, 55, 51,231,187,156,115,126,210, 7,206,231,243, -181, 90,173, 94,175,255,103,228, 72, 63,170,213,106, 24,210, 83,112, 52,246, 90,103,195,229,114,121,105,121,169,211,105,127,233, - 76,194,228,113,133,239,127, 3, 88, 75, 68,179,141,229,138,221, 63, 58,220,220,221,110,212,239, 56, 69,152, 49, 83, 57,193, 76, - 62,179, 78,163, 43,236,202, 28, 17,161,124,247, 18,101, 92,172, 42, 0,104,239, 96,127, 99,103,171,121,223,136,233,151, 64,106, - 59,240,204,192,187, 91,100,176, 90,230,178,218,226,142,252,174, 81, 33,244, 9,250, 8,162,143,100,193,243,135, 36,121, 5, 66, -175,135, 65,120, 21, 13,219, 95,240, 81, 68,226, 18, 56, 31,132,129,130, 21, 39,187, 94, 12,118, 43,165,181,153,169,110,123,120, -251, 52,232,209,251, 49, 42,228,104,128,186,121, 63, 67,113,250,180,151, 97,117,155, 28, 14, 60,119, 54,112,131, 44,238, 13,162, -235, 70,247,236,242,241,228,178,117,209,234, 62,244,195,155, 56,234, 64,236, 51, 18, 19, 58,127,121, 59,190,105,158,190, 15, 66, - 4, 69,132, 42,222,212,114, 97, 21,251,243,221,164,192,148, 31, 29,148, 17, 69,117,169,116,202,132, 58,137,132,212,216,192,146, - 2,233, 40, 77, 20,144,154,159,114, 56, 93, 34, 88, 85, 98, 1, 0, 75,200,209, 96,191,152, 35,116,120, 92,204, 93,107,134, 40, -139, 32,221, 69, 52,188, 49, 82, 64,148,128, 9,221,172,235,247,209, 14, 19, 45,107,164,100,120,106,188, 32, 60, 98,112, 26,144, -216, 86,220,144,241,137,127, 94, 80, 32,141, 64,148,152,123, 42,207,155,164,200, 39, 29,251,193, 86,122,148, 38, 75,200,224, 49, - 73,201, 70,211,254, 52, 49,106,232,137, 65, 90, 86, 64, 9, 59, 86,101, 10,198,167,223, 45, 40,110,217,163,219,159,154,208, 30, -248,235, 88, 76, 98, 52,137, 77,192,158,229,202,250,225,168,175,114,150,201,127, 42,182,138, 51, 72,208,222, 89,113,134, 99, 56, -186, 51, 46, 6,171, 37,127,142,190, 19,141,132,239, 14,248,174,224,198,195,136, 8, 21, 33,186,209,199, 52,223,165, 27, 52, 33, -204,124,131, 99, 20,193, 75, 66,138, 25,166,189, 13, 24,193,144,159,211,142, 74, 98, 88,110,235, 34,172, 93, 65,185,116,187,244, -255,136,145,112,251, 17, 46,181,250,152, 50, 93, 9, 44,149, 77,126, 59,159,184, 87,147,132,159, 2, 80,118, 62, 63, 77, 4, 81, - 28,159,217,182,233, 15,106, 77, 17, 12,138,198, 11,145, 4, 8,176, 23, 8, 49, 49,254, 13,198,164,234, 65,210,163,246,223,211, -171,103, 19, 15, 74,194,209, 8,129,132, 96, 33,128,110,177,203,238,206, 60,231,189,249,177,211,101,149,184,153, 52,123,216, 54, -147,217,238,219, 55, 51,239,251,249,254, 43, 73, 81, 1,183,223,239, 23, 34,126,175,215,187,126,126,227, 17,134,225,187,193, 64, -119,103, 61, 12,223, 14, 6,126,117,179, 62,125,241,178,183,176,248,184, 0,101,246,133,233, 55, 6,119, 31,123, 80, 40,189,113, -240,210,205, 39, 91,175,250,111, 86,194,117,107, 34,193, 28,237,203, 64,111, 8, 66,134,159,232,181, 0, 66, 43, 35,169, 6, 21, -140,151, 60, 11,183, 54,159,111,191, 94, 90, 91,149,148, 42, 57, 68, 59, 55,170, 81,248,129,139,227,213,121, 86, 91, 96,193, 12, -225,209, 59, 84,147, 83,179,230, 74,165,135,214, 58, 37,230, 68,158,178,228, 40, 30,223,175, 55,239,176,218, 5, 19,223,153, 56, - 41,251,214, 25,131, 47,201,229, 24,141, 59,106, 15,167,219,203,247,110,159,159,167, 31,119,135,159, 15, 84,250,158,168,192,222, -170, 98, 25, 71,163,202,218,117,149, 43,242, 20,120,119,138,119,154, 60,205,196,183,227,232,253,206,209,135,175,135,159,246, 78, -134,163,232, 64,140,135, 12, 25,244,179, 65,208,101,108, 4,217,126, 18,255, 20,233, 92,181,249,108,234,238,211,233,149,197,217, -141, 86,123,141,215,231,126, 67,147,198, 71, 18, 79, 13, 41, 14, 25,137,179,213,112,161, 38,143, 48, 75,153,182,110,176,110, 64, -210,240,197,193, 49,198,201,151,194, 88, 92,105,219,107,193, 93, 48,178, 97,159, 89, 48,138, 21,220,219, 34,113,145,111, 15,230, -187,118,148,188,219,188, 29,174, 45, 20,216,224,110, 20,222,110, 57, 94,119,217,107, 96, 23, 19, 56,252, 37,238,219,126,114,207, -227, 87, 22,100, 26,153, 87,142,227,108,137,192, 81,188, 56,152,170, 83, 13, 12, 52,165, 17, 78,177,203,161,216,152, 53, 58,114, -154,126, 13,159,202,175, 17,166, 6,209,252, 20,247, 90,224, 46,115,219, 26,134,138, 60, 17,220,221,154,190,118,125,225,212,220, - 63,159, 25,105, 27, 88,187, 14,207, 22,150,231,193, 93, 78,218,134,240,124,168, 39, 30,121,240, 54, 84,254, 43,184,107,137,226, -131,238,163, 22, 26,215,151,152,233,102, 70,252,140, 93,104, 4,245,178, 27, 87,190,200,131,242,142, 74,227, 86,163, 67, 21,168, - 65, 5, 25,144, 16,227,132, 30,179, 24, 53, 86,227, 76, 92,166, 87,163,248, 87,148, 92, 68, 87, 81,156,198, 82, 79,250, 89,133, -144, 20, 1, 38,242,170, 33,122,131,131,161,248,107, 66, 40,102,226,210, 56,143, 11, 59,182, 6,162, 46,201,193, 28,101, 74, 32, - 80, 3, 5,234,125,146, 17, 90, 26,163, 11, 61,104, 32, 29,235,148,130, 62, 89,244,232,123,228, 76,207,232,197, 3, 34, 33,148, -188,154, 97,252, 17,128,177,107,235,109, 26,134,194,177,211,180, 73, 53, 96, 33,169,132, 88, 25, 66, 43,237,107, 95,120,226, 97, - 18,208, 31, 59, 9,129,144,248, 31, 45, 55, 65,138, 64,226, 58, 36,210, 78,108, 74,154, 56,137,141,125,124,105,154, 70,130, 60, -197,169,123,108, 89,206,201,241,231,207,223,249, 55, 62, 19,134, 97, 16, 4, 81, 20, 73, 55, 61,155,205, 22,139,197,106,181,226, - 49,184,185,247, 60,143,199,227,188, 94,204, 11,113, 44,189, 63,255,151,137,253,167,211,233, 98, 62, 79,211,180,113, 31,132,225, - 0,170,201,162,185,134,119,134,110,191,255, 17, 26,229,166,110, 6, 65, 2,246,121, 55, 2,232, 80,164,127,226, 31, 33,211,104, -253, 26, 77, 38, 89,186,233,131, 17,131,201,248,225,224,244,201,163, 55,243,197,243,179,167,252,225,201,100,124, 17,175,253, 48, -248, 28, 45,121,241,104, 56,228,245, 63, 45,151, 90, 20, 18,157,140, 70,155, 52,251,249,237,135,122, 67,225,203,120, 56,240, 31, - 62, 62,125,247,234,245,203,179,103,124, 72,239,141,239,175,227, 88, 24,249,176,212,204,100, 81,245,210, 98,188, 28,226,206, 17, -104,188,254,134, 37,149, 81, 94,204,106,251,171,141,120,164, 4,193, 50, 56,119, 74,215, 52,239,229,116,236,121,135, 37,126, 91, -112,231,219,178,206,146, 31,167, 91,118,119,226, 31, 36,118,249,226,253,249,245,174,243,224,110,232,247, 61, 23, 35,238,211,133, -210,189, 43,114, 54,254, 33, 20, 59,120, 83,208,175,151,213,175,171,138, 18, 98, 51,114,124,195,113,110,123,209, 58, 59,191,178, -143, 15,122,174, 16,202, 32, 93, 65,254, 44, 51,138, 9,238,244,186,126,137, 6, 5,115,115,193,183, 97,132, 7,232, 37,111,241, -154, 72, 21, 73,147, 78,153, 80,107, 3, 2, 89, 74,208, 73, 98,136, 50, 95,173,150, 20, 21,179, 23,192,196, 29,180,128, 33,164, -168, 47, 72,121,125,164, 1, 71,195, 82,167,160,250,175,197, 88, 24,128,200, 10, 32,109,136,185, 43,148, 15, 81,166,115, 13, 41, -218,140, 38,211, 86,245, 40,216, 50,120, 79,107, 42, 78, 19,227, 87,187,200, 47,210,106,119,172,109,237,101,152,150, 91, 15,173, -179,129,107, 1, 88, 5,208,195, 3,153,125, 12,215, 19,115, 72,254, 61, 70,109, 26, 3,250,228, 84,205, 85, 34,180, 31, 2,179, -157,240,166,169,196,199,182,104, 56,133,227,169,180,225,220,181,228, 67,147,248,134,244,206,129, 86, 65, 1,111, 86,115,241,251, -114,202, 58, 31,142,162,189, 91,109,129,188, 89,238,252,191,115, 55,125,250,126,241,197,106,203, 63,209,104, 32,163, 77, 54,164, -231,184,121,145,237,153,197, 74, 8,158,150,164, 34, 24, 72,229,210,219, 50,214, 73, 74, 98, 83, 33,197, 46, 68,132, 24,127, 11, -138,156,228,204, 74,186,216,225, 35,217, 17, 42,132, 72,242, 88,248,146,182,162, 24,180,133,177,173,194, 27,216,130,170,161,126, - 84,197,227,216, 86, 28, 16,138,213,233,113, 86,110, 19,119,241,161, 46, 37, 63, 88, 37,124, 22, 42, 5, 88, 51,180, 37,167,150, - 22,218, 8, 51, 42,125, 48, 7, 10,152,122,127, 5,160,236,106, 94,155, 8,162,248,204,236,210,213, 82, 37, 32, 88, 73,147,155, - 39, 61, 22,141,110,143,246, 38, 4, 47,226, 81, 3, 85, 80, 16, 41, 53,208, 96,109, 73, 41, 37,144, 66,175,189,197,139,224, 57, -249, 27, 90,132,254, 3,126, 43, 38,149,210,143, 88, 53,105, 62,118,119,198, 55,243,118,246, 35,161, 21,151, 37, 76,150,100, 50, - 73,102,127,243,230,253,222,251,189,127,227,123,169, 84,130, 71,128,224, 98,177,104,219, 54,180,243,249,124,181, 90, 5,124,143, -182,241, 41, 28, 91,155,155,149, 74,229,214,244,116, 54,155,125, 56, 51,131, 40,108, 79, 77,173,149,203, 3,237, 7,185, 28,180, -177,243,213, 98, 49, 48,216,239,231,114, 55,245,245,245,114,121, 34,157, 6,123, 31,222, 8, 87, 0,199, 1,223,241, 83,106,181, -218,203,197, 69,188, 94,152,159, 71,136,199, 91,249,197,210, 18,224,190,122,253,225,234,242,114, 71, 46, 30,242,198,201,216, 25, -232, 13,206, 70,189,241,249,253,199, 39,207,103, 59,199,146, 4, 93, 41, 44,220,185,119,247,154,125, 3,218, 59,245,198,198,218, - 58,244,242,120,110, 54,153, 78,193,149,237,173,183,111, 94,189, 86,247,150,220,161, 77,102,174, 39, 83, 19,112,254,248,190,243, -229,195,167, 71,115, 79,177,147, 82, 97, 1, 22, 3,164,214,168, 74, 82,132, 99,151, 11, 24,214,101,195,188, 66,172,175,158, 3, -102,248,177,154,235, 99,218, 78, 55, 20,214, 19, 13,253,209,156,207,132,154,244, 7,220, 61,232,180, 83, 35,214,237,115,137,189, -158, 83,119, 97, 98,122,109,206, 45,198, 18, 66,156, 17,116,140, 26, 46,163,223, 68,127,187,185,127,200,197, 69, 66,158, 93,189, - 52,153,188,176,251,167,187,215,118,127,123,228,221, 81,175,213,147,140,255,175,174, 39, 9, 29, 69,207, 48,233,116,146, 36,132, - 36,144,127, 50,193, 71, 45,211, 0,128, 5,168,230,108,180,231,151, 25, 50, 93,110,185, 60,209,247, 88,215,107, 41, 19, 20, 5, -186,132,116,252,201, 4, 88,243,172, 53,206, 68,183,213,223,135,229, 2,195,216,185,230, 55,181, 28,135,239,143,229,148,210,129, - 58,141,194,247,123, 41,205,126,206,197,128,241,142,229,203, 98, 50,238, 58,234, 67,139, 36,198,196, 82,136, 23, 68,159,115, 17, - 45, 49, 26,238, 3,194,160, 24, 26, 12,111, 56, 8,143, 13, 37,178, 70,113, 95, 9, 68, 27,244, 52, 93,131, 72, 76,151, 95,152, - 61,132,120, 21, 20,175,215, 0,141,242, 58, 65, 29, 99,225, 60, 47, 66, 0,224,255, 21,232,213, 68,192, 40, 22, 87, 26, 87,170, - 57,209,205, 35,124, 7,174,192, 52, 89, 95,144,158,135, 57, 71, 65,206, 87,196, 33, 64,152,118,233, 80,130, 69,181,104,144,154, -203,196, 64, 42, 95, 84,222, 93,136,144, 89,141, 9, 66,136,161, 28,168,255,139,165,143,239,167, 24,150, 37,144, 51,210,116, 60, -231,116, 31,151, 74,251,231,228,228,108, 53,192,244,190,211,183,204, 17, 9,218, 96, 99,181,155,169,243, 41,139,145,102,231, 8, -126, 48,248,190,142,220, 59,114, 85, 97, 76, 70,169,187, 88,118, 28,235,225, 73,157, 48,102,200,221, 63, 53,116,189, 16,195, 31, -182,161,138,145, 17,165, 65,134,224, 75,209,204,247,217, 20,157,152, 74, 53,117,193, 2,169, 50, 69,225,168,184, 26, 46, 66, 90, - 49, 36,171, 13,148,192,241,131,224,229,244,128,129,193,150,227,175, 0,140, 93, 65,107, 19, 65, 20,222,153, 77,210,184,233,161, - 69,193, 67,171,160,146,174,135, 66, 91,132, 98,205,143,240, 34,226, 73, 60,120, 16,133, 34,158,114, 11,197,171, 7, 47, 27, 3, - 34,226,177, 30,155, 66, 40,105, 61,120,242,228,189,177,189,180, 24, 65,193,160, 33,164,187,217,157,241,205,123,179,179,155, 53, - 68,115,154, 12,155,217,205, 50,251,205, 55,111,223,247,189,127,227,123,181, 90, 5,122, 94,171,213, 0,193, 1,202, 1,208, 31, - 34,106,195, 87,211,134, 70,187,221,126,191,189, 77,113,152,157,102,243, 96,127, 31, 72, 58,141, 0, 32, 14,224, 75,140,219,180, -161,177,186,182,246,124,107, 11, 64, 28,134, 50,171, 55,245, 55, 60, 15, 46, 29,128,254,102,165,114,122,114, 2, 32,254,116,115, -115,201,117, 97,112,128,114, 56, 30,214, 6, 56, 5,244,215, 61,207,156,136, 62,112, 24,128,251, 51,117,252,245, 71, 79, 30, 15, -227,157, 1,220,184,214,206,110,217,117,143, 14, 59,212,128,206, 55, 94,227,248,176,179, 94,217, 88, 94, 93,121, 91,111,192, 13, -186,247,224,254,141, 91, 27, 11,151, 22,225, 2,234, 47, 94, 46, 92, 94,188,125,247,206,199,131, 15,223, 78,187, 52,239,247,154, -173,171, 75,229,227,206,151,118,179,117,205, 45, 67,207,187, 87,175, 97,144,196, 54,195, 74,120, 60, 37,164, 31, 69,225,119,203, -159,177,236, 43,202, 9, 70,252, 80,134,140,178,103,201, 62, 34,120, 9, 33, 62, 22, 28,235,125, 62,229,197,251,232, 36, 12,139, - 65, 15,232,130, 84, 5,212, 87, 28, 39,143,165, 2, 97,246,157, 69,209, 94,255, 87, 87, 70,105,242,179, 60,239,124, 29,200, 79, -159,187,253, 80, 14, 66,216, 87,242,188,218, 48, 42,183, 82, 11,117, 26,168, 12,102,232, 50,135,133, 24,148, 56, 93,209,146, 97, - 36,244, 44,194,210,120,202, 89, 41, 87,178,217, 92, 16, 6,204,242,185, 12, 41,132,128,211, 16,149,150, 66,248,114,248, 91,248, -179, 5,231, 92,254, 98,127, 4,107,153,175,253,188,208, 40, 44,225,118,152, 33,194,180,104, 71, 51, 24,237,223,192, 8,220, 35, -138,216,136, 24,106, 8,226, 69,172,107,210, 48,111, 37,242,178,191, 45,127, 19, 42,202,146,180, 72, 19,198, 23,227,228, 93,253, -133,248,197,238,196, 93,212,244,160, 45,252,220, 78, 87,251,153,154,103,144,134,120,110,197,152, 28, 19,121,141,242, 36,168,224, - 9, 87, 78,138,222,177,140, 5, 61, 22,187,226,134,224,243,241, 55, 83, 44, 35, 1,203,104,155, 98,111,228, 56,149, 72, 98,186, -181,137,201, 36,133,209,178, 9,111,105,145, 56, 45, 81, 76,243, 77,125, 5,209, 88, 38,131, 76, 45,167,198, 86,200,196,111,228, -255, 72,103,114,220,158,168, 83, 45,168, 23,146,163,140,216,149, 79, 13,219,230, 44,202, 80,215,167, 27, 69,129, 24,207,187, 75, -165,196,161,111, 23,211, 37, 89,124, 1,220, 37, 56,239, 92,152, 43, 20,207,236,194, 32, 26, 2,184, 3,151, 87, 58, 99, 84, 85, - 7, 10,222,113, 56, 38, 48, 42, 2,207, 14,101, 79, 82,218, 12,249,250, 74, 99,215, 28,226, 62, 30,205, 72,114,182, 46,166, 74, - 94,138, 90,198,140, 8,174,156,197, 8, 64, 48,208,196,152,206,131,156, 44,227,199,135,130,147,181, 73,137, 59,179, 51,243,197, -124, 81, 68,163,159,126,239,143, 0,148, 93,203, 74,195, 64, 20,157,153, 38,213, 84, 69,180,130,130, 32,168,223,225,194, 7, 46, - 68,221,246, 59, 92,248, 21,214,159, 18,116,235,214, 23,130,214,199,166, 69,138,210,154,182, 51,227,125,204, 76, 30,181,136, 89, - 72,168,100,154,152,120,115,238,189,231,158,243,119,124,111,143,149, 62,126,221,250,125,196,176,215, 20,106,177,126,210,110,135, -146, 11,160,254,203,171,171,210, 62, 87,111,158, 91, 45, 56,117, 14,253,124,219, 23,234,117,248,185,189,183,199,248, 61, 44, 2, - 59, 28,169,225,124,224, 88,216,129, 99,207,207,206, 14,143,143, 27,141, 70,179,217,100,252, 14,183,249,165,133,219,201,233,105, - 45,169,221,209,202,121,130,188, 40,170,217,220,223, 98, 81,101,161,142,221,208,173,221, 29,194,239, 45,248, 34,248, 36,169, 37, -251, 71, 7,112, 28, 32,125,199, 83,102,169,144,156,202, 49, 47,117,119,123,147,235,255, 59,178,154,115,100,203,146, 38,219, 21, -186, 99,123,171, 42, 90,143, 18, 72,225,158,204, 32, 17,134,121,141,108,170, 23,166, 91,131,165,181,240, 37,251, 24,249, 83,136, - 99, 59,163,193,116, 69, 37, 21, 53,180, 88,245,254, 40, 63,250,226, 35, 85, 23,239, 95, 40, 85, 22,161,200, 1,230,140, 56,244, -204,202,171,238, 31,193, 83,149, 36,143, 64,230,216,166, 50,244,250,140,154,171,138,217,116,212,131, 92, 21, 45, 12, 53,242,195, - 98,180,141,131,228, 20, 18, 88, 65,118,148, 50,181,195,239, 81,127,166, 58, 51, 31, 45,119,134,175, 26,126,201,120, 77, 58,238, -138, 51,186,205,154,128,186, 80, 73,176,236,156,231,131, 59, 65,116, 54, 77, 29,177, 57,134,155,219,144, 99,186,228, 69, 49,119, -105, 66, 43,149,201,143,129, 22, 41, 69,222,176,194,120,142,154, 20,101,189, 54, 59, 9,131,255, 49,181, 90,156,126,252,157, 48, - 70, 33, 62,144, 38,149,147, 19, 67, 44,156,161,124,230, 87,134,241, 83,223,131, 43, 1,115,186,101,194, 75, 85,227,248,175,156, -204,122,151, 36,135,224,184, 24,129, 37,233, 94, 34, 86,152,188, 84,128, 9,154,236, 1,137,231,255, 36,210, 99,118, 21,108,230, - 61, 25,116,156,189, 86,202,171,188, 12,142, 21, 19,223,151,255,216,136, 75, 46,162,226,114, 8,225,173, 29, 7,239,138, 94, 18, - 33,184,179,155, 38, 37,202,114,109,105,243,177,253, 80,116,115,197,235,170, 96,141, 37, 70, 55, 84, 25,117, 7,157,165,169,149, -215,207,183,217,197, 13, 88, 43, 86,106, 96,236, 20, 9, 61, 99,233, 70,107, 38,131,193,101,166, 84, 33, 39, 29, 36, 77,142, 75, - 44,177, 97,121, 18,194,100, 29, 17,126,246, 56,100,147,169, 13,245,107,181,111, 70,216,204, 88,152,200,150,244,196, 50,227,118, - 72, 33, 94,121, 75,128,240,222,213,190, 55, 83,149,149, 90, 60, 7,153,125, 47,237,246,245, 55,156,205,143, 0,156, 93, 77,111, -218, 64, 20,220, 93,203,124, 88,145, 74, 3,167, 40,185,181,106,110, 37,215,252, 8,254, 29,127,132,228, 70, 34,164, 86, 54, 85, - 20,169, 85,111,189,181,193,199,128, 26, 34, 57,216, 94,239,102,223,123,222, 93,187, 77,168, 84, 14,200, 32,100,175,204, 50, 59, -204,190, 55,243, 63,245,145,134,164, 59,216,117,199,134, 50, 27, 90, 61, 30,143, 9,151,225,229,233,233,213,124,126,130,143,233, -116, 74,159,113,199, 6,133, 39,147, 9,209,249,225,104,180,140, 99, 58, 33, 73,246,203, 36,161,247,147, 56, 38,229,231, 69,158, -213,143,162,203,217, 12,116,158,243,115,195,226,205, 21, 23,243,185, 27, 91,186,186,187,156, 93,152,131,143,103,103,230,249,251, -215,111,234,175, 31, 1, 98,132, 72, 87,169, 57,190, 73,190,108,238,215,135,163,225,109,178, 60, 58, 57, 54, 39,255,124,189,128, -165, 43,219,165,119,169, 97,244,239, 62,188,255,116,181, 96, 53, 79,196, 40, 87,154, 55,237, 38,199,166,125, 85, 96, 39, 95,198, -194,183,156, 29, 64,181, 9,104,202,199,135,253, 65,222,219,100,187,123,179,204, 50,208, 62,120,131, 4, 5, 54,230,180,135,253, - 83,230, 75,122, 64, 99,226, 30,218,233, 70,129,232,118,130, 65, 20, 14,251,221,248,199,239,159,141, 27,114, 36,184,196,244, 69, - 51, 73, 75, 67, 28, 20,231,126,182,184,226, 49,202, 66, 33,172,247,126, 43,184, 23,164,145,161, 43, 46, 14, 66, 21,109,139,237, - 83,241, 36,153,130, 74, 82,228,249, 5,238,222,228, 74,134, 80, 67,102,240, 61, 16,224, 99,195, 74, 85,200,240, 77, 55, 24, 60, -154, 63, 42,220,109, 18,106, 15,227,120,122,225, 37, 87,236, 32, 69,124,169, 24,101, 46,161,246,206,236,238, 43,247, 97, 66,186, -237,236,255, 10,178, 59,192,242,108,180,225, 83,235,212,129, 86, 55,140,218,215, 12,180,135, 15,106,225,215,223, 38,184,243,125, - 53,193, 80,175, 94,167, 59,169,150, 97, 82,237, 69, 70,235,162,112,163,172,112,237,117, 67,111, 68, 10,121,127, 77, 40,154,102, - 86, 78, 17,236,133,238, 33,109,163,156,124,121,127,189,234, 54,179,173,181,203, 47,108, 53, 7,252, 81, 25, 67,233,199,202,195, -184,211,154, 90, 85,148, 46,152, 68,187,160, 20,237, 59, 24, 96,207,163,118,189,251,135, 56,179,199,100,134, 91,135, 22,253,186, -170,102,223,108,251,134, 64, 54,103, 39,151,185,185,244,106,243,171,217, 56,101,203, 93,120,169,193, 23, 0,218,254, 96,128,149, -100,229,227,110,187,206,134, 81,167,187, 99, 25,246, 50, 9, 69,230, 70, 72,141, 48,208, 25,124,128,112,222, 74, 85,223,224, 74, -214,232,204, 44,172, 11, 2,119, 1,102, 3, 26,245, 25,216,149, 13,172, 65,139,110, 71,235, 85, 62,208,151, 98,133, 20,217,144, - 97,180,167, 32, 88, 64,238, 79,105,171, 10,189, 11,228, 67,177, 93,231,165, 4,179, 4, 80, 17,159, 5,224,236,106,122,154, 8, -194,240,204,108,105,187, 5,138, 4,185,146, 24,117,241, 39,168,191,193, 61,120, 16, 19, 46,198,147,137,253, 23, 28,252, 27, 61, -155,120, 33,122, 48, 33, 49,225,208, 26, 18,146, 70, 60, 53,241, 15,128,144,136, 1,180,116,222, 29,159,153,121,103, 63,202,130, -209, 61,109,218,221,110,187,157,125,230,153,247,227,121,254, 13,223,199,110,235,245,122,224,233,128,233,124,223,135,107,128,245, - 0,229,126,191, 15,132, 5,112,167,105, 10,124, 7,242,226, 48, 79,174,203,251, 56, 11,239,130,122,119, 58, 29,236, 3,199,241, -122,226, 66, 64, 73,146,108,132,215, 7,131,193,117, 79,158, 47,224,193, 28,128, 41, 97, 56, 28,226,234, 79,210,244,211,206, 78, - 94,252,131, 13, 31,248,102,107,235,225,227, 71,184, 75,192,247, 58, 73, 51,251,168, 28,140, 70,247,146,228,233,243,103,224,236, - 95, 71, 95,246, 6,159, 63,190,255,176,185,242,226,229,235, 87, 56, 98,251,237,187,111,227,241,221,245, 4,116,126, 23,248, 30, - 28, 34, 66, 65, 68, 33,111, 59,251,108, 7,134,230, 51,130, 39, 86,146,204, 78, 6, 36,244,222,241,121, 83,137,174,148,107,173, -118,151,244,161,158,158, 90, 10,207,249,200,166, 51,217,152,216,240, 78, 20, 91, 42,109, 71, 5,184,195,173,150,237, 46, 93,136, -163, 7,171,113,220,105,239,127,191,192, 96, 93,203,232,216,117,184,117, 69,212,142, 90,191, 50, 91, 99,110, 19, 49,202,214,183, - 27, 79,224,133, 12,225, 84, 47, 74,152,183,125,249,149,134,114,207, 40, 57,201, 95,156,160, 90, 96,238,244, 27,196, 92, 91,141, - 36,155,142,119,171, 78, 98,218, 43,157,147,135,150,164,180, 71, 32,202,162, 51,115,186, 58,127, 91,202, 57,109,173,159, 76,232, - 70,102,171, 50,229, 28,105,104,118, 81,201, 21, 37, 65, 65,192,187,146,113,200, 61,239, 71, 45, 57,166, 6,178, 89,139,236, 69, -171,106, 8,254,154,146, 96,225,127, 21,247,214, 86, 40, 70, 53,224,110,110, 20, 13, 14,161, 0,227,123, 77,165, 44,164, 37,243, -128,140, 97, 31, 31, 46, 62,244,243,110,225, 42, 14,106, 47, 69, 85,117, 64, 85, 90,177,242,116, 66,221, 8, 23, 85, 19,212, 89, -111,107, 81,200,246, 94,215, 28, 16,236,142, 57,110, 17,214,169,165,111, 30, 38,166, 34,118,111,174,232, 0,123,199,172,134,205, - 64, 10,170,239,186, 45,123,159,254,229,127,163,170,242,189,169,159, 36,166,229,187, 64, 38, 91,110, 47, 78,206, 38,110,208, 78, -175,248,191, 23, 49, 86, 95,205,162, 84,227,199,229,201,124,115,233,232,252,240,126,124, 71,131,202, 16, 87,102,133, 74, 38,146, -156, 68,117,209, 47,155,216, 36,239,204,165, 66, 67,172,187,138,201, 88, 72,192,174,222, 26,156,162,231,176,187, 14,101,148,196, -110, 30,188,254,207, 11,174, 50,215, 9, 85,237, 20,227,159,111, 74,234,155, 36, 46, 47,178,159, 4,186,197, 44,196,252, 17,128, -183,107,201,105, 24, 6,162, 30,199, 73,212, 66, 81,145, 42,144, 16, 44, 89,113, 21,212,115, 32,216,210, 3,148, 5,199, 97, 81, - 46,195, 1,144, 88, 32,177, 8, 45,109,113,226,224, 25,127,226,196, 65,252, 36,178,104,187,168, 26, 37,241, 76,223, 60,207,123, - 3, 3,116,157,130, 85,207,160,139, 31,108,103, 95,207,102, 58,113,223, 47, 22,236,223, 15,136,250,142,245,113, 62,157, 26, 72, -126,113,117,121, 59,191, 49,159,161, 33,227,146,186,199,177,178,137, 82, 79, 94,240, 0,248,120,144, 27, 11, 30,193,238, 89,245, - 64, 9,143,156,131, 87,176, 98, 41,122,216,250,237, 48, 17,167, 2, 10, 41,159, 74,181,164,167,149, 19, 41, 95,144, 63,220, 24, - 69,105, 92, 47,180, 73,150, 76,134,217,193, 40, 61, 59,218,121,220,168,187,135,151,231,183,119,236,196,210, 24,154, 54,126,149, -105,191, 64,209, 18,138,171, 77, 87, 58,152,140,199,129,181,123,189,237, 56, 20,110, 50,138, 5, 23, 40,188, 81, 60,231, 35,168, -242,149,124,221,234,122,183, 42,201, 16,163, 44,221, 72, 54, 3,243, 13,253,154,216,107, 65, 21,133, 72,210,241, 96,191,100,171, -165, 44,168,209, 66, 5, 55,207,174,215, 14, 10,166, 16,117,176,157, 8,123,231,241,107,154, 7,163, 33, 15, 10, 92,113, 16, 72, -156, 2,204, 30,147,191,161,166,169,227, 54,254, 37, 51, 16,167, 75,238,136,157,246,119,224, 55, 43,214, 49, 97,188, 75, 12, 5, -162,185,198, 20, 18,250,108, 57, 0,194,105,161, 53,251,204,237,184, 14, 8,151, 56,179,123, 78,166,106, 81, 50,145, 95,167,189, -177, 54, 64,204,185,221,249,121,221,169,204, 2,189,113,159,201,187, 33,141,160, 1,248,140,125, 83,119,250,119, 25,166,255,241, -156,107, 48,180, 13, 3,131,219, 70, 23,192,242,148,137, 76,164, 41,100, 25, 78, 85, 18,195,100,239,120,247,100, 43,215,172,218, -172,229,134, 16,143,196, 30,196,218,224, 30, 70,254, 84, 72, 48, 74, 29, 44,232, 9,108,179,179,112,140,144,207, 48,138,100, 77, -110, 3, 64,213, 22,167, 43,151,181, 91,253,225, 30,135, 85,110,140, 23, 55,244,105,147,115,176, 20, 72,137,175, 34, 22, 8,221, -178, 52, 38,163,191, 16,254, 33, 0,115, 87,207,211, 48, 12, 68,115,118,146, 34, 49,128,196, 74,197, 0,252,255,133, 13,196, 31, -224, 79, 48,192,130,152, 90,145,164,181,125, 71,252,113,246, 57,165, 66, 2, 6,170,110,169, 84,201,114,158,207,239,222,123,215, -254, 33,188,254,147,207, 92,215, 95,174,215, 51,196,143,195,240,120,255,240,226, 9,159, 42, 3, 54,220, 92, 22, 87, 90, 97, 29, -207,145, 9,228, 41, 96,197,111, 32, 3, 1, 30, 36,131,208,145, 6, 93,137, 54,203,189, 83,136, 58, 9, 15,186,109,100,250,230, -167,111, 14,223,109,115,187,234,111, 90,220,236,221,132, 46,252, 88,157, 6,146,241,172, 85, 93,231, 67,112,174,207,187,171,139, - 19, 88,245,119,207, 31, 79,175, 27, 31, 90,170,253, 69,207, 98,148,193, 38, 20,208, 84, 52, 12, 74, 30,107, 69, 12, 17, 71,124, - 4,179,156,203, 53, 32, 66,202,116, 68,227, 96,178,219, 29,142,214,185,125,179, 67, 30,143,133,204,208,199,175, 14, 99,192,216, -127, 15,243,238,158,246, 67,223,181, 20, 18,112, 65, 22,130,144,163,155, 43,124,199,148,208, 91, 56, 25, 34, 22,116,167, 70, 31, - 38,133, 54, 84,220,113, 54,208,215, 83,155,115,186, 1, 44,242, 10,240, 8,253,114, 76, 4, 77, 95, 33,187,170,159,124, 91,182, -215,245,175,172, 16,149,196, 94, 39,160, 26, 14,188, 65,149,178, 3,202,160, 31, 85,124, 91, 92,218, 67, 17, 79, 46,137,109,177, - 80,114,182,117, 94, 97, 89,104,243, 31,167, 21,167,210,153, 81, 25,107,168,225,140,254,212, 55,198,133,213, 28,133,143,140,106, - 15, 14,167,222,255,100,246,225,239,128,106,121, 0,142, 66, 55,153,153, 68,240,177,238,193,248,217,173,172, 49, 74,251,105,147, - 10,245, 8, 91, 75,166,211,253,224,118,254, 62,237,226, 52,241,116,104, 25,178,202, 43,107, 48, 22,112,243,241, 96,155,168, 47, -104, 12, 39,114, 72, 2,205,178, 48, 55,120, 92,163, 3, 35,210, 50,114,195, 96, 8,142, 79,125, 44,100,179,100,216, 51, 46, 28, - 18, 81, 92,159,166, 32,176,137,199,132,148, 5,178,205,124, 59,209,159, 2, 16,119, 5, 57, 13,195, 64,208, 94,219, 73,219,208, -114, 67,220,144,144,248,255, 27,248, 10, 7, 14,192,161, 20,137,146,196,177,137,215, 94,199,155, 40, 82, 17, 72, 60,160, 81, 21, -199,235,153,245,204,236,111,241,251,191,215,119,201, 93, 15,158, 91, 42,202,198,232,218, 96, 41,200, 96,125,194, 32, 62, 79,244, -206, 55, 75, 63,235,209, 22,112,134,163,120, 25,105,129, 36,233,178,162, 53, 27,183,200, 78,195, 67,173,239, 13,188,156,237,219, - 48, 52, 10,174,181,220,111,225,170, 54, 55,135, 74, 86,230,185,117,143, 79,167,241, 12,208, 10, 16, 59, 4,173, 85,238, 80, 71, -237, 8,249,223,165, 66, 95, 41,200,156,238, 35,153,253, 43, 21, 12,164,144, 65, 91,131, 62, 93,172, 99,198, 30,142,253,177,243, - 45,178,206,222,166, 78, 75, 34, 36,136,217,149, 72, 70, 59, 21,249, 16,150,123,221,152,109, 83,239,222,187,215, 24,252, 91,140, - 51,154,163, 80, 10,150,241,148, 1, 25,255,191,115,101,222,128, 35,201, 12,109,205,201,120,239,153,206,218,229, 65, 28, 84,217, - 75, 32, 25,117,147,156, 10,208,240,162, 11, 86, 17,248,183,113,113,101, 23,107,249,233,203,159,207, 24,129,228,137,243,192, 89, - 35,117,228, 65, 20, 37,159, 78, 32,177,140,123,244,108, 62,245,196,108,216, 85,106,209,147, 41, 94,145, 19, 60, 23, 36, 26, 47, -179,143,166,220, 35,121,109, 75,169, 76,134, 77,195, 98,170, 42,163, 86,235,135,238, 95,149,151,125,125,248,104, 79, 73,131, 0, -117,135,149,125,166,146,146,169,249, 22,190,104,236,168, 40, 45,180, 86,186, 2, 83,137,141, 9, 49, 77,155,219,250,174,181,103, - 63,180,118,232,191,198, 66, 31, 48,251,200,113,253,231,136,218,241, 90, 14,247,130,119,168,112,181, 73,228,238, 32,105,216,163, -146,108,240, 83, 86, 65,232,209,219,201, 74, 70,119,194, 66, 59,186,151,206, 99,211,105,114, 83, 98,183,244,204, 48, 5,192, 5, -192, 10,212,138,116, 72, 26,180, 21,221,248,156,111, 1, 88, 59,191,214, 6, 97, 40,138,231, 36,138,179,202, 30,199,158, 10,123, - 89,191,255,231,232, 23,217, 63, 24,180,107,161,218,220,204,228, 38, 26,163,182,165, 91, 31,164, 80,168, 65,244,103,238, 73,238, - 57,127,226,251,221, 87,223,220,246,183, 55,218, 78, 99,162,207,204,242,253,178, 97,116,191, 36, 61, 53, 54, 72, 40, 47, 46,197, -229,248,223,163,247, 1, 34,166, 74,197,190,224, 65,217, 64,132,126, 9,222, 18, 40, 87, 10,155,149,122,173,139,151, 58,203,114, -245,213,154,143, 86,191,157,104,251,254, 35, 29,175,237,106, 39, 55,214,186,163, 47,235,172,191, 9,114, 41,158, 30,101, 85,226, -212,154,221,209,124, 31,164,245,146, 87,190, 33, 72, 16,104,184, 26,224,148, 9,247,160, 42, 47,225, 89,213, 62, 23, 77,190,167, -131,203, 19,224,224, 71,238,231,228,232, 3,184,162, 79,245, 1,149,241,151, 42,171, 59,196,239,232, 51, 20,236,110,104,114, 84, -232, 35,137,198, 14,221,152, 9,220,181, 9,206,224, 60,118, 26,192, 67, 99,207,222,113,196,210,160, 36, 80,114,150, 68,234,153, -107,122,156,187, 31, 36,238, 33,123, 58,253,190,118,171, 47,224, 30,169, 19,205,132,245,125, 12,244,132,242,161, 11, 41, 42,225, - 76, 26,191, 23, 73, 40, 34,133,251, 25, 11, 15,156,153, 80, 94,204,231,158,143,164,176, 89,184,139,107,169,217, 88,136,174,250, -175, 79,230, 88, 63,230, 59,156, 69,140, 69,188, 66, 7,247, 7,101,167, 51, 69, 97, 83,206,196,115,181, 46, 81, 30,155, 61,233, -166,227,187,182,226,140,245,128,212, 90,115, 35,240,217,205, 37, 66, 32, 35,245,237,205,142,242, 66, 15,106, 12, 23,151,134, 35, - 85,225, 11,154,120, 82,130,104,113,134,119,200,240, 59,192,239,150, 13, 57,154,253,244, 13,193,181,130,194,248,109,143,235,175, - 0,172, 93, 91,110, 2, 49, 12,204,132, 68,104,171, 34, 85, 85,239,127,177, 94,128, 27, 64,187, 73,220,152,196, 33, 47,162, 86, - 69,124, 0, 31, 88,139, 49, 19,175,237, 25, 51,190,243,173,202, 82,111,250,137,248,254,255, 37,185,248, 11,190, 15, 53,205,223, -216, 71, 7,241,237, 19, 48, 59,132, 70, 45, 66,221,126, 78, 8,105,201,122,206,223,123,136,215, 73, 69, 18, 49,164, 44,212,145, - 41,209, 42,137, 37, 20,109,161,212,157, 79,224, 30,168, 44, 95,143,177, 72, 71,195,115, 96,241, 47,253, 98,240,182, 29, 62, 94, -109,180,244,121,166,221, 21,189, 64,116,126,146,111,154,103,182,110,145, 99,188,195, 53, 92,118, 17, 26,240, 85,242,158, 55, 14, - 55,176, 14, 1,125,179,197,199, 1, 59, 93,132,225, 20, 72,245, 94,184,207, 11,102, 94,249, 4,220,131,104,214, 18, 53,139,220, - 84,159,152,214,249,226, 67, 96,109, 53,103,106, 69,210, 85,237, 93,207,165, 96,176,168,206,119,239,104,104, 54, 12, 19,223,120, - 28,204, 88, 99,125, 19,156,183,243, 26, 19, 51,212, 94, 64,241,186, 90,130,123, 7,202,243, 43, 68,213,138, 64,123,118,215,220, - 37,181, 4,119, 53, 96, 55, 61, 41,137,228, 56,214,214,179, 4,216,234,116,208,204, 35, 8,149,174, 73,226,160, 82,122,193,228, - 35, 29, 35,154,247,107,243,237,179,182,155, 61,157,204,251,183,187, 58,247,229,253, 30,210,192, 59, 15,170,177, 30, 0,171, 8, -228,238, 17,213,110,151, 61, 43,121,157, 94,184,187,151, 10, 11, 76,126, 73, 72,103, 85, 87,138,155,185, 32, 83, 75,116,160,167, - 60, 64,106, 53,217,108,202,232,127, 4, 24, 0, 58, 21,119, 57, 95, 10,227, 13, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130, + 21,169,119,167,235, 30,198,123, 87, 5,110,217,127,236,233,100,164,226,101, 53,110, 63,211, 66, 54, 19,185, 58,161,155,242,249, +101,249,181, 25,224,123,131,249,120,238,203,119,243,232,241, 30, 81, 28,192,152, 19,233,156,211, 60,209,229, 52,141,176, 63, 97, + 69,237, 61,215,255, 31, 69,201, 63, 84, 11,140,194, 25, 51, 16, 98,109,235,196, 46, 11,198, 54,108,202,170, 48,170,124,156,184, +199,145, 90,135,209,206, 87, 33, 56, 12,202,233,218,241,101,184, 53, 40,112,251, 64,206,228,206,152,183,151, 46, 60,235, 96, 53, +184,202,236, 37, 88,177, 37,177, 20, 62,132,225,177, 50,160,117,197,155,113,178,206,131, 86,233, 91,234, 79, 98,154, 66,250, 42, + 93, 36, 13,149,159,136, 65,119, 84,234,150,184,221, 83,165, 83,205, 59,122,183,129,164,205,235,235,183,183,183,239,155,245,250, +120, 60,152,225, 62,169, 89, 19, 89,170,113, 22, 93,189,172,198,177, 26,146, 71, 22, 16,138,233,139,196,248,106,250, 73, 29, 90, +171,242,145, 75,153, 11, 82, 87,214,148, 13, 20,199, 56,119,117,176,158, 84,163, 38, 14,194,227, 68,240,157, 36, 63, 23, 25, 1, + 23,139,221,143,241, 15,101, 30,253,125, 88,241, 30, 95,170,231,235, 57,249, 79,112, 45,243,205, 45,240,104, 11,249,224,182,107, +255,150,220,233,245, 75, 0,210,174,166,167,109, 32,136,122,214, 94,135, 47,147, 70, 17, 23,154, 75,123,168,250, 15,138, 0,241, + 91,144, 56, 86,226, 47,240, 35,123,130, 35,168,135, 42, 74,139,132, 66,208,102,237,101,222,204,174,109, 34, 2, 65, 77,162,104, + 21, 91,150,119,119,246,205,155,247,162,245,127,225,187, 10, 50, 45,109,151,118, 48,170,198,168, 77,131,233, 9, 18,169,138,230, + 64, 72,200,221, 18, 63, 18, 4,252,149,151, 92,168, 25, 75,106,172,202,244,148,229, 86,181,183, 63,172, 62,109, 15,118,207,207, + 47,110,110,174,231,143,143,164,219,234, 38,248,209,129, 23, 53,190,142,129, 46, 51,152,199,221,187,138,109,187,199,165, 86,158, +140,157, 4,238, 65, 17,159,146, 46,168, 37,180,222,100,242,107, 27, 6,148,101,189,108,105, 41,102, 69, 30,160, 21, 90, 71, 23, +178,127,208, 90, 30, 20,213, 96,254, 97,253, 8,201, 9, 50, 16, 16,254, 20,223,165,231,112, 60, 13, 7, 53, 89, 99, 14, 6,227, +223,243,233,204, 45,110, 23,127,127,205,255,220,249,135, 89,182,120,178, 97,103,184,117, 56,174, 14, 71,187,195,129,229,220,152, +139, 89, 42,111,201, 27, 12,106,185, 25, 88, 46,110,184,227,196, 32,254,196, 88,239,200, 57,174, 56,185,112,197,192, 26, 8,238, + 84, 90, 48,253, 36,146,146, 45, 3, 95,139,131, 57,128,174,112, 20, 27,231, 80,193,242,236,112,245,149, 75,242,114,222,103,209, +196,146, 87, 45,182, 85,103,118,146, 34,102,200, 12,117, 53, 15,245, 9,181, 72,108, 5,159,198,224,254,174,155,244,238, 81, 3, +166,111,125,175, 18, 95,145,230, 21,220,191,140,191,222, 47,254,245, 15,249,224,155,141, 21,255, 44, 90,151,155,130, 59,189,148, + 44,150, 0,247,108, 5,118, 35,244,246,172,169,117, 74, 78, 10,176, 87, 5,247,149, 37, 70,235, 5,124,162, 14,145,214,117,164, + 15,238,125, 93,152, 82, 86,233,238,220,164, 12,160,178, 42,150, 70,136, 27, 89, 24,105,131,151, 41,135,147, 95, 99,131, 82, 3, +129, 87,152,150, 59, 73, 81, 13,100, 15,202,225,120, 21, 48, 40,139,232,110,193,227,170,157,106, 52, 58,248, 60,153,252, 56, 58, +250,121,117,249,253,248,219,233,201,217,253,244,129, 79, 99,252,112,206, 3,118,235, 58,237,195, 1, 98,141,234,147,151, 56, 1, + 43, 24,214, 13,196,123, 60,187, 93,252, 90, 43,166, 83, 1, 6, 4,243,174,137, 61,166,118, 79, 14,132,239,178,225,235,122,241, +217,112,156,179,148,172,101,234,208, 54,229, 89,158,199, 2,119,178, 74,113,116,100,172,177,117,104,222,242, 42,186, 79, 47, 45, + 71,119,184, 83,139,223,118,170, 60,254, 85,210,124, 20,220,249,245, 44, 0,101, 87,179,227, 52, 12,132, 61,118,108,147,236,101, +187,123, 97, 81,133, 16, 7, 94, 1,150,183,129, 59,175,197, 13,184,193,115, 32,246,194, 13, 36, 46, 72,172, 42, 74,243,255,227, +157, 31,187, 13,221,182,130,182,138, 34, 37,106, 98,123,230,155,111,230, 27, 37, 71,241, 29, 78,253,162,205, 65,228,117,130,233, +194,110, 19, 49,103,103, 39,192,198,165, 85, 38, 89, 0, 45,174, 96, 16,137,156,193, 72, 33, 24, 34, 39,160,212,139, 2, 48, 69, + 0,233,165, 49,207, 95,188,124,253,230,213,199, 15,159,112, 37, 70, 76,186,112,173, 85, 90,233,196, 48, 5,100,162, 53, 69,217, +150,178, 76,103, 50,228,227, 38,213,249, 67, 44, 20, 50,243,144,224, 14, 42,183,249,242,114,185,174,215, 50,233, 82,115,103, 11, +136, 50,122,244, 49, 13,243,121, 50,212,203,162, 31, 45,174,170,166,186,126,118,253,237,215,247,137, 45,229,241,197,178,164,178, + 10,245,198,132, 40,252,208,224, 16,208, 17,171,155,105,248, 61, 18, 73,255, 90,254,188,105,126,220,234, 77,105, 7,101,245,153, +247,185,247,133,243, 57, 18,118, 10,117, 4,235, 22,221,129,115, 81,107,181, 35, 29, 74, 59,107, 30,100,188,175,193,113, 15, 76, +238,172,207,148,179, 34, 69,131,207, 12, 94,175,237, 85, 89,133,117, 25,218, 14,250, 33,244,189, 66,106,191,169,166,186,214, 85, + 61, 53,117,104, 26,104,219, 17,135, 55,140,170,105,167,154, 31, 61,137,119,220, 32,255, 31, 72,196, 18, 89, 53,196, 71,144, 77, + 28,166, 3, 94,234,188,184,168,186, 82,138,111, 56, 47, 72,184,232,164,212,199, 16, 98, 79,133, 36,206,255,241, 65, 26, 62,134, +191,170, 34, 79, 46,159,174, 24,178,199,248,134, 74,164,201, 69, 66,210,125,251, 68,112, 79,194,245, 46,210,252,227, 13,120,227, + 57, 60, 31,200, 39,246, 10, 32,247,201,123, 74, 94, 1, 14,120, 80,196, 92,103,114,204, 21,146,111,195, 65,101,254, 62,205,223, +182,202,108, 93,236,132, 75,206,250,100,224, 8,252,207,212,212, 93,191,131, 74,108,134,107, 50, 8,218, 91,121,140,209, 14,210, + 16,116,136,148, 93, 24,253, 14,196,217,173, 50,217,103, 82,165,169, 65, 77, 11, 79,226,175,210,233, 40,109,131, 4, 3,105,156, +224, 2,172,201, 28, 2, 60, 49,120,239,209,222, 65, 87,101, 85,216, 51,168,213,251,183,239,110,190,124, 94,173,110,255,148,155, +174,173, 7,106,234, 26, 68,238,151,210,174, 48, 65,205, 27,202, 2, 12,107,180, 25,186,136,241,248,143, 54, 39,202, 18,224,225, +226,106, 93,111, 64, 73,219,196, 76,192,135,176, 40,206,187,190, 99,224, 8, 22, 25,166,113,253,216, 49, 38, 72,133, 42,204, 41, + 60,122, 27,155,200,180, 7,164, 60,113, 48,175, 64,238, 97,250,105, 40,134,153,132,163,143,103, 96, 41, 30,156,178,234, 99,135, +238, 4, 96,237,218,118,218, 6,130,232,218,107, 19, 19, 40,132, 86,149, 42, 17,193, 71, 32,132, 42,245,255, 95,120, 64,168,138, +202, 43, 15,189,168,164,208, 66,226,221,181,189,187,204,153,177,201, 69,216,226,161,145,162, 68,218,196,215,217,179,103,206, 28, +141, 95,241,207, 36, 91, 43,208,208, 70, 69,106,127, 9,196,150, 62,183,132,189, 19,246, 84,155,184, 49, 39, 16,232,151,198,184, +186,237,135,203, 52, 94, 86,126, 77,232,149,225, 62, 17,140,237,208, 47, 47, 62,127,161,161,111,179, 25, 17, 89,107,141, 41, 75, + 83,149,190,174,209,197,144,248, 53,231, 57,236,110, 98,245,167, 35, 23,124, 76, 48, 97, 42, 64, 36, 80, 47,227,193, 76,200,136, +112, 13,217, 57, 75,111, 26,154,162, 86,113,192,188, 17,252, 74, 21, 21,149, 19,144, 82,131, 29,168,233,209,116,175,216,157,125, +191,161, 19, 98, 41, 74,116, 71, 40, 81,206,187,191,141,189,247,229, 92,185, 38, 13, 85,240, 68,108, 14, 16,130, 41,145, 83, 34, + 25, 77, 96,140, 12, 92,198, 1,237,209,204,109, 50, 90,156, 36,154, 89, 97,138,132,221,197, 14,253,129,206,183, 57,254,244,145, + 34,254,238,207,253, 40, 27,149,142,174, 3,129,120, 92, 84, 33,229, 44, 85,131,232,195, 63,192, 41, 48, 46, 5,173, 4,252, 56, +145,232,234,176, 52,117, 96, 4,135,142,207, 5, 56, 31,147, 42,194,147, 67, 35,121,176,243,159, 11, 90, 71, 43,212, 93,185, 41, + 37,247,193,164, 55, 29,216,100,255,253,239,199, 95, 17,150, 12,233,102,172, 33,142,114, 17,107,211,253, 18,135,221, 5,251,163, +131,165,123,234,147,104,104, 35,124,155,210,245, 58,103,232,247,159,200,232,217,233,249,213,237,229, 27,157, 9,107,238, 0,205, +114, 13,118,116,184,123,244,207, 60, 20,121, 97,107,187, 21, 6,133, 70, 40, 26,111,211, 77, 32, 30, 80,222, 59,135,101,238,131, + 91, 15,171, 23, 95, 77,236, 1,119,169,166, 10,103,218, 50, 75, 14,156, 79,124,221,130,180,154,191, 91, 86,153, 77,193,125,229, +241, 93,201,234, 72, 62,197, 63,155,182, 78,129,164,195,172,164, 69,115,254,174, 51,254,144,137,204, 18,189,236, 66, 88, 22, 7, +112,108,249,127, 34,162, 13,170,108, 76,179, 9,152,179, 81,142, 54,211, 68,111,232,131,184, 77, 62,153,124,152,158, 76,175,191, + 94, 87,120, 86,157, 49,214, 44, 75,130,120,231, 26, 87, 99,214, 87, 8,199, 4, 23,135, 95,154,137, 32,156, 55, 52,219, 97, 9, +142,177, 24,143,223,141, 15,239,230, 63, 22,166, 36,226,111, 41, 81, 13,200,197,177, 64, 40,207,157, 83,189,152, 95,107, 34, 56, +184,214,200,246, 90,127,141, 98,159, 28, 67,182, 20, 78, 58,138,131, 57,165, 24,100,195,134,151, 70,253,151,206,168,125,158,156, +248,230,244,183,239, 48,158, 5,224,236,218,118,155,136,129,168, 61,235,236, 38, 45,149,160, 92, 30, 16,207,229,223, 17, 15,252, + 8, 63,128, 82,222, 80, 43,132, 90, 53, 73, 55,217,141,237,225,140,199,206,110, 46,165,192,107, 36, 59,217,245,248,204,204, 57, +199,177,251, 59, 99,238,201, 89,134,190, 35,219,108,115,146,207,177, 35,218, 56, 53,181, 21, 33, 5,237, 15, 9,238,160,203, 10, +222, 72,183,165, 73,216,165,149, 82,206,132, 11,216, 27,229, 6,162,119,211,243,249,252,219,226,254, 14,163, 48, 33,150,232,172, +158,117,253, 38,100, 89, 99, 39,111,228, 98, 40, 75, 59,135,229, 78,254,140,116, 93,200,190,124,241,234,161,189,231,204,151,145, + 94,158,161,228,126,136,172, 6,222, 28,190,195, 59, 5, 88,231, 42,128,146, 94,148, 44,230,236,196, 88, 31, 86,253, 18, 15, 69, + 73, 20,110, 12,170,230,240, 16, 54,171,208,255, 12,171,149,219,246,150,103,103,147, 25,213, 54,144,252,115, 58,155,218,218,198, + 2, 28,109,187, 78,228, 77, 50, 90, 79, 37,234,241,190,196,227, 56,155,184, 64,113,234,170,102,162, 46,245,202,136,250, 19,176, + 45,186,110,251,225,253,155,143, 87, 87,159, 62,127, 1,238,226, 21, 7, 49, 61, 70,108, 33, 60,142, 83, 22,136,173, 56, 50,125, + 63,177,104, 16, 24,213, 58,126, 91,148,155,192,176, 11,104, 45, 78, 77,222,122,185,255, 41, 58, 73, 5,194,110,114, 4,212,185, +166,102, 52,173,249, 60,128,148, 50, 74, 25, 10, 17, 17,253,178, 93,238,186, 92, 78,183, 65,101,213,109, 63, 82,177,213,144, 28, +232,105,165,242,177, 91,252,129, 63, 41,168,176, 23,200,244, 28,171,243, 53,129, 59, 29, 42, 84,234,147,120,114,236,184,111, 0, +184, 23,247,243,225,214, 5, 40,160,195,161, 17, 37,149,114,155,167,231,184,205, 32,119, 17,103, 58,203, 28, 81, 34, 39,245,216, + 84, 45, 86,250,165, 50, 80, 42,107,214,232,100,107, 79,141,100, 83,214,136, 79, 20,130,102, 44,168,186,193,209,177, 7,238,131, +235, 81, 93,141, 92,200, 24, 53,186, 21,100, 47,134,102, 5,126, 45,230,140,138,103, 9,192,197,131, 86,236,113,218, 21, 36,222, + 59, 93,222, 46,121,203,234, 81, 19, 42,150,249,148, 24, 98, 58, 48,144, 8,118, 19,171,110,221,126,191,158,163,128, 67,248,138, +125,215,251,212, 70,198, 36, 4, 73,167,120,209,156, 63,118,173,214,130, 8,111,167,130,157, 92,237, 91, 93, 94,188,189, 91,252, +186,124,253,238,230,246, 7, 6,212,117,221,111, 25,201,196, 75,117, 2, 52, 66,204, 7, 20, 78,125,191,193, 92,152,190, 72,166, +131,154,173, 0,113, 20, 47,180,179,189,177, 25,115, 60,255, 83, 80, 31,227,248,136, 60, 98, 69,180,176, 63,201, 78,195,199,162, + 96,211,217,127,113, 30,255, 22,128,178, 43,216,141, 26, 6,162,182, 19, 39, 77,170,221, 30, 80, 43, 36,170,170, 95,192,129, 11, + 8,196,167,192, 17,137, 67,255, 9, 10,252, 13,167,170,151, 34, 85,162, 82, 5, 18,210,210, 45,237, 38, 77, 28,123, 58, 51,118, +188,219,237, 38, 18,187,215,108,100, 39,246,155, 55,111,222,172,135,200,187, 28,248,177,140,172, 96,213,248,216,183, 54,176, 46, + 34,116,145,230,169, 72, 51,153, 5, 62, 1, 84, 1,209, 2, 95, 66,130,207,151,152,169, 16,149,171, 22,174,194,156,136,240,141, + 17, 53,216, 43, 61, 29,236, 58, 16, 26, 55,219,245,191, 43, 68, 22, 4,171,189,233,211,223,179, 75, 68,185,206, 24,182,133,184, + 64,133,100, 52,102, 82, 2, 23, 50, 43,157, 40, 88, 25,176,234, 35, 46,167, 13,152, 16,222,212,202,151, 94,188,178, 77, 95,194, + 56,216,221,217,221, 41,166, 63,255, 92,172, 59,221,156,243,177,196,113, 48,226, 57,113,226,192,150,175,155,230,246, 22,211, 64, +105,231,118,241,171,157, 87,105,215,166, 93, 49, 37,223,203, 19,124, 8, 86,243, 13,192, 88,210,150, 20,229,131, 18, 7,136,244, + 24,128, 69,109,130, 82,153,107,149,229, 73,129,224, 94,168, 92, 19,216,146,103,222,201,166, 1,242, 48, 83,193, 16, 94, 63,127, +113,246,227,252,226,114,246,254,221,219,211,147,179,239, 39,167,101, 94, 80,228, 73, 96,146,105, 71,226, 22,121, 97, 14,247,159, + 45,234,106,118,117,125,244,241, 3,210,159, 79, 95,142,179, 45,133,113, 6,137, 74, 66,154,149, 35,163,164,181,119, 56,160,134, +230,133,129, 11,247, 74, 66, 46,120,124, 73, 26,247,150,247,132,130,143,158,180,226,104, 67, 54, 93,205,226,251, 32, 98,246,151, + 43,251,208, 40,185, 73,116, 30, 93,253, 0,246, 81,116,144,155,136,121, 50,224, 82,131,101,126, 41,198,173,108,165, 46,107, 83, +249,225,227,221, 26, 90,144,184,124,116,107, 77,156, 84, 7, 29,136,165, 72,223, 27, 98,213, 67,178,131,232,153, 26,216,120,184, +188,148, 2, 96, 84, 28, 87, 43, 14,244,240, 7,203,125, 62,135,139, 99,178, 53,153,215,127, 87, 58, 15,214,111,192, 26, 25, 68, +148,143,124, 80,137,216, 89, 40,163,103, 95,245,110,168, 88, 77, 77,249, 93,123, 3,138,236,185,249, 38,100,247, 60, 46, 13, 44, + 94, 4,160,247, 94,201,224,152,236, 97,157,249, 58,248, 6, 64, 25,155,155,216, 72,151,114, 84,160, 96, 64,208,141, 79, 23,217, +140,105,201, 1, 76,149,208, 14,243,115,100,236,109, 99,232,212, 26,195, 7,229, 80, 46,233,107,253, 9,153,195,152,244,176, 49, +154,228,223, 36, 43,243,237,178,220,198, 43, 94,190,122,179,127,112,240,237,235,103, 4,126, 58, 51,167,111,192,241,121, 48,176, +123,142,103,201,114,139, 92,135,114,175, 49, 98, 4, 50,108,135,182,255,211, 27,177, 86,234, 24,167,221, 65,229,102, 38, 4,203, +130,141, 15, 48,180,210,220, 0,130,195, 35,195,216,248,231, 94, 0,214,174,101,183,137, 24,138,250,122,158,121,148,128,160,165, + 65,101, 9,127, 1, 11, 96,197, 87,161,136, 47, 64,229, 15,144,224, 27,120, 44, 17,108, 89, 33, 80, 41, 21,109,164, 46, 8, 37, + 45,243,200,120,108,115,239,181, 77, 66,154,138, 86, 98, 86, 89, 68,242,140,231, 62,142,207, 61, 71, 19,159,171,184,123,241,200, + 34,146,114,190, 56, 8, 86, 55,127,142,203, 5,161, 79,141, 47, 72,180,181,157, 57,225, 17,217, 86, 53, 17, 14,136, 67, 99, 21, + 37, 50, 73,227,172, 27,119,215, 59,215, 12,232,137, 58,250,213,150,146,228, 76,137, 79, 74, 76,111,122, 21,162, 42,139, 36,205, +168,153, 11, 51,158,236,241,103,142, 90,102,205, 72,196, 8,204,195, 59,198,204, 43, 88,164,188, 61,188,181,123,184,227, 36,152, + 78,118, 46,172,143, 60, 79,117,129,173, 85,147,202, 84, 89, 98,223, 6,189,203,199,213,137,143,122,141,232,224,210,151,195, 93, + 30, 17,201, 69,133,170,197,228,133,150,140, 86,150, 81, 60,115,110,214, 73,116, 32,154,232,233, 24,190,215,162,109, 34,221, 31, +228,131, 36,235,229,253, 94, 39, 21, 60,240,119, 19, 95,171,121,214, 41, 52,169, 65,165,200, 16, 59,107,186,249,196,125, 56,137, +227,158, 69, 54, 24,245,100,182,141,194, 84, 1,143, 43,195,173, 97, 53,211,223, 14,246, 55,214,111, 90,209,121,245,230,117, 81, +153,251, 15, 30,126,248,184,247, 99,138,157, 42, 82,134,156,187,172, 64, 22, 87,175, 12, 30,141, 70,187, 59, 95,159, 60,221,190, +115,247, 30,194,204,103,207, 95, 32,254, 36, 58,155, 53,155, 89, 26,215,180,193,144,113, 90,211,250, 64,189, 87, 91, 40,141, 94, +235, 38, 71, 39, 38,137, 50,220,109,105,181,158, 7,150, 9,211,255,191,190, 36, 98, 2,147, 96, 2, 17,175, 8,180,122,177,168, + 22,255,225, 34,125,100,218, 43,154, 66,158,210, 23, 6,238,123,133,229,181, 19,229,149,174,225, 95,144,170,228,226, 14,158,130, + 11, 34, 40,210, 23,170, 85,206, 38, 55, 79,198, 78,169,233,164,196,249,249, 7,245, 24, 48,103,183, 46,128, 37, 95,219, 41,150, +223,206, 3,206, 87, 9,218,113,178,242,216,105,245,211,158,253, 8,225, 24, 11,190,202,243, 93,226,142, 85,170,226, 33,149, 35, +214,231,226,246, 96,251,246, 25, 65,185, 51, 47,238, 50, 10, 62,214, 64,199,203, 57,180, 39, 74, 15, 92, 47,224, 26, 27, 45,155, + 87, 23, 46,233, 74,188, 83, 27, 56,209, 3, 56,157, 65,204,170, 27, 94,141,245, 49,152,212,160,232, 39, 86,121,140,162, 70, 17, + 19,195,158, 38,108,178,202,182,237,245,181,205,241,100,223, 77,221,240, 16, 41, 92,149,182,172,163,193,231,198, 38,128,255, 52, + 89,158,247, 71,219,143,223,189,125,191,241,114,179, 40,142,113,249, 27,253,173,207, 7,159,112, 53,163, 16, 95, 53,184,163, 13, +171,232,243,180, 91,207, 74, 27,210,155, 2, 53, 4, 43, 79,203, 82,213,148,231, 81,201,194, 5, 32,251, 10,114, 49,135,172,166, +101,245, 34, 29,191, 32,216, 94,138, 22,219,154, 11,231,211,111, 1, 88,187,118,221, 38,130, 40, 58, 47,207,122,215,201,218,184, + 65,148, 40,113, 65,137,144,104, 81,254, 50, 21, 18, 63,128, 20,165,164,160,194, 13, 13, 18, 5, 10,137, 68,129, 68, 21,156, 16, +112,214,251,154,225, 62,102, 95, 78, 44, 64,194,141,237,125,142,118,103,239,158,123,207, 57, 51, 3,126, 85,222, 13,238,141,221, + 88,119, 61, 41, 56, 21,184, 50,163, 49,233,195,219, 28, 73, 64,146,177,246,186,112,121, 5,136, 71, 84, 68, 91, 9, 21,188,165, +248, 28, 48,241,232,248,158,160, 17, 13, 50, 92,243,104,242, 48,181,233,218,103,176,189,106, 92,205, 24, 15,201,210, 64,242, 87, +156,217, 14,190, 80,112,105,162, 77,177,246,172, 61,116, 97,148,130, 22, 98,192,146,235, 95, 43,234,125, 88, 82, 15,138, 76, 35, + 3,195, 19, 56, 88,149,151, 57,236,140, 20,141,151, 5, 57,152, 27,121,190,184,202,126, 40,198, 47,236,143,107,105, 92,239,195, +172,167, 84,184,128,255,145,181,120,197, 69,125,225,190, 93,198,171,120, 98,246,162, 24, 46,130,133,238, 33, 76, 93, 67,254,174, + 29, 54, 24, 82, 22, 29,141,204, 36, 81,251, 9, 74, 21, 19,107, 12, 2, 23,149, 23,174, 44, 37,172,188,186,206,168,220, 13,128, + 1, 22,202, 13, 26,125, 84, 89,113, 49, 75,254,204,242,231, 79,159, 61, 89, 28,188,255,240,241,193,108,190, 56, 92,188,121,187, + 60,124,124,144,166,211,200, 70,231, 23,159,163,241, 40,142,196,100,108, 32, 3,224, 14,123,244,226, 8,146,251,215, 39,167,103, +103,159,150,203,119,231, 95,190,122,167,225,128, 10,135, 31,192,198, 27,173,172,149,179,216, 76, 83,189, 55,209,177, 13,197,222, + 10, 73, 85,151, 83,115,136,205,194, 27,208, 90, 4,218, 20,114,107,136,130,145,182, 10, 85,149,245,144, 83,250,159,115, 54,205, +147,121, 14,105, 53, 7,175, 65, 88,244, 59,165,150,254,175, 60,228,247,210, 86, 53, 1,118,130, 63,161,250,164,183,156, 62, 12, +123,209, 12,229, 84,175, 49,242, 79,167,186,195,142,118,245, 1, 98, 67, 68,231, 16,100,105,121, 99, 44,217, 49, 7, 75, 23,186, +101,104,100,112,152, 32, 48,164, 42,184, 30,188,162, 84, 31,176, 41,209,211, 62, 10,246,150, 42,134,237, 84,132, 36,125,132, 12, + 42, 25,250,141,213,118, 98, 92,121,132, 11,193,180,153,233,235,103, 8, 27,181,171,152, 10,197, 29,232,236,241, 40, 17,141,164, + 21,185, 81,218,198,187,160,120,230,113, 49,138, 50, 67,175,106, 69, 97,158,126,220,220,174, 48,180, 97, 48,103,182,142, 9, 54, + 36,155,112,127, 12, 66, 10,226,201,102,147,237,203,244,213,241, 75, 84,155,120, 81, 20,249,247,155,203,154, 28,239, 24, 64, 80, +229,236, 41, 61,170,167,241,236, 54, 95,119,184, 57,192,202,240,196, 87,144,195,225, 5,112, 94,202, 30,165, 33,239,123, 59,111, + 83,221,112,152, 49,146,234,245, 46,193,147, 24, 10,189, 60,246, 31,191, 37,163,194,174, 5,193,201,247,253,225,194,176,131,236, + 31, 63,191, 5,160,236,106,122,155, 6,130,168,103,215,118,118,157, 52, 41, 13,164, 66, 69,168,253, 5,192,133, 3,167,254, 13, + 36, 14,252,213, 2, 66, 66,112, 64, 2, 36,212, 75,197,161,162, 9,109,148, 52, 86, 28,127, 51, 51,187,142, 93, 7, 35,136,114, +202, 41, 94,207,188,153,121,243,102,246,207,248, 14,117,243,168,105, 31,181,124, 70,242, 6, 23,193, 45, 58,163,153, 81, 66,227, +201,101,101, 98, 22, 67, 52,152, 91, 43,209,117,249,160,192,244, 48, 56, 83,205, 77,106, 81, 56, 67,181,127, 95,141, 23,201,178, + 36,130, 69,240,212, 1, 80, 39,132, 95, 70,213,225, 43, 48, 74,111, 18,142,186,230,122, 57, 11,238, 91,246,144,140,101,164, 71, +220, 41, 45, 26,174, 65,242, 29,179,159,198, 0,189, 85,243, 48,139,138, 15, 33, 93, 27,174,140,146, 75,121,138,176, 86,194, 64, +239,225, 15, 67, 61, 58, 57, 60,190,190,189,169,228,244,228, 52,152,116,159, 28, 28,127, 93, 92, 92,136, 25,244,139,161,175,125, + 32,169,191,242, 93,237,187, 38, 51,234,121, 94, 64,220,160,107, 44,216,119,189, 64,143,126,205,194, 36, 19, 8,220, 69, 6,121, +234, 60,156, 76, 94,191,122,217, 15,212,116,122,179, 90,173,241, 84, 92, 38,220, 17,127,233, 12, 28, 25, 19, 69, 83,246,164,124, +246,228,233,135,143,159, 16,116, 79, 95, 60,255,242,237,243,189, 97,144,230,209,163,163,195,120,189, 88, 46,175,123,202, 69, 59, + 89,199,101, 20,101,211,121,248,246,236,253,217,155,119,243,213,250,106, 54,255,113,121,133,175, 9, 67, 70,156, 21, 17,229, 67, +121,146,113,135, 21, 67, 16,144,156,115, 19,151,248,141, 19, 52,107,140,186,133,239,138,112,137,121, 31,228,219, 91, 3,171,149, + 28, 70, 57,186,187,127,134,166,198,173,211,182,248, 97,128,157,149, 3, 93,212,161, 81,200,116,153, 41, 38,239,208, 57, 58,219, +206,145, 90,242,196,118, 55,230,223, 16,223, 36,197,174,240,202,178,220, 25, 59, 34, 90,224, 32, 24,175,211, 80,236, 68, 50,216, +105,154,129, 3,127, 1,133,187, 67,170,182,245, 0,224, 56,157,195,177, 66,212,210, 29,167, 41,227,217,198,191, 10,184,155,193, + 86, 52,130,140,165,221, 97, 43, 59, 51, 83, 25, 53,220, 83, 17,137,217,143,176,226, 54, 97, 53,111,204,163, 74, 97,203, 91, 9, + 60, 65, 97, 40, 26,230, 94, 76,223,149,101,178, 70,222, 66, 78, 71,114, 25, 71,248,210,239,171,254,100,239, 65,154,167,143,199, + 71, 88,193,199,217, 70,212, 15, 75,228, 42, 37, 57,232,230,113,204,183, 64, 38, 9,213,235, 60, 96, 77, 72,192,243,171,144, 87, + 67,242,165,135,174, 66,133,187,228,197, 38,212,166, 80, 74,159,159,127,255, 57,189,196, 84, 0,163,194, 38,142,120,153, 9,173, +233, 48, 11, 55,236,134, 2,112, 6,122, 24, 70,183,112, 23,223, 11, 75,189,131, 66,119,150,146,228,209, 0,213,123,132,102, 28, +237,234, 27, 49, 58,208, 48, 62, 43,119, 65, 52, 39,213,187,141, 77,123,131,180, 72, 90, 70,162, 69,144,177, 59, 24,100,199,191, +174, 61,205,149,241,255,125,126, 11, 64,217,213,181, 54, 17, 68,209,238,236,108,118,179,217, 38,180, 24,124, 80,136, 80, 74,161, +130, 85, 65,250, 82,161, 15,173,255,215, 31, 81,125,208,183, 22, 41, 5,159, 20,106, 17,217, 52,205,118, 63,103,198,251, 49,179, +217,182, 49, 42, 36,144,108, 72,178,217,153, 57,115,238,189,231,220,172,194,119, 91, 2,111,205,107,157,154,234,122, 60,130, 49, + 16,182,251,151,236,123,176,101,225,165, 52,174, 16,209,145,253,123,173,193,157,237,111,202,214,227,173, 3,130, 43,156,155,209, +198, 56,126,244, 35,191,162,239, 36,104,103, 6,207, 8,143,163,175, 93, 15, 9,251,128, 0, 70, 59, 59,147,157,169, 48,174,176, + 19,112,151, 49, 56,184,243,100,103,118,123, 77, 10, 25, 54,111,180, 42, 93, 23, 40,120,154,106,191,173,204, 75, 76,198,207,210, + 44,245,105, 7,135, 31,149,149,183,233,205, 47, 99, 9, 20,146,247, 81,127,216,147,189,247,151, 39,223,204, 52, 18,152, 94,175, + 42,108,249, 82,230,166,194, 52, 8, 22,245,227,190,140,130, 0,200, 59, 10,120,124, 8, 15,213,222,238,246,209,225,193,197,215, +179, 97, 34, 7, 16,152,133,176,127,172, 21,245,124, 54, 75, 95,190,218, 61, 62,124, 59,136,123,233,244, 39,112,144, 16, 21, 68, +100,101,197, 62, 29,190,196,241,105,246,223,236,157, 95,124,169,234,236,245,139,231,151, 87,223,243, 34,219,222,154,156,124,248, +248,238,232,248,211,231,211,186, 82, 20, 71,227,181, 12,164, 44,234,186,108,154,164, 31, 82,131, 15,244,167,246,104, 13, 0,173, + 9,208, 50, 40, 6,192, 49, 34, 92,157, 48,219,139, 66,151, 21,170,139, 53,183, 61,131,197,141,206,164, 6,215,154,177, 43,139, +241,253,158, 19,213,116, 84,192, 93,230,110,108,195, 39,124, 61,242, 99,237,184,240,234,168,117, 5,184, 47,197,235,127, 15,131, +199,201, 99, 77,217,219,123,231,255,167, 44,169,232,100, 35, 73,220,212,242,226, 5,209,129,147, 41, 48,177, 3, 7,229, 67, 95, +139,219, 72,204,211,209,228, 26,251,157,225,179, 40,136, 57,153,243,240,108,169,223,139,113, 5, 97,170, 22,121, 98, 89,108,177, +228,223, 14, 23, 30,139,187, 99,225,178,166,139,161,241,188, 86, 10,105, 91,120, 56,161,215,194, 21,200,204, 29,121,155,117,137, + 8, 82,200, 48,100,179, 98, 5,167,153,100, 13,180,113, 77,156,132,104, 69,147, 44,125,246,219,183, 48,187,167,235, 3,180,122, + 94,220, 0,140,103,249, 60,111, 10,159, 93, 71, 24,206,147, 59,145, 26,218, 1,138,212, 26,211,176,116, 67,180, 87,228,213, 38, +223, 58,171, 90,236, 89,111, 36,155,212,226, 73,241,212, 32, 93,189, 95, 84, 37, 80, 64, 0,129, 36, 92,159,206, 83,218, 39,248, +115, 16, 66, 96,118, 43,188,155,178,206,141,107, 52,102,216,111,222,241,167, 2,140, 66,220,192, 5,237,206,246,236,117,122,109, + 89, 81,184,113, 40,199,200,206, 47,145, 34, 22, 25, 64, 18, 38,165,170,255,198, 42,112,195,209, 70,221,197,119, 64,210,170, 99, +118, 29,150, 10,232, 89,189,246,255,142,214,223, 2,176,118, 61,191, 73, 4, 81,120,102,118, 22,134, 5, 34, 4, 60,181, 7,123, +178,181, 38, 77,141, 7, 19, 15,158,108,210,248,159,154,120,245,127, 80, 47,141,154, 84,123, 41,141,191,122, 48,210, 16, 96,150, +133, 25,124,223,155,217, 21, 8, 77, 52,113, 79,176, 33,217, 93,120,239,123,191,190,239,177, 5,223,171,191,112, 78, 54,193, 61, +208,222, 97, 59,110,193,115, 81,126,248, 76,101,202,163,214, 80,156,236,187,178,127,164, 67,219, 67,196,100,161,204, 31,124,180, + 71, 2, 93,158,182, 3,194,208,154, 87,119,179,222,104, 49,181,148, 19,201,196,241,142, 70,116,117,150, 46, 98, 58,199,119,216, + 66,220,194, 24,219, 85, 76,220,173, 20, 76,208, 76, 17, 46, 18,254,182,205,157,153,203, 41,252,231,243, 28,246, 39,152,199,187, + 84,209, 34, 17, 21,245,225,238,193,112, 60, 84, 65,207,207,115, 51,186,194,200, 14, 67, 66,226,188,235,183,250, 90,107, 59,159, +133, 70,179,224,162,148,204,239,253,116, 48,146, 69,166, 76,104,238,123, 86,211, 17, 92, 26,173, 9, 94, 33,197,131, 56, 15,149, + 66, 88,157, 70,230,245,240,224,240,249,201,201,135,179,183, 54,159, 82,180,193,172,213,227,217,127, 92,255,124,243,238,108,112, +245,245,209,209,209,139,211,211, 94,175,247,229,234,251,112, 52,213, 90,180,179,180,149,201, 70,157, 32, 56,127,124,124, 60,184, +188,252, 53,188,217,187,183,231,124,122,254,121,240,244,201,179,151,175, 94,239,239, 63,232,119,186, 31,207, 47, 52,174, 71,183, + 22, 72, 22,112, 48,104,198, 82, 73,177, 36,173,137,134, 17, 45,163,154,153,108,155,132, 66, 11, 61,239,216,130,158, 64,126,108, + 82,250,152, 96,191,197, 23,106,169,180,205,237, 12,201,146,224,114,185, 28,248,173, 47, 33,244, 43, 20,128,117,162, 17,126,152, +166, 70, 74,194, 21,232,252, 95,187,146,255,241, 72, 69, 74, 85,185, 45, 38, 14, 28, 56,244,237, 12,164,173,139, 44,109,212,211, + 70, 1,190,243,150,164,190,107,186,179, 21,173, 96,181, 73,166,124,171, 74, 36,141,154,136,219, 86, 20,164,178, 54, 65,147,119, +193, 59,139, 40, 96, 22, 4,241,132, 29,149, 47,172,128,187,175, 8,105,130,135, 13, 60,118,219,184,183, 72, 29,136,156,189, 40, + 35, 68,231,195, 36,198,131,245, 20, 37,250,178, 74,221, 35,186,151, 39, 69, 64,118,249,167,228,141, 10, 38, 24,105, 34,162,168, + 59,234, 87,146,240, 2,116, 91, 41, 2,177, 61, 9, 42, 61, 62,201,158,139,212,174,146,188, 68,118, 60, 50,125,142, 1, 65,221, + 42, 99, 13,128, 85, 26, 53, 94, 61, 66,230,166,240, 86,133, 49,239,110,111,199, 22, 54,172, 89,165,148,110, 14,167,159,199,158, + 10,112,121, 17, 92, 62, 64,128,172,246,218,128,133,101, 59,205, 14,213, 1,228,224,157,172, 83,171, 55,198,147, 27, 66,118,173, +106,247,119, 14, 46,190,125, 98, 90,164, 67,188, 96, 9, 44,196, 51, 24,136,121,238,227,198, 89, 72,203, 52,249, 18,203,106,255, +192, 6,251,251,214,185,165,212, 28,176,103,114, 69, 98,214,174,183, 42,209, 58, 40,106,174,240, 91,138,218,181, 34, 22,162,200, +149,218,119,163,196, 11,110, 71,224, 46,255, 66, 24,184,245,248, 45, 0,103, 87,211,219, 52, 16, 68,189,187,241,250, 35, 31,165, + 9,165, 8, 85,173, 2, 5,122, 64, 32,142,112,224,192, 1,137, 27, 18, 23,254, 45, 23, 36,110, 69, 21, 66, 8,104, 43, 5,168, + 26, 8,105,234,196,117,226,196,246, 50, 51,187,235, 36,208, 2, 34, 7,203,114,164,181,108,175,103,103,222,188,247,252,167,248, +206,127,209, 65,160,109,144,238,155,147,225, 23,109, 37, 11,224, 45,202,137, 29, 78,243,152, 30, 48,110, 69, 89, 41, 90,149, 40, +203, 28,147,102,115, 83,184, 32,196, 7,133,155, 68, 6,171,172,201,224,178,191,250, 37, 62,162, 19, 97,132, 71,214,182,182,132, +160,140,221,196, 20,165,217,184, 68,131, 53, 9,137,246, 23, 34, 90, 46, 1,126, 48, 23, 38,211, 9,204, 44, 88, 66,167, 89,122, +115,125,251, 52, 25,242, 82, 43,205,180,209, 93,209,143, 7, 72,154, 37, 93, 45,140,180,185,182,149,164,103,194,226, 55,112,169, +201, 44,161,149, 92,221,191,126,239, 71,212, 67, 64, 74,137, 94, 49,236,201, 81, 51, 12, 27, 85, 47,244, 42,245,192,111,174,184, +205,186, 92,173,251,141,176, 2,121,113,232, 99,176,149, 94,197,151, 46,237, 40, 41,138,187,119,110, 57, 12, 59,195, 7, 7, 29, +135,123, 27, 87, 55, 59, 95,191, 41,244,166,113, 97,230, 71,163,232,253,135,119,135,157,253,237,246,214,211, 39,143, 55,174,173, +119,143,187,189,193, 48,142,209, 23,172,127, 58,217,185,189,115, 18,141, 62, 31, 29, 95,106,172,220,104,183, 95,190,122,253,232, +225,131,143,251,159,118,247,222,190,120,254,108,247,205, 94,183,251, 61,207,157,106,232,167,105, 6, 43, 14, 50,214,104, 97,196, + 46, 71,142, 7, 20,135,146,150,133,129, 35, 92, 36,141,193, 45,116, 5,171, 74, 81, 11,121, 0,171,136,100,190, 7,101, 25,119, + 37,131,228, 1, 74, 91, 98, 11,103,101,124, 47,237, 82, 75,238, 34, 76,113,207,245,178,165,156, 20,255,106,133, 87, 32, 62,206, + 84, 22,136, 32, 35,117, 15,191,216,220,241,191,227,187,116,100, 78, 94, 68,236, 47, 58, 88, 85, 65,160,214, 85, 4,137, 82,203, + 7,107, 19, 34,110,157,143,222,104, 33,248, 2,212, 99, 40,182,112, 57,228,173, 85,216,183,145, 17,248, 94,104,235,209, 5, 80, +167,124,117,139,194,138, 3,244, 56,121, 49, 91,110, 30, 48,110, 51,247,102,216,154,204,198,212,174, 68,226,169,110,212, 10,231, + 28,134, 40,108,171, 94,141, 30, 8, 97,133, 4,158, 21,170, 76, 37, 57, 91,150,164, 40,171,156, 95,136,236, 54,184, 43,131,204, +216, 4,127,174, 96,210, 36,149,138,150,113, 32, 91, 86, 48, 99, 53, 35,140, 8, 28,233,150,136,216,104, 75, 41, 10,241,142, 81, + 43,150,214, 5,152,189, 65, 45,202, 73,105,129, 35,208,190, 40, 23, 3, 56,103,156,198,186,109,152,107, 11, 48,108,252,104, 91, + 2,184, 9,164,102, 44,140, 92, 29,194,160,165, 40, 42,253,221,246,241, 52,129,224,142, 53, 39,231, 85, 89,139,146, 65,171,182, + 54, 58,139, 78,226,254, 56, 77,168,244,167,138,192,226,239,212,180, 51, 52, 0, 61,143,211, 89, 90, 44,231,239,206,220, 73,137, +107,171,103, 75,208, 99,100,190,100, 14,192, 48, 4,170, 56,101,136, 35,177,203, 84, 43,242,172,228,216,184, 93, 21,243,245,130, +253, 78,215, 89,174,125, 29,103,193,118,244,223, 85,223, 23,253,126, 10, 64,218,181,180, 54, 17, 69,225,123,238,220,153, 73, 58, + 41,245,137,213,106, 90, 16, 5, 5, 23, 85, 23, 82,168, 11, 65,119,197,149,221,185,208,149,226,255, 19, 92, 90,176,190,168, 26, +132, 34,138,197, 7, 42,134, 74,155, 56,147,153,204,100,230,122,207, 57,119, 38, 83,169, 85, 48,201, 42, 9,195,132,220,123, 30, +223,247,157,239,254, 61,190,143,127,179, 37,124,128,103,211,168, 95,131,192,105,141, 72, 26, 66,112,188,197, 61, 28,107, 71, 3, + 96,199,174, 36,193, 29, 60,162,207,170, 41, 34,223,165,181,173,240,148,219,116, 27, 19,174, 63,233, 79,126, 31,252, 24,229, 67, +134,202,114,157,151,255,172, 29, 56,160,152,207,235, 64,200,130, 75, 15, 11,180, 75,251, 18, 60, 47,221,112,189,249,246,252,198, +230,123,179,164,122,209,182, 96,150,135,214,174, 99,157,223, 21, 85,216, 14, 21, 29,200,239,155,230, 14,144,227,101,213, 24,233, +100, 36,112,160,236, 69,253,161,206,168,166,129,175,141,110, 43, 80, 7, 76, 7, 24,168,160,161,246, 79,169,137,166, 98,111, 13, +141,114, 7, 57,202,144,133, 72, 82, 84,159,160, 80, 58,135, 44,133,133, 75,139,207,215, 58,103, 78,157, 91,123,249,230,232,145, +153,219, 55,111,221,127,176, 18, 37,122, 72,240,119,146,232, 56, 46,190,124,219,124,252,180,243,226,213,250,177,233,227, 75, 75, +215,103,103,102, 63,126,238,110,253, 12, 77,142, 57,217, 62,209,106,250,111,223,125, 48,221,235,133,243, 23, 31, 62,122, 50,215, +158,115,189,198,202,234, 51,207,243,239,221,185,123,121, 97,113,249,198,242,213, 43,215, 58,175,215, 55, 62,117, 99,164,185,245, + 96, 88,132,131, 81, 63,206,195, 40,235, 69, 89, 28,235,104, 32, 76,226,163, 97,239, 66,161,122, 71, 96,253,174, 88,126, 33,211, + 20,189, 36,211, 97,218,239, 39,204,121,228, 5,112,124, 55,125,137,105,137, 56, 6, 9,107,173,137,123,145, 23,158, 39,125,192, +148,139, 43, 22,147, 34,181,168, 35,107, 26, 3,123, 96,220,187,186, 5,192, 63,120, 24,152, 6,201, 87, 40, 52, 45,254, 32, 99, +147,182,164,218,103,226,117,249,157,138, 19,178,251,202, 17, 74,239, 28, 62, 84, 38,253, 57, 62,167, 1,167, 6, 87,106,198,106, +106,193,157,153,168,211,211,103,195, 36, 36, 85, 50,252,174,181,217,179,111,209,130,133, 75,246,102,210, 12,197,102, 60,193,193, + 94,133,176,227, 66,114,140,163,131,200, 80, 84, 83, 84,100,175,198,145, 51,105,106, 9,130, 76,235,131,181, 99,140,190,244, 79, +176,131, 72,162, 12,238,154,109, 92,199,197, 59,115,164, 44,155, 33,127, 23,250, 84, 82,178,161,170, 72, 91, 23, 37,201, 59,207, +166, 63, 85,237, 60, 46,225,201,169,130,207,112, 32,196,134, 76, 4, 80, 21,236,184,192, 7, 59, 88,239, 73,182,127,180,209,175, +178,198,192,204, 72,218, 45,178,248,165,103,110,125, 98, 43, 66,186,164, 13,208,241, 49, 75,182,195, 45, 83,156,103, 56,237,154, +196, 73,108,174,193,231, 24,144, 78, 0,143, 63,176,167, 57,136, 98,172,220, 37,122, 8, 0,106,138, 67, 91,120, 34, 30, 65, 1, + 7, 64,138, 90,142, 47,234,179, 96,248,134, 83, 89, 2,177,206,255, 80,112, 56,206, 98,201,112,116,137,229,152,158,121, 42, 56, + 56, 72,195,186,207,133,222,109,178, 15,106,131, 78,255, 31,220,205,227,151, 0,140, 93, 77,107,219, 64, 16, 93,105,245,229,164, +200,141,237,134, 52,224,131,161,105, 15,129, 66,161,231,228,247,245,143,244, 90,122,204,161,208,246, 15,180, 7,211, 52,165, 52, +184, 80,108,234,196,177,101, 59,145,165, 93, 77,119,102, 86,178, 76,113, 8, 24,131,177, 17, 50, 59,122, 51, 59,243,222, 91,239, +225,244,100,168,249,253, 18,249,201,228,112,223, 3, 89,208, 6, 80, 82,221, 97,162, 65,177,179,150, 0,133, 58, 26,199, 51, 56, +108,221, 53,109,212, 86, 22,166,236,226,153,153, 23,183,219, 11,147, 0,139, 78, 20, 95,230, 9,170,203,178, 21,109,139, 53,119, +231,136,203,129,151, 53, 37,185, 47,101,114, 59, 3, 94, 29,151, 57,215,248,166, 10,182, 22, 80, 38,158,210, 34,253,250,251, 11, +153, 36,250, 20,148,165,255, 12,166,107,162,132,149,141,120,143, 5,213,166, 52,199, 82,148, 35,222,109,132,110,239, 73,239,124, +120, 33, 80, 8,234,229, 58, 71,105,173, 35, 7,114,164,208,150,215,199, 84,128, 70,122,144, 43, 39,172, 90,248, 18, 27,151,137, +129, 85,101,254,154,179, 84, 58, 8,208, 2,211, 96, 70, 28,183,250,253,159, 71,207,142, 95, 28, 29,159,125,250, 60, 24,188,153, +204,151,141, 32, 48,183, 27, 72, 47,108,132,157,246,227,253, 78,187,219,237, 30, 30, 62,109,181,247,154,241,222,233, 73,207,164, +138,183,239,222, 39,139,244,199,175, 63,175, 95,189, 76,110,179,244,114,152,165,217, 65,167,211, 63,255,246,188,215,139,194,224, +236,195, 71, 3, 9, 87,147,235,241,120,114,147,204,254, 94, 79, 87, 52, 30, 13,148, 14,125,159,249, 62,244, 36,163, 87, 15, 89, +210, 35,124, 57, 68,100,191,203,112,215,202,167, 27, 24, 16,204,242, 98,149,235,200,108,201, 4, 87, 81, 56,209, 32, 29, 25,160, + 98, 88, 79,235, 17, 2,107, 97,169,200,236,228,199,249, 95, 90, 93,216, 1,251, 86, 2, 56, 21,191,174,190,151, 75, 25,135,241, +124, 83,242,154,235,212, 36, 81, 87,108,136,220, 96, 67, 40,132, 31,231,171,105,245, 56, 85,150,138, 6,104, 52, 25,144,161,222, + 24, 45,228,214,230,151,200,199,214,153, 92, 59, 46, 84,196, 24,235, 22, 91,114,130,109, 19,246, 98,244, 93, 96, 21,239,214,196, +180, 80, 3,231,130,190,245, 12, 94, 84, 96, 14,214,164,206,150,227,101,147, 7, 24,236, 66, 63,210, 42,231,211, 2,106,232, 14, +229, 1, 34,246,202,174,189, 67,219,108,100, 32,167, 99, 12,182,239,136,220,154,180,137,181, 31, 40, 33,183,115, 93, 62,216,131, +183,214,101, 86, 0, 11,193,232,226, 2,192, 63,224,130,157,244,136,194,230, 33,160,233,166,176, 67, 87, 11,238, 46, 91,143, 88, + 6,142,244, 60,182,231,195,122,169,156,100,210, 36,141,174, 41,133,168, 60, 49, 16,211, 93,129, 39, 23, 72,243, 36, 59,212,165, + 1, 75,147, 91,235, 35, 72,182,129,154, 63,133,101,226,126,235, 32,242,119, 6, 87,131, 69,190, 36,238, 50, 52,119, 91,227,217, +136, 59,186,172, 71, 68,229,146, 37,189, 67, 25,192,216, 2,128, 50,227, 83,154, 33, 69,156,128,157,240, 81,220,104,142,110,134, + 32, 54,172,175, 37,178,127,170,197, 37,139,169, 90,129,143,220, 51,157,146,191,165, 93,134, 93,244,137,156,102, 58,189, 91,172, + 28,203, 38,217, 74,159,175,203, 53,138, 7,131,251,253, 66,167,127, 2, 80,118, 45,189, 77, 3, 65,216,187,118,188,137,107, 5, + 81,170,208, 64,211, 3, 72,181, 84, 42, 46,156, 56, 32,224,192, 21, 33,206, 92, 56,240,131, 56, 34,126, 10, 23, 84, 80, 69,139, +168,212, 8,164,190,120, 68,132,180, 10, 52, 10,113,212,248,189,236,204,238,218, 78, 83, 33,240, 37,135, 56,113, 28,239, 60,246, +155,111,190,249, 71,125, 96, 62,219,205, 33,214, 6,176, 79, 32, 32,227, 3,131, 62,120, 19, 8, 48, 8,165, 96,191, 31,225,202, +153, 75,196,157,230,197, 55, 50, 69, 56,130,241, 23, 33,136,132,113,216,208,145,170,240,146,203, 11,173,131,222, 94, 10,155,160, + 84, 66,239,138, 66, 11, 77,246,147, 40, 33, 8,167, 26,146, 19,169, 43,255,224,203,189, 69,111,183,183,187,186,188,114,216, 59, +144,148,152,162,108,166, 2,140,121,125,241, 90,247,164, 75,185, 76,103, 32,252,152, 90, 89,193, 91,242,142, 6,199,126, 48,138, +210,116,255,232, 16,182,165, 38,194,253,212,176,137, 57, 72,198,190, 27,211,136, 9,223,112, 42,238,112,146, 50,208, 57,205, 18, + 70,145,226, 5, 55,239,216,150,120,125,246,244,137, 83,115,159,191,120, 25, 10,247,111,208,249, 11,117,241,254,201,112,184,185, +249,225,193,189,187,175, 94,175, 55,154, 87, 46, 46, 52,222,111,183, 47,213,221,251,119,110, 63,126,244,112,245,230, 90,191,223, +127,183,241,118,167,221,254,252,181, 51, 26,251,147, 32, 14, 97,160, 17,175, 86,172,222,113,215,173,221,106,204,187, 43,158,215, +106, 93,109, 54, 47,239,124,252,212,249,222,153,115, 25,163,116,125,227, 77, 28, 39, 98,169, 70, 25,113, 88,165, 38,153, 12,104, +100, 85,145,142, 90, 96,139, 9,120, 67,130,100,130,244, 84,252, 42, 78,132,203, 22, 22, 36,242,119,113, 50,179,137,109, 26, 78, +133,212,107, 44, 77,172,111, 58,149, 66, 45, 85,212,224, 83,198, 55,117,136, 75,133,113, 32,243, 56,126,182,249,166, 88,192, 12, + 38,233, 4,180, 8,237,179, 11,180,248,236,185,142,126, 20,142,102, 61, 21,201,157, 85, 33,152,197,115,111,206, 11, 25, 0,163, +236, 16, 25,160,213,208,105,134, 69,100, 64,105, 44,106,195,182, 29, 24,189,188,164, 56, 87,160, 40,194,103,205,129,166,194,111, +172, 36,113, 29, 39, 64, 58, 81,126,119,142, 5, 17,213,156,194, 75, 19,157,204, 76, 50,110,116, 27, 41, 45,153, 36, 41,245, 31, +201, 11,167, 73, 40,231, 27,148,147,119, 9, 16,107,188, 69,209, 60, 36, 22,147, 3, 55, 34,254,146,252, 46,255,230, 9, 10, 65, + 49, 42,213,124, 21, 35, 89,115,108,168, 22,123,151, 10,186,216, 19, 72,115, 16,153,170, 81, 0,152,199,171,214,110, 85,152,229, +134, 82, 41, 80, 44, 73, 67,213, 90, 41,238,152,117,229,139,226,189,164, 96,183,152,148,101,114,179, 79, 80,146, 87,156,137, 67, +108,160,165, 47,145, 61,226, 78,165,122, 99,105,109,235,203,150,170, 1,102, 26,196,224, 50,150, 2,124,251,227, 87,151, 34,119, + 31, 23, 44,204,120, 26,248, 63,213, 32, 48,165, 48,156,225, 5,117,227,174,210,203,227, 82,128,143, 43,214, 47,186, 19,132,126, +163, 40, 26,102, 67, 29, 27,212, 96, 34,249, 76,205,243, 92,174,102,181,146,113,224, 79,177, 6,146,144,168,167, 4,255,100, 54, +101, 1,133,201,156,217,227,102,255,153,185,139, 37,157,150, 6,159,149,143, 63, 2,112,118,117,171, 77, 4, 81,120,103,103,118, +118,147,221,108, 18, 98, 66,105, 45,161,248, 2,222,249,131, 69,172, 90,240, 77,196, 11, 95, 76,193, 23, 80, 43, 4, 9, 85,193, +130, 87,162, 23, 69,154, 43,173,166,173,155,108,118,118,186,206, 57, 51,179,187, 77,131,130,144,155, 36, 4,102, 55, 59,231,204, + 57,223,207, 89,246, 23, 35, 53,159, 57,183, 68,232, 45,200,106, 19, 59,146, 59,144,135, 26,177,182,198,128, 57,112, 37, 25,179, +167,100, 3, 46, 23,174,145,255, 59, 38,127, 99, 21,227,106, 45,146, 74,240,156,114,143,242, 6,227,109, 30,198,126,131, 51, 46, + 28, 49, 57, 59,154,254, 62, 1, 76, 12, 73,130,187,215, 31,125,153,124, 6,148, 18,243, 46,246, 13,100,224,135,152, 99,164, 17, + 75,163,158, 77,227,128,112,220, 22,234,140,187, 64,177, 28,192,164,120, 78, 40, 24, 54,214,213,106, 78, 65,103, 15,111,169, 97, +245,146,107,131,173, 52, 75,213,159, 57, 77,126,105,155, 33,170, 57,182,180, 54, 96,170,112,222, 45,142,124,198, 85, 6,207, 97, + 82,142, 42, 94,220,128,187,234, 3, 85,123, 54, 3,226, 49,120, 96,133,112,178, 76, 62,121,252,244,214,246,206,243,103, 47, 22, + 89,166,114,221,214,112,115,243,234,198,222,104,172,150,176,251,224,254,203,189,183,247,238,108,175,175,111,188, 30,141,213, 53, +125, 61,252, 54,222,223, 63,248,240,241,248,251,143, 56,110,245, 7, 93,143,131,147,193,108,158, 48, 42,163, 22, 48, 94, 10,153, + 63,220,185,123,251,198,205,181,254,218,171, 55,163,247, 7,159,210, 76,204,210, 25,238, 71,208,187, 94,233,120,221,142, 31,135, + 36,106,242,200, 7,200, 20, 50, 86, 1,238, 99, 30, 18, 32, 60,199,104,101, 1, 34,134, 77, 5,119, 69,100, 57,205, 11,149, 15, + 6,172,209, 15, 84,104, 39, 29,135, 30, 78, 78,143,207,230,218, 20,254, 92,139,205,176,170, 13,253, 16, 49,201,186, 65, 17,216, +251,168, 27, 36, 87,123,138,153,103, 73,187,251,114, 55,192, 99, 84,177, 82,171,125,217,250,150,252,155,177, 78,150,152,136, 75, +191,139,252, 88, 74, 17, 5,177,200,133,222,159, 88, 86,230,214, 51, 71, 45,158, 65,197, 9, 12, 31,105, 64,127,211, 51, 37,164, +226,159,192,138, 5,202, 89, 47,202,182,151,229,136, 37, 27, 88, 19,246, 83,144, 23,145,203,100,245, 11, 21, 6,169,134,192,105, + 94,200,185,189, 44, 90, 87, 36,145,106, 16,140, 14,238,212, 50,151, 43,122, 76,245, 34,127,125, 57,214, 12,134, 24,134,130, 54, +144, 49, 46,237, 6,140,210, 35, 59,176,204,165,214,183, 0,172,167, 93,107,192,106, 76, 6,203,150,189,117,145,196,182, 59,186, +133, 17,102,130, 59, 1,111, 88,170, 49, 85, 23, 77, 84,113,111,245,162,110,220,108, 37,139,164,156, 28, 85,169, 25, 52, 37,222, +209, 39,196,252,103,114,130,129,146, 88,235, 94,139, 96, 18,167, 50,142, 69,173,147, 30,208, 84, 24,202, 23, 60, 24, 72,178,150, +195,222,112, 58,155,218, 64,174,107, 17, 27, 85,173,141,108,169,136,212, 83,252, 84,220,136,195,118, 38, 68,165,140,116,200,170, +238, 70,153,139,109,141, 69, 72,141, 77, 44, 75,233, 72,167,209, 75,243,249,242, 44, 4,104, 6, 74,219,243, 36,255, 7, 71,153, + 80,185,234,171, 63, 2, 80,118, 45,171, 81, 4, 81,180,170,159,211,227, 56, 17, 19, 4,193, 85,220,135,184, 51,248, 7, 46, 92, +104, 16,252, 38,151,226, 95, 24,193, 69, 68, 5, 21,201,194, 7,130, 95,160, 98, 2, 6, 51,100, 38, 51,233,247,212,195,123,111, + 85,117,247,140, 67,192,129,204, 98, 8, 77,119, 87,213,189,183, 78,221,115,206, 69,245,123,211,185,156, 68,125,228,149, 97,207, +140,121, 62,244,120,211,156, 72,228, 92,245,130, 94,141,242,251, 50, 64,214,101,200, 76, 39, 19, 87,177,230,146, 91,135, 55, 82, +145,108,140,202, 52,185,189,248,190, 59,191,135, 49, 56, 23, 98,168,216, 26,130,146, 33, 29,159,248,189,184, 63, 43,103, 80, 99, +190,249,246, 74,186, 86,119,147,219,112, 0, 8, 92, 83,204,242, 29, 40, 96, 97, 90,153,100,167,112,131, 85,141,172, 78,211,213, + 26,248,225,195, 59,247,159, 29,236, 89,200,213, 51,199, 62,116,226, 68,211, 17,254,235,112,116,136, 70, 25,200,222,176, 91,108, +244,172, 99, 60,135,241,224,116,104,172,249,177,156,170,152, 65, 45, 28, 39, 1,204, 92, 73,177, 18,133,117,124, 75,228, 69, 84, + 39,193,132, 86,100,236,201,211,199, 87,175,108,164,217, 36,140,144,208,113,253,218,250,244,108, 2,177,102,123,107,235,231,175, +163,172, 72,159,239,191,124,112,239,238,160,159,192, 99,213,115,121,244,123,244,231,248,228,195,199, 79,235,107,151,111,110,222, +216,217,185,189,187,251, 40,157, 78,223,189,127,253,246,224,179, 16,117, 94,229,123, 47,246, 39,179, 20, 74,251,170,154,147,251, + 9, 34,251,204,195,215, 14,111, 44,205, 84,224, 41,200, 71, 81, 72,180, 50, 5,241, 20,242, 45,148,216, 72,254, 64,131, 20,205, + 98, 43,208,236, 13,195,160, 15,139, 80,179, 60, 42, 34,197, 82, 49,255,113, 50,206,132, 56, 43, 74, 46,227, 82,100, 24, 7,133, +217, 47,155,178, 7,255,228, 2,113,149, 14, 24, 17,232,137,186, 8,248, 63,173,238, 13,112,169,107, 85,118,195,226,146,124,182, +190,176,159,125,213,134,180, 75,175,230, 16,202,139, 42, 51,199,185, 13,213,200,168,152, 57,157,103, 18, 14, 98, 60,137, 33,166, +164,156, 66,136,115, 41,105,141,119, 97, 16, 7,209, 48, 69, 84,199,146, 29,188,133,208,220, 86,220, 11,123, 20,250,186, 20, 38, + 37, 65, 43,112,225, 73, 62,110,183,241,109,153,230,117, 35, 2, 93, 11,179,201,246,230,173,175,223,191,248, 84,203, 82,228, 82, + 29,222,128, 65, 50, 32, 26,110,140,211,145,143,190, 94,132,220,107,231, 9,105,226, 14,169, 2,172, 94,192, 40,147,235, 30,206, + 21,142, 14, 47,214,142,164,234,130,181,117,107,181, 24,141,223, 21, 14,212,214,232,192, 0, 28, 30,107, 29, 8, 77, 87,139,161, +178,211,158, 88, 27,243,100,179,214,124, 99,216,100, 22, 93, 59,104, 80,193, 8, 70, 91,118, 2, 90, 49, 48,227, 57,174, 50,221, + 18,120, 41, 73, 80, 41,100,222,106,158, 99,173, 38, 89,163, 4,169,145,172,171, 8, 87, 52,205,158,218,147,156,222, 50,169,246, + 40,221,248, 51,155, 28, 6, 63,196, 1,186,202, 12,130,126, 41, 42, 33,107,109, 77, 56,141,220, 14, 44,114, 88, 70,202, 28,178, + 18,251, 16,123,222, 32,247, 80, 85,201, 27,136,199,129, 16,202,193, 18,109,202,134,219, 30,192,212, 42,207, 57,119,121,200, 77, +126,186, 11, 53, 45, 78,181,213, 94,197,185, 23,144, 60,223, 74,145,165, 37, 9,154,255,114,169, 92,250,252, 21,128,177,235,123, +141, 26, 8,194,151, 77,246, 46,201,209, 22, 90,139,160, 15, 22, 69,193, 39,139,160,255,115,169,248, 92,124,247, 77, 4,197, 7, +235, 67,241, 55, 74,185,122,181,119, 73,246, 54,217,117,190,153,221, 92,170, 82,125,190, 64,114,179,187,179, 51,223,204,124,223, +191,241, 25,250, 20,211, 54, 44, 80, 1, 57, 31,153,155,111, 81,137, 2, 98, 56,183, 63,110, 20, 55, 41, 94,172,186,149,226,124, +158,188, 6,166, 88,189,240, 42,208,117, 13,227, 48,107,190,204, 95, 8, 63, 69, 76,228,188, 52,171,100,172,121,141, 64, 96, 97, + 43, 6, 93,236, 86,190,125,222,204, 83, 24,184,211,216,214, 62, 82,181,224,160, 54, 8, 36, 61,183,208, 58,110,130, 15, 88,100, + 40,184, 70,158, 36, 90,150,182, 53, 79,158, 63, 5,206,198,251,134, 43, 84,120,172,208, 19,211, 26,188, 59,214,122,105,217,192, +183, 14,131,118,219,229,150,206, 38, 31,103,159,248,244,160, 51,236, 76, 47,174,141,243, 50,215,211, 92,103, 25,184, 24, 41, 49, +208,217, 72,107, 47,245, 41,225,253, 67,176,171,244,203,215,199,173, 61, 54, 93,146,144, 51,182,102,186,185,251,254,243,233, 88, +231,143,246, 31, 30, 28, 30,242,108,150,187,187,183,119,125,103,163,237, 44,157, 0,203,121, 33, 69,218,247,238,223,121,252, 96, +127,179, 44,158, 29, 29,189,125,119,242,245,219,151,101, 93, 43,214,169,121,241,234,141,181,109,150,166,197, 68, 67, 37,213, 98, +238,131, 76, 81,209, 85,202,227,114, 20, 52, 21, 57,188, 4,217,100, 50, 65,152,230,148, 3,123,240, 8,224,210,180,164,152, 62, +233, 26, 80,155,205,150,230,251,217,124,105,237, 69,229, 26,186,118,188, 9,250,103,112,213, 85,208, 85, 96,224, 24, 82, 24,152, + 19,134,121,107, 90,154, 65,189, 81, 78,142,244,173,171, 63,246, 92, 57,222, 88,172,126,114,215, 65,146, 68, 17,156,225,164,254, + 80,199, 67, 14,109,138, 57, 14,215, 7,248, 9, 99, 41, 44,219,228,175,216,210,225, 74,134,104, 91,198,190, 53, 22, 24,249,130, +119,190, 53,182, 9, 7, 16, 81,164, 94, 81, 98, 23, 17, 24, 31,103, 41,215,194,116,222, 93, 48, 14,211, 67, 64,228, 23, 90,168, +151,251, 64, 35,147, 36, 67, 97,247, 8,100,224, 2,171,108,205,109,145, 89,231,251, 94,140, 32, 77,126,107,247,246,135,211,147, +100,224, 17, 2, 87, 6, 78,188, 51,166, 81,125, 31, 49,153,244, 50,135,107,111,183, 92, 23, 20, 78,166, 89,112,191,209,179, 43, +102,114,249,219,124,192, 80, 85, 79, 94, 38,121,146,138,196, 97, 62, 82, 62,138,196, 78, 36,159, 81,129,121,131,211,108,134,168, +133,246, 79, 78,172, 31, 14, 79,201, 5, 21, 47, 3,201, 66, 36,128, 85,253,172,147,168, 42,135,161,168,128, 65,171,212,215,171, +138, 22, 27,230, 2,135, 41,144, 25,153, 95, 79,217,197, 83,116, 65,207, 3,179,101, 68, 7, 96, 12,144, 84, 21,255,166, 19,137, + 62,104,140,185,223,114,184, 88, 56,149, 41, 89,133, 36,127,190,152,113, 83,255,168, 94,213,163,193, 82, 6,254,119, 60,205,155, +220,197, 72, 29,106,157,204, 69,194,197, 7,254, 89, 34, 75, 54,218,165, 6,215,248, 66,168, 41,184,117,199, 96,178,206, 84,251, +116, 51,131,227,198, 20,185, 48, 27,114, 19,142, 29, 6, 55,189, 10, 96,122,165,139,255,127, 89,227, 95, 2, 16,118,197,202, 77, +196, 64, 84, 90, 73,119,246, 5, 19,219, 9, 73,138, 80, 65, 3, 13, 5, 13, 5,191, 64,199,167, 82,241, 7, 12, 5, 20, 12,198, +164, 0, 2,147,194,198, 78,198, 57,251,206,178,116,135,118, 87,119, 99, 7, 18,202,140, 39,231,243, 72, 90,237,190,125,251,158, +190, 13,169,147, 60,221,220,190, 40, 65,154, 28, 94, 37,151,149, 20,174,173,176,211,245,228,180,123,138,230, 71,174,178, 72,203, + 7, 28,169,169, 96, 29, 98, 61, 73,169, 80, 27, 20,171,175,184, 3,120,136, 20,243,119,236,167,107,161, 83,208, 93,204, 38, 97, + 17, 18, 85,183, 12,155, 1,133,247,104,204,149,218, 45,124,191,215, 68, 21, 86, 72,200, 99,170,111,132,209,226, 41,163,120,196, + 77,159,104,190,203, 27,113, 63, 27, 24,165,151, 54, 39,153, 51,100,218,135, 7, 39,160,143,251, 71, 87,249,229,227,147, 71, 95, + 47,198, 6,244,211,135, 79, 70,231, 35, 20,236, 55, 38, 84, 42,211,235, 89, 20,141,164,164,230,123, 57,145, 15,252,208,164,137, + 22,209,165, 6,176, 33, 25,158,185,182,168,104,145, 40,225,100,229, 54, 2, 85, 7, 80,189, 75,209,108, 70, 88,113,155, 25, 56, + 26, 14,206,206,198, 47,158, 63, 59, 56,188,119,114,156,189,126,245,210, 59,248, 50,254,100,157,203, 5, 5,100,186,116,202,124, +245,230,221,251,183, 31, 63,132, 50, 96,113, 93,218,194,247,187,157, 94,150,246, 58, 98,176,167,209,188,187,210,225, 54, 67, 12, + 29,229,215,192,134,192,227, 42, 69, 43, 99, 80,126, 18,151, 96,131,227,181,117, 87,195,253,142,201,180,194, 43,204,131,119,234, + 98,178, 88,148,110,182, 44, 11,114, 40,198,218,138,240, 64,218,148, 21,219,122, 84, 88, 17, 36,236, 98,140, 87,157,108,143,130, +144,187,208,199, 45, 34, 71, 49, 78, 90,225,211,202,111, 68,157, 54, 10,209,219,194, 6, 8, 91, 3,118,227,111,216,115,243,204, +136,107,202,188,240,103,225, 87,127,127, 79,180,218,161,243,198, 70, 49, 97, 33, 86, 54, 15, 47,156,153,222,138,252,249, 90,145, +166,109,246,113,216, 30,228, 56, 46,104,192,194,239, 62, 55,172, 96, 74,232, 19, 39,169,117, 40,251,156,119, 52,194,170, 29,194, + 59, 60,107,129,199,178,155,116, 14,122,135, 63,103,231,195,189,225,124, 57, 39,170,168,193,136, 36, 9,198, 71,141, 34,104,131, + 41, 19,191,126, 76,191,193,150, 82,124, 43, 4, 73,233,137, 28,253,250, 12, 60,223, 93, 87,255, 22,110,147,114,158,255,134,232, + 93,204,188,151, 58,146, 88, 36,235, 48,192,127, 37,219,136,205,110, 66,186, 67, 89, 51,254, 70, 5,205, 57,194,102, 38,203,116, +203,150,138,198,221, 53, 65,118,143,130, 60, 96,162,201, 25, 15,141, 75,250,136,133, 95, 69,163, 25, 41,183,133,104,226,192,160, + 38, 56, 94, 51,101, 94,182,192, 69,248,231,196,211,188, 17,115,120,194, 49,223, 79,251,151,197, 60,210,214, 36,118,173, 17, 28, +164, 40, 12,141, 3,106,180,190,107,178, 99, 69,252,109,127, 67,168,133,107,179,154,242,123,130, 82,203, 77, 25,245,200, 41,168, + 40,178,220, 70,152,142,163, 71,133, 32, 4,168, 36, 95, 47, 98,208,199, 69, 13, 25, 79,236,210,135,115,130,224,164,219,224, 4, +169, 20,187, 24, 35,198,116,126,159,194,150,219, 8, 92,132,246, 91,114,121,212,186, 9, 47,135, 72, 46,245,126,100, 91, 87, 53, +159,138,214,182,247,238, 16,111,192,240, 44,197,221,214,196,127, 4,224,235, 74,122,155, 6,162,176,103, 28,123, 28,103, 79, 42, +165, 85, 5, 92, 57,113, 66,226,208, 27,255,132, 11, 63, 22,137, 43, 2, 21, 42, 36, 10,136, 37,148,218, 73, 92, 59, 51, 25,230, +123,111,188, 36, 80,164, 40,135,200,138,101,121,230,205, 91,190, 5,253,119, 75, 39,115,103, 34,212,200,231, 52,123, 67,138,142, +166, 78,221,169,100, 24,121,168,173, 75,111,170, 69, 50,231, 60,152,184, 68,240,221,230, 6, 30,159, 15,188, 58, 56,101,135,141, + 51,102,177, 80,122, 87, 50,142, 35,149, 70,233, 32, 74, 37,197,222, 47,155,207,119,166,112, 59, 54, 43, 50,205,210,160, 65,237, +219, 18,216, 65, 50,112, 17,204,214,202,118, 30, 79, 79,105, 3, 83, 97, 3, 54,169,174,109, 33,209, 26, 54,144, 31,226, 81,254, + 52,157,132, 48,219, 16,238,213,110,139,141,197,247,214, 66, 92, 72,220,184, 19, 30, 13,122,123, 58, 59,211, 32,193, 26,166,112, +243,189,220,227,228,225, 70,187,152,104, 66,184, 81,151,129, 49, 1, 33, 99,128, 46,175, 74,228,184, 46,154,199, 49,220, 73,148, + 10, 35, 21,168, 88, 66,177, 32,145, 46, 64, 63,123,250,228,205,187,183, 15,207,207,151,203,211,201,104, 58,159,159,204, 39, 48, +153,188,188,250, 8,230, 29,102,210,160,114, 97,161,239, 69,182,134,173,240, 32,141,163,126,146,105,243, 99,189,189,190,217,172, +242,114, 93,237,116,137, 92, 71,146,232, 58,172,104,201,188, 10, 25,150, 11, 79, 66,244, 3, 57,148, 98, 22,169,101,156,246,118, + 50,207,108,126, 27,189,255,126,123,249,181,248,176,250,253,107, 91,229, 40, 58,184,193,198,196, 96, 75,136,154, 61,243,251, 48, +202, 54, 1,156, 81, 1, 39,115,165, 73,226,206, 57, 13,175,112, 47,163,250,255, 74, 17,111, 71,141,119, 70,243,224,232,197,243, +151,175,175, 94, 13,195,145,182, 85, 23, 33, 96,235,112,115,116, 38, 12,213,152, 88, 69, 94,164, 44, 18,145,245, 35,122,113, 72, +154,181, 42,236, 3,247, 2,211, 71,247,138, 34,225, 29,207,113, 83,221,168,125, 81, 41,213,104, 99,176,178, 8, 9, 34,145, 99, +243, 63, 12,119,164,219,225,154,236, 24, 17,248, 92,236, 9,123,132,122,180,227,100, 90,236,214,108,149,235,178,186,126,156,186, +101,254, 51,255, 70,160,198, 59,222, 27,184,216,119,206, 5,117, 87,172,173,107,244, 7,179, 71,174,102,151, 7, 36, 82, 97, 91, +206,107, 11, 63,175,139,140,150,254,221,250,212, 55, 97,215, 59,111, 0, 69, 58,234,143,220,130,240, 2,141,247,136,221, 52, 0, +201,144,230, 84,170, 23,153,189, 38, 15, 94, 98,245, 51,228, 11,149, 31,214,126,204, 30,200, 20,139,123,100, 32, 67,155, 84,178, +164, 7, 77,171, 2, 47, 58,128,107, 16,247, 37,107, 61, 5,222,180,137,250,236,228,251,225, 45,103, 66,130, 72,146, 37, 31, 11, + 65,201,144,135, 91,190,245,199,187,219,211, 72,197,201,100,158, 21, 57,141, 35, 8,138,234, 37,219,240, 16,181,128,220,222,183, +222,168, 12, 32, 68, 11, 70,100,230, 80, 22,201,221,119, 49, 92,108,202,181,251,151,139,199, 23,159, 86,215, 36, 96,204,197,215, +190, 33,166,134,158,193,137,159, 33,245,100,170, 84,165, 24, 83, 55, 56, 29,201,131, 0,164,149,163,100,234,162,127,109, 76,220, + 49,247, 12,196,114,114,182, 45,215,173,142,207,193, 52,179,213, 13,106, 82, 13, 22,131, 59,226, 61,137, 99,243, 63,241, 55, 83, +164,251, 73,100,108, 58,166,149,247, 77,173,254, 8,192,215,149,237,182, 13, 3, 65, 81,164, 68,209, 87,108, 35, 72, 31,154,160, +232,255,127, 74,251, 9, 5, 90,160, 15, 65,130, 88, 64, 98, 89,146,117,144,221,157,149, 4,169, 73,251,108,152,150,104, 30,179, +179,187, 51,236,239, 65, 51,182,207,142, 20,150, 98,207,196,243,212,216,172, 57,101,202, 66, 72,167,131, 2, 78, 87,108, 54, 23, +160, 63, 99,178,251,245, 61, 20,187, 90,214,210, 15, 56,123, 20,119,200,192,134, 35,128, 76,136, 32,173,133,181, 22,107,171, 33, +136,171,237, 46,219,238,179,157, 99,243,114,255,253,249, 91, 31,117, 13, 99,223,150,251, 80,192,102,130, 9,238,167,208, 66, 14, +238,201,138, 0, 66, 25, 72,221, 4, 35,194, 70, 52,122, 50,184, 85, 67,151, 7,185, 29,186, 69,104, 16,250,244,224,110,234,166, +228,180, 15,133,235,113, 10,137, 81,205,235, 30,133, 77,154,207,216, 0,114,153,155,154,123, 52, 80,211, 95,124,218, 62,215,235, + 38, 86,137, 51,166,238,130, 77,232, 43, 1, 8,154,121, 18, 73, 52,100,150,128,161, 79, 52,178, 87,220,158,203,218, 71, 52, 13, + 15,159,239, 30,159,114,186, 6,234,206, 75,198,134, 32,178,209,198, 57,155,151,158, 32,127,141,163,244,202,234, 95,234,181,106, +104, 78,157, 77,173, 53,150,194, 87,227,223,202,182,174, 26,130,237, 92,171,168,149, 99, 85, 20,191,129,214,188,243,241, 46,177, + 95,182,236, 61,255,214,134,210,247,167,170, 57, 87, 28, 66, 76, 14,170, 49, 92, 12, 83,229, 46, 93, 49, 72,249,120,154, 41, 87, +117,165,135,235, 1, 27, 13,178, 24,113, 4, 3,132,136, 61, 40, 33, 71, 12,173,189, 0,172, 35,135, 14,119, 59,109,237,205,165, + 57, 47, 15,232,192,188, 48, 69,211,126,112, 34,109,163, 94, 51, 18,247,233, 76,134, 72, 22,148,209,182,165,251,123,228,102,166, +213,245,112,252,250, 59,255, 53, 14,232, 93,178,169,219,203,191,106,231,253, 71,160,134,176, 66,235,175,209,232,167,184, 74,215, +244,170,117, 87,202, 37, 77,129, 19, 65, 96,204,200,251, 42,158, 32, 10, 1, 97,116, 18,102,125, 96,223,196,147,253,108, 52,184, + 4,208, 91,163,238,222,150,215,203, 82,240,107,112,251,146, 7, 75,217, 22,202,183, 3,171, 51,203,225,141,143,141,149,182,248, +125,186,204, 93,234,138,234,117,170,140,156,239, 59, 89,237, 96, 54,195,104, 79,175,208,185,180,176,139,255,219,165,123,218,182, + 99,117,142,160,107,141,100,170,244, 3, 42, 61, 35, 82, 4, 21, 65,126, 30,140,185, 52,153,163,148, 24, 5, 32, 82,113, 6, 7, +234, 33, 43, 49,216, 36, 4,116,145,240, 9, 46,231, 56,118,156, 82, 41, 95, 22,210,179, 42,238,241,241,160, 33,204,149, 75,254, +110,255,201, 24,253,227,233, 39, 88,205,174, 97,148,193,138, 32,157,239, 15,187,227, 75,145,215,205,181, 11, 98,173,205,208,163, +159, 90,216, 65,214, 51,171, 46,212, 76, 28,230,202, 13,129,179, 98,122,101, 55,249,229,116, 92,223, 82, 60, 87, 84, 5,189, 13, +133,110,116, 35,210, 83,228,231, 23,214,146,103, 55, 75, 67, 17,219, 8,177,121, 44, 58,139,152,192, 1,105, 37,213, 99,180,134, + 15,171, 3,171, 22, 42,150,212,150, 0,202,207,114,147,244, 44,230,221, 95, 60,175,129, 9,209, 2,209,140,220,189,132, 5,195, +125, 19, 45,181, 69, 37,117, 16,131,111, 84, 51, 47,145, 15,199,255,127,183,197, 31, 1,248,186,150,221,166,129, 40, 58, 30,219, + 99,135, 64, 43, 17, 64,160,116, 1,252, 8, 63,193,142, 47,236,138,159,224, 31,144, 88, 66,187,104,169, 40,139, 56,118,237, 25, + 15,247,156, 59, 78,236, 20, 85,138,178,176, 18, 59, 25, 95,223,185,175,115, 78,242,239,179,146,157, 93,218, 74,150, 45, 77,237, +208, 33,102,161, 2, 86, 65,230,112,248,213,194, 20,239, 86, 91,151, 21, 32,112,136, 10, 56,214, 74, 46,233, 77,224, 53, 37, 11, +198, 6, 46, 91, 36,184,224,243,122,101, 93,229, 16,188,131,193,185,168,238,186,155, 31,247,223,197, 56, 90, 96, 82, 60,135, 3, + 83, 15, 92,222,215,213,139,246,161, 33, 72,153, 45,124, 29, 6, 72,120, 84, 75, 42, 16,134,212, 76,239,192,211,101, 11, 16,129, +189,249,120,117,251,203,229,217,246,229,197,223,230, 94, 30, 44, 49,193,139,205,118, 93,175,174,239,174,224,223,105,241,242,251, +190,124,250,124,249,237,107, 34, 70,128,205,137, 59,197,172,213,200, 34,205, 88,246,183,175,111,118, 77, 46,201,192, 84,119, 52, +202,108,169,189, 59, 56,205, 2, 90, 27, 6,106,124, 72,110, 93, 9,148, 45, 64, 64,182, 4, 52,130, 65,132, 92,110, 93, 99,189, + 92,105,189,183,191,247,189,100,162,251,193, 55,221,176,107,123, 32, 78, 77, 40, 89, 93,161,132, 48, 44,183,237,122, 50,204, 32, + 87,232,250, 49,175, 74, 38,242,242, 48, 12,178, 91, 20,222,156,163,158,239,222,158,159, 57,238, 45,118, 44,218,208,128,162,147, +163, 97,236,226, 67,228,128, 88,109, 49,199,170, 11, 77, 32,234,209, 27, 21, 47, 54, 12,230,201,230,129,187,165,177, 85,228,192, + 85,194,196,135,228, 37,130, 89,136, 16,165, 65,240,231,245,153,172,135, 68, 76,178,205,239,135,102,138, 36,194, 9, 42,239, 80, + 90, 57, 8, 31,230,198,121, 51,112, 32,221,243,120, 98, 60,151,123,247, 16,218, 37,174,239,255, 25,232,140,236, 40,215, 51, 16, + 81, 82,139,147,105,161, 38,168,127, 33, 30, 35,150, 83,145,156, 68,109,125, 24,144,159,127,216,102,118,113,185,120,108, 30, 60, + 53,236,160,162, 63,148,236, 61,209, 82,210, 30,157, 43, 74,241, 98,217,148, 70, 80, 81, 52, 39,160, 39, 62,226,137,156,196, 49, + 82, 20, 31, 55,207, 94,237,186,102,140, 73, 57,100,193,124,182,116,235, 83,177, 95,171,236,140,203, 98, 76, 2,152, 20,218,200, +141, 86,198, 13,227,235,212, 6, 69, 48, 14,244,185,122,108,100,195, 38,149,223,149,124, 66, 25,178,217, 8, 77, 75,165, 12,142, + 28,168,139, 60, 3, 88,242,224,214, 81, 14,229, 13, 5,190,105,166,184,157, 81, 72, 7,175,140,227,186,100,174, 22, 3,240,180, + 66,137, 14,229,100,157,239,134,209, 67,171,128, 40,101, 50,133,177,176, 8, 45, 27,124,151,179,140, 75,182, 82,173, 45,176,172, + 26, 8,131,116,165,147,171,239,250,189,206, 98,192, 67,227,105,240, 22,136,150, 94,130, 75,144, 78, 99,170, 50,176, 7, 59,234, +254, 45, 71,154,190,213, 0,123,164,124,171, 4,155,218,225,200, 20,225, 54,105, 57,205, 44,240,209,136, 64,170,205,104,202,152, +197,101,210, 26,103,180,123,241, 8,155,152,183, 91, 76, 85, 86, 45,225,132,241,212,251, 39,255,254,126,243,225,250,207,207,240, + 36, 77,253, 63, 1, 8,187,182, 29,167, 97, 32,106,215,118,156, 52, 85, 90, 16,101, 5, 8, 33,158,144,248,255, 31, 97,121, 65, +192, 35,210,238, 66,233,110,155, 52,110, 46,142,119,102,236, 36, 77, 75,133,250, 18,169, 73,147,182,227,241, 92,206,156, 51,209, +231,227, 23,130, 94,158,107, 78, 78,133, 75,130, 20, 11, 11, 83,200, 36,169,138,129,188, 31,117,187,137, 95, 47,213, 42,175, 75, + 99, 27,129, 14, 29, 13,194,203, 62,128,231,154, 57, 50, 43, 71, 59,188,210, 16,233,104,153,164, 81,154,202, 88,176,238,203,246, +214, 52,121,150, 46, 55,135, 77, 99, 43,236, 58,162,140, 13,237,157,131, 56, 13, 31,135,170,103,161, 35, 52,106,251, 98,110,232, +200,178,124, 33,136,243, 88, 68,136,101, 4,155,131, 23, 85,240, 67,112,129,124,186, 92, 99, 16, 79,101,156,182, 91, 36,243, 67, + 85,194,187, 36,214,238, 72,181,167, 93,205, 95,110,203, 71,200, 36,192, 73, 55, 81,113,175,246, 71,204, 77, 72,226,131, 90,252, +204,249, 65,185,192,139, 73, 89,173,212,154,199, 26,247, 30,228,101,236,144,114, 29,190,103,132, 18,226, 16,227,179,133,198,246, + 77, 83,241,253, 65,228, 88,244,193,157, 4,220,169,169,154,202,182,149,181,115, 45, 82,141,244, 30,144,194,128,153,151, 6,245, +197,224,114,120, 38,211,192,102,129,169, 67,139,132,201,158, 2, 27,114,136,218, 84, 85,145, 35,219, 78,170, 52, 92,187,210,201, + 18, 82, 35, 28, 55,227,202,105, 99, 11,170,195, 32,236,136, 59, 9, 89,132,119,223,158,200, 77, 48,105, 58,227, 89,155, 49, 74, +183, 54,213, 89, 89, 23,240,177, 62,122,119, 30,223, 48,113, 85, 65,118, 50, 81, 9, 81,168, 7,187, 23,161, 89, 58,153,175,118, + 87,176,188, 20,248, 43,159,102,178, 19, 94,148, 16, 24,177,208,212,226,189,170, 34, 46, 63,174,106, 87,177, 17,230,141,207, 32, +241,182, 42,137,226,188,218,159,209, 76, 94, 83, 61,237, 49, 45, 51, 54, 98, 64,176,193,126,179,124,251,176,187,203,226, 21, 68, + 3,223,239,190,157, 98,145, 61,189,156,146,186,105,143,108, 40,163,156,172, 12,254, 47,252,242, 57, 41,141, 80, 4, 60,109,134, +194,172,111, 35, 93,251,137,168,253, 57,241,239,152, 95, 58,210,155,236,253, 59,121,223, 25, 81,174,246,237,229, 94,238,131, 10, + 40, 46, 52, 54, 81,129,132, 42,170, 84, 56,197,112, 12, 2, 17,226, 95,148, 28,143, 41,216, 22,148,206, 6,153, 11,143,138, 20, +161,166, 45,108,128,178, 34,114, 5, 12,185,110,143, 1,150,216,245,114,125,140,130,247, 97, 1, 50, 65, 2,122, 1, 34, 25,134, + 97, 89,240,117,176,118, 60, 31, 53,197,230,152, 65,182, 20,188, 55,180,242,240,160,115,239,215, 31,126,222,255,128,219, 81,214, + 59,131, 44, 23, 91,201,104,196,184, 51, 8,210,102,234, 9, 6,209, 76, 23,113, 10, 62, 29,110,247,176,251,195, 17,249,106,215, +233,218,116,199, 93,249,180,152,103,182,174,225, 73,115,179,127,149,173, 55,197,239, 79,111, 62,127,253,117,235,145,220,148,168, +182,239, 94,124,124, 52,127,253, 40,254,182,124,234,201,216, 93, 23,164,189, 71,212,253,217, 8, 18, 31, 60,112,111, 6,112, 62, +228, 16, 82, 70, 24, 83,242,129,171,250, 18, 30, 60,254,245, 39,210, 90,126, 4,130, 13,154,218,238, 66,225,253,191, 24,121,127, +218,179, 0,124, 93, 93,111,211, 64, 16,180,207,190, 56, 78, 82,147, 34, 81, 34,120, 40,188, 35,229,255,255,136,194, 31, 64, 8, + 33, 80,213, 64, 63,104,113,237,179,207,119,236,236,222, 37,142,137,144,170,188, 52,138, 99,103,111,111,118,111,103,102,146,223, +211,127,106,189,116, 50,193, 22, 90,162,209,204, 90, 49, 40,229,253,153, 71, 30, 25, 61, 87,249,217,166,216, 80,222,105, 44, 58, +190, 76, 97, 29, 16, 71,120,112,148,200, 41, 0, 40, 9, 83, 40, 20,133,134,107,180, 70,163, 70,125,123,250,124,243,124, 3,134, + 71, 2,217, 55,100, 48,209,255,247, 66, 44,150,152,139, 98,170,220, 66, 17,215, 0,132,146, 15, 54,190,244,189, 64,128,206, 49, +181, 40,121, 28,110,166, 74,173,202,213,155,234,245,143,251,107,218,133,182,151,219,187,199,219,251, 63,183, 40, 65,164, 16,197, +225, 83, 48,117,100, 42, 16, 40,158, 29,133,155,162, 76,183,170,251, 90,184,184, 40,168,114,215, 86,245,227,204,224,190, 65,153, + 78,165, 25, 69,241, 73,139, 66,110,150,235, 77,199,190, 29,108,226, 1, 1,179, 76,210,211,192,238,165,132, 9, 50,229,202,162, +160,149,215, 66, 29, 99,152, 65,133, 7,137,181,243, 93,107, 29,221,166,246,186, 29, 82, 88, 72,250,196,216,206, 24, 75, 31, 81, +228,136, 70,199,222,241,125, 79, 48,199,211, 30, 69,143,171,239, 58,130, 44,157,197, 95,211,216,223, 77, 95, 27, 12,159,105,229, +171,172, 80, 86,207,210,116, 61, 7,154,145,210,196,178, 58, 56, 55,101, 88,146,204,137,234, 7,122, 55,240,218, 70, 71,141, 42, +104,174, 98,197,131,210, 7, 47, 74, 23,137,127,213,188,170, 77,189,199, 14,233,148,114, 61, 28,219, 16,159,134,184, 2,255,150, + 97, 96,113,188,121,120,102,126,251,245,226,252,221,197,251,143, 95,175,232,167,191, 88,190,250, 89,239, 74,189,100, 80, 19, 50, + 13,109, 15,132, 15,106, 62, 83,141,178,164,255, 23,236,155,142, 30,140,101,188,248,136,126,127, 16,117,192,239,225,192,150, 7, +180,243, 60,167,224,196, 65, 77,226,233,210,173,125, 94, 22, 47,232,121,143, 79, 70, 71,202,192, 62,153, 90,117,203, 40, 59,174, +242,146, 71, 30,211,253,154,158,126, 67, 21,212,150,130,166,159, 58,248,159,122,225, 48, 68, 15,141,112, 23, 62, 90,255,178,191, +158,204,171,123, 86, 9, 16, 11,135, 44,211,236, 74, 12, 76,157, 67, 62,136, 94,129,123, 50,218,117,114,193, 37,204, 94,197,144, +100,137,247,138, 61,142, 74, 98, 5, 64,107,197,176,143, 41, 54,253,129,155,225, 80,228,224, 38, 58,214, 71,150,241,164,128,156, +166,226,243,120,105,102,123,150, 83,156, 36,151,148,105,153, 88,193,117,155,192,115, 39,205, 25, 11,197,175, 1,189, 89,156,111, + 66, 18,146, 46, 71, 0,231,195,229,246,211,151, 43,174,138, 68,193,192,111,214,111,175,239,190, 11, 57, 32, 70, 32,202, 81,169, + 56,170,114,253,100,234,110,104,133,192,196,182,170, 78,235,130, 48, 28,183, 26,193,225,238, 97, 75, 41, 14,149, 88,179,244,212, +206,230, 21, 1,133,221,195,142,240, 88,221,183, 73,152,240,142, 24,231,232,247,117,227, 38,225, 66, 47,204, 96,134, 67, 24,200, +114,193, 32,103, 32, 11,143,129,142, 63, 38,156, 73,247, 51,212,181, 46,137, 92, 13,249,119, 85,158, 63, 52,191,164,251,151,158, +102, 87,157,232,216,200,155,254, 10, 64,216,181,236, 54, 17, 4,193,153,217,183,157,181,113, 28, 39, 74,114,203,137, 11, 34,226, +192,129,175,231,192, 31, 32,200, 13, 4, 2,161, 32, 99, 39,126,173,199,251, 24,186,186,199,187, 22,182, 68,148, 67,148,104, 45, +103, 60,211, 83,253,168,170, 46,190,235,147, 50,214,123, 80, 18, 28,108, 80,237,157,209,240, 67,200,108, 5, 49, 89, 7,163,193, +241,184,161,161,160, 18,221,102,183, 89,152,150, 94, 4, 78,154,177,102, 47, 12,157, 12,226,164,116, 81,158,166, 61,147,208,142, +249, 52,123, 88,185, 69, 24,132,243,245, 12,247, 57,133,120,130,117, 94,235,189, 25,102,163, 2,170,255,182,213,170,102, 86,161, + 54, 94,199, 79, 42,135,106,220, 63,175, 27,187,221,149, 40,249, 1,134, 24,208, 75,125,203,136,242, 46,228,140, 33,235, 59,211, +106, 32,244,155,248,205,221,171,207,223, 31, 34, 19,190,123,249,246,253,199, 15, 0,239, 60,204,121,127,247,250,219,239, 31, 79, +219, 5,212, 69,184,172, 90,241,213, 45, 10,150, 42,168,202, 81,177, 84,244,198, 97,144, 93, 86, 21, 45, 65,130, 94, 4,236, 88, +129,172, 81,140,230,156,163, 86, 69,221, 4,190, 21,173,217, 78, 18, 70,178,180, 42, 55,147,139,136,226, 45, 42, 57, 16,171, 41, +138,102,109,183,235,221,142,118,105,222,143, 38,121, 22,201,184, 58, 90,184,181,221, 86,200,163,249, 87,107, 75, 40, 36, 46,184, + 15, 74, 1,159, 94,205, 90, 75, 47,179,161, 27, 9,130,143,208,121, 7,196,193, 57, 86,105,210,152,216,109,214,106,190,170, 42, +219,100, 42, 24, 4,248,247,123, 38,164, 11,134, 62,192,141, 43,192, 18,174, 53, 76,112,112,236,240,108, 13,135, 4,124, 12,146, + 16,251, 10, 25, 67,201,122, 95,196,200,194, 76,202,151, 41, 39,146,173,218,251,177, 56, 82, 91, 64,220,227,113,165,143,202,134, +135, 65, 16, 2,201,154,174,183,130, 79,136,159,205, 72,227,158,221,121, 67,162,125, 16,111, 41, 69,126, 91, 18, 98, 98,190,204, + 73,154,183,180,173, 92, 14,202,248,178, 37, 99,138,145,119, 14,122,234, 34, 14,211, 60, 25,206,214,211,142,220,215,137, 40,224, +122,142,227, 88, 12,103,218, 25, 81,199,140, 10,246, 74,213,135,195, 42,195,222,139,231,226, 73, 31,201,140,116, 66,199, 82, 71, +104, 65,155, 59, 98,165, 59,137,172,110, 60,184,156, 47,255,232,195,248,206, 75,125, 53,184,158,174, 30, 59, 14,129,246,132, 41, +246,179,145,131,169,185,151, 96, 68,228, 55, 98, 78,105, 20,134, 17,119,158, 40, 29,140,225, 74,234,123,161, 41,132,168,245,200, + 68,151,121,114,209, 15, 38,103,113, 22,129,219, 1,112,100, 20,228,140,118,245,170,168,159,183,106,110,221,115,161,167, 22, 67, +181,220, 78,103, 40,206,246,180,141,120,165, 41,111,210,228,137,172,206, 72, 76,104,199,221, 4, 47,211, 31,111, 70,215, 95, 30, +191, 42,174,115, 98,215, 41,142,239, 28,229,165, 32, 83,178,142,140,173,119,244,237,205, 33,180, 68, 92, 97,165, 98,249,206,178, +156,178,162, 57, 96,114,151, 9,137,202,108, 35, 90, 41, 92, 50,135, 14, 45,198,206,120,130, 89,171,125,212,150,192,221, 76, 6, + 87, 43,187,220,216, 13, 43,215,162,164,138,253, 86, 22,252,172,116,203,121,226,155, 41,173,109, 17,197,233, 46,239, 60,194,217, +174,195, 28, 62, 91, 20, 72,254,175, 35,130,200, 52,209,209, 32,184,112,222, 27,255, 90,252,228,170, 90, 32,102,223,206, 63,229, + 78,186,216,255,247,235,175, 0,140, 93, 77,111,211, 64, 16,245,218,222,117,226, 52, 77,218, 82, 17,133,182,215, 30,144,144,144, +248, 9,136, 3, 39,254,102, 15, 28,248, 19,156,184, 32, 85,130, 3, 66, 28, 80, 69, 75, 16,184,142,147,216,187,246, 50,111,198, +219,244, 67, 72,168,151,182,106,171, 52,182,103,223,204,188,143,190,190, 63,108, 99,149,186, 15,115,194,148, 38,238,185, 74,253, + 64, 45,145, 98,207, 76, 45, 53, 29, 29,172, 86, 37,239,222,209,229, 76,245,238,209,104, 14, 83,214, 22,184,208, 48,199,157, 14, +198, 65,130, 52,233, 8,153, 24,186,178,215, 31, 23,231, 27,208,156, 35,235,155,201,206,193,162,184,114, 81, 35, 4, 39, 31, 82, + 87, 68, 61, 17,247,146, 16,166, 76, 49,241, 23,197,155, 5, 8,147,108, 55, 97,119, 11,240,185,233, 88,166, 26,145,160, 67,164, + 98,161,169,184,211,109, 77,159,240, 30,127,146,239,206,246, 30,127,191,132,166,105, 66, 56,180,169,232, 88,202,204, 96, 93,175, + 79,143, 78,127, 20, 87,191,150, 11,199,154,108, 49,141,230,172, 95,107,177, 69,194, 72,156,110,172,217,116, 94,214, 69,103,234, + 50, 43, 97,216,101, 91,197, 82,133,198,226, 12,166, 50, 59,204,226, 76, 83,229,133, 86,114,133,156, 2, 31,196,179,132,169,113, +206, 13,147,228, 81, 62,188,234,154,142,173,250, 60,140,121,219,138, 94, 74,131, 34, 75,181,125, 62,205, 39,227, 36,213, 32,176, + 91,231, 45,146,130, 65,240,202, 76, 66,143, 82,227,162,114, 73,224, 67, 67,197, 74,183,225,202,242, 59, 14,110, 13,117, 71, 84, +157,107,231,107, 60, 34,145, 54, 17,245, 9,214, 66, 0, 69, 71,212,166,238,196, 42,139, 26, 43,103, 27,211,166, 59,105,156,167, + 38, 55, 70, 14,170,198,114,216, 60,155,112,163,202, 59, 12,228, 49, 79, 75,204, 90, 34,111,188, 76, 78,168,130,164,206,187,135, +155, 79,193, 34,119,179,156,194, 72, 49, 29,206,166,199, 95, 23,159,233, 34,142,244,184,178,165,250,167,253,145, 10,194,144,237, +102,136, 9, 48,112, 97, 45,123,188,175,238,213, 77,182,122,198,150, 53, 67, 72, 11,222,126,157,228,182,221,104, 80,241, 28,175, + 46,251, 28,221,155, 48, 35, 40, 54, 18,253,100,255,228,219,207, 47, 33,230, 37,241,119,103,154,125,136,157, 64,219, 45, 84,138, +111, 39,126, 68,129,248,203,161,185,140,217, 4,174,138,168, 64, 8,116,204,176,204,116, 6,199, 30, 8, 50,111, 78,190, 86, 5, +111, 5,181, 53, 80, 51,244, 61,216, 63,132, 71,108,155,197, 33,209,105, 60, 72,140,195, 22, 42,234,131,141, 48, 0, 77,249,107, +201, 88,210,120, 68,128,214, 9,167, 27,172,155, 8,123, 65,189,199,152, 61, 54, 74,239,235,116, 54,214, 39,211,252,248,208, 28, + 76, 50,132, 56,243,216,153, 97, 50,148, 46, 94,100,204, 50,166,136,216,139,177,141,174,151,238,226, 79,119, 89,232, 69, 29, 45, +106, 27,243, 72,217,247, 33,129,226, 73, 28, 11,243,130, 53,171,113, 24, 92,108, 37,199, 97, 65, 39,232,191,147,225, 59,218,118, +190, 82, 64,241,232, 47, 45,149,254,220, 12, 95, 62,127,117,246,254,204,123, 97, 61,132,178,128, 77,236, 97, 81, 21, 14, 78,188, + 74,168, 81,178,178,164, 31,217, 27,239,255,174, 10,164,191, 49, 93,140,126,113,104, 70, 93,107, 87,204, 16,237,109,198,249,127, +148,169, 11, 67, 9,208,224,169,151,166,115,111, 99,233,177,174,251,209, 77, 24, 79,122,105,155,188,162, 63,181,110, 86,131,116, + 80, 53,203,219,201, 7,132,117, 54, 22, 87,214,232, 1,157,106, 85,159,243,215,241, 7,251, 45, 42,117,127,186,226,187,215, 47, +222,188,251,240,150,122, 42, 23,185,167,243,103,159, 46,206, 67,156,247, 54,158,172, 95,186,162, 12,179, 38,247,255,170,252, 95, + 1,232,186,150,229, 36,130, 40,218,243, 30,102, 8, 18, 30,134,160, 49, 27,227, 55,164,252,112,171, 92,185,208,133, 91,127, 64, + 43,101, 64, 2,145, 16, 96, 96, 30, 61,211,222,115,187, 71, 38,104, 82,149, 41, 22, 36, 60,186,231, 62, 78,159,123,206,127,226, +187,245,140,183,182,211, 28, 29, 68,143,230, 68, 65,203,181,221,205,110,141,206, 78, 9, 62,219,243, 65,146, 17,192, 17,186,113, + 23, 38,135, 74,180,189,246, 56, 30,211,149, 42, 62,223,246,181,157, 18,189,203,101,122,255, 43,185,127, 76, 31,112, 63,240,152, +184, 89, 90,136,134,115,171,165,195,133,210, 38,236,245,236, 53,103,233, 78,171, 3,186, 18,124,191,120, 51, 87,106,220, 31, 39, +251, 77, 14, 65,125, 20, 84,204,244,130, 16, 60,135,117,168, 25, 67,135,215,113,125,248,229,161,156,215,180, 92, 10, 22, 2,250, +115,160, 36, 86,252, 87,146, 81,193, 2,210,174, 82,163, 19, 69, 85,188, 25, 92, 92,157, 95,125,248,246,209,245,188, 18, 39,189, +237,172, 76, 83,153,211,190,109,117,100, 60,164, 45,147,229,185,218,225, 92, 89,165, 84,214, 74, 5, 32, 19, 98, 0, 2,178,215, + 48, 59,117, 61,122, 88,105,124,147,213,123,132,253,105, 49,117,125, 31, 32, 39,215, 58,153, 44, 10,176,143,202, 56,244,206,186, + 81, 43,116,216, 16,139, 53,171,133, 12, 60,187, 29,133, 54, 10,234,124, 52, 26, 93,191,191, 30,246,123,159,191,124,165, 76,244, +253,230,231,228,246,214,245,124,246,205, 46,211, 76, 38,123,153,115,189, 19, 4, 86, 0,178, 38,181,231,202,243, 4,181, 7,153, + 20,219, 68,108,118,149, 22,183,217, 83, 70,161, 79, 91,200,216,117, 66, 10, 7, 44,188, 6, 74, 41,253, 66,136, 91, 49, 40,207, + 39, 83,102,130, 92, 24,209,230, 6,133,139,201,145, 39, 89,190,163, 14,130,130,198,184, 59,186, 89,254,176,143,139,116,163, 29, + 98,153,131,217,102, 56, 83, 71, 44,177,208,139,210, 98, 71, 47,209, 9,105,161,105, 23,149,180,115, 6, 39,131,201,227, 68,135, + 10,234,189,168, 29,214,242,100,170, 30,128, 56,141,122,219,253,138,179, 14,235,238, 54,143, 29,213,113, 33,175,177, 23,250,207, + 20,244,114,173,220,123,116,154, 42, 68,173, 5,102, 76, 26,107,150, 70, 51,178,215,228, 13,139,249,241, 84,226, 68,125,138,188, +191, 55,115,195,127, 6,200, 85, 94, 14,222,206, 30,167,153,220, 83,160, 56,239,190,154, 45,167, 54,143, 61, 80,218,140,189,120, +157,174,158,170, 7,234, 17, 83,235, 48,116, 37,106,145, 23,131,207, 40,212,226, 58,223, 40, 22,246,226,178, 93, 31,150, 82,155, +135,128,142,210,156, 58, 33, 42,213,225,241, 66,165, 21,148, 42, 44,186,210, 46,244,232, 86, 29, 5,254,235, 23,241,187,179,240, + 98, 24, 7,129,163,129, 4,172,144, 6,124,112,225, 9, 83,206, 85,140,123,224, 84,138,174, 84, 22, 0, 75,145,149,190,206,215, +226,110,229,206, 18,119, 85, 84,185, 44,205,212, 40, 40,191,104, 32,213, 83,105,132,191, 11,110,248,206, 96, 69,234,244, 1, 19, + 78,201,130,190,128,103, 25, 34,164,135,113, 4,198,237, 98, 61,175,216,202,141, 13,169,141,211,158,193,104, 76, 71,136, 55,109, +114, 50,195, 40,250, 94,102, 21, 57, 60,231,180,213, 95,165, 15, 5, 85, 73,150,241,177,225,128, 93,214,200,251, 33,107,131,147, +137,198, 7, 7, 7, 84,240,105,247,178, 82,131,106,120,105, 78, 31,134,101, 9,139, 65,230, 18, 31,198, 59,226, 32, 78,210,132, +191, 39, 52,184,108,191, 86,105,183, 41, 74,177,212, 31,136, 99,232, 30, 8, 85,175,253,114,177,189,115, 45,205,155,208,159, 8, +225,150, 13,194,155,228,254,138, 86, 18,138,152,255, 48, 23,158,251,249, 35, 0, 93, 87,187,218, 68, 16, 69,119,246,123, 55,217, +216,216,164, 52,133,210, 10, 85,240, 71, 65,170, 32,248, 6,226, 67, 8,250, 50,234, 19,233, 51,168, 69,196, 31,130,138, 86,209, + 20,147,150,184,117,179,223, 51,222,123,102,119, 83, 34,205,191,144, 31, 59,187,153,189,115,238,189,231,158,163,249, 51,198, 37, +163, 44,113,165,192,152,106, 79, 12,193,162,237, 4,145,226,140, 69,213,233,254,239,223,122,240,246,203,107, 11,246,187,141,141, +139, 50, 67,215,175,185,251, 97, 66,146,205, 4,136,118, 88,175, 11,135, 54,151, 54,180, 46, 25,116,101, 24, 44, 10, 93,147, 81, +141,224,187,108, 24, 68,145, 63,136,243,216, 22,171,186, 63,191,255,182, 55,236, 15, 79, 23, 83,143, 93,185, 53,177,150,139,135, +104, 22,241,228,197,157,253,195,207,211, 79,182, 98, 24, 63,240,162, 81,180,185, 53, 24,253,152,159,208,166,113,224,220,232, 64, +248,253, 90, 48, 96,177,120, 76,102,106,173, 57,200,153,169,174, 32,200,248, 93,213,116,185,155, 59, 7,199,223,222,179, 25, 19, + 26,247,146,135, 6,197, 36,218,249,122,118, 2,149, 2, 10,216,210,166, 48,106,151,195, 77,193, 53, 34,197, 61,165, 56, 22, 69, +105, 85,133, 73,200,158,112, 29,129,230,113,127,242, 43,153,150, 12, 45,173,153,181, 48, 3, 87, 59,187,179,148, 38,197,100,163, + 78, 74,186,156,181,189, 17, 97,236, 8,179, 39,182, 69, 9,106,200,132,122,222, 79,247,238, 30, 61,126,242,116,239,246, 33,161, +192,217,247,143,227,201,238,197,124,246,226,217,243, 55,239, 62, 84,149,149, 3,125,231,204,206,171,153,193,138,218, 21,221, 18, + 61,250,176,103,132, 30, 29,110, 42, 93, 26,105, 38,146,140,229, 37, 10,237,180,170,128,250, 11, 90, 32, 33,156, 50, 52,184, 91, + 78, 95, 43,206, 92, 36,179,224, 27, 16,132,154,124, 35, 5,130,234,153,209,169,101,115,159,186,130,204,186, 99,251, 89,149,154, + 87, 78,216,173, 59, 77,211, 67,190, 30,142,206,151,243, 86,163,156,255, 77,223, 9,170, 42,239,249, 17,102,253,133, 92, 57,108, +160,231,207,137, 96,208, 78, 51, 53, 81,131, 82, 67, 58,116,247,198, 55,206,255,204, 8, 94,137,150, 32,208,173,195,119,252,164, + 76,244,226, 61,219,131, 14,101,254,191,251,146, 46,180,154,151,170,154,180, 0,215,245, 88,182,150,199, 82, 58,105, 45, 94, 10, +193,255, 10, 38, 30, 77,251, 12,172,109,140,237,106,250, 34,183, 61, 67, 47,202,202,132, 98,167,235,184,180,189,181,231, 12,151, +252, 48,186, 93,214,229,229,182,112,219, 0, 48,215,184, 55, 93,124,231,150, 41,100, 55,233,129,211, 45,203,186, 64, 27, 83, 56, +152,122,103, 95, 23,139,123,206,125, 63, 50, 85, 74, 59,214,133, 86, 47,167,204,166,189,227,187,187, 27,193,193, 86,111,127,187, +239,184,173, 0, 31,191, 37,208,231,211,194,220,220,143,114, 28, 63,112,131,190,217,235,219,182, 47,108, 79,193,146,148,187,244, +148,165, 22,121,145, 45,147, 56, 78,255, 46,210,228, 34,203,211,248, 66,253, 60,243,126, 47,131,105, 86, 88, 0,171,140,229, 13, + 11,199,150,208,101,104, 29, 99,218,252, 12,108, 71, 20, 2, 52,219,189,212,110,203,178,206, 97,199,193, 23,226, 20, 76,130, 87, +163, 32, 70,221,241,103,224, 45, 11,143,120,209, 52,246,155,255,183,110, 39,117,233,183,237,141,201,116,113,202, 9, 7, 6, 30, + 88,174, 76,147,104, 52,173, 82,151, 90,218,198,168,142,170,178,221, 46, 96,230,107,118,176,194, 0,115, 85, 33, 82, 19,108,167, +196, 11, 12,159,102, 50, 89,106, 72, 46, 91,138, 37,248,154,116, 23, 15,143, 30,189, 58,126,217,208,173,128,184,133, 92, 73, 67, +172,141,158,181, 3, 91,162,235,192,170,238, 20,236,198,185, 86, 47,139, 92,119,212,185,250,243, 79, 0,198,174,101, 39,110, 24, +138,218,142,157, 56, 78, 50, 1,134,151, 0, 33,181,160,138, 10,117,213, 15,224, 7,202, 95,116, 81,169,127,202,178, 72,253, 2, +250,160, 20, 6,230, 61,147,216,233,189,215,246,116, 68, 89,116,151, 5, 66,153,241,157,235,251, 56,143,160, 47,150, 4, 37,165, + 16,100,126,114,151,172, 9,245,121, 5,165, 44, 45,172,109,144,170, 10, 95, 61, 53,152,222, 3,253,230,254, 6,221,207,137,216, +188, 50,153, 65,143,102,127,157, 70,165, 71, 28, 15,195,105, 49,171,179,140, 28,183, 29,157,151,245,146, 79, 8,238,240,208, 68, +106,189,124, 53, 99,116, 49,109,103,222,222, 58, 98,222,131,117,234,201,222,233,175,225,207, 92, 21,144,242,136,153,230,253, 61, +130,149,204,253,232, 14,126, 61,138,214,247,112,160,139,249,116,127,115,119, 58,159, 66, 85, 0,141,133,136, 76, 90,244,239, 98, + 45, 41,113,132,225,157,239, 67, 93,240,103, 96,148,212, 44,244, 92,223, 30,127,120,194,160,136, 85,102,157,215,183,195, 91, 58, + 78, 55,183,237,100, 97,199,179,118, 56,230,221,180, 26, 12,248,195,160,187, 27,112,197,247,126,143,198, 75, 75,154, 80, 82, 45, +237,124,216, 60,194, 11, 64,249,207,157, 80,213, 50,175,136, 59,146,160, 54, 27,225,200, 88, 42,161,185, 75,122, 70,105,124,123, +169, 51,105,242,148, 35,172,190,219,217,234, 93, 94,126,248,248,233, 51,180, 19,110,254,157,179,197,211,195,237,215,235,171,227, +147,211, 94,161,175,191, 92,213, 61, 93, 22, 18,125,190, 21,109,157,137,155,229, 90, 95, 76, 73,214, 73,228,103, 53, 46,149, 93, + 89, 64, 23,130, 62, 83,165, 54,239,207,223, 38,174,123,120, 26, 9,166,160, 53, 53, 6,154,211,165, 66,140, 70,226, 77,209, 50, +132,255, 96,100,195, 51,100, 13, 56,250,192,122,164, 66,187, 65,216, 70, 48, 96,241,145, 71, 27, 23,150, 43,211, 58,183,198,182, + 65,185,212,149, 66, 25, 95,131, 54,250,136,105,145,171,189, 66, 49,226, 69, 3, 1,179,104, 22, 34, 90, 82, 64, 72,146, 84, 94, + 75,233, 30,110,177,214, 47, 62,225,115, 24, 8, 3,183, 12, 22,131,144,131,219,153,196,134, 77, 58,212,172,134, 39, 73, 96,126, +148, 9,235,229, 27,208,156, 80, 89,129,177,247,108,210, 30,228, 72,152,203, 84,234, 25, 52,135,219,199,232,213,137, 11, 77,140, + 5,177,150,220,189,228, 94,207,212, 29, 57,208, 10, 22,125, 30, 59,118,118,120, 62,130,234, 7,185,172, 88, 7, 16, 26, 16,203, + 90,148,104, 23,164, 82, 24,136, 9, 81,165,115,173,206,133, 44,140,116, 74,193, 60, 30,166,251, 43, 52,128,153, 93, 37, 41,177, +118,145,132, 41,201, 1, 89,226,186, 11, 43,116, 77,222, 97, 70,114,147,170, 74, 65,179,156,104, 5,207,162, 76,210,131,194,188, +219,169, 47, 94,245, 47,206,250,111, 14,203,173, 26, 83, 59,252, 54, 20,116,180, 89,154,166, 56,171, 73,112,129, 6, 95,101, 85, +236, 29,149,251,175,245,238,145, 40,250, 54, 41,103, 54,153, 55,108, 12, 77,225,210,161, 85,175,149,141,208, 60,171,178,141,157, +162,127, 80,109, 31,153,106, 75,107,182,145, 79,106, 53, 75,157,110, 59,141,131,120,225,135, 93, 1, 90, 19, 45, 57, 87,108, 46, +252,131,237,178, 63, 37,125,177,149,170, 90, 27,156,244, 92, 28, 80,176,216,156,209,108,136, 5, 66,134,139,215, 43,127, 81,200, +136,178,245,120, 54,241, 54, 65,156,199,219,218,215,206,156, 67, 12, 19,196,178, 99, 43,111,241,224,139, 18,134,106,200,100, 67, + 23,210, 77,156, 43,224,212,222,121, 7, 16, 74,107,141,231, 36,211, 42,213, 18,188, 40, 40, 47,210, 74, 48,104, 99, 64,113,217, +162,120,113,248,119,193,220,131,191, 32,181, 20,105, 82,252, 95,144, 76,120,221,231, 68,167,238,255,149,200,254, 8, 64,215,185, +244, 54, 13, 4,113,220, 94, 59,235, 56, 73, 93, 2,109, 17,109,213, 22, 40, 41, 32, 78,168,229,204, 7,225, 0,119,196,129, 3, + 18,124, 26, 36,248, 40, 72, 92, 17, 20, 81, 84,241,146,218,164, 21, 13, 41,121,217,241,174,119,153,135,157, 56,149, 56, 38, 82, + 44,197, 94,207,227, 63, 51,191,241,157, 25,228, 19,207, 25, 79,112, 97,146,228, 78,171,169,102,154, 4,104,252,111,204,188,200, +127,130,167,180, 16,215, 80,180,163,150, 18,198, 80,104,244,100, 26, 51, 92,172, 75, 67,240, 74,213,126,227, 54,163,165,225,120, +136,146,153,165, 14, 67, 90,208,204, 8,255,140, 29,232,252,138,111,183,232, 0,179, 69, 55, 24, 60, 94, 48, 19,223, 79, 14,163, +176, 9,225, 79, 66, 38,192,153,241,124,232, 61,163,222, 91,151,113, 52,214,108,175,181,126,156,254,132,120,176,234, 75,108,111, +164,145,218, 98,197, 59,202,133,229, 53,161,166,152,180,100,232, 13, 60,206,214,234,206, 73,175, 83, 13, 26,224, 81,152,247, 9, +207,126,105,121, 53,209,217, 32,238,193, 5,214, 23,215, 27, 65,116,208,217, 95,137,174,246, 70,184,238, 29,204, 50, 4, 89,221, + 81, 7, 39,191, 49,124, 14, 33,177,173,122, 33,164,209, 26,163,123,143, 66,120,183, 94,119,117, 32,224,143, 39, 19,146, 20,201, +222, 4, 18, 13, 52,149,167,208,147, 41,149,193, 33,186,215,218,126,244,228,241,221,189,135,142, 35,213,168,243,249,195,199,205, +235, 91,111, 94,191, 13,171,193,121, 47,222,221,125, 16, 53,106, 24,233,196, 14,193, 35, 49,148, 17,138,251,213, 69,206,216,134, +219,157,234,173,205,141, 59,173,181, 12, 23, 24,217,131,195,111,153,149,207,159, 62,131,135,254,226,213,203,110,191,143,209, 78, +150, 70, 13, 49,248,147,136,184, 34, 69, 52,176,127,105,215,241,132,188, 39,156, 0, 45, 43,181, 84,197,124,143,136,159,142,150, + 61,244,235,177, 30,185,165,199, 0,246, 53,117,202, 61,191,224,219, 17,173, 62, 53,249, 21, 33,180,201, 57, 69,177,142, 67,190, +236, 76,186, 65, 37, 84,147, 63,192,102, 21,100, 17,199, 16, 58, 22,176, 48, 65,112,237, 62,178,233,177,157, 78,179, 97,246,168, +221, 13,211,115,159,115,104, 83, 11, 23, 6,113,223, 96, 69,221,167, 52, 69,149,223, 45, 30,192, 46, 51, 41,141,163,106,114, 1, +125, 63,234,132,162,221, 61,190, 40,200, 88, 94, 59,140,194, 13,100,163, 19, 92, 47,103, 68, 62,165,111,165, 47,225,115,187,123, + 4,238,208,163,149,212,188,116,128,212, 42,154,199,167,198, 36,222, 34,153, 56, 49,225,191, 68, 9, 52,133, 2, 52,141, 13, 95, +196,182,139, 28,226, 99, 92,230,177,211,168,184, 71, 0,165, 0,183,222,185,161, 15, 14, 27,124, 3,194, 92, 81,151,132,172, 72, +134, 27,139,225,237,149,133, 27,215,234,152,232,146, 30,146,102, 70, 10, 92, 4,143,102, 29,107, 82, 20,213, 65,166, 29,132,149, +230,170, 87,187,164, 28, 49, 78,116,210, 31, 78, 38,112, 46,148, 79, 20, 0, 44, 81,230,121,173, 69, 19,193, 75,155,192, 67,192, + 37,130,203,141,181,102,184, 52,110,156,159, 70,191,143, 87,218,234,232, 60,106, 39, 41,188,104, 76,117,229, 89, 0, 99,231, 76, + 20,220,136,179,209, 25, 23,244, 80,248,160,138, 69, 24, 84,119,150, 55, 63,253,218, 39, 3, 63, 37, 49,218,124, 70,125, 14, 30, +205,125,132, 69,172,192,149,207, 98, 26,205,163,176, 18,236, 67,119,220, 35,131,203, 48, 96, 90,208, 97,204, 56, 25, 90,183,152, +130,117,103, 99, 13,140,230,244,136,114,175, 92,149,170, 4, 59,218,172,205, 21, 43, 4, 68, 5, 91, 87,110, 30, 28,127,145,126, +229,254,173,189,247, 95,223,209,247,134, 87, 48,230,178,147,181,224,161,179, 12,233,164,112,115,148,206,202,232,108,251,191, 65, +112, 92,146, 28, 80, 54,121,145, 33, 68,150, 54, 99, 89, 71,138, 10, 13,105,103,243,190,224,191, 33,252, 63, 1, 24,187,154,222, +166,129, 32,234,181,189,118,156,230,131,170, 73,211, 22,137,130,232,133, 19,226,194,133,143, 11, 18, 72,168, 20, 85, 28,225, 82, + 9,126, 8,136, 83,143, 28, 64,252, 22,132, 4,133, 86, 2, 36,184, 32,161, 34, 36, 68,212,166, 36,109, 72,237,166,254,216,117, +188,204,236,174,221, 20, 56,112,110,236,164,218,217,157,183, 51,111,222,179,139,202,189,228, 65, 35,243,110,100,164, 74, 15,214, + 16,199, 6,108,109, 74, 35,174, 85,234,165, 68, 72,102, 30, 37, 76,145,151, 12,213,141, 39, 19,146,223,166,106,232, 24, 29, 25, + 81, 67,157,240,177,174,223, 1, 20,150,226,183,140, 10,114,169,106,157,141, 27,142,171,140,135, 23,112,105,164,148,233, 41,116, + 68, 60, 16,146, 83,245, 86,202, 19,244,124,208,230, 21, 66, 81,234,140, 49,237, 42,205,198,146, 85,197,102,173,177,235,247,144, + 59, 96,152, 17,139,101,147,211,146,130, 10,218,224,111,182, 62,187, 61,232, 24,122,106, 67,164,154, 25,136,133,180,186, 91,223, + 13,246,168,237,248,209,254,124,235,108,207,239, 2,100,186,119,247,254,165,165,107, 79, 30,173,110,188,127, 9, 41,125,187,191, +237,209,193, 76,237,228,169,198,233,173,253,215,176,185, 96,219, 3, 76,144, 9, 15, 83, 23,206, 76,215,102,218,251, 91,132,112, + 56, 85,208,255,147, 13, 7,131,108,151,115,188,186, 24, 36,102,128, 85, 25,102, 50,100,166,201,249, 81,194,230, 90,205,238, 94, +152,196,201,131,149,149, 91,203,119,156, 90, 11,254,187,157,239,159,219,223, 54,167,231, 90,176,253,218,237,238,195,199,171,111, +215, 94, 81, 58,213,239,143, 0,137, 13,227, 3, 8, 62, 7, 2,193,118,108,142, 30,175,156, 97, 27,186,236,148,126, 5, 62, 99, +198,226,245,155,139,183,151,130,193, 0, 86,240,217,243,167, 31, 62,126,234,245, 58, 87,110, 44, 95,188,112,254,197,155,117,216, +176, 28,203, 54,102,165, 74, 2, 30,194,181, 25,222, 38,213,115, 71, 18, 26, 91, 60,139,109,226, 22,102,236, 88,238,201, 4, 19, +169,235, 0,136, 36, 33, 59, 44,226,238, 32, 25,142, 71,159,107, 57,153, 38,246,146,194, 10,205,196, 54, 32, 85,234,187, 36, 59, +226,164,203,237,108, 65, 22, 47,216,187,169,150, 47, 45, 12,210,196, 33, 30,238, 10,249,140,168,229,178,252,252, 72,120, 8, 15, +115, 57, 31, 0,127,133, 21,153,156,152, 92,255,178,166, 76, 30, 80, 56,122,236,156, 65,202,211, 40,203, 97,159,108,224, 11,114, +249,220,213,119, 95, 55, 4, 55, 76,114,172, 72, 2,171,131, 5, 86,118,168, 84, 20, 77,148,187,178,112, 79, 10,109, 22, 45,231, +179, 40, 37, 60,100,161,137,114, 82,136,209,171,110,205,143,125, 88, 14, 56,181, 9, 22,232,154, 63,131, 29,100, 37, 1,218,176, +220,200, 72, 72, 70,198,230, 80,117,205, 36,203,189,177, 20,149, 70,190, 76,234, 36, 74, 16,132,114,167,216,132,176, 93,219,116, + 1,185,163, 79, 38,245, 44,148,196, 0, 96, 0, 43,113,166, 82, 94,104, 76, 44,204, 86, 79, 84, 40,210, 13,225,206, 18, 27,178, +144,136, 24,191,228,216, 30,186, 71, 98, 93, 71,151, 6,234, 77, 10,123,138, 56, 97,204,226,144,201, 54,191,128,143,209,146, 91, +114,229,140, 8,186, 59, 96, 34,101, 9, 11, 25, 15, 67, 22,241, 52, 78,146, 72,196, 72,195,129,211,129, 82,123,106,190, 81,157, +246,234,237,242,143,190,179, 83,106,163,145,145,212,239, 78,149, 46,164,242,244,208,194, 59,122, 56,154, 40,249, 11,173, 10,199, + 56,219,236,108,138,124,124,148, 28, 77, 7,253,209, 65,193, 69, 83, 78,232,249, 68,178, 0, 52,224,185, 94,128,102,109,138,240, +140, 73,180, 86,170, 14, 33, 14,133, 98,183, 74, 71, 79, 75,202, 99,169, 38,120, 62, 12, 81, 41,213, 32,207, 4,161, 15,207,122, +142,135,252, 28,150, 97,226,132,199,163,161,252,129,184,147,225,254, 45, 47,127, 82, 79, 68,153,175,202, 86, 16,196,128, 37,173, +160, 97,109, 38,156, 50,252,194, 88, 68, 72, 79,248,171, 22, 3, 97, 0,111,200,213, 0,198,248, 62,255, 24,156, 16,227,230,166, + 42,150, 20, 3,205,252,111, 71,167,223, 2, 80,118, 45,171, 81, 4, 81,180,171,187,250,221, 61,111,205, 96, 18, 77, 2, 65,163, +130,131, 27, 55, 46,196,149,184,116, 33,126,133,123, 87,130,250, 5,174, 92,248, 21,186,209,128, 40,130,168,136, 1, 21, 65, 71, +136, 58, 17, 31, 76, 18,210,201, 60,250,221,222,123,171, 50,211, 1, 55,146, 69, 32,144,164,123,186,235,212, 61,183,206, 61, 71, +250,207,180,220, 67,100,166, 1, 55, 16,231,212, 90,170,217, 77, 75, 55,128,231, 78, 10, 8, 40, 14, 26,196,167, 24, 43, 31,172, +149,229, 62,211,129,106, 41, 99,158, 14,183, 83,137, 46,142,173,153, 2,197, 32,150,165, 89,186,111,213,140,223,109,195,101, 40, + 33, 79,247,117, 10,130,214,225, 83,240,157, 42,209,171,226, 72,109, 62, 70,109, 8,174,159, 40, 29,211,160, 35, 34,114,205,109, +228,148,172, 34, 99, 45,104, 97,138, 81, 38, 21,239,165,210,235,111,228, 89,134,239, 51,211, 60, 96,243,128, 89,232, 2,133, 85, +190,216,177,154,126,107,123,176, 3, 87,227,218,110, 34,194,189,136,145,136, 92,139, 97, 56, 12,162, 97, 20, 71, 73, 10,160, 10, + 85,100,209, 57,125,118,161,179,178,246,226, 85,111,227, 43,214,254, 12, 40, 69,180, 51,218,237,109,245, 8,209,128, 38, 59,182, +225, 13,194, 1, 96, 96,211,159,217,220, 67, 5,235, 40, 30,160,252,188, 72,198, 52,156, 25, 43,201,136,229, 9,157, 35,135,169, + 72, 21,198, 39, 29,195,223,203, 56,252,167, 91, 55,111, 67,105,103, 90,214,245, 27,119,118,183,251,221,247,111,219, 71,151, 62, +188,126,222, 62,182,180,120,242,156, 87,111,173, 62,124,176,176,184,188,217,223,158,157, 95, 72,226,236,202,213,107,221, 79,235, + 26,179,251,155,129,109,217, 97, 8, 47, 89, 17,199,249,209,185,249,206,153,206,187,143,221, 36, 73, 79,157, 88,126,244,248,201, +221,123,247, 87,159, 62,251,252,229,199, 86, 48,170,217,254,249,139,151,181,108,188,246,230,101,189,226,170, 88, 74, 40,112, 85, +176, 72,226, 48,197,148, 77, 69,180,206,164,173, 28, 69, 86, 22,242,216, 13,171, 9,132,162, 48, 25,193, 62, 7,240,146, 23,211, +161, 36,193,178, 77,205,148,123,112, 62,233, 69,136,183, 1,117, 35,170,170,211, 52, 38, 9,215, 74, 65, 72,150,110,230,121, 82, +158,164,166, 68,227,132, 29, 48,161, 84,229,113, 39, 25,185,138, 55, 21, 80, 79, 12,202, 54,188, 70,148,134,191,131, 95, 27,253, +111,132, 41,156,250,144, 69, 81, 76,157,210,101, 7,137,122,122,218,126,246,195,247, 63,235, 81,145,144,110,156,218,206, 2,247, + 53,209, 99, 69,152, 32,173, 33,122,189, 33,121,165,249, 33,209,118, 5,130, 27, 35,220, 43, 36,247, 86,196,167, 37,140,181,179, + 60,179, 12, 11, 46,120, 47, 12,152,128,113, 6, 88,204,241, 30, 85,118,192, 46, 70, 12, 17,209,224,169,248,145,152, 20, 71,210, + 73,156, 78, 71,119, 39,216, 70,184, 5,172, 80,215, 92, 19,187, 49,158,101,114,205,174, 26,108,201,247, 46, 29,159,185,176,114, +120,174,101,193, 90, 14,161,106,192, 14, 67, 65,226, 72,213,226, 26, 38,192, 88, 58, 98, 55, 55, 68,184,146,222,156,211,234,179, +105,166,142, 71,225,120, 8,239, 8, 80, 52,221,243,172,170,111,219, 85,135,251,142,234,217,170,107, 3,105,229,158, 99,214, 60, + 15, 54, 76, 32,176, 21,219,128,218, 21,221, 53, 48, 18, 91,124,161,122,192,105,122,117,207,229, 59,202,128, 7,212,142, 18,247, + 87,176, 73,158, 45,226,182,169,155, 77,191,129,163, 15,244,241,229,148,168, 85, 72,218,204,218,192, 36, 84, 54,140,198,178, 95, + 58, 17,240, 8, 76,153,164,106,149,240,135, 35,125,177, 66,244, 6,151, 53, 40, 16, 62, 69,198, 66,224,177, 51,172,250,172, 72, + 53, 84, 61,112,194, 13,166, 74, 11, 26,230, 24, 54,206,172, 34,173,135,213,151, 38,164,142, 55, 52,221,208,173, 40, 9,165, 17, + 10,109,176,193, 8,189,163,103, 42,237,238,207,174, 40,235, 29,195,165,132, 3,137,197,113, 6,240,144,200,178, 87, 36,121,151, + 60, 9,224,161,149, 39, 78,225,119, 57, 55,208,187,152,178, 91,217,191, 52,195,101,221, 81, 86,252, 95, 84,223, 95, 1,248,186, +182,158, 38,130, 40, 60,179, 59,123,105,187,117, 11, 98,133, 98, 9, 26, 44, 10, 5, 52,242, 23, 12,134,144,152, 24,253,161,250, + 96, 36,222,222, 13,209,152, 40, 49,138, 62,224, 5, 99, 32, 20,216,210,189,143,231,178,219, 66, 98, 76,154,190,180, 15,211,206, +206,156,111,206,124,151, 98,127,207,233, 24, 82,134, 95,195,211,105, 57,182, 91,181,189,147, 65, 32, 12,246, 74,146, 81, 30,145, + 14, 69, 74, 41,255,201,174,151,195,246,134,228,120,108, 10,115,146,101,149,146,162,204,200,198,206,149,173, 92,226,109,144,109, + 1, 19,143,168, 17, 95,166,133, 25,172,236, 48,165, 53, 55, 57,247,167,247,155,253,176, 96, 48,176,122,177, 90, 18,169,215, 40, + 72,104, 98,230,226, 76,175,223, 35, 35,179, 34, 60,146,253,234,136, 78, 32,161, 44, 13,162, 83, 36,191, 83, 30,252,152,215,128, +149, 22, 83, 0,136,201,244, 52,145, 29, 6, 61,178,142,177,155,141,203,193,160, 31, 33,253,132,146,121, 53, 90,224,210, 74, 22, +237, 75, 87,130, 36, 12, 19,116,221,218,254,252,241,245,227,167,159,118,182,195, 40, 40,126,164,230, 46,190, 9,152,127,185,189, +188, 31,236, 31, 15,142,230, 91,157,159,135,123,128,169, 53,198, 1, 15,152, 94, 9, 95,132, 71,199,119, 26,137, 25,155,213,188, + 2, 79,186,169, 10,181, 17,186, 78,226,181,121, 13,224,149, 16,143, 30, 62,128,221,190,187,188, 80, 49,147,151,207,158,196, 97, + 95, 25,162,187,178, 58, 62,117, 13, 6,254,229,253,155,205,205,231, 91, 91, 91, 75,221, 46,252,210,181,141,251,211,115,139, 77, +191, 50, 59,219,130,122,180,190,190, 6, 99,170, 86,212,226,252,140,237,228,237,246,213,183,239, 62, 68,121,182,186,114,235,219, +238,238,246,206,215, 52,201, 28,219,170, 3,144, 83,249,250,198, 93,223,171,190,122,241, 20,224,103,152,144,226, 41,230,204, 69, +180, 95, 35,200,205, 35,215,101, 18, 25,194, 87, 12,147,195,187, 38,158, 48,163, 4,230,249,153,234,111, 12, 33,146,163,220,132, + 60,243,134, 91, 60, 55,151, 51,106,131,176,196,194, 24,101, 38,152,168,108, 20, 25, 0, 43,216, 31,217,211,145,210, 18,208,235, + 38, 43,125, 8, 70, 45,185, 17,177,210,128,201,181, 40, 82, 81, 83,116, 1,156,103,145,221,137,193, 44, 25, 59,221, 34,134, 85, + 10, 14,105, 68, 25,208, 22, 74,209,114, 89,178,180, 40, 2, 26, 71,221,172, 55,225,232,100,114, 7,175,140, 88, 98, 41, 34,117, +170, 21, 49, 58,248, 88,202,220, 25,125,123,246, 78,167,213,249,113,240,157, 17, 10, 17,216, 11, 7, 94, 68,128,148, 39, 92, 4, +105, 16, 52,162, 43, 4, 67,158,115,172, 26, 89, 87, 25,197, 75, 19,115, 65,145,127, 53, 33, 20, 67,186,166, 73,128,221,244,108, +187,238,218, 53, 87,121,182,211,114,213,198,141,201,123, 75, 83, 99,158,234,199,128,128, 18,210, 91,228, 68, 51, 67,122,155, 99, + 41,152,113,180,244, 67,245, 54,210,223,113,137,140, 79,139, 70, 75, 36,121,116, 26, 69, 33, 54,151,209, 45,164,230,192, 59, 84, + 84,204, 16, 80,164, 19,176,169,190,185, 74,184,182,168,186, 98,194, 51,155,141,218,228,216,132, 95,243,149, 21,195,195, 29,165, +156, 4,131, 69, 28,142, 7,190, 95, 83,125,125, 98, 30,167,108, 64, 92, 10,207, 71,215,130, 25, 50,180,210, 20,234, 76, 74, 97, +171,215,167, 58,251,193, 1,186,125,229,249, 81, 31, 3,131,121, 87,103, 39, 40, 93,222, 86, 48,109, 90,235,242,162, 70, 23,184, + 0, 86,229, 41,242, 17, 11, 79,123,158, 24, 22, 13,193,140, 67,197,162,109, 20,255,112, 56,107,146,157, 92, 68, 13, 46,163, 94, +185, 0, 69,151, 29,194,197,136,208, 41, 8,216,157, 16,215,138,189,201, 11, 17, 49,252, 25,120, 62,163, 34,125,115,122,225,215, +225, 94,249, 1,187,107, 22,202, 12, 89,176, 24,135,250, 51,220,187,226, 52, 60,227,122, 11, 40,138, 44,172, 48,113, 90,202,243, +217, 91,114,212,123,145,103,219,158,250, 60,109, 65,255, 87,206,247, 87, 0,198,174,100,183,105, 40,138,122,124,137, 29, 59,206, +224,116,160, 21,160,150, 65,128, 84, 53, 5,132, 4, 93, 84, 45, 93,242, 7, 8,241, 47,108,216,241, 19,192, 55,116,211, 5, 18, + 43, 36, 22, 84, 66,162, 18, 44, 80,105, 81,219,224, 56,142,235, 49,182,185,247, 62,187, 13, 66, 72, 72, 89, 37,145, 51,248,189, +243,206,157,206,169,234,171,220, 5,179,172,109, 97, 54, 48, 74, 2, 63,244, 40, 71,135,250,215, 34,215,114,175,110,208,121,153, +164,248,219, 53, 71, 40, 93,107,109,115, 22,182, 7, 44, 80,108, 48,160,130, 27, 87, 40, 42,139,105,216, 91,154,139,101, 78,230, + 60, 60, 41, 47, 75, 69, 60,234, 89, 20,224, 78,187,147,106,182,192,212,204, 48,137,128, 15,194,130,224,117, 27, 42,220,138,238, +217,176,165, 89, 64,174, 37, 46, 68, 67,137,117,106,130, 84,230,218,115, 39,238,241,218, 82, 31, 32,203,208, 48,175,234, 39,126, + 26,163,234, 58,215, 86,130, 15,132, 3, 0,168,132, 27,122,253,229,190,227, 59,199,238, 41,171,105,150, 97,121,193,152,108, 76, + 40,234,207,210, 81, 56,178,141,153,113, 56, 6,228,131,173, 0,241, 32,236,189, 0,165, 42,248,136, 45, 31, 2,130, 67, 66, 53, + 52, 3, 2, 0,120,201,106,116,116,181,126,115,241,246,207,209, 17,252,220,123,203,247,157, 51, 55, 76, 3, 88,108,131,192,105, + 54,117,185, 57,209,152,204,211,178, 8,236,149, 37,149,174, 40,117, 38, 31,124,223, 63, 60,220, 95,235,175,190,121,253,214,238, + 93, 90,223,216,254,244,241,195,141,254, 35, 58,202,163, 87, 47, 95,140, 3, 95, 42,210,103,207,159,190,219,221, 89, 93,187,155, +198, 35, 93, 83,147,100,236, 12,142,182,182, 31, 95,191,182,220,106, 53, 55, 55,183,246,246,246,102,237,185, 47,251,159, 1,215, +250, 43,119, 2,127, 20,199,163,153,182,105, 53, 85,189, 46, 71, 65,252,240,193,186,125,229,214,251,221, 29,199,115, 59,150, 1, +224,160, 8,168, 38,223,208,165, 32, 76, 97,115, 49, 81,163,210, 40,158,222,216,251,165, 54,112,117,166,137,170,104, 69,229,182, + 83, 77,111,148,133,180,170, 48,136, 48,157, 87,226,142, 93,189, 23, 79,226,188,148,231,158, 54,131,230, 13, 8,188,225, 87, 98, + 56,131,204,128, 14,219, 70, 15, 78,199,243,110,122,100, 85, 10, 67,162, 92, 5, 7, 92, 52, 70,165, 39,105,199,137, 89,134, 67, +117, 50, 38,247, 51,108,147,133,144, 34,155, 0, 97,229, 54, 82, 66,101,244, 73, 14,123,178, 86,211,101,145,145, 84, 36,143, 55, + 5,110, 90, 68, 93,179, 17,220, 77, 38,215,121,118, 23,158,198,238, 20,184, 26,118,239,160, 39, 22,217, 70, 18, 14,211,247,128, +157,242,203, 31,124, 59,249, 90,105, 19, 78,231, 79,139, 63,242,165,136, 5, 92, 10,242,220, 19,109,250, 81,136, 23,198, 76,165, + 89, 81, 46,226,128, 52, 99, 53,146,171, 4,164,134, 67,140, 53,152,108,106,192,196,213,182,194, 54, 22, 23,158,172,116,151,230, + 77, 31,110, 94, 50,161,177,232,156, 91, 77, 32,115,199,180, 12,234,222, 32,204, 1,185,192,243,142,234, 83, 86, 79,232, 93,198, +136, 18,130,211, 8,145, 24,201, 36,252, 89,170,130, 1, 75, 16, 9,206, 88, 24,184,193,145,231, 28,140,220, 67,207,251,225,103, + 78,160, 69, 49, 26,246,104,170, 96,235,194, 66,135,205,119,236,122,205, 20, 68, 76,236, 76,242,114,163, 75,114,189,101,105, 98, +226, 13,243, 48,207,165, 11,163,164, 42,107, 74,102, 9, 16, 98, 95,182,175, 14,137,156, 13,253, 97, 86,150, 39, 10,110, 99,200, +109,105,219,166,125, 22,249, 60,185,151,151,139,141, 74,102, 4,250, 24,190,235, 38,177,191,162, 81, 51, 44,163, 25, 33,202, 23, + 60,161,193, 71,220,245,154, 14, 16, 63, 14, 61,137,108,193, 33,232,140,179, 4,168, 3, 48,117,106, 27,146,225,178,179,205,121, + 0, 22,198,208,255,150,202, 27,114, 29, 21,235,210,174,209,141,200,253,188, 66, 47,169, 82,207,197,110,251,211,241, 9,124, 13, +154,245, 3, 26, 33,229, 60, 15, 89,228,149,106,208,133,213, 43, 10,207,169,181, 20,222, 6,241,101,145, 11,226,148,208,138, 40, + 22,255,242, 63, 19,166,220,160,166,220, 40,197,255,147,128,255, 45, 0, 99,103,210,219, 52, 20,196,113,251,217,241,146,186,117, + 66,150,166, 27, 45,170,212,138,245,128,144, 64,229, 4, 7, 16, 66, 21,156,248,106, 72,240, 33,184,192, 5, 33,113, 70,234, 1, +149, 32,154,170,106,105, 73,186,164, 73,227,172,246,115, 28,155,153,121,118, 82,161, 30,184, 70,178,163, 68,246,188,255,204,252, +231, 55, 99,255,140,114,137, 81, 32,199, 40, 95,218,187,134,149,104, 57,252,103, 18, 79, 85, 98, 92,181, 36,203, 87, 81,159,240, + 46,131,225, 0,101, 47,142, 22,169, 49,170,120,236,255, 97, 44,129,230,200, 99,212,240, 4,119, 23,129,152, 8, 68, 15, 45, 25, +103,146, 30,173, 61, 62,105,214,188,192,139,196,124,142,132,244, 9,114,185,226, 37,150, 49, 69, 32, 24, 44,109,171, 44, 33,159, + 17,239, 2, 50, 47,151,187,157,190, 51,155, 1, 57,214,247,135, 28, 81,233,100,179,129,247, 31,110, 2, 82, 29,110,107, 25,214, +121,167, 9,233,219, 81,163,134,116,139, 40,240, 56,228,157, 98,137,145, 0,215, 69,183,151,239, 86,106,149, 80,142, 71, 40,123, +188,219,195,106,149, 50, 86, 45,226, 39,204,231, 74, 32,157, 64,188,135, 40,198,131,243,110,227,212, 57, 14,201, 54,119,210, 57, +155, 49, 51,185,233,252,198,250,195, 95, 39,187,204, 24,113,196,124, 42,152,234,224,234, 37,201,208, 21, 83, 99, 16, 88, 45, 35, +165, 27,122,187,221, 61,173,119, 14,246, 15, 43,123,251,131, 1,191,168,215,219, 78,235,254,198, 19,225,105,251,242,233,131,211, +238, 21,138,243, 47, 55, 95,191,123,251,254,197,230,171,161,239,101, 23, 86,166,211,230,215,207, 31,183,127,148,251, 61,255, 79, +237, 12,164,102,237,120,175, 52,151,169, 85, 15, 52, 67,186,181,118,163,217,114,234,141, 38, 36,248,156,251,215, 23, 23,230, 75, + 37, 77, 51, 87,111,222,251,189,251,211,105,182,158, 63,123,186,181, 85, 70,223, 7, 36,209,186,226,113,120,224, 37, 63,226, 4, +229,193, 99,145,156,106, 1,225,244, 48,152,146,192,136,171,234,114,178,201,150,177, 20, 28, 85,102,202,132,119,105, 57,183,138, +204, 56,130, 37,185, 9,172, 6, 1,214, 52,232,112,137,225, 17, 45,102,175, 99,235,142,236, 40,130, 75, 35, 22, 90, 78, 54,148, +162, 45,110, 20,197, 83,243, 44,217, 28, 18, 21,166,139,144, 92,170, 76,155, 49,109,142, 21, 82,225, 13,143, 50,102,174,207,251, + 4,140,144, 8, 62, 17,206,152, 89, 31,181, 69, 36, 70,150, 32, 10, 82, 61, 20,159, 75,120, 80,151,114, 43, 29, 92,228, 70, 58, +153,144, 18,150,110, 89,250, 20,153, 11, 2,177, 56,148, 80, 91, 17, 30, 24,163, 32,158, 26,149, 34, 67, 77,195, 65, 6, 73, 3, +124, 46,140,147, 99,169, 42,162, 59,205,163,178,164,168,144,176, 38,105,104, 79,154, 8,120, 22,123, 41, 24, 75,230, 22,233,114, + 70,220, 15,162,242, 41, 24,223,241, 33,177,116,213,210, 53, 51,165,230, 53,253,205,157,165,205, 7, 37, 8,185, 30, 39, 75, 33, + 29, 97,162, 67,128, 68, 38, 85,209, 33,131, 65,241, 78,188, 95,134, 77, 81,244, 31,104,186, 4,137, 96, 42, 45,121, 32,141, 2, +156, 58,133,244, 77,195,237,122,240, 55, 15,154, 23, 71,149,234, 78,125,244,221,205, 31, 42,115, 85, 86, 56, 86,114,181,200,222, +115,245,242, 89,184,189,227,148,191, 85,123,149, 70,193,245,213,229,140,180, 94, 52,150,114, 69,137, 5, 29,206,135, 97, 20, 11, + 88,217,204,152,134,231,182, 58,184,110, 64,142,153, 69,148,236,197,243, 72, 24,201,157,222, 69,210, 67, 21,255,147,240,176,145, +109, 26, 49, 51, 33, 31, 65, 38,130,235,131,109,211,118,253, 65, 52,169, 88,200,121, 43, 63,240,251,216, 26,162, 38, 22, 46, 6, +193,170, 55,126,121,198,202,122, 68,173,161,202, 22, 14, 60, 10, 91,166, 32, 86,209,230, 22, 3, 77,128,184, 99, 29,213, 25,220, +199, 78,219, 30,218, 31, 49, 88,205, 24,118,151,247,112,127, 14, 82,221,163,236,212, 53, 20,218, 9,238,145, 54,193,169, 16, 91, + 68,112,152,181,231,218,174, 3,151, 96, 39, 9,179, 0,180,234,235,138,232,133,198, 26, 28,221, 13,152, 61, 32,178, 41, 32, 23, + 98, 82,120, 39,119,208, 56, 0,202, 87,108,163, 76,216,247, 44,165,232, 84,204,148,255, 83,194,255, 21,128,174,107,233, 77, 34, +138,194,243,100,134, 25,160, 3, 82, 74,171,214,214, 7,182,209,196,198,116,209, 84, 99, 98,234,198,157,233,175,112,105,226,127, +240, 87,152,248, 72,220, 26,141,175,173,209, 77,109, 98,180,214,174, 52,149,210, 23, 77, 41, 80,202, 60,128,121,120, 30,148, 82, + 27, 9, 11, 32, 48,129,203,189,247,124,247,156,239,124,159,116,226,249,177, 55, 67,200,135,117,216,221,152,251,222, 6, 75, 66, + 39, 4, 39,254,207,213,175,219,115, 42,250, 65,219,118,157,136, 60, 80, 35, 49,160, 95, 66, 65, 26,185, 58, 41, 86,146,224,164, + 91,208,165, 70,134, 61, 17, 75, 83, 55,241, 88, 77,140,235,197,223, 11,172, 43,108,104,113,204,119, 71, 98, 38,126, 74, 62, 60, + 2, 57, 45,199,197,106,158,216, 61,141,208,185,150,135, 7, 64, 1, 92,124,208, 26, 42,238,172, 29, 0, 18, 36, 38,165,143,244, +187,208,208,205, 7,119,239, 43,232,156, 42,155,122, 2,190,246,196,233, 66,210, 72, 16,131, 40,244,176,150, 29, 50, 85, 63,160, + 29, 98,169,184,156,181,114,140, 91, 45, 51, 13, 65, 27,176,125, 74, 75,166,140, 20, 3, 79, 88, 65, 0, 36, 55, 42, 91,229,250, + 38,160,212,128, 18,247,164,208, 67,116, 83,116,169, 85,171,205, 74,195,105,188, 92,124, 13,107,189,229, 69, 77, 27,105,128,172, + 73, 34,114,150,138,196, 25,200,112,131,220, 9, 66,185, 88, 42,195, 31,177, 86, 90,125,243,238,149,107, 55,105,140, 59, 2,149, +193,225,193,244,245,171,197,213, 95,213,234, 78,203,179, 97,255,105,108,175,109, 22, 75,219,149,131,239, 75, 43,239, 63,188,253, +244,249,227,227,167,207,124, 31,246,101, 13,181, 76, 21,100,208, 43,178,212,246, 66,219, 9, 28, 47,156,157,185, 49, 63,127,111, +229,231, 34,140,210,229,201,209,107, 83,227,115,119,110, 43,138,214,106,133,245,134,191,190,237, 6,148, 57, 81, 69, 0,124,138, +166,196,248,220, 27,147,244,158,103, 80, 60,150, 96,189, 90,185, 43, 99,139, 29, 98,196,123,129,125,195,133,145,217,179, 43,118, +235,160,143, 16,133,217,183,177,220,121,153, 30,199,208,230, 5,155,227,225,233, 86,109,221,243,155, 84, 74,145,168,167, 1, 73, + 80,201,120,186,231, 63, 74, 71, 7, 3,229, 65, 5, 9, 86, 87,111,250,149,247,119,120, 11,222,119,171,124,112, 70,178,185,162, +123, 29,155,214,182,122, 97,120,194, 71,203, 65,161,225,213, 20, 60, 27, 25, 88,188,161, 49, 39,230, 62,230,203, 51,137,193, 82, +229, 15,252,148, 1,195,202, 38,134, 44, 35,131,126, 79,129, 87,179,107, 93, 48, 18, 73, 92,124,128, 11,193,148,147,123, 60, 54, + 73,244,124,199, 39, 37, 81, 64,241,108, 46,125,228, 81, 77, 6, 16,240, 10,108,253, 10,102, 4,163,152, 34,103,204, 12, 71,160, +110,137,144,165, 14, 72,179, 5, 46,146, 54, 50,150, 97, 25, 42,118,222,227, 87,163, 38, 62,242, 19, 70, 42,112, 34,110,105,138, + 26, 87, 53, 89,138,229,101,237,225,205,201,185,233,209, 14,162,117,220,190,233,222,211,253,141, 96,100, 85, 64,229, 72,151,196, +113,230,238,160,128, 61, 95,147, 3,130,153,194,243,149, 16,170,220,207,170,200,100, 67, 22,214,203,187, 95,151, 55,126,248,103, +253,241, 25, 99,112, 76,142,153,104, 27, 35,168,186,172, 65,192, 75,103,115,103, 46, 22,134,175, 76, 85, 7,198, 95, 44,184,207, + 31,125, 41, 62,249, 6, 16, 64,184,117,233,220,108, 97, 52,143,172, 54,114,187, 67,190, 74,190,144, 27,137,235, 33, 5, 92,148, +173,215, 45, 64,196,228, 39,194,170, 29,108,244, 77, 4, 10, 38,158, 7,216,228, 72,222,117, 76, 58, 18, 59,228,113,134,211,169, +237, 29, 6, 66,254,120,180,231,238, 82, 37, 21,131, 19,146, 37, 80, 50,161,195, 86,217, 26,242,254,185, 66,142, 80,223,110, 55, + 71,210,249,110, 13,134, 42,183, 73, 61, 73, 82, 57, 72, 51, 37, 21,135,168,122,176, 7,151,200, 24, 89, 1, 85, 64,246, 89,100, +139,189,102,235, 54,138, 12, 74,125,245, 33, 0, 46, 0, 97,201, 56, 69,201,167,207,194, 63,171,235,102, 64, 84, 46, 74, 78,251, +110,187,213,103,208,114,196,115,116,176, 62,127,116, 51,245,148, 34, 41,255, 18, 38,121,226,112, 38, 74,224, 86, 33,156,252,237, + 19,237, 26,130,112, 92, 36,250,120,108,248, 43, 0, 89, 87,242,154, 70, 20,198,103,209,113, 70,163,198,154,198, 68,171, 81, 99, + 66,233, 78,105, 41,148, 64, 2, 45,133,144, 67, 47, 61,244,208,191,166,255, 78,233,161, 52,201, 41, 52,165, 33,208, 94, 90,200, + 82, 72,240, 18, 40,130,177, 90,151, 25,103,115,230,245,251,190,247,140, 9, 65,153,139,162,179,188,247,190,229,253,150,171,249, +187, 60,113,154, 20,198, 37,225,104,218, 64,227, 5,118,177, 59, 50,126, 99,207, 68, 88,100,201,215, 61,125,228,177, 91,158,248, +156,163, 59, 67,162,101, 73,194, 77,213, 27,185, 49, 77, 79,197, 51,129,248, 41,185, 56, 83,130,105,195,115, 43,120,121,190, 71, + 24, 27, 69,157,168,233, 35,215, 20,123,165, 44,128, 7, 22, 10, 1, 75, 30,144, 17,206,192,179,126, 85, 25,155, 23, 32,127, 4, + 37,216, 95, 63,219,104,245, 90, 14, 25,161,145,210,145, 52,147,204,166,244,196,246,175, 29,234,139,192,180,212,250,195,193,239, +198,233,187,213,183, 7,103, 7, 62, 9,235,146, 14,151,216,246,161,123, 60,178, 92, 59,159,201,119,172,182,174, 25,109,179,131, +120, 12,127,104,123, 54, 92, 79, 41, 91, 52, 93, 19,114, 56, 20, 68, 96,202,250,147, 87,245, 70, 29,206, 32, 12,101,157,188, 0, +225,142, 45,206,213,254,116, 27, 56,238,145,201,138,202, 4, 78, 52,192,121,167, 66,230,206, 12, 93,193,125, 95,140, 19,138,161, +161,198,223,196,144, 35,228,234,140,225, 66,185,112,255,246,210,207,253, 29,167,127,190,183,183, 11,131,105,109,245,249,195, 71, +143,115,185,217,114,117,241,251,183, 47,159, 62,126,216,218,220,180,135,166,161, 71,113,237,146, 34,150,227,199,141,116,181, 82, +219,255,113, 48, 24, 74,197,252,146,237,201,135, 39,117,114, 10, 9, 95,172,173,204, 23, 10, 95,119,119, 95,110,188,129,170,252, +248,240,184, 90, 93,254,188,181,141, 40,114, 63,180,253, 17, 20,149, 48,241, 93,199,229,148, 65,136,202,142,103,205,166,243, 67, +204,139, 49,237, 64, 93, 27,194, 65,144,198, 8, 23,186,194, 7,175,169, 26,247, 14,198,228, 48, 12, 18,218, 20,149,113, 34,250, +119,204, 54, 28, 83, 90, 18, 29,248, 24,187,212,131,134,133,123, 10, 86,213,139,220, 4,235,229, 75, 45,193, 41, 61,105,121, 24, + 45, 70, 28,117, 35,113, 87,104, 58, 42, 98, 27, 0, 41,110,140,205,103, 75, 84, 93, 97,159,183,103,253, 51, 52,131, 42, 60,212, + 29, 34,100, 87, 32,172,200, 20,110,137,164,216,174,197, 17,236, 80,207,197,181,120,199,106, 17,224, 33, 70, 88, 82, 9,106,124, + 35,134,154, 36,165,236,130,105,119, 47, 91, 61,240,179,226,148,119, 18,221, 12,199,124, 93, 49,114,144, 55, 16, 79,250, 62, 84, +132,216,225,133,154,216, 69, 71, 33,164,118,199,162, 49, 1,217, 36,184, 22,191, 34,184,183,142,135,162, 47,210, 88,214, 64,161, +136,167,146,228,117, 84, 13, 19,176,190,107,106, 82,146,223,191, 89, 41,175, 63,144, 76, 55,130,150, 91, 4,116,164,244, 93, 34, +117, 22, 5, 87,101, 4, 77,198, 17, 4,131,248, 50,196, 47, 32, 72, 16,130, 95, 68,202, 21,165,100,134,252,146, 67, 2,219,147, +154, 99, 16, 88,189,222, 73,189,209, 79,222,203, 87,150,135,150,231,249,216, 82,128,106, 79,165,244, 30, 98,110, 40, 71, 28, 15, +213, 97, 74,149, 82,161,152,155,186,145, 57,106,122, 71, 59,167, 21,149,105, 79,111, 25,233, 68,162,239, 90, 67,135,180,245,152, + 10,249,170, 47, 55, 59, 30,191,225,112,225, 56,114,152, 96,116,241,142, 58,103,153, 44,229,107,177,168,222, 49,187,119, 75,119, +220,145,111, 83,177, 62,246,102, 97,164,121, 39,114,115,225,248, 42, 11, 23,101,161, 96, 47, 26, 15, 2,113,143,219, 93,244, 49, + 76,161,218,220, 34, 4,140,102,247, 92,112, 83,149, 72, 58,145,110, 15,154,232,209, 32,220,210,101,248,235,242,108,249,175,217, + 66, 72, 62,215,216, 66,146, 93,252,102,106,110,224,245,197,232,163,238, 17, 71,246,140,255, 78,210,181, 68,163,115, 6,113,127, +232,152,104, 15, 0, 15, 20,245, 65, 73,140, 66,102,108,226, 33, 47,214,213,164,145, 38, 93,220,128,175,177,200, 38,161,170,130, + 77,216,189, 12,190, 67,160, 50,238, 31, 82,152,142,103,144, 81,142, 1, 70,186,232,153, 92,149,131,148,217, 53, 63, 16, 56,252, + 23,128,170,235,216,109, 34,138,162, 83,222,148, 55,205,221,105,114, 10, 11, 96, 17, 4, 40,128,132, 16, 72,172, 64,226, 23,248, +167,136, 15, 33, 11, 36,248, 3, 36,202, 38, 68, 8, 41, 9, 73, 20, 37, 33,197, 16,197, 99,123,170, 61,230,222,251,158, 29,103, +149,133, 99,107, 44,223,114,110, 59,103, 42,190,203, 18, 88,182, 68, 71, 99, 30,175, 88, 14, 4, 36, 77, 27, 60,175, 65,155,180, +104,211,166, 71,170, 14, 3,245, 38, 35,246, 88, 27,254,134, 70,137, 58, 25,160, 35, 19,192,192,231, 1,182, 47, 6,121, 70, 50, +140,226,173, 89,142, 11,183, 66, 42, 88,246, 31,167, 47, 34,228,167, 98, 76,247,237, 74,137, 7,241, 32,210,174,127, 81,165, 85, + 93, 4,136, 4, 25,130,192,142, 34,184,204, 68, 57,181,125,188,211, 79,163,167,183, 31,253, 9,219, 26, 85,229, 81, 22,133,113, + 15,219,179, 76, 7,180, 94, 9,170,113,150, 84,220,202,206,233, 1, 88,112, 47,141,176,114, 47,114,110,186, 81, 22, 11, 82, 33, +100,215, 24, 13,187, 81,119,105,102,185, 19,117, 90,181, 69, 72,167, 41,178,158, 97,194,233,196,189, 33,205,178, 70,121, 81,111, +182,234, 65,115,107,127, 11,138, 93,188,173, 55,236,185,234, 2, 36, 24,203,180, 86, 23, 87,247,254,238, 17,177,234, 16,156, 69, +113, 11,219, 32,176,133, 34, 15, 42,231, 10,119, 32,214,171, 54,211, 93, 71, 13, 92,205,119, 84,136,251, 68,177, 83, 88,214,200, +208, 7,187,219, 63, 55, 54, 62,108,110,110, 66, 2,242, 61,205,182,181, 7,207,222,172,220, 89,219,217,250,246,110,125,253,240, +248, 20,124,195, 48,145,224, 44, 75,139, 36, 25,118,123,105,185, 82,122,120,239,254,231, 47, 95,193,224,231,103,155,229,114,112, +176,191, 95, 45,115,139,161,134,162,142, 50, 44,233,147,231,175,207, 14,127,125,250,248,190,125,113,126,114,114, 98,153,162,181, + 12, 40, 72,111, 54,170,189, 94,156,101, 24,185, 0,125,184,102,233,162,219, 46,136,100,230,250, 40, 65,158, 13, 22, 0,231,135, + 52,110,193, 46, 28, 93,242, 8, 28,139,246, 58,153,223,140,183, 69,144, 21, 4,207,160, 6,211, 91,188, 35, 98,128,104, 4, 51, + 97, 28,106,234,141,177,156,197,144,203,140, 16,205,212, 88,114, 68, 58,166,228, 79, 88, 43,145,120, 58, 88,215, 85,255, 50, 77, +251,240,136,140, 25,146, 34,147,200,202,136,218, 68, 50,231,148,121,197,102, 78,150,139,142,141, 70, 92, 17,184, 59,110,234, 44, +195,230, 44, 22,254,147,237,137, 36,195,141,207, 30,249,127,213,173,193,147,104, 99,202,130, 1,185,159,176,122,211, 48, 29,203, + 3,248, 2, 5, 65,201,171, 64,157, 46,156,136,206,163,164, 34,188, 72,129, 89,129,199,160,194,182,231, 42, 11,140,153,128,165, +196,181,221, 92,121, 62, 78, 99,105,219,244,135,142,145,153,109,160, 12,147,103, 89,186,238,188, 90, 89,122,249,246,133, 18, 56, + 74,221, 85,194, 62,203, 7,133,208, 1, 35, 82, 56, 33,181,106, 51,230, 66, 94,178, 77,212, 88,207,145, 1,131,152, 65, 85, 14, + 85,107,235,150,226,123, 24, 49,114,100, 77,202,241, 53, 8,171,201,209,193,241,149,177,178,124,119, 45, 73, 0,215,115,110,115, +226,162,196,117, 4,226,250,192, 74, 14,119,111, 52,198,125,223, 9, 74, 22,247,103,103,106,204, 15,190,255, 56,227,191,207,170, +143,231,173,186, 7, 33,190,219, 79,112,173, 94, 81,131, 26,235, 31, 37,151,121,166, 75,125,105,177,138, 62,114, 77,238,217, 94, +132,240, 72,105,148, 27,187,167,123, 14, 15,192, 49, 47, 58,109,100, 39,165,161,171, 84,199, 30,207,204, 29,219, 71,201, 90, 65, +151, 81,200,240, 48,158,100, 76,248,165, 69, 56, 19,233, 30, 83,125, 45,168, 1, 32, 75,179, 84, 12,129,144, 7, 84, 99,142,229, + 34,140, 32,122, 96,248, 71,248,234, 97,220, 1, 16, 0,222, 24,240, 82,132,141, 32,180,200,127,225,249,112,188,154, 5,129,202, +181, 93,128, 99, 67,121,211, 71, 75, 96,100,216,164, 41,136,237, 31,156,216,225,221, 28,158,156,128,249, 3,112, 44,241,114,156, +247, 39, 18,196, 88,217, 23, 67,200, 4,114,104, 36,244, 90,166,142, 73,105, 5, 37,151,108, 8,184,103,220, 9,147, 14, 93, 17, + 10,129,215,209, 53, 53,244,205, 16, 63,233,162,107,227, 6,206,127, 1,168,186,150,158, 38,162, 40, 60,175, 78,135,233,208,153, + 14, 83, 30, 77,193, 6, 1, 19,130, 11,140, 11,127,132,134,159,231,150,157, 11,119,110, 12, 9,137,146,168,105, 76,140,162, 6, + 93, 24, 86,208, 66,155,210,199,116,222, 47,207, 57,247, 78,209, 29,133,244,150, 76,207, 61,207,239,251, 78,233,223,101,137,255, +138, 70, 76, 57, 66,145,115,167,214, 68,105,111, 26,247, 87, 43,168,165, 32,241,229, 49, 57,155,137, 50, 78, 16,228, 3, 85, 89, +163,125,164,249, 98, 69, 44,187,149, 76,157, 77,252,167,127,202,254, 6,207,228,201,246,179,145, 59,200, 72, 58,154, 17, 86, 51, + 4,213, 84,152,108,191, 84,150,189, 69,185,195,144, 80,106,108,133,181, 64, 70,156, 16,134, 49, 43, 87,102,227, 59, 32, 98, 7, +209,220, 54,108,112,202, 9, 26, 19,165,240,162,184,179,177, 3,229, 21,188,156,248,110, 74,220,197,246, 74,171,101,109,140,189, + 59, 20,118,193, 84, 61, 31,185,119,126, 18, 65,142, 6,167,245,199,125,210, 63,202,204,154,181, 98, 58,126,132,180,154,180, 96, + 12,102, 76, 34,224,180, 32, 12, 26, 53,219,170, 53, 32, 42, 64, 80, 97,157, 37, 72, 10,192, 62,116,221, 60,254,242,122, 83,221, + 58,125,255,182,101,173,143,252, 49,146, 69,130, 57,252,251, 81, 26, 95,222, 92,194,225, 7,237,131,158,123, 99, 87, 27,129,234, + 35,131, 54, 3, 99,144,226,168,152,121, 89, 76,164, 32, 69,172,196, 73,145,166, 74, 16,162,232, 18,142,169,149, 92, 83,139,233, +204,187,234, 13,208,151,224, 52, 86,153,185,217,207,243, 95, 75,114,246,104,127,239,213,241,203,235, 94, 15,174,159, 23,164,158, +151,250, 16,253,112, 55, 44, 14, 43,109,203,216,221,217,254,244,185, 11, 54,191,108, 24,157,206,230,197,197,133, 36,171, 66, 33, + 95,223, 12,191,157,127,127,241,252,168,179,247,184,123,118,210,237,126,236, 15,239,124, 63,139,195, 60, 76,216,118,167,188,105, + 45, 67,136, 26, 12,199,232,206,114, 25, 17,235, 73, 32, 8, 37,185,156,239, 41, 46,170,114, 21,158, 15,149,144,162,170, 44, 65, +204, 96,232, 96,169, 28,185, 47,216,106, 98,233,155, 41,115, 33,169,172, 60,167,171, 85, 41,168,249, 6,206, 17,167, 97,124, 17, +227,189,108, 54,107, 46, 75,139,158, 53,217, 24, 34,253, 21, 5,130, 11,100,138,124, 52, 89,160, 6,249, 97,231,233,196, 31,195, +197, 70,182, 42,165,210, 18,227,116, 80,119,123,197,112,224, 84,200,185,144,136, 36, 64,158, 11,247,176,145,230, 49, 18,169, 98, + 31,147, 71,210,168,225,213, 39, 41, 81,113,240,173,200, 43,229,130,207, 10, 9, 42,138, 78,196,177, 13, 7, 50,134, 16, 97, 40, +105, 38,164, 80, 16,204,131, 25,134, 1,178, 80, 2, 70,149,245, 47,124, 17,154, 25,227,122, 92,222,195,119,195, 25, 97,126,248, +196,213,195,149,111,121, 57,147,100,206,157, 43,201, 64,153,165,171,240,163,112,180,219,126, 32, 20,195,175, 83, 85,169,203, 45, + 69,152,250, 18, 92, 11,108, 47, 98,164,149,113, 43,175,180, 4,161,166,166, 87, 84, 25,156,127,128, 30, 14,119,246,162,127,175, +170,242,214, 67,161,166,161, 77, 71, 73, 17, 70, 81, 18, 71, 65,228, 78,167,131, 89,165,214,220,127,247,225,244,228,236,205,249, +143, 79,131,219,190,101, 56,182,237, 48,228, 10,182,112,112,117, 14, 36, 70, 72,127,181,154, 38,118, 57, 20,173, 86, 55,109,167, +241,231,214,207,126, 95, 53, 15,215,212,101, 93, 25, 7,243, 40,134, 7, 86,209, 84,113,158, 95,142, 92, 62,172,160,121, 21, 94, + 37,168, 17,177, 29,147, 50,186, 67, 24, 71,144, 59, 39,228,187, 85,181,218, 52,215,171,170,234,129,103, 20, 73,154, 10, 81,203, + 41,148,239, 41,117, 27, 33, 48,163, 82, 27, 9,181, 66, 0,168,107,117,100, 24,164,169,169, 91, 8,162,165,250,157,173, 48,132, +103, 72, 21, 67,177,102,174,121,177, 7,137,215, 28,190,244, 44,129,160, 14, 31, 91,215, 77,145,186, 17, 18, 77,108,225,134,194, + 33, 1, 65,119, 86,173,213, 89,232,182,157, 77, 91,111, 76,252, 41, 99,122,162, 4, 31,250,189,130, 9, 72,232,154, 65,237, 55, + 30,138, 74,216, 62, 87,245, 87,177,248, 75,224, 67,185,155, 98,249, 41,153,175,105,216,126, 56, 43,238,251, 31, 92,208, 95, 42, +229, 3, 36, 46,135, 84,178,128, 81, 40,216,108, 89,173,177, 63, 17, 23,187,123,185, 91, 47,254, 39,132,222, 59,253,191, 2,208, +117,117,173, 77,131, 81, 56,201,154,164,105,154,118,109, 89, 29,126, 76,246,129, 50, 21,153, 94, 14,245, 63,120, 35,236, 15, 8, + 94,250,119, 4, 47,132, 93, 8, 42, 3, 21,197, 59, 17, 65,157, 40,162, 55, 34,179, 78,152,110,237,218,217, 54,205, 71,147,165, +245, 57,231, 52,173, 10,178,203,134, 54, 75,222,247,156,231,188,231, 57,207, 51,138,239, 76, 25, 30, 57,173,150,157,178,157,113, +116,213,232, 69,110,201,169,132,220, 16, 75,148,177, 54, 20,239, 29,146,160,211, 67,170, 44, 98,236, 7, 60,211, 30,223, 43,123, + 21,146,134, 87,194,195,234,197, 92,201, 36, 36,100,144, 67,113,170,125, 39, 41, 10, 96, 86,244,161,100,151,159, 58,122, 6,251, +176,235,119,132, 74,153,250,204,210,241, 55, 42, 95,236,127, 98,164, 18,173, 56,195, 19,182,177,100,151,105, 34, 56,247,165,166, +230,161,237, 65, 37, 95, 5,122, 98, 51, 85,150,175, 83,229,156,135, 86, 61,233,240, 37,135,172,140, 61,236, 6,238,126,239,128, + 87, 6, 74, 33,167,236, 84, 58, 62,238,127,232, 6,189,182,223, 21,115, 59,124, 10,200,223,112,155,168, 40,147, 84, 5,157, 71, +109,213,188,149,239, 39, 81,219,111,211,157, 48,153,118,110,230,100,163,221,196, 74, 13, 81, 22,184,110,166,110,220,219, 88,175, + 55,119, 45,211, 66, 41, 80, 45,206,180,189, 14,247,202, 8,137, 37,234, 16, 9,249,194,194, 74,173,190, 21, 89, 88,233,180,247, +240,197,200, 33, 94, 72, 2,219,184,198, 70, 37,172,107, 89,162, 58,168,128,108,200,173, 94,128,250, 94,101, 37, 24, 69, 4,190, +241,195,253,176, 95,173,206, 94,191,113,243,217,227, 39,235,119, 31,224,169, 3,216, 17,190, 97, 85, 35,158,103, 65,104, 64,101, + 96,174,174, 94,222,250,186,195,222, 56,250,194,252,210,235,183,239, 81,135,229, 44, 61,155, 81, 80,186, 95, 91, 91,115,202,179, +143,238,223,110,236,183, 16, 25,186,189,164,219, 11,163,136,138,124, 11,193, 35,111, 44, 46,204,127,248,244, 25, 56, 32, 97, 87, + 40,203, 44,138,117,171, 76,146,103, 77, 27,187, 2, 48,177,236,204, 80,147,131, 26,212,241,164,218,156,244,252,255,242,137, 20, + 28, 50, 16, 19, 23,133, 6,193, 89,149, 91,236,130, 84, 49,164, 22, 2, 44, 89,245,210, 57, 70, 98,167,196,170,113,187,149, 38, + 40,213, 76, 66, 11, 76, 33,221, 55,154,216, 80,216,169,194, 32, 33, 82, 62,204,229, 86, 88, 46, 58, 12, 12, 35, 7, 76,101,160, + 38,161, 81,172, 0,129, 64, 27, 53,219,232,119, 8,190,210,236,104,130,220, 32,193, 87, 77, 77,146, 85, 65, 27,169,180, 44,246, +139, 99,230,185, 53, 71,120,176,100, 87,112, 93, 16,135, 62,254, 88,148,138, 91,187, 37,230,200,143,244,161, 6, 92, 99,140,121, +163,248,146,104,208, 79,255, 17, 22,117, 99,105,166, 63,140, 59, 39, 98, 37, 83,163,131, 39,226,249,233,212, 5,209,179,186,142, +108,122,245,244,113,211,156,126, 21,206,125,175,199,139, 23,109,165,211,209, 66,194,232, 72,255, 42,211,139, 45,221,112,108,203, +206,155,164, 83, 29,197, 33, 66, 26,249,224, 17,160,193, 67,200, 30,155, 87, 10, 22,221, 77, 24, 37, 94,216, 11,251,190,231,183, + 90,237,151, 31,183,239, 60,188,245,116,243,249,222,110,173,246,163,182,249,229,221,139, 55, 27,135, 94,188,188,116,222, 48,116, +226,182,224, 46,100,184,100, 42, 83,174,148, 84, 68, 3,234,203,224,182,140, 98,161,184,189,231, 26,223,126, 78,175, 28,177,180, +169,168,233, 1, 99,224, 82,203,208, 26,187,253,128, 61, 11, 69,255, 99,100,241, 49,136,197,248, 49,136,253,148, 75, 61,148, 51, +119, 55, 32,110, 34,182,152,172,118,209, 79,185,116,238,202, 78,107, 7, 11,131,130, 15,193,229,129,244,216,151, 79,156,109,145, + 12, 25, 69, 12,110,162, 18,121, 26,249, 30,181,172, 70,170,221, 67, 64,213,182,215, 6,104, 11,248, 4,120,140, 26,144,213, 16, + 55,240,166,176, 84,144, 33, 44,211,166, 19, 54,230,227, 39, 36,116, 17, 3, 1,136,139,186,198, 90,107,114,184, 47,156,113,124, + 45, 46,102,149, 40,122,129, 5,171, 0, 36, 39,218,117,242,146,241,144,165, 91, 60,118, 93,157,216,177, 34,166,113,118,215, 38, +248,101,168,254,203,165,210,152,104, 53, 90, 51,168,237,126,249, 7,169, 81,251,144, 91, 26, 42,201,227, 12, 6,255,235,175,254, + 22,128,173,107,217,105, 34, 10,195,103,166,237,180,165, 55,108,167, 80, 42, 24, 93,152,152,152,136,151,196,248, 4, 68,195,198, +196,240, 2, 38, 93,200,187, 16, 31, 64, 55, 62,134,174,221,224,194, 13, 59,144, 40, 10, 1,132, 10,165, 51,157,153, 51, 76,199, +255,251,206,180, 16, 99,151, 77,154,105,207,233,249,207,127,249, 46, 6,255,174, 76,131,223,124,111,249,143,206, 53, 58,160,107, +142,254, 4, 24,104,144, 9,148,249, 81,101,227, 92,169,143, 22, 90, 75,247,151,150,247, 79,247,228, 94,245,177,100,120, 82,158, + 87, 40,252,153, 56,227, 25, 70, 67,234,244, 22, 34,249, 43,103, 4,191,172, 53,111,212,156,205, 89,150, 95,215,247, 78,189, 96, + 96, 77,212,242, 12, 19, 70,178,170,123,139, 15, 46, 70,231,240,109,161, 54,180,241,104,132, 44, 42,148, 14, 44,139, 18,229, 83, +160,164, 57, 99, 97, 24, 80, 40,216,244,229,121,145, 38,180,196,184, 2, 40,216,134,149, 88,159,169,119,155,221,253,254,193, 0, +174,190, 9, 13,101,104, 62,106,228,141,232,176,110,140,126, 19,195,204, 33,254,182,235, 46, 29, 15,142,186, 55, 22,229, 34, 60, + 60, 63, 6,225,139,107, 40,101,148, 60,172, 85,109,251,241,240,219,238,246,225,201,129,196,125, 13,233,234, 40,129,215,159,164, +229,227,188, 4, 41, 8,163,198,242,166,142, 37,191,246,115, 85, 91,142, 92, 16,226,224,197,116, 97,149, 71,150,115, 5, 59,177, +131, 16,114,160, 28, 62, 89, 64, 98,130,244,148,146,175, 36,233, 76, 74, 91, 75,132,254, 94,175, 39, 27,184,177,241,246,201,242, +163,223, 71,135,100, 0,193,229, 76,138,192, 88, 67, 36, 82,162,180,148,183,235,111,214, 87,158,175,172,189,122,185,186,250,226, + 50,242, 55,191,108,150,138, 80,231, 25, 5,122,161, 61,191,246,186,167,146,248,195,187,247,167,195,136,170, 39,137, 99, 65,140, +204,248, 69,215, 75,229,208,215,223, 15,142, 11,185, 34, 74,248, 52, 9, 37, 56,210,199, 47, 7, 58,130, 38,107, 61,149,128, 40, +215,188, 61, 5,125, 41,235,223,201, 79,102,114,112,229, 15, 99,224,184, 25,192,156,164, 52,211, 75,181, 1, 81,167,212,140,217, + 68,131,141, 27, 27, 70, 66,134, 21,158, 98,106,208, 20,101, 65, 78,110, 39,199, 0, 41, 33, 26, 25,136, 6,123, 39,113,132,252, + 17,238, 38,202,252, 42,143, 8, 18,173, 10,198, 98,148,228,103, 22,102, 24,115, 16,219,201,108, 87, 45,186,208,228,209,136,191, +212,110, 99, 14,109,122,112, 38,100,109, 35, 34,187,211, 80,135, 84,204, 71, 2,200,134, 46,102,133,146,191,199, 64,218, 33, 49, +234,204, 46, 32, 16,144,130, 55,105, 58,102, 74, 74, 83, 60, 36,137, 84,169, 91,107,201,131, 36,112,202, 57, 42, 21,102, 42,165, + 42,251,159, 99,118,141,145,188, 3,233, 40,215,149,228, 87,182,253,208,117,227,249,167,103,170,232,249,250, 86,209,118,218,137, +234,123,212,151, 67, 61, 41,187, 91,147,207,183,154,170, 82, 73,130,192,151,244, 88,195,230, 20,224, 73, 84,132,249, 70,231, 22, +122, 59,121,248, 15, 36,146,218,248,158, 55, 28,109,109,239,126,252,252,105,172,189,187, 85,117,167,162,186,101,213,114,148, 36, + 56, 95,119,182, 36,183,127,188,252,204, 41, 65,210,192, 41, 74,177, 93,112,138,133,102,167,105,177, 1,192, 97, 38,152,211,245, +217,250,175,253,243,219,174,165,110, 86,157,254, 40,136,228, 18, 85,165,114,238,199,206,217, 64,170,103, 72, 22, 59,178,193, 92, +112, 0,101, 19,101,186,255,116,145, 36, 99,156,106, 9, 64, 27,104,254, 20,219,136, 24, 0,111,152,255,121,178,135, 11,152,158, + 80,234, 90,230,112,114,118, 68, 66, 30, 91,187,180, 26,180,193,134,141,178,105,144, 69,109, 44,170, 21,155, 40, 36, 65, 73,214, + 6,165, 67,154, 56,128, 34,231,155, 21,247, 34,186,136, 36,226,217,202,173,181,189,200, 67,155,209,100,228, 25,172,111, 74,213, + 55,208, 62,188,218,213,182,212,253,181, 82, 13, 44, 54, 73, 70,203, 13,109, 28, 92,137,136,209,176, 86,152,106, 40, 88,215,221, +190, 0, 64,152, 68,115,217,127, 41, 17, 66, 72,128,164,153, 15,150,202,132,235,211, 73,119,114, 2,106,156, 74,101, 88,156,195, +183, 2, 61, 50,114, 61,255, 13,241,127, 5, 96,235,106,122,147,136,162,232,227, 49,204, 12, 51,211,118,248, 42, 5,164,105,180, + 54,145,106,131, 38,134,133, 43,247, 46, 76,220,248, 35, 76,140,191,199,141, 43,255,137, 46,140,214,180,150, 38,141,245,139, 38, +181, 84, 11, 5,166,101, 96, 96,198,115,239, 27,104, 23,238, 8, 4,120, 3,111,238, 61,231,190,123,207,137,231,155,144,103, 56, +125,176, 57,125, 66,254,241,218,253, 97, 79,157, 67,198,234, 31,154,201, 57, 70,181, 45, 83,226, 2, 9,253,121,122,168, 14,168, + 85,120,157,178,186,167, 20,170, 37,134,138, 27,212,100,171,233,158, 26,216, 19, 87, 77,158,241,199,206,201, 39, 87, 81,164, 84, +254,153,196,221,238,173,213,255,246,218,248,228,211,193,201, 56,244,149,142,126,110,177,176, 94,220, 64, 4, 9,227,226,105,130, +143,239,184,251, 88,200,226,194, 50, 40, 51,195,177,216, 26, 88,217, 79, 38, 99,255,200,120, 74, 69, 77, 42, 82, 64,160,163,116, + 29, 41,125,204, 54,163,248, 31, 12,195, 74, 50, 13,224, 81, 69, 10,205, 74,115, 3,136, 9,191,242,132, 27, 91, 56, 4, 32,194, +130,129,143,184,188, 67, 78, 14,141,219, 15,247,142,246,241,233,229, 92, 37,183,152,235,120, 93,106, 12,151,124,120,195,176, 52, + 96,233, 43, 46, 11,132,192, 17,181,242,221,206,144,138, 54, 41,161, 57, 57, 82,254,179,245,148,107,107,118, 90, 51,116,194, 69, + 5,199,112,211,154,153, 78, 0, 59,107,106,136, 82,163, 11,209,245, 4,110,125, 83, 23, 6,249, 83,137,225,229,164,241,160,241, +244,217,115, 44,233,119,235,240,213,203, 23,159, 62,188,239,116,123, 8, 8, 36, 62, 18, 34,190, 83, 95,103, 0,242, 29,140,191, +127,107,110,127,124,247,121,251,195,254,222,238,206,238,206,233,217, 9,136,118, 48,137, 6,151,254,253,250,214,163,199, 79, 90, + 95,155,175,223,188, 21, 83, 32,116,174,112,130,200,143, 40, 18,128,136, 47,187,246,193,143, 99,207,243,233, 28,140, 42,131,236, +191,205, 73,250,230,202, 70,103,112,230,152,139, 83,134,213,243,121,107,121,205,168,108,230,235, 75,219, 51, 99,129,114, 13,101, + 98,174, 36, 70,197,230,162, 91,194,237, 1,124, 16,177, 43,167,242, 70,228,189,148, 76,204,149,153, 88,159, 11, 8,157,212, 90, + 98,143, 30, 2,181, 36, 24, 74, 35,157,186,150,164,131,208, 52,217,106, 83, 9,154, 93,230, 98,157, 3,186,221,166, 32,203, 26, + 47,155,222, 9,212, 70, 34,208,188,155, 3,182,132,195,106,182, 86,235,237,243,246,204, 36,116,134,181,120,233,160,107,150,158, + 70,132,164,169, 99,174,183, 42,103, 78,169,148,179,153, 67,227,187,242, 86,214, 15,134, 50,238,112, 87,170,120,130, 56, 7,210, +249,132,166,228, 64, 82,177,212, 48, 12,226,254, 46, 78,118, 75,142, 27, 4,160,194,178,146,171,244,188, 30, 16, 3, 21, 30, 37, +117,104,240,209, 46, 65,191,149, 76,197,247, 47,116,226, 37, 18,123,128, 26, 35,197,216,180, 75,197,141,134,146, 42, 58, 58,234, +222,186,227,136, 78,151,108, 30, 39,202, 97, 92, 91, 42,228,197,218,186,176, 50, 81, 31,172,178, 79,109,144, 1,231, 49, 2, 44, +114,185, 80, 22,238, 2, 54, 19, 46,111,114,238,117,186, 94,167,215,255,210,220,151,189,227,170, 41,138,186,112,146, 34,155, 20, +153,148,112, 52,234,214,106,182, 14, 86,243,213,205,205, 58,126,114,211, 48, 12, 92,140,153,202,151,243, 0, 26,164, 66,147, 34, + 73, 98, 60, 80,179,223, 23,173,227,108,109, 81,243,195,160, 79,248,198,116, 82,178, 45,127,245,251, 81,252,239, 78,184,222, 66, +227,226, 35,110,137,197,147,181,234, 38, 94,245,134, 23,165,108,201, 15,124,236,178,106,246,134,101,226, 58,244, 17,121,168, 70, +120,140,111,168,173,214,122,151, 93,130, 26,216,172, 73, 82,185, 47,185,101, 0, 14, 29,137, 67, 36, 42,217, 42, 53,173,241, 96, +110, 90, 79,187,118,102,193,118,145,173, 45,221,177, 13, 11,225, 91,249,176,177, 43, 9, 13, 84,134,124,242, 15, 66,143,224, 30, +241,198,194, 74,188,177,199,172, 45, 17,198,254,124,241,177,144,194, 25,177,134, 50,151, 96,176, 78,188,142,251, 43,191, 84, 24, + 12,207, 71,227,145, 98,120, 92,188,137,102, 10,166,209,108,198, 73, 70, 87,250,210,242, 58,151, 13,194, 64, 9,177,204,184, 43, +189,135, 6, 31, 89,183,252,122,219,228, 92, 62,128,203,244,196, 56,103, 5,153,255,132,248,127, 2,176,117, 45,189, 77, 92, 81, +248,204,219,158, 71,252, 72, 66, 76, 75, 66, 64, 32,209, 69,133,248, 21, 21, 18,139,254,129,254,182,110,186,169,212, 29, 59, 84, + 85,138,186,104,203,162, 5, 17,243, 20, 41,216, 50,193,118,156,120,198, 30,143, 51, 79,206,119,174, 93,211,170, 94, 89,214,245, +216,154,123,231, 60,191,243,125,107,126, 49,109, 37, 30,159,230,203,150,191,237,151, 62, 90, 91,104,104,168, 18, 74, 5,110,113, +153,181, 67, 19, 92, 28, 42,175, 20,159,173,229,194,125,179, 1,210, 32, 7,208,191,186,246,245,235,211, 23, 8, 61,132, 95,205, + 88, 59,192,134,215,142, 22,147,138, 20,227,213,255, 72,184, 93,109, 95, 27,156,247,223,141, 78,248,103,120,171, 6,103, 61, 60, + 57, 48,142,229, 56, 26,205, 22,145,194,144, 26,250,198,137, 73,163,210, 25,206,134, 8,112,196, 32, 40,135, 43, 20,216,156,118, +101,186,129,127, 93, 72, 72, 32,250, 93, 28, 85, 65, 34,195,175, 5, 56, 70, 40,111,147,136, 46, 1,156, 22, 46, 67,199,112, 17, + 12,150, 34, 98,196, 6, 61, 67,205, 93,148,236,202, 78,243,139, 81,248, 49, 7, 37, 90,170, 58,105, 28,187, 29, 61, 63,194, 64, +141, 97,244,206,122,253, 73, 95,152, 51,203, 27,123,135,227,232,140,143, 90,165,175,105, 38,138,210,174,187, 55,246,110,190, 62, +125,169, 73, 73,149, 47, 31,120,134,121, 73,162, 84,162,131,250,122,169,103, 40, 53,136,142, 43,242,113, 80,132,107,162, 25, 2, +246, 87,176, 82, 81, 89, 24, 80,106,202,137,227,239,251, 15, 30,208,150,247,244,231,135, 39,175,142,127,252,225,251, 40, 60,183, + 1,104, 65,128, 79, 96, 56, 42, 37, 89, 97, 27,166, 61,126,220,205,114, 16,174,114,228,199,143,165,101,161, 31,105,154,101, 43, +208,238,221,189, 77,148,119,255,250,163,110, 23,205,134,133,110, 82,165,205, 33, 81,136, 52,180, 81,183,122,253,241,240, 44,228, +221,230, 7,194, 49,253,182, 31,156,158, 15,212,126,157, 12, 95,234,168,185, 47,215,140, 5,176,146,207,122, 79,148,101,231, 52, + 46,175, 82,215,242,132, 46, 24,166,188,229,239,134, 34,181,195,222,197,119, 26,211, 4,232, 85, 96,105, 48,234,194, 71,165, 86, +228,201,126,251, 32,168,251,221, 65, 87,129,219,235, 70,157,141,166,132, 3, 70,188,156, 87,171, 82,190,161,124,120, 9,212,252, +117,206,168,112, 12, 76,199,181, 93, 94,220,240, 90, 36,181, 84, 1, 56,115, 18,157,221,238,220,121, 59,124, 35, 0, 68,165, 9, + 93,124,217, 60,232, 79,222,123, 82,253,195,220,121, 50,189,136, 39, 34,129,254, 25, 2, 65,206, 23,202, 16,101, 17, 39, 51,215, +113,107, 22, 91,249,197,127,244,167,248, 78,242,117,210, 44,229,167,212, 4,127, 16, 85, 50,214, 43,180, 83,186, 80, 36, 42, 61, + 38, 29, 58, 55,180, 34,229, 3,245,102,150,186, 78, 61,135,120, 12,210, 8, 76,115,102,169,169,235, 27, 48,157, 4,102,166,102, + 39,201, 76, 87, 69, 89,169,237,130,230, 90,175, 58,251,247, 40,215,127,251,253,209,175,127, 62,250,123, 48,184,187,253,221,149, + 78,163,186,152,242,150,219,164, 5,190, 71,183,238,208,222, 85, 10, 23,228,120,176,170,165, 16,132,201,249,172,170,100, 54, 13, +131,248, 10, 5, 14, 16,245,134,158,166,249,197,252,178, 76,162, 67,151, 70, 41,117, 99,138, 75,234, 88,116,224,208, 33,186,179, +180, 56,167, 95,142,126,186,255,205,183,190, 7, 67,110, 24,166,205,129,175,111, 25,153,240, 0, 35,181,178,103,147,104, 57,143, + 91, 59,205,241,208,166,241,156,154,206,214, 86,173,140,216,221,146,229,150, 74,242, 59, 85, 44,191,202, 99, 11, 91,167, 34,188, +234,246,143,129, 91, 37,146,121,117, 24,187, 15, 23, 31,212,200, 52,111,193,254,238,117,206,129, 78,198,239,158,189, 63, 14, 92, + 95,137, 42,241,125,168,244,149,124, 2,191,248, 6, 38,105,204,161,216,174,183,147, 92,162, 86,198, 55,191,237,111, 3,215, 75, +213, 52, 14,149, 20,153,154, 87,201, 87,154,241,154, 16, 10,225,114, 74, 9,100, 37,115, 32,229, 32,173,248, 71,181, 27,111, 56, +198,199,224,231,229, 98,141, 30, 65,161, 96, 43,216,153, 68, 35,249, 10,155,211, 98,183,177,247,113,122,186,158, 9, 81, 36,196, + 90,189,230, 45, 68, 53,140, 87,181,189,150,234,252,125,166,184,161, 41,156,220,191,133, 16,212,135,202, 88,170,225,146,106, 29, + 18,168,113, 10,140,191, 2, 51,187,161,137,223,172, 81,175, 79, 2, 80,117, 45, 61, 77, 68, 81,248,118,166,243,232,148,182, 52, +165,181,160,242, 48,162, 70,130, 49, 49,241,129,129,133,113,131,196,196,196,165, 63,205,173, 11, 93,152,128, 49,184, 51,209, 31, +225,194,196,160, 73, 11, 22,166,116, 58,109,167, 51,157,151,231, 59,119, 90,132, 13, 11,202,164,119,238,189,231,124,231,245,125, + 25,126, 39,216, 46,135,191,105,125,228, 9,253,216, 71,115, 55,115,207,211,103, 13, 52,228, 83,164, 52, 97,210,183,228,241,237, + 45, 2, 17, 24,227,156, 21,124, 47,228, 8,178, 12, 59,161,239, 4,170,214, 42,219, 23,166, 45, 97,249,163,128, 46,106, 78, 89, +173,223, 24, 5, 67, 73, 53,148,205,243, 66, 15, 8, 46,215,245, 28,122, 24, 15,178,211,177,116, 96, 1, 11, 21, 16, 30, 68, 44, +160, 40,117,146,224, 74, 17,163, 77,153, 65,114,203, 11, 43,100,106,233,123,176, 55,131, 5,200,243, 95,185,210,141,236,146, 1, + 50, 19,169,252, 12,163,179,117,235, 81,144, 76,154,243, 77,123,208, 11,208, 7, 8,211, 74, 55,173,227,156,166, 76, 98, 62,192, +188,156,104, 86,155,253,145, 27, 34, 75,160, 88, 5, 56, 3,122, 57,141,106,147, 30, 85, 43,213,153,107, 69, 16,172,227, 17, 86, + 85, 76, 41, 89,232, 93,189,222,125,115,110,219,221, 65, 55,100,181,144, 76,137, 0,225,103, 2, 66,243,145, 35,157, 52, 72,227, + 82,244,169, 88,121,101,174,144, 43, 91,106,205,210, 23, 10, 90,137, 34,223,148, 32, 56, 6,108, 84,120,154, 52,152,224,246,140, +125,208, 56,122,180, 61, 62,132, 82, 9,183, 45, 53,234,223, 62, 31,190,255,240,177,239,248, 71,191, 91,161, 63,209,201, 24,228, + 17, 5, 17,202, 76,226,148,214,134,176, 76,215, 10,134,129,112, 74,203, 91,134,166,179,222,166,101, 40,150,169, 20, 11,218,253, +205,123,213,114,241,211,193,254,223,147,179, 56,201,141,199,225,104, 4,236, 8, 6, 90, 58, 3, 65,114,124,234,130,173, 1,201, +236, 56,224,202,103, 58,147, 69,224,180, 40, 55,133,147,133, 42, 83,212, 73,254, 47,171, 76,178, 58, 7, 29,193,197,249, 69,215, +235, 19,218,163,149,118,135,103, 92,246,198,191, 32, 7,194,232, 38, 19, 8, 2, 84, 65,204,238,120, 61, 92, 24,110,129,215, 21, + 61,201, 18,235, 62,155,209, 57, 48,120, 72, 94,124,180,114, 25, 18, 43,143, 97,247, 69,189,210, 24,250,131,152,121, 20,198, 96, +248,202, 49, 45,137, 70, 47,254,230,181,187,109,251, 79,185, 0, 40, 39,231,140, 40,230,240, 3,175, 86,106,184, 94, 79,102, 99, + 64, 35, 49, 27, 40,204, 82, 40,216, 83, 29,189, 34,122,196, 18,208, 62, 52,219,114,211,153,147,105, 58, 93, 65,251, 9, 34,155, + 52,101,121, 38,112,252, 78,226, 40, 39, 46,244, 45,100,200,146, 71,167,191, 34,129, 28, 20, 95, 16, 30, 17, 68, 64, 67,142,174, +106,163, 96,144, 74,238,164,116,218, 54,192, 87,153, 32,191, 9, 42,136, 80, 38,229,116,168, 96, 71, 75,149,165,103, 79, 95,237, +127,121,123,248,245,157,240,122,209, 36, 94, 55,146,245, 39,155,225, 73,143, 94, 39,218,108, 86,215,196,250, 29,193,141, 7,169, + 59,232,219, 29, 2,246, 56,234, 81,102,232,205, 98,165, 82,158, 23,101, 83,232,121,197, 25,159,218,189, 86,215,241, 78,142,194, +177,123, 96,139,239, 67,241, 51, 16,109, 31,248,125,153, 66, 70, 85,248,169,104,245,236,231,219,123, 87,174, 46,162,190, 97,106, +197,242, 92,190,105, 9, 45, 39, 76,132, 48,177, 59,242,122, 3,218, 70, 93, 3,121, 67,197,239,168, 69, 67, 29, 71, 50,195,236, +159,135, 63,142,187,220,236,203,213, 51,102, 27,163,144, 40, 22, 18,160,162, 79, 6,217, 69,108, 44, 14, 79,173, 84,165,239,219, + 40, 55, 34,150,114,162,219,167,171, 6,249,236, 23, 15,118,219,118, 59, 8, 3,147, 64, 39,183,150,122,129,103,230,245,149,250, +154, 59,116, 94, 62,220,107, 84, 26,191, 58, 71,244,148,157,141,237,162,129,254, 55, 58, 69,219, 27, 59,173,243, 99,218,145,235, + 11,171,116,121, 48, 41,153, 69, 80,136, 35,100, 22,134, 54,187,106, 85, 67, 86,127, 21,210,239,112,150, 47,107,202,196,236, 69, +129, 92,120,132,250,109,134, 88, 33,135, 25,121,244, 11, 52, 53, 0,248, 42,228, 7, 6, 93, 44,135, 63,193,105, 55,204, 82,177, + 98, 23, 78,148,169, 27,180, 22, 67, 51,185,126,147,136,105,162, 82, 54, 11,208, 70, 71, 40, 22, 10,217, 72,194,142, 70, 26,248, +244, 18,138,159,229, 65, 46, 55,166,139,255,146, 65,244,243, 79, 0,174,174,172,167,137, 40,140,222,206, 76, 59,157,173, 29,218, + 34,155,134, 4,226, 18,136, 91, 66,140,198, 68, 77,244, 39,250, 75,124,225,197, 68,223,125, 49, 6, 98,128, 34,224, 82, 90, 40, +116,153,105, 59,251,120,190,239, 14, 66,124,234, 75,211,229,222,249,246,243,157,115,229,223,181, 42,108,108,181,181, 6,255, 91, +102,146, 69,110,231,135,146,152, 23, 86, 20, 38, 83,167,226,160,138,108,213, 22,142,187,237,115,175, 79,217, 86, 46,120,166,175, + 71,105, 49, 41,146,160,209, 2,137, 92, 82,224, 85,100,100, 97, 78, 27,181,110,186,168,143, 96, 45, 23,227,243,171,226,149,140, +152,229,211, 40,189, 70,106,153,114,179, 95,246,219, 96, 81, 43, 77,154, 23,203,173, 51, 84, 91,146,170,105,125,241, 30, 2,160, +228,245,144, 50, 61, 67, 31,239, 17, 46,241, 53,147,200,156, 93,181,158,221,125,113,116,254, 67, 50,246,231,180,234, 82,150,196, +205,188,217,144,217,134,229, 5, 19,159,138, 50,223,181,231, 42,196,125, 87,245,130,105,148, 33,123,130,249, 84,184, 60, 76,189, +217,132, 86,213,249,240,113, 43, 83,164, 6,121,230, 79, 71,248,181,126, 56,129, 53,162,124,134, 97, 35,145, 73, 57, 43,194, 31, +178, 13, 26,199,127,221,251, 18,132, 33,177,137,165, 57,190, 75,106, 89, 51,191, 40,169,220, 25, 58, 65,181,248, 9, 81,212,204, +246, 71, 65, 22,168,217, 68, 77, 38,106, 30,169,150, 98,186,102,181,229, 24,174,105,204,219, 53,167,108,234,153,102,171,106, 77, +168, 53, 77, 51, 53, 21,159,169, 22,180, 14,226,240,160,253,125,127, 15,255,209,173,233,101, 98,114,204,202,196,180,149,197,112, +135,248,101, 17,169, 20, 51, 94,162, 24,107, 32,136, 86, 53, 56, 98,197, 33,163,166,200,225,123,201,238,206,193,231,143,159,246, +219, 71,120,174, 16, 66,152, 95, 39,215,149,188,105,106,149,114,246,171, 27,205,224,213, 83, 22, 29, 47, 4, 43,201, 79,225,124, +224,118,169,129,131, 50,137, 53, 68,168,218,227, 59, 81,139, 29,110, 65, 28,112,165,156, 6,101, 66, 24, 85, 68, 22,226, 81,226, +124,185, 4,247, 74,124,153, 92,237, 62, 94,125,210, 27,117,138,157,242,127,188,205, 40,217, 56,166,220,114,151,225,218, 96,144, + 20,230,113,226, 68,132, 71,128, 57, 9,204, 37,244, 71, 20,216, 70, 13, 39,188, 58,191,214, 29,116, 72,183, 11, 70, 18,199, 86, +197,194,215, 17,171, 84,150,246, 70,167,120,186, 54,111, 63,234, 13, 58,220,192,163,245, 99, 36,227,195,201, 64,194, 10,168,175, +173,233,248, 76, 71,183, 97,254,215,205, 37,133,213,159, 83, 90,117, 94,106, 44,251,129,175,144,116, 6,193, 31, 37,253, 17,227, + 49,105,162,131,211, 32, 97, 3,150,167, 64,182,193, 16,230,144, 91,252, 66, 41,166, 17,202, 21,171,185,224, 85, 88, 98,221,136, + 25,146,207,102,146, 85, 52,157, 3, 37, 5,118,141,250,118,100,212,164,229, 77, 13,141,152, 54,149,144, 50,243, 18, 19, 30,130, + 87,155,175,147, 52,248,176,253,126,195, 22, 15, 92,209, 44, 11, 45,154,109,189,125,153,245,250,112, 42,182, 99,137,167, 91,162, + 94, 39,142,129,105,146,121,254,176,127, 26, 20,248, 72,169,171,158,149,202, 70,163,214, 80, 77, 67,212, 77, 98,221, 60, 27, 29, +246,250,227,139,238, 81,127,184, 61, 22, 18,125,237,113,205,254,208, 18,150, 42,166,153,232,120,226,205,243,119,235, 27,247, 81, + 27,234,112, 81, 11,117, 49,199, 61,128,113,148, 92,142,147, 40, 36,112, 5,181,225, 41, 2, 85,135, 39,154, 99, 16,240, 23, 55, +142,204,122, 16,126, 59,238, 43,188,133,196, 0, 0,217,106, 47, 36,148,164,126,181, 68, 42,225,244, 80,130,210,141,195,119,199, + 4,148, 84, 56, 83, 92,106, 46,244,189,139, 48, 12, 6,211,129,169, 91, 75,141,165, 40, 10,155,118,115,165,121, 7, 15,161, 63, +243, 45,221, 60, 62, 59, 89,110, 46,255, 57,255,137,203,218,239,180, 47,252,254, 98,125,225,210, 31,236,254,222, 65, 72, 64, 10, +226,218,238,132,186, 61, 37, 25, 27,100,162, 98, 25,118,194, 8,218, 89, 50, 67, 0,148, 36, 51,220,184, 37,223, 72, 50,179,236, +173,144, 52, 68,105,172, 20,247, 41, 29, 51, 19, 12, 41,164, 61,153,230,241, 74,227,246, 65,119,143,226,175, 40,214,143,229,104, + 61,166, 41,110,129, 35, 12, 8,183,195,236, 10,105, 46,187,248,249,141,145,106,203,105, 77,120,164, 87,186,102,183,207,109,189, +198, 0,176, 66, 45, 69,185, 26,197,222,128, 72,150,254,115,241,242,229,175, 0, 76, 93, 73,111,219, 70, 24, 29,142, 72,145,162, + 36,203, 91,146, 90, 54,156,164,117,128,162, 77, 15, 61,183,255,185,135,246,144, 91,122,233,173, 64,179,184,141, 17, 4, 72, 26, +203,150, 28,219,146, 37, 81,226, 54, 28,246,189,111, 68,163, 55,193, 54, 44,114,214,111,121,139,127,239, 14,131, 37,250,239,244, + 19, 27,167,187,135, 87,119, 23, 82, 83, 97, 84,142,144, 57, 45, 41, 43,150, 20, 43,236,220,189,254,110, 65,141,188,202,219,200, +239, 25,221,210, 7, 91,135, 95,150, 19,214,101, 92, 58,161, 54,148,117,143,238, 75, 52, 44,198,231, 56,234, 34,255,197,222,222, +233,238,223,212,147, 74,244,245, 37,193, 9, 48, 55, 5, 49,161,136,232,114, 87,199,108,160, 63,234,251,227, 31, 71,127,253, 86, + 11,253,106, 89,139, 75,142,181, 31, 38,239, 37, 15,177, 90, 36,129,221, 80,227,153,174,231, 19, 89, 61,222, 34, 93,252,254,247, + 75,164, 78, 21, 5, 33,168, 19,178, 34, 40,158, 4,236, 78, 20,225, 62,127,245,233,173, 52, 99, 20, 38, 27,111,116,250,249,157, +236, 55, 46, 50,206,189,227,215, 42,103, 34,217,194,103,100, 27,133,152,163,211, 8, 45, 8,165, 92,195,122, 78, 81, 87, 94,149, +199,173, 24,159, 79,134,207,198,211, 9,206, 38,252,207,116,150,246,226, 62,253,173, 90, 30, 14,234, 36,191, 96, 46,104,171, 78, +187,123,189,184,122, 54,252,102,150,204,219, 10, 49,117,252,211,183, 63,191,120,245,235, 50, 83,139,172,228, 88,180,200,113, 76, + 62,223, 28,237,156,172,205,173,241,166,195,253,248,225,118,220,143,250,140, 33, 41, 40,174,141, 33, 37, 74,124,129,144,141, 86, +235, 94, 80, 25, 28,127, 6,113,183,205, 41, 95,183, 34,206, 13,241,164,151,211, 97,207,163, 42, 50,101,220,234, 64,219, 16, 15, +100, 55, 34,179,248, 41, 27,101,145, 54, 54, 69,206,214, 69, 8, 36,236,143,202,146, 16,224, 85,186, 23,212,239, 71,105,201,210, + 80, 64,193, 53,170, 6, 88,188, 96, 94,229,200, 0,176,235, 18,234,205,209,118,158, 60, 69, 1, 5,243, 1, 9, 1, 54,142,175, + 40, 19,228, 57,109,211, 85,182, 18,197, 30,130,175, 12,217,125,233,209,238,225,248,238, 18,227,124, 54, 58,149, 92, 69,254, 80, +251, 56,160,137, 61,215,180, 93,126,254,244,135,211,143,175,219,116,162,210,210,236,226,176,227,100,192,217, 82, 84,184,131,173, + 47, 52,197, 56,236,225, 48, 61, 59,127,227, 60, 51,112, 8,174,181, 13,194,118, 88,135,105,158, 10, 11,129,197,202,127, 70,111, + 48, 26, 76,242, 60,111, 43, 28,100,229, 42, 12, 2,124,103, 73, 11, 36, 95, 66,233, 44, 53,197,222,214,193, 52, 65, 8,226, 61, +222, 63, 70, 18, 70,100, 36,101,226,165,134,174,140, 95,179,142,191, 21,109, 47,179, 69,195,213, 96,201,133,212,249,210,138,170, +129, 21,238, 94,137,119, 9,169,129,162,185,101,232, 58, 64,180, 41, 91,127, 26,225, 66, 15,215,146, 67,136,225,129, 7,221,157, +100,189,200,139,180,177,169,240,132,133, 90, 23,117,166, 8, 63, 17,123, 50, 45, 82, 5, 18,254,224,160, 62,122,112,252,199,159, +191, 28,183,216, 2,157, 87, 42,194,123,148,137,162,104,132,238, 96,212,135, 67,117,240, 72, 21, 78,237,155,237, 89, 87, 5,185, +247, 29, 37, 44, 34, 89, 76,103,203,175,110, 58,106, 47, 86,187,253,157, 65,140, 32,198,248,157,153,213, 70,217, 64,136,224, 56, + 98,231,162, 6,222,245, 85, 23, 23, 12, 57,237,214,239, 71, 62,242,199,118, 64, 9, 26,188,196,117,170, 76, 41,232, 10,206, 25, + 21, 26,177, 42,150, 45,100, 85, 56,214, 85, 20,226,138,104,151, 37, 86,218,118, 20, 45, 76,186,209, 3,171,254,167, 72, 40,146, +226, 98, 94,186,198, 47,177,218, 49, 17,136, 29, 51,131,124, 20,203, 65,127,253,232,228,114, 54, 30, 93,159,251, 42, 64,100, 22, +232, 32, 43,214,227,217,228,201,131,167, 30, 89,227,237,171,249,132,142, 2, 65,248,101, 54,158, 39,119, 15,183, 49,131,211, 65, +103,240,252,201,119, 23,183,151, 8,114,216,174,183,213, 42, 91,158,141,166, 24,243,189,254,126,118,183,174,181, 51,176, 33, 78, +198, 41, 4, 54, 52,105,215, 23, 20,161,115,164, 89, 68, 3,187, 10,180,239, 19,236,179,105,129,218,123,230, 18,177,221,244, 42, +184,188, 61, 71, 0, 46, 41,123,225, 42,125,157, 32, 94, 17,101,238, 16, 55, 77, 59,216,125, 75, 83,161,214, 77, 85, 70,203,174, +118, 94,191, 27, 40,175,220, 18,105,190,180,174,101, 41,133,154, 90, 64, 53,213,134,249,161, 26,124,164, 87, 55,198, 21,247, 76, +169,255, 4,224,234, 90,118,155, 6,162,232,140,237,216, 99,187,105,236, 52,143,150,150, 86, 1, 84,181, 11, 16, 2, 68,133,196, +163, 21, 43,248, 3,216,176, 0, 36, 62,141,175, 96,193, 6, 33, 84,209, 34, 16,168, 10,180,162,109,154, 52, 73,243,168,237, 58, +177, 99,115,239, 29, 83, 42,214,217,196,158,153,235,115,238,156,123,142,196,239,137, 64, 91, 3, 70, 54,117, 41,153, 29,146, 32, +137, 93, 24, 69,161,130, 42,116,113,120,114,136, 77, 31, 46,255, 82,162,144,209,210, 32,192, 57, 20,149,101, 34,125,141,171,232, +206,129, 78,136,113, 49, 95,244,176,117,168, 46, 86,106,131,224,132, 88,176,103,235, 83,240, 24,203,243,171,232,206,131,249, 12, + 81,118, 83,149,169, 68,169,217,164,160, 20,175,126,180, 67, 38,227, 25, 67,177,240,170, 42,194,220, 74, 41,143,231,178,129,167, +216,186,185, 80,170,173, 95, 95,111,245,219,201, 36, 18,134, 21,163,143,143,122,222,202, 42, 77, 87,130, 16,152,117, 82, 45, 84, + 79, 67, 47,203,121,226, 80,184,131,230,224,120,146,153,214,103, 78,244, 50,121, 29,231,155, 38,113, 97,202,233,251,125,248, 29, +136, 11, 70,187,193,225,209,109, 76,160, 70,217, 22,174,215,173, 43,183,133, 33,252,208,155,117, 47,161, 4, 72, 85, 15,187, 7, +240,228, 18,180, 2,144, 12, 66,159,124, 65, 13,120, 82, 32,113,176, 15,238, 92, 93,219,105,254, 40,152,110,247,236,100,175,189, + 23, 39,227,219,181,187,228,127,212,183,114, 70,209,114,225,245, 95,171,214, 44, 97, 53,122,251, 80, 51,190,244,235, 31,235,187, + 31,234,123,219,191, 15,118,154, 71, 91, 71,205,159,157, 78,253,184,205, 80, 6, 15, 48, 36,225,134, 53,142, 16,104, 20,132, 49, + 99, 89,139,211,211,101, 96, 0,166,168, 88, 98,214, 50, 47, 59,118,201, 50, 10,192,102, 53, 64, 25, 41,112, 36, 88,102,168, 84, + 65,136,232, 62,198,102, 6, 71,231, 88,149, 11,145, 22,166,210,188, 9, 0, 42,229, 99,214,104, 4, 7,221, 0, 37, 64, 64, 7, +164,129, 19, 6,149, 8,199,116,239, 45, 63,104, 13,143, 41, 85,131, 27, 24, 28, 4,124, 29, 21,102, 66, 51,117,195,140,227, 72, +201, 44, 34,178, 41, 79, 69,234, 82,129, 99,153,142,166, 40,168, 69, 83, 53,186,140,194,106, 40,128,163,104,148, 28, 40,227, 22, + 82, 25, 32,143, 64,254,201,218,211,237,250, 22,194, 86,105, 24, 34,249, 59,252,187,100,132, 38,223,104,185, 37, 0, 11,194,185, +117,167,102, 0, 37,193,186,194,146,205,185,151, 59,195, 22, 84,213, 23,143, 95,125,254,181,137, 82,109, 18,174,207, 22, 23,202, +249,178, 23,248,100, 77,133, 41,166,228, 99, 26,202, 75,180, 49, 6,234,226, 85, 44,208, 56,212,228,164, 41, 96,124, 20,117, 96, +219, 8,227, 77,230,156,121,168, 59, 56,126,129,247, 90, 17, 79,255, 78,211, 72, 27, 73, 66, 38, 64,115, 39, 89, 96, 51, 42, 17, + 93,123,198,135,253, 79,212,250,225,234, 70, 16, 98, 28, 58,124, 75,172,156, 37,181,128,176, 31,110, 44,221,220, 39, 95,132, 89, +103, 1,235,130, 84,143,164,128, 6, 76, 55, 95,130,253,131,102,121, 40,165,194,211,138,194, 72,158,232,156, 63, 90,185,247,105, +243,237,156, 22,189,247,216,187, 62,107,142,216,188,154,110, 60, 92, 75, 7,158,106,232,252,214, 77, 86, 42, 35,120, 63, 27, 51, +248, 70, 15, 78,123,237, 70, 24, 97,162,110, 44, 67,146,104,183,235,182, 99,105,185,156,109,192,254, 6,126,218, 60,108, 55,135, +222,176,219,254,238,201,238, 52,186,236, 46,235,236,190,203,132,194, 90, 35,214, 11,217,243,103, 47,157,149, 26,131, 82,110, 26, +114, 70, 11,125,229, 13, 40,188, 10,158, 75, 13, 39,138, 20, 91, 4, 71, 13,173,183,155,171,148,152,173,227,104,249,100, 18,116, +188,221,253, 83,111,130, 17,239,153, 71, 66,146,198,156,238, 91,169,150,185,182,227,143,206, 8, 78,249, 0,146, 94, 63,121, 3, +239,161, 51,232,194, 82,180,122, 77, 88,205,197,234,210, 41, 84,167, 52, 94, 40, 45,230,205, 60, 0,252,246,160,229,135,104, 8, +220, 31,118,107,149,218, 92,177,170,233,162, 55,232, 0, 70,134, 15,131,173, 91, 95,127,127, 3, 22, 46,219, 44,242,142,135, 44, + 72,145,100,194, 97,132, 99, 62,147, 47,163,236,125, 28, 38, 25,148,151,173, 26,146,164,144,104,110, 68, 61,131,139,151,151,202, +191, 68,117, 25, 86,128, 6,159, 65,236,147,215,105,148,102,115,203,178,193,195, 1,115, 41,212,127, 96,231,222,200,100, 86, 66, +185,190, 10,187, 80,217,165,106, 86,142,221,170,212, 57, 33,211, 36, 78,211, 27,233, 63,139,189,115,199,186, 11, 72,253,191,230, +204,249,207,127, 4,224,234, 90, 90,155,136,162,240,157,185, 51,147,201, 36,147,166, 77,218,154,208, 42,214,138,143, 42,162, 32, +136,224,202,141,224,222,133, 46,252, 9,110, 4,255,150, 32,254, 0,113,161, 80, 90, 41,197, 22, 69,146, 54, 73,155, 54, 73, 51, +143,100, 50,153,204,203,115,206,157,168,184,107,233,162, 97,238,205,153,239,156,243, 61,178,249, 76, 65, 53,161, 33, 66,120,133, +105,118,177,176,202,148,230, 47, 40, 49,235,129, 43,177,113,233,134, 31, 76, 4,141,172,152, 51, 56,199, 8, 52, 35,151, 71,249, +159,120, 52, 12, 99,109, 19, 82,112,209, 96, 71,155, 6,228, 39, 37,165,228, 2,200,233,163,167, 40,131,147,120,207,233,242, 84, +158, 51,153,231,249, 29,244,206,196,158, 78,209,147,140, 23, 44, 11,123,131, 98,222,196,228, 67, 6,128, 32, 71, 78,211,127,180, + 77,232, 16, 52,112,122,141,179, 6,156, 19, 92,215, 91,245, 91, 93,187, 43,218, 91, 17, 96,143,206, 1,180, 35,113,252, 81,146, + 13, 0,113,213, 58,207,130,196, 35,161,125,122, 76,110,244,216,146,163,129,161, 6,133,123,132,227, 63, 89,130,226,171, 40,208, +146,106,142,231,212, 43,235,102,161, 60, 66,201, 3, 59, 29,158,244,221, 1,218, 36,121,206,197,248, 2, 23,170, 73, 10, 88, 30, +149, 26,100,139, 29,162, 88, 57, 22,254, 54,152,188, 29, 69,141, 65, 3, 62, 82,173, 92,119,125, 7, 1, 47, 9, 61,122,128,100, +211,244,234,234,166, 59, 29, 65,175,215, 26, 54, 91, 86, 67, 78,213,141,218,122,162, 89,240,213,129,255, 13,237,136,155, 4,238, +204, 59,247,172,166, 61,220, 61,237,124,106, 52,118, 90,237, 32, 98,214, 44, 60, 29, 77,127, 89,214,231,163,206,126,247,236,195, + 97,243,107,179,179,221, 27,124,115,237,253,161,101, 5,211,199,235,181,250, 82,105, 81,215,151,243,121,147,231, 12, 73, 53, 36, +101, 81, 85,138, 50, 47,107,220,128, 62, 67, 85,224, 59,172,107, 76, 87,248,200,142, 14, 27,118,199,246,197, 58, 46, 22,129,246, + 52, 38,199,245,175,204, 15, 58,123,104,227, 69,247, 8, 51, 23,209,227, 20, 95,120, 88,248, 4, 63,125,158,168, 72,126, 42, 98, +140,134,148, 53, 12, 59, 68,137, 38, 74, 99, 98,150,172,152,203,112, 44,254,204,139,147, 80,104, 2, 51,149,114, 54,223,150,118, +127,238, 16, 29, 69, 6,112, 87, 95, 92,179,161, 23, 36, 30,165,104,108, 49, 57, 6,135,167, 9, 84, 73,104,213, 9,220, 48,232, +175,117,173, 0,133, 64,229,218,247,163,125, 40,196, 42,244, 42,132,160,172,241,240,238,149,187, 65, 20,160,166, 73,226,213, 98, + 21,240, 56,233, 98,102,130, 96, 46, 34, 31, 80,193,143,129, 22,184, 36, 65,209, 22,109,138,174,173,110,158, 92,180,133,192, 42, + 3,115,114,182,125,200,235, 6,193, 17, 36,122, 34, 27, 39, 77, 74,148, 68,136,105, 90,129, 71, 74, 24, 44, 46,237,139,150,153, + 43,248,225, 20,240, 41,116,201, 61,128,156, 24,108,150,156,187, 93, 9, 3,112, 56, 32,161, 40, 3,145,100,197, 17,133,126, 48, + 70, 15, 95,244,115,225,196, 12,147, 21, 36,107,203, 37, 77,123,116,253, 65,115,239,227, 84, 98,239,109, 54, 76,217, 89,204,110, +155,252,249,179, 39,108, 56,150, 87, 42,236,193,125,124,234, 94,200, 38, 62,155,132, 51,215,113,251,237,144,184,173,194,207, 83, + 40,182, 20,221, 80,180, 66, 9, 14,178, 90,100,166,161,246,221,102,223,137,220,190, 53,158,244,201,120,232, 18,103,207, 23,217, + 86, 17, 97,122,115,204,242,165,234,235, 55,239,216,242, 2, 22,116,120, 43, 64,215, 0, 63,228, 56,142,224, 57,174, 23, 50,243, + 39, 69,178,183,191, 20,245, 25, 95,171,176,156, 74, 84,143,216, 59,182,127,116,156, 9,242,136, 24,153,128, 33, 82, 85,101,165, + 12,189, 11, 54, 46, 36,233,162,182,175, 94,169,245,237,254,215,131, 47,173, 65,171,108, 46,220,185,124,179, 86, 89,129, 67, 89, + 41, 86,123, 72,171,227,128, 17, 49, 89,129,202,221,171,167, 47,253,208,111, 15, 78,134, 19,220,165,221,187,243,176,123,218,134, + 91, 7, 15,121,117,105,245,220,238,189,123,241,246,230,218,214,113,239,104, 18,250,128, 44,131,104, 10, 55,221, 11,224,165,203, +225,176, 38, 51,143, 28,222, 69,178, 11, 43, 27, 75, 17, 90,177,199,130,223, 14, 29, 54,155,103, 50, 11,250, 56, 75,255, 55, 0, +131,223,203,165,106, 16,248,104, 56, 35,145,105, 84,182,160,201,132,166,217,144,141, 9,242, 44,161, 30, 4,211, 10, 84, 26, 13, +205, 35, 84, 50,217,158,187, 15,207,137, 91, 18, 5,175,145,219,155,156, 38, 49,251,107, 75, 39,201,255,148,229,127,150,180,127, +124,250,254,254,225,183, 0, 92, 93, 75,111,211, 88, 20,190,126, 93,219, 77,234,132,148, 20, 90,104,203,128, 84, 85, 20,177,128, + 46, 16, 91, 54, 44,128, 53,210,204,110,254, 35, 98,135,196, 2, 4, 43,196, 2, 13, 82,167, 29, 65,218, 36,205,171,118,108,199, +142, 99,155,243,157,107, 23,105,164,238,218,166, 73,125,238, 61,175,239, 81,221,239, 76, 3,163,102, 62,129,164, 42, 8,218, 78, + 94, 75,133,232,149,183, 54, 46,240,105, 8,145, 29,141,235,226, 21,199,136, 99,218, 62, 21,173, 58,196, 70,182,175,237,132, 73, +224,200,181,202,198,129,110, 46,181, 88,100,253, 97,250,179,158,235,113, 93,131,151,106, 55, 59, 9,176, 74, 42,131, 1, 98,124, +195,219, 10, 19, 31, 64, 25,168,192, 43,215, 61,189,182,244, 70,106,131,253,116,145,177,213,122,174, 54, 86,101, 5, 58, 4,128, + 7,145,207,172, 4,122,102,231,179,243,154,254,162,210,148,182,221,217,142, 40,134, 74,149,198,241,195, 59,221,189, 97, 48,160, + 66, 91, 90, 18,203, 75, 70,183,119, 26,215,125, 44, 15,129,124, 87, 80,107,197, 44, 87, 88, 56,158, 92, 81, 27,168,211, 37, 62, +131,239,151, 82,247,198,202,129,222, 51,157,231,202,121, 71,148,174, 92,139,151, 49, 83, 76,177, 4,247,220,118,196, 85,124,150, + 81, 3, 95,174,209,119,211,100,103, 99,247, 34,184,104,200, 6, 3,248, 80, 10,152,186, 77,239,252,224,246,131,111,103, 95,239, +116,247,131, 36,104,202,206,112, 62, 28,199,139,101, 86, 88,236,135,106, 75, 97, 73,216, 37, 43,191, 77, 41, 76,215,176, 2, 77, +124, 57,254,239,100,216,255,121, 49,246,113, 74,138,220,178, 29,207,179, 41, 39,128, 98,163, 13,194,197,199,227,179, 73, 88,158, +142, 86,253,128,229,190,210, 34, 92, 1, 32,147, 82, 15,158, 27, 25, 8, 32,101,146,148,254,101, 49,186,200, 79,122,233, 48,136, + 88,185, 69, 89, 55,160,216, 53,117, 10,196,188,233,122,148,170,185,162, 52, 88,100,163, 84, 59, 73,219,114,109,236,187, 86,186, +162, 66,235,149, 1, 3, 27,100, 97,188, 96,106,224, 40, 81,218, 51, 48,126, 89, 42, 75,135,156, 39,203,234,159, 38, 13,167,242, + 14,169, 27, 71,165,215, 74, 47, 33,117,135,206,240, 36, 28, 93,197,177,166,228, 8,216,101, 27, 88,102,185,198,211,213,134, 82, +243, 15, 98, 95, 87,122,191, 2, 35, 35,129, 43,120,157, 26,166, 56, 93,244,167,189, 5, 21,137, 80, 70, 95,165,249,106,153,166, +144,147,213,106,105, 71, 28,190, 28, 3,167,178,246, 18, 6,115, 88, 74,195,162,134,128,201,116,248, 76, 77,230,115, 93,201,101, +183,221, 86,180, 8,197,111, 13, 41, 76, 11, 49,253,212,173,195,189,135, 99,127,228, 57,120, 22, 37,139, 20,234,186,185,204,146, +105, 48, 82,248, 78,173, 90, 54, 96, 33,193,130, 51,236, 5,197, 83,214,219, 27, 59, 49, 20,241, 52, 69,222,128,112,152,192,140, + 14,254, 30,165,120,120,107,255,242,244, 61,117,196,159, 98,209, 96,193,185,199, 45,239,197,179, 39,218,124, 46,238, 31,136,187, +119, 69,146,137, 69,138,250, 61,201,146,217,200,159, 12, 50,181,169, 44, 86,149,164, 31, 48, 15,166,213,104,203,178,176, 41,177, +223,108,183,132, 54,238, 77,199, 81,248,200,240, 61, 81, 60, 94,215,254,188, 89, 62,109,225, 51,245, 22,226,251, 68,188,124,254, +250,240,239,191, 4,116, 53, 36,106, 1, 83,171,190, 84,241,174,163,224, 20,142, 81,204, 38,227, 15,239,174,239,111,137,110, 27, + 9,128, 37, 97,163,147,233,251,227,115,163,118,184, 46, 89, 77,111, 5,197,139,152,201, 58, 21, 96,154, 14,120,154,101,155,173, + 77,186, 91, 93, 73, 37,135, 57,143,231,255, 14, 78,163, 36,166,234,123, 28,205, 94, 29,189,236, 79,251,235, 78,115,179,189,117, + 25, 78,194,120, 49,152,156, 83,218,166,216,179,133,236,157,253, 16, 92, 72,217,210,189,183,245, 7, 61,184, 55,159,223,126,239, +253, 51,230, 57,219, 94,119,119, 26, 78, 29,214, 60,167, 22, 33, 78,227,163,123, 71, 20, 45, 25, 40,147,136, 28,144,127, 25, 95, +171,104,208, 60,211, 42,110,117,118, 47,163,153,170, 23, 91,141,107, 41, 20, 50,168,145,101, 78, 40,252, 89,168,232, 14, 33, 30, + 9,167, 52,252,234,186, 67, 25, 83, 7,107,167,230,118,183,156, 78, 10, 26,115,205,249, 16, 98,163,217,133,177, 21, 58, 96, 81, + 84,192,153,242,127,222, 26, 20,129,174,217, 0,233,165,178,177,188,226,124, 84,155, 28,237,247,146,245, 10, 60,163,160,199,106, +202, 45,126, 9,192,214,181,244, 54,141, 69,225,123, 83, 59,126,197, 78,220,180,169, 26,160,180,138,102, 42, 4,133, 82, 24,170, + 1,118, 12,127,128, 13, 59,196,111, 64,104,126,199, 44,248, 55, 8,196,106,182,140, 70, 3, 44, 96,102,104,105,135, 52,113, 99, + 59,126,219,177, 61,231,156,155,240, 18, 82,213, 69,164,214,143,156,231, 61,223,247, 29,193, 95,173, 13,197,236,183,251,182,177, + 12, 97, 11, 9,223, 92,130,248, 46, 70,147, 72, 66, 38, 73, 88, 85, 70,225,198, 6,122,148, 66,180, 61,132,134, 16, 30,134, 19, + 20,189,152,166,158,192, 5, 87, 2, 16, 65, 81,254,220,202,166, 31, 79,192,166,225,207,161, 22, 22,107,136,161, 6, 90,235,172, +131,195, 19, 57, 22,233,160, 16,254, 16,168,143,157, 1, 87,155,218,141,193,205, 15,167, 7,159,206, 54, 63, 9,176,241, 57, 29, + 25, 13, 68, 66,181,101,190,172,219,170, 98,172, 88,171, 8,200, 33,149,190,205,213, 65,140,162,178,124,205, 94, 15,209,235,176, + 54, 7,231, 39, 98,232, 92,198,169,165, 91,126,232,237,110,237,193,205,159,233,110, 12,221,143, 34,154, 95,222,186,250,126,244, + 55, 60,215,206,249, 43, 31,241,195,162,141, 50, 35, 89,141,231, 25,133, 23, 77, 36, 73, 54,117, 43,133, 84, 81, 49,203,176, 75, +242,151,237,179,151, 92, 26,186,138,252,222, 49,187, 67,255,152,228, 86,106,177,114, 69, 87,245,188, 44,192,224,160,232,248,105, +112,227,225,221, 7,207,254,124, 6, 95, 4,132, 89, 48,133,172,204,169, 24, 33,224,189, 36,247,172,181,172, 44,154,141, 38, 84, +160,233, 12, 17, 93, 39, 81,156,196,149, 31,151, 65,196,194,176,142,162, 58,205, 33,244,214, 73,134,188,237, 70,205,157,105, 8, +174,208, 91,214,236,182, 97, 65, 63,165,170, 16, 24, 13, 85,150, 81, 94, 7,155, 44, 77, 70, 45,140, 13, 11,174, 21, 67,106, 73, + 98,217, 13, 10, 39,152, 58,110, 60,156, 68, 71, 99,255,104, 28, 28,141,166,135, 35,255, 96, 28, 28, 79,252, 48,205,161,204, 65, +180, 30, 46,151,226, 34, 77, 83, 29, 63, 35, 82, 15, 78, 20, 73,129,150,151,141,185, 66, 57,220,231,138,209, 67, 37, 38,180,176, + 37, 48,247,172,204,108,163,155, 19,217, 88, 28, 52, 35, 36,191, 44,126,189,247,248,213,251,215, 53, 77,212,113,227, 27,201,171, + 66, 13, 53,171,178,110,171, 39, 75, 18,180,231, 80, 46, 52,155, 10,148,186,224,135,186,210, 74,103,113, 91,237,128, 19, 66, 5, +219, 82,205, 12,129, 55,140,196,111,177,197, 71,210,118,226,214, 98,162,194,150, 36, 20,207, 82,160,212,133,223, 61,187,223,209, + 59,184, 66, 96, 86,164, 69, 98,183, 58,112, 57, 76, 3, 40,172,216, 4, 63, 7, 3, 94, 49, 87,145,160, 87, 87,170,164, 19, 22, +174,218,217,184,118, 58, 29, 43,184,195, 78,131,208,172, 41,154, 31,185, 59,155, 87,161,117,211, 85,220, 51, 62, 23,204, 17,143, +142,168,176,148,125,169,219,206,231, 40, 3,120,103, 78,224, 16,112, 26,242,127, 78,128, 81, 78, 63, 56, 61,133,231,162, 25, 79, + 41, 40,233,144,117,118, 55,246,188,112, 34, 74, 69,162, 77, 37,240,237, 10, 69, 73,170,137,169,237, 37,117,107,232, 82,110, 95, +216, 15,254,121, 14,241,239,119,204, 44, 24,223,239, 15,250,183,126,190,196,138,156, 93,187,194, 44, 27, 15,103,162,156,197, 25, +131,215, 55,250, 47,244, 70, 51, 26, 20,147,192,195, 66,143,190, 42, 21,195,226, 75,112, 43,136, 93,101,103,186,253,180,120, 59, + 12,228,204,189,219,202, 46,183,234,139, 22, 78,207,255, 77,235,191, 28,214,110,247, 30,253,246,132, 13,214, 49,190, 55,228,239, +104,209, 74, 36, 32,168,200,147,167, 47,212,108,172, 95,220,100,182,134, 31,210, 86,223,248,205,232,143, 35,143,118,142,163,114, +254,130, 9, 42, 70,156, 92, 40,119,209, 65, 4, 51,181,214,105,236, 37, 89,156, 23, 5,228,117, 48, 3, 60,157,107,106, 29,211, +118, 60, 7,186, 80, 20,103,169,102, 39,238, 9,195, 3, 43,232, 29,248,216,119,126,217,187,243,242,221,203,237,179, 63,238,111, +239, 31,142, 62, 88,186, 57, 60, 61,113, 67, 15,254,195,245, 31,174, 67,253, 14,151, 88, 95, 62, 7, 13, 55, 54,139, 53, 11,146, + 41,188, 16, 60, 77,197,254,156, 17,129,174,134,102,194,208,173, 10, 35, 27, 66,170, 80,254,154,215, 26,130, 47,194,249, 2,142, +122,190,201, 0, 10, 89, 93,181, 76, 20,204,137,224, 17,112,196, 66, 34, 81, 96, 20,105,150, 52,144,213, 46, 38, 61, 24, 4, 82, +164, 85,243, 47, 54,223, 65, 57,149,162,112,205, 98, 13, 33, 24, 3,205,252,202,111,224, 48, 69,133, 91, 90, 22, 11, 97,248, 98, + 33, 54,255, 42,196,127, 86,104,154, 67,187,248, 66,130,230,127, 1,232,186,150,221,182,141, 40, 58, 20,103, 40,137, 50, 69, 91, + 15, 68,138, 29,217,174,225, 42, 72,155,164,137, 3,196,105, 23, 65, 17, 4, 72, 22, 94,100,149, 69,127,165,232,190,127,208, 95, + 40,208, 31,232,174,139,110,186,107, 19, 7,105,129,218,141,101, 87,178,104, 89,178, 30, 38, 41, 62,115,207, 12,229, 6, 8,250, + 1,182, 52,163, 59,119,206,189,115,238, 57,217,252, 42, 67,221, 29, 81, 44,214,172,154,148, 22,231,178,205,141, 54,117, 81,148, + 32,227,165,233,215, 43,173, 41,101,112,169, 1, 34,116,177, 92,170,192,114, 76,208, 25, 40, 72, 5,109,221, 52, 74, 74, 73, 89, +232, 16,154,126,249,248,155,253,163, 87,116,126, 8, 94, 61,252,244, 81,119,112,146,117,242,117, 10,128,194,249,204, 9,160,140, +139,255, 16,169,129,148,156, 94, 46,218, 30, 60,148,231,224,191,167, 11,161, 2, 45, 19, 92, 86,188, 84,138,208,189, 71, 47,250, +195,158,212,136,215,104,227,232,151,144,133,109,180, 90, 89, 19,194,232, 12,222,169,206,166,108,124, 39, 25, 36,147,212,143,204, +148, 29,166, 28, 46,125, 80,119,212,243,163,249, 97,255,240,179,214,109,103,210, 15,226,120,120, 57, 42, 35, 73,218,206,216,161, +168, 50,243,150,109,218, 23,144,135, 77,107,229,134,212,137, 76,231,177,151, 74, 99,230,198,114,211, 11, 93, 31, 79,155, 17,193, + 82,112, 99, 98,232,151,250,115,151,128,187,101, 46,231,193,197,246,233,114, 94,173, 52, 8,140, 56,163, 62,173,241,201,221,167, + 63,254,250, 83,217, 44,111,214, 55,233,168, 82, 42,167, 96,106, 85, 55,208,186,145,142,142,157,193,129, 23,248, 19,127, 68,247, + 22,109,133, 85,180, 2,238,163, 90,210, 83,193,177,176, 16,226, 59,105, 16,194,120,143,234, 92, 74,223, 66,240,186, 85, 50, 12, + 97, 26,198, 10, 97,158,130,110, 20,121, 89, 26,108,150,132, 70,201, 29,142, 63, 60, 87,208, 4, 6,242,169, 44, 69,139,160,236, + 75, 1, 72,104, 3,164, 82,127, 33, 81,197, 37, 37, 20, 17, 98,206, 49,185,191,249, 85,231,236,232,138, 48, 44,152, 40,155, 43, +202,255, 76,109, 38,197, 6,229,139,162, 32,136, 13,179, 58, 25,232, 9,109,154,114,247,150, 67,161,116,201, 37, 60,199,183,155, +183, 8,188,211, 5,143,217, 99, 38,254,234,190,229, 56,150,138,226,202,232, 38,131, 85, 0, 38,182,131, 32,156,223,105,221,155, +184, 19,213, 30,165,239, 68, 69, 21, 85, 12,243,200,149, 39, 48,206,243, 2, 12, 25,226,152, 45, 98, 2,173,191, 68, 77,148, 96, + 29,112,164, 73,195,246,106,187, 59, 60,113,189,201,216,191,104, 84, 86,115,192, 74,152,220,164,149, 80, 13,110, 10,211,139,188, + 80,246,217,233, 30,162,197,223, 89,223,161,139,129, 16, 52,125,129,254,248, 20, 50,141,194,160,180, 67,224,206,197, 40, 99,220, + 31,245, 64,140,193, 51, 26,142, 6,108, 70, 82,128,158, 37,180, 92, 32, 52,198, 33,205,171,103, 52,182,140,102,169, 75,155, 49, +240,235, 11,249, 34,229,124,211, 88,202, 30,162, 53,170, 80,253,170, 85, 87, 85,172,108, 58,165,206,244, 84,122,146,200,151, 37, + 40,245, 50, 14,228,142, 94,214,138, 89, 13, 98,143,115,102,208,145, 52,236, 56,242,191,254,252,203, 81,239,117, 91,155,254, 19, +241,227,128, 21, 88,250,221,110,123,109,187,197,150, 76,118,127, 7, 73,128,192, 59,146, 59,161,248,203,201,191,135,174,123,201, + 22, 86, 58,160, 66,164, 74,111, 24, 45,105, 81,178,115, 73, 82,164, 13,109,218, 70,195,182, 6,254,239,195,249,244, 98, 92, 96, +236,240, 50,249,123, 22,237,159, 17, 94, 53,191,253,254, 7,115,239,137,236,101,243,255,153,135,199, 79, 26,254,241,166,251,203, +207, 55,238,125,194, 54,107,204, 52,112,234, 35, 0,164,243,223,142,247, 7, 51, 29,233, 93,250,204,165,202,207, 37,243,222,163, +173, 94,191,182, 49,195,153, 77, 49, 71,150,102,243,237,202,218, 89,240,252, 86,115,171,119,126, 74,123,179,251,197,227, 92, 28, +191, 61,249,179,106,215,115,114,136,233,194, 29,209, 81,234,156, 29,211,159,159,142,157,131,238, 65,109,165,126, 60,232, 80,172, +234,112, 16, 55, 26, 55,214, 65,161,147,118,138,132,223,149,240, 17, 5,252,243, 7,207, 58,206,145,154, 52,162,207,221,110,222, +156,120,211,225,108, 32, 33,115,124,115,237,246, 96,236,164,146, 32,175,128, 51, 8,241,178,177, 33,245,242,224,103, 7,138, 1, +148,107,240, 64,152, 44,154, 50,234,245, 37,148,238,146,154, 20, 17,202, 26,150,108,225, 43,168, 40, 92,255, 25,236,130, 79,132, + 9,245, 15,244,135, 23, 14,193,120,109,178, 76, 11,166,129, 87,180,200, 43,236,174, 72, 89,139, 65,170,143,178,188,246, 94, 0, +190,174,109, 39,141, 40,138,206, 77, 70, 24, 40, 87, 69, 65, 5,108,140,166,181, 85,211,244,169, 73, 95,154, 52,233, 91, 31,253, +130,254, 68,127,162,175,253,130,246, 43,250, 11, 77, 52,246,197, 43,169, 55, 24, 16, 25, 24,102, 96, 46,167,123,237, 3,244,165, +233,155,145,224, 56, 51,231,236,189,246, 62,123,173, 53,227,175, 98,168, 96, 76, 64,141, 22, 55,148,108,195,185,120, 72, 44,189, +143,173,133, 52, 45, 58,207,119,105,185,210, 3,133,136, 62, 33, 72, 10,109, 34, 68, 56,136,124,166,144,115, 94,102,135, 29,218, +156, 39,205, 99,250,129, 39,177, 20,187,127,135,193,249,157,183,157, 65, 43,150,108,127,246,117, 98, 17,134, 9, 15,186,129, 92, + 96, 26, 24, 76,228,115, 81,117,175,126,208,117,187,138,152, 27,223,160,220,166,196,176,156,171,254,106, 30, 13, 71, 67, 67,103, + 5, 12,190,240, 90,161, 54, 66,135, 61,126,245,244,117,202, 72,246, 64,111,163, 20, 99, 48,255, 88, 72, 89, 55,101, 38, 72, 26, + 11,166,218,178,253, 94,200, 51, 90,244, 82,253, 96,178,146,171,116,135, 29,156,156, 70, 99,199,115,232, 47, 80, 64,183,251,109, +169, 98,134,224, 37,105, 14, 76,207,205,167,139,246,160, 77,111,241,217,198,238,126,125,255,244,254,244,253,193,135,243,219, 51, + 66,172, 92,136,136,245, 98, 21, 43,207,237,209, 91,161,218,208, 25, 13,182, 42, 56, 79, 62,105, 30, 57, 94,159,109,108,141,174, +211,166, 76, 83, 72, 23,203,249, 50,221,139, 61,176,151,178, 21,140,223, 16,118,208, 98,202,151,126, 68, 49,200, 21,134, 8,112, +186,169,134,172,124,207,208, 89,161, 16, 15,138, 39, 70,234,249, 73, 42, 6, 70, 75,132,158, 36, 64,147, 50, 52, 83, 79,128,162, + 45, 12, 30,162, 38,144,188,160, 9, 51,178,124,129,174, 81, 16, 69,158,239, 49,143, 29,240, 49,111, 85,169,198, 66, 93,138,182, + 84,152, 50,224, 41, 76,159,253,238, 92, 69,241,116, 24,138,150, 17, 90,236, 17,251,171, 48,247, 34,189,248,196, 99,163, 28, 41, +208,134,112,159, 72,229,172,220,208,235,195,181, 18, 13,110,169, 62, 1, 90, 50,221,105,210,180,208,156, 81,117,202, 94, 4,129, +209,222,153, 49,136,244,153, 33, 29,235,118, 5, 15,110,199, 11,220,172, 85,144,163,144,180,133,120,111,224,211,124, 42, 71, 41, +153,126, 79,208,131,174, 82,205,173, 81,125, 0,162,118,186, 68, 0, 74,135,247, 30,213,154, 1,168, 60, 17,236, 55, 19,172, 17, + 79,251, 60,149, 72,161,192,215,112, 0,224,194,152, 5,244, 11,250,151, 22, 32,137, 14,121,106,194,248,182,115,207,163,120,232, +115,211,109, 66,119, 1,147,200, 0, 64,245,242,102,125,185, 97, 59, 54,171, 35, 8, 42, 97, 49, 61,197,109, 4, 42,227, 30,135, + 93, 29,135,252, 22,101,125, 22,190,159, 66, 19,161,206,237,177, 85, 57,118,140,179,220, 24,234,152,152,120,139, 66, 66, 18,189, + 97, 55,161, 75, 1, 81,169,156,161, 77, 7,162,161,139,173,201,142, 81, 66, 55,189,201,160,144, 89, 18, 65, 0,143, 73, 45, 84, +197,100,175,190,179,182, 92, 30, 95,254,124, 83,210,138,134,246, 66,139, 63, 29,190, 83,146,105,165,182,162,108,109,163, 45, 51, + 10,248,112,117, 34,122,189,254,237, 37,158, 8, 55,222, 25,188, 11, 77, 18,246,241, 38,131, 69, 43, 99, 36,146,137, 56, 54, 12, + 93, 89, 47,149, 86,243, 57, 39, 56,238, 71,205,246, 99,203,139,206,156,176,209,120,249,249,203,215,236,225, 71,206,220,250,255, + 92,131,174,111, 78,191,125,175, 52,114,230,126, 3, 99, 57,166, 46,213, 53, 21,127,124,253,163,121,238,122, 26,155,249,178,252, + 7,246, 36,138, 75, 51, 21, 18,248,101,163,143,136,109,179,101,124, 64,115,132,121,254,141,114,227,230,225,110,179, 92,187,108, + 53,233, 75, 39, 23,199, 55,157,219,231,181, 93,250, 22, 61, 34,170,123, 54,150,106,125,247, 97,128, 51,246, 60,196,136, 68, 76, + 48,156, 82, 41, 52,178,160,195,172,150,168, 74,118, 71, 23,173,115,217,125,221, 90,221,166,180,157, 77,102, 47, 90, 87, 32,160, +242,101, 12,195,164,200,238, 50, 25,141, 98, 10,149,119, 84, 64,140,131, 17,228,247,103, 46, 76,172,153, 10,204, 40,157,231,100, + 86,150,229,144,212,109,153, 55,198,197, 92,247, 84,104, 66,153,251,104, 99,177,103,204, 12,193, 51,105, 61, 69,203,128, 13,117, +205,244, 98,218, 11,252,127, 59,116,196,202,152, 5, 90,180,191,208,126,174, 0, 34,102, 81, 94,157,169,184, 78,187, 60,146,121, +241, 71, 0,186,174,165, 53,106, 40,140,230, 61,201, 52,153,100, 28, 59,143, 62,166,165, 82,197, 98, 5, 11, 46,132,130,160, 5, +221,213,133,162, 27,151,110, 92,184,240, 23,185,112,237, 31, 16,220,249, 7, 68,138,160, 86,138,117,112,106, 31,147, 73,154, 73, + 50,121,248,157,239,166,182, 27, 97,182, 67, 94,247,126,247,124,143,115, 78, 21,223, 9, 22,112, 43, 82, 41, 43,142, 44,182, 19, +232, 48,138, 46, 84, 59,104, 81,133, 73,192, 60,221,146, 27,134, 20, 92,166, 51,150,195, 14,182, 37, 1, 85, 33, 2,167,170, 70, +155,112, 46,139, 11,214,161,136, 93, 80,216,170,193,167, 27,140,203, 32, 26, 5,177,175,201, 24,110,213, 33, 64,103, 96,208,141, + 82,105,238, 48,152,181, 58,253, 49,207, 43,173,151,161, 63, 20,194,155,231,166, 82, 82,105,234,180, 12, 77, 28, 33, 70,141,194, +172, 1,169,229,130,245, 47, 53,130, 99,113, 18, 31,250, 67, 66,229,255, 76, 77, 84, 56,111,229,166, 89, 79,146, 68, 76,229, 48, +126, 47,116,221,220,186,185, 69, 97,148,114, 52,122, 94, 10, 85, 17, 5, 20,203,166, 3,153,208,159,107, 55, 79, 34,138,239,250, +101,175,187,177,114, 59,147, 50,184, 8,241, 59,164, 84,163,223, 94,166,220,101, 20,209, 90,132,176, 56, 37, 61,180,104,126,143, +134,187,195,111, 57,102,205, 51,149, 94,154,156,209,106,243,156, 22,225, 80,167,102,167,229,116,174, 57, 63, 56,217, 23, 98, 23, + 44,243, 0,162, 44,179,159,192,133, 29,142,135,178,162,157, 78, 48,133, 73, 97,200,182, 28,171,102, 29, 71, 7,220,172,206, 9, +176,178,249, 54,199,161, 66,168, 26, 9, 99, 74, 33, 39,109,180, 28, 76,182, 65, 71,158,213, 26,210, 92, 25, 37,229, 52,145, 19, +186, 48, 68,179,132,184,113,114, 73,162,219,246, 53, 9,154,118,149,199, 15,115, 26, 25,159, 74, 83,225,239, 13,149,109, 76,157, +203,149, 38, 22, 44,112,129,151,179, 76,197,128,125, 46,203, 85,203,200, 80, 13, 72, 69, 42, 48, 36, 19,218,121, 5, 79,149, 80, +186, 70, 40, 97,214,237,194,141, 65,226,234,183,172,206,186,237,241,132, 64,150, 2,129, 14,244, 81,138, 51, 39,118,140, 96, 21, + 85, 83,177,100,193, 72,180, 61,105, 37,160, 8, 35, 84,134,171,193, 53,124, 60, 54, 10, 64, 87, 28,181,222, 34,143,179,136,110, + 35, 99,229, 30,102, 84,149,116,221,149,238,170,144,154,234,120, 61, 66,190, 49,203, 62, 95,235,175,255, 58,220,235, 53, 23,232, +255,243,173, 5, 63, 28, 89, 48,223, 33,156,146,243, 70, 85,233,209, 8, 37, 45,181,151,143,131, 99, 21, 3, 96,134,160,104,208, +254,114,234,141, 0,176,238, 72, 56, 20,226,132,133,124, 74, 86,200, 69,195,242,252,240, 40,225,150, 50, 6, 45,160,102, 97,210, +231,131,242,137, 66, 7,222, 76,215,165, 36, 47,236, 53,231,177,132,152,194,170,114,101,246, 52,137,102,204,250,230,218,230,215, +193,119, 33,110, 64,145,151,109,226,113, 56,181, 27,157,136,157, 63, 85, 30,166,180,107,182,166, 42,113, 26, 42, 34,237,135,219, +135,234,105,246,211,199,207,223,127,120,215,215,226, 91,158, 62,103, 40, 87,183, 31, 98,148,229,250, 21,169,213,161, 83, 81, 74, + 82,252,162, 56,221,223, 13, 71,127, 80,155,201,114,161,237,170,150,108,112,134, 74, 17,218, 87, 48, 23,116, 92,186,150,201,132, + 61,105,177,217,233,120,221, 76, 27,164,146,110,183, 95, 60,121,181,253,242,181,190,182, 42,101, 19, 9,244,210,218,127,131,251, +238,222,151, 55,111, 91, 78,222,188,187, 46, 45,121,146,109,176,135,111, 38, 17,244, 28, 30, 12, 62, 70,123, 73, 64, 64,151,185, +138, 48,111, 33,100, 29,231,169,232, 7,200,152,110,234,113, 56,198,206,165,152,126, 18,250,104, 57,104, 53,255,116,252, 96,227, + 30, 37, 95, 16, 10,100,178,225, 98,107,193,237,247,212, 2, 34, 54,155, 55,238,124,250,241, 25,196,230,188,124,116,255,217,162, +215,217,249,185, 19, 68,227,209,196,167,247, 22,166, 33, 45,153, 16, 54, 59, 42, 5, 80,212,223,131, 35,180,193,203,148, 32, 23, +156, 45, 4,229, 30, 57, 70, 38, 84, 8, 27,117,111,194, 44,182, 41,119,200, 43,189,129,202,205,166,116,172,230, 4, 2, 27, 18, +125, 8, 74, 73,167,211, 12,220, 37, 76, 67,202, 23,236, 74,207,109,136,197,202,165, 88,138, 17, 62, 66,117,160,202,163,159,229, +154,174,131, 74, 99,156,162, 50,153,137, 74, 53, 87,230,138,139,134,171,194, 20,248,162,163,177,124,238,241, 40,159, 73, 25, 85, +158,190,180,245, 42, 56, 95, 86,102,177,127, 5,160,234,250,126,147, 6,163,104, 11, 45,180, 80, 58, 5, 6,204, 73, 98,214, 17, +150,153,232, 52,113,198, 7,125, 52,241, 81, 31, 76,230,191,103,226, 63,224,139,137,111, 62, 26,117,206,232,139,203,182,196,233, +212,233,104, 41,148,150,246, 43,245,158,251, 21,220,246,220,133, 66,251,221,123,238,143,115, 78, 30,223,217,112,114,177,205,153, + 91,165,210, 3, 72, 80,185, 51,131,139,203,169,106,169, 82, 46, 85,185,142, 6,126,167, 12, 73,199, 21, 80, 8,236,124, 13, 35, + 50,205, 8,165,199, 5, 51, 78,107,166, 21, 78, 35, 10, 85,116,189,148,109, 82, 81, 93, 26,132,188,232,167, 31, 6, 64,217,104, +176,164, 84,142, 65, 6, 68, 8,113,173,227,248,188, 79,166,163, 62, 85,155,118, 7,171,241,176,106,195, 29,208, 1,163, 39,135, + 56,194, 5, 4, 99,119,244,206,160,233,131,174, 18,165,161, 18,171, 95, 39,231,117,193, 40, 73, 54, 41,190, 76,188,185,204, 62, + 82,212,254,207,125, 58,180,210, 39, 6, 54, 67,108,240, 53,142, 39, 20,223,127, 15, 79, 45,180,195,210, 83,239,215,225,233,193, +152,114,190, 76, 14,172, 71,113,255,250,131,119,251,111,117,141,119,141,184,149, 8,126, 86,154,182,150,218,117,187,233, 5, 30, +125, 17,130, 36,132, 25, 9,116,199,113, 46, 16, 79,239, 47, 43, 11,170,155,221, 27,110,112,182,221,219,246,198,195,157,251, 59, +223, 7, 39,208,234, 98,237, 44,186,237,219,189, 59,163,192, 15,226,209, 70,119,243,135,123,124,219,185,251, 61,252, 90,198,178, +169,128, 28,171, 46, 73,187,220, 41,148, 69, 45,101,245, 98,214,172,153,245, 90,249, 82,173,100,232, 20, 11,138, 66, 45, 70,179, + 76, 46, 36,210, 37, 26,194, 50, 21, 91,201,211,199,207, 14, 15,143,146, 24,158,147,200, 43, 2, 26,203, 42,171,246, 53,172, 22, +157,144,203,149, 38,100,149,176,220,144, 74,205,138,246,210,149, 81,228, 55, 42,141, 32, 9, 53,116, 69,242, 89,136,196,167, 5, + 14,139,153,178, 24,165, 82, 68,179,228,143, 28,130,196, 79, 0,217,148, 56,141, 96, 17,142, 77, 20, 17, 42,159, 78, 39,244, 18, +218,134, 45, 5, 90,235,232, 81,132,188,152,144, 59,217,193,224,134, 23, 13,232, 63,173,114, 77,114,146,231,228,160, 89,238,121, + 4, 78,145, 20, 92,204,164,242,148, 6,145, 7,132,173,209,100, 20,195, 24, 17,123,128, 65,232, 23,225,214, 27,127,251,115, 36, +233,253,166, 97,186,163,193, 90,219, 49, 74, 38,213,163, 34,205, 53,194, 36,153, 48, 17, 83,236, 5,241,236, 87, 74, 6,166,252, +121,112,130, 78,197, 37, 40, 66,215, 41, 12,216, 21,212, 46,172, 99, 67,117, 80, 84, 80,230,110, 73,188, 77, 52,227,237, 16, 77, + 46,131,161,215,155,176,208, 88,166,195,171,178, 20,197,148,183,210,213,198,170, 44, 46,253,241,208, 50,170,204,154, 81, 87, 27, +221,129,143, 5,161,101,187,221,176,151, 9, 28,240, 76, 91, 72,131, 20,240,188,232,179,160,207,133, 6,232,153,123,114,111,235, +174,115,115,251,229,235, 87,222, 36,109,216,245,245, 39, 15,241, 19,245,251, 74,197,194,218, 12,192,187, 80, 6,127, 38,199, 7, +116, 3,149,230,106, 70,153, 53,153,178, 43,104,166,113,230, 45,106, 44,245, 49, 75,193,108,182,108,157, 78, 61, 29, 8,203,164, + 16,223,232,182,250,154,233, 71,209,241,217, 95,125, 58,187, 28, 23, 10, 83, 58,105, 10,168,170,186,182,160,205,228,127,225,216, +127,253,102,239,197,243, 86, 75,111, 63,186,165,108,180,149,146, 49, 55, 99, 78, 9, 50, 40,159, 14, 62,188, 31, 13,102, 33, 86, + 17,210,212,233,109,117,150,187, 80, 67, 5,171,155, 43, 64,133, 30, 86, 32,248, 80,211,131,243,152,187,206, 10,232,232,164,236, + 30,238, 57, 43,107, 63,220, 95, 32, 6, 98,178, 98,108,175,223,250,248,117,215,243, 93,122,181,252,201,120,163,219,167, 58,155, + 10,232,207, 71, 95,226, 84, 56,237, 53,110, 0, 22,169, 86,182, 77,219,233, 56,110,224, 14,195,209,146, 81, 35, 48,232, 6,158, + 85,134,102,198,230,213,235, 92, 50, 10,120,123,169,138,179,210,163, 26,154,233,153, 5,244, 21,212,180, 84,208, 8,167, 98,190, +146,119,137, 17, 5,196, 44,230,217, 43, 15,249,213,204, 52, 42,244,230,137, 60, 84,254,111,176, 44, 58, 39, 42,211, 27, 67,144, + 69,120, 88,206, 67, 10,122,193, 98,240,193, 19,185, 30, 41, 37,233,193,148,204,196, 57, 86,234, 2,222,206,109,107, 47,168,148, + 93, 80,126, 87,115,149,166, 76, 94, 81, 45,219,132,123,254, 9, 64,213,181, 45, 53, 13, 69,209,147, 75,147, 52, 73, 75, 3,148, +150, 66,111,220,135, 65, 81,199, 25,121,244,209, 87,255, 71, 63,199, 7, 63,194, 87,103,208, 1,102, 0, 31, 68, 46, 34, 3, 21, +180, 52, 77,211, 52,205,165,113,239,125,146, 1,121, 44,116, 38, 45,231,236,203,218,107,175,149,206, 87, 85,213, 32,217,166,132, +152,218, 50, 23,209,129,170,124,130,222,243, 50, 63,229, 37,221,130,198,150,238, 45,155, 41,206,110,212,182,186,131, 63, 61,164, + 52,136, 73,102,213, 6, 77, 55, 33, 30, 41,167,206, 15, 3,136,230, 16,226,137, 21, 65,142, 57,180, 22, 59,161, 77,247,133,217, +122,207,189,135,239, 20,162, 12,138,110, 71, 62,228, 31,184, 3,222,200,165, 26, 77, 32, 27,229,152,192, 7, 8,220, 50, 13, 52, +112,186,165,160, 24,125,132,155,235, 44,166,113,246, 56,165,170,209, 42,147,169, 21,214,107,155,208, 31, 64, 92, 22, 72,186,116, +224,219, 16,188, 98, 78,204,160,243, 2, 79, 91,212,167,248, 94,149, 76,228, 14,180, 9,154, 64,160, 44,239,108,190, 66, 82, 71, + 20,144, 99,101, 46, 66,181, 19,145,219,113, 17, 28, 50, 49,243, 69, 28,154, 65,188, 70,158, 31,174,158, 64, 62,135, 58,124,218, +156,185,236,254,108,204, 44,219, 94, 23, 14,108,142,166, 43, 20, 38, 4, 94,111,106, 42,110,111, 66, 83,233,248,131,155,251,206, + 40,242, 37, 73,130, 20, 82,159,107,186,158, 83,177,106, 85,107, 1,130, 11,116, 6,161, 16, 45,206, 44, 52,102,151,134,225, 96, + 16, 94,139,162,226,184,193,152,148,121, 3,188, 30,233,244,154, 2, 26, 42, 76, 90,166,174,145, 54,153,166,137, 6,146,213, 68, + 65, 17,138,134,164, 43,112,139, 17,105, 13,176,215,136, 15,247,246,136, 33,158, 67,162, 20, 22,115,136, 48, 66, 16,129,115, 6, +215, 6, 69,227,209,225, 79, 80,114, 58,226,230,196, 88, 69, 95,227, 36,193, 5, 13, 58,145, 5, 99,138,216,226,130, 38,107,170, +146, 23, 82,146, 0,110,152, 19,233, 67, 36, 43,118,142,231,176,242,212, 60,230, 12,211, 66,182,204, 36,169,148, 42,186,170, 59, +144,255, 38, 33, 23,171,137,113,181, 89,240, 70, 14,188, 30,112,101,224,132,243, 40, 37, 49,115,173,164,146, 57,225,110, 56,228, +172,141,199,172,100, 90,208,207,210, 20,139, 64,106, 81, 54,242, 6,138, 85,169,208,200,232,163, 96,248,180,249,220, 80,117, 74, +186, 85,114,114,199,147, 9,193,204, 66,169,169,176, 82,154,187,188, 59, 39,240, 71,152, 54,167,249, 50, 42, 7,239, 67, 28, 80, + 60,252, 36,164,102,212, 42,175,192, 99, 67, 96,149,101,244,104,134,242,133,182, 88, 69,158,239,179, 78, 57,197,220, 17,147,140, + 35,108, 90,100,196, 25,114,104,166, 28,167, 14, 6,216, 49, 69, 91,141, 39,219,237,103,174,231, 58, 35, 27,238, 2, 22, 1, 8, + 55,225,199,181,221, 30, 95, 11,243,124, 7, 89, 70,241, 88,203,169, 80, 73,115,125,220,113,232, 37,228, 24, 92, 50,202,136, 98, + 39,147,126,231,230,205,187,247,237,242,202,193,241,217,230,106,189,246,122,155,105, 50,107,181,152,172, 32,242, 62,138,217, 96, +200, 46,190,251,118, 55,145,114,122,121,113, 60,236, 71,112,127, 73, 56, 80,226,254,135,184,109, 5, 53,127,140, 40,141, 10,253, + 70,129, 11,201, 34, 61, 6,170,134, 86,121,179, 58,167, 4,254,183,147,163, 47,251, 95,127,255, 56, 83,236,161,222, 15, 36,199, +103,119, 3,214,237, 51,187, 31, 93, 93,217,159,191, 28,127,248,216, 57,218,221,120,177, 84,126,251,146,181,107,112, 64, 50, 39, + 56, 34, 99,186, 14,251,116,186,123,233,133, 88, 86,176,122,169,222,251,219, 57,191, 58,177,135, 61, 35,111, 66,246,130, 10, 6, + 66, 10, 84,217, 28, 90,230,210,128, 69,221, 26,133, 67,172, 8, 85, 99,125, 97, 13, 18,236,175,187,203,229,218, 26,156, 49, 72, +153,215,208,168,187,189,102,181,121,222,185,104, 55, 86,231, 43,141,130,154, 63,188, 56,180,138,211,240, 91, 8, 23, 61,183,123, +107,223,194,191, 3,254,108,103, 99,103,255,244, 0, 14, 60,244,175,170,162, 65, 17,131,131, 49,198,160,146,131,194,202,192,168, +130, 75,219,240, 22,137, 73, 57, 69, 29, 7,184,198,175,171,166,231,123,216,164,102,160, 75, 76,133, 63,173,226,112, 21, 32, 20, +153, 29,135, 33, 60, 63, 69,161, 36, 3, 73, 30, 45,151,210,231,129,158, 62, 85,204,205,252, 84,137, 36, 18, 39,153, 38, 48,101, + 92,137,100,138,131,255, 29,241, 30, 56, 50,201,131, 32, 65,170,112,156, 73,109,241,229, 41,246, 72,136,155,241, 97,245, 63, 1, +152,186,178,158, 38,194, 40, 58, 91,167,211, 14, 67,167, 51, 85, 42, 22,161, 46,136, 60,184, 5, 9,241,205, 23, 31,141,137,137, + 62, 24,127,168,207,174, 65, 73,124,209,132,168, 21, 23,192,130, 80,102,161,179, 79,189,231,126,131,248, 10, 9, 19,102,190,239, +220,237,220,115, 42,253,247,146,249,149, 19,110,207, 21,101,213,162,207,133, 58, 54,171,158,210, 49,165, 55, 66, 16,230, 88, 29, +122, 95, 17,197,204,104, 68, 23, 62, 41,210, 51,214, 12,225,126,157, 53,223,121,190,138, 39, 47,207,221,236,185,125,138,144,216, +145, 71, 60, 56,123, 97,102,225, 96,180,207,126, 42, 74,107,202, 9,227,163, 32, 14,232,246, 26,186, 1, 5,116, 69, 29,167,216, +252,246,199, 30,123,243,136, 72,132,134, 59,180, 42,243,136,183,141, 48,251, 98, 85,224,140, 89,240, 38,157, 12,130, 81,138,174, +130, 96, 40,114,206, 40,137,134,254,208, 7,213, 18,139,127,176,121, 66, 79, 77,169,118,230,133, 27, 38,166,113, 42,211, 9, 50, +250,158,216, 24,150,149, 2,159, 42,222,252,181,185,231, 13,233,107, 81,197, 36, 24, 78,194,135,185,219,238,221,186,180, 58,244, +118,254, 4,135,174,233, 22, 66, 37, 89,130, 97,147, 80, 25, 37,160,196,218,154, 92,106, 26, 26, 20, 20, 63, 8, 5, 90,166,253, + 96,237,225,224,247, 32, 76, 60, 96,159,162,210,179, 40, 11,167, 67, 70,213, 15, 74,254, 50,111,214,205,122,189, 1,161,140, 12, +252, 95, 8,167, 40, 24, 64,209,171,248, 52,124, 47,201,154,109, 25,178,146,129,255, 9,196, 41, 40,121, 2, 87, 82,102,239, 55, +196,205,114,214,182, 36,204,235,100,104, 98,151, 74, 92, 72,152, 0,148, 74,150, 76,130,113,150, 51,184, 19, 48, 54, 36, 93,213, +106,184, 98,232,128, 34,213,116,173, 51,127,188,253,243,206, 28, 93,164, 44, 77,111, 95, 90,219, 25,109, 83,230,194,125,173,106, + 92, 36, 20,237, 84,206, 13,232, 61,211, 17,111, 81,234, 93, 36, 81, 54,134,124, 88,145,245,187,139,182,217,142,227,152, 5, 90, +101,166,142,233,130,250,173, 48,135,114,169,183, 28, 70, 30,197,114, 56, 97,113, 71, 91, 88, 45,179,112,203,132,138, 57,199,116, + 3,202,110, 8,193,107, 80, 72, 44, 88,164, 19,162,162, 85,112,172,206, 57,218, 68,220,156, 17,108,168,233, 70,139, 46, 3, 85, + 21, 83, 13, 27,146,244, 58,149,137, 49,152, 51,138,174,107, 26, 33, 56, 29, 27,168, 77,113, 83, 5, 66,120,160,223,200,231,236, +238,246,193, 47,110,166,226,143, 71, 44, 65, 37, 79, 78,117,197, 78, 20,225,185, 58,146, 74,163,214,160,147,153, 78, 82,122,249, +132,197, 77,189,217,235, 92,240,162, 67, 89,232, 10,242,249, 16, 82,227, 60,119,149,132,189, 39,247,165, 84,118,178,174, 33,177, + 80,176,187,165,242,245,222,247,135,224,114, 72, 37,197,167, 56,141,133,233,154, 90,249,204, 85,250,200, 96, 82,230, 88,122,164, +223,250,104, 33,130,126, 68, 8,104, 32,244,166,101, 25,105,138, 92,215,117, 63, 24,221,182,186,189,103,143,239, 46,174,205, 94, +239, 72,141, 76,154, 50, 32, 40, 86, 51,168, 20,197,250,232,247,175,147,221,239, 4, 64,116,146, 19,239, 48,143, 67,177,106, 35, + 40,153,208,157, 6,186,195,128,152,226,133, 92, 36,148, 65,233,141, 41, 73, 88, 96, 27, 42,116, 11,102,157,206,213,185,229, 43, + 11,253,142, 85, 38,225,206,246,151,207, 31, 55, 6, 27,239, 54,223,188,250,185,177,254,227,245,139,173,183, 47,143,247,190,245, +175,205, 44, 61, 90,107,220,191, 41, 89,142,132, 45, 87,229,164, 19,144, 75, 84, 47,110,109,142,158,251,235, 71,161,206,229,167, + 23, 7, 17,250, 87,148,145, 24, 20, 92, 15,131, 35,130,154, 48, 30,159, 16,161,171,213,126, 85,211, 98, 54, 59,164,138,199,157, +118,135,222,239,227, 52,170,171,122, 16,133,148, 63, 57,150,221, 54, 29,250,191,188, 99,127,239,104, 63,142,198, 79,239, 61,233, +117,122,187, 7,208, 25,116, 44,247,206,229,149,249,238,130, 99, 58,131,225, 96,117,113,101,227,235,135, 27, 23,175,239,142,118, + 41,192,183,173, 54, 21,232,152, 30,201, 72, 32, 48,169,171,213,155,181,102, 16,135, 19, 86,163, 99,232, 45,216,234,170, 60,213, +214,226, 33, 19, 3,167,248, 73, 89,229,243,204,129,134, 85, 9, 32, 6,243,137, 10,226, 43, 45, 35,137,170, 49,219, 36, 52,240, +255,153,113, 73,255,104,238,149,206, 0, 87,166,120,104, 46, 79,148, 19,115,132,255,179,120,249,148, 25, 83, 41, 5,171,148,211, +228,101, 50,223,233, 19, 20, 79, 27,173,148,221,234, 69,179,134, 80,209,182,220, 40, 25,255, 21,128,171,171,233,109,219, 10,130, + 79,252, 18, 69, 74, 52, 45, 89,142, 34,217,113, 98,203,106, 13, 36, 65, 16,167, 77,123, 42,122, 14, 10,244,212,191, 88,160,191, +160,233,177,151, 22, 1,114,232,173,177, 17, 20,181, 98, 39,134,252, 77, 83,226,151,200,206,236,147,140,160,128,111, 50, 40,145, +143,111,119,118,223,206,204, 34,190,147, 81, 94,101,194,181,209, 93, 26, 85, 55, 93, 65,120,165,239,249,210, 20, 99,212,199,253, +183,220,128, 90,166,170, 76, 17, 25,107, 86, 94,102,219,189, 93,128, 80,146,102,152, 27, 22,210,153,147,235,211,235,248, 18,152, +151,196,147, 42, 7,224, 58,158,140,229,110,184, 37,200,209,146,118,182, 67,140,236,102,121, 70,217, 41,114,217, 43,173, 24, 86, + 9, 79,215,107,248,248, 10,228,210,106,121, 4,183,124,106,216, 42,182,107,201,252, 92,137,141,103, 0,179, 3,135, 96,177,183, +186, 15, 16, 64, 43,162, 90, 83,134, 53, 17,178, 83,203,116,180,225,207, 92, 76, 38, 77,145,159, 46,217,243,146,202,218,100, 47, + 85, 79,183, 33, 94,222,107,247,137,178, 57,250,205,117, 86, 11,151, 91,117, 21, 95,140,207,142, 50,177, 97,147,161,157,164,217, + 32,139, 26,171,130,205,187,218,108, 3,107,115,120,166,152,213, 41,215,147,240,186,166,137, 87,228,221,248,239,126,123,176,219, +255,242,227,229,201,138, 23, 80,170,180, 30, 80, 22,223,198,235, 59, 67,196,188,205,162,176,217, 70,104,155, 68,231, 47, 71,223, + 4,173,224, 98,138,240, 81,109,172,111,204,106, 31, 92,199,234,132,245,210,204,168, 95, 46,226, 60, 34,130,169,202,106,161,108, + 62, 75,202,123,129,103, 57, 86,131,134,174,196,238, 57,146, 68, 89, 9,157,191,198,224, 46,134,191,142,165, 26,149,103,213,156, +148,126,167, 50,142,102, 88,211, 36,142,179, 40,154, 69, 36, 7, 85,156,252,137,211, 41, 46,178,210, 88, 77,138, 84, 23, 46,247, + 87, 7, 83,161,159, 96,165,218,173, 46,158,219, 52,139, 1,222, 91,110, 40,146,120,234, 42,186,184,140,207,155, 94,200,240,106, +187, 94,189,149,229, 51, 20,127,168,139,191, 24,236, 29,159,253,123,113, 51, 9,253, 53,252, 12, 45,102,175, 15, 9, 76,211, 70, +126,242,157, 6, 86,132,121,148, 22,201, 72,200, 54,135,157, 10, 22,144,131,206,166,248,243,177, 47,101,137,247,115,154, 3,145, +150,205,122,192,134, 24, 73, 85, 41, 77,235, 68, 11, 28,123, 50,240, 87, 16,241,119,238,143,254, 57, 61, 88, 11,214,145, 59,108, + 78,229,250,184, 38, 79, 46, 84,181,214,236,142, 54,247, 44,195,185,141, 35,241,191,160, 96, 17,150,175,223,222,152,146,156, 50, +221,236,108,161,156,231,105,191, 46,100, 89, 71,240, 39,107,106,174,109,152,156,218,180,237,243,155,179,185, 8, 75,177,139,210, +236,220,208,183, 64, 9, 95, 90,252, 62, 13,171,169, 67,100, 89,234,198,143, 73,209, 40,167,148,241, 77, 30, 71, 89, 20,173,141, + 18,220,154,177,217,221,122,177,179,127, 52, 57, 50, 52,157, 74,213,144,230, 1,232,109, 82, 74, 3,108, 64,223,241,112, 53, 4, + 50,212, 13, 41,189,141, 82, 81, 21,197,187, 69, 57, 0,196,241,147,195,195,253,112,221, 90,235,168,230, 88, 25, 5, 74, 27,229, + 35,143,123,236,207,140,199,234,232, 80, 37, 51, 30,203,243,153,230, 65,239, 33, 91, 5,121, 42,157,119,165,135, 53, 25,223, 57, + 6,207, 16,111, 0,111,121, 94,205, 23, 81,120,202,242, 89,202,179, 84,216, 80, 15, 66,119,212,239, 61,223,121,244,124,184,251, +228,225,240,233, 96,251,241, 96,235,217,198,163,111,135,219,175,246, 7, 63,190,244,190,122,170,186, 61, 5, 8,193,222, 67,181, +236, 63,211,206, 75, 29,143,213,239, 7,127,252,165,174, 84,234, 91, 30,205,165,132, 74,138, 91,163,146, 79,195, 47,105,124,152, +170,197, 72, 75,169, 25,134, 69,173,204,242,188, 18, 50,217,188, 70, 37,168,172, 88, 48,210, 91, 94,128, 63,224,194, 86, 16,190, + 63,125,191,211, 27,226, 29, 7, 24,250,245,237,235,227,179,143,251,123, 95, 31,124, 56, 0,210,191, 78,226, 55,239,254,140,166, +183, 63,188,250,233,151,223,126, 30, 13,134, 39,231,159,196,246,118,142,122, 49, 74,167, 41,253, 23,233,189,174,199, 96,190,123, +252,253,233, 21,254, 33, 67, 10,159,243,128,208,193, 99, 41,164,214,212,242, 56, 38,213,129,138,255,207,168, 47,117,122,177,166, +235, 65,239, 82,228,140,140,207,108,202,240, 49,170,216, 72,228, 63,239,220,187, 42,146,129, 66, 29,118,238, 52,232, 62, 51, 50, + 93,120, 55,169,187,144,190,212,231, 53, 23, 19,184, 68, 90,174,225, 38, 5, 82,229,141,254,168,162,191,158,102,175, 18, 79,212, + 45, 27,209,233, 63, 1,184,186,146,221, 38,130, 40,216,227,158,125,188, 36,182, 65,113, 54, 2,138, 20, 36, 32, 98, 59,112,228, +130, 64,226,163, 57,193,129, 59, 7, 22, 37,144, 96, 34,103,177,163,120,198,158,241,108, 84,189,182, 1, 33,249,224,131, 29,103, +122,222,188, 87,175, 95,117,213, 42,191,171, 6, 64,220, 86,247, 78,194,218,152,139,234,158, 39,204,153,138, 68,186,124, 38,146, + 65,148,232,146, 61,235,146,228,135,170,242,208,200,228, 41,154, 26, 32, 66,211,100,153,230,194,216,138, 85, 82,202,208,116, 0, +235, 5, 78, 68, 23, 36,153,154,215, 43,103, 54,161,199, 89,158,141,140,224, 77,179,155, 63,106,124,162,191, 80,136,194, 95, 11, + 69,143, 38, 59,134, 86,185, 60,224, 42,170,177, 21, 37, 35, 68,173,197,151,205,138,210,196,197,193, 38,160, 98,156,202,216,196, + 90,233,246,209,156,193,178,241,107,187,189,189,201,108, 66,146,128,165, 68,197,155, 66,240,165, 48,237, 12, 73, 6, 15, 33,114, + 25,153,242,170,126,253,244,117, 95,196,220, 27,202, 54,114, 94, 64,187,154,170,142,128, 53,253, 89,158, 96, 89, 10,250,184, 38, +192, 60, 73, 46,236, 26,233,208,144, 25,219,193,122,178,136,125,161, 15,137,115, 72,117,116,113,132, 11, 6, 90, 1,168,231,118, + 4, 5, 79,200,147,219, 31, 28, 32, 37, 13,199,167,200,242,136, 42,212,185,179,235, 33,194,183, 84,197,104, 6,148,151, 35,161, + 4,174, 51,225, 17, 39,182, 9,139,138,180,247,116, 1,116, 92, 45,128, 42,105,187, 91, 14,144,217, 60, 39, 10,180,239, 41,186, +118,240, 80, 72,213, 12,116, 39,106,224,105,245, 29, 43,116,149,239,171, 70,230, 38,121,204,180, 83, 89, 89,153,201,166, 99,161, +149,107, 56, 33,136, 96, 20, 66, 78, 11, 26, 86, 42, 76, 80, 78, 29, 69, 95, 9,235, 41,180,105,110, 55,181,194, 53,148,231,166, +219,156, 34, 21,210, 26,137,252,108,205,177, 74, 32,186, 52, 30,138,217, 90,180,134,219,141,200, 67,225,103, 74,211, 78, 66, 65, +237, 90, 44,165,108,223,166,139,158, 71,146,213, 92,172,254,114, 51,183, 92,242,196, 56,124,174,163,176,221, 69,242, 85,117, 70, +145, 25, 33,113, 54,212,203, 7,175,102, 89, 60,157, 93,135,126,196,222, 73,209, 71,136,193,206, 85, 46, 59, 97, 55,206,110, 46, +167, 87,172, 73,189,109,164,212,189,193,254,217,248,196,230,116, 4,215, 92,163, 30,175, 71,235, 31, 63,191, 7,242, 69,217,211, + 75,239,212,154, 12, 22,219,222, 28,108,191,121,248,202,119,221,147,203,211,167,119,159, 39, 25,199, 66, 34,167, 83,155,110, 70, +220,232,116,224, 69,241,124, 42, 86,155,245, 78,127,247, 42,190,148, 51,122,212,159,194, 7, 68,203,154,135, 31, 61, 10, 91, 34, +149, 27,147,207,133,177,146, 48,158,239,210,209,167, 17, 79, 72,241,220,195,241,249,177, 72,235, 88, 27,157,141,138, 82,136,137, +168,212, 42, 9,232, 18,223,197,106, 3,226, 80,253,131,197,204, 88, 25,240,151,180,163,125,215, 74,235,249,249,209,183,251,237, +142,115, 32, 15, 28,114, 49, 48,204, 60, 83, 63, 79,212,201,177,154, 78, 17, 49,140,145, 34, 71, 1, 9,251,155,101,154,148,232, +171,164,225,181, 45, 65,238,248,107, 14,119,101, 93, 13, 76, 80,232, 50,213,158,175,154,109,212,183,229,203, 21, 65, 16,215, 97, +229,232,182,213,224,150,218, 25, 52,246,118,244,238,182, 53,216, 82,157,158,210, 45,193,236,122,181, 51, 44,238, 38,124,229,106, + 52, 84, 95, 62,149, 31, 22,239,206,208, 36, 21,109,114,174,230,184,148, 60, 47, 2, 63, 68, 2,138,179,164, 29, 52, 1,183,241, +160, 53,195,102,175,213,199,155,141,238,214, 44,157,209,179,211,226, 62,106,228, 70,184,179, 40,225,136, 22, 52,196,227,120,140, +197, 7,216, 10, 91, 29,252,127,227,235,139,183, 47,222,242,252, 68, 93,198,243,228,112,255,241,143,209,247,172, 88, 52, 1, 76, + 23,115, 84,202,209,112,216,235,220,126,116,247,240,215,120,136,136, 65,204,227, 99, 40, 15, 81, 16,226,205, 90,212,101,210,183, +234,175,191,190,224,166,160,225, 99, 35, 8, 44,162, 93,250,223, 74,217,137, 2,194, 50,116,114,230,136,181,178,254,151,241, 50, +199, 63,175,147,201,147,123,207,198, 55, 99,181, 26,111, 10,143, 90,201, 38,152,101, 84,210,141,201,144, 81,120, 22,230,141,205, +125,208,127,156, 84,151,226, 60, 86,189, 66,250,184,235, 30,179,147,241,251,248, 71,105,146,103,232, 26, 75,115, 35,241,107,251, + 91, 84,216,244, 20,156, 15,253, 22,128,172,107,217,109, 26,136,162,227, 87,108, 39,113, 75,154,146, 54, 45, 37,149,218, 64,139, + 64,149, 88,176, 64,130, 5,172, 1, 33,177,226, 79, 16,223, 3,123, 22, 72,136, 31, 96, 65, 17, 32, 36, 22,136, 71,121,180, 13, +205,203,137,227,215, 56,118, 56,247,218, 41, 72, 72, 89, 36, 82,235,196,158,153,115,207,157,185,247,156, 2,223, 65,118,104, 53, +142, 59, 0,104,149, 83, 6, 50,162, 52,203, 72,156,123,227,223,196,166,201, 27, 39, 1,134,204, 4, 77, 83, 14,107,217,153,106, + 29,169,107, 97,205,202, 54, 29, 89,190, 63, 42,196, 90,189,149, 81, 93,151, 17,209,145,177,194,170,173, 73,197,116, 44, 82, 74, +137, 88,250,114,182, 88, 61,131,121,231,147, 62,220, 52,102, 1,166, 66,103, 49, 15, 71,220,159,157,178, 80,167, 58,207,210,103, +220, 48,138,196,109,238,234,140,169,196,126,220,185,134,149,170,252,234,255,196, 79, 90, 48, 23,184,233, 31, 1, 64,103,207,117, + 17, 81,117,121,106,155, 22,104,120, 70, 85,134,153,122,106,158, 67,199,176,228,210, 7,162, 58, 14,221, 60, 61,108, 46,109,188, +255,250,182, 51,234,130,201,134, 73,144,139,144, 0,143, 76,211,162, 54,212, 52, 38, 72, 34,145,219,217,222,238,213, 71, 15, 31, + 63,123,245, 12,208, 79, 14,244,220,183, 9, 14,154,215, 89,226,167,198,233, 52, 72, 66,228, 49, 36,254,103,216,219, 43,237,227, +241, 49,230, 31, 38,238, 48,112, 7,129,235, 6,125,140, 33,160,231,250,165,155,247,110, 61,120,247,249,205, 42, 40,115,138,152, +138, 48, 35,249,118,213,193, 56,154, 68, 89, 44, 89,227,142, 15,160, 98,192, 15,114,168,132,204,166,106,229, 50,254,204, 40, 33, +240, 40, 92, 2,168,133, 41,210, 76,133,234, 29,145,151,201, 20,193,128, 32, 48,212,105, 75,138,211, 79, 60,202, 59,215,238, 31, +116,190, 17, 58,209, 37,181,178, 85,102, 51,113,191, 8,190,162,144,202, 32,241, 85,131,218,133,214,150,206,135, 88,141,149,154, +235,247,241, 76, 64,112,102,133,195, 48,157,107, 2, 68,192,151,129, 98, 97,228,247, 39,253, 52, 77,150,156,134,100, 70,191,177, +212,162,210, 74,174, 30,171,152,213,203,173, 61,124,196,165,176, 32,219,205,221, 92, 38,236,250,206,141,227, 97, 39, 63,194,193, +183, 55,156,198,143,222, 65, 20,133, 36,144, 38,196, 98,181,134, 21,222, 29,157,120,177,183,181,182,211,117, 79,200,247,146, 74, +227,207, 78,147, 4,143,107,179,177,121,121,115,175,231,158, 76, 89,159,114,232,117,193,178, 59,195,195, 34,231,229,129,246, 35, +239,168,127,136, 0,179, 94, 63, 47,101, 4,114,192,194,191, 42, 70,106,171,113, 97,171,189,253,244,229,147,195,222, 47,140, 82, +217,180,135, 62,169, 80, 1,205,201,239, 8,153, 47,133,186, 12,193, 15,248, 11,148,173,148,200,178, 99, 56, 25,176,206,129,122, +214, 89,225, 48, 95, 45,105, 90,238,215,131,255, 45, 27,214,162, 83, 3,150,197,115, 53, 74, 13,116, 71,215, 21, 62, 5, 94,175, +173, 75, 54, 11, 77,146,168,164, 82,171, 58,235,148,138,122,117,249, 74,235,202,200, 31,165, 83,105, 26,230,221,107,119,129, 59, +164, 75, 64,156,108,166,228,162, 9,132,201,148,209, 98,125,153,150,233, 77,163,170,219,105,221,222,166, 29, 87, 64,112, 42,133, +235,138,110, 87,120,129,136, 49,252, 88, 91, 50,211, 12,221,118,226,113, 95,122,221, 92,223,149, 13, 48,232,114,134, 70,181, 12, + 84,205, 70,115, 84, 53,112,179, 73,128,165, 43, 28,135, 20,102,144,247,145, 11, 65,174, 69,168,241,235,244,141, 86,220, 86,177, +239,153,205,145, 61,127,147,136,225,145,248,248, 78,124,242,246, 95, 27,106,101,181,162, 91,131, 73, 79, 87,140,246,218,197, 19, +143,172, 19, 87,107,205,206,224,247,136,234, 41,144,197, 6, 82, 74,246, 59, 61, 23, 39, 73, 60, 13, 43,214, 66,202,114,229, 97, + 28,225,198,183,155,109, 76,209, 73,228,219,134,141, 37, 31,203,216,243, 71, 6,245, 72,198, 59, 27, 59,207,247, 95, 88,134,133, + 60,224,227,247, 15,131, 96,104, 26, 96, 15,224, 70,182, 23, 79,124,233,247,189,222,151,227, 47,116,108, 38,102,200, 47,193, 87, + 86,234,205,101,103,249,136, 68, 65,168, 31,158, 59,229, 20, 22,127, 22, 81, 34,211,194, 4,133,172, 1,243,125,115, 4, 72,208, + 89, 57, 47,126, 21, 69, 93,254,169, 15, 23,155,247,169, 42,166,156, 69,250,131, 41,181, 23, 48,127,229, 77, 98,234,141, 96, 27, + 60, 61,215,138,164,195, 78, 42,193,196, 12, 44, 58, 73,255, 53,200,182,169, 44, 48,213,169, 43,158,176,164, 98,179,166,130, 86, + 50,169, 82, 32, 57, 85, 50,248,107,104,252,255, 43, 55,112, 21,202, 31, 1,168,186,150,222,198,169, 48,122, 99, 59,118,226, 71, +156,135, 39, 68,125, 12,101,132,152,142, 70, 2,129,216, 32,216, 34, 36,182,252, 17,216, 32,177,225,151,161, 65,204,128,196, 10, + 6,161, 2,139,138,121,209,166, 77,211,214,137, 99,215,142, 99,155,115,190, 59, 25, 6,169,139, 72,173,210, 68,190,223,185,223, +227,124,231, 16,223,229,165,165,201,156,178,116,167,229,203,168,197,220,212,220,160,245, 28,151,197,178,238, 47,171,166,109,216, +136,109,156,236,140,237, 60, 86,166,150,148,213,218,110, 91, 36,182,145,116, 36,212,116, 44,215,226,213, 71, 95,138,183,119,239, +161,252, 1,208,139,132,183, 45, 51,144,182, 56,217,151,185,140, 38,122,110,255,211,247, 62,255,243,244,200, 52, 94,222,103,142, +232, 6,203,150, 85,107,203, 98, 98, 2, 24,116, 2, 98, 16,125,134, 52,179,174,177,100,197,223,230,178,137, 31,133,227,113, 56, +222,143,232,249,224,119,195,180, 72, 59,150,131, 79,219,182,156, 56,187, 70, 68, 29,188,113, 48,199, 29, 43, 45, 96,189, 15,141, +139, 7,103,251,116,113,234, 80,229,133, 78, 38, 52,213, 19,214,201, 2, 89, 42, 66, 13,159,214, 48,162,222,100,158,206, 74, 89, +203,162,197, 17, 21,239,236,100,185,122,244,248, 97,217,148,149, 65,119, 80, 50, 85, 25, 63, 86,199,102,150, 74, 62,143,200,145, +139, 77,105,179, 42,211,121,114,129,107,198,182,156,143, 14, 63,249,250,139, 47,127,252,235,103,100,133, 64, 61,211,110, 47,243, +229, 15,191, 61, 24,134,227, 40,140,174,210,185,105, 22,128, 11,128,123,223, 55, 43, 49,237,192,169,161,102, 91,213, 0, 3, 59, + 29, 3,201, 43,107,116, 83,221, 30,245, 90,164, 48, 26,155,162, 54, 37,244,147,138, 34, 14, 40, 81,242,117,181, 88,150,121,190, +193,227, 68,249, 14, 76,161, 39, 36,101,143,234,227,233, 49,237,108,148, 94, 68,104,101,148,216, 52,180,212, 51, 62,107,200,238, +118,165,105,152, 81,127,124,184,123,255,143,127,142,240, 91, 26,237, 74, 74,219,144, 46,109,123,182,207, 25, 19,155,200, 45,167, +237,234,237,130, 65, 55,202, 54, 89,224,120,138,140, 26,247, 44, 62,225, 44, 71, 22, 23, 1,166, 40,165,103,241,185,197, 97,105, +117,153,156, 35,157, 71,178,246, 98,254, 76,116,134,185,251,138,111,122,195,114,208,241, 2,255,155,175,190,125,240,232,187,189, +232,118,198, 85,100, 26,105, 38,171,216,216,114, 8, 74, 90,162, 51,185,139,179,120,122,241,194,119, 67, 74,234, 91,142, 0,151, +209,247, 70, 61,102, 94,172,255,240, 56, 16,179, 72,171,145, 33,206,150,231,248,215,125,183,143,191,188, 78, 46,187,182,115,114, +117,242,228,249,241,208, 31,145, 41,104,180, 23,233, 18,176,222,200,184,152,198,217, 65, 4, 80,198,149,182, 51,220,199,181,132, + 99,198,141,202, 86, 43,112, 67,233, 44,161,150,202,164, 67,206,201,183,192,166,161,125,219,113,225,225,203, 90, 45,235, 86, 56, + 46, 0,178,244,162,175,180,140, 9,112,170, 99,106,118,118, 45,148, 83,170,233,225,104,173,138,213,233,245,116,111,176,179,200, +151,131,238,224,201,236, 41,128, 12,248,219,239, 14, 88,243,113, 29, 90, 27,214, 55,180,175, 65, 25,110, 82,195,225, 94,216,219, +255,236, 80, 73, 31, 83,226,186,173,226,132,251,171, 69,161,114, 96,188,242,247,239,122,147, 55, 59,193,168,202, 86,213, 58,149, +138,139, 12, 63,139,253, 25, 18, 46,137,236,109,185,126,112,158,144, 51,229,137,218,228,202,247,148,219, 37, 91,198, 82,255, 55, +153,123,189, 67,241, 42, 91,223,108, 95,224,231, 70,157,255,173,142,126, 87,105, 82,253, 50,249,254,228, 50,203,175, 16, 11,180, +128,173, 55,243,248,146, 10, 52, 85, 29,167,139, 97, 48,244,187,222, 69, 50,215,189,232,154, 42, 41, 37,158,166,108,228,179, 97, +163,211,190,183, 38,119,206,174,167,184,169,102,139, 89,193,164,193, 73,242, 4,193, 62, 12, 34, 68,110,122,147,149,245,250,157, +157,187,253, 96,232,217,174,197, 1,140,131,119,235,145,192,157,173,139, 98, 55,218,195,155, 80,230, 23,160,180, 89,123,222,240, +195,247, 63,254,233,215,135, 59,131, 73,202, 45,217, 66,184, 58,245, 86,133,166,182,148,249,238,193, 7,103,241, 84, 47,242,117, + 44, 23,153, 82, 81, 22, 90,247, 8, 73,131, 69, 99, 85,233,129,170,214, 86,208,171, 22,129, 60,201, 80,181, 33,182,161,167, 24, + 29, 68, 55, 78, 66,217, 20, 90, 23, 84, 27,135, 10,237, 87,173,101, 28,245,106, 5, 85,143, 29, 71,189, 91,107,170,219,123,101, +149, 59,182,107,139, 92,249, 75, 17,233,173,145,227, 22,216, 95,127, 22,122,180,248,159,205, 19,126,241,175, 0, 76, 93,203,110, +211, 64, 20, 29, 79,108,231,253,104,161, 15, 80, 83, 72, 83, 4,165, 80,170, 82, 42, 64, 72, 8, 9, 9,177,224,107, 96,207, 55, +176,237, 18, 9,126, 3,177, 64,128, 16,221, 65,203, 75,226, 21, 72, 19,226, 52,137, 95,245,216, 30,238,153,113, 5,139, 74, 85, +165,198,142,125,231,206,157,123,206, 61,231,168, 63,163, 74, 54,133,137,104,111,245, 50, 56,121, 9, 88, 89,128,179, 98, 49,118, + 15,164, 78,165,136, 98,209,156, 93, 26, 78, 28,237, 37,207,178,118, 75,134,228,106,176, 81,207, 2,128,100, 9,195, 28,122,178, +145, 51,249,115,169,181, 65, 47,169, 81,170,107,120, 74,192, 94, 39,130, 14, 3,186, 37, 17,197,241,183,193, 55, 1,137, 96,165, +250, 43,181, 12, 27, 34, 81,187, 75,209, 31,128, 86,201,132,138, 47, 52, 99, 84,214, 95,109,174,143,131, 17, 93,171, 82,172, 53, +167,154,253, 73,143, 78, 73,251,163, 94,127,210, 87,199, 91,122,115,242,218,217, 27,189, 97,151, 34,198,226,121, 74, 7, 84,163, + 73, 37,113, 99,114,179, 81, 3, 35,144, 78,238,180,183,231, 77,123,226, 79, 22,102, 91,225, 97,136,125, 37, 85,222, 43, 6,187, +121,241,246,108,125,230,199,224, 59, 37,125,186,121, 1, 86, 12, 0, 21,211,182, 67,137, 94,127, 64, 5,122,170,181,164, 25,196, + 27, 88,106, 89,230,116,105,202, 21,190,159, 4,106, 20, 34, 85,246,202,156, 22, 17,229,221, 90,169,106,112,107,231,235, 27, 74, +190,159,246, 63,218,133,124,173, 92, 95,107,173,209,243, 60,115,234,108,174,192,207,181, 87, 36, 51,251, 78,151,115,244, 37,139, +121,219,153,248,128, 20,149, 67,165,226,190, 75,205,130,167,224, 15, 14, 69,115,170,166, 28,165,149, 56,179, 52,124,145, 27,208, + 15, 68,104, 13, 11, 27,184,180,204,180,148,167,181, 6,107,189,246,204,185, 32,242,225, 67,157,234, 49,122, 36,125, 77,130,165, + 69,146,233,248,171, 17, 48, 42,236,128, 30,203,164, 57,211,218,249,252, 26,153,139,231, 10,118, 41, 6, 10, 4, 85, 22, 90,138, + 97,114,120,162, 62, 63,215, 56, 57,194, 36, 87, 74, 55, 1,125,215, 98,141, 82,246,230,210,214, 94,103,119,163,125,117,226, 83, + 53, 26,231, 12,152, 53,210,222,182,178,176,218, 25,192,150,203, 4, 10, 2,143, 77,116,215, 33,146,135,186,175, 90,110,160, 15, +194, 57, 21,110,174,231, 61,127,241,140,174,235, 65,156, 14, 61, 4,144, 50,185,161,193, 75,219,180, 12,165,172, 75,255, 75,201, + 17, 30,194,146, 45,206, 44,174, 46, 94,232,143,123, 24,245, 70,133,107, 35, 93, 97,226,137,150,159,113,105,233,178, 23,250, 97, +228,113,101, 14, 29, 9, 65,223, 98,237,244,250,254,193, 47,202,114, 84,228, 52,138, 53, 55,112, 53,237, 94,169,183, 42,213,239, +208,167, 74, 19, 77,246, 88, 80, 78, 12,227,192, 84,149, 19,125,230,116,185, 78, 59, 58, 29,254,168,234, 7, 75,152,211, 35, 51, +139, 96,163, 73,229, 3,142,171, 80, 60,208,239,199, 43,211, 43, 11,231, 7,174, 67,103,226,122,161, 86,205, 87,198, 64, 47, 18, +221,180,201,169,165, 68,225,141, 17, 45,131, 43, 49, 62, 64,127,192,186,115, 38,211,224,155, 54,157,144,242,234,153,235,138,231, + 99,211, 54,109,129, 16,207,162, 72, 92,169, 84,217,242, 49, 36, 0, 48,141,138,204,113,152, 27, 80,114, 79,195,208, 40,148,173, +217, 38, 96, 65,216,155,201,112,212, 3, 52,132,254, 59,134,100,129,108,160,247, 4,119, 87,180,221, 45, 14, 69, 48,147,150,189, +199,188, 49,146,117,177,196, 40,122,254, 87,181,202,178, 73,250, 95,205,158, 28, 1,170,130,201, 1,251,178,203, 62,125, 96,137, +207,118,243,111,222,198,253,216,167,143,135, 70,163,234,202, 42, 39,141,108, 40,218,139,124,218,234, 18,173, 13, 13,194, 17, 4, +218, 50,236,157,163,238,209,226, 4, 7, 46, 69, 87,114,111,235,238,187, 31,239, 91,115,109, 47,192,156,202,246,195,167,157,223, + 95, 95,237,189,244, 69, 56,114,157,238, 65,183,243,231,251,192,115,198,222,152,195, 73, 66,236, 15,187, 80,123, 77, 65,243,160, + 16,202,129,103, 85,161,156,112,227,214,157,251,219, 15,158, 60,122, 60, 63, 61,223, 25,252,162, 47,118,121,121,243, 39,196,227, + 98,165, 22,140,122,101,232, 13, 5, 26,173,117,122, 11,145, 66, 28,193, 63, 65,155,206,164,219,159,171,195,147, 64,104, 93, 48, + 35,235,179, 79, 85,142, 29,138,208,212,101, 50, 20,177,112, 18,133,248, 48,220, 25, 67, 11,124, 63,166, 33, 4,153,102,162,145, +250, 44,165,188, 30,255,233,245,170, 81,205, 36, 86, 82,169,169, 20, 32,119,233, 6, 80,122,228, 93,124, 4, 68,102, 10, 25,218, +244,151,103,196,229, 74,161,170, 70,131, 65,214,252, 43, 0, 83,215,178,219, 52, 16, 69,199,142,243,112,220, 36, 78,155,132, 10, + 20,154, 8, 40, 68, 80, 94, 2,169, 8, 85, 44,216,178,128, 47,224, 7, 16,159,193,146,143, 96,201, 31,176,130, 29, 11, 86, 32, +212,128,250, 34,161, 80, 39,212, 14, 73, 28,199,227, 39,247,204, 36, 21,203,168, 81,237,204,204, 61,115,159,231,156,225,187, 38, + 56,169,139, 82,144, 79,202, 69, 46, 53,168,144,237,143,133,176, 8, 38, 56,196,181, 49,114,109, 66,128,101,135, 78,186,228,170, +196,223,232,112,147,255,187,181,113, 27,138, 45, 1,191,222,186,217,168, 32,239, 65,255,240,196,249, 21,129,212,201, 79, 99,132, + 60,200,166, 21, 77,244, 75,144,191, 28, 4,139, 82,195,127,205,253,213,226, 26, 16, 7,182, 70,128, 9, 34, 98,138,173, 66,244, +186,164, 82, 84, 83, 73, 51,167, 19,139,246,175, 42, 88,223,172,177, 69,118,110,174,212,180, 5,141,143,172,124, 35, 85, 23,166, +177,224,234,139, 9,196,233, 72,153,134, 89,210,205, 25,159,148,114,101,151, 99,204, 65,215, 10, 15,174, 61,220,183,246, 30,223, +122,252,237,184,235,161, 35, 48, 37, 95,190,108, 84,119,251, 95,251,118,175, 98,172, 74,185,237,186,185,238,248, 14,112,161,121, +243,203,112,119, 16,143, 28,213,243,212,185,157, 76,156,208,157, 69,158, 6,131, 76,251,206,177,142, 68, 56,212,221,200, 68,141, +188,209, 89,239, 88,174, 69,235, 77, 27, 64,111,194,147,112, 26,120,228, 27, 62,219,126, 26, 41,225,222,240,200,139,253, 74,217, +212, 11, 70,247,176,187,115,111,231,124,251, 82,175,255,125,213, 76,115, 57, 22,170,126,172,136,110, 42,113, 67, 75, 25,177, 48, + 78, 2,158, 6,243,176,174,151,200,255,202,103,193,140,158, 73, 64, 61,230, 37, 17, 90, 44, 80, 18, 36,131,165,119, 32,155, 77, + 38, 54,249,240, 25,123,252,199, 11,102, 32, 73,207, 22,162, 40,214,224,237, 42,171, 37, 73,224,131,106,162, 84, 2, 67,130, 11, +228,254, 10,173,204, 96,124,146,193, 88,178, 38,107,227,152, 79, 94, 12, 31, 97,159,200, 33,178,221, 33,238,161,194, 10,109,196, +156,207,233, 52,211,158,110, 95,219,222,237,125,109,214, 91,195,177,133,241,136, 52,190,119,249,254,225,239, 61,114,150,201, 56, + 67,209, 83,220,168,172,227,164, 49,180, 21,210,121, 47,233, 21,122,208,130,181, 34,142,201, 26,101,212, 6, 70,120,114,168, 37, +243, 53,240, 80,148, 80, 48,130,151,191,114,161, 19, 69,156,188,138, 87,207, 95,127, 63,238,142,103,227,195,147, 67, 46, 36,244, +200, 2, 9,253, 9,194,124, 14,207,107,171,117,167, 63,236,129, 7,148,160, 92,201,108,109,220,232, 13, 15,194,132,188, 23, 10, + 55,125,244,195,229, 12, 10,161, 40, 46, 92, 74, 10,203,233, 17,108, 32,249,254, 20, 84,209,135, 38,164,199,102,160, 34, 16, 50, + 38,116, 91, 64,136, 71,216,129, 12, 98, 4,114,165, 47,158,188, 60, 26,244,131, 8,201, 46, 10,127,119, 58,143,236,137,131, 10, + 51,211,204,149,202, 79,187, 55, 3,169,150, 36,150,203, 72, 49, 19, 90,207,230,234, 69, 15,161, 0, 19,228, 60, 66,113, 78, 80, + 79,170, 82,195, 83, 81, 54,106,173,137,247,215, 26,253,158,131, 10,130,192, 29,139,145,215,178,211, 36,112, 15,236,206,102,157, +213, 13,128,199,156,179,209, 20,248,206,121,202, 3, 70,209, 97,121, 13,191, 11,232,238,113,161, 49, 11, 26, 87, 85,149,248,158, + 67, 39,141,134, 36,123, 86, 93,230,220, 85,164,101,226,128,185, 35,230, 58,232,129,161,179,156,203, 47,115, 50,103,229, 83,137, +242, 18,238,125,150,158, 50,107,159,237,118,217,192, 66, 79,181,171, 57,239,245, 15,142, 83, 16,247,161,228, 77, 23,122,227,242, +186,194, 80,190, 32, 27, 20,247,151, 96,167,151, 36,175, 20, 72,121,156, 23, 11, 69, 90,106,161,192, 7, 91,166,203,184,219,255, + 70, 95, 32,220, 16,213,157,233,219,119,111,126, 88, 63,138,144, 77, 86, 55,207,111,250, 33,215,115,122,171,209,154,204, 39, 87, + 47,108,210,158,174, 25, 53, 55,112, 3, 48, 41,113,134,113, 51,125,236,253, 5,203,150, 51, 42,233,213,207, 31, 63, 29,159,246, +232,153,181,149,198,209,240,136,238,149,214,185,118,187,214,134,186,158,162, 84,141,170,235,187,145,228, 53, 89,182,188,208,203, +221,110,223,245,230,179, 63,211, 1,216,144,132, 23,126,166,151,158,205,228,208,197,151, 8,234, 84, 53, 83, 46,152,145,152, 87, + 16, 41,151,226,197,198,198,216, 3, 95, 44, 29,145, 78,243, 58, 91,248,175, 41, 61,200, 23,170,118, 98,180, 68, 50, 38, 74,255, + 95,162,175, 44, 34,178, 5,101, 42, 19,170,125,169,148,197,198,167,122,169, 6,217,128, 37,133, 60,166,148,242, 40, 92, 7, 98, +230,238,159, 0, 60,157, 75,111, 19, 87, 20,199,103, 60,239, 71,198, 30,227, 7,110, 18, 39,128, 65, 20, 34, 37,148,116, 19, 88, +130,170, 86,106,171,170,234,130, 29,253, 10,221,245,171,176,130,101,165,130, 96,209, 34, 81, 16, 2,177,104, 69,120, 8, 80, 69, + 73, 28,112,163, 60, 93, 39,182, 51,227,216,241, 60,250, 63,231, 58,236, 28, 47,162,235,185,231,158,123,254,103,206,249, 29,217, +162,151,135,120,128, 26, 66, 90, 91,115, 6, 84, 73, 71,231,205, 53,179, 33, 53,109,142, 6, 99,107,170, 81, 45,212,194, 65,135, +251,245,163, 84,116, 84,141, 48,248, 12, 1,161,112, 88, 22,163, 70,104, 58,109, 76,129, 55,182,171,224,149,186,189, 29,108,228, +152,233,195,106,123, 81, 48, 83,253,236,245,251,103, 98,236, 49,119,189, 66, 53, 59,125, 66,220,100, 4,121, 88, 30,129, 4, 18, + 73, 52,173,112,108,105,105,212, 17,238,152, 14,174,116, 28, 15,230, 76,167,142,238, 20,189, 34,130, 65, 71,119,195, 40, 60, 55, +253,249,202,198, 50,190,129, 39, 90,218,124,199,247, 39,201, 37,209,125,195,213, 65,112,217,148,195,161,192,115, 24,194, 2,248, +248,170,188,236, 49,216, 13,142, 43, 97, 5, 15,246, 63,173,158,181, 13,247,213,135,151,112,199,182,110,239,113, 60,149, 50,240, + 27,255,164,156,157,152,240,199, 91,102,239,225,210, 99,132,164,236,113,196,168,193, 68, 26,129,249, 40, 87, 78,229,166,120,150, +100, 7,166,157,209,232, 13,228, 96, 96,100,212, 83,133, 99, 88,252, 48,141,190,153,253,170,209, 94,131,131,104,236,254, 59, 95, + 59,191,112,126,225,210, 79, 95,136,125,250,237,218,239, 91,141,205, 95,239,223, 56, 94, 58,232, 71,233,171, 70,179,221,235, 7, +196,159, 20, 88, 99, 98, 9, 80,101, 65,130, 83,188,127,113,186,226,218, 6,252,192,224,128,114, 2, 89,215, 90,233,247,135,240, +221, 52,139,149, 18,238,176, 58, 91, 77,245,112, 98,181,251, 65,162,156, 27,109,224, 84,241,196,242,250, 91, 17, 62,120,166,143, +131,241,186,241, 82, 76,145, 80, 84,173,224, 29,221, 13,182,227, 56,134,226,201,185,121, 60,115,238,250, 73, 16,236,127,191,240, +195,157,191,110,193, 90, 8,129,203,169,252,172,235,143,251,213, 55,171, 47, 20,230, 95,169,178,106, 26,118, 39,220, 25, 63, 50, + 85,246, 75, 47,234,139,144,253,147,165,169,247,219,117, 40, 24, 67, 55,243, 94,233,136,235, 47,214,159,154,154, 42,146, 64,204, +125,136,107,149,211,203, 27,239, 68, 80,131,231, 15, 61, 78,156,150,168,255,221,194,149, 95, 30, 93,255,114,254,219,199,111,238, + 67, 11, 66, 47, 35, 38, 50, 84,139, 33, 55,137,201, 45,205,154,162,205, 29,155,135,189,204, 30,159,123,240,252,143,153,233,153, + 39,127, 63,161, 25, 4,114, 92,242,202, 59, 65, 11,158,221,210, 92, 8, 23,143,109, 27, 34, 6,113, 55, 81, 0, 83, 41, 24,116, + 25,101,200, 32, 30,106, 52, 75, 56,241, 74, 78,150,144,209,105,130,123,162,195,220, 18,193, 16, 46,103,203, 59,189, 93,110, 95, +138, 24, 38,162,216,170,141, 75, 7,254, 10,203,110,182,215, 60, 43, 7, 23,156,163, 4, 78,140, 24, 92,101, 68, 88,214, 34,230, + 90, 37,119,180,217,105, 86, 11,213, 70,179,161, 42, 74,216, 15, 89,181, 19,146, 26,235, 12, 15,246,230,170,179,237,253, 46, 46, +170,173,238, 86, 68, 16,102, 21,235,108,117, 91, 88, 29,249, 99,130, 33,227,118,145,117, 77, 54, 53, 2,231,187,164,225, 51, 23, +207,126, 93,108,254,121,225,231,203, 82,209,150, 58,129,180,217,148,154,109,169,189, 23,117,131,216, 28, 51, 38,207, 48,130, 76, + 14, 86,255, 9,215, 87, 20, 30,176,164,144, 15,207,104, 42,209,255,153,225,174, 81,252,174,107,236,226,249, 27,214, 75,148,243, +193,159,150, 35,229,125,169,144,151,252, 28,125,206,152,135,253, 77,145,148, 12,164,160, 35,253,215,146, 90,109,170,219,137, 34, + 49, 6, 34,189,109,222,124,219, 29,168, 84, 48, 30,143,122, 14, 35, 62, 36, 68,227,130,233,100,237, 44,126,250,122,155,180,245, +144, 47, 72,156, 85, 4,236, 80, 91,147,133,234, 90,107, 21,134,234, 88, 14,158, 14, 14,241,144,166,115, 4,124,159,196,135, 44, + 23,229,199,203, 87,239, 46,222,243,189, 60,108,169, 86, 57, 89,223,168,115, 10, 33,214, 13, 27, 59,137,219, 58,102, 56, 4, 51, +191, 41,249,227,218, 57,236, 17,165, 34,137,110, 27,143,185, 16,238,219,148,113,224, 90,118, 1, 77,194,115,134,128, 44,185,149, +221,126,135, 85,169,120,199, 68,102, 42, 32,217,212,188, 70,116, 13,234, 72, 34,116, 4,119,135,192,132,161, 21,100,106,150,236, +101,228,195,204,124,146,212, 62, 57, 93,223, 92,250,248,230,148,230,235,240, 76,190,136,210, 56, 50, 73, 5,146, 45, 9,207, 23, + 74,120,128,205, 71,207, 74,225,186,161, 25, 41, 15,255,163,218,141, 52,130,251,210, 51, 52,209, 19,209, 24, 23,181,139, 13, 16, +236, 37, 46, 33, 22, 85, 72,135,213, 37,255, 11,192,212,213,244,184, 77, 69,209,103, 59,246, 36,153,201,212, 33,205, 71,167,153, +164,204,128, 40,168, 85,169, 64, 8,117,195, 2,118,195, 6,177,227, 47,244,247, 33, 33, 36, 42,181, 11, 86,136,138, 25,209,170, + 64, 71,233,196,249,152,196,137,237,216,241,119,108,238,185,246, 32,164, 89, 69,147,143,247,252,238,123,231,220,119,239, 57, 37, +126,103, 65, 96, 8,226, 16, 44, 69,164,229,187, 0,114, 78, 41,243, 83, 28, 81,113,150,174,220, 5,209,198,154, 86,231, 75,134, +255,169,221, 43, 80, 77,170,105, 85,244,136,203, 18,139,247,202,250,126,243,193,224,209,204,154,246,154, 71,116, 54,192,235, 50, + 13,182,128,141,217,210,154,113, 77,105,217,206, 82, 74, 26,243, 9,254, 95,225, 17, 13,179,177,167,211,244,168, 56,171, 35, 34, + 23,240,237,147, 33, 26, 12, 55, 40,214, 84, 61,172,235,222,214,233,183,135,174,111,179, 40,121,190,176,175, 9,137, 83,220,122, + 80,134, 43,149, 67,110, 55,218,159,158,124,230, 71, 65, 2, 43,122,176,230,156,181, 88, 59,183, 58,143, 79,191,184,188,254,155, +109, 84,113,117, 70,145, 79,171,136,130,133, 16, 52,253,152, 32, 13, 97,184, 44,164, 66, 18,153, 8,117, 6,229,122, 57,147,133, +159, 56,163,252,210,136,141,195,122,125,191,166,113,182, 87, 66, 64,128,104,179, 82,170,164, 49,182,162,205,182,146,171, 8,155, + 88, 74,253, 93, 16,229,137, 31,123, 99,219, 24, 91,147,201,122,246,236,237,175, 23,243,191, 46,215, 35, 58, 86,175,108, 99, 19, + 58,211,115,227,213,139,139, 61, 26,247, 70,125, 53,250,243,157,105,168,185,252, 97,183, 58,117, 29, 90, 93, 72, 78, 43,108, 43, +195, 22, 16, 69, 21, 57,141,113,208,168,247,106, 53,194,247, 90, 42,212, 68,168, 66,178,195,212, 10, 98,215,143,161,190, 70, 99, + 11,147,131, 92,185,246, 54, 5,240,103,172,180,179,182,144,173,191,163,247,189,192,161,127, 89,184,179, 61,220, 92,193,249,152, + 27,181,209,105, 8,112,187,139,109,111, 77,135, 19, 29,195,244, 8, 30, 14, 30,255,114,241, 83,251,160, 87,170, 2, 64, 4, 8, +193, 1, 87,235,186,222,109, 30,177,138, 0, 60,233, 9, 82, 77,214,198,124, 61,197,220,200, 50,109,247,253,247, 6, 59, 68,215, +214,114,161,206,184,141, 61, 34,196, 21, 5,250,116,135,181, 38,189, 98,251,107, 90, 7,144,112, 64,121, 0,151, 30,101,216, 31, +167,171,241, 38,116, 31,222,123, 68,208,149,102,181,173,119,233,176, 35,166, 72,172,232,251, 39, 63, 92, 45, 71, 26,167, 71, 76, +103, 49, 94, 92,105, 10,220,124, 76,103,229,250,155,167,103, 79,159,159, 63,223,209, 25,139,190, 77,233,180,119,186,176,167,159, + 12, 31,124,253,213, 55,231,175,255,160,128, 31,180,135,244, 35, 5,124,113,111, 21, 34, 72, 21,150, 71, 61,233,190, 79,177,173, +239,183,194, 40, 56,251,252, 91, 5,149,175,209,237,131, 22,122,226,178,132,182,233,187,205,187, 14,154,158,144,240,230, 70,149, + 44, 8,225, 90, 75,188, 4,190,238, 82,222,168, 54,130, 36, 58,110, 29,187, 69,149,167, 2,169,165,186, 86, 13,112,107,236,219, +129, 77,179,125,175, 59, 92,185,166,194, 68, 93,149, 42, 1, 63,174,153, 53,159, 90, 19,141, 89, 32,110,116,226,144, 86, 53,116, + 14, 34,175,213,104, 39, 80, 98, 40, 53,240, 21,110, 81,170,105, 13, 57,139,204,205,200, 76,162, 59,111,220,230,147, 33, 66,222, +218,138,141, 79,248, 61,193,251,125,133,224, 81, 69,141, 87, 11,111,254, 15,235,136,112,141, 29, 59, 83, 87,152,237, 34,201, 94, + 8,184,107,252, 87,145,203, 93,158, 8, 32, 54,122,138,207, 68,108,183,194,178,132,185, 4, 60, 95, 78,196,114, 42, 22,134,152, + 27, 98,252, 78,204,230,194,113, 69, 28,149,226, 99,180,165,254,172,253,120,238,171,245,202,233, 65,107, 95, 81,117,181,122,255, +232,254,218, 91,167,220,181, 72,203,111,208,238,211, 72, 55,220, 64,119,227,192, 11,112, 79,179,247,221,151,103,191,189,125,153, +224,166,154,232, 71, 68,224,215,130,182,123, 84,118, 73,103,226,227,227,143,174,157, 37, 5,230,239,151, 47,151,206,156,160, 61, + 19,118, 20,137, 16, 48,133,186,134,148,133, 73,216,209, 59, 65,232, 19, 42, 95, 57,230, 73,239,131, 32,242,135,157,161,233,152, +196, 12,104, 74,233, 59, 41, 62,232,195, 83,110,107, 96,253, 15, 98,189,176, 17,245, 2,207,165,160,136, 35,113,179,117,102,133, +241, 25, 87,194,208,131,195,214, 92,216, 33,112,211, 67,113, 67, 72,104,174,232,242, 3, 45,131,127, 41, 96,183,227, 91,112,194, + 80,112,135,205,121, 71,228,195,120,218,213,170, 90, 69,182,131,240, 95, 33, 8,157,223,248,237,150, 21,134, 50,147, 30, 92, 63, +104, 80,203, 0, 78, 61,210,251,166,187,164,213,174,105,181, 24,141,123, 82,129, 57, 74,217,225,155,236,123,145, 41,162,151,254, + 21,128,166,107,105,109, 34,140,162, 51,201, 36, 51,211, 36, 77,154,118,218,248,108,173, 15,180,104, 69, 91,177,226, 99, 41, 46, +116, 39,250, 35, 4,127,138, 11,255,128, 8,110, 21,164, 96,165, 32, 8,238, 84,170,161, 22,164,104,219,160,105, 76,147,166,147, + 76,230,149,121,196,115,239, 55,133,108, 2, 97,194,204,220,239, 62,207, 61,231, 16, 63, 51, 20,154,244,116, 57, 86, 33,241,167, + 10, 83,243,211, 11,141, 78, 93, 18,240,157, 84,162, 55,235,132,118, 66,114,149,112,218, 80,249,130,152,151,145,179,131,216,231, +178,143,171,192,192,107,152,117, 49, 5, 51,157, 3,219,181,224, 2, 10,185, 81,152, 63, 15,149,137,101,200,200, 79,102, 51, 58, + 23,164,177,104,237,139, 22, 13,107,173, 17,204, 28,199,224,222,213, 7, 91,136,126,220,251,131, 41,227, 62, 81, 26, 15, 73,155, + 23,185,191,127,238,232,249,237,230, 47,234,130,165, 68, 87, 86,208, 51, 17,239, 54, 51, 1,145,182, 7,222,125,163,179,107,123, + 61, 65, 74, 79, 42, 84, 25, 45,140,131,166,217,104,154, 36, 10, 35, 90, 30,101,226, 1,118,203, 57,195,246,186,126,224,186,136, + 70,126, 63,228, 5,105, 18,183,136, 2, 47,246, 34, 65, 64, 76,103, 67,238,107, 72,193,153,145, 91, 44,179,241,156, 32, 37,224, +221, 98, 89, 68, 12, 85, 73, 33,136, 22,211, 24,248,163,208,158, 16,185,123, 85,210, 53, 2, 39,100,210,248,137, 29, 57, 45,255, +160,110, 53,190,236, 84,151,215,222, 47,175,173,188, 88,126,181, 90, 93,169,238, 84,221,192,166,185,234,208,175,119,109,153,121, +201,149, 12, 14, 0, 79,188,224, 17, 20, 22, 47,143,165,172,148,186,124,220,152, 49,138,198, 56,146, 57,132,119,101, 92, 69,120, +196,213,195, 81,152,217,128,182,160,251,148,218,171, 17,179,163,201, 9,204, 10,150,170,105,140,153, 65, 77, 35,150,155, 69,254, + 48,109,204,118, 93, 51, 12,105,105, 8, 14, 29,174,191, 82, 60,218,182,219,136,163,251,118,139, 17, 32,169,177,252,152, 77,100, +238,114, 2,140, 35,172,125, 88,208,242,168,117,240, 0,241,132,247,186, 77,154,189, 39, 96, 39,106, 29, 58, 3,135,101, 84,201, +138,113,218,107,173,157, 27,115,119, 92,226,242,116, 30,222,122,248,109,235,171,150,201,113,202, 76, 3, 27, 94,196, 71,113, 41, +149, 10,227,168,169,251,142,181, 81, 91,135, 67,199,219,239,225,204,200, 41, 93,161, 18,161,214,220, 30, 68, 4, 55, 60, 82, 62, +254,228,254,211,133,187,139,223, 63,127, 27, 32, 37, 11, 3, 56,220, 43,247, 23,119,127,238,250,129, 83, 44,136, 93, 24, 19,247, +127,106,114,246,237,199,215,120, 33,211, 83,167, 17,186,240,162,175,157,185,190,111,181, 88, 81, 54,167,165, 85, 56, 69, 68,154, +152, 87,252, 96,141,176,147, 22,139, 85,145, 31,225, 94, 73, 73, 31,179,252,174, 60,148,133,204, 89,165, 84,185,120, 98, 30, 57, + 77,207,233,233, 89,149, 13,130, 50,246,124, 86,223,235,238,205, 24, 51,180,252, 18, 71,165, 92,137,198,245,172,159, 68, 91,123, + 3,183,109,237,243,102,214, 72,138,165,133,184,142,212,111, 93,184,217, 56,104, 8, 56, 32,167,180, 33,254, 8,105, 1,207, 27, +105,163,155, 61, 59,163,237, 68, 51, 51, 26,168,170, 62,158, 55,252,216,219,177,220,165, 80,145,230, 38,164,142, 37, 89,125,201, + 35,114,132,129,231,186,102,203,105, 55,156, 78,157,132,100,101, 49,225, 59, 84,185,165,203, 49, 2, 82, 97,255, 78, 31,150,236, + 32, 47,159, 73, 40,127, 25,158,201,247,196,244, 96,168, 8,225,251, 60, 79,242,124, 26,225,134,188,137, 60,100,118,219, 52,175, + 90,124, 42,200,157,139, 81,177,240,242,251,187,231,235, 31,158, 85, 87,223,212, 54,126, 52,127,159, 31,173,148,212,156, 31,163, + 12,141,123,196, 97, 23,242,130,201,144,229, 32,135,149,177, 35, 48, 30,220,245, 63,115,207,236,155,115, 39, 47, 33, 23,166,105, + 42,171,119, 33, 77, 36, 87,200,231, 17,207,170, 60, 82, 70,106,225,121,222,163,219,143,255,182,255, 34,150,195,138,150,206, 46, + 77,149, 39,107,173, 63, 68, 56, 31, 6,142,107, 31, 51, 78,108,238,110, 26,197,137,166, 73, 29,149,190,215,135,189, 9, 46, 70, +137, 69,107, 16,248,137,254,129, 58, 9,145,158,209,225,184,124,230, 14, 58,148,104, 58,108, 22, 15, 99, 33, 82, 67,252,184, 52, +233, 33,212,123, 94,207,199,188,240,204,100, 62,220, 76,147,146,102, 6, 61, 45, 26, 62, 34, 33, 76, 43,236,208,185, 35,173, 40, + 12,166, 17, 95, 99, 22, 63, 72, 11, 92, 11,199, 8,118,168,220,140,225,138,118, 68,213, 4,208,142,217, 75,104,182,218,115,123, + 8,142, 65,228,251, 9,130, 89, 64,121, 18,191,142, 99, 5, 51, 64,218, 36,167, 24,240, 45, 73,255, 5,224,233, 90,122,155, 56, +163,232,216,158,241,216,158,241,196,153, 56, 33,137,157, 16, 90, 19,160, 13,176, 0,132,232,162, 66, 60,182,221,180,172,216,132, + 95,195, 63,232, 63,232,174,170,212,110,250, 11, 42, 84,181,138,170,166, 45, 45, 68,136, 56,193, 78,140,237,121, 63, 60, 15, 79, +239,185,159, 65,242, 42,118,252,152,185,247,126,247,113,238, 57, 2, 63, 83, 18,221, 31, 1, 22,196,201, 6, 78,134,217,196, 31, +199, 32,218,198,135, 53,107, 38,121, 17,133,168, 43,155,215,239,124,122,231,232,236, 21, 35,202, 81, 13,176,144, 20,150,205,152, + 37, 6,228,192, 60, 69,145,214, 91, 27,172,223, 20, 48, 39, 18,194,110,194, 90, 25,130,201,184, 0,248,172,225,197,174, 12,154, +124,108, 60,102,172,143, 65,255,158,164, 81,141, 15, 85, 50,103, 83,107,159, 78,223, 86,152, 77, 47, 95,136, 69,167,162,248, 1, + 3, 39,221,194, 36,150, 69, 41,130, 56,139, 26, 75,171,214,129,127, 23,244, 89, 69,209,168,235,244, 3, 82, 60, 83,232,117,131, +254,138,205, 64,216,179, 76,181, 48,163,149,208, 73,156, 1, 87, 71,245, 65,148,241, 84, 85,200, 22,113, 27, 22,215,182, 99,110, + 47,105, 45,111,102,241, 14, 98, 41,149, 11, 44,242,207, 43, 60,135,164, 66,143, 66, 27, 14, 57,138,197, 69, 38, 24,240, 11,112, + 2,242, 50,164,216, 73,102, 53,171, 50, 20, 78,113,131, 75,139, 25, 11, 76, 70, 56, 26,106, 96,200, 54,228,202,124, 94, 78, 18, +201,137, 2, 43,112,135,174,253,198, 27,255,113, 54, 26,120,129,157,164,214,108,230, 36, 89,144, 80,110, 66, 15,212,161,244, 74, +105, 94,178,194,196,141, 18, 89,109,254,126, 18,252, 59,117,250,190,127, 26, 68,227, 40,238, 24,215, 6, 33,228,205,190,220,125, + 92, 41,169,163,112,168,148, 27, 2,233, 4,226, 72,230,113,153,165, 1,160, 15, 5,250, 0,228, 72, 45,125, 5, 0,134,104,202, +107, 32, 90,154,101,103, 14,197, 26,208,165,237,174, 95, 69,224,150,242,166,218,140,128,193, 80, 68,233,195, 43, 24,232,173,113, +219, 52,164,123,122,115,231,214,237,222,221,151,253,191,180,154,129,142,126, 89, 38,231, 73,160,165, 89,165, 24,196, 72, 13,245, +205,249, 43, 74,246,255, 57,249,147,210,121, 74,147,127, 59,250,149, 46,202,170,177,246,244,193, 62,121, 67,111,125, 23, 80,153, +216, 70,192,173,214,221,192,222,255,106,191,127,118, 76,231, 49,112, 35, 21,149, 30, 84,111,117,151,187,183,119,239,158, 79,207, +201,250, 41, 64,191,248,251, 23,171, 63, 81,100,217,108,174,216,129,253,224,254,163, 31,190,251, 94,215,140, 94,247,242,149,205, +158,229, 78,182,219,151,156,216, 29, 76,250,244,195,191,249,226,201,200, 30,141,236, 33,200, 74, 47,221,216,219,217,123,249,238, + 63, 63,241, 98,102,224,168, 42, 13, 58, 57,201, 72,234, 74, 13, 86,145,102,221,149, 29,200,129,224,124,194,200, 33,231, 75, 72, +118, 68,233,130, 31, 5, 39,227, 99,203, 27, 49, 15,107, 34, 45,218,178,128,207, 82,100,129, 97, 20, 25, 89,120,219,104,147, 85, + 95,223,222, 35, 51,126,124,227, 81, 19,214,136,186,231,217,195,103,135,199,135,189,181, 79, 58,230,198,216,165, 43, 95,120,161, + 3, 86,109,156, 58, 0,150, 92,104, 93,224,232, 90, 1, 41,119,158,177, 16, 80,177,212, 88,166, 8,181, 97, 94,140, 82,159,220, + 83, 6,167, 80,148,150, 11,121, 16,108,221,219,146,252,128,241,145, 49, 69,119, 16, 74,131,249, 45, 97,209, 96, 56, 74, 89,208, +117, 2,196, 87, 18,237,255, 5,240, 70,254, 48, 98,165,228, 93,253,128,127, 7, 62,178,224, 23,112, 75, 70,144, 71,148, 62,178, +145, 47,180,160, 36, 78, 52,144,190, 28,172,246, 15,170,223, 30,254,252,245,143,207, 15,222,191,117,194,160,173,212,223, 71,211, + 35,251,244,167,225,145, 81,211,123,122,155,156, 43,230,222,172,104,184, 11, 98, 87, 39,244,216,239,178, 48, 1,160,206,242,167, +221,213,206,196,181,162, 44,105,105, 6,229, 19, 19,127, 42, 82, 77, 55,244,234, 42,244, 36, 40,252,189, 30,188,110,168,148, 38, + 98,228, 67,129,155, 14, 99, 84,255,181,230,214,218, 14,235,169,249, 87, 55,175,209, 59, 80,149, 95, 2, 57, 74, 42,132,124,233, +219, 66,129, 16,220,136,106, 50,207, 63,219,250,252,220, 25,146,249, 97,178,205,125, 5, 12,156, 84, 53,229, 19, 93,136,211, 1, + 69, 51,135, 44,112,206,203,133,204,198,145,115,159,153,174, 78,153,190, 3,232, 20, 43, 85, 83, 51, 77,125, 57,197,122, 32,111, +236,193,223, 25,242,135, 70, 23,116, 44, 77,221, 36, 51, 88,105,182, 11,105,177,158, 45, 48,150, 60,188, 41,184,216,149,116, 85, +107, 84,193,201,223, 89,222,160, 55,160,106,175,194, 21, 27,221, 49, 69, 86,140,250, 18,157, 67,237,165,117, 32, 38,139, 20, 76, +109, 10,160,147,170,162,198,121,196, 77,233,185,152,192,254, 47, 0, 83,215,210,219, 70, 21, 70, 61,190,243,178,199,158,241,216, +142,221,202, 78,164,244, 33, 4,162, 17, 18, 66, 98,131,144, 88,160, 74,221, 87, 69, 32,254, 0,123, 36,216,243, 15,248, 35, 93, +178, 97,213, 22, 84, 21, 36,132, 68,211, 54,129,138, 36, 56,193,121,212, 30,207,203,246,120, 56,231,187,182,196, 38, 74, 22,118, +238,220,123,231,123,158,239,156, 13, 63,129,134,232,203,162,215, 45, 93,114, 45,173, 7, 94,105, 5,150,169, 80,134,172,198,209, + 40, 74,163, 89, 30, 49, 38, 93, 33, 68,116, 96,139,231,203, 84, 18,127,214,131,234, 72,201, 76, 19,183, 9, 81,225, 28, 78,198, + 32, 31,190, 33, 21, 55, 24, 56, 14,182, 16,153,179,104,208, 70,164,217, 34,134,129, 43,164,196,121, 61, 28,104, 82, 33,220,236, +154,237,193,205,250, 53,255,228,242,104,185,225, 44,196,227,147, 47,123,145,234, 78, 46, 12,174,212,127,139,190,223, 67, 94,198, +153, 85,101,237,110,237,226,129,211, 60,198, 81, 69,217,236,102,255, 86, 88,111,227,200,241,136,173,122,123,146, 82,127,202,169, + 58, 37, 41, 18, 11,233, 71, 87, 6, 33,167, 22, 69, 93,155,133, 41, 67,199,183,155,145,100,114, 39, 32,147,178,221,227,203, 35, +102, 93,236,242, 26,158,175,130,142, 21,192,147,216,166,235, 42,215,169, 34,100,113,109, 50,173,215, 93,214,106, 76, 1, 43, 43, + 89,182, 33,223, 39,108, 95,171,181,102,174, 81,173,104, 1,239, 66,131,150,244,132, 28,151,163, 56,117,169,228,255, 40, 25, 97, + 49, 29,201, 0, 44,153, 89, 84,146, 29,137, 22, 39,242, 88, 90,214,194,160,194, 55,222,224,211, 56,121,125,254, 38, 80,161,109, +176,123,232, 33,133, 52, 42,121,153, 99,117,201, 34,241,157,214,225,248, 16,126, 1,113, 74,199,235, 46,240,190,175,228, 26,200, +177, 23,162, 21,254,206,240,206,104,138,248,174,236, 54,187, 56,110, 92, 47,132,219,165,248, 82, 4, 44,159,125,244,229,225,217, +193,121,116, 94, 10, 97, 22, 22, 3, 39,129, 27,130,157, 89, 17,162, 78,164, 10,177, 67,228, 49, 91, 96, 63, 71, 23, 71,108, 33, +138,178,138,239, 5, 97,179,189,229,247,135,221, 29,134,249,136,153,150,153, 99, 53, 62,184,253, 97,146,167,221,102,199,117,106, +249, 60, 35, 8, 58,159,253,188,255,232,120,252, 55, 18,249,211,171, 19,188, 17,132, 88, 8,119,208,179,253,167,185,200, 38,136, + 78, 72, 33, 26,191, 78,203,235, 30,141,255,196, 23,238,246,110,222,255,228, 65,224, 6,241, 60,190, 18, 66, 71, 71, 33,143, 81, +211,136, 80,232, 89, 54,113, 76,239,213, 63, 47,191,253,226,155,199,191, 61, 66, 76,215,246,194,231,199,127, 32,148,126,251,214, +187,219,253,157,159,158, 63, 57, 24, 29, 16, 78,163,212,150,127,157, 29, 84,206, 63,151,158,213,192,139, 4,247,147, 44,103,118, +149,234,207,154, 32, 15,166, 36,168, 17, 73,165,116,230,168,240,248, 10,145,126, 63, 28, 96, 71,175,181,122,113,154, 12, 89,153, + 97, 63, 77,102, 71,201,147, 58, 8,135, 4,120, 76,199,105,158,189, 26,189,196, 78,102,162,199,123, 49,189,140,179, 24,167, 59, + 73, 38,189,160, 63,141, 39,130,248,174, 96,183,113,135,119, 58, 59,103, 36, 46,230, 36,242,160,189, 13,163,214,172, 53, 9,243, + 23,110,212,148,115,176,184, 4, 89, 81,100, 28, 67, 53, 85,156, 45,223,223, 27, 84,204, 37, 66,248, 50, 73,231,243,249,130,236, +163,235, 46,148, 8,139,110, 84,163, 42, 26,203,137, 11,199, 11,170,225,218,180,230,218,166, 59,166,200,239, 73,185, 70,233,126, +118,245,127,144,188, 53,209,157,252,100,241,184, 82,195,103,189,202, 15,245, 23, 79, 23,223,239,255,248,221,175, 15,123, 86,243, +235,247,238,125,181,247,233,231,111,125,124,119,112,199, 42,141,223, 47, 14,126, 57,123, 81, 84,173,189,214,144,134,202,180, 83, +153, 54,151,220,154,182,254,198,181, 27,112,150, 5,153, 48, 12, 56,102,108, 35,193,211,244, 33, 6,172, 63,178, 73, 91,145,122, + 90, 98, 91, 79,171,226, 52,220,122,195,246, 16,191,139, 40, 51, 29,107,186,204,227, 60, 26, 79,254,197, 95,189,102,239,245,248, + 47,216, 25,172,212,175,251,112, 0,194, 42, 19,203,200, 27,222, 76,194,183,224, 83,206, 38,167,212, 22,144, 26,181, 6,149,195, + 82,135,245, 80, 26,111,124,106,252,142, 75, 5, 91,199,121,117, 45,206, 40,179, 75,210, 30,103,110, 65,177,250,170, 42,228, 92, +210,156,195, 89, 65, 45,244,220, 26, 34, 27,147,233,123,169,132, 92,203, 98, 50,111, 33,201,110,251,157,105, 26, 41,246, 24,109, + 61,145,180, 65, 72, 50,143,134,225,222,238,110,159,190, 57,185, 66,152,151,167,150,196,138, 98, 59,120,140, 48,140, 48,158, 73, + 30,233, 2,166,140,255,173,241,145,107,193,144, 13,255,251,127, 2, 16,117, 53, 61, 77, 68, 81,116, 62,219,206,180,140, 37,165, +218,150,146, 24, 40, 16, 98,130,209, 24, 21,149,132,196,141,191,192,184, 82,255,136, 49,174, 92,250, 15,252, 15,174, 77,136, 27, + 93, 17,136, 11, 53, 46, 76, 27, 69, 74, 11,195, 48,157,215,233,124,116, 90,207,189,175,224,174, 33,105,153,121,239,221,251,206, +253, 58,231,114,190,105, 10,120,194,170, 14,212,156, 68,131, 24, 36,143,153, 93,246,236, 92,168, 93,210,197, 15,140,102,106, 57, + 41, 51, 45, 21,151,112, 88,150,107,173,179,224,180, 49,223,244, 70, 94,154, 81, 35,129, 84,134,149,137,164, 87,111, 94,127,218, +221,213,216, 6, 82, 70,185, 52,211, 63, 87,209, 73,179,141,164,215, 96, 78, 88,235,152,136, 55,105,229, 88,111,126,204,221,141, +212,165, 83, 44,204,225,121, 0,153, 72, 74,141,111, 61,188, 97, 16, 6, 50, 44,172,207, 55, 27,149, 69, 79,224,110, 24,123,194, +163,236,155,166,195,185,172, 47,110,136,145, 96, 58, 23, 29, 91, 78,204,104, 83, 57, 6,165,243,113,159,200, 0, 7,255, 11, 62, + 8, 81, 15,208, 61, 73, 67,112,181,101,194, 99, 86, 28,208,208, 62, 13, 83,161, 72,177, 77, 38, 49,172,212, 45, 45,167,208,118, + 1,154,170,179, 63,195, 89,198,209,148,206,227, 40,141,146,177,212, 66, 35,228,198, 58, 23, 83,201,134, 55, 37,183,129, 47,218, + 57,195,182, 12,203, 54,231, 0, 80,225, 48,242, 70,193, 50,109, 64, 65,155, 46, 12,170,126, 25, 92,169, 52,153,253,137, 30, 88, + 77,199, 42, 98,107,220,149, 88,221, 4, 49, 76, 6,243,214, 50,153,246,209,140,169,166,227,252,117,131,254,145,240,142,130,224, +104,224,159,248,131, 40,142,206, 35, 63,153,164,199,131,110,166, 36, 68,200,172,169, 49, 98, 21,156,104,117,210, 40, 47,225,189, +108, 82,191, 90,184,179,122,239,107,103,159, 11,255,164,134,138,120, 63, 97,246,161,187, 43,247,123,126, 15, 39, 23,112, 24,119, +109, 49, 95,122,190,243,242,160,189,111,210, 4,165,193,220, 94, 57,233, 59, 0,151,240,174,240,197, 68, 79, 62,201, 96,132,243, + 4,231,135, 37,219, 1,236,245,134,126,223, 63, 22, 17, 15,253,242,114, 96,127, 59,189, 95,148,208,212, 13,108,147, 74,142, 59, +171,149, 27, 92,197,209, 30,223,124,242,187,223,222, 92,190,221, 63, 63,198,217,175, 58,213, 40, 14,175,215, 90, 99, 30,121, 43, + 21, 28,128,250, 56, 9,253,209,160, 85,111,133, 81,228, 11,183,108,149,241, 90, 84, 51,103, 17, 6, 88,166, 99,148,134, 52, 6, + 57, 61, 23,238,153,112,241,225,224,231,158, 59,112,225,214,235,149,198, 41, 83,230,254,237,118, 14,123,135, 55,150, 54,113, 31, +224,201,195, 40, 12, 83, 34, 93,152,168,212, 44,159,208, 36, 92,138,253,193, 47, 91,185, 60, 37,178,185,213, 25, 78,185, 64, 5, +127,169,145, 73,144, 69, 35,234,121, 35, 77, 70, 36, 50,110,230,185,206, 22, 51,135, 41,241,200, 51,114,140,105,182, 14, 43,134, + 59,219,164,187, 16,191, 20,167,137,101,230,241,108,216, 69,154,130,142,197, 40, 30, 61,218,120,136,235, 71,196, 33,117,245,176, +153,120,129, 43, 53,103,195, 72, 72,105,114,226,169,167,102,119,205, 41, 56, 92, 63,203,195, 34, 50, 34, 14,162,201,153,173,181, +107,138, 99, 40,238, 64,141, 98,163, 82,199,237,152, 18, 59,241,127, 26, 52,141, 41,104, 36,209,142, 54,179, 85, 38,216,215, 88, + 64,213, 52, 20, 75, 87,172,156, 98, 25,156, 10,228, 68,188, 76, 63, 40,140,223,103,194,208,108,127, 82, 89,165,168, 42,227,130, +242,177, 28,116,107,239,219,159,223,238,125, 88,189,210,120,183,243, 98,251,250,166, 27,135, 34, 77, 16, 28,222,170,174, 44, 23, +171, 95,250,157, 31,103,109,108,214,154,115, 21, 86,153, 16,135, 19,229,185,240,252,240,191,253,193,169, 36,227,228, 9, 68,213, + 31, 6,204,235,160,110,173, 63,192,137,233, 7, 39,240,169, 56, 12,240,230, 9, 87,100,101, 63, 21, 80,130, 20,186, 3,224, 99, +202, 16,230, 47,210,117,196, 94, 56,189, 50,177, 44,169, 94, 96,236,216,142,230, 66, 19,240, 31,123, 45, 81,237,204, 73,145,186, + 75, 42, 73,229, 84,214,234,227,164, 66,204,105,177,169,108,204,167, 10, 43, 19,169,203,209,120, 77,189,240,243,100,221,217,179, +237,167,223,255,124,147,211,152, 60, 87, 79, 67,142,240, 16, 38, 51, 21,230, 1,123,177,243, 8,225,117,213, 42,148,230,236, 82, + 24, 82,159,174, 83, 44, 83,147,171, 58, 99, 27,149, 61,185,176, 2,145, 8,226,113,226,190,222, 89,185,148,125,119,198,153, 61, + 94, 52,141,221, 10,183, 57, 50,182,158,200,192,226,162, 56,106,231,138,255, 4, 32,234, 90,122,155,184,194,232,204,120, 94, 30, +123, 50,118, 72, 98,210, 32, 7, 23, 25, 66,203, 2, 21,165,105,255, 3, 75,254, 8,171,174,186, 42,191,134, 45, 98,193, 10, 33, +129,186,237, 34, 41,108,144, 66,162, 40, 49,113, 60,153,177,199,243,242,140, 57,231,187, 14, 72,145, 55,177,172,251,252,238,249, + 94,231,172,236, 59, 61,244, 69,145,210,204,173, 94,103, 85,187,163,137,182,128, 98,106, 92,233,138,179, 2,146, 41, 86, 49,226, + 98,251,133, 65,219,115,188,104,126,141,197,181, 69, 88,130,175,220,138,103,201, 44,203,252,195,187,247,228, 78, 97,251, 4, 15, + 58,198, 13, 79, 95,168, 14, 74,145,233,225,215, 82,242,139, 25,218, 42,155,172, 15,122,195,105,122, 45,218, 35, 84,245,164, 68, +148,122,226, 36, 0,202,165,167,240,161,182,187,121,247,100,252,133,108, 65,236,131,173, 85,191,133,204,179, 30,199,151,177,148, + 0,197, 89,220,178,201, 38,168,208,104, 37, 10,200, 21, 25,253,113, 79, 72,131,245,240,206,175, 87,179, 75,192,255, 52,231,253, + 1,204, 76,138,153,244, 91,106,210, 44, 90, 96,190,140, 5,235,203, 53,183,107,224,180,119,112, 51,217, 61, 68,227, 42,213,135, + 82, 89, 35, 68,233,100,133,230, 54,178,133,201,106,180,128,111,113,251,109,178,133, 56,192,144,174,237, 17,239,195,184, 91,126, +219, 10, 60,107,173, 69, 67,175,140,187, 73,115,110, 48, 92,143,219, 96, 89,110,211,108,123,102,211,229,170, 57, 38,209,142, 41, +117,203,240,218,150, 21, 86, 88,175, 21,101, 58, 19, 15,212, 96,214, 1, 4, 44,123,169, 90,246, 69,111, 44, 41,179,164, 44,102, +243, 44, 78,243, 40,203,194, 36,137,105, 32, 42,108,188,105, 24, 81, 26,237, 15,126,199,226, 68, 89,116, 30,158,231, 90, 1,163, + 83, 46, 23,158,235, 63,220,249,229,116,242, 5,118, 54, 76, 38, 56,232,129, 19, 76,152,140,173, 48,204,163,147, 35,248, 1, 28, +162, 97,177, 74,119, 73, 69, 40, 76,206,119,219, 36,245,108, 56,153,148, 78, 42,101, 71,106,149, 49,103,200, 90, 34, 21,163, 99, +155, 9, 97, 47, 11,129,109,145,199,131, 29,124,186,255,244,255,211, 67, 21,150, 36,153, 93,195,204,139,252, 50, 26,141,227, 17, +188,180, 36,159, 15,182,135, 73, 58, 3, 48, 95, 84,170, 40, 77,239, 73,244, 15,142, 48,206,118,148,132,248,221,123,189,123, 93, +223, 63, 30, 29,227,164,249,205,246,102,103, 51,156,134,143,238, 63,234,247,251,231,231, 23, 13, 89,220, 89,146,252,253,252,159, + 55,111, 95,179,224,178, 46, 88,168,206, 52,134,133, 89,156, 93,157, 41,161, 75,157, 26,167,216, 34, 91,122,145, 23,100, 45,181, + 91,109,215, 15,188, 78,146, 78,187,164,104,175, 49, 60,193,149,210, 88,167,155, 45,199,227, 82, 48, 41, 77,166,239,166,105,207, +210,169,109, 90,248,235,117,123, 60,165, 27,187,197, 34, 31,254, 52,196, 42, 1,130, 52, 88,142,172,193,102,237,223,127,114,120, +124, 68, 77,162,189, 63, 0, 6, 58, 77, 58,181,192,155, 23,215, 23, 28, 85, 93,254,246,243,227,233,124, 22,120,109,106,200,214, +218,186, 31, 0,139, 80, 33,132,137, 19, 47,175, 82,215,180, 9, 15,225, 31, 72,105,205,206,230, 94,145, 77,254,220,221,208,123, +142,118,117,141, 9, 25,219,195,101,153,103,209, 88, 80, 59,111,151,234,244, 86,230,218, 16,190, 90, 93,137, 57, 41,252,142, 79, + 71,116,214,219, 46,185,224, 29, 74, 70, 9,174, 87,255,253, 30, 28,166,243,184,234,168,194, 91,114,230,212,175, 90, 31, 62,205, + 63,231,227,191,254,125,217,209,221, 23, 7,207,110, 7, 91, 97,158,197,243, 57,230,178,213,217,136,203,172,223,218,234,123,221, +247,163,143,255, 93,157,238,221,186,187,110,121, 11,141,161,239, 7, 59, 15,166, 89, 50, 73,194, 39,131,199,227, 36, 84, 8, 64, +248, 81,150,235,237,117,236,221,225,201, 17, 14,170, 4,172, 23,131,222,224, 43,149,249, 0,200,124,184, 44, 65,115, 13,222, 94, + 47, 96, 11,177,226, 35, 1,204,167, 29,175,203,131,225, 1, 80,160, 16,107, 16,174,169,134,246,166, 72,245, 2,121,220,176, 98, +252, 96, 87,215, 85,192, 8, 75,196, 64,131,161,252, 87,248,187, 20, 72,160,185,119,106,105, 15,106,232, 22, 78, 78, 67, 88,117, +121,243, 36,189,137, 47,140, 38, 35, 32, 0,222,117, 62, 23, 98, 28,120,234, 76,249, 4,114,183,182,111,237,148, 53, 44,137,141, +205,163, 24, 61, 57,139, 12,161, 50,204,113,108, 2, 47, 80,132,219,154,132,209,170,234,198,171, 87,160, 82,114,169,152, 50, 89, +191, 72, 37,166, 0,186,118, 35,221,167,234, 41,127,136,127, 27,194, 6,246, 77, 0,158,174,101,183,141, 50,140,218,115,241, 92, +237,241, 56,105,172, 38,110,233, 69, 45, 21,164, 27, 64,138,216, 32,209, 77, 23, 93, 35,193, 30,120, 8, 22,108,120, 12, 30,161, +175,192, 11,176, 64,162, 82, 85, 9,146, 10,170,162, 56,118,124,201,216,115,241,220,123,206, 55, 99, 54,150,236,140,237,201,239, +255,255,190,243,221,206,105,237, 59,158,202,132, 78,189,191,130,180, 59, 82, 77, 36,237,125,221, 78,238,144,127, 6,203,231, 59, + 7, 81,186,145,148,177,188, 83, 40, 38, 35,178, 44,169,141,246,152,244,104, 86, 48,107,148,179, 80, 13, 68,223, 5,225, 79, 79, +248, 2,153, 75, 63,242,110,135,136, 43,185,201, 52, 33,245, 42, 27,202,192,178,106,114,230,124, 5,160,166,148, 80, 8,254,143, +157,121,221,122, 63,180, 69, 79,134,195, 41, 82, 29, 53,144, 80, 20,111, 22,209,178,169,217,254, 63,123,129,123, 34,157, 44,103, +118,242, 30,109,166,158, 75, 41, 3,191,113,181, 23,202, 84,228,127, 60, 62,152,212,114, 80,111,226,160,121, 51,108,165, 40, 14, +194,128, 50,183,197,102, 21,250, 29,150,160,243, 78,170,153,117,165,235, 81, 92,165,121,157,236,202, 93, 90, 73,182, 16,235,163, + 26, 6, 80,152, 98, 80, 20, 93,105,138, 42, 0,248, 6,209, 58,145,184,105, 32,124,233, 58, 48,232, 48, 30, 61,241,251,212, 9, +234, 10,117, 23,147, 60, 50, 64,136,141,192,126,100,118,165, 84, 13,217, 95, 87,196,172, 21,219,224, 53,120,236,187,154,235,106, +195,129,238,218,186,235,104, 22,220,131,169,120,174,102,152,170,133,175,128,117,129, 51,161,252, 54,217,121,116, 67,165,106, 31, +236,152,205, 1,150, 74, 5,126,207,131,108, 27,228, 33, 0,194,223,139,127,215,169,244, 26,169,181,174, 83, 69,250,222,225,125, +236,251,217,118,102,244,172,145, 53,194,118,132, 53,231,157,118,181,123, 71, 15, 23,225,204, 64,112, 41,124, 91,184, 85,130,119, +178, 26, 97,169, 77, 24, 89, 96, 79, 32, 83, 78,247,105,228,149, 36,175, 39,243, 89,106,213,109,244,208,165, 60,215, 82, 16, 41, + 44,122,192,151,244, 92,192,240,255,150,151,192,241,182,233, 54,185,111,145,227,214, 51, 17, 59,132,165, 38, 13,167,213,135,185, +103, 70,146, 31, 80, 28,249, 99,120,179,245,118, 85, 9,172,202,242,228,249,217,139,119,179,119, 8,120,175,111, 22,223,127,243, +195,235,191, 94, 89, 20,108,138,102,139,249, 98,113, 13,204,209,208, 5, 31,186,135, 79, 62,249,244,143, 63,127,199, 95, 1, 8, + 96,169, 11, 33,203, 60,246,143,103,155, 43, 44,164, 99, 58,236,154,168,171,159,190,251,249,159,203,115, 10, 3,176, 30,154, 3, + 56, 99,199,226, 74,207,241,128,108,190, 62,253, 42, 78,119, 48,187,187, 44, 85,165, 96,214,145, 32, 99, 50,154,120,206, 0, 1, +120, 41,194, 87,216, 21,155, 36, 56,176,135,211,213, 20, 17,207,116,125,117,246,232,139,243,233,133,194, 42, 23, 99,154,139,233, +219, 36,221, 97, 29,151,219, 21, 96,218,154,242,144,108, 25,148,211,222, 15,227,112, 30,204,133, 15,189,112, 56,166, 27,182, 84, +169, 93,181,236, 20,119,252, 9,192,195, 45,239, 22, 60,189,174, 40,227,209, 73,184, 91,166, 25, 53, 69, 63, 63,241,141,187, 14, +237,123,154,194,251,199,235, 89,190,139,149,150,235,178, 37,143,108,185, 42, 91, 20,223, 50, 27,210, 24,232, 66, 27,249,209, 65, +231,206,168, 51,176,137,226,123, 82,101, 85,246,243, 77,245,158,137, 22, 7,201, 82,136,244,223,248, 23, 47,211,215, 27,189, 86, +226, 31,127,251,245,114,187,252,229,236,219,199,135,147,235, 56,196,247,101, 89,230,247,253,235, 96, 21, 1, 91,151,229, 3,111, + 28, 38,187,243,237,251,247, 73,252,236,246, 19,160,150, 40,137,191,252,248,179,109, 18,205,111,230,192,100,148,237, 36,197,155, +148,114,133, 15, 10, 48,124, 60, 28,103, 69, 33,148,157,213,213,234,114,232,194, 4, 37,174,229, 2, 31, 48, 6, 50, 45,132, 65, + 65,188,129, 39,110,234, 67,113, 30,195, 94, 44,195, 85,156, 71, 98,145, 59,210,249,194, 44,249,233,221,167,111,175, 46, 68,225, +160,110,167, 50, 37, 89, 45,169,210,234,120,116, 50, 30, 30,229, 69,209,183, 28,225, 31,236, 4,113,112,122,255,233,106,179,110, +184, 81, 53,146,214,113, 62,182, 20,150, 42, 33,207,103, 6, 22,216,200,119,252, 36,167, 34, 32, 22,105, 96, 15,113, 52, 88, 92, +229,153,214,252,129,223, 48,131,217,166,157,215,165,231, 13,153,166,206,120, 64,112, 87,158,233,142,250, 62, 16, 6,246,114,147, + 85,144,182, 21, 89, 98,145,136, 2, 38,108,228,163, 41,133, 93,164,181,104,123, 1, 2,194, 7, 54,131, 82, 50, 12,212, 50,215, +236,121,204,248,123,125, 16,128,168,107,217,109,219,136,162, 35,190, 95,162,228,135, 24, 67,121, 88, 78, 27, 3, 78,171, 77, 16, +160, 8,144,133,209, 77, 11, 4, 8,208,109,191,171,223,209, 69,119, 69, 23,237, 58,139, 52, 40,138,116,213,164,142,227, 42,142, + 37, 89,148, 40, 74, 35,137, 98,207,185,164, 27,120,101,128,166,135,228,157,251,154,115,207,249,223,191,215,253, 26,245,137,230, +166, 26, 72, 83, 85, 1, 7,207,227,217, 2, 42, 34,144,113,179,174, 32,163, 4,210, 32,115, 15, 43,185,113, 88, 91, 5,157, 12, + 61, 14,137, 5,110,132, 40,234,113, 35,229,120, 53, 33, 94,186,158, 35, 61,236, 68,183,254,189,190,168, 88, 84, 11,106,203,177, + 89,239, 58, 1, 12, 7,159,231, 48, 57, 34, 11, 51,131,162, 96, 90, 86, 57,185, 32, 68,224,185,234,193,203, 81,181,201, 1, 9, +225,230,133,173,175, 11,253,229,221, 62,174,202,201, 85, 20,251,148,214,212,114,108,237,172, 87, 90, 22,239,230, 60,230, 37,138, + 54,142, 98,199,230, 1,172,170,169, 46,177,169, 70,200, 82,225, 8,201, 19, 34, 20, 99, 75, 61,223, 20, 69,197,222, 9,119,166, + 42, 60,162,226, 29,241,116,237, 56, 50, 67,252, 82, 54, 81,131, 57,166, 79,111,110, 54,125,203,245, 81,206, 90,150,168,112,186, +118, 3,110, 26, 30,223,193, 58, 76,153, 96, 97,166, 47,116,102,148, 59, 53, 10, 18, 14,160, 10, 35, 59, 72, 77, 79,183, 45,145, +224,187,164, 68,177,172,154,143,136,209,208, 82,245,206, 43,100,114,166, 65, 84, 9,238,111,120,182, 32,151,105, 64, 50,205, 41, + 37,115, 69,230, 76,162, 93,147,215, 96,109, 65,104,134, 17, 2, 0, 75, 10,216,153, 52, 19, 81,136, 88,164,188, 55, 36,211, 39, +196, 8,158, 35,159, 46,178,113, 54,123,159, 14,166,203,116, 55,104,183,253, 24, 89,231,162, 88,102,171,121, 55,190,141,117, 12, +210, 11,225,235, 85,142,227, 98, 3, 28,180,187,119,147, 94,190,224, 8,207, 70,106, 25,225,177,161,168, 13,197,104,240,168,166, + 21, 7, 77, 74,170, 10,205, 50,145,103,108, 59,204,234,193, 51, 81,211,130,145,224, 35,194,249, 98,109, 90,107,132, 72, 60,140, +136, 49,153,100,149, 90,100,142,237, 33,216,119, 59,119,144,178,237, 54,219,248,163,227,238, 49,254, 59,245,173,102, 87, 21, 97, +153,222,172,191,121,242,237,203,191, 94, 62,236,157, 44, 87,171,116, 60,193,173, 70,179, 17,243,241,178,216,111,239, 99,111, 35, +138,204,151,179, 73,126,253,251,171, 23,113, 24,195,237,162,220,246, 93, 47, 65,154,159, 77,174,166,151,207,191,250,238,124,120, +190, 27,239,165,217, 4, 78,246,167, 23, 63,182,252,214,120, 58,220,139, 19, 98, 43, 13, 51, 66,233,197, 93, 77, 21,144,216,139, +223,124,252,251, 40,185, 63,201,198, 22, 91,246, 29, 78,204,231, 41,124, 1,170,210, 41, 18, 5,138,134, 39,134,188,153,166,215, +244, 28, 23,101,248, 52,159,192,151, 29,180,111, 29,223,126,248, 97, 52,136,194, 38,217, 11,168, 99, 83,174, 86,186,187,123, 48, + 91,100, 17,204,168, 84,108,163, 47,242, 10, 22,221, 63,236,159, 93,253, 3,195,222,138,110,154,216, 6,177,100, 8, 69,228,248, + 99,117,171, 17, 86,175,167, 31,104, 24, 22,225,252,253,131,253,230,103,129, 26,166, 91,173, 23,233, 80,103, 83,153,107, 22, 92, + 87, 53,131,127, 3,170, 35,125,136,146, 31,206,154, 11,230,125, 39, 84, 88,131,225,169, 78, 75, 37, 29, 21, 69, 42, 50, 62,209, +105, 21, 74,213, 42,208,166,138, 44, 94,246,139, 63,126,117,231,207, 92,119,227,232,135, 63,126,254,237,226,245,247, 15, 78,159, +223,127,124,185,200, 9,118,224, 41, 40, 57, 9,124,199, 13,252, 96,134,132, 8, 79,180,211,251,245,253,235,203,124,112,178,215, + 59,253,252,241, 32, 29,161,166,127, 59, 56, 67, 6,240,245,163,211,229, 82, 35,233, 54, 72, 55,226,192,179, 19,254, 83,104, 20, + 79,236,212, 25, 21, 18,164, 60, 76,238, 13,103, 87, 4,164,111,182, 59, 65,140,220, 63,105, 37,248,184,161,227,205,151, 57, 5, +117,229,208,110,205,185,229, 2, 1,155, 34,243, 18,134, 81, 59,190,185,124,171,110, 16,226, 50,124,227,150,141, 42,229,147,147, + 50,226, 28, 28,132, 85, 91,216, 35,136, 79, 93,235,167,253,211,243,143,103,107, 86,108, 28,146,226, 40, 23, 21, 89, 77,250, 16, +131,131,220,207, 30, 61,123, 55, 60,231,152, 18,235, 33, 58,175,253, 56, 89,234,133,141,103, 32,163,170,223,226,220,251, 54, 12, +195,192, 15,191,232,157,244,238, 29, 33,137, 29, 77,198, 54,249,186, 9,206, 78,231,233, 13,117, 60,193, 85,204,147,138, 26,211, +200,163, 93,155, 98,202,145, 23,222, 76, 75, 48,168,224,222,200, 89, 17, 48, 8, 74,148, 60,176,172, 91,248,101,221,133,111, 52, +254, 19,128,166,171,233,109,156,138,162,182, 95, 98,187,142, 99,167,113,147,182, 76, 91,102,152,142,102, 10, 5,164, 25, 6, 9, + 65, 17, 66,136, 21, 35,182, 8, 70,176, 96, 9, 63,129, 63,193,146, 31,192,134, 5, 59,196,122, 36, 54,136,143,129, 41, 82, 25, + 90, 53,208, 76,218,166,237, 36,105, 18,127,196,126,182, 57,247,190,204, 46, 74,228, 36,246,123,247,243,157,123,206, 92,223,131, +145, 48,243,198, 13,243,130, 89,115,165,156,103,184,124,184,224, 56,143,213, 40,199, 90,240, 66,152, 16,119,224,221, 27,111, 97, +219,245, 71, 61,158, 78, 36, 22, 23,165,147, 32,153, 59,130,133, 49, 41,149,131,133,195,245, 55,220, 38,246,186, 77,167,175, 85, + 70,194,228, 74,215, 83,205, 52, 17,203, 79, 6, 71, 48, 59,231, 62,169,166,252,108,150,204,231,171,184,178, 84,147, 86, 84, 16, + 49, 47, 13,190,103,235,202, 54, 44, 19, 31, 99,237,177,233, 50,106,251,166, 36,150, 70,206, 84,176,132,147,220, 90,123,181, 55, +232,242, 17,102,113,103,243,245,211,193, 41, 43,165,177, 76, 12,141,179,228, 88,247,102,109,169,238,144,177,193,167, 40,181,114, + 54,164, 42, 29, 81, 74,130, 69, 26,106, 94,182,194, 39,105,142, 94,177, 5,246,143, 89,213, 23, 96, 94, 21,221, 50,241, 62,126, +158, 42,232, 89,170, 81,198,155,170,101, 34,109, 50, 20, 33, 57,105,129,150, 36, 86, 43, 89, 51,175, 40,179, 76, 79,179,204,177, +204,123,239,191,247,217, 71,159,236,188,241,230, 44, 45, 14, 14,143,227, 24, 21,104,133,233,164,213, 98,115,214,193,160, 29, 6, +222, 10, 68, 20,252, 11, 26,218,161,138, 70,168, 58,142,154,133,185,198, 67,170, 70,221, 22, 46,182,131,197,152,106,188,135,192, + 68,228,112, 4,214,100,172,147, 97, 90, 52,143,206,168, 80, 69,218,200,216, 56,221,100,142, 64, 81, 88,122,102,104,231,233,232, + 36, 58, 63,184, 56, 64,168, 91,243,215,112,151, 65, 61,184, 76,198, 68,219,148,167, 85,230, 94, 94,242,131,186,233, 99, 99, 12, +163, 1,140,161, 86,173,185,182,119,255,221, 79,255, 60,252, 29, 6, 41,136,133,153,245, 29, 53,125, 38, 99, 92, 62,137,199,168, +115,153, 34, 87,192,168,168,131, 71,115,161,212,160, 76, 82, 24,117, 84,119, 60,151,100, 58,168,209,153,147, 71,112, 22,221, 96, +163,189, 33,165,236, 28,255, 35,216, 92,225,136,224,166,225,247,121,134,155, 36, 17, 26, 78, 3, 75,219,233,118,226,217,244,232, +172, 19, 37,147,255, 78, 58,175,220,184,125, 62,232,243, 1, 58,137,142,121,158, 95,200, 2, 25,162, 65,144,208,133, 47, 63,252, +226,225,254,175, 48,170,213,197,231,218,139,237,222,197, 49,210,145,199,221, 61, 20, 37,147,112, 76,160, 47, 25, 11,173,114,119, +243, 14, 74, 58, 92, 82,183,233,137, 34, 73, 68,170, 24,184, 1,204, 21, 81,216,224, 73,250, 92,230,204,102, 90, 82,107,222,208, +215,131, 13,220, 66, 66, 50, 41, 26,241,238, 49,125,141,164,177, 20, 11,254,104,235,202,205,151, 54,182,159, 60,237,141,162, 17, +226, 92,154, 37,215, 87, 55,153, 14,161,248,224,181,123,143, 58,143,130,250, 82,255,178,159, 82,218,104, 44,216, 14,110,144,180, + 44,120, 63, 35, 20, 89, 21, 91,102, 51,238,171, 84, 86,188,118,152, 78,199,225,112,146,140, 37,209,167, 72, 65,243,147, 8,246, + 68, 37,120,187,237,121,183,124,248,119,194,253,147,252, 89,249, 12, 75, 87,114,182, 94,206,211,118,197,204,199, 58, 28,130,207, + 92,169, 39, 51, 76,191,253,230,167,135, 63,236, 38, 63,238, 77, 31,236, 7,184,228,214,117,226,130,207,121,232, 61,231, 22,133, + 89, 33,141,167, 81,172,125,151, 62,248,165,252,227,242,104,165,209, 56, 56, 59,252,234,231,239, 87, 23,150,191,126,251,243, 75, +153, 68,185,244,109,171,223,187,168, 70,122, 54,209,204, 84, 12, 70, 23, 73,153, 5,254,226, 82,173,129, 42,242,183,225,254, 81, + 20,125,252,226,206,147,225, 9,157,157, 90, 68, 72,254,239, 89, 23,241,149, 85, 39,168,225, 69,218, 26,154,146, 7, 21, 17, 15, +121, 42,172,142,107,185,215,218,215, 16,110,195, 44, 12,227, 16,166, 77,186, 43,133,198, 52, 83,102, 11,190,126, 58, 44,244, 57, +112,208,171,249,239,108,239,252,221,125,140, 71,193,148,253,248,251, 85,198,149, 19, 78,117,217,107,165,196,184, 39, 21, 51, 12, + 30,120, 24, 79,240,122,153, 40,131, 98,248,183, 36,141,247,142,254,194,158, 20, 60,165, 70,194, 96, 20,179,145, 38, 10,154,174, + 71,198, 86,202,206,233,161,162,221,157, 19,201,233, 2, 73, 45,209,160,218,174, 99, 58,235,173,231, 7,225, 83,100, 36, 91,235, + 55,145,164,175, 52, 86,154,203,173,151,175,110,239,238,239, 10,165,106,167, 78, 87, 85, 91,147,109,210,183, 26, 40, 77, 74, 37, +145, 86, 22, 8, 42,147,100,138, 61, 86,240, 13, 40, 8, 16,138, 81, 36, 82, 77,183, 53, 73,199,212,171,200, 11, 99,142, 96, 37, + 94,213,166,211, 68,188,249, 95, 0,162,174,165,183,141, 50,138,122, 60, 99,207,203, 51,227,248, 21,167, 64, 29, 43,174, 16, 32, + 90, 34, 94,162, 18, 44, 40, 20,177, 98,211,178, 98,135, 84, 33,129,212, 77,197, 47, 96,205,207, 96,199,134, 53, 11, 42, 22, 5, +129, 16, 68, 8, 1,105,162,212, 49, 25,199,143,120,236,241,188,103,108,206,189, 99, 53,217, 69,178,101,205,124,247,187,247,156, +239,187,247,156, 13,126, 23,169,143,251,210,245, 9, 17, 9, 2, 2,192, 18,167,209,165, 13, 32, 59,249,165,228, 68, 60,101,149, +177, 82,127,122, 60,113,193, 31,201,113,155, 90, 50, 41,248,138,133,220, 20, 78, 40,242, 81, 17,169, 50, 97, 25, 64,189,129,145, +177,207,105,202, 41,112, 73,213,129, 85, 36,241,204, 42, 77,205, 8,200, 5,116,228, 66, 33,183,186,108, 57,101,147, 7, 67,181, +248,130, 50,203,103,119,121,166,153, 90,128,177, 54, 99,190,245,198,243,170,138, 78, 33, 42,108, 22, 15,127, 88, 48,252,202, 34, +116,193, 6,232,254,146, 60,167,165,243,249, 8,124,141,206,183, 69, 49,215,124,200, 53,226,253,216,115,125, 39, 99,144,158,229, +230, 91,120, 64,106,102,164,129, 0, 96,204,108,157, 16,148,230,226,168,106, 82,213, 42,129,192, 96,129,203,101,161,162,137, 74, +137,117, 86,121,206,187, 76, 7, 18,107,252, 7,210, 22,167,220,135, 69, 70,216,108,172, 91,148,116,185, 12, 40,109,168, 74,165, + 66,114,172,247, 63,251,244,157,183, 94,125,244,243,143, 91,166,252,201,221,143, 27,166,126,116,124, 4, 4,134,160, 80,248,242, +118, 3,178,152,142,149,242,185, 8, 42, 28,185, 80, 16,143,147,242,229, 57,157,158, 32,251,203,204, 27, 36,228, 2,130, 43,248, +172,174, 74,150, 33,153,186, 72, 62, 78, 98,145, 57, 9,243,115, 74,208,172, 25, 88, 66, 41,151,233, 88, 71,166, 50,133,247, 36, +130,200, 96,193, 84,100, 36,169,168,137, 5, 29,169,206, 3,162, 31, 76, 6,120,129,187,245,110,167,182,171, 41, 58,114,205, 99, +251, 95,123,110,191,119,253,246, 34,152, 81, 27,153, 40, 78,151,147, 11,215, 65,228,249, 33, 49, 54,108,155, 32, 10,130,196,187, + 90,235,144,170, 26,153, 59, 42, 21,213,140,162, 80,166,128,137,187,173, 61,130,186,220,119,143,226,212,182,174,200,186,236,123, + 94,187,246,204,220,119,226, 44,112, 3,103, 52, 31, 34,203,199,105,136, 50,132, 77,101,168,134, 31,211,124, 96,179,210,228, 30, + 77,145, 66,145,238,163,233,122, 19, 33, 14,108,142, 96,185,255,229, 3,103,230,140,135, 67, 4,216,185, 99, 79,102, 99,236,141, +170, 94,189,182,211, 67,254,253,245,240,151,132,136,173, 0, 54,125,100, 63, 6, 33, 64,194,197, 43, 7,185, 68, 29,242,130, 37, +249, 71, 21,214,253,233,233,138,173,104,201,187, 78,146,194,192,219,177,174, 80,114, 44,172,237,139,193,205, 23,111,158,142,251, +188, 32,235,186,213,162, 78,134, 44,195,107,233,181,122,113,150,188,249,252,107, 79,236, 19,110,137, 67,142, 77,131, 36,220,210, +170,101,177,124,112,114, 48, 15, 22, 97,236,239,119,247,135,179,115, 64,126,234,191,140,188, 39,163, 65,195,168, 47,253, 5, 13, +255,178, 57,225,182,217, 82, 74,114, 16,121,212,128,164, 90,248, 36, 56, 40,235,205,146, 90, 79, 16, 7, 53,109, 75,147,181,221, +102,215, 13,230, 60, 12, 33, 54,172,118, 18,147, 73,242,203, 70,165,246, 74,173, 48,117, 4,194, 76,172, 82,180,137,246,252,250, + 48,151, 95,224, 81,141,167, 54, 20,216, 69,114, 9, 69,233,155,239,254,232,251,137,213, 50,206,146,248,228,108,178,211,159,154, +207,213, 11,207,214,233,222, 53, 73, 25,182, 43, 4,219, 31,245,143,190,253,109, 53,235,253, 30, 69,160,137,141, 98,249,235,131, +239, 15,157,193,131, 27,119,154,186,105, 59, 83, 49, 46,116,196,238,135,247,190,184,254,213, 71, 55, 62,191,253,194,221,119,247, +219,111,103,127, 47,254, 26,254,233, 36,203,151,170,221,135,103,255,216,254,127,141,162, 85,151, 53,164,130,154, 89,245, 99,114, +223, 38, 68, 35, 20, 55, 26,136,236,197,131,136, 10,162, 48, 79, 68, 88, 8,148,189,153, 55,155, 46,166, 52,234, 72, 2, 85, 98, + 62,205,202,116,132,172,168,107,160, 74,161,123,109,187, 71,170,121,161,223,217,238,244, 71,167,221,246,222,120, 49,202,133, 10, + 13,181,162,149,200,167,197,113, 47, 84,252, 58,233,206,164,185, 0, 0,223,238, 82,254, 1, 10,108,154, 59,147,229,136, 24, 56, +245,109,151,243, 52, 40,178, 94, 16,105, 85,166,241, 22, 57, 76, 5, 87, 91, 93,159,196,109,104,124,233,141,189,215,237,153,205, +199,171,132,205,200,217,163, 98, 42,178,226,135,222,186,184,118,188, 5,190,126, 58, 28,220,122,255,214,195,159,126, 88,184,174, +174, 85,232,162,133,106, 70,238,211,144,207,201,102, 88,107,230,184, 43, 84, 8,131,229, 76, 80,102,202,228, 26,253,193,241,249, + 97, 46, 49,182,140,168,176,121, 32,196, 2,141, 70, 35,181,178, 47,208,170, 4,236,159,166,212, 35, 46, 8,255, 11,192,212,213, +244,182, 81, 69,209,153,241,140,191,191, 27,227,102,146,152, 20, 75, 17, 72, 72,208, 34, 36,144,170, 72,172,144,144, 90,144, 42, + 33, 1, 11, 42, 22, 44, 64, 66, 98,193, 10, 33,177, 41, 43, 22,221, 32,241, 35,216, 20,254, 1, 8,218,130, 40, 4,168, 83,218, +166, 46, 65,173,235, 56,254,136,199,246,120,102,158, 61,156,115, 95, 16,108,147,140,243,230,249,221,143,115,223,189,231, 28,251, +119, 37, 21,130,255, 79,165, 34, 28, 81,225,225,191,138,141,169, 99,128, 52,105,106, 6, 51,253,170, 54,156, 59, 50, 47,181, 88, +194, 8,114, 73,192, 25,100,235,148,189, 14,132,243,129, 82,182, 75, 18,241,164,172,164,146,132,103,165,184, 50,154, 13, 98, 81, + 72,192,222,193,225,250,106,134,167,180,140,172,112, 61,134, 82,223, 35,190,128,193, 8,237, 48, 59,204,224,178, 28, 39, 5,111, +137, 79, 5,110,226, 21,171,136,237,226,200, 42,197,251, 94,124,211, 57, 39, 43,146,223, 28,130,160,122,212, 98,225, 56,105, 44, + 19,128, 3,238, 6,201, 56,121,183, 23,122,204, 88,138,111,177,166,167, 60,238, 76, 42,102, 10,120, 48,149,204,137,122, 11,193, +157,104,106,135,230, 49,245, 66, 65, 25, 42,159, 77,151, 79,208, 12,179, 41,248,119,246, 48, 56,142,220,172,242, 11,101, 19,187, +227, 96,121, 84,127, 76, 59,134,227,216,188, 80, 77, 91, 69, 60,156,117,242, 89,163,148,139,107,149, 68, 49,111, 20, 11,201, 15, + 63,120,255,243,203,151,191,187,246,211,141,157,223,247,247,239,191,118,254,149, 90, 37,127,115,183,165, 55,150,145,122, 73,131, + 78,219, 54, 32, 2,147, 11, 21, 7,129,225,195,127, 4,230, 44, 20, 58,118, 86,109,140, 36, 48,136,195, 11,146, 20,139,127,194, +215, 26, 91, 74, 89,112, 98,254,156, 86,105,112,168, 69,170, 59, 90,143,141,179,116, 9,222, 3,167,156, 2, 2, 44, 22,150, 73, +100,210, 78, 49,203,120,144,207, 97,205,250, 22,129, 33, 64, 89,241,220, 10,102,150, 2, 10, 38,119, 99,108,236,245,247, 38, 33, + 16,180,233, 86,220,107,119,190,247,252, 9,203,232,209, 28, 71,244,226, 75,111,127,253,227, 21,172,255,100,181, 33,117, 54, 86, + 5,143,252,225,130,228,204,153,165, 80, 45, 50,249,181, 76,156,191,241,244,168,136,220, 58, 83,154,248, 30,143,144, 90,158,123, +253, 92,103, 15, 80, 76,225, 39,154,191, 22,199,100, 2,171,176, 25,176,145, 19,176, 65,141, 4,115,148, 79,139, 8,159,243, 25, +210,211, 7,149, 92,109,251,233,237,219, 15,111,217, 34,171,246,231, 47,173,235, 59, 87,207,108, 61,223, 29,118,154,238, 22,236, +126, 76,141,198,105,119,216, 45,229, 74,188,210,199,247,139, 3, 46, 28,220, 30,201,120,163,245,149,199,135, 30,241,114,176, 12, +106,185,154,204, 49,150,130, 0, 57, 35, 94,243,164,138, 72,245, 5, 91, 90, 44, 35, 36, 28,103,159, 60, 59, 24,247,189,153, 7, +100,179, 90,117, 79,185, 79, 52,234,141,254,240, 0,231,110,191,215, 70, 44, 1,146,192, 1,115,168,109,105,193,188,223,220,190, +176,115,239, 15,108, 26, 39, 1, 19,196,103,120,253,213,234, 26,118,236,217,230,153, 32,140, 16,171, 96,192, 90,195,147,244,115, +177,217,247, 14,167,129,111, 37,132,123, 71, 5,248,239,110,165, 78, 73, 72,164, 83, 78, 10, 27,232,135, 51,105, 19, 96, 58,137, +208, 91, 76,151,241,171,181,218,198,104, 58,124,166, 92,168,158,174, 24,189, 81, 12, 44, 73,198,145,133,180,144, 72, 90, 44,224, + 84,168,134, 45, 93,168, 57,230,129,198,195,249, 84,171,213,189,242,235, 62, 96,151, 82, 17,194,209, 83,235,229, 70,189,144,196, + 25, 66, 22,149,150,233,188,133,109,252,240,247,238,151,223,254,124,245,110,104,218,189,176,225, 69,126, 38,145,232, 77,188,207, +110,124,179,150, 89,253,226,229,247,110,117,238, 37,103,197, 55, 62,185,228,126,250,156, 57, 74, 95,255,232,230,111, 31,223,110, +127,117,176,225,158,218,124,231,244, 11,149, 87,251,127,181,148, 61,143,149,177, 51,188,139, 67,247, 98,189,137,149, 13,166, 71, +166,214,117,212, 14, 71,244,111, 23, 82, 80,210, 66, 90, 48,106,155, 99, 77, 12, 3,248, 59,183,186, 46, 36, 72,166,241,111, 39, +136,166, 54, 89, 74, 31,228, 60, 8, 86, 79,184,237,131,251, 48,225,195,241, 96, 52, 29,244,198, 61,169, 1,240, 68, 97, 27,231, + 81, 48,158,141, 12,145,110,102, 85,153,122, 39, 66,183,103,152,143, 21,234,156,114, 39, 51,246, 88, 40, 33,185,134, 82,166, 76, + 63, 19,235,153, 24, 67,124, 20, 25, 67, 57, 4, 11,223,205, 70, 50, 18, 90, 60, 24, 60,212, 61, 53, 43, 5,222,171,123,129, 55, +153, 79,143, 38, 99,216, 28,176, 47, 48, 74,169, 84,221,108,108,190,117,233,221,238,110,103,208,235,205,163,112,230, 79,145, 30, +109,173,109, 61, 58,236,176,200,192, 82,167, 69,150,105, 97, 26, 0,134, 64,114,220,172, 55,187,163, 71, 72, 54,218, 7,109,210, + 44,178,201, 66,136,152,180,238,175, 97, 49, 1, 18,194, 68,120,130, 13,236,204, 50,212, 90,234,255, 8, 64,213,245,252,182, 77, +134, 97,127,137,237, 56,142,237,216,206,143,118, 83, 18, 24,234,134,186,116, 43,165, 19, 82, 55,122, 0, 77, 27,154, 58,132,182, + 3, 98, 7,164, 74,187,240, 23,176, 51,151,177, 19,226,194, 1, 46, 8,184, 33, 14, 12, 16, 7, 14, 72, 1, 4, 26, 2,182,142, + 18,105, 98, 29, 77,233, 80,147, 38,105,108, 39,182,227,216,222,251,190,110,167, 33, 85, 85, 21, 89, 85, 62,199,121,190,231,121, +191,247,125,158, 4,223, 15,198, 91,159,240,157,212,229, 2, 0,229,255, 43,242,209,227, 11, 30, 27, 22,163,139, 47, 47,245,157, + 93,248,237,163, 81, 74, 0,107,206,138,152,230,193,246, 73, 38,246,236,195, 93,214, 84,109,229,236,197,187,247,238,128,234, 58, +216, 76,176, 90, 5, 26,135, 34, 56,210,137,154,166,108,241,248,120,229,100,215,234, 16,182, 78,176,232,143,167,151, 0,211,232, +195,192, 37,209,133, 33,218,117, 98, 29,141, 16,132,161, 23,168,134,221,147,164, 63, 41, 20, 2,176, 57, 4,124, 57, 81, 91,128, +175, 28,151,218, 55,149, 71,212,198, 17, 78,124, 65,198,140,221,128,140, 30, 40, 62,156,139,135, 99,215, 80,205,189, 81, 63,121, +225,192,174, 13,191, 26, 57, 81, 41,155, 83,136, 44,153, 56,175,139, 19,234, 52, 10, 3, 6,128, 59,178,185,193, 48, 30, 58,209, +192, 9, 29, 39, 26,142, 34,215, 69, 47, 2, 32,218, 49, 78,187,161,186, 20, 69,160,249,177, 44, 9,151, 94,189,188,252,226,249, +198, 79,119,100,201,124,243,202,234, 7, 31,126, 28, 68, 66, 20,139,247, 55,182,183, 31,118,175,174,190,229,187,225,207,183,254, +224, 80,151, 1, 64, 71,233,136,198,159, 57, 44,179, 80,111, 64, 74,195,174, 74,150,147,152,136,245,119,150, 17, 64, 42,165, 65, + 58,192, 82, 2, 44,235,167, 88,200,232, 56,151,151,112,210,142, 10, 34,128,250, 56, 53,142,120, 45,103,211,120, 48, 43, 11, 57, +153, 7, 64, 7, 57,146, 67,250,142,114,129, 75,198,196, 34,228,194, 73, 26, 81, 28,226,244,150, 63, 78,133,176, 91,176,216, 97, +126,103,216,201, 49,201,204, 21,237,192,202,241, 42,108,222,148,101,129,231,216,176,218, 75,103, 46,255,208,108,148,180,114,189, + 90, 7,106, 12, 11, 55,212, 18,124, 68,176,251,142,201, 46, 20,249, 5,207, 15,253, 17, 79,123,191,237, 89, 23, 78,173,140, 3, + 0, 56, 15, 30,229,245,219,235, 69,109,170,107,119,242,104, 24, 23, 81, 36, 47, 63,109, 86,108,167, 71,133,248,104,228, 59,192, + 30,128,106,192,245, 41,242, 47, 2, 8,213,228, 60,168,249,245,214,159,158,239,158,157, 63,255,242,115,203,141,187,141,211,245, +165,102,171, 25, 69, 1,236,235, 35,223, 54, 20,243,234,185,213,181,127,214,151,113, 58,116, 27,216, 31,165, 46,160, 37, 17, 6, +131,120,118,123,176, 3,207, 12,144, 98,203,179,168,227, 16, 83, 65, 22,142,204, 15,199,163,222,160, 23, 68,147,103,166,143, 0, +211, 71,223,152,157,141,246,160,187,213,109, 77,233,101,248,255,221, 65,151,143,216,110,191, 61,240,246, 18,153,187,244,236, 18, + 72,141, 82,190, 72,115, 55, 54, 44,185,185,121,207, 80,117,156, 16,137, 39,115,181, 57, 80,235,190,239,247,237,254,133, 83,231, +214, 30,172,153,138, 1, 88,131, 44, 76,206, 79,176,115, 95,152,173,204, 42, 82,206,118,173, 12, 74, 47, 65,149,148,130, 86,124, +237,133,139,183, 55,224, 98, 29, 56,144, 78,109, 69, 39,170,245,135,189,255, 74, 90, 9, 52, 13,108, 25,192,202,108,167,195,241, +217,186, 32, 20,159, 47,112, 61,139,141,125,108,233, 78,114, 4, 25,229, 56, 36, 93,219, 20, 40,126,224, 89, 72,163,122, 52,107, +121,179,113, 95,207, 8,139,135,243, 79, 23,180,146,146, 53, 36,201,200, 1, 85, 5,194, 46,114, 94,154,251,177,245,219,123,223, +125,254,197,173,191, 7,142,168, 9,121, 49,207,216, 81, 69, 45, 46, 78,207, 92,255,245,171,102,255,193,181,249, 43,105,216,220, + 28,246,198, 39,239,112,179,220,247, 71,127,121,247,253,235,139,238,201,249,211,115,147,190,255,246,167, 55, 62,251,232,219,215, + 95,122,101,230,216,153,193,230, 95, 66, 42,252,230,223,223, 91,174,181, 82, 89, 24, 5, 52,249, 72,197, 10,184, 9,166,170, 91, +174, 13,239, 82, 87,140,167, 74, 85,184,111,240, 7,124, 46,128, 6,182,231, 36,181,114,192, 19,207,163,206, 28,173,204,200,169, + 27,221, 15, 57, 76, 52,196,120,213,137,191,131, 61, 54, 88,200, 46,227,233,136, 68, 19, 3,184,110, 69, 82,170,197, 26,220,112, + 33,149, 76,188, 99,238,101, 81, 53, 3,116,163, 66, 73, 3, 27,231,148,113, 8, 68, 85, 70,144,106,133,218,158,187, 39,241, 64, +177, 4,156, 81,216,247, 3, 32, 7, 2,150,128, 44,191,239,210,130,242, 1, 37, 81,197,172,194, 82, 60, 60,224,197,216,209,140, +152,145, 50,248, 35, 3,129,226, 69, 0,144,206,110,167, 16,231,191,190,249,229,112, 56,194,209, 31, 42,248,180,251,109,160,212, + 37,181, 12, 79, 17,145,109,110,230,240, 49, 16,196, 89, 94,134,167,102,171,179, 25,147,247, 36,122,193,166,165,178,126, 8,244, + 28,123,194, 4,158,142,190,176,116, 81, 84, 75, 91,189, 22, 77, 87,225, 27,125, 36, 0, 85, 87,215,219, 54, 25,133,109,167, 73, +108, 39,177,155, 54, 89,211,134,176,118,107,217,150, 78, 67, 64,216, 52, 9,198, 0,105, 8, 81,208,212, 59, 46, 17, 87,227, 2, + 42, 4, 18,119,136, 91,254, 4, 55,211,184, 67, 2, 36,126, 0, 21, 84,168, 82, 53,166,110, 93,187,165,221,250,145, 14,199,249, +112,226,248, 35,254,120, 57,231,188,233, 16,215,150, 18,235,181,125,206,115,206,121,206,243, 96,124,231,107, 77,162,200, 78, 44, +113, 17, 59,227, 42, 7,160, 79, 9,245,120,197,255,201, 61,143, 58, 68,163,212,207, 4, 34,141,162,227, 7,156,181,196, 36,168, +119,208, 98,152, 5, 92,206, 82, 56, 49,220,131, 18,120,115,251,111,146, 92,151,136,167, 40, 17, 57, 63,152,153,168, 88, 54,193, +121,241,191, 2, 2,130, 59,246,249,216, 72, 8,147, 28,233, 0,168, 4, 83, 90,217, 9,108,190, 32, 10,101, 59, 58, 37,201, 26, +100,136, 49, 41, 73,187, 39, 88,218,121,196,128,214,213,113,127,136, 18, 38,141,246, 33, 59, 25, 60, 62,191,113,145,187,220,145, + 91,108, 58, 9, 56, 53,129, 62, 59, 1,118,102, 6,238, 96,110,234, 44, 22, 22, 56, 66, 1, 12,174,210,184,216,129, 90, 1,167, + 11, 56,102,101,138, 42,219, 30, 20,227, 82, 18, 53,246,164, 33, 73,225,241,137, 49, 14,217, 35,206,183,197,131,229, 26,128,220, + 50, 11,176,200,181, 55,222, 92,249,230,251,115,139,175,152,199,117, 45,155, 93,188,120,241,135,219,119, 8, 83,136, 16,249, 30, +213,159,180, 76,227,203, 47, 62,223,217,169,239,236,238,225,168, 21,189, 49,177, 62,204, 41, 82, 86, 77,232, 89, 73, 77, 75, 25, + 85,164,197, 97,106,101,209,118, 9,194,208, 56, 1,231,231,161,157,168, 59, 28,250,128, 79, 6,128, 54,237, 0,192, 59,196,125, +199,101,142,131, 70, 31, 40,253, 17, 35, 35, 48,163, 66, 88, 20, 85, 69, 84,101,145,182, 79, 41, 31,162,100, 60, 81,160, 41, 32, +224,214,120,196,134, 33,113, 49, 73,110, 1,165, 93, 21, 49, 82, 32,144,246,207, 77, 84,223,190,116,237,238,254, 6,100,214,178, + 94,182, 60, 43,171,104,189,129,115,216,218,159,206,151,215, 31,175,165, 83, 16,145, 25, 61, 47,194, 34,104, 62,151, 83,100, 25, +183,254,226,104, 58, 95,113,176,159,200, 32,160, 27,150, 81, 41,204,250,161,235, 6, 78,171,247,143,132,202,189,254,245, 75,111, + 89,125, 43, 70,225, 35, 83,207, 78, 64,224,131,231, 5,152, 23,128,155,209,105, 36,104, 63,127, 12, 77,208,101,223,247, 18, 68, +214,188,121,245,163,181,135,127,154,221, 14,224,128,131,214, 97,136,110,212, 84, 74, 15, 93, 57,169,172,222, 95,173, 86,206,175, +110,173,162, 61, 86, 24,233,170, 86,155,191,114,212, 62,234,187,214,167, 31,222,218,216,254,235,221, 87,111, 44, 44,156,223,169, +111,194,129, 4,240,127,161,119,220,110, 64, 12, 45,106,147,237,190,169,201,250,163,163,135,141,118,163,144, 43, 84, 43, 47,213, +230,107,245,198,227,129,107, 79,230,198, 19, 72,190,234, 2,118, 90,170, 45, 25,221,103, 7,205, 3,219,181,170, 47, 94,128,119, + 6, 71,133,164, 77, 49, 55,117, 6,165,108, 94, 95,218,124,122, 63, 64, 82,169, 88,202,151,224,110, 25,154, 89, 62, 67, 95, 13, + 33,254,224,181,247,225, 31,253, 40,104,118,141,140,156, 1, 96, 8, 79, 11,162,191,141,163,239,246,189,189,187, 17,177, 98, 61, + 40, 77,227, 32,147, 82,247,205,167, 99, 9,254, 98,147, 61,136, 24,207,205, 84, 33, 14, 46, 42, 66,241,234, 41,161,219, 19,194, +161,136,164,180,240,185, 95, 11, 22,201, 36,170,192, 9,245,220, 19, 40, 66, 10,191,100,153,129,211,142,207, 78,230,245, 52,164, +126, 57, 55,166, 78,230, 38,180, 23,102,132, 66, 65, 48,156, 63,110,255,126,231,183,245,173,110,223, 75, 67, 29, 45, 41, 16,120, + 68, 45,136, 74, 77,167,219,178,154,223,174,255, 82, 72, 21, 87,170,239,117,122,241,199, 63,125, 39, 64,166,187,206,142,237, 39, +159,253,120,171,252,213,180, 50,159, 42, 45, 23,150, 63,185,241,224,231,123,239,252,186,188,178,240,245,194,203, 87,204,163,141, +181,227,237,150,103, 94,158,170,230,146, 41, 56, 19, 78,159,117, 67, 23,170, 55,190, 86, 78, 37,151, 1, 95, 98, 65, 47,246,220, + 30,228, 87, 72,117,240,105, 67,148,183,157, 62, 84,240,249, 92,254,242,133,218,131,253, 45,100, 0, 70, 1, 92, 82,146,242,236, +169,211, 29,187, 19,113,177, 56, 22,245,125,248, 12,134,163,116,134, 90,202,126, 23, 9,181,196,168,225, 94, 89, 2, 67,135,172, +145, 98, 39,162, 98,155,220,128, 73,106, 46,240,124,143, 86, 1,131, 19,103, 94,222,206,138,121,225,192,183,254,199,179,227, 40, +100,130, 13, 80,134,186, 11,156,121, 57, 90, 1, 18,104,199, 17, 53,157,176,203,204,216,233,242,108, 90, 86,118,247,118, 5, 34, +157,135, 1,118,102,232,106,100, 57,180,104, 41,160,224,140,105, 53,169, 62, 96,220, 95, 19,237, 19,232, 71, 1, 34, 0, 28, 41, +233, 51,118, 96,115,163, 39,120,115,114,138, 86, 41,206, 53,123, 6,146,244, 49,235, 36, 84, 52, 60,136,254, 21,128,168,235,249, +109,155, 12,195,113,236, 38,118,236,116,113, 26,234,132,118,253,153,164, 43,218, 96,173,134, 90,137,105,128, 4, 92,118, 24, 32, +206, 27, 7,142, 28, 42, 36, 78,112,168, 16, 66,112,228,111,152,128, 11, 71,132, 24, 84, 8,212, 77,128, 24,234, 97,226, 71, 89, + 27, 72,215,180, 89,126,219,137,157, 56,110, 28,158,247,117, 34,238,142, 29,251,251,190,247,125,190,247,123,222,231, 25,215,223, +169,209, 60,112,151, 27, 9,244, 98,199, 77, 50,123,253, 78, 84, 82,206,124,106,255,145, 72, 62, 37,112,200, 28,146, 84, 54, 91, +148, 5,226,145,129, 68, 24,107,155, 80, 89,166, 71,164, 23, 63,160, 92,145,230,240, 89,223, 39, 67,118,133, 8,137, 82,100, 46, +181, 80,119, 26,220,213, 74, 81,197,114, 76, 58, 48,101, 87,141,241, 33, 42,253, 1,118,195,242,134, 99, 79,240,160,169, 44, 34, +201,212,182,138,221,116,114,182,108, 61, 22,153,103,198, 54,146,212, 1, 63,100, 42,219,148,102,224,157,186,110,219, 23,252,240, +168,224,200,158, 37,130,143, 77,137,199, 70, 66, 35,222, 43,229, 30,252,204,235,115,229,139,186,192, 88,116,211,178, 77,219,237, + 32, 87, 1,210, 48,155,219,167,221,107,224,143, 41, 14, 69, 49,148,121, 82, 33,147, 13,242, 36, 27, 34,169, 69, 35, 34,208,116, + 76, 9, 3, 26,211,137, 43, 49, 91,200, 22,135,205, 45,153, 87, 76, 22,151, 4,154,140,164,246,252,213,245,129,107,125,254,217, +237,197,249,121, 93, 79,124,187,179,163,170,138, 26,149, 52, 57,162, 42,145, 66,177,160, 76,136,175,223,184,190,123,247, 71,252, + 54, 26,149, 56,196, 11, 44,241, 70,167,181,136,215, 61, 55,212,182,125, 32,179, 64, 7, 34,192,245,184, 24, 65,253,153,213,167, + 62,249,240,131,119,183,182,222,120,245,198,149,181,117,160,134,163,226,177,227,244,136,106,142,100, 77,181, 91, 73, 83,164, 4, +214, 46, 73,120, 9, 72,133,184, 91,215, 13, 97,254,123, 52, 57, 5,198,152, 99,255, 23,150,250, 3, 90,150, 35,228,255, 64,117, + 78,162, 65,115, 63,179,232,253, 91, 63, 42,156, 28, 32,168,229,211,171,189,129,131, 28,131, 0, 93,172, 29,112,103,157,147, 58, +151, 50, 59, 45, 86, 80,161,173, 38,240, 14, 18, 63,233,187,145,168, 68,127, 24,198,115,123,193,206, 11, 72,164,214,174, 54, 59, + 85, 12,235, 92,106,190,110,215, 73,122, 41,170, 20, 43, 69,108,164,114,153, 11, 21,171,204,189,163, 54,139,196,246,155,157,250, +128,178, 25, 17,117,150,210,185,110,207, 65,212,110,119, 59,166,221, 42,156, 28, 98,236,214,243,235,150, 99, 45,166, 23,211, 9, + 3,219, 85,118, 90, 23,146,113, 29, 57, 3,243,195,116,154, 51,201,153,118,183,157,159, 89,217, 59,188,143, 24,129,237,252,253, +253, 95, 0,168, 75,149, 82,169, 92, 34,198, 20,159,168, 99,166, 97,145,148,137,212,248, 44,160,180,145, 74,231,206,175,104,146, +220, 31,120,165,218, 81, 46,147,221, 63,222, 71,252,221,126,235,163,159, 31,236,174, 45, 93,198,130, 60,174, 62, 66, 86,221,200, + 93, 89,202,228,255,122,244,199,164, 28,119,122, 14, 54,203,155,249, 13,172,189, 74,171,242,240,244,161,221,163,192,132,155, 35, +188,108,172,108, 46, 27, 89,211,177,240, 89, 48, 68,143,155,167,118,223, 94,157,201, 19, 39,218,117, 72,252,157,139,191, 24,105, +124,246,107,151,174, 86, 91, 85,228, 98, 73, 32,247,224,164,150,212,181, 4,151,110, 93,106,161, 36,255,153, 39,106,205,195,185, +204,211,107,106, 58,118,209, 15, 89,157,144,231, 9,136, 31, 92,235,160,206, 85, 38,159, 18,119,129, 73, 89, 35,149, 66, 6, 61, + 68, 66,118, 99,178, 26,211, 38, 85, 69,139, 39,147,122, 66,215,227,170,220,170,214,239,124,247,219,157, 95,255,252,187,105,121, +146,132, 52,226,178, 53,162, 28,145, 98, 97, 5,241, 61, 34, 10, 63,157,252,243,195,233,222,205,229,151, 22,165,169,215,182,223, +199,205,171,183, 76,117, 75, 62,255,229,188,253,125, 99,103,251,211,111,190,186, 93,248,122,247, 82,231,133, 23, 63,190, 86,250, +226,248,205,123,239,188,247,220,219, 89, 49,253,160,177,183, 87, 63,152,158,156,189,168, 79, 59, 64, 22, 84,242,240,151,141, 5, +147, 37,248,243,153,101,198, 54, 98,102,106, 22, 33, 5,227,139, 44,107,118, 45,234, 41,165,230, 58, 42,241,165,207, 25,119,127, +191, 71,226, 30, 19, 17,140, 75,223, 3, 68,112,171,102, 13,171,249,149,203, 47,151,234,101, 93,213,153,208,238,135,199,181,117, +220, 57,107,100,241,157,233, 67, 12, 7,136,140, 23,102, 87, 26,157, 22,158, 29,136, 59, 35,152, 76, 8,225,100, 60, 5, 88,173, +107,250,220,244, 66,211,106,140,188,143, 88,134,146,245, 33, 36, 67, 55,144,221, 55,179,155,165,230,169, 79,210, 8,126, 96,237, +132,235, 98,114,156, 28, 92,195, 82, 66, 35,147,107,126,137,192,150,143, 42, 15,212,157, 20, 18,106,181, 10,139,202, 80,111, 15, + 85,208,184,201,153,253, 76, 72,103,147,218,158,207, 6,180,212,124,142,175,124,227,255,141, 59,132,161, 77, 69, 33, 70,201,124, + 17, 38, 79,205,172,132, 2,228,207, 47,201, 18, 5,161,255, 4, 32,234, 90,122,219,168,194,232,248, 49, 51,126,204,120,226,146, +184,142, 67,109, 37, 4, 7,146, 10, 82, 32,108, 10, 84, 77, 75, 85, 85, 40, 82,139, 42, 22, 93,177, 0,254, 0, 27,164,110, 88, + 35,216, 33, 80,251, 7,144, 16, 43, 36, 84, 36, 22,149, 44, 33, 85, 1, 41,173, 64, 40,113, 72, 49,182, 83, 59,177, 61,126,204, +120,222,119,248,206,157, 68, 72,217, 57,126,220, 59,247,123,222,115,206,119,226,223,227, 24,251, 43,177, 19,109,201, 24,183, 67, +159, 75, 72, 2, 97, 60,147,153,165,196,138,235,169,128,199, 37,112, 96, 63,227,228, 49, 56,184,152,136, 12,215,115,184,128,177, + 16, 93,224, 8,255,123, 80,198,245,202,233,108, 72,203,197, 42,157,242,169, 13,198, 1,125,194, 43, 11,235,157, 97, 39,129, 93, +166, 53,249,209,241, 11,248, 13, 61, 4,112,152, 95,200,205, 83, 50, 14,135,238,218, 2, 39,102, 56,174,105, 90, 19,250,241, 35, +107,196,141, 48,193, 39,142,240,185,229, 44, 88, 42, 86,245,105,143,138,122,232,241, 71, 50,189, 97, 4, 10,141, 16, 67, 40,154, +152,224,171,114, 14,109, 86,136,249, 81,209,164,138, 66, 50,224, 65,242, 84, 97,159,183,141, 48,108, 47, 76, 73,105, 46, 39,130, +155, 14,244,230, 18, 48,179, 36,203, 74, 82,194,114, 25, 37,197,230,148,130, 46, 74, 51,126, 49,137, 57,150, 82,146,188,188,160, +164, 19, 73, 9,240, 68,114,205, 96, 15, 98,196, 3,244, 94,158, 54,219,191,214,106, 15, 30,252,244,251,206,159, 87, 54, 47,107, +138,242,176,246, 80,203,202,178, 20, 79,165, 18, 42,135,198,183,155, 79,175, 93,189, 52, 53,198,207, 58,109,138,235, 23, 86, 87, +198,227, 17,121,166,120, 8, 54, 22, 25,172,105,251,134, 69, 81, 52,244,188,208,241,248,229, 45,159,224,126, 70,205,221,251,230, +235,209,200,184,119,255,126,173, 86,163, 77,125,127,235,189, 59, 31,220,108,181,234,134,209,215,148, 20,200,221,114, 92,194,196, + 11,250,255,168,242, 32,207, 30,218, 46, 72, 20, 20,177, 37,112,168, 99,185, 44,149, 11, 73, 53, 67,165, 37,128,249,156,126, 0, +188,153,143, 76, 16, 95, 23,184,204,154, 50,215, 15,117,203,148,168,226, 9,134,131,105,223, 97, 78, 65, 41, 90,190, 91, 45,189, + 60,164,116, 19,106,242, 48, 3,112, 49, 56, 87, 88, 76,136,190,135, 33,218, 20,185, 79, 25, 50, 40,158,148, 20, 88,227, 33,151, + 4,215,205, 65,113,166,244,225,187, 31,255,219,109,144,243,162, 66,138, 28,171,110,244, 86, 74,171,250,164, 79,245,193, 98,225, + 5,122,184, 34,159,138,181,116,118,249,160,179,175, 41,121, 11,148, 69, 63, 43,229,110,221,188,173,247,245,214,241,161, 9,109, + 12,167, 92, 56,215, 31, 29,189,189,246, 78, 79, 63,162,168,163,166,178, 92, 89, 77, 80,101,245,197,114,117,123,239, 17, 61, 60, + 50, 96,219,119, 77,219, 64, 32,141,129,229, 23,130,150, 2,198, 83, 42, 41, 11, 72, 33,141,243,149,243, 79, 14, 30, 99,104,173, + 99,247,134,199,100,159,160,212,170,179,197, 74,101,208,235,110,255,245,232,104,216,189,248,210,198, 94,235,111,138,232, 90, 70, +203, 43,103,234,135,187,175, 45, 93, 56,155, 47, 12,205, 33,121,129,242,220,185,221, 86, 61, 9,156, 82, 88,158,171,200,208, 36, +232,143,141,209,254,225,110,163,219,120, 99,249,245,118,175, 73,139,186,177,113,157, 92,137,229,216,165,252,188, 4, 42,123,210, +114, 76,219,115, 96,243,192, 92, 57, 0,132, 49,246,156, 58, 75, 1,192,176,141, 92, 90, 85, 51, 10,101,187, 74, 58, 75,139,165, +253,118,221,201,196,233, 61, 47,176,194,134, 38, 88, 83,193,179, 5,204,138, 99,156, 62, 18, 17, 51, 35, 56, 90,156,247, 35,133, + 72,171,132,182, 69,161,248,235, 45,196,253,132, 44,228, 10,233,226,104,218, 57,248,167,243,219,126,115,167,217, 61,118, 28, 23, +138,148, 84,146, 7, 22,162, 56, 46,165,148,148, 56,175,204,190,185,124,123, 50,238,125,249,248,231, 35, 91,255,116,105,235,226, +229, 59,217, 79, 10,119, 23, 63, 95,175,172,106,223,106,221, 31, 26,223,125,245,133,173, 4,105, 85, 9,115,177, 39,251,191,188, + 26,223,220,250,232,198,221,239, 63,107,255, 17,108, 93,185,213,109,108,255,120,184, 19, 36,228,235,243, 43,134, 7,177,198, 32, + 22, 46, 22,202,157, 1,249,229, 25,203, 54,105, 93,200,166,173, 73, 90, 76,175,149,215,158,233, 29, 96,124, 35,132, 55,135,180, + 93, 90,125,107,183, 93, 23, 69,192,202,242, 25,109,226,154,115,188,172,167, 12,160,126, 88, 15,192,170,163,183,163, 12,226,140, + 31,176, 79,233,200,105, 89,173, 63, 62, 22,209,178,164,236,164, 90,111,239, 5,130, 79,249,216,213,245, 77,170,231,128,228, 9, + 65,192,166, 83, 59,177,199,232, 37,248, 60,245, 12,152, 36,201,213, 18, 5,131, 1, 71, 9, 2,156, 26, 93,224,163,209,199,207, + 52, 85, 15, 12,106,170, 62,207,147, 64,210,142, 69, 9,124, 36, 4, 39,208,211, 47, 99, 98,146,103,147, 81, 3,138,227,241, 63, + 74, 58, 3, 62,191, 11,237, 37, 70, 65, 75,199,109, 4, 59,213,229, 59,233,145,199,133,248, 9,127, 41,140, 24, 60,120, 13,114, + 35,129, 95,202, 47,140, 32, 88, 13,223,203, 7,166,250,188, 35, 23,251, 79, 0,162,174,165,183,141, 42,140,142,237,121,250, 49, + 30, 59,142,147,180,117,210, 52, 1, 66, 30, 80, 76, 34, 18,146, 34, 26,145, 72,236, 90, 9,118, 72,252, 1, 54, 32,193, 50, 98, + 89,177, 98,193,134, 93, 5, 18, 72, 32,118,116, 1, 82, 87, 5,129, 4, 18,155, 54, 24,170,214,177,131, 29, 63, 38, 19,199,118, + 60, 79,143, 57,223,189, 9,172, 60,155, 25,207,220,199,119,191,243,221,115,207,249, 63,190, 7,204,239, 49,196, 72, 58, 87, 0, +227, 21,118, 42, 54, 48,174,143,112, 33, 35, 36, 92,248,116,209,163,241, 43,137, 74,223,237,197,201, 27,132, 83,185,185,221,210, + 57, 18,192, 39,144, 9,195,212,130,217,109, 55, 58,117,100,193,196,158, 12,217,100,182,233, 56,162,166, 36,241,239,164, 97,194, +248, 65,200,208,159,153, 92, 80, 36, 21,112, 44, 8, 92, 31,121, 42, 99,218,224,177,154,172,112,254, 53, 91, 63, 9,106,169, 82, +124, 56,226, 55,162,101,181,211, 51,139,172, 20,153, 26,103, 32, 12,201,202, 89,210, 60, 4,104, 46,116,201, 15, 30,179, 88,131, +187,240,194,170, 2,108,225,219,110,159,212,121, 4,214,133,172,200,162,201, 73, 18, 96, 27,210,224,224,166, 13,236, 83,168,250, + 35, 81, 49, 71, 33,142,171, 68,226,244,170, 68, 59,159,164,216,136, 62,115, 4, 7, 49, 23,235,148, 31,181, 29, 32, 62, 50,129, + 39, 99,154, 88,132,220, 75,197,136, 76, 92,215,232,198, 43, 27,171, 47,173,253,244,203,239, 47, 23,139, 51, 87,231,191,249,238, +158, 31,198,194,161, 24, 14,201,140, 33, 24,138,205, 86,167,248, 98, 81,215,141, 7, 63,255, 58,150,205,124,114,231, 78,187,121, + 84,169, 86,226,113,153,237,187,114, 54, 61,137,208,224, 66, 67, 19, 0, 61,224, 13,132,225,250,218,245, 27,155, 27,123,123, 31, +149,203, 37,219,177, 42,149,191,126,188,255, 61, 2,250, 91,183,223, 44,149,126,139,171,163,172, 33, 41, 10,222,153,237,237,179, +163,162,100,218, 35, 70,207,149, 36, 88, 58,199,209, 6,179, 41,136,132, 12, 46, 32,187, 32,149, 64, 74,187,169, 12, 69,116, 76, +230,157, 69,178,120,146, 56,136,208, 78, 78, 74, 82, 83,146,238,133,110, 74, 73,150,205,199,180,239, 75, 27,216, 67, 38, 69, 75, + 68, 85,172,116,128, 68,219,215,111,150,155, 85, 70, 77,163, 35,245,104,219, 75,217, 43,182, 55, 72, 42, 9, 52,240,246, 11, 59, +120,164,217, 53, 75,213,125,210,213, 34, 55,203,163,102,167,158, 78, 26,102,167,129,117, 66,140,201, 39, 93,147,233, 60, 19,133, + 8,128,199,245,200, 77,165,211, 63,126,246,242, 66,165,121, 96,157,152, 17,159,186, 12,179, 8, 19,181,239,216,155, 75,235,115, +151,230,244,164, 1, 4,242,180, 85,102, 30,129,163,214, 73, 3,113,115,253,185, 13,100, 15,249, 76,174,218,170,168, 10, 63, 33, +128,213, 74, 40,228,166, 49,130,229,152,140,135, 52,172,250,214,242,150, 38, 41,255,152,181,124,102,162, 55,232,162, 1,110,172, +108, 90,167, 22,210,142,122,171, 30,146,193,158,240,218,210, 86,179,211, 64, 26,158,211,199,124,207,173,153,117,204, 85,199,115, + 15, 26,149,190,131,175, 35,224,210,181, 79, 49, 22,232,192, 45, 59, 43, 10,192,186, 50,187, 12,108,182, 56,189,248,231,225, 62, +134,100, 82, 73,181, 59,173,129,221,195, 91, 21,198,175, 28, 52, 15, 60,151,182,172,119,215,118, 87,231, 87,159, 30, 61, 1, 38, +204,235, 99,128,240,220,154, 25, 67, 25,161,191, 71,185, 63,159, 80,126,207, 62,166, 99,109,241,241, 25,193,155,122,117,156,228, +124,125, 55,130, 97, 28, 9,207,173, 56,254,115,217, 99, 51, 59,100,167, 46,168, 67,209, 69,214,220,254,145,241,224,176, 93,106, +251,134, 31,241,163,237,138,213,235, 7,129, 77,230,148,136,233,184, 32, 13, 76,164, 19, 46,243, 32, 76, 41, 50, 80,101,205,140, +182,122,214,231,165, 31,214,211, 43,239,205,191, 93,184,123,243,238, 27,223,126,245,248,203, 15,191,254, 64, 24, 19,238,189,251, +169,154,209, 10,250,164, 22,147, 13, 81,239,140,122,165, 71,247,151,119,118, 54,251,219,239,255,241,206,222,244,199, 87,141,236, +103,143,190,176,194,240, 86,161,232,142, 28, 38,227,154, 62, 27,244,109,207, 77,199,147,103,174,131,213, 17, 88, 16,241,154, 60, + 29,153,243, 4,167,173, 51,178, 55,213, 87, 15,143,107, 30, 2,151,168, 50,147,238, 76, 58,110,212,145, 77,147,182, 1, 1,231, +231, 47, 47,250,129,187, 52,179,132,136, 92,156, 47,246,237, 65, 90,211,231, 38,174, 17,196,244,108, 82, 29, 71, 54,237, 15,144, + 74, 2, 18,229,141,137,135,213,135,172, 90, 67,230,204,204,120, 28,249,153, 56,153,158, 66, 30,240,250,173,221, 39,165,191,179, +233, 92,253,184,230,122, 54,218,204, 39,233, 89,162,198,158, 49, 66, 23, 23,241,194,168, 96,235, 49,177,179,140, 68,118,194,200, + 11, 35,198,243, 38,146, 8,201,149, 16, 89,121,132, 9,229, 98,213,207,165,114, 64,159,164, 85, 71,226, 66, 1,139, 93,164,253, + 71, 34,145, 84,186,136, 8,124,123,153,251, 30,141, 46,194, 47,227,192, 25, 9, 35,147,200, 58,129,205,125,161, 79, 7, 29,190, +114,207,230,103, 1,116, 40, 61, 29, 13, 53, 57,241,175, 0, 84, 93, 75,143,219, 84, 20,142,223,118,156,216,241, 36,147,215,180, + 51, 81,146,182,104,250, 80,135, 81, 91, 22,101,129,104, 97,129,170, 22,196, 2, 9, 65, 5, 66,229, 7,176, 64, 32,177,131,174, +216,179,132, 63, 0,108,144,232,130, 17,237, 12,168,116,131, 88,160,106, 58,165,180, 37,208,164,121, 59,126, 36,177,227,132,239, + 92,103, 1, 82,148, 77,156, 40,190,199,247,156,239,156,123,206,247,241,255, 81, 2,143,211,115, 38,253,176,124, 24,232, 62,169, + 55, 36,241, 63, 33,215, 24,121,193,239, 15,188,129, 27,142, 16,209,177,212, 65, 52,137,161,123,146,234, 48, 44,135,161, 63, 4, + 48, 30,149,179,229,191,123,127, 33,152, 9, 84, 41,166, 58,138, 76, 13, 0, 60, 41,140, 36,120,127,234, 6,193, 56,102, 78, 96, + 5,107, 97,191,121,119,232,245, 99,166, 28, 86,102,141,143, 56,145,215, 76,129,166, 5, 65,164,142, 73, 66, 36, 9, 63,244,168, +222, 66,170,158, 20,111, 1,196,240,111,227,233, 86, 18,126, 11, 3,138, 76,140, 52, 63, 98, 43,131, 21, 97, 20,254, 33,233,123, + 4,190,227,219,128, 66,149,194, 81, 70, 56,206,154,200,217, 48, 85,192,104,184,153, 40, 1,157, 61, 16,130,101,105, 50,113, 99, +205,194,141, 92, 5, 8, 14, 72, 87, 21,216,208,169,200, 3,219, 18, 75,210,156, 38,155,152,133, 22, 41,141,203,164, 4,211, 64, +142, 47,100,116, 92,198, 17, 45,191,136,187,139,218,205,214,133, 23, 47,228, 45,115,119,119,175, 92,200, 31,171,148,116,124,170, +176,240, 78,197,184, 16, 43,177, 90, 40,113,156, 50, 24,250,175, 94,190,146, 59, 92,189,244,202,107, 8, 37, 83, 63,130,103, 6, +172, 3, 12, 55,117, 49,191,162,148,243,106, 57, 43, 31,194,123, 81, 46,174, 42,165, 66,218,182, 59,240,202,181, 74,249,227, 15, + 63,184,126,253,179,115,207,158,186,245,227, 13, 44,246,214,201,227, 1,185,105, 46, 10,196,233,148, 58, 44, 17,224, 67,170,176, + 51,248, 79,131, 98,156, 42, 75, 0,101,154, 34, 82,179,157,192,171,226, 2, 89,133,174, 10, 70, 82,180, 82, 98, 70,151,204,148, +148, 2, 72,214,101, 51, 45,231, 86,148,156,165, 25,112, 93, 73, 37,210,230,195,185,237,207,156,201,124,252,212,251,199, 84, 51, + 72,143, 52, 89,227, 56,161, 90,168,225, 75, 2,227,116,133,189, 90,253, 54,227,216,156,167,147,233,164,146,148,101,173,239,246, + 96,169,174,219,197, 82,239,222,189,217, 30,182, 53, 69,247,167, 30, 80,243,169,141, 77, 36,189, 8,170,138,152,132,115, 63,148, +221,160,254, 95, 82,147,136, 84, 81,221, 62,114,166,209,123, 76, 7,110,190,109,233,217,237,218, 54,174,124,218,110,226,167,224, + 73, 97, 38,228,215,216, 50,223,221,185, 17, 74, 68,175,215,113,186,133, 76,161, 94,168,192,190, 64, 97,186,172,223,222,191,253, +184,253,232, 97,235, 17,199,142,167,120, 94,162, 97,200,233, 24, 65, 5, 9,129,235, 59,150,110,192,107, 28, 52,238,223,250,125, +175, 86,172, 35, 67, 11, 2, 79,163, 49, 97,165,152, 41, 0, 94,121,163,254,138,145, 67,106,125, 98,253, 24,128, 23, 31, 69,240, +200, 57,195,218, 92,175,215,139,213,197,124, 86,207,111,240,139,232,153,181, 35, 79,250,205, 92, 42, 11, 24,112,245,229,183,171, +197,245,246, 0, 89,172,247,219,253, 95,109,191, 15, 8,111, 38, 13,106,198, 93, 44,206, 28, 63,171,176, 89,205,131,198,189,162, +185,186, 86, 90, 63,187,245,252, 65, 99,255,235,189,111,224, 41,224, 71,138, 86, 25,238, 41,156,197,218, 6,124,201, 42,174,229, +214, 94, 58,125,145,148,115, 38, 62,219,250,115, 82,238,192,238, 20, 19,140,227, 87,140,169, 99, 68, 41, 33,136, 49, 39,240, 18, + 2,178,187, 38,134, 57,216,131,159, 45,254,232,186, 63,183, 31, 56,115,106,241, 25, 18, 80, 75,248,115,160,117,146,135, 65,118, + 23, 44, 88,100,143, 98,133, 72, 18,164, 6,212,196, 66,100,101,121,167,121, 15,191,118, 41,127,186,118,237,245,232, 78,226,157, +157, 55,222, 61,255,126,226,124, 98,231,242,151,146,161,244,130,201, 71,191,124,245,230, 15,159,191,119,243,139,134,227, 7, 82, +212,250,246,167,139,159, 60, 39, 39,178,215,190,255, 52,119,244, 92, 69,203, 79,253,158, 61, 11, 85, 94,134, 79,118, 38,206,112, + 50,146, 36, 97, 68,162,219, 52, 85,158, 53,172,180,162, 43,130,140, 7,102,171,122,146,102,249, 56, 18, 90, 96, 98, 25, 20,203, +101, 54, 44,221, 25,117,241,242,166, 94,172, 72,194,168, 23,196,230,224, 73,207, 29,192,160,216,176, 15, 91, 15, 66,210, 65, 24, +183,134,196,123,145, 77,174,212,139,117,234,145,157, 76, 68, 86,183,113,125,219, 84, 13,137, 77, 92, 47,251, 82,168, 32, 67,141, +146, 52,228,241,103, 11,219,164,239,244,240,168,108, 30, 62,113,245,133,183, 0, 74,144, 52,140,136,217,145,199,243,156,146,211, +240,234,237, 97, 7,171,154, 55,242, 88,176,190,211, 69, 14,209,113, 59,196,209,204,104,135,107,249,122,199,110, 15, 93,219,243, + 29,248, 32,219,165,131, 34,224, 21,114, 58,212,247, 49,179,180,140, 12,248,184, 0, 8, 83, 74,102,105,233,156, 89, 44, 79, 42, +154,174, 25,212, 94,165, 24, 51,210, 53, 28,187,227,145,196, 41,203,122, 9, 27, 47,134,141, 16,222, 2, 50,215, 60, 70,194,255, + 10, 64,212,185,196,182, 81, 69, 97,120, 60, 51,158, 25,219,227, 55, 99,199,169,147,216, 6,220,244,161,180,137, 80, 27,218,170, + 44,216,176,232,190, 21, 18,130, 37,123, 36,118,168,176, 66, 8, 33, 54, 72, 32,118, 21, 91,186, 64, 32, 22,160, 32, 65, 82,136, + 4, 66, 85,195,171, 69, 10,164, 73,147,216,158, 56, 99,143,159, 99,207,152,243,159,155,132,173, 21,197,158,185,247,158,115,238, +121,124,255, 73,252,142,124, 28,217,151,140,153,149,153, 84,165,162,205,150,167, 0, 80,145,241,255,175,174, 74, 98,246, 16, 14, +197,138,231,233, 34,172, 65, 83, 52,240,143, 68,250,160,191,202,211,158, 66,145, 85,225, 33, 93,173,209,169,115, 33, 80,112, 64, + 1,145, 8, 68, 71,191,232,233,151,142, 97, 10, 18,152, 12,232, 8, 22,250,106,199,215, 5,180, 31, 41,225, 92,106, 42,202,135, + 95, 56,111,153, 91,157, 98,186, 57,141, 74,157,203, 88, 49,100, 2, 88, 69, 47,200,197,167,192,163, 56,241, 93,236, 0,189, 49, +224,153,241,104,154,137, 8,136,121, 14,187,205,102,183,193, 80,114, 41,162, 26,213,226, 60,189,181, 35,148, 36,247,151, 31, 75, + 29,194,241, 64, 58,220,239, 57, 3,155, 60,127, 33, 31, 67,146, 61, 12,141, 83, 69,166,203,154, 44, 64, 2, 28, 75,241, 88,211, + 68, 32, 98, 38, 44,159,128,238,151, 33, 87,104, 90,237,230,185,179,213,226,116,126,229,187,111, 47, 61,183,168,133,149,135,143, + 30,137,129, 85, 9, 12,234,209,194,185,249, 91, 55,111,126,249,197,221,126,215,189,253,206,237,143, 62,120,255,242,242,114,109, +111,111,243,241,182, 10, 48,128, 15,171, 55,241, 52, 53, 48,180, 64,131,192, 21, 58,238,233, 44, 71, 12,245,202,181,235,247,214, +238, 25, 70,228,213,215, 94, 47, 84,150,103, 78, 37, 87, 86,190, 57, 93, 61,111, 24,230,218,250,125, 63, 8,143,198,130,228, 42, +243, 36, 44,154,201, 24,248,131,185, 69,158,128, 69,158, 7,191,223,159,120, 35, 97, 5, 78,168,177,104,189,140,234, 10,185, 46, + 49, 61,139,238,157,112,200,140,202,113, 83,214,227, 33,218,179, 64,211,203, 10,198, 82, 38,126, 42,146,233,122, 46,133, 18, 24, + 42, 65,125, 89, 54, 99, 9,187,125, 48,166, 24,223, 72, 26,154,126,208,170,107, 64,242,104, 49, 84,204,146, 20,197,211,162,195, +141,134, 66,233,120,154,194, 82,250, 95, 77,183,169, 41, 74,119,232,210,145,214,100,125, 56,238,145, 3,130,252,194,160, 51,103, +149,246, 14,159,208, 65, 60,149, 45,238,183,106,205,142, 67,251,144, 17,222, 81, 50, 89,228, 30, 42,133,114,117,246,204,249,179, +139,179, 87,206,252,184,186, 74, 15,108, 59,117, 85, 13, 55,219,135, 41, 51,185, 99,239,122,227, 33,157, 67,219,181, 41, 92,160, + 31, 57,151, 43,229,211,185,189,195,125,122, 59,179, 79,205,209, 39,180, 88,232,214, 64,193,124, 52,102,229,107, 67,142, 80, 0, +184,177,185, 97, 37, 50, 91,141,109,218,168,244,117,207, 76,149,215,255, 90,231,230, 13, 24,193,116, 36, 77,230,219, 74,100,147, +177, 36, 89,156,165,202, 66, 3, 74, 35,173,210, 76,181, 63,234,255,252,231, 47,237,126,231,242,233, 75,116,173,113, 58,142, 2, + 82,147,239,246, 58,244,117,133, 84,174,222,218,183,157,198, 82,249, 2,247,195,140,235, 7,187,189,118,123, 4,221, 96,213, 1, + 31,122,152, 49, 83,205,174, 67,143,207,121,115, 63,170, 27, 47, 93,124,241,251,223,127,160,103,161,107, 7, 45, 87, 50,146,162, +152,174, 26,213,243,215,166,164,126, 95,242, 60, 28,136, 16, 51, 35,197,200,123,112, 68,231, 22,105, 80,159,227,247,137,175,236, + 55, 18, 53,111, 72,182,205,243, 67,105, 61, 17,209,236,199,142, 75,246,125, 0, 92, 40,136, 1, 67,122, 11,140,215, 18,115,137, +244, 23, 81, 67,182,148,153, 15, 55, 86, 15, 61,247,147, 11,111,100,223, 91,124,121,233,149,221, 94,243,243,187,119, 58,159,254, +182,185,117,255,179,157,213, 59,127,124,245,188, 85,186, 49,123,209,247,251, 31, 63,252,186,144, 46,166,157,206,211, 55, 94,136, +255,154,121,247,239, 55,223,190,254,214,206,147,127,214,236,159, 22,243, 11, 57,157,150,111,162, 28,241,186,132,226, 69, 40, 25, + 79,152, 90,164,231, 13,124,192, 74,189,186,115, 32,236,174,168,196, 94,157,191, 74,175,133,174, 59, 28, 76, 74, 86,194,162, 69, +193, 49,132,142,150, 68,215,125,148,214, 7,189, 30, 69,202,137,108,192,169,110,122,248, 33,224,225, 18,119,229, 5,207,230, 43, + 20,200,143,153, 3, 74, 91, 17,214, 3,221,135,128, 66,251,248, 48,196, 17,113,137,130,134,122,173,150, 50, 81,143, 81,195, 97, + 10,225, 31,252,251, 64,215,141, 9,152,231, 67,193, 96,128,252,136,200,153,112,183,202, 0, 36, 9, 1, 5, 64, 5, 46,130, 64, + 40,186, 85,223,130, 56, 20,157, 17,206,201, 12, 6,125, 80,210, 2,238,160, 65,218,205,162,107, 43,108,148, 4,140,138, 80, 67, + 98, 30,179,170, 98,230,110, 0,205,119,134, 69, 83, 84, 36, 38,105, 93, 8, 84,249,228,235,166,179, 69,183,143, 93, 81,201,149, +231,172,242,174,189,173,162,231,197,255, 79, 0,174,174,165,183,141, 42, 10,207,140,227, 25,143, 51,126,140, 99,215,118, 72,154, +208,148,128,154, 20,167, 9,134,150,151,212, 72,172,160,165, 74,120, 72, 44, 64,236,248, 5,136, 13, 44, 34,129, 88, 33, 54,108, + 17, 15, 9,138, 4, 18,123, 32,162, 43, 86, 36,149,234,180, 73,133, 73, 83,146, 52, 41,141, 31, 99,103,102, 60,115,199,230,124, +103,156, 70,194, 75,123, 52, 30,205,189,247,156,239,188,190,239,152,159,128,105,210, 2, 27,114,133, 94, 24, 16, 48,146, 23,255, +235,139,199,136, 1, 10,173,232, 94, 71,238, 89, 86, 58,129, 47, 29, 67,123,102,247, 98, 57, 38,218,148,131,170, 78,119, 3, 55, + 64, 88,207, 57, 10, 22,122, 76,141, 21,126, 40, 14,200, 24, 57,122, 29, 49, 85,247,145,174, 66, 89,147, 57,129,251,175, 75,234, +119,195, 10,203,181, 88, 35, 20, 43, 21, 42,144, 3,164, 11,215,136, 39, 45,187,209,207, 38,114, 99, 99, 84,137,114, 85,173, 95, +170,237,171,147,135,230, 10,195,223,104, 21,100,153,115,152, 94, 10,238,134,152,184,156, 98,186,180,158,174,219,117,191, 11,250, + 98,208, 76, 6,130,108,229,177,188, 12,167, 43, 41,100,163, 93,144, 53,141, 30, 42,230,104, 71,241, 3, 41,156, 96, 98,222,187, + 94, 68, 10, 25,229, 32,136, 70, 22,219,118,187,135,135, 4,175,128, 92, 65, 84, 18,136,237,187,127,191,122,249,149, 84, 82,187, +181,113,253,185,103,231,170, 27,215, 7,162, 93,250,165,144,203,188,177,184,240,246, 59,239,174,172,172, 92,189,250,195,107, 11, + 87, 30, 25, 25, 91, 90,250,184, 88, 28,158, 61,119,238,215,223,150,201,115, 42, 93,121,110,102,102,108,132, 66,219, 33,211,200, +164,147,233, 84,122,136, 12,165,170, 14,186,118,239,226,252,203,183,215,171,107,149, 13, 93, 83, 39, 39, 70, 55,255,186,179,252, +203,239,229,167,206, 83,176,113,237,218, 31, 3,138,230, 65,204,146, 5,244, 34,125,113,109, 66,174, 2,163, 88,200,167,211, 49, +246,124,196,237, 10, 88,124,153,138, 32,170,196, 99,146,161, 67,229, 71,139,146,125, 87, 64, 9, 14, 22, 6,164, 63, 53,114,111, +186,172,199,240,118,105, 43, 88,109, 39, 38, 71, 65,233, 39, 41,173, 78,147,220,159,224, 41,101, 20, 46,152,207, 57,111, 22, 48, + 28, 40, 71, 8, 19,145,169,141, 50, 19, 3,253,237, 94,125, 47,155, 42,208, 5, 73,200,140, 40,187, 53,156, 82, 11,220,129, 2, + 78,132,245,227,201,208,123,190, 79,187,203, 52,204, 83,249, 83,171,213, 63,195, 9, 12, 58, 54, 18, 56,246, 0, 74,232, 76, 18, +194,109, 57, 22, 29,170,137,226,227, 55,183,214,108,209,185,178,176,120,176,245,224, 86,245, 6, 60,119,208, 37,136,103,145,173, + 20,110, 50,150,104, 34,103, 2,111,238, 10,219,133,250, 71,157, 86, 45,161, 27,152,186,146,228,102,187, 49,148,204,209,106, 18, +190, 30, 54, 11,102,220, 36,136, 87,154, 46,157,121, 97, 54,216,183,107,173, 58,125, 89, 52,243,190,112, 77,232,240,133,100, 85, + 61, 50, 13,197,116,161,152, 41, 84,182, 42,100, 68,171,247, 55, 45,183, 13, 41, 56,186, 73,186,208,118,154,163,217, 17,211, 72, + 85,238, 84,200,177,157, 61, 57,181,125,127,251,197,179,207,151,198,166,108,191, 83,111, 60,120,242,209,210,234,230,170, 54,160, + 53,108, 11,148, 88,232,218,114,189,158, 32,168, 78, 91, 84,211,226,228,159,232,245,143,159, 24,167, 37,216,169,223,187,185,115, +219,113, 15,201, 95,182,208,212, 75,182,218, 38, 36, 50, 22,137, 13, 95,200, 82,196, 43,161, 77, 59, 96, 22,223,126, 79, 1, 75, + 72,134,130,239, 18, 71,111, 72,185,200,190,250, 79, 45,213,164,131,220, 85, 38, 71,103, 68,123, 55,162, 30,236, 90, 46,186, 90, +131,110, 39, 0, 43, 10, 46,230,118,111,159,171,144, 9, 77, 77,106,234, 61,215,250,122,189, 82, 86, 71, 63,248,252, 75,103, 79, +188,245,197,235, 95, 45,124, 63,125,233,177,229, 79,191,253,100,253,167,181,218,230,135,229, 55, 75,249,211,169,193,196, 51,249, +201,137,120,254,179, 27, 63, 22,181,236, 75, 79, 44,150,159,158, 91,250,249,163,247,146,239, 39,178,242, 55, 27,223,157,201, 79, + 79,165,200, 51, 9,229, 97,211, 31, 30,180, 27, 27,208, 28, 31,194,242,161, 90,180,242, 80, 83,153,169, 5,118,144, 42,113,181, +168, 74,168, 20, 86, 30, 93,137, 14,196,211,184,179, 37, 99,100, 56, 79, 0, 46, 70, 67, 79,148, 79,207, 90, 32, 52, 4,174, 11, +203, 15,100,151,254,109, 29, 16,180,150,192, 30,163,211,102,116, 58,224,175,101, 62, 50,193,138,114, 72, 95,181,225,107,209,195, +160, 70, 85, 90,130,128,117, 28,209, 2, 31,208,131,121,189,163, 73,204, 48,129, 45,179,239, 4, 7,156, 12,202,197, 92,226, 68, +155,149,133, 60, 10,237,188,206,124,105,190,186, 95, 85, 80,196, 2, 76, 3,148, 34,219,126, 52, 73,235,116,108,129,180, 76, 72, +120, 22,178, 57,246,164,126,102, 24,169, 89,223,247, 6,245,196,120,110,124,167,182, 45,243,116, 30, 4, 24, 88,248, 14,217, 63, + 70,110,135, 78,123,191,193, 25, 42,214,157,248, 79, 0,170,174, 37,166,141, 43,138,206,248, 59,182,199, 16,112,130, 12,129, 36, +206, 7, 21, 68, 81, 99,199,134, 44, 72, 76, 23,253,136, 34,162, 36,219,168,202,190,203, 74, 37,155, 84, 44,187,234, 2,117,213, +172, 73, 21,101, 17, 37,106,149, 85, 43,148, 5,138,100, 68, 16, 73,249,218, 22,197,128, 63,216,158,192,120,126,158, 25,247,222, +251, 38,145,227,149, 37,203,214,248,205,155,115,239,125,247,220,115, 28,127, 15,102,237,196,200,139, 28,231,140, 19,224,216, 19, +199,241,159, 56,166,211, 8, 25, 61,195,128, 12, 38, 77,216,224,228, 91, 27,250,163,134,142, 95, 68, 43, 40, 52, 91,180, 28, 63, +193,118,126, 37,215, 30, 14,240, 92,228,124, 36, 86, 57, 65,133,107,246, 33,189,105,203,188, 29,116,118,252,101, 89,191,130, 49, +159, 24,124, 67,114, 4,127, 17,240, 49, 44,116,232,152, 45,218, 65,111, 80, 12,116, 24,134,202,248,250,180,232,152, 20,180,232, +160, 0,138, 0,164,218,180, 76,226,183,160,212, 1, 54,163,201, 7,174,140, 54, 61,120, 42,133,254, 65, 60, 90,133, 25,200,184, + 71,145, 28, 8, 48,209, 83,103,113,120,210,197,251,221, 33, 63, 9,178,195,125,135, 60, 87,131,220,198,224, 76,147, 87, 52,236, +129,105, 77, 83, 81, 45, 93,195,251,223,208, 44,180, 76,133,144, 67,100, 74,146, 93,112, 29, 20,107,219,219,249,169,111,190,187, +112,126,112,100, 52,145,223,217,205,230,247,224,167, 70,134, 70,198,199,198, 95, 60,127,190,240,199, 19,192,208,217, 7,179,207, +158, 46,100,243, 91,245,106,101,122,102,122,243,223,119,242,137,212, 41,138,119,102,166, 39,211,233,248,232,104, 42, 53,150, 74, + 37, 39, 38, 38,210,233, 47,147,215, 18, 55,110, 78, 70,123,163,181, 74,105,121,101,121,245,205,234,203, 63,255,122,181,184,248, + 94,150,111,223,186,125, 84, 45,191,123,187, 22, 18,253, 62, 15, 50, 97, 32,239,182, 81,184,175,133, 18,137, 54,160, 36,236,111, + 22,128,121,210,207, 33,137, 31,114,173, 36,249, 36,158, 84,223,160,102,132, 45,206, 5, 5, 62, 28,228, 4,161, 5,153,123,103, +216, 37, 0,162,251, 16,194, 41,243, 65,141, 77,151,133, 77,232, 38, 62, 69,110,198,167,133, 90, 74, 53, 21,233,184, 6,149, 50, +143,164,126, 36,231, 66,164,152,188,250,213,206,193, 22,160,118,119, 56, 2,235,220, 21,234,206,149,114, 40, 37,239,241,195,250, + 99,231,147, 20, 63,116, 83,189, 24,189, 12, 97, 88,240,121, 97, 37, 7,251, 6,179, 7,217,100,114,252,176,176,111,243,176,161, + 27,103, 35, 3,251,245, 2,141,242, 99,170,161, 27,170, 24, 20, 43,245,202,240,208,240,250,198,218, 81,174,180,177,179,118, 44, +215,209,255,239,184,154,254, 60, 93,172,151, 18, 87,174, 78,165,190,205,108,173,144,181, 60,202,201,153,168, 62,173,251,169,165, +105, 83, 21, 67,130,172,180,129,121, 14,234,229,235, 67, 99, 71, 82,213, 84,140,204,235, 37,128,215,162,116,120,186,163, 91,146, +235,128,126,231,250, 47,233, 13, 60, 55, 39, 91,155, 51,167, 66, 29,235,133,141,129, 72, 31, 92,191,162,169,177,158,129,154, 2, +229,133, 27,178, 51, 31, 2,150,246, 38,183,138, 38, 7, 94, 47,212,245,240,228,238,150,118,255,171,236, 21,171,135,241,203,241, +234,251,138,138,151,225, 37, 23,111, 15,128, 59,160, 91,236,204,133,178, 84,134, 43, 12,249, 3, 6, 57, 91,213,228,186,130,138, + 8,110,192, 57,136, 22, 3,167, 99,117,185,236, 33,125, 2, 23,103,185, 53,109,232,102, 47, 68, 7,196,119,100,187,216, 31, 24, +187,108,172,195,177,118,198, 42,141, 32,140, 51,196,213, 18,220, 50, 28, 23, 42, 75,149,241,158,104, 81,223, 61,106, 64, 92,193, +211, 79,147,172,105,217, 20,108,147,190, 8, 75, 19,244,120, 59, 3,193, 46,193,245, 79,190,248, 83,236, 94,124,254,235,239, 19, +247,178,234,254,227,204,163,147,249,204,207,127,255,150,145,115, 15,227,119, 67,130, 79,106,158, 0,180,169,156,254, 5, 0,147, + 84, 91, 40, 44,221,247, 39,187,126,188,244,235, 47,191, 75,178,231,135,196,253,185,229,185,254,238, 43,147,145,115,146,213,224, +185,143, 66,103,120, 70, 1,149, 22,132,118,212,141, 33, 87, 19,139, 90,196,174, 22,231,240, 59,137, 15, 4, 88,140, 14, 1, 45, + 20,211, 39, 69, 50,199,118, 9,242,223,144,128,162,114,186,101,200,138,220,219,213,179,190,183, 73,114, 90, 46, 54, 15, 21, 64, +101,238, 0, 57,184, 33,247,154,233, 64,180, 99, 21,128,195,103,253,131, 40,126,199,187,157,148,215,182, 8,211,176, 86,224,145, +181,220,169, 56,138,229,228, 20,193,160,222,105,113, 0,166, 55,101,173,193,216, 31, 8,166, 86, 51, 87,204, 81, 96,109,145,119, + 16, 7, 59,159, 24, 45, 54,147,137,180, 25,161,220, 65, 72,102, 91, 78,138,124, 54,132, 88,200, 56, 69, 64, 23,173,169, 20,106, +251,212,228,196,212, 55,140, 35,120,154,237,156,168,227, 97, 6, 20, 10,138,218, 64, 73, 42,122,253, 47, 0, 89,231, 22,227, 68, + 25,197,241,105,103, 58,157,233,180, 51, 91,218,217,118,119,217,123,195,101,187,139,110,220, 69, 66, 68, 80, 49, 49, 49, 49, 49, + 65,159,224, 1, 18,194, 11,207, 36,248, 70,140,137,137,225,129, 55, 5,140,190,107,200, 18,118, 31,128,196, 7, 48, 75,162,240, + 2, 42,171, 75,161,206,222,122,191,204, 78, 47, 51,157,139,231,124, 95,219, 24, 77,250,208,204,195, 92,191,239,124,255,115,190, +115,126,167,207,127,167,173, 80,189,126,240,157,182,203,235,225,223,105, 22, 10, 75,145,176, 46,227,120, 61, 91,239,245,154,236, +254,203, 34,187, 48, 4,209,244, 51, 52,235,153,249,207,239,255,182,190,104, 20, 73,205, 2,219,135,159, 33,190,131, 21,201, 73, +232,246, 2,211,151,225, 44, 98,157, 69,203,181,169,237,192,168, 1,161,172, 49,180,239,131,107, 15,237, 25, 45, 27, 5,244,112, + 41, 81,205,243, 2,156, 64,105, 39,241,136,170,202,201,154, 81,113, 29,154, 16, 9, 35,198, 38,198, 31, 33, 65,147,131,211, 36, +125, 8, 6,180,133,172, 2,138,134,192, 57,132,249, 77,240,105,193,185, 33,229, 16, 44,232,219,176, 32, 42, 10,238,191,115,184, +201,201, 42, 97, 68,140, 9,152, 18, 15,227, 18, 81,145,138, 20,136, 74,156, 18,230,228, 48,167, 68, 2,240, 71, 12, 96,171, 23, +158,247,139,130,191, 86, 47, 63,126,242,171,107, 89,146, 20,169, 85,141,231,107,235, 96, 85,183,182, 55, 30,254,252, 48,147,201, +192, 51,166,166,199,231,210,179, 55,110,126, 59, 52,168,194,205,207,206, 28, 24, 25, 86,255,120,254,180,217, 54, 31,172, 62,250, +225,214,210,173,165,149,229,229,187,119,238,220,189,127,239,254,242,237,165, 86,195, 24,155,152,196, 22, 16,123,199, 22,222, 88, + 76,237,155,177, 44,167, 90, 51,198, 71, 39,206,156, 61,127,253,235,239,126,251, 51, 91,221,237,180,136, 82,181,209,100,247,152, + 62, 12,137,170, 96, 92, 4, 1, 12, 44, 34, 38,253,132,231,134,203, 54,118, 90, 10,250, 36,129, 13, 9,158, 28,241, 75, 33, 70, + 18,177,151, 5, 72,103, 88, 39,248, 32, 67,246, 36,124,150,133,126, 61, 14, 57,222, 97,205, 96, 66, 26, 14, 5,164,122,179, 12, +174, 37, 29,124,178, 56, 96,118,218, 71,143,190, 53,150, 26,213,178, 27,112, 65,240, 55,183, 10,155, 96,129,196,128,164, 55, 43, +160,223,183, 42,154,131, 60, 94,193,143, 9, 6,102,167,227,192,133,224, 11,142,192,204, 55,170, 37,189,152,220, 51, 4,223,248, + 69,238,133,192, 10,243,139,243,121, 45, 31,147,227, 45,211,208, 77,157,106,121, 88,185,210,227,233, 92,173, 0, 35, 68, 12,132, +226,195,170,166,101,225,224, 84, 98,114,179,160, 53, 44, 67,150,148,146, 94, 2,209,186,182,253,215,234,239,171,160,232, 47,124, +112, 46,179,243,178,131, 17, 43, 10, 36, 69,233,132,100, 76, 44, 73,231,222,158, 59,182,190,181,158,148, 19, 27,197,141,103,175, +158,217, 4,231, 4,118, 39, 61, 49,243,119, 46, 11, 22, 86,226, 67,249, 90,254,181,244,226, 75,109, 93,226,133,150,221, 6, 35, + 46, 4, 37, 85,142,107,165, 77,240,232, 15, 31, 92,120,255,245,227,171,107,191,236,141,141, 21,234,121,112,100,193, 7, 13,113, + 48, 17,165,106,179, 14,102, 2,174, 2,186,236,221, 19, 31, 21,115,155,213, 70, 21,245,132,143, 25, 84,226, 65,142, 23,248,208, +199,239,125,234,153, 86,121,183, 98,180, 13, 81,144, 82,195, 83,217,130, 70,234,175,113,182,194,187, 2, 19, 6,222, 70, 29, 1, +121,156,170, 36, 44,187,225,231,124, 42,195,237,127,103,148,225, 48, 59,138, 72, 53,202, 10, 68,205,134,251,203, 93,144,140,103, +147,152, 58, 54, 76,110, 69,249,200, 17,208,162,182,211,178, 28, 47,202,182, 10,214,182,142, 91,234,158,133,156, 94,151,104, 53, + 82,131,130, 83, 6,163,122, 72, 58,226,249,176,192, 31,138,133, 79,159,251, 60, 56,146, 56,245,197,169,111,222,188, 57, 63, 59, +247,253,213, 47,175,101, 87, 62, 59,252, 73, 84, 16,118,177,136,132,246, 5,193,244,155,133,216,212,143,217,159,162,245,240,241, +203, 31, 62,185,254,116,101,103,249,210,137,139, 87, 30,125, 53, 32, 15,158,140, 79,214,236, 38, 45,199,196,133, 21,147,126,176, + 77, 99,189,221,192,251,240, 51,189, 78, 79, 93, 27, 66, 83,169, 41,140, 5, 76, 7,207,243, 32,136,225,109,196,148,184,222,210, +105,124,120, 95,114, 58,147,203, 96,139,106,159,183, 93,222, 33,224,204,238,137, 40,205,205,234, 96,166, 77,114, 32, 9, 90,152, +233, 53,176, 35,165,142, 14,106, 59,199, 44,215,203, 3,161, 40,120,199,176,120, 4, 16,154, 68,229,182,183,107,234,166, 77,216, +230, 72,145,100,104,166,178, 71,147,226,201,221,193, 17, 66,163,235,244, 74, 65,187,205, 85, 9, 57,213, 13,178,193,132,156, 4, + 7, 17,151, 35,130,151,167,193,135,238,195,245,139, 43,153,238,253,144,130,169, 54,117,109, 84, 57,129,251,139, 8,193,150,193, + 15, 38,217,222,254,233,100,170,162,151, 92,108,232,102,209, 68, 41,106, 96,255, 17,128,172,107,233,109,226,140,162, 51,227,121, +249, 49,177,199,128, 99, 64,137, 35,132, 73, 65, 74, 89,240,172,212, 77, 23, 84, 66, 72,252, 10, 86,172,248, 5,180, 18,108,187, +169,120, 9, 84, 85, 85, 55, 44,187, 68,149, 88, 84, 65, 16, 65,120, 67, 81, 2, 84, 36, 64, 94, 30, 59,126, 76,102, 98,123, 60, + 31,231,222,111, 76, 74,107,101,225,216, 99,123, 94,223,189,231,190,206, 81,211, 84,136, 73,244,155,148, 45,234,207, 45, 55,146, + 80,199,127,249, 72,152,129,135,233,147, 47,173,188,170,252, 7,177,127,166,147,249,223,139,130,102,235, 13, 98,237,137,163,173, +252,190,202,228, 48,201,167, 98,230, 24,145,124,150,156, 35, 30, 6, 0, 26,103, 20,225,129,129,155,248, 6, 34,175, 47,152,238, + 94, 33, 1,163,172,101, 90,196, 12,174,114, 34, 66, 40, 8,192, 83,138, 54,234,238,108,249,235,204, 24, 55,252, 26,246, 67, 89, +203,209, 13,179,229, 55,240, 18,206, 32,206,221,219,229,185,132,132, 73, 97,243,135,208,219,114,132,210,211,169,226,108,224,254, + 62,118,176,172, 91,218, 64,104, 97, 47,150,226, 9, 82,119, 38,232, 71, 52, 88,205,244,216,216,204, 48, 5,219, 65,114, 35,212, + 92, 72, 74, 29,192, 11, 26,201, 62,246,187, 22,204,164,110,192,236,210,240, 55,245,214,146, 88, 18,145, 0,170,218,142,194, 8, +118,236,231, 43, 87, 61,207, 3,148,123,249,236,197,141,223,126, 13,194, 46,181,172,210, 80, 4, 17,106,154, 68, 55,134,165,208, +191,116,249,242,223, 47, 95, 77,255,117,199, 45,110, 27,135,165,223,187,167, 82,169,232, 8,181,210,153,135, 51,247,206, 95,184, +136,213,242,253,137,239,142, 28, 58, 60, 59,251,112,250,222,221, 20,241,120, 96, 61, 15,186,145,232, 83,129, 7,107, 73, 24,236, +195,185, 87,151, 64, 5, 37,217,177,243,100,245, 9,197, 73,125, 48, 86,189, 6,244,160,123, 40, 82, 7,120, 18,118, 5,194,148, + 0, 94,157, 59,204,113,120,229, 56,191,175, 52,245,228,195, 35,124,154, 91,181,104,220, 12, 38,222,205,184,115, 31, 95, 33,176, + 65,164,133,136,146, 69, 21,116,174, 7, 38,221, 77,110,166,232,181,215,224,107, 89, 76, 99,147,133,212,133,174,152, 99, 59,198, +215,154, 43, 88,231,166,110, 30,174, 30,121, 52, 63, 59, 94,154,104,116, 60, 88,118, 34,216, 79,217, 97, 47,164,124,186, 91,110, +116,106, 89,219,201,217,185,122,187, 62, 53, 49,133,243, 54,191, 52, 71, 73, 57,210, 73, 81,203,219,203,237,118,187,238,123,197, +156,123, 96,108,242,233,187,231,110, 58, 31,246,122,205,205,198, 70,176, 33, 88,247, 10,110, 0, 27, 91, 41,211, 73, 59, 8,245, + 86, 26, 31, 96, 53,220,172,155, 18,136,219,116, 57,181,120, 96,119,245,237,242,107,174,115,170, 64, 72, 19,165,138, 97, 26,239, +107,139, 0,129,134,110,192, 43,220,126,114,155,122, 25, 5, 46, 49,133,111,147,187,247,181,130,102,173,179,142,237, 11, 78,209, +177,114, 35, 25,103,102,254, 62,206,117,218,206, 32, 0,133, 13,194,209, 17,137, 63,172,118,202,194,205,196,212, 79,132, 49,251, +220,143,129,223,117,114,249,213,198, 50,143, 74,170,163,133,210, 38, 23,129,137,152, 72, 37,242, 25,172, 20,199,206,198, 34,208, + 13,237,171, 65,234,212,197,227,138, 30, 40,141,166,210, 13,104, 98, 66,254,245, 7, 10,145, 57, 2, 87,244, 67, 98,193, 27,144, +188, 41,208, 76,211,125,236,149,173,116,193, 15, 26,176, 97,147, 5,255,197,250,235, 86, 72,141, 29, 61,238,159, 97,221, 31, 24, + 21,146, 69,134,153,198, 21,205,167,205, 74,126,196,205,228, 12, 37, 58,186,255,244,159,143,131,115,211, 63,137, 7,194,251,253, +214,183,215,206,140,186,163,103,191, 62, 17, 40, 81, 39,240,117,217,244, 69,237,102,250,132, 83,250,241,254, 31,239, 86,151, 22, +230, 22,111,253, 48,115,242,230, 55,226,172, 24,251,165,154,217, 86,188,126,232,244, 98, 88,147,172,182, 56, 94,219, 78,119,252, + 14,124,137,105,217,190,223,142, 72,207,154, 91,196, 41,215, 68, 44, 88,164,109, 77,160, 77,181,205,108, 20, 17,193, 64,221,175, + 99,151,247,238,170,190, 89,254,135,209, 27,213,216,107,157,218,241,234,177,149,214,202,194,218,123, 89, 82,102,177,169,152,109, +177,198,215,168,151, 20, 6,255,141,157, 69, 92, 45, 87, 23,188, 5, 73, 86,136,247,129,238,129,214,241, 19,212,116,168,153, 27, +228, 15, 4,243, 73,200,126,188, 4, 28, 83, 62, 96, 64,141,196, 0,151,219, 29,217,236, 20, 75, 34,136, 84,194,243,147, 24, 77, + 77,147,125,134, 82, 70,119,248, 13,204,254, 74,163, 58, 44, 69, 0,244, 72,154, 82, 49,141,167,201,183, 34, 73, 30, 28,179,186, +115, 44,220,108,193,239,110,144,102, 36,253, 47,134,161,201,144,173, 65,211, 62, 9,192,216,217,244,182, 81, 69, 97,248,206,167, +103,156,169,147,184, 77, 28, 28, 98,212,134, 54,226, 67, 66, 8, 22, 8,169, 2,177, 40, 59,186, 64,236,224, 7, 32, 36, 88, 20, + 33,164,178, 65,236, 16,127,162, 66, 72,149, 42, 22, 93,192,158, 77,105, 32, 11, 48, 77, 26, 53, 36, 17,109, 10,118, 60,246,216, + 99,143,103, 60,115,231, 14,231,189,119,220, 45,120,107,107, 50,190,190, 57,243,158,123,206,121, 94,179, 12,162,172, 28, 82,253, + 63,193,253,201,187,121,201, 81,103,218, 92,101,235,243, 55, 11,246, 31,175, 57,186,144, 34,187,124,224,204, 49,244, 48,210, 5, + 49,220,200, 68,162, 14,139, 72,139,209,239, 74,186,179, 36,142, 49,221, 1,129, 54, 86, 17, 1,115,234,112,248, 68, 13, 29,125, +249, 40,118, 22,202,246,112, 24, 13, 84, 54,160,156,239, 28,203,253,228,234, 71, 95,127,255, 13,229,200, 6,134, 75,153, 44, 95, +228,115,238,169,152, 70, 3, 38,211,167,238,240,113, 47,236, 74, 47, 68,149, 0,224,147, 80,181,146,127, 9, 46, 63, 58,118,172, +223,118, 7,207,111,174,104, 22,133, 98, 33,237,238,240,124,134, 18, 44,171,203,154,200,248, 40,206,203,191,207, 74, 30, 50,154, + 73, 20, 25, 18,231,251,246, 20,254,222, 28,195,205,134,144,159,210,112, 82,144, 3,216,240,207,105,176,178,188,148,198,252,179, +107,159, 15,195, 49,226,160, 94,128, 34, 96,144,122, 50,228,208,162, 36, 5,145, 74,155,241,126, 47, 8,250,254,175, 59,219, 40, + 75,192, 23, 92, 56, 21,231,169,181,198,250, 70,171,253,199,189,170,109, 93,218,108, 94,255,242, 11,102, 54,222,120,243,242,195, +143,143, 79, 3,159,110, 33,154,230,202, 26,216,160, 48,138, 51,117,116,245, 98, 95,193,128,211, 64,233, 24, 30,112, 69,156, 98, +174,181, 98, 51,215,129,159,201, 12,185, 58,110,149, 11,212,144, 73, 17,225,126, 80, 59,129, 76, 73,120, 49,202,163,253,206,239, +244,227, 85,156, 74,156,228,207,174,109, 29,119,143,162, 36,162, 64,150,194, 73,142,147, 96, 87,182, 5, 46,197, 78,105,242, 16, + 78,134,186,110, 14, 38, 62,253,179,144, 40, 30,197, 1, 45,191, 99,131,127, 54,227,232, 2, 68,253, 95,136, 15,222,122,255,246, +221,219,171,245,213,163,222,193, 18, 12, 72,217, 89,239, 92,119,216,121,247,245,247,190,251,233, 91, 27,213, 93, 65,178, 72,135, +109,155,231,185,222, 30, 16, 5,156,180,115, 60,155,134,209,104,154,196,207,181, 46,237, 28, 76, 78,252, 19, 18,116,245, 90,189, +253,232, 94,163,214,232,133,125,207, 94,136,129, 53, 6,171,143, 36,246,139,173, 23,238, 63,218, 51,117,131, 46,178, 96, 57, 20, +247, 73,113, 83,234, 70,226, 32, 7,212,176, 72, 57, 55, 45,139,199,201, 70,163,213, 27,251, 36,216,215,235, 27,244,200, 49, 77, +171,125,216, 94,116,207,164,148,242, 23, 25, 45,194,185,165,181, 97, 20,248,129, 79, 59,194,115,151, 47,172, 62,189,115,216,166, + 61,252,246,171, 87,194,100,124,119,119,187, 10,218, 26,248, 60, 89,150,153,210,222,197,115,206,144,250, 59,244,143,243,104,228, + 85, 23,109, 86, 12, 35, 90,146,184, 89, 95,247,199,125,206,147, 78,208,145,253,186,133,164, 54, 21,182,229,164, 25,101, 39,245, + 48, 74,228, 17,132, 44,139,211, 54,119, 76,138, 57,242, 8, 94,201,110, 6,230, 19,227, 70, 46,193,133, 79, 90, 15, 52,125,198, + 39,163, 65,144, 10,253,252,130,231,103,167,164, 78,103, 92,157,201,148,120, 23,161,212,109,105,158, 76, 91,162, 8,147,212,182, +128,191,255,121,255,135, 90,149,221,122,249, 43,246, 10,187,241,225,143,127,101,131,107, 91, 87,251,233, 48,205, 85,159,207,188, +103, 91, 19, 3, 62,122,103,227,165, 79,187,219,236,142,184,114,249, 53,118,147,177, 30,123,166,186,185,159, 62,140,132,164,251, + 73,206, 37, 28,222,215,206,239, 30,182, 41,169,106,157,109,238,197, 19, 37,220, 53,133,129, 85,131,184,120,102,104,117,216,230, +241,229,218,202,131,238,159,205,229,245,147,193,227,227,206, 17,131, 37,158, 73,154,159,150,157,214,255,151,131, 29,133,205, 46, + 91, 0,153,210,218,204,177,208,231,158, 37, 51, 53,234, 37, 35,152,234,250,192, 87,190,255,247,190, 91,129, 31, 61, 32, 72,114, +126,116,171,121,241,206,131, 62, 45,229,162, 67, 91, 37, 22,101,111,139,156, 10,145, 87,231, 96, 65,196,116, 9,211, 64,232,238, +133, 61,153, 86, 2, 0, 9, 70,139,196,165,213,113,226,148,213, 92,143,146,140, 60,203,149, 57,246,188,198, 9, 29,170,218,211, + 85,160, 91,116,107,179, 44,157,192, 83,123,110,247,173, 56, 49,154, 90,129, 34, 64,221, 17, 58, 91,200, 97, 89, 21, 89, 73,167, +146, 28, 57, 29, 35, 89,252, 87, 0,194,174,100,183,105, 40,138,218, 73,156,177,169, 29,211, 38,105,194,208,130, 42, 90, 21,161, + 50,131, 4,180, 66, 72,128, 96,129,196, 18,196, 30,137, 15, 96,203,111, 32, 22,108,217,178, 5, 65, 7, 4, 75,196, 80, 21,181, +168,133, 64, 65, 77,227, 64,234,216,177,159, 39,238,121,207, 45, 42, 44, 72, 86,137, 34,121,136,223,125,231,158,123,239, 57, 49, +255, 30,238,228, 78,162, 29, 82, 4,255,127,109,233, 67,203,210, 95, 84,253, 63,175,109, 47, 94,121, 71, 38,176, 93,123,141,143, +168, 23,244, 30,179, 9,230, 96, 38, 13,160,129, 81, 74, 46, 12,149, 80,227,230, 30,137, 81, 76,204,227, 80, 62,215,251,141,120, +159, 10, 87, 2, 8,221,192,141,239, 88,188, 79, 97, 36,108,126,225, 37, 52, 31,185,135, 39,125, 67, 17, 80,139, 43,171, 9, 31, + 93,213, 82,124,151, 32, 67, 33,197, 34,118,162,196,145,128, 77, 98, 16,210,162,118,246, 14,140, 96, 78, 10,238,123,129,107,251, +147,187, 7, 84, 8, 49, 3, 5, 19, 66,244,120,195, 38,253,113, 92,201, 52, 65, 31, 25,157, 10, 67,208,100,208, 64,139, 24, 23, +179, 23, 91,114,114, 75,162, 23, 58, 40,190,204, 96, 30, 14,162,128,223,166, 24, 24, 76, 79,157,125, 62,243,130, 48, 19,220,107, +121, 66, 10,253, 97, 39,240,220,208,131,154, 11, 88, 65,215,245, 26, 43,171, 70,171,213,179,172, 98, 95, 33, 79,201, 72, 49,155, +203, 38,105,205,247,172,245,190,188,148,201,227,244,247,215,107,253,125,201, 87,115, 51,115,243,175, 29, 55,242, 61, 88, 12, 71, + 60,231,160,235,204,161, 47, 30, 44, 71, 22,130, 54,152, 89,205, 40,144,117,164, 67,120,156,108,227,110,147,160, 98,124, 31,164, +174,203,128,220, 33, 41,136,133,198,149,232,133, 67, 36,158,250, 80, 9, 80,164, 65,211,188,231,180,209, 34, 70,231, 26, 20, 48, +143,163, 18,114,167,184, 93, 41,213, 40, 42, 25,221,166, 86,216,101,108, 54,211,233, 76, 69, 27,202,166,178,110,192,134,244,202, +225,225,201, 31,237,239,220, 87, 29, 91,236,240,224, 8,133,182,225,234,190, 15,171,239,191, 52, 63,123, 48,226, 81,134,203, 35, +109,179, 57,185,255, 8,133,239,217,133, 89,198, 28,173,160, 31, 29, 61,121,235,194,205,119,171,239,104,151,252,214,250, 26, 4, +129,218,167, 19,140, 74,203, 10,193,156,159,166,177,216, 88,212,139,186,227, 90, 4,156, 45, 7, 21,215,171, 39, 47, 27,157,142, + 86,212,232,102,169,249,254, 3,181,209, 95, 38,228, 9,233, 73, 24, 44,150, 79,143,157,250, 97,172,105,165,193,164,162,172,124, + 91, 10, 16,179, 82,245, 82,237,250,233, 43,133, 61,213, 82,148,249,178,209,160,199, 9,118,122,152, 56,117,233,196,154,157,214, +153,241, 83,211,147, 83,157,192,111,110,124,175,106,229, 65,181, 76, 32,116,234,246, 13, 99,105,109,125,115, 35, 1,215, 30,199, +178,205,143,141, 37, 90,124, 67,122,157, 18,199,209,161, 3,150,107,151,139, 3, 20, 85, 91,157, 86, 73,213,225, 41,145, 76,246, +220, 94,165, 84, 69, 51,156,162, 80,246,173, 21, 75,109,179, 13,139,227,192,167,212,109,188, 62,222, 54, 13, 94,169,166, 60,178, + 3,245,201,132, 60,166,228,118, 95,172,193,237, 26,145, 93, 48,153, 28,199, 8,112, 23,134,201,184,184,138,194, 37,225,113,217, + 75,119,163,241,140,146,171, 42, 82, 49,213, 90, 54,215, 54,123,104,199,246, 68, 99, 1,226, 67,192,229, 74,249, 68,139,208, 23, +151,161,246,149, 18, 83, 29,148,195,200,146,157,126,211,124,252,228,193,219,103,199,170,135,198,118,213, 59,140, 59,138, 72,194, +184, 27,254, 4, 92,169, 67, 30, 83,247, 60, 90,126,122,109,223,241,250,165,131,247, 31,222,191, 91,185,247,242,215,236, 34,251, +116,103, 98,154, 50, 15,211,233,201,220,241,103,227,231, 58, 56,107, 57, 68,207, 21, 74, 8, 17,167,153, 66,186,228,138, 86,165, +184, 38,156,128,186,204, 54, 29,211,232,182,233, 55, 22,131,108,131,136, 12,253, 5, 21,249, 31,224,155, 68,185, 90, 46,149,177, +152, 29,138,249, 13, 41,228, 34,254, 4,255, 61,174,109,215,149,226, 43, 18, 12,178, 8,242, 0,215, 39, 70, 33, 95,193,113, 53, +136,172,134,177,214,159, 87, 9,133,160, 14, 47, 11,243, 89, 40,231, 87,245,186,105,117, 68,248, 59, 55,113,254,115,115, 69,104, + 96,110, 53, 55,134, 81, 60, 16,142, 3,184,112, 30,245, 44,214, 11,121, 11,201, 31, 32, 45,197,254,204,209,214, 88, 38,189,109, +207, 70, 95, 22, 36, 75,165, 96,219, 91,101, 7, 27,194,119,231, 32, 18, 70,221,124,173,160, 21, 5,234,240,240,158, 80,126, 11, + 64,214,181,244,180,113,133,209,121,120, 30,158, 49,198,143,196,152, 96, 19, 37,149, 80,149,162, 74, 9,155, 54, 82,212, 74,237, +162,139, 74, 77, 55,225, 23,116,209,174,170, 36,127, 32, 82,255, 75,214, 89,228, 15, 84, 40, 45, 13,139, 62, 18, 2, 68, 96, 97, +156, 98,198, 51,120,236, 25,207,219,190,253,190,239,142, 41, 74, 88,129, 1,195,204,189,115,238,249, 94,231,228,248,158, 9,255, +139,204,176, 75,244, 93, 21,180,233,188, 57,146,125,144,159,121, 15,205,217,101,192,254,224,103, 47,230,176,214,150,111,217,152, +112, 23,196,247,223, 70,156, 7, 19, 51, 88,182,130,168, 36, 89, 50,203, 83, 40,136,224,243, 68, 16,239,206, 68, 22, 15,129,121, +130, 37,108,150,139,140,113,117, 25, 42,141, 21,104,239, 33,224, 50,114, 76,199,187, 54, 35, 49,117, 49,165,233, 50, 84, 7,203, +166, 97,228,207,230,147, 3,236,210,149,115,194,146,151,158, 5, 86, 46,214, 98, 52,130,145,116,205,116,252,129, 34,225,163, 83, + 54,234,195, 96,180,219,179,135, 94,106, 10,133,138,170,220,172,150, 13, 89,169, 22, 84, 83, 34, 57, 47,226, 63, 41, 33, 53, 60, + 69, 50,181,125, 25,138,140,178, 95,120,168, 19,176,242, 63, 6, 65, 28, 26,126, 10,170, 44, 42,228,214, 81, 4,238, 85,148, 0, +179,122,157,142,227,156,211,196, 4,124,201,146,104, 10, 97,117,152,100, 33,252, 67, 81, 58,137, 99,207,207,210,108,122,102,185, +189, 83, 11, 14, 18,160,255, 81, 12, 7, 0,162,191,200, 10,104,122,195, 93,115,131,104,103,251,197,243,231,207,182,119,182, 53, +149,149, 12, 18, 44,160,239,145,174, 27, 35,105, 26, 62, 71,193, 20, 69,230, 18,252,216,134, 10,219, 0, 39,208,176, 77, 8, 66, + 19,132,123,174, 56, 63, 67,153,165,162,138, 94,162,101, 13, 53, 50, 13, 77, 42,169,232,106, 2,155, 42,244, 81, 54,110,181,126, + 3,168,119,173,212, 20,177,181, 46, 27, 5, 46, 54,183,208, 18, 69,105, 4,161,244, 56, 64,189,245, 73,232, 51, 50,187,113,195, +145,161,232,214,208,178,125,231, 90,101,121,132, 6,196, 50, 68,102,231,147,161, 23,184,217,148, 29, 15, 58,247,239,126,135, 3, +232, 51,230,120,214, 71,205,143, 59,253,206,223,221,191,146, 89, 92, 64, 81, 76,245,176,255,246,247,253,237, 36,137,155,213,166, + 82, 80,208, 80,201, 88, 56, 58, 61, 4,138,208,174, 95,255,241,254, 79, 91,255,252,138,242, 35,162,164, 23,138,156, 19,238, 30, +191,129, 79,134,254, 0, 46, 60, 78,195,129,219,175,151,113,238, 20, 96, 0,248,120,231,244, 40,140, 2, 93, 86, 53,248, 21, 89, + 7,150,208,190,178, 2,111,190,245,106,235,180,123, 12,236,222, 26, 89,107,173,181,205,123,223, 31,252,251,182,177,216,136,146, +176,178, 80,251,227, 96,199,118, 44,107,208, 91,169,183,186,118,239,211, 59,159,247,207,222,233,118,182,247,110, 47, 33,102, 12, + 75,118,125,105, 21,192,113, 28,249, 95,173,127,241,186,187, 11,247,216,245, 93, 93, 51,236,177,221, 88,188, 26,101, 73,148,198, + 75,139, 75, 16,242, 91,227, 51,120,125,243,219, 31, 86, 74,181,151, 7, 59,181,133,250,227, 7,143,126,123,245, 2, 64,157,220, +230,162, 5,116,146,242,209,180, 5, 2, 46, 73,248,204, 48, 43,223, 52,243,204, 43,224,187, 52, 47,215, 49,178,230, 32,154, 36, +210,168, 90, 74,210, 73,232, 57, 31, 42, 77,253,220, 99, 71,187,238,137, 61,137, 81, 38,144,140, 55, 25,165, 26,132, 92, 82, 88, +160,246,115, 68,118,146,194,150,209,117, 18, 29,239,100, 5, 69,185,245, 76, 73, 55,218,149,219,181, 70,150,106,195, 56,185, 82, +185, 26,199, 17, 58,149,147,153, 55, 86,178, 4,177,170, 27, 79,247, 95, 54,202,205, 47, 31,126,253,228,151, 39,155,181,159, 79, +166,251, 91,193,159, 15,174,109,244,209,203,129,186,185,165, 60, 9,139,103, 17,105,189, 84, 75,213, 69,179,226, 7, 62,224, 20, +112, 5,216,187, 55,151,111,156,185, 14, 39,173,102,177,164,107,154, 31, 79, 56, 29, 67,219,241, 4,107,173,176,226,112, 13,227, +208,243,226, 73,171,222, 50,138,102,144,132,183, 90,159,224,196,220, 8,237, 65, 82,150,225,252,163,196,157, 77,105,243,139,185, +221, 61,220,149,174,221, 69,157, 21,186, 85,148,195,193,110,189,152,250,109, 40, 11,204, 5, 23,167,228,233, 10, 47,162, 49,136, +227, 13,195, 36,164,147, 12, 7, 4,219,245, 54, 55,180,153,241,210, 34, 73,185,145,203,173,192, 61,154,248,135,196,155, 10,105, +101, 74, 90,201, 44,154,112,168,231,174,215,249, 24, 62,239, 41,167,230, 31, 73,186,192, 98, 81,200, 43,206,226, 69,233, 18,159, +105,192, 16,117,125,117,221,241,156,255, 4, 96,235, 74,122,155, 6,131,168,237,216,159,215,216, 73,147, 46, 20,232, 18,132,160, + 5, 10, 42,229, 82,196, 5,161,170,112,224,140,184,112, 64, 66, 66, 28,248, 13,253, 3,252, 20, 36,238,220,170,170, 72, 28, 64, + 32, 68, 55,209, 61, 73,219,184,110, 22, 59,137,107,199,204,140,237,138,138,170,149,122, 73, 29,111,223,155,153,111,222,155,151, +224,123,152,146, 32,207, 32,142,212,180,220,133,224,126, 33,196,195,153, 13,105, 3,238, 41,142, 88,147, 4,153,166,146,253,195, +146, 73,209, 28, 14, 7,248, 56, 96, 12,121,126, 43,190,236,255, 50,253, 52,210, 37,212, 76,238,124,119,182,103,202,150, 79,185, + 54,154,179,164, 21, 21,250,116,139, 12, 59, 69,241, 61, 82,140,130,129,134, 18, 35,253, 37,199,179, 19,198, 21, 10, 54,113,230, + 13,100,142,232,165,217,105, 32, 81, 22,192,139,104,254, 89,213,244,147, 6, 58,127,174,133,192, 39,178, 86, 26,178, 42,144,224, + 24,103,227,248, 97, 23,135,181, 70,252,196,240, 76,217, 57, 42, 55,220,173, 35,231,119,165,185,111, 55, 2,128,137, 46,156, 99, +104, 50,213, 18,133, 75,186, 50,156, 85,242,162, 84, 68,215, 69,129, 86, 21,199,144,182, 1,223,223,203,224,150, 11,142, 61,128, + 19, 87, 25,196, 15, 78,197,221,215, 8, 55,190, 1,226, 37,225,164,126, 28,203,216,100, 0,125, 37,202,106, 56,166, 91,151,164, +172, 34,105,114,198, 84,100,156, 40,169, 51, 75,103,125, 38,206,150,209,161,176,135,255,141, 69,183, 52, 61,137, 36,175, 28,186, +232,202,100, 84, 8, 63,188,136,172,231,128, 58,108, 1,170, 65, 68, 26,207, 1,208,172, 40,188,174, 73,140, 92,168,176,214, 67, +165, 37, 39, 43,130,174,194, 47,118,213, 52, 85,176, 44, 33,111, 72,154,158, 49,116, 81, 87, 49, 76,244, 80,187,223,243, 59, 92, +187,221,139,124, 46,104,158,198, 90, 57,175,141,226, 67,183,211, 52,181,156,161,102, 59,190, 43, 36,172, 7, 64, 7,181,234,148, +251,205,129,131,227,114,108,155, 25,187,134,193,159,201,145, 41, 38, 72,187,246,166,194, 20,148, 53, 68,209,219,167,239,150, 87, +150,188, 83, 87, 99,218,198,222, 58, 36, 65, 0,172, 17,146, 61,170,112, 76,192,187,209, 98,201,110,214, 60, 31,103,254,193,103, + 0, 64, 1, 37,135, 11,151,239,142,223,134,165,222,112,155,221,160, 91,117, 42,159,150, 62,206, 77,207,111, 29,110,205,222,152, +221,174,161, 39,131,169,224, 45, 68,101, 19,185,167, 66,140, 81, 24, 90, 5, 92, 27, 28,127,243,244,245,202,206,234,244,245, 25, +212,100, 48, 25, 10,113,248, 10,200,148,251,205,130,219,169,195,185,193, 97,171,245, 10,188,108,251,118,121,239,112, 23,210,246, +234,201, 1, 36,122, 80,222,221, 47,221,131,203,201, 25,214, 9,218, 57, 53,214,214,126, 62,123, 48,183,188,250, 21, 2,244,196, +200,173,177,226, 24,100,157,123,118,197, 67,237, 76,192, 68,209,113,235, 57, 61, 63, 90,188, 82,204, 21,202,118, 25,206,217, 39, + 38, 88,203,109,182,131, 14,148,104,176, 98, 23,191,125,134, 80, 4,183,175,213,105,125,255,243, 3, 5,143,240, 90, 6,193,228, +200,205,221,218, 14,188,198, 67,249,171,221,160,142,147, 63,140, 1,235,113,145,147, 80,152, 26, 91, 46,165, 27,168, 4,241, 84, +174,103, 8,195, 48,153,133,128,205,159,174, 58, 91,191,156,237, 13,199,169,183,131, 0,163, 0,181,112, 81,180, 71,224, 76,156, +116,120,121, 24, 34,187,168, 49,201, 96,162, 33,203, 58, 99,104, 5, 0,197, 33,249, 19, 80, 48, 9, 91, 92, 77,224,157,169,226, +148,213, 55,126, 96,111, 35, 15, 22, 87, 90, 60, 56,157, 31, 84,173,165,237, 53,143,231, 95,190,127,177,176,240,225,161,254,188, +206,111, 46,186, 95, 94,149, 30,181,195, 22,159,142, 44,166,140,181,151, 51,114, 18,206, 10, 69,185, 41, 92,117, 64,133, 45, 60, + 74, 67, 49,161,120,168,181,106, 17,186,170,134,249,108, 31, 60, 11, 31,137,218,148,137, 83, 78, 8,235,245,216, 61,134,200, 23, + 34,133, 45,192, 14, 13,238,117,120,229,147,253, 90,179,134,215,134,222, 18, 89,175,219, 78,236,142,184, 88,195,213,163, 45, 18, + 33,113, 44, 20, 98, 87, 20,100,109, 29, 53, 15,249, 40, 19,111, 28, 36,221,106,186,179, 97, 76,106, 36,202, 56,241,247,176,125, + 69, 78,216,156,215,110,145,129,101,186,255, 28, 79, 29, 75,134,160,224,183, 20,180, 62,108,237,242,103,143, 7, 18,237, 16, 18, +128,128, 22, 66, 47, 29, 77,169, 49, 3, 74,160, 39,119,230,215, 43,107, 52, 15, 56,109,188,114,137, 61,211, 25,186, 35, 39, 18, + 89,249,254,190,189, 7, 81,225,175, 0,116, 93, 75, 79, 19, 81, 20,158,123,239, 48,211,199, 48,125, 8, 8, 72,173, 98, 8,104, + 32, 33, 32,110,116,227,198,181,123, 87,174, 76,252, 11,110, 93,232,206, 95, 97,226,206,196,141, 27, 13,108, 52, 33, 46, 80, 9, + 81, 32, 64,171, 34,180,149,215,132, 62,102,202, 92,207,119,110,139,175,152,176,108,232,237, 60,238, 61,231,124, 47,224,171, 16, +124, 90,166,175,249, 85,254,159,252,185,119,159,238,119,250, 63,195, 25,253,207, 88, 70,252, 13,198,158,158,201,127,152, 28,252, +222, 4,200,223,112, 87,249,159, 89, 80,119,145, 82,118, 1, 3,217, 5, 0,164,185,108, 24,132,227, 7,187, 54,109,137, 8,201, + 85, 92,182,107,190, 12,172, 93,134,220,198,208,247, 48,187, 84,142,151,204,214,168, 68, 2, 91,191,201, 0,218, 47,189,149, 50, +167,165,148, 57,184,214, 1, 45,161, 23,169, 45,162,180,157, 72,185,233,180,155,166,135,146, 54,108, 71,185, 67,153,194,183, 96, +131,158, 99,109, 64, 14,142, 76,160,231,154, 42,164,201,193,171,149, 96,221,182,163,124, 42,133, 13, 93,232, 84, 82,185,240, 28, + 70, 89, 20,208,105, 0, 39,123,224, 50, 17,117,112,128,179,216, 41,131, 93,186, 29,102,155, 43,165,194,118,204,254,165, 18,107, +112,128,117, 42,164,203, 50,208,194, 53, 79,108,181,205,106,169,190, 86,220, 77,119,156,137,164, 86,182,100, 15, 58,193, 58, 92, +180, 49,136, 6,228,249,140,113,214,134,149,181,102,198,175,230,228,107, 7, 70, 58,224, 70, 2, 34,102,162, 36,155, 45,187,156, +199,204, 92,221,248,184,110,213, 57,243,156, 13,160, 69,196,225,199,142,176, 28,173,131, 61,213,140,173,125,204, 31,233, 28,242, +169, 60,143,145,109,223,128, 32, 25,139,232,105,159,180, 4, 91, 5, 36, 28,119, 48, 59,252,181, 86, 42,244, 21,171, 65,205, 98, + 50,102,194,237, 13,195,122,214,203,209, 25,176, 31, 84,206,248,253,212, 4,196, 28, 70,220, 3, 70,179, 26,201,157, 75,185,169, +114,181,212,182,244,185,220,240,250,246, 42,173, 97,116,104, 60,140, 26, 84, 2,211,135,189, 68,186,222,170, 23, 6, 46,110,237, + 66,214, 63, 85,156, 10, 26, 65,191,223,119,253,242,220,211,249,103,126,202,255, 82, 45, 83,149, 68, 47, 52, 93,139,179,217, 1, +234,147, 34, 29, 31, 30,237,161, 28, 59,137,232, 38,222,189,125,111,254,237, 75,165, 5,198,238, 82, 86, 14,118,115,201, 76, 38, +237,239,254,248, 78,119, 99,246,210, 52,109,103,158,155, 90, 92,123, 55,218, 95,220,222,219,241,147, 30, 93,236, 91, 51, 55,223, +172, 44,110,236,108,120,105, 56,139,113,236, 50, 35,101, 40, 11, 84, 95,166,207,177,221, 82,117,131,238,218,220,216,244, 74,105, + 53,108,211,147,211,147,243, 50,249,204,192,114,233,195,204,232,236,251,210,199, 27, 87,174,189, 90, 90,224, 60, 57,155,170,235, + 36, 71,114,211,205,184,112,182,184,185,187, 53, 49, 50,177,182,253,217,150, 46, 43,141, 32, 6,246,144, 24, 23, 59, 8,215,147, +121, 63,123,208,170,221,201, 95, 56,255,112,204,242, 4,252,103,142, 27, 86,196, 16,107, 35,130,147, 92, 35,196,223,113,104,213, +163,184, 25, 66, 81,210, 66, 16,205,243,165,114, 37, 0, 88,100, 92,134, 36,151,151, 74,128,112,201, 89, 48, 28,158, 11,123, 65, + 16, 13, 4, 71, 7,131, 57,102,162,163,109, 97,140,192,128, 6, 65, 9, 69,173, 99, 43, 47,135,235,193,249,253,184,157,224, 52, + 98,184,237,193,161, 79,140,247, 22, 30, 45,190,216,172,197, 75,205,133, 65, 49,118,127,228, 97,221,253,244,120,251,201,235, 91, + 15,106,141,170,209,177,155,220,154,144,161,124,102,103,226,109,240, 18,189,213,160,106,152,240,212,210,177,142, 16,179, 15, 72, +133,192,121, 59, 49,173, 6,147, 81,116,108, 24,135, 22, 59,196,242,248,155,173, 27,185, 23, 97, 98, 53, 51,172, 99,221,193,198, + 58,130,169, 86,212,154, 44, 78, 46,151, 87,168, 63, 48, 72, 40,190, 3,255,196,202,184,254, 17,146, 52, 84, 11, 26, 73,214, 6, +197, 72, 69, 51, 95,101,198, 41,124, 66,152, 49, 10,179, 90, 68,215,176,214,182, 56, 93,180,147,163, 98, 92,136, 59,165,163,150, +167, 33,124, 38, 99,139, 71,250,130,127, 26,107,244,121, 95,115,132,123,216, 60,160,178, 12,144,134, 98,120,143,107, 91, 58,159, +142, 26, 32,143,165, 33,235,179, 0, 32,153, 97,147,212, 84,254,133, 81,243,167, 0,108, 93,203, 78, 83, 81, 20,237,189,167,247, +121,218,222, 2, 82, 68,209, 0, 70, 35,241, 17, 13, 70,141, 3, 67,100,224, 15, 56, 48,198,168, 3,167,126,128,113,162,191,161, + 31,132,134, 8, 19, 99,128,138, 65,229,145, 82,160,175,251,126,186,247, 62, 7,170, 9, 73, 7, 29,180,183,205,189,231,172,179, +246,107, 45,201,223, 19,201,148, 79, 1,119, 67, 53,176,180, 88, 12, 63, 96,226,218,194,187,114,245,236, 28, 28,161,202, 16,172, +255,123,157, 90,146, 85, 37, 67, 7,214,108,230,255,215,110,149,225, 9, 81,148, 73, 50,183, 56,173, 76, 43,206,169,178, 42,115, +215, 39, 10,245,202, 73, 60, 35, 50, 95, 84, 65, 7, 54, 1, 97, 93, 4,193, 90, 46,227, 33, 49,174, 43,174, 12, 75, 20,200,151, + 31,121, 89, 30,195, 9, 9, 4, 51,136,124, 49, 31, 7, 52, 80,136,229,163, 34, 2,198, 59,154, 99,141,160,177,159, 82,122,251, +228, 93,115,103,147,164, 17, 82, 93,131,155,163, 5,112, 5,224,170,113, 96,178, 26,240, 44, 49,155,165,160,201, 41, 92, 68, 3, +158,220,241, 14,142,220,110, 47, 8,118,187,238,161,151,182, 93,246,187, 51,248,213,245, 54, 90,222,110, 79,251,211,237,187, 17, + 32, 99,133,229,220,235,135, 90, 86, 26, 97, 90,195,210, 1,222, 42, 69,137, 3,215,142, 83,141,178,128, 22, 67, 59, 67, 52, 42, + 87,201,214, 33,197,180, 40,224, 93,181,162, 0,241, 71,155, 64,106, 22, 67,121, 19, 61,167,100,122,161,209, 76,136,169, 50,216, + 34, 9,236,228, 8, 29, 9,177, 77,156, 28,251,200,133, 23,139,171, 73, 86,194,115, 9,213,252,101,111, 85,156,146,206, 76,137, + 69, 8,229,169,239,151, 34, 47, 15,163, 60, 8,243, 48, 68,151, 65, 44, 98, 99, 30, 12, 27, 70, 1, 89,224,135,108, 85,153,228, +198,160,155,117, 3,181, 31, 28, 97, 79, 78,138,206, 21, 40, 32, 74, 61,181, 42, 43, 23, 52, 76, 0,209, 77,197,170,225,200, 70, +154,132, 73,236,216,163,135,131,182,208,202, 51, 53, 14,167,176, 99,215, 72,187, 2,248,184, 97,105, 86,213,114, 44,211,198, 39, +149,166,207, 22,158,114,157,127,217, 88,190, 63,247, 0, 48, 17,142, 44, 55,236,155,134, 13,251, 31,184, 24, 61,205,236,249,139, +151, 95, 87,150,209,165, 1,195,165, 20,208,217,208,245,239,219,223,150,214, 62,147, 56,120, 8,123, 19, 72, 39,196,112,126,232, + 98,241,179,127,160,149,141, 65,208,131,231, 56,211,152, 14,227,112,107,231,199, 68,117,124,171,181, 5, 81,160,134, 45, 42, 10, +132,255,113, 28, 0,154, 24, 58, 0, 22, 3,106,143,201, 37,133, 77, 79, 92,132,143, 1, 11,115, 3,183, 9,223, 26,153,216,239, +183,227, 60,165, 64,187, 2,251, 4, 32,163,213,221, 55, 12, 8,223,204,187, 87,238,172,111,175,195,234, 58, 63, 54, 85,183,157, + 67,172, 39, 23, 97, 18, 0, 55, 92,188,190,176,185,215, 12,163,160,213,217,127,124,123, 17,160, 28,189, 74, 76,126,115,250, 6, +252,127, 88,108,220,228,176,153, 1, 40,225,124, 66, 37,156, 60,133,187, 52,211,152, 73,146, 24, 77, 19, 89,217,225,163,117, 62, + 30,166,238,252,153,121,126, 47, 43, 57,140, 98,183,252,120, 79, 22,242,141,136,233, 8,220, 20, 82,178,177,116,182,182,211,235, + 5,137,172, 62, 34,175,192,117,133,129, 30,195,185, 13, 28,155, 32,135, 44, 93,197,123, 81, 70,133, 96,180, 31,208, 25, 57, 7, + 96, 15, 87,169,172, 72, 39, 37, 74,241,169,137,210,155,180, 27,188,122,217, 13, 58,140, 52,214,133,145, 33,215,141,102,103,239, +103,219,123,243,254,245,199, 15,159,166,204,107,133,214, 95,242, 87, 94, 93,122,152,228,158, 24,113,145, 44, 78,234, 88,145,200, + 9, 10,197, 36,179,231,102,123,254,128,102,203, 11,250,239,136, 67,220,172, 98,110,157,224, 34, 21,185, 12, 1,186, 36, 83, 40, + 0,156,220, 32, 4,165, 70, 62, 88,200,140, 44, 78,177, 83, 47, 77, 33, 68,200,235,118,253,209,173,133,213,205, 85, 69,149,205, +178,199,180,181,240, 34,159,188,134, 72,163, 86, 68,198,196,224,185, 94,137, 73,146, 87,102,240,101,149,163,248, 23, 11, 69, 86, + 64,246,122,160, 77, 80, 13, 47,146,231, 83, 99, 23,188,120, 32,168,175,195, 29,147,153,134,129,221,128, 8,220,118, 21,139,130, +244, 91, 25,182, 48,197, 52, 84,165,202, 51, 66, 25, 6, 99, 98,198,149, 92, 3, 81, 33, 17,144, 10, 45,188,211, 4,173,107,179, +228,175, 0,124, 93,203,106, 19, 81, 24,158,123,230,146, 76,218, 73,164,157,182, 94,104,172, 5, 69,112,227, 66, 80, 65,193,133, +143,160, 75,215,186,114, 39,184,241, 41, 92,248, 10, 46,124, 4, 81,180, 40, 40,138, 84,171,182,222, 82, 91,211,166,211, 92, 38, +115,201,204, 25,255,239,156,164, 6, 65,187,106, 33, 9,105,114,206,119,254,243,255,223,229,160,255,206,228,137,190,243,100,229, +158, 97,135,176,201,122, 60,227, 18,101,250, 33,112,255, 79,199,230, 31,213,247, 65,189,127, 48, 19,158,108,220,203,163, 33, 1, + 30,197, 38,251,225,242, 95, 13, 28,161, 20, 27,207,157,139,137,219,192, 72,168,202, 21, 16, 96, 0,194,117, 25, 35, 75,219,168, + 32,148, 91, 98, 60, 60, 11,211, 30, 75, 51, 7,195,152, 62,214, 36,143,233, 97,128,111,254,174, 64,125, 97, 57,221,211, 17,231, + 4,118, 18,150, 1, 1,135, 12, 84,205,158,172, 62,238,197, 96,125,209,202,167,167,152,154, 41, 73,154,131,179,161,175,169,165, +118,127,135,214,127,138, 72, 76,168,224, 96,126,164,186,200,235, 73,163, 91,215,239,188,124,251,220,198,183,155,100,108,192,152, + 78, 11,228, 72,253,196, 86,103,179, 55, 28,254,234, 15,182,194,110,161, 31,106, 14,246, 90,105,214, 12,227,159,221, 4,226,116, +130, 60, 73, 41,201,178,107,168,117, 83,175, 91,165,186, 89,154,162,223,237, 82,165,164, 76, 57,170,101, 20, 6,109, 98, 65,142, +224,126, 3, 25, 40,108, 76,196, 56,148,184, 15, 26,167, 24, 21, 84,245,219,150,226, 56,116, 45,149, 45, 75, 49,116,201,210, 85, + 27, 77, 33, 68,250, 85, 76,197, 18,138, 82, 42,176,121,150, 56,168, 64,252,152,140,232, 96,136, 89,146,230,125,130,177, 48, 79, + 83, 88, 87, 74,220,230,222,210, 20,171, 36, 83,217, 94, 54,164,163,142,181,222,220,255, 18,244,226, 44,196,101,132,103, 19,170, +176, 13, 64,247, 80, 6,119,136, 14,191,204,247,230,235,110,109, 39,216,102,133, 80,163, 20,136, 35, 80,168, 24,153, 82,249, 22, + 24, 14, 35, 85, 53,174, 93,190,182,178,250, 84,216,144, 5,189, 29,238, 10, 43,211, 71,186,178,182,194,249,156,249, 86,176,153, + 36, 49,149,219,167,142,157,222,237,180, 96, 50, 28,238, 1, 67,242,156,192,221,181,171,113, 58, 56,214,104, 92, 56,123,105,253, +235, 39, 90, 48, 21,179, 74, 27,188, 86,246, 32, 50, 74,224, 92,132,178,151, 14, 15,122,100, 22,207,123,254,126,119,151,144,136, +240,130, 94,135,238, 28,173,110,139,254,247,165,185,198,204,180,191, 60,191,244,109,251,139,174,170, 23, 79, 94, 56,236,205,124, +248,177,102,104,170, 95,245,203,150, 77, 39,183,173, 91,231,207, 93,221,248,182,154, 98, 12,174, 31,173, 31,217,237,180, 97,241, + 24,245, 8,199, 63,110,173,249,211,115,253,168,123,229,204,165,135,207, 30,209,129, 68,133,127,208,223, 67,158, 76, 20, 82,241, + 94,171,212,118,247,219,158,235,253,216,105,210,155,140,134,225, 50,100, 53,155, 2,148,218,189, 64, 36,160,201, 24,249,184,180, +207, 59,112, 66, 63, 94,181,171,220, 87,121, 95,211, 84,215,172, 80, 93,153,231, 81, 60, 12, 44,221, 97,189,237,197,203,179, 82, +221,192, 54, 18, 4, 22,174,115, 31,169,111, 20, 1,160, 88, 49, 90,145, 19, 46,151, 29,251,253,247, 96, 47, 78, 21, 65, 52,230, +179, 80, 29,107, 6, 53, 14,156,161,225, 3,165, 42,114,113,144, 1,164,240, 52,137,178,166,121,150,121,120,122,138, 91,169, 23, + 58, 15, 40, 22, 61, 97,250, 34, 92, 24,102,206, 7,200, 16,215, 10, 52, 91,170,244,212,198,236,194,235,230,198,155,246,230,237, +187, 55,239,223,123,176, 96,158,148,245,238,139,244,221,141,197,243,116,195, 27,183, 47, 20,113,203,103,162, 58,150,216,140, 55, +219, 9, 49,188, 73, 97,135, 38, 84,103, 80,180,248,158, 79, 11,131,167,247,113,176,135, 17, 22,231, 15, 51, 30, 75,204,248,168, + 77, 42, 70,234,243,113,199,155, 11, 71, 11,193,245, 88, 94, 88,238, 65,215, 10,219,240, 48, 13, 95,125,126, 3, 37, 14, 98,155, +242, 92,112, 85, 56,246, 80,209,183, 56,211,248, 25, 52, 37,238, 81, 88,140,161,210, 50,156, 40, 3,119,222,117,170, 9, 55,254, + 29,211,232,255,244, 38,184,235,248,184,129, 66,216,109, 86,232, 70, 66,175,214,234,208, 70,135, 13, 6,227,109,176, 48, 9, 35, +168,165, 32, 76, 33,184, 0,201, 93,226,100,239, 66,246, 42,181, 40,141,124,111,174, 75,187,224,207,132, 85, 22,118,191,138, 52, +178,204, 65,247,157,138, 86,148,249, 24, 9,208,223,191, 5, 32,236, 90,122,154,136,162,240,189,243,106,167,175,161,211,242, 20, + 20, 48, 54, 49, 38,154, 40,129,176,112, 97, 92, 26, 55, 6, 23,198,141,254, 0,119,238, 77,252, 17,198, 95,100,140, 11, 9, 17, + 66, 2, 18, 33, 66, 1,219, 82, 90,153,247,148,250,157,115, 91,209,104,116,215, 38,147,153,204,220,243,248,190,115,207,253,206, + 69,253, 93,251,227,252, 81,255,111,120,252,191, 56,253,223,101,122,117, 91, 83, 90, 84,103, 96,158, 32,105,180, 21,112, 1, 55, + 74, 15, 19, 19, 15,241,101,253, 88,221,198, 23, 28, 52,183, 92,220,225,183,221, 92,238, 5, 27,236, 64,255, 58, 94,138, 77,132, + 52, 12,240,126,128, 54, 30, 77,100, 86,226, 25,120,124, 38,161,211,248, 88, 66, 50,151,124,166, 64,170, 20, 92, 15, 81, 75,193, +134, 18,193,116, 72, 98, 76,227,209,174,116, 59,146, 89, 39,101,158, 65,191,189,129,240,253,112,241,209,218,222, 42,137, 16,145, + 76, 71, 60, 89,158,110,118,142,121,143, 30, 4, 51, 74, 41, 5,167,126,226, 39, 73,242,126,253, 29,156, 48, 1, 16,129,253, 9, +150,157,232,197,199,221,125, 75, 47,198,189,208,177, 43,166, 97,157,248, 71, 84,227, 67, 64,215, 92,255,220, 75,133,222,137,123, +223,226,184,225, 27,199, 33,141,242,106,195,133,101, 31,236, 49,167,153,174,153, 25, 45,228, 29,211, 44, 25,217,108,223, 40, 72, + 16,117, 19, 63,108,221, 36,163, 76,101, 74,211,123,100, 20,244,168,227, 37,161,183, 29,136,209,113,163, 53, 33, 47,171,207,218, +238,162,144, 69,232, 71,208,151, 36, 32,108,144, 81,145, 42, 23, 11, 53,229, 76, 35,103, 1,163,145, 70, 77, 5,216, 35,111, 58, + 69,195,205, 91, 37,219, 40,216,200, 16, 50,171, 73,176, 13, 71,154,159,246, 90,187,109,143, 5,134,184,135,141, 93,104,202,157, +113,178,101,216,238, 98,109,121,231,120, 27,159, 22,142,138, 8,149,203,208,164,189,169,242, 76,209, 38, 10,133,181, 0, 76,158, + 28,153, 6, 96,183, 12,219,143,189, 86,183, 5,199,163,208, 47,180,169,234,165,132,132,248, 85,137, 64,175,228, 43,126,236,219, + 89,187, 54,125,189,235,119, 16, 70,145, 63, 86,238, 61,174,218,213,253,214, 62, 69, 37, 3, 38, 30, 45,213,150,215, 54, 87, 55, +183, 55, 4,205, 33,176,224,189, 14, 29, 56, 12, 73,201,137, 59,137,113, 67, 80, 90,184,165,174,134,192, 17, 79,165,246, 24,172, + 99, 46,147,127,118,255,169,231,159, 53,189,246,215,198,222,231,250, 86,213, 25,155, 25,191, 34,123,233, 89,224,195,150,198,157, +177,131,246, 97,204,162,154,240,216,237,157,117, 60,229,206,181,219,251,205,131, 32,138,192,142, 96, 15, 69,187, 52,225,142, 29, +180,142,206,162,239,126, 24, 54,207, 78, 88, 47, 48,154,159,156,109,117, 72, 99,214,143, 34, 16, 85,215,157, 88,121,240,100,247, +203, 54, 94,106,212,169, 82,161,128,240,151,141,235,121, 4,141, 64, 14,155, 31,159,163, 2,116, 47,157,170, 76,226,233,245,211, + 58,114, 27, 18,201,169,223, 6,190,195,131, 2,150,202,129, 9,155,150,169,135,254,141,187,151,197,156,205,206,214, 23,170,241, + 74,246, 7,243,123, 6, 0, 80, 1,101, 9,112, 46, 44,243,195,250, 97,152,158, 43,234,166, 68, 96,248,176, 27, 73, 70,171,170, + 66,143,179, 53, 87,167,169, 62,109,225,147, 74,163,144,177,102, 42, 35, 70,214, 56, 9, 73,235, 41,195, 53,152,159,162, 81,169, + 8,116,207,110, 39,240,119, 13,148,101,185,182,176,215, 56, 8, 2,127,231,180,177,209,108,188,124,245,226,205,235,183, 87, 11, + 11,194,232,126, 76,182,158,207, 46, 69,125,143,251,155,127,134, 80,193, 77,253, 37,238, 89,151, 1, 41,198,240,185, 18,218, 57, + 34,249,156, 48, 78, 65,161,162,132,172, 91, 97,118,133,199,111,206,222,170,183,235,192, 42,229,210, 40,210, 42, 79,247, 81,146, +228, 98,112, 84,148, 68,168, 70, 40,152,138,243, 70,167, 73,135,111,212,214,164,212,203,197, 50,139,218,218,113,156,128,178, 19, +164,227,241, 26,112,231, 70,183, 37, 46,250,215,149,148, 35,176, 8,137, 31, 68, 41,248,147, 21,167,161, 98, 73, 44,127,112,209, +208,194,255,213, 68, 5,250,244, 64,232, 88,214, 19,175,229,230,221, 40,142, 21,221, 0,226,150, 67,185, 39,213,167, 52,236,173, + 35,122, 97,104,166, 23, 7, 17,205,124, 72, 7,245, 9,109,200,199, 52, 49, 60, 24,164, 46,239, 81,206, 80, 81, 81,138, 31, 2, + 48,118,109, 61, 81, 67, 65,184, 61, 61,167,183,237,178, 11,203,101, 81, 9,209, 64, 76, 76,136,111, 70, 30, 12, 15, 62, 25,255, +130,254, 55,226,131,241, 15, 96,120,210,196,132,248, 0,162,196, 53, 18,110,114, 95,220, 11,108,247,214,118,219, 61,117,102, 90, +118, 53,129, 68,120, 34, 57, 9,237,194,153,249,102,230,155,239,227, 3,156,126,211,102,233,173, 63,170,202,255,126,197, 55,157, +239,145, 87,203,176,185,143,241, 46, 26,156,209, 85, 4,182,112, 3,225, 41,131,190, 23, 96, 86,255,167, 83,175,222, 74,191,188, + 78, 75,196,166,137,211,205,219,216,226, 54,138,234,200, 36, 23, 51, 8,217,221,168,131,130, 18,154,128,240,219, 99,125, 36,243, + 37, 34,149,169,227, 65,210, 96,161,137,127,140,125,124,116, 17, 81,100,206, 25,109,180, 27, 49, 53,207, 24, 42,120,250,240, 87, +127,251,233, 13,156,132,154,136, 28,107,253,131,202, 62, 10,224,168,108,196,202,215,187, 53, 20, 95, 11,113, 90,162,162,208,138, +212, 24,148,120,186,135, 78,184,164, 77, 71,109,114,215,199, 37,172,178,123, 78, 14,174,184,240, 9,233,183, 27,161, 62, 17,128, + 54, 78, 11, 71,161,210,233,247,181, 82,211, 61,186,108,249, 18,123,112, 28,203,100,101,196, 50,115,166,152,205,102,167,179, 25, +219,182, 13,166, 77, 24, 70, 61,232,193,221,178, 98,110,192,195, 43, 40,116, 9, 33,187, 21, 81,110,241, 36,212,127,161, 8, 13, +147,235, 2, 31,128,163, 73, 9,138,118,216, 54,217,151,195,107, 68,172, 7,224, 33, 68,238,151, 31, 34,131, 1,192, 0, 84,229, + 30,122,131,209, 71, 19, 65, 96, 66, 56, 9, 79,152,183,245, 41,199,168, 53,188,245,131, 43,168,239,161, 60,152, 30,155,217, 62, + 47, 17, 66,194, 44,119, 88, 61,192,253,163,208,251,113,252,253,206,216,189,122,179, 26,163, 28, 43, 60,188,238, 75,191,222,169, + 26,204, 48,209,122,219, 88,152,121,180,125,242, 19,224, 51,105,242,241,171,102,157,150,215,188,172,149,131,127,114,136,254,104, +166, 72,151,115,191,178,135,150,170,157,102,229,234,183, 33, 44,212,224, 53,173,229,213,229, 7,197,185,166,215, 4,144,139,154, + 88,113,184,117,180,165, 27, 38, 73, 12,234,112,108, 52, 83, 16,130, 95, 93, 52,252, 48,120,253,252,213,225,249, 33,250,132, 48, +117, 99,119, 3,110,117, 27, 45,146,185, 35,178, 93,196, 1, 80,112,132, 43, 27,171,173,182, 11,137,103,174,120,223, 80,121,161, + 48,181,180,176,244,181,180,118, 82, 63, 11,124,223, 51, 3, 0,176, 79, 31, 62, 9,250,189,141,157, 77,199,114,244, 40, 62,174, +156,154,134,157,216, 15,189, 92,124,177,242,249,253,222,197, 97, 49, 95,132,219, 7, 9,222,133,250,140, 41,243,197,249,197,199, + 75,103, 31,222,193,175, 43, 56,163,249,217,169,198,217,101,175,211,114,204, 12,164,159,114,189, 12,145,168, 92, 43,231,157,172, +206,120, 46,147,245,194, 94,151, 28,194, 32, 55, 20,114,133, 70, 11, 3, 58, 87, 24, 36,176,163,218, 17,225, 66,214,241, 91,147, + 99,119, 39,166,166,127,237,175, 67,141,217,225,150,178,227, 42,207,198, 17,164,247,117,140,239, 26,142, 62,144, 81,195, 7, 46, +109,212, 45, 16,232, 93,208,250, 86,133,202, 76,215, 88, 72, 33, 94,198,233,172,142,209,202,158, 42,101,252,247,197, 7,152,163, +169,150, 16, 72,168, 21,218,113,199,109,214, 61,192, 61, 25,156,216,224,183, 96, 9, 32, 82,133,136, 38,133,233,143,207, 94,158, +238,194,167,244,177,180,198, 0, 67, 25,136, 36, 77,197,198, 17,168, 18, 59, 60,219, 66,237, 82,147, 40,251,164,162,138,180, 3, +178, 38, 67, 18, 49,183, 12,211,239, 7, 0, 8, 18, 23, 1,153,178, 63, 84, 50, 19,166,125,218, 52,112, 35, 97,153,140,222,250, + 95,246, 54, 5,231, 80,146,251,110, 69, 38, 27,254, 41,108, 87, 82, 79, 34, 56,140,100,138, 88,146, 11,216,245,168,143,106, 96, + 57, 92,123,108, 7, 77, 98, 70,202, 56, 29,180,146,201,220,192, 89, 34, 49, 54,196, 3, 56, 5,161, 68,130,188,154,196,245, 66, + 29,116,195, 18,123,207,148,179,159,200,250, 37, 12, 33, 9,176,143, 36, 92, 37,170, 58,114,173,226, 86, 53,114, 82,187,102,243, + 37,197, 6,190,128,219,117,113,102, 38,195, 33, 69, 50, 30,118,180,213, 84,125, 64, 73,204,177, 1,136,192,171,212,208,124, 92, +253, 35, 0,101,215,210,218, 68, 20, 70,103,238,157,153, 36,211,166, 77, 99,211, 23, 20,219, 34,138,148, 22,171,226,190, 32, 5, + 55,254,129, 46,253, 29,130,127, 68, 4,117, 45, 8,174,186, 16, 4, 91,186, 80, 81,236,203, 42, 45,244,153, 52,233, 35,175,121, +100, 30,241, 59,223,157,212, 86, 68,116,153,217,204,100,230,222,115,191,199,249,206, 49,206,201,148,250,191, 33,251,223,233,237, +255, 9,251,151,160,191,163, 34, 9,244,135, 56, 1, 6,127,245,246, 31,186,175,191,117,119, 47, 50, 27,117,117,110, 38,122, 58, + 29, 63, 42, 31, 61,179, 16,204, 46,230,133,177,202, 2,240,199,109,123,120,239,177,160,157,147,136, 44, 11,165,162, 31,167,173, + 44, 84, 10, 88, 28,174,195, 85, 18, 39,213,242,244,196,157,239,123,235, 20, 94, 65,190, 82, 24,220,111,194, 93,156,192,229,162, +190, 78,169, 64,211,175,251, 65,171, 20, 28, 34,234, 17,129, 98, 69,161,128,169, 73,120, 98, 99, 29, 66,211, 15, 73, 71,152,232, +203,113, 23, 84, 87, 19,106, 66,143, 36, 92, 87, 35, 52, 0, 36, 62,191,100, 57,235,182,136,242, 54,232,170,181, 86, 76, 55,160, +240,208, 9, 34, 2,163, 98,172,125, 11, 43,234, 52, 39,164,156, 26,204,209,195,235, 25,139,192,213,128,209,187,180, 92, 48,212, +108, 33,123, 51,169,235,217, 44,202,223, 26, 6,156, 17, 97, 19,238, 64, 26,205, 8,221,184,234, 33,252,241, 64, 74, 18, 65,160, +241,170,230,177, 58, 22,163, 2,153,172,133, 38,170,169, 94,146,174,245,219,169, 30,211,114,253,120,105,237,232,168,225, 75,153, +182, 77,171, 82, 47,110, 30, 64,160, 28, 58,215,128, 5, 1,140,246, 28,219,176, 27,126,163, 14, 95,158,144, 78, 62, 58, 50,107, + 94, 13,134,186, 45, 47,211,101, 55,156, 42,133,231,110,224, 53, 3,135, 50,208,148, 48,231,102,230,150, 55,150,232,138, 50,217, + 41, 86, 15, 29,207, 61,183, 65,231, 40, 94,137,143, 34, 48,163,216,188,238, 53,109,171,123,126,118,254,201,139,199,147, 87, 39, + 9,178,251,179, 5, 10,255, 41,127,145, 44, 47, 83,170, 22, 9,247,143,105, 11, 65,150, 78,123,186,240, 76, 98,232,193, 31, 45, +140,101, 80,175, 12, 29,223,233,235,202, 15,247, 13,111,238,111, 96,245, 24,102,241,172,148, 49,210,131,185,161,129,158,161,245, +221,149,221,242,206,215,205, 15, 35,185, 17,215,119,108, 51,125,247,218,204,226,234,226,231,173, 47,163,253,163,244, 19, 70,184, +169,238, 66,207, 21, 90,127, 53,167, 78,223,229,227,198, 39,203,180,210,166, 21,107,225,126,249, 16, 90,226,244,212,154,204,166, +186, 95,191,123, 69,175,221,176,229,126,249, 96,188,235,198,118,101,229,229,155,231,247,167,103, 13,156, 70, 65, 79, 38,123, 84, +171,152,102,234,225,189, 7,239,215,150, 61,175,154,179,123, 43,181,242,237,137, 91,187,149, 61,202, 90, 40,126,167, 96,175, 59, +133,188, 71, 50,146,112, 2,212, 42, 12, 12,113,173,185,237,153, 93,219, 11,123,227,143,110,106, 4,166, 81,147,199,234,120,129, + 11, 14,225,209,164,135,225,147,214,107,162, 26,189,122,250,118,121, 7,174, 9,154,130,190, 14, 11,156, 27,144, 23,235,181,138, +171, 7, 75, 75, 41,242, 89, 91,166,205, 83,215, 9,113,246, 75, 30,188, 69,230,198,189,124, 86,180,101, 31,119,215, 45,231,236, +169, 10,212, 6, 5, 51, 86,100,196, 81,182,218,247, 77, 45,176, 52, 99,207,219,137, 88, 36, 71,176, 83,149,206, 93, 80, 61,142, +144, 78, 71,218,113,253,152, 54, 12,253,205, 80,136,241,252,216,143,210,150,143,234, 53,108,192, 66,140,112,160, 8, 19, 43,213, + 5,140,119,194,229,147,221, 36,193,217,111,199,241, 57, 74, 38, 65,183,114, 56,162,111, 4,254, 30,229, 45, 6, 5,197,202,213, +155, 91,166, 26,230,186,194,176, 17,213,241, 4,220, 90,253,197, 81,108, 39, 37,157,118, 98,156,150,216,122, 83, 30, 0, 5, 87, + 16,124,141,124,182,159,150,141,141, 17,185,166,154,237, 50, 18,223, 37,149, 27, 9, 53, 22,195, 76, 16,221,241,154,170, 40, 29, + 41,151, 64, 80, 42,216, 60,141,163,152,115, 54,126,199,114,137, 79,219,203, 66, 0,226,130,222, 77, 98,104,221,142,207,154, 39, +220, 92,193,165,159, 2,176,118, 45,187, 77, 67, 65,244,218,215, 78,108,231,225,164,143, 52,168, 65, 77, 43,144,128, 21, 11, 86, +124, 2, 18, 43,126,128, 79,227, 11, 88, 32,132, 4,136, 45, 66,109,165,168,139, 66, 90,181,180,105,200,163,121, 55,142,227,248, +205,204, 92, 39, 5,193, 6,137, 31,176,147,235,185,103,206,188,206, 40,236, 95,104,251,127,133,248,223, 94,145,230,168, 8,239, +224, 70,111,153,170,211, 33, 75,148,206,208, 78,132,174,127,244, 55,136,143,153,178, 18, 56,203,106,121,128, 74, 84,142,252,149, +202,211,113,137, 22,120, 60,168, 72, 40, 92,196, 16,194,135, 97,184,172,112,163,113,194,133,199, 98, 69,136,186,154,118,100,137, + 28, 76, 81, 55, 83,170,222,159, 94, 51,218, 85,113,116, 81, 3,184,217,217,172, 54, 7, 77,225, 52,105,140, 80,246,209, 16, 84, +120,219,100, 49,166, 70, 63,209,142, 41,149,243,101,112, 15,148, 72,247, 72, 84, 67,162, 86, 10, 38,254,142, 72, 45, 5, 52,172, +140,117, 77, 68,113,106, 53, 6, 48, 96,124,175,240,168, 57, 61, 71,197, 73, 22,240, 0, 94,129, 59,189, 73, 72, 61, 82,104, 49, + 3, 23, 75,230,105,250,158,115, 81, 95, 10,235,195,177,206, 93,156,228,164, 7, 35,163,145,177,135, 3,252, 27, 68, 6,128,253, +247,139,197,106, 62, 87,192,234, 66,214,148, 48,247, 2, 92, 30,229,248, 89, 48,115, 60, 75,138,231,216, 69, 20, 80,150,136,102, +175,240,186,226,230,129,208, 0,238,197,193, 77,101, 83, 28,248,163,237,248,251,223,251, 67, 11,156,167,195,165,148,231,217, 51, +127,162,171, 57, 35,149,107,141,174,224,172, 53, 85,155,187, 78,224, 47, 0,224, 12,173, 0, 22,143, 63, 9, 59, 86,248,100, 54, +146, 21,133,124, 49,220, 77,182, 91,222,187, 30,119, 15,207, 14,224, 50,220, 41, 84, 28,127,254,177,246,126,238,205,133,116,193, +192,234, 83, 25, 77, 7, 87, 69,251,181,117, 27, 53, 73, 34,192,101,112,114,134,150,237,223,116,224, 19,164, 52,253,237,254,155, +141,226,214,166, 89, 66, 33,142,208, 79,180, 88,163, 64, 85,141,148,164, 64,124,155,207,172, 45, 60, 59,165, 40, 96,105, 15,239, + 62,168, 55,190, 78,102, 67, 47,160,110, 78, 22, 14,173, 1,176,108, 51, 83,180,156,105,121,173,210, 25, 52, 32,244,182,221,233, +105,251,196,163,237, 55,240,107,102,174,173,113,117,167, 92,109,116, 27,156,243, 23, 79,159,191,254,252,174,152, 47,186,174,219, + 25,183,219, 55, 93, 89, 68,126,146,220, 26,117, 80,213, 54,242, 55, 50,235,112, 77, 81,114, 54,246,178,105,179, 61,234, 66,172, + 80,200, 20,128,176,239,150,170, 21,185,120,132,162,110,252,203,217, 65,165,180, 51,178,198, 16, 10,120, 88,117,118, 26,189,171, +177, 61, 1,127, 12,240, 13, 95,255,199,160,133,243,238, 44, 66,194,193, 36, 67, 53,168,203, 59, 18,211,239, 97,224,215, 79, 15, + 21, 8,245,112, 34,164,215, 28, 70,219,175, 62,165, 94, 62, 99,104, 74, 19,166, 16, 94,112,202,108, 35, 17, 0, 60,207,176, 90, +247,226,195,249, 81,189, 55,116, 92,224, 1, 88,213, 32,189,160,208, 23,240,144,180, 96,173, 6, 15, 41,221,137,155,249, 42, 27, +249,133, 28, 77, 45, 11,112, 21, 32, 82, 69,128,140,133, 24,155,104, 83, 3,179, 83,200, 42,211,138, 23,205, 44, 44,174,104,198, +124,225,193,205,210,228,180,231,133,154,142,187,177, 38,108,182,173, 85,246,231,158,153,206, 7,145,139,139,106, 49,240,205,155, + 70,230,164,115,153, 91, 47,207, 71,125, 28,162, 21,156, 61,138,176, 34, 66,126,231,201,189,199,181,203, 99,184,114, 91,102,233, +184,245,141,228,224,104, 95, 82, 64, 2,245, 50, 11, 48,155, 71,124, 62, 78,210,185, 98, 8, 55,190,109,199,128,208, 77, 49,211, +102,223,237, 69, 75,124,228, 50, 98, 8,202, 10,105, 89,136, 0,134,179, 27, 89,138, 87,178,180,183,204, 90, 20,126,105,229, 88, +210,209, 71,199, 5, 15,204,164,113,200, 57,173,104,182,235, 8,150, 9,252, 6, 44,208, 15, 93, 81, 30,141,165,165,244,215,106, +168, 83, 98, 99,107,204,150, 27,208,153,152,125,100, 75,177, 2, 1,130, 44, 81,164,249,163,229, 36,145,131,148,146,225,127,244, + 14, 20, 57, 39, 58,140, 63, 5, 96,236, 74,118,155, 8,130,104,207,238,217,226, 69,182,147, 40,137, 2, 18, 66, 32, 33, 33,113, + 0, 62,129, 59,159,192,133, 3,119, 62,130, 95,224, 15,144,184, 32, 4, 39, 56,162, 8,133,229,192,201, 33,193,132,216,216, 25, +143,199,179,122,182, 30,170,186,199, 73, 0, 9,113,241,201,158,145,103,170, 95,191,234,122,245, 74,254, 7,148,255, 79,243, 42, +206, 9,100,170,243,255, 63,127,255,251, 11,204,110, 16,167,204,178, 20, 3, 34, 44,171, 7,212, 18,174,132, 21,203, 11, 66,204, +139, 87,101,150,100,213,234,228, 93,138,113, 38, 97, 33,158,221,147, 15,134,173, 68,222,169,180,106, 7,168, 50,148,143, 84,170, +108,178,169,187,252,185,112,215, 48, 52, 68,217,237, 94,154,120, 99, 94,232,128,120,117, 99,192,107, 15,247, 9,177,146,113,202, + 43, 92, 95,108, 91, 29, 72,141, 41, 14,180, 83, 41,182,119,166,248,158,197, 66,145, 20, 8, 70, 69,107, 96,165, 5, 85,139,194, +216, 27, 17, 38,165,101,147, 82, 0,117, 1, 70, 51,110,199,192, 29, 80, 89,234, 91, 2,137, 88, 98, 45, 18,181,232, 52,173,141, + 91, 15, 60,167, 16, 82, 85, 50,112, 61,227, 25,227,170, 66, 34,254,182,125,115,130,133, 61,243, 88,202, 32, 97, 73, 66, 57,173, + 89, 87,121,225, 45, 34,101, 19,130, 44, 58,134,237, 61, 3,214,193, 68,232, 70, 3, 56,120,175,185,182,110, 24, 91,166,121, 99, +179,103, 27, 90,207,208, 0,239,153, 89,163,144,226, 90,167,240,118,208,227,190,160,128,183,131, 81,112,120,226, 59, 11,234, 70, +129, 38, 91,247,110,222,127,181,255, 12,224, 79, 17, 13, 32,113, 16, 12,211,197,164,100,231,157, 56, 62, 27,139, 84, 42, 4, 93, +142,117,136, 76, 18,225,113,229,126,236,155,186, 29, 39, 11, 93,179,129,174,206, 99,215,199,244, 19,229,213,240, 76,166,139, 17, +206, 33, 48, 91,180,208,218,102,219,139, 61, 72,165,129, 68, 7,201,194, 99, 93,139, 13,213,100, 44, 21,235,104, 0,214,148,118, +224,167,186,102, 2,104,238, 15,222, 95,221,190,190, 63,248, 32,203, 90,156,248,146,164,233,186,177,196,228,172,138,178,168,109, +183,179,108, 41,225, 59,194, 5,219, 94,235,104, 13, 11,219, 62, 33, 12,112,108,222,229,241,236, 88,197, 30, 1, 37,203,179,225, +228, 91,199,110,206, 3, 23,246, 93,213, 82,205, 6,142,152,176,212,198,221,107,119,222,126,122,115,186,152,180,141, 38,108, 96, +207,223,189,156,249,167, 22,242,238,178,219,236, 1,188, 96,210,128,178, 37, 41,101,167, 40,101, 65,251,157,254,193,244,187,161, +106, 78, 24, 86,149, 15,223,209, 84, 77, 83,244, 19, 7,199, 72, 49,139, 40,204,216,210, 52,153, 56, 63, 0,205,113,200,178, 32, +158, 46, 28,192, 23,236, 48,101, 41, 11, 92,208,141, 92, 8,152, 69,232, 97, 63, 35, 48,137,216,195,187,228, 37,218,121,240, 0, + 38,133,109,244,189,100,114,123,227,138, 27,238, 61,122,252,226,225,151,163, 91, 79, 30, 16,178, 65, 68,143, 24, 17, 81, 69, 2, +251,115,147,145,168,215,131,189,167,251,195, 32, 45, 33,243,208,149, 36, 88, 78,230,126,154,229,154, 42, 75,182,133,226,122,122, + 94, 69, 20,216, 60, 79, 0,241,157, 86,115,179,103, 37,121,186,140, 11, 9,101,102,120, 60, 47,177, 6,121, 42, 85, 82,201,124, +162,184,215, 10,218, 71,139,114, 85,158,140,134,148, 74,144, 93, 37,233, 28, 22,185, 41, 27, 94, 26,181,119,214, 32, 36, 3,226, +246, 27,232,122,223,178,236,174,221, 26,122, 33, 36,170,240,247,103,209, 92,151,149, 78,119,211,164,228,216, 29,163, 82,134,169, +158,163, 52,102, 69,197,106,228, 78,163, 44, 89,102,217,204,119,114,230,249,133, 39,186,180, 52, 13,107,119,125,247,227,209,103, +145,112,112,175,207,241, 25,223, 62, 27,254, 70, 87, 58,145,124, 26, 78, 5,114, 78,197,225, 19,153,156,128,138,166,164,110, 99, + 34,127,130, 59,255, 61,223, 47,136,176,221,221,114,124, 7, 66, 29,254, 53,112,255,175, 63, 15, 33, 54, 89, 3, 93,189,236,226, + 60,226, 94,191,220,206,143, 91,151,192,158, 88,112,233, 38,131, 41,164, 80,132, 31,140, 33, 9,149, 33, 2,203, 37, 97,202,227, + 26,228,171,170,246,127,100,218, 75, 93,209,147, 34, 17,106, 49,202, 74,153, 82,223,145,167, 8, 53, 64,254, 18,128,176,107,217, +109, 26, 10,162,247,250,121,237, 56,206,163,105,155, 70, 85, 81, 65,128,132,160, 98, 1, 18, 18, 18, 95,192,146, 21, 11,190,134, + 21, 91,118,252, 0,176,166, 98, 85, 88, 21, 65, 43,160, 80,164, 2, 74,161, 47, 66,104,146,166,205,211,137, 29,219,204,204,117, + 10, 69, 66,117,183,117, 93,223,155,204, 61, 51,115,230, 28,237,148,234,201,105,151,142,181,242,232, 63, 68,198,211, 47,121,242, + 8,221,134,128, 38, 93, 0, 67,246, 39,178,203, 43, 64,131,189,191,211,133, 99, 73,119,133,200,239,114,118,128,147,169, 28,201, +234,157,124,178,101,164,250,126, 55,177, 51,145,189, 83,218,119,200,178, 19,174, 40, 29,191, 26,246,244,186,134,106,109,254, 42, +143, 21,168, 99, 37,233,143, 72, 75,147,152, 74, 70,241,100,102,122, 99,111,131,232,165,158, 15,161,111,220, 8,129,157, 25,134, + 40,148,237, 13, 7, 57,103,162, 61,104,199,241,136,232,138, 92,218,205, 4,248, 3, 47, 19, 6,156,188,197, 25,105, 21, 40, 76, +216, 76,167,105, 34, 74,255, 80,190, 70, 71,135,110,157,250, 8, 22,210, 18, 66,193, 19,117, 67, 62, 26, 33,205, 17,229, 48, 73, +123, 75, 46,135,170, 38, 57, 10,202,195,203, 6, 20,160,113,146,232,101,146, 48, 44, 23, 44,130,221, 34,246,187, 80, 35, 13, 91, + 84,126, 24, 55,162,160, 81,173,127, 14, 66,244,226,131, 95, 54,116,219, 22, 41, 93,119,133,233, 56,118, 86,232, 37,195,110,122, + 65,171, 55, 28, 6, 1,141, 6, 99,223, 70,101, 38, 60,178, 55,104, 62, 91,121, 76,137, 5,220,221, 27,248, 1,228, 1,134, 46, + 60,164, 97, 34,113,173, 51,104,195,191,153,113,242, 16,100, 33, 79,192, 38, 18,174,107,212,245, 0, 25, 33,248, 26,250,131, 90, +103, 63,209,113, 35, 59,111,136,164,128,244,103,242,179,149,131, 31,144, 68, 11, 83,244,177,215, 29,184,118,214, 11, 6,182,200, +192,194,202, 34,106, 90,164, 61, 52,230, 69,102,117,199, 59,132,195, 99, 58, 59, 3, 56,186,118, 84,181, 76,187,224, 78,110,215, +182, 34,180,107, 80,225,248, 12,226,224, 92,241,252,155,175,175,138,249, 82,179,213, 16, 66,188,252,240, 34,239, 20, 52,116,150, +135,212, 74,217,222,255,150, 54, 29, 64,136, 66, 53, 56,206, 34, 42,173, 94, 75,195, 37,198,128, 59, 63,121,230,198,133,235,139, +171,139, 75,239,151,166, 51,133, 92, 42,235,218,110,173, 85,131,115, 11,182,225,218,194,205,201, 84,118,121,125, 25, 54,171, 93, +233,192, 93, 46,154,123, 28, 32, 17, 17,199,149,205,140,229,192, 75,193, 43, 88,134,216, 63,218,199,218, 66, 72,222,217,170,122, +245,236,194,112,228,191, 45,191,211,184, 49, 55, 49,251,105,247,139, 57, 10, 33,202,211, 16,189,143, 21, 58,250,144, 35,165, 49, + 26, 33, 45,152,132, 21,209,153,146,133, 25,219, 77,146, 33, 5, 5,176,224,123,144,182,220,130,149,113, 70, 91, 43,173,157, 61, + 93,125,240,240,249,157,167,175,111,223,191, 43,238,221, 98,172,196,180, 1,138,142,177, 94,240,104,117,249,201, 26, 28,170,134, +208,189, 48,172,215,218,171,235,219, 61,198,166, 25,203, 49,102, 92, 49,227, 72, 58,120, 38, 99,175,128, 54,108, 77,187, 84,154, +176,132,218,238,163,239,132,137, 70,168, 52,177,196, 18,161, 94, 42,133, 0, 28, 64,216,142,144,141,115,184,197, 28, 81, 2,173, +176,234, 97, 21,179, 26,198,179,142,219,240,142,138,243,151, 25,118,100,187, 57, 35, 87, 15,234, 37,245,162,198,184, 79,170,145, +164,165,197,178,110,190,185,187, 89, 59,172, 7, 10, 39, 57,129, 40,164,121, 90, 20,247, 96,124,167,177, 11, 81,157,161,127, 83, +156, 79,231,225,227, 1, 89, 87,249,103, 25,118,106,237,251, 71, 68,238, 36, 26, 19,179,164,228, 62, 46,222, 38, 1,167,152, 43, +193,222, 97, 21, 30,130,193, 56, 28, 78,185, 83,181,110, 67,138, 19, 16, 1, 95,146, 87,162, 36,190, 39,186, 59,200,176,228, 73, +112,199, 55,174, 52, 43,161,196,203, 76,126, 1, 17,104,146,110,129,196, 84,138,180,246,132, 85,154, 43,204,237,213,119, 53, 77, +131, 28, 17, 96, 62,226, 0,250,179, 60,121,126, 20,143,229, 43,109, 67,248,189, 62,231, 73,138,127, 12,219,143,213, 41,221, 84, +214,107,121,236, 4, 35, 70,249,135,142, 40,175,223, 2, 48,118, 45,187, 77, 3, 81,116,198,227,177,147,166, 78,250, 4,133, 54, +164, 82, 75,121, 84, 85,187, 66, 32, 64,234, 23, 32,118,136, 13, 91,126, 1,150, 93,240, 3,176,228, 7, 88, 32,224, 27,144,218, + 10, 42, 22, 72, 69, 2,202, 67,164, 82,136, 75,155, 71,235, 38,118,236,241,112,239,181, 83, 44,168, 4, 82, 87, 85, 36,203, 51, +201,153,123,238,156,123,206, 9,250,247,255, 7,119,116, 7,211,209,137,141, 26,254, 47, 76,231,233, 18,224, 7, 81,103, 18,135, + 25, 49, 59,255,251,227,198,159,224, 14,139, 24, 39, 78, 50, 60,117,228, 73, 10, 14,106,193,243,244,194,129,161, 25, 88, 68, 40, +159, 7,124,137, 40,138, 68,103, 44,232,169, 60,161,184,113,148,232,104, 26,119, 78,198,136,178, 38,245,131,203, 93,186, 19,197, + 83, 81, 8,203,202,197,104,208, 17,210, 77,108,124,236, 25, 65,217,132, 49, 32, 17, 2, 45, 86, 49,200, 63,160,246,110,105,128, +165,192,147, 42,200,177, 72,162,110, 92,163,148,201,178, 80, 66,111, 3, 55,208,161,212,145,133,131,171,220, 70, 83, 72,101, 42, +101, 2,248, 91,134, 77, 26,112, 43,103, 66,101, 37, 11,121,107,172, 36, 75, 37, 49,226,136,209,146,116,134,113,124,212, 96, 2, + 88, 51, 0,153, 82, 2,219,152,140,212,155, 56,152, 98,112,224,153, 40, 84, 38,117, 50,202,222, 56,201,243, 49, 47, 0,158, 15, +149, 58,252, 89, 18, 31, 0,207,193, 64, 38, 83, 0,189,239, 49,213, 9,251,110,207,251,126,208,244,188,192, 50, 45, 60, 81,146, +104,102,178, 36, 73,178,218,208,133, 6,187,252,178, 79,209,207,216, 83, 22,246, 97, 23, 7, 46, 20,221,127,193, 38,244, 2,239, +250,197, 21,146,165, 99, 89, 36, 80, 57, 45, 82, 39, 85,173, 39,156, 9,168,127,113, 58, 87,230, 8,180,213,244, 88, 21, 86, 47, +234,163,177, 45, 16, 50,120, 7, 88,161,142,215, 41,143,151,221,214, 15,204,134, 66,221,126,162, 97,141, 23,171,139, 63,219, 46, + 44,248, 66,101,105,255,112,255,236,233,234,118,253, 35,172, 68, 16,246,233, 74,156, 3, 91,183, 76, 27,126, 90,245,102,157,236, +104, 66,248, 93, 9, 67, 94,158,191, 10, 28,252,192,239, 8,224,142, 10, 13,129, 21,237,102, 98,150,162, 40,150, 4,176,152, 18, + 34,185, 51, 52, 60, 51, 57,179,254, 97, 3,211, 96,164, 60,242,187,112,180,140, 20,156,115,229,217, 80, 69,182, 41, 55,222,175, +239,184,181,229,185,229, 47,238, 55,224,218,240,226,104,252,141, 38,116, 56,208,232,249, 94,101,124,170,209,222, 5,246, 0,111, +148,183,134, 4, 23,192, 12, 0,149, 96, 39,106,187,181, 11, 83,231,107,187, 59,145, 86, 45,175, 61, 95,158,107,180,221, 62,172, + 64,140,205, 37,248,242,192, 87, 4, 14,158,234, 36,186,152,177,212,133, 54,134, 3, 38,142, 35, 97,154, 77,175, 9,165,192,165, +179, 11,192,129, 48,135, 3, 86,176,119, 48, 58, 84,127,221,112,161, 24,190,213,141,156,189,238,218,203,205,198,234,179,189, 55, + 91,149, 48,104, 61,127,199,158,126, 90,123,181,221,179,177,105, 30, 98,170,170,174, 54,187,247,247, 59,119, 24,187,201,216, 38, + 99,111,165,113,166, 96,251,132, 91, 10,216, 27, 80,144,225,252, 82,101, 82, 25,176, 35,125,105,114,199, 52,115,210,196, 32, 1, +178, 70,164,208,222, 84,149,204, 9, 48, 1,241, 45,211, 40,229,109,155, 89,181,189, 66,132,166, 53,102, 18,195, 96, 68,198,163, +173, 23,183, 87,238,222,152,189,178,250,100,245,222,212,131,199,238,195,106,169,114,173,120,170,141,102,194,188, 31,162,105, 66, + 7,175,187,133, 31,169,241,226, 40,144,170, 22,234,211,226, 36, 26, 44,162, 82, 29,231, 57, 96, 59,117, 52, 61, 81,249,220,248, + 74,228, 38, 73,170, 35,187,146, 88,103,208, 46,206, 66, 9,252, 11, 56, 83, 50,165,154, 25,218,143, 15,131, 35,150,154,144, 37, + 67, 2,191, 39,112,244,192,145, 93, 15, 58, 61, 58, 77,150,224,169, 84,146, 15,204,165, 83, 35,182, 99,241, 33, 31,136, 74,121, +215, 71,179,207, 98,161,232,135, 62, 42, 97, 82,199,182,164,242, 76,193, 61, 17,233, 7, 97, 64,249,122, 60, 83,188,179,227,236, + 45,216,125,143, 26,247, 52,168, 99, 24,217,209, 31,226, 7, 89,176,253, 37, 0,103,215,178,155, 68, 20,134,207,156,185, 82,102, + 24, 6, 16,218,161,105,106, 20, 72,212,168, 27, 99,250, 4,117,225,214,133,111,224,214, 55,113,227,214,117,223,160,137, 49, 94, +146,110,138,198,216, 52, 86,106,109,106,172, 6, 74, 11, 76,153, 1,230,194,204,248,255,135,161,142,137, 49,198, 13, 33,100,114, +230, 48,151,239,191,127,159,240,127,110,251, 95,112, 60,109, 39,100, 94, 9, 66,151,252,158, 93,137, 83, 67,170,255,114,210,244, + 92,235,188, 71,158, 99, 34, 65, 92,213, 88, 57,238,125,229, 82,147,176,170,162, 1,162, 2,142,224,168, 49,218,140, 25,187,103, + 60,241, 39, 9, 66, 19,178, 32,101,125, 84, 88, 15, 47,186,113, 24, 91, 16,218,216,144, 41,120, 97, 28, 48,239, 58,154, 85,240, +146,245,177, 57,137,186,222, 8, 28,170, 28, 47,170,153,156, 55, 60, 3, 51, 5, 17, 98, 78,201,219,254,249, 44,213,151,145, 84, + 12,175,144, 18, 18,181, 80,224,203, 64, 8, 99, 78, 98, 52,141, 24,104, 51, 70,121,150, 60,129,181, 1,251,217,221, 20,120,108, + 66,167,216, 87,199, 97, 15, 1, 51,223, 25, 89, 80, 50, 2,227,107,129,152, 14,194,225, 88,148,137, 72,163,209, 24, 2,243,152, + 9,181, 83, 69, 2, 35,128, 91, 3, 0,149,120, 70,163, 58,101,207,167,196,136,127,177,219,129, 48,218,122,124, 70, 2,164,246, + 69,181, 35, 89, 6,224,192,109,184, 46,135, 60,101,172, 82, 45,130,109, 65, 34, 93,216, 9, 13, 48,101,198, 82,141, 83, 38,109, + 22, 32,175, 5,211,190,192,126, 4, 89,196,158, 48, 85,201,103,101, 13,160,106,169,176, 10,230,243,176,221,130,255, 62,158,216, + 49,171,112,176,196, 8,250, 16, 91, 31, 95,131,247, 42, 33,245, 37,101,115, 13, 33,220, 19,240,208,189,208,107,181, 63,149,212, + 18, 64, 94,223, 57,141, 24, 53, 92,223, 57, 19, 56,193,154, 88,138,160, 0,228, 45, 21,151, 1,245,170, 37,163,245,125, 31,173, +149, 40,197,168,116, 8,193, 41, 68, 15,246,219,131, 38,192,253,157,218, 90,207, 57, 53, 84,163,211,111,131,213,130,136,205, 31, + 91, 96, 87, 0, 38,202,185, 74,119,120, 2, 71,170,153,133,137,235, 81, 65, 8,131, 32,167,107,175,118,158,195, 69, 0, 63,168, + 51,236,136,201, 76, 14,151, 17, 84,211, 88,132,247,112,224,244,203,134,169, 80,241,204,238,128, 21,179, 70,231,205,131,230, 90, +227,238,222,209,174,143, 86,151, 95, 95,187,183,241, 98, 3, 78,209,168,214,117, 28, 83, 26, 92, 53,107,150,107,151,245,210,201, +160,139, 29,205, 36,190,113,249,166, 61,178, 22,141,197,189,227,125,179,100, 2, 6,249, 83,159,198, 49, 92,138,213,202,202,192, +161, 21,189, 82,212,138,219,159,183, 95,238,190,129,103,181,164, 22,193,206, 30,158, 28,130,115, 87,214, 13, 74, 69, 48, 69, 63, +172,182,235,122,195,104,136, 84, 70,152, 8, 5,251,175, 20,148, 66,199,234,192,197,180, 93, 39,159,213,235,102,227,253,151,119, +121, 77, 15, 66, 14,118, 82, 43,104,157,192, 66,233, 8,112,150, 69,249, 62,150, 97,200, 99, 66,158,108,238,172,111,181, 30,221, +106,220, 94,170,155,203,133, 99,219,193, 70, 81, 12, 5,201,166,139, 18,246,224,188, 63, 35,228, 41, 28,221, 30, 92,211,179, 16, + 7,250, 83,172, 25, 94, 55,139,101, 61, 51,246, 60,137, 39,134, 38, 43, 50,207,136,139, 16,250,195,144, 67,198,224,104,166, 15, +145,228,177,241,241,166, 84, 17,196, 66,118,193,197,144, 23,121,202,224,147,199, 34,111, 44, 18,209, 38,147,135,181, 7,228, 3, +190, 97,134,144, 15,188, 97, 1, 27,239, 41,132,179,245,234, 21,199,155, 28,117,191,193,138,189, 49,182,165,119,157,158,231, 3, +230,131, 7,129, 85,123, 31, 65,126,202,148,222,167,176,129,146,118, 9, 37, 21, 19, 9, 13,142,137, 75,198,115,245,209, 52, 61, + 34,119, 49,134, 63, 23, 8, 73, 64, 41, 76,126,165,233,218, 94, 20,115,169,222,142,139,223,184,249, 50,209, 92,240, 46, 98,227, + 87,168, 27, 20,253, 82, 34, 74,179,110,205,178,234,172, 81,142, 21,171,251,195,190,129, 5, 30,155,233,132,132,243,125,206,234, + 4,137,252, 83,197, 48,219,253,118,156,100,228, 89,230, 61, 1,247, 56,105,133, 76, 42, 8,179, 42, 94, 50, 10,251, 71, 12,254, + 41, 0,107, 87,211,211, 68, 20, 69,231,163,239,205,116,166,117, 44,180, 69, 65, 10,129, 20, 49,154, 64, 32, 36,198,196,149, 81, +255,129, 49, 49, 49,113,229, 95,240,103,248, 35, 92,235,130,141, 44, 84, 22, 26, 18, 19,217,152,232,130, 15,249, 46,133,150,218, +161,101,230,205, 71,159,247,190, 55, 83, 17, 93, 26, 54,132, 52, 37,211,153,158,123,238,125,231,156,139,249, 4,240,242,174, 18, + 42,255, 21,220,229,239, 84,163,114,186,114, 33,243, 61,171, 91, 44,246,120, 26, 55,159, 37,182, 42, 7, 85,127,109,122,186,128, +236,242,112, 89, 28,255,167,129,165, 73,145, 60,159,139, 38, 75,179,170,246,195,138,211, 27,157, 8,148, 18,254,254,123,238, 70, +160,143, 68,254,142, 80, 14, 32,108, 19,120,154, 59,210, 6,146,110, 3,195, 24,114,181,127,182,143,113,193,186, 24, 39,168,101, +103,228,208,221,181,136, 5, 52, 19,247,186,225,180, 4,229,212,210,202, 13,120, 25,218,208, 98, 75,192,206, 8, 2,173,166,222, +106, 97, 93,143, 81,129,110, 18,192,119,148, 14,235, 25,177,200, 91,228,201,163,216,130,106, 78, 30, 56,187, 32, 10, 26,143, 68, +100,163,216,143, 26,135,210,194,129, 55, 95,243, 60,241,176, 68, 81,128,204, 32,132, 38, 30, 58, 99,220, 59,140,183, 0,165, 38, +178, 15,132, 55, 14,224,115, 23,150, 15, 74,145,224,195,123, 5,177,140,121, 6, 14,171, 16, 93,129, 63,155, 6,190, 50, 70,129, + 60,135,175,238, 89, 35,186, 76,114, 62,139,135,115,149, 32,246,246, 79,246,198,203,213,227,147, 58,220, 47, 5,105, 20,250,235, +108, 60, 31, 67,215,183, 23,226,132,138,232, 70,192, 60,209, 13, 37, 77,141, 38, 84, 3, 90,202,142, 1,218,142,218,117, 51, 99, + 24,212,242,131, 14, 92,209,204,248, 44,180,204, 64,198,115, 89, 27, 13, 10, 58, 57, 5, 80,166,185, 14, 84, 83, 85, 25,114, 74, +237,174, 11,176, 46, 8,181,220, 72,195, 13,106, 12,230,224,235,189,143, 78, 63, 30, 15, 15,140, 30,185,135, 50, 59, 14, 62, 68, +161,146,146,193, 0,114,235, 23,254,220,155,189,191,184,242,134,162, 68,220, 20,177, 33, 56,201,198, 73,131,144,181, 73,209,130, + 92, 72, 0,109,207, 37, 51, 7,229,181, 96, 57,113, 4, 52, 61, 4,202,108, 17,195, 34, 38,144,234,131,230, 1,193,134, 8, 58, + 42, 77, 36, 67,224,252, 64,238, 24, 26, 43,143, 53,220,230,194,212,124,164, 41,203, 95,222, 3, 20,206, 85, 23,198,135, 70,223, +174, 46, 21,242, 3, 68, 37,235,181, 53,184,132,162, 83,118,125,151, 49, 95,196, 42,170,149, 82,101,175,129,123,121,110, 79,207, +253, 56,220,110,158,182,224, 10,160,129, 0, 4,207,103,243,226, 32,196,191,113,109,234,235,246,247, 17,168, 64,161, 87,255,121, + 60, 86,174,192,149,109,212,214,108,195, 10,123, 76, 79,196, 95,153,199,211,131,203, 7,159, 62,239, 55,106,140,237,248,182,119, +230,215, 20,134,211, 27, 63,186, 83, 44,188,122,240,164,237,147,145,226,214,183,102, 11, 0,190, 11,125, 78, 20,191,222,114, 63, +182,253, 40,195,125,230,179,179,110, 20,178,231,147, 87,128,106, 88,148,206, 87,138, 58,197, 68,141,130, 77,243, 52, 35,173, 31, + 34,255, 20,158, 55, 53,228, 80, 46,185,135,193,170,226, 4, 42,177,188,234, 0,238,101, 39,111, 40,250, 94,179, 85,171, 95,223, +101, 17,197, 28, 20,148, 1, 76,152,163, 15,151, 94,240,119,124,103,177, 57,249,114,230,195,220,202,221,213,202,211,155,143,158, + 77,220,218,236, 52,138, 57, 39,226, 81,171,227, 42,152,248, 36, 83, 10,208,190, 90,114,202,235,245,109,252,119,112, 39, 48, 85, + 31,109, 37, 0,155, 1,138,146, 25, 23,125, 6,110,112,199, 51, 85, 97,127,146,146, 21,168, 67,188, 15,238, 18, 75,226, 11, 22, + 31,174,240,254, 16,231, 55,150,247, 18, 75,148,154, 74, 21,123, 50,175, 82, 48, 45,158,156, 54, 99,105,128,146,236, 49,175,122, +181,186, 81,223, 20, 83, 29,121, 96,193,133,122, 25,173,218, 38, 49,161,162,151,242, 37, 32,221, 44,244,207, 27,120,248,185,153, + 12, 79,214,230,197, 82,164,217, 75,195, 87,196,182,133, 94,178,184, 90,253, 3, 70,101,231, 36, 26, 38,169,173,255, 7, 85,254, + 37, 0,105, 87,206,219, 68, 16,133,189,167,119,125,237,250, 74,148,120, 19,132, 72,162, 32, 19,132, 64,136,130, 67, 10, 17, 74, +145,159,129, 68, 73, 65, 71,151, 63, 64, 77, 79, 77, 19,241, 35, 40, 64, 74, 69,129, 34, 10, 39, 36, 78,236,196,199,222,179,215, +240,222,140, 47,104,145, 82, 56,138,237,172, 61,243,222,188,247,246, 59,230,243,153,255, 76,238,255, 76, 85,120,106, 94, 80, 32, + 88, 28,188,208,132, 78, 66,139,255,158, 32,223, 44, 94, 4,185,211, 25, 72, 55,199,209,163,156,117,135,222, 23, 16, 33, 12, 20, + 42,176, 9,143,196,117,237,202,154,145,176, 69,153, 40,137, 45,154,189,178,202,180, 94, 94,242,161,251,155,177,123,167, 12, 10, +120,104,232, 38,255, 19, 63,207, 75,154,225, 78, 72, 98, 92,113, 67, 84, 36,228, 94,113,238, 47,188,230,254,237,135,110, 96,231, +149, 2,252, 31,216,176, 94,228, 32, 95, 14,141, 50,112,241,176,116, 17,185, 89, 11, 21,139,138, 13, 49, 19,101,136,219,166, 76, + 34, 21, 71,144, 18,210,187, 37, 89,215,148, 34,100, 11, 89,102,146, 30, 18,130,228,209,197, 0,159, 0,219, 36, 10,227,166, 81, + 41,228, 85,123,236, 48,143,110, 45,131,248,195,123, 90, 18, 90,253, 49, 41, 95,214, 42,202,186, 44, 85,205,188,161, 83, 69, 76, + 15, 94,190,120,255,238,237,171,231, 79,123,189,171,110,127,168, 32,122, 68, 96, 19, 77,148,171, 65,212, 57,126, 28, 68,131,179, +100, 75,209, 55, 66,194,154, 29,167, 66, 50,254, 64, 91,205,119, 29, 60,153,196,153, 23, 82,226, 65,112, 42,113, 74,110,156, 27, +219,179, 33,128, 52,169,208,183,123,156, 68,172, 43,232,111,238, 68, 30,137,160,153, 78,185, 50,149, 42,231,241, 83,208, 40,155, + 75, 32, 97,185,193,102, 66, 80,253, 41,136, 89,132, 3, 21,195, 18,206,134, 18,172,126,119,120,241,102,255,245,183,147,239,105, +150, 68, 41,105,150,151, 73,140,100, 49,120, 73, 68, 66,184,106, 72,247,119, 86,182, 6, 78,159,178,252,142,121, 53, 39,141,252, + 65,142,137, 50,112,251, 8,136,193,189, 7,251,191, 7,167,155,171,219,189,209, 69, 69,175,194,162,104,138,142,170, 79, 12,238, + 87, 84,139,110,232, 75,146, 28, 68, 62,115,241, 21,152,232, 78, 26,103,137,138,146, 35,200,210,132, 86, 12, 14, 18, 72,148,138, +172, 56,254, 88,100,158, 38,121, 85, 29,123, 3,143,248,142,111, 15,220, 1,172,238,206,122, 27,178,191, 27,186,108,248, 74,161, + 85,181, 26, 86,165, 0,155,199,131,134,227,236,250,188,115,217,177,234,107,186,174,245,236,235,227, 95,199,112,230,193,119, 93, +214, 42,207, 30,239,153,181,229,147,211,159,112,104,181,215,218, 27,173,141,213, 90,171, 94,169,194,151,185, 84,109,192,102,187, + 28,246, 35,244,166, 48,225,173,130,152, 64, 95,130,182,145, 73,212, 29, 93, 65,233, 58,244,198, 46,226, 8,232,208, 27, 13,209, +110, 2,157,197,160, 97, 16,217,205, 59,141, 42,187, 91,185,227,203,243,115, 39,240,227,120,187,176, 98,153,102, 83,211, 74,178, + 0,167,130, 34,234,187,235,237,140, 6,195,172,103,199,177, 38,201,200,106, 71,176,145,104,200,122, 19, 26, 67, 18,186, 4,202, +250,108,167, 94,122,212,106,222,109,153,229,130,104,153,170, 85, 45,212, 74,106, 81, 23, 81,120, 78, 22,152,163, 25, 15, 87,145, + 17,209,185,148, 54,142,159, 97, 37, 84, 65,174, 21,181,181,186,241,163,211,247, 51,146, 79,107,221,144, 41,220, 98, 93, 38,187, + 1,249,114,246,245,240,227,225,167, 15, 71,221,142,189, 89,107, 29,141, 62, 31, 88, 79,100, 33, 9,208,208, 46, 64,191, 83, 20, +239,197, 11, 35, 89, 20,167,105,152,198,208,151,160,129, 49,148, 48, 52, 9,209,221, 38, 50, 42,117, 59,112, 98,148,185,164,140, + 12, 73,225,232, 41,106,232, 87, 7, 11,114,239, 86, 27,182, 43,134, 56,175,236,231,120,131, 69, 26, 13,110,214, 92, 54, 19, 21, +248,235, 54,229,170,185, 98,163,143, 57,157,170,251,206,245, 18,232, 20, 79,148,161,214, 83,172, 41,121,135,248, 97, 68, 88, 78, + 74,172,218,154,139, 38,195,108,120,143, 48, 0,220,231, 28,205,169, 74,106,163,220,112,152, 61, 58,175,237,167,153,157, 78, 32, +145,217,100, 96,207, 80,156, 41,211, 78, 72, 39,151,199, 92, 50,115, 76,143, 95,152,112, 58, 57,166,126, 38,134, 40,206, 20,238, +103,169,239,143, 0,172, 93, 57,111, 19, 65, 20,222,217,219,187,222,196,193, 9, 73,192, 9, 71,140, 8, 1, 1, 10, 17, 13, 8, + 33, 14, 33, 26,254, 1, 5, 66, 8, 4, 18, 66, 66,116,180,148, 52,252, 7,104,248, 9,180, 20, 52, 68, 8, 66,136, 16,135, 33, +167, 99, 39, 89,219,123,120,246,228,189,231,221, 96,137,150,206,146,237,230,105,230, 93,243, 29,255, 39,191,255,155,235,165, 62, +174,169,152, 75, 50,238,154,129,176,140,225,204,250, 12,249,254, 58,243,229,219, 22,150,255, 87,220,253, 42,127,182,166,141, 31, + 52,199,170, 9, 45,176, 72, 30,140, 16, 13,233, 47,187,172,191,222, 96,240,168,200,247, 25,133, 19, 88,212,210,139,221, 40, 32, +126, 90, 2, 25,132, 54,248, 73, 23,253,203,211,158, 15,100, 86,203,115,210, 91,130,144,216,120,125,103, 5, 46,182, 23,185,170, +172,122,104,227, 18, 19,103,129,220, 7,196, 76,161, 19, 50, 78,101,239, 48, 51,137,130, 43, 75, 18,203,112,148,144, 91,139,134, + 98, 21,112,235,141, 32, 21,184,151,113,138,246,201,104,210,130, 53, 27,197,246, 68, 6,205,249,141,235,151, 95,191,122,121,251, +206,189,153,106,117, 97,225,203, 70, 3,213,133,112,169,162, 39,208, 34,193,141,230, 92,132,126, 81, 87, 37,195,144, 57,143, 29, + 39,190,123,235,238,195, 7, 79,118,118, 58,163,163, 99, 16,220,197,165, 47,186,154, 90, 80, 66, 52,193, 44, 40,184,209, 71,180, +131,192,131, 16, 10,140,215,133,154,195,134,135,138,174,227,226, 18, 39,149, 66,124, 60, 70,199,240, 32, 64,173, 63, 24,166, 73, + 98, 67, 80, 34,205,144,116, 33, 18, 53,201, 32,183, 13,191,141, 6,214,184,165,209,101,203,237, 58,112,170, 90, 30, 2, 6,136, + 12,204, 70,172, 49,135,119, 2, 42,225,100,197,140,211,136,161,154,170,170, 35,117, 8, 23,190, 1, 34,145, 16,153, 46,102,160, + 98, 33, 86,152,252,177,246, 41,140,120,177, 48,112,172,114, 28,126,179,221,105,218,158,205, 67, 15,250,116, 30,186,144, 97, 2, +178, 54, 30, 48,172,110,224,193,121, 55, 21, 67, 87,140, 1,221, 34,115,109, 31, 18, 40,228,223,122,187,222,113, 91, 91,237, 77, + 56,249, 17, 42, 33, 38, 80,137, 53,133,180,166, 19, 68, 67,145, 82,113,112,241,228, 85, 68,244,163,158, 27,250, 10, 26,106,209, +210, 44, 31, 81,228, 17,146,234,133,244,220,204,133, 61,197, 18,143, 2,164,238, 50,182,111,104,159,235,123,131,230,224,217,234, +153,241,210,216,217, 35,115,191,154,203, 37,163,184,229,218,166,110, 78,141, 30,110,118,182, 39,134,247, 55, 58,141,243,179,151, +150,126, 47,138,178,148, 32, 17, 25, 45,218, 53, 89,245, 33, 71, 17,159,101,221, 94,255, 90, 91, 92, 89,175, 65, 67, 13, 23,247, +244,225, 83,243, 63, 62,252,216,248,254,179, 94,179,189,214,102, 11,170, 23,219,114,182,169,117,100,179,213,217,213,237,181,233, +137,163,156, 7, 26, 68, 15,181,209, 17, 73, 43,228,202,180,187,178, 38,149,242,193,222,155,173, 46,176,107, 39, 10, 31, 86, 55, +235,190,111, 7,220,148, 76,168,230, 48,124,250, 81,212,230,221,101,199,189, 60, 33, 44,117,190,189, 95,219,120, 83, 91,134, 63, +140, 89,150, 44,166,221,152,125,179,121,147,123, 43,237, 78, 59,228,101, 81,188, 63, 87,157, 30, 55, 38,203,234,228,158, 66,121, + 64,131, 64,195,168,146,249,187,246,124, 69,122,211, 48,126, 64, 37, 3, 69,150,224, 40,154,154,108, 41,202,222, 82, 97,250,208, + 72,219,225,159, 87,155,216,235, 71,197, 53, 31,154,247,100,116,112, 92, 78,196,133,230,242,124, 99,231,233,179,199,207, 31,189, +152, 51,175,108,201,181,183,238,187,155, 83, 23,166,246, 87, 86, 26, 27, 9, 97,216, 73, 95,131, 8,215, 9,186, 84, 67, 66, 12, +211, 4,226,236, 4, 46,106,240,197,193, 72,105,188, 97, 55, 97,166,193, 11, 73, 88,153,152,156, 81,113,210, 34,129,204, 58,130, +208,205, 48,142, 51,166,110,102, 59,202,250,229,211,169,247, 76, 13, 5, 5, 38, 33, 53, 12, 25, 67,136,207,206,243,187,195, 29, + 56, 87,147,195,147,109, 56, 51, 4,229, 32, 3,208, 36,127,180,203, 38, 72,168, 88,208,149,163,241,175, 72, 14, 52, 17, 34,232, +161, 93, 16, 51, 81,131,222, 38, 65,164, 85, 12, 9,243,133,110,146,102, 60,171, 60,179,247, 38, 1,198,242, 7,109,210, 4,194, +142,172, 82, 62, 96,187, 45,146,116,143,123,142, 58,189, 68,152,236,130,199, 83, 50, 76,207, 8,252,255,234, 15,164,127, 4,224, +236, 90, 90,155,136,162,240,204,100,122,103, 50,147, 87,155,164, 77, 31, 86,105, 23, 34, 82, 68, 20,171, 45,136,245, 85,186,213, + 77,197,130, 10,254, 0,113, 99, 43, 5, 41, 86, 80, 43,110,252, 13,238, 5, 43, 10,130,197,109, 17, 69,169,233,203, 54,109,236, + 43,125,216, 36,109, 50,239,137,231,220, 59,233, 67,116,227, 38, 4, 58, 73, 39, 51,115,207,253,206,249,206,249,190,255,140,239, +252, 63,156,247,132, 61,145,125,111, 53,234,175, 88,223,147,107,223,157,149,222,253,107,121, 27, 16,248,114,136, 71,154,158, 99, +182, 52,130,224, 77,104, 48, 98,194, 97, 83,191,172,132, 65, 65, 12,162,103,218, 23,225,148,255,147, 64, 89,211,253, 57, 6, 54, + 74, 26, 59,103, 81,214, 34,230, 98,129, 56, 17,101, 29, 17,220,142,129, 8,110,161,241, 80, 77, 17,160, 31, 37,146, 0,217, 33, + 40,199,108,203,221,213,173, 7, 48, 43,250, 75, 56,135,129,117, 70,191, 36,233, 60, 36,188,120,147, 9, 17, 67, 10, 9, 98,115, +184, 40,201, 40,213, 4,123,176,129, 70,105,156,136, 34,218,130, 31, 14, 8,144,136, 42, 87, 5, 17, 37, 53, 84, 71, 6,250,239, + 15, 15,191,126,251,102,248,124, 71, 71, 87,103,231,228,228,248,194,210,138,128,189,125, 62, 42,245,134,145,154,214,241,125,186, + 97,111,229,141, 27,221,221, 61,221,215, 30, 63,127,250,104,104,232,195,200,200,212,143,105,219,210, 58,218, 90,111,245, 92,227, +108,243,103, 58, 29,137,132,158, 12, 12,118, 93,188, 52, 54,246,173,160,105, 82,133,248,240,222,221, 7,125,189,156, 99, 36, 39, +146, 33,149,120, 94,132, 37,142, 32,107, 6,123, 12,222, 86, 88,207,168,241,162, 89, 16, 19, 33, 60,233,150, 65,133,243,121,198, + 75,195, 34,140, 5, 98,121, 29,194, 61, 58,240, 21,141, 66, 99,180,105, 45,151,129,243, 2, 12,206,151,105, 11, 69, 14, 80,219, +116, 8,207,214,213,246,238,116, 38,133, 77,214,116,126, 10, 64, 73, 44, 92, 13,175,244,126,113,248,158,227, 82,153,217,173,237, + 92,133, 72,162,129, 56, 21,221, 54,153,100, 63,124, 63, 74,226,241, 56,147, 2,143, 0, 26,216,219,186,230, 24, 16,130, 77,219, +170,141,212,174,231, 87, 81, 45,192, 31,150,137, 31, 22,167, 69,199,211, 0,106,194,241, 33, 53,162, 91, 91,176,146, 73,133, 4, +113,127,122,113, 28,182, 1,221,210, 79, 52,159, 90,216,152,131,144, 81, 52,177,125, 75, 38,202,133, 99,231,146,243,223,179,133, +205,197,181,180,201, 42,189, 28,159,211, 54, 41, 57, 15, 9, 77,113,126,117, 62, 81, 89,251,101,246, 43, 60, 39,217, 66, 22,190, +115,109,123,173, 96,104,112,113, 76,199,254, 52, 49,122, 32,222, 8, 89, 2, 44,201, 68,164,186,165,245,236, 92,106,202,176, 12, +166,165,162, 16, 37,232, 15, 73, 68,129,231,170,237,200,233,177,185,228, 82,118,153,230, 61, 76, 78, 28,187,215, 33, 88,208, 31, +171,205,103,210,186,109, 45,110, 44, 65,238, 18, 86, 35, 13,241, 70, 20,182,165, 23,178, 46,154,128,140,193, 47,225, 96, 54,234, + 48, 27, 57,129,179,149, 64,101,172,100,159,108,175, 94, 89, 94,207,106,198, 38,100,142, 46,175,217,216, 45, 91,116,204, 77,189, +168, 89,238,229,250, 68,173, 42,181, 36,212, 32,192, 3,135,171, 81,225,100,124, 49, 69,121, 63,147,153,201,101, 21, 95,233,230, +225,134,103,157, 71,207, 52, 65, 78, 33, 87,133,100,212,127, 6, 32,131,234,192,108,214,147,247,220,154, 41,181,200, 4,230, 32, + 27,132, 36, 50, 32,145,176, 34,214,132,148,250, 67, 81, 78, 37, 31, 71,103,117,202,223,248, 92,145, 8, 7,215,225,106,219, 86, +128,247,191, 75,125,142,185,205,183,251,175, 15,246,189,184,211,220,251, 42,251,114,214,158,187,146, 56,158, 41,254,202,107, 5, +151, 42, 65, 50,250, 20, 94,209,162, 26, 93, 83, 28, 88, 43,120,121,113,199,118, 13,122, 64,193,212, 18, 85,117,121,236, 66,113, +131,114,144,170, 92, 20,217,228, 45,139, 25,164,130,192,231,104, 29,195, 43,199, 51,219,104,151,250,243,185,204,107, 26, 25, 41, +131, 22, 47,225, 87, 72,186, 87, 63,241,228, 99, 32,238,230, 0,137, 99, 67, 13,150,197,235,163,245,240, 65,195, 50,189,114, 60, +133, 47, 14,150, 48, 61,211, 60, 10, 21,144, 0,243, 70,239, 4,143,191,197,193, 43,236, 0, 98, 5,134,114, 80,167, 21, 30,106, +187,194,148, 50,188,162,144, 91,166,111, 33, 53,217,210,242,216,211,230,148,254,176, 60, 45,167, 26, 92, 84,141,138, 62, 98, 58, + 58, 35, 21,246, 69,119,154,211,252, 22,128,180,107,249,105, 34, 14,194,221, 87,183,219,221,237,210, 71,144, 74, 65, 8,104, 36, + 6,149, 16,137,122, 17, 16,163,248, 56, 25,189,112, 50,158,124, 4, 34,222, 52, 30, 76, 52, 17,189,120,225, 79,240, 74, 60, 24, + 19,143, 18, 81, 36, 33,190, 79,196,168,168, 17, 75, 88, 90,182,221, 95,187,219,237, 58, 51,219, 34,200,209,235,166, 73,187,219, +157,153,111,126,243,205,247,253,111,126, 15,146,187, 2,197, 27,169, 44,149,205, 42, 96,220,230,140,254, 47, 66,167, 17, 6, 47, +135,148, 8,175,151,113,149,148, 95,191, 30,170, 99,246,122,105, 10, 76,122, 1, 25, 7,255, 30, 79, 28, 12, 62,169,165,160,111, + 13, 36,148,214,235,132, 31, 10, 78,221, 56,175,110, 90,194,133,182,110,233,214,114, 55,183,165, 0, 1, 6, 96,174,173,146,192, +116,221, 30,215,111, 52,210,217,252,175, 64, 56,169,182, 49, 65,108, 29,180,250,227, 4,250, 24, 78, 95,136,187,229, 11,184,253, +227,199,117, 89,209,112, 96,202,211, 30,170, 72,195,110, 36,156,160,216, 28, 79, 14,206,168, 61,128,114,237, 50, 15,216, 7, 64, +189, 34, 87, 85, 37,228,148, 10,195,199, 7,154, 51,233,123, 19, 15,230,230,223,205,188,154, 61,212,119,112,240, 72,255,199, 79, +111,172, 53, 51, 44, 73,213,170, 80,161, 89, 15, 20, 27,199,245,151, 87, 10,231,206,156, 26, 27, 29,191, 59,113,127,234,201, 51, +232,168, 35,138, 40,137,126, 42,161,142, 94,185, 60, 48,120,162,189, 99,231,212,227,167,125,189,125,151,174, 93,111,223,213,181, +180,248,237,245,252,219, 68, 67,114,124,108,180,165,173, 53,174,201,211,211,207,203,184, 20,136, 16, 69, 8, 76,206,137,142, 9, +105, 7, 57, 56,142,239,187, 92, 68, 84, 29,183, 76, 68,163, 26,253, 23, 23, 7,145,192,224, 66,138, 33, 73, 35,180,106,242, 48, + 14, 33,204,188,168, 28, 67,109, 78,199, 14,102, 44, 46,250,142, 96,151,242, 37,251,153, 57, 69, 28, 60,243, 33, 93,142,161, 3, +173, 24,182, 28, 11,144, 23, 96,231, 82,185, 8, 87,224,129, 73, 97,137, 14,238,188,238, 29,123, 57, 78, 88, 99, 57,234,163, 60, +146, 82,192, 49,134, 18,142,160, 97, 41, 49, 37,224,253,110, 80,227,170,172,159,191, 56, 50,247,114, 22, 74, 38,114, 79, 93, 71, +139,234,118, 25,202, 95, 57,157,108,206, 23, 86, 0,249,110,139, 55,231,109, 52,238,192, 6,133,124, 44,225,235,224,247, 36,117, +172, 43,169, 88, 35,132, 45,148,135, 95,230, 79, 28,131, 96,203, 69,143, 3, 67,215,235,104,234,176, 81, 68, 48,236, 16,135,167, +183,115,159, 34, 69,190,155, 63,200,119, 23,183, 15,161,155, 76,234,241,162, 83,130,122,147,103, 57,184,241,165, 92,118, 97,225, +125,177,196, 32,251,192,243, 65, 19,100, 59, 7,201, 26,250, 24,167,234,102,115,203, 0,207,113, 45, 65, 10,235,170,129, 42,243, +114,116,181,104,193,179,133, 10, 81,116, 11,200,152,226,133,100, 44,177,198, 10, 86, 9,208,125,150,196, 97,132,182,166,246, 37, +243, 55,128, 77,192,143, 24,188, 94, 73,164,113,124, 84,105,216, 81,173,116, 29,107, 54,204, 2, 84, 23,215,245, 10, 21,103,113, +173,176,104, 89,166,109,175, 48, 60,184, 24,217,221,178, 63,173, 37, 52,145, 49, 47,173,199, 57, 65,100,174,211, 32, 42, 31,127, +152, 23,122, 50, 15, 79,119,159, 61,220,150,222,174,201, 49, 17,143, 14,137, 99, 35,214,244,248, 54,144,201,130,128, 20,144, 51, + 0, 64, 65,149, 1,185, 75,134, 26, 78, 65, 61,104, 73,134, 90, 83, 31, 94, 44,124, 89,182, 0,237, 67,154,134, 96, 52,109,131, +121,222, 80,207, 64, 91, 60,115,103,230,209,112,255,201,225, 3, 67,183, 39, 39,111,117, 94,189,249,245, 70, 82,139,245, 25,153, +172,141,236,126,135,152, 89,136,223,145, 28, 80, 65,143, 17,175, 18,150, 85,200,176, 80,240,220,154, 68,187, 15,125, 51,164,250, + 85,150, 15,198,143, 54,196, 12, 43, 82, 6, 15, 40,228,168, 68, 66, 29, 18,161,145, 26, 65,210, 87,101, 85,139, 68, 88,169, 36, +241,226,158,204,158,156,101,210, 46,107, 77,160, 23,146,123,144,115,140,168,193,202,182,161, 24, 56, 15, 95,191,109, 52,226,171, +178, 10, 11,118,154,104,177, 4, 65, 53,100,156,132,154, 42,150, 45, 90, 74,168,110,244, 99,250,107, 36, 1, 97, 36,138, 71,187, +135,160,134, 6, 52,248, 58, 53, 31, 1, 78,149, 78, 8,235,154,101,190, 30, 49,200,205,220, 37,222, 71, 64, 7,173,145,243, 55, +184,101,112, 1, 30,128,176,130,247,106,125, 61, 55,196,215,183,129,234,201,254,143, 0,164, 93,207, 79,211,112, 20,111,187,110, +109,183,174,131,177,129, 3,212,145,128, 30,140, 81, 48, 30,184,169,137, 30,188, 40, 38,222, 60,171, 49, 18,239, 38,198,248, 23, +200,197,131,209, 35, 49,209,120,243,162, 30,140, 9, 9, 1, 76,188, 40, 4,228, 87,128, 1, 27, 56, 86,182,174,107,187,246, 91, +223,123,223, 65, 48,241,230,133, 75,211,140, 54,253,190,247,121,239,125,222,231, 35,255,255, 88,149,100, 63,153, 27,122,226,191, +212,219,197,127,247,111,240, 62,178, 14,107, 74, 66,196, 16, 59, 92, 1, 23,243,142, 24,107,136,135,156,152, 68, 52,105,163,109, + 8,223,102, 34,249,112,212,141,241,224, 89, 76,107, 79,228,210,105,152, 78, 37,146, 61, 13,248, 54, 65,136, 75,158,124, 49,138, + 1,226,131, 43, 68,190,254,203, 25, 48, 60, 50, 83, 17, 15,100, 39,209, 54, 4, 61,227, 93, 90, 3,195,248, 6, 1,173,100, 22, +242,157,253,107,187,171, 33,249,181,250,156, 20,132, 29, 9, 63,100, 71, 20,137,165, 64,226,209,145, 20,178, 19, 42, 28,143,144, +202, 39,228,104,123, 7,114,209,232,102, 71,168, 7, 85,156,100,222,170, 66,186, 31, 64,249,219, 55, 71,224,226,229, 43,151,222, +140,143,195,131,245,228,178,150,181,251,124,236,217,232,195,251,143, 30,220,121,241,242,213,230, 86, 57, 20, 20,196, 37,162, 92, + 7,216, 86,173,157, 59,115,246,201,227,167,239,222,191,253,252,229,107,187, 17,143, 70,112, 54,234, 53, 25,202,115,199,147, 82, + 76, 57,214,217,109,232,154,200,188,166, 85,145, 81, 78, 62,128, 90, 65, 87,131,114,105,189,167, 55, 83,183,126,167,146, 88, 97, +192, 63, 6,119, 81,163, 11, 93, 88,233,132,132,114, 76,136,170, 66,213, 10,108,175,202,149,248,112,102, 31,132,173,109, 98, 49, +116,221,134,136,202, 24,168,196, 11, 73,183,222,168,101,219,115,165,202,166,229, 86, 61, 63,102,196,219, 76,123, 15, 15, 44,126, +213, 88,224,227, 24, 3, 21,196, 80,193,209,149, 28, 1, 69,251,108, 45,154,112,253,134, 18,137, 29, 46,193,163,110, 10, 99, 89, +163,109,165,184,196,219,145, 1,145, 13,226,112,212, 67,162,134, 75, 44, 10,152, 95, 86,224,140, 13,230,135,126,174,255, 88, 41, +254, 90, 26,155,135,183, 9,105, 38,161, 25,131,167, 47, 76, 45, 76, 66,126, 61,223,119,113,118, 99, 22,112, 49, 36, 89, 0, 68, + 90, 84,243, 66,151,150,173, 34,168, 52,200,208,222,107,223,170, 64, 37,132,205,116,230,127, 91,156, 2, 20,207,169,114,253,185, +129, 29,179, 8,249, 70, 87, 52, 26,157,133,233,100,135,227, 54,150, 75,171,133,242, 54,214, 40, 68,129,226,218, 38, 80,230, 20, + 77,215,245,156, 74,104, 58,190, 31, 33, 43,237,180,110,236,219,150, 13,200, 84,132,112, 95,114, 60, 23,158,171, 45,145,130, 40, +111,218,213, 48, 34,161,155, 35,115,246, 81,178, 70,144, 28, 41,155,202, 42,178,186, 81, 46,248,126,211, 48, 82,128,154,213,152, +174,197,204, 19,185,190,226,238, 54,164, 13, 56,252, 11,133,249, 91,195, 35,139, 91, 75,115, 27,115, 9, 37,174,199, 13,207,179, +240,253, 70,212, 62, 35, 16,122,218,187,134, 78,222,232, 77, 14,174,165,191, 23,118, 38,215, 74, 19,155,254,114,165, 37,250,186, + 93,179, 79,117,228, 23,138, 59,237, 40, 73, 8,232, 30,242, 96,144,201,200,175,239, 13,167,251, 13,100,184, 96,207,138,225, 95, + 31, 29,206, 80,219, 0,209, 68, 32,161,240, 26, 20,143,212, 72, 71,187, 14,177, 69, 60,144,120, 83, 62, 34,105,170,144, 51,132, +238,204,218,167,185,153,133, 45, 69, 85,225, 43,242,208,146,195,246,253, 70,189,217,248, 48,243,113, 64,207,155, 66,101,244,234, + 93, 97, 66,208,133, 76,103, 74,222,113, 86,174, 31,191, 6,167,200, 97,220,132,143, 12, 73, 48, 97, 50, 35,110, 64, 16, 55,189, +253, 38,166, 67,159,202, 93,252, 42,136, 41,198,186,210,185,205,202, 22,225,125, 38,178, 86, 55, 55,174, 40,249, 76,126,182, 48, + 75, 26,199, 7,106, 53, 7, 60, 14,159,111,127, 67,225, 30,120, 43,187,171,205, 22,151,157, 70,235,140,198,255, 34,199,110,162, + 26,213,114,233,158,218,182, 69, 35, 25,129,134,199,130, 69,251,122, 98,171,143,194,237, 96,177, 42,171,212,202,100, 15,223,242, +124,208,181, 20,132,123,106,231,144,151,132,196, 77,146,253,233,197,105, 78,230, 38,108,132,175, 46,224, 45,124,244,159, 50,224, +235,170, 59, 85,248, 93,211, 46, 19, 71, 3,139, 15,234,201,180,180,110, 14,119,140,184, 65, 43, 53, 29, 32,166,161, 43, 3,250, + 79,241,235,236,136, 61, 19,221,249, 71, 0,206,174,237,181,105, 56, 10, 39, 77,210,230,214,166, 45,221,173,178, 21,167,200,234, + 30,188, 81, 20,145, 13,113, 94,112,226, 63,225, 31,178, 23, 81, 4, 21, 20, 20,223,124, 81,240,194,116, 47, 14,113,204, 23,159, + 68, 28, 67,112,194,196,173,157, 91,177, 91,187,166,109,218,166, 77,218,120,206, 73,210, 9,123,243,165, 80, 8, 73,147,230,119, +126,223, 57,231, 59,223,247, 63,248,157,221,167,216,238,236,209,231,247, 85,248,253,111,190, 71, 43,231,131,116, 26,150,102, 4, +141,141,181,225,214,152, 38,245, 30,123, 42,154, 61,164, 31, 32, 9,130, 16,199,200, 2, 35, 10,168,171, 34,171,130, 22,130,140, + 16,103,169,105,174, 13,129, 22, 50,190,121,162,105,176,189, 90,189,219,227, 37,118, 13,145, 87, 4,219,243, 60,220, 27,128, 13, +203, 26,154,252,145, 87,189, 55, 69, 69, 71,192,106,119,136,194, 34,112,188,133, 61,121,182, 82, 47,211,195, 13, 48,190, 22, 31, +182,182, 1,145,178, 46,185,144,245,197, 81, 8,171, 51, 76, 76,147, 37, 73, 32,245, 74,172, 24,209,244,159, 67, 83,154,200, 62, + 84, 36, 54,172,242,138,196,169, 34, 58,219,209,132, 39,196,119,225,202,133,203, 87,167,175, 45,127, 93,122,246,226, 53,210, 64, +200,154, 36,191, 83,249,185,154, 61, 63,121,241,240,193,244,202,143, 85, 93,215, 67, 65, 64,109, 86,215,182, 38,206,100,238,223, +190,185,184,184,112,239,209, 99,132, 84,188,128, 77,153,142,211,178,186, 21,195, 76, 37,135,211, 99,227,243,243,239,222, 47,124, +108,214, 27,163,169,193,141,220,175,185,185, 55,112,181, 0,103, 27, 21,125,119,167,240,106,118,118,125, 99,219,178,185, 86, 11, +173,186, 1, 50, 89, 54,228, 16, 0,165, 29, 72,239,113, 62,217,236, 32,155, 31,189,143, 59, 46,240, 32, 4,239, 57,206,116,201, + 44,214, 43, 76, 82, 91,168,110,214,221,126, 63,236,148, 84, 57,105, 65,148,167,131, 59, 65, 30,227,166,141,134,186, 40,210, 64, +174, 97, 12, 74,188,217,166, 38,199,209, 68,201, 66, 94,176,235,142, 6,113, 15,158, 86, 73, 47, 2,226, 30,238, 75,233, 13, 29, + 22,188, 69,146,203, 54,214, 89,173,136, 20,213,164, 72,185, 94, 6, 20, 12, 64, 6, 9, 72, 28, 39,133, 20, 1, 18,130,102,181, + 92,219, 69,113,109,214,137,171,137,237, 74,158,176, 3, 7,152,174,105, 26,162,168, 68,148,136,200,139,222,216, 8,252, 55, 28, + 15, 96,153,188,238, 26,216,250, 14, 74, 81, 37,110,162, 90, 6,139,238,198,182, 21,147,163,110, 73,119,171,188,101, 17, 39, 39, + 44,135, 45, 11,126, 33,147,234, 59,200,195, 54,232,116, 53, 69, 43,232, 56, 64, 63,148, 72,102,198, 50,217, 63, 27,170, 40,195, +101, 1,140,231,182,209,163,117, 60,149, 94, 47,100, 93,134,149, 20, 84,170,102,173, 63, 50,128,174, 17, 1,231, 80,242, 72,201, + 40, 67, 0,130, 77, 2,194,140,129, 66, 61,184,174, 33,120,229,119,243, 45,219,170, 53,170,240,194, 67, 64, 57,122, 32,189, 89, +202,239,212, 74,155,165, 45, 77,213, 84, 9,242,170,166, 77, 50,191,176,138, 79, 74,124, 98,122, 4, 53, 35, 99, 65, 45, 25, 25, + 27,138,102, 18,234,228,177, 83,119,159, 62,153,185,126,246,219,231,229, 47,185,226,141,137,211,229,106,219,196, 70, 75, 27, 30, +199,137,209,161,244,165,180,148,142, 51, 10,199,132, 80,222, 15,149,132,121,183, 65, 22,240, 8, 80, 56,121,132,222, 44, 28,142, +109, 96, 64, 15, 10,240,168,225,213, 21, 66,162,192,171, 34,171, 73, 76, 42,193,164,250, 11, 31,190,191, 92, 88,113,104,188, 2, +179, 85,172, 61, 89, 49,126,164,212,198, 0, 0, 9,247,219,181, 79, 15,111, 61, 88,122,158, 93, 91,253, 61, 53, 56,117, 39, 55, +115,110,224,184, 26, 96, 13,108, 81, 32,159, 12, 62,197,144, 76, 37, 56, 20,206, 52,237,182, 24,148, 96, 91, 53, 90,117,155,172, + 60,176, 87, 5,160, 13,119,107,131, 20,216,229,152, 18,133,116,167, 67, 28,135, 2,100, 57,142,239,243,233,138, 0,147,158, 0, +205,153, 91, 45, 44, 48, 98, 92,193,137, 13,127,184,117, 79,112,214,179, 72, 69, 3,197, 98,173,200,120, 58, 97,248,142, 68, 36, +205, 70,194,112,199,237, 39,245, 36,192,232, 37,238,246,138,223, 29,178,112, 34,198, 99,192, 43, 40, 16, 34,114,176,176, 99,250, +132,119,170,216,120, 4, 29, 12,249,176, 70, 72, 81,188, 19,133,219, 52, 13, 56, 9,166,203,116, 57,223, 57,164,215, 0, 14,252, +211, 97,244,128,101,215, 27,228,242,251, 2, 30,145, 30,207,255, 87, 0,202,174,229,181,137, 32,140,207,238,102,103,178, 25,179, +217, 52, 77, 91, 75, 45, 85, 65,133,170,160, 32,222, 20,245,236, 69,193, 10,130,168, 80,250, 7,232,169, 23, 47,226,217,155, 39, + 15, 34,254, 5, 86, 65,240, 38, 94,234, 11, 65, 79,182, 70,234,187,175, 36,155,221,236,206,238,100,215,239,155,205,163, 74, 17, +132, 16,114,200, 38,155,205,206,204,247,251,230,247,248, 63,126, 36,167, 92, 81,203,147,191, 66, 86, 13,178,133,114,184,221,228, +222,123,173,111,233, 17,117,171,124, 3, 70, 29,106, 86,245,238, 46, 60,217,218,208, 70, 3,243, 76, 19,150, 73, 85,179, 62, 12, +213,204, 2,204,242, 12,233,107, 77,185,217,146,174,150,245, 47, 85,146, 40,178,148,212, 53, 77, 50,231,126, 68, 9,216,124,135, +241,140, 44,120,109,224, 45,140, 54,161,249,146, 39,154,217, 69, 44, 23,134,234,237, 77,197,124, 33,168,232,193,254, 64,100,144, + 28,134,246,106,255, 82,227, 42, 5,109,218, 21,243, 17,221,164, 6,220, 1, 83,163, 21, 94,226, 94, 20,165, 57,162,136, 3, 80, +136,161, 85,122,158,233,184, 75,168, 44,103, 20, 36, 65,148, 34,162, 84,198,169, 8, 34,147, 25, 85,103,104,109, 99, 83, 8,105, +152,166, 98,115, 34, 72,139,165, 56,118,228,192,220,236, 28, 99,214,194,194,211, 23,175,223, 80,131,158, 57,125,106,230,252,249, +197,151,139, 55,111,221, 14,101, 76,169,169,220, 31,227, 28,250,253, 39,190, 47, 44,198,246, 78, 78,212,190,126,195, 54,136,105, + 56, 69,110, 24,137,148,130, 82, 42,162, 78, 16, 2, 2,214,130, 80, 38,120,118, 25, 43, 16,145,144, 84,238,218, 88, 60,192,125, +107, 38,177, 23,135,174,178,194,150,157,164,175,212,238,115, 81, 81,108,205,176, 14, 78, 58,127,236,197, 40, 94,135,195, 43,110, +184, 9,255, 4, 5,160, 98, 2, 72, 64,137, 25,140,210,108,195, 51,219,141, 46, 91,101, 55,168, 67,241,110,115,135,231,249,202, +250, 10,218,210,234,204, 64,170, 15,243, 80,173, 74, 78, 28, 60,243,252,253,179, 98,193,110, 5,216,190, 24,177, 71,224,200,186, +191, 1, 32,186, 30,212,237,188, 3, 72, 14,202,216, 0,160, 0,181, 92,228, 77,203,201,209,221, 48, 75, 5,210, 87,115,165, 86, +177,171, 41, 70,100, 88,181,159,159,224,131, 97,169, 88,115, 87,135,139, 85,120,103, 59,244,148,233, 88,162,167, 58,114, 82, 13, + 90, 64,175, 24, 9,167,196,233,142,182,240, 96,149, 98, 57, 76,177,114, 10, 37,138, 43,104, 4,197,175, 50, 46,214,218, 97,144, + 55,205, 32, 10,225,240,169,209,169,165, 31, 31, 81, 49,171,229,202,118,197,109,187, 33, 54,172, 58, 21,123,152, 51,235,203,250, +247,253,227,251,214,154,171,112,194, 48, 19,141, 58, 99, 77, 21, 54, 91,247,154,106, 32,146,201,202, 68, 40, 5, 38,107,219,229, + 40, 18,240,151,101,113, 91,234,110,132,175,192, 9, 18, 19,101,135,119,109,180,214,138,140,127,111,252, 82,132, 2,162,136,173, + 8, 7,195,142,188, 86,173, 78,223, 57, 78,154, 45, 34,124, 34, 99,210, 8,137,235,147,175, 27,100,246, 6, 25,153,126,112,229, +210,229,251,143,167,203,188, 76,233, 24,183,134, 98,113,253,220,133,125, 23,143, 18, 81, 35,217,174,173,140, 0,254,224, 35, 70, + 62, 37, 62, 96,193,143,148,176, 57, 78,186,169, 13,122,111,104,154, 74,226,145, 55,136, 93, 32, 59, 29,120, 94,126,248,234,222, +147,119, 6,203,149,224, 7,195, 53, 67, 98, 46,220, 81,112,248,158,229, 6, 43,155,124,113,245,243,163,149, 15,241,210,250,252, +201,187,251,217, 33,171,212,152,121,123,118,254,240, 85, 1, 40, 14,237,193, 85,143, 58, 77,138,156,251,129, 79, 25, 3,116, 40, + 83, 89,180, 74, 45,225,133, 17,204,119, 42, 23, 35,219,128,197,200, 98, 13, 57, 78,161, 7, 85, 26,242,149, 73,167,233, 55,160, + 2,131,165, 58,192,102, 75, 95,136,180,221,164,164,103,177,213, 3, 21, 84,150,253,163, 25,125,197, 80,207,144, 76,201,169, 96, +101,130, 10, 35,232,132,152, 38, 69,100,230, 77,159,244,236,228, 7,188, 26, 45, 29, 43,237, 84,234,132,180,239,115,219,205,158, +236,127, 81, 2,203, 31,172,142, 22, 96,184,236,243, 59, 10, 9,193,226,102, 26,230,152, 51, 94, 91, 95,214, 19,128,212, 5, 63, + 82,137,178,233, 95,173,117,181, 13,210,141, 13, 29, 16,126,180,129,138, 85,235,133,103,144,223, 2, 80,118, 53, 61, 77, 68, 81, +244, 77,167,211,153,118,166,118, 74, 41, 69, 8, 26,131,226, 82,141, 95, 81,227,194,133,110,112,169,184,247, 7,232,202,141, 49, +113,231,210,141,113,105,136, 9,193,176, 80, 19,220,155, 96, 76, 36,154,184, 32, 49, 37,128,150, 16,160, 80, 40,211,143,233,116, +190,199,123,239,107, 11, 24, 19, 99, 66, 87,148, 41,121,189,239,222,243,238, 59,247,156,255,203,239,186, 2, 11,221,228,249, 93, +248,147, 25,249,207,228,206, 15, 48,216, 45, 9,162,158,221,107,212,107,141,139, 44,118, 64, 79, 24, 79, 29, 18, 74,151,176,176, +163, 77, 79,157, 40,106,190,147, 1, 53,198, 87, 66,148,243, 74, 94, 78,136,149,246, 38,217, 24, 50,234,103, 33,129, 8, 54,161, +207,121,171, 60,197,227, 68, 53,206,199, 71,194,126, 83, 38,236,248,150,208,173, 72, 20, 14, 28, 25,172, 52, 54, 99,232,166,197, +191,236,136, 29,190,215,248,171, 68, 15,118,135,224, 36, 17,184,196,140, 68,110,230,104, 97,108,117,239,231,233,161,220,240, 81, +125,199, 2,156,196,196, 56, 4, 34,192,118, 65, 85,177,163,107,152,126, 27,133, 17, 69, 0, 65,104, 86, 37,225, 33,209, 67,247, + 52,128,178,128,224,208, 75, 60, 33, 97,205,146, 68,210, 42,128, 13, 44, 99,177,233,239, 27,152,184,115,247,250,213, 27, 36, 71, + 22, 65, 22,120, 63, 59, 59, 61,243, 14,114,129,166, 34, 26,245,188,208,180, 28,234, 95,134,124, 17,225,225, 34,221, 58, 35,163, + 13, 82, 48,242, 33,177,178,194, 94,113,225,141,104, 49, 38,136, 18, 6, 16,252, 21, 42, 18,147, 78, 54,132, 4, 64, 37,199,195, + 61, 20, 88, 78,212, 38, 97, 17,236, 20, 50,132, 80, 8,235, 56,185, 6,121, 5,154,164, 57,216,236,197, 16,130, 84, 8,255,155, +131,180, 34, 92,222,126, 45,103,180,234,176,241,134,179,199, 1,134, 91, 78, 3,126, 43,139,112,154,151,219,158, 73,162,213,104, + 2,183, 47,112, 74,185, 3,117,169, 36, 5,153, 9, 46, 31,194, 14, 72,222, 59, 64, 82, 59,245,205, 7, 51,133, 26,181,209, 21, +146,110, 30,233, 63,126,110,236,204,183,226,247,173,250,122, 92,140,183,156,214,147,137,167, 83,115, 83,165,173, 18, 94,178,121, + 80,249, 18, 28,245, 95, 28,187,188, 80, 90, 32, 15, 16,212,127,199,169,147, 88,152, 83, 7,224, 19,171,230,206,237, 11,227,213, +154,177, 84, 94,212, 83,217, 99,249,145,197,181,226,104,225,196, 90,101,117,176,175,176,177,179, 46,199,209, 77,241,236,232,249, +229,181, 31,240,156, 47,197,207,217,116,159,229, 88,212, 5, 16, 84, 37,229,250,222,216,208,169, 77,163,108,218, 45, 25, 15, 46, +174,150,210, 96,145, 12,179,150, 75,235, 46, 78, 9,168, 85,179,106,217, 22,234,169,213,183, 1,169, 66, 61,179, 93,211,197,226, +232,235,170,190,107, 86,229, 88, 60,147,214,125,223, 51, 45,228,216,161,253,157, 32,232, 73, 29, 0,108,169,178, 2,139,143,195, + 1, 9, 69,141, 39,235,118, 29,217, 44, 88,186,114,205,246,174, 34,198,160, 2,220,138,107, 55, 95, 94, 99,158,201, 96,233,224, +155,178,108,214,108,135,197,149,249, 37,246,118,189,254,252,211,215,131,209,155,103,172,226,108,179,132,193,230, 39,153,152, 64, + 13, 50, 56,196, 65,114,183, 93,230,120,248, 99, 67,174, 71,220,203, 45,224,123,185, 5, 51, 59,196,177,140, 19,119, 44,171, 2, +108,103,213,214,220,139,143,175,231,138, 74, 74,134, 42, 45, 73, 98, 20,198, 26,158, 95, 54,221,229, 90,115,209,104, 65, 4, 65, +189,116, 2,119, 98,248,254,204,135, 87,247, 46, 61,158,188,242,236,193,175,135,111,106,211,143, 78,142,151,237, 61,126, 99, 73, +254,146, 33,215,251,133,226,109, 58,240, 12,164,248, 6, 68, 82,163, 9, 86,244,219,241, 73,125, 8, 33, 71,215,167, 9,160,103, + 74, 73,151,141, 50, 22, 68,126,154,164, 91, 82,138,210,240,128, 6, 83,135,172,219,165,126,116,156, 81,225,173, 74, 66,145,197, +100,211,169,119, 68, 5,186,233, 29,144,193,198,222, 22,110, 13,129,187, 0, 50, 46,131, 31, 68,156, 81,211, 17,149,100,189,219, +185,110, 50,204,164, 50, 73, 41,185,221,128, 50, 76, 8,159,196, 83,186, 3, 58, 52, 68, 35,112, 1,196,142,217, 30,111,196,147, +192, 12, 60, 73,212,100, 21, 16, 64, 55, 73, 70,135,250,225,221,172, 69, 13,228, 67,198, 71,108,127,234, 7, 95,191, 5,224,236, + 90, 90,155,136,162,240,157, 87,146,153,201,163, 38,164,205, 75, 91,218, 90, 68,168,130, 59, 87,110, 10, 46,196,189, 32,254, 4, + 23,110,116,229,206,141,160,254, 12, 11,250, 11, 4, 87, 10,138,162, 84,170,174,180,173,109,109,243, 78, 51,153, 36,115, 51, 51, +153,241,156,115, 39,182,106, 17,116, 23, 72,152,201,220,185,247, 60,190,115,206,247,253,207,124,211,177,193,123,120, 72, 33,240, +167,113,199, 95, 97,131, 42,181,178,228,204,124,179, 95,147,126,229,130, 12, 17,103, 55,135,190, 35,133, 17, 83,132,198,116,234, +246,196,192, 34, 96, 19,101, 85, 74,123, 68,115,164,130,223, 40,186,162,167, 19,153,188,158,107, 58,213,246,168,205,168,219, 27, +169, 40,253, 33,165,249,254,196,135,135, 2,223,255,217, 96, 31, 96,231, 34,132, 24, 49, 48, 58,132,240, 78,134,152, 37,249,159, +232, 47,169,255, 69,225,190, 67, 53, 40,124, 44,156,121, 81,164, 74, 54,179,188, 80,104,112,206, 61,108,106,141,169,138,208, 91, +140, 39,112,215,193,193, 65,198, 98, 36,105, 12,227, 24,220,202,156,135,162, 77, 4, 99, 97,164,165,137,124, 49, 66,225, 72,121, +138,227, 78, 16,101, 38, 19, 74,229,100,169, 48, 93, 28,121,222,214,214,238, 94,181, 17, 40, 56, 25, 10,187, 15,101, 42, 3,240, + 19, 56,217,159,212,101, 19,108,140, 38, 2, 3, 38, 32, 36,148, 25,198,190, 69, 65,164, 45,249,180, 57, 73,198, 1, 23, 20,195, +118, 56,224, 46, 38,156, 30, 22, 67,241, 61,104, 49,198, 15,184,139, 67, 85,136, 19,155,137, 12,214, 60,132, 57,142, 4, 34, 34, +112, 83,146, 85, 18,130,149,130, 72,211,146,145,167, 68, 72, 71,213, 32,230, 29, 27, 49, 83, 65, 14, 38, 7,207, 79, 32,233, 9, +163,207, 45,156, 37, 70,150, 55, 89, 97, 81, 54, 76,151, 85,252,177, 91,201, 87,246, 91,251, 58,138,101,123,154,172, 46, 22, 79, +215, 14,170,220,229,144,131,139, 90, 22,228, 94,217, 84,182,222,173,194,202, 67, 86, 11,183,211,193,238, 41,138, 53,176, 16,207, +177,219,125,119,104,196, 12,200,151,145, 18,135, 15,224, 88,130,251,129,247, 43,208, 33, 98,235,196,163, 94,202,148, 7,110,223, +118,122,249,212, 52,214, 3, 70,131,108,242,132, 42,171,173,110,227,212, 76,197,178,173, 27,151,174, 63,126,185, 90,202, 20, 96, +185,150,230,206,190, 89,127,145,136, 27, 51,233,124,195,170,229, 82,249,190, 99, 67,220,189, 88, 92,216,172,110,192, 42, 65,204, +161,170, 42, 88,159, 98,174, 56,101,164, 63,109,127,246,144, 53, 87,204,220,132,243,133,249, 47,251,155,176, 61,102,115,179, 27, +245,141,114,174,180,215,129,103, 52, 61,226,135, 3,251, 53,165,167,186,195,158,134,179,110,216, 26, 8,254,201,140, 27,240,223, + 32,148, 31, 56,246, 82,105,233,123,107, 23, 30, 10,210,148,186, 85, 43,103,203, 77,187,142, 29, 74,241, 24,190, 94, 57, 40,141, +164, 91, 15, 86, 88,206,101,118, 15,146, 56,230,112,214,231,108,187,113,111,245,245,221, 15,213,223,246,238,237,139, 23,238,191, +122,143,159,182, 31,177,110, 31,203, 85, 62,169,179,130,149,135, 13, 58, 18,145, 59,106,160, 69,254,151, 36, 31, 73,254, 81, 69, +227,110,232,172,144, 97,233,100,231,233,218,229, 59, 79,222,113, 28,148,213,136, 30,192, 15,254, 54,150,126, 45,123,179,211,213, +158, 93,125,120,254,249,202, 88,175, 95, 41, 46, 91,254,240,220,220,153,183, 95,215, 4,165, 18, 69, 87,200, 15,234,122, 35,199, +225,211,179,149,250,183, 29, 8,118,168, 85, 5,167,150, 98, 90,188, 99,183, 5,165, 46,129, 48,228, 27, 36,201, 37,141, 58, 41, + 34,142, 22, 4,227, 88, 70,131, 53, 28, 32,151,178, 18,149, 59, 35, 54,119, 34,169,145,163,122, 33,105, 67, 80, 65, 1,109, 13, +141,135, 80,191, 6,100, 93,235, 59, 31,145, 35,150,148,236,198, 36,185, 18,132, 17,246, 35, 0, 20,240,244,173, 94,243, 8, 71, + 64, 4,152, 19, 0, 31,138,122,244,132,233,140,133,135,254,128,100,168,136,184, 70, 66, 21, 23, 95, 84, 77, 67, 41,156, 8, 87, + 77, 38,161,142,192,231, 17,120, 29,117,148, 76, 90,243,143, 99,132,129,123,252, 16,128,178,107,217,109, 26,136,162,158,212,241, + 43, 78,210,144,164,106, 69, 43, 74,145,232, 2,216, 33,177, 64,106, 37,186,134, 95,224, 7,248, 25, 86,236,249, 0,254, 0, 22, + 44,187, 5, 4, 8,181,234, 35, 77,218, 38, 77,147,250,149,140, 99, 15,247, 49, 78,121, 9,132, 20, 41, 74, 20, 79,102,236,185, +119,206,220,185,247,156,255,139,191,139, 63,201,103,151,138,186,255,191, 56,247,130,194, 23,231,120, 44,195,159, 59,164, 91,133, + 65,194,218, 44,152,161, 7,145, 59, 58, 54,147,174,165, 10, 75,197,245, 8,130, 56, 33, 51, 93,182,138, 71,100, 18, 99,219,121, +219, 93, 6,187,138,210,144, 53, 79,132,248,133,118, 39, 95,160,150,231, 33, 5, 76, 62,153, 17, 81, 37, 11,138, 21,161,255,223, +144,122,161,226,173,137,136,126, 44,156, 34, 85, 1,210, 78, 67,229, 28,150, 0, 82, 44, 97, 13, 30, 71, 42, 89, 42,155,214, 36, +197,180,162, 5, 60, 12, 4, 20, 15,192, 28, 19,203, 81,145,212, 64, 53, 40, 20,174,196,149, 1,214, 9, 64, 16, 4,178, 21,170, +223, 77,209,217,179,140, 24,165, 79,241, 30,142,196,116,250,195,240,203, 94,103,255,160, 59, 10, 37,248, 78, 7, 69, 77, 51,202, +177, 35,197, 96,188, 61, 24, 45,133, 47, 36,180,147,194,158, 22,129, 57, 21, 68,225,132,202, 40, 79, 6,124,189,137,124, 6, 37, + 11, 25,105,112, 66, 90, 11,162,204, 17, 38, 84,212, 18,120, 56,172,148, 9, 32, 58,146,164,246,103,193,224,154,126, 19, 96,120, +205,193,106, 85, 61, 77, 5, 73,109, 9,184,220,198,231,193, 21,203, 84, 98, 6,223, 48, 90,169, 59, 13, 3, 57,121, 18,150, 75, +131, 63,177,109,207,183,171,227, 40, 0,236, 25,203, 9,155, 9,113, 56, 51,173, 6,190, 63,125,248,236,211,241,103,199,178,178, + 44,117,236, 74,239,178,155,200,132,141, 1,186, 91,113,107,209, 36, 4, 87,206,150,192,208, 30,158, 6,192,121,184,248, 42,190, +100, 9, 36,202,112,207,249,104,189,225,183,110, 47,221, 25, 4,231,235,205,245, 81, 52, 98,153,226,178,229, 44,186, 72, 9, 2, + 91,129, 69,191,190,222,222, 24, 4,131,169,156, 84,221,218, 52,157,108, 63,216, 62, 60, 59, 58, 30,156,192,216,161, 53, 88, 40, + 59,167, 71,112, 47, 97, 57,159,226, 73,169,194,240, 14, 66,120, 21,198, 81,137, 24,167, 61,215,115, 29,100, 19,235, 7,195, 78, +191,235,185,254,140, 24,255, 41, 59, 58, 31,199, 87, 25, 13,161, 31,244, 55,111,222, 61, 60,239,180,170,205, 32, 30,123,182, 75, + 4,183,185,109,121,168, 28,147, 99,118, 74,197,241, 47,194, 33,224,125, 73,170,115, 96,245,181,202,162, 89, 42,131,107,131,221, + 82,187,222,190, 8, 6,240,155,105, 26,195,218,107, 65,255,189,230, 73, 56,124,108, 88,246,206, 50,170,105,179,166, 13,184,183, +186,187,181,177,180, 90,187,215, 29, 5,189, 96,108,193, 70, 28,229,139,213, 81,167,247,226,254,114,105,181,102,100, 61, 67, 72, +244,230, 42,215,164, 43,108, 13,152,255, 40,208,155,187,224,205, 45,163, 10, 47,219,104,120,198, 13,223, 88,107, 25,155, 43,134, + 52, 94, 62,127,253,228,213,187,238, 44,159,203,245,228,255,162, 28,249,152,236,238,169,221, 55, 7,239, 63, 36,111,235,166,189, +230,182,226, 44, 57, 28,116,240, 52, 11, 1,135,153, 42,105,155,238, 90,243, 22,204,171, 32, 14, 30,237,108,237,127,253, 6, 24, + 0,241, 15,213,178, 36,114,146, 9,158,130, 58,211,145, 20,129, 84,171,186, 20, 77,175,114, 22,246, 51,116,186, 33,124, 88,105, +172, 12,195,145, 54,126, 45,231,164,133,183, 43, 86, 21,204,111, 70,252, 2, 66, 23, 61,177, 37, 97,120, 18,238,243,233,248,140, + 67,217,120, 48,238, 55, 40, 88, 42,169,253, 60, 47,124, 49,114,215,136,235,130, 88,205,126, 40,174, 3,205,204, 97, 57, 55, 25, + 53,231,171,164,228, 77,240, 18,240,248, 96, 18,234,140,120,238, 5,159, 9, 48, 45,193, 47,130,121,185,118,240,133,244,133,161, + 7, 85, 48,142,205, 1,255,119, 1, 72,187,118,221,168,161, 32,122,253,184,182,247,229,221,152,108, 72,194, 18, 34, 81, 32, 5, + 33, 5,209, 81, 34, 16, 45, 53,252, 8, 21, 5,255, 65,141, 16, 13, 29, 63,129,160, 8,162, 75,162,132, 40, 36,118, 30,236,174, + 29,175,215, 47,230,204,181, 55, 9, 73,131,216,214, 15,121,125,175,103,206,204,156, 57,243,111,248, 93,187, 14,197,207,178, 43, +156, 72,209,175,156, 92,101,102,140,203, 55,184,160,236,243,215,201,132,105, 45,150, 15,203,106,249, 91,165,179, 80, 75, 17, 96, +199, 97,238,144, 41, 76, 71,147,165, 48, 90,134, 77,177,115,199,234,120, 77,239,104, 18,236, 69,123,104,145,229,194, 63,119, 61, +100,117, 30,173, 80,139, 71, 63,183,209, 27,197,167,236,149,174,213,190, 44,109,105,163,175, 47,207,234, 58,134,230, 88,141, 56, +137,148,161,207, 49, 24, 67, 99, 98,109,241, 96,229,225,198,238, 55,116,101,147,189,182, 9,184,165,134,110,160, 41, 85,215, 59, +142,181,220,239, 25,142,133,240, 27,173,204,132,107, 8, 21,177,118,134, 40, 27, 77,171,211, 50, 33,165,142,132, 18,124,155,106, +191,165, 13, 68,216,156, 54,176, 94, 73, 91,240, 59,213, 8,239,107, 49, 89, 90,172,191,102, 66,117, 0,238,193,150,154,106, 18, + 74,146,130,195,124,212,210, 13,145,219,200,141,226,144, 35, 53, 91, 98,184, 67,146,224,159, 78, 40,192,207,117,128, 16, 81, 56, + 22,154,205, 65, 46, 78,128,252,165,174, 91, 54,186,170, 83, 30,128,118, 54,197, 89,237,134, 60, 12,134, 81, 2,162, 16,210,179, +136,147, 75,165,208,207, 5,210,139, 43, 90, 22,197,121,156,200,159, 16,187, 68,214, 1, 87,117,111,238,197,175,250,134,233,168, +105,152, 45,217,164,219, 77,160, 78, 3, 37,181, 73, 26, 9,140,123,110,114, 99, 58,217,220, 6,212, 77,114,140,204,101,226,181, +174, 36,129, 20,119,193,129,193, 45,152, 76,147, 91,166, 76, 89,112,149, 21, 10, 81, 26,165,197, 50, 77, 11,217, 12, 19,146,103, +138, 5, 64, 87,119,154,110, 24,141, 75, 37, 35, 33,202,229,222,192, 31,238,211,166,114, 91, 93,105,104,163,104, 76,190,112,109, +229, 62,129,241,101,111,105,199,223,177,193,250,145, 12,242, 4,249, 36,122,173,100,250,151,230,250,180, 7,127,252,252, 62,215, + 66, 89,248,206,252,234,182,191, 77,143,234,181, 60,114, 57, 20, 40, 44,206, 45, 4,163,227,121,148,118, 15, 6, 55, 86,182,252, +205,133,222,205,147,240, 68,177, 31,232, 14,144, 57, 51,100, 24,143, 76,158, 10, 73,129, 8, 93,232,146,211,138, 67,242, 7,160, +216, 50,197,124,224, 13,130,161,207,237,115, 5,249, 39, 76,247, 45,203,213,197,187, 20, 69, 77,115,204,214,202,210, 41, 56, 0, +186,112,164,209,110,184, 71,161,255,180,123,235,197,219,117,177,222, 21,254,177, 24,141,197,116, 10,208, 93,102,191, 62,157, 62, +127,247,121, 35,216,191,186,221,191,188,124,242,232,205, 51, 49,137,133,193, 21,118,218,173,211, 20,176, 61, 87,124, 13,157, 7, + 63, 1,155, 8,219, 18, 94, 19,176,125, 55,252,240,250,227,171,247, 95,243,255,158, 0,113,207,189,253,184,191, 22,101, 49, 45, + 46, 69, 78, 94,179,183, 25,108,205,102,108, 11, 22,123,115, 76,217,110,187, 7,191, 3,193,132, 25,238,237, 4,151,166,182,239, +244,104, 78, 52, 25,163,111, 67,101, 93, 57,251,161,114,215, 76,142, 81,115, 7,141,170, 35,172, 66,192, 37,189, 49,169,203,134, +180, 9,181, 0, 62,243, 14,161, 79,146,252,232,209,208,231,129, 16,228, 51,250,135, 33,134,191, 35,172, 70, 66, 32,109, 59,221, +179, 73,152, 20,153,146,204, 44,106,171, 61, 19, 65, 96,178,116, 69, 34,157,229, 11, 46, 98,118,165, 88, 92,201, 18, 10,165,227, +198, 38,186,210,166,172, 57, 51,101,117, 73, 45,122,163, 43, 65,130,218,170, 42, 5,191,243,146,235,165,100, 50, 19,192,254, 8, + 64,218,181,235, 70, 13, 68, 81, 63,214,235,215,198,206,139, 36, 36,144,104, 35,162,136,136,134,164,166,162,226, 39,248, 0, 36, + 36,190,131,138, 6, 4, 18, 13, 45, 37, 21, 66, 80, 82, 65, 75, 65, 10, 4, 41,146,144, 85,148,125,217,187,246,120, 60,220,115, +103,150, 93, 5, 26,132,180,141,247, 33,217, 87, 59, 51,231,222,123,238, 57,255,140,223,173, 63,138, 51,232, 73, 88, 78,232,198, +108,160,122, 9,197,187, 38, 77,152,113, 4,153,129,201,179,103,146,105,183, 34, 57,183, 60,246,166, 64, 9, 69, 76,206, 33,199, +240,223, 93, 23, 95,160,191, 63,191,152,155,235, 97,122,206,211,125,228,165,248,138, 80, 98, 36,114,215,192,120,131,224,149,105, +166, 40,158, 86,170, 65, 26,181,212,165,174,233,108,231,151, 89, 34,211,182, 9, 74,219,248, 9,110,117, 37, 93,207,203,204,131, +242, 59, 0, 4, 45, 96,189,165,129, 73,130,196,223,209, 98, 75, 4, 67, 43, 37,251,163,241,114,232,181,175,205,121, 30, 1,160, + 70,228,193,221, 52,109, 53,147,150, 27,251, 80, 60,103,129, 82,219,227,244, 5,133, 20, 89,163, 80, 51,134,231, 87, 37,106,223, +113, 67, 16,229, 49, 83, 58, 30,149,217,168,162, 80, 7,158, 19,251, 94,236, 1, 87,177,206, 19,220,109, 2, 87, 69, 1, 65, 43, + 55,165,227,206,197,163, 53, 89,178,143, 61,186, 28, 45,119,108, 75,182, 47,179,100,163,225,180, 2,138, 27,179,139,209, 2, 84, + 17,189,227, 99, 16,209,145, 80, 7,156, 15, 41,211,128, 71, 78,127, 48, 30, 12,133,182,230,153, 44, 56, 93,152,177, 77,120,248, +154, 89,199,211,225, 6,196, 3,140, 27,149, 68,139, 69, 53, 74,194, 5,166, 59, 74,173,137, 68,161, 11,155, 65, 85, 85,232,106, +178, 76,124, 43, 72,106, 38, 63,232, 6,122, 19,173,185,134, 16, 85,123,109,187,229,199, 12,174, 3,129, 65,101, 3, 46,225, 81, +137,233, 42, 48, 89, 23, 98,130, 84,160,201, 83,232,178, 34,167, 85,147,243, 68,140,226,167, 35,236, 15, 94,179,150,218,131, 63, +117, 58, 42,243, 6,206, 95, 79,129, 43,167, 48,166,200,126,202,160,235, 40, 48, 26, 9,188,119,250, 29, 74,236, 54,150,214, 49, +176, 9,166,154, 30,131,176, 86,147,213,102,211, 63,237, 30,159,117,207, 41, 7, 59,216,222,255,209, 57,202,139,236, 96,103,255, +240,248, 48,242,162,172, 28,150,117, 73,249,205, 69,222, 47,197,184, 16, 69, 24,182,210, 40,217, 92,110, 95,100, 64,226, 20,135, + 86,152,210, 70,191,187,177,219,203,123,123,155,123, 39,221,159,144, 14, 23, 99, 62,213, 36, 61, 14,221,146,102, 72, 87,149,236, +230, 93,169, 24,206,219, 80,205, 99,157, 9,176, 57,203,170,160, 93,233,198,218, 78,103,112,202, 78,120, 13,250, 52, 47,134,183, +183, 14, 62,159,124,125,240,248,197, 93,217, 92,217,186,106, 45,164,192, 75,223,179,252,221,183, 59, 79, 94,127, 25,244,254,186, +174,159, 63,188,103,183, 9,197, 11, 70,235, 10, 58, 68, 1,189,124,107,206,131,111, 58, 97,246, 36,180,230,105, 91, 79,172,235, +148, 25,212,239, 31,189,185,117,255,229,135, 35,255,211,219,143, 79, 95, 61,251,207,253,157, 54,244,155,139, 91,189, 98, 24, 71, +115,231,189, 51, 56, 89, 18, 78,175,213, 20, 44, 56, 54,101,161,195,113, 70, 24,146, 16,122,111, 52, 0,139, 83, 50, 23, 94,113, +134, 2, 66,179,208,213,216, 90,171, 8,219,198,248,168,158, 76,173, 50,108,150, 92, 58,103, 23, 87, 94,252,101, 81,230, 85, 14, +181, 47, 41,211,104,174, 20, 37,175,244, 42,135, 52,158, 45, 89,176,108, 8,143, 1, 89,155, 90, 10, 54, 95,202, 56, 43,205, 88, +103, 97, 39,101, 79, 57, 46,184,194, 13,213,114,226,162,202, 12, 76, 45,207, 81,207,104,215,152,204,162,214,186, 99,102,122,199, +148,110,216,117,138, 89, 49,182,174,198,155, 2,248,108,101,157,219,131, 19,135,167,250,247,128,168, 50, 42,227, 92, 75,160, 85, +243, 75, 0,206,174,101,183,105, 40,136,250,218,190,215,118, 18, 55, 33, 77,156,180, 8, 54, 69, 44, 42,181,226, 3, 42, 85, 32, +245,167,216,242, 7,172,249, 10,196,134, 5,160, 74, 93, 82,129,132, 42,164,138,110, 10,165,239,146,216, 73,108,199, 73,204,156, +185, 54,105,212, 21, 85,171, 86, 93, 84,114, 28,103,230,204,157,243,184, 39,126, 95, 4,239, 60, 40, 24,102,201,128, 44, 62,131, +183, 56,145, 11,229,187,140,131, 17,183,253,126, 45, 86, 93, 19,134,229,124,143,226,124, 74, 35,119,201,217, 98,165,108,149,170, +149,173,151,210, 74, 40, 5, 45,145,237,128,172,165,148, 37,149, 41, 29, 28,242,170,163,232, 64, 57, 50, 74, 16,158,137, 83,105, + 78, 6,214, 13,128,202, 26, 21,162,170,227, 19, 20,210,100,212, 59,197,189, 92,145, 44,168,106,203,244,218,242,250, 69,225,108, + 51, 63,142,210,161,175,136,138, 71, 52,140, 73,104,157,112,188,100,165,109,167,225,109,109,118, 90, 77,111, 56,158, 36, 99, 35, +140, 51,250, 25,197,211,116, 38, 82,104,101,120,101, 5, 20,150, 43,137,155, 73,211, 56,213, 6,106, 20, 18,245, 95, 96,233, 74, + 93, 43,155, 82, 57,135,158,208,166, 15, 0, 61,133,120, 65, 38,159, 23, 50,175, 22, 13,198,177, 4,108,177, 13, 28,188,224,190, +241,132, 77,248,221,182, 4, 21, 67,250, 27,156,123,156, 18,100,195,113, 54, 74, 53,200, 17,227, 9, 12, 34, 83,253, 13, 95, 62, +108,145,242,185,105,157,198,219,144, 56,133, 73, 79,112,236,129,158, 93,124, 40, 65,226, 9, 82,210,110,187,176, 22,239,172,126, +172,249, 23,134,158, 96,105,149,174,150,218,161,198,226,218,160,207,204,181,109,134, 5,183,125,141, 77,138,200, 21,147,179,235, +129, 88,104,150,234,214, 87,126,222, 28,151,130, 88,192, 48,207,169,217,166, 29,193, 71,158,237,124, 89, 52, 88,161,102, 48,133, +194,182,237,183, 46,163, 11,205, 91,152, 21, 52,217, 66,240, 80,117,107,195,100,104, 50, 81,194, 81,142,239,130,117,147, 77,224, + 12,108, 9, 57,225,160, 56, 41,229,230,163,205,155,232, 79, 20,247,232, 98, 19, 24,224,128, 29,181,214,125,242,227,236, 80,154, +118,224, 7,157,102,112,120,114, 72,183,118, 16, 15, 56,177, 93,213, 42,149, 36, 29, 83,235,160,142,226, 40,143,128,191,178,221, +211,235, 95, 15, 91,143,145,205,203,166,175,131, 36,162, 57,227,249,198,139, 47, 71,251,215, 3,240,127, 70,136, 61, 0,246,104, +120,141,126,210,227,172, 96,168, 43,104, 36,117,149,187,181,177,149, 85,197,238,167,247,116, 73,124,205,162,189, 20,156,133,231, + 75, 14,189, 10, 66,250,217,246,250,246,254,209,103,186,117,157, 70, 55, 78,123,118,158,190,254,250,161,159,165,255,151,161,182, +247,202,120,234, 27,163, 1,103,177, 24, 88,180, 70,153,113,147,128,150, 92,117, 1,216,235,158, 97, 84,140,203,254,238,203,119, + 59,111, 62,234, 98,241,192,107, 30,188,221, 91,221, 89,191,119,101, 87,134,221,148,181,103,203,107,142,148, 52, 53, 44, 87,154, +136, 97,169,214,175,194, 43,172,176,138,115, 34,244,114,134, 23, 51,200, 51,242,105,211,111,157,247, 78,233, 25,108,215,131, 48, + 14,251,113, 88,108,216, 8,222,213,105, 96,186,232,128,193,242, 91, 3,188,127, 71,216, 64, 36, 98,214,246,131,110, 99,229,251, +201, 55,230,219,176, 72,176,212, 55,229,101,217,178,196,156, 87,195,255,165,149,165,236, 37,163,117, 24,122,129,165, 51,163, 10, + 50,122, 57,187, 26,176,205,160, 71,158,154, 61,224,221,176, 39,196,220,130,216,145, 96,117,115,126,139,222, 88, 79, 93,233,130, + 12,145,105,222,135,206,152,194,151, 95,105,140,178,193, 4,253,166, 64,239,139,133,215,156,235,132,138, 4,167, 59,239,105, 14, +107,240,191, 2,112,118,238,186, 77, 68, 65, 24, 62,123,243,122,189, 94, 95, 48, 78, 76, 34,132, 4, 18, 13, 69, 10,160,160, 8, + 5, 45, 61, 8,158,129,134, 71,224, 5,120, 12, 58, 36, 58,218, 72,161, 68, 36, 69, 4, 18, 69,226, 4, 18,199, 78,226,141,124, +201,198,187,222,179,204, 63,179,142,185, 8,161,208, 89,174,142,215,103,103,230,204,249,231,251, 47, 17,223,255,108,206,128,147, +165,156, 88,159, 95, 76,171, 50, 2,172,192, 56, 23,139,175,140,126,177, 93,154, 99,212, 21,195, 11,113,200,154,254,214,165, 49, +148,157,240, 98,204, 92, 8, 47,198,145,153,141,117,138, 77,184,205,250, 25,182, 23, 80,182,103,187, 40,231, 77,167,228, 32,142, + 25,134,219,240,107,237,209, 78, 63,234,209,243,135,161, 6,124,135,240,198,162,252, 81, 57,254,205, 66,171,216,142,121,124,249, +226,233, 75,117,152,129,244,223,234, 13, 58,166, 50,255, 77, 44,158, 43, 81,249, 10,222,241,146, 52, 42, 23,107,227,100,204,224, + 70,133, 57, 85, 75,136,103,230,131,219,139,180,192,136,130, 40, 90,223, 84,137, 57, 65, 80, 52,153,170, 0,161, 27, 40, 19,106, +146, 64,228, 9,184, 82, 60,117, 80,134,107,139,169, 11,112,242, 6,240,208, 64, 35,151,123, 29, 37,203,242, 41,168,224,248,130, +243, 11,166,153, 92,140,245,234,137, 62,157, 80, 58,128,156,216,181,205, 56,211,148, 1, 39,105, 10, 99,192,204,104,213,131,245, +173,221, 41,100,146, 80,125,229,230,240, 90,198,254, 56,154,167,162,224, 18, 96, 94, 42, 85, 10, 58, 53, 58, 11,138,117,122,253, +176,138,220,239,150, 93, 19,229,205, 81, 12, 90, 0, 1,102, 56, 27,112, 51, 37, 67,138, 68, 65,110, 18, 92,232,196,153,140,156, +247, 58, 37, 1,101, 76,116, 48, 56, 29, 41,191, 16, 64,102, 3,193,143,205,110,102,244,126, 21,138,110,145, 42,241,102,101, 49, + 73,226,163, 17,212,129,180, 60,104,153, 53,232, 67,194,251,190,123,243,222,167,246, 71, 90,218,181, 90,171, 63, 58, 57, 99, 33, + 57,135,248,185,177, 99,198,158,233, 87,130,198,233, 40,132,205, 55, 6,239,225,156, 73,121,121,169,190,180,123,180,243,226,233, +203,247,107,239,190,247,247,109,238, 55,210,102, 46, 23,253,179, 36,242, 28, 88,172,208,134,162, 47, 87,110,172,108,110,111,174, +222,121,184,115,184, 77, 37, 82,171,209, 60, 12,123,131,241,192,117, 10,213, 82,117,239,184, 93,114,124,250, 67,168, 96, 15,188, + 74, 12,254,123, 84, 43, 85,198, 49,124, 10, 3,175,138,222, 91, 66, 9,195, 42,123, 84, 48, 70,180,103,194,179, 16,131, 21,150, + 89, 42,240, 85,170, 50, 40,198,193,201,104,120, 74,167, 4,218, 68, 5,112, 42,121, 2,154,254,126, 83, 72,164, 0, 66, 80, 90, + 98, 75,163,212, 98, 47,224,235,181,197,183, 95,214, 54,194,111,151,141,179,111, 30,223,127,246,250,185, 10, 12,168,110, 78,134, + 42, 60, 87,189,137,250,218, 87,131,201, 70,187,179,117, 48, 88,104, 85,247,143, 71,175, 62,124,222, 83,243, 51,186,171,220,147, +245,237,242,234,242,127,199,247, 39,183, 30, 81,162, 90,168, 55,187,131,110,167,223,229,243,156,246, 93,143,126,227, 56,130,181, +172,180,149,213,204,173, 46,229,137, 19, 72,103, 12, 61, 5,156, 6,219,170, 89,105,210, 71,144, 27,184, 88,155, 66,231,106,136, +141, 84, 54, 27, 32,146,107, 29, 9,159,240,153, 73, 19, 64, 67,217, 55,105, 54,197,142, 2,123,185,177,124, 16,118,242, 14, 72, + 46, 29,144, 27, 90, 45,133,206,148, 91, 42,162, 16,166,101, 52,130, 6, 29,197, 82,110,209,248,174, 15, 37,110, 62,233,148, 73, + 55,210,152,193,201, 24,170,157, 35,197,178, 92, 55, 15, 89,223,213,160,213, 29,118,242,211,176,150,230,187,176, 10,180, 24, 1, +230,245,163,254,203, 84,209, 79,170, 69,147,187, 75,179, 92,144,235,213,127, 8,192,217,181,236, 54, 13, 68, 81,207,140, 31,121, +213,105,155,168, 78, 75, 65, 37, 5,161, 72, 72,188, 37, 86,108,248, 0,190,128, 47,226, 51,248, 1,182,172, 89,116, 5,168, 43, + 68, 43, 1, 81, 68, 26, 26,147, 71, 19, 39,182, 19,143,185,247,206,216, 77, 10, 11, 84,229,161, 40,155,196,201,204,153,251, 56, +247,156,255,197,247,191,193, 61,205,152, 51, 76,195,174,210, 27,160, 38, 30, 21, 74,165,177,234,165,148, 99, 34, 96,129, 40, 96, + 45,186, 88, 16, 21,184,204,209,178, 39,117,139,142, 88, 68, 6,139,140,133,208, 52,117, 84, 79, 79,181,248,140, 80, 18,237,112, +162, 88,116, 60,192, 34,119, 56,220, 45, 19, 80, 14,125, 65,177, 74,227, 8,187, 90,112,253,176,223,153,125,135,211, 18, 2, 34, +137,108, 42, 36, 71, 6,170,175,155,234, 78, 10, 30, 36,105,148, 47,159, 60,120,135, 45, 45, 73, 90,122, 85, 1,250, 95,236,247, + 76,232,140, 94,115, 13, 99,156,140,133,169,102, 69,131,101,112,157,168,134,109, 41, 23, 40,188,211, 86, 36,141,108, 18,212,209, +179,199, 50,111, 7,163, 18, 11,233, 58, 98, 41,156, 92,253,200,170, 67, 48, 7,141, 52,113, 34,188, 86, 44, 25,214,242, 60,152, + 79,101, 60,140, 34, 72,122,130, 40, 25, 5,209,197, 52, 52,180, 98,227, 74,249,172,236,188,120,242, 56,156, 12, 55, 76,190, 91, + 67,191,159,163, 99,228, 81, 36,216,245, 75,104, 92,132, 24,145,104,251,164,250, 78,218,105,158, 50,217,172, 80,101,176,106,121, +251,247,164,175, 84, 53,178,193,223, 52, 55,111,147,186, 91,132,171, 28,189,202,208, 97,196, 92,146,195, 14, 58,124, 81, 94,220, +220, 57,132, 32, 12,224,143,161,175,161,168,187, 94,127,220,171,150,183, 70,193, 64, 77,135,145, 29, 23, 62,158, 30, 62,251,252, +237,163,169,106,208,216,166,226,174,227, 78, 98, 0,125, 12,213,201, 52, 69,211,175, 20, 95,214, 22,118,168,124, 63,116,201, 13, + 55,228,221,189,123,167,221, 19,146,245,190,220, 3, 36, 19, 34, 33,104,138,146,184,225,238,206, 48,245,198, 67, 20,178, 1,248, +121,127,141,123,158,219,184, 89,191,117,220,254, 4, 31,210,186,209, 58, 27,254, 68, 23, 37, 18,161, 52,177,239,178,132,231, 3, +175, 57, 13,208,158,247,108,132,202,227,158, 91,131,175,121,127,191,245,165,251,213, 31,251, 42,167,131,119,182, 74,155,131, 96, +120,123,231,224,199,121, 27,160, 31, 85, 13,136,180, 90, 46,194,178, 55, 32, 39, 32,226, 80, 10,171, 23,224,134, 56,121,105,165, +176,129,146, 41, 92, 44, 81,194, 31,110, 9,213,214,184,186, 92, 0,178,193,197,112,191,190,135, 50,247,156,155,150, 32,216, 72, + 82, 61,106, 6,127,254,226,237,201,135,235, 65,237, 75,183,242,230,213,243, 71, 15,154,198,130, 25, 93, 56,254,102,175,223, 31, +189,235,251, 87,102,213, 75, 54,100, 39,186,196, 93,181,107,163,200,135,133, 41,141,248,122, 31,250,112,251,142, 87,168,206,101, + 12,135, 19,196,103, 9, 68, 33, 92, 87,201, 97, 45, 1,218,182,251,109,142, 9,104, 17,182,240, 60, 86,140, 56, 29, 56,227, 47, +191,217,232,248, 29,169, 74, 52,186,167,137, 28,174, 36, 11, 82,232,223,207, 73, 21,218,216,154,115,197,224, 72,149,206, 44,185, +159, 41,197, 47,105, 91, 78,180,136, 57, 91,215, 51,103,151, 92, 25,137,126, 13,146, 34,236, 68,201,193,171,126, 45,192,177, 45, + 74, 72, 11,206,217,232,233,202, 40,105,206, 49, 99,153, 99,147,174,208,192,245, 10,242,156,224, 25,178, 83, 13,135,229, 85, 16, + 69,243,179,163, 56, 92,117,185, 88, 51,215,102,107,240,122,165,153,248, 71, 0,202,174,101,183,105, 32,138,122,198, 51,182,147, + 52, 78, 66,218, 82, 30, 93, 32, 85, 8,164,238, 80,191,128,207, 0,190,131, 5, 11, 62, 17,177, 64,130, 77, 97,199, 35, 16,225, +196,142,237,177, 61,195,125,140,173,180, 20, 1, 82,229, 69,149, 56, 19,103,230,206,185,119,206, 61,231,159,226,251,141,242, 2, +158,208, 54,184,135,248, 63,111, 86, 18,252,230, 2,203, 23,236,239, 10,112,214,114,245, 56, 85, 71,165,203,202, 46,231, 20,149, +136, 49, 72, 48, 21,126,147,240, 97, 93, 19, 96,151,100, 21,140, 87, 34,122,192, 60,208, 82,199, 24, 0, 21,188, 38, 9,227, 68, + 99,149,102, 18, 31,100, 38,187,204, 62,112,255, 27, 30, 10, 58, 58,101,117,189,166, 15, 25,150, 11, 78,250,124,250, 35,250,211, +127,172, 36, 88,111,170,114,197,171, 68, 6,215,184, 53,142,101,112, 90,215, 96, 46, 32, 81,229, 71,122,145, 3,146, 7,166,205, + 78, 33,120, 71,108, 75,114, 38,244, 6,252,135,116,164, 31,207,245, 11,233,225,191,220,107,169, 24,104, 86,206,211,123,144, 99, +163,176,106, 33,113,147,142, 70,209,106, 87,176,164, 11, 92,106,131,157,121,158, 71, 32,153,230, 11,159,169,166, 40,219,168,159, + 94, 60,169,202, 66, 52, 59,219,229,217,218,124, 94, 35, 47,135, 4,250, 2,114, 98,234, 13, 11, 58, 65,228, 36,199, 4, 71, 27, +176,102, 29,207,223, 46,214, 99,148,211,218,173, 49, 14,163,207,137, 24, 66,252, 64,182,133, 59,177, 2, 1, 90,107,161, 75, 31, + 58,176, 69,184, 95, 82,125,204, 89, 38, 0,209,226,178, 90,233,142,180, 1,232, 73, 98, 66, 5,131,128,212,187,174,139,170,133, + 39, 25,198, 58,110,154,122, 62, 94,110,235, 76, 12,204,179,160,175,224,248,230, 17, 17,171,228, 56, 61, 92,101,171,186,173, 7, + 71, 74, 22,235,134, 56,174, 67, 93,212,185,239, 66,164,226, 53,124,177,217,116,158,239,242,116,148,194, 8, 97,182,148,166,212, + 40,229,158,228, 53, 58,180, 40,165,206, 79,207,223, 94,190,185, 59, 63,253, 81,172,122, 50,168, 35,138,148,156, 31, 44, 98, 24, +121,219,193,109, 79, 22,119,190,174,191,132,168, 22,231, 70, 17, 0,136,130, 60,124, 37,255,136,112, 31,131,140, 8,145,142,230, + 57,154, 53,226,207,152, 38, 7,176,181,180,109, 3, 3, 67, 67, 74,129,189,178,228, 85, 82,244,114, 36,246,112,186, 52,214, 0, + 34,169, 76, 73,132,232,224,222,226, 62,236,130,232,196,133,155,129,129,196, 5,207,243,247, 78,239,216,136, 5,246,254,119,223, +223, 39, 74,193, 19,202,209, 32,192,230, 77, 93,117,205,182, 49, 59,242,199,176,246,239, 22, 62,103, 81,210,134,118, 85,153,130, + 94, 27, 43,180,247,194,250, 51,202,236,224,194, 49,166,101,148, 56, 22,105, 97,179,135,183, 31, 63,123,241,252,245,203, 87,226, + 88,252,111,124, 95, 70,211,139,163, 71,136,231,156,156,141,166,155,106, 75, 68,175, 16,251, 84, 16,105,105,106, 21,134,181,130, + 54,109, 53,106, 96, 4, 92, 36,225,242, 8, 12,169, 33, 18, 57,204, 55, 72,125, 0, 62, 7,212,192, 1,203,253,193,201,217,167, +111, 31,217,190,141, 33, 11, 32, 9,244,113,172,126, 74,191, 66,156, 63,104,237,251,206,111,162, 24,186,161,197,137,113, 59,103, + 12,183,210, 37,128, 52, 64,250, 40,135,194,233,175, 96, 69, 42, 33,254, 16, 57, 67,108,144, 78, 54,229,198, 43,202,247, 86,174, +110,192,236,253,162,155,198,179,194,108, 88, 72,135, 77,161, 70,209, 36,111,139,137, 26, 23, 87, 29, 50,122,139,146,235,195,182, +123, 37,157, 95, 2,112,118, 45,187, 77, 3, 81,212,227,113,236, 36,142,242,106,104, 40, 8, 33, 33, 33,177, 69, 42, 11, 62, 30, + 36,196, 23,176, 96, 87, 68, 4,148, 18,146, 38,196,241,219, 99, 15,247,220,177, 93, 71,237, 6,164,238,170,196,246,120,114, 31, +103,206, 61,199,249, 39, 88,166,139,188,235,198,115,195,234, 40, 10,224, 32, 91,186,102,204,241,193,194,151,215,209, 53,247,148, + 90,106,196, 67,107,250,100, 66,170, 45,165,133,185, 81,217, 92, 66,118,148, 35, 57, 14, 75,148,198,252, 7, 69, 42,240, 15, 65, + 53,164,111,204,216,231, 83, 52,208, 91,219,190,116,213,127,238, 83,249, 75,211, 94,104,109, 61,244,158,218, 79, 58, 96,209, 82, + 41,151,183, 41, 0, 89, 29, 54, 38, 92, 49, 48, 58, 13, 70, 12, 2, 29,187, 35, 27,183, 47,203,246,232,151, 3,116,163,162, 54, + 84, 40,118,155,180,237, 70, 32,195, 80, 67,234, 0, 63,241, 22,135,108,203, 11,202, 45, 1,178, 60, 0,156,202,193, 71,133, 67, + 97,130,178,131, 23, 82,177,161,196, 46,202,169,100,145, 3, 81,150, 44,238, 98,247, 38, 99, 15,234,180, 69, 57,245, 7, 83,223, + 47, 84,118,177, 60,223,252, 88, 5,123,245,107, 7, 46,189, 42,192,146,208, 44,233, 2, 46,101,221, 27, 34,239,241, 19, 24,235, + 24, 22,184, 21, 76, 56, 18,146,130, 17,133,155,250, 5,217, 82, 87,101, 71, 45,155,219,104,219,113,157, 94, 90, 38, 6,232,166, + 90,102,225, 47,183,225,186,160,252,135,188,198, 96,137,110,160, 44, 33, 20,188, 4,133, 54,213, 41,202, 22,164,191, 63,225,214, +180, 55,174,227, 82,116,198, 17,165, 74,140,218,187, 57,221, 26, 58,212, 92, 43,230, 31,213,155, 48,206,195,111,219,120,212, 31, +117,157, 27,152,224, 92,245, 49,132,204, 13,184, 70,115, 71,251, 36, 87, 57, 14, 14,192,148, 96,158, 27,204,190,119,103,227,229, +238,184,241,251,190, 72, 0,190,170, 66, 5, 81,168,116,185,141,214,108,228, 2, 79,208,229,236, 73,148,134, 84, 70, 77,135,227, +213,230,171, 3,171, 22,121, 76, 2,207,237,165,176, 18,180,162, 52,209, 48, 98, 68,228,225,150, 1,215,162, 69,241, 48,130,123, + 48,173, 16, 51,252,138, 36,139,105,223, 42, 27,172,217,153, 63, 59, 68,251,179,241,130, 34, 90,146, 37, 79,231,207,232,121,163, + 44, 46,209, 92,225,236,144, 86,227,241,244,252,231,254, 26, 61, 71, 94, 40,153,207, 6,211, 40,141,209, 15, 54,136, 13,215,147, +198,119,154, 46, 55,184, 77,143,125,156, 69,217,190,144,147,190,135,112,111,225,136, 22,182,162,130,222, 75,238,244,252, 87, 47, +158,127,248,252, 41, 73, 19, 9, 74, 49,244,108,143,170, 72,225,244,162,175,242,244,196,224, 13, 35,199,202, 64, 11,168, 6,212, +221,184, 80,172,131, 96,117,216, 28,110,223,125,124,255,246,245,155,255,168,223,179, 74,141,134,126, 26,193, 54,157,118,151,177, +174,134, 76, 33,235,199, 29, 19,198,250, 52, 53, 62, 69,201,120, 8, 51, 70,164,170, 50,115, 63, 60,249,196,200,137,160,109,144, +153,184,217,179,229,163,249,197,151,155, 43,250, 31,151,234,250,242,229,229,205,126,125,189,251, 94, 99,134,204,132,104, 3,186, +205, 97,153,233,112, 53,201,187,234,142,129,154, 3, 57,195, 81, 22, 70, 36, 92,255, 14,214, 92,182,219,117,131, 43,106, 51, 86, +235,132,167,126,194,174,166,133, 75,116, 90,233, 6, 4, 54,143, 42,152,154, 32,106,196,199,124, 71, 88, 4,148,212, 39,195, 57, + 75,212, 33,226, 71, 44, 41, 12, 74, 72,117,199,251,110, 35, 82,121, 47,226,119,141,171,254, 10,192,217,149,236, 54, 13, 69, 81, +191,103,199,142, 19,103, 78, 83, 16, 45,173, 64, 42, 18, 18, 43,246, 44, 97,197, 95,240,113,124, 2, 59,150, 72,253, 0, 36,186, + 66, 41, 67,105,234, 76,118, 28,207,230,158,251, 60,164,172, 42,178,204,164,228,249,250,142,231,158, 99,252,135, 60,147,184,183, +179,170,200,123,139, 74, 82,213, 40,177,240, 60,246, 46,154, 49, 69,211, 34, 98,132, 55, 64, 50, 38,227,100, 64,110,217,188, 46, + 12,128,121, 68,221,101,208,203,110,187, 34, 7,230,198, 46,210, 40, 52,220, 37, 83,150,130,237, 5, 34,198,104,189, 51, 90, 70, +152,154, 30, 21, 59, 9, 86,160,138, 37,162,242,238,181, 82,151,172,177, 71, 85,242,158, 61, 64, 16,188, 34,240, 81,251,180,108, +241,168,102, 75, 70, 44,254,121,228,129,121, 89, 31, 41, 47,229, 29,133,209,178,200, 14,169,162, 37, 95,150,134, 33,203, 83, 74, +214,214,102, 69,176, 44,171, 15,166,146, 50,134, 75, 95, 36,127,202,200,204,145,128, 62,149,114,159, 24,135,160, 75,202, 83,169, + 44,161,156,151,110,128,205,126,159,164, 74, 43, 74, 90, 45,100, 91,109,211, 60, 26,180,163,128,206, 48, 57,157, 30, 95,156, 63, +238, 15, 29,179,101,132,182,253,221,115, 25, 64, 6, 56, 0,214,189, 84,150,203,171, 33,148, 34, 73,238,201,128,203,129,255, 11, +171,169, 41,170,188, 2,140,101,152,151,148,106, 86,244, 97,199, 30, 48,115, 64,209,240,129,226,155, 82, 81,227, 73, 53,105,183, +109,233,139,202,196,203,133, 1,203,236,218,186,133,197, 60,241,111,133,199,107,126,152, 8,140,157, 41,121, 61, 72,230, 26,228, +212,246,195,222,216, 11, 60,141,145, 73, 84,148, 80,225,113, 58, 58,251,177,188, 38,151, 55,235, 31,207, 33,208,168, 81, 54, 93, +242,109,151,150,131,217, 76,202, 67, 47,117,243,150,116, 88, 26,131,115,164, 41,180, 32, 72,118,108, 72, 58,131, 87, 69, 68, 14, + 66,136,139,217,139,111,191,191, 82,116,121,118,244,124, 27,109,183,254, 26,237, 54, 10, 87,105,220,235, 12, 54,193, 6, 44, 49, +105,161,155,192, 56,186,254,157,198, 45, 0,165, 87, 71,135, 49,232, 12,200, 34, 23,235, 69,187, 77, 53, 53,246, 0,178,204,231, +234, 11,148, 21, 58,115,242,140,156,241,210,119,147, 4, 20,113, 94,184,161,103, 54,193, 86,128, 97, 16,244,103, 41,242,227,152, +126,113,156,135, 67,103,226, 5,171,159,171, 95,116,105,226, 36,146,116,233,227,162, 63, 25,158, 76, 79,230,183,215, 96, 95, 97, +194, 86,202,108,122, 38,149, 86, 43,178,139, 39,206,163,171,229, 13,107,185, 72,149,224, 64, 75, 5,122,129,188, 13, 40, 5, 69, +199, 87, 79,207, 62,188,127,247,242,124,246,241,211,231,137,105, 27,104,250, 1,208,139, 21, 60,118, 60,113,150,187, 73, 28,166, +233,151,197, 77,140,221, 14,173,129,235,137, 67, 60,177,209, 31, 13,200, 62,186,194,126,251,250,205, 65, 22,245,208,135,159,238, +189,104, 55,235, 77,200,146,195, 28, 32, 37,213,157, 48,165, 78,103,194,121,159,154, 0,193, 82, 91,166,229, 88,253, 91,255,150, +201,222,113,163,144,185, 14,157, 49,213,109, 65,184,163, 34, 86,133, 57,138,148,243,187, 57,221, 30,189,118,119, 31,133,244,182, +203,171, 75,134,127,232,133, 56,208,230, 80,137, 19, 79,100, 70,157,209,122,231, 10,132,231,123,122,213, 90, 53,185, 84,125,203, +146,118,134,221, 73, 85, 72, 20,234, 59,242, 26,200,168,213, 78, 69, 52,249,180,198, 91, 98, 24,159,113,127,176,241,236,138,227, +160,210, 95, 85, 12, 50,128, 14,229,174,239, 42,133, 85,197, 94, 74, 7, 19,103,145, 90,144,108, 72,196, 74,191,209,108,183,230, +117, 68,169,186, 67,127, 5, 96,236, 90,122,155,136,129,176,247,229,221, 58, 9,143,182,148,210,210, 86, 80,165, 45, 7,110, 72, + 72,252, 91,254, 5, 39,206,168,220,120,136,135, 84, 26, 53,173, 4, 37,217, 36, 77,178,105,118,215, 54,243,112,118, 83, 4, 82, +165, 28,162, 40,114,214,142, 61, 51,158,249,230,251,194,219,152,117,241, 47, 54,130, 69, 77,149,147,227,158, 99, 7, 35,156, 32, +134,243, 54,240,150,241, 50,142, 11, 0,211, 19,136, 87,198,150, 26, 12,193, 74, 61,183, 53,188,129, 23, 38, 32,239, 42,156, 60, + 83,205,255,142,172,187,216,130, 67, 98,162,152,158,102,201, 12, 75, 84, 39, 20,227,146, 94, 33,146, 31,140,145, 88, 10, 99,184, + 86,220, 26,100,169,168,105, 40,150,232, 38,110, 56,216,229, 58, 1,159, 5,251, 63,159, 71,249,106, 93, 79,172, 94,104,124,229, +196, 18,238,218,181,168, 39,205, 10, 66,178,123, 52, 41,195, 10,127, 54,137, 84,137, 77, 43,154,147, 90,102,121, 95, 49,196, 27, +105, 59,168, 27,215, 35,181, 63,176,244,154, 36,139,176, 56, 28,102,243,242,235,112, 2, 87,111, 47,138, 61,236, 43,130,221, 28, +220, 85, 82, 34, 51,131,215,240, 67,165, 34, 33,229,243,131,167,145,212,113,224,131,209,159,143,174,167,179, 18,111, 30, 46, 97, + 11,214,216, 74,171,154, 65, 51,244,147,132,236,128, 79, 5,174,171,114,144,230,125,226, 81, 9,180,227,233, 65, 78, 63, 42, 22, + 88, 71,194,172,233, 74, 74,249, 77,218,127, 40, 93,107,249,159,103,176,174,213,221, 94,103, 37, 92,193,188,179,103, 43,168,213, +117,158, 21, 30, 66,241, 67, 78,120,184,219, 42,165,180,104,254,251, 27,251,221,222, 25, 12, 56,157, 77,208, 44, 90,170,164, 97, +113,192, 87,113,163, 36,118,169,243,126, 7, 70,156,229,147, 97, 22,241, 38,219, 89,223, 5,139, 79, 29,131, 72, 42, 9,198, 26, +134, 99, 57, 52, 22,186, 65,230,112, 15,110,117,152, 75, 25, 99,182, 4, 11,179,240,227,133, 45, 71,217, 16,190, 52,205, 39,176, + 44,231,131,115,216,117,157, 94, 39,160,100, 14, 24, 23,229,203,185,185,134,144,237, 65,115, 13,158,246,112,251,240,248,251, 59, +216,195,131,113, 10,207,242,178,253,226,248,228, 61,248, 3, 42,105,148,200, 95, 36,130,246,227,182,146,234,244,242, 20, 66,242, + 39, 27, 7, 95, 46, 62, 27, 42,165,228,232, 64,139, 2, 37, 12,237, 74,164,192, 46,131, 11, 65,101, 74,236,137,143,136,161,240, +138, 13, 8,150,149, 25,255, 32,144, 78, 2,124,198,230,189,135,191, 70, 40, 68,126, 66,132,154,168, 29,230, 57,174, 82,226, 80, + 44,169, 64,111,162, 64,174,198,119,206,166,125, 8,225, 13,107, 90,212, 80, 0, 60,147,176, 14, 63, 46, 47,190,117,186,159, 46, +127,126, 24,252,222,148,141,216, 71, 69, 48, 21, 69,205, 80,182, 18, 25, 7,120, 21,222,130,247,161,236, 21,249,199, 30,210,103, +122,212,134,163,237, 13, 25, 59, 41, 98,209, 20, 59,219, 91, 38,212,226, 40,129, 79,222,190,126,243,168,189,251,236,213,209,237, + 77,188,129,149, 47,179,146,120,187, 96, 41, 10,106,208,207, 81, 52,167, 10,207, 8,181, 34, 80, 90,138,160, 50, 24, 74, 17,229, + 47,194, 95,193,237,149,186,208, 66, 47, 21,251,184, 42, 74, 48, 48,131,219,202, 6, 11, 60,156, 96, 23, 64,129,128, 17, 11, 84, +161,193,140,153,213,129,235, 13,173,144,114,149, 58,183,117, 4,149,124,118,137,255, 14,108,176, 74, 20, 60, 64, 70,123, 12, 6, +187,223, 88, 75,199,120,231, 94,107,173,167,211,212, 86,100, 4,124, 9,112,233, 12,179, 32,119, 52,172, 43,176,112, 9,124,178, + 42,164,134,191,183,186,119,150,158,186, 86, 40, 46, 15,176, 21, 51,181, 46,233, 66,162,228, 47, 43,205, 25,126, 55,139, 63, 2, + 80,118, 37, 61, 74, 4, 97,180,186,155,134,102, 27, 96,144,101, 28,102, 52, 30,252,189,254, 23, 79,222,141,137, 7, 15,106,204, +152, 24,200, 44, 9,195,192, 64,179, 52, 52,189, 85,249, 45, 85, 44, 17, 77,132, 27, 36,189, 85,215,183,190,239,189,220,191,205, +250,223,140,187, 97,121,100,118,100, 18, 44,210, 2,181,164,115, 41,116,235,194, 54,133,119,236, 26, 56,252,104, 48,146,165, 81, + 85, 30, 69,103,116,167,109,150,192,161,139, 70, 2,119,219, 16,146, 89, 26, 75,195,163, 33, 12,216,160, 19, 97,126, 10, 59,192, + 89, 35, 79,180, 40,186, 72,126, 2, 91, 97, 22, 47, 19,137,201, 26,230,194, 73,200, 21,136, 3,160,223,233, 0, 67, 25, 79,168, +140,142,151,110, 23,211, 80, 14, 28,202, 58,145, 7, 29,117,155, 13, 74, 67,115,218,176,178, 46, 51, 59, 51, 89,169,150, 94,145, + 54, 15, 53,176,188,228, 33,144, 84,147, 60, 75,145, 9, 45,236, 45, 17,243, 87,220, 38,129, 3,126,209,201,242,194,147, 50,134, + 56,240, 41,142,170,181,226,117,165, 6,193, 48,248, 61,216, 21,155, 40,113,165,163, 34,187, 92,176,170,121, 28,251, 66,209, 12, +156,191,203,138,213,234,118, 21,127,235, 63,194, 19, 75,241, 19, 35, 28, 43,243, 74,234,204,181,114, 40, 83, 34,151, 1,236, 2, +136, 74, 17,153, 94,238,120,189,139,226,229,175,224,103,148,133, 96,236,208,122, 88,200,238,159,237, 30,189, 5,166, 51,116,248, + 26,201,159,215,203,231,240,251, 60,152, 18,213,117,129,166,130,169,208, 14, 78, 55,203, 74,110, 21,187,185, 68,215, 14, 95,136, +194,130,208, 71,177,236, 92,142, 10, 38,170, 85,109,207, 55, 11,150,177,185,157, 12,152,229,201, 66, 68,144,167, 66,220, 57,235, +104, 5, 39,235,212,218, 35,255, 17,210, 35, 15, 81,176,118,152,172,151,225, 2,187,173, 74, 61, 60,223, 25, 62, 61, 36, 43,183, +120,120,208,210,220,203, 12,223,133,213, 40,230, 75, 96,205, 47,207,123,179,245, 20,145,145,201, 38,225,137,118,165, 59,105,193, + 22,177,231, 65,184,226, 23, 2,211, 37, 34,229,129,187,132,200, 29, 22,228,211,205, 71,162, 73, 65,189,221, 52, 74,135,243, 49, +174, 48, 17,134,240,212,155,227,184,240,124,111, 30,190,228, 28,116, 78,221, 70, 59, 85,201, 96, 52,144,102, 51, 82,169, 68, 16, + 93, 15, 15, 20,216,112,155,189,198,245,237,115, 31,121,118, 44,213,173,191,244,151, 83, 56,218,152, 38,155,234,165,230,114, 51, + 31,250,195,114,161, 28, 99,103, 2,167, 26,108, 91,191,159,182,160,161, 51,181,133, 28, 2, 73,206,178,244,109,243, 10,236,123, +138,236,180, 90, 3,154,100, 67,241, 14, 19,212, 77,205,190, 78, 6,239,222,127,248,124,255, 3,109, 52,172, 45, 4,239, 56, 84, +225, 20,108,183, 17,121, 47, 42, 16, 27,228, 9,128,162, 94, 85,106,223, 39, 35,211,232, 59,142,221,225,188, 34,134,183,227,245, +213,181,166, 30, 22, 86, 16,172,222,116, 47,254,171, 68, 51, 93,249,157,179,230,110,120, 48,159,115, 91,181, 86,255,169,143,226, +245,241, 54,193, 26,151, 96,253, 52,201, 12, 72,152,231,226,116, 94,193,241,210, 44,156,111, 23,202,100,207, 71,218, 23, 88,184, + 11,247,114,110, 66,167,219,218, 4,166,218,237, 17, 89,141, 88,132, 62,161, 35, 36, 83,172, 31, 2,231, 16,107, 7, 54, 70, 26, + 21, 55,140,184,117, 31, 67,151,143,184, 59, 35,117, 79, 20,254, 24, 47, 39, 66,253,129,173,102, 79, 66,209,183,142,231,108, 8, +200,106,254,122,182,115,153,114,175,205,173,238,103,119,146, 10, 64,134, 47, 75, 49, 40,211, 58, 29,120,154, 35,168, 61, 66,158, +215,234,183, 0,148, 93, 93,107,211, 80, 24, 78, 78, 62, 79,154,174,211,174,155,130, 94,168, 67, 65, 84,156,136,120,163,255,194, +127,224,165,191,203, 27, 65,240, 23, 56, 6, 10, 34,130, 87, 50,198, 46,198,220,148,205, 74,215,180, 73,147,180,201,241,125,222, + 55, 25,213, 93, 9,161,176,182,235,199,233,121,191,159,243, 60,234,191, 8, 9, 90,235, 54,231,206,157,110, 93, 70,179, 0,198, + 96,133, 29, 21,199,170, 27,169,110,199,233, 70,142,246, 65,171,229,122,134,246,139, 79,127,122,192,186,120, 46,221, 40, 15, 58, +188,182,244, 99, 64,167,123, 78,167, 64, 87, 64,153, 39,166,190,174,129,187,119,164, 50, 96,194, 25,224, 80,152,126,151, 81, 37, + 14, 12,155,207,249, 35,157,110,164, 91,140,141,206, 53,119,241,250, 43,235,194, 5,215,192, 96, 45, 97,254,191,184, 54,168,250, +151,151,137,178,126,223, 9,101,149, 92,112, 25,186, 23, 90,241, 23,175, 70,173,117, 45, 30, 44, 67, 80, 77, 83,192, 49,243, 59, + 26,170,182,124,152,180, 72,161, 10, 34,145,157,231,243,205, 37,202, 1,124,151,140, 38,210, 50, 17,248,173, 1,230,189,148,237, + 21,186,238, 32,210,218,241,205,220,157,231, 78, 61,243, 77, 25, 36,105, 29,163,134, 13,120, 15,217, 20,245, 78, 78,135,144,147, + 29, 37, 59, 31, 62, 27, 70,148,147, 55,191,127,237,209,213,104,179, 91,245,138,121, 49, 46,146, 89, 69,117, 64, 70,129,112, 86, +205,242, 69,150,149,211,113, 49, 10,148,127,187,119, 7, 9, 54,228,167, 21,109, 68, 9,217,189,112, 69,161,183, 38,237,116, 44, + 45, 23,185,214, 56, 27,145,199, 52,220,125,243, 64,194,200,117,134, 5, 29, 19, 16,107,148,208,206,100,142, 13,124,183,172,152, +176,224, 54,180, 53, 56, 41, 82,191,210, 97,205, 84, 81, 2, 36,229, 84, 30, 43,150,207, 11, 74,194, 78,198,199, 60, 32, 53,148, +186, 62,184,241,144,121, 90, 74,122,133,213, 78, 95,166, 44,173,230,174, 66,102, 71,161,174,204,132, 7, 11,114,131,224, 6, 0, +122,135, 1,154,112, 31,207,238, 62, 47, 64, 93,169, 38,197,164,228, 57,103,171, 91,220, 40, 24, 7, 62,152,218, 30,111, 62, 9, + 3, 77,241,120,146, 79, 48,163, 99,219, 81,144, 5,115, 7,189, 13,250, 17, 46,197,107,158,231, 31,254, 62, 68, 81,102,219,179, +124,170, 61,109,131, 93, 54,167,244,127, 99,245,138,239,209, 22, 82,219,223,182,247,126,236,201,156,157, 2, 85,228,235,114, 81, + 80, 56,100, 89, 6,140, 64, 40,220, 6,174,222, 61,222,165, 45, 71,182, 65,159,252, 44, 61,139,194,152,253,183, 29,235,120,206, +185, 57,217, 87, 28,196,100, 52,177,238,200, 52,130,167, 60,168,130, 13, 98,134, 41,217,203, 82,164, 15,252,206,245, 78, 31,236, +225,192, 31, 99, 75,129, 30,129,185,159,193,233,110, 27,122,143, 4, 36, 14,148,128, 91,133, 1,163, 67,182, 40,206,138,124,152, +167, 71,105,242,115,154,176, 72,186, 41, 22,139,117, 47, 92,137, 58, 34,249,172,254,242, 36,156,130, 90,243,131, 47,251,195,233, +232,251,233,241,209,215, 3,122,236,253,199,157,215,239,222,210, 67, 91, 91, 79, 67,189,218,226, 48,254, 73, 29,221, 72, 15,110, +221,188,247,242,197,171,157, 55,159,250,250,178,131,225,182,207,141, 75,156, 24,193,222,128, 83,192, 24,134,185,174,113, 8,175, +132,134, 30,250,242, 20, 44, 43,246,245, 25,160,186,140,149,172, 77, 11, 72,111, 15,132,182,122,154,102,217,178,154, 68, 88, 16, +241,109,105, 80,137, 97, 53, 22, 39, 67,134,230,216, 84,251,255,158, 2,136,182, 18,208, 48, 3, 36,107,232,124,233, 6,187,210, + 40, 11, 91,195,201,105,221,182,149, 91, 38, 2,179,244,238, 53,179,141, 32, 50, 85,130, 34, 49, 96,187,148,184, 91, 55,252, 62, +114, 30, 75,152, 63, 26,138,200, 54, 52, 9,151,193, 82, 26,202, 96,209,165, 47,205,247, 88,181, 57, 39,116,230, 39,255, 17,128, +175,107,105,109, 34,138,194,115,231,145,121,164,233, 36,166,212,166,169,165,180,130, 22, 23, 22, 93,139,224,218,165, 43,117, 81, + 68, 92,137, 63,209,165, 47, 68,148, 10, 82,137,148, 90, 16,146,148,182,233,188,238, 60,238, 92,207, 57,119,102,154,170, 24, 6, +178,153,144,185,119,206, 57,247, 60,190,115, 62,253,255,150,157, 28, 88,213, 94, 52,111,220, 13,118,145,156, 65,134,107,240,242, + 92,230,153,154, 5,145, 78, 80, 4, 65, 49, 67, 76, 66,233, 14,189,181,190,219, 55,113,230,185,229,217, 30,178,135,130,163, 32, +237,150,134,160, 70, 19,167, 32, 18,232, 15, 83, 16,134, 98, 44,172, 89,156, 44,149, 75, 50, 41,155, 79, 25, 11, 21, 21, 96, 88, + 74, 85, 70,173, 74,101,147, 83, 97,208, 20,114,120,212, 84,196, 97,126, 42, 8, 81, 48, 9,127, 21,165, 26, 38, 94,247,140, 41, +146,195, 75, 21, 8,138, 52, 77,103,126,233,168,249,148, 56,130,195,137,139, 60,202, 19, 54,239,181,252,219,190, 75,226,102, 23, +227,112, 42,254,196, 81,214,195,247,105, 84, 5, 98,101, 5,211, 26, 18,151,242,210,133, 37,176,250,163,200,103, 74, 89, 39,183, +145, 12, 76, 40, 59, 11, 94, 37,207, 69, 20,227,149,196, 16,186,202,156, 67, 68,202, 58, 14,232,191,233,216, 26,236,181,219, 2, +171,162, 5,103,147,111, 95, 71, 81,156, 26,172,234,211,248,184,255,229,228,120, 22, 21, 28,153, 76, 74, 80,101, 65, 2,136, 95, +185, 38, 82,145,242, 2,214, 31,244,172,222,162,217,163,167,102, 28, 75,130,232, 19,103, 89, 74,116, 2,106,146, 51, 83, 80, 32, +199,176,113,180, 61,190, 28,112,246,203, 12, 11,101, 26,113, 84,181,192,245,199, 49,200, 58, 97,161,136, 44, 69, 39, 40, 49,253, + 92,191,210, 94, 34,128,160,174, 58,108,117, 53, 62,178,142,129, 96, 7,112,176,143,206,108,195,182,117,251,170, 63, 0,215,248, +195,247,119,146, 48,165, 60, 11,193,171,253, 75,104,245,165, 78,223,208, 26,132,155,236,122,221,237,225,246,246,240,166, 36, 36, + 79, 46,210, 31,227, 17,248,107, 88,207, 37, 17,112,105,108, 78, 99, 25, 96,153,158,229,193, 97,115, 56, 61, 72,211,164, 78, 71, + 33, 23, 13,117, 3,148, 60,205, 38,179, 49,104,233,207,227,195,182,211,166, 30, 0,221,107,181, 65, 32,163, 44,164, 9,202,168, + 26, 32,243, 89,158, 33,255, 19, 8,191,105, 58,150, 3,178, 4,135,250,250,210,250,162,235,111,173,108,250,222, 34,207,147,142, +239, 63,122,248,100, 58,155,162,159, 8,239, 52,197, 3, 47,203,211,115, 62, 67,132, 46,211,195, 56,138,146, 96,208, 95,129, 48, +109, 18, 32,167,121,192, 19, 46,168,192, 72, 57,219, 5,187,141,217, 33, 74,137,149,228, 64,198, 69,118,173,187, 42, 48, 19, 45, + 43,225, 71, 82, 83,166,206, 40,154,253, 12,190,109,166,108,117,129, 68, 30, 66, 80,134, 7,142,177, 56,229,227, 48,154,128,184, + 72,176,167,120,251,157,254, 50,245,178, 53, 92,247,178, 25, 55, 53,112, 7, 27,119,175,239, 12,183,110,111,222, 88,219,217, 88, +246, 86, 31,220,191,183,251,114, 23, 54,228,211,251,183,175, 30,191,168,239, 68,134, 55,126,206, 63,191,222, 91,235,220,138, 14, +162, 40,158,140,222,236, 61,127,250,236,104,255, 8, 98, 50,120, 19,160, 98, 88, 25,210, 74,158,243, 51, 44,189, 56, 39,209, 41, + 54,142, 50,133, 58,199, 64,208,119,123, 78,203, 17,146,140, 62,101, 55, 20, 85,105,117, 6, 40, 3,218,216,229, 74,135,216,133, +126, 86,101,205, 6, 1, 92,221,211, 64, 31, 5, 10,155,133, 57,125,183,167,218,242, 20,192, 13, 14,146, 4, 66, 92, 66, 71, 98, + 61,151, 92, 50,207,105,215,152, 75,218, 97, 65,127,193,212,191,227,102,230,178, 32, 60,172,108,174,234,121, 84,178, 94,170, 14, + 85,226,168, 36,203,222,184,141,240,118, 22,156,142, 82, 2,108, 18,146,108,190, 67,135,214, 81, 77,142, 87,172,176,205, 85,214, + 83,205,202, 57,219,255, 91, 0,194,174,101,183,105, 32,138,122,198, 73,157,164,117, 40,106,139,218, 42,221,116,131, 90,216,176, +224,241, 7, 44,144,248, 26, 88,242, 61,136, 13, 59,126, 0, 9, 9, 80,165, 46, 88,128,132,168,148,144,164,113,227,212, 77, 60, +182,227,215,152,251,176,157,150,135,200, 34,146,101,201,178,199,158,251, 62,231,252,191,254,222,110, 88, 10, 33,118, 21,175, 72, + 89,147, 41, 3,106, 34, 69,148, 93,211, 70,129,102,145, 84, 45, 6,136, 61, 19, 55,117,205, 80, 28,111, 31, 25,182,113,230,159, +169, 68, 89, 18, 35,163, 92,226,180, 34,118,148,225,147, 70, 46,228, 28,113,243, 5,119, 19,120, 14, 28, 12,153,182,144,133,166, +102,129, 39, 15,192,253, 69, 26, 89,229, 12, 60, 66, 96,125,131,120,144,214, 54,154,109, 88,196,190, 58,203,137, 59, 84,211, 32, + 12,132,151, 58,103, 17, 20, 45,202, 85, 40,147, 23, 81,235,121,144,150,174,241, 91, 43,152, 90,135, 16, 79,101,105,246, 39, 21, +218, 63, 10, 60,165, 67,151, 72,196,167,197, 53,206, 53, 76,239, 11,228,181,128,135, 72,209,115,136, 18,224, 80,249, 88, 89,213, +234,116,213, 41,168, 4, 98,216, 42,227, 50, 55, 36, 92, 25,103, 90,224,225,183,186, 45, 2, 79,147,192, 97, 19,201,126, 59, 26, + 54,176,217,177,192,194,166,150,185,182,191,183,235, 47,194,109,219, 86, 23,211,129,227,164,112, 22, 99, 50,156, 21,237,202,219, +216, 92, 66, 25, 38, 51,101, 56, 52,161,170,169,136,174,145, 0, 29, 94, 95,142,210,151, 61,187,247,213,115,145,207,153, 16,185, + 68, 38,147, 83,168, 76, 66,218,130,243, 85,209, 89,223, 72,252,132,239,186,160, 92,135,171,242,200,182,144,229, 44,217, 41, 72, +219,132,128, 14, 60, 51,132, 73,176, 31,205,145, 72,174,168,100, 20, 37,199, 19,210,208,186,134, 4, 99, 33,126,169,224,112,170, + 38,118,203, 14, 35, 69,140, 12,154,188,111, 77,150,176,250, 65, 26,113,125,104,108, 30,205,189,208,195, 44, 4, 41,160,179, 36, +214, 97, 58,109, 8, 33,170, 22, 57,218, 53,136,160,215,172,150,217, 94,196, 8, 46,117,149, 11, 23, 8,146,136,183,138, 36,147, +129,125,221, 34,237, 52,214,151,200,195, 46, 73, 80, 64,187,254,148, 67, 31,199,119, 24,173, 11, 11,213,164, 26,209,216, 27,195, + 9, 75, 88, 56,228, 46,132, 10,249,182,151,253,139, 1,196, 64, 19,111,162,150, 1, 44,251,149,119,249,246,221,107,194, 65, 24, +135,187,135,167, 63, 78,153, 66,147,135,247,218, 86,139,145,201,163,217,216, 36, 40,111,156,197,247, 14,142,199,179, 81,148,132, + 12,224, 65,121, 16, 10,244, 50, 42, 64,195,141,194,195, 30,237,222,237,207,157,254, 98,162,105, 56, 42, 55, 86, 0,119,166,138, +186,140,195, 10,106,142, 47, 69, 99,139, 72, 18,208, 95,248, 73, 60, 81, 11,134, 89,132, 89,182, 71, 74,182, 72,142, 79,184, 42, +150, 52,134,192, 33, 79,115, 76,160, 13,227,187, 51,104,174,183,140,208, 8,194,224,211,201,201, 78,111, 31,190, 98,231,219,144, +247,221,147,251,143, 62,126,249,240,236,225,211,211, 55,159,207,207,175, 94,189,124, 49,186, 26,169,247,193, 86,119,243,241,243, + 7, 63,135,144,253, 24,119, 54,118, 46,212, 20,118, 44,120, 27, 8,210,193,178, 35, 11, 48,133, 15,120, 17,148,241, 65, 57,151, + 40, 90, 18, 72,206, 96,170, 93, 93,113, 50,234,149, 96, 81,217, 96, 44,203,109, 76,196, 85,220,104,251,214, 21,154, 27,152,202, +234,224, 86,103,243,220, 11,102,193,140,198,185,204, 27, 5,216,130,113,145, 56,233, 28,232,120,138, 66, 46, 57, 87, 80,200, 15, +160,226, 99,138, 12, 82,204,124, 46,122, 91, 7, 67,119, 80,252,189,141, 39,106,115, 45,235,234,188, 40,109, 1,252,145, 76, 5, + 30, 66,182, 7, 47, 58, 91, 33,195,217, 66,148, 85,250,250,193,181,177,234, 48,234,213, 20, 12,250,255, 95, 2,208,117,109,187, + 77, 3, 65,212,235,189,216,137, 29,231,210,196, 20,164, 64,139,104, 43,113,169, 84, 36, 36,126,128,239,224,185, 47,124, 3, 18, + 31,129,128,254, 3, 47,124, 0, 15, 72, 72, 72,168, 18, 15, 32,132,138, 74, 91,138,104,211,210,218,137,237, 92,236,101,103,118, +227,164, 69, 68,121, 75,228,120,189,177,231,204,204,153,115,236,255, 85, 99,102, 61,238,113, 98,207, 17,246,137,161, 42,154,153, + 38, 96,200,218,158, 39,130, 64,248, 62,171, 9,226, 98, 93, 5,112,253, 2,107,134, 94,200, 65,249, 43,184, 31,110,220,108,172, +168,171, 3,106, 62,212,169,128,247, 75,197, 33, 66, 16, 71, 72,161,110, 3,149, 56, 83,168,222, 48, 27,172,235, 24, 22,118, 84, +254, 40, 92,226,114, 34, 24, 16,222, 65, 51, 85,221, 86,128, 68,128,166, 2,226, 51,168,226, 69, 42, 76,120, 42,167,182,201,110, +188, 51, 46, 50,104, 28, 66, 74, 10,221,203, 98,162,167,198, 10, 20,209,215, 40,222, 98, 42,219,224,149, 89, 37,223,244,138,229, + 63,166, 29, 86,118, 1,185,207, 26,177, 51,247,150,203,159, 74, 28, 80,246,236,121, 57,127,227, 28, 0, 26, 94, 0,153,231, 24, +244,165,181,123, 49,215,240, 45, 19,186,178,150, 8, 34, 4,197,204, 64, 22,148,208,137,172,121,172, 21,216, 87,219,172,221,228, +157, 38,109,214,105, 35,192, 77, 47,236,187,107,107, 87,218,157,102,173, 78,250,233,222,207, 3, 50,140,232,240,207, 36, 61, 29, + 36, 39, 81,114,122, 56,250,214, 35, 95, 83,186,227,186,123,190,219, 19, 44,181,129,218,193,212,143,112, 12,219,128,234,209,192, +158,131,102,164,209,204, 54,214,230,196, 98,192, 93,243, 4,231,165,127,112, 52, 56,181, 96, 78,193,158,142,164, 26, 27, 63,143, +251, 84, 75, 38,131,136, 2, 5, 12,107, 81,137, 44,120,128,250,192, 14,165,126,213,195, 78, 58, 10,194,226,150,248, 78,141, 51, +231,114,216,132, 64, 34,163, 44,206,113, 92, 96,245,218, 42,153, 94, 43,156, 18,200,137,113,225,209, 26,175, 58, 7, 66,141,101, +180,191,133, 97, 9,140,182,126, 53,192,152, 9,114, 2,157, 90, 7, 2, 6,144,208,229,122,119, 61,202,206,144, 57, 7,207,195, +176, 30, 46,248, 45, 92, 73,241, 96,245,161, 58, 11,193,157,165,240,214,157,238,186,130,246, 56, 62, 83, 40, 80,174,125,145, 81, + 2, 86,175, 57, 87,135,237, 46, 44,213,220, 0,147,126,217, 10,218,150,185, 28, 64, 98, 84, 11, 78, 70,105, 14, 4,143, 31, 56, +161, 99, 9,199,225,156, 47,182, 22,213,119, 62,126,223,214,170, 15, 70, 17,156,200, 56,141,147, 52,233,103, 42, 45, 64, 61, 29, +196,122,159, 15,190,168,160,197,185,104,249, 13,152, 21, 71, 43, 72,135,241, 64, 1,121, 46,212,222, 29, 39,253,183,187,219, 59, +201,113,108,141, 34,153,197,150,122,150, 15, 83,107,148,225,123,104,169, 5,179,120, 0,169,207, 8,117, 88,141, 56,174,238, 88, + 66, 73, 39, 63,207,178,222, 96,144,141,199, 42,204, 11, 74,151,252,186, 52,211,148,104,134,134,166,102,196,230, 97, 0, 21,152, +222,254, 81,126, 2,147,234, 3,235, 60,160, 78,123, 2,141, 98,121, 28,251, 84, 60,219,124,250,254,211,187,229,198,218,155, 15, +175,111, 63,186, 39, 86,120,159,245,159,191,122,185,249,248,201,141,141,174, 58,239, 23, 91, 91,245,170,247,187,127,100, 58, 88, + 6,172, 18,220,134, 2,134,177,225,239, 82, 84,156, 42,162, 86,162, 57,178,133,161,181,232,145,207, 92, 87, 85,114,105,168, 96, + 58, 69,153,130,119, 67,122,209, 99,124, 90, 6,252, 34,142,151, 70,105, 0, 45, 34,126,157, 29,170,211,184,222, 89, 38,196,186, + 0,187,113,108,216, 97, 85,133,202,199, 19, 84,195, 71, 59, 64,169,235,242,144,100,231,181, 74, 3,202,153,133, 33,146,238,247, +118,101, 9,222,139,233,177,204,187, 32,250,142, 7,239, 55, 99, 39,106, 92,203, 17,208,229, 24, 69,213, 43,206, 34,236,156,207, + 90,134,165,230, 83, 73, 63,159, 76, 31,238,114,142,165, 38,167, 2, 48,127, 5, 32,236,220,122,154, 8,162, 56,190,179,221,237, +236,165,244,194,182, 80,192, 16,140,128,240,160,162,137, 74,162, 15,126, 0, 99,252, 68,190, 24, 63,131,207,126, 1,159,124, 51, +126, 1, 73, 32,160, 96,192,210, 66, 81,108,237,150,219,182,221,238,109,198, 57, 51,187,165,133, 68,210,183, 62,181,179,103,207, +109,206,249,255,110,184, 95,149, 71,117,128, 81,140,189,150,146,177, 72, 25,203,122, 9, 23,167, 51, 51, 30, 9,186, 32,146, 41, +107, 36,109,200,154,169,102, 13,102,112,192,246, 14, 17, 10, 52,148,158, 49,167,199,113,241,224,252,167, 67,123,106, 4, 76, 11, + 34,195, 30, 90,192,135,245,216,225, 42,176, 53, 42, 39,117, 12, 84,235,192, 38, 7, 69,105, 16, 72, 7, 10, 5,108,199, 8, 22, + 31, 4,128, 16, 20,104,211,134,202, 66,133,218, 13,186,181,206,145, 31,246, 41,167, 56, 69, 36,176,242,229, 63,167,191,161,165, + 33,230, 51,164, 88,181, 77,192,228,130, 32, 64, 55,207, 67,254,103,146,136,230,181,113, 55,112,253,168,127,221,197, 59, 92,163, +120, 16, 13,212, 20,230, 37, 91, 36, 83, 58, 44,156,121, 21,115, 40,226, 49,143,205,204,143,236, 28,109,198,215,234,177,126, 5, + 17,137,176, 20, 11, 87,202, 17,179, 53,128,202, 66, 15,135,157, 11,136, 62, 34, 24, 44, 10, 3, 22, 69,245,237,157, 31,172,198, +107,218,173,239,181, 38,230,153,133, 71, 40,203,177,251,241, 42,147,212,129,131, 37,138,212,215,113, 63,111, 66,127, 37,244, 51, + 36, 42, 40, 72, 67, 44,220, 34,141,197,212, 46,233, 67, 37, 6, 0, 68, 58, 16, 86, 37,176, 94,224, 80,158, 17,195,141, 34, 47, +222, 5,145,155, 47,225, 9,123,229, 73,153,211, 80,100, 85,100, 83, 6,214,152,171,154,159, 90,172, 52,246, 56,186, 21,246, 3, +152,175,100, 94, 30,136, 39,148, 88, 25, 24,146,243, 35,207,113, 79, 37,177,238, 36,110,172,147,147,162, 28,246, 77,121,109,180, +119,188, 59, 48,250,185,226,156,221, 61,233, 38, 36, 4,148,156, 97, 49, 55,209, 62,111, 9, 98,170,211,115,162, 40, 64,131, 18, +137, 74, 46,113,123,103,174,137, 77, 21,160, 19,238, 90,117, 45,157, 82,173,108,201, 50, 75, 91,245,117, 65,178, 22, 23,152,181, + 70,149, 29,190,235,245,236,139, 22,130,107,124, 3,118,220, 49,102, 41,121,185, 80,182, 29, 27,106, 20,110,175,236,143,244, 2, +183,210,220,101,129,124,117,113,117,255,184,242,203, 62, 20,113,229,150, 53,219, 56,111,248, 94, 63,197, 37,161, 41,103,216,178, + 39,190,114,251,222,198,193,214, 73,167, 45,164,214,178,122,142,189,210,214, 88,241,130,189,216,112,243,140, 12,221,152,202, 78, +178,199,122,216,172, 11,114,111,206,204, 95,244, 28,172,232, 62, 76,172,123,122, 74,153, 28, 43,125,174,125, 93,107, 87,174,217, +106,106,104,176, 11,197,253, 24, 73,240,130,226,141,211, 96,116, 4,131,207, 50, 68,138, 68,218,110, 71, 83, 20, 11, 68,162,209, +131, 66,177, 14, 58,204,136, 75, 65,132, 44,150, 96, 37,205, 98,255,236,236, 76,125,179,250,104,229,190,159,146,221,191,246,221, +220,194,252,194, 29, 31, 75,101,169,180,190,183,189,181,241,237,227,250,167, 55,239,223, 50,247,103,161,137, 49,108, 45, 45, 47, + 63,121,254,120,233,225,226,171,215, 47, 95, 60,125, 38,101,164,230,102,243,203,187, 15,149,179, 3,133, 15,178, 67,215, 5, 62, + 33,111, 62, 69, 62,116,187, 32,158,186,172,236,226,189, 77,156, 54,122, 98, 91,141,198,138,225, 48, 5,203,131,148,153, 54,253, + 16, 16,119, 73,106, 37,192,218,113, 19, 67, 96, 73, 10,122,193,238,180,233, 80, 94, 21,119, 2,165, 68,219,155, 91,121,181,185, + 15,133, 38, 26, 93, 77,103, 63, 4, 88,185, 36, 94, 26,225,113, 91,195, 90,215,235, 16,254,114,218,157, 22,239,152,197, 8, 87, +145,201, 39, 66,230, 28,112, 40, 56,116,151, 68, 64, 4,115, 64, 35, 78, 70,200,121,200, 3, 85, 44,110, 42,188, 13, 49,220, 94, + 16, 99, 64,151,229,200, 21, 72,213, 64,218, 11,190,254, 39, 0, 93, 87,178,219, 52, 16,134,103,188, 39,118,156,198,161,180,141, + 26, 84, 33, 69,170, 16, 21, 39, 56,240, 0,189,115,230,196,123,112,225, 21,120, 11,110, 92,224,136,132, 84, 56, 32, 36,184,180, +149, 16, 42, 41,173,104,170, 52,193, 77,236,216,142,151, 97,254,127,108,199,105,232, 45, 74,148, 56, 94,102,254,237, 91, 22,252, +213,255,118,226,151,141,247,160,182,147,243,201, 42, 42,192,128, 53,118,195,174, 57,150,218,156,197,190, 23,187,124,151,215,136, +172, 75,186,161,232,170, 2, 73,186,163, 91,154,102, 96,246, 77,195, 36, 83, 0, 8, 60, 31,206,134,243, 44,184,158,243,114, 56, +150,138,233, 60,220, 94,146, 22, 90, 96, 98,156, 32,214, 24, 84,122,224,222, 0, 30,100,186, 6,200,119, 69,227, 59, 60,188,159, +142,231,147,121, 58, 35,104, 45,129, 12, 74,145,131,196, 41, 74,224, 22,228,121,182,218,116,103, 75, 88, 73,186,130, 53,202,207, +190, 58,163,200, 22,104, 25,161,244,192,110, 9, 18,242, 98,226,186, 56,144, 36,173,132, 12, 90,145, 95, 99, 36,217,185,211,235, +143, 78,138,195, 97,158, 11,178, 44,216, 10,131, 41, 54,168,204,232, 48,157,166, 27, 29, 7,100,127,101,170,170, 64,255, 82, 20, + 58,143,193,160,200,100, 74,228, 39,118, 77,171,101,105,131,101,111,191, 30, 43, 5,142, 42,197,255, 31, 87,136, 90,114,229, 69, +130,237, 14, 93, 37,166, 74, 28,173,109,203,219, 93,115,215,151,162, 95,238,145, 23,186, 72, 53,203,138, 90, 4,179, 17, 64, 2, + 65, 82,100,155, 14, 47, 33,253,112,134,186, 56,130,170, 4,173,228,205,214,214,217,232,183,160,221,211, 92,178, 9,214,101,221, +104,180,204, 86, 16,249,215,193,132,127,182,185,182,117,233, 94,224,198, 5,251,163,161, 24,160, 1, 89,178,162,115, 8, 19, 44, +126, 75,183,194, 36, 68, 76, 99,233, 89,131,233, 24,197,182, 93,206,147, 34,120,193, 32,198,104,138, 1, 66, 93,208,186,197,128, +130,180,228,118,221,113,193,130, 17,201, 25, 21,251, 54, 97,224,197,207,208,182,154,227,233, 72,104, 6,149,178, 53, 24, 57, 89, + 97,156, 14, 89,142,109, 54, 39,193, 68, 22,237, 56, 42,237,172,223,239, 15, 79,100, 4,141,241,204,154, 95,130,142,211, 29, 79, +175,252, 40,135,120,242,195,236, 63,218, 63, 56, 62,224,191,198,191,235, 78,198,113, 26, 63,236,238, 29,158, 31, 74,168, 94,137, + 79, 18,235,109,244,206, 71,103, 48, 88, 78,194, 86,125,141, 71,196,140, 10, 50, 53,208,118,208, 69, 17,194,170,192,147,242,194, + 68,151,148,171,201,223,247,131,111,197, 83,151,146,197,171, 21,168, 5,220,105, 13,176,191, 76, 42, 90,190, 41,222,249,184, 76, + 16,171,240,117,147, 72,107,186,209,181,154,187,206,250,199,225,197,153, 55, 77,192,166,152,173,200,116, 48,247,116,248,244,193, +227, 35,191,255,249,205,187, 15,159,190,188,124,253,234,230,130,152,145, 31,223,127,158,254, 57,229,143,176, 49,168,185, 3, 55, +185, 27, 59,157,246,147,237,189, 23,207,159, 93, 49,143,151,167, 81, 28, 53, 84,251,114, 58, 64, 15,214, 88,150,245, 40, 3,123, + 6, 4,197,103,216,141, 76, 58,237,123,231,128,157, 37, 37,167,136,229,168, 19, 1,191,102, 18,165,171,244, 69, 82,110,186, 68, + 16, 79, 40, 43,225, 52,203, 12,251,178,111, 71, 42,130,137,203,178,178,153, 85,111,122,129,135,134, 82,128,195, 23,252,114,177, + 91, 9,165, 98,129, 87,186, 97,186, 81, 0,210, 97, 1, 25,170,201,128,175, 20,222,146, 84, 66,172,105,212,172, 32, 10, 64, 16, +179,152, 23,102, 57,252, 39, 21, 64,188, 44,143, 76,139,228,189, 64,208,148,108, 77,136,128,255, 4,224,235, 90,122,154,136,194, +232,237,220,153,219,153,190, 8,130, 37,196,132, 54,186, 33, 97,199,214, 45, 49, 49,254, 9, 22,198,133, 59, 55,198,191,224, 66, + 52, 13,198,196, 71,112,165,176,213, 63,161, 91, 68,220,144, 42, 72, 10,180,157, 82,250,154,182,243,242,251,190, 59,115, 25, 10, +178,235,162, 77, 51,115,103,206,247, 60,231, 92,135,239,137,219,164,116,125,185,156,118,114,156,104,106, 38,228,122,196, 53,151, + 24, 74, 66,209,144, 21,234,166,102,230,140, 12,164, 24,121, 35,151, 22,150,165,155,166,110, 97, 31, 63,240, 60,236,135,251, 80, +121,101,117, 3,126,210, 26,117, 28,175, 11,177,193,241,156,129,219, 35,123,115, 50,210, 64,178, 90,132,168, 88, 40,132,196,138, +103,104,191,184, 48, 87, 58, 32,230,113,138,242, 62,130, 26,202, 4,133,112,112,178,231, 82,121,230, 81, 51,145, 41,112, 79, 70, +184,240,130, 90,207,255,240, 61, 53,225, 21,126,105,113,254, 26, 70, 84, 20, 24,248,132, 69,107,244,215, 44,210, 76,100,202, 90, + 17, 1,203, 20, 89, 72, 39, 91,189,122,172, 90,140,192, 30, 48, 79, 34, 23,160, 58,199, 97, 29, 79, 11, 20, 30, 40,204,230,125, +174, 27, 80,191,160,244, 14, 36,219,154,227,185,142,235,231, 2, 61,135,180,110,191, 52,149,253,190,119,240,237,207, 73, 38,238, +208,249,241, 18,167,124,239, 13,122,179, 37,132,209, 75,207,148,125,106,150,227, 92,187, 32, 80, 38, 54,244, 69,154,167,125,166, + 13,144,230, 18, 89,156,196,246, 8,200, 32,195,224, 65, 86,241, 52, 24,198, 71, 92,112, 11, 78, 83,122, 19,148,138,119,142, 79, +107, 88,187, 80,109, 28,203,110,203, 65, 42,183, 12, 49, 68,165,195,240, 60, 87,210, 52, 58,121,149, 79,200, 6, 8, 50,194, 22, +138,229,253,250,111, 72,127,241, 75, 17,141, 47,149, 74, 24,105,198, 29,117, 36,249,113, 45, 90,225, 21,134,128,140,251,108,208, +230,196, 42, 51,200,126, 68,233, 66, 75, 19,184,225,120, 0,149,225,104, 60, 66, 61,122, 51, 43, 77,180,139,133,185, 70,183, 30, + 75,177, 50,157,139,169,108,193,238,217,180,177, 31,197, 18,185,213, 3,169, 6,148, 41, 40, 55, 79, 29,106,229,210, 6,161,171, +209, 57, 41,223, 44,255,109, 30, 2,154,195,217, 1, 28,224, 58, 25, 60,249,232,250, 54, 11, 1, 32, 12,125,142, 46, 87, 52,102, + 9,163, 11,135,235,155,159,158, 63,178,107,164, 81, 37, 21, 29,180,153,252,180,221,183,117, 38,229, 14,113,250,164, 97,245,230, + 86,221,206,250,179,183,181, 65,179, 90,171,222,191,187,242,225,203, 70,229,211,203, 4, 86,111,176,197, 85,214, 60,100, 77,168, +120,246, 25,131, 28,127,135,177, 95,140, 29, 51,214, 75,160, 91,154, 64,223,101, 9,249,176,115, 27, 63,171, 0, 55,244,204,117, + 71,163,254,235, 39,207, 31,175, 61,101, 13,199,177,219,112,181,118,235,212, 13,130,207,155, 91, 47,214, 43,187, 63,182, 31,174, + 62, 58,178,155,155,239,223,221, 91,121, 80,121,181,182,184,188,116,123,121, 41,104,247,181, 91,121,121,158,181,159,181,157,189, +221,254,112, 56,216,238, 66,124, 18, 29,247,227,215, 55, 99, 40,102, 60,212,215,132, 91,128, 27, 83,216,239,240,168,166,143,181, + 1,164,210,145,220, 94,196,106, 82,214,145,177,154, 70, 52,116,148, 14, 76,209, 7,158, 96, 0,133, 87,236, 18, 74,205,165, 75, +122, 45,161, 22,139,145,133, 87,213,241,114,205, 38, 94,114,140,172, 1,153, 74,219, 21,178, 75, 22, 82,144,208,105, 9,227, 69, +221, 27,153, 25, 36,181,133, 94, 74, 42,190, 94,176,221, 83,123, 92, 56,150,167,206, 76, 32, 3,150, 20, 76, 83,170, 6, 42, 84, + 4, 74, 51,126,146,185,154, 34,142, 14,251, 39, 0, 97,215, 14,219, 68, 16, 68,119,239,103, 59,118,144,147, 56, 82,148,159, 66, + 26, 20,137, 6, 20, 33,154, 8, 5, 33, 68,129,168,168, 17, 61, 2, 82, 82, 80,208, 80, 81,128,148,130,130,158,130, 2, 10,232, + 9, 10,161, 75, 5,162,161, 33, 38,113,126,216,241,231,108,223,221,122,119,153,157,221, 61, 59, 6, 9,251, 36, 75,150,229,251, +236,221,204,155,153, 55,111,188,255, 50, 35,165,157, 72,109, 90, 81, 48, 69, 99, 81,167,138,206,237,220, 59,233, 90, 3,161,198, +192,137,196, 23, 62,196,143, 61,166, 26,241, 99, 46,186,156, 67,100,151,165, 65,226, 38,224,252, 98,197,135,227,224, 9,192,246, + 79,229, 38,225,236, 26, 44, 82,140,102, 86,143,120, 20,211, 14,118,202,187,166, 87,193,246,160,186, 62, 63,168,237, 33, 35, 85, +121, 48,142,190,147, 73,165, 3, 30, 39,137, 48, 42, 17, 92, 24,207, 46,116, 94,116, 32, 96, 17,127, 87, 25,104, 31,137,167,208, +214,145,150,128, 63, 4,246, 41,177,110,199,152,196,127, 22, 79,164, 51,164, 48,153, 2, 65, 66,102,138,115, 71,205,125,157,126, + 85,196,130, 32, 7,151, 43, 67,131, 40,105,199, 74, 1,205, 96,122,213,178,148, 43, 52,193, 48, 89, 5, 33, 44, 81, 98,142, 70, + 74, 95,205,249,243, 24,202, 29,129,221,103, 76,118, 35,209,137,248,232,136, 51,145,205,140,229,178, 95, 42, 21, 37,136,141,113, +184, 59,160,204,144, 38,233, 18,219,222, 38, 17,191,113, 91,233,205,162,231,242,108, 37, 78, 56, 73,151, 38, 25,215,153, 80, 86, +159,196,220, 13,104, 16,118,105,140,100, 45,223, 85, 41, 26,162, 88, 63,166,131, 75,169,199,153, 26, 56,216,125,167,214,172,246, + 56,211, 84, 90, 0,182,112,203,130, 97,202, 6,106,174, 19,206,215,118,169,161,168,167,236,127,233, 12, 16,153,125, 55,128,189, + 98,163,191, 60,168, 87, 48, 49,149,206, 79,236,227, 36, 61, 81,150,219, 53,154, 25,155, 14,227,118, 24,135,240,119,103, 70,138, +106,170,134,173,112, 40, 98,126,170,172,129,171, 9, 54, 55,134, 35, 68,217,178, 30,239, 53, 59,141,102,212,130, 16, 60,102, 17, + 4,148,197,124,177,147,132, 76,241, 12, 89,163, 93,135,207,241,209,241, 38,132,228,234,144, 20,103,107,161,180, 80,174,149,225, + 14, 84,179, 19,113,198,137,113,228,130, 84, 78,246,125,207,253,221,170, 37, 0, 62,176, 88,167, 39,195, 8, 0,110,146, 30,213, + 15,177, 82,141, 20,103,117,135, 59, 16,187,248,190,223,137,218,112, 98,135,141,195, 82,113,178,224,229,118, 79, 42,186, 12, 12, +225, 2,186, 81,205,233, 32,186,115, 36,146,252,230,165, 91, 43,107, 87,165,106, 9, 34,143,214,201,155, 23,175, 23,207,174,175, + 61,189,143, 30, 60, 38,151,239,146, 87,132,100,102, 9,155, 37, 13, 66,106,104,225,127,226, 86,134,109,135, 84,191, 18,185, 69, +196, 51, 68,252, 57, 98,106,177,168, 60,227,122,177, 74,149,192,162, 39,224, 23,245,101,255,246,227, 59,169, 52,246,118,126,205, + 44, 45,144, 98, 97,154, 76,193,151, 55,170, 43, 60, 12,183, 55, 63,173, 46, 47,143, 79, 22, 23, 47,158,191,253,224,206,133, 43, +203, 25, 47,243,242,201,243,173,205,237,123,143, 31,150, 43,187, 75,243,231,230,167,231,174,175, 94, 35, 45,178,193, 62,191,125, +255,238,227,198,135,185,177, 82,143,245, 50, 94,182, 17,181,244,120, 83,174,223, 20,105,230, 84, 63, 99, 26, 14,153,206, 26, 68, +236, 66,203, 90,184, 40,121,106,201, 35,166,247,206, 76,215,144,166,114,233, 12, 60,216, 34,101,180,209, 65,107, 56, 96, 21,251, +102,242,148,102, 87, 26,217, 96, 37, 40,133,140, 52, 31,228, 1, 86,162, 8,185,149,122, 71,126, 62,237, 43,181,247, 77, 15,252, +228, 56,172,106,100, 64, 79,115,215, 29,174,103,152,234,182, 6, 9,207, 72, 33, 40,213,218,199,137, 96, 67, 49,191, 10, 53, 17, + 97,192,130,141,102,243, 77,165,216, 58, 92, 32, 76, 95,127, 4, 96,236,218,117,156, 6,162,232,120,108,199,175,132,205,138, 32, + 37, 2,241, 40, 16, 44, 5, 21, 5,162,162, 7,209, 64, 75,197, 39, 80, 82,130, 16, 21, 84, 72,124, 3,191,128,132,168,160,216, + 21, 5,210, 74, 11,236, 18, 65, 54, 18,210, 46,144,135, 54,142,147,177,135,123,238,120,178, 6,133, 71, 10, 43, 69,156,196,206, +205,204,185,143,115,206, 31,241,187, 91, 97, 10, 44, 76, 57, 12, 97,209,229, 83, 28,120, 62, 7,154,109,119,185,199,165,204, 19, +159, 21, 5, 2, 25,196,126, 28,122,180, 10,197,117, 47,129,244, 10, 6,225, 32, 39, 0, 7, 59, 41, 34, 15, 29,186, 73,158, 21, +232, 22, 58, 7,179,116, 14, 61,100, 88,132, 82,224,210, 66, 63, 86,227,130,123,162,198,209,156,107,178, 60,129,138,171, 83,216, + 28,216,222, 1,214,116,186,132,146, 76, 25,102,255,219, 82,145, 89, 23,135, 70,222,197, 95, 40, 92,186, 66,237, 21,203, 86,118, + 58,174, 70, 71,193,131,248,229,148,223,201, 82, 82, 44, 21, 99, 46, 55,111, 66,106,202, 81,214,138,197, 12, 63,177, 4, 77,129, + 35, 70, 20,156,178,109, 36,185,241,239, 50,114,101, 11, 63, 8,187, 7,158,134, 26,165, 75,241,237,175,157,109, 23,113,148,209, +221,194, 72,182,158, 43, 61,201,138, 73,170, 58, 73,176, 86,111,188,248,244,121, 60, 87, 39,188,160,223,223,133,234, 33, 99, 33, +186,173,105,165, 80, 99, 50,243, 69,105, 86, 86,202, 53,177, 41,220, 58,236,159, 44,197,152,145, 64,221,135,238, 77,205,149, 73, + 32,143, 53,100,205,235,108,246, 6,133, 85,100,205,217,226, 3,165, 49, 83, 58,100, 73, 15,138,117,130,171,161, 31, 42, 90,227, + 9, 53, 75, 86, 0,118, 28, 74, 48,120,106, 39, 55, 93, 17,199,142,192, 20, 6,199,234, 82,223,147,255, 65, 80,158,224, 78,140, +210,214,215, 82, 50,159,151, 94, 23,213,146,122,216,200,102,233,104, 58, 50, 70,151,173, 70,107, 15, 54,152,214, 75, 30,130,248, + 16,228,178,220, 88, 4,146,201,228, 69,169,219,170,245, 50, 55, 49,102, 48,161,226,234,187, 65, 28,196,105, 54,157,171, 41, 16, +133,118,106, 94,200,163,250,148,154,156,234,125,235,153, 6,137, 85, 12, 55,179,163,136, 62,202,172,234, 33,182,103, 7, 22,146, +185, 81,176,162, 15, 70, 83,212,245, 89,102,146,167,163,192,135,130, 44, 0,204, 26,121, 24, 13, 52, 50,142,144, 40, 76,232,106, +211, 57,251,250,130, 20,214, 0,201, 75,186,214, 39, 20,128,255,220,233, 11, 47,251,239,214,119, 54,170,209,246,229, 85,247,228, +213, 51,252,244,136,184, 54, 20, 79, 45, 82, 95,225,221,219, 65,229, 5,191,247,190, 16, 20,206,180, 56, 60, 23,226,201, 93, 33, + 30,131,121,162, 77, 13, 15,143, 80,122,148,125,239,167,147,128,178,237, 40, 78, 41,126,178,131, 59, 55,110,223,127,246,104,252, + 99,152,207,138,102, 45, 2,191, 55,142,154,171,205,239,221,221,139,151,175,188, 89,127,125,188,221, 81,174,152, 43, 69,112,127, +164,178,135,247, 30,108,189,253,120,235,250,205,205, 15, 91,239,187,219,219, 95,119,250,123,221, 5, 48,186,212, 62,191,146, 52, + 38, 89,218, 12, 86, 6,147, 33,109,201, 72,240,133, 50,137, 32, 45, 7,171, 73,107, 48, 29, 25,149, 9, 48,109,112,116, 43, 72, + 76,179,103,140,178, 14,125, 69,165,159, 42, 74, 27,106,171,128,183, 88,160, 17, 97, 44,111, 96,133, 37,243,202, 76,203,127,104, +229,219,183,214,214, 19,142,191,132, 54, 90,129, 6,101, 87, 7,117,254,213,207,171, 40,235,154,144,180,198,159,129, 27,229,140, + 92,173,194,157,153,109, 61,116,247,131,151,161,244, 64,143,168, 84,129, 23, 72,212,212,103,126, 10,192,215,213,235, 54, 17, 4, +225,221,189, 91,223,157, 29,199, 33,182, 33, 5, 33, 74, 68,210, 80, 32, 94,128, 71,224, 5,120, 11, 74, 10, 10, 10, 74,106, 26, + 26, 10, 30, 0, 42,168,144,160,167,136,144, 18, 5,145,132, 8, 43, 56, 63, 64,236,156,189,183,183,183,204,204,238, 58,150,108, +197,178, 44,123,117,231,187,211,236,206,204,206,124,243, 77,204,174, 11,187, 79,156,119,255,233,186, 65, 5, 8, 77, 20,106,165, +108,200,216, 58,133, 71, 88, 43,194,138,240, 18,100, 82, 42, 81,136, 42,170, 9,228,113,197,150,113, 52,149, 75,163,178, 90, 61, +227, 41,242, 24, 34, 51, 3, 56,116,250,178, 24,230, 5,210, 7,142,204, 8, 87, 17, 9, 13,182,113,221,122, 59,145,181,129, 30, +212,240,111,224,120,139,213,251, 24,202,119,141,200,141,245, 20,252,214,135, 14,152,103,204,154, 90,183,252,250, 68,106, 52, 67, +174, 25, 52, 59,107,165,173,139,241,191,160,220, 39, 93,168, 88, 52, 99, 45,231, 21,151,217,137,127, 90,178, 18,238, 85,198,201, +250,205,205,221,222,118, 40, 39,112,238,155, 17, 19,218, 7,102,111,119,214,127,157,253,144, 68,153, 11, 78,101,100,171, 78, 34, + 70, 32, 78,195, 27,177, 72, 19, 19,151,151,160,135, 7, 10,246,179,165, 47,157, 70, 40, 55, 95,205, 26, 95,246,123,251,231, 67, +112,225,147, 38,127,176,177, 88, 40,236,180,135, 76,147,218, 40, 77, 86,177,172, 70,218,230, 6,115,173,121, 8,190,235,192, 70, + 4,223,255, 82,196, 70, 34, 25, 61, 90,242,166,100, 32, 30, 85, 98,125, 95, 34,209, 77, 63, 58,183,235,221,227,141,174,252,142, +205,118, 16, 81, 67,251, 84,228,170, 23,174, 86,132,226, 47,130, 98,241,196, 5, 72,185,120,203, 82,153,129, 51,171, 80,225, 98, +172, 90,138,120,181,179,122,120,122, 0, 39,183, 27,203,167,195, 19,208,167, 50,138,177, 17, 37,229,187,224,160,118,163,253,123, +216,231,100, 2,157, 76, 42,151,142, 97, 54, 31,227,108, 89,170, 47,101, 50, 67, 26, 50, 4,156, 12, 29,159,176, 91,197,205,180, +165,176,247, 72,160,154,100,142,220,213,174,117,214, 16,187, 70,195, 53, 17, 83,120,183,154,102,155,240,124, 26, 92,140,171, 66, +231,133,147, 84,183,117,171, 33, 27,135, 39, 7,212, 67,156,237,247, 15, 5, 85,252,187,106, 22,138,210, 27, 87,234,130, 64, 70, +173,148, 46, 28, 80, 84,248,118,108,120,189,145,202,115, 42,103,207,226,236,238,202,230,183,159,219,139, 73, 29,153, 24, 4, 5, +115, 25,239, 46, 44,195, 67,221,233,172,237, 29,239,193,236,128,185,151, 36,201,159,193,153,241,176,105, 27,208, 19,209,168, 82, + 53,203,118,143,118, 60, 51,110,184,247, 15, 95, 63, 62,127,242,226,217,203,167,140,117, 89,155,177, 38,137,249,130,177, 77,146, +171, 9, 63,123,100,201,193, 16,108,193, 73, 43,158,113,128,107,138,210,224,107, 92,149, 41,140,136,136,202, 71,200,240,136,248, +245,187, 55,240,150, 52, 97, 30, 63,124,212,108, 45,188,122,255,118,145, 37,176, 24, 47,108,190,117,255, 94, 49,143,137,246,243, +206,167,217, 65, 16,116,123,225, 6,236,180,180,214,253,162,143, 92,213,168, 98, 76, 61,170, 43,152,170, 6,220, 62,137,173,154, + 4, 53, 28,137,168, 9, 76, 28,163,197, 23,161,158, 29,179,237,160,121, 52,122,119, 66, 19,188,223, 16,184,154,103,105,154,171, + 1,103,147,109,185,157,223,169,205,121, 17, 30,142, 98,130, 77,224,215, 81, 80,249, 44, 84,160, 9, 99,222, 67,241, 1,242,128, +117,228,211,128,160, 43, 98,199, 57, 74,130,160,123,194,105, 87,120,130,136,174,143, 36,154,149,154,142,225, 91,207,134,237, 24, +229,201,133,199,237,160,225, 87, 76,174, 14,220,232,243,171,180,224,204,127, 1,248,186,154,222,166,129, 32,186,187,222,117,156, + 56, 37, 31,141,160,237, 5,169,128, 4,103, 14,156,249,121, 72,136,191,192,141, 63,212, 11, 20,137,143,170,105,229,196,169,219, +216, 78,236,216,187,203,204,108,236, 54, 17,173,148, 91, 34, 71,222,143,183,111,102,223,188,145, 79,128,123,219, 53, 91,108, 31, + 77,137, 64,230, 18, 6,232, 6, 35,154,131,216,221,100, 10,215,154, 22, 49, 2, 19, 3, 28,205,156, 69,109, 1, 91, 84,165,107, +201,177, 31, 92,135, 43, 24,211,187,213, 2, 54,164, 14, 6,100,142, 42,201, 75, 70, 58,189, 58,137,243,181, 6, 20,128,189,192, +128, 10,240, 33,239,158,132,199,147,254,120,154, 93,207,215, 51,197, 37,118,227, 52, 48,159,165, 54, 30,229,118,237,224, 96,146, + 22, 75,234,127,102,218,238,131,118,103, 98,237, 94,179,145,125, 79,205,255, 77,170,239, 5, 28, 15,158,205, 3,251, 80,206,118, + 18,107, 79,156, 25,173,169,240,253,213,247,179,238, 56, 89,199,223,175,206, 90,247,133, 7, 17, 18,107,234,200,108,156, 92,194, +228,172,224,104,180,182, 79, 51,242, 59,195,234,196,174,176,201,218, 72,175,142,242,248,227,135, 99, 27, 98,167, 39,230,105,146, +207, 11, 94,138,139, 69,114, 22,207, 2,169, 2, 37, 86, 69,137, 69,139,134,111, 80,213,142,125,180,123, 10, 32, 4,165, 2, 69, +197, 54,149, 46, 52,222,135,148,154,173,145, 50, 97,198,198,111, 42,184,130,134,206, 11, 90,122,146,132, 55,181,230,232, 9,135, +205, 56,121,158,177, 87, 47,184, 84,225,207,168, 64, 96,167, 14, 30, 24, 4,248,157,158, 63, 72,178,152, 86, 29,194, 60,112,119, +228,183,232, 17,225,196,127,122,212, 27, 28, 13, 79,126, 69,231,240,255, 23,241, 95, 55, 86, 68,253,137, 22,176,186,157, 13,248, + 65,180,140,152,235,253,183,141,169,249, 65,119, 4,152, 14,180,125,150, 34,238, 47,242, 69, 32,187, 84, 6, 40,240, 2,214,181, +182,225,104, 80, 12,136, 9,240,236,123,157, 48, 8,111,243,196, 41,246,199,189,201, 69,252,199, 90, 87,134, 14, 4,137,187, 11, +164,214,189, 99,235, 4, 66,201, 19,231,202, 72, 39,176,185,190,141,200, 24, 18,227, 7, 96, 25, 82,170,178, 92, 43, 21,148,213, +218,208,190, 11,252, 46,188, 33, 32, 59,137,246, 24,111, 24, 35,138,208, 5,197, 37,130,167,101,238,209,179,243, 34, 63,191,250, + 1, 28,159, 60,132, 73,104, 79,225,196, 60,187, 1, 62, 56, 77, 46,145,217, 96, 53, 83,138,166,178, 64,193, 55,233,182, 88,183, +105, 44, 9, 99,254,114, 56, 57, 25,140,151,243,204,151,170,198,170, 75,180,167,186,154, 78, 79, 79,223,184, 66,108, 0, 94,252, +140, 25,123,215,220, 25,109, 8,241,225,179,160, 57,246, 8,238,155, 44,200,158,119, 7,188,233,235,195,231,179,187,196, 29, 96, +192,177,180, 81,195,142, 15,219,118,121,147,124,254,242,233,232,253,219,175,252, 91,127, 52, 52,240,133,237, 84,181,246,173, 79, +118,170,100,149,160,235,199,124,156, 80,171, 42,123,139,244, 38, 45, 86,253, 78, 24,101,183, 5,181,204, 46,117, 5, 27,188, 48, + 85,137,182,163, 24,179,135,234,217, 48, 28,193,138,198, 85, 34,125,129, 12, 79,114,236,253, 78,154, 42, 83,115,173, 44,185,116, + 3,185,192, 37, 88,139, 94,128,206, 37,124, 35,182,206, 19,220, 29,178,102, 55, 95,226,246,189,177, 13,207,135,209, 59, 60, 56, +140,239,230, 66, 8,182,147,207,121,200,190, 77,155,134,119,153, 50,135,236,198,213, 72,109, 69, 47,172,145,135,240,125, 37,133, +221,225, 16, 77,165,136, 91,224,198,161, 60,156,166, 20,163, 61,166,221,184, 39,149,141, 98,158, 2,113, 12,247, 49,124,212,173, + 62,135,128,254,159, 0,124,157,219,110,211, 64, 16,134,125,196,174, 93,210,186,180,161, 21, 18, 21, 23, 72,136, 27,170, 94,129, +196,203,160, 62, 15, 87,220,242, 52,220,150, 7, 64, 2,132,138, 82,165,165,173, 19, 39,196,235,117,246,192,204,172,215,135, 6, +136,172,220,228, 32,203, 94,207,206,254, 59,243,253,193,191,131,123,183,185,218,178,221,141,248, 78,114, 42, 33,144, 72, 0, 39, +121, 23,231,138, 86,215, 87,198, 65, 74, 27,214, 35,238, 7, 70,240, 78, 22,152,101, 93,230, 85, 94,114, 36, 53, 23,245,130, 42, +223,209, 59,156, 42, 68, 96,106, 14,211, 7, 41,172,223,179,120,132, 13, 65, 1,100, 47, 15,247,147, 44, 9,227,181, 82,227,248, +113,236, 37, 87,108, 10, 15, 81, 72,206, 31,144, 98,194,220, 14,227, 58,199, 4,199,148, 70, 25,192,218,102,188,246,238, 57, 5, +246,195,186,133, 48,245,127,101,132, 96, 92, 28,113,140, 26,253,127,243,220,193,111,251,159,245,255,188,169,148, 15,104,249, 46, + 9, 68,179,100, 51,194, 57,180,250,175,106, 41, 34, 29,236, 13,101,238,106, 73, 81, 39,177,107,235,128,174,115,160, 48,188,194, +232, 77, 93,121,117,241,253,104,255,240,224,209,222, 45,175,165, 80,137,231,127,186,184,252,122,151, 39,129,159,250,218,173,126, + 51, 88, 21, 81, 83, 10,185, 17,171,128, 54,112, 34, 20,124,116, 8,151, 46, 10, 43,200, 16,164,179,226,114, 27,155,209,213, 82, +209,205, 51,253, 86,246,128,220,187, 36,164,252, 22,230, 79, 72, 21, 75, 33,100, 19, 25,181,226,234,105,198,127,252, 18,138,138, + 75,124, 34,173, 74, 81, 23,242,166,171,127,161, 72, 25,249,240,228,215,164, 45, 56,105,180, 83,176, 57,195,254, 26,215, 86, 59, +224,208,198, 62, 50, 82,243,165, 20,182, 8,194, 49,186,138,182,169, 3,185,190,168, 98, 53, 55, 20,111,136,185,175,159,191, 57, +255,118, 46,101,219,131,166, 45,198, 9,238, 90, 77, 32, 51, 23,146,193,186,172,141,157, 0, 60, 52, 57,187, 53, 80, 73,221,124, + 83, 14, 42, 29, 60,111,111, 43,139,163,120,114, 55,177,183, 87,165, 81, 74,109,235,144,204,115, 42,210,146, 48, 80, 9,203, 24, +238,164,187,211,188, 36,131, 8,211,107,131,231, 73,126,136,200, 44,178,164, 58, 88,139, 58,163,116, 84,148, 5,118, 96, 34,153, + 0,217,200,108,205,145,175,226, 17,239, 1, 43,199, 76, 43,184,134,217,120,197, 16,179,172,154,245,178,193, 46, 53,180, 38,223, + 74,183, 16,230,224, 36,223, 30,191,252,114,243, 19,209,123,126,211,149,122,118,246,238,195,251,143, 70, 98,113,182, 73,135,135, + 49, 52, 33, 89, 6,206,166,117, 91,122, 65, 43, 53,152,201,153, 99,125,148,189,126, 31, 72, 28, 6,167, 71, 79,102, 21, 90, 20, +174,117,215,116, 39, 72, 6,129,197,232, 46,117,170,113, 3,243,114, 16,108,164,140,209, 23,185,143,146, 55,253,255, 94, 51,190, +248,124,189,248,219, 39, 77,237,166,235,199,144,132,204,235, 57, 28, 7,217,171,195,241,201, 90,230, 82, 92,251,100, 84,232,135, + 17,196, 52,244,236, 19, 76,224, 82,201,211,100,205, 33,181, 40, 33, 33, 83, 12,231, 0,101, 97, 92,180,195,225, 81,104,186, 39, +152, 40, 43,226,224, 80, 16,194,236,153, 91, 19, 37,199,154,235,169, 62,139,176,137,213,198,145, 85, 53,143, 48, 28,199,227,103, +211,252,178,150,220,213,238,112,123,207,209,195,188,125,192,150,236,106, 35, 27, 36,253, 70,136,119,155, 16, 37, 55,230,133,110, + 39, 29, 33, 96, 88,158, 32,101,111, 35,209,253, 35, 0, 97,215,178,219, 52, 16, 69,231, 97,123,156,230, 33, 64, 66, 44, 0, 5, + 85, 66,116,135,216, 84,252, 6,236,248, 14,190,162,124, 3,127,194,138,125, 89, 32,177, 1, 82,164,180,149, 32, 14,109,169,113, + 98,123, 50,158, 97,238,189,142, 51,105, 16,100,145,101,228, 36,227,235,115,207, 61,247,156,136,109, 96,227,214,172,153,111, 5, + 92,180,209,201, 8,222,219, 18,239,107,136, 70,228,190, 22,219, 59,188,201,129,183,241, 32,207,183,159,125,217,239, 39,123, 74, +246,250,145, 18, 16,134,231,159,231, 69,174,127,131,131,160,239, 1, 45, 80,209,218,195,157, 21,124, 44,218,120, 73, 37,227,145, +236,137,100,168, 32,212,188,151,196,137,199,149,145, 76,180,181,216,159,201, 94, 60,124,162, 70, 89, 61,155, 47,102, 49,139,157, + 32,131,124, 15, 17,133,107, 39, 24,102,231,171,176,176,178,187, 45, 71,124,190,230,160,108,128,167, 55, 66, 83, 52,129, 34,215, + 89, 30,116,103,225,200,244,111,138,199, 80,219, 78, 94, 80, 24,200, 37, 58,101,204,102,130,205, 59, 31, 78,214, 78, 47,108,233, +108,202,128, 43,215, 4,173,168,153,197,102,250, 78,204,110, 15,226, 81, 42, 7, 96,142,110,142, 63, 76,206,125,103, 26, 69,215, + 90, 47,128,167, 1,172,230, 32,202, 21,114,163,140,146, 46,130, 77,137,218,250,182, 73,164,146, 21,208,200, 66,165, 6, 31, 78, + 72, 82, 4, 95,112,205,228,170,241,213, 94, 38,232, 68, 93,130,194,201, 86,208, 39,178, 61, 1,208, 94,225, 3,205,248, 70, 10, +247,203,116, 3, 20,252, 48,145,198, 35,166,134,223,187, 21,253,184,182, 49, 85,105,206, 86,232, 2, 99, 37, 26, 22,208, 76, 67, + 50, 80,224, 96, 98, 3,176, 22,186, 34, 87,238,237,145,180, 43, 40, 93,171,219, 32,115,193, 15,136,148,188, 4,145, 17,217,105, +210,217, 7,124, 61,153, 77, 72, 39,192,130, 54, 86,180, 59, 86, 2,213,112,208,234, 14,212,160, 54, 53,162,251,221, 20, 46,167, + 34, 5, 45, 26,221,202,214, 93, 46, 46,199,189,113,240,196,198,193, 1, 0,112,237,120, 59,155, 45, 77, 89,193,206,186,251,142, +123,170, 22, 27,244, 69, 77,127, 23,215,198,116,183,144,105,181,174, 22,185,117, 59, 72, 71,249,242, 87, 26, 43,200,113, 54, 90, + 91, 35, 26,209, 72,158,128,127, 39,250,116,118,108, 43,169,160, 49, 48,145, 8, 9,209, 5,194, 83,248, 3,103,167, 23,217,235, +151,175,166,243,243,119,211, 79,116,181,135,251, 79,239, 31, 60, 58,122,123,132,205, 88, 2,135,134,224,195, 18,223,159,173,191, +213, 25, 99, 25,146, 51,224, 65,195,218,131, 6,246, 18,155,227, 60, 74,210,207, 63,179,188, 42, 85,172, 12,102, 20, 1, 62, 4, +185,150, 68,141,147, 77, 31,239, 79,223, 31,147,171, 19,185,208, 99, 36,125, 3,218, 23,107, 82, 25, 85,255, 43,241,255,126, 61, +184,123, 80, 20,217, 69, 1, 73,170,243,171,143,253,241,139,135,207,223,212,249, 23,177, 56,129, 37, 72,127, 20,231,103,166,202, + 93,126,194,202,175, 16, 88,227,175, 10,130,215, 26, 65,219, 78,228,112,200,108,199,152,220, 20,203,180,194, 16,187,182,105,228, + 87, 75,116, 43,131, 65,152,109,101,236, 65, 53,224,220,117, 44, 94, 39,201,115,157,231, 35,115,167,217, 55, 75,125, 33,223, 98, + 6,110, 24,247,216, 64,123, 23,224,193,181, 16, 38, 44,241, 34,224, 32,236, 14,171,179,253,208,104,192,135,188, 35,164,218,234, +253, 71, 0,202,174,223,197,137, 32, 10,207,204,206,206,102,243,227,146,179,136,114,156, 86,222, 63, 96, 33,130,104, 97, 33, 28, +216,216, 93,163,224,127, 96, 97,101, 99,103, 41, 22,214, 86, 90, 92, 39,135, 88,216,139,141,156, 65, 17, 4, 65,114,162,160, 57, +127, 36,187,155,219,236,102,103,198,121,111,102,147,221,200, 21, 54, 33,236,194, 6, 38, 59,223,123,223,188,239,125,143, 87,251, +152, 86,192,189,138,236,149,226, 42,142, 67, 6,192,129,136,161,136, 11,145,134,181,115,194, 5,225, 6, 40, 66, 22,130, 24,192, +227,154,178, 28, 44,173,180,206,129,132,134,140,107,132,173,220,121, 17,154,220,137,217,146,253,156,128,209, 32,160, 53, 55,168, +106,178,125,127,141,232, 30,252,164,111, 46,154, 52,204,167, 94,147,138,134,175,142, 84,113, 42,220,104,178,112,152, 28,248,138, + 3,132, 73,236,205, 39, 57,170, 40,153,170,175, 4,173,233, 29,157,143,124,105, 43, 22,160, 49,164, 61,135, 40,121, 13,163,139, + 29,196, 22,150,157,255,234,213,201, 49,212,179,142,240, 64,240,209, 42,195,171,187,250,128,212,212,173,155,157,167, 10,223, 67, + 6,149, 59,179, 61,198,245,103, 11, 96,216,180,223, 36,235, 45,222, 9,120,161, 89,150,169,113,174,162,204,132, 76,153, 26,112, +194, 0,160, 49, 6,116,133, 23, 10,195,132, 32, 25,131, 73,175,112, 90,169,218,104,146, 20, 40, 61,147, 36, 46, 32, 74, 11, 79, +183, 60,147,233,171, 0,186,245,213,172,128, 91, 62,213, 13, 73, 4,213,179, 57, 0,154, 79,172,110, 20,214,213,124,118,209, 36, + 75,120,172,109, 16, 17,115,161, 36, 37,167,187, 98, 20,101, 4,154,149, 60,187,253, 13, 43, 15,120, 43,206, 99,156, 42, 75, 17, +248, 98,187,230,157, 70,167,223, 59,249,237,215, 87,165,138,122,141,130,210, 21,251,230,106,183, 6,166, 89,134,228, 97, 67, 50, +144, 18,167, 64,163,128,197, 40, 77, 89, 77,151, 22, 59, 12,170, 82, 74, 78,179,169, 73,156,225,205,163, 96,238, 17,207, 98,236, +151, 96, 86, 11,193, 17,223, 93, 7, 25,162,240,240,231,112,201,177,168,158,204, 38,196, 21,125, 43, 6,185,104, 32, 46,173,164, + 78,151, 39,252, 68, 47, 11,117,122, 57, 44,194,220,249,157,140,205,149,195,104, 4, 57,136, 89, 34, 33,176,157, 71, 93, 59,119, +245,213,199,215,115,176,143,128,199, 8, 38,172, 89, 22,181,239, 36,179,219,158, 89,105,133, 66, 58,104,178,165, 19, 97, 47,201, +146,195, 52,126,252, 98,239,201,221,251,122,179,183,251,236,249,246,141,235, 91,151, 46,108,159,191, 2, 97,133, 54, 32, 44, 22, + 24, 97, 36,158,151, 79,203,104,243,153,144, 31,248,174,176, 82, 59, 5,121,254, 66, 32, 71,173, 80, 21,200,133,148,220, 48, 21, +226,113, 37,155, 30, 40, 53, 97,146,189, 23, 20,114,222, 15,215, 73,155,191, 31,188,117, 38, 0,168,145,102,224,102,227, 4,107, +103,123,221, 47, 81,186,115,121,103,179,127,102,247,205,222,135, 79,251,255,139,239, 7,223, 7,143,238, 60,189,253,224, 22, 14, +207, 33,195,193,195,173,155,247,214, 54,250, 69,116,145,100,113,145, 37, 65,242,135,180,154,202,203,211,119, 47,229,104,104,139, + 51,234,104,170, 97,114,101, 42,167,145,154,140,138, 60,150, 38,139, 65,100,150, 90,211,234,228, 30,247,103,210,197,206,119, 3, +220,168, 92,214, 42, 43,103, 52,214,111, 89,215,125, 14, 92,191, 81,121, 26,195,232, 49, 39,183,174,161, 10,167,117, 47,139,185, +246,170, 45, 19, 88, 89, 71, 29,226,173,115, 7, 43, 29,200,106,121, 73,205,239,176, 50, 31,169, 38, 10,253, 43, 0,101,215,174, +219, 68, 16, 69,103,102,103, 31,126, 36,150, 19, 68, 20, 3, 49,162, 67, 80, 4, 41, 5, 66, 2, 87, 20,124, 12, 63, 65,193,223, + 32,196, 67, 41,120, 20,180, 68, 72,137, 4, 69,138, 88, 50, 80,224, 36, 38,246,250,177,222,245, 60,152,123,103,199,222, 56, 17, +136,210,146,189,146,119,103,239,156, 57,247,220,115,248, 18,167, 83,132,183, 46, 36,143,205,221,128,145, 81,197,177, 85, 26,218, + 33,218, 8, 92, 98, 0, 84,113,240,147, 50,168, 17,146, 54, 2,212, 23,166, 74, 4, 26, 9, 37,204,243,240, 41,157,152, 98, 74, +117,232,209,136, 85,192,216, 15,105, 43, 78, 60,235, 28,224, 65, 17, 1, 49, 37,148, 62, 69,135, 50, 99, 51,223,148,179, 33,160, + 33, 22, 66,107,133,149,152, 65, 62,222, 88,100,155,213, 13,243,147,206,176,205, 41, 15,204,153,196, 51,187, 55,103,176, 53, 96, +238, 16, 93, 12,243, 23, 42,174,219,168,108, 90,139, 82,101,191, 50, 82,177, 21, 77, 47,190,175,116,161,170,211,249, 6,203,206, +233, 43,232, 95, 90,182,244,146, 49, 96,230, 48,128, 70,207, 69,184,167,158,243, 82,182,110,105,190, 84,177, 80, 99,167, 92,156, + 63,158, 58, 33, 87, 12,108, 55,183,204, 84, 98, 83, 43, 51,112, 68, 52,127, 50,153,209, 48, 34, 27,202, 75, 81, 92, 98,224,177, +231,145, 90, 8,177,193, 32, 91,196,181, 3, 17,194,184, 49,143,103,182,163, 69, 39, 2,156,100,220, 32,131, 1,212,240, 56, 3, +180, 90, 46, 83,128,234,150,175, 16,192,200,211, 41,240,153,180,132, 9,149,153, 36,229,144,150, 80,161, 89,139,168, 1, 73, 30, + 24, 69,178,122,141, 29, 30,179, 68,216, 9, 20,133, 52, 20,155,138,132,185, 27,143,172,136, 53, 44, 34,227,233,232,251,241,164, + 32,120,191,216, 3,153,139,123, 73, 33,108, 15,144, 88, 2, 94, 17, 32, 97,225,102, 63, 7, 20, 73,208,143,199, 17, 73,122, 89, +139, 90,132, 58, 66,137,209,116,100,205,166,226,228,236,218,218,141,238,160,139,242, 11,221,188,122,171,125,114,100, 87,181, 99, +223,216,162,193,174,237,241, 27,131,146,114,133,155,123, 53,148,155,105, 96,249,188,122, 78, 81,234,229, 63, 37,109,109, 48, 37, + 27, 89,120,180, 39,210, 73, 54,221, 90,111,118, 78, 58,239,247, 63,128,191, 13, 8,133,224,186, 1,247, 51,232, 9, 59, 83, 82, +101,249,118,232,163,120,129,111, 10, 43, 68,149,113, 30,167,113, 37,170,154,139,183,251,189,167,207,158,239,108,223,110, 60,184, +243,110,119,247,225,163, 86,151,100,181, 96,125, 32, 70,128,156,108,125, 55,207,181,129,139,201,190,238,107, 8,222, 83, 72, 80, +115,116, 72, 47,151, 59, 3,109, 5,211, 81, 17, 11, 87,194, 16,219, 15,112, 84, 55, 96, 28, 79, 15, 56,130,193,152,121, 35,107, + 37,144,180,191,124,243,182, 12, 21,192, 46, 99, 56,164,112, 16,126, 81, 41, 73,107,235,174, 94,105, 30,245,126,244,102,253,175, +159,190,236,127, 59,184,247,120,251,127, 75,252,222,225, 94,107,231,201,199,207,175,240, 83, 63, 30,255,188,121,255,186,185,190, +248,189,170,131,213,106,189,145,166, 96,191, 16,109,146,228,245, 11,121,118, 42, 6,167,233,217, 47, 57,236,101,147, 88,154, 3, + 22,242, 11,246, 48, 4,222, 39,204, 79,101, 34,117,158,172, 12,235, 21,193,187,147,143, 91,173,138,176, 2, 84,141,135, 47, 52, +117, 60,231,111,115,161,172,255, 91,187, 97,229, 45, 65, 80, 73, 33,177,146, 46, 53,253, 48,104,172, 2, 49, 9, 90, 22, 80, 60, +181,208,138,195, 24, 85,190,203, 20,140,221,149, 51, 48,215,139, 41,214,203,242,230,254, 8, 64,217,181,236, 54, 13, 68,209,185, +147,113,156, 52, 9,109,104,120,136, 22, 69, 66,108, 0,137, 29,127,193, 87, 32,161,110,251, 41,236,145, 64, 2,190, 0,137, 37, +172, 88,208, 5,170,216, 80, 68,165,166, 60, 90, 85, 84, 77,210, 58,113, 98,143, 99, 51,231,206,216,113,162,178, 32,171, 88,114, +172, 36, 51,190, 62,115,230,220,115,150,252, 9, 74, 73,196,110, 19, 86,209,156,153,227,254, 57,129,196,100,196, 39,177,189, 25, +187, 63, 10, 46, 86, 40,208, 24,125,171, 94, 99,163, 52,157,217,102, 15,130,137,184,116,145,170,133, 34, 85,113,124,132, 21,222, +120,108,219, 45,108,148,180, 84, 60,221, 85,149,119, 58,174, 85, 87, 64,221, 40, 3, 12,241,204,168,155,122,158, 65,170,188,234, +183, 87,227,171,195,168, 15,207, 86,208, 78, 72,231, 53, 56, 82, 59,223, 55, 42, 90,117,169,104,189,102,140,214,244, 91, 73,162, +199,105,136, 4, 34,235, 17, 78,214, 92, 41,115,132, 91,137,167,207, 55, 36, 36, 93, 66,159,205,115, 14, 23,159,155,229,120,175, + 98,117,103,255,110, 92,191,213,108, 79,167,131, 10,217,195, 89,146,205,214, 85,197, 12,102, 63,215,161,195,214,141, 49, 85,131, +196,186, 15,147, 93, 14,165, 76,135, 9,104, 90, 27,111, 40,161,184,128, 47,179, 89, 69, 53, 36,234,187,170,100,190,112, 94,141, +117,207, 90,139,155, 73, 45,214,148,210,121,240, 14,120, 24,130,130,213,254,134,134, 39,194, 68, 96,121, 36, 33,115, 52,103, 37, +169, 52,192,188, 93, 55,119,173, 12,176,182, 49,144, 13,254,101, 45, 31,163,110,134,168,225, 87,170,190,136, 19,140, 87,179, 38, + 87,188,170,167,226,120, 38, 61,226,233, 72,164,217,211,205,102,199, 47, 64,114, 86,186,167, 5,171, 14, 57,191,203,203, 94,112, +143,149,170,238,215,131,201, 5,148,206,169,237,138,149,182,196,179, 97,183,188,221,233,254, 58,253, 33,114,172,149, 50,108, 36, + 42,187, 65,185, 28,146,146,208,152, 74,205,198,116,212, 63, 54, 24,250,230,218, 70,172,245,193,159, 30,145, 35,244,210, 28, 20, + 21, 37,254,122,235,198, 32,186,208,113,100,111, 45,223, 51, 15, 56, 21, 68, 35, 89,190,137,242, 60, 29,146,255,216,185,231,159, +187,217,233, 14,130,179, 48,154,112, 2, 10,104,197,159,103,135,108,169, 36, 36,205,113, 91, 16,143,176,172,112, 57,101, 69,138, + 16, 62,100, 86, 63,231,227, 97,140, 88, 24,243,128,163,105, 56,170,154,153, 81,243,179,212,251,178,119,248,121,247,123,144,140, + 31,109, 60,108,119,186,162,214,126,189,243, 18,164,251,158, 16, 61, 33, 54,185,190, 23,237,118, 87,132,120,192,228,187,197,245, +218,241, 51, 48,186,207,177,144,249, 98, 30, 27,205,227,157,180, 13,191,206,177, 21,174,150, 73,120,239,238, 29,115,222,241,126, +175, 81,243,161,193,173, 72,100,140, 97,119,147,195,162, 4,125, 27,134,239,119, 95,185,203,221, 66,216,210,243,103, 47,158,110, + 63,249,175,250,254,246,195,155,173,199,219,121,125, 23,167,123,239,238,119,183,144,136, 50, 48, 7, 67,189,127,158,157,156,200, +163,223,211,157,143,193,215, 79,113, 18,206,208,196,173,205,244, 3, 35, 92,107, 78,162, 81,150, 71, 30,177,175, 95,230,114,246, +108,108,188,117,160,202, 17,133, 43,249,206,217, 15,127, 14,163,231,172, 32,208,201,137,230, 11,121, 69, 49,181, 88,205, 34, 47, + 77, 96,181, 23,151,188,178,208,153, 3,202,229,128,101, 64,243, 40,225,232, 62,135,122,236, 68,157,177, 43,174, 72, 74,216,187, +212,109, 74,185,170,101,105, 91, 96,249,245, 87, 0,202,174,165,199,105, 24, 8,143, 29,231,213,180, 37,203,150,135,246,176,128, + 56, 32, 14, 92, 56,172,196,149, 35,191,132,223,196,157, 95,194,111, 64,220,118,121, 8, 45,237, 62,219, 52,109, 94,182,241,140, +237, 52, 45, 39,122,168, 84, 69,105, 36,203,153, 25,207,124, 15, 49,100,231,194, 97,243,221,249,101, 59, 7, 37,172,113,236, 9, + 61,209, 36,176,102, 74,111,172, 58, 44, 7,137, 7, 94,244,216, 20,246, 56,234,108, 48,249,160, 41, 42, 89, 55, 91,177, 67,237, + 5, 84,180, 79, 62, 40,234, 43,136,196,174,201,149, 9,197,197, 76,242,224, 65, 26,196,121, 60, 34,139, 38,148, 32, 47,154, 54, + 11,195,204, 60, 26,109,100,216, 22,209, 84,250,100,124, 90,212, 75,179,122,157, 22, 10, 83,157,106, 20, 14, 6,200,158, 67,239, +132, 24,192,225, 13, 18, 54,153, 6, 83, 19,148,226, 36, 90,171,114,177,253,221,146,165,156,139, 61, 76, 9,128,129, 53,160,163, +182, 82,162,144,210, 9,170,177,125, 8, 37, 59, 28,109,239, 22, 91, 15,251,251, 12,252,236,130, 65, 87, 47, 99,242,105, 93,119, + 77,139,240, 46,120, 74, 62, 24,169, 71, 52,152,207,140,195, 56,226, 91,201, 74,224, 35,146, 56, 66, 56, 12, 67,216, 34,249,187, + 90, 67, 59, 88,119,128,125, 91, 50, 70,137,113,245, 8, 35,207, 81,170,109, 58, 10,243, 17, 98,134, 87, 53,122,121, 50, 43, 20, + 35, 76,166,212,141,210, 21,237,118,147, 6,114,102,182,151, 42, 59,156,243,153, 61,150, 68,172,150,202,132,105,243,172, 36, 50, +145,157,101, 33,111,200, 26, 11,179,189, 48,107,199,205,173, 89, 42, 2,242,195,205, 31, 64,102,110,105,129,132,197, 77,118,197, + 78,148,167,151, 14, 21, 33, 84, 28,142,209, 99,108, 96,241,124, 76, 26, 53, 61,249,206,102, 69, 83,107,151,117,105,182,122,158, +229,183,197,237,174,227, 66,219,222,228,131,159,139, 11, 90,217, 96,143,195, 58,172, 81,232,143,102,227, 71, 55,229,141,213,127, +181, 71, 54,237, 34, 62, 1, 85, 24,159, 47,255, 32, 63,148,236, 85,204,181, 52,206, 54, 77,249, 98,246,242,199,245,133,135,244, +192, 85,113,165,188,126, 9,182,221,219, 45, 21,132,186,215, 98, 36, 36,168,197, 72,106,178, 47,181,218,170,124, 15, 22, 71, 30, +115,223,231,231, 88,250,146, 92, 65, 18,165, 73,144,148, 85,225,164,208,240, 91,146,219, 1, 69, 32,110, 14,184,233,209, 56, 71, + 89, 74,122,201,201,175, 18, 65, 4,104,219,228,240,115, 78,249, 13, 39, 94, 66, 76,166, 71,235,102,147,137, 39,130, 69, 29, 11, +210, 48,153, 36, 15, 35,216, 28,127,249,120,123,246, 97,153, 61,111, 79,222,192,107, 6,175, 0,222, 2,152,200,124, 10,240,204, + 81,216,168,168,111, 45, 95, 90,226,172, 87,128,170,130, 90, 23,245,253, 10, 1, 88, 68,223,197, 38, 33,247, 78,106,108, 11,205, +251,179,119,230,182,175,191,206, 11, 40,139,170, 12, 17,194, 40,182,114, 35,251,120, 82,109,144,149, 45,146, 22,185,108,213, 44, +124,124, 45, 23,255, 27,223,239,202,235,201, 40,235,127, 86,139,111,226, 14,154, 75, 89,125,250,220, 92, 93,234,213,125, 91,222, +181,155,229,186,152, 87, 12,161, 97,138,145, 1,179,132,170,107,200, 34, 88, 57,180,180,213, 89,151,182,150, 71, 36,171,116,144, +172,254, 29, 39, 98, 42,147,189,194,139, 87, 90,239,171, 99,239,132,237, 99,163,114, 91,217, 86,247,106, 20, 77,214, 85,201,247, +154,142,188,143, 64,156, 9,115,236,198, 81,186,127, 96, 79, 87,102, 14,109,195,118, 82, 75,174,101,233,123,147,135,176,159, 78, +123, 26, 20,131,161, 91, 31,252, 91,194,255, 21,128,178, 43,231,109, 34,136,194, 51,123,120, 29, 31, 97,189, 38,114, 34, 69, 57, +164,112,132, 2, 81, 1, 63,129,142,134,138, 26,137, 72, 20, 32, 33,241, 11,160,128,158, 34, 18, 13, 61, 77, 68, 67, 1, 66,162, + 74,153,142, 16,129, 80, 8, 9, 78, 98,199,216,187,107,123,175, 25,222,123, 51,235,216, 40, 66,162,115,177,222,123,231, 29,223, +247,190,207, 58, 75, 57,146, 79,210,102, 24,137,188, 19, 62,139,242,235, 86,129, 91,176,164,218,218,240,218, 36,196, 25, 81, 53, + 26,213, 81, 83, 69,140,180, 10, 72,144, 22,107, 28,204,245,144, 20,207,117, 87, 81,205,184, 91, 52,220,161, 80,226, 84,153,105, +208, 54,112,229, 85,108,223,115, 63,137,145,168, 0,199, 73,177,209, 25,164,233, 52,122,109, 88, 21,252, 16, 10,131, 36,129,147, +105, 84,150, 15,252,175,144, 65,196, 72, 12,193,150, 47, 70, 26,122,124, 99,136, 2, 39,239,104, 35,148,131, 65, 58, 44,166, 5, +199, 40,121, 5,119,185,122,241,123,111, 7, 5,131,242,137, 24, 57,102,188, 55,162,181, 80, 93,234,120,213,122,171,119,200,207, +192, 83,229,153,211, 10, 35, 12,199,212,100, 59,165,194,136,168, 38,132,196, 1,186,243, 33,145, 27, 94,222, 37,215,170, 27,214, + 81, 38,102, 4, 97,177,156, 87,109, 6,129, 51,193,161, 23,236,202, 65,246, 24,103, 44, 76,241,118, 23,200, 54, 41,193,181, 6, +183,246, 76, 26, 89,202,152,131,252, 83,137,118, 86,166,225, 22,109,183, 98, 15, 35,177,179,223, 63,238,198,157,228, 20,116,134, +130,160, 86,177, 22,235, 83,139,141, 41, 63,147,221,128, 76,123, 81,164, 5, 61, 73, 19,116,217,130, 21,214,240,137,224, 87,194, +170,202,136, 4,237,214,128, 48,192, 67,193, 93,130,139, 83, 46,203, 69, 35, 21, 60,225,210, 45,115,100,109, 10,204,220,139, 78, + 9,162,200, 32, 10,209,131, 81,169,181,232,113, 4,120, 19, 98,164,174,211, 83,177,209,127, 78, 54,187,251, 51,211,179,221,160, + 29,231,192, 85, 62,105,129, 37, 88,199, 63, 49,116, 43,140, 80, 50,168,247,164,114,241, 27,181, 18,117, 45, 72, 25,145,254, 66, +184,169,199,212,219, 62, 44,238,217,185,114,173,135,110,124, 42,255,158,152,102,210, 37, 57,165,112, 94,165,113, 18,182, 96, 31, +123,237, 31,180,194, 26, 36,167,133,245,187, 55,229,157,160,197, 35, 63,117, 79,206, 20, 12, 73,245, 40,130, 43, 44, 35,189, 26, +219, 50, 23,106, 75,205,160, 57, 24,134, 90,137, 39,159,253,190, 60,191,250,121,127,155,144, 55,236,235,244,163, 97,132,236, 4, +136,214, 72, 12,149,228,146, 66,238,179, 8,111,205,213,230,227, 52,106,249, 45,236,121,113,124,202, 38, 83, 54,141, 58,166, 41, +122, 63,217,160, 40, 15, 1, 22,246,123, 84,254,210,140, 33,188, 2, 34,190,177,112,245,253,206,135,246,112,157,241,245,210,208, +153,251, 53,239, 30,175,132,111, 93,145, 93, 19,198,205,192,110,116,234, 13,177,232,177, 43,140,109,194, 46,183, 16, 78, 51,209, + 48,152,204,206, 68,123,251,155,113,105,118,226, 85, 63,236,237, 29, 28,244, 2, 31,174,248,119, 22,188,126,190,254,144, 59,117, + 94,249,248,233, 29,252,245,241,221,181,173,221, 47, 79,215,158, 92,191,115, 11,110,111,149, 89,207,238, 63, 42, 91, 69, 19, 18, + 60, 90, 40,218,233, 49,236,227,193,237,123, 47, 55, 94,253,215, 18,191,122, 97,101,244,219, 57,218,237,190,120, 19, 53,127,118, +182, 54,165, 73, 50,177, 73, 20, 71,253, 36, 14,105,142, 62, 67,173,248, 76, 97,130,130,236, 24,212, 13,210, 50,144, 57,233, 37, + 55,221, 25,205,184,144,219,164, 74,156,248,164,174,148, 24, 83,229, 29,131, 39,165,248,123, 73,229, 16,173, 21,179, 78,158, 42, +217, 96, 50,113,190, 92,111, 5, 71, 42,189,211,132, 74,170,244, 84,104,215,134, 84, 99,135,179, 70,157, 98,117,150, 57,209, 94, +213,162, 74,127,102, 60,121,151,255, 68, 3,255, 8,192,216,181,243, 54, 13, 69, 97,223,235, 71,220,196,110,154,180,149, 83, 37, + 2,149,242, 40, 42,108,252, 6,126, 2, 35, 19, 3,236, 44, 48,242,111, 16, 66, 98, 7, 22,196,194,128, 24, 24,232, 80,170,134, + 82,232, 35, 15, 18,219,241,243,250,114,206,185,177, 83, 9,138,216,162,100,137,125,237,243,250,206,247,125,198, 5,224, 32,171, + 12,149, 84,251, 72,222, 11, 8,240,219, 70,157, 43,179,134, 57,153,140, 23,170, 73,198,214, 30,189, 2,248,249, 62, 21, 11,119, +211,210, 77, 8,211, 53,110,154,220,134, 20, 59, 73, 2,129,178, 98,112,238, 40, 3,134,227, 24,148,172,225, 49,121, 35, 64,245, + 89,211,145, 82,225, 50, 35,101,210,230, 24,224,225, 10, 27,220, 32, 42, 35,110,251, 69,133,132,120, 7, 89, 44, 41, 18,215,114, +112,206,195, 12,163, 32,255,183,130,216,141,115,239, 19,165, 35, 14, 47, 13,196, 74, 56,235,136, 62,163,126,105, 82,224, 2, 68, + 71, 91,239, 58,151,250,193, 62, 43,217,109, 84, 46,137, 10,255,144,101, 18,134, 43, 27,162, 90,200, 92,192,168,106,255,201, 2, +141,253,149,144,166, 22,178, 72,222,138,118, 69,145,253,163,153, 4,171,166,105, 18, 75,220, 76,235,214,217,230, 90, 3,218, 32, + 63, 72,156, 37, 20,123, 85,202, 4,132, 66,227,102,122, 94, 30, 26,142, 95,232,167,156,178,182, 32,115, 90, 4,232, 12, 4,131, +200,117, 21,243,104, 82,112,175, 86, 91,117,140,254, 32, 60, 24, 37,126, 38, 3,234,189,179,243,226, 9,126,254,217,247, 55, 15, +253,219,151,235,215,122, 46,148, 60, 97, 20,255, 10, 69,154,227,189, 91,178,180,122, 14,157, 84, 49,142,181, 89, 70,249,201, 98, +106,110,181, 86,103,161,192, 9,190,109, 34, 25,159, 17,138,112, 58,205,183, 58,230,225, 0, 29,196, 13, 60,151, 40,205,171,139, + 80,107,221, 92,237,160,160,132,189, 97,120,173,141,163,193,161, 82, 13,242,150,187, 39,211,159, 84,166,148,179,111, 77, 46, 90, + 92, 94, 49, 66,152, 92,120,244,226,147, 93, 58,212, 42,145, 40,201,200,251,177,221, 88,153, 70,190, 10,244,170, 44,199, 58, 45, + 23,110,205,153, 66,165,140, 64, 62, 91,111, 18,193,149, 14,201, 91,217,136,210,208,143, 2,199,118,177, 48, 39, 97,145, 92,102, + 53,179,134,141,130,200,213,254, 4,122,105,150,141, 25,238,116, 25,102, 4, 1, 37,199, 37, 17, 8,136, 45,167, 61,152, 12,116, +226,185,192, 13,220, 63,219, 67,235, 56, 14,197, 46,203,196, 98, 25,101,247,232,203,156, 53, 41, 48,213,163,153,129,110, 73, 65, +204, 47, 89,108,121, 55, 14,206,246,200,136, 3,113,143,254,160,207,112,218,166,187,182, 91, 32, 36, 30,201,249,106, 58, 87,233, + 78,153, 34, 40,183,178,102,125, 57, 23,240,111, 50,174,252, 28, 9, 51, 16, 89,252,236,222,163,215,119, 95, 61,120,242,248,227, +247,189,227, 96, 24,197,242,219,248, 3, 13,101,158,107,118,163,227,118,111, 73,199,251,209, 29,239,166,130,241,208, 75,191,250, + 61, 11,154, 54, 29,223, 87, 72,228,237,237,235,150,150, 67,189,213,101,157,155, 87,182,118,118,182,123, 61,175,125,231,170,190, +218,132, 82, 96,181,213, 90,243, 58,157,102,119,195,105, 67, 6,205,179, 12, 30, 19, 19,186, 14,102, 65,126, 56,126,255,233,100, + 50,107, 8,189,109, 57, 41,181,174,182,105, 69,193,236,221,203,183,247,159, 62,164,248,254,191, 54,220,173, 70, 43, 30,141, 22, + 13, 95,158,156,190,121, 17, 4,147, 76,139,145,222, 8, 55,176, 16, 56, 82,132,119, 63,153, 33,118, 36, 83,173, 32,210, 7,169, + 20, 18, 82, 77, 1,177,116,117,210,230,154, 84,213, 91, 76, 14,124,220, 88,178,221, 41, 57, 7,192, 17,135, 89,120,161, 3,158, +246,231, 38,203,162, 36, 46,131,251, 28, 94, 34, 57, 13, 49, 10,135,232,125, 89, 82, 83,231, 18, 57, 82, 45,190,170,162,131, 21, +149, 29, 5,161,252,172,210,137, 34, 98, 25,124,209,176, 29, 8,161,227,217,240, 28,156, 95,106,102, 73,249,143, 85,143,223, 2, + 48,118,110,173, 77, 4, 81, 28,159,219,238,166,217, 54,109,146,154,120,105,139, 65,177,104, 21,145,170, 15, 62,248,224, 87,240, + 51,248,225,124,240,213, 7, 47, 40, 72,209, 23, 17, 65,104, 17,137,214, 54, 34,177, 37, 77,147,236,101,118,103,198, 57,103,118, +211,134,190, 20, 22,114,131,108,178,151,153, 51,231,252,207,255, 7,254, 4, 20,186,214, 20, 61,163,134,196,151, 28,217, 58,220, + 3,143, 66,120,210, 16, 13, 52,221, 22, 14,239,205,156,236, 0, 18,171,118, 58, 85, 78,228,175,145, 76,130, 68, 8, 48,138, 70, +251,100,200,182,219,173, 21,182,236, 12,177, 63,250,109, 3,118, 15,212,248,204,199, 69, 43,254, 93, 30,130,241,183, 0,235, 2, +238, 3, 87,148,176,128, 99,188,203, 88,232, 65, 68,111, 47,198,138,224, 17, 88,151,208, 84,101, 71,105, 36,152, 56, 76,246,254, + 70,253, 84, 37,137, 74,164, 78, 50,215, 16,107,138,208, 12, 15, 0,207, 1,218,155,163, 22,197,126,175,192,223,207, 67, 22, 94, +172,182,187,227,157,194,229,230,196,210, 29,105, 75,142, 18, 87,182,119, 77, 43, 18,174,122, 13,200, 30, 77, 18, 53,153, 49, 9, +154,113, 11,194,118,205, 60,177,255, 30,178,228, 8,153,245, 25, 77,210,216,206, 79, 77, 66,110, 44,251,215, 46, 45, 12, 34,213, + 31,102, 19,169, 61,110,236,102, 79,245, 24,234,253, 48,160, 35, 86,206,145, 93, 32, 40, 17,192, 90,193,226, 23,206,112,118, 84, +243, 49,188,245, 80,125,173, 64, 19, 76,154,213,160, 83,247,122, 7,241,207,163, 36,194,234, 90,132,250,230,164,140,223,221,141, +229, 99,201,109,158,144,203,139,252,254,245,165,149,118,104,163,160,254,145, 28, 78, 20,104,100,160,250, 71, 99,236,167, 84,176, + 83, 52,176,100,180, 94, 5,212,179,125,145, 27,112,106,110, 84,121, 96, 79,161,224,213,128,126,220,137,255,141, 33,132,146, 10, +166,165, 76,129, 1,127,171,182,218, 27,236, 21,182,168, 40, 19,210,174, 43, 21,133,107,206,213,145,160,142,101,214,170,173, 32, +150,219,113,214,213, 84,203, 44,183,102,101, 30,177,212,149,194, 71,141,249,102, 34,199, 18,248,127, 16,185, 3, 47,181,236, 37, + 49,133,163, 30,238,151,186,203,210,157,104,183,244, 45, 86,232,232, 79,103, 54, 86,111,117,251,221,123,157, 7,219,187, 95, 39, +114, 82,128,135, 40,173,250,243,199,241,192, 89, 41, 56,142, 41, 80, 46,114,181,182,220,233, 13,246, 49, 9, 80,200,233, 13, 14, +220,246,209,163, 2,162, 71,157,185,251, 92,149,157, 98, 87,154,171,189,131,221, 74, 37,148, 50,161,120, 71, 96,113,221,128,105, + 7,244,105,195,161,175, 87,234,169,145, 89,150, 58,211,202, 34,138,114, 60, 68, 92, 67,131, 64, 13, 60,135,184,131, 74,250,144, + 17,103, 62, 2, 43,219,139,173,195,104, 8, 93,176, 76,180,155, 45, 77,197,113,148,165,204, 78, 73,245,141,218,205,103,119,159, +146, 37,242, 97,235,203,243,207, 47, 95,247,183,126, 68,223,225,186,204, 15,236,151,214,130, 57,165,115,143, 74,192, 44,160, 11, +102,168, 23,124, 31,110, 62, 20,182,129,234,129,231,202,183,235, 72, 9, 19, 33, 76, 62, 21, 95, 4, 94, 20,199,163,209,208,198, +204, 94,224, 9,193,134,147,225, 24, 83,249,115, 36,120,220,238,140, 84,122, 8, 93, 8, 16,102,253, 26,252,249,244,226, 13,187, + 90,127,184,185,137, 41,160,115, 73, 39,111,175,108,180, 23, 46,188,221,126,143, 14,192,181,245,181, 59, 18, 69,152, 20,145, 10, + 20,201, 73,185, 76,158,172, 63,122,245,237, 29,172,133,128,247,128, 52, 39, 85,242,192,115, 87, 64,213,230,116,103,226,137,186, +209,184, 86,126,134, 78, 68,238,210, 66,115, 96, 58,117, 26,112, 64,230,105, 39, 42, 61,149,194, 61, 59,162, 58,183, 84, 83,232, + 26, 10,112,228, 73, 43,146,158,162, 66, 72, 73,104, 51,165,253,164, 41,209,223,196,204,214,243, 76, 33,251, 97,216,229, 78,245, +185, 6,247,226,189,255, 2, 80,118, 45,185, 81, 3, 65,180,237,246, 55,227, 36,206,151,100,136, 2, 72, 8, 37,130, 37, 18, 55, +200, 2,137, 21, 59,238,192,154, 59,176,230, 14,220,129, 61, 72, 8, 9,129, 16, 18, 34, 40, 32,148,160, 64, 38, 51,153,241,216, +110,183, 63, 77, 85,117,123,226,132,108,152,197,172, 44, 91,109, 87,119,253, 94,189,135,231, 59,173,176,110,249, 48,205,253,207, + 21,180, 45,148,244,113, 72,201,218,229, 65,196,122, 21,142,161,114, 98,204,176, 5,130, 57, 26,210, 81,197,215,100,112, 72, 72, + 45,162, 58, 36,100,154, 23, 11,163,170,149, 96,201,134, 19, 57, 59, 37, 98, 60,220,138, 46,113,225, 97,110,200,192,156, 28,188, + 43,132,240,182, 23,161,201,184, 10, 75,120, 62, 92, 9, 22,236, 56,188, 86, 6, 57, 84, 83, 17,104, 84, 8, 81, 21,178,201, 14, +211,111,101, 45, 69, 93,224,100, 51, 78,224, 87,122,166,140,138,168, 24,128, 87, 8,193,172, 8, 16, 10,207,112, 57,145,228, 4, + 86,176, 49,183,113, 84, 28,202, 42, 85,216, 22,170,187,128,215,203,188, 16,231, 4,111,172,147,233, 51,118,229,208,177,214, 30, +178,181, 34, 21, 18,205, 96,101,220,243, 67,238, 77, 39, 39,161,109,221,221, 12,183,215,123, 83, 81, 31,143,228, 72,128,155, 83, +145,141,197, 63, 48,203,164,109,224, 67,176,143,140,154, 4, 2,104, 52, 41, 46,149,221, 93, 91,151,107, 49, 27,200, 42,244,178, + 82, 89, 14, 87,203, 30,223, 93,157, 27, 37,242,251, 48,155,160,248, 49,178,199,192,226,199, 10,225, 17,250, 88,215,108,145, 33, + 25,135, 67,229,154,205,216,222,189, 17,239,220,138, 7,227, 34,205,242, 36,175, 39, 5,154, 82, 42,149, 32, 83, 10, 41,115,131, +224, 54, 14,120,207,199,207,147, 55,150,104,192, 27,241,181,200,134, 67, 31,108, 68, 86,234,205,151, 66, 72, 4, 31, 20, 40,145, +201, 74,228,138,210, 54,107,120,239,225,111, 33, 88,204,101, 78, 83, 5, 22,191, 72,177,116,105, 32,205,140, 35, 25,108,242, 63, + 12,170,204,240, 13, 19, 74, 7, 91, 56,164, 35, 66,138,190,237,136, 54,214, 55, 45,170,134, 16,220, 94,139,171,169, 78,203, 4, + 46,114, 93,240,244, 92,214,101, 63,238, 15,211, 65,154, 37, 40, 0, 98, 89,178, 20, 36,169, 98,220, 3,220, 60,244,123,147,116, + 84, 43, 45, 84, 7, 43,170, 92,199, 43,203,178,157,192,210,196, 67,202,231, 62,132,210,176,184, 56,140, 41, 43,183, 88,219,141, +128, 7,251,196, 94, 25, 5, 11, 66,166, 58, 33,182,177,233, 68,114,226,218,235, 33, 8,202,165,114,167,206,157, 53, 35, 8,215, +116, 14, 56, 42,136, 1, 23, 92, 1,169, 48, 56, 86, 14, 46,225,193,237,251, 31,127,124,210,252, 91, 56,197,138, 91,207,161,189, +231,130,201,192, 43, 40, 45, 8,110,156, 28, 27,159, 43,143,182,246, 30,223,217,243, 55,109, 86,176,241,135,230,231,150,253,250, + 55,123,247,235,112,127,184, 63, 20, 3,238, 71,238,218,189,188, 9, 78,135, 95,229,244,184,202, 39, 42, 25,220,224,243, 15, 23, +253,245,121, 39,201,216, 65,158,188, 29,191,170,216, 56,147, 39,121,121,214, 96, 28,210,152,206,156,197, 87,189,109, 76, 59,236, +249,107,188, 31, 56,107,103,242,253,242,210,209,176,144,153,213, 76,133, 56,160, 70,203,203,231, 47,158, 60,123,234, 65,220, 83, + 94,205, 85,217,253,204, 16, 86,239,172,222,252,252,103, 31, 91,194,110,212,143,175, 43,199,109,147, 65,211, 68, 71,126,248, 74, + 32, 39, 45,141, 79,211,201, 94, 25, 73, 31, 19,178,215,102, 59,117, 64, 81, 74,205,192,108,172, 54, 3, 60, 74, 93,144,148,193, + 82,124, 53, 67, 53,118,206,247, 46,199,203,165,152,206, 98,179, 42, 10, 1, 82,184,173,161, 38,154, 48,163,205, 68,217,185,192, +136, 86, 63,215,212, 2, 70,255,161,229,181,154,149,140, 47, 14,156,254,215,225, 14,191,191, 2,208,117, 45, 61, 81, 67, 81,248, +220,190,134,118,166, 51, 12,195, 35,128,137, 27, 3, 34, 97,193,214, 68,215,254, 5,255,131,107, 93,235, 95,112,225,222,133,137, + 27,254,135, 27,124, 36, 26, 19, 94, 33, 49,188, 4,129,150,182, 76,111,111,235,253,206,109,193, 1,204,172,154,153,116,218,219, +222,115,190,243,250,190,218,190,223,220, 62, 53, 33, 1, 66,106, 20,112, 88, 38, 91, 95,118, 87,140,219, 12,195, 53,126, 80,232, + 91,128,176, 47, 56,255, 4,139, 70, 32,205, 11, 87, 81,176,170, 14, 27, 33, 22,169, 1, 78,129,171,104,123,109,207, 26, 75,228, + 5, 18,169,182, 57,179, 6, 8, 88,132, 22, 40,176,209, 86,223,209, 56,221, 1,216, 13,132,231,123, 45, 1, 41, 15,189,109, 45, +151,129, 11,222, 36, 35,211,204, 78, 92, 59,146,131, 52, 26,150,197,238,249, 15, 73, 50, 43,146,172,208,166,102,200, 44,196, 69, + 37,174,228, 78, 96,101,114,146, 28, 7,129,194,222, 37,151,235, 69,238,164, 63,115,174,142,147, 34,230,202, 11,243,190,137,107, +221,241, 27,150,253,255, 77,145,163, 41,248,230, 79,177,125,249,145, 34, 94, 96,202,124, 71, 73,175, 44,151,103,131,126,207, 79, + 50,185, 31,229, 26,240,234,219, 13,225,217,232, 36, 47,115,240, 49,194, 69, 43, 14, 53,209, 21, 84, 19,128,215, 82, 5, 24, 19, + 23,208, 61,209,135,137, 98,133, 71, 18, 93, 71, 76,120,214,120,203,238, 56,222,250, 81,146,128,179, 1,153,166,201,192,154, 10, +220, 40, 41,183, 83,105, 58,158, 3,158, 88, 12, 16, 75,144, 14,170, 53,214, 10, 93,154,237,121,171, 11,189,153,169,240,215,111, +141,247,242,211,180, 72,115,212, 28, 83, 30, 47,215,206,208,101, 19,175,223,128,174,175,221,172, 72,149, 17, 65, 66, 65,188, 5, +224, 40,166, 66, 43,202,212,231, 13,121, 9,209, 22,160,248, 92, 34,149,196,196, 64,134,156,200,100, 31,241, 25,116, 38,143,227, + 19,123,180,111,102,100, 70,144,110, 45,103, 53,210, 73,108, 20,196,204, 70,194, 62, 18, 38, 9, 86, 35, 38,253,227, 65,119, 16, +167,209,124,127,126, 7, 10, 27,156,101, 7, 39,159,159,230,218, 49, 21, 85, 35,209,198,101, 33,204,196, 64, 97, 74,216, 99,174, +215,246,187,199,209,161,197,111,172, 42, 36,234, 77,128,128,104,147,131, 4,149,215, 30,132,253,141,195, 77,236, 92, 85,183,112, + 94, 13,206,113, 22,221,182,154,217, 23,141, 78, 22,231,150,190,237,126,233,119, 38, 50, 41, 51,153, 58,215,158, 0, 41,105, 92, +185, 81,149,230, 91, 48, 41, 91,196, 0,252, 53, 54,160,209, 27,111,142, 28,110, 54,112, 88,223,198, 5,216,194,164, 87,167,229, + 75, 85,120, 54,180,207,120,117, 45, 35,229, 9,174, 81,132,173, 66, 95,115,156,203, 82,216,185,176,135,100,203,202,189, 31, 46, + 44, 13, 22, 31,251,171, 43,175,166,105,133,175,233, 8,132,193,155,123,180,125, 70,235,251,180,126, 65,145,210,104,139, 30,204, +209,195,105,122,218,167,229, 9,250,179, 77,107, 95,233,253, 79,218, 75, 41,142,165,204,207,170, 2,204,236,101, 49, 20,178,180, +242, 19,223, 9,124, 41, 53,122,176, 85,150,157,127,207, 14,222,189,121,246,228,227,167,181,157,211,131, 61,186,124,253,252,197, +203, 15,111, 31,117,239,109,197,135,174,235,229, 96, 18, 84,183,232,183, 42, 99, 25,185, 79, 19,129, 93,232,140,233,133,133, 82, +144,231,195, 93, 89, 70, 13,161,166,224, 50,212, 96, 80, 0, 81,134,166,186,100,245, 8,214, 2, 81,134,138,170, 38, 14,166,170, +170,110, 81,143, 32,241,213,116,199,140, 76, 92,176,185, 21,166,145,163,230,147,169,232,159, 83, 8,170,202,187,120,219,205,131, + 53,105,109,180, 29,161,110,110,129, 77,161, 38, 8,106,148,148, 89, 76,170, 50,130,222, 92,166,101, 92,169, 68,163,211,236,183, +130,108,180,147,242,170, 25,239,122, 26,246, 14,227,126, 7,201,202, 95, 1,232,186,146,221,168,129, 32,218,221,110,187, 61,246, + 12, 78, 66,194, 37, 8, 36, 2, 72, 68,128, 56, 32,193,129, 3, 23,184,228, 47,144,248, 26,110,156,248, 0, 78,124, 1,103, 4, + 87, 54, 9,164, 8, 36, 32, 8, 2, 40, 25, 50,182,199,235,180,155,170,234,158, 37, 11,210, 28,230,104,245, 82, 93,245,234,213, +123,242, 36,201,148, 41,254, 78,167,159,226, 18,130,125,138, 7,182,148,182,217,144, 13,132,129,231,168, 93, 19, 66, 81, 57,153, +162,249, 83, 47, 49, 20, 56, 97,144,173,121,138,251,161, 68, 47,167,188, 29, 34,212, 3, 85, 41, 62,184,216, 99, 34,206,165, 5, +148,133,245, 50,147, 44, 32, 17, 36,116,176, 9,144,130,195,149,149,206, 20, 78,211,191,209,157, 79, 97, 30, 42,134, 65,160,228, + 4,107, 12,142,229, 48, 89, 44,116,194,181,203, 15,209, 92,160,194, 8, 38,148, 50, 16,235, 8,195,142,164,175, 68,105,195,233, + 60,188,163, 46, 97,238, 79, 76, 48, 11, 4,204,212,198, 73,122,220,156,248,116,119,204, 9,214,195, 10, 8,214, 87, 75, 99,244, +123, 67,112,138,211,212, 47,173, 19,235,251,242,210,170,234,199,222, 40,171,211, 90, 67,158, 27, 72, 30,249, 94, 44, 13,100,220, + 61, 37, 21, 82,200,121,137,157, 87, 74,192, 40, 48,162,243, 53,221,218,134,206,173,182,233,132, 97, 13,185,103, 10, 68,127,121, +214, 16,116, 83, 55,214,237,190,102,168,237, 9, 27,182,177,222,227, 58,208,219, 7, 5, 26,135, 34, 44, 19, 49,185, 30, 6,198, +215, 95,138,186,212,184,214,227,170,253,190, 91, 12,226, 48,137,101,110, 90, 85,243, 90,152, 24,202, 28, 4,193,144, 11, 63, 38, +141, 79,229,177,131,186, 91,225,162,106,160, 88,118, 51,120,154,122,191, 69,213, 13, 66,239,218, 6,127,243, 25, 2, 59, 18, 58, + 59,219, 52,160,217,203,142,116, 38, 59, 71, 3,236, 16,145, 60,170,174,199,237,172, 93,119, 24,220,156, 89,186,207, 84, 64,169, +242, 93, 32, 70, 25, 59,174,230,224, 22, 56,168,167,251,203,195,124,175,168,242, 72, 69, 59,195, 29,212,229,160,164, 10,190,179, +106, 10,227,188,166,230,227,130,184,111, 16, 48,201,166, 3,121, 89,117,190, 58, 88, 27,230, 67,122,158,189, 59,155,183, 95,124, +120, 73, 13, 78, 68, 34,199,213, 8,158, 7, 72,195,123, 97, 63,131,253,213,206, 93,203, 6,119, 65, 20, 50, 71, 76,230,166,110, +155,247,223,222,193,118,164,197, 8, 30,105, 41,248,140,127, 44,172,166,148,213,136, 9,147,113,149, 50, 71,197,243, 92, 23,194, +118, 36,220,159, 89, 71,110,238,232, 96,239, 42, 92, 25, 40,134,172, 16, 41,121,206,224, 13,130, 35,145, 68, 73,138, 45,110,136, + 30, 58, 10,121,209,181,240,101,112, 24, 98, 76,253, 85,218,254,124,189,223,220, 61,123,235,233, 31,182,187,207, 70, 1, 83,103, +216,185,132,221,188,206,238,113,118,127,182,250,250,144,131,193,202, 21,246, 96,139,109,110,179,247,159,216,222, 95, 63, 45,214, +178,146, 37, 13, 91,158,176, 44,133, 82,250,124, 58, 70, 27, 64,248,245,106, 45,194,184,172,222, 94, 13,183, 30,190,122,180,253, +241,249,133,141,139,254,141,203,207, 30, 63,249,154,253, 88,234, 37, 45,185, 69, 88, 26,147, 53, 98,130,119, 46,242,177, 49,166, +144, 62,135, 37, 10, 68,108,148, 35, 36, 56, 66, 5,209,169, 94,242,107,244, 27,139,170,133,177, 8,151,165,147, 49, 4, 41,192, + 88, 35,188,105, 82, 60, 5,227,216,124,208,116,222,147, 44,218,146,168,183,250, 72,255, 12,157, 97,252, 48,144, 50,171,114,241, +159, 68,221, 28,155,133, 21, 78,196,198, 51,238,125, 18,194,184,178,134,104,135,220,121, 38, 96, 72, 85,202, 11,137,129, 2,215, + 31, 19,161,202,148,180, 26,112, 64,104,238,150,241,210, 14, 66, 47,106,214, 76,153, 60,122, 1,121, 52,236, 24,147,254, 88,178, +249, 79, 0,190,206,101,197,137, 32, 10,195, 85,213,213,151,164, 33, 25,156,241,130, 3,142,224, 34,160, 65, 5, 23,226,202, 55, +112,225, 3,184,242, 29,124, 0,223,194,183,113,225, 74, 81,188,224,206, 36, 32,162, 51, 12,154,152, 78,210,221,213, 85,101,253, +167,170, 51,105, 25,221,205, 16, 18,146, 78,234,244,185,252,231,251,101,119, 49,115, 87, 22, 25, 56,239, 97,192,202,120, 46,250, +141,245, 40,192, 64,107, 0,232,203,138, 6,250, 19,234, 10,145,232, 62, 50,146, 54,195,253,100, 19,188, 65,255, 75, 85,150, 40, + 3,116, 64,117,107, 48,219,112,204, 87, 61,213, 28, 78, 21,136, 87,160, 2,184, 63,221,153,174, 34, 12,253, 74,152, 64, 54, 50, +146, 61,173,251, 88,236,198,171,103, 66, 84,232,195,144,238,144,162,186, 56,131,228,112,111,247, 96,182, 27, 78,132, 47,166,182, + 76, 70, 40, 45,207,147,130,120,223,221,105,192, 4,231, 29, 58,232, 48, 63, 80,245,166,210,155,118, 78,130, 49,169,228,190,237, +199,248,223, 11, 52,222,117,160,189,134,174, 58,182, 26,158, 71,158,178, 27,242, 49, 10,241,140,239,229, 50, 77,197,247,185,234, + 83,148,234, 37, 98,191,207,137,208,195, 47, 98,102,105,105,243,197,186, 79, 90, 41, 91, 54,148,228,104,160,125,221, 3, 85,203, +221,194,130,157,177, 27,146,221, 66,129, 99,192,117,213,152, 1,243, 95,141,245, 0, 64,207, 54, 48,133, 22,147,226,246,209,112, +124,152,207,167,122,193,116,206,162, 43,113,114,253, 82, 58,251,189,174,105, 6, 15,236,204,218, 14,151,245,241,201, 42,207,161, +186,113,239, 44, 23, 40, 32, 74,101,178, 8, 87, 77, 19,129,181,161,110, 69, 45, 12,110,234,238, 91,208, 16,246, 72,195,146,216, +133, 78, 28,171, 97,143,223,187,145,188,157,212,170, 17, 62, 65, 69,141, 16, 52, 72,224,128,186,127, 20,241, 49,252, 37,164,252, + 32, 37, 94,199,153,158, 52,234,162,157, 76, 40, 37, 77, 59, 4,233, 24,235,144,100, 15, 95, 72,100, 67,242,142,131, 45,224,217, +102,234,141,160, 5, 0,196, 94,141,101, 13, 87,103, 74, 97,181,181,187,251,124, 97, 67,131,194, 68, 5, 95, 99,190,166, 39,250, +135, 79,151, 63, 13, 66, 51,109,186,146,169,119,165,202,220, 5,247,205, 92,202, 4, 21,124, 24,145, 89,178, 37,239, 76,176, 90, +233,165, 24, 31,221,121, 63,123, 23,100,240,219, 59, 84,139,165,128,179, 96, 36,248,182, 93, 27, 62, 80,168, 78, 4,121,151, 80, + 85,233, 35, 60,167,190, 50,228, 30, 24,207, 81, 25, 61,232,247, 93,254, 94,148, 43,234, 68,186,104,152,205,203, 5, 61,215, 29, + 40,189,159, 15, 78,151,139, 84,194,172,184, 52,250,114, 47,249,182,169, 31,201,135, 35,177,119,181,102, 47,167,236,115,143, 85, + 55,217, 52, 99, 95,136, 22, 92, 83,251, 14,172,154, 8,213,222,152, 65, 98,227,149,187, 46, 55,191, 63, 98, 15, 70,116,120,182, + 23,209, 16,223,166,160,156, 98, 69,198, 33, 39,209,228,195,173,175,111, 30,207,142,127,124,122,246,226,218, 93,153, 45,213,243, + 39, 79, 95,125,124,125,152, 13, 21,232,224, 42, 70,214, 24, 39, 28,123, 46, 41,112,109,174, 72,143,149,167, 19, 82, 99, 79, 98, +209, 72,163,172,177,162, 40,151, 69, 89,248,113,160, 7,129,209, 77,218,119,200, 9, 6,174,169,249,230, 33, 65,220,231,245,188, +181,108, 11, 62, 26,116, 55,216, 26,151,154,128,163, 56,175, 28,207,129, 98, 46,254, 9, 29,220, 89,150, 52,157,173,151,240,251, +164,190, 12,247,106,114,170, 44, 37,242, 19, 46, 7,217,133,189,244, 32, 17,113, 89, 87, 69,179,174, 26, 21, 67, 71,210,244, 34, +181,214,171, 74,175, 60,213,156,140,206, 45,219,198, 72,222,121, 27,252,156,180,221,254, 7,110,252, 71, 0,190,174,174,183,105, + 24,138, 58,113,226, 38,235,216, 64,154, 54,241,128, 38,182,137, 55,196, 11, 63,129,255,201, 31, 64,188,242, 31,120,226, 67,130, +161,105,218, 3,104, 72,131,117,109,151,182, 73,236,216,220,115,175, 61,149, 49, 38, 85,171, 86, 69,109,148,216, 55,199,199,231, +158, 83,220,165,156,145,221,121, 49, 1,198, 89,210, 7,116, 15, 28, 35, 33,163, 49,177,233, 34,154,124,196, 79, 0,130,117, 26, +178, 30, 63,184,220, 65,105, 1,136,235,249,236,188, 97, 61,165,143, 49,102, 89, 34,167,176,134, 28, 56,114,172,224,181, 39, 27, +195,195,128,208, 2,247,160,124, 83,225, 54, 0, 77, 3,116,163, 28,230, 84, 1, 61,155,121,223,113,238, 79,105,131,175,224,236, + 74,224, 50,163, 69, 92,145,105, 39, 95, 29,242,248, 51, 65,165,118, 42,151,250,246, 28, 23,225, 50,112,137,207,184, 23,124, 54, + 76,125, 96,151,215, 36,155,161,215,245, 98,162, 56, 18, 58,249, 8, 97,130, 39, 91,177,112,203,225, 61,181, 80,221, 52,184,201, + 26,205, 7, 57, 21,126,182, 23, 34,142,164, 17,157,135,171,198,110, 19,138,202, 33,191,216,121, 80,110,109,148, 22,182, 76, 97, + 57,192,200,161,131,223, 38,238,225,168, 64,133,160, 75,188,176,236,252, 31, 60,158,149,188,209,179, 66, 88, 74,116,179, 18, 56, +183,112,252,215,202,102, 81,228, 58, 28, 91,192,254,152,187,227,207,151,123, 85, 94,151,153, 1,127, 25, 26,237,222, 95,180,147, +214,207,146, 5, 60, 21,250,234,218,215, 19,187,175, 1, 42, 8, 12, 65,150, 15, 84,165,154, 30,237,137, 53, 59,123,181,129, 48, +169, 62, 31,160,159,121, 52, 82, 15, 55,194,204,170, 69, 79,255,234,138,106, 7,104,247, 48,174,243,231, 7,197,199, 83, 68,160, + 7,141,139,192,108, 40,182, 88,134, 0, 98,186, 44, 52,194,111, 35,221,156,149, 69,217,115, 6,219, 45, 86, 51,172,181, 6,134, +191,228,187,121, 76, 20,205,214, 36, 94,194, 22,241,132,157,173,230, 69, 60,198,103,113,197, 0,238, 25,221,111, 50, 58, 5, 58, +139,231, 62,142,209,181, 25,173,218,149,138,125,170, 25,129, 71, 15,199, 7,124,245,241,247,111, 8, 76,149, 29, 89, 80,133,178, + 11,135,112,188, 50,135, 98, 75,244,159, 38, 51,210, 31,183,166,197,143,225,204,244,233,167,179, 15,185, 40,173,196,116,143, 10, +167,143,141,231,154,201, 26, 45, 29, 78, 50,245, 88,223, 25,169, 39, 62,166,130, 69,101, 27,205,216,120,136, 30,238, 29, 76,155, +203, 37, 68, 88, 66, 48, 7,203,113,174,242,240,160,117,131, 78,114, 95, 26,229,189,237,198,101,209,185, 14, 6, 50,122, 52,157, + 55,155,227,252,197,238, 62,205,137,233,107,245,242, 80,157,215,234,250,139,234,143, 84,243, 76,117,227,152,247,114,145, 60, 75, + 78,148,122,147,146, 29, 5, 55,136,155,180,248, 97,108,194, 38, 94, 29,110,169, 87, 91, 28,237,251, 83,253, 58, 81,167,103,106, +247,183, 26,153,213,219,171,119,195,233, 82,127,237,130,107,250,126,241,244,201,145,117,150, 80,158,227, 59, 65, 87,114,195,140, +175,218, 57,167,102,251, 78,178,121, 82, 20,147,151, 32, 36, 20, 98,140,195, 88,136,153,216, 48,166, 66,240,125,164, 76, 4,192, +251,132,228,227, 91, 52,100, 23,106, 48,150,117,191,214,156,114, 79,199,105, 54, 91, 78, 6, 58,199,255,122,205,170,127,123,254, +147, 38,133, 55, 44,229,193,139,226, 94, 8, 77,189,109,118,118,235,199, 52,216, 17, 64,103, 91,208,159, 67,143,134, 85, 21,241, + 27, 77, 53,131,125,205,118, 80, 54,109,236,229, 62, 69, 70,223,232,134,239,112, 58, 86,225,126,219,250, 63, 2, 16,118,173,173, + 77, 4, 81,116,102,118, 39,187,137,174, 41, 62,218,248, 69, 17, 21, 4,193, 79,126, 23,127,187, 8,226, 31,240,137, 32, 82, 86, + 67, 33,198,152,125,204, 99,199,251,154,152, 34, 69, 40,165,144, 66,186,205,220, 59,231,222,123,206, 61,144, 52,204,229,109, 98, + 4,132,181,216,103,139,166,201, 64,122,109, 12,235, 87,145,175,136,163, 29, 90,191, 14, 47, 1, 46,152,213,240, 85, 86,128,197, +144,208,206, 18, 55,154, 27,115,100, 22, 58,219,209, 73,173,141, 15,196,114, 91,120, 11,236, 42,242,251,106,237,161, 38,192,113, + 16, 14,190,107,170,209, 48,203,226,208, 9,173, 38,177,183,137,107, 43,141,165,117, 28, 80,207,192,161,118,147,135, 8,108,247, +223,125, 34,111, 16,204,248,226,223,148,111,239,195,254, 52, 89, 65, 54,195, 20,111, 0, 65, 64,161,180,143,191,148, 20,217, 7, +193, 42, 95,190,185, 79, 69,156, 8,157, 47,105,169,104,180,206, 50, 93,125, 28,139,204, 11,228, 31,152,240,142,140, 98, 22,162, + 36,117, 50,215, 0,135, 23,165,158,219,194,214,246,218,162, 4,240,117,190, 25,207, 55,125,187,245,235,157,119,131, 31, 29, 68, + 64, 28,225,169, 60, 94, 94,115, 3,249, 81, 87, 70, 53, 51, 13,144,191,194,134, 9,242,191,224,217,121,133,175,166,150, 75, 71, + 81,183,163,148, 82,230,228,222,103,124, 1,175,174, 67,106,167, 4, 88,116, 29, 83, 27, 98, 27,144, 55,233, 50, 66, 41,201, 58, +166,177,198,234,180,221,199,222, 79,142,124,112,125, 72,152,181, 39,217, 90, 81,235, 52, 47, 82, 85,144,228, 21,245, 80,234, 86, +141,233,104, 0,172, 28, 85, 83,195,103,164, 58,151,198, 73,175, 78,204,197, 54,162,234, 94,107, 91, 92,103, 11, 63, 58, 78,112, + 64,236,114,113,147, 56,127,248,175,242,148, 34, 37,187,253, 85, 92, 16, 11,165, 64,208, 57,137,183,159,129, 10,221,251,129, 32, +177, 16,118, 21,123, 57,226,249, 97,172,138, 24,183, 72, 76, 64,100,217,145, 34,247, 59, 52, 56, 61, 91,174, 16, 3, 10,209,145, + 42, 42, 67,150,143, 41, 56,184, 87,101,232,130,159, 52,156, 52, 74,226,252,193,227, 31, 84,217, 58, 0,122, 49,112, 57, 85, 99, + 24,104,163, 61, 14,242,184,105,142, 46, 34,101,197,253,185,163,103,144,111,167,203,213,224, 59, 30,197,192,205,161, 8, 85,152, + 12, 65, 12,229,120,148,149,176,133,172,225, 22,188,225,168,225, 56,154, 21, 51, 18,172, 42, 35,139, 53,148, 11, 99, 15, 25, 95, +137, 26, 0, 78,132, 11,161,160,206,100,161,143,204,169, 40, 45,238,250, 93, 64,145,176,161,165, 50,152,116, 92, 52, 91, 63, 62, +127,249,236,198, 99,181,249,160,236, 59,117,247,179, 50,239,213,233, 87,117,231,167,250,113,161, 6,139,137,190,215,136,200, 15, + 38,180, 37,157,180, 58,147,175, 14, 28, 62,248,157,205, 55,213,190, 85, 31, 95, 79,229, 39,255,176, 51, 79, 23,250,201, 70,189, +184,255,232,213,151, 55,186,112, 6, 42,250,186,130, 50, 48, 90, 27, 13,202,160, 34, 57,179,195, 25, 91,212, 77, 55,116,188,217, + 94,122,109,137, 83,155, 40, 1,167, 41,247, 89,132, 8,135,161, 13, 64, 5,247,110, 78,178,116, 61,177,242, 60, 79, 44,147, 88, +210, 75,251, 70,150,132,254,111,139,192,229,109,236, 68, 93,154,174, 26, 94,102,110,133,190,180,164,139, 72,145,124, 14, 81,132, + 95, 98,191, 5, 51,223,237,249,217,189,230, 65, 85,218, 33,184,189,239,127,135, 1,217, 31,232,112, 7, 81,238, 32,212, 28,206, +170, 92,148, 13, 35, 5,203,102,181, 56,115, 35,201,170,178,243, 72,123,125,254,233,182, 95,197,227, 57,216,246,168, 63, 2,176, +117,237,188, 77, 4, 65,120,119,239,124, 15,159, 45,192, 66, 66, 66, 81, 66,133,228, 14,209,210,243, 27,248, 49,252, 40, 36, 10, + 36, 26, 10, 26,144, 64,208, 64, 65, 42, 10, 64, 74,128, 4,251,226,123,236,238, 28,243,216, 61, 95, 20,183, 41,114,150,207, 59, +251,205,204,247, 56,228, 79,160, 71,162, 79,136,203, 76,240,122, 97,157,145, 54,148,151, 70, 98, 84,144, 32,160, 33,241, 44,125, +226,109, 79, 7, 80,170, 25, 24,103,240,118,130, 78, 66,138, 44,209, 9,166, 50,117,161,167,243,164, 85,218, 60, 26,211, 15, 41, + 39, 56,228, 42,113,100, 62, 24,210, 12, 17,164,227,195, 50, 26,143, 26, 71, 51, 21,151,233,124,149,151, 13,123,151, 83, 95,207, +154,204,203, 14,171,144,155,210, 23,167, 29,137, 9,235,181, 24, 9, 68,195, 6, 96, 74, 79, 70,197,157,230, 71, 16, 5,174,209, + 46, 80,143,203,213,240, 61, 4,204,190,127,165,195,112,221,185,108,212, 51,242, 48, 86,140, 93,185,190, 15,170, 40, 42, 0,184, +149, 53,203,116, 88,205,204,162, 34,147,181,139,198, 54,141,223,118,110,107,135,148,181, 42, 8,234,232, 12, 25,213, 88, 26,172, + 19,172,198,159,115,134, 53,221,244,148,145,198,164, 13, 46, 76, 57, 23, 64,128,192,142,111, 98, 8,159, 4, 51,117,251,229,112, +136, 16, 28,127, 4,246, 6,135,215,199,131,138,192,168,110,252, 31,141, 95, 44,126,122,126, 5,252, 20,172,227,121,138, 72,149, +196, 13, 91,175,111,151, 6,159,126,135, 18, 63, 84,221, 2,226,122,114,150,199, 18,223,251, 77,131, 5,142,150,230,206,233,188, + 76,158,172,205,219, 47, 29,145, 96, 85, 71, 26,182,148, 60, 73,200,234,202,119,117,219,139, 59, 13, 45, 64, 96,159, 99,175,167, + 93, 36, 37, 55, 88, 31, 53,219,248, 97,234,110, 35,188,137, 69, 62,111,218,157, 92,178,226,140, 33,193,214,154, 55,144,235,163, +135,223,126,158,142, 6, 3,136, 62,128,206,147, 99,181,234,164,203, 34, 59,123,207, 5, 55,201, 16,152,103,243,127,216,180, 49, + 87,159,174, 28, 86, 23, 19, 67,201,164,253, 96,203,188, 36,147,119,112,109,239, 76, 72,104, 74,184,161,227, 25, 50, 64, 71,190, +193, 18, 42, 43,195, 21, 16, 14, 28, 94,146, 23,155,115, 41,185, 51, 66,255,212,144, 99,109, 74, 88,198, 38,113,173,172, 25, 20, + 99,121, 50,209, 83,140,109,165,103,152,103, 69,211,119, 8,192, 19, 51,206, 75,201,112,172,181, 45,169,220,216, 51, 85,155, 48, +254, 18,226, 38,243,141, 76, 28, 55,106,209,212,104, 97,103,208, 98, 10, 47, 75,159,155,236,211,230,227,203, 87,235,167,207, 31, + 31, 63, 83,199,223,149,122,173, 94,188, 81,159,223,113, 65,199,127,184, 84,197, 66,109, 87,170, 58, 82,229,137,154, 63, 80,219, + 5, 54,227,234,146, 56, 58,170,134, 24,242,240, 91,185, 51,122,131,254,212,119,231, 80,218,254,204, 34, 34, 81,143,238,249, 95, + 95,179,247, 63, 62, 20,139,226, 2, 79, 38, 30, 84,168,123,187,179, 88,200, 60, 35,248, 65, 2,248,212,223,152,112,171,199,192, +142,152,131, 53, 4,192, 29,166, 43, 58,246,154, 3,109,167,174,132,205, 44,228,118,233,146, 98, 16,121, 12, 41, 13,156,132,195, + 56, 87, 31, 54,139,218, 91,167,139, 81,182,158,232,155,166,147,156,138, 83,195,124, 8,126, 18, 50, 36, 11,172,233,190, 55,188, +182,228,251, 92,235,101,118,247,126,117,146,233, 4,209,231,204,232, 42, 73, 72,225, 55,120, 34,115,187,157, 37,198, 7,109, 40, + 33, 46, 77,115,102, 51, 0,253, 61, 60,143,146,255, 44, 64,160,197, 95,179,221,187,177, 18,136,201,112, 19,223,130,255, 2,240, +117, 45, 43, 78, 4, 81,244, 86,117,119, 30, 61, 9, 72,102,227, 66, 65,130,224, 98,112,163, 32,110,117, 47,204,191, 8,126,135, + 59,191,193,133, 11,127,193,165, 56,138,160, 48, 40, 35,131, 48,142,200,204, 36,147, 73, 63,210,169,174,242,158, 91,213,157, 68, +163,100,151, 52, 73,167,187,250,214,169, 91,231, 17,211,223, 46,233, 77,139,166, 1,221, 46,141,134,221,152, 65, 7,131,169,101, + 81,151,226,127,100,100,224, 0, 52,148,182,215,211,113, 47, 78, 19, 60,233,194, 6, 68, 94, 71,109,161, 34,173,140,231,146, 55, + 22,222, 24, 33,248,218, 40,241, 0, 88, 82,143,133,224, 79, 49,220,151,163, 46, 5,115, 18, 9, 42, 99,244,103,165, 67, 98, 61, +213,141, 95,121,101,124, 11, 51,130,248, 21, 93,207,201, 34,115,155,230,253, 62, 99,175, 86,107, 74,128,128, 2, 84, 35, 71,195, +101,117, 43,107,157,246,118, 7, 1, 83,211,161, 10, 35,175,169,236,193, 82, 74,109,198,115,175, 85, 39,215,198,251,233, 16, 7, + 7, 49,231,110,143,174,167, 4,130,115, 2, 74,242, 36, 51,211,194,152,218,101, 96,110, 40, 24,244,105,156,205,229, 18,237,151, +172, 70,205,202, 25,253,242,191,171, 85, 21,213,120, 71,171,126,196,104, 23,164, 73,254,152,167,251,185, 36,114, 84, 82,196,189, + 9, 96,235, 2,171, 27,127, 5,221, 88, 4,254,103, 17,167, 27,176,127,150,195, 70,198, 98, 23,142,171,182, 36,183,147,202,132, +222, 88,201, 26,135, 47,245,180,112,195,142,222,233,168, 65,140,248,150,108,233, 58,206, 14,186, 90,172,207, 16, 36,194,247,134, + 7, 99, 94,216,209, 72, 63,190,155,188,253, 58,156,149,243,190,112, 60, 22,170, 22,178,128, 18,179, 95, 89, 19, 73, 67, 65, 38, + 19,193, 88, 54, 56,198,216,127,158, 42, 20,118, 69, 85,240,184, 75,187,169, 3,209,190,210, 62,210, 90,135, 92,133,163,211, 35, +237,181,158,242, 80, 26, 36, 57,162,107, 27, 76, 10,208,187,117, 50,234,160,207,232, 36,128,210,243,226, 42,231,179, 83, 94, 60, +142, 59, 31,235,196, 8, 98, 66,251,168, 50,211,249,133, 95, 8, 74, 82, 36,194, 2, 69, 76,132,190, 33, 79, 54,240, 62, 91,148, +109, 84, 24, 32, 28,143,101, 18,217, 25, 86, 15,104, 78,241,193,105,146,206,197,144, 32, 18, 78,142, 48,146,176, 76,212,232, 82, +198, 18, 69, 73,124,161,248, 52,203, 69, 33, 27,113,106, 52,216,253,121,121,170, 20, 53, 38,240, 94, 80,167,252,102,178,108, 9, +104,201, 68,209,181, 18,205,151, 22, 91,204,200, 54, 59, 22,209,166, 57,182, 79, 50,230,121,109, 49,142,110, 63, 25,223,251,240, +134, 62,190, 54,183,246,226, 59, 15,104,255, 33,237, 39, 84,126,163,131,247,244,234,144, 14,142,233,199, 39, 60, 36,123,215,232, +233,125,122, 52,166,195,239,244,252, 51,125, 41,104, 86,224,122,246, 98,234, 39, 52,118, 52,208,148,101,145, 41,237,137, 57, 63, +166,217,203,201,187,204,156,188, 24, 63,187,162, 95, 23,230,204,113,173,128, 49, 60,244, 96, 40,234,198,120,218, 50,186, 82,160, + 32,121,141,143,171,125,113,183, 27,142,233, 98,173, 38,185,185, 62,230,172, 53,116, 20,180, 14,178,140,167,185,120,245,169,183, +121,160, 16,226, 22, 4, 76,106,187, 30,201,173, 90,230,219,114,157,236,202,177, 75,181, 40,104,237, 64,145,170, 6,255, 59, 21, + 2,151,218,254,140,183,114,193,210,186, 19,245,111,238,220, 64,224,156,173,167, 37,215, 45,168,115,178, 69,150,155, 60,119,133, + 16, 23,204, 18,218,115,161, 80,132, 95,102, 68,215,225,239,180,212, 78, 30,202,254, 25,249,233, 54,201, 35,158,219, 97,183,154, + 27,254, 22,128,175,115,201,109, 34, 8,194,112,245, 99, 38,126,202, 50, 65, 66,113, 36, 47, 96, 11,130,236,179, 68, 57, 2, 43, + 46,195, 89, 56, 0, 59,174, 0, 11,118, 44, 88,102, 69, 20, 65,236,196,143,177,199, 51,211,211,244, 95,213, 51,118, 12,194, 43, +143,101,201,182,220, 83, 93, 93,245,215,247,219,163,159,231, 35, 26,173, 77,117,144,188, 15,236, 32,108,188,121,185,128,180, 28, +152,141,186, 53,206, 52,124, 60, 44,181,217, 85, 69,106, 59,195,164,103, 48,166,148,132,108, 60,188,178,241,224, 14,161, 35, 4, + 42, 52, 11, 4,209,144,147,217,237, 26,101, 39,199,202, 72,175,170,198, 77, 37, 73,176,248, 43, 87,132,229,123, 2,211, 33,221, + 81, 54,220,135,137,177,125,211, 13,111,219,241, 16,105, 31,156, 44,179,113, 57, 1,127,232, 76, 52, 97,244, 45,240,171,193,229, + 55,213,153,182,235, 28,185, 13, 13,230, 76,237,133,236,205,253, 29,207,217, 38,198,159, 56, 72,211, 36, 80, 94,235, 3,245,123, +189, 39,151,237, 63,135, 53, 35,173, 49,192,184, 75,207,186,186, 99,244, 34,119, 55,179, 85,200, 27, 87, 5,106,217,165,104,210, + 21,221,151,108,147,196,119,100,136,170, 27, 31,215, 20, 68, 68, 21,157, 66,152, 10, 30,192,150,183, 84,168, 89,224, 90, 19,169, + 32, 82, 24,205,155,191, 79,146,142, 84,120, 34,205,165,250,111,124,151,145,232,140,149, 4,180, 3,249,125,105,168,163,177,235, +244,172, 87, 78,175, 65,115, 11,151, 62, 69,183,136,182, 5,142, 88, 42,129,156,166,130,173,171, 46, 93,200, 58,116,146, 64, 11, +180,132, 95, 5,106,106,191, 22,245,244,137,121,253, 60,251,242,195,185,122, 7,221,125,136,174,140, 78,172,100, 76, 79,217,144, + 40, 24, 45,182, 69, 42,213,166,223, 27,206, 55, 15, 92, 54,255,135, 70, 82, 75,109,194,176,153,136, 39,112,228, 33, 30, 71,247, + 90,243,209, 82, 11, 6, 35, 82,191, 27,251, 49,199,193,221,199,184,200, 64,107, 60, 11,159, 59,234,141,102,171,185, 4, 92, 82, +123,161, 49,250, 64,117,180,152, 8,247,228,126,164,202,235, 19, 54, 15,130,188,129, 15,133,231,227,179,249,234, 30,197,163, 40, +164,149,236,221, 75,183, 41,234,153,163,174,221, 51,156, 68, 73,172,138,213, 61,163,197,106,205, 69,192, 1,101,187,109,200,217, +195,106, 71,149,209,251,223,203, 91, 81,216, 42, 29, 15,211,202,183, 54, 5,178, 63, 98, 8, 46, 77, 13,204, 44, 13,203,190,164, +136,233, 35,231,218,183,227,245,210, 16,197, 94,128,250,232, 91,125, 69, 51,186,120, 69,182,178, 63,239,252,231, 53,208, 75,250, +130, 38,239,168,119, 69,239,183,244, 33,101,166,228, 29, 13, 39, 68, 47,216, 14,228, 27, 93,126,164,211, 27,122, 40,168,204, 17, +146,173,165,169,162,243, 1,217,156, 38,117,242,102, 60, 29, 61, 37, 26,189, 12,203,241,251,245,237,167,235,175, 89,150, 1, 39, + 84,243, 68,138, 43, 75,100,219,152, 63, 18,176, 61, 34, 49,179,167, 35,192, 53,198,232, 70,185, 46, 39, 96,109,135,157,225, 12, +253,176,118, 50, 72,250, 26,184,232,166,253,188,100, 17,111,156, 21,138,194, 62,223,114,255,234, 67,165,137,218,247, 66, 93,132, +179,180,105,240, 33,225, 69,132,121,234,175,201,166,182, 24,163, 30, 9,103,226, 87,229,147,152,151,178, 54,183,237,205, 89,111, +218,181,221,220, 21, 69,177,201,171,245,182,200,178,114,131, 25,204,176,172,208,243,130, 85,153,228, 1, 45,152,139,181,209,149, + 63, 40, 67,248, 71,165,254, 99,233,189, 68, 60,117, 36,162, 60,120,252, 17,128,174,115,217,109, 34, 8,162,104,245, 60,108,207, +248,145, 4,226, 36, 44,128, 8,177, 1,133,143,224,255,216,243, 63,176,100,197, 2, 33, 33, 69, 8, 17, 34, 75,129,120, 60,182, +123, 94,221, 83,116, 85,247, 60,156,129, 40,203,216,138, 60,237,234,238, 91,183,238, 9, 6,135,119,175,105, 97,185,158,126, 28, + 76, 11, 37,247,213,158,167, 41, 45,191,150, 39,110, 28,225,136,161,215,154,130, 0,169, 49, 71, 88,216,145,117,187,231,164,202, + 58,101,141,220, 5, 94, 75, 35,199,166,153, 73,239,168, 41,216,215,188, 9,157,151, 66, 70,104, 19, 22, 93,216,216, 50,106, 28, +205, 2,210,157, 3, 2, 78,170,163,113,108, 46,198,102,181,236,170,122, 17,154, 47, 69, 48,245,188, 31, 85,106,205,174,162, 25, +104,199, 65,154, 35,118,213,204,239,225, 12,123,180,141,166,184,163,149, 62,193,113,208, 68,235, 22,117,131, 95,206, 32,201,151, +112,225,242,156, 45,207,189, 21,232,161,203, 76,137, 71,248,108, 33, 38, 30,252, 73,242,155,173,202, 56,248,220, 82,210, 38,252, +130, 77,115,254, 39, 35, 74, 83,175, 85,195,201, 51,229, 40, 99,124,184, 79,169,191,246, 3, 97, 51, 16,255,101,217,252,243,250, + 80,117,201,123, 15, 91, 12,194,253, 31,252,168, 70, 99, 45,120,119,137, 0, 18, 13,143,106,140,144, 87,159,192, 9,160, 52,247, + 12,237, 73,198, 63,153, 42, 63, 10,234, 88, 11, 41,176, 18,222,227,136, 86,104,161, 97,238,147, 85,197,198, 66,152, 43, 90,174, +224,118,131, 39, 51,239,237,155,209,199, 47,170,208, 65, 64,210, 56,255,214, 52,183,188, 60,126,178,186,191,157, 78,142,210, 44, + 97, 55,121,189,205, 83,218, 23, 57, 80,203,225,138,221,186,167, 30,191, 27, 65, 64, 11,238,230, 91,176,187, 12,123,110,182, 83, +216,156, 67, 50,170,155,131,130, 15,204,130,101,221,170, 77,202, 67,166,153,115,152, 20,174,119,107, 95,116,114,117, 19, 55, 68, +219, 69, 60,138,101, 33,205,193, 37, 10,103,210,156, 82,132,179, 36,230, 85, 97,113, 24, 30, 91,209,211,253, 38, 10,199,178,220, +249,110, 71, 18, 29, 6,172,118,169,208,214,175,231, 55,201, 2,162,109, 14,219,214,129,213, 0,173,218,194,150, 27,115,178,225, +171, 41, 61,183,249,100, 86, 80, 6,123, 5,173,160, 15, 3, 87, 52, 97,131,158,223,252,254,217,102,247,117, 86,142,238,185, 51, + 61, 21, 89,119, 64, 10,155,123,241,242, 66,254,130,175,239,117,116,233, 47, 47,149, 60, 14,239, 3,184, 91,193,135,207, 4,221, +133, 87,102,213,129, 62,135,250,140,140, 49, 87, 57,173,132,179, 43,184,120, 7,175, 77, 77,218,195,169, 4, 85, 18,205,118,182, +134,241, 2, 46, 19,120,122, 66,206, 25, 92,193,245, 55,248,244, 29,207,211,249,210, 63,189,243,174,203,202,156, 8, 85, 69,156, + 2,205,182, 9,170,235,243,120, 97, 62, 73,153,109,173, 71,213,217, 25,109,139,212,105,241,110,200,147,118,134, 44,105, 40,169, + 14, 64,203,105,121,244, 4,117,181,173,235,218,241, 54, 28, 10, 21,177,223,151, 28, 28,123,107,151,150,216, 29,127, 80, 60, 36, + 45,169,238,187,115, 48,182, 10,240,191,152, 23,207,245,143,144, 69, 26,214,214,166,225, 98, 30, 76,117, 93,202, 34, 77,178,116, + 95,237,168,178, 99, 81,146, 15, 78,115, 89,215, 86,117,232,229, 65, 2,119, 28, 88,247,166,122,160, 16,254, 1, 36,233,205,139, +160, 56, 36, 38, 12,115,104,254, 10, 64,217,181,244, 54, 13, 4,225,125,249, 17,167,110,218,138,148, 74,149, 80,133,132, 84,169, + 21, 7,110, 72, 32,113,231,140, 56,241, 7,248,131,252,129, 10,113, 6,133, 19, 66, 66, 37, 60, 42, 90,242,106,146,117,188,187, +236,204,120,253,128, 92,136,114,137,163,196,246,218, 26,207,124, 51,223,247, 85,252,166,150,137, 7, 39,236,210, 39,218, 0, 38, + 49,149,203, 28, 36, 55,157,193,189,129,166, 79,109,120, 20,170, 18,129,227,159,128, 99,246, 85, 26,137, 36, 18,232, 79, 6, 9, +186, 45,108,185,114, 27, 66,183,209,140,152,217,170, 13, 72,132, 14, 4, 68, 28,244,125, 72,231, 30,185,121,216,157, 16,162, 47, + 83, 21,197, 61, 17,251,244,102, 16,103,169,202,246,146,126,132,118,243,183, 6,136,202,133, 43,180,181, 31,110,222, 23,102,189, + 44,111,117,169, 87,128,204, 27, 72, 43, 17,157, 51,129,230,214,186, 58,146,179, 70, 36,162, 58,235, 16,220,155, 94, 95, 72,219, + 5,161,172,142,119, 60, 62,254,230,101,148,172, 38, 54, 87,139, 14,131, 22,254, 89,244,240, 14,247,135,248,237,183, 30, 27,176, +203,165,132, 58,197, 31,228,248,113,205, 42,141,238, 90, 80, 56,194, 4,188,192,175,106,186,169,106, 33, 45, 46, 72,202, 68,184, +113, 26,116, 0, 93,219,192,235,127, 94,116,117,146,218,115, 21,223,185,175,193,241,100,102, 72,223,142,112, 93,122,146, 15, 83, + 25, 3, 45, 7,135, 3,164, 15,133,160, 65, 28, 71,106, 39,102, 89, 79, 76, 52,215,214,165,177,175,249,164,102, 46,139,248,221, +129, 92,105,251,118,228, 43, 50, 80,161,180, 80, 13,192, 78,242,236,224,106,250,147,112, 75,188, 37,108, 44, 19,129, 84, 42,191, +242, 11, 61,195,250,169,163,105, 74,142,101,216, 65, 85,168,103,199,201, 13,149, 83,112,151, 36,198,197,207,142,207, 71,151, 31, + 81, 49, 0, 18, 68,128,188, 77, 97, 73,175, 2,139, 47, 18,174,176, 91,132,157,131, 44, 9,103,167,199,167,163,203,145,196,161, +120, 2,118,169,139,131,101, 4,165,223,156,160,109,116, 53, 35, 43,184,150,217, 47,122,214, 53,142, 63,172,197,100, 85,216,130, + 10, 22,175,212, 60,144,149, 6, 31, 54, 89, 5,197,125,199, 27,251,129, 10,159,161, 40, 2,118, 11, 85,191, 1,101,252, 37, 76, + 73,196, 10,140,167,163,208,138,192, 71, 14,106,245, 97, 96,243,145,245,232,224,232,251,205, 47, 41,211,149, 53, 79,246,159,190, +122,254,218,125,102, 23,239,216,245,114,206,119,197,124, 47,233, 61, 86,159,238,177,229, 33, 27,223,103,215,216, 29,145, 57,132, + 34,185,131,237,191,146,109,208,212,165, 44, 65,136,194,104,120, 88,100, 95,224,207, 15, 47,216,240,199, 66, 46, 39,143, 6,236, +217,238,112,104,146,248,138, 69,251,236,197,155,151,160, 71,100, 22,218,128,199,251,198,172,193,148,213,130,146,132, 15,248,132, +146,161,120, 9, 5,119, 75,209,180,162,239, 87,131, 35,174, 33,124, 54,172, 70,119, 50, 60, 25, 79,190, 10,167, 86,155,101,224, + 49,185, 16,227, 29,223, 38, 17, 35,186, 1, 90,213, 51,133,181,111,155, 97, 45,126, 1, 11,170, 94,255, 10, 18, 52, 5, 60,235, + 76,181, 66, 25, 9, 51, 51,120,147, 62,216, 61,235,201,120,170,103,211,245,100, 90,204, 97, 58, 28, 86, 14,149, 59, 48,178, 27, + 22, 68,231, 27, 7, 40, 81, 35,192,190, 24,182, 13,176,234,186, 56,112,125,144,174,155,179,111,161,179,254, 17,128,175, 43,216, +109, 26, 8,162,179,107,199,174,211,166,212,138, 67, 10,168,202,169, 8,184,112,226, 27,248, 91, 56,113,227, 6,226, 0,135, 10, +229,208, 10, 21, 16, 82,154,148,166,212, 73,104,108, 37, 78,118,217,153,217, 93,167,180,106,212, 83,218, 58,214,102,119, 60, 51, +239,205,123, 53,127,134, 35, 29,247,220, 67,242,159, 96,242,140, 53, 5,183,116, 20,181,105,162,182, 41, 90, 69, 72,151,217,154, + 13, 26,187,115, 61,111,170,152, 80,245,159,118,240,138, 16, 66, 94,163, 37,197,186,144,145, 32,103,250, 29,218,245,162,137,115, +204,191,200,180, 84,162,123, 89,130,158,209, 81, 72, 79, 14,147,235,205, 87,203,173, 16,245, 12,202,117,121,126, 61, 84,220,231, +211,230, 7,247,201,154,167,226,181,239,174,168, 13,232, 78,122, 76,196, 38, 83, 86,216, 77, 88, 8,220,125,103,210, 14,149, 4, +174, 52,102, 82,179,251, 53, 39, 92,150, 69, 21,112, 88,151, 78,111,204,124,114, 28,232, 87, 29, 49, 45,170,211,171,197, 72,163, +223,222, 22,176, 29,166,104, 67,208,134,112, 31,194, 24, 2,162,193,232,192,209,136,149,167,174,187, 45,199, 54, 12, 92, 80, 50, + 65,109,225, 28, 42,229,205,128, 46,239,237,195,220,255, 82, 14,125,245, 82, 1, 26,108,161, 72, 58,245,116,176, 77,118, 47,205, +246, 36,140, 87,154,220,202,132,114,106,223, 43,216,142,112,173, 43, 45, 90,145,164, 32,142,245,118,210, 64,201,201,188,212,205, + 40, 56,124, 28, 12,198,166, 64, 71, 61,105,204,214,145,108, 62,167,229, 18,156, 40,241, 0,136, 57, 6, 72, 80, 89, 47,152, 80, +170,221,172, 56, 53,212,205, 5,227, 56, 76, 20,234,249,112,231, 90,242,240, 4, 7,119, 73,110,179,173,228,193,121, 62,162,126, +180,224,240,106,174,155,110,239, 61, 63,120, 97,202, 5, 18, 24, 85,155,165,250,109, 64,158, 85, 13,198,132,139, 34, 78,230, 36, + 18, 26,102, 7,198, 9,130, 68,146,125, 48,120,128,197,105,118,219,212, 64,120,180,157,155,198,172, 33,101, 91, 56,146,165,174, +192,254, 51,155,172, 72,166, 90,217, 42, 4,233, 52, 62,100,240, 49,148,126, 48,133,158, 80,246, 15,200,225,132,108, 87,113,162, +149,253, 45,105, 85,108, 79, 72,215,137, 10,130, 28, 90,181,119, 59,211, 98,182,155,180,170,213,250, 91,249,163,127,122,210,123, +212,123,249,122,239, 89, 22,159, 12, 71,111,190,190, 63,234,119,207, 62, 54,139, 15,208,253, 12,135, 71,240,244, 59,116, 7, 80, + 28, 67,115, 0,242, 18,158,228,144, 77, 97,127, 6,114, 8,105, 14,237, 25,100,127,224,225, 25,180, 74,232,254,154,101,127, 7, +233,178,104,149, 81, 53,129,172,219,236,127, 82,111,143,223,253,132, 47,230,171,172,112,136,165, 82,106, 97,114,248,131, 78,111, + 50,191,178,169, 56,216,148,157, 20,209,184, 45,175,189, 92,162,118, 25,183, 29, 96,226,228, 29,119, 22, 54,169, 39, 69,190, 92, +153, 35,191,180,145,157,222,215, 53, 55, 92,187, 50, 90,241,193, 20,181, 82,183,205,150,149,135,214, 60, 49,226,102,112,119,222, + 78,162, 54,103,178,151,167,123, 23,178,238,146, 9,214,113,145,206, 77, 18,118,162,116,167,145,254,158, 95, 94,148,227, 98,117, +141, 19,245, 24,214, 81, 20,145,133,114,215,183,192, 94, 79,193,115,181,102,112,215, 67,234, 63, 85,203,205, 27,191,251,236,255, + 19,128,180,107, 89,141, 34,136,162, 85, 93, 93,211, 61,143, 30,199,152, 9, 89,140, 16,205, 74,196,141, 31,160,226,175,185,247, + 11, 4, 17,247, 46, 93,185, 54,224,194, 69, 4,117, 33, 40, 65, 99,195, 36, 65, 39,244,179,170,171,172,123,235,209, 61, 1,221, +152, 64, 66,134,153, 9,157,116,223, 62,247,220,115,207,217,194,239,145,179,181,132,241,104,132,248,125, 68,211,200,238,151,163, + 56, 73,187, 14, 70, 7, 74, 43,196,128,140, 12,126,143, 13,114,135, 49, 44, 24, 61,226,214, 8,232,128, 96, 81, 70,162, 3, 12, + 68,239, 2,198,178,139, 71,176,181,207, 56,222, 66,172, 33,103,232,178,193,238,134, 65, 72,141, 65,241, 28,196,144,124, 39,153, +101, 60,157,153,207,120,220,116, 32, 35,154,176,184,144, 32,153,253,186, 57,249, 89,252,104, 72, 85,136,202,170, 74, 17,188,119, + 22,191,171,208,210, 12,172, 97,131,101,152,173,232, 46,163,202,106, 25,172,106,136,146,225,190, 9, 11,142, 60,219, 93, 26,245, +230, 85,190,187,178, 30,178, 78,244,125,239,186,190, 44,219,111, 37,152,209, 9,196,224, 55,224, 43,155, 80, 62,101,108,153,240, +108,196,112, 19,149, 84,162, 91,151,245,169,170,215, 8,198,165, 39,206,148, 87, 64,234,160, 98,244,167,166,229,238, 19, 47,133, + 12,124,253,255,127, 88, 8, 63,243,230,209, 18, 31, 73,253, 32, 87, 99, 6,236, 28, 38,191, 52, 5, 89, 12,210,244, 73,148,165, +113,161, 13,138,103,230, 63, 36,113,236, 14,220, 25,165,215,198,116, 35, 0,249,238,101,156, 19,117,244, 81, 22, 45,199,173, 92, +108, 68,225,158,161, 23,147,221,245,239, 28, 77,122,240,158,223, 79, 53,224,175,191,152,238,158, 23,103, 12,171, 49,188,171,198, + 66, 78, 67,109,141,152, 35,207, 34,159, 0, 76, 44,252,181, 2, 22,137,131, 56,115, 50,152, 26,216,180, 21,166, 20, 56,152,248, +143,208, 45,139,238,181,207,114,112, 10,228, 8,141, 42,131,105,128,255, 69, 33, 54, 4,187, 5, 84, 86,246,214,132, 3,157, 21, +190,220,252,124, 23,188,130, 63, 49,127, 8,243, 52, 43,218,146,217, 99, 65,174, 41,118,212,121,160, 4, 67,152, 26,104,170,173, + 59, 42,162,126,130,109, 46,112, 57, 49,198,162, 38,144,250, 13,172, 78, 18,143, 76, 85, 45,155, 10, 72, 12,213, 9,123, 90,194, +115, 98,131, 37,148,185,226, 24,159,243,165,224,217,206,226,224,225,234,193,253,219,183,198,151,148,172,200,231,156,188, 62, 34, +111,190,147,119,107,114,222,192,200,228,209, 62,121,241,152,236, 31,146,227, 99,242,244, 11,201, 5,236, 64,165, 56, 55, 50,248, +189,218, 72, 26,199,249,233,179,174,126, 79,165, 52, 61,106,174, 79,110,146,213,243,195,151,175,196,147, 15,228,109, 39,155, 70, + 85, 82,213,109, 39, 36, 46,138, 75,200,217,160,158, 70,183,107,250, 78, 12,227, 43,251, 0,185, 43, 11, 0,160,130,163,191,167, +222,102,225,177,178, 43, 58,208, 80,170,193, 92,245,138,189,163,187,238,195, 77,221,170,126, 7, 89, 60,122,192,114,248, 94, 98, + 40,221, 33, 4,166,250, 32,151,170,163,158,225,141,168,175,239,230,251,114,186,119, 81, 92, 28,100,119,170,166,254,213,158, 9, +105, 42,187, 64,216, 14,132,140,196, 72, 45,218, 59,157,245,178, 28,218,187,141,219, 89, 11, 40,209,174,176, 5, 1,194,119,189, + 96,244,111, 42,120, 23, 58,251, 71, 0,210,174,158,199,105, 32,136,238,174,215, 73,156, 68,145,149,112,210, 17, 14, 9,116,208, +156, 78,208, 32, 81,242, 63,104,169,248, 63,252, 5,106,232, 40,105,169,168, 0,233, 36,160, 57,133, 40,185,187, 92, 32,216,103, +123,189,187,120,102,118,157,181,116, 29, 77, 26, 75,246,198, 31,179, 51,111,222,188, 39, 3,244,222,189,244,194, 45, 26,177, 41, + 35, 80, 29,193,205, 68, 7,145,221, 32,146, 69, 19, 64,244, 81, 69,160,137, 97,193, 76, 41, 6,240, 8,204,110, 13,150, 33,174, + 98, 50, 70,250, 23,182,246,163,183,216,122,173,177,197, 23, 65,163,192, 64,235,174, 89,127,243, 25,107,173, 5, 58, 27,247, 56, + 74, 76, 88,147, 87,170,121, 53,155, 42,190,168, 85, 18,129, 99, 95, 89,215, 23,229, 26,242, 45,237,228, 28,218, 17,247, 54,156, + 11,170,196, 3,209, 89,238,104, 14, 12, 60,216,155,179, 85, 55,248,177,220, 18,220,197, 62, 39, 11,117,195,237,254, 73,208, 45, +172,247,162,241, 66,200, 36, 73,231,209, 74,170,250, 71,174, 46, 16, 96,161,204,125,200,226, 52,146,211, 88,142,250,189, 81, 44, +239,140,123,195,158,156, 12,161, 52,105,182,190,159,171,237,135,197,242, 79, 23, 3,162,180, 61,246,203,214, 62,203, 14,241, 28, + 27,244, 81,217,127,164,240,161,221,171,242,160, 60, 93,165,194, 75, 12,168,188,168,217, 13, 90,209, 1,166,219,148,216, 70,228, +202, 54, 91, 84,191,199,210, 62,208, 32,147, 65, 44,192,130,153, 77, 71,160, 10,112, 52,225,219,204,236, 10,115, 47,141, 94, 60, +225,159,206,212,213, 78, 34,231, 27,147, 99,101,198,131,209,102,135,217, 28,210, 73, 45,221, 86, 20, 67, 7, 36,170,200, 56, 12, +160, 97,177,199,200, 63,119, 31,220,133, 15,238,212,207, 60, 61, 58, 57,223, 44,104,248, 48,108,136, 1,191, 86, 87, 17, 50, 97, + 45,187,205,146,178, 91,204, 24,214,106, 28, 5,146, 82, 22,169, 61,200,121,231,126, 13, 36,161, 74,178, 82, 26, 39,156, 34,154, + 46,117, 50, 57, 45,173, 13,253, 14,224, 87,127, 93,124,227,222,251, 25,212,154,203, 76, 58,134,140, 19,248,243, 2,226, 94,177, +199,135, 39, 65,172, 74,218, 94, 64, 41, 83,180,217,232,241,193,195, 95,215, 75,234, 65, 22, 85,145,151, 57, 53,154,155,243,207, +167,119,149,209, 89,145,111,243, 93,205, 81,216, 66,216,195,116, 86,100, 42, 22,234,119,181,126,191,254,248,174, 60, 27, 76, 30, +245, 78, 30, 63,125,205, 94, 50,246,170,121, 16, 11, 86,156,179,106,195,230, 15,112,128,181,121,250,111,216,120,197,138, 37, 43, + 11,150, 41,216,155, 19,104,113,200,195,132,149, 92, 76, 71,227,249,232,224,120,120,255,249,236,153,144,234, 75,246,246,251,245, +231, 26,192,247, 38,172, 43,141,251, 44,128, 18,181, 73,199,179,139,191,151, 52, 51, 76,164,117,227, 38, 81, 41,131,164, 3,220, + 77,106, 2,158, 71, 17,188, 69,105,168,111, 71,154,191, 64,157, 33,219, 88, 78,226,164, 93,251, 99,219, 25,241,244,182,124,172, +163, 4,105,130,208,215,133,221,157,129,134,222,251,122,216, 28,153, 51, 12, 21, 34,249,126,202,160,149,200, 96, 87,187,203,113, + 63, 77,120,188,211,151, 32,196,133, 36, 25,237,152,251, 45, 33,217,134, 14, 80,193,166, 2, 98,109, 18, 97, 73,239,187,106,195, +127, 67, 58, 90,164, 91, 97,131,234,189,171, 93,220,241, 12,252, 39, 0,107,231,178,219, 52, 16,133,225,185,216, 30,199, 78,226, + 22, 10,165, 8,161, 62, 3,139, 46,120, 25, 94,139, 37,111,196,162, 72, 32, 36, 42, 65,202, 2, 87, 81, 72,115,105, 98,123,108, +206,109,156,132,148, 29, 81,165,180, 73,164,168,118,226,249,207, 57,255,124, 63,234,247,142, 55,245,136, 92, 37, 46,145, 52,223, +141,211,131,150, 40,213,158,122, 8, 60, 47,165,181,200,244, 6,121,124,153,138, 83,234,188, 99,110, 31, 72,239, 78,215, 32,162, +113,226, 74, 2, 66,241,201, 32,158,144,198,253,153,134,121, 44,178, 95,143,150, 26, 45,248,172, 8,123,171, 54, 53,206,226,238, + 77, 7, 66,222, 26,208, 26,249,216,229, 32, 21, 46,242, 98,228,178,170, 37, 83,104,167,103,213,252,122,122, 13,127,173,155,213, + 6,249,145,176, 2,192,227,148,236,138,135,221, 51,225,236, 40,156, 80,139,167, 14,107, 8,211,246, 93,248,191, 46,238, 1,243, +164,118, 11,117,215,203,187, 29,178, 57,212,142, 92,184,213,190,123,158,214,175, 35,255,241,119, 61,161,167,115,165, 78, 48,243, + 50, 26, 42, 59, 76,146, 83,135, 16,241, 81, 26, 63,201,220,137,179, 89, 10, 85, 79,148,184, 56,119,238,211,143,242,253,231,111, +183,161, 33,222,236,184,162, 7,200, 80,191,247,123,171,254,243,205,132, 66,161,143, 39,244,225,227,146,135,137,238, 25,117, 22, +224, 48, 17,239, 13,189,171,121, 98,139,212, 34,224, 63,141, 94,156,198,195, 60,201, 51,168,182,116,221,242,188,203,223,206,177, +130,126, 54,178,137,233,190,223,109,191, 76,212, 67,133, 29, 5,248,238, 38, 81,190,220, 44,224,108,250, 86, 98,183, 58,145,171, +193, 9, 18,218,134,134,105, 92,134,119,222, 17, 45, 82,235,224,134, 52,180, 37, 42,110, 48, 41, 59, 24,194, 41, 98, 38,252, 52, + 12,218, 38,246,168, 14, 37,151,121,108, 26, 33,155,239,246, 69, 17,188, 60, 27, 96,222, 27, 69,213, 82,111,136, 17,129, 28, 42, + 98,130,233, 26, 86, 0, 79, 3, 32, 41, 32,122,242, 49,251,226, 9, 65,134, 66,158,147,163,120,157, 96,215, 52,179, 74, 20,255, + 95,134,161, 66,130, 65,166,110,142, 16,195, 25,197,129, 21, 51,110,134,209,246,188, 56,159, 46,202,152, 2,213, 99,236,211, 68, +130,139,162,113, 5,232, 34, 12, 80,136,226,213,118, 93,121,166, 22, 97,208, 13,172, 14, 89, 60,178,105,161, 7,227,139,179,203, +233,160,176,195,203,229,187, 55,221, 21,158,253,140,252,178,124,104,120,160,252,150,150,252,151, 74,221, 83,186,223, 56, 20,118, +219, 27,165, 75,245,245,195,204, 46,126,150,139,201,116, 57, 89,173,126,149,203,155,106, 51,127,168,239, 53, 58, 35,177,219,214, + 32, 55, 15,223, 31,196,156,181,182, 2, 9, 47, 78,198, 3,217,222, 6,156,191, 72,240, 86, 80, 18,129,249,200,121,184,140, 9, +225,187,110,127, 10,202, 19,176,227,207,243,129, 70, 22, 37,175,205, 63,119,165,118,125,241,197, 23,247, 71,113,145,189,103, 90, +115,136, 41,158, 20,164, 17,192,117,252,169,123, 21, 41, 55, 91,223, 85,104, 59,104,200, 73, 47,240, 90,105,133, 28,216, 61,132, + 40,105, 4, 95,193, 53, 58,245,222, 48, 75, 67,242,255,142,205,145,158, 47,170,123,148,227,227, 20, 86,184,253, 17,128,180,243, +217,141, 34,134,193,120,236,204,159,150, 86, 80, 21, 36, 4, 18, 92,184, 32,193,123,240,162,188, 15,170,122, 68, 28,128, 3,162, +162, 91,137,161, 59, 51, 59, 73, 76,108,199,217, 89,177,112,161,199,149,186,187,218, 36,158, 47,246,231,159,155, 53,220, 18,172, +158, 92,146,134,236, 85,239, 70, 23,146,253, 63, 21,181,238,141,236,228,100,156, 87, 62,215, 93,223,100, 73,221, 54, 76,187,242, + 75, 62,215, 50, 27,126,209,180, 65, 1,218,203, 33, 75,226,224, 46, 95, 83, 59,212,192, 28, 46,178,190, 76,217,113, 49, 75,248, + 4, 17, 35,242,236,160,162, 89,206,217,118, 73,195, 50,183,200,175,245, 30, 6,246,183,177,199, 70,202, 51, 4,171,103, 87,185, + 35, 75, 67, 24,185, 2, 77,198,125,239, 22,157,250, 62, 58,246,229,122,172, 5, 85, 51, 90,232, 52, 10,239,106, 35, 34, 88,213, + 1,172, 73, 11,214, 8, 55,208,217,188,156, 21, 58,111,233,213, 9, 93,221, 46, 95, 14,179,219,169, 96,165, 64,141,150,186, 66, + 81,124,178, 83, 98,244,101,254,149, 95, 63,127,242,110, 51,188,255,126,179,252,125,158, 64,252,247,156,129,255,254,211, 2, 0, +154,138, 39,219,115,218, 72, 37, 45, 24,220,125, 49, 74, 51, 86,240,138, 63,163,187,153,141,230,151, 15,120, 23, 13, 63,221, 48, +132,132, 35, 47, 55,184,190,243, 79, 31,250, 51,223,237, 28, 78, 1,186, 14,159, 61,238,193,207, 95, 55, 83,190, 10, 76,115, 92, +150,169,237,152, 13, 56,134,172,178,217,254,152, 86,160, 36,172,192, 12,177,252,169,121,154, 7,177, 49,231, 7, 76,165,138, 48, +225,150, 40, 30,193,155,131,192,155, 23,111,175, 63, 95, 31, 57,233,218,226, 80, 64,244, 71,131,187,208, 79,156,171, 79, 25, 13, + 54, 8,138,170,241, 26,217,197, 63, 99, 74, 90, 0, 27,145,193, 14, 30, 20, 96,230,107,185,181,186,170, 20,134,196,205, 64,143, + 78, 46,182,229,134,129, 21, 30,162, 59, 72,154,114, 69,130,217, 36, 79,132,242,244, 0,117,130, 74,221, 72,221, 59, 58,111,103, +154,239, 85,141, 53,168,216, 19, 41,223,162, 87,235,111, 2,156,195, 18,118,247,202, 25, 37,185,100, 36,150,100,110,160,109,155, +176, 73,205,143,120,183,227,116,232, 54, 95,208, 90, 9,238, 23,178,202,193, 50,132,121, 39,124,144,154, 80, 29,215,154,172, 78, + 51,191,116,191,110,220,101,248,216,208,167,184,124,163,233, 54,205,155, 51,207,231,159, 33,249, 92, 77, 25,153, 91, 17, 25,212, +147,248,246,144, 35,125, 16,218,163,148, 85,247,163,149,162, 24,124, 84,150, 23,122, 12,213,240,103, 1, 55,169,129, 18, 76,240, + 27, 29,125, 29,230,254,220,207,110,159,127, 47,110, 81, 49,152, 31,121,182,211, 62,230,146, 49,120,235,155, 38, 50,247,115,101, +190,144, 25,237, 20,214, 47,183,139, 28,155, 78, 39, 30,237, 29, 37,123,145, 76,122, 83, 53,192,172,146,131, 88,219, 35,209,224, + 19, 34,121,139,255,221, 36, 63,154,143,191,140,244, 51,122,246, 33, 10,248,112, 64,180,126,240,111, 1, 88,187,154, 30, 39, 98, + 24,154,143,105,102, 58,165, 93, 78, 11, 23, 96, 17, 7,126, 3, 63,157,223,129,144,246,178, 28, 88, 86,136, 2,210,150, 85, 59, + 31,137,109, 18, 59,153,153,178, 92,144, 56,244,218, 78,218,212,126,182,223,123,174, 30,101, 54, 9,183, 70, 84,189, 17, 16,141, +104, 49,109,134, 69,153, 34, 10, 73,147,241, 74, 50,218,173, 84,188, 25,117,109,156, 44,221,102, 58, 60, 72,114, 14,137, 64,144, + 80, 19,187, 47,165,196,171,203,130,158,136,238,185,151,138,217, 28, 25, 40,195, 99,173,165, 70,139,225, 97,149, 6,113, 38,130, +194,117,213, 56,110,233, 59, 27,159, 4, 15,190,107, 42,183,117,171, 14,194,215,211,158, 83, 71,234,240,240,237,161, 51, 10,131, +144,222,121,105,134, 85,122,134,107, 60,152, 26, 89,166, 40,193, 93,205, 36,119,230, 50, 76,140,167,121,210,117,182, 86,187,204, + 85,160, 96, 3, 70,124,164,157,133,183, 45,221,221,251, 79, 52,183,179,153,253,162,211,104, 20,233, 68,193,122, 14, 48,241, 56, + 62, 36,115,165,213,170,117,105, 90,227,185,201,244,238,229,179,247,223,246,119,229,231,161,127, 71,223,248,159,162,188, 47,234, +243,233, 58, 58,190,107, 93,249,159,199,115,213, 48, 3,212,135, 62,213,117,245, 0, 93,114, 56,128,129,153,112,163,210, 79,172, +185, 1, 60, 2, 93,236,220,213,139, 93,117,185,113,201, 45,128,126,245,240,227,190,135,180,119,189,103,148,143,236,107,222,140, +195, 22, 23, 66, 66,185,149,200,170,102,177,213,125,117,121,117,251,253,179, 22,167, 10, 91, 5,240,231, 78,242,233,245,225,246, + 35, 77, 11,238,105, 46,191,165, 64, 39,203,241, 3,181, 82,127, 74, 71,152,141, 76,187,205,211,211,216,249, 48, 44, 11,252,228, +121, 98, 68,147,196,171,103,121,190, 43,244,253, 8,234, 83,143,145, 39,251,172,108,207,159,147, 85, 57, 32,205,244,140, 50,145, + 38, 41,202, 52,201, 86,188,232, 74,192,163, 97, 65, 32,137,199, 36, 9,114,143,159, 72,197,172, 90,106, 24,149, 57,241,235,166, +237, 67,207,134,198, 74, 38,204,233, 1,197,118, 54,247, 51,112,187,190,136, 23,125,127,248, 25, 47, 88, 83,183, 15,125, 47,121, +200,135,163, 1,235,253,218,232, 77,107, 67,215,100,239,129, 41,130, 83, 33,110,185,146,239, 67,145, 73,203, 25, 14,149,242, 17, +223,169,158,146,192,124, 0, 58,198,247,140, 85,142,135,227,128, 3, 98,204,224,254,205,243,215,215, 95,174, 37, 58,163, 40,121, +184,151, 14, 5,210,241,124, 85,100, 91,210,101, 21,193,142,206,106, 84,181, 8,238, 2, 19, 97, 38,213, 76, 64, 27,255,158,204, +231,216, 87, 36, 79,147, 46, 73, 47, 67,124,153, 88,210,180,218, 20, 23, 86, 4,180,216,165, 76, 89,195,104,178,139,112, 81, 60, +148, 58, 35, 30, 13,120,191, 92,210, 9,201,206, 45,207, 61,106,200, 13, 15,181,240,163,199,210,111, 81,101,136, 71,133, 70,142, + 37, 42,155, 34,233,101, 7,142, 89, 57,191,240, 62,127,148,165,166,111,227,183, 0,188, 93,217,138, 19, 81, 16,237,253,102, 98, +119, 50,163,204,188, 9,234,147,248, 46,204,255,255,130, 8,163, 32, 34,130, 66,204,100, 72,199, 94,239, 82,222,170,186,213,139, +224,171,121, 10,233, 78,210, 27,117, 79,157,170,115, 74,230,107,207,205, 88,226,130, 70, 0,214,127, 82,101,207, 26,221,210,148, + 72, 38,125, 56,131,192, 56,168,166,224,158,109,114,212,163, 1, 14,203,242,207,142, 70,230,157,213,196,150, 35, 60,155,162,145, +143, 54,142, 28, 18,120,109,197,231,145, 87,196, 12,255, 63, 39,215, 5,244, 12, 81,200,143,251,228, 32,247, 17, 33, 33, 30,201, +255, 90,145,160,234,201,127,231,208, 62,142,168,143, 53,228,170, 25,156, 65, 23, 66, 84, 50,117,140,236,196,187,185,116, 30, 35, +190,104, 1,226,158, 36, 1,137,212,187, 26, 74,104,139,224, 62, 91, 23, 70, 11, 67,186,197,229, 5,148,155,194,219,202,194, 0, + 31,140,155, 56,141, 92,174,185,142,200,168,129, 56, 23,159,113,116,104,157,108,154, 81, 59, 80,123,163,174, 84,161,242,164, 79, +161,218,109,223,228, 87, 71,221,233,245,125,250,111,175,100, 22,195,204, 7, 0,194, 11, 49, 23, 63,202,123,110,236, 81,180,245, +201, 68, 30, 37,110,123,116,181,234,184,182,147, 68,247,175,170,215,213,238,203,247,250,225,212,124, 62, 14, 31,143,191,222,191, +236,238,223,189, 80,185,186, 45,157,238,205,227,197, 12, 35,244, 62,141, 71,237, 68, 84,170,230,122,227,195,194,222,206,144, 4, +111,211, 93,117, 87,183,104,229,232, 33,238,183,195, 87,210, 7, 98, 67, 75, 89,148, 79,221, 73,122,131,161, 82,101,171, 59,170, +113, 34,200,183,206, 73,137, 19,130, 45,123, 64, 93, 41,214,237, 50,122, 72,157, 72,224, 41,224, 98, 7,206,246,249,239,238, 60, +104, 61,233,172,226, 80,142,103, 9, 85,204,154,211, 20,163,123, 74,185,116,202, 0,139,134, 6,161, 37, 47,238,234,113, 73, 94, +212,221, 57,150, 21, 38,118, 65,217,124,233, 46, 41,213,123, 28, 19,228,137,204,119, 96, 77, 44, 15, 15, 34,246, 63,100,137,212, + 51,130,132,123, 26,198,128,208,216,136, 44,232, 83,208, 42, 33,144, 60, 42, 43,252, 97,105,107,216,152,229,166,188, 62,156,209, +232,248,220, 94, 60,136,198,129, 36,102,240,225,227,118,119,243,179, 62,161, 11, 20,234,108,253,238,117,220, 23,102,179,135,125, +184,203, 78,202,245, 83,233, 30,100, 81,119,178,213, 73, 29, 8,181,236,121,227,244, 48, 36,126,157,238,117,220, 27,104, 70,172, +169,142,168,195,183,238,225,199, 39, 75,229,106,114, 1,243,192, 20,229,166, 86, 90, 99, 32,204, 45,148, 22,199,136,243,183, 24, +214,225,149, 64,186, 19,228,190, 10,238,240,183,192, 52,134, 69, 67, 36, 44, 92, 72,215,132,124, 88,238,197,157, 10, 38,238,154, +173,132,220, 63,166, 59,196,100,103, 68,150,104,161,218, 27, 44,139, 57,183,192,243,193,193,201, 38, 4, 98, 58, 57,114,133, 76, + 41,196,195,170, 88,154, 36,139,122,128,168,142, 24,188,199, 11,207,152,160,172,164, 84, 46, 97,134,124,170, 40,202,218, 3,130, + 59, 87, 65,227,143, 0,164, 93,203,174, 19, 49, 12,205,107, 30,109, 5,213,189,176, 64,226,249, 9, 8, 22, 44,249,113,126, 2, +116,247, 8,177,132, 75, 75, 31, 51, 77,147,140,137,237, 36,147, 1,177, 64,108,186,105, 43,205,211, 62,182,143,207, 49, 53,234, +145, 9,191, 39, 90,161,162,253,130, 70,175,182,237,131, 1, 35,142,135,172,107,138, 44, 23,109, 90, 21,171,237,190, 69,173, 49, + 69,143, 38, 18,102,128,146,179,199,250, 11,239,176, 7, 46, 37, 66, 18, 82,229,168, 95, 13, 52, 96, 54, 75,198,178, 18, 1, 55, +170,148,181,189, 89,181,186, 51, 58, 6,190, 22, 45,107, 72, 77, 44,222, 97, 39,156,119, 83, 39,250,221,101,199, 91,112, 49,169, +224,155, 44,195,146,239,143,245, 65,144,243, 52, 67,213,115,106, 38, 66,228,174, 84, 78,105,152,152,117,145, 60, 73, 62, 44, 75, +223, 38, 33,235, 97, 53, 93,177,137, 20, 40,167,151, 27,215,131,188, 59, 94, 79,203, 68,202, 12,247,142,182,144, 77, 44,168,145, + 73, 16,107, 17, 19, 79,227,108,245,238,108,187,198,172, 59,115,211,247,183, 27,251,124,187,126,250,112, 45,238,199, 50,228,252, + 87,220,253,255,200,253,207,135,154,195,253,149, 62, 59, 2,245, 70,204,138, 16,150, 14,149,233,243, 7,218, 40, 26, 41,177, 61, +154,196,187, 23,143,135,189,212,147,238,165, 54, 16,190, 9,241,225,235, 73, 5,255,254,205,179, 39,219, 94, 7,231,172,255,124, +143,221, 89, 79,176,103,196,197,200,177,105,208, 90, 10, 42, 26,238,247, 35, 78,228, 8, 53, 19, 74, 69,140, 60, 93,236, 96,175, +140,169,105, 39, 49, 4, 73,146,144, 32, 19,155, 23,112, 48,176,161,221,209, 19, 36, 10, 75,122, 49, 9, 29,107,252,163, 33, 35, +123, 90, 73,154,136, 48,126, 28,142,125,183,114, 62, 76,105, 73, 27,168, 45,206,172, 69, 94,183, 82,166, 65,199, 27,110,255, 55, +216, 54, 12, 49,214,143,151,145,193,125, 32, 95,208,211,104,137, 86, 0,153,250, 46,147, 9, 56, 97, 28, 82,184, 9,200, 31,200, +107, 42,236, 39,137,106,249, 44, 9,204,134,145,148,126,222,190,122,253,241,203, 39,198, 25, 44,105,198,238, 96,241, 66,236,135, + 61,181, 43,177, 93, 67,182,101,120, 76, 68, 5,145,232,248,193, 12, 32, 82,245,163, 79,216,157,127,132, 65,225,142, 48,102, 35, +167,128,252,215, 20, 56,105,101, 55, 55, 94,124,149,221, 67, 53,234, 47, 95,133, 34, 39,105,196, 32, 14,241,178, 93,221, 79,239, + 15,224, 35,132,191, 32, 27,114,194,233, 34,189,149,116, 66,121,148,154,204, 80,127, 11,238, 18, 82, 95,102,182,208, 75,248, 20, +184,245, 41, 67,222, 71, 77,172,235,186,139, 34, 23,189,153,100, 75, 93,100, 99, 75,181, 84, 65,248,202,193,174,244,100,114, 36, + 88,130,247,153,226, 82, 9,177,135, 34,147,147, 15,131, 71,112,248,203, 49, 28,214,234, 70,179, 41, 20,225, 37, 86,226,128,121, +154, 5,101, 21,174,236,190,179,245, 16, 69,164,176,244, 69,224, 99, 69, 75, 84,154,202, 96, 16, 86,137,181, 41,179,116,229, 95, + 85, 36,127, 9, 64,219,181,236,182, 13, 3, 65, 46, 37,133,166, 29,167, 45,140,246, 80, 32, 31,208, 75,255, 31,232, 71, 20,254, +130, 32, 1,146,160,201,193, 41, 18, 61, 76,241, 81,238,131,178, 20,163,232,169, 62,217,134, 97, 75, 48,185,156,221,157,157,153, +234, 51, 58,157,134,127,104,121, 33,139, 95,102, 68, 26,125,177, 53,117,222, 63,132,226, 35, 77, 79, 96, 50, 13,200,102,169, 61, +182,174,124, 67,147,129, 52,136,136, 11,215, 67,224, 3,172,200,161,192, 98, 76, 88,204, 6,227,212, 48,164,173,130, 58,128,141, +202,176,221, 92, 86,118, 83, 27,219,172,242, 79,215,128,202,101, 67,242, 53,112, 20,143,249, 54,195,232,186,208,147,224,115, 32, +124, 83, 8,250,114,108,104,214,100, 39,191,122,173,102,138, 38, 32,212,119, 62,117,150,242, 3,160, 97,154, 88,152,212, 36,164, +231,174,225,196, 88,129,146, 39, 73,250,120, 1,233,235,102, 52, 40, 76, 17,111,206, 78,123, 45, 68, 37, 84,113,233, 81,189, 18, + 83, 84,163,198,118, 84,228, 21,170, 45,210, 61,171,167,186,189,106,170,231, 67,142, 44,222,252,203,187,236,127, 63,194, 76,193, + 38,204,240, 90, 85,162, 60,148,125,174,203,165,118,180,157,248,126, 7,122,153,159,223, 63,116,119,143,238,230,181,251,165,198, +182, 64,254, 31, 15,195,102,253,252,253,219,103, 99,204,151,173,187, 61,184, 21,160,221,171,163, 53,209,121,117,149, 94,183, 54, +199,101,227,252, 80,209, 88, 32, 18,185, 82,153, 7, 5,214,117,200,112,182,202, 57, 16,205,162, 51,193, 70, 93,239,174,247,119, +123, 42,157, 49,106,143,111,125,142,236, 49, 71, 58, 47,224, 48,125, 92,127, 58,244, 47,121, 1, 99,243, 93, 56,113,129, 92, 88, +164,152, 51, 6,231,250, 35, 85,232,133, 10,201,170,113,100,161, 85,163, 29, 60,202,250,194,218,174, 35,149, 34,173,181,249,139, +114,112, 71, 88, 39,166,247,242,233, 24,211, 4,168,120,228,157, 61, 56, 53,235,169,176,140,158,204,210, 39, 45,147,250, 28,194, + 88, 78, 65,214,243,207,219,189, 46,189,246, 98, 1, 71,254, 89, 74,203,186,149,172, 62,102, 60, 68,181,239,124, 17,225,241,247, + 19, 17, 13,240, 62,115, 16,111,143,125, 98,135, 71,224, 65,197, 64,188, 51, 18,140,136, 99,254, 47,194, 12,155,167, 25,242,157, +120,214, 97,249,102,152,130,190, 70,241, 18, 31,143, 65,185, 10, 25, 6,152, 85, 19,216, 11,156, 87, 75,109,134, 58,112, 65,184, +164,177, 68,244, 36,202, 36,212,141, 59, 67,238, 4,165, 33, 74,203,252,228,207, 33, 65, 45,190, 15,238, 11,186,204, 92, 57,125, + 14,225, 23, 33, 62, 45, 26,176,103, 29,218,119,243,162, 92,162, 81,197, 4, 91,151,194, 60,159, 88, 25, 79, 66,235,219, 15,171, + 93,229,204,136, 18, 36,172,174,195, 78,147,211, 81, 14,133,197, 23,197,147,141, 34, 76, 69,244,177,101,146, 33, 41,228,101,179, +179,176,165,213,133,214, 68,111,225,101, 32, 3, 8,152,198,143,254,242,248, 35, 0,107,231,178,219, 54, 12, 68, 81, 82, 15,218, +146,163,192,104,131,124, 67,182,253,255,125,209,101,251, 1,237, 38,221, 36,139,214, 54,100,189, 40,146,229,157, 33, 37,202,105, +129, 2,109, 86,206, 34,128, 95, 33,103,238,220, 57,183, 72, 54, 2,164, 92, 68,136,144, 97, 41,103, 57, 31,196, 94, 59,163,100, +177, 43, 75, 27, 37, 34,190,238, 74,138,164,232, 33,193, 33,103, 0,161,243,188, 38, 72, 16, 6, 35,102,148, 86, 38, 39,205,125, + 85,171, 13, 21,188,203, 65,156,241, 10, 35,217, 92,115,172,225, 41,112, 88,203,157, 63,234, 17, 73,157, 83, 82,154,179,190,163, +158, 51, 27, 51,111,241, 12, 59,221, 66,228,130, 89, 1,154, 23,111, 54,111, 69, 55,201,213,204, 6,189, 22, 61,154,110, 77,205, +102,255,123, 0,199, 71, 78,253,162,227, 80, 83,193, 37,188,115, 27,137,155,134, 98,117, 57, 42,171,125,163,235,239,161,239,227, + 60,253, 1,214,169, 67,217,235,104, 40,109,174,150, 83,133,178,157,152, 47, 70,214, 98, 6,129, 64,200,111,151,190,128,188,251, +127,204,236,255,126,202,155, 45,225, 64, 38, 30,158, 57,185,192, 92,194, 75, 88,164,207,147, 16, 31,159,127,182,189,123, 17,232, +105,122, 94,237,167, 7,159,190, 94, 62, 60, 61,188,107, 84,215,169, 59,133,204,194,110,194, 95, 93,169, 15, 56, 15,226,253, 97, +170,212,227,235,117,140,192,253, 40, 89,130,159,133, 19,113, 95,213,254,235,119,246, 5,163, 11,104, 76,255,141,252,252,252,133, + 0, 3, 75,239, 12, 71, 35,168,150,133,210, 19, 11,140,114,208,157, 63,214,154,234,216,235,126,176, 67, 93,214,135,125,115,238, + 78, 68, 72, 15,104,217, 56, 74,147,156,195,141, 98, 27,197,126,112, 21,208,134,105,174,141,190,111,142,151,211,143,234,112,215, +247,131,115, 87,114,185,132, 49, 79, 0, 27,210,232,192, 5,141,134,105, 30,172,241,145,194,206,196, 91,164,254,100,252,171, 63, + 17,203, 44,143, 82, 69,120,201,100, 2,229, 52, 67,123,139,127, 77, 54, 94, 12,165,253, 21,249, 78,155,214, 81,250, 10, 93, 94, +142,114, 73,194,214, 63,145, 0, 12,225, 10, 51, 7,235, 51,146,143,208, 55,137, 9,239, 90, 39,178, 35, 26, 47,187, 1, 82, 37, +166,227, 55, 71, 63, 30,251,150, 11,131,115, 4,121,249,154,125, 4, 56, 22,139,140,112, 4, 74, 2, 9, 56, 54,221, 17, 83,121, +217, 72, 93, 53,235, 16,226,196,154,187,189, 25, 25,146,158,141,232,207, 56, 78,180,113,110, 97, 23,196,192, 95, 15,169,100, 90, +140,187,223,252,159,218,219,141, 80,241,134, 58, 25,102,179,249, 90,179,218,104,152, 8,159,154,191, 44, 95,167,151, 90,221,219, +105,212, 46, 4, 29,175, 86,203,224, 85,225, 35, 40, 95, 52,119,210,159,253,203,212, 34,193, 80,176,131,182,204,171,166,120,108, +253, 13, 10,118, 5,212,191,210, 23,132, 66,181,216,150, 49, 78,164,227,222,219,159, 95, 2, 16,119, 53,171,109, 3, 65,120,215, +146,108,139,216, 77, 3, 33,161,167,190, 64,233, 59,180,167, 62, 70, 46,125,221, 60, 67,160, 16, 26, 72,156,196,114, 44,237,127, +119,190, 89,173, 54,200,144, 99,133, 14, 90, 73, 24, 44,217,179,179, 51,223,207, 98, 62, 83,101,235,176,138,250,156, 26,245, 46, +105,132, 53, 52, 59,145, 19, 94,252, 14,154, 94,164, 57, 88,221,123,211,144,150,250, 2, 76, 29,233,125, 2,163, 50,118,141,200, + 20,212, 72, 73, 69, 79,152,127,195, 56, 61, 33,219,208, 60, 18, 64,228, 74, 73, 50,173,245,186, 93,180,219,213,217,166, 33, 75, + 26,212,155,200,238,117, 73,102,194,130, 49,180,129,156,198,234,222,190,106,172, 1, 33,122, 99,121, 86,241,185,148, 38, 67,142, +207,114,210, 81,224,148, 60,100, 13,119,206,226, 25,166, 70, 97, 55, 73, 65,101, 38, 34,115,190, 2,106,174,128, 75, 84, 35,190, +136, 93,184,200,220,119,231,134, 99,160,133,177, 84, 78,222, 91,119,178, 81,169,199,182,164, 66, 98,219,225,237,146, 44, 48,250, +121, 74,184,189, 32,169,189,191,193,220,217,193,121,179, 46,212,193,254,251, 86, 38,110,182,216,203,171,254,253, 48,111,183,131, +122,147,230, 30,198, 64, 22,191,215, 22, 59,169, 99, 90,179,109,235, 47,159,215,159,214,139, 87, 77,170, 62,140,203, 84, 32,121, +253,121,222, 61,119, 15, 85, 33, 43, 61,225,195,240,255,142, 17,249,233,176, 99, 23,245,180,128,147,233, 26,178,198,204,148,161, +212,105, 48,241,241,135,186, 33, 3,169,222,168,111, 95,191,247,230, 24, 15, 72, 75, 61,184, 93,247, 24, 99,125,226, 81,195, 20, + 75, 22, 84,151, 9,153, 90,213,151,219, 43, 86, 93,103,172,138,182,250,199,207, 95, 55, 55,191, 73,158, 27, 90,103,163,120,189, +103,231, 55, 10,175, 84,143, 79,190,160, 24,142,158,114,228, 85,128, 41,135,162,158,133,183,215, 5,119,146,199,184, 28, 92, 81, +122, 6,220, 65,102,110, 71, 96,181,176,145,165,153,134,193,239,135,206, 56,191,172,150,117,211,196,143,182, 40,119,163,102,234, + 57,151,143,183, 94,111,175,192, 12,167,243,103,146,186,194, 72,147, 6,255,144, 22, 94,101, 19,213,191,143,239,161, 56,159,146, +253,131,128,130,152,118, 49, 66,196,231, 64, 96, 54,130, 70,131,179, 34,192, 48,116, 72,232,208,155,152, 36, 32,120,121,159,147, +247,178, 58, 30,194, 36,227, 88, 20,162,253,137, 90,162,252,168,153, 52,187, 95,206, 85,210,229,200, 83, 45,130,123,152,243,223, +240,252,171, 25, 93, 34, 41,149,142, 40,105, 58, 84,230,160,108,183,169,206, 27,177,106,128, 67,169,208, 82,132,239, 10,107, 41, + 50,151, 3,241,141,104,100, 13,220, 44, 77, 81,231,200,174, 21,148, 26,111, 98,110,237,148, 10,199, 65,244,111,225,184, 15, 47, + 90,168,149,104,165,200, 98,181,167,237, 72,254, 9, 64,221,149,181, 56, 17, 4,225,234,238, 57,122, 66, 68, 16, 23, 22, 87,196, + 7, 87,217,255,255, 55,244, 77,124, 19, 49, 32,235, 34, 43,230,154, 43,211,221,118, 85,117,205,225, 38, 63,192, 48, 15,129, 73, + 66,152,169,233,170,174,250,142, 89,127, 70, 9, 71, 54,169,233,226, 17, 11,234, 22,186,231,122,157, 36,155,113,117,203, 99, 60, +149, 56,222,153, 18, 39,223,137, 46,160,232,110, 97, 76,134,211,116,176, 42,199,200,166,239, 56,142, 87,159,202, 97,170,217, 51, +145, 1, 34, 61, 13,163, 43, 99,109, 22,143,202,154, 34, 94,164,248, 4,173,139, 50, 51,170, 69,154,128, 26, 51,126,252,176,205, +244,183,223, 27,212, 81, 30, 18,169,205,177, 38, 0,117,250,148,231,237,111, 80,139,161,203,130,164, 56,210, 70,216,101,129, 41, +198, 50, 88,215, 51,174, 80, 26,184,178,121, 34, 40,217, 12, 81,143,167,110,247,141,131, 28, 53, 83,212,137, 0, 52,143,231,128, +228,110,198, 21,202,102,158, 94, 67,122, 66, 2,139,182,139,247, 30,182,200,220, 76, 18,242,191,126,237, 2, 60,131,240, 26,224, + 65,100,109,214,148,240,226,117, 56,212,238,229,149,137, 85,248,221,117,181, 63, 14, 77,127,170,125,154,220,162,127,144,135, 23, +225,164,209,121, 16,198,174,198, 8, 84, 35, 48, 10,138,248,139, 3, 61,109,120, 5,210,166, 70, 45,232,212,170,195, 55, 85, 97, +223,223,220,125,250,250, 49,190,255,178,249,236, 37,241, 59, 44,219,137, 79,197,195,216, 9, 35,177,116, 17, 0,170,123, 73, 60, +152,161, 89,100, 78,169,110,223,221,190,125,115, 19, 51,135,106, 91,198,224,251,148, 84, 8, 3,152,148, 16, 19,153,144,218,238, +220,113, 8,101,110, 87,101, 44, 98,202,109,253,136,153,192, 13, 15,219, 95,198, 36,135,193,212,169, 16,196, 8,241, 55, 21, 76, +187, 24,166,110, 98,216,242,184, 49, 11,169, 90,231, 42,125,219,237,145,120, 2, 30, 9, 70, 26,122,100,176,106,242, 89,192,122, +248,126,123,159, 68,247,156,219, 13,141, 14, 22,207,184,206,255,112,240,193,184, 21, 9,103,202,130, 56,142, 88,189,100,110, 33, +177,211,169, 63, 16,126,198,250,166,246,174, 15,204, 99, 66, 12, 17,146,223,226,162, 78, 94, 17,248, 64,217, 60,111,250, 99, 72, +183, 70,114,103, 26,103, 94,138,113,181, 68,115,159,161,224,235, 75,219, 92, 5,151,202,122, 79, 66,128, 0,255,234,137, 79,218, +192, 50, 6, 16,240,226,164,180,110,230,139,238, 19,212,188, 26,117, 17,200,172,244,224,118,189,238, 42,179,118, 62,111,209,193, +163,163, 95,195, 37, 94,115, 7,132,102,123,132,171,137,203,102,167, 96,145,227,130, 96,199, 99,244, 54,254,224, 67,255,106,117, +189, 57,126, 63, 98,255, 18,227,101,128,161, 0,125,238,159, 44,230,200,127, 5, 96,238,106,122,155, 6,130,232,206,126,216,110, +156,224,208, 74,149,104,225, 16,137,123,213, 11,255,255, 14,247,246,208, 72, 28, 64, 2, 10, 74,101,133,184,254,216, 93,118,102, +118,157,164,177,212, 43,214, 30,156, 68,177, 44,199, 25,191,121,243,230,141,156, 42, 18,143,102, 23,158,102, 58,239, 56,117,146, +209,153,149,219, 89, 17,149,140,189, 61,108, 90,144, 1,202,156, 53,232, 92,209, 6, 42, 71,246, 60,227,150, 16, 45,101,161,179, + 51,147,151, 38, 47,100,166, 2,112, 80,212,179, 18,178,103,148,202, 20, 69,248, 28,248,171, 26,195,187, 14, 32,221,177,110,183, + 67, 41, 61,150,212, 10,109, 22, 89,118,183,185,175,251,154, 48,145,165, 17,125, 14, 68,170,132,251,189,254,157,248,211,180, 72, +217, 25,113,183,136,156, 37,202, 35, 61, 22,167,232,127,197,220,187, 2,230,231,233, 53,141,203,149,144, 12, 35,165, 63,144,142, +186,254,201,242,232,188,240,228,149,189,197,122, 85, 63,133,124, 33,197,250,140,118,114,218,105,211,213,239, 40,156, 53, 73, 89, +188,196,185,178,174,125,205,180,253,255,223,198, 59,239, 59, 21,117, 62, 21,250,166, 52, 55,115,179,154,235,183,134, 76,195,123, +191,125, 14,153,143, 60,175,138, 0,228,223, 24,201, 88, 99,108,208,237,112,104,134, 76,195,181, 64, 28, 81,164,110,102,102, 23, +139, 11,155,170,116,204, 50,243, 26, 34, 58, 65, 32,140, 3, 46,177,207,206,214,207,219,207,235, 47, 88,155,194, 84, 76, 41,242, + 37,163,158, 12,224, 70,153,171,229,149,135, 81, 85,125,132,220, 35,142, 4,255,167,126,172,202, 37, 51,174,225,200,187,182,121, +247,254,250,238,126,173,149,161,218,166,229,188,129,207,202, 71,184,126, 80, 76,140, 45,177,120, 71,182, 67,187,217,110,126,109, +127, 14,142, 1, 59,113,184, 86,240, 64, 34, 23,121, 21,239, 34,117, 29,165, 23,251,188, 36,206,140,181, 92,180, 28,162, 33, 7, +219, 15, 34,144,178,100,144,110,165,187, 93,221,146,231, 62, 54,254, 97, 83, 10, 75, 38,227, 67,144,246, 2, 74, 34,147, 71,247, +184, 25,214,113, 24, 64,159,150, 77,112,126,244, 61,221,171, 36, 67,164,121, 16,226,199, 55, 84, 81,180,168,107, 7,228, 74, 99, + 69, 12,128,156, 42,209,114,202, 54,168, 7, 63,188,164, 7, 50, 18,214,140,158, 88, 68, 76, 6,254,201,112,246,242, 93,152, 6, +239, 47,155, 81, 38,192,126,116, 84,190, 62,255, 32,246,161, 83,194, 9,215,122, 26,220,147,107, 2,147,236, 60,164, 51,164,134, + 77,109,127,239,252,147,130,144, 39,205, 43, 89, 45, 68,149,163,109,254, 25, 78,142, 17,170, 23, 93, 39, 26, 39, 7,141,253, 10, +224,197,177,190, 59, 61,205,195,137,125,253,251, 80, 22,229,106,241,241, 82, 94,206,208,247, 47,252, 4, 93, 43, 58,251, 90,144, +248, 39, 0,117,231,182,219, 52, 16,132,225, 61,186,177, 13,137,170,150, 11, 42,212, 62, 0,188, 61, 55,136,247, 64,189, 65,164, + 82, 15, 18, 80, 16,161,137, 15,233, 30,216,153,241,172,237, 40,226,190, 55,201, 85, 36,219,177,199,179,179,255,255,253,192, 23, + 3, 7,188,214,121,238,142,152, 71, 20,110,177,109, 48,253, 93,165,174,166,243, 56,136,215,193, 28,169, 72, 41, 58, 40, 94, 69, + 21,163,114, 32, 71,208,146, 93,227, 56, 94,212, 11,232,247, 11, 75, 30, 13, 24,222,128,235,136,112, 72, 5, 40, 32, 65, 97,153, +154,160,133,133, 22,190,178, 69,109,109,159,150,153, 70, 35,133, 20,158,137,116, 9, 74, 93,244, 97,119,187, 91, 55,190,193,251, +213,121,152, 26, 57,156,238, 5, 94,203,230,204, 23, 37,102,208,125, 78, 44, 33,249, 48,158,220, 0,153,149, 36, 63, 98,222, 44, + 23,247, 33,133,143, 93,106, 98, 34,135,212, 16,109,177,253, 30, 92,186, 40, 43,244,218, 47,141,252,235,252,195, 76, 90, 51,248, + 63, 45,127, 90, 86,145,103,178, 85,110,210, 45, 43,109, 46,140,126,242,254,241, 24,202,249,101, 21,119,197,180, 28,133,166,199, +206,133,203,165,249,112, 85,191,174,204,222,249, 90,203,247,151,103, 17,156,154,162,178,250,231,159,125,223,186, 38,181, 18, 92, +223,211, 15,223,106,191, 90,190,163,244,115,252, 31,137,194, 75,113, 23, 49,245,164, 77,191, 19,135, 30, 98,122,198,198,222,141, + 68,229,103,175,206,211,247,105,125,218,236,183,114, 48, 56,229, 97, 15,201,207,197,166,123,242, 33,240,248, 64,114,133,136,196, + 25,133,233, 12,205,101, 48, 26, 84,161,103,214, 40,123,179,254,246,233,243, 71, 99, 77, 7,122,121, 96,249, 58, 76, 67,167, 9, + 5, 1,138, 38, 70, 88,153,181, 52,168, 96,192,249, 62,199, 62,241,238,127,230, 68,146,163,107, 28, 45, 18, 35, 89,242,254,208, + 96,175,206, 64,193, 97,227, 48, 98, 24, 59,141, 98, 32,203,227,246,215, 29,197, 78,167,195, 47, 79,234,214,245,145,182,105,137, +239, 0,168,214, 19,101, 10, 91, 46,125,117,161,244, 27,115, 5,150, 69, 55,217,104,205,197,221,115, 71, 79, 37,242,249, 94,184, + 47,194,175,175,213,230,235,243,230,183,104,182, 1,102,149, 45, 38,164, 57,230,133, 16,217, 33, 78, 24,140, 81, 78,172,129, 98, + 80,194, 28,228, 19, 77,251,119, 57, 7,160,207,248,134,135,244, 94, 57, 74, 36,245,127,150, 6,199,114, 17, 60, 67,135,218,126, +139, 80,150,105,252,222, 81, 39, 84,148,226,128, 92, 34,199, 91, 47,230, 35, 9, 88,139,119, 93,108, 91,200, 51,238, 61,228,172, +182,132,128,167,205, 97, 52,249,207,234,186,156,191,120,210, 59,243,177,251, 97, 84,185, 42,210, 27, 98,145, 42, 42,174, 3,100, + 24, 55, 68,142,159,235, 63, 1,168,187,182,157,182,129, 32,186, 55, 59, 77,104, 8, 60,208,170, 18,226,153,255,255,137,126, 67, + 69,197, 19,138, 8, 36,160,160,166, 54,182,119,183,123,102,102,227, 77, 40, 18,175, 60, 70, 74, 34, 39,246,206,206,158, 57, 23, +247, 6,202, 18,103, 21, 35,156, 30,176, 79,250,216,190,248,237,169, 93, 80,103, 16,200, 64,208, 87, 90, 64, 31, 27, 13, 90,122, +116, 73, 16,142, 76,109,218,154,160,111, 4,163, 17,166, 37,232,228,233,219,112,207, 77, 85,243, 64,125,162,106,166, 51,167, 23, + 21,184, 16,169,202, 79,210,250,169, 93, 21,180,133, 60,218,185,129, 36, 27, 14, 42,246,190,143,205, 67,243,148,174,164, 7,239, +138, 9,239, 3,101,103, 19,244, 42, 99,105,137,213,166, 39, 95,120, 9, 58,167,120,240, 17,222,240, 48, 87,237,215, 84, 97, 8, +124, 32, 59,102,139, 72, 35,120,124,161, 16,139,148, 67,251,220, 55, 92,181, 29,232,252, 49,245,239,247,225, 56, 11,166,112,150, +144, 49,203, 73,198,106,116, 46,127, 54,243,205, 61,128,105,100,218,190, 32, 47,233, 19, 23,247, 61, 95,222, 21,167,218,157, 82, + 63, 55,221,175, 77, 55,179, 8,122,189,254, 54, 63, 59,173,119, 67,183,152,187,202,186,171,139,233,114,221,106, 28, 57, 35, 99, +244, 88,159, 6,220,108,203,200, 24,235,131,198,243,153, 30,217,191, 33,254,151,228,201, 86, 0, 44,106,222,252,121, 52,218,157, +185,122, 86,127,109,250, 93, 96, 53, 6,147,169,181,112, 55,210,251,102,147,105,186,227,127,219, 93,177, 40,228,137,192, 20,201, + 99,131,110,251,214, 56, 75,158,236,254,203,124,246,176, 94,165, 98,218,189,190,126, 63,255,113,187,252,237,105,120,233, 67, 6, +156,217, 41, 69,123, 97,138,101,143, 99, 60,248,184, 54, 82, 52,167,143, 88, 43,225,163, 81,154,184,160, 89,140,141, 71,155,236, + 54, 99, 58,105,122,204,169,104,146, 74,243, 88, 75,173,143,165,253,140, 11,125, 47, 6, 44,176, 90,231,246, 63,255, 85,176, 98, + 29,124,104,219, 78,139, 50,212,178,201,119, 4,131, 17,212, 84,184, 96,109,159,204,242, 89,173,207,135,203,241, 20,165, 10,102, +100, 41,159, 70,173,191, 81, 97,181, 84,219,149,106,218,212,137, 34, 82, 52,253,150, 33,251,170, 49, 14,197, 59,105,216,187,173, +137, 91,119, 12, 35,176, 30, 63,144, 66,147,225, 24,157,173, 87,162,201, 75,201,239,177,241,162,198,187,247,123,255, 80,152,164, +190,125, 3, 5,174,136,184,172,184, 36,173, 15, 34,250,120, 34,170,195, 17,101, 39,199, 35,141,114,170, 3,119,163, 88,112,240, +205, 33, 45,103,244,184,213,227,230, 97,178,241, 0,186,213,212,200,222, 53, 55,196,163,135, 87,247,128,230, 93, 16,148, 80,132, + 61, 28,245,133,255, 4,160,238,218,122, 26,132,161, 48, 45, 48, 96,211,105,162,137,137, 79,190,251,255,255,142,111, 62,168, 35, +139, 3, 39, 12,218,218,115, 43,133, 45,123,247,117, 25,201,202,224,235,233, 57,223, 37, 59,235, 34,145,120,155, 93, 58, 45,245, +254,148,223,113, 60,230, 52,219,116,155,194,135, 6,143, 84, 84,119,192,189, 6,207, 94, 96,185,128,249, 5,122,103,120,168, 78, +201,189,128,138,165,222,239, 7, 73, 94, 17, 95,145,163, 42, 93,231,108, 14, 38,131,128,203, 37, 36, 97,102, 21, 26, 28,156,172, + 45,210,236, 38, 47, 70,127,222,211,246,164,125,105,212, 66,168, 49,132,136,128,255,190, 95,234, 0, 20, 76,199,165,151,154, 8, + 45, 0,148,150,111, 35, 91, 41,187,192,137,228, 14,186,230, 84, 48,222,153,131, 4, 77, 12, 63, 21,201,141, 39,112,215,145, 47, +167, 70,123, 98, 3, 2,243, 28,241,218,255, 98, 36,111, 44,221,248,149,160, 91, 41, 97,243,133, 52,151, 49, 86, 16, 30,129,181, +144,220, 59,252,194,147,210,159, 88,188,255,107,112,143, 95,155,149, 0,125, 41, 82,222,202,232,231,109,249,250,242,112,232,129, +107,219,118,182,200,211,205,166,120,188,171,186,222,102,237,112, 76, 44,181,176,238,171,245, 97,248,165, 35,151, 75,196,130, 95, +207, 76, 60,221,196,164,152, 89, 49, 5,232, 71,132,135,203, 61,222,213, 77, 93,100, 43, 55,146,146, 84, 97,150, 29, 22, 27,252, + 38, 66,242,159,236,253,209,114,176, 16, 70, 77, 40, 20, 89, 96,104,101,212, 8, 62, 42,197, 79,211,228,171,220, 12,102, 63,212, +187, 67, 13,202, 22,235, 33, 14, 6,254,200,140, 68,211, 91, 8,228,145,198,185,150, 88, 32,197, 3, 29,129,120, 84,120,187, 32, +198, 83, 46,114,202,165,217,147, 65,242,177, 34,242, 3, 52,135, 52,123,233, 40, 49,165,214, 44,124,159,124,187,144,169,236,175, + 99,172,151,128, 59, 98, 9,225, 0, 3, 3, 41,140,213,227, 8, 41, 92,205, 62,169,119,238, 29,240,125,140, 90, 25,106, 62,110, +181,193,207,238,173, 79,190, 62,244,241,219,246, 39,232, 52,140,230, 54,201, 90, 88,141,225, 67,148,101, 30, 35,181,165, 22,149, +109, 48, 3,176, 60,222,188, 50,113,114,129, 79, 98, 46,139,181, 85,252,255,207, 92, 0,231,109,153, 40,170,240,202,179,235, 22, + 26,168,179, 70,141, 90,140,123,195,169,194, 73, 60,212,178,218, 72,162, 83, 86, 4,202, 65, 64, 29,115,199,137, 5, 43, 1, 74, + 49, 89, 73, 99,227,177,119, 51, 55, 99, 78, 46,188,184,160, 63, 1,152,187,150,228,166,129, 32, 58, 31, 73,182,113, 28, 39, 44, + 96,145,170, 28,129,251, 95,133, 19, 64,130,171,136, 13,182,132, 52, 51,141, 94,247,244,100,100, 10, 42, 75,188,151, 74, 37, 89, + 79,253,121,159,130,239, 73,193, 48,147,114,212,205, 39, 50, 81, 28,241, 27, 3,178,151,227,157,191,221, 80, 11,170, 98, 52,146, + 76, 45,123,204, 14,234, 58,150,111,107,215,199,121,144,124, 35, 96, 75,234, 37,147,208,105,220, 41, 89,191,243,110,203,177,174, + 93,211,108,154, 53,236,191, 29, 93,220,144, 58, 64,194,224, 71,156,184,113,241, 28,224,230,141,121,106,138,234,180,137,218, 2, + 66, 16,202, 70, 4,164,227, 42, 80, 93,184, 29, 76,172,113, 20,104,118, 69,131,154,115,180,115,130, 37,115,132,140,171,182,234, +206, 72,227,162, 91, 54, 86,130,147,179,175, 61, 14,205, 95,164, 83,232, 99, 81, 43,128,152,109,175,220,154,189,114, 69, 68,222, +205, 17,113,188, 95,117,218,243,102,127,145, 76,137,154,207,179,181,118,254, 90,124, 65, 81,246,134, 90,230,255,254, 57,157,164, +175, 52,159,228, 29,168,119, 8, 41,220,111, 87,159, 30,223,223,221,223,124, 62,124,223,128,207,146,154,134,186,174,189,191,233, +250,159,211,140, 18,109,140,107,107, 31,118,237,184,218,247,163,167, 44,117, 70,189,154,149, 43, 28,218,158,201,138,204,185,207, + 10,226,180,192, 7,158,186,113,227, 6, 16, 5,150,131, 16, 57,245,128, 83,140,245,163, 70, 70,136,120,146, 71, 4,214, 26,251, + 71, 18, 51,169, 61, 30, 8,237, 60, 35,151,247, 57,128, 45,246, 43,140, 1, 6,124,132,132, 34,120,115,128, 21, 19,120, 12, 27, + 24,192, 95, 35,128, 22,105,192,202,124,150,160, 75,167,174,153,185,126, 39, 53,234,192, 95,153,173,253, 4, 33, 19,251,237, 19, + 47,168, 37,251,143, 62,238, 63, 60, 29, 15, 62,123, 85,139,255,129,208, 16,193, 88, 6,239,221, 6,201, 96, 16,201,104, 33,255, +138,211,152,229,156,139, 38, 26, 63,198,230,114,246,167, 23, 58,196, 96,124,201, 48,138, 85, 33,159,106,196,159, 47,235,235, 55, +243,242,108,206, 71, 51,244, 54, 76, 38,132, 31,211, 37,133,144, 23,204,114,159,196,150,196,230,201, 87,126, 80,170,177,215, 66, +183,208,222, 23,196,149,180,152,165, 95,239, 87,255, 65,250,166, 37,219,199,214, 14, 45,244,215,249,126, 93, 35, 64,228,224,220, + 52,141,230,205, 47,227,210, 13,230,234, 32,170,221,128,139, 67,125,101,221, 78,173,109, 87,221, 26, 33,242,124,119,197,196,183, + 18,187,202,250, 48, 41,210, 23, 57, 85, 42, 67,174,219,245,110, 62,246, 56,156,234,171,250, 45, 0,115, 87,179,155, 54, 16,132, +103,108,175,193,118,164, 20, 18, 85,170,212, 7,232, 51, 84,125,251,168,143,144, 67,115,234, 37,149, 80, 83, 75,169,192, 6,214, +222,141,231, 15,219, 20,114, 46, 39, 31, 48, 32,172,157,253,118,230,251,201,230, 63, 78,184, 62, 81, 28,141,162,122,184,244,178, + 1,165, 72, 84,196, 58,214, 85, 90,149, 80,177, 62, 91,124,117, 8, 96,245,106,163,159, 49,203, 31,114,246, 58, 77,101,112, 25, + 37,241,146,154,239, 67,169,116, 72,209,169, 64, 54, 3, 46, 77, 51, 74,119,131,195,107, 95,135, 5, 25,184,228,108,252, 94, 22, + 55, 69, 85,174,238, 86, 79,143,143,100, 18, 78, 38,133, 65, 38,102,172,114,238,197,138,210, 92,195,212, 48, 28,163, 57, 75,112, +204,207,132, 39, 99,222, 29, 70, 16,210,104,142,228, 36, 90, 27,247,206, 83,142, 15, 55,149, 4, 26, 41,216, 79,232,120, 76,163, +225, 63,116,198, 39,244,237, 72,148, 69,158,247, 5,206, 64,235,194,144,123,193,116, 28,150, 33, 83,214,114, 74, 83, 23,250,244, +134,175, 61,243,213, 28,191,243, 99, 2,155, 62,180,239,176, 2,254,123,216, 30,255, 89, 54, 29, 31,113,128,254, 16,252,224,178, +219, 42,255,124,127,179, 94, 87,191, 94,155,109,227,189,199,172,195,204,245,197,194,125, 90, 47,186,237,209,123, 40, 49,174, 74, +215, 64,254,115,159, 39, 44,105, 81, 93, 73,192,147, 56, 99,128, 11, 95,191,124,251,254,227, 1, 76, 9, 29,103, 9,243,150, 2, + 20, 85, 76,130,154,204,102,180, 60, 53,219, 0, 49, 35, 84,222,132, 60,252,112,113, 61,115,121, 39,238,197, 0,108, 82,245,102, + 8,253,176, 4,142,157,200, 50, 3,201, 53,185,207, 45, 23, 76, 45, 15, 65,213, 61, 32,123,147,208,188,213, 71, 31,141,103, 35, + 60,180,225,173,153, 88, 13,227, 20,187, 89, 67, 67, 88, 12, 12,100, 80,187,217, 50, 68,104,253, 33,196,110, 68,158,209, 52, 83, +195, 41, 91, 20,223,226, 71, 72,197,193, 11,183, 7,116,184,128,149, 91, 50,239,157, 40,103,116,207,113, 7,127, 95,240,247,209, + 67, 17,141, 33, 19,230,156,200,177,191,177, 1,124,121,134, 93,157, 28,118,221,126, 7,195,179, 28, 78,212, 33,106,206, 85,156, + 16, 14,131,138,222,205, 84, 32, 41,150,203,182,221, 74, 26, 93,144,112,117,152,182,228, 47, 79, 83,241,122,249,188, 82,109,167, +136,248, 82,120,221,165, 91,148,211, 46,185,127,120, 70,206,141,147, 93,231,125,102,102, 60,243,236, 45, 92,217,248, 45,142,251, +214,108,173, 80, 14, 87,146, 90,113, 55,161,174, 57,183, 78, 52,255,227,198,167, 76, 41,251, 46,178,138,234, 90,195, 12,227,235, + 77, 0,222,174,100,183,109, 24,136,114, 72,138,150, 92,219, 41,156, 67,209, 94,210, 91, 17, 32, 95, 18,228,215,130, 2,253,167, +246,222, 91, 15, 69,128, 32,233,130,194, 49, 26, 43,146, 37, 75, 28,214, 51, 36,173, 37,201, 45,232,209, 7, 25, 90,103,134,143, +111,209,189,222, 70, 35,175, 12, 16,141,175,158, 33,101,212, 11,190,201, 38,140,159, 81,222,228, 37,108, 39, 42, 91,200,153,102, +229,118, 8, 70, 1,239, 88,167, 12,251,100, 88,231,243,152,132,214,236, 91, 45, 21,153,188, 19,236,161, 88,185,188, 91,213,247, + 5, 50,221, 86,203,253, 4,151,218,108,174, 23, 71,199,203, 15,167,167,231, 23,231, 39,103, 39, 87, 95,175, 62, 93,126, 92,253, +249, 69,193, 76, 2, 45,225, 66,241,229, 97, 71, 42,201,116,167,200, 96,242,139, 91,233, 2,157,102,224,235, 27,173, 86,227,246, +233, 33,205, 99,176,125, 58,122, 70,225, 16,223, 24, 92, 88,202,211,154,102,195,229,123,198, 55,184,180,194, 56, 55,209,144,245, +224,102,197,213, 31,216, 25, 62,229,232, 65,201,122,120, 5,100, 93, 97,232, 59,160,114,191,255,224, 12, 55,206, 4,224,214,138, + 7,210,184,254,111, 32,197,189,208, 95,201,206, 97,180, 35,229,250, 61,100, 96,202,127,214,226,204,225, 22,237,205,223,205,122, +215, 54, 72, 97, 78,182,109,139, 10,166,169, 62,158, 79,202,197,238,205, 52, 49, 42,185, 46,244,207, 13,111, 59,178,221,250,124, +242,154, 16,252,186,124,123,244,238,199,250, 6,152, 65,252,249,219, 23,146, 61, 75, 23,124,253,226, 87,231,250,204,183,195,154, + 57, 90,248,246, 38,233, 40,153, 60,112, 91,186,192,215, 94, 22,140,232,196,148,232,167, 81, 69,180, 71,244,182,118, 90,185,136, +180, 51, 38, 35,188,143,105,144, 20, 69,243, 27,223,176, 85, 8,115,226, 22,226,177,111, 16,135,149, 7, 72,136,210, 29, 12,254, +190, 72, 83, 92, 16,246,171, 48,215, 99,132, 87, 56, 67,134,218,222, 42,191,227, 57, 68, 36,202, 52, 54, 72,180, 48,248,164,209, +175,105,250,234, 97, 91,176,186,156, 85, 66, 4,221,107, 98, 36, 40, 73, 87,195,166,250,208, 84,203,187,124, 86,213, 75, 40,170, +247,237,247,184,123,148,244,140,104,154,161,138, 85,253, 22, 38, 95,111,171,123, 81,151,184,171,217,228,156,252, 88, 3, 65, 20, + 59,161,107, 4, 94, 48,160,201,176, 95,224,180,232,145, 47, 23,113,109, 55,130, 23, 32, 70,197,249,195,159,100,186,143,253,100, +134, 85,122,132, 6,141,222,115, 28,185,255, 75, 74, 50,232,217,180,120,250,213,128,109, 73,103,155,153,116,127,246, 13, 91,166, + 63,211, 36, 70, 17,169, 97,217,230, 65, 58,143, 25, 27,169, 26,162,200, 65, 47,124,143,204, 1,224,169, 58,228,186, 66,111, 71, +232, 16,136, 65, 94, 85,221,182,238,209,109,250, 39, 0,111,103,204,219, 54, 12, 68, 97,145, 34, 41, 43, 78, 16, 27, 69,129,174, +201, 18, 52, 91,183,238,253,243, 29,138,246,111, 36,118,108,184,173, 45, 81,180,196, 43,239,120,100,168, 38, 40,138, 14,245,160, +145,144, 44,137, 60, 29,191,247, 30,231,243, 41, 42,119,115,135, 58,201,167,242,185,250, 88,131, 67, 1, 36,185,112, 99,195,187, + 9, 54, 10,160, 80,184, 93, 73, 85, 27,231,189, 17, 26, 13, 12,164,194,234, 94,106,132,115,136, 83,177,112,126, 26,246,155,126, +187,113,219,157,221,246,211, 9, 51, 6,101, 76,147,167,122, 97, 26,123,219,119,221,241,253,253,253,237,199,155, 55,205,250,212, +217,195,247,195,224,200, 66,122, 12, 63, 71,159,191, 72,188,113, 33,150,222, 98,159, 54, 69,147, 35, 15,150, 45,192,222, 60,130, +160,151, 28,199,204,168,140, 18,209,184, 35, 90,122,196,142,123,157,164, 77,156,129,156,141,250,136,155,132,112, 45,199,243,105, + 51,218,150, 2, 84, 13,173, 23, 22,247, 34,144, 68,222, 97, 31,149, 27,205,215, 36, 93,208,244,153, 99,140,188,208, 82, 83,214, + 14,229, 83, 83, 88, 40,246,134,125,171,132, 6,185,159,252,211,127,244, 36, 16,105,109, 47,219,150,179, 88,128,127,154,223,171, + 2,155,201,227,251,103, 54, 20,208, 19,180, 70, 97,245,113,112,248,225, 94, 99,250,156, 86, 98,185, 80,151, 11,125, 85,139, 1, +154,207, 15,114,107, 37,111,105,225,255, 90, 55,234,226,100,143,161, 52,254,105,127,136,164,140,163,123,140,107,128, 86, 77,120, + 36,226, 14, 74,126,218, 33, 33, 18,220,188,203,134,123,153,179,137,192, 99,242, 47,100,204,220, 51, 1,189, 94,174,172,115, 69, +248,118,154, 21,124,230,109,162,104, 40, 42,121, 72,223,134,199, 8, 37, 82,240, 47, 99,195, 69, 10, 68,114,139,202,203, 17,123, +194,166, 13,126,214, 78,231,216,144, 42,209, 91,130,211,197,216,173,154,141, 20,240,176, 90,174,194,200, 14,227,145, 61, 37, 31, + 84,153,207,155,144,152,199,211, 49,152, 0,222,145, 23, 3, 55,134,194,203,104, 84,115,217, 94,185, 80, 53, 73,181, 16,245, 7, +185,190, 85,239,160, 50,230,124,238,222,222, 61,126,106, 33, 73,243,178, 80, 89, 22,114, 39,188,152,175,149,250,246,197,218, 93, +213,239,125,127,240, 67, 15,206,194,232,136,143,164, 69,193,243,140, 49,111,173, 80, 34,196,196,230,131, 80,206,113,233, 81,242, +101,178,104,225,151, 5,226,185, 41, 51, 31, 22,254, 92,164,252, 54,179,195, 11,224, 38,178, 72,121,137, 17,105, 11,127,166, 20, +134,234,186, 93, 57,140, 27, 28,197, 44,202,237,149,145, 35,129,154, 99, 2, 17, 58, 34, 11, 94,145, 80,175,169, 36,108,254,226, +245, 74, 59,200,162,140, 34,121,209,234,121,101,168, 95, 2,240,118, 37, 59, 13,195, 64,212, 75,156, 46, 20, 16,156,248, 8,126, + 30,144, 42,190,129, 63,224,196, 1,209, 3, 75, 27,154,110,105, 98, 15,158, 25,219, 73, 74,133,224,194, 61,109, 26,215,241, 44, +111,153,172, 23,118,128,222,185, 84, 61, 98, 68,113,192,174,229,252,119, 17, 98,131,135, 19,230,206,152, 93, 84, 77,189,183, 5, +157,158,216, 97,215, 26, 27,131,171, 38, 71, 17,173, 82,196,211,194,157, 81,185,218, 98,219,208, 41,166, 77, 18,104, 73,186, 39, +127, 69,237, 67,122,230,136, 58,233,239,216,192,108,246,124,119,115,123, 63,157,126,124,204,215,235,101,185, 41,201, 63,154,222, + 10, 31, 68, 44, 67,109,105, 96,146, 32,215, 7,136,222, 13, 36, 47,232,208,170, 84,226, 16, 48,217, 76,209,152, 8,201, 84,119, + 96,210,171,130, 80,215, 56,121, 40, 79, 75,238, 99, 84, 53,248,199, 83, 11,116,220, 22,148,173, 75,131,112, 54, 87, 88,112,238, + 31, 31,169, 97,173, 27,193, 88,171,201, 0,237,176,124, 1, 51, 50,208,144, 85,224, 8, 77,204,157,246,137,186, 1, 99,205,216, +194, 99,213,188,255,111, 23, 5, 34, 95,115, 23, 69, 88,166,227, 32,102,251, 61,162,223,131, 1, 92,184,232,142, 75,193, 54, 44, + 84, 56, 87, 75, 31,159,215,106,226,154, 44,167,190, 92,173, 70,198,161,103,131,116,167,131,236,225, 69, 63,205, 73,126,141, 27, + 3,225,122,218,134,174,220, 20, 52,248, 69,182,248,152, 12,178, 77, 64, 35, 71, 83,161, 60, 85, 49, 44,206,156, 13,209,101, 35, + 64,244,148, 35,150,109,131, 50,189,148,151, 71, 46,121, 95,238, 98,204, 80,169,165,128,228,198, 33,226,252, 14, 56,201,206,124, +176, 65,225, 4,105,212, 32,118,130, 40,103,181,244, 85, 54,142, 31,138,163,195, 68,192,161,100,148,204, 80,226,172,193,181,241, +227,184, 32, 37,124, 74, 7, 81, 29, 59,142, 97, 63,158, 61,200, 96,190, 90,164, 18,211,165, 95, 25, 6, 99,112, 29, 33,138,117, + 1,193,240,148,189,135,113,161,208, 18,126, 91,106, 61,244, 87, 93,231, 87, 23,217,228,117, 83,236,242, 26,106,181, 95,149,141, +184,244, 91, 1,242,158,132,181,157,119,197,118,183,111,203,202,126, 74,191,242,117,229,136,238, 16,103,181, 49, 49,137, 12, 71, +228, 17,170, 10,203,127, 82,251,152,211,248, 78,206, 30,207, 68, 68, 14, 66, 55, 8,218,158, 5, 28,201,222,225,247, 39,251,241, + 90,221,177,207, 99,143,130,249, 13,159, 21, 98,185, 45, 34,189,238, 16,222, 21, 45, 97, 38,180,206,122,206,137,180,101,135, 58, +223,218,138,110,247,215,254,235, 33,118,218, 5,138,127, 98, 71, 10,241, 37, 0,111, 87,178,211, 48, 12, 68,189, 36,105, 83, 10, +226,194, 17,241,255, 95,194, 47, 32,132, 4, 18, 2,169,128, 80,171, 82,234,198,177,141,103,177,227, 4, 4,136, 3,189, 85, 85, +183,140, 51,235,155,247,170,156,189, 37,133,169,144,232,137, 37,143, 35, 28,118, 46,137,150,148,154,101,208, 96,135,179,169, 97, +240,232, 9, 42, 4,152, 48,229,129,140, 91, 72, 43, 13,220,154, 61,105,102, 14,154, 41, 72, 36, 1, 11, 73, 4, 82, 68,149, 98, +141,232,121,237, 92, 3,248, 0, 21, 98,233,214, 54,237,245,237,213,225,221,192,134,170, 3,245,142,222,117,214,198, 10,166, 3, + 65,152, 64,107, 31,161,212, 54, 10, 12, 9,102,236,145, 47,210, 73, 18, 58,163, 36, 29,191, 81, 49,201, 42, 9, 92, 38, 42, 96, + 50, 23, 47,168,203, 97,234,205,225,193, 51,180, 45, 70,182,103,223,145,232, 65, 29,109,166,130, 5,165, 52,176,216,137, 6,197, + 16,155,102,170,139, 74,206, 26, 16, 58, 58,154,145,254,179, 56,105, 32,121, 55,224, 4,228,124, 46,218, 16,238,159,204,205,254, +255,156,123,118, 31,117,250,145,203,244, 84, 39,224,249,161, 16,125,213, 5,143,216,111,194, 70,126, 99,159, 38, 16,203,132, 84, +235, 73, 61,220,122,175,251,232,175,150, 72,169,214,202,190,209, 42,154,215,116,246,242, 97,119,247, 26,234,154, 41, 46,114,142, + 66,169,128, 99, 82,163,209, 33, 7,185, 15,204, 91, 75,180,100, 81,224, 15,186,242,138,101, 32,100,214,246, 16, 25, 68,144,210, +246, 98,248, 18, 86,235,149,202,119,178, 31, 13,208,218,217, 98, 99, 54,176, 18,146,228, 31,104,177,133,217,109, 8,171,139,114, +207, 89, 70, 54,196,218, 60, 84,169,156,166, 99, 39, 39,224, 11,149,161,152,137, 43, 55,121,122, 73,172,150, 49,239,130,184, 11, +116,143, 26, 14,170,194,213, 41,193, 84, 80,236, 74,104,154,140,175, 84, 85, 99,236, 65,229,209, 94,130,171, 16,236, 18,106, 87, + 80,190,241,231,245,241, 89,125,250,248,246,210,225,111, 48, 59,107,119,235, 94, 92, 40, 55,236,172, 78,186,222, 14, 57,129,228, +118,171,220, 94, 56,131, 12, 54, 61,201,162, 80,219, 42, 99,127,184, 81, 44, 71,126, 42, 3, 72, 44,178, 48, 50,109, 28, 67,224, +113,223, 29,155, 84,201,128,114,176,103,200,193,130, 81, 55,133, 28,246,247,143,145,103,199, 38,181,159,156, 94,140,227, 95,110, +167, 18, 89,163,144,159, 64,240,126,250,249,194, 49, 69, 90,233,142,115, 81, 16,116,221,196,203,245, 55,198,145,226, 66,132,178, +200,246, 63,253,247, 15, 1, 72, 59,159,222,132, 97, 24,138,215, 73,128,178,162, 29,166,221,216,113,223,255,235,236,178,105, 55, + 54,105, 82,217, 6,165,165,109,146,213,118,210, 36, 45,251, 35, 13,113, 64, 72, 32, 68,133,121,182, 95,126, 79,197,175, 7,207, +183,231,235, 35, 2, 52,216, 58,154,169, 71,114,241, 72,133, 79, 37,128, 99,197, 3,147,175,249, 25,154,132, 83,250,140, 21, 81, +208, 8, 93, 24, 76,212,118,115, 32, 57,116, 1,154,244, 44,126, 94,180,237,162,151, 92,169,114,255, 38,105,125,139, 12, 58,131, + 39, 16,113, 56,163,123, 67,245,221, 37,103,251, 48, 67,239,235, 12, 37, 94,122,165,224,250, 96, 24,131,205, 28,194, 27,192,101, +172,129, 13, 1,171,174, 12, 72,118, 31,139,104,214, 69, 93, 13, 17,254,106, 90, 79,111,176,190, 99, 7, 93, 25,194,213, 91, 68, + 43,229,185, 42, 90,168, 72,179, 45, 73,111,174, 21,228, 67, 39,140,192, 52, 78,131, 0,132,217,103, 98, 13,246, 80, 54, 15,187, +211,179, 54,205, 37, 55,164,138,194,249,254,127, 83,254,125,164, 31,149, 72,127, 95, 82,217,109,105, 91, 80, 80, 81, 30,231, 42, +205,143,186, 32,139, 88, 99, 38, 21,158, 34, 10, 23, 28,193,194,218, 95,148, 86,247,178, 83, 71,209, 99,117,110,224, 12,250,118, +248, 34,235,190,172, 50,220,192,227, 14,148, 81, 66, 73, 5,148,228,126,159, 43, 93, 37, 84,177, 42,246,186,229, 36, 1,240,240, + 42,152,104, 28,247,200, 12,127,174, 2,198,245, 86,144,237,169, 48, 20, 0,137,159, 34,132,162,217,236,245,125,103,177,201,164, +109,175,225,188, 80,195, 28, 49,150, 1, 25, 25,128, 33,104, 43,215,254,198,199,100, 60,100, 44, 26,134, 49, 58,152, 60, 97,249, + 98, 37,164, 28, 26, 99, 90, 8, 19,230,136,116, 9,201,112, 34, 51, 80,196, 50, 57,147,199,217,133,179, 15,185,189, 32,192,245, +213,166,222, 87, 26,196,132,184,231, 26,139, 12,184, 24,223, 23,219,247,174, 42,235, 79, 28, 28,246, 6,154,230, 68, 37, 1, 73, + 35,154,127,150,233, 42,144, 81,182,131, 22,248, 56,224, 57,141,161,178,119, 29, 5,113,106,232, 17, 26, 75, 88, 4,147, 86,183, +212,188,103,220, 98,245,238,102,187, 90,230, 79, 47,143,124, 56,198, 19,146, 67, 89, 79,160, 67,102,204,179, 8, 17, 28,246,247, +217,204,244, 31,198,207, 42, 46,220, 86,139,245,185,107,230, 18,158, 59, 8, 26,208, 59,210,251,172, 75, 0,223, 84,234,232,235, +178,147, 5,253, 49,117,182,152,239, 79,216,206,117,250,124,213,108,254,230,162,254, 18,128,180,115,219, 73, 24, 8,194,112,103, + 89, 10,229,144,160, 55,222,249,254,143,164,183,106,140, 24,130, 17,180,212, 30,118,236,156,150,150,214, 24, 35, 15, 64,104,179, +204,238,206,252,255,247,251,243,251,179, 88, 19, 20,252,133,173, 12, 60,143, 33,130, 92,152, 57,113, 41,206, 30,133,198,234,130, +164, 26,114,134,153, 6, 88,203, 30,124,193, 72,224,178, 28, 36, 65,195, 81,188,147,243, 46,168, 13,139, 89,104, 14,234,252,192, + 77,241,137,140,141, 9, 84, 84, 19,171,154,204, 35,168,180, 36,118, 33,152, 90, 70,133,152,120,177,205,154, 77,201, 76,171,104, +249, 12,224, 72,167, 47,184, 86, 55, 57,215,119,137, 89,160, 3, 82, 29, 89, 78,102, 25,164, 39,105,171,244, 71,149,175, 89,238, +194,128,105,136,179, 68,134,107,192,173, 79,143,245,151,231,138,118, 40,131, 75,125,150, 38,243,153, 95,103,211,205,210, 47, 82, +223,148, 97,187, 59,221, 63, 28,239,138,106, 55,214, 50,243,182,209,186, 14,122,247,255,103,246,218,208, 55, 83,110,152,144,176, +135, 18, 60,233, 96,178,118,232,137, 7, 71,150,180,207,146,235, 62, 63,124,106, 62,117,111,174,197,225, 60,182, 27,127, 51, 25, +172, 75,176,157, 67, 26, 86,237, 70, 50, 7,156,242, 5,189,106,160,168, 67,153, 80, 42,202,161, 0, 63,135,155,141,127,217,209, + 72,162,225,210, 3, 61,169,174,242,208,237,101, 27, 63,131,187,221,146,161, 65,206,186, 32,130, 47,250, 39,198, 19, 45,246, 14, + 57,186, 72,250, 34, 57,252,245, 82,108,232, 49,100, 57, 15,136,218, 32, 40,151, 92,217, 94,137,242,179,206, 72, 21, 48,247, 44, +152,243,133, 33, 50, 17, 5,213, 89,168,150,133,125,181,188,174, 67, 85, 20,133,227, 40, 4,210, 71,154,151,150,193,186, 78,104, +226, 19,254,187,114, 60,103, 84,141,203,226,165, 2,179,202, 86,135,252,253,121,191,181,161,156,235,249, 65, 21,192,222,222,182, +155,246,224, 49,115,243,183,252,181,106,239,199, 88, 82,195,168,200,203, 69,170, 15, 46,125, 24,175, 99, 65,249, 34,198,211,242, +157,224,152,135,166,162,230, 12, 18, 61,132,221,141, 68,239,150, 1, 47, 74, 68,185,222,107,130,208,114,236,152,171,121, 42, 79, +251, 71,173, 40,138,116,199,177, 22, 10,170,132, 20, 53, 11,219, 14,239,161,139, 17, 78,126,152,193,226, 88, 55,166,233,235,152, +227,231, 84,157,220,176, 61, 38, 3,122,192, 44, 93,145, 61, 66,227,156, 35, 71, 22, 76,121, 69, 6, 24,136, 82,221,145, 26, 13, + 67, 97, 15,142,133,187, 95,254,128, 1,111, 60,252,197, 31,243, 45, 0,105, 87,178,211, 48, 12, 68,109, 39,221,145,160,136, 59, + 66,226,255, 63, 9, 46, 8, 85,130,162,148,226,180,113,108, 15,158,197,169,187, 32,129,232,161,135, 30,186, 68, 29,103,230,205, + 91, 10,126,164,152, 34,131, 57, 77,177,144, 54, 46,224,223, 43, 71, 69, 82,216, 2, 93, 95,147, 26,240,244,191, 50, 3,157,156, +196, 23, 90,112, 75,163, 10,173,247,208,107, 84, 64,233, 86, 94, 87, 21,226,248,134,149, 26,100,188,137, 86,192,121, 5, 42,235, + 32, 37, 6,120,104,113, 22,153,147, 31,100,134,101,226,166, 65,177,147,196,114, 28,124,153, 9,200,171, 36, 74,150, 49,119, 62, +220, 41, 84, 77,218,119,105,225, 17, 98, 65,165, 71, 32,150, 51,168, 90, 38,100, 33, 91, 10, 85, 55,125,196,196,181, 55, 36, 52, +141,178,244,146,241,172,131,248,238,252,227,108,210,108,251, 53,245, 61, 29,168,198,186, 57,132,169,130,221,206,239,214,122,181, +117, 47,155,238, 53,115, 18, 76,145,139,116,142, 24,142, 50,172,241,207, 46,190,202,166, 55,124,231,184, 85,234,186,102, 11, 68, + 61, 31,225,250,120, 15,105,206, 48, 11,114,123,243, 65,245, 30,246,125,216, 58, 24,108,238,246, 66,112, 20,160, 6,142,238,212, + 71,101, 83, 23,252, 10,190, 61,196,108, 27,121, 69,103,189, 37, 27,196,218,227, 18, 98,140,153, 1,245, 24,213, 17,176,105,195, +114,209, 27,206,234, 30,192,194, 60, 33, 28,124,133,142,246,157,154, 66,233, 56, 28,140,248,136,236, 28, 36,240, 11,243,101,212, + 41,246,114,177, 75, 42, 37, 83,240, 67,228, 54, 70,135,233,152, 39,196, 32, 73, 55,194,189,201, 89,157, 32,254,182,116, 43, 18, +241,183, 46, 43, 28, 74, 92,151,149,213,195,158, 53, 61,111,108, 99,216, 48, 91, 31,192,210, 92,155,134, 65, 31, 93,226, 79,192, + 87, 94, 20,255,236,100,214,124, 53, 66, 13,206,254,228, 89,167, 69, 6, 74,149, 80, 54,211,219, 45,170, 89,235,221,199,222,246, +161,183,206, 58,191, 90,250,153,183, 40,223,133, 57, 23,179,108, 9, 35,168, 44, 53, 33,171,216,168,188,253,132,224,198,169, 18, +131,182, 88,126,248,154, 88, 17, 4, 73,224,224,145,253,254,238,225,249,237,105, 90, 79,218,116, 62,178,190,138, 42,178, 98,255, + 31, 37, 91,110, 85, 56,121, 29,166,174, 56, 80, 5, 65,159, 55,239,199,237,196,239,203,228,188, 83,209,151, 68, 81, 80,204, 17, +184,116, 41, 78,195,233,104,220,245, 29,127,231,244, 67, 82, 35,215,246,219,242,112,199,236,248,200, 59,204, 83, 32, 19, 10, 27, +203,242,148, 47, 56, 61, 23, 86,175,127, 61,217,249,241, 45, 0,105, 87,178,211, 48, 12, 68,227, 37,132,210, 5, 33,129,248, 2, + 46,252,255,119,112,224, 3, 16, 2,113,107, 5, 74,218,102,243,130,103, 60,227, 56, 85, 37, 4, 72, 61,244, 80,181, 74, 19, 63, +143,103,222,162,103, 87,235,217,169,158,127, 64,206,160, 57,151, 77,161,199, 54, 13, 66,224, 11, 12,234,234, 0,143, 44, 10,242, + 98,135, 94,122,198,119,155, 90, 38, 18,170, 12,176, 30,192,177, 70, 18,116,168,248,236, 27,103, 49,121, 12,152,243,113, 18, 64, + 78, 74, 46,137,242,224, 94, 91,239,179,117, 8, 52,122,104,114, 78, 99, 17,124,114,116, 84,252,197,242,136, 90,237,128,238,144, +171, 1, 47,141,109, 79,234,199,123, 52, 74, 8,219,135,140,178, 64,128,140,216,170,138,203, 80, 2, 53, 78,172,150, 55,227, 97, +167, 49,111,179,199,191, 38, 0,241, 32,138,123,184,157,102,244, 23,143,139,213, 83, 91, 71,203,176,176, 27,189,236,237,184,111, + 7, 14, 57,210,248,121,193, 29, 24,149, 87,164,153,144, 35,233, 74,226, 39,199,127, 84,238,201,253, 38,188,191, 21,226,186,244, +189,144, 99, 33, 42, 37, 22,165, 44,117,184,145,178,210,190, 43,228, 74,139, 5,196, 49,187, 59,173,143,157,219, 30,204, 87, 11, +227,241,142,149,183,197, 79, 58,242, 52,162,138,212, 11,197,166,240,138, 99,252, 96,226, 10,141, 93,223,132, 50, 93,234, 37,244, +150,193,121,179, 44,237,177, 18,101, 37,186,174,178, 54,146,210, 37, 97,187, 77, 49,216, 42,167, 19,196,101, 0, 14,133,236, 2, + 77, 43,135,124, 77,125, 30, 15,118, 30,220, 9,121, 49,204,154,123, 76,232,136,193,167,133, 68,219,192,128,208, 36,126,178,140, +233,137,123,227,104,172,230, 19,247, 98, 90,145, 42, 25,226,251,169,120,167,125,210,171, 25,208,112, 30,100, 50,213,193,201, 23, +105, 92, 33,205, 88, 57, 14, 4, 98,125, 62,185,166, 58, 65,108,255,137, 88,130,133,191,156,194, 43, 40,243, 2, 26, 56, 64,206, +177, 96,102, 32,225, 89,135,157,216,143,198,185,214, 12,199,207,143,117, 91,155, 26, 92,221,139, 13, 28,244, 68, 74, 42,194,171, +210,170,232,195, 77, 11,103,177,102,251,112,185,121,222,189,143, 67,141,140, 81, 76, 10,177,104,111,150,104,166,120, 26,126,219, +190, 66,117,108, 58,146,178, 98, 23, 41, 67, 82,204,207, 66,135,247, 9,100, 24,204,248,244,197,220, 25,218,178, 79,138,119,225, +127,185, 40, 78, 58,138,231,235,230, 25,221, 82,156,176,239, 17,220,233, 60, 2,195,229,177,113, 89,142, 18,166, 17,158, 61,123, +251, 74, 93,117,182, 69,231, 72,119, 50,190,202,209,124, 89,173, 15,125,147,115,219,254,166,137,249, 22,128,179, 43,217,105, 24, + 6,162, 94, 40,105,105,161, 82,132,250, 15,252,255,127,240, 1, 72, 92,185,176,137, 2, 77, 66, 60, 54,158,205,117,155, 34, 4, +183,222, 26, 39,246,140,103,230, 45,103,245,170,248,173, 65, 53, 36,134,163, 65, 66,213,230,183,123,225, 52, 57,114, 81,124,110, +172, 83, 50,118,190,214, 75, 81,205,197,181, 99,205, 15,138,168,116, 85,139, 66, 82,162,173,128,107, 70,112, 0,154,111,123, 0, +153,134,241,104,133, 42, 97,206,243, 34,254, 90,196,175, 89, 26,210,231, 59,247,158, 53, 76, 7,213, 36, 83,121,168, 82,139,198, +210, 69,222, 16,157, 64,208,146, 57,145,208, 25,180,164,239,129,211, 91, 54,115, 72, 81, 2, 20,217,233,106,139,223, 47,174,219, +240,182,197,254,171, 59,183,216,126, 4, 98, 86,230,164, 1, 96,159,251,225,166, 93,247, 97,121, 63,238,168,172, 68, 30, 83,175, + 24,193,166,210,105,114, 85,160,156,169, 50,159,215, 24, 54,211, 91,240,255, 90, 52, 5,173,200, 3,207,134,122, 50, 75,231, 54, +141, 13,206,181,200, 45, 51, 91,200,117,181, 9, 72, 73, 73, 67,178,237, 28, 97,115,232, 17,209,204, 86, 11,191,190, 0,188,177, +165, 49,199, 99,171,242,197,126, 82,222, 30,253, 99,217,142,190,250,193,250, 4,160, 3,216, 25,125,152, 49,218, 97,228,150,171, + 33, 19, 34,243,177, 29,214, 87,177,235,252,229, 98,179,251,122,135, 99, 37,125,119,138,246, 34, 83, 34, 65, 25,231,239, 25, 76, +250,205,179, 76, 90, 2,116, 4,121,112,150,180, 70, 51,188,105,131, 97,109, 24,169, 63, 89, 77, 70,189,111,180, 95, 98,196,105, +174,248, 85, 76,130,140, 21, 19, 54,155, 42,193, 28, 37, 23,201,158, 76,220, 6,197,141, 56,237,178,234, 90, 36,113, 41,215,147, +245, 56, 28, 3, 1,146,102,150, 3,203,233, 3,100,136,200,153,113,154, 35, 77,218,136, 36, 21,139, 1,125, 64,252, 91, 12, 61, +161,143,153, 10,149,250,207,248,128,215, 19,155,163,252, 28,133,162,144, 62,235,228,117,135,209,192,139,137, 79, 57,196, 63,222, +190,222,193,216,161, 86, 8, 22,214,140,184, 7,246, 73,149, 7,138,201, 9, 57,198, 21,205,200,138, 75, 40,171, 82,105,251,138, +227, 20, 75,129, 88,211,247, 99, 82, 23,139,233,108,243, 79,167,195,159,134,153, 11,125,110, 10,157, 73,167,123,119,118, 95, 60, + 85, 9,160, 32,211,235,231, 44, 48,144, 30,118, 21,132,230,199, 39,239, 80, 0, 37, 71,249,213, 24,114, 57, 29,254, 77,120,252, + 22,128,178,107,219, 73, 24, 8,162, 59,219, 34, 69,130, 81,131,193, 23,249, 4,255,255, 95,124,225, 69,141, 18,141,114,181,117, + 47,118,110,203, 22, 81,145,164, 9,225,129,150,101, 59,157, 57, 51,231,156, 14,127, 21,204,126, 71,254,208,211, 13,164,159,211, +101,136, 41,180, 22,152, 3,168,232, 53, 59,213,114, 79, 7, 89, 23,212,230,164, 33, 3,150, 92,103, 17,165,128,104, 59,201,157, +162,166,183, 35,215, 29, 66,236, 52,141,162, 30, 7,147,221,108,224, 79,229, 32,130,134,248,213,239,149, 94, 34, 29, 19, 85,139, + 79, 93, 59,172,216, 53, 1, 1, 65,166, 20,183, 44,148, 9,107,207, 63, 40,171,109,179, 13, 98,242, 64, 61,172,224, 19, 25, 5, + 13, 4,135,215,189,229, 19,245, 92,241,104,247,215,200, 82, 82, 99,224,195,249,187,197,250,118, 60,178,115,243,236, 26, 84, 70, + 53, 97,153,105, 34,110,232, 77,165, 17,147,113, 12, 14,247, 85, 86,130,165,153, 19,251,255,138, 44,237,179, 62,181, 76,121, 60, +113, 84,246,206, 75,232, 19,150,234,189,127,111,224,181, 13,237,180, 80,189,194,244, 45,108,154,130,230,208,139,139, 33,174,207, +104,216,191, 33, 91,221, 34,108,109, 29,239,181,218,240, 42,117,233,191,229, 60,169,177,233,119,194, 79,242, 60,112,202,132,100, +112,191,118,237, 51, 47, 86,224,171, 96,150, 14, 35, 40, 49, 9, 76,111,224, 38,151,245,195,252, 13,197, 73, 41, 89,140,201,220, + 2, 58,186, 50, 57,208, 25,187, 12, 22, 30,144, 84,169,244,253,245, 35,188,141, 71,179,117,119,118,235, 39,129,218,163, 60, 57, + 80, 5, 3, 96, 58,158,206, 94,102, 32,128,100, 74, 36, 85, 66, 36, 36,178, 61,228,231, 81, 77,140, 68,188,210,233, 72, 14,231, + 73,200,154, 10, 14, 27, 59,151, 64, 89, 3,133, 99, 22,131, 68, 58, 54, 14, 97, 25, 1,126,128, 6,105, 98,162,124,250, 36,219, +181, 27, 39,225, 38,177,116,212, 50,252, 23, 25,129,104, 85, 91,158,172,220,250,147,124, 71,106, 18, 15,230,159,226,183,171,248, +136, 27,212,175, 76,168,208,187,167,253,219, 88, 7,144, 56,176,166,216,152, 48, 55,208,172, 44, 14, 62,180, 55, 7,230,175, 68, + 3,224,118,179, 23,179,115,149,111,147, 88, 18, 83,139, 44,100,110, 33, 33,238,156,108, 98,174,203,188,179,187,150, 5,246, 9, +153,201,204, 81,205, 17,193, 29,254, 24, 72,209,215,213,217,100,190,120,202, 80,111,248,125, 20, 71,175, 48,238, 43, 70,106,112, +119,217, 87,200, 61, 94,156,214,126,243, 83,173,144,143,199,240,174, 70,209,252,120,216,231,231,200,200,240, 37, 0,101, 87,178, +155, 48, 12, 68,109, 19,160, 72,180,160,194, 1,169,234,165,234,177,255,255, 49, 61,112,105, 15, 84,137, 4, 82, 18, 26, 39, 94, +154,153,177, 29,187,132, 46,156, 33, 10, 16,143,199,111,222, 18,248, 51,148, 71,202,163,198,252, 7,220, 63, 78, 64, 24, 14,178, +129,116,194,135,128, 67, 27,146,206,252, 48, 2,122, 97,176, 73, 36,107,111,114,105,164, 51,151,197,134, 74, 3,149,222,165,218, + 43,206,227, 20, 66, 50,123,242, 41, 36,174,100, 27, 79,244,185, 68,211, 60,190, 25, 54, 0,180,126,156, 64, 50, 20,160, 74,128, +195,103, 78, 94, 5,243, 86, 20, 39,130,139, 59, 66,255,132, 55, 18,230, 41,158,119, 79,251,143, 87,202, 53,158,205, 86,221,164, +128,205,192, 0,200,219,225,113,147,147,217,136, 16,167,166,221,151,159, 47,187,245,225, 88,231,231,166,178,122,197, 76,203,140, +116,182, 33,238, 78, 9,159,105, 35, 59, 73, 17, 33,218,161,103,239,254,201, 64,103,145, 36,131,104, 60,119,128, 4,138,205, 76, +100, 25,108,145,109,103,106,165, 91, 28,145, 85,164, 75,196,204,195,123,169,182, 83,118,150,122, 41,108,169,193,214,101,187, 94, +128,252,168,179, 71,217, 76,241, 55,150,145, 66,253,218,216,202,140,176,199,220, 23, 68, 77, 28,155,227,147,115,131, 7,189,190, +126, 47,176,231, 43, 27, 64,225,231,156,173,110, 85,145,181,141,202, 40,105, 90, 89,182, 89,110, 78,213,137,166,139, 81,145, 10, +251,185, 53, 99,167,235,240, 76,130,110,211,196,107,154,132, 28, 46,202,135,251,219, 52, 99,235,204,105,160,172,201,171,220, 33, + 30, 3, 37, 35,225, 54, 98,217, 18,209,122,224, 78,118,225,160,164,137, 87, 80,115, 36,242,227,121, 85,248,201, 16, 75,200, 52, +222,170,202, 98, 52, 6, 72, 59,250,139, 63,110, 31,222,138,119, 76, 35,232,151,142,240,191,182,181, 9, 70,228,152,239,161, 87, + 23, 62,137,210,175, 86, 84,241, 96,102, 16,130,222,186,129,143,244,253, 59,105,178, 12,161, 78, 70,214, 58,135, 80, 49, 28,136, + 3,161, 13,198, 28,153, 83, 97,130, 3, 84,201,120, 81,202,250,160, 91,165,181, 52, 96,136,172,209,126, 95, 33,139,136,145, 85, + 61,143,124,154, 35,103,243, 0,233, 71,132, 28,158, 98,204, 35,197,221,229,103, 80,226,104, 84,239,126, 73,112,226,201,104,115, +184,158, 97,130, 95,240, 42,251,226,158, 98, 50,118,140, 77, 31,254, 37, 98, 15, 14, 54, 50,223,104, 51,151,119, 6,241,109, 73, +113,143,223, 63,156, 55,121, 2,213, 91,123,125,131,250,203,235, 75, 0,202,174,166,167, 97, 24,134,218, 73,199, 54, 16,159, 18, +147, 16, 39, 46,227,200,145,255,207,223, 64,226,136,208,196,132,246, 65,187, 37,105, 77, 18, 59,105,198, 24,130,222,167,118, 77, +237,196,207,126,239, 49,127,149, 9,205,136,189, 58, 31, 30,126,101,135,238, 88, 30,130,240,187, 50, 16, 47, 89, 58,133,117,210, +115,237,126,218,192,216,219,172,101,192,135, 21,196, 18, 99,101, 23, 72, 77, 56,101, 30, 39,206, 74,217,192,163, 6, 36,210, 2, + 66, 13, 68, 21,229,112, 98, 3, 43, 82, 85,181, 48, 84,149,216, 67,161, 20,146,121,117, 84, 18, 34,243, 33, 96,141,241, 69,173, +142, 10,146,174,173, 7, 16, 92,176,163,114, 36, 54,196,178,152, 49,122,129,230,198,157, 84,234,254,250, 44, 12,252,185, 48, 12, +234,111, 48, 10,245,129, 12,158, 67, 1,194,100, 61,146,204,252,196,162,173,154,135,168,240,128,183,192,254, 53, 72,239,252, 18, + 96, 2,234,106, 80,157,141,245, 72,211,218, 65,109,187, 55,211,190, 16,188,199,246,192, 80,154, 1,170, 1, 90, 0,204, 90, 88, + 89,170,108,232, 97,223,158, 86,147,139, 99,173,245,251,194,190,125,110, 93,209,219,105,255,185,205, 64,162, 83,141, 18, 46,207, +147,151, 71,161,114,162, 35,197, 68,226,132, 77,251, 26, 98,172, 62, 86, 21,187,170,116,177, 47, 98, 3,247, 15,123, 96, 19,178, + 97, 70, 86,253,239,235, 97, 14, 20,202,130,112, 37, 78,131, 34, 74,144, 26,182,253,222,128,244, 13,163,199,140,151,248, 71, 48, +214, 33, 82,153,174,138, 32, 17,248, 79,113,240, 36, 7, 25,113,241, 21,121,140,226, 56, 2,210, 1,138,244, 84,141,133, 89,118, +210,124, 79,190,192,189, 90,124,120,180,173,179,211,219,233,124, 57, 15,250,121,217,103, 74,168, 85,217,250, 99, 39,103,229,156, +234,255,230,249,241, 69, 23,116, 1, 28, 8, 85,156, 67,139, 6,161, 17,163,150,155, 85, 32, 41,249,111,220,214,195,155, 7,123, +247, 8,235,134, 54, 58,216, 10,109, 2, 22,239,207,242,190,246, 84, 53,152, 37,184, 69,221,205, 94,219,231, 39,107,155,174,169, +157,107,192,248, 95, 27,150,141,228, 17,120, 76,154, 15, 5, 74,158,176, 92,164, 29,215, 67, 44,206,224, 88,140, 81,255,124,106, + 46, 73,172,127,160,125, 74,219, 85,137,220, 55,230,181,192, 94,210, 98, 47,117,252,129,199, 39,213, 18,237, 38,247, 82,244,224, +144, 57,137, 46, 84,195, 66,180,234,106, 92,141,109,103, 56, 83, 13,245,168, 37, 71,191, 23, 26,255,185,190, 4,160,236, 76,118, + 26,134,129, 48,108, 79,210, 37, 45,136,125,145, 16,136, 19, 18,219, 1, 9,241,254, 79,192, 67, 32,122,160,108, 5, 74,200, 98, +103,176,199,107, 2, 69,165,135, 30,162,170,170, 26,251,119, 60,254,231,251,173,190,123,139,112,195, 22,173, 24, 93,233,231,139, + 15, 37,126, 83,249,200, 74,199,227, 26,126, 92,222,242, 0, 60, 50,154,153,185,216, 24,193, 7,127,122,212, 26, 15,230, 78, 65, +107, 62, 64,240,131, 25, 83,188,159, 69,224,178, 59,208, 20,223,149,192,167, 38,135,158, 39, 55, 39,215,147,231, 9, 80,104, 67, + 99, 75,252,214, 53,170, 46,214,162, 50, 84, 50,228,212,182,139, 18,100, 94,211,246, 50, 69, 34, 49, 19, 56,140, 80,127,160,222, +103, 95,117, 41,229,233,206,218,225,198, 56, 75, 19,117,203,212,164,236, 33, 97,213, 72,235,201,105,206, 19,119,220,218,143,224, + 30,157,142, 18,248,207,195, 59,184, 83,205, 17, 99, 91, 74,226,147,164, 55,128, 97, 10,111,181,154,131,242, 94,200, 7,194, 42, +156,103,131,203,205,193,241,122,118,180,218, 63,219, 24, 94,172,102, 87,227,108, 75,194, 84,212, 19,161,158,221,228, 8,224,120, +127,180,185,146,125,205,138,167,183,106, 74,155, 15,136,200,124,203,187, 20,252, 48, 21, 81, 25, 71,219,237,185,182,238,232,178, +152,110,157,208, 41, 95, 82, 7,117,177,181,113,250,248,158,218,156, 13, 6,186, 62,236, 12,188,216,138,204,116,206, 93,180,192, +116,157,207,219,214, 14,252,169,239,210, 56,116, 66,216, 38, 98,107,126,178, 54,125, 16, 89, 60,230, 26,214, 5, 87,217,173, 36, + 4,241, 8, 50, 17, 56, 23, 65,220, 13,232, 75,207, 56,226, 98, 83,194, 30,119, 76,140,144, 26, 25, 99,110,245,197, 74, 86,234, + 15,120,249,124, 97, 22,148,106,123,192,108,223, 44, 67, 23, 24,101,158,143, 26, 83,122,226,190,128,128,106,167, 95, 8,106, 79, + 33,143,141,173,252,147,141, 30,247,250,219, 31, 85,158,203,162,148,181, 20, 69,182,123, 89, 30,156,242,124,174,153, 79,234,191, + 87,139,127,169, 15,217,121,206, 89,142,197,251,107, 51,159,241,233,157,188,187, 21, 85,222,212,115, 44, 11, 29,198,172, 9, 43, + 2,121, 20,124, 27,119, 30, 5, 56,164,169,182,135, 1,139,110,143,207, 58, 4,247,214,195,187,175, 10,176,216,243,254, 55,149, +128, 91,226, 32,120,214, 8,215, 12,149,196,173,207, 93,137, 95, 78,217, 3, 62, 1, 23, 52,151, 46, 20,196,182,141,202,191, 4, + 5, 90,152, 15, 11, 20,113,208,199,176, 55,162, 69,188,137,191,118, 60, 88, 81,227, 97,201,223,253, 45, 0,101,231,179,218, 54, + 16,132,241,221, 89,201,150, 34,199,193,165, 1,135, 30,139, 15,189,247, 5, 10,125,255, 67,161, 15, 80,218, 38, 14,196,166, 77, + 99,201,187,210,206, 84,251, 87, 43,169, 9,169,241,193, 24, 12, 43,175,119,172,153,249,230,247, 9,107,141,237, 92, 28,135, 91, +197,127, 46, 56,132,126,224, 47,158,101, 62,111, 64, 39,205,103, 8,150,186,140, 39,116,124, 72, 71,143, 93,105, 52,234,195,112, +212,232,229,145, 9, 9,137, 59,135,181,237,112, 39, 13, 98, 3, 62, 78, 57,129,131,188, 59, 69,150,119,109, 98, 86, 8,207,132, + 63,156,164,111, 15,119,166, 81, 43,132, 70,132,160,136,116,181,251,116,111,150, 89,174,117,255,247,208,229,248,136,150, 55, 32, + 9,165,173, 38,181,140, 75,203,117,202,140,190,128,246, 82,125, 63,158,218, 14,183,171,242,221,213,106,187, 42,174, 22,139, 10, +178, 21, 65, 70, 80,152, 66, 62,207,163,237,170,189,171,237, 18,175,143,168, 56,212, 51,114,222,115,183,201, 44,201, 3,222,154, +248, 46, 54, 69, 94, 45,243,167,150,246,141,122, 64,188, 99,236, 99,177,252,244,126, 35, 42,174,179,126,181, 88,107,170,173, 38, + 73,228,176,187, 94,127,126,179,249,114,248,253,147,216,101, 71,187,237,250,102, 83,238,239, 79,223,142,231, 71,155,175,227, 76, + 34,249, 63, 7,195,107,129, 68,200, 96,140,182,199,154,153, 46, 4,244,207,101,110,188, 28,251,140,167,200,197,241, 36, 76,169, +204, 71, 2, 39, 13, 25, 23,224, 83,255,107, 23, 78, 44,210, 36,224, 79,121, 82, 95, 73,227, 59, 77,134,164,156,231, 42,114, 62, +181, 69,155, 93, 38, 78, 83,118,167,110, 31, 4, 69,105,184,231,222,170,221,107, 31, 99,112,231,228, 99, 57, 64,144,117,177,216, +254, 15,182, 76, 67,205, 19, 35,168,198, 58, 38,120, 63,178,254,122,138, 69,169,109, 32, 72,204,255,220, 11, 61,174, 33,152,183, + 47,203,117,109,168,200, 22, 34,207,252, 96, 40,243,228, 74,222,160,186,200,202,254, 59, 83,157, 50,216, 44,148,213,245,135,246, +102,199,154, 39,214,106, 82,103, 99, 61,212, 52, 40,207, 32,165,172,127,117,245,129,213,127,244,195, 15,125,255, 21, 85,255,233, + 51, 42,163,127, 39,173, 44, 44,179,139,139, 98,193, 8, 23, 61,152,129,134,150, 42,139, 91, 74, 33, 89, 10,243, 95, 48,130,217, +210,152, 75,250, 66,113, 70, 79, 19, 92,240,118, 1,129, 58,197, 29, 78, 16, 2,220, 34,204,188,167, 74,119,124,190,238, 30,192, + 56, 56,214, 86, 78,104,198,195,207,171, 18, 23, 45,181,243,163, 58, 57, 61, 20,178, 77,154, 49,100,204,166, 11, 51,193, 63,201, + 87, 50,200, 58,199,199,126,197,227,175, 0,156, 93,205,110,219, 48, 12, 22, 37, 71, 49,218, 96, 67,129, 98,167,237, 41, 6, 12, +216, 99,244, 89,251, 32, 29,176,123,111, 5, 6, 20,205,146,174, 73, 99,203, 34, 75, 82,146, 35, 59, 93, 81, 52,200,193, 39,195, +182, 8,138,164,190,159,166,126,188,154, 52,104, 95,213, 71, 86, 85, 26,204,179,198,211, 68, 79,165,121, 45,199, 84,217, 51, 35, +145,243,210, 50, 22,213,124,213,185, 19,229, 84, 81,236, 48,170, 48,137, 10, 84,201,130,194, 69,110,205, 36,110,160, 27,111,140, + 73, 10,124,160, 66,164, 34, 44, 38,202, 19,172, 69, 62,254, 74,194,221,229,194,230,108,160,246, 55, 58, 35, 20, 88,113, 3, 73, +135,198,101,242,133,134,129,179,205,186, 91,123,113, 16, 92, 73,205, 35, 30, 56, 41, 99, 32,130, 7,153, 37,200, 59, 44, 85,209, +102, 47,161, 45, 76,121,155,132,180, 52,221,255,163,248,107,179,189,217,108,189,177,151,203,229, 69, 35, 24,244,214,203,150,250, + 60, 32,196,208, 41,100,136,166,112,245, 52,177, 81, 18,184, 9, 83, 96,172, 45, 27, 0, 78,131,190, 78,253,177,160, 86, 90,206, +155, 11,215, 17,173,187,184, 37,228,202,253,187,247, 87, 63,191,253,126,248, 27,131, 17,167, 76,145,174,148,247,231, 13,237,241, +192,237,245,126,245,105,245,195,159, 95,247,187,208, 97,235,220,115,103,255, 60,134, 93, 5,245,250,176,241, 72, 83,189, 90, 91, + 90,110,254,123,245, 16,224, 85, 57, 4,241, 30,254,236,205,153,231, 11,174, 99,154,172,136, 84, 25, 94,211,104,248, 6,197,182, +169,116,117,164, 96,172, 36, 77,164, 35,246, 84,243,100, 81,192,233,211,103, 22, 18, 39,247,179,246, 60, 12, 65,188,107,104, 38, + 86, 5,179, 42,108, 26, 93,213,183, 31, 33, 50,101, 11,129, 99,231,112,180, 4, 58,218, 61, 86, 67,128, 35, 29, 30,211, 89,178, + 30,236, 66, 70, 12, 91,165,242, 66,141,145,118,121, 88,163,112,200,196,155,157, 36,247, 88,163,237, 71,222,153, 91, 80, 18,142, +167, 2, 84,144,122,206, 18,234,105, 55,216,219,221,221, 87,255,101,233,124,231,250, 1, 28, 87,229,180, 89, 35,246,224, 15, 92, +138,152,133,183,142, 3, 23,130,165, 94,128,148, 79,200, 97,187,189,231,180, 62,112, 87, 17,130, 16, 15, 57,240, 99,106, 36, 12, +141, 92, 37, 67,177,170,199,102,179, 0, 33, 37,230, 15,109,211,169, 92,154,128, 65,129,117,226,127, 80, 3,240, 90,169, 67, 21, +237, 5,230, 80,153,220, 62, 97, 68,191,104, 7,148, 78, 8,138,212,254,184,160, 5, 29, 48,242,149, 78,203, 41,132, 57,156,134, +234,217, 78,253,200,124,199,167,184,151,130,198,218, 1,209,190,181,109,188,213,139,244,161, 63,173,163, 15,130,205,123,239,239, + 69, 0,218,174, 37, 39,129, 32,136,118,247,124, 0, 13, 24,195, 13, 76, 76, 92,120, 6,247,186,242, 16,222,210,196,196,149, 71, +112,225, 5, 80, 80,144,225,215,204,116,183, 93, 85,253, 27,134,184, 49, 46,217, 0, 19,232,170, 87,175, 95,189,151,183,247, 15, + 99, 11,209,199,102,127, 19,175, 79, 25, 25,211,116, 91,128,112,117,223,248,219, 90, 39,149,116,191, 55,169, 39,157, 23,128,103, + 76,105, 8, 81, 60,169,242, 20,138,205,105, 67, 10, 5, 5, 44,243, 7,194, 80, 19,112, 68, 42,137, 34, 28,194,131, 63,178,208, +190, 22,192,123,101, 65,204,144,184, 47, 9, 74,167,196,133, 99,244, 22, 18,153,243, 14, 4, 45, 52,114,190,250,229,253,117, 94, +111, 47, 71,236,250,252, 98, 45,135,196,146,215,141, 68,139,133, 28, 18,125,208,243,126,207,180,157, 98, 37,192,118, 67,120,252, + 27,117,217, 37, 38,117,216,202,177,134,135, 85, 83, 89, 91,192, 44, 73, 47,239,181,240,228,202,146,238, 56,152,228,101,186, 67, +196, 59,188, 65,170, 9, 15,224,133, 42,251, 25, 92,171,242,158,200, 6, 69, 94,237,154, 93, 3, 14,112,246,227, 30,110,174, 38, +188, 66, 15, 52, 32, 42, 4,142, 80, 53,136,222,180, 61,192, 27,105,222,102,203,121, 3,160, 99, 92, 22,101,222, 91,172,155,106, +167,195,174,255, 95,188,139,181, 63,126, 52,166, 12,201,183,128,252, 82,189,167, 93, 14,173, 84,156, 20, 33,121, 19, 3, 92, 92, + 21, 19, 94,255,199, 18, 3, 25,111, 48,200, 61, 92,244,132,141,227, 47,184, 78, 26, 0, 42,161,156, 67, 8,201,195,249, 74,174, +220, 26, 78,226,116,152, 30, 55,209,145, 61,114, 22,171, 22,239,222,186,121,208, 19,185,149, 32, 7, 0,149,140, 56,140, 79,166, +122,236,252, 11,104,209,207,187,165,115, 87,229, 93, 2, 8,157, 1, 44,236,155,122,229, 90, 90,100,130,149,223,114,106,143,255, +198,204,150, 31, 49,197, 45,134, 90,195, 98,146, 81,117,150,243, 29,107,166,106, 49, 46, 79,165,253, 35,219,130,174,164,169,190, + 44,248, 48,229, 70,231, 37,122, 68,245, 41, 70, 77,233, 61,171,145,141,169, 62,149, 5,236,251, 26,236,127, 20, 36,132,163,110, +147, 84, 60, 38,236, 97,117,185,242,244,126, 60, 13, 60,202, 4, 87, 97,247, 11, 53, 67, 34,213,112,252,170, 85,244,147,142, 62, +210, 72, 40, 23, 3,191, 75,191, 63,186,189,187,127,126,122,156, 47, 38, 68,198, 35,240, 59, 64,223, 58,252,238, 16,212,102,154, +131,178,204,219,118, 68,166,133, 28, 34,120, 47,179,130, 65,130, 35, 93,100, 35, 33, 89, 12,182,118,138, 98,252,232, 99,252, 95, +152,207,143, 0,172, 93, 77, 79,194, 64, 16,221, 15,176, 96, 0,245, 96,226, 95,240, 55,120, 49, 30,252,255, 87,227, 93, 19, 48, + 32,208, 66,161,221, 25,119,103,118,182,203, 71, 36, 38,146, 13, 33,229,208,210,148,217,153, 55,111,222, 51,231,206,129, 39, 75, +122, 91, 39, 9,227,225,226,104,238,200, 98,169, 27,254, 74, 82,244,188,179,187,172, 51, 38,242,219, 14, 83,211,204,101, 93,163, +224,227, 33,205, 51, 57,168,146,214, 61, 2,116,197, 32, 38,160, 46,250,128, 80, 11, 63, 38,128, 24,237,231,217,138,129,223, 1, +163, 92, 55,241,204,130, 41, 3, 47,160,171,217, 52,155, 69, 80, 37, 84,239, 43,213, 31, 76, 93, 64, 34,153,244, 73,123, 24, 90, +206, 55,252, 22,215, 35,166,205,128, 56,125,170, 27,234,193, 29, 69,118, 29, 98,153,190, 33,159, 28, 39, 5, 38,146,122,240,152, + 12,155, 88,129, 43, 17, 34,217,180,126,255, 43,156,103,178, 60, 5, 78,192, 98, 19, 7, 86,237,248, 42,144,251,247,142, 16, 84, +165,158,134,215,119,247,253,143, 69,181,217, 1,231,137,117,131, 59,226, 77,248,210,218, 39, 99,208,186,217,122,251,230, 11,118, +165, 30, 31, 38,163, 97,177, 92,213, 77,221,180,255,241, 8, 98,150,174, 94,101,211, 94, 45, 89,245,250,219,230, 88,186, 19,131, +138, 9, 56,171,187, 70,141, 22,245,109, 96,207, 37,154,104,142,132, 15,255,185, 37,225,116,136,243,111, 42,202,174,243, 67, 36, +176, 95, 68,168, 33, 65, 58, 41, 85,103,245, 93,121,222,130,243, 34,166,133,142,178,210, 36, 51,121, 52,139,148, 97,178,210,157, + 51, 54, 87, 90, 22, 68, 93,192, 37,211,209,217, 65, 38, 74,169, 56, 21,157,196,214,117,188, 79,246,239,139,218,245,137,254, 24, +118, 37,167,251,182,152, 12,111,249,168,236,122, 90,199, 61, 10,115, 47,189, 32,201,106,248,239, 7,228,102, 66,222,129,129,241, + 27,202,183, 70, 1, 41, 27, 55,223,110,251,217,150,214,244,181,237,129,171,161,156,171,106, 97,170,149, 45,151,166, 92,181,213, +172,222, 78,155,106,142,229, 28,214, 95,254, 91,220,206,131,219, 42,139,117,251,236,136,201,145, 73, 91, 44,222, 1,192, 67, 79, + 13, 19,123, 99, 90,180, 18,140, 0,210, 52, 3,128, 70, 39,231, 60,125, 18,158,178,164,243, 40,225,165,223,126, 25, 56,180,214, + 62,191,188,142,198,227, 99,157,186, 46,115,207,185, 27,134,102, 24,245, 81, 28, 60, 27,220,177,131,145,229, 92,166,224,109,191, +141, 83, 58,106, 88,140, 18,193,198,215, 67,168, 46, 67,255,103, 66,240,223, 95, 63, 2,208,118, 45, 57, 13,195, 64, 52,227, 56, + 85, 74, 75, 65, 72,172, 88, 32,113, 9, 22,156,137, 3, 32,113, 88, 96, 27,209, 31, 77,243,113,237,193,158,177, 29,167,180, 18, + 18,162,203,170,170,210,198, 25,191, 25,191,143, 60,185,141,192,233, 77, 19,126,211,164,139,240, 51, 40,159, 32, 74, 27, 32,229, +215,103, 30,165, 64, 8, 96,242,113,148,113,166, 5,225,166,187,249, 19, 80,252,112,116,131,160, 22,152, 68,125,129, 96, 16, 78, +201,192,183,119,225, 82,153,158, 67, 10, 64,233, 89,249,174, 34, 48,255,217,173, 72,222,179,181,183,237, 99,111, 65,134, 79, 83, + 57,125,154,223,110,235,234, 3,179, 89, 6,181,116,249,195,114,160,196,217,213,152,219,117, 45, 69,214, 40,147,211,164, 41,152, +130, 33,159,145, 78,130, 71,163, 8,127, 26,121,191,192, 44,207, 23,165,180, 37,181,234, 85,163, 7, 27, 47,117,102, 51,135,227, +213, 60,176,203, 33, 41,232,145,217,194,246, 97, 45, 37, 32, 82,201,179,205,179,187, 99,247, 55, 23,111,159,219,174, 83, 78, 57, +198, 34, 46, 10,123, 0, 23, 57,132,246,163, 59,133,239,141,170,178,236, 81,200,135,187,107, 11, 61, 86,203,214,117,225, 73,106, +135,249, 67,125,135, 36, 88,220, 83, 66, 73,224,182,160, 51,199, 89, 1, 36,255,119,125,145,210,185, 24,123, 6,176,242,158,185, +240, 38,132,110, 33,166,148, 42, 15,198, 56, 8, 46,213,111,176, 77,209, 85,121, 89,119,117, 72,102,136, 76,235,240,221,236, 83, + 59, 58,239,135,129,153, 67, 19,122, 31,219,234,199,134,134, 65, 53,250,137, 92, 90,116, 96, 28, 9, 22,245,183,148,159,131,131, +192,218, 48,167,150,158, 2,224, 54, 68, 28, 72, 83, 42,144,237, 12,227, 44,211,141,163, 60,247,195,118,143,157,234,122,139,178, +189,158,150,177,139, 15,185,210,193,153,103, 52, 84,128,129,174,143,131,198,203,130,114,103, 41, 64, 99,132,188,150,186,215,186, +204, 39, 5, 20,186,171,105, 47,208, 7,145,245,210,160,148, 7,142,163,178,200,221,144,201,251,126,107,156, 45,112,143,110,100, +207,130, 2,139,203,180,193, 52,153, 40,157, 54,255, 72, 87, 37,151, 32,222, 98, 57, 55, 71,184, 12, 56, 17, 33, 60,103,146,195, + 89, 66,160, 73,202, 81, 68,238,246, 42, 89, 35,144,208, 98,130,205,114,187,255,122,125,121,222,108,214,172,152, 25, 31,233, 28, + 95,161,133, 18,173,214,112,190,125,192,227,183, 70, 79,109, 67, 13, 86,250, 90,238,170,184,241,207,139,249, 90,175,146, 99,116, +252, 63, 8,255, 45, 0,105,103,211,148, 48, 12,132,225,221, 52,210, 34,138,122,115,116, 70, 61,249, 87,252,255, 71,143,234,193, +131,142,194, 80,160, 31, 73,214,100, 55,161, 45, 21,199, 81,224,194,199,161, 12,237,178, 31,239,190,143,254, 54,160, 31,160,100, +253,234, 24, 92, 34,225,254, 42,202,203, 9,219,215,212, 39,243, 40,231,227,122,196, 51, 88,169,224, 35, 25,129,121,241, 52,154, +192, 32, 67,230, 17,247, 85, 98, 18, 14, 45, 47, 88,133, 86, 24,251,135,217,174, 86, 69,142,243,108, 79, 69,226,214,193,121, 61, +224,233,217,205,249,197,237,117,189,121, 91,249, 31,187,208,104,187, 36,206,217,134,183,148,248,224, 85,197,100, 28,177,216, 21, +232,246, 7, 11, 16,129,133, 34, 16,177,218, 52, 7,117, 53,203,213, 68,189,151,205, 83,219,110,135,254,171,120, 88, 83,165,210, +199,112, 52,116,234,167,243,147,244, 86,193, 13,144, 83,157, 21,153,158, 97, 76, 87, 22, 85,253,248,242,185,174,154,109, 77,219, +176,175, 8, 71, 66,109, 54,164, 9, 55,181,125,109,237, 19,192, 29,192,195,253,229,244,100, 74, 77,181, 90,173,151,100,203, 36, +217,252, 39,245,123,215, 98, 50,124,132,254,145, 35, 30,171,240,240,247,105,166, 74, 95,106, 56,156,135,221,101, 12, 77,227,148, +141,202,100, 80, 2, 34, 19,168, 83,199, 89,130,163, 27, 98,150,160,227, 34, 69,124, 16,139, 30,196, 6,157, 18, 40, 33, 46, 77, + 11,108, 33, 38, 5, 18, 22,251, 21,116,152,219, 83,183, 77,149, 28,248,118,157,118,164,189, 73, 85,226,111, 0,140, 41,110,209, +152, 21, 99,203, 72,118,172,226, 74,106,210, 0, 4, 36,135, 63, 13,141,226, 40, 15, 73,253, 18,237, 51,164, 20,225, 17,237,110, + 26,213,193,203,118,193,221, 82,154, 3,144,128,137,157,224,173,113,240,199,199, 79, 76,168, 68,131,239, 82,166,192,180,186, 48, +243, 73,173, 74, 40,159, 65,105,255,154,203,114, 48,156, 3,136,254,210,182,206,108,125, 88,135,106, 97,218, 42,120, 28,152, 80, +247, 69, 11,205,110, 1,215,237,205,162,199,150,141,233,234, 83,121,145,111,170,141,180,220,131,229, 44, 90,250,238, 90,112,208, +115, 57, 30,234,208,113,176,232,159, 26,181,194, 99,100, 49,190,140, 84,253,183, 92,151, 75,173, 99, 1,213,219,189, 23,149,220, + 88, 28, 69, 63,180,203,127,208, 47,226,112, 48,160, 6,157, 87, 94,106,177,141,142,126,168, 17, 79,152,146, 39,162,195,137,221, + 31, 50, 42,127,251, 18,128,180,115,235, 73, 24, 8,162,240,206,182,150,226,237,201, 40, 70,253, 71,254,124,159,125, 49,132,152, +104,140,168, 80,186,237,174,157,219,238, 86, 81, 48, 62,146, 66,128,164,153,238,204,156,243,157,156, 15, 28,236,246,128,168,221, +189,196,248, 61,225, 15, 85, 94,137,118,220, 31,201,166,195,112,158,157,161,186, 30,100,163,105, 33, 36, 94,113, 74, 70,140,140, + 55, 44,210, 4, 53, 24,213,117,229, 55,139, 47,148,156,221,192, 49,197,108,177, 35,173, 36,191,128, 49,141,175,195, 73, 52, 42, + 30, 58,116,138,116, 8,190, 9,148, 55, 47,207,219,146,249, 39,199,165,129,214,178,194,100, 67,151, 74,101, 52,182, 58,107, 30, +126,155, 51,112,117, 84, 87, 19,123,255,186,122, 32, 44,112,175, 16,177,126, 15, 7, 19,140,219,180,124, 49,223,233, 20,126,170, +158,169, 37,137,223,173,239, 79,171,233, 69,125, 48,111, 96,110,194,221,243,219,117,183, 30,142, 55,235,161,154, 99, 47, 18, 90, +148, 31,226,131,116,217,154, 5, 61,144,206,141,185,189,185,156,205, 78,134,178,185,120,124,127,125,105, 86,228,185,117,255, 46, +238, 38,203,117,146, 86, 3, 99,120,109, 77,154,153, 67,107,156,135,210,194,217,164,108, 29, 5, 42,114,158,155,151, 78,158,137, +132, 74, 70,167,241,122, 72,130, 24,174,211,209,171,196,172,152, 36,122, 49,209,106,228,245,110, 76,135,119,175,200, 71,225,183, +103, 2, 9,242, 46, 71,150,170, 36,109,131,206,189, 65, 37, 31,126,155,153, 61,152, 84,233,163,197, 65,178,182,133,144, 35, 27, + 62,118, 62,225,249,220, 10, 96,146,131,151, 16, 12, 68, 85, 30,228, 81,196, 97,225,212, 31,138, 42, 71, 66, 35, 99,100, 1,196, + 1, 38,232,176,221, 51,173, 24, 36, 67, 48, 9,201, 81,165, 96,233,107,105,193,239,240, 95,225, 2,172,234,221,135,111,158, 48, +184,175,168,123, 68, 52, 13,247, 8,208, 24,137,194,101,135,190, 1,243,233, 86,120,194, 9,148, 73,132, 2, 15,234,138,197,160, +234, 43, 91,185,206, 69, 15,123,126,239, 0, 29, 85,108,186, 16, 54,237,198,102,235,142, 31,229,217, 99, 59, 80, 54,248,246,240, + 85,230,199, 71,120, 89,215,210,125,209, 23, 60,254, 97,205,182, 23,148, 85,134,123,251, 6, 21,221, 65,198, 46,226,244, 9,182, + 44,123, 67, 46, 10,199,189, 56, 96, 96, 86,163,243,247,198,173,227,217,172, 80,212,129,176,214, 51,168,189,217,163,240,254,178, +238,226, 15,126, 10, 64,218,217,228, 52, 12, 3, 81,120,236,166, 41,148,170, 66,108, 64, 98,207, 33,184, 3,183,230, 10,108,187, + 3, 85,221, 84,252, 20,136, 19,123,240,252, 57, 73, 91,169,149,144,186,171,148, 74,105,242, 60,243,230,249,115, 53, 86, 16,236, + 93,177, 51, 84, 30, 79,168,188, 75,103, 58, 54,170,242,206,149,221,231,118, 14,176, 78,211,173, 17,238,127, 42,241, 77, 86,220, +163,162,252, 18,236,165,157,249,155,142, 23,114,122,169,124, 44, 44, 61, 17, 11,158,222, 69,151, 42, 13, 80,121,121, 28,236, 92, +123,155,167,209,117,253,196,220, 63, 59,253,157, 76,180, 95,157,232, 66,197, 68,137,107,112, 63,124,134,234,204,144, 3,129, 62, +116, 31,238,235,250,230,106,250,188,249,120, 27,220,182,246,140,206,200,143,141,200, 52,136, 10, 76,135,248, 87,195,215,116,150, + 65,220,181,112,151,127,119,113,185,253, 12,235,248,189, 2,216,190,119,185,159, 88,242,251,212,176,197,176,227, 86,163,225,107, + 62,186,250,233,225,182, 94, 94, 92,213,240,219, 52,171,215,221,186, 33,136,113,107, 45,194,127, 36,222, 91,112, 83,118,120,205, +193, 95,120, 88, 78,115,217, 94,101,245,252,202,130,212,193,188,246,139,185,127,217, 56,131,246,137,223,198,176, 58,144, 83, 43, + 80, 28, 54, 69, 32,106,138,134,255,194, 97,213,228, 16,143, 4,240, 37, 51,163,139,186, 86,241, 2,195, 2,245,222,221, 24, 67, +136,165, 74, 40, 89, 47,126,240, 82, 37,103, 92,171,212,151,136,159,218, 13, 88, 70,175,189,242,119,125,222,155,112,102, 74,255, + 53, 58,174,197,133, 93,191,135, 71, 92, 27, 81,121, 70,114, 76,248,202, 34,241,220,105, 38,232, 41,249,230,204, 56, 80,188,151, + 48,109,153,163,109,202, 46, 3,103,147, 50,225,110,208,246,222, 40,180, 50, 79, 33,169, 54,229,214,182, 37,244, 12,133,120,171, + 38, 63,245,145, 41, 33,116,191,137,204,221,166, 20, 48, 6, 12, 59, 97, 18,228,162,159, 77,179,168,120, 53,158,121,181, 41, 28, +174,122,206, 34,122,227,167, 66,204, 25,119, 44,198,177, 95, 29,167, 3,249,194,210,170,141, 7,224, 17,196,209, 69, 52, 54, 51, +253,185,209,151, 37, 1,177,180, 50, 34, 68, 49,245,165, 55,226,233,210, 56, 30,155, 89,130,211, 29,155,112,153,151, 70, 32,172, +249,132,232, 39,142,140,173, 54, 76,246,211, 61, 56,163, 60, 79,238,164, 3,244, 94, 77, 82,184,197, 65, 57,127,126,159, 92,249, + 42, 36,149,150, 63, 1, 72,187,118,157,134, 97, 40,106, 59, 78, 83,154,150,150,135, 64,170,224, 7, 88,144, 88,250,227,124, 3, + 59, 3, 35, 44,128,196,115,168,148,146,186, 73,108,236,123,175, 19, 39,164, 82, 36,218,173, 85, 7,215,241,241,125,157,115,186, +245,153, 33, 40,207,134,198,242,158,175, 20, 52, 99,107,148, 71,230, 90, 27,229,105,192,166, 9,228,189,249, 43, 41,207,161, 30, + 30, 15, 76, 44, 89, 56, 71,193, 77,159,144, 28,254,202,249, 33, 32, 8, 8, 77, 30,243, 36,205,103,223,178, 66, 65, 74, 83,146, + 68, 8, 17,230,252,252,150, 27,166,116,237,112, 16, 11, 54, 81,109,199, 12, 82,224, 18,144, 79, 66,252,187, 70,163, 91,130, 48, +146,126,180, 39, 46,101,114,153, 38,247,223, 63,111,204, 92, 50,190,154,204,111, 46, 78,215,185,186,125,126,121,216,255,167, 6, + 18,111,132,143, 85,176,103,166,253,249,200,119, 44, 13, 57, 40,153,162, 40,213,182, 56, 95, 76,174,206, 14, 71,159,230,174,204, +223, 45,196, 51,246,170, 91,123,105,163,254, 21, 23,215,199,243,229,201, 44,157, 69, 91, 27,206,103,250,233, 99,243,248,181, 89, +195, 68,208, 24,150,246,159,250, 32, 39,187, 43, 2,247, 41, 19, 71, 66,204,147,120,145,196, 7,177, 11, 15,109,214,108,131, 64, +128, 10,158,171, 24,146, 87, 94, 55,173, 56,186,154, 2,124, 4,224,238,154,133,164,234,200, 77,127,101,148,183, 19, 32,144,201, + 72,147,105,166, 50,212,195,232,128,123,151,255,233,117, 3,157, 10,186,129,121, 10, 19,145,208,183, 48, 88, 63,134,195, 40,124, + 29, 9, 67, 16,188, 60, 16,231,113,162, 38,228,167, 0, 39, 26, 38,182,200, 75,199,120, 79, 85, 80,118,108, 40,221,152,115,192, + 98,185,244,185,172,225,190, 48,196,125, 5,138,251,199, 17, 58,206,216,157, 2,150,110, 80,203,106, 60, 8, 27, 14, 33,139,200, +235,193,125, 13,156, 73, 27,143, 11, 22,149, 74,139,204,238,152,209, 59,237,100,111, 92, 95, 2, 46, 87,231,190, 80,217,115, 96, +225,187, 84, 22,229, 29,161,201, 61,221, 24,240,208,237,230,124,136,251,226, 78,220, 52, 77,245,144,125, 65,128,169,218,158,192, +193,156,115, 15,183,236, 79,240,222, 84,105, 80,204,156,244,132, 97,153, 58,144,162,107, 79,112,186,230,203,225,120,161,138,124, + 87,109,135,171,149,117,106,121, 82,140, 44, 86,131, 87, 9, 83,160, 87, 46,185, 4,134, 38, 58,220,225,165, 90,171, 81, 64,205, +182, 40,176, 6,192,105, 45, 56,130, 65, 3, 41,181, 10,139, 30,116,229, 52,217, 67, 13,238,246,245, 43, 0,105, 87,215,211, 54, + 12, 69,253,213, 52,165, 16, 84,182, 85, 27, 66, 98,111,240,206,127,224,223,243, 23,246,130,212,105,154, 4, 75,215,180, 77, 98, +251,206,190,246,117, 28, 70, 24,210,242, 84, 85, 85,149, 38,233,245,245, 57,231,158, 51,224, 51,234,165,247,252,100,149,127, 63, +159,150,191, 28,235,255,124, 91,150,247,242, 60, 51,176,180,201,191, 27, 6,141, 85,250, 31,243,216,181, 91,146,181, 11,178, 26, +131, 41,159, 80, 96, 41, 30,156, 35,130,139,150,129, 96,231,114, 6,166,175,245,102, 85,178,121,177,220, 31, 46,188,134, 45,234, + 92,210,213, 8, 37, 69, 80,236, 70, 84, 50,184, 51, 47,149,252,217,153, 83, 25, 61, 26,219,184,189,130, 61,213, 50,188,159,220, +173,206,159, 11,121,212,253,163,233,215,140,223,157,158,223, 94,125, 88,174,230,162,147,247,242,178,124,252,241, 96,244,212, 53, +148,201,189, 59,195,103,250, 12, 92, 83,196, 88,114,106,144,195,135, 27,102,119, 26,158, 14,253, 73,209,175,207,203,245,178,184, +217,182,223,234,221,166,109, 27,159,176, 6,103,140,175,228,236,162, 40,190, 84,139, 79, 85, 97,149,159,122,175,247, 93, 81,170, +205,179,126,122,110,106,173, 27,146,244, 24,246, 95, 71, 16,191,159, 32, 84,181, 96,242,107, 85, 94, 87,139,171,143,149, 18,226, +123,125,220,118, 26,180,249,101,244,178,100,173, 85,219, 3, 18,239,156,165, 1,205,116,251, 44, 27,138,187,209, 97,195,151, 66, +124,222,208,210, 13,213,193,253,144,223,125, 19,115,178,227,112,167, 37,241, 9,192, 95,120, 24,143,181,218, 15, 0,162, 39,146, +175, 27, 65,236, 1,228,109, 20, 51, 31, 34, 38, 15, 89,228, 25,203, 48,138, 49,143,135,150,234,104,124, 17, 11,115,232, 62,228, +152,172, 35, 86, 74,248,209, 92,225,234,132, 72,230,221,241, 81, 75, 78,232, 60,166,104, 36, 76, 38,166,154, 97,103, 26,120,105, + 72, 65, 67,168, 55, 13,155,159,176,109, 8,137, 84,146,107,215,228, 90,126,132, 78,128,236,220, 27,104, 17,228, 39,182, 17, 46, +179,184, 14, 6,183,200, 22, 39,202,122,220, 53, 91, 98, 50,248,139, 97,142, 28,174, 10, 5, 12, 18, 3,194, 13, 69, 35,254, 83, + 70, 18,239, 50,140,193, 25,152, 40,238, 68,193, 24, 24, 90, 74, 78,236,199,104, 98, 57, 32,191,225, 91,119,237,150,129,125,245, +108,236, 4,112,157, 79, 20,226,154,170,113,129,199,177, 36,188, 63,174,143,118,235, 33,186, 80,164,145,230,193,215,139,186, 52, + 75, 76,190,239,103, 20,159, 25,143,122,185,231, 76, 9,178,226,200, 76,185,225, 61, 73,153,249,241, 71, 0,210,174,101,167, 97, + 24, 8,102,243, 80, 91,209, 0,109, 65,136, 11,112,131, 15,224,255,127, 3,132,248,129, 10, 65, 11,164, 73,155,196, 94,188,246, +174,227, 52,225,212, 91,171, 70,145,220,196, 99,123,118,118, 38,245,239,178, 26,116,195,195,177,109,230, 41,234,184, 78,222, 4, +193,205,181,117,166, 99,159,106,217,200,131, 45,163,113,239,161, 76, 98,122, 5, 53,102,196, 72, 50,223,138,218, 25,234,137, 55, +218,177,153,156,159, 36, 46,237,213, 51,191, 46,199,141,210,224,118,117,249,186, 35,199,184, 89, 17, 61,173,202,171,185,250, 46, +150,148, 46,229, 83,182, 81,204, 43,120, 57,117, 91, 20, 86,225, 77,116,208, 37, 15, 81,102, 15,240,181,172,148,222,253,145, 2, +249,226,248,173,220,155,207,183,144,153, 1,191,127,109, 95, 62,177,106, 72,153,190, 72,210, 27,213,174,255,127, 84, 56, 80, 15, + 96,192,216,168, 64, 65,149, 6,100, 78, 67,245, 0, 85, 84,237, 38,163, 24,219, 12,210, 60,159, 62, 95, 76, 15, 20,103,107,142, +217,120,150, 81,126, 83,131,102,181,199,143,189,193, 15,179, 18,144,117,191,249,167,118,191,205,250,167,174, 35, 42, 18, 28, 78, + 6,119,103,192,144, 17,190,195,221,108,246,120,157,223, 47,231,243,116,242,176,202,201, 84,182, 41,182,229,182,178,230,128,139, +105,182, 41,128, 54,141,137,195,114,175,163,245,244, 2,159,167,209, 57,144, 6, 6, 39, 67,227,132,184, 59,237,119,102,173,116, +131, 86,100,185,128,130,195,129, 21,150, 0,145,243,179, 70,143,242, 32,133,109,215, 48,229,224, 9, 99, 23, 76, 36, 69, 87, 37, +144,204,188, 13,244,213,232,208, 73, 43,209,239,119,100, 11,239, 24, 21, 2,222,184,247,160, 89, 63, 67, 13, 65,212,137, 70,164, + 60,187, 91,137,111,130,173, 59,179,165,171, 61,230,114, 98, 6,181, 53,117,219,118, 14, 66, 50,131, 75,210, 68, 67,107, 39, 26, +155,228,156, 39,151,137, 85,148,153,117,107, 79, 49, 6, 21,104, 27, 24,107, 99, 55, 81,113,135, 48,146, 30,220, 92, 85, 99, 67, +202, 25,251,131, 45, 75, 49,240, 40, 30,163, 15,196,214,129,132, 9, 58, 84,141,128,143, 99, 99,237,216,136, 3,153,185, 62,214, + 75,192,176,176,137, 35, 93,153, 24, 6, 36,245, 3, 65, 28, 81,165,189,189,187,147, 80,245, 91,195, 16,250, 48,232, 11,195, 33, +101, 42, 36, 4, 11,100, 99,169,151, 70,214, 36, 49,181, 29,242,244, 37, 78,197,140, 44, 14, 23,113,215,210,214,201,194,109, 8, +188, 40, 66,188,232, 4, 69,155,239, 24, 60,212, 99, 42,187, 81,232,255, 19,128,182,171,217, 73, 24, 8,194,179,219,133, 66, 68, + 37, 61,153,120,242,224, 75,248,254,143,224, 19,152, 72, 36,132, 32, 6,104, 41,221, 89,119,102,246,167, 20,241, 98,228,194,165, + 9,180,221, 78,103,191,249,126,134,252, 72,219,115, 15,255,135, 66, 63,164,114,203,131, 20,171,188,138,185,175, 42, 74, 87, 51, +160,238, 66, 2, 54, 6, 51, 48,186, 34, 98,223, 1, 46,219, 68,171,159,228, 96, 86,114,251,228,121, 51,204,197, 32, 83,114,167, +223, 14, 27, 57,174, 6,120, 93,195,203,228,171, 80,119, 71, 43,199, 34,163,165, 28, 51, 24,168,253, 33,185,147, 56,125, 28, 0, + 44,192, 58, 98,174,176, 29,228,124,109,217, 88, 77, 64, 27,218,169,185,133,197, 27,250, 81, 92,213, 71,108,220, 1,187, 29, 98, + 67,194, 16, 34, 77,202, 31, 46,122,100, 74,219, 3,103,174, 33, 99,170,231, 17,159,216,135, 38,174,242, 45,116,170,131,114, 95, +212,246,120, 63, 34, 2,144,225,213,196, 49, 98,110,221, 98, 77,195, 53, 42, 42,219, 14,166, 99,221,250, 19, 55,186,109, 79, 31, +159,205,234,212,109, 89,159,101,255, 6,187, 79,153,224,239,139,123,165,204,243,124,246, 52,159,150, 8,139,229,222,194,225,125, + 77,218,162,189,237,252,123,206, 87,172,153,129,219,137,191, 11, 90, 44,151,147, 27,162,139,249, 46, 46, 69, 2,161, 40, 16, 7, +197,125, 32,111,145,180,162,222, 34, 8,227, 71,206,134,129,216,188, 7,187,177,108,222,151,186, 66, 21,249, 55,161,249,136,125, +121,168,241,156, 44, 47, 56,146,192,206,226,103, 29, 58,107,230,205,243,122,182,201, 73, 70, 37,158,117, 12, 74, 35,163,121,147, + 90,120, 9, 54, 34,196, 15,181,186, 96, 27,171,136,110,235,160,247,234,119,178,202,101, 86, 78,252,198, 52,126,133, 8, 53,138, +240, 67, 64, 98, 20,251, 25,122,101,148, 48, 46, 78,118,207, 67, 63,223, 7, 84,211,170, 30, 23, 59,138,170,229,177, 67,184,188, + 82,227,253,245, 98,149,136, 19,100,198,134,137,177,147,105,115,204, 97,194,190,234,247, 28, 54, 83,172, 86,151,147,201, 48, 58, +228,247,129,138, 14,194,191,240, 83, 46,104, 51,238, 10,137, 82,103,187,154,193, 48, 0,207, 55, 86,195,169,174,187, 52,227,191, +178,183,160, 74,162,203,145, 42, 26,219, 22,177,178,251,206,192, 56,209, 72,185,135,234,113,189, 89,234, 80,223,141, 74, 94,250, +100,203, 49,106,142,141,100, 91, 51,153,141,105,131,154, 12,228,144,137, 68, 52, 29, 1, 78,172,204, 94, 74,104,163, 46, 23,243, +140,240,234,231, 91, 0,210,206,102,167, 97, 24, 8,194, 94,203, 9, 52, 45, 63, 18, 18,103, 4, 23,222,255,129,224, 82,137, 3, + 69, 17, 45,184,141, 99,123,241,122,237,196,129,180,170,132,218, 67,212, 30,154,186,145,187,187,153,249, 38,241,103,250,105,179, +131,191, 98,140,255, 84,148,112,198,173, 93, 56,249, 2,204, 29,195,232,234,134,210, 68,130,153,212, 17, 97, 50,233,193,118, 8, + 20,165, 57,225,132, 27, 32,123,172,146, 12, 71,106,183,127,167, 9,196,120,101,220, 11,127,189, 92,124,155,177,147, 75,198, 90, +143, 67,138, 84,154, 25,197,113,126, 45,180, 35,107, 54, 33,118,163,236, 79,118,180,161, 3, 75,221, 49,165,143,202,134,116,232, +254,197,187, 56, 63, 9,187,170,109,157,221,120,191,165,124, 98, 81, 75, 50, 64,109,242,152,165,138,163,106,127,228,210,158,249, + 74,121, 1,171, 41,130, 99,152, 18,184, 28,119, 28, 78, 82, 27,111,156,239, 76,223, 26,175,123,219, 91,194,126, 83,162, 56,132, +146, 76,124, 57,103,156,216,237,205,122,103,222, 4, 45,141,249,199,112,134, 67, 1,155, 72,194,121, 94, 52, 79, 55,171, 86,219, +117,171, 63,181,177,214, 29, 40, 5,208, 28,122,251,161, 77, 56,238,188,187,109,100,189,168, 95, 91,197,238,159,232,134, 76, 38, + 56,255,171,120, 79,225,158, 2, 70, 48,233,252,197, 6, 83, 44,210, 88, 53,101,187, 80,209, 32, 79, 74, 54,244,165, 2,102,176, +209,227, 40,116, 28, 98,221, 89,123, 46,139,178, 34,115,154,112,136, 60, 45, 60, 85, 5,190,128, 93,213, 25, 50,147,131,140, 49, + 83, 81, 37, 14,221,226, 84,122, 87, 60,185,175,228, 1, 56,163,175,146,199, 11, 10, 80, 61, 83,185, 29,103, 38, 65,226,168, 20, + 1,113, 17,115, 84,147,248, 17,237,193,117,142,120,238,184, 4,213,161, 33,237, 35, 77, 99,108,180,123,245,196,153,177,134, 54, +119, 34, 94, 59,138,109, 2,254, 40,207, 46,194,162, 67, 47, 59, 23,200,137,159,105,105,176, 92,118, 44,229,193, 80,252, 31, 12, +134, 91, 16, 51,254, 50, 60,231,166,224, 25,111,225,156, 78,228,148,118, 70, 78, 54,119,228, 52, 92, 26, 38, 68, 32,168, 4, 85, +145,246, 72,169, 74, 85, 68,168,173, 76,215, 41,169,194,235,241,255, 52,222,173, 78,243, 84,106,213, 66, 11, 27, 74,251,240,195, + 55,151,171,176,236,138, 9,183,200,233,164,112, 81, 53,144,162, 8,112, 40,127, 31,238, 30,183,251,150, 55,199,171,234, 42,242, + 38,143,158,240,143, 0,140, 93,199, 82,195, 48, 16, 85,117,136, 9,101, 56,112,228, 19,248,255, 11,255,194,192, 5,134, 50, 64, + 8,196, 69, 43,180, 69,178,226, 1, 18, 79,238,118,108,105,181,229, 21,183,183,103,255, 71,223,230, 63,161,224, 3,179,120, 51, +167, 9,196,138,145,192, 6, 58, 81, 79,102,202,244, 47, 17, 11,111, 24,164,192, 20, 39,233,206,198,200,243,148,125, 69, 67,102, +172, 32, 63,159, 85, 98,166,235,170,109, 30,123,159, 22,175, 35,176,117, 54,227, 68,117, 34,200,253, 25,205,206, 91,146,201,153, + 83,171,159,122, 73,189, 1,245,103, 68, 0,178,206,226,189, 81, 29,154,210, 33,208,240,161,234,134,121, 50,185,110,211, 33,222, + 35,217, 36, 86, 52, 40, 91,189,153,240, 91,232,132,217,164,169,130,198,179, 6, 47, 33,214,227, 26,115,240, 97, 51, 96,255,118, +233,210,113, 18,207, 72,140,119, 19,128,228,189,208,109,213, 91,212, 9, 24, 52,156,123,179,233,250,117,215,111,200,185, 57,100, +183,169,189, 53,224,175,193,125, 73,191, 75,101,174, 79, 79,190, 1,110,158, 95,211,243, 92, 40, 59, 6, 19,130, 67,114, 60,105, +109, 45,104,144,116,236,213,217,194,223,191,185,110, 84,105,133, 3,229,135, 20,171,216, 42, 59, 22, 92, 19,247, 93,117,209,168, +202,233, 88, 77,190, 51,243,207, 94, 66, 9,183, 98,114,130,169,179, 20, 93, 44,125, 19, 25,255,149, 32, 27,166,154,188,178,226, + 41,201,190,206,101, 35,136,151,147, 54, 38, 78,248,238,200, 10,116,164, 14, 86, 44, 4, 37,182,231, 66,128, 86, 51, 22,162, 76, + 84,178,145, 27, 0, 90,154,250, 38,206, 55,111,172,168,203, 34,131, 44, 96,119, 16,239,139, 93,124, 17, 70,118, 17, 59,139,187, +109, 16, 35,176, 75, 19,122,189, 93,217,149,234,190,122, 28, 77, 12, 93,255, 49,142, 77,123,180,120,215, 91,224,225, 42,113, 94, +233,107,208, 30, 4,226, 18,107,182, 99, 3,222, 79,197, 77, 13,166,233, 52, 72,219, 67, 77,212,212,226,145, 93,169, 7, 75,217, + 4, 57, 3,139, 48, 29,201,121, 40, 91,167,243, 59, 48,214,131,145, 31,250,127,154,210, 33,193, 93, 87,105,187,146,241,161, 38, + 96, 12,130, 32,113,232,110,156, 55, 22,149, 42, 81,115, 1,147,209,166, 89, 24,176, 71,174,105, 93,219,218,214,219, 6, 97, 1, +204,161, 82,200, 16,235,198, 45, 78, 68, 81,222, 39,157,157,168,180, 31,108, 90, 9, 46,213,250, 64,250, 51, 30,185,241,114,148, +167,155,223,189,220,226,221,232, 85,124, 14,107,189,203,140,153, 93, 63, 2, 48,118, 45, 59, 13,195, 64,208,107,167, 41,180, 5, + 85, 28, 65,136, 35, 39,254,255, 27,184,243, 15,156,120, 8,149,166,137, 31,139,119,215,118, 28,210, 22,206, 85,163, 40,173, 39, +187, 51,187, 51,205,252, 93, 7,199,192,113,142,242,225,116, 2,200,255, 5,232,217, 83, 47, 16, 15, 48,182, 73,152,148,249,236, +118,170,197, 38, 12,114, 54,151, 46,102,204, 90,229, 92,214, 80,239,202,149,165,211, 66,122,197, 50,185, 89, 60,133,203,117,176, + 86,225, 1,113,219, 46,222,253,245,103,239, 56, 60, 86, 99,217, 57, 80, 73, 5, 43, 24, 74,193, 79, 74,139,129,159,225, 2,156, +104,247,144,168,112,118,188, 25,121,146,129,187,206,134,241,210,179,219, 76,147,205,208,215, 38,130,123,115,191, 89,190,125,196, + 99,149, 36,217, 54,155,139,193,105, 98, 36, 76,219,172,118,154,141, 39, 95,236,242, 92,205, 64,106, 42,205,185, 95, 5,108, 27, + 61,176, 84, 24, 31,220,142,247, 14, 91,178, 58,140,173, 35, 44, 53, 4,231,123,235, 58,231, 73,155,205,248,142, 21, 95, 23,254, +113,128,228,102, 86,236,129,243, 96,204,227,118,243,178,239,159,187, 67, 72, 31,121, 10,144,112, 68, 91,245,220,232,180, 10, 91, +128,141, 49, 30,240,117, 71,191,177,103, 34, 89,156, 37,164, 82,175,173, 97, 48, 40,156,217, 35,201,139,254,215,240,232,236,205, + 14, 18,118,156,166, 44, 85, 45,167,225,236, 20,135,186, 43,144,250,129, 52, 85,173, 96,210,214,143,252,114, 1,250,106,137, 42, +254,229,210, 34, 29,230, 52,108, 48, 69, 28,100, 41, 73, 94, 11,236,167,229,227,229,217,248, 78, 82,186, 33,173,231, 28, 27, 69, +153,222, 92, 41,111, 81,184,248, 84,182, 83,150,177,228,164,129,194,105,139,195, 9, 80,133,178,114,106, 31,187, 89,141, 87,203, + 53, 88,202,185,105, 34,228,235,176,115,223, 30,164,202,193,108, 65,236,179,193,140, 39,158,143,231, 14, 83, 99, 12, 53, 47, 92, +188, 32,202,188,105, 64, 85,243, 84, 48,110, 23,101,112,247,149, 93,125, 46,222,199, 57,200, 58,173, 9, 79,128, 59,254, 93, 82, +158,135,163,243,156, 76, 13,238,201,231, 95,102,167, 56,245,179, 97,103,127,169,217, 57, 20,142,120,155,197,106,113,113,183,186, +221,182, 55, 90,235,193,217,158,182, 98, 99,251, 74, 10,170, 97,134,235,210, 92,220,172,182, 17,250,227,133,186,205,112, 8, 93, +239,250, 47,251,213,217,254,219,237,173, 63, 88,138,198,101, 23,198,108, 30, 7,105, 99, 89,243,193,116, 50,129, 51,250, 93, 79, +111,250, 71, 0,202,174,174,167,113, 24, 8,218,235, 56, 77,139, 80,133,184, 59,241,122,226,133,255,255,204,255, 64,226, 23,128, + 16,186,147,144, 26, 66,237,245,237,135,183, 14, 41, 20,174,143,169, 84, 41, 77,188, 30,207,206,206,116,167,255, 6,127, 84,229, +195, 82, 1,233,191,195,179,127,147,142,119,213,233,204, 27,157, 2, 38,139, 55, 8, 95, 39,174, 51,109,143, 22,138,137, 30,235, +232, 2,231,111,122, 72, 31, 37,167, 28,146, 51,235, 12, 6,176,100,225, 79,127, 70,239,202,143, 72, 95,133, 71, 90, 92, 19, 61, +165,236, 27, 51, 88, 51,131,244,240, 11,214,143,231,169, 19, 1, 70,111,114,101,240,181, 9,217, 89,214,168, 90,113,105,162,180, +120,173,224,133,235, 68, 96,195,159, 94,202,223, 0,110, 27,225,234, 60,254,222,196,251,167, 93, 47, 5, 49,205,230,149, 38,219, +153,242,215,138,168,122, 92, 8,182,236,181,181, 59,182,168,144, 50,210, 29,211, 13,167,178,135, 16, 3,107, 58, 87,200,131, 1, +107,238, 90,139, 28,196,165, 93,194,241, 45,255,117, 89, 51, 99,119,239, 93,207, 78, 67,120,111, 74, 77,165,101,232, 94,110,226, +112,125,177,190,125,126,185, 19,117,144, 30,149, 94,100, 47,166, 45,103, 96,145, 93, 33,208,178,118,101, 83,252,165,131,135,169, +127,205,140,121,164,120,128,180, 84,184, 60, 41, 60, 60,144, 51,243, 74,229,103,193,243,150,164,244,241, 91, 87,135,230,148, 59, + 65,231,222,119, 86,143,101,218,110, 73, 13, 11,224,230,157,177,174, 43,197, 24,109,142,169, 73,189, 44, 69,187, 78,251,248, 42, +184, 2, 77,209, 41,161,250,228, 57,141,255, 82,139, 72,204,153, 48,159,188,200, 84,221, 53,136, 14,138,199,207,180, 33,179,138, +217,186, 83,141,125, 87,216,110, 62,201,232,154,170,191, 44,251, 94, 44,200,148,240,110, 55,166,113,130,137,128, 11,123,164,179, +159, 11,106,158,147,254, 69, 50, 5,170, 85, 94,156,126, 4,200,163,210,242,246,235,214, 13, 22,237, 65,133,234,104, 14, 34,126, +193,133, 88,185,199,170,242, 41,165,197, 81, 53,183,119, 83, 7,205,140, 61,173,181,124,138, 96,249,127,160, 89,190, 10,207, 57, + 78, 16,226, 43, 81,182,107,122,162, 67, 63, 32, 34,211, 50,146, 0, 4,190,251, 53, 92,254,220, 92,173, 96, 69, 15,122,164, 35, +116,206,123,182,174, 44,135, 76,201, 61, 18,240, 74,210,190, 67, 42,253, 49, 4,161,217,160,195,184,133,237,186,155,124,142, 37, +172,198,244, 58,122,142, 11, 77, 46, 9, 60, 82,240, 99,103, 53, 23, 84,110, 2,150, 4,187, 88,161,255, 4, 96,236,218,118,219, +134, 97,168, 40,167,142,147, 21,117, 59,236,105,239, 3, 6,108,223,189,255,106,135, 61, 20, 45,138,100,151, 68,150, 37,113, 34, +169, 91,235, 54,105,144,135,192, 72,108,193,142, 40,234,240,240,156,215,241,247, 19,123, 27,124,137,200,195,187, 33,120,120,207, +215,160, 1, 26,161, 96,147,139,139,229, 61,116, 53, 94,149,152,187,238,215,113,153, 4,128, 6,244,172,111,148,237, 46, 72,170, + 79, 63, 50,160,119, 30,140,120, 76,198, 7,165, 51,237, 1, 84,181,249,204, 83, 42,205, 40,182,157,140,143,106,208,118, 29,226, +138, 44,251,104, 10, 97,146,119, 31, 51,204,210,103, 66,235, 86,119, 49, 97,191,207,153, 23,101,253,168,198, 14, 70,232,126,237, +236, 79,239,123,142,251,151,164, 8, 79, 67, 55,153, 15,211, 61,199,106,222, 42,177,182,226,145,242,218,230,152,187,226, 51,111, +132, 93,139, 97, 31,148,225,174,152, 13,119,215,117, 90,226, 35, 88,135,143,179,127, 82,238, 15,183,191, 78,121,145,104,229, 98, +212,107, 18,213,133, 36, 51, 48, 32,211,179,175,200,247,126,248,242,241,195,143,135,167, 91,222,158,119,205,223, 78,244, 9, 38, +133,191,121, 14, 59,106, 14,192,207,215,195,157,217,120,145,129, 67,169,255, 33,151,177,125,170, 23, 22,212, 35,183, 33,161,106, + 49,228,218, 36,131,207,117,192, 67, 33, 4, 74,127, 83,229,153, 44,239, 42, 36,197, 73, 56,145, 15, 66,161, 45,166,181, 1,117, + 67,203,213,109,184, 41, 98,225, 5,169, 79, 5,216, 80,124, 44,115,176,128,100, 67, 70,215,214,117,158, 21,223,167, 70,204,182, + 25,187, 28, 46,182, 23,149, 36,227, 83, 38, 84,101, 63,206, 0,209,212,162,199, 1,217, 19, 80,232, 28, 87,181, 19,176,206, 39, +164,205, 78, 96,105, 85, 6,247, 69,164, 15, 67, 67,184, 76,144,147, 60, 47, 85,145,120, 92,178,250,160,208, 66, 84, 50, 57,199, +172, 12,207,100, 75, 85, 77,169,176,218, 34,150,224,238,213,219,222, 26,225, 92,168,111,106,135, 24,206, 6,166, 69,112, 87, 57, +103,239, 8, 71,164, 30,223,152,170,199,208, 60,110,110,194,236, 46,136,189,161,199,225,234,219,248,245,102,253,233,159, 53,123, +146, 60,154,172,183,115,152, 15, 49,117, 39, 82,136,140,210,179,252,115,146,223,137,119,243,224,173,245,179,117,211, 28, 98,230, +126, 60,122,243,215, 29,140,155,246,184, 51,234, 64,164, 62,162, 93,174, 50, 95,190, 83,141,141,204,178,135,169,124,254, 47, 0, +103,215,178,211, 48, 12, 4,215,206,163, 15, 64, 28,170, 74, 32,113, 70,226,159,249, 36,126,129, 3,226,196, 1,129, 40, 74,155, +164,177,241,172,215,206,166, 45, 8,144,170,158,114,104, 98,215,153,157,157,157, 41,255, 33,122,209, 40,222, 79, 98,133,127,198, +230,191,229,235, 21,132,151, 10,214, 38,255, 13,169,106,163, 11,187,152,106, 24,177,177,225,138,123,125,121,253,212, 62, 14,106, +224, 89,223,188,117,170, 31,139,132,108,136,191,202, 40,173,225,220, 37,126,155, 66, 60, 91,216,193, 57, 44,158,181,201, 61,158, +164,208, 29, 34, 13,196, 46, 52,252, 7,197,252,228, 46, 77,211, 85,140,124, 59, 78,249,224, 1, 87, 23,106,171,240, 10,185,173, +231,117,215, 62,160,205,137, 3, 20,145,211,173,123,110, 65, 92,156,225,124, 52, 75,124,202, 13,237, 59,100,214, 75,202, 71,118, +229,245,223, 96,103, 29, 11,208,166,185, 89, 23, 7,107, 83,135,179,226,145,246,240,240, 22,100,151,252,116, 3,102,223,161,187, +107, 59,214, 84,212,228, 63, 29,189,211,126,139, 44, 54, 9, 21, 33,229, 53,159,231,144,115,137,224,149, 66,191, 86,221,212,115, +162,187,249,114,117, 81,221,191,188,110, 20, 45,216,171, 18,176, 73, 47,158,125,202, 8,108,236,188, 25, 16,105,228, 93, 38, 97, + 37,252, 86,108, 98,180,109,202, 81, 67,224, 24,194,107, 60,105,200, 37,243, 45,239, 51, 15, 12, 52, 58,206,143,142,252,147,161, +147,163,137,199,194, 9, 97,177, 17,147,154,178, 42, 24,174, 79,229, 27,137,130,224, 81,163, 88,104,226,120,143, 40, 94, 70, 61, + 56, 92, 27, 54, 72, 46,128,103,118,167,142,233,172, 49, 99, 85,184, 49,175, 21,241, 52,145,200, 41,214, 17, 33, 86,195, 72,239, + 79,124,214,204,184,148, 78, 15,218,240,149, 61,123,123,153,188,242,224,216,125, 52, 6, 49, 38,153,187, 97,164,140,164,131, 27, + 97,187, 88,253, 37,110,195,143,116,202,193,201,174, 45,104,146, 92,149, 93,254,114,156,147, 40,233,213,225,110,178, 32, 39,201, + 96, 14,144,187,255, 27, 6,215, 91,198,211,111,155,135, 39, 14,119,139, 58,179,136,153, 80,133,173,194,247,110,219, 4,204,110, +108,121,181,184, 89, 47, 86, 31,253,110,211,190,177, 97, 50, 53,188,178,113, 95, 23,236, 75,152, 20,177,184, 97, 96,242,176,238, + 6,206,109,225,170,170, 0, 61,220,211,208, 33, 73,209, 84,182,174,221,172,243,221, 64,125, 79,125,216, 52, 51,170, 75, 8, 40, +145,131,203, 8,163, 48,162,168,113, 52,125, 44,241,103,127, 9, 64,217,181,244, 36, 16, 3,225,105,247,133, 32,143,141,137, 9, + 18, 47,222,136,209,255,236,143,243,224, 5, 53, 17,113, 95, 29,233, 76,103,182,139,128,122,225,202, 82, 96,250,245,235,247,232, +241,251, 31, 4, 48,199, 69, 47,240,155,156,230, 60,138, 63,245, 46,145, 35,128,219, 57,213,210, 97,251,196, 53,235, 52, 84,138, + 35,248, 94,183, 27,115, 96,109,141,126, 83,241,143, 61, 9,153,173,225,180, 78, 30, 73,156,141,220,114, 94,175,202,122, 57,239, + 22, 11, 15,116,183, 59, 11,166,215, 65,240,198,112, 53,189,110,154,198,186,207,170,105,129,173, 34,244, 71,172,229,122, 19,195, +168, 13, 68, 0,237, 28,230,174, 24,173,179,162,106,219, 55,202, 48, 96, 36,187, 0, 88, 66,122,107,178,155, 52,219, 63, 84,234, +125,129,189, 97, 6,251,218,198,115, 49,161,137,204,223, 90, 50,206, 76,164,152, 84, 38,189, 13, 66,111,252, 34,201, 69,133,110, +231, 85, 19,254, 90,167,130,110, 11,184, 17, 74, 71,139,191, 19, 97,169,148,125, 74,133, 53, 82, 84,126, 65, 31,118, 70,200,253, +113, 60, 89,149,249,211,203,251, 71, 20,108,121, 16,126,233,100,149,106,122,212,135,113,246,140,211,150,175,201, 53,102, 90,181, +143, 97,130,240, 55, 24,208,117,116,106, 57, 2,225, 35, 91, 19,162,214, 53, 80,165, 47, 66,204, 1,196,102,162, 80,250,129,135, +219, 40, 14,120, 77, 59,104,204, 50, 71, 64,189,236, 56,170,239, 1,171,137, 3,131, 99,111,143,226,213,172, 74, 39, 76,139,170, + 68,166, 61, 1,117, 89, 98,168, 62,184, 9, 52, 50, 11, 29, 74,168, 36, 68,125,150,253,178,171, 43, 50,230, 64,228, 58,148,215, +202, 33, 83, 6,161,159, 54,188, 58,162,205,124,196,176, 88,138,249, 68, 33,250, 84,166,113,226, 50, 62, 28, 78, 97, 38,228,141, + 42,220, 81, 46, 43, 64, 92,100,146, 8,163,247, 35, 28, 39, 31, 15,119, 93, 24,232, 6, 25, 6,120, 32, 49, 56,117,231,111,254, + 45, 8,249, 57,220,185,250,205,203, 92, 82,147,237,241,251, 30,179,103, 62,204, 9, 46,243,233,186,188, 47,139, 57,205,111,152, + 20,227, 34, 73, 51,203, 12,142,103,182, 50,210,180, 83,123,162,179, 50, 77, 88,123,227,188,134,205,228, 82,113,210, 96, 23,204, +183, 30,173, 39, 59, 95,144,136, 76,247,119,164,152,204, 33,247, 4, 53,225, 96,117,134, 70,249,225, 70, 73,204,111, 1, 24,187, +154,158,132,129, 32,186,211,143, 21, 4,149,132,112,195, 68,207,254, 13,255,161,191,207,131, 39, 53,129,196, 40,208, 98, 59, 59, +238,204,238,108, 11, 5,245, 74,210,148,182,219,217,215, 55,239,205,251, 91, 63, 3,167,240, 56, 13, 72, 27,211,187,251,195,129, + 75,231, 80,252, 63,194, 69, 85,201, 0,161, 94,136, 79, 58,170,159, 3,253, 33,111, 65,166, 62,190,136,205, 8, 50, 56, 97,156, + 72,251,134,144, 88, 28, 93,148,251, 27,103, 29,226,205,152,110,103, 77, 67,109,181,195,247,173,249,106,205,196, 54,203,133,185, + 25, 21,207,175, 8,234, 78, 8,223,161,171,207, 55,127,232, 53, 56,153,211,193,184,112, 39,249, 30, 1, 26,141,165, 64,127,199, + 55,148, 85,206, 30, 89,215,244, 93,239,113,150,219,199,217,124, 98,237,206,225,170,218, 35,210,180,132,169, 45,252, 21,125,214, +251,106,183,255, 16, 17, 78,171,158,142, 70,215,229,239,119, 41,141,158,207,123, 25, 99,121, 79,108,227,132, 18,169, 13,124, 25, + 55, 50,112, 45, 63,183,218,207, 10,118, 98, 43,101,186, 21,126,169,236, 77,140, 73, 28,145,211,179,160,212,244, 66,177,252, 68, +235,251,195,120,114,191, 24, 61,189,172, 55,218,135,112,103,186,178,233,114,252, 73,235,242,178, 66,206,218, 78, 38,247, 24, 30, + 29,201,220, 4,196, 37,142,229,104,229, 28, 67,248,212,120, 20, 82, 55, 85, 46,140,230, 73,211,205,158,164,195, 50,116, 52,138, + 22,186,218,212,183, 78, 29,202,137,244, 35, 49,209, 32,233, 65, 97, 24, 66,198,220, 77,230,122, 62,152,110,246,134,160,120,195, + 47, 41,229, 14, 66,130, 19, 47,222, 16,194,164,125, 0,248, 77,221,161,170,118,241,150,130,230, 83,116,138, 4,211,229,195, 68, + 30,220, 25,232,219,138,210, 31, 30,184,231, 28,165, 45, 36,116, 59, 59, 22, 41, 74, 48, 53, 27,195, 29,132,141,159,194,236, 20, +113,122,212,226, 29,248,143, 2, 89,145, 26,170, 6, 41, 17, 61,189,226,142,177,216,197,163,218, 78, 65,148, 54,190,179, 43,205, + 12, 30, 29, 12,100,223,244,119,113, 39,241, 46,113, 23, 69,138, 59, 39, 55, 23,172,105,183, 25, 75, 45,232,246,106,185,156,222, + 93, 64,182,105, 61,230,171,107, 9,164,245,117,182,200, 75, 91,150,121, 83,111,169,114,204,232,202, 28, 75, 10,182,153,184,153, +161,227,133,154,115, 7, 70,236, 18,130, 6, 81,237,201,190,148, 47, 96,190,166,117,107,176,148,188,181, 96, 96, 40,205,197, 56, +243,101,100, 3, 60,108,135, 49, 24,106, 68,137,114, 56,124,154, 31, 1, 56,187,182,214,132, 97, 48,218, 47,209,214,213, 27, 19, +199,246,176,193, 16,217,203, 94,246,139,247,231, 6, 99,136,232, 16,171, 73,219, 36,203,237, 75,211,234, 70,153, 79, 34,162,150, +182, 95,142, 39,231,242, 23,126,239,141,220,123, 9,228,161, 7, 17,223, 54, 14,180,138, 79,193,171,224, 27, 94, 8,111,176, 80, +114,128,183, 17, 9,175,123,181,149,106,197,244,227,226, 96, 77, 4,122,100,228, 89,125, 63,175, 39,105, 85, 50,161, 39,147, 9, + 66, 17,201,161,150,167, 82, 50,158, 60, 44,169,168,232,145, 59, 23,183, 31, 62, 38,176,130,170,155,132,243, 42, 97, 38,102,201, +248, 69,107,195, 60, 40, 17,177,213, 52,146,115,100,246, 42, 57, 42,185, 97,236,179, 96,147,193,224,245,110,186, 94,206, 22, 19, + 61,226,146, 93,193,191, 79,124, 47,235,194,182, 43,149,150,196, 8,217, 0, 61, 77, 70, 52,178, 56, 37, 81,124, 77,168, 38, 72, +209,125, 39,112,142, 91, 8,160,172,217,213,124,169,163,254, 99,180, 46,241, 9, 69,240, 30, 0,120,134,145, 3, 99,187,161,250, + 56, 28,189, 61,205,223, 63,182, 95,210,112,241,240,139,229,164,243, 88, 1,156,135,183,190,247,144,128, 79, 86,177,106, 62,147, +103,101,214,109, 97,211,133, 66,204,159,251,228, 38,160,168, 83,119,135, 35, 70,226,162,238,185, 5,123,226, 69,104,248,235, 12, +247,166, 7, 44, 98, 0, 84,210,175, 91, 65, 53,232, 30,218, 92,168,114,234, 46,136, 54,143, 60, 25,104,174,111, 95,131, 77,156, +253, 14, 87, 21, 64,197, 39, 33, 87,203,118, 33,180,200, 26, 91, 76, 80, 34, 54,206,207,184,100, 22,117,189,222, 60, 10, 45,134, + 86, 93,209, 1, 41,151,115, 16,225,101, 8,162,249,152, 30, 81,237, 69,166, 35,222,240,244,186, 53,169,218,221,217, 86,100,178, + 10,165,184, 74, 54,240, 28,188,165,184,131,220, 65,184,190,173, 11,230, 65, 69,219,137,255,176,224, 93, 86,103,144,139, 17,132, +127, 10,141,200,157,216,137,164,199, 58,213,176,157,208, 33,209,176, 61, 29,152,115,164,214,243,151,213,236, 89, 31,237,254,180, +219, 28, 55,219,211,246,192, 15,231,178, 96,226,204,107,198, 68, 73,128,140,104,166,127,254, 89,214, 54, 34, 20,119,137,253, 30, +131, 41,233, 20,190,191,198, 69,181,201, 74,131,120,236,150,161,132,140,146,188,178, 74, 8, 61,238,115, 24, 79, 6,211, 69, 58, +203, 73,174,223,207, 85,137,149,121,141,235, 5,209, 4,252, 8,192,218,213,244, 36, 12, 4,209,221,150,182, 96, 15, 69, 73,228, +224,193,155,241,238,255,143,119,255,133, 7,162,146, 96, 8, 72, 41,221, 47,119,118,102,182, 31,152, 96,140, 55, 14,180, 52,219, +101,246,205,155,121,111,254,194,191,143, 80,124,242, 83,215,141,227, 33,124,231,163, 44,127, 67,196,147, 81, 65,199, 15,210,108, + 70, 67,211, 44,157,235,213,104, 36, 57, 44, 37,168, 23, 76, 12,203, 71,136,189,196,209, 79, 22,166,105, 39, 14, 73, 49,108,179, +155,207,220, 2,150,200, 54, 13, 16,208, 40,151,244, 39,111,107, 68,173, 66, 92,147,122,245,217,222, 47,243,183,173, 77, 51, 10, +151,193, 23,194,223,165, 61, 40,113, 4,213, 18,236,253, 6,181,223, 12,186,243, 30,250,198, 37, 62, 4, 18, 60, 19,102, 43,210, + 70,156,222,119,234,101,183,157,131,186,213, 95,139,232, 19, 30,170, 69,229,123, 40, 87,214,195,117,190,104, 32,108,153, 54,193, +217,173, 81, 42, 21, 51, 83, 69,173, 84,240, 48,199, 96, 65,163, 3, 83,212,134,158,206,128,241,225,119, 45,135,254,188,103,234, +171,153,168,153,113,222,231, 24,197,251,132, 96, 41, 38, 79,119,213,243,102,247,170, 93,206, 91, 66, 95, 50,158,244,215,150,211, +114,111,252, 14, 38,234,214,132, 67,220, 31, 57,123,181,169,245,113, 81,148, 6, 76, 57, 89,207, 58,156,176, 60,106,236,225,118, + 89,166,110,177, 46, 40,201,128, 43,100,193,210,141, 59,175, 69, 52, 36, 96,146,219, 14,208,173,141,129,210,141, 20, 46,118, 24, + 20, 18,164,225,168,151,200,245,224,188,166,220, 90, 16,119, 18, 68,161, 96, 52, 32, 41, 39, 36, 71, 41, 41, 25,179,224,228, 56, +109, 49, 7, 69,255,254,128,247, 44,210,225,131,226, 2,170, 62, 35, 55,194,124,146, 38,218,134,165,252,110,172,138, 27,253, 97, + 49, 13, 96,243, 62,219,121,228,179,133, 89,215,164, 64, 84,209,136, 1,151,189,178,170, 99,204,142,128, 93,246,209,186,176,180, +168, 29, 80,235,102,162,179,104,185, 11,238,230,220,122, 37,194,118,251, 31,182,213,113, 41,162,207,118,124,203, 14,146,242, 36, + 52, 63, 73,166,101, 16,182, 67,124, 79, 96,178, 66,250, 48,127,188,157,222, 40,115, 90,237, 62,214,245,250, 75,213, 14, 12,100, + 92, 38,243,194,129, 25,201, 36, 49,202,180,254,251, 69, 58,187,154,228,254, 51, 72,239,185, 53, 8,231,138,133,100, 83,147,143, + 40,212,137, 32,244,107,224, 41,208, 23,194,166, 34,189,145, 85, 35, 84, 38,139,178,168,174,139,170,156, 76, 65,110, 86,251,216, +213,104,161, 66,147, 54,174,137,197,218, 14,190,172,111, 1, 72, 59,159,157, 54, 98, 32,140,123,236,253,151, 0, 66,169,168, 84, +113,229,128, 4,239,255, 18, 60, 3,135,158,138,160, 21, 41,162, 33,235,172,237,233,206,216,227,245,110, 36, 10,234, 45,135, 40, +171,216,222,207,163,111,102,126, 83,253,255,210,248,162, 66, 78, 29,213,210, 97, 65,231,249,140,196,227,209,237, 34,241, 7,171, + 60, 31, 57, 61,157, 44, 49, 39, 19, 63,150, 41, 80,228,151,145,173, 19,182,110,255,173, 85, 39,166,221, 90, 82, 18, 7,208,152, +241,214,165,182,201,231, 87,234, 12,174,216, 38,123, 38,198, 59,129,222,199,205, 36, 34, 57, 18,164,195, 91,119,113,170, 47,191, +248,199,223,170, 54, 9,137, 51,120,127,222,186, 31,251, 49,218,133, 53,107, 37,112,109,123,174, 17,236,197,160,136, 87,130, 77, +206, 56, 50, 11,158,208, 30,142, 65, 11, 91,250, 60,202,189,107,185,146, 36, 2,237,246, 18, 74,231,134, 3,252,204, 70,132,162, + 0, 92,139, 64,175, 10,134,251,138,119,228, 64, 15,162,108,112,155, 78, 51,207, 86, 96,161,223,241,247,131,240, 47,163,224,181, +226,239, 71,213,142,210, 31, 11,102, 54,202, 92, 93,172,108,135,119,223,223, 56,157, 59,155, 91,242,206, 27,120,109,148,213, 39, +129,199,111,138, 91, 76,226,254,210, 63,220, 91,250, 55,245, 97,215,172,215, 26,170,185,219,176,104, 95,196, 41, 55,138, 98, 4, +167, 43,188, 96,111,201,172,187, 82,217, 81,154,132,226, 4,223,178,151, 53,255, 40, 46, 43,163, 23, 81,228, 36,153, 58,138, 66, +172, 34, 49, 50,126, 47, 97,148, 4, 59,163,146,201, 74, 55, 49, 70,238, 47,103, 54, 97,106,138,215, 25, 63,140,114, 38,210, 46, + 64, 97,241,207,114,149, 37, 97,141,159, 31, 74,101,159,187,163,203, 33, 18, 33,241,115, 69,198,217, 19,139,240,177, 35,166, 21, + 44,173,255, 41,113, 42, 0,168,160,222, 81,246,114, 49,179,178,231,209, 62,121, 90, 46,166,226, 72, 15,185,145, 85,148,125,140, +157, 33,112, 65,207,191, 12, 22,154,154,105,186,222,247, 31,180,221, 97, 94, 56,192,111,159,206, 67, 34,169, 55, 85, 83,193, 76, + 5,117,173,235,138,250,144,224,102,115,187,105,206, 15,193,255,124,253,245,180,123,120, 25,254, 12,202, 38, 47, 25,161,129, 22, + 98,183, 12, 98,239, 14,150, 84,190,109,192,236, 85, 28, 9,202,123, 33,212,160, 4, 69,231, 32, 61,141, 17,133, 4,118, 14,232, + 28, 47, 69, 7,245,105,115,182,233,190,118, 85, 87, 27,109, 7, 63, 56,199,233, 86,143,203,132, 68,194,116,253, 21,128,178,171, +233, 73, 24, 8,162,179,116, 41,104, 82,176, 7,140,137, 39, 99, 60,120,241,255,255, 6,255, 7, 7,141, 33, 80, 43,221,214,118, +199,157,157,253, 42, 22, 13, 92,129, 64,191,222,206,190,121,243,158,188, 8,202,197,121, 41, 76, 10,244, 48,158,184, 73, 53, 54, +127,227, 58, 70, 78,134,138, 98,121, 26,120,140,209,153,201,121,252, 70, 30, 54,102, 27,249,202,194, 2, 61,168,129, 36, 43,219, + 22, 94, 10,226,190,204,233, 43, 37,222, 46,244,161,234,143,131, 85, 30, 33, 44, 36,225, 90, 99, 77, 99,231,212,185,160, 77, 84, +103,187,212,117, 7, 95,157,126,190,223,108,119,111, 50,227,223, 53, 53,187, 30,190,117, 77,145,147,110,156,177, 77,198,125, 89, + 43,162, 44, 38,102,158,217, 64,167, 11,164,137,158,144,144,169,136,226, 24,242, 88,228, 18, 22,176,211,111,127,121, 42,222, 73, +162,147, 28,243, 54,129,133, 28, 56, 59, 9, 98, 52, 96,206, 18, 73,192, 43, 95,182,244,201,149,106,146, 88,168,107,251,199, 66, + 90,172,217,109, 20,148, 56, 40,239, 54,197,107, 85,149, 51, 27,126,107, 87,136, 84,181, 57, 41,225, 47, 1,214,203,114, 71,102, + 98,218, 53,110,236,163,223,182,123, 6,247, 39, 83,221,203, 89, 43, 50, 76, 54,212, 98,234,120,157,135,170, 53,250,142,108,187, +107,155, 7,182, 97, 52, 45, 25, 24,113,246,146, 12, 54, 7,152,222,137, 26, 4, 68,111,163,127,217, 75,246, 3,153,121,191, 96, + 6,174,176,199, 71,116,185, 37,206, 22, 76,240, 98, 99, 99,105,236,160, 71,112, 48,115, 44,181, 39, 35,241,215,204, 37, 78, 75, +122,194, 50,192, 68,211, 9,178,139, 83,159, 46,127,222, 92,145,236,203, 73, 72,251, 19,113,244, 96,226,160,195,234,168, 3,172, +195, 0, 34, 17,188, 39, 13, 12, 28,213,221, 40, 18,100,247,211, 46, 24,150, 19,223,236,133,212, 25,198,251, 97, 14, 56, 17,143, + 55,253,234,176, 61,215, 74, 60,167,220, 75,216,121,183, 23,188, 89,174, 26,213, 88,181,140, 52,101, 50,131,187,129,251,135,213, +227, 42, 47,204, 7,106,117,120, 63,126, 84, 4,238,138,163,167, 25,190,204, 87,230,146, 22, 3, 27,246, 76,242, 71, 52,207, 28, + 41,165, 5, 25, 63, 8,231, 81,196,146, 60, 22,122,245,118, 48,130,231,212,156,151, 15,106,239,210,209,215,216, 41,213,212,237, +190,200,215,166,244,236,116,115,236, 63,205, 91, 11,177,108,176,177, 85, 90, 6,126,152,152,111,188, 31, 1, 72,187,150,157,134, + 97, 32,232,181,157, 7,105, 90,144,144,202, 29,206,252, 2,255,255, 5,252, 2, 2, 9,209,150,148, 18,146,216,120,215, 94, 39, +105,154,138,199, 53,135, 68,114,146,217,209,206,206,172,254, 15,115,135,121,148,233,198,106,245, 41,136,159,134,254, 40, 57,224, + 32,158, 6,177, 96, 43, 97,100,139,152,180, 14, 57,223,153, 55,245,244, 52, 35, 19,201,165,192,165, 64, 47, 31,120, 90,238,205, + 64,219, 60,126, 90,223,130, 40, 8,128,182,109, 47, 33,102,157, 3, 50,171, 20,206,167,231, 26, 74, 9, 36,156,238, 90,210, 60, +124,202,135,150,193, 76,230,161,121,207,147,239, 29,163, 97,194,109,110,134, 46,188,210, 50,255,165,161,111,164,204, 25,255, 16, +222,217, 84,243,196, 97, 44, 9,127,136,127,177, 3,215,143,228,201,116,143,179,121, 16,214,225, 61,176,111, 52,226, 82,201,193, +111, 91,135, 60, 13,247,104,168,133,169, 5, 84,116,164,121,216, 24, 30,154,242,254, 11,202,232, 41, 43,220, 27, 46,175, 46,116, +182,130,253,246,235,166,148, 85,237, 42,162, 73,236,208,121,116,218, 86,119,159,167,175, 54, 71,224, 83,156,185,132,101, 83, 44, +132,125, 80,112,157,166, 21,168, 39, 40, 73, 75, 55, 29,119,182,143, 60,207,214, 14,229,193,163, 9,119, 14, 99,233, 57,123,128, +164,208, 61, 96, 78, 60,234, 14,199,148,152,238, 71,150,221, 51, 40,207, 75,154,226,180, 15, 57, 96,100,236, 44,134, 81, 73,110, + 31, 70,223,147,239,190,251,109,175,209,113, 18, 25,174,128,217, 96,162,193, 62,169, 16, 48, 99,166, 42,129, 61, 11,238, 12,172, + 48,129,117, 24,131, 32, 35, 59, 49, 33, 66,248,161,143,106, 36,159,198,252, 63,232,203, 79,136,190, 55,140,236,102, 20, 98, 24, +211,102,236,113, 46,208,204, 78,161,217, 81, 72, 99,225,247,142,203,168,131, 16, 34,137, 26,247,184,161,166,154,128, 78,165,118, +252, 93, 73,117,183,188, 93, 47,214,181,227,207,162,125, 62,188,109,155,221, 1,153,187, 97, 22,226,247,116,169, 76, 23, 25, 54, +118, 13,180,178,177, 77,131,107,205,171, 60, 41, 58,165,154,182,137,241,214, 49,166,159,178, 36, 48, 0,133, 82,240,172, 9, 81, + 76,134,124, 80,152,248,227,126,204,189, 61,108,234, 13, 85, 76,119,107, 60,240, 66,148, 75,149, 86,221,134,100, 75,229,101, 36, +127,140,223, 2,144,118,109,187, 9,195, 48, 52, 78, 82, 74, 5, 26,131,151, 77,218, 55,236,255, 63,107, 76,136, 91,201,101,182, + 19,167,105, 87,134, 52, 30,145, 64, 42, 77,114,236,216,199,231,216,103, 48,253, 81, 50, 62, 74,228,103,179,248, 74,203, 31, 96, +170,164,154, 14, 64,150,139,185,115,210, 64, 87, 61,238, 88,165, 27, 70,244,226,137,112, 13,132, 96,124,243,129, 85,116,123, 31, +247, 21,221, 34,140, 23,150,196, 88, 16,185, 48, 92,106, 76,174, 72,249, 97,169,117,160, 25,126,240,217,215, 89,185,204,135, 84, + 74,220,180,211,159,186, 84, 70,169,150, 63, 26,145,154, 49, 50,212,154,176,187,231,205,189,224,199, 54, 82,115,231,197, 0,230, +206,211, 79,122, 9, 57,253,127, 70,242, 70, 11,113,145, 0,131,239,228,148, 25,238,164,253, 90, 52,123, 60, 21,154, 20,119, 8, + 18,160,107, 46, 38, 39, 49, 93,170,209,119, 34,154, 86,178,114, 12, 3, 11,198,247,205,218, 46, 95,154,143,221,146,138,127,193, + 95, 61,217, 54,123, 41,239,168, 57, 45,211, 79, 3,199,102,139, 95,196, 56, 74, 83,255, 58,179,228, 48,248,158, 48, 55,105,186, + 61, 6,158,104,217,248, 45,132, 42, 99,157,101,190, 14,227, 48, 73,110,178, 38,201, 36,113,223, 66,224, 75,230, 46, 48,113, 72, +141,106, 92,147,145,250,243,195,153,245,191, 80,190,130,120,113,228,128,164,126, 26,138,138, 36, 51,104,240, 72,155,172,158, 96, + 6,114,118,132, 18,147, 68,119,120, 82, 62,154,105, 90,149,179, 16,126,151, 98,102,118, 8,148, 9,172, 98,245, 55, 42, 97,133, + 65,166,113,164,246,161, 10,178,151, 48, 57, 70,246,124, 16, 93,186,142,196,170,251,231, 99, 28, 36, 7,202,248,146, 48, 63,105, +162,109, 82,112,143,119,192,253,201,153,213,248,128,236, 17,179,122, 44,121,177,120, 82, 13, 3,107, 84, 99,117,139,187,250,173, +123,127,109,119,206,135,133, 49, 95,231, 67,127, 59, 1,165, 71,244,186,220,160,133,142, 11,104,140,182, 8,241, 76,166,180,206, + 93,143,225,124,193, 75,127,127,110,155, 46,153, 10, 24,185,122, 42,246,195,104,201, 13,145,173, 53,165,230, 28,114, 11,132,216, +212,144, 59, 43, 9,187,129, 53,238, 41, 15,116,241,182,134, 21,216,205,193,125,115, 59,208,240,147, 19,207,245, 71, 0,210,206, +104, 55, 97, 24,134,162,113, 72, 41, 42, 76, 76,236, 97,210,248,131,253,255, 15, 77, 72,123, 69, 19,171,170,173,141,179,216,137, +147, 16, 86, 84,137,190,211, 7,218,222, 56,206,245,185,230,193,178,253,254,223,228,106,168, 97, 61, 12, 85, 84, 34,181, 85, 82, +203, 76,199,253,199, 32, 47,129,117,165,127,129,233,154,144, 72,127, 5,122,219,239,222, 47, 51, 65,166,169,180,164, 37,129,105, + 97, 29, 5,247, 41, 99,204,199,249, 87, 75,187,144,204, 39, 72, 40,221, 45,167,241,165,155,255,136, 34, 43,105, 91,167, 92,236, +100, 61,180,133,127, 81,179,223,198,176,184,135, 73, 87, 23,103, 65,161,229,231, 42,120,131,136,255, 93,238, 19, 72, 89, 31, 99, +177,129,104,233,182, 94,142,129,153,153,192,129, 74, 80,108, 50, 92,207, 67, 94, 77, 54,219,168, 55, 82,118, 28,104,214,212,133, +248,230, 38,118,240,233, 83,108, 89,179,122,255, 67,218,176,172, 15,251, 14, 71, 36,150,154,131,139,115,157, 85, 95, 55,132,178, +112,189,107,117,216, 29, 62,209,215, 65, 72,211, 99, 58, 19,190, 2,178,124,112, 77,120,227, 19, 69,108,110,182, 75,216,186,241, + 4, 22,197, 2,137, 69,217, 30,241, 41,220, 79,118, 57,150, 89,212, 28,231, 78,170,243,188,204,242, 42, 94, 87,125,109, 37,221, +165,232,154,201, 37,188, 74,132,177, 16, 91, 4, 43, 85, 74,188, 16,134,175,145,138,233,100,183, 10, 32,132,235, 0, 71, 92,146, + 2, 65, 31,227,164, 98,132, 1,132, 62, 86,189,215, 73,145,217,152, 23, 58,200,199,210,255, 40,123,182, 29, 9,159,222, 21, 59, +239, 74,220,115,183, 61, 25,240,111,197, 93,205, 84,238, 15, 94, 26,244,241,249,120, 58,159,102, 36, 78, 7,194, 12,143, 50, 25, +234,201,104, 95,188, 83,152,228,174,217,191,108, 94, 7,180, 79,134, 6,242, 98,186, 30, 33, 68, 77, 56, 48,200,243, 23,224,171, +125, 95, 28, 54,173,241, 66,175,251,177,239,167,193,226, 52,232,137, 18,212, 9, 43, 59,217,156,176, 9,210, 62, 35, 0, 10,218, + 21,103,198,133, 55,153,104,170,225,100,218,242, 50,192,218,200,222, 29, 38,181, 48,236, 98, 92,235,205,214,184,193,126,115,148, +227,138,253, 41,248, 39, 0,107,231,178,211, 48, 16, 67,209,241, 76, 58, 67,104,139, 0, 9, 22,101,193,255,255, 19,107,132,144, +128, 13, 82, 75, 50, 15, 98,123,156, 76, 30, 4, 16,116,221, 74, 73,212, 56,246,117,238,185,213,127, 93,175,117, 60,153,154,149, +248,223, 18, 40,211,218, 88, 6,197,170,109,130,151,159, 13,151,105,100,151,159,127,188, 8,214, 91,164,196,192, 77,237,246,206, + 61, 60,189, 33,119,145,153, 32, 4, 31,121,137,213,161, 10,143,190,121, 23, 61,106,210, 50,123, 97,246,114, 11,127,146, 35,179, + 18, 83,167, 36, 46,181, 25, 42,114, 87,118,177,113,222,101,132, 16, 22, 86, 43, 85,200,255,224, 69,120, 93,232,239,236, 44,221, +210,249, 19, 60, 0,211, 6,108,102, 75,225,232, 64, 35, 66, 58, 71,223, 51,215, 24,221,199, 23, 68,226,166,109, 98, 56, 42,211, +170,120, 41,235,120, 79, 39, 2, 57,230, 25, 11, 51,146,175, 61, 50,194,238,174,235,166,105,145, 80,246, 17, 94, 79,136,151, 1, +217,181,150,199,124,175,212,109,125,241,156,182, 21,229, 86, 23, 14,210,222,200, 52,212,243, 34,178, 39,138,172,161, 75,149, 0, +178,211, 38,228,247,126,217, 30,145, 29,107, 82, 53,162, 88,132, 36,201,104,112,197,124, 77, 47,129,162,255,128,233,170, 88,175, + 44,144, 74, 35, 84,182, 61,167,156, 64,147,178,175,169,207,132,231,152, 85,114,107,131,132,133, 6,206,147, 84, 5,105,244,219, +155, 98,237,107,176,220,188,143,149,153, 40,185,219,227, 21, 69, 26,228,151,217, 83,117, 50,251, 76,138,123, 14,242,200,237, 93, + 28,119,238, 48, 94,165,142, 53,153, 5, 89,102,145,181,247, 39,122, 45,197,148, 44, 22,119,149,135, 90,205, 18, 54,254, 69, 17, +116,170, 13, 88,163,187,123,194, 94,185,131, 51,174,187, 62, 22, 76, 27, 61,165,155,128, 49,149, 67,164, 76, 27, 9,138, 15,253, +211, 15,127,142,239, 46, 56,115,182, 65, 19, 77, 55,250,123, 82,105,212,222,238,121,199, 10,185, 21,236,253,186,137,211, 38, 80, + 27, 66,231, 83,164, 38,137,179,177, 2,111,155,169,241,231, 5,120, 54, 17, 6,148,118,218,238, 8,107,179, 59,250,163, 97,208, +157,130, 79, 1, 72,187,178,157,134, 97, 32,232,221,117, 46,170,130, 42, 1,226,129,255,255, 55,120,168, 84,142,182, 57,108,147, + 93, 31,113, 32,105, 5, 84,125,168,170, 86,121,136, 61,158,236,206,206,232,191, 65,249,213,178, 12,172,127,185,148,119, 5, 23, +122, 29,234,186, 81,156,203, 20,109,106,138, 6, 73,181,232,108, 2, 93,244,254, 87,204,118,218,168,245, 46, 17,239, 55, 85, 55, +208,203,123,215, 20,133, 13, 50, 50,190,192,222,142, 55, 92,111,141, 61,186,193, 3,217,249,135,230, 44,117, 41, 77,172,212, 83, +244,133, 79, 51,174,165,144,119, 41,187, 51, 95, 16, 97, 37,214,124,245, 17, 76,135, 86, 37, 91,202,235, 44, 50,193,122, 37,239, +173, 20,220, 41, 20,130,240,228,179, 8, 98,156,200, 13,231,240, 66,193, 51, 23, 56,162,115, 47,221,191,179, 24,212, 54,154, 91, +205, 90, 97,163,169, 29, 76,109, 65,168, 4, 47,183, 15,182, 91,240,226, 25, 50,242,204, 49,174,217,222,185,195,103,127,251, 80, +238, 54,229,235,190, 35, 50, 13,113, 83, 91,103, 81,130,254,245,168,212,115,179, 61, 20,119,192, 70, 19,144,203,169,178,105, 76, + 84,110, 38, 61,143,106,138, 89, 37, 63,164, 74, 68,149, 5,123,174, 72, 12,142, 11,134, 43, 1, 53, 76,252,107,200,168,179,223, +148,118,151, 34,227, 35,178, 39, 75, 26, 88,164, 23, 48,251, 20, 29, 7,226, 73, 25,146, 25,236, 68,225, 65,105, 23, 77,116, 98, + 68, 28,138, 17,128, 14,185,178, 78,121,145, 52, 96,230,179, 97,215,144, 27,112,141,239,172, 69,119,242,172,216, 4,238, 32,114, + 76, 55, 89,103, 39, 67, 71,249,221, 2,136,255, 58,161, 52, 49, 57,175, 11,180, 19, 23,243,227, 75, 6, 50, 3, 52, 55,223,212, +139,207, 79, 26,169,179,255, 10, 22,131,149, 29,228,226,237,211,194,241,145,203,238,220, 80, 45, 56,160, 3,118,205, 19, 1,141, + 80, 90,143,132,158,105,182,183,180,162, 26,171, 66,213, 6,173, 26,222,206,170, 19,246, 99,125,144,183, 24,205,114,163,203,231, +145, 27,225,224, 39,215, 86, 67, 73, 52,158, 16,189, 24,203,184,184,199,249,196, 0,111, 75,199,233, 89, 90, 44,208,253, 0, 28, + 66,214,127,177, 97, 81,216,148,108,193,100,209,154, 2, 75, 71,208,155,163,119, 53,255, 18,128,180, 43,217,105, 24, 6,162,241, +146,180,164,105, 37,122, 64,220, 56,244,255,255,128, 79,225, 74, 15, 64, 41, 82, 11,117, 22,219,204, 98,199,105,186, 32,160,199, +168,178, 34,103, 60,158,229,189, 55,127,140,223,127,236, 71,159,229,190,102,169, 86,115,169,204,147, 44,176, 87, 84,240,215, 60, +251,104,113,127,236, 5, 18, 98,179, 63, 3, 59,248, 72,180, 67,251,203, 47,175, 89, 4, 81,171,187,106,186,186,175, 30,159, 62, + 20, 99, 34,124,234, 76,195,106,175, 78, 62,228,170,109,236, 38,142, 58, 58,187, 3,252, 5,234, 88,143,102, 25, 50,134, 24, 50, +131,137, 26,170,136,149,211, 20, 74,207, 50,185, 40, 48, 19,116, 40, 8,221,238,233,101, 14, 87,181, 36,135,199,137,169,164,139, + 76, 44,208,133, 40,227, 81,166,145, 29, 61, 88,210, 82, 9, 84,177,147,106, 78,237,132, 70,194,237,130,138, 24,144,169,204, 20, + 50,164,193,148, 74, 37,182, 52, 75,178, 16,222,214,178, 54, 93, 23, 65, 16,224,246,225, 98, 32, 81, 29,140,253, 49, 9,144,162, +235,220,219,246, 80, 84,170,204, 53, 5, 59, 88, 31,249,140, 44, 42,254, 65, 26,177,130,100,168, 90,110,197, 28,140, 81,163,216, +174,198,234, 12, 70,136,196,133,244, 54,225,100, 2,192, 34, 12, 81,226,230,234, 88,233, 49,196,251,228,137,108, 24,182, 55,100, +205, 7,231, 30,149, 14,122, 42,205, 16, 45, 46,252,209,170, 1,252,157, 37,133,105, 63, 64, 9,136,203,221,236, 17, 88,145,240, + 49,204, 92, 18,146, 37,163, 73, 56,140,197,240, 28, 63, 29,244,158, 56,132,247, 16, 40,160, 58,129,236,211, 0,123,101, 8, 0, +221, 25,248, 87,217,207, 43, 78,102,224,143,207,205,168, 36,234, 66,128, 19, 57, 70, 46, 86,102,226,192,147, 40,232,232, 78,106, + 47,191,109, 2,249, 52, 22, 49, 72,255,186,190,230, 62,224,166,158, 2, 49, 71,125,224,147, 36,251,127,206, 29, 2,240,214,214, +231,114, 2,230, 36, 4, 97, 61,194,188, 35,167,137,120,170,186, 84,183, 83, 93, 58,186,119, 39,200, 91,199,239, 12,174,191,204, +115,147, 21, 16,147, 47,228,108,170,111,214,102,221,102, 6,246,184,113,109,151,185, 9,216,185,247,207, 95, 47, 27,243,190,179, + 7, 2, 80,130, 43,176,141, 51,112,224, 44, 98,167, 58, 56,143,164, 23, 42,104, 50,150,239,245, 63, 88, 34,169,200,114,200,149, + 91,156, 34, 1,254,129,143, 67, 16, 83, 21, 72,128,118, 68,131,102, 45, 74,196, 23, 21,106,162,164,168,173, 41,100,241, 45, 0, +105, 87,178,155, 48, 12, 68,109, 39,206, 2, 41,203, 1,245,212, 67,197,255,127, 79,111,189,209,170, 82,213, 2, 45, 91, 98,123, +234, 25, 59,198, 9, 75,183,136, 19, 7,100, 12, 30,207,242,150,127,245,103,126, 2, 98, 63, 27,226, 35, 9,145,240,235,118,114, + 41,213,151,120,238,151,129,230,140,164, 37,143,162, 60,239, 53,255,117,155,222,126, 48,113,135,123,135,255,143,186, 85, 2,232, + 61, 36,229,200,166,185,156,207,170,197,202, 60, 60,111,115, 41,180, 19,212,107,143, 2,199,184, 9,143, 38,189,151,192,155,230, +201, 75,116, 94,108, 43, 5,141, 45,211,102,241, 77,139, 19, 39, 76, 36,162,116, 82,140,155,162, 74,112, 88, 63, 40,132, 1,181, +170,213,158,193,175,140, 53,110,232, 53, 78,249, 40,147, 26, 68,161, 1,209,144, 32, 86,100,217, 91, 73,164,236,230, 9,212,164, + 50, 54, 73, 81, 21, 95, 10,155,164,160,171, 24,197, 26,190, 19,182, 52, 65, 66, 71,153,128, 77,198, 7, 41, 95,215,201, 90,233, +141, 65,112, 75,112,155, 76, 73,186,221,110,224, 70,195,226,237, 48,172,146, 26, 84,134,147, 89,172,253,221,101, 86, 18, 66,233, +214, 46,169, 24, 65, 62,126,199,224,207, 36, 39,197,118, 55, 0, 23, 32,140, 48, 29,201, 70,195, 34, 3, 45,237,169,153,167,115, + 78, 19,232,154,173,158, 59, 4, 39, 85,104, 27,238, 45,228, 47,192,168, 3, 50,239, 88, 6, 4,142,113,152,207, 71, 32, 10,207, +104,101, 87,133, 77,226,252, 15, 34, 65, 69,212,158, 35,161, 35,240,198,115,112,218,162,225,206,235,129, 26,190,206, 13,131,123, + 23, 3,184,154,126,226,151,208,116, 31,185,225,180,233, 66, 23, 67, 40,239, 95, 66, 60, 78,147, 59,114,188, 16, 48,136,208,155, +205, 2,251, 83,254,126,130,237,225, 81, 19,198,176, 35,211,146,157,210,151,216,229,228,253,252,188,238,187,135, 42, 78,127, 64, + 15,250,112, 57,163,247,201, 59,250,117, 56,182, 42,114,154,240,141,105, 49,195, 62, 8, 40,157,242, 61,215, 50,245, 24, 33,180, +245,192,122, 27,121, 70,147,108, 84, 38,243,117,179,220,169,221, 80,150, 85,146,229, 40, 61,178,124,253,124,217,106, 68,199,187, + 22, 0, 50, 31,161, 41, 52,182,236,181, 38,221, 76,180, 17,194,126,140, 12, 33, 11,108,209,172,221,190,208,226,115, 66,126,248, +118, 60,141,107,104,157,158, 93,142, 19,121,123,186,148,253,112,165,114,153, 9, 4,249,193,151, 0,172, 93, 75,111,219, 48, 12, + 54, 41, 75, 78,215,100,109,177,165,235,122,217,125,251,255,192,254,200,142,187,183,151,162,104,220,198, 15, 89, 28, 73, 73,137, + 93,123, 65, 6,236,152, 67,226, 4,145,168, 79,228,247,248, 15,250,166,127, 2,242,115,239,248, 49, 53, 42, 90, 46, 81,214, 19, + 46,166,134,207,141,226,222, 9,169, 38, 98,168, 81,216,194,225,222,247, 80,192, 29,184, 31, 5,237,200, 51,244,174, 71,147,207, +168,247,249, 84, 20,247,174,250,126,119, 3,214,253,252,165,180,119,205,197,212,185, 53,102,126,152,124, 44,191,241,119,176,223, +202,226,214,247,140,103,159,207,152,236, 15, 35,187,152,242, 72,169, 36, 61,177, 41,182,236,175, 12,110, 63, 84, 77,215,251,140, +241,207,161, 96,155,220,239,230, 87,155,202,221,174, 45, 18,223, 28,161,239,232,169,165,181,114,197, 90,128,181,163,107,203,181, + 88, 66, 54,120, 89,241, 50,221, 88, 89,211,206,224, 85, 85, 94, 90,149,232, 33,131, 14,134, 0, 34, 38,121,220, 53,245, 91, 83, +183,254,169,243,221, 32, 11,104, 5,184, 19, 18,209,129, 39, 44, 33,181,245,139,103,192, 98,251,240, 49,224,214,192,198,211,202, +192,118,101, 26,179,217,153,203,189,168,121, 52, 18, 65,183, 57,196,240, 6, 37,204, 16,166, 20,185,172,186,135,225,216,194,165, + 44,184, 95,232, 51,100, 79,173,212,118,167,163, 5, 87,108,222,100,234,217,212,222, 36, 22,154, 48,173, 27, 48,182,237,154,172, +222,133, 46, 1,254,149,170, 20, 70,165, 7,115, 42,141,176,132, 98,228,216, 33, 7, 94,202,183, 86,121,229,192,129, 58,102, 80, + 72,145, 17,209,138,203,159,250,175, 49,145, 39,147,141, 59, 1, 78,191, 4,193, 72,248, 52, 27, 29,231, 27,114,200,193,126, 71, +186,209,172,184, 19,205,118, 47,156,154,181, 77, 26,104,211, 3, 37, 31, 55,148, 83,182, 19,169,105,178,193,223, 5,159, 46,130, +119,135, 86, 2,143,150,195, 89, 78,236,187,225, 28, 72,154,161, 5, 3,106, 6,213,194,137, 52,146,135, 90,124,190,184,151,244, +153,208, 1,150, 93,240,174, 48, 46,136,125,100,201, 16,200, 24,212,152,130,166,111, 90,223, 34,186,155,234,250,235,197, 23,254, +125,207,175, 15,111,253,235, 94,252,103,106, 47, 12, 62, 31, 53,115,154,153, 60,180,212,201,147, 18,115, 16,194,128, 26,228, 38, +141, 29, 27, 93,141,210,108, 41,221,127,202,162, 84, 56,168,129, 31,169,201, 81, 26,189,103, 36,139,183,108,193,197,135, 6,159, + 76, 45,237,255, 8,192,218,213,244,180, 17, 3, 81,219, 99,103,119,147,109,137,128, 30,138,132,122,226,200, 63,239,127,233,185, +135, 10, 9, 36,122, 64,136, 64, 9,155,100,237,153,122,108,175,227, 77, 2,180, 18,199, 68, 81,178,218,172,159,199, 51,239,227, + 99,230,171,255, 85,200,103, 81,146, 44,189, 7, 18,207,193,137, 93,235, 18,218, 9, 68, 63,232,126, 67, 99, 33, 85, 30,222, 98, + 54,215, 27,168, 53,225,206,210, 53,209, 84,170, 11, 83,159,147,242,255,214, 2,125,153,236,113,214,205,216,123, 75,127,105,155, +203,111,243,171,174,255,254,227,183,199, 58, 0,158,217, 57, 84, 49, 22,176,120,234,217,234,198,127,219, 47,212,167, 32,190, 58, +238, 54,175, 69,138,251,120, 23,142,221, 72,147,194,237,142,192, 24,161,165,131, 79,214,181, 70,207,155, 74,117, 29, 13, 68, 26, +255,153, 99, 33,206,185,166,144, 29,239, 53,226, 94,224,141,160,151,196,186, 73,119,149, 27, 65, 0,103,173, 62,157, 79, 13,176, +138,249, 97,233,145,213,250, 35, 91,205,162, 45,226,124, 25, 96, 23, 7,195, 36, 32,229, 97,221,104,117,210, 76,218,137, 60,153, +177,169, 53, 7, 66,106,211, 84,218, 84,198, 0, 60, 46,186,199, 63,171,171,251,231,249,178,123,232,214, 43, 71,154, 67,127,120, +133, 25,160,217, 4,206, 62,195, 81, 51,169, 64, 78,107, 38, 7,191,180,245,207, 39,185,114,234,206, 86,183, 54,144, 59,253,143, + 70,227,129,200,200,141, 82, 30,127, 70,181, 50,199, 40, 97,193, 80,140,114,160,109,111,101, 76, 23,193, 98, 28,131,217,190,112, + 72,162, 72,137,110, 56, 12,243, 48, 23, 4, 37,121,131, 50,112, 28, 80, 11,141, 98, 6, 14,116, 40,156, 24, 21, 41,165, 9, 71, + 97, 93,128,169,207, 66, 41,218,221, 69, 35,177, 88,194, 51,249, 86, 15,188, 73, 18,219,204, 62, 26, 70, 70,251,155,136, 42,104, +221,209,176, 71, 15,226, 32,114,242, 93, 74, 66,129,207,140,236, 57,228, 58,103,209,238,128, 59,109,239,209,216, 40, 61, 53,144, +222, 88,247, 50, 53,134,229,118,217,202, 67,180, 93,220,187, 60, 42, 90, 40,205,218,117, 56, 46,216,227,203, 8,238,251,147,240, +127, 60, 92,208,171, 91, 83, 60, 97,248, 90, 93,134,226, 93,242, 90,224,231, 85,212,208, 54,186,117,110, 99, 49,148,220,128, 65, + 48,202,218, 72,191, 9,104,235,235, 33, 15,241,170, 23,182, 39,127,117,171,231,126,129,140,101,184, 97, 83, 95,134,181,158,237, +124, 83, 46, 89,156,139,134, 55, 45,155, 65, 18,183,246, 33, 60, 15,148,178, 2, 66,160, 74,232, 14, 25,161, 55, 65,193, 28,246, +126, 21,186,172, 38,159, 95, 69, 18, 9, 5, 41, 39,135, 2,166,146, 49,250, 83, 86,170,254, 43, 0,107,231,182,211, 54, 16,132, +225,217,131,215, 54, 77, 82,226, 74, 69,136,162,158, 37,158,128,167,230,158,135,224,174,247,149,170,162, 86, 13, 16,176,130, 72, +236,120,179, 83,207, 30,156,181, 9,130, 74,125,129, 72, 86, 70,179,179,255,252,251,253,255,205, 63,243, 79,103,128,137,218, 49, + 70, 65, 60,143,206,237,221,183,182,157,133,199,122,231,191,219, 63,108,165, 61,230,230,169, 96,126, 18, 4,116,220,124,163,151, +173,252,115,158,188, 21,105, 33, 69, 42,132,146,140, 39, 73, 9,250,236,199,237,124,185, 86,228,107, 2,143,165,182,150,203, 16, +255,135, 91,149,136, 8,206,236, 15,240, 49, 75,191,160,158,129, 94,134,240,163,213,115, 69,102, 34,193,148,123,211,133,153, 67, +157,175, 77,185, 88, 77,115,229,182,193, 83,194, 8,139,211,105,113,114,188,127, 49,187, 62,159,149,115,219,241, 39, 0, 31,129, + 23, 32,191, 67,115,239, 79,120,104,199,134,247, 74, 78, 94,165,239, 14,198,121, 59,123, 84,186,200,244,186, 78, 26, 34, 92,152, + 70,243,170, 29,213, 57, 77,143, 57,153,122, 97, 36,165,146,124,148,202, 44,229,175, 51,149,229,170, 49,244,190,238,242,182,186, +250,121,125,121,179, 40,151,245,155,145, 58, 62, 40,190, 30, 29, 94,221, 45, 87,117,211,150,115, 42,219,202,198, 81,130,119, 53, + 46,144,107, 20,191,239,245,175, 7, 44,169,158,137,141, 68, 65, 76, 27,194, 40,146, 8, 13,194, 82,182, 88, 64, 10, 9,231,184, +235,190, 29,131,236,238, 5,148,174, 47,116,116,224, 94,130,133,119,236, 5, 17,217,225, 7,224,169,225,157, 5, 35, 60,108,221, + 26, 96,162,102, 50,108,239,248,172, 57, 58,110,150,189,169,223, 34,136, 89, 68,221,233,152, 51, 17,149,151, 57,230,150, 17,232, +184,240,220,199,183, 51,214,201,232,216,211, 84, 88,124,193,112,224, 49,251,145,154,130,225,156, 8,223,223,247,236,158,125, 29, +120, 0,182,177,121,161,185,227,176,185,187, 4, 84, 51,252, 9, 30, 36,115,159, 23,183, 75,130,197, 39, 87,172,172,255,112,105, + 56,188, 15,142,217,202, 54,247,151, 8, 53, 93,247,207, 69,246,176,169, 94,110,221,134, 71, 73, 53,204, 3, 26, 29,134,156, 39, +246, 47, 73,197,228,195,248,211,138,158, 35,145,224,214, 24,172,117,181, 39, 20,221,115, 29, 86,211,198, 97,147, 95,192,208, 66, +220,208, 30,149,226,150,236,199,106,109, 61,142, 33,190,211,243, 42,172, 1, 6,237, 29,216,154, 84,219, 75, 43, 5, 9, 48,231, + 0,144,182,124,108,166, 7,154,136,130,167,195, 90,222,101,243, 56, 8,169,123,109, 78,186, 60, 45, 98, 18,193,136,153, 67,123, + 95,162, 76,178,191, 2,208,118, 45,185,109,195, 64,148,164, 40, 75, 70,163, 38,112, 12, 24,104, 29, 20,217,116, 83,244, 2,217, +231, 2, 57, 95, 47,209,109,114,130,172,178, 46, 80, 36, 93, 20,104,190,112, 28,196, 54,164, 80,195, 12,103, 72,153,180,157,207, +166, 94,121, 33,255,104,106, 56,111,230,205,123,250,127,132,239, 55,175, 89,169,210,216,110,202, 57, 89,253,205,168,205,190, 64, +150, 18,137,122,101,151,200,219,148,234,182,236,196,102,142,174,100,112, 35, 95, 44,154,223,124, 24,176, 11, 27,254, 81, 0, 89, +166, 49, 11, 38,227, 3, 95,235, 12, 55,190, 81, 30, 58,217,168,243,230,190,224, 84,192,163,212,123,206,151,197,252,165, 94,135, + 14,227,172, 98,125, 54,124, 83, 74,216, 80,228,187,167,145, 38,121, 47,198,173, 24, 23,229,172, 94, 20,194, 14, 85, 89,103,226, +248,207,213,233,195,195, 93,184,248,150, 46, 62, 44,242,163,178, 58,153, 78,230, 2, 10, 33,119,100,158,151,189,253,207,187, 7, + 95, 71,147,155,197, 84,212,117, 83,171, 18,116, 11, 91, 10, 79, 53, 49, 80,184, 51,179, 92,169, 39, 34, 40,126,196,253,219,215, +101,137,128, 84, 92, 78,235,243,139,219,235,201,227, 13,230,236, 77,139,187,185,234, 23,223, 71,219,223,198,131,159,191,254,253, + 56, 59,191, 18,142,238, 59,116,211,167,249,238,206,224,206,124,152, 67,238,228, 0, 92,221, 30, 17, 66,219,227,230, 40, 62,179, +236, 52,173, 98,186, 55,145, 0,104,228,154, 69,189,164,149,105, 25,129, 39,246,162,106, 9,216, 40,203,230, 23, 65, 8,195,113, + 5,121, 57, 47, 35,188, 88,110, 72, 16,109,100,232, 28,202, 62, 54,230,105,192,186,156,245, 90,190,241,110, 74, 70,240, 83, 50, +174, 34, 43, 35,120, 10,150,219, 46,214, 11,161,114, 69, 78,250, 66,141, 10, 70, 38, 65, 72, 71,110, 78, 49,149,232, 88,163,138, +103,219,153, 61, 3, 1, 18,179, 52, 88,112,181, 78,223,196, 46, 23,186, 83, 13,235, 14,146,216, 33,175,227, 31,181, 41, 68,134, +110,196, 36, 9,241,114, 85, 1, 47,210,117,144,203, 21, 6,155, 52,125, 33, 77,116, 18, 42,228, 59,229, 4,248,145,171,220,209, + 78,220, 96, 93,189, 98, 20, 60,218,250,116, 61,187, 76,181,106, 94,139, 79, 33,191,198,172, 78, 85,189,202, 24,140,191,217, 94, +245,165, 68, 8, 79,150, 98,115, 80, 51,131, 57, 82, 99,233, 19,129,176,178,198, 88, 1,154,188, 62,100, 75,184,136, 44, 10,129, + 41, 52,116, 80,118,193,221, 75,186, 19, 94, 7, 58, 16,100, 38, 28, 49,207,184, 16, 47, 91,175,222,238,105, 75,140,179, 52, 43, +112,250,170, 27,123,192,181,129, 64,194,109,124,252,133, 28,232, 17, 64,184,249, 68,119,215,129,107, 11, 60, 11, 64,218,181,181, + 36, 16,132,209,153, 93,117,119,205, 10,210,110,148, 4,249, 96, 15, 69, 69, 96, 84,255,184, 63, 17,244,216, 99,244, 18, 65, 81, +102,146,105,153,165,235,230,206,126,205,125,103,204,162, 72, 22, 17,113, 69,240,155,153,243, 93,206, 57, 63,233, 3,231,243,249, + 90,173, 86,175,215,255, 51,114,164, 31,213,106, 53, 12,233, 41, 56, 26,123,173,179,225,114,185,188,180,188,212,233,180,191,116, + 38, 97,242,184,194,247,191, 1,172, 37,162,217,198,114,197,238, 31, 29,110,238,110, 55,234,119,156, 34,204,152,169,156, 96, 38, +159, 89,167,209, 21,118,101,142,136, 80,190,123,137, 50, 46, 86, 21, 0,180,119,176,191,177,179,213,188,111,196,244, 75, 32,181, + 29,120,102,224,221, 45, 50, 88, 45,115, 89,109,113, 71,126,215,168, 16,250, 4,125, 4,209, 71,178,224,249, 67,146,188, 2,161, +215,195, 32,188,138,134,237, 47,248, 40, 34,113, 9,156, 15,194, 64,193,138,147, 93, 47, 6,187,149,210,218,204, 84,183, 61,188, +125, 26,244,232,253, 24, 21,114, 52, 64,221,188,159,161, 56,125,218,203,176,186, 77, 14, 7,158, 59, 27,184, 65, 22,247, 6,209, +117,163,123,118,249,120,114,217,186,104,117, 31,250,225, 77, 28,117, 32,246, 25,137, 9,157,191,188, 29,223, 52, 79,223, 7, 33, +130, 34, 66, 21,111,106,185,176,138,253,249,110, 82, 96,202,143, 14,202,136,162,186, 84, 58,101, 66,157, 68, 66,106,108, 96, 73, +129,116,148, 38, 10, 72,205, 79, 57,156, 46, 17,172, 42,177, 0,128, 37,228,104,176, 95,204, 17, 58, 60, 46,230,174, 53, 67,148, + 69,144,238, 34, 26,222, 24, 41, 32, 74,192,132,110,214,245,251,104,135,137,150, 53, 82, 50, 60, 53, 94, 16, 30, 49, 56, 13, 72, +108, 43,110,200,248,196, 63, 47, 40,144, 70, 32, 74,204, 61,149,231, 77, 82,228,147,142,253, 96, 43, 61, 74,147, 37,100,240,152, +164,100,163,105,127,154, 24, 53,244,196, 32, 45, 43,160,132, 29,171, 50, 5,227,211,239, 22, 20,183,236,209,237, 79, 77,104, 15, +252,117, 44, 38, 49,154,196, 38, 96,207,114,101,253,112,212, 87, 57,203,228, 63, 21, 91,197, 25, 36,104,239,172, 56,195, 49, 28, +221, 25, 23,131,213,146, 63, 71,223,137, 70,194,119, 7,124, 87,112,227, 97, 68,132,138, 16,221,232, 99,154,239,210, 13,154, 16, +102,190,193, 49,138,224, 37, 33,197, 12,211,222, 6,140, 96,200,207,105, 71, 37, 49, 44,183,117, 17,214,174,160, 92,186, 93,250, +127,196, 72,184,253, 8,151, 90,125, 76,153,174, 4,150,202, 38,191,157, 79,220,171, 73,194, 79, 1, 40, 59,159,159, 38,130, 40, +142,207,108,219,244, 7,181,166, 8, 6, 69,227,133, 72, 2, 4,216, 11,132,152, 24,255, 6, 99, 82,245, 32,233, 81,251,239,233, +213,179,137, 7, 37,225,104,132, 64, 66,176, 16, 64,183,216,101,119,103,158,243,222,252,216,233,178, 74,220, 76,154, 61,108,155, +201,108,247,237,155,153,247,253,124,255,149,164,168,128,219,239,247, 11, 17,191,215,235, 93, 63,191,241, 8,195,240,221, 96,160, +187,179, 30,134,111, 7, 3,191,186, 89,159,190,120,217, 91, 88,124, 92,128, 50,251,194,244, 27,131,187,143, 61, 40,148,222, 56, +120,233,230,147,173, 87,253, 55, 43,225,186, 53,145, 96,142,246,101,160, 55, 4, 33,195, 79,244, 90, 0,161,149,145, 84,131, 10, +198, 75,158,133, 91,155,207,183, 95, 47,173,173, 74, 74,149, 28,162,157, 27,213, 40,252,192,197,241,234, 60,171, 45,176, 96,134, +240,232, 29,170,201,169, 89,115,165,210, 67,107,157, 18,115, 34, 79, 89,114, 20,143,239,215,155,119, 88,237,130,137,239, 76,156, +148,125,235,140,193,151,228,114,140,198, 29,181,135,211,237,229,123,183,207,207,211,143,187,195,207, 7, 42,125, 79, 84, 96,111, + 85,177,140,163, 81,101,237,186,202, 21,121, 10,188, 59,197, 59, 77,158,102,226,219,113,244,126,231,232,195,215,195, 79,123, 39, +195, 81,116, 32,198, 67,134, 12,250,217, 32,232, 50, 54,130,108, 63,137,127,138,116,174,218,124, 54,117,247,233,244,202,226,236, + 70,171,189,198,235,115,191,161, 73,227, 35,137,167,134, 20,135,140,196,217,106,184, 80,147, 71,152,165, 76, 91, 55, 88, 55, 32, +105,248,226,224, 24,227,228, 75, 97, 44,174,180,237,181,224, 46, 24,217,176,207, 44, 24,197, 10,238,109,145,184,200,183, 7,243, + 93, 59, 74,222,109,222, 14,215, 22, 10,108,112, 55, 10,111,183, 28,175,187,236, 53,176,139, 9, 28,254, 18,247,109, 63,185,231, +241, 43, 11, 50,141,204, 43,199,113,182, 68,224, 40, 94, 28, 76,213,169, 6, 6,154,210, 8,167,216,229, 80,108,204, 26, 29, 57, + 77,191,134, 79,229,215, 8, 83,131,104,126,138,123, 45,112,151,185,109, 13, 67, 69,158, 8,238,110, 77, 95,187,190,112,106,238, +159,207,140,180, 13,172, 93,135,103, 11,203,243,224, 46, 39,109, 67,120, 62,212, 19,143, 60,120, 27, 42,255, 21,220,181, 68,241, + 65,247, 81, 11,141,235, 75,204,116, 51, 35,126,198, 46, 52,130,122,217,141, 43, 95,228, 65,121, 71,165,113,171,209,161, 10,212, +160,130, 12, 72,136,113, 66,143, 89,140, 26,171,113, 38, 46,211,171, 81,252, 43, 74, 46,162,171, 40, 78, 99,169, 39,253,172, 66, + 72,138, 0, 19,121,213, 16,189,193,193, 80,252, 53, 33, 20, 51,113,105,156,199,133, 29, 91, 3, 81,151,228, 96,142, 50, 37, 16, +168,129, 2,245, 62,201, 8, 45,141,209,133, 30, 52,144,142,117, 74, 65,159, 44,122,244, 61,114,166,103,244,226, 1,145, 16, 74, + 94,205, 48,254, 8,192,216,181,245, 54, 13, 67,225,216,105,218,164, 26,176,144, 84, 66,172, 12,161,149,246,181, 47, 60,241, 48, + 9,232,143,157,132, 64, 72,252,143,150,155, 32, 69, 32,113, 29, 18,105, 39, 54, 37, 77,156,196,198, 62,190, 52, 77, 35, 65,158, +226,212, 61,182, 44,231,228,248,243,231,239,252, 27,159, 9,195, 48, 8,130, 40,138,164,155,158,205,102,139,197, 98,181, 90,241, + 24,220,220,123,158,199,227,113, 94, 47,230,133, 56,150,222,159,255,203,196,254,211,233,116, 49,159,167,105,218,184, 15,194,112, + 0,213,100,209, 92,195, 59, 67,183,223,255, 8,141,114, 83, 55,131, 32, 1,251,188, 27, 1,116, 40,210, 63,241,143,144,105,180, +126,141, 38,147, 44,221,244,193,136,193,100,252,112,112,250,228,209,155,249,226,249,217, 83,254,240,100, 50,190,136,215,126, 24, +124,142,150,188,120, 52, 28,242,250,159,150, 75, 45, 10,137, 78, 70,163, 77,154,253,252,246, 67,189,161,240,101, 60, 28,248, 15, + 31,159,190,123,245,250,229,217, 51, 62,164,247,198,247,215,113, 44,140,124, 88,106,102,178,168,122,105, 49, 94, 14,113,231, 8, + 52, 94,127,195,146,202, 40, 47,102,181,253,213, 70, 60, 82,130, 96, 25,156, 59,165,107,154,247,114, 58,246,188,195, 18,191, 45, +184,243,109, 89,103,201,143,211, 45,187, 59,241, 15, 18,187,124,241,254,252,122,215,121,112, 55,244,251,158,139, 17,247,233, 66, +233,222, 21, 57, 27,255, 16,138, 29,188, 41,232,215,203,234,215, 85, 69, 9,177, 25, 57,190,225, 56,183,189,104,157,157, 95,217, +199, 7, 61, 87, 8,101,144,174, 32,127,150, 25,197, 4,119,122, 93,191, 68,131,130,185,185,224,219, 48,194, 3,244,146,183,120, + 77,164,138,164, 73,167, 76,168,181, 1,129, 44, 37,232, 36, 49, 68,153,175, 86, 75,138,138,217, 11, 96,226, 14, 90,192, 16, 82, +212, 23,164,188, 62,210,128,163, 97,169, 83, 80,253,215, 98, 44, 12, 64,100, 5,144, 54,196,220, 21,202,135, 40,211,185,134, 20, +109, 70,147,105,171,122, 20,108, 25,188,167, 53, 21,167,137,241,171, 93,228, 23,105,181, 59,214,182,246, 50, 76,203,173,135,214, +217,192,181, 0,172, 2,232,225,129,204, 62,134,235,137, 57, 36,255, 30,163, 54,141, 1,125,114,170,230, 42, 17,218, 15,129,217, + 78,120,211, 84,226, 99, 91, 52,156,194,241, 84,218,112,238, 90,242,161, 73,124, 67,122,231, 64,171,160,128, 55,171,185,248,125, + 57,101,157, 15, 71,209,222,173,182, 64,222, 44,119,254,223,185,155, 62,125,191,248, 98,181,229,159,104, 52,144,209, 38, 27,210, +115,220,188,200,246,204, 98, 37, 4, 79, 75, 82, 17, 12,164,114,233,109, 25,235, 36, 37,177,169,144, 98, 23, 34, 66,140,191, 5, + 69, 78,114,102, 37, 93,236,240,145,236, 8, 21, 66, 36,121, 44,124, 73, 91, 81, 12,218,194,216, 86,225, 13,108, 65,213, 80, 63, +170,226,113,108, 43, 14, 8,197,234,244, 56, 43,183,137,187,248, 80,151,146, 31,172, 18, 62, 11,149, 2,172, 25,218,146, 83, 75, + 11,109,132, 25,149, 62,152, 3, 5, 76,189,191, 2, 80,118, 53,175, 77, 4, 81,124,102,118,233,106,169, 18, 16,172,164,201,205, +147, 30,139, 70,183, 71,123, 19,130, 23,241,168,129, 42, 40,136,148, 26,104,176,182,164,148, 18, 72,161,215,222,226, 69,240,156, +252, 13, 45, 66,255, 1,191, 21,147, 74,233, 71,172,154, 52, 31,187, 59,227,155,121, 59,251,145,208,138,203, 18, 38, 75, 50,153, + 36,179,191,121,243,126,239,253,222,191,241,189, 84, 42,193, 35, 64,112,177, 88,180,109, 27,218,249,124,190, 90,173, 2,190, 71, +219,248, 20,142,173,205,205, 74,165,114,107,122, 58,155,205, 62,156,153, 65, 20,182,167,166,214,202,229,129,246,131, 92, 14,218, +216,249,106,177, 24, 24,236,247,115,185,155,250,250,122,185, 60,145, 78,131,189, 15,111,132, 43,128,227,128,239,248, 41,181, 90, +237,229,226, 34, 94, 47,204,207, 35,196,227,173,252, 98,105, 9,112, 95,189,254,112,117,121,185, 35, 23, 15,121,227,100,236, 12, +244, 6,103,163,222,248,252,254,227,147,231,179,157, 99, 73,130,174, 20, 22,238,220,187,123,205,190, 1,237,157,122, 99, 99,109, + 29,122,121, 60, 55,155, 76,167,224,202,246,214,219, 55,175, 94,171,123, 75,238,208, 38, 51,215,147,169, 9, 56,127,124,223,249, +242,225,211,163,185,167,216, 73,169,176, 0,139, 1, 82,107, 84, 37, 41,194,177,203, 5, 12,235,178, 97, 94, 33,214, 87,207, 1, + 51,252, 88,205,245, 49,109,167, 27, 10,235,137,134,254,104,206,103, 66, 77,250, 3,238, 30,116,218,169, 17,235,246,185,196, 94, +207,169,187, 48, 49,189, 54,231, 22, 99, 9, 33,206, 8, 58, 70, 13,151,209,111,162,191,221,220, 63,228,226, 34, 33,207,174, 94, +154, 76, 94,216,253,211,221,107,187,191, 61,242,238,168,215,234, 73,198,255, 87,215,147,132,142,162,103,152,116, 58, 73, 18, 66, + 18,200, 63,153,224,163,150,105, 0,192, 2, 84,115, 54,218,243,203, 12,153, 46,183, 92,158,232,123,172,235,181,148, 9,138, 2, + 93, 66, 58,254,100, 2,172,121,214, 26,103,162,219,234,239,195,114,129, 97,236, 92,243,155, 90,142,195,247,199,114, 74,233, 64, +157, 70,225,251,189,148,102, 63,231, 98,192,120,199,242,101, 49, 25,119, 29,245,161, 69, 18, 99, 98, 41,196, 11,162,207,185,136, +150, 24, 13,247, 1, 97, 80, 12, 13,134, 55, 28,132,199,134, 18, 89,163,184,175, 4,162, 13,122,154,174, 65, 36,166,203, 47,204, + 30, 66,188, 10,138,215,107,128, 70,121,157,160,142,177,112,158, 23, 33, 0,240,255, 10,244,106, 34, 96, 20,139, 43,141, 43,213, +156,232,230, 17,190, 3, 87, 96,154,172, 47, 72,207,195,156,163, 32,231, 43,226, 16, 32, 76,187,116, 40,193,162, 90, 52, 72,205, +101, 98, 32,149, 47, 42,239, 46, 68,200,172,198, 4, 33,196, 80, 14,212,255,197,210,199,247, 83, 12,203, 18,200, 25,105, 58,158, +115,186,143, 75,165,253,115,114,114,182, 26, 96,122,223,233, 91,230,136, 4,109,176,177,218,205,212,249,148,197, 72,179,115, 4, + 63, 24,124, 95, 71,238, 29,185,170, 48, 38,163,212, 93, 44, 59,142,245,240,164, 78, 24, 51,228,238,159, 26,186, 94,136,225, 15, +219, 80,197,200,136,210, 32, 67,240,165,104,230,251,108,138, 78, 76,165,154,186, 96,129, 84,153,162,112, 84, 92, 13, 23, 33,173, + 24,146,213, 6, 74,224,248, 65,240,114,122,192,192, 96,203,241, 87, 0,198,174,160,181,137, 32, 10,239,204, 38,105,220,244,208, +162,224,161, 85, 80, 73,215, 67,161, 45, 66,177,230, 71,120, 17,241, 36, 30, 60,136, 66, 17, 79,185,133,226,213,131,151,141, 1, + 17,241, 88,143, 77, 33,148,180, 30, 60,121,242,222,216, 94, 90,140,160, 96,208, 16,210,221,236,206,248,230,189,217,217,205, 26, +162, 57, 77,134,205,236,102,153,253,230,155,183,239,251,222,191,241,189, 90,173, 2, 61,175,213,106,128,224, 0,229, 0,232, 15, + 17,181,225,171,105, 67,163,221,110,191,223,222,166, 56,204, 78,179,121,176,191, 15, 36,157, 70, 0, 16, 7,240, 37,198,109,218, +208, 88, 93, 91,123,190,181, 5, 32, 14, 67,153,213,155,250, 27,158, 7,151, 14, 64,127,179, 82, 57, 61, 57, 1, 16,127,186,185, +185,228,186, 48, 56, 64, 57, 28, 15,107, 3,156, 2,250,235,158,103, 78, 68, 31, 56, 12,192,253,153, 58,254,250,163, 39,143,135, +241,206, 0,110, 92,107,103,183,236,186, 71,135, 29,106, 64,231, 27,175,113,124,216, 89,175,108, 44,175,174,188,173, 55,224, 6, +221,123,112,255,198,173,141,133, 75,139,112, 1,245, 23, 47, 23, 46, 47,222,190,123,231,227,193,135,111,167, 93,154,247,123,205, +214,213,165,242,113,231, 75,187,217,186,230,150,161,231,221,171,215, 48, 72, 98,155, 97, 37, 60,158, 18,210,143,162,240,187,229, +207, 88,246, 21,229, 4, 35,126, 40, 67, 70,217,179,100, 31, 17,188,132, 16, 31, 11,142,245, 62,159,242,226,125,116, 18,134,197, +160, 7,116, 65,170, 2,234, 43,142,147,199, 82,129, 48,251,206,162,104,175,255,171, 43,163, 52,249, 89,158,119,190, 14,228,167, +207,221,126, 40, 7, 33,236, 43,121, 94,109, 24,149, 91,169,133, 58, 13, 84, 6, 51,116,153,195, 66, 12, 74,156,174,104,201, 48, + 18,122, 22, 97,105, 60,229,172,148, 43,217,108, 46, 8, 3,102,249, 92,134, 20, 66,192,105,136, 74, 75, 33,124, 57,252, 45,252, +217,130,115, 46,127,177, 63,130,181,204,215,126, 94,104, 20,150,112, 59,204, 16, 97, 90,180,163, 25,140,246,111, 96, 4,238, 17, + 69,108, 68, 12, 53, 4,241, 34,214, 53,105,152,183, 18,121,217,223,150,191, 9, 21,101, 73, 90,164, 9,227,139,113,242,174,254, + 66,252, 98,119,226, 46,106,122,208, 22,126,110,167,171,253, 76,205, 51, 72, 67, 60,183, 98, 76,142,137,188, 70,121, 18, 84,240, +132, 43, 39, 69,239, 88,198,130, 30,139, 93,113, 67,240,249,248,155, 41,150,145,128,101,180, 77,177, 55,114,156, 74, 36, 49,221, +218,196,100,146,194,104,217,132,183,180, 72,156,150, 40,166,249,166,190,130,104, 44,147, 65,166,150, 83, 99, 43,100,226, 55,242, +127,164, 51, 57,110, 79,212,169, 22,212, 11,201, 81, 70,236,202,167,134,109,115, 22,101,168,235,211,141,162, 64,140,231,221,165, + 82,226,208,183,139,233,146, 44,190, 0,238, 18,156,119, 46,204, 21,138,103,118, 97, 16, 13, 1,220,129,203, 43,157, 49,170,170, + 3, 5,239, 56, 28, 19, 24, 21,129,103,135,178, 39, 41,109,134,124,125,165,177,107, 14,113, 31,143,102, 36, 57, 91, 23, 83, 37, + 47, 69, 45, 99, 70, 4, 87,206, 98, 4, 32, 24,104, 98, 76,231, 65, 78,150,241,227, 67,193,201,218,164,196,157,217,153,249, 98, +190, 40,162,209, 79,191,247, 71, 0,202,174,101,165, 97, 32,138,206, 76,147,106,170, 34, 90, 65, 65, 16,212,239,112,225, 3, 23, +162,110,251, 29, 46,252, 10,235, 79, 9,186,117,235, 11, 65,235, 99,211, 34, 69,105, 77,219,153,241, 62,102, 38,143, 90,196, 44, + 36, 84, 50, 77, 76,188, 57,247,222,115,207,249, 59,190,183,199, 74, 31,191,110,253, 62, 98,216,107, 10,181, 88, 63,105,183, 67, +201, 5, 80,255,229,213, 85,105,159,171, 55,207,173, 22,156, 58,135,126,190,237, 11,245, 58,252,220,222,219, 99,252, 30, 22,129, + 29,142,212,112, 62,112, 44,236,192,177,231,103,103,135,199,199,141, 70,163,217,108, 50,126,135,219,252,210,194,237,228,244,180, +150,212,238,104,229, 60, 65, 94, 20,213,108,238,111,177,168,178, 80,199,110,232,214,238, 14,225,247, 22,124, 17,124,146,212,146, +253,163, 3, 56, 14,144,190,227, 41,179, 84, 72, 78,229,152,151,186,187,189,201,245,255, 29, 89,205, 57,178,101, 73,147,237, 10, +221,177,189, 85, 21,173, 71, 9,164,112, 79,102,144, 8,195,188, 70, 54,213, 11,211,173,193,210, 90,248,146,125,140,252, 41,196, +177,157,209, 96,186,162,146,138, 26, 90,172,122,127,148, 31,125,241,145,170,139,247, 47,148, 42,139, 80,228, 0,115, 70, 28,122, +102,229, 85,247,143,224,169, 74,146, 71, 32,115,108, 83, 25,122,125, 70,205, 85,197,108, 58,234, 65,174,138, 22,134, 26,249, 97, + 49,218,198, 65,114, 10, 9,172, 32, 59, 74,153,218,225,247,168, 63, 83,157,153,143,150, 59,195, 87, 13,191,100,188, 38, 29,119, +197, 25,221,102, 77, 64, 93,168, 36, 88,118,206,243,193,157, 32, 58,155,166,142,216, 28,195,205,109,200, 49, 93,242,162,152,187, + 52,161,149,202,228,199, 64,139,148, 34,111, 88, 97, 60, 71, 77,138,178, 94,155,157,132,193,255,152, 90, 45, 78, 63,254, 78, 24, +163, 16, 31, 72,147,202,201,137, 33, 22,206, 80, 62,243, 43,195,248,169,239,193,149,128, 57,221, 50,225,165,170,113,252, 87, 78, +102,189, 75,146, 67,112, 92,140,192,146,116, 47, 17, 43, 76, 94, 42,192, 4, 77,246,128,196,243,127, 18,233, 49,187, 10, 54,243, +158, 12, 58,206, 94, 43,229, 85, 94, 6,199,138,137,239,203,127,108,196, 37, 23, 81,113, 57,132,240,214,142,131,119, 69, 47,137, + 16,220,217, 77,147, 18,101,185,182,180,249,216,126, 40,186,185,226,117, 85,176,198, 18,163, 27,170,140,186,131,206,210,212,202, +235,231,219,236,226, 6,172, 21, 43, 53, 48,118,138,132,158,177,116,163, 53,147,193,224, 50, 83,170,144,147, 14,146, 38,199, 37, +150,216,176, 60, 9, 97,178,142, 8, 63,123, 28,178,201,212,134,250,181,218, 55, 35,108,102, 44, 76,100, 75,122, 98,153,113, 59, +164, 16,175,188, 37, 64,120,239,106,223,155,169,202, 74, 45,158,131,204,190,151,118,251,250, 27,206,230, 71, 0,206,174,166, 55, +109, 32, 10,238,174,101, 62,172, 72,165,129, 83,148,220, 90, 53,183,146,107,126, 4,255,142, 63, 66,114, 35, 17, 82, 43,155, 42, +138,212,170,183,222,218,224, 99, 64, 13,145, 28,108,175,119,179,239, 61,239,174,221, 38, 84, 42, 7,100, 16,178, 87,102,153, 29, +102,223,155,249,159,250, 72, 67,210, 29,236,186, 99, 67,153, 13,173, 30,143,199,132,203,240,242,244,244,106, 62, 63,193,199,116, + 58,165,207,184, 99,131,194,147,201,132,232,252,112, 52, 90,198, 49,157,144, 36,251,101,146,208,251, 73, 28,147,242,243, 34,207, +234, 71,209,229,108, 6, 58,207,249,185, 97,241,230,138,139,249,220,141, 45, 93,221, 93,206, 46,204,193,199,179, 51,243,252,253, +235, 55,245,215,143, 0, 49, 66,164,171,212, 28,223, 36, 95, 54,247,235,195,209,240, 54, 89, 30,157, 28,155,147,127,190, 94,192, +210,149,237,210,187,212, 48,250,119, 31,222,127,186, 90,176,154, 39, 98,148, 43,205,155,118,147, 99,211,190, 42,176,147, 47, 99, +225, 91,206, 14,160,218, 4, 52,229,227,195,254, 32,239,109,178,221,189, 89,102, 25,104, 31,188, 65,130, 2, 27,115,218,195,254, + 41,243, 37, 61,160, 49,113, 15,237,116,163, 64,116, 59,193, 32, 10,135,253,110,252,227,247,207,198, 13, 57, 18, 92, 98,250,162, +153,164,165, 33, 14,138,115, 63, 91, 92,241, 24,101,161, 16,214,123,191, 21,220, 11,210,200,208, 21, 23, 7,161,138,182,197,246, +169,120,146, 76, 65, 37, 41,242,252, 2,119,111,114, 37, 67,168, 33, 51,248, 30, 8,240,177, 97,165, 42,100,248,166, 27, 12, 30, +205, 31, 21,238, 54, 9,181,135,113, 60,189,240,146, 43,118,144, 34,190, 84,140, 50,151, 80,123,103,118,247,149,251, 48, 33,221, +118,246,127, 5,217, 29, 96,121, 54,218,240,169,117,234, 64,171, 27, 70,237,107, 6,218,195, 7,181,240,235,111, 19,220,249,190, +154, 96,168, 87,175,211,157, 84,203, 48,169,246, 34,163,117, 81,184, 81, 86,184,246,186,161, 55, 34,133,188,191, 38, 20, 77, 51, + 43,167, 8,246, 66,247,144,182, 81, 78,190,188,191, 94,117,155,217,214,218,229, 23,182,154, 3,254,168,140,161,244, 99,229, 97, +220,105, 77,173, 42, 74, 23, 76,162, 93, 80,138,246, 29, 12,176,231, 81,187,222,253, 67,156,217, 99, 50,195,173, 67,139,126, 93, + 85,179,111,182,125, 67, 32,155,179,147,203,220, 92,122,181,249,213,108,156,178,229, 46,188,212,224, 11, 0,109,127, 48,192, 74, +178,242,113,183, 93,103,195,168,211,221,177, 12,123,153,132, 34,115, 35,164, 70, 24,232, 12, 62, 64, 56,111,165,170,111,112, 37, +107,116,102, 22,214, 5,129,187, 0,179, 1,141,250, 12,236,202, 6,214,160, 69,183,163,245, 42, 31,232, 75,177, 66,138,108,200, + 48,218, 83, 16, 44, 32,247,167,180, 85,133,222, 5,242,161,216,174,243, 82,130, 89, 2,168,136,207, 2,112,118, 53, 61, 77, 4, + 97,120,102,182,180,221, 2, 69,130, 92, 73,140,186,248, 19,212,223,224, 30, 60,136, 9, 23,227,201,196,254, 11, 14,254,141,158, + 77,188, 16, 61,152,144,152,112,104, 13, 9, 73, 35,158,154,248, 7, 64, 72,196, 0, 90, 58,239,142,207,204,188,179, 31,101,193, +232,158, 54,237,110,183,221,206, 62,243,204,251,241, 60,255,134,239, 99,183,245,122, 61,240,116,192,116,190,239,195, 53,192,122, +128,114,191,223, 7,194, 2,184,211, 52, 5,190, 3,121,113,152, 39,215,229,125,156,133,119, 65,189, 59,157, 14,246,129,227,120, + 61,113, 33,160, 36, 73, 54,194,235,131,193,224,186, 39,207, 23,240, 96, 14,192,148, 48, 28, 14,113,245, 39,105,250,105,103, 39, + 47,254,193,134, 15,124,179,181,245,240,241, 35,220, 37,224,123,157,164,153,125, 84, 14, 70,163,123, 73,242,244,249, 51,112,246, +175,163, 47,123,131,207, 31,223,127,216, 92,121,241,242,245, 43, 28,177,253,246,221,183,241,248,238,122, 2, 58,191, 11,124, 15, + 14, 17,161, 32,162,144,183,157,125,182, 3, 67,243, 25,193, 19, 43, 73,102, 39, 3, 18,122,239,248,188,169, 68, 87,202,181, 86, +187, 75,250, 80, 79, 79, 45,133,231,124,100,211,153,108, 76,108,120, 39,138, 45,149,182,163, 2,220,225, 86,203,118,151, 46,196, +209,131,213, 56,238,180,247,191, 95, 96,176,174,101,116,236, 58,220,186, 34,106, 71,173, 95,153,173, 49,183,137, 24,101,235,219, +141, 39,240, 66,134,112,170, 23, 37,204,219,190,252, 74, 67,185,103,148,156,228, 47, 78, 80, 45, 48,119,250, 13, 98,174,173, 70, +146, 77,199,187, 85, 39, 49,237,149,206,201, 67, 75, 82,218, 35, 16,101,209,153, 57, 93,157,191, 45,229,156,182,214, 79, 38,116, + 35,179, 85,153,114,142, 52, 52,187,168,228,138,146,160, 32,224, 93,201, 56,228,158,247,163,150, 28, 83, 3,217,172, 69,246,162, + 85, 53, 4,127, 77, 73,176,240,191,138,123,107, 43, 20,163, 26,112, 55, 55,138, 6,135, 80,128,241,189,166, 82, 22,210,146,121, + 64,198,176,143, 15, 23, 31,250,121,183,112, 21, 7,181,151,162,170, 58,160, 42,173, 88,121, 58,161,110,132,139,170, 9,234,172, +183,181, 40,100,123,175,107, 14, 8,118,199, 28,183, 8,235,212,210, 55, 15, 19, 83, 17,187, 55, 87,116,128,189, 99, 86,195,102, + 32, 5,213,119,221,150,189, 79,255,242,191, 81, 85,249,222,212, 79, 18,211,242, 93, 32,147, 45,183, 23, 39,103, 19, 55,104,167, + 87,252,223,139, 24,171,175,102, 81,170,241,227,242,100,190,185,116,116,126,120, 63,190,163, 65,101,136, 43,179, 66, 37, 19, 73, + 78,162,186,232,151, 77,108,146,119,230, 82,161, 33,214, 93,197,100, 44, 36, 96, 87,111, 13, 78,209,115,216, 93,135, 50, 74, 98, + 55, 15, 94,255,231, 5, 87,153,235,132,170,118,138,241,207, 55, 37,245, 77, 18,151, 23,217, 79, 2,221, 98, 22, 98,254, 8,192, +219,181,228, 52, 12, 3, 81,143,227, 36,106,161,168, 72, 21, 72, 8,150,172,184, 10,234, 57, 16,108,233, 1,202,130,227,176, 40, +151,225, 0, 72, 44,144, 88,132,150,182, 56,113,240,140, 63,113,226, 32,126, 18, 89,180, 93, 84,141,146,120,166,111,158,231,189, +129, 1,186, 78,193,170,103,208,197, 15,182,179,175,103, 51,157,184,239, 23, 11,246,239, 7, 68,125,199,250, 56,159, 78, 13, 36, +191,184,186,188,157,223,152,207,208,144,113, 73,221,227, 88,217, 68,169, 39, 47,120, 0,124, 60,200,141, 5,143, 96,247,172,122, +160,132, 71,206,193, 43, 88,177, 20, 61,108,253,118,152,136, 83, 1,133,148, 79,165, 90,210,211,202,137,148, 47,200, 31,110,140, +162, 52,174, 23,218, 36, 75, 38,195,236, 96,148,158, 29,237, 60,110,212,221,195,203,243,219, 59,118, 98,105, 12, 77, 27,191,202, +180, 95,160,104, 9,197,213,166, 43, 29, 76,198,227,192,218,189,222,118, 28, 10, 55, 25,197,130, 11, 20,222, 40,158,243, 17, 84, +249, 74,190,110,117,189, 91,149,100,136, 81,150,110, 36,155,129,249,134,126, 77,236,181,160,138, 66, 36,233,120,176, 95,178,213, + 82, 22,212,104,161,130,155,103,215,107, 7, 5, 83,136, 58,216, 78,132,189,243,248, 53,205,131,209,144, 7, 5,174, 56, 8, 36, + 78, 1,102,143,201,223, 80,211,212,113, 27,255,146, 25,136,211, 37,119,196, 78,251, 59,240,155, 21,235,152, 48,222, 37,134, 2, +209, 92, 99, 10, 9,125,182, 28, 0,225,180,208,154,125,230,118, 92, 7,132, 75,156,217, 61, 39, 83,181, 40,153,200,175,211,222, + 88, 27, 32,230,220,238,252,188,238, 84,102,129,222,184,207,228,221,144, 70,208, 0,124,198,190,169, 59,253,187, 12,211,255,120, +206, 53, 24,218,134,129,193,109,163, 11, 96,121,202, 68, 38,210, 20,178, 12,167, 42,137, 97,178,119,188,123,178,149,107, 86,109, +214,114, 67,136, 71, 98, 15, 98,109,112, 15, 35,127, 42, 36, 24,165, 14, 22,244, 4,182,217, 89, 56, 70,200,103, 24, 69,178, 38, +183, 1,160,106,139,211,149,203,218,173,254,112,143,195, 42, 55,198,139, 27,250,180,201, 57, 88, 10,164,196, 87, 17, 11,132,110, + 89, 26,147,209, 95, 8,255, 16,128,185,171,231,105, 24, 6,162, 57, 59, 73,145, 24, 64, 98,165, 98, 0,254,255,194, 6,226, 15, +240, 39, 24, 96, 65, 76,173, 72,210,218,190, 35,254, 56,251,156, 82, 33, 1, 3, 85,183, 84,170,100, 57,207,231,119,239,189,107, +255, 16, 94,255,201,103,174,235, 47,215,235, 25,226,199, 97,120,188,127,120,241,132, 79,149, 1, 27,110, 46,139, 43,173,176,142, +231,200, 4,242, 20,176,226, 55,144,129, 0, 15,146, 65,232, 72,131,174, 68,155,229,222, 41, 68,157,132, 7,221, 54, 50,125,243, +211, 55,135,239,182,185, 93,245, 55, 45,110,246,110, 66, 23,126,172, 78, 3,201,120,214,170,174,243, 33, 56,215,231,221,213,197, + 9,172,250,187,231,143,167,215,141, 15, 45,213,254,162,103, 49,202, 96, 19, 10,104, 42, 26, 6, 37,143,181, 34,134,136, 35, 62, +130, 89,206,229, 26, 16, 33,101, 58,162,113, 48,217,237, 14, 71,235,220,190,217, 33,143,199, 66,102,232,227, 87,135, 49, 96,236, +191,135,121,119, 79,251,161,239, 90, 10, 9,184, 32, 11, 65,200,209,205, 21,190, 99, 74,232, 45,156, 12, 17, 11,186, 83,163, 15, +147, 66, 27, 42,238, 56, 27,232,235,169,205, 57,221, 0, 22,121, 5,120,132,126, 57, 38,130,166,175,144, 93,213, 79,190, 45,219, +235,250, 87, 86,136, 74, 98,175, 19, 80, 13, 7,222,160, 74,217, 1,101,208,143, 42,190, 45, 46,237,161,136, 39,151,196,182, 88, + 40, 57,219, 58,175,176, 44,180,249,143,211,138, 83,233,204,168,140, 53,212,112, 70,127,234, 27,227,194,106,142,194, 71, 70,181, + 7,135, 83,239,127, 50,251,240,119, 64,181, 60, 0, 71,161,155,204, 76, 34,248, 88,247, 96,252,236, 86,214, 24,165,253,180, 73, +133,122,132,173, 37,211,233,126,112, 59,127,159,118,113,154,120, 58,180, 12, 89,229,149, 53, 24, 11,184,249,120,176, 77,212, 23, + 52,134, 19, 57, 36,129,102, 89,152, 27, 60,174,209,129, 17,105, 25,185, 97, 48, 4,199,167, 62, 22,178, 89, 50,236, 25, 23, 14, +137, 40,174, 79, 83, 16,216,196, 99, 66,202, 2,217,102,190,157,232, 79, 1,136,187,130,156,134, 97, 32,104,175,237,164,109,104, +185, 33,110, 72, 72,252,255, 13,124,133, 3, 7,224, 80,138, 68, 73,226,216,196,107,175,227, 77, 20,169, 8, 36, 30,208,168,138, +227,245,204,122,102,246,183,248,253,223,235,187,228,174, 7,207, 45, 21,101, 99,116,109,176, 20,100,176, 62, 97, 16,159, 39,122, +231,155,165,159,245,104, 11, 56,195, 81,188,140,180, 64,146,116, 89,209,154,141, 91,100,167,225,161,214,247, 6, 94,206,246,109, + 24, 26, 5,215, 90,238,183,112, 85,155,155, 67, 37, 43,243,220,186,199,167,211,120, 6,104, 5,136, 29,130,214, 42,119,168,163, +118,132,252,239, 82,161,175, 20,100, 78,247,145,204,254,149, 10, 6, 82,200,160,173, 65,159, 46,214, 49, 99, 15,199,254,216,249, + 22, 89,103,111, 83,167, 37, 17, 18,196,236, 74, 36,163,157,138,124, 8,203,189,110,204,182,169,119,239,221,107, 12,254, 45,198, + 25,205, 81, 40, 5,203,120,202,128,140,255,223,185, 50,111,192,145,100,134,182,230,100,188,247, 76,103,237,242, 32, 14,170,236, + 37,144,140,186, 73, 78, 5,104,120,209, 5,171, 8,252,219,184,184,178,139,181,252,244,229,207,103,140, 64,242,196,121,224,172, +145, 58,242, 32,138,146, 79, 39,144, 88,198, 61,122, 54,159,122, 98, 54,236, 42,181,232,201, 20,175,200, 9,158, 11, 18,141,151, +217, 71, 83,238,145,188,182,165, 84, 38,195,166, 97, 49, 85,149, 81,171,245, 67,247,175,202,203,190, 62,124,180,167,164, 65,128, +186,195,202, 62, 83, 73,201,212,124, 11, 95, 52,118, 84,148, 22, 90, 43, 93,129,169,196,198,132,152,166,205,109,125,215,218,179, + 31, 90, 59,244, 95, 99,161, 15,152,125,228,184,254,115, 68,237,120, 45,135,123,193, 59, 84,184,218, 36,114,119,144, 52,236, 81, + 73, 54,248, 41,171, 32,244,232,237,100, 37,163, 59, 97,161, 29,221, 75,231,177,233, 52,185, 41,177, 91,122,102,152, 2,224, 2, + 96, 5,106, 69, 58, 36, 13,218,138,110,124,206,183, 0,172,157, 95,107,131, 48, 20,197,115, 18,197, 89,101,143, 99, 79,133,189, +172,223,255,115,244,139,236, 31, 12,218,181, 80,109,110,102,114, 19,141, 81,219,210,173, 15, 82, 40,212, 32,250, 51,247, 36,247, +156, 63,241,253,238,171,111,110,251,219, 27,109,167, 49,209,103,102,249,126,217, 48,186, 95,146,158, 26, 27, 36,148, 23,151,226, +114,252,239,209,251, 0, 17, 83,165, 98, 95,240,160,108, 32, 66,191, 4,111, 9,148, 43,133,205, 74,189,214,197, 75,157,101,185, +250,106,205, 71,171,223, 78,180,125,255,145,142,215,118,181,147, 27,107,221,209,151,117,214,223, 4,185, 20, 79,143,178, 42,113, +106,205,238,104,190, 15,210,122,201, 43,223, 16, 36, 8, 52, 92, 13,112,202,132,123, 80,149,151,240,172,106,159,139, 38,223,211, +193,229, 9,112,240, 35,247,115,114,244, 1, 92,209,167,250,128,202,248, 75,149,213, 29,226,119,244, 25, 10,118, 55, 52, 57, 42, +244,145, 68, 99,135,110,204, 4,238,218, 4,103,112, 30, 59, 13,224,161,177,103,239, 56, 98,105, 80, 18, 40, 57, 75, 34,245,204, + 53, 61,206,221, 15, 18,247,144, 61,157,126, 95,187,213, 23,112,143,212,137,102,194,250, 62, 6,122, 66,249,208,133, 20,149,112, + 38,141,223,139, 36, 20,145,194,253,140,133, 7,206, 76, 40, 47,230,115,207, 71, 82,216, 44,220,197,181,212,108, 44, 68, 87,253, +215, 39,115,172, 31,243, 29,206, 34,198, 34, 94,161,131,251,131,178,211,153,162,176, 41,103,226,185, 90,151, 40,143,205,158,116, +211,241, 93, 91,113,198,122, 64,106,173,185, 17,248,236,230, 18, 33,144,145,250,246,102, 71,121,161, 7, 53,134,139, 75,195,145, +170,240, 5, 77, 60, 41, 65,180, 56,195, 59,100,248, 29,224,119,203,134, 28,205,126,250,134,224, 90, 65, 97,252,182,199,245, 87, + 0,214,174, 45, 55,129, 24, 6,102, 66, 34,180, 85,145,170,170,247,191, 88, 47,192, 13,160,221, 36,110, 76,226,144, 23, 81,171, + 34, 62,128, 15,172,197,152,137,215,246,140, 25,223,249, 86,101,169, 55,253, 68,124,255,255,146, 92,252, 5,223,135,154,230,111, +236,163,131,248,246, 9,152, 29, 66,163, 22,161,110, 63, 39,132,180,100, 61,231,239, 61,196,235,164, 34,137, 24, 82, 22,234,200, +148,104,149,196, 18,138,182, 80,234,206, 39,112, 15, 84,150,175,199, 88,164,163,225, 57,176,248,151,126, 49,120,219, 14, 31,175, + 54, 90,250, 60,211,238,138, 94, 32, 58, 63,201, 55,205, 51, 91,183,200, 49,222,225, 26, 46,187, 8, 13,248, 42,121,207, 27,135, + 27, 88,135,128,190,217,226,227,128,157, 46,194,112, 10,164,122, 47,220,231, 5, 51,175,124, 2,238, 65, 52,107,137,154, 69,110, +170, 79, 76,235,124,241, 33,176,182,154, 51,181, 34,233,170,246,174,231, 82, 48, 88, 84,231,187,119, 52, 52, 27,134,137,111, 60, + 14,102,172,177,190, 9,206,219,121,141,137, 25,106, 47,160,120, 93, 45,193,189, 3,229,249, 21,162,106, 69,160, 61,187,107,238, +146, 90,130,187, 26,176,155,158,148, 68,114, 28,107,235, 89, 2,108,117, 58,104,230, 17,132, 74,215, 36,113, 80, 41,189, 96,242, +145,142, 17,205,251,181,249,246, 89,219,205,158, 78,230,253,219, 93,157,251,242,126, 15,105,224,157, 7,213, 88, 15,128, 85, 4, +114,247,136,106,183,203,158,149,188, 78, 47,220,221, 75,133, 5, 38,191, 36,164,179,170, 43,197,205, 92,144,169, 37, 58,208, 83, + 30, 32,181,154,108, 54,101,244, 63, 2, 12, 0,210, 11, 96,129, 76, 18,236, 22, 0, 0, 0, 0, 73, 69, 78, 68,174, 66, 96,130, }; From 87929332c7e0e371933a54ca8b86ad2099c34ac7 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Mon, 31 Aug 2009 18:18:10 +0000 Subject: [PATCH 375/577] Changed sync difference time of sound strips to 0.5 seconds instead of 1 frame. Maybe this should be a user preference setting? --- source/blender/blenkernel/intern/sound.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 8159f2f8c4c..06ef8a23142 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -376,7 +376,7 @@ void sound_update_playing(struct bContext *C) float diff = AUD_getPosition(handle->handle) * fps - cfra + handle->startframe; if(diff < 0.0) diff = -diff; - if(diff > 1.0f) + if(diff > FPS/2.0) { action = 2; } From 121f310fab0a3e1171293583df2e7a984112363b Mon Sep 17 00:00:00 2001 From: Diego Borghetti Date: Mon, 31 Aug 2009 22:50:08 +0000 Subject: [PATCH 376/577] Add missing define to rna for sound system. --- source/blender/makesrna/intern/Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/blender/makesrna/intern/Makefile b/source/blender/makesrna/intern/Makefile index c7cc6e7a4bf..4a4e41edd15 100644 --- a/source/blender/makesrna/intern/Makefile +++ b/source/blender/makesrna/intern/Makefile @@ -77,6 +77,18 @@ ifeq ($(WITH_QUICKTIME), true) CPPFLAGS += -DWITH_QUICKTIME endif +ifeq ($(WITH_SDL),true) + CPPFLAGS += -DWITH_SDL +endif + +ifeq ($(WITH_JACK),true) + CPPFLAGS += -DWITH_JACK +endif + +ifeq ($(WITH_OPENAL),true) + CPPFLAGS += -DWITH_OPENAL +endif + ifeq ($(OS),windows) # Windows needs these extra libs because of winstuff... It is not # _really_ needed, but it is the easiest fix for now. If you have From 04bbb6a0c7a7c8a6c55f1528e76132e7f5a38e6f Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Tue, 1 Sep 2009 00:33:39 +0000 Subject: [PATCH 377/577] 2.5: Layout Python Files: * Code cleanup. * Made some files match the code guidelines, should be all now. Please everybody use them: http://wiki.blender.org/index.php/Dev:Py/Blender2.5/Layouts/Guidelines * Made polls and header_draw functions as small as possible. * Small fixes here and there. --- release/ui/buttons_data_armature.py | 2 +- release/ui/buttons_data_bone.py | 7 +- release/ui/buttons_data_camera.py | 4 +- release/ui/buttons_data_curve.py | 69 +++--- release/ui/buttons_data_lamp.py | 17 +- release/ui/buttons_data_lattice.py | 2 +- release/ui/buttons_data_mesh.py | 2 +- release/ui/buttons_data_modifier.py | 1 + release/ui/buttons_data_text.py | 40 ++-- release/ui/buttons_game.py | 30 +-- release/ui/buttons_material.py | 318 +++++++++++-------------- release/ui/buttons_physics_cloth.py | 10 +- release/ui/buttons_physics_field.py | 2 +- release/ui/buttons_physics_smoke.py | 144 +++++------ release/ui/buttons_physics_softbody.py | 18 +- release/ui/buttons_scene.py | 8 +- release/ui/buttons_world.py | 43 ++-- release/ui/space_image.py | 56 +++-- release/ui/space_info.py | 2 + release/ui/space_node.py | 3 +- release/ui/space_text.py | 14 +- release/ui/space_view3d_toolbar.py | 11 +- 22 files changed, 362 insertions(+), 441 deletions(-) diff --git a/release/ui/buttons_data_armature.py b/release/ui/buttons_data_armature.py index f207b556a6d..ed350caa3bd 100644 --- a/release/ui/buttons_data_armature.py +++ b/release/ui/buttons_data_armature.py @@ -83,7 +83,7 @@ class DATA_PT_bone_groups(DataButtonsPanel): layout = self.layout ob = context.object - pose= ob.pose + pose = ob.pose row = layout.row() row.template_list(pose, "bone_groups", pose, "active_bone_group_index") diff --git a/release/ui/buttons_data_bone.py b/release/ui/buttons_data_bone.py index cfdaabadf79..8098648886b 100644 --- a/release/ui/buttons_data_bone.py +++ b/release/ui/buttons_data_bone.py @@ -77,6 +77,7 @@ class BONE_PT_bone(BoneButtonsPanel): ob = context.object bone = context.bone arm = context.armature + if not bone: bone = context.edit_bone else: @@ -192,18 +193,18 @@ class BONE_PT_deform(BoneButtonsPanel): __default_closed__ = True def draw_header(self, context): - layout = self.layout - bone = context.bone + if not bone: bone = context.edit_bone - layout.itemR(bone, "deform", text="") + self.layout.itemR(bone, "deform", text="") def draw(self, context): layout = self.layout bone = context.bone + if not bone: bone = context.edit_bone diff --git a/release/ui/buttons_data_camera.py b/release/ui/buttons_data_camera.py index 0480897d641..aa107d8dbdd 100644 --- a/release/ui/buttons_data_camera.py +++ b/release/ui/buttons_data_camera.py @@ -7,7 +7,7 @@ class DataButtonsPanel(bpy.types.Panel): __context__ = "data" def poll(self, context): - return (context.camera != None) + return (context.camera) class DATA_PT_context_camera(DataButtonsPanel): __show_header__ = False @@ -49,7 +49,7 @@ class DATA_PT_camera(DataButtonsPanel): elif cam.type == 'ORTHO': row.itemR(cam, "ortho_scale") - layout.itemR(cam, "panorama"); + layout.itemR(cam, "panorama") split = layout.split() diff --git a/release/ui/buttons_data_curve.py b/release/ui/buttons_data_curve.py index 92e414ba2f3..ced3c6597e0 100644 --- a/release/ui/buttons_data_curve.py +++ b/release/ui/buttons_data_curve.py @@ -38,33 +38,34 @@ class DATA_PT_shape_curve(DataButtonsPanel): curve = context.curve space = context.space_data - if curve: - layout.itemR(curve, "curve_2d") + layout.itemR(curve, "curve_2d") - split = layout.split() + split = layout.split() - col = split.column() - colsub = col.column() - colsub.active = curve.curve_2d - colsub.itemL(text="Caps:") - colsub.itemR(curve, "front") - colsub.itemR(curve, "back") + col = split.column() + sub = col.column() + sub.active = curve.curve_2d + sub.itemL(text="Caps:") + sub.itemR(curve, "front") + sub.itemR(curve, "back") - col.itemL(text="Textures:") -# col.itemR(curve, "uv_orco") - col.itemR(curve, "auto_texspace") + col.itemL(text="Textures:") +# col.itemR(curve, "uv_orco") + col.itemR(curve, "auto_texspace") - sub = split.column() - sub.itemL(text="Resolution:") - sub.itemR(curve, "resolution_u", text="Preview U") - sub.itemR(curve, "resolution_v", text="Preview V") - sub.itemR(curve, "render_resolution_u", text="Render U") - sub.itemR(curve, "render_resolution_v", text="Render V") + col = split.column() + col.itemL(text="Resolution:") + sub = col.column(align=True) + sub.itemR(curve, "resolution_u", text="Preview U") + sub.itemR(curve, "render_resolution_u", text="Render U") + sub = col.column(align=True) + sub.itemR(curve, "resolution_v", text="Preview V") + sub.itemR(curve, "render_resolution_v", text="Render V") -# sub.itemL(text="Display:") -# sub.itemL(text="HANDLES") -# sub.itemL(text="NORMALS") -# sub.itemR(curve, "vertex_normal_flip") +# col.itemL(text="Display:") +# col.itemL(text="HANDLES") +# col.itemL(text="NORMALS") +# col.itemR(curve, "vertex_normal_flip") class DATA_PT_geometry_curve(DataButtonsPanel): __label__ = "Geometry " @@ -76,27 +77,25 @@ class DATA_PT_geometry_curve(DataButtonsPanel): split = layout.split() - sub = split.column() - sub.itemL(text="Modification:") - sub.itemR(curve, "width") - sub.itemR(curve, "extrude") - sub.itemR(curve, "taper_object", icon='ICON_OUTLINER_OB_CURVE') + col = split.column() + col.itemL(text="Modification:") + col.itemR(curve, "width") + col.itemR(curve, "extrude") + col.itemR(curve, "taper_object", icon='ICON_OUTLINER_OB_CURVE') - sub = split.column() - sub.itemL(text="Bevel:") - sub.itemR(curve, "bevel_depth", text="Depth") - sub.itemR(curve, "bevel_resolution", text="Resolution") - sub.itemR(curve, "bevel_object", icon='ICON_OUTLINER_OB_CURVE') + col = split.column() + col.itemL(text="Bevel:") + col.itemR(curve, "bevel_depth", text="Depth") + col.itemR(curve, "bevel_resolution", text="Resolution") + col.itemR(curve, "bevel_object", icon='ICON_OUTLINER_OB_CURVE') class DATA_PT_pathanim(DataButtonsPanel): __label__ = "Path Animation" def draw_header(self, context): - layout = self.layout - curve = context.curve - layout.itemR(curve, "path", text="") + self.layout.itemR(curve, "path", text="") def draw(self, context): layout = self.layout diff --git a/release/ui/buttons_data_lamp.py b/release/ui/buttons_data_lamp.py index c1873d934c4..808a205b1b8 100644 --- a/release/ui/buttons_data_lamp.py +++ b/release/ui/buttons_data_lamp.py @@ -13,9 +13,7 @@ class DATA_PT_preview(DataButtonsPanel): __label__ = "Preview" def draw(self, context): - layout = self.layout - - layout.template_preview(context.lamp) + self.layout.template_preview(context.lamp) class DATA_PT_context_lamp(DataButtonsPanel): __show_header__ = False @@ -69,8 +67,7 @@ class DATA_PT_lamp(DataButtonsPanel): if lamp.type == 'AREA': col.itemR(lamp, "distance") col.itemR(lamp, "gamma") - - + col = split.column() col.itemR(lamp, "negative") col.itemR(lamp, "layer", text="This Layer Only") @@ -299,18 +296,12 @@ class DATA_PT_falloff_curve(DataButtonsPanel): def poll(self, context): lamp = context.lamp - if lamp and lamp.type in ('POINT', 'SPOT'): - if lamp.falloff_type == 'CUSTOM_CURVE': - return True - - return False + return (lamp and lamp.type in ('POINT', 'SPOT') and lamp.falloff_type == 'CUSTOM_CURVE') def draw(self, context): - layout = self.layout - lamp = context.lamp - layout.template_curve_mapping(lamp.falloff_curve) + self.layout.template_curve_mapping(lamp.falloff_curve) bpy.types.register(DATA_PT_context_lamp) bpy.types.register(DATA_PT_preview) diff --git a/release/ui/buttons_data_lattice.py b/release/ui/buttons_data_lattice.py index 5535f973b27..895c1a65bea 100644 --- a/release/ui/buttons_data_lattice.py +++ b/release/ui/buttons_data_lattice.py @@ -7,7 +7,7 @@ class DataButtonsPanel(bpy.types.Panel): __context__ = "data" def poll(self, context): - return (context.lattice != None) + return (context.lattice) class DATA_PT_context_lattice(DataButtonsPanel): __show_header__ = False diff --git a/release/ui/buttons_data_mesh.py b/release/ui/buttons_data_mesh.py index 42b637e1f9d..33b3960b381 100644 --- a/release/ui/buttons_data_mesh.py +++ b/release/ui/buttons_data_mesh.py @@ -7,7 +7,7 @@ class DataButtonsPanel(bpy.types.Panel): __context__ = "data" def poll(self, context): - return (context.mesh != None) + return (context.mesh) class DATA_PT_context_mesh(DataButtonsPanel): __show_header__ = False diff --git a/release/ui/buttons_data_modifier.py b/release/ui/buttons_data_modifier.py index bc41b04d32c..66c8179f990 100644 --- a/release/ui/buttons_data_modifier.py +++ b/release/ui/buttons_data_modifier.py @@ -27,6 +27,7 @@ class DATA_PT_modifiers(DataButtonsPanel): # the mt.type enum is (ab)used for a lookup on function names # ...to avoid lengthy if statements # so each type must have a function here. + def ARMATURE(self, layout, ob, md): layout.itemR(md, "object") diff --git a/release/ui/buttons_data_text.py b/release/ui/buttons_data_text.py index 1abc82cfaa3..aabf218122f 100644 --- a/release/ui/buttons_data_text.py +++ b/release/ui/buttons_data_text.py @@ -38,29 +38,29 @@ class DATA_PT_shape_text(DataButtonsPanel): curve = context.curve space = context.space_data - if curve: - layout.itemR(curve, "curve_2d") + + layout.itemR(curve, "curve_2d") - split = layout.split() + split = layout.split() - col = split.column() - col.itemL(text="Caps:") - col.itemR(curve, "front") - col.itemR(curve, "back") - col.itemL(text="Textures:") - col.itemR(curve, "uv_orco") - col.itemR(curve, "auto_texspace") + col = split.column() + col.itemL(text="Caps:") + col.itemR(curve, "front") + col.itemR(curve, "back") + col.itemL(text="Textures:") + col.itemR(curve, "uv_orco") + col.itemR(curve, "auto_texspace") - col = split.column() - col.itemL(text="Resolution:") - sub = col.column(align=True) - sub.itemR(curve, "resolution_u", text="Preview U") - sub.itemR(curve, "render_resolution_u", text="Render U") - sub = col.column(align=True) - sub.itemR(curve, "resolution_v", text="Preview V") - sub.itemR(curve, "render_resolution_v", text="Render V") - col.itemL(text="Display:") - col.itemR(curve, "fast") + col = split.column() + col.itemL(text="Resolution:") + sub = col.column(align=True) + sub.itemR(curve, "resolution_u", text="Preview U") + sub.itemR(curve, "render_resolution_u", text="Render U") + sub = col.column(align=True) + sub.itemR(curve, "resolution_v", text="Preview V") + sub.itemR(curve, "render_resolution_v", text="Render V") + col.itemL(text="Display:") + col.itemR(curve, "fast") class DATA_PT_geometry_text(DataButtonsPanel): __label__ = "Geometry" diff --git a/release/ui/buttons_game.py b/release/ui/buttons_game.py index e28e3fda2c6..73ba566e23f 100644 --- a/release/ui/buttons_game.py +++ b/release/ui/buttons_game.py @@ -45,10 +45,9 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel): col = split.column() col.itemL(text="Attributes:") - sub = col.column() - sub.itemR(game, "mass") - sub.itemR(game, "radius") - sub.itemR(game, "form_factor") + col.itemR(game, "mass") + col.itemR(game, "radius") + col.itemR(game, "form_factor") col = split.column() sub = col.column() @@ -108,8 +107,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel): col.itemR(soft, "dynamic_friction", slider=True) col.itemR(soft, "margin", slider=True) col.itemR(soft, "bending_const", text="Bending Constraints") - - + col = split.column() col.itemR(soft, "shape_match") sub = col.column() @@ -134,32 +132,26 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel): elif game.physics_type in ('SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'): - col = layout.column() - col.itemR(ob, "restrict_render", text="Invisible") + layout.itemR(ob, "restrict_render", text="Invisible") class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel): __label__ = "Collision Bounds" def poll(self, context): - ob = context.active_object - game = ob.game + game = context.object.game rd = context.scene.render_data return (game.physics_type in ('DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC')) and (rd.engine == 'BLENDER_GAME') def draw_header(self, context): - layout = self.layout - - ob = context.active_object - game = ob.game + game = context.active_object.game - layout.itemR(game, "use_collision_bounds", text="") + self.layout.itemR(game, "use_collision_bounds", text="") def draw(self, context): layout = self.layout - ob = context.scene.objects[0] - game = ob.game - + game = context.active_object.game + layout.active = game.use_collision_bounds layout.itemR(game, "collision_bounds", text="Bounds") @@ -184,8 +176,6 @@ class SCENE_PT_game(SceneButtonsPanel): def draw(self, context): layout = self.layout - - rd = context.scene.render_data row = layout.row() row.itemO("view3d.game_start", text="Start") diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py index e317d990c39..dc11731d7a9 100644 --- a/release/ui/buttons_material.py +++ b/release/ui/buttons_material.py @@ -8,18 +8,16 @@ class MaterialButtonsPanel(bpy.types.Panel): # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here def poll(self, context): - return (context.material) and (context.scene.render_data.engine in self.COMPAT_ENGINES) + mat = context.material + engine = context.scene.render_data.engine + return mat and (engine in self.COMPAT_ENGINES) class MATERIAL_PT_preview(MaterialButtonsPanel): __label__ = "Preview" COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME']) def draw(self, context): - layout = self.layout - - mat = context.material - - layout.template_preview(mat) + self.layout.template_preview(context.material) class MATERIAL_PT_context_material(MaterialButtonsPanel): __show_header__ = False @@ -83,32 +81,27 @@ class MATERIAL_PT_shading(MaterialButtonsPanel): layout = self.layout mat = context.material - ob = context.object - slot = context.material_slot - space = context.space_data - if mat: - - if mat.type in ('SURFACE', 'WIRE'): - split = layout.split() + if mat.type in ('SURFACE', 'WIRE'): + split = layout.split() - col = split.column() - sub = col.column() - sub.active = not mat.shadeless - sub.itemR(mat, "emit") - sub.itemR(mat, "ambient") - sub = col.column() - sub.itemR(mat, "translucency") + col = split.column() + sub = col.column() + sub.active = not mat.shadeless + sub.itemR(mat, "emit") + sub.itemR(mat, "ambient") + sub = col.column() + sub.itemR(mat, "translucency") - col = split.column() - col.itemR(mat, "shadeless") - sub = col.column() - sub.active = not mat.shadeless - sub.itemR(mat, "tangent_shading") - sub.itemR(mat, "cubic") + col = split.column() + col.itemR(mat, "shadeless") + sub = col.column() + sub.active = not mat.shadeless + sub.itemR(mat, "tangent_shading") + sub.itemR(mat, "cubic") - elif mat.type == 'HALO': - layout.itemR(mat, "alpha") + elif mat.type == 'HALO': + layout.itemR(mat, "alpha") class MATERIAL_PT_strand(MaterialButtonsPanel): __label__ = "Strand" @@ -158,8 +151,7 @@ class MATERIAL_PT_physics(MaterialButtonsPanel): def draw(self, context): layout = self.layout - mat = context.material - phys = mat.physics + phys = context.material.physics split = layout.split() @@ -363,12 +355,11 @@ class MATERIAL_PT_sss(MaterialButtonsPanel): return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) def draw_header(self, context): - layout = self.layout sss = context.material.subsurface_scattering mat = context.material - layout.active = (not mat.shadeless) - layout.itemR(sss, "enabled", text="") + self.layout.active = (not mat.shadeless) + self.layout.itemR(sss, "enabled", text="") def draw(self, context): layout = self.layout @@ -408,12 +399,10 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel): engine = context.scene.render_data.engine return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) - def draw_header(self, context): - layout = self.layout - + def draw_header(self, context): raym = context.material.raytrace_mirror - layout.itemR(raym, "enabled", text="") + self.layout.itemR(raym, "enabled", text="") def draw(self, context): layout = self.layout @@ -465,11 +454,9 @@ class MATERIAL_PT_transp(MaterialButtonsPanel): engine = context.scene.render_data.engine return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) - def draw_header(self, context): - layout = self.layout - + def draw_header(self, context): mat = context.material - layout.itemR(mat, "transparency", text="") + self.layout.itemR(mat, "transparency", text="") def draw(self, context): layout = self.layout @@ -477,15 +464,14 @@ class MATERIAL_PT_transp(MaterialButtonsPanel): mat = context.material rayt = context.material.raytrace_transparency - row= layout.row() - row.itemR(mat, "transparency_method", expand=True) + row = layout.row() row.active = mat.transparency and (not mat.shadeless) + row.itemR(mat, "transparency_method", expand=True) split = layout.split() col = split.column() - row = col.row() - row.itemR(mat, "alpha") + col.itemR(mat, "alpha") row = col.row() row.active = mat.transparency and (not mat.shadeless) row.itemR(mat, "specular_alpha", text="Specular") @@ -517,129 +503,6 @@ class MATERIAL_PT_transp(MaterialButtonsPanel): sub.itemR(rayt, "gloss_threshold", text="Threshold") sub.itemR(rayt, "gloss_samples", text="Samples") -class MATERIAL_PT_volume_shading(MaterialButtonsPanel): - __label__ = "Shading" - __default_closed__ = False - COMPAT_ENGINES = set(['BLENDER_RENDER']) - - def poll(self, context): - mat = context.material - engine = context.scene.render_data.engine - return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES) - - def draw(self, context): - layout = self.layout - - mat = context.material - vol = context.material.volume - - split = layout.split() - - row = split.row() - row.itemR(vol, "density") - row.itemR(vol, "scattering") - - split = layout.split() - col = split.column() - col.itemR(vol, "absorption") - col.itemR(vol, "absorption_color", text="") - - col = split.column() - col.itemR(vol, "emission") - col.itemR(vol, "emission_color", text="") - -class MATERIAL_PT_volume_scattering(MaterialButtonsPanel): - __label__ = "Scattering" - __default_closed__ = False - COMPAT_ENGINES = set(['BLENDER_RENDER']) - - def poll(self, context): - mat = context.material - engine = context.scene.render_data.engine - return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES) - - def draw(self, context): - layout = self.layout - - mat = context.material - vol = context.material.volume - - split = layout.split() - - col = split.column() - col.itemR(vol, "scattering_mode", text="") - if vol.scattering_mode == 'SINGLE_SCATTERING': - col.itemR(vol, "light_cache") - sub = col.column() - sub.active = vol.light_cache - sub.itemR(vol, "cache_resolution") - elif vol.scattering_mode in ('MULTIPLE_SCATTERING', 'SINGLE_PLUS_MULTIPLE_SCATTERING'): - col.itemR(vol, "cache_resolution") - - col = col.column(align=True) - col.itemR(vol, "ms_diffusion") - col.itemR(vol, "ms_spread") - col.itemR(vol, "ms_intensity") - - col = split.column() - # col.itemL(text="Anisotropic Scattering:") - col.itemR(vol, "phase_function", text="") - if vol.phase_function in ('SCHLICK', 'HENYEY-GREENSTEIN'): - col.itemR(vol, "asymmetry") - -class MATERIAL_PT_volume_transp(MaterialButtonsPanel): - __label__= "Transparency" - COMPAT_ENGINES = set(['BLENDER_RENDER']) - - def poll(self, context): - mat = context.material - engine = context.scene.render_data.engine - return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES) - - def draw_header(self, context): - layout = self.layout - - def draw(self, context): - layout = self.layout - - mat = context.material - rayt = context.material.raytrace_transparency - - row= layout.row() - row.itemR(mat, "transparency_method", expand=True) - row.active = mat.transparency and (not mat.shadeless) - -class MATERIAL_PT_volume_integration(MaterialButtonsPanel): - __label__ = "Integration" - __default_closed__ = False - COMPAT_ENGINES = set(['BLENDER_RENDER']) - - def poll(self, context): - mat = context.material - engine = context.scene.render_data.engine - return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES) - - def draw(self, context): - layout = self.layout - - mat = context.material - vol = context.material.volume - - split = layout.split() - - col = split.column() - col.itemL(text="Step Calculation:") - col.itemR(vol, "step_calculation", text="") - col = col.column(align=True) - col.itemR(vol, "step_size") - col.itemR(vol, "shading_step_size") - - col = split.column() - col.itemL() - col.itemR(vol, "depth_cutoff") - col.itemR(vol, "density_scale") - - class MATERIAL_PT_halo(MaterialButtonsPanel): __label__= "Halo" COMPAT_ENGINES = set(['BLENDER_RENDER']) @@ -720,7 +583,7 @@ class MATERIAL_PT_flare(MaterialButtonsPanel): col = split.column() col.itemR(halo, "flares_sub", text="Subflares") col.itemR(halo, "flare_subsize", text="Subsize") - + bpy.types.register(MATERIAL_PT_context_material) bpy.types.register(MATERIAL_PT_preview) bpy.types.register(MATERIAL_PT_diffuse) @@ -729,13 +592,122 @@ bpy.types.register(MATERIAL_PT_shading) bpy.types.register(MATERIAL_PT_transp) bpy.types.register(MATERIAL_PT_mirror) bpy.types.register(MATERIAL_PT_sss) -bpy.types.register(MATERIAL_PT_volume_shading) -bpy.types.register(MATERIAL_PT_volume_scattering) -bpy.types.register(MATERIAL_PT_volume_transp) -bpy.types.register(MATERIAL_PT_volume_integration) bpy.types.register(MATERIAL_PT_halo) bpy.types.register(MATERIAL_PT_flare) bpy.types.register(MATERIAL_PT_physics) bpy.types.register(MATERIAL_PT_strand) bpy.types.register(MATERIAL_PT_options) bpy.types.register(MATERIAL_PT_shadow) + +# Volumetrics +class VolumeButtonsPanel(bpy.types.Panel): + __space_type__ = 'PROPERTIES' + __region_type__ = 'WINDOW' + __context__ = "material" + + def poll(self, context): + mat = context.material + engine = context.scene.render_data.engine + return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES) + +class MATERIAL_PT_volume_shading(VolumeButtonsPanel): + __label__ = "Shading" + __default_closed__ = False + COMPAT_ENGINES = set(['BLENDER_RENDER']) + + def draw(self, context): + layout = self.layout + + mat = context.material + vol = context.material.volume + + row = layout.row() + row.itemR(vol, "density") + row.itemR(vol, "scattering") + + split = layout.split() + + col = split.column() + col.itemR(vol, "absorption") + col.itemR(vol, "absorption_color", text="") + + col = split.column() + col.itemR(vol, "emission") + col.itemR(vol, "emission_color", text="") + +class MATERIAL_PT_volume_scattering(VolumeButtonsPanel): + __label__ = "Scattering" + __default_closed__ = False + COMPAT_ENGINES = set(['BLENDER_RENDER']) + + def draw(self, context): + layout = self.layout + + vol = context.material.volume + + split = layout.split() + + col = split.column() + col.itemR(vol, "scattering_mode", text="") + if vol.scattering_mode == 'SINGLE_SCATTERING': + col.itemR(vol, "light_cache") + sub = col.column() + sub.active = vol.light_cache + sub.itemR(vol, "cache_resolution") + elif vol.scattering_mode in ('MULTIPLE_SCATTERING', 'SINGLE_PLUS_MULTIPLE_SCATTERING'): + col.itemR(vol, "cache_resolution") + + col = col.column(align=True) + col.itemR(vol, "ms_diffusion") + col.itemR(vol, "ms_spread") + col.itemR(vol, "ms_intensity") + + col = split.column() + # col.itemL(text="Anisotropic Scattering:") + col.itemR(vol, "phase_function", text="") + if vol.phase_function in ('SCHLICK', 'HENYEY-GREENSTEIN'): + col.itemR(vol, "asymmetry") + +class MATERIAL_PT_volume_transp(VolumeButtonsPanel): + __label__= "Transparency" + COMPAT_ENGINES = set(['BLENDER_RENDER']) + + def draw(self, context): + layout = self.layout + + mat = context.material + rayt = context.material.raytrace_transparency + + row= layout.row() + row.itemR(mat, "transparency_method", expand=True) + row.active = mat.transparency and (not mat.shadeless) + +class MATERIAL_PT_volume_integration(VolumeButtonsPanel): + __label__ = "Integration" + __default_closed__ = False + COMPAT_ENGINES = set(['BLENDER_RENDER']) + + def draw(self, context): + layout = self.layout + + mat = context.material + vol = context.material.volume + + split = layout.split() + + col = split.column() + col.itemL(text="Step Calculation:") + col.itemR(vol, "step_calculation", text="") + col = col.column(align=True) + col.itemR(vol, "step_size") + col.itemR(vol, "shading_step_size") + + col = split.column() + col.itemL() + col.itemR(vol, "depth_cutoff") + col.itemR(vol, "density_scale") + +bpy.types.register(MATERIAL_PT_volume_shading) +bpy.types.register(MATERIAL_PT_volume_scattering) +bpy.types.register(MATERIAL_PT_volume_transp) +bpy.types.register(MATERIAL_PT_volume_integration) diff --git a/release/ui/buttons_physics_cloth.py b/release/ui/buttons_physics_cloth.py index a1978f44c18..5cdca3c2c74 100644 --- a/release/ui/buttons_physics_cloth.py +++ b/release/ui/buttons_physics_cloth.py @@ -103,11 +103,10 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel): return (context.cloth) def draw_header(self, context): - layout = self.layout cloth = context.cloth.collision_settings - layout.active = cloth_panel_enabled(context.cloth) - layout.itemR(cloth, "enable_collision", text="") + self.layout.active = cloth_panel_enabled(context.cloth) + self.layout.itemR(cloth, "enable_collision", text="") def draw(self, context): layout = self.layout @@ -139,11 +138,10 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel): return (context.cloth != None) def draw_header(self, context): - layout = self.layout cloth = context.cloth.settings - layout.active = cloth_panel_enabled(context.cloth) - layout.itemR(cloth, "stiffness_scaling", text="") + self.layout.active = cloth_panel_enabled(context.cloth) + self.layout.itemR(cloth, "stiffness_scaling", text="") def draw(self, context): layout = self.layout diff --git a/release/ui/buttons_physics_field.py b/release/ui/buttons_physics_field.py index 3c68327ba79..58033d2c431 100644 --- a/release/ui/buttons_physics_field.py +++ b/release/ui/buttons_physics_field.py @@ -8,7 +8,7 @@ class PhysicButtonsPanel(bpy.types.Panel): def poll(self, context): rd = context.scene.render_data - return (context.object != None) and (not rd.use_game_engine) + return (context.object) and (not rd.use_game_engine) class PHYSICS_PT_field(PhysicButtonsPanel): __label__ = "Force Fields" diff --git a/release/ui/buttons_physics_smoke.py b/release/ui/buttons_physics_smoke.py index d7313632638..c87f71bff42 100644 --- a/release/ui/buttons_physics_smoke.py +++ b/release/ui/buttons_physics_smoke.py @@ -97,10 +97,7 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel): def poll(self, context): md = context.smoke - if md: - return (md.smoke_type == 'TYPE_DOMAIN') - - return False + return md and (md.smoke_type == 'TYPE_DOMAIN') def draw(self, context): layout = self.layout @@ -126,22 +123,15 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel): def poll(self, context): md = context.smoke - if md: - return (md.smoke_type == 'TYPE_DOMAIN') - - return False + return md and (md.smoke_type == 'TYPE_DOMAIN') def draw(self, context): layout = self.layout - md = context.smoke - - if md.smoke_type == 'TYPE_DOMAIN': + md = context.smoke.domain_settings + cache = md.point_cache - domain = md.domain_settings - cache = domain.point_cache - - point_cache_ui(self, cache, cache.baked==False, 0, 1) + point_cache_ui(self, cache, cache.baked==False, 0, 1) class PHYSICS_PT_smoke_highres(PhysicButtonsPanel): __label__ = "Smoke High Resolution" @@ -149,95 +139,85 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel): def poll(self, context): md = context.smoke - if md: - return (md.smoke_type == 'TYPE_DOMAIN') - - return False + return md and (md.smoke_type == 'TYPE_DOMAIN') - def draw_header(self, context): - layout = self.layout - + def draw_header(self, context): high = context.smoke.domain_settings - layout.itemR(high, "highres", text="") + self.layout.itemR(high, "highres", text="") def draw(self, context): layout = self.layout md = context.smoke.domain_settings - - if md: - - split = layout.split() + + split = layout.split() - col = split.column() - col.itemL(text="Resolution:") - col.itemR(md, "amplify", text="Divisions") + col = split.column() + col.itemL(text="Resolution:") + col.itemR(md, "amplify", text="Divisions") - sub = split.column() - sub.itemL(text="Noise Method:") - sub.row().itemR(md, "noise_type", text="") - sub.itemR(md, "strength") - sub.itemR(md, "show_highres") + col = split.column() + col.itemL(text="Noise Method:") + col.row().itemR(md, "noise_type", text="") + col.itemR(md, "strength") + col.itemR(md, "show_highres") class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel): __label__ = "Smoke Cache" __default_closed__ = True def poll(self, context): - return (context.smoke != None) + return (context.smoke) def draw(self, context): layout = self.layout md = context.smoke - - if md: - - cache = md.point_cache - - layout.set_context_pointer("PointCache", cache) - - row = layout.row() - row.template_list(cache, "point_cache_list", cache, "active_point_cache_index") - col = row.column(align=True) - col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="") - col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="") - - row = layout.row() - row.itemR(cache, "name") - - row = layout.row() - row.itemR(cache, "start_frame") - row.itemR(cache, "end_frame") - - row = layout.row() - - if cache.baked == True: - row.itemO("ptcache.free_bake", text="Free Bake") - else: - row.item_booleanO("ptcache.bake", "bake", True, text="Bake") - - subrow = row.row() - subrow.enabled = cache.frames_skipped or cache.outdated - subrow.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame") - - row = layout.row() - #row.enabled = smoke_panel_enabled(psys) - row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake") - - row = layout.row() - #row.enabled = smoke_panel_enabled(psys) - - layout.itemL(text=cache.info) - - layout.itemS() - - row = layout.row() - row.itemO("ptcache.bake_all", "bake", True, text="Bake All Dynamics") - row.itemO("ptcache.free_bake_all", text="Free All Bakes") - layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame") + cache = md.point_cache + + layout.set_context_pointer("PointCache", cache) + + row = layout.row() + row.template_list(cache, "point_cache_list", cache, "active_point_cache_index") + col = row.column(align=True) + col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="") + col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="") + + row = layout.row() + row.itemR(cache, "name") + + row = layout.row() + row.itemR(cache, "start_frame") + row.itemR(cache, "end_frame") + + row = layout.row() + + if cache.baked == True: + row.itemO("ptcache.free_bake", text="Free Bake") + else: + row.item_booleanO("ptcache.bake", "bake", True, text="Bake") + + subrow = row.row() + subrow.enabled = cache.frames_skipped or cache.outdated + subrow.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame") + + row = layout.row() + #row.enabled = smoke_panel_enabled(psys) + row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake") + + row = layout.row() + #row.enabled = smoke_panel_enabled(psys) + + layout.itemL(text=cache.info) + + layout.itemS() + + row = layout.row() + row.itemO("ptcache.bake_all", "bake", True, text="Bake All Dynamics") + row.itemO("ptcache.free_bake_all", text="Free All Bakes") + layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame") bpy.types.register(PHYSICS_PT_smoke) bpy.types.register(PHYSICS_PT_smoke_cache) diff --git a/release/ui/buttons_physics_softbody.py b/release/ui/buttons_physics_softbody.py index 73eb15d2212..703977a056f 100644 --- a/release/ui/buttons_physics_softbody.py +++ b/release/ui/buttons_physics_softbody.py @@ -77,12 +77,10 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel): return (context.soft_body) def draw_header(self, context): - layout = self.layout - softbody = context.soft_body.settings - layout.active = softbody_panel_enabled(context.soft_body) - layout.itemR(softbody, "use_goal", text="") + self.layout.active = softbody_panel_enabled(context.soft_body) + self.layout.itemR(softbody, "use_goal", text="") def draw(self, context): layout = self.layout @@ -120,12 +118,10 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel): return (context.soft_body) def draw_header(self, context): - #layout = self.layout - softbody = context.soft_body.settings - layout.active = softbody_panel_enabled(context.soft_body) - layout.itemR(softbody, "use_edges", text="") + self.layout.active = softbody_panel_enabled(context.soft_body) + self.layout.itemR(softbody, "use_edges", text="") def draw(self, context): layout = self.layout @@ -170,12 +166,10 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel): return (context.soft_body) def draw_header(self, context): - layout = self.layout - softbody = context.soft_body.settings - layout.active = softbody_panel_enabled(context.soft_body) - layout.itemR(softbody, "self_collision", text="") + self.layout.active = softbody_panel_enabled(context.soft_body) + self.layout.itemR(softbody, "self_collision", text="") def draw(self, context): layout = self.layout diff --git a/release/ui/buttons_scene.py b/release/ui/buttons_scene.py index abd42e32e35..126afc4ef23 100644 --- a/release/ui/buttons_scene.py +++ b/release/ui/buttons_scene.py @@ -323,11 +323,9 @@ class SCENE_PT_antialiasing(RenderButtonsPanel): COMPAT_ENGINES = set(['BLENDER_RENDER']) def draw_header(self, context): - layout = self.layout - rd = context.scene.render_data - layout.itemR(rd, "antialiasing", text="") + self.layout.itemR(rd, "antialiasing", text="") def draw(self, context): layout = self.layout @@ -391,11 +389,9 @@ class SCENE_PT_stamp(RenderButtonsPanel): COMPAT_ENGINES = set(['BLENDER_RENDER']) def draw_header(self, context): - layout = self.layout - rd = context.scene.render_data - layout.itemR(rd, "render_stamp", text="") + self.layout.itemR(rd, "render_stamp", text="") def draw(self, context): layout = self.layout diff --git a/release/ui/buttons_world.py b/release/ui/buttons_world.py index 342adfaf4af..b02673d126f 100644 --- a/release/ui/buttons_world.py +++ b/release/ui/buttons_world.py @@ -9,17 +9,14 @@ class WorldButtonsPanel(bpy.types.Panel): def poll(self, context): rd = context.scene.render_data - return (context.world != None) and (not rd.use_game_engine) and (rd.engine in self.COMPAT_ENGINES) + return (context.world) and (not rd.use_game_engine) and (rd.engine in self.COMPAT_ENGINES) class WORLD_PT_preview(WorldButtonsPanel): __label__ = "Preview" COMPAT_ENGINES = set(['BLENDER_RENDER']) def draw(self, context): - layout = self.layout - world = context.world - - layout.template_preview(world) + self.layout.template_preview(context.world) class WORLD_PT_context_world(WorldButtonsPanel): __show_header__ = False @@ -52,32 +49,30 @@ class WORLD_PT_world(WorldButtonsPanel): world = context.world - if world: - - row = layout.row() - row.itemR(world, "paper_sky") - row.itemR(world, "blend_sky") - row.itemR(world, "real_sky") + row = layout.row() + row.itemR(world, "paper_sky") + row.itemR(world, "blend_sky") + row.itemR(world, "real_sky") - row = layout.row() - row.column().itemR(world, "horizon_color") - col = row.column() - col.itemR(world, "zenith_color") - col.active = world.blend_sky - row.column().itemR(world, "ambient_color") + row = layout.row() + row.column().itemR(world, "horizon_color") + col = row.column() + col.itemR(world, "zenith_color") + col.active = world.blend_sky + row.column().itemR(world, "ambient_color") class WORLD_PT_mist(WorldButtonsPanel): __label__ = "Mist" COMPAT_ENGINES = set(['BLENDER_RENDER']) def draw_header(self, context): - layout = self.layout world = context.world - layout.itemR(world.mist, "enabled", text="") + self.layout.itemR(world.mist, "enabled", text="") def draw(self, context): layout = self.layout + world = context.world layout.active = world.mist.enabled @@ -87,7 +82,6 @@ class WORLD_PT_mist(WorldButtonsPanel): flow.itemR(world.mist, "start") flow.itemR(world.mist, "depth") flow.itemR(world.mist, "height") - layout.itemR(world.mist, "falloff") @@ -96,13 +90,13 @@ class WORLD_PT_stars(WorldButtonsPanel): COMPAT_ENGINES = set(['BLENDER_RENDER']) def draw_header(self, context): - layout = self.layout world = context.world - layout.itemR(world.stars, "enabled", text="") + self.layout.itemR(world.stars, "enabled", text="") def draw(self, context): layout = self.layout + world = context.world layout.active = world.stars.enabled @@ -118,13 +112,13 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel): COMPAT_ENGINES = set(['BLENDER_RENDER']) def draw_header(self, context): - layout = self.layout world = context.world - layout.itemR(world.ambient_occlusion, "enabled", text="") + self.layout.itemR(world.ambient_occlusion, "enabled", text="") def draw(self, context): layout = self.layout + ao = context.world.ambient_occlusion layout.active = ao.enabled @@ -186,4 +180,3 @@ bpy.types.register(WORLD_PT_world) bpy.types.register(WORLD_PT_ambient_occlusion) bpy.types.register(WORLD_PT_mist) bpy.types.register(WORLD_PT_stars) - diff --git a/release/ui/space_image.py b/release/ui/space_image.py index 8dc016f55b7..3f82727da47 100644 --- a/release/ui/space_image.py +++ b/release/ui/space_image.py @@ -7,6 +7,7 @@ class IMAGE_MT_view(bpy.types.Menu): def draw(self, context): layout = self.layout + sima = context.space_data uv = sima.uv_editor settings = context.tool_settings @@ -69,6 +70,7 @@ class IMAGE_MT_image(bpy.types.Menu): def draw(self, context): layout = self.layout + sima = context.space_data ima = sima.image @@ -148,13 +150,13 @@ class IMAGE_MT_uvs_weldalign(bpy.types.Menu): layout.itemO("uv.weld") # W, 1 layout.items_enumO("uv.align", "axis") # W, 2/3/4 - class IMAGE_MT_uvs(bpy.types.Menu): __space_type__ = 'IMAGE_EDITOR' __label__ = "UVs" def draw(self, context): layout = self.layout + sima = context.space_data uv = sima.uv_editor settings = context.tool_settings @@ -195,10 +197,11 @@ class IMAGE_HT_header(bpy.types.Header): __space_type__ = 'IMAGE_EDITOR' def draw(self, context): + layout = self.layout + sima = context.space_data ima = sima.image iuser = sima.image_user - layout = self.layout settings = context.tool_settings show_render = sima.show_render @@ -281,38 +284,34 @@ class IMAGE_PT_game_properties(bpy.types.Panel): return (sima and sima.image) and (rd.engine == 'BLENDER_GAME') def draw(self, context): - sima = context.space_data layout = self.layout - + + sima = context.space_data ima = sima.image - if ima: - split = layout.split() + split = layout.split() - col = split.column() + col = split.column() + col.itemR(ima, "clamp_x") + col.itemR(ima, "clamp_y") + col.itemR(ima, "mapping", expand=True) + col.itemR(ima, "tiles") - subcol = col.column(align=True) - subcol.itemR(ima, "clamp_x") - subcol.itemR(ima, "clamp_y") + col = split.column() - col.itemR(ima, "mapping", expand=True) - col.itemR(ima, "tiles") + sub = col.column(align=True) + sub.itemR(ima, "animated") - col = split.column() + subsub = sub.column() + subsub.active = ima.animated + subsub.itemR(ima, "animation_start", text="Start") + subsub.itemR(ima, "animation_end", text="End") + subsub.itemR(ima, "animation_speed", text="Speed") - subcol = col.column(align=True) - subcol.itemR(ima, "animated") - - subcol = subcol.column() - subcol.itemR(ima, "animation_start", text="Start") - subcol.itemR(ima, "animation_end", text="End") - subcol.itemR(ima, "animation_speed", text="Speed") - subcol.active = ima.animated - - subrow = col.row(align=True) - subrow.itemR(ima, "tiles_x", text="X") - subrow.itemR(ima, "tiles_y", text="Y") - subrow.active = ima.tiles or ima.animated + sub = col.row(align=True) + sub.active = ima.tiles or ima.animated + sub.itemR(ima, "tiles_x", text="X") + sub.itemR(ima, "tiles_y", text="Y") class IMAGE_PT_view_properties(bpy.types.Panel): __space_type__ = 'IMAGE_EDITOR' @@ -324,9 +323,9 @@ class IMAGE_PT_view_properties(bpy.types.Panel): return (sima and (sima.image or sima.show_uvedit)) def draw(self, context): - sima = context.space_data layout = self.layout - + + sima = context.space_data ima = sima.image show_uvedit = sima.show_uvedit uvedit = sima.uv_editor @@ -376,4 +375,3 @@ bpy.types.register(IMAGE_MT_uvs) bpy.types.register(IMAGE_HT_header) bpy.types.register(IMAGE_PT_game_properties) bpy.types.register(IMAGE_PT_view_properties) - diff --git a/release/ui/space_info.py b/release/ui/space_info.py index 4188209e393..79937816791 100644 --- a/release/ui/space_info.py +++ b/release/ui/space_info.py @@ -79,6 +79,8 @@ class INFO_MT_file_import(bpy.types.Menu): def draw(self, context): layout = self.layout + + layout.itemL(text="Nothing yet") class INFO_MT_file_export(bpy.types.Menu): __space_type__ = 'INFO' diff --git a/release/ui/space_node.py b/release/ui/space_node.py index 875aca7fd82..6ac1ac84f35 100644 --- a/release/ui/space_node.py +++ b/release/ui/space_node.py @@ -6,6 +6,7 @@ class NODE_HT_header(bpy.types.Header): def draw(self, context): layout = self.layout + snode = context.space_data row = layout.row(align=True) @@ -113,9 +114,7 @@ class NODE_MT_node(bpy.types.Menu): # layout.itemS() # layout.itemO("node.show_cyclic_dependencies") - bpy.types.register(NODE_HT_header) bpy.types.register(NODE_MT_view) bpy.types.register(NODE_MT_select) bpy.types.register(NODE_MT_node) - diff --git a/release/ui/space_text.py b/release/ui/space_text.py index 7b7ec176b72..117033c50a1 100644 --- a/release/ui/space_text.py +++ b/release/ui/space_text.py @@ -5,9 +5,10 @@ class TEXT_HT_header(bpy.types.Header): __space_type__ = 'TEXT_EDITOR' def draw(self, context): + layout = self.layout + st = context.space_data text = st.text - layout = self.layout row = layout.row(align=True) row.template_header() @@ -50,8 +51,9 @@ class TEXT_PT_properties(bpy.types.Panel): __label__ = "Properties" def draw(self, context): - st = context.space_data layout = self.layout + + st = context.space_data flow = layout.column_flow() flow.itemR(st, "line_numbers") @@ -69,8 +71,9 @@ class TEXT_PT_find(bpy.types.Panel): __label__ = "Find" def draw(self, context): - st = context.space_data layout = self.layout + + st = context.space_data # find col = layout.column(align=True) @@ -100,6 +103,7 @@ class TEXT_MT_text(bpy.types.Menu): def draw(self, context): layout = self.layout + st = context.space_data text = st.text @@ -200,8 +204,7 @@ class TEXT_MT_edit(bpy.types.Menu): __label__ = "Edit" def poll(self, context): - st = context.space_data - return st.text != None + return (context.space_data.text) def draw(self, context): layout = self.layout @@ -240,4 +243,3 @@ bpy.types.register(TEXT_MT_edit_view) bpy.types.register(TEXT_MT_edit_select) bpy.types.register(TEXT_MT_edit_markers) bpy.types.register(TEXT_MT_edit_to3d) - diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py index 517571e1b09..0b7ccb15d6c 100644 --- a/release/ui/space_view3d_toolbar.py +++ b/release/ui/space_view3d_toolbar.py @@ -420,10 +420,11 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel): context.texture_paint_object)) def draw(self, context): + layout = self.layout + settings = self.paint_settings(context) brush = settings.brush texture_paint = context.texture_paint_object - layout = self.layout if not texture_paint: layout.itemR(brush, "smooth_stroke") @@ -444,7 +445,6 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel): col.active = brush.airbrush col.itemR(brush, "rate", slider=True) - class VIEW3D_PT_tools_brush_curve(PaintPanel): __label__ = "Curve" __default_closed__ = True @@ -454,9 +454,10 @@ class VIEW3D_PT_tools_brush_curve(PaintPanel): return (settings and settings.brush and settings.brush.curve) def draw(self, context): + layout = self.layout + settings = self.paint_settings(context) brush = settings.brush - layout = self.layout layout.template_curve_mapping(brush.curve) layout.item_menu_enumO("brush.curve_preset", property="shape") @@ -469,6 +470,7 @@ class VIEW3D_PT_sculpt_options(PaintPanel): def draw(self, context): layout = self.layout + sculpt = context.tool_settings.sculpt col = layout.column() @@ -497,6 +499,7 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel): def draw(self, context): layout = self.layout + wpaint = context.tool_settings.weight_paint col = layout.column() @@ -524,6 +527,7 @@ class VIEW3D_PT_tools_vertexpaint(View3DPanel): def draw(self, context): layout = self.layout + vpaint = context.tool_settings.vertex_paint col = layout.column() @@ -598,6 +602,7 @@ class VIEW3D_PT_tools_particlemode(View3DPanel): def draw(self, context): layout = self.layout + pe = context.tool_settings.particle_edit ob = pe.object From 47beb68a0fbeecf0135efd5a356b6ece03e24457 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 1 Sep 2009 00:52:03 +0000 Subject: [PATCH 378/577] Open recent list was arseabout, only adding files on save, rather then open. This is problematic for a few reasons... * I'd often save a blendfile only so it would appier in the open recent menu. * Saving files (when you dont need to) makes access times less useful. * binary diff's in SVN dont give any useful info. Sometimes I wasnt sure if I actually edited or saves for fast re-opening. * Testing 2.4x files with animation data in 2.5 can loose info. * Its not logical and other apps dont work this way. Also made the recent file list in the file browser display the most recent item first (like the open recent menu). --- .../blender/editors/space_file/file_panels.c | 18 +++++++++++------- source/blender/windowmanager/intern/wm_files.c | 6 +++++- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index c48b3529389..24c3f9b4ca1 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -63,7 +63,7 @@ static void file_panel_cb(bContext *C, void *arg_entry, void *arg_unused) WM_operator_properties_free(&ptr); } -static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory category, short *nr, int icon, int allow_delete) +static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory category, short *nr, int icon, int allow_delete, int reverse) { SpaceFile *sfile= CTX_wm_space_file(C); uiBlock *block; @@ -71,7 +71,7 @@ static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory cat uiLayout *box, *col; struct FSMenu* fsmenu = fsmenu_get(); char *curdir= (sfile->params)? sfile->params->dir: ""; - int i, nentries = fsmenu_get_nentries(fsmenu, category); + int i, i_iter, nentries = fsmenu_get_nentries(fsmenu, category); /* reset each time */ *nr= -1; @@ -86,12 +86,16 @@ static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory cat box= uiLayoutBox(pa->layout); col= uiLayoutColumn(box, 1); - for (i=0; i< nentries;++i) { + for (i_iter=0; i_iter< nentries;++i_iter) { char dir[FILE_MAX]; char temp[FILE_MAX]; uiLayout* layout = uiLayoutRow(col, 0); - char *entry = fsmenu_get_entry(fsmenu, category, i); + char *entry; + i= reverse ? nentries-(i_iter+1) : i_iter; + + entry = fsmenu_get_entry(fsmenu, category, i); + /* set this list item as active if we have a match */ if(strcmp(curdir, entry) == 0) *nr= i; @@ -124,7 +128,7 @@ static void file_panel_system(const bContext *C, Panel *pa) SpaceFile *sfile= CTX_wm_space_file(C); if(sfile) - file_panel_category(C, pa, FS_CATEGORY_SYSTEM, &sfile->systemnr, ICON_DISK_DRIVE, 0); + file_panel_category(C, pa, FS_CATEGORY_SYSTEM, &sfile->systemnr, ICON_DISK_DRIVE, 0, 0); } static void file_panel_bookmarks(const bContext *C, Panel *pa) @@ -137,7 +141,7 @@ static void file_panel_bookmarks(const bContext *C, Panel *pa) uiItemO(row, "Add", ICON_ZOOMIN, "file.add_bookmark"); uiItemL(row, NULL, 0); - file_panel_category(C, pa, FS_CATEGORY_BOOKMARKS, &sfile->bookmarknr, ICON_BOOKMARKS, 1); + file_panel_category(C, pa, FS_CATEGORY_BOOKMARKS, &sfile->bookmarknr, ICON_BOOKMARKS, 1, 0); } } @@ -146,7 +150,7 @@ static void file_panel_recent(const bContext *C, Panel *pa) SpaceFile *sfile= CTX_wm_space_file(C); if(sfile) - file_panel_category(C, pa, FS_CATEGORY_RECENT, &sfile->recentnr, ICON_FILE_FOLDER, 0); + file_panel_category(C, pa, FS_CATEGORY_RECENT, &sfile->recentnr, ICON_FILE_FOLDER, 0, 1); } diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 9c30c99bbdd..b98717c8629 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -96,6 +96,7 @@ #include "wm.h" #include "wm_window.h" +static void writeBlog(void); /* To be able to read files without windows closing, opening, moving we try to prepare for worst case: @@ -256,7 +257,10 @@ void WM_read_file(bContext *C, char *name, ReportList *reports) if(retval==2) wm_init_userdef(); // in case a userdef is read from regular .blend - if (retval!=0) G.relbase_valid = 1; + if (retval!=0) { + G.relbase_valid = 1; + writeBlog(); + } // XXX undo_editmode_clear(); BKE_reset_undo(); From 285d665d99da1e4ab9406f66026fcca77195d761 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Tue, 1 Sep 2009 01:09:05 +0000 Subject: [PATCH 379/577] more use of data structures for communication. begining support for more than one file per fob (external dependencies, point cache, ...) --- release/io/netrender/client.py | 13 ++-- release/io/netrender/master.py | 117 ++++++++++++++++-------------- release/io/netrender/model.py | 23 ++++-- release/io/netrender/operators.py | 76 +++++++++---------- release/io/netrender/slave.py | 90 +++++++++++++++-------- release/io/netrender/ui.py | 23 +++++- release/io/netrender/utils.py | 38 ++++++---- 7 files changed, 223 insertions(+), 157 deletions(-) diff --git a/release/io/netrender/client.py b/release/io/netrender/client.py index 90039a3273a..bc4d363c996 100644 --- a/release/io/netrender/client.py +++ b/release/io/netrender/client.py @@ -22,7 +22,7 @@ class NetworkRenderEngine(bpy.types.RenderEngine): def render_master(self, scene): server_address = (scene.network_render.server_address, scene.network_render.server_port) - httpd = master.RenderMasterServer(server_address, master.RenderHandler) + httpd = master.RenderMasterServer(server_address, master.RenderHandler, scene.network_render.path) httpd.timeout = 1 httpd.stats = self.update_stats while not self.test_break(): @@ -32,6 +32,7 @@ class NetworkRenderEngine(bpy.types.RenderEngine): slave.render_slave(self, scene) def render_client(self, scene): + netsettings = scene.network_render self.update_stats("", "Network render client initiation") conn = clientConnection(scene) @@ -41,7 +42,7 @@ class NetworkRenderEngine(bpy.types.RenderEngine): self.update_stats("", "Network render exporting") - job_id = scene.network_render.job_id + job_id = netsettings.job_id # reading back result @@ -51,10 +52,10 @@ class NetworkRenderEngine(bpy.types.RenderEngine): response = conn.getresponse() if response.status == http.client.NO_CONTENT: - scene.network_render.job_id = clientSendJob(conn, scene) + netsettings.job_id = clientSendJob(conn, scene) clientRequestResult(conn, scene, job_id) - while response.status == http.client.PROCESSING and not self.test_break(): + while response.status == http.client.ACCEPTED and not self.test_break(): print("waiting") time.sleep(1) clientRequestResult(conn, scene, job_id) @@ -68,7 +69,7 @@ class NetworkRenderEngine(bpy.types.RenderEngine): x= int(r.resolution_x*r.resolution_percentage*0.01) y= int(r.resolution_y*r.resolution_percentage*0.01) - f = open(PATH_PREFIX + "output.exr", "wb") + f = open(netsetting.path + "output.exr", "wb") buf = response.read(1024) while buf: @@ -78,7 +79,7 @@ class NetworkRenderEngine(bpy.types.RenderEngine): f.close() result = self.begin_result(0, 0, x, y) - result.load_from_file(PATH_PREFIX + "output.exr", 0, 0) + result.load_from_file(netsettings.path + "output.exr", 0, 0) self.end_result(result) conn.close() diff --git a/release/io/netrender/master.py b/release/io/netrender/master.py index daca3bcf653..6f97685935d 100644 --- a/release/io/netrender/master.py +++ b/release/io/netrender/master.py @@ -9,12 +9,22 @@ JOB_WAITING = 0 # before all data has been entered JOB_PAUSED = 1 # paused by user JOB_QUEUED = 2 # ready to be dispatched +class MRenderFile: + def __init__(self, filepath): + self.filepath = filepath + self.found = False + + def test(self): + self.found = os.path.exists(self.filepath) + return self.found + + class MRenderSlave(netrender.model.RenderSlave): - def __init__(self, name, adress, stats): + def __init__(self, name, address, stats): super().__init__() - self.id = hashlib.md5(bytes(repr(name) + repr(adress), encoding='utf8')).hexdigest() + self.id = hashlib.md5(bytes(repr(name) + repr(address), encoding='utf8')).hexdigest() self.name = name - self.adress = adress + self.address = address self.stats = stats self.last_seen = time.time() @@ -31,11 +41,12 @@ def groupKey(job): return (job.status, job.framesLeft() > 0, job.priority, job.credits) class MRenderJob(netrender.model.RenderJob): - def __init__(self, job_id, name, path, chunks = 1, priority = 1, credits = 100.0, blacklist = []): + def __init__(self, job_id, name, files, chunks = 1, priority = 1, credits = 100.0, blacklist = []): super().__init__() self.id = job_id self.name = name - self.path = path + self.files = files + self.render_files = [MRenderFile(path) for path in files] self.status = JOB_WAITING self.frames = [] self.chunks = chunks @@ -44,6 +55,14 @@ class MRenderJob(netrender.model.RenderJob): self.blacklist = blacklist self.last_dispatched = time.time() + def testStart(self): + for f in self.render_files: + if not f.test(): + return False + + self.start() + return True + def start(self): self.status = JOB_QUEUED @@ -75,7 +94,7 @@ class MRenderJob(netrender.model.RenderJob): if f.status == QUEUED: self.update() frames.append(f) - if len(frames) == self.chunks: + if len(frames) >= self.chunks: break return frames @@ -162,10 +181,10 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): if frame: if frame.status in (QUEUED, DISPATCHED): - self.send_head(http.client.PROCESSING) + self.send_head(http.client.ACCEPTED) elif frame.status == DONE: self.server.stats("", "Sending result back to client") - f = open(PATH_PREFIX + job_id + "%04d" % job_frame + ".exr", 'rb') + f = open(self.server.path + job_id + "%04d" % job_frame + ".exr", 'rb') self.send_head() @@ -173,13 +192,13 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): f.close() elif frame.status == ERROR: - self.send_head(http.client.NO_CONTENT) + self.send_head(http.client.PARTIAL_CONTENT) else: # no such frame - self.send_head(http.client.NOT_FOUND) + self.send_head(http.client.NO_CONTENT) else: # no such job id - self.send_head(http.client.NOT_FOUND) + self.send_head(http.client.NO_CONTENT) # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- elif self.path == "log": job_id = self.headers['job-id'] @@ -194,23 +213,21 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): if frame: if frame.status in (QUEUED, DISPATCHED): self.send_head(http.client.PROCESSING) - elif frame.status == DONE: + else: self.server.stats("", "Sending log back to client") - f = open(PATH_PREFIX + job_id + "%04d" % job_frame + ".log", 'rb') + f = open(self.server.path + job_id + "%04d" % job_frame + ".log", 'rb') self.send_head() shutil.copyfileobj(f, self.wfile) f.close() - elif frame.status == ERROR: - self.send_head(http.client.NO_CONTENT) else: # no such frame - self.send_head(http.client.NOT_FOUND) + self.send_head(http.client.NO_CONTENT) else: # no such job id - self.send_head(http.client.NOT_FOUND) + self.send_head(http.client.NO_CONTENT) # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- elif self.path == "status": job_id = self.headers.get('job-id', "") @@ -228,13 +245,13 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): message = frame.serialize() else: # no such frame - self.send_heat(http.client.NOT_FOUND) + self.send_heat(http.client.NO_CONTENT) return else: message = job.serialize() else: # no such job id - self.send_head(http.client.NOT_FOUND) + self.send_head(http.client.NO_CONTENT) return else: # status of all jobs message = [] @@ -262,6 +279,7 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): if job and frames: for f in frames: + print("dispatch", f.number) f.status = DISPATCHED f.slave = slave @@ -274,9 +292,9 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): self.server.stats("", "Sending job frame to render node") else: # no job available, return error code - self.send_head(http.client.NO_CONTENT) + self.send_head(http.client.ACCEPTED) else: # invalid slave id - self.send_head(http.client.NOT_FOUND) + self.send_head(http.client.NO_CONTENT) # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- elif self.path == "file": job_id = self.headers['job-id'] @@ -288,14 +306,14 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): self.send_head(headers={"job-id": job.id}) self.server.stats("", "Sending file to render node") - f = open(PATH_PREFIX + job.id + ".blend", 'rb') + f = open(self.server.path + job.id + ".blend", 'rb') shutil.copyfileobj(f, self.wfile) f.close() else: # no such job id - self.send_head(http.client.NOT_FOUND) + self.send_head(http.client.NO_CONTENT) # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- elif self.path == "slave": message = [] @@ -322,33 +340,25 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): self.server.stats("", "Receiving job") length = int(self.headers['content-length']) - job_frame_string = self.headers['job-frame'] - job_name = self.headers.get('job-name', "") - job_chunks = int(self.headers.get('job-chunks', "1")) - blacklist = self.headers.get('slave-blacklist', '').split() - job_path = str(self.rfile.read(length), encoding='utf8') + job_info = netrender.model.RenderJob.materialize(eval(str(self.rfile.read(length), encoding='utf8'))) - if os.path.exists(job_path): - job_id = self.server.nextJobID() + job_id = self.server.nextJobID() + + print("chunks", job_info.chunks) + + job = MRenderJob(job_id, job_info.name, job_info.files, chunks = job_info.chunks, priority = job_info.priority, blacklist = job_info.blacklist) + self.server.addJob(job) + + for frame in job_info.frames: + frame = job.addFrame(frame.number) - job = MRenderJob(job_id, job_name, job_path, chunks = job_chunks, blacklist = blacklist) - self.server.addJob(job) - - if ":" in job_frame_string: - frame_start, frame_end = [int(x) for x in job_frame_string.split(":")] - - for job_frame in range(frame_start, frame_end + 1): - frame = job.addFrame(job_frame) - else: - job_frame = int(job_frame_string) - frame = job.addFrame(job_frame) - - job.start() - - self.send_head(headers={"job-id": job_id}) + headers={"job-id": job_id} + + if job.testStart(): + self.send_head(headers=headers) else: - self.send_head(http.client.NOT_FOUND) + self.send_head(http.client.ACCEPTED, headers=headers) # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- elif self.path == "cancel": job_id = self.headers.get('job-id', "") @@ -375,7 +385,7 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): self.send_head() else: # job not found - self.send_head(http.client.NOT_FOUND) + self.send_head(http.client.NO_CONTENT) # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- elif self.path == "slave": length = int(self.headers['content-length']) @@ -412,7 +422,7 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): job_path = job_id + ".blend" - f = open(PATH_PREFIX + job_path, "wb") + f = open(self.server.path + job_path, "wb") f.write(buf) f.close() del buf @@ -445,7 +455,7 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): if job_result == DONE: length = int(self.headers['content-length']) buf = self.rfile.read(length) - f = open(PATH_PREFIX + job_id + "%04d" % job_frame + ".exr", 'wb') + f = open(self.server.path + job_id + "%04d" % job_frame + ".exr", 'wb') f.write(buf) f.close() @@ -471,7 +481,7 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): print("log length:", length) buf = self.rfile.read(length) - f = open(PATH_PREFIX + job_id + "%04d" % job_frame + ".log", 'wb') + f = open(self.server.path + job_id + "%04d" % job_frame + ".log", 'wb') f.write(buf) f.close() @@ -483,20 +493,21 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): class RenderMasterServer(http.server.HTTPServer): - def __init__(self, address, handler_class): + def __init__(self, address, handler_class, path): super().__init__(address, handler_class) self.jobs = [] self.jobs_map = {} self.slaves = [] self.slaves_map = {} self.job_id = 0 + self.path = path def nextJobID(self): self.job_id += 1 return str(self.job_id) - def addSlave(self, name, adress, stats): - slave = MRenderSlave(name, adress, stats) + def addSlave(self, name, address, stats): + slave = MRenderSlave(name, address, stats) self.slaves.append(slave) self.slaves_map[slave.id] = slave diff --git a/release/io/netrender/model.py b/release/io/netrender/model.py index 98866ff1dfc..8b919b1fa36 100644 --- a/release/io/netrender/model.py +++ b/release/io/netrender/model.py @@ -10,7 +10,7 @@ class RenderSlave: def __init__(self): self.id = "" self.name = "" - self.adress = (0,0) + self.address = (0,0) self.stats = "" self.total_done = 0 self.total_error = 0 @@ -20,7 +20,7 @@ class RenderSlave: return { "id": self.id, "name": self.name, - "adress": self.adress, + "address": self.address, "stats": self.stats, "total_done": self.total_done, "total_error": self.total_error, @@ -40,7 +40,7 @@ class RenderSlave: slave = RenderSlave() slave.id = slave_id slave.name = data["name"] - slave.adress = data["adress"] + slave.address = data["address"] slave.stats = data["stats"] slave.total_done = data["total_done"] slave.total_error = data["total_error"] @@ -54,7 +54,7 @@ class RenderJob: def __init__(self): self.id = "" self.name = "" - self.path = "" + self.files = [] self.frames = [] self.chunks = 0 self.priority = 0 @@ -62,6 +62,11 @@ class RenderJob: self.blacklist = [] self.last_dispatched = 0.0 + def addFrame(self, frame_number): + frame = RenderFrame(frame_number) + self.frames.append(frame) + return frame + def __len__(self): return len(self.frames) @@ -96,8 +101,9 @@ class RenderJob: return { "id": self.id, "name": self.name, - "path": self.path, + "files": self.files, "frames": [f.serialize() for f in self.frames if not frames or f in frames], + "chunks": self.chunks, "priority": self.priority, "credits": self.credits, "blacklist": self.blacklist, @@ -112,8 +118,9 @@ class RenderJob: job = RenderJob() job.id = data["id"] job.name = data["name"] - job.path = data["path"] + job.files = data["files"] job.frames = [RenderFrame.materialize(f) for f in data["frames"]] + job.chunks = data["chunks"] job.priority = data["priority"] job.credits = data["credits"] job.blacklist = data["blacklist"] @@ -122,8 +129,8 @@ class RenderJob: return job class RenderFrame: - def __init__(self): - self.number = 0 + def __init__(self, number = 0): + self.number = number self.time = 0 self.status = QUEUED self.slave = None diff --git a/release/io/netrender/operators.py b/release/io/netrender/operators.py index 8df662b6b52..a1208aa1b46 100644 --- a/release/io/netrender/operators.py +++ b/release/io/netrender/operators.py @@ -48,7 +48,7 @@ class RENDER_OT_netclientstatus(bpy.types.Operator): return True def execute(self, context): - netprops = context.scene.network_render + netsettings = context.scene.network_render conn = clientConnection(context.scene) if conn: @@ -59,12 +59,12 @@ class RENDER_OT_netclientstatus(bpy.types.Operator): jobs = (netrender.model.RenderJob.materialize(j) for j in eval(str(response.read(), encoding='utf8'))) - while(len(netprops.jobs) > 0): - netprops.jobs.remove(0) + while(len(netsettings.jobs) > 0): + netsettings.jobs.remove(0) for j in jobs: - netprops.jobs.add() - job = netprops.jobs[-1] + netsettings.jobs.add() + job = netsettings.jobs[-1] job_results = j.framesStatus() @@ -93,22 +93,22 @@ class RENDER_OT_netclientblacklistslave(bpy.types.Operator): return True def execute(self, context): - netprops = context.scene.network_render + netsettings = context.scene.network_render - if netprops.active_slave_index >= 0: + if netsettings.active_slave_index >= 0: - slave = netrender.slaves[netprops.active_slave_index] + slave = netrender.slaves[netsettings.active_slave_index] - netprops.slaves_blacklist.add() + netsettings.slaves_blacklist.add() - netprops.slaves_blacklist[-1].id = slave.id - netprops.slaves_blacklist[-1].name = slave.name - netprops.slaves_blacklist[-1].adress = slave.adress - netprops.slaves_blacklist[-1].last_seen = slave.last_seen - netprops.slaves_blacklist[-1].stats = slave.stats + netsettings.slaves_blacklist[-1].id = slave.id + netsettings.slaves_blacklist[-1].name = slave.name + netsettings.slaves_blacklist[-1].address = slave.address + netsettings.slaves_blacklist[-1].last_seen = slave.last_seen + netsettings.slaves_blacklist[-1].stats = slave.stats - netprops.slaves.remove(netprops.active_slave_index) - netprops.active_slave_index = -1 + netsettings.slaves.remove(netsettings.active_slave_index) + netsettings.active_slave_index = -1 return ('FINISHED',) @@ -129,22 +129,22 @@ class RENDER_OT_netclientwhitelistslave(bpy.types.Operator): return True def execute(self, context): - netprops = context.scene.network_render + netsettings = context.scene.network_render - if netprops.active_blacklisted_slave_index >= 0: + if netsettings.active_blacklisted_slave_index >= 0: - slave = netprops.slaves_blacklist[netprops.active_blacklisted_slave_index] + slave = netsettings.slaves_blacklist[netsettings.active_blacklisted_slave_index] - netprops.slaves.add() + netsettings.slaves.add() - netprops.slaves[-1].id = slave.id - netprops.slaves[-1].name = slave.name - netprops.slaves[-1].adress = slave.adress - netprops.slaves[-1].last_seen = slave.last_seen - netprops.slaves[-1].stats = slave.stats + netsettings.slaves[-1].id = slave.id + netsettings.slaves[-1].name = slave.name + netsettings.slaves[-1].address = slave.address + netsettings.slaves[-1].last_seen = slave.last_seen + netsettings.slaves[-1].stats = slave.stats - netprops.slaves_blacklist.remove(netprops.active_blacklisted_slave_index) - netprops.active_blacklisted_slave_index = -1 + netsettings.slaves_blacklist.remove(netsettings.active_blacklisted_slave_index) + netsettings.active_blacklisted_slave_index = -1 return ('FINISHED',) @@ -166,7 +166,7 @@ class RENDER_OT_netclientslaves(bpy.types.Operator): return True def execute(self, context): - netprops = context.scene.network_render + netsettings = context.scene.network_render conn = clientConnection(context.scene) if conn: @@ -177,21 +177,21 @@ class RENDER_OT_netclientslaves(bpy.types.Operator): slaves = (netrender.model.RenderSlave.materialize(s) for s in eval(str(response.read(), encoding='utf8'))) - while(len(netprops.slaves) > 0): - netprops.slaves.remove(0) + while(len(netsettings.slaves) > 0): + netsettings.slaves.remove(0) for s in slaves: - for slave in netprops.slaves_blacklist: + for slave in netsettings.slaves_blacklist: if slave.id == s.id: break - netprops.slaves.add() - slave = netprops.slaves[-1] + netsettings.slaves.add() + slave = netsettings.slaves[-1] slave.id = s.id slave.name = s.name slave.stats = s.stats - slave.adress = s.adress[0] + slave.address = s.address[0] slave.last_seen = time.ctime(s.last_seen) return ('FINISHED',) @@ -210,15 +210,15 @@ class RENDER_OT_netclientcancel(bpy.types.Operator): __props__ = [] def poll(self, context): - netprops = context.scene.network_render - return netprops.active_job_index >= 0 and len(netprops.jobs) > 0 + netsettings = context.scene.network_render + return netsettings.active_job_index >= 0 and len(netsettings.jobs) > 0 def execute(self, context): - netprops = context.scene.network_render + netsettings = context.scene.network_render conn = clientConnection(context.scene) if conn: - job = netprops.jobs[netprops.active_job_index] + job = netsettings.jobs[netsettings.active_job_index] conn.request("POST", "cancel", headers={"job-id":job.id}) diff --git a/release/io/netrender/slave.py b/release/io/netrender/slave.py index 59c474293b3..64801743d70 100644 --- a/release/io/netrender/slave.py +++ b/release/io/netrender/slave.py @@ -21,17 +21,50 @@ def testCancel(conn, job_id): response = conn.getresponse() # cancelled if job isn't found anymore - if response.status == http.client.NOT_FOUND: + if response.status == http.client.NO_CONTENT: return True else: return False -def render_slave(engine, scene): - NODE_PREFIX = PATH_PREFIX + "node" + os.sep - timeout = 1 +def testFile(conn, JOB_PREFIX, file_path, main_path = None): + if os.path.isabs(file_path): + # if an absolute path, make sure path exists, if it doesn't, use relative local path + job_full_path = file_path + if not os.path.exists(job_full_path): + p, n = os.path.split(job_full_path) + + if main_path and p.startswith(main_path): + directory = JOB_PREFIX + p[len(main_path):] + job_full_path = directory + n + if not os.path.exists(directory): + os.mkdir(directory) + else: + job_full_path = JOB_PREFIX + n + else: + job_full_path = JOB_PREFIX + file_path - if not os.path.exists(NODE_PREFIX): - os.mkdir(NODE_PREFIX) + if not os.path.exists(job_full_path): + conn.request("GET", "file", headers={"job-id": job.id, "slave-id":slave_id}) + response = conn.getresponse() + + if response.status != http.client.OK: + return None # file for job not returned by server, need to return an error code to server + + f = open(job_full_path, "wb") + buf = response.read(1024) + + while buf: + f.write(buf) + buf = response.read(1024) + + f.close() + + return job_full_path + + +def render_slave(engine, scene): + netsettings = scene.network_render + timeout = 1 engine.update_stats("", "Network render node initiation") @@ -43,6 +76,10 @@ def render_slave(engine, scene): slave_id = response.getheader("slave-id") + NODE_PREFIX = netsettings.path + "node_" + slave_id + os.sep + if not os.path.exists(NODE_PREFIX): + os.mkdir(NODE_PREFIX) + while not engine.test_break(): conn.request("GET", "job", headers={"slave-id":slave_id}) @@ -53,41 +90,30 @@ def render_slave(engine, scene): job = netrender.model.RenderJob.materialize(eval(str(response.read(), encoding='utf8'))) - print("File:", job.path) - engine.update_stats("", "Render File", job.path, "for job", job.id) + JOB_PREFIX = NODE_PREFIX + "job_" + job.id + os.sep + if not os.path.exists(JOB_PREFIX): + os.mkdir(JOB_PREFIX) - if os.path.isabs(job.path): - # if an absolute path, make sure path exists, if it doesn't, use relative local path - job_full_path = job.path - if not os.path.exists(job_full_path): - job_full_path = NODE_PREFIX + job.id + ".blend" - else: - job_full_path = NODE_PREFIX + job.path + job_path = job.files[0] + main_path, main_file = os.path.split(job_path) - if not os.path.exists(job_full_path): - conn.request("GET", "file", headers={"job-id": job.id, "slave-id":slave_id}) - response = conn.getresponse() - - if response.status != http.client.OK: - break # file for job not returned by server, need to return an error code to server - - f = open(job_full_path, "wb") - buf = response.read(1024) - - while buf: - f.write(buf) - buf = response.read(1024) - - f.close() + job_full_path = testFile(conn, JOB_PREFIX, job_path) + print("Fullpath", job_full_path) + print("File:", main_file, "and %i other files" % (len(job.files) - 1,)) + engine.update_stats("", "Render File", main_file, "for job", job.id) + + for file_path in job.files[1:]: + testFile(conn, JOB_PREFIX, file_path, main_path) frame_args = [] for frame in job.frames: + print("frame", frame.number) frame_args += ["-f", str(frame.number)] start_t = time.time() - process = subprocess.Popen([sys.argv[0], "-b", job_full_path, "-o", NODE_PREFIX + job.id, "-E", "BLENDER_RENDER", "-F", "MULTILAYER"] + frame_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + process = subprocess.Popen([sys.argv[0], "-b", job_full_path, "-o", JOB_PREFIX + "######", "-E", "BLENDER_RENDER", "-F", "MULTILAYER"] + frame_args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) cancelled = False stdout = bytes() @@ -120,7 +146,7 @@ def render_slave(engine, scene): for frame in job.frames: headers["job-frame"] = str(frame.number) # send result back to server - f = open(NODE_PREFIX + job.id + "%04d" % frame.number + ".exr", 'rb') + f = open(JOB_PREFIX + "%06d" % frame.number + ".exr", 'rb') conn.request("PUT", "render", f, headers=headers) f.close() response = conn.getresponse() diff --git a/release/io/netrender/ui.py b/release/io/netrender/ui.py index 71b013c5a63..f8179fedbda 100644 --- a/release/io/netrender/ui.py +++ b/release/io/netrender/ui.py @@ -48,9 +48,11 @@ class SCENE_PT_network_settings(RenderButtonsPanel): col.itemR(scene.network_render, "mode") col.itemR(scene.network_render, "server_address") col.itemR(scene.network_render, "server_port") + col.itemR(scene.network_render, "path") if scene.network_render.mode == "RENDER_CLIENT": col.itemR(scene.network_render, "chunks") + col.itemR(scene.network_render, "priority") col.itemR(scene.network_render, "job_name") col.itemO("render.netclientsend", text="send job to server") bpy.types.register(SCENE_PT_network_settings) @@ -84,7 +86,7 @@ class SCENE_PT_network_slaves(RenderButtonsPanel): slave = netrender.slaves[netrender.active_slave_index] layout.itemL(text="Name: " + slave.name) - layout.itemL(text="Adress: " + slave.adress) + layout.itemL(text="Address: " + slave.address) layout.itemL(text="Seen: " + slave.last_seen) layout.itemL(text="Stats: " + slave.stats) @@ -119,7 +121,7 @@ class SCENE_PT_network_slaves_blacklist(RenderButtonsPanel): slave = netrender.slaves_blacklist[netrender.active_blacklisted_slave_index] layout.itemL(text="Name: " + slave.name) - layout.itemL(text="Adress: " + slave.adress) + layout.itemL(text="Address: " + slave.address) layout.itemL(text="Seen: " + slave.last_seen) layout.itemL(text="Stats: " + slave.stats) @@ -189,6 +191,12 @@ NetRenderSettings.IntProperty( attr="server_port", min=1, max=65535) +NetRenderSettings.StringProperty( attr="path", + name="Path", + description="Path for temporary files", + maxlen = 128, + default = "/tmp/") + NetRenderSettings.StringProperty( attr="job_name", name="Job name", description="Name of the job", @@ -202,6 +210,13 @@ NetRenderSettings.IntProperty( attr="chunks", min=1, max=65535) +NetRenderSettings.IntProperty( attr="priority", + name="Priority", + description="Priority of the job", + default = 1, + min=1, + max=10) + NetRenderSettings.StringProperty( attr="job_id", name="Network job id", description="id of the last sent render job", @@ -249,8 +264,8 @@ NetRenderSlave.StringProperty( attr="name", maxlen = 64, default = "") -NetRenderSlave.StringProperty( attr="adress", - name="Adress of the slave", +NetRenderSlave.StringProperty( attr="address", + name="Address of the slave", description="", maxlen = 64, default = "") diff --git a/release/io/netrender/utils.py b/release/io/netrender/utils.py index c158ff115fa..d64b6fcda1e 100644 --- a/release/io/netrender/utils.py +++ b/release/io/netrender/utils.py @@ -3,9 +3,9 @@ import sys, os import http, http.client, http.server, urllib import subprocess, shutil, time, hashlib -VERSION = b"0.3" +import netrender.model -PATH_PREFIX = "/tmp/" +VERSION = b"0.3" QUEUED = 0 DISPATCHED = 1 @@ -41,40 +41,46 @@ def clientVerifyVersion(conn): return True def clientSendJob(conn, scene, anim = False, chunks = 5): + netsettings = scene.network_render + job = netrender.model.RenderJob() if anim: - job_frame = "%i:%i" % (scene.start_frame, scene.end_frame) + for f in range(scene.start_frame, scene.end_frame + 1): + job.addFrame(f) else: - job_frame = "%i" % (scene.current_frame, ) - - blacklist = [] + job.addFrame(scene.current_frame) filename = bpy.data.filename + job.files.append(filename) - name = scene.network_render.job_name - + name = netsettings.job_name if name == "[default]": path, name = os.path.split(filename) - for slave in scene.network_render.slaves_blacklist: - blacklist.append(slave.id) - - blacklist = " ".join(blacklist) + job.name = name - headers = {"job-frame":job_frame, "job-name":name, "job-chunks": str(chunks), "slave-blacklist": blacklist} + for slave in scene.network_render.slaves_blacklist: + job.blacklist.append(slave.id) + + job.chunks = netsettings.chunks + job.priority = netsettings.priority # try to send path first - conn.request("POST", "job", filename, headers=headers) + conn.request("POST", "job", repr(job.serialize())) response = conn.getresponse() + job_id = response.getheader("job-id") + # if not found, send whole file if response.status == http.client.NOT_FOUND: f = open(bpy.data.filename, "rb") - conn.request("PUT", "file", f, headers=headers) + conn.request("PUT", "file", f, headers={"job-id": job_id}) f.close() response = conn.getresponse() - return response.getheader("job-id") + # server will reply with NOT_FOUD until all files are found + + return job_id def clientRequestResult(conn, scene, job_id): conn.request("GET", "render", headers={"job-id": job_id, "job-frame":str(scene.current_frame)}) From d7a5cccb5bfc90c724d4771ec52bce9902a73b60 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 1 Sep 2009 06:48:40 +0000 Subject: [PATCH 380/577] 2.5 - Code shuffling in arithb.c * Moved all the euler-rotation functions so that they were near each other in the file. * Tagged all functions relevant to axis-angle rotations --- source/blender/blenlib/intern/arithb.c | 269 +++++++++++++------------ 1 file changed, 137 insertions(+), 132 deletions(-) diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index ebead4bce9b..32bacc9472c 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -1610,7 +1610,7 @@ void VecUpMat3(float *vec, float mat[][3], short axis) } /* A & M Watt, Advanced animation and rendering techniques, 1992 ACM press */ -void QuatInterpolW(float *, float *, float *, float ); +void QuatInterpolW(float *, float *, float *, float ); // XXX why this? void QuatInterpolW(float *result, float *quat1, float *quat2, float t) { @@ -2943,137 +2943,6 @@ void EulToQuat(float *eul, float *quat) quat[3] = cj*cs - sj*sc; } -void VecRotToMat3(float *vec, float phi, float mat[][3]) -{ - /* rotation of phi radials around vec */ - float vx, vx2, vy, vy2, vz, vz2, co, si; - - vx= vec[0]; - vy= vec[1]; - vz= vec[2]; - vx2= vx*vx; - vy2= vy*vy; - vz2= vz*vz; - co= (float)cos(phi); - si= (float)sin(phi); - - mat[0][0]= vx2+co*(1.0f-vx2); - mat[0][1]= vx*vy*(1.0f-co)+vz*si; - mat[0][2]= vz*vx*(1.0f-co)-vy*si; - mat[1][0]= vx*vy*(1.0f-co)-vz*si; - mat[1][1]= vy2+co*(1.0f-vy2); - mat[1][2]= vy*vz*(1.0f-co)+vx*si; - mat[2][0]= vz*vx*(1.0f-co)+vy*si; - mat[2][1]= vy*vz*(1.0f-co)-vx*si; - mat[2][2]= vz2+co*(1.0f-vz2); - -} - -void VecRotToMat4(float *vec, float phi, float mat[][4]) -{ - float tmat[3][3]; - - VecRotToMat3(vec, phi, tmat); - Mat4One(mat); - Mat4CpyMat3(mat, tmat); -} - -void VecRotToQuat(float *vec, float phi, float *quat) -{ - /* rotation of phi radials around vec */ - float si; - - quat[1]= vec[0]; - quat[2]= vec[1]; - quat[3]= vec[2]; - - if( Normalize(quat+1) == 0.0f) { - QuatOne(quat); - } - else { - quat[0]= (float)cos( phi/2.0 ); - si= (float)sin( phi/2.0 ); - quat[1] *= si; - quat[2] *= si; - quat[3] *= si; - } -} - -/* Return the angle in degrees between vecs 1-2 and 2-3 in degrees - If v1 is a shoulder, v2 is the elbow and v3 is the hand, - this would return the angle at the elbow */ -float VecAngle3(float *v1, float *v2, float *v3) -{ - float vec1[3], vec2[3]; - - VecSubf(vec1, v2, v1); - VecSubf(vec2, v2, v3); - Normalize(vec1); - Normalize(vec2); - - return NormalizedVecAngle2(vec1, vec2) * (float)(180.0/M_PI); -} - -float VecAngle3_2D(float *v1, float *v2, float *v3) -{ - float vec1[2], vec2[2]; - - vec1[0] = v2[0]-v1[0]; - vec1[1] = v2[1]-v1[1]; - - vec2[0] = v2[0]-v3[0]; - vec2[1] = v2[1]-v3[1]; - - Normalize2(vec1); - Normalize2(vec2); - - return NormalizedVecAngle2_2D(vec1, vec2) * (float)(180.0/M_PI); -} - -/* Return the shortest angle in degrees between the 2 vectors */ -float VecAngle2(float *v1, float *v2) -{ - float vec1[3], vec2[3]; - - VecCopyf(vec1, v1); - VecCopyf(vec2, v2); - Normalize(vec1); - Normalize(vec2); - - return NormalizedVecAngle2(vec1, vec2)* (float)(180.0/M_PI); -} - -float NormalizedVecAngle2(float *v1, float *v2) -{ - /* this is the same as acos(Inpf(v1, v2)), but more accurate */ - if (Inpf(v1, v2) < 0.0f) { - float vec[3]; - - vec[0]= -v2[0]; - vec[1]= -v2[1]; - vec[2]= -v2[2]; - - return (float)M_PI - 2.0f*(float)saasin(VecLenf(vec, v1)/2.0f); - } - else - return 2.0f*(float)saasin(VecLenf(v2, v1)/2.0f); -} - -float NormalizedVecAngle2_2D(float *v1, float *v2) -{ - /* this is the same as acos(Inpf(v1, v2)), but more accurate */ - if (Inp2f(v1, v2) < 0.0f) { - float vec[2]; - - vec[0]= -v2[0]; - vec[1]= -v2[1]; - - return (float)M_PI - 2.0f*saasin(Vec2Lenf(vec, v1)/2.0f); - } - else - return 2.0f*(float)saasin(Vec2Lenf(v2, v1)/2.0f); -} - void euler_rot(float *beul, float ang, char axis) { float eul[3], mat1[3][3], mat2[3][3], totmat[3][3]; @@ -3179,6 +3048,140 @@ void Mat3ToCompatibleEul(float mat[][3], float *eul, float *oldrot) } +/* axis angle to 3x3 matrix */ +void VecRotToMat3(float *vec, float phi, float mat[][3]) +{ + /* rotation of phi radials around vec */ + float vx, vx2, vy, vy2, vz, vz2, co, si; + + vx= vec[0]; + vy= vec[1]; + vz= vec[2]; + vx2= vx*vx; + vy2= vy*vy; + vz2= vz*vz; + co= (float)cos(phi); + si= (float)sin(phi); + + mat[0][0]= vx2+co*(1.0f-vx2); + mat[0][1]= vx*vy*(1.0f-co)+vz*si; + mat[0][2]= vz*vx*(1.0f-co)-vy*si; + mat[1][0]= vx*vy*(1.0f-co)-vz*si; + mat[1][1]= vy2+co*(1.0f-vy2); + mat[1][2]= vy*vz*(1.0f-co)+vx*si; + mat[2][0]= vz*vx*(1.0f-co)+vy*si; + mat[2][1]= vy*vz*(1.0f-co)-vx*si; + mat[2][2]= vz2+co*(1.0f-vz2); + +} + +/* axis angle to 4x4 matrix */ +void VecRotToMat4(float *vec, float phi, float mat[][4]) +{ + float tmat[3][3]; + + VecRotToMat3(vec, phi, tmat); + Mat4One(mat); + Mat4CpyMat3(mat, tmat); +} + +/* axis angle to quaternion */ +void VecRotToQuat(float *vec, float phi, float *quat) +{ + /* rotation of phi radials around vec */ + float si; + + quat[1]= vec[0]; + quat[2]= vec[1]; + quat[3]= vec[2]; + + if( Normalize(quat+1) == 0.0f) { + QuatOne(quat); + } + else { + quat[0]= (float)cos( phi/2.0 ); + si= (float)sin( phi/2.0 ); + quat[1] *= si; + quat[2] *= si; + quat[3] *= si; + } +} + +/* Return the angle in degrees between vecs 1-2 and 2-3 in degrees + If v1 is a shoulder, v2 is the elbow and v3 is the hand, + this would return the angle at the elbow */ +float VecAngle3(float *v1, float *v2, float *v3) +{ + float vec1[3], vec2[3]; + + VecSubf(vec1, v2, v1); + VecSubf(vec2, v2, v3); + Normalize(vec1); + Normalize(vec2); + + return NormalizedVecAngle2(vec1, vec2) * (float)(180.0/M_PI); +} + +float VecAngle3_2D(float *v1, float *v2, float *v3) +{ + float vec1[2], vec2[2]; + + vec1[0] = v2[0]-v1[0]; + vec1[1] = v2[1]-v1[1]; + + vec2[0] = v2[0]-v3[0]; + vec2[1] = v2[1]-v3[1]; + + Normalize2(vec1); + Normalize2(vec2); + + return NormalizedVecAngle2_2D(vec1, vec2) * (float)(180.0/M_PI); +} + +/* Return the shortest angle in degrees between the 2 vectors */ +float VecAngle2(float *v1, float *v2) +{ + float vec1[3], vec2[3]; + + VecCopyf(vec1, v1); + VecCopyf(vec2, v2); + Normalize(vec1); + Normalize(vec2); + + return NormalizedVecAngle2(vec1, vec2)* (float)(180.0/M_PI); +} + +float NormalizedVecAngle2(float *v1, float *v2) +{ + /* this is the same as acos(Inpf(v1, v2)), but more accurate */ + if (Inpf(v1, v2) < 0.0f) { + float vec[3]; + + vec[0]= -v2[0]; + vec[1]= -v2[1]; + vec[2]= -v2[2]; + + return (float)M_PI - 2.0f*(float)saasin(VecLenf(vec, v1)/2.0f); + } + else + return 2.0f*(float)saasin(VecLenf(v2, v1)/2.0f); +} + +float NormalizedVecAngle2_2D(float *v1, float *v2) +{ + /* this is the same as acos(Inpf(v1, v2)), but more accurate */ + if (Inp2f(v1, v2) < 0.0f) { + float vec[2]; + + vec[0]= -v2[0]; + vec[1]= -v2[1]; + + return (float)M_PI - 2.0f*saasin(Vec2Lenf(vec, v1)/2.0f); + } + else + return 2.0f*(float)saasin(Vec2Lenf(v2, v1)/2.0f); +} + /* ******************************************** */ void SizeToMat3( float *size, float mat[][3]) @@ -4745,6 +4748,8 @@ void LocQuatSizeToMat4(float mat[][4], float loc[3], float quat[4], float size[3 mat[3][2] = loc[2]; } +/********************************************************/ + /* Tangents */ /* For normal map tangents we need to detect uv boundaries, and only average From a44b9482603daaec9fa012714ddf4a1558c283fe Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 1 Sep 2009 12:18:17 +0000 Subject: [PATCH 381/577] 2.5 - Rotation Orders for Bones [Durian Rigging Request] This commit is the start of an implementation of (euler) rotation orders for Bones (later to be extended to Objects too). Technical details and references can be found at: http://wiki.blender.org/index.php/User:Aligorith/EulerRotationOrder In short, I've added a new set of Euler conversion functions (EulO... and ...EulO), coexisting with the old functions for now, which can handle different rotation orders. Changes have only been made to the basic evaluation code. However, the following places will still need modifications: * Transform code - needs to be made to use functions which take rotation order into account instead of using XYZ only * Rotation constraints - same story * Other rotation editing tools for armatures also need a check up, since there might have been some missing code when I ported eulers earlier --- source/blender/blenkernel/intern/armature.c | 4 +- source/blender/blenlib/BLI_arithb.h | 47 +++- source/blender/blenlib/intern/arithb.c | 217 +++++++++++++++++-- source/blender/editors/transform/transform.c | 2 +- source/blender/makesdna/DNA_action_types.h | 9 +- source/blender/makesrna/intern/rna_pose.c | 9 +- 6 files changed, 254 insertions(+), 34 deletions(-) diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 7b894d79b45..631bc2cb88c 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -1988,9 +1988,9 @@ void chan_calc_mat(bPoseChannel *chan) SizeToMat3(chan->size, smat); /* rotations may either be quats or eulers (no rotation modes for now...) */ - if (chan->rotmode) { + if (chan->rotmode > 0) { /* euler rotations (will cause gimble lock... no rotation order to solve that yet) */ - EulToMat3(chan->eul, rmat); + EulOToMat3(chan->eul, chan->rotmode, rmat); } else { /* quats are normalised before use to eliminate scaling issues */ diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h index 0a0749d3382..4156e3c52ec 100644 --- a/source/blender/blenlib/BLI_arithb.h +++ b/source/blender/blenlib/BLI_arithb.h @@ -174,7 +174,36 @@ void CalcNormShort(short *v1, short *v2, short *v3, float *n); float power_of_2(float val); /** - * @section Euler conversion routines + * @section Euler conversion routines (With Custom Order) + */ + +/* Defines for rotation orders + * WARNING: must match the ePchan_RotMode in DNA_action_types.h + * order matters - types are saved to file! + */ +typedef enum eEulerRotationOrders { + EULER_ORDER_DEFAULT = 1, /* Blender 'default' (classic) is basically XYZ */ + EULER_ORDER_XYZ = 1, /* Blender 'default' (classic) - must be as 1 to sync with PoseChannel rotmode */ + EULER_ORDER_XZY, + EULER_ORDER_YXZ, + EULER_ORDER_YZX, + EULER_ORDER_ZXY, + EULER_ORDER_ZYX, + /* NOTE: there are about 6 more entries when including duplicated entries too */ +} eEulerRotationOrders; + +void EulOToQuat(float eul[3], short order, float quat[4]); + +void EulOToMat3(float eul[3], short order, float Mat[3][3]); +void EulOToMat4(float eul[3], short order, float Mat[4][4]); + +void Mat3ToEulO(float Mat[3][3], float eul[3], short order); +void Mat4ToEulO(float Mat[4][4], float eul[3], short order); + +void QuatToEulO(float quat[4], float eul[3], short order); + +/** + * @section Euler conversion routines (Blender XYZ) */ void EulToMat3(float *eul, float mat[][3]); @@ -185,11 +214,14 @@ void Mat4ToEul(float tmat[][4],float *eul); void EulToQuat(float *eul, float *quat); -void compatible_eul(float *eul, float *oldrot); - void Mat3ToCompatibleEul(float mat[][3], float *eul, float *oldrot); + +void compatible_eul(float *eul, float *oldrot); +void euler_rot(float *beul, float ang, char axis); + + /** * @section Quaternion arithmetic routines */ @@ -216,6 +248,8 @@ void printquat(char *str, float q[4]); void QuatInterpol(float *result, float *quat1, float *quat2, float t); void QuatAdd(float *result, float *quat1, float *quat2, float t); +void QuatToMat3(float *q, float m[][3]); +void QuatToMat4(float *q, float m[][4]); /** * @section matrix multiplication and copying routines @@ -349,8 +383,6 @@ float NormalizedVecAngle2(float *v1, float *v2); float VecAngle3_2D(float *v1, float *v2, float *v3); float NormalizedVecAngle2_2D(float *v1, float *v2); - -void euler_rot(float *beul, float ang, char axis); void NormalShortToFloat(float *out, short *in); void NormalFloatToShort(short *out, float *in); @@ -422,9 +454,6 @@ void VecStar(float mat[][3],float *vec); short EenheidsMat(float mat[][3]); -void QuatToMat3(float *q, float m[][3]); -void QuatToMat4(float *q, float m[][4]); - void Mat3ToQuat_is_ok(float wmat[][3], float *q); void i_ortho(float left, float right, float bottom, float top, float nearClip, float farClip, float matrix[][4]); @@ -435,8 +464,6 @@ void i_rotate(float angle, char axis, float mat[][4]); - - void MinMax3(float *min, float *max, float *vec); void SizeToMat3(float *size, float mat[][3]); void SizeToMat4(float *size, float mat[][4]); diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index 32bacc9472c..e0f17864d73 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -1408,22 +1408,6 @@ void RotationBetweenVectorsToQuat(float *q, float v1[3], float v2[3]) AxisAngleToQuat(q, axis, angle); } -void AxisAngleToQuat(float *q, float *axis, float angle) -{ - float nor[3]; - float si; - - VecCopyf(nor, axis); - Normalize(nor); - - angle /= 2; - si = (float)sin(angle); - q[0] = (float)cos(angle); - q[1] = nor[0] * si; - q[2] = nor[1] * si; - q[3] = nor[2] * si; -} - void vectoquat(float *vec, short axis, short upflag, float *q) { float q2[4], nor[3], *fp, mat[3][3], angle, si, co, x2, y2, z2, len1; @@ -2807,6 +2791,156 @@ void MeanValueWeights(float v[][3], int n, float *co, float *w) /* ************ EULER *************** */ +/* Euler Rotation Order Code: + * was adapted from + ANSI C code from the article + "Euler Angle Conversion" + by Ken Shoemake, shoemake@graphics.cis.upenn.edu + in "Graphics Gems IV", Academic Press, 1994 + * for use in Blender + */ + +/* Type for rotation order info - see wiki for derivation details */ +typedef struct RotOrderInfo { + short i; /* first axis index */ + short j; /* second axis index */ + short k; /* third axis index */ + short parity; /* parity of axis permuation (even=0, odd=1) - 'n' in original code */ +} RotOrderInfo; + +/* Array of info for Rotation Order calculations + * WARNING: must be kept in same order as eEulerRotationOrders + */ +static RotOrderInfo rotOrders[]= { + /* i, j, k, n */ + {0, 1, 2, 0}, // XYZ + {0, 2, 1, 1}, // XZY + {1, 0, 2, 1}, // YXZ + {1, 2, 0, 0}, // YZX + {2, 0, 1, 0}, // ZXY + {2, 1, 0, 1} // ZYZ +}; + +/* Get relevant pointer to rotation order set from the array + * NOTE: since we start at 1 for the values, but arrays index from 0, + * there is -1 factor involved in this process... + */ +#define GET_ROTATIONORDER_INFO(order) (&rotOrders[(order)-1]) + +/* Construct quaternion from Euler angles (in radians). */ +void EulOToQuat(float e[3], short order, float q[4]) +{ + RotOrderInfo *R= GET_ROTATIONORDER_INFO(order); + short i=R->i, j=R->j, k=R->k; + double ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss; + double a[3]; + + if (R->parity) e[1] = -e[1]; + + ti = e[0]/2; tj = e[1]/2; th = e[2]/2; + + ci = cos(ti); cj = cos(tj); ch = cos(th); + si = sin(ti); sj = sin(tj); sh = sin(th); + + cc = ci*ch; cs = ci*sh; + sc = si*ch; ss = si*sh; + + a[i] = cj*sc - sj*cs; + a[j] = cj*ss + sj*cc; + a[k] = cj*cs - sj*sc; + + q[0] = cj*cc + sj*ss; + q[1] = a[0]; + q[2] = a[1]; + q[3] = a[2]; + + if (R->parity) q[j] = -q[j]; +} + +/* Construct 3x3 matrix from Euler angles (in radians). */ +void EulOToMat3(float e[3], short order, float M[3][3]) +{ + RotOrderInfo *R= GET_ROTATIONORDER_INFO(order); + short i=R->i, j=R->j, k=R->k; + double ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss; + + if (R->parity) { + e[0] = -e[0]; + e[1] = -e[1]; + e[2] = -e[2]; + } + + ti = e[0]; tj = e[1]; th = e[2]; + + ci = cos(ti); cj = cos(tj); ch = cos(th); + si = sin(ti); sj = sin(tj); sh = sin(th); + + cc = ci*ch; cs = ci*sh; + sc = si*ch; ss = si*sh; + + M[i][i] = cj*ch; M[j][i] = sj*sc-cs; M[k][i] = sj*cc+ss; + M[i][j] = cj*sh; M[j][j] = sj*ss+cc; M[k][j] = sj*cs-sc; + M[i][k] = -sj; M[j][k] = cj*si; M[k][k] = cj*ci; +} + +/* Construct 4x4 matrix from Euler angles (in radians). */ +void EulOToMat4(float e[3], short order, float M[4][4]) +{ + float m[3][3]; + + /* for now, we'll just do this the slow way (i.e. copying matrices) */ + Mat3Ortho(m); + EulOToMat3(e, order, m); + Mat4CpyMat3(M, m); +} + +/* Convert 3x3 matrix to Euler angles (in radians). */ +void Mat3ToEulO(float M[3][3], float e[3], short order) +{ + RotOrderInfo *R= GET_ROTATIONORDER_INFO(order); + short i=R->i, j=R->j, k=R->k; + double cy = sqrt(M[i][i]*M[i][i] + M[j][i]*M[j][i]); + + if (cy > 16*FLT_EPSILON) { + e[0] = atan2(M[j][k], M[k][k]); + e[1] = atan2(-M[i][k], cy); + e[2] = atan2(M[i][j], M[i][i]); + } + else { + e[0] = atan2(-M[k][j], M[j][j]); + e[1] = atan2(-M[i][k], cy); + e[2] = 0; + } + + if (R->parity) { + e[0] = -e[0]; + e[1] = -e[1]; + e[2] = -e[2]; + } +} + +/* Convert 4x4 matrix to Euler angles (in radians). */ +void Mat4ToEulO(float M[4][4], float e[3], short order) +{ + float m[3][3]; + + /* for now, we'll just do this the slow way (i.e. copying matrices) */ + Mat3CpyMat4(m, M); + Mat3ToEulO(m, e, order); +} + +/* Convert quaternion to Euler angles (in radians). */ +void QuatToEulO(float q[4], float e[3], short order) +{ + float M[3][3]; + + QuatToMat3(q, M); + Mat3ToEulO(M, e, order); +} + +/* ************ EULER (old XYZ) *************** */ + +/* XYZ order */ void EulToMat3( float *eul, float mat[][3]) { double ci, cj, ch, si, sj, sh, cc, cs, sc, ss; @@ -2834,6 +2968,7 @@ void EulToMat3( float *eul, float mat[][3]) } +/* XYZ order */ void EulToMat4( float *eul,float mat[][4]) { double ci, cj, ch, si, sj, sh, cc, cs, sc, ss; @@ -2865,6 +3000,7 @@ void EulToMat4( float *eul,float mat[][4]) } /* returns two euler calculation methods, so we can pick the best */ +/* XYZ order */ static void mat3_to_eul2(float tmat[][3], float *eul1, float *eul2) { float cy, quat[4], mat[3][3]; @@ -2895,6 +3031,7 @@ static void mat3_to_eul2(float tmat[][3], float *eul1, float *eul2) } } +/* XYZ order */ void Mat3ToEul(float tmat[][3], float *eul) { float eul1[3], eul2[3]; @@ -2910,6 +3047,7 @@ void Mat3ToEul(float tmat[][3], float *eul) } } +/* XYZ order */ void Mat4ToEul(float tmat[][4], float *eul) { float tempMat[3][3]; @@ -2919,6 +3057,7 @@ void Mat4ToEul(float tmat[][4], float *eul) Mat3ToEul(tempMat, eul); } +/* XYZ order */ void QuatToEul(float *quat, float *eul) { float mat[3][3]; @@ -2927,7 +3066,7 @@ void QuatToEul(float *quat, float *eul) Mat3ToEul(mat, eul); } - +/* XYZ order */ void EulToQuat(float *eul, float *quat) { float ti, tj, th, ci, cj, ch, si, sj, sh, cc, cs, sc, ss; @@ -2943,6 +3082,7 @@ void EulToQuat(float *eul, float *quat) quat[3] = cj*cs - sj*sc; } +/* XYZ order */ void euler_rot(float *beul, float ang, char axis) { float eul[3], mat1[3][3], mat2[3][3], totmat[3][3]; @@ -2962,6 +3102,7 @@ void euler_rot(float *beul, float ang, char axis) } /* exported to transform.c */ +/* XYZ order */ void compatible_eul(float *eul, float *oldrot) { float dx, dy, dz; @@ -3025,6 +3166,7 @@ void compatible_eul(float *eul, float *oldrot) } /* uses 2 methods to retrieve eulers, and picks the closest */ +/* XYZ order */ void Mat3ToCompatibleEul(float mat[][3], float *eul, float *oldrot) { float eul1[3], eul2[3]; @@ -3048,6 +3190,46 @@ void Mat3ToCompatibleEul(float mat[][3], float *eul, float *oldrot) } +/* ************ AXIS ANGLE *************** */ + +/* Axis angle to Quaternions */ +void AxisAngleToQuat(float *q, float *axis, float angle) +{ + float nor[3]; + float si; + + VecCopyf(nor, axis); + Normalize(nor); + + angle /= 2; + si = (float)sin(angle); + q[0] = (float)cos(angle); + q[1] = nor[0] * si; + q[2] = nor[1] * si; + q[3] = nor[2] * si; +} + +/* Quaternions to Axis Angle */ +void QuatToAxisAngle(float q[4], float axis[3], float *angle) +{ + float ha, si; + + /* calculate angle/2, and sin(angle/2) */ + ha= (float)acos(q[0]); + si= (float)sin(ha); + + /* from half-angle to angle */ + *angle= ha * 2; + + /* prevent division by zero for axis conversion */ + if (fabs(si) < 0.0005) + si= 1.0f; + + axis[0]= q[1] / si; + axis[1]= q[2] / si; + axis[2]= q[3] / si; +} + /* axis angle to 3x3 matrix */ void VecRotToMat3(float *vec, float phi, float mat[][3]) { @@ -4704,6 +4886,7 @@ float PdistVL3Dfl(float *v1, float *v2, float *v3) /* make a 4x4 matrix out of 3 transform components */ /* matrices are made in the order: scale * rot * loc */ +// TODO: need to have a version that allows for rotation order... void LocEulSizeToMat4(float mat[][4], float loc[3], float eul[3], float size[3]) { float rmat[3][3], smat[3][3], tmat[3][3]; diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index dd7cebdfe3f..4a376f35552 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -2670,7 +2670,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short /* this function works on end result */ protectedQuaternionBits(td->protectflag, td->ext->quat, td->ext->iquat); } - else { + else { // TODO: need some methods for the new euler types... float eulmat[3][3]; Mat3MulMat3(totmat, mat, td->mtx); diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h index c9d75d5c262..474d5a4217f 100644 --- a/source/blender/makesdna/DNA_action_types.h +++ b/source/blender/makesdna/DNA_action_types.h @@ -199,8 +199,13 @@ typedef enum ePchan_IkFlag { typedef enum ePchan_RotMode { /* quaternion rotations (default, and for older Blender versions) */ PCHAN_ROT_QUAT = 0, - /* euler rotations (xyz only) */ - PCHAN_ROT_EUL, + /* euler rotations - keep in sync with enum in BLI_arithb.h */ + PCHAN_ROT_XYZ = 1, /* Blender 'default' (classic) - must be as 1 to sync with PoseChannel rotmode */ + PCHAN_ROT_XZY, + PCHAN_ROT_YXZ, + PCHAN_ROT_YZX, + PCHAN_ROT_ZXY, + PCHAN_ROT_ZYX, } ePchan_RotMode; /* Pose ------------------------------------ */ diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index bfebc5ee49f..727e3ff6a6d 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -124,7 +124,7 @@ static void rna_PoseChannel_euler_rotation_set(PointerRNA *ptr, const float *val { bPoseChannel *pchan= ptr->data; - if(pchan->rotmode == PCHAN_ROT_QUAT) + if(pchan->rotmode == PCHAN_ROT_QUAT) /* default XYZ eulers when using quats... */ EulToQuat((float*)value, pchan->quat); else VECCOPY(pchan->eul, value); @@ -353,7 +353,12 @@ static void rna_def_pose_channel(BlenderRNA *brna) { static EnumPropertyItem prop_rotmode_items[] = { {PCHAN_ROT_QUAT, "QUATERNION", 0, "Quaternion (WXYZ)", "No Gimbal Lock (default)"}, - {PCHAN_ROT_EUL, "EULER", 0, "Euler (XYZ)", "Prone to Gimbal Lock"}, + {PCHAN_ROT_XYZ, "XYZ", 0, "XYZ Euler", "XYZ Rotation Order. Prone to Gimbal Lock"}, + {PCHAN_ROT_XZY, "XZY", 0, "XZY Euler", "XZY Rotation Order. Prone to Gimbal Lock"}, + {PCHAN_ROT_YXZ, "YXZ", 0, "YXZ Euler", "YXZ Rotation Order. Prone to Gimbal Lock"}, + {PCHAN_ROT_YZX, "YZX", 0, "YZX Euler", "YZX Rotation Order. Prone to Gimbal Lock"}, + {PCHAN_ROT_ZXY, "ZXY", 0, "ZXY Euler", "ZXY Rotation Order. Prone to Gimbal Lock"}, + {PCHAN_ROT_ZYX, "ZYX", 0, "ZYX Euler", "ZYX Rotation Order. Prone to Gimbal Lock"}, {0, NULL, 0, NULL, NULL}}; StructRNA *srna; From 9965e8915d9121fae88aaa98990f714b3c2670bf Mon Sep 17 00:00:00 2001 From: William Reynish Date: Tue, 1 Sep 2009 12:41:06 +0000 Subject: [PATCH 382/577] Added the old Edge settings to scene properties. This old feature is really quite terrible as it isn't even resolution independent - the edge width should be relative to the image dimensions. Adjusted layout for sound in sequencer and a few other minor tweaks. --- release/ui/buttons_scene.py | 32 ++++++++++++++-------- release/ui/space_sequencer.py | 25 +++++++++++------ source/blender/makesrna/intern/rna_scene.c | 4 +-- 3 files changed, 38 insertions(+), 23 deletions(-) diff --git a/release/ui/buttons_scene.py b/release/ui/buttons_scene.py index 126afc4ef23..d8b2b51751b 100644 --- a/release/ui/buttons_scene.py +++ b/release/ui/buttons_scene.py @@ -189,20 +189,28 @@ class SCENE_PT_post_processing(RenderButtonsPanel): col = split.column() col.itemR(rd, "use_compositing") col.itemR(rd, "use_sequencer") - + col = split.column() - row = col.row() - row.itemR(rd, "fields", text="Fields") - sub = row.row() - sub.active = rd.fields - sub.itemR(rd, "fields_still", text="Still") - sub = col.row() - sub.active = rd.fields - sub.itemR(rd, "field_order", expand=True) - + col.itemR(rd, "dither_intensity", text="Dither", slider=True) + + layout.itemS() + split = layout.split() - split.itemL() - split.itemR(rd, "dither_intensity", text="Dither", slider=True) + + col = split.column() + col.itemR(rd, "fields", text="Fields") + sub = col.column() + sub.active = rd.fields + sub.row().itemR(rd, "field_order", expand=True) + sub.itemR(rd, "fields_still", text="Still") + + col = split.column() + + col.itemR(rd, "edge") + sub = col.column() + sub.active = rd.edge + sub.itemR(rd, "edge_threshold", text="Threshold", slider=True) + sub.itemR(rd, "edge_color", text="") class SCENE_PT_output(RenderButtonsPanel): __label__ = "Output" diff --git a/release/ui/space_sequencer.py b/release/ui/space_sequencer.py index 87111b2925f..bef48f5ebdb 100644 --- a/release/ui/space_sequencer.py +++ b/release/ui/space_sequencer.py @@ -303,6 +303,7 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel): row.itemR(strip, "frame_locked", text="Frame Lock") col = layout.column() + col.enabled = not strip.lock col.itemR(strip, "channel") col.itemR(strip, "start_frame") col.itemR(strip, "length") @@ -422,16 +423,21 @@ class SEQUENCER_PT_input(SequencerButtonsPanel): strip = act_strip(context) - layout.itemR(strip, "directory", text="") + split = layout.split(percentage=0.2) + col = split.column() + col.itemL(text="Path:") + col = split.column() + col.itemR(strip, "directory", text="") # Current element for the filename - split = layout.split(percentage=0.3) - col = split.column() - col.itemL(text="File Name:") - col = split.column() + elem = strip.getStripElem(context.scene.current_frame) if elem: + split = layout.split(percentage=0.2) + col = split.column() + col.itemL(text="File:") + col = split.column() col.itemR(elem, "filename", text="") # strip.elements[0] could be a fallback if strip.type != 'SOUND': @@ -477,14 +483,15 @@ class SEQUENCER_PT_sound(SequencerButtonsPanel): layout.template_ID(strip, "sound", new="sound.open") layout.itemS() + layout.itemR(strip.sound, "filename", text="") + row = layout.row() if strip.sound.packed_file: - layout.itemO("sound.unpack") + row.itemO("sound.unpack", icon='ICON_PACKAGE', text="Unpack") else: - layout.itemO("sound.pack") + row.itemO("sound.pack", icon='ICON_UGLYPACKAGE', text="Pack") - layout.itemR(strip.sound, "filename") - layout.itemR(strip.sound, "caching") + row.itemR(strip.sound, "caching") class SEQUENCER_PT_filter(SequencerButtonsPanel): __label__ = "Filter" diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 02b891c6cd2..935bf8ccc3f 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1621,10 +1621,10 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Edge", "Create a toon outline around the edges of geometry"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); - prop= RNA_def_property(srna, "edge_intensity", PROP_INT, PROP_NONE); + prop= RNA_def_property(srna, "edge_threshold", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "edgeint"); RNA_def_property_range(prop, 0, 255); - RNA_def_property_ui_text(prop, "Edge Intensity", "Threshold for drawing outlines on geometry edges"); + RNA_def_property_ui_text(prop, "Edge Threshold", "Threshold for drawing outlines on geometry edges"); RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL); prop= RNA_def_property(srna, "edge_color", PROP_FLOAT, PROP_COLOR); From add244bca8259e171155be6917307136fcb8e2c8 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Tue, 1 Sep 2009 14:59:50 +0000 Subject: [PATCH 383/577] 2.5 Buttons: * Fix for Point Density Texture panel. "System" label was there before the pointer button showed up. (For Source Type Particle System.) --- release/ui/buttons_scene.py | 1 - release/ui/buttons_texture.py | 32 +++++++++++++++++--------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/release/ui/buttons_scene.py b/release/ui/buttons_scene.py index d8b2b51751b..3c321f11f6e 100644 --- a/release/ui/buttons_scene.py +++ b/release/ui/buttons_scene.py @@ -205,7 +205,6 @@ class SCENE_PT_post_processing(RenderButtonsPanel): sub.itemR(rd, "fields_still", text="Still") col = split.column() - col.itemR(rd, "edge") sub = col.column() sub.active = rd.edge diff --git a/release/ui/buttons_texture.py b/release/ui/buttons_texture.py index ee3f85e15ef..90ce40b4832 100644 --- a/release/ui/buttons_texture.py +++ b/release/ui/buttons_texture.py @@ -665,27 +665,21 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel): if pd.point_source == 'PARTICLE_SYSTEM': col.itemL(text="Object:") col.itemR(pd, "object", text="") - col = col.column() - col.enabled = pd.object - col.itemL(text="System:") - col.item_pointerR(pd, "particle_system", pd.object, "particle_systems", text="") - col.itemL(text="Cache:") - col.itemR(pd, "particle_cache", text="") + + sub = col.column() + sub.enabled = pd.object + if pd.object: + sub.itemL(text="System:") + sub.item_pointerR(pd, "particle_system", pd.object, "particle_systems", text="") + sub.itemL(text="Cache:") + sub.itemR(pd, "particle_cache", text="") else: col.itemL(text="Object:") col.itemR(pd, "object", text="") col.itemL(text="Cache:") col.itemR(pd, "vertices_cache", text="") - sub = split.column() - - sub.itemL() - sub.itemR(pd, "radius") - - sub.itemL(text="Falloff:") - sub.itemR(pd, "falloff", text="") - if pd.falloff == 'SOFT': - sub.itemR(pd, "falloff_softness") + col.itemS() col.itemL(text="Color Source:") col.itemR(pd, "color_source", text="") @@ -694,6 +688,14 @@ class TEXTURE_PT_pointdensity(TextureButtonsPanel): if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_AGE'): layout.template_color_ramp(pd.color_ramp, expand=True) + col = split.column() + col.itemL() + col.itemR(pd, "radius") + col.itemL(text="Falloff:") + col.itemR(pd, "falloff", text="") + if pd.falloff == 'SOFT': + col.itemR(pd, "falloff_softness") + class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel): __label__ = "Turbulence" From 6d5f824518cdbf8bf710096ab369624d12d23037 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 1 Sep 2009 16:37:23 +0000 Subject: [PATCH 384/577] - enum for convex hull and triangle mesh were swapped - python pedantry --- release/ui/space_time.py | 4 ++-- release/ui/space_view3d.py | 22 ++++++++++----------- source/blender/makesrna/intern/rna_object.c | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/release/ui/space_time.py b/release/ui/space_time.py index 81681e42d92..bb82eea3272 100644 --- a/release/ui/space_time.py +++ b/release/ui/space_time.py @@ -141,8 +141,8 @@ class TIME_MT_autokey(bpy.types.Menu): layout.active = tools.enable_auto_key - layout.item_enumR(tools, "autokey_mode", "ADD_REPLACE_KEYS") - layout.item_enumR(tools, "autokey_mode", "REPLACE_KEYS") + layout.item_enumR(tools, "autokey_mode", 'ADD_REPLACE_KEYS') + layout.item_enumR(tools, "autokey_mode", 'REPLACE_KEYS') bpy.types.register(TIME_HT_header) bpy.types.register(TIME_MT_view) diff --git a/release/ui/space_view3d.py b/release/ui/space_view3d.py index 5801f9e7941..c5c1abf1d40 100644 --- a/release/ui/space_view3d.py +++ b/release/ui/space_view3d.py @@ -42,7 +42,7 @@ class VIEW3D_HT_header(bpy.types.Header): # ********** Utilities ********** class VIEW3D_MT_showhide(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Show/Hide" _operator_name = "" @@ -54,7 +54,7 @@ class VIEW3D_MT_showhide(bpy.types.Menu): layout.item_booleanO("%s.hide" % self._operator_name, "unselected", True, text="Hide Unselected") class VIEW3D_MT_snap(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Snap" def draw(self, context): @@ -136,7 +136,7 @@ class VIEW3D_MT_view_navigation(bpy.types.Menu): layout.item_floatO("view3d.zoom", "delta", -1.0, text="Zoom Out") class VIEW3D_MT_view_align(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Align View" def draw(self, context): @@ -145,7 +145,7 @@ class VIEW3D_MT_view_align(bpy.types.Menu): layout.itemO("view3d.view_center") class VIEW3D_MT_view_cameras(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Cameras" def draw(self, context): @@ -580,7 +580,7 @@ class VIEW3D_MT_PARTICLE_showhide(VIEW3D_MT_showhide): # ********** Pose Menu ********** class VIEW3D_MT_POSE(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Pose" def draw(self, context): @@ -638,7 +638,7 @@ class VIEW3D_MT_POSE(bpy.types.Menu): layout.item_menu_enumO("pose.flags_set", 'mode', text="Bone Settings") class VIEW3D_MT_POSE_transform(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Clear Transform" def draw(self, context): @@ -653,7 +653,7 @@ class VIEW3D_MT_POSE_transform(bpy.types.Menu): layout.itemL(text="Origin") class VIEW3D_MT_POSE_pose(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Pose Library" def draw(self, context): @@ -668,7 +668,7 @@ class VIEW3D_MT_POSE_pose(bpy.types.Menu): layout.itemO("poselib.pose_remove", text="Remove Pose...") class VIEW3D_MT_POSE_motion(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Motion Paths" def draw(self, context): @@ -678,7 +678,7 @@ class VIEW3D_MT_POSE_motion(bpy.types.Menu): layout.itemO("pose.paths_clear", text="Clear") class VIEW3D_MT_POSE_group(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Bone Groups" def draw(self, context): @@ -693,7 +693,7 @@ class VIEW3D_MT_POSE_group(bpy.types.Menu): class VIEW3D_MT_POSE_ik(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Inverse Kinematics" def draw(self, context): @@ -703,7 +703,7 @@ class VIEW3D_MT_POSE_ik(bpy.types.Menu): layout.itemO("pose.ik_clear") class VIEW3D_MT_POSE_constraints(bpy.types.Menu): - __space_type__ = "VIEW_3D" + __space_type__ = 'VIEW_3D' __label__ = "Constraints" def draw(self, context): diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 0535ae131bc..bbb10991564 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -774,8 +774,8 @@ static void rna_def_object_game_settings(BlenderRNA *brna) {OB_BOUND_SPHERE, "SPHERE", 0, "Sphere", ""}, {OB_BOUND_CYLINDER, "CYLINDER", 0, "Cylinder", ""}, {OB_BOUND_CONE, "CONE", 0, "Cone", ""}, - {OB_BOUND_POLYH, "CONVEX_HULL", 0, "Convex Hull", ""}, - {OB_BOUND_POLYT, "TRIANGLE_MESH", 0, "Triangle Mesh", ""}, + {OB_BOUND_POLYT, "CONVEX_HULL", 0, "Convex Hull", ""}, + {OB_BOUND_POLYH, "TRIANGLE_MESH", 0, "Triangle Mesh", ""}, //{OB_DYN_MESH, "DYNAMIC_MESH", 0, "Dynamic Mesh", ""}, {0, NULL, 0, NULL, NULL}}; From 83e9144ff0e077c2d9ffd3c0e1b0c2327eb3e497 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 1 Sep 2009 17:10:56 +0000 Subject: [PATCH 385/577] 2.5 Background picture used bad scissor/viewport code, causing bad drawing on tool region. --- source/blender/editors/space_view3d/view3d_draw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 4ca1f296f15..66113ec4941 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1421,7 +1421,8 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d) glMatrixMode(GL_MODELVIEW); glPushMatrix(); - glaDefine2DArea(&ar->winrct); +// glaDefine2DArea(&ar->winrct); + ED_region_pixelspace(ar); glEnable(GL_BLEND); From 3bc5d87e5001453f05f9f14c0326dc87727982fa Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Tue, 1 Sep 2009 17:31:33 +0000 Subject: [PATCH 386/577] 2.5 Bugfix: new ALT+LMB pan in 2d windows hanged eternally; the modal keymaps didnt support this yet. Is on todo; but fix is easy for now. Also don't know if this is the right way to do it... systems with MMB can also get it as macro (like action mouse, select mouse). --- source/blender/editors/interface/view2d_ops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 1e8cda68e6d..f3610769d17 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -235,6 +235,7 @@ static int view_pan_modal(bContext *C, wmOperator *op, wmEvent *event) } break; + case LEFTMOUSE: case MIDDLEMOUSE: if (event->val==0) { /* calculate overall delta mouse-movement for redo */ @@ -826,6 +827,7 @@ static int view_zoomdrag_modal(bContext *C, wmOperator *op, wmEvent *event) } break; + case LEFTMOUSE: case MIDDLEMOUSE: if (event->val==0) { /* for redo, store the overall deltas - need to respect zoom-locks here... */ From 3f5115064aea902b3f6886dc688e7a20d771a212 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Tue, 1 Sep 2009 23:32:34 +0000 Subject: [PATCH 387/577] == SCons == * Add BGE_CXXFLAGS so we can get rid of hard-coded BGE compiler settings. This was only done for windows, but now linuxers and osxers should be able to set BGE-specific optimisation too. See the windows default configs for example. --- config/win32-vc-config.py | 1 + config/win64-vc-config.py | 1 + source/gameengine/BlenderRoutines/SConscript | 8 +------- source/gameengine/Converter/SConscript | 2 +- source/gameengine/Expressions/SConscript | 8 +------- source/gameengine/GameLogic/SConscript | 6 +----- source/gameengine/GamePlayer/common/SConscript | 8 +------- source/gameengine/GamePlayer/ghost/SConscript | 12 +++--------- source/gameengine/Ketsji/KXNetwork/SConscript | 9 +-------- source/gameengine/Ketsji/SConscript | 6 +----- source/gameengine/Physics/Bullet/SConscript | 8 +------- source/gameengine/Physics/common/SConscript | 8 +------- .../Rasterizer/RAS_OpenGLRasterizer/SConscript | 8 +------- source/gameengine/Rasterizer/SConscript | 8 +------- source/gameengine/SceneGraph/SConscript | 8 +------- source/gameengine/VideoTexture/SConscript | 7 +------ tools/btools.py | 2 ++ 17 files changed, 20 insertions(+), 90 deletions(-) diff --git a/config/win32-vc-config.py b/config/win32-vc-config.py index c50f41b6d4b..5c4342d4f30 100644 --- a/config/win32-vc-config.py +++ b/config/win32-vc-config.py @@ -149,6 +149,7 @@ CXX = 'cl.exe' CCFLAGS = ['/nologo', '/Ob1', '/J', '/W3', '/Gd', '/wd4244', '/wd4305', '/wd4800', '/wd4065', '/wd4267'] CXXFLAGS = ['/EHsc'] +BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast'] BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr'] diff --git a/config/win64-vc-config.py b/config/win64-vc-config.py index ed08e578df8..abc90c84f33 100644 --- a/config/win64-vc-config.py +++ b/config/win64-vc-config.py @@ -163,6 +163,7 @@ CXX = 'cl.exe' CFLAGS = [] CCFLAGS = ['/nologo', '/Ob1', '/J', '/W3', '/Gd', '/wd4244', '/wd4305', '/wd4800', '/wd4065', '/wd4267'] CXXFLAGS = ['/EHsc'] +BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast'] BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr'] diff --git a/source/gameengine/BlenderRoutines/SConscript b/source/gameengine/BlenderRoutines/SConscript index eb5f2a76e10..dc5a93a2e48 100644 --- a/source/gameengine/BlenderRoutines/SConscript +++ b/source/gameengine/BlenderRoutines/SConscript @@ -28,10 +28,4 @@ incs += ' ' + env['BF_PYTHON_INC'] incs += ' ' + env['BF_BULLET_INC'] incs += ' ' + env['BF_OPENGL_INC'] -cxxflags = [] -if env['OURPLATFORM'] in ('win32-vc','win64-vc'): - cxxflags.append ('/GR') - cxxflags.append ('/O2') - cxxflags.append ('/EHsc') - -env.BlenderLib ( 'bf_bloutines', sources, Split(incs), defs, libtype=['core', 'player'], priority=[300, 45] , cxx_compileflags=cxxflags) +env.BlenderLib ( 'bf_bloutines', sources, Split(incs), defs, libtype=['core', 'player'], priority=[300, 45] , cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Converter/SConscript b/source/gameengine/Converter/SConscript index 7d3185605d5..9164a9f6d78 100644 --- a/source/gameengine/Converter/SConscript +++ b/source/gameengine/Converter/SConscript @@ -23,4 +23,4 @@ incs += ' #source/blender/makesrna' incs += ' ' + env['BF_PYTHON_INC'] incs += ' ' + env['BF_BULLET_INC'] -env.BlenderLib ( 'bf_converter', sources, Split(incs), defs, libtype=['core','player'], priority=[305,50] ) +env.BlenderLib ( 'bf_converter', sources, Split(incs), defs, libtype=['core','player'], priority=[305,50], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Expressions/SConscript b/source/gameengine/Expressions/SConscript index 69f87ffbb90..dc9c184fd8a 100644 --- a/source/gameengine/Expressions/SConscript +++ b/source/gameengine/Expressions/SConscript @@ -6,10 +6,4 @@ sources = env.Glob('*.cpp') incs ='. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/SceneGraph #source/blender/blenloader' incs += ' ' + env['BF_PYTHON_INC'] -cxxflags = [] -if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): - cxxflags.append ('/GR') - cxxflags.append ('/O2') - cxxflags.append ('/EHsc') - -env.BlenderLib ( 'bf_expressions', sources, Split(incs), [], libtype=['core','player'], priority = [360,120], cxx_compileflags=cxxflags) +env.BlenderLib ( 'bf_expressions', sources, Split(incs), [], libtype=['core','player'], priority = [360,120], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/GameLogic/SConscript b/source/gameengine/GameLogic/SConscript index 837769e5e78..f259a338dc0 100644 --- a/source/gameengine/GameLogic/SConscript +++ b/source/gameengine/GameLogic/SConscript @@ -17,12 +17,8 @@ if env['WITH_BF_SDL']: else: defs.append('DISABLE_SDL') -cxxflags = [] if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): - cxxflags.append ('/GR') - cxxflags.append ('/O2') - cxxflags.append ('/EHsc') if env['BF_DEBUG']: defs.append('_DEBUG') -env.BlenderLib ( 'bf_logic', sources, Split(incs), defs, libtype=['core','player'], priority=[330, 100], cxx_compileflags=cxxflags ) +env.BlenderLib ( 'bf_logic', sources, Split(incs), defs, libtype=['core','player'], priority=[330, 100], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/GamePlayer/common/SConscript b/source/gameengine/GamePlayer/common/SConscript index 1942cde2531..3ac2576b46d 100644 --- a/source/gameengine/GamePlayer/common/SConscript +++ b/source/gameengine/GamePlayer/common/SConscript @@ -62,10 +62,4 @@ incs += Split(env['BF_PYTHON_INC']) incs += Split(env['BF_PNG_INC']) incs += Split(env['BF_ZLIB_INC']) -cxxflags = [] -if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): - cxxflags.append ('/GR') - cxxflags.append ('/O2') - cxxflags.append ('/EHsc') - -env.BlenderLib (libname='gp_common', sources=source_files, includes=incs, defines = [], libtype='player', priority=5, cxx_compileflags=cxxflags) +env.BlenderLib (libname='gp_common', sources=source_files, includes=incs, defines = [], libtype='player', priority=5, cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/GamePlayer/ghost/SConscript b/source/gameengine/GamePlayer/ghost/SConscript index 83bc61381c0..ce8b07b9393 100644 --- a/source/gameengine/GamePlayer/ghost/SConscript +++ b/source/gameengine/GamePlayer/ghost/SConscript @@ -42,14 +42,8 @@ incs = ['.', incs += Split(env['BF_PYTHON_INC']) -cxxflags = [] -if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): - cxxflags.append ('/GR') - cxxflags.append ('/O2') - cxxflags.append ('/EHsc') - -defs = '' +defs = [] if env['WITH_BF_FFMPEG']: - defs += ' WITH_FFMPEG' + defs.append('WITH_FFMPEG') -env.BlenderLib (libname='gp_ghost', sources=source_files, includes = incs, defines = Split(defs), libtype='player',priority=5, cxx_compileflags=cxxflags) +env.BlenderLib (libname='gp_ghost', sources=source_files, includes = incs, defines = defs, libtype='player',priority=5, cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Ketsji/KXNetwork/SConscript b/source/gameengine/Ketsji/KXNetwork/SConscript index e6584b55ed2..ce4a29b9492 100644 --- a/source/gameengine/Ketsji/KXNetwork/SConscript +++ b/source/gameengine/Ketsji/KXNetwork/SConscript @@ -9,11 +9,4 @@ incs += ' #source/gameengine/Network #source/gameengine/SceneGraph' incs += ' ' + env['BF_PYTHON_INC'] -cxxflags = [] -if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): - cxxflags.append ('/GR') - cxxflags.append ('/O2') - cxxflags.append ('/EHsc') - - -env.BlenderLib ( 'kx_network', Split(sources), Split(incs), defines=[],libtype=['core', 'player'], priority=[400, 145], cxx_compileflags=cxxflags ) +env.BlenderLib ( 'kx_network', Split(sources), Split(incs), defines=[],libtype=['core', 'player'], priority=[400, 145], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript index d3b67cfdb11..ea9d32fa0bf 100644 --- a/source/gameengine/Ketsji/SConscript +++ b/source/gameengine/Ketsji/SConscript @@ -29,12 +29,8 @@ if env['WITH_BF_SDL']: else: defs.append('DISABLE_SDL') -cxxflags = [] if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): - cxxflags.append ('/GR') - cxxflags.append ('/O2') - cxxflags.append ('/EHsc') if env['BF_DEBUG']: defs.append('_DEBUG') # for Python -env.BlenderLib ( 'bf_ketsji', sources, Split(incs), defs, libtype=['core','player'], priority=[320, 60], cxx_compileflags = cxxflags ) +env.BlenderLib ( 'bf_ketsji', sources, Split(incs), defs, libtype=['core','player'], priority=[320, 60], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Physics/Bullet/SConscript b/source/gameengine/Physics/Bullet/SConscript index 44b75402630..0b797c2cb8b 100644 --- a/source/gameengine/Physics/Bullet/SConscript +++ b/source/gameengine/Physics/Bullet/SConscript @@ -21,10 +21,4 @@ incs += ' #intern/guardedalloc' incs += ' ' + env['BF_BULLET_INC'] incs += ' ' + env['BF_PYTHON_INC'] -cxxflags = [] -if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): - cxxflags.append ('/GR') - cxxflags.append ('/O2') - cxxflags.append ('/EHsc') - -env.BlenderLib ( 'bf_bullet', Split(sources), Split(incs), [], libtype=['core','player'], priority=[350,80], cxx_compileflags=cxxflags ) +env.BlenderLib ( 'bf_bullet', Split(sources), Split(incs), [], libtype=['core','player'], priority=[350,80], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Physics/common/SConscript b/source/gameengine/Physics/common/SConscript index 447b0ec1bbb..8b373ec830c 100644 --- a/source/gameengine/Physics/common/SConscript +++ b/source/gameengine/Physics/common/SConscript @@ -5,10 +5,4 @@ sources = 'PHY_IMotionState.cpp PHY_IController.cpp PHY_IPhysicsController.cpp P incs = '. ../Dummy #intern/moto/include' -cxxflags = [] -if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): - cxxflags.append ('/GR') - cxxflags.append ('/O2') - cxxflags.append ('/EHsc') - -env.BlenderLib ( 'bf_common', Split(sources), Split(incs), [], libtype=['core','player'], priority=[360, 90], cxx_compileflags = cxxflags ) +env.BlenderLib ( 'bf_common', Split(sources), Split(incs), [], libtype=['core','player'], priority=[360, 90], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript index e206c90ea25..963c6616b64 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript @@ -8,10 +8,4 @@ incs += ' #source/blender/gpu #extern/glew/include ' + env['BF_OPENGL_INC'] incs += ' #source/blender/gameengine/Ketsji #source/gameengine/SceneGraph #source/blender/makesdna #source/blender/blenkernel' incs += ' #intern/guardedalloc #source/blender/blenlib' -cxxflags = [] -if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): - cxxflags.append ('/GR') - cxxflags.append ('/O2') - cxxflags.append ('/EHsc') - -env.BlenderLib ( 'bf_oglrasterizer', Split(sources), Split(incs), [], libtype=['core','player'], priority=[350, 115], cxx_compileflags = cxxflags ) +env.BlenderLib ( 'bf_oglrasterizer', Split(sources), Split(incs), [], libtype=['core','player'], priority=[350, 115], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Rasterizer/SConscript b/source/gameengine/Rasterizer/SConscript index 255131f9a44..c2af14e8ce5 100644 --- a/source/gameengine/Rasterizer/SConscript +++ b/source/gameengine/Rasterizer/SConscript @@ -7,10 +7,4 @@ sources = env.Glob('*.cpp') incs = '. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/BlenderRoutines #extern/glew/include #source/gameengine/Expressions #source/gameengine/SceneGraph #source/blender/blenkernel #source/blender/makesdna' incs += ' ' + env['BF_PYTHON_INC'] -cxxflags = [] -if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): - cxxflags.append ('/GR') - cxxflags.append ('/O2') - cxxflags.append ('/EHsc') - -env.BlenderLib ( 'bf_rasterizer', sources, Split(incs), [], libtype=['core','player'], priority=[350,115], cxx_compileflags = cxxflags ) +env.BlenderLib ( 'bf_rasterizer', sources, Split(incs), [], libtype=['core','player'], priority=[350,115], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/SceneGraph/SConscript b/source/gameengine/SceneGraph/SConscript index b3db50117f1..8f433a21e49 100644 --- a/source/gameengine/SceneGraph/SConscript +++ b/source/gameengine/SceneGraph/SConscript @@ -6,10 +6,4 @@ sources = env.Glob('*.cpp') incs = '. #intern/moto/include' -cxxflags = [] -if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): - cxxflags.append ('/GR') - cxxflags.append ('/O2') - cxxflags.append ('/EHsc') - -env.BlenderLib ( 'bf_scenegraph', sources, Split(incs), [], libtype=['core','player'], priority=[325,125], cxx_compileflags = cxxflags ) +env.BlenderLib ( 'bf_scenegraph', sources, Split(incs), [], libtype=['core','player'], priority=[325,125], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/VideoTexture/SConscript b/source/gameengine/VideoTexture/SConscript index d6b78f6d1a6..583ccf29dbd 100644 --- a/source/gameengine/VideoTexture/SConscript +++ b/source/gameengine/VideoTexture/SConscript @@ -15,15 +15,10 @@ incs += ' #source/blender/gpu #source/kernel/gen_system #intern/string #intern/m incs += ' #intern/guardedalloc #extern/glew/include' defs = [] -cxxflags = [] if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): - cxxflags.append ('/GR') - cxxflags.append ('/O2') - cxxflags.append ('/EHsc') if env['BF_DEBUG']: defs.append('_DEBUG') - incs += ' ' + env['BF_PYTHON_INC'] #incs += ' ' + env['BF_OPENGL_INC'] @@ -32,4 +27,4 @@ if env['WITH_BF_FFMPEG']: incs += ' ' + env['BF_FFMPEG_INC'] + ' ' + env['BF_PTHREADS_INC'] defs.append('__STDC_CONSTANT_MACROS') -env.BlenderLib ( 'bf_videotex', sources, Split(incs), defs, libtype=['core','player'], priority=[300, 72], cxx_compileflags = cxxflags ) +env.BlenderLib ( 'bf_videotex', sources, Split(incs), defs, libtype=['core','player'], priority=[300, 72], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/tools/btools.py b/tools/btools.py index 1ae952adbc7..580a457e3a0 100755 --- a/tools/btools.py +++ b/tools/btools.py @@ -77,6 +77,7 @@ def validate_arguments(args, bc): 'BF_OPENGL_LINKFLAGS', 'CFLAGS', 'CCFLAGS', 'CXXFLAGS', 'CPPFLAGS', 'REL_CFLAGS', 'REL_CCFLAGS', 'REL_CXXFLAGS', + 'BGE_CXXFLAGS', 'BF_PROFILE_CFLAGS', 'BF_PROFILE_CCFLAGS', 'BF_PROFILE_CXXFLAGS', 'BF_PROFILE_LINKFLAGS', 'BF_DEBUG_CFLAGS', 'BF_DEBUG_CCFLAGS', 'BF_DEBUG_CXXFLAGS', 'C_WARN', 'CC_WARN', 'CXX_WARN', @@ -333,6 +334,7 @@ def read_opts(cfg, args): ('CFLAGS', 'C only flags', ''), ('CCFLAGS', 'Generic C and C++ flags', ''), ('CXXFLAGS', 'C++ only flags', ''), + ('BGE_CXXFLAGS', 'C++ only flags for BGE', ''), ('CPPFLAGS', 'Defines', ''), ('REL_CFLAGS', 'C only release flags', ''), ('REL_CCFLAGS', 'Generic C and C++ release flags', ''), From d89e1eb437e7a78cc91cb71d25bfc30f93f272b3 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Tue, 1 Sep 2009 23:43:00 +0000 Subject: [PATCH 388/577] * BGE optimisation tweaks. --- config/win32-vc-config.py | 2 +- config/win64-vc-config.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/win32-vc-config.py b/config/win32-vc-config.py index 5c4342d4f30..1e993565e98 100644 --- a/config/win32-vc-config.py +++ b/config/win32-vc-config.py @@ -149,7 +149,7 @@ CXX = 'cl.exe' CCFLAGS = ['/nologo', '/Ob1', '/J', '/W3', '/Gd', '/wd4244', '/wd4305', '/wd4800', '/wd4065', '/wd4267'] CXXFLAGS = ['/EHsc'] -BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast'] +BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast', '/arch:SSE'] BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr'] diff --git a/config/win64-vc-config.py b/config/win64-vc-config.py index abc90c84f33..ce2fd8cd405 100644 --- a/config/win64-vc-config.py +++ b/config/win64-vc-config.py @@ -163,7 +163,7 @@ CXX = 'cl.exe' CFLAGS = [] CCFLAGS = ['/nologo', '/Ob1', '/J', '/W3', '/Gd', '/wd4244', '/wd4305', '/wd4800', '/wd4065', '/wd4267'] CXXFLAGS = ['/EHsc'] -BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast'] +BGE_CXXFLAGS = ['/O2', '/EHsc', '/GR', '/fp:fast', '/arch:SSE2'] BF_DEBUG_CCFLAGS = ['/Zi', '/FR${TARGET}.sbr'] From f77fc5c3c9461dce9c694e35db736777214f8b2d Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Wed, 2 Sep 2009 00:07:55 +0000 Subject: [PATCH 389/577] support for multiple file: linked libraries --- release/io/netrender/client.py | 2 +- release/io/netrender/master.py | 207 ++++++++++++++++++++------------- release/io/netrender/slave.py | 20 +--- release/io/netrender/utils.py | 52 +++++++-- 4 files changed, 172 insertions(+), 109 deletions(-) diff --git a/release/io/netrender/client.py b/release/io/netrender/client.py index bc4d363c996..59cb19c2075 100644 --- a/release/io/netrender/client.py +++ b/release/io/netrender/client.py @@ -69,7 +69,7 @@ class NetworkRenderEngine(bpy.types.RenderEngine): x= int(r.resolution_x*r.resolution_percentage*0.01) y= int(r.resolution_y*r.resolution_percentage*0.01) - f = open(netsetting.path + "output.exr", "wb") + f = open(netsettings.path + "output.exr", "wb") buf = response.read(1024) while buf: diff --git a/release/io/netrender/master.py b/release/io/netrender/master.py index 6f97685935d..6f360a4e7a9 100644 --- a/release/io/netrender/master.py +++ b/release/io/netrender/master.py @@ -46,8 +46,6 @@ class MRenderJob(netrender.model.RenderJob): self.id = job_id self.name = name self.files = files - self.render_files = [MRenderFile(path) for path in files] - self.status = JOB_WAITING self.frames = [] self.chunks = chunks self.priority = priority @@ -55,8 +53,19 @@ class MRenderJob(netrender.model.RenderJob): self.blacklist = blacklist self.last_dispatched = time.time() + # special server properties + self.save_path = "" + self.files_map = {path: MRenderFile(path) for path in files} + self.status = JOB_WAITING + + def save(self): + if self.save_path: + f = open(self.save_path + "job.txt", "w") + f.write(repr(self.serialize())) + f.close() + def testStart(self): - for f in self.render_files: + for f in self.files_map.values(): if not f.test(): return False @@ -184,7 +193,7 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): self.send_head(http.client.ACCEPTED) elif frame.status == DONE: self.server.stats("", "Sending result back to client") - f = open(self.server.path + job_id + "%04d" % job_frame + ".exr", 'rb') + f = open(job.save_path + "%04d" % job_frame + ".exr", 'rb') self.send_head() @@ -215,7 +224,7 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): self.send_head(http.client.PROCESSING) else: self.server.stats("", "Sending log back to client") - f = open(self.server.path + job_id + "%04d" % job_frame + ".log", 'rb') + f = open(job.save_path + "%04d" % job_frame + ".log", 'rb') self.send_head() @@ -270,8 +279,6 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): print("slave-id", slave_id) - self.server.getSlave(slave_id) - slave = self.server.updateSlave(slave_id) if slave: # only if slave id is valid @@ -297,22 +304,35 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): self.send_head(http.client.NO_CONTENT) # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- elif self.path == "file": - job_id = self.headers['job-id'] - print("file:", job_id, "\n") + slave_id = self.headers['slave-id'] - job = self.server.getJobByID(job_id) + slave = self.server.updateSlave(slave_id) - if job: - self.send_head(headers={"job-id": job.id}) + if slave: # only if slave id is valid + job_id = self.headers['job-id'] + job_file = self.headers['job-file'] + print("job:", job_id, "\n") + print("file:", job_file, "\n") - self.server.stats("", "Sending file to render node") - f = open(self.server.path + job.id + ".blend", 'rb') + job = self.server.getJobByID(job_id) - shutil.copyfileobj(f, self.wfile) - - f.close() - else: - # no such job id + if job: + render_file = job.files_map.get(job_file, None) + + if render_file: + self.server.stats("", "Sending file to render node") + f = open(render_file.path, 'rb') + + shutil.copyfileobj(f, self.wfile) + + f.close() + else: + # no such file + self.send_head(http.client.NO_CONTENT) + else: + # no such job id + self.send_head(http.client.NO_CONTENT) + else: # invalid slave id self.send_head(http.client.NO_CONTENT) # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- elif self.path == "slave": @@ -345,14 +365,15 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): job_id = self.server.nextJobID() - print("chunks", job_info.chunks) + print(job_info.files) job = MRenderJob(job_id, job_info.name, job_info.files, chunks = job_info.chunks, priority = job_info.priority, blacklist = job_info.blacklist) - self.server.addJob(job) for frame in job_info.frames: frame = job.addFrame(frame.number) - + + self.server.addJob(job) + headers={"job-id": job_id} if job.testStart(): @@ -411,86 +432,100 @@ class RenderHandler(http.server.BaseHTTPRequestHandler): self.server.stats("", "Receiving job") length = int(self.headers['content-length']) - job_frame_string = self.headers['job-frame'] - job_name = self.headers.get('job-name', "") - job_chunks = int(self.headers.get('job-chunks', "1")) - blacklist = self.headers.get('slave-blacklist', '').split() + job_id = self.headers['job-id'] + job_file = self.headers['job-file'] - job_id = self.server.nextJobID() + job = self.server.getJobByID(job_id) - buf = self.rfile.read(length) - - job_path = job_id + ".blend" - - f = open(self.server.path + job_path, "wb") - f.write(buf) - f.close() - del buf - - job = MRenderJob(job_id, job_name, job_path, chunks = job_chunks, blacklist = blacklist) - self.server.addJob(job) + if job: - if ":" in job_frame_string: - frame_start, frame_end = [int(x) for x in job_frame_string.split(":")] + render_file = job.files_map.get(job_file, None) - for job_frame in range(frame_start, frame_end + 1): - frame = job.addFrame(job_frame) - else: - job_frame = int(job_frame_string) - frame = job.addFrame(job_frame) - - job.start() - - self.send_head(headers={"job-id": job_id}) + if render_file: + main_file = job.files[0] + + main_path, main_name = os.path.split(main_file) + + if job_file != main_file: + file_path = prefixPath(job.save_path, job_file, main_path) + else: + file_path = job.save_path + main_name + + buf = self.rfile.read(length) + + f = open(file_path, "wb") + f.write(buf) + f.close() + del buf + + render_file.path = file_path # set the new path + + if job.testStart(): + self.send_head(headers=headers) + else: + self.send_head(http.client.ACCEPTED, headers=headers) + else: # invalid file + self.send_head(http.client.NO_CONTENT) + else: # job not found + self.send_head(http.client.NO_CONTENT) # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- elif self.path == "render": print("writing result file") self.server.stats("", "Receiving render result") job_id = self.headers['job-id'] - job_frame = int(self.headers['job-frame']) - job_result = int(self.headers['job-result']) - job_time = float(self.headers['job-time']) - if job_result == DONE: - length = int(self.headers['content-length']) - buf = self.rfile.read(length) - f = open(self.server.path + job_id + "%04d" % job_frame + ".exr", 'wb') - f.write(buf) - f.close() - - del buf - job = self.server.getJobByID(job_id) - frame = job[job_frame] - frame.status = job_result - frame.time = job_time - - self.server.updateSlave(self.headers['slave-id']) - self.send_head() + if job: + job_frame = int(self.headers['job-frame']) + job_result = int(self.headers['job-result']) + job_time = float(self.headers['job-time']) + + if job_result == DONE: + length = int(self.headers['content-length']) + buf = self.rfile.read(length) + f = open(job.save_path + "%04d" % job_frame + ".exr", 'wb') + f.write(buf) + f.close() + + del buf + + job = self.server.getJobByID(job_id) + frame = job[job_frame] + frame.status = job_result + frame.time = job_time + + self.server.updateSlave(self.headers['slave-id']) + + self.send_head() + else: # job not found + self.send_head(http.client.NO_CONTENT) # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- elif self.path == "log": print("writing log file") self.server.stats("", "Receiving log file") - length = int(self.headers['content-length']) job_id = self.headers['job-id'] - job_frame = int(self.headers['job-frame']) - print("log length:", length) + job = self.server.getJobByID(job_id) - buf = self.rfile.read(length) - f = open(self.server.path + job_id + "%04d" % job_frame + ".log", 'wb') - f.write(buf) - f.close() + if job: + length = int(self.headers['content-length']) + job_frame = int(self.headers['job-frame']) - del buf - - self.server.updateSlave(self.headers['slave-id']) - - self.send_head() - + buf = self.rfile.read(length) + f = open(job.save_path + "%04d" % job_frame + ".log", 'wb') + f.write(buf) + f.close() + + del buf + + self.server.updateSlave(self.headers['slave-id']) + + self.send_head() + else: # job not found + self.send_head(http.client.NO_CONTENT) class RenderMasterServer(http.server.HTTPServer): def __init__(self, address, handler_class, path): @@ -500,7 +535,10 @@ class RenderMasterServer(http.server.HTTPServer): self.slaves = [] self.slaves_map = {} self.job_id = 0 - self.path = path + self.path = path + "master_" + str(os.getpid()) + os.sep + + if not os.path.exists(self.path): + os.mkdir(self.path) def nextJobID(self): self.job_id += 1 @@ -539,6 +577,13 @@ class RenderMasterServer(http.server.HTTPServer): def addJob(self, job): self.jobs.append(job) self.jobs_map[job.id] = job + + # create job directory + job.save_path = self.path + "job_" + job.id + os.sep + if not os.path.exists(job.save_path): + os.mkdir(job.save_path) + + job.save() def getJobByID(self, id): return self.jobs_map.get(id, None) diff --git a/release/io/netrender/slave.py b/release/io/netrender/slave.py index 64801743d70..3d7153a0c54 100644 --- a/release/io/netrender/slave.py +++ b/release/io/netrender/slave.py @@ -27,24 +27,10 @@ def testCancel(conn, job_id): return False def testFile(conn, JOB_PREFIX, file_path, main_path = None): - if os.path.isabs(file_path): - # if an absolute path, make sure path exists, if it doesn't, use relative local path - job_full_path = file_path - if not os.path.exists(job_full_path): - p, n = os.path.split(job_full_path) - - if main_path and p.startswith(main_path): - directory = JOB_PREFIX + p[len(main_path):] - job_full_path = directory + n - if not os.path.exists(directory): - os.mkdir(directory) - else: - job_full_path = JOB_PREFIX + n - else: - job_full_path = JOB_PREFIX + file_path + job_full_path = prefixPath(JOB_PREFIX, file_path, main_path) if not os.path.exists(job_full_path): - conn.request("GET", "file", headers={"job-id": job.id, "slave-id":slave_id}) + conn.request("GET", "file", headers={"job-id": job.id, "slave-id":slave_id, "job-file":file_path}) response = conn.getresponse() if response.status != http.client.OK: @@ -76,7 +62,7 @@ def render_slave(engine, scene): slave_id = response.getheader("slave-id") - NODE_PREFIX = netsettings.path + "node_" + slave_id + os.sep + NODE_PREFIX = netsettings.path + "slave_" + slave_id + os.sep if not os.path.exists(NODE_PREFIX): os.mkdir(NODE_PREFIX) diff --git a/release/io/netrender/utils.py b/release/io/netrender/utils.py index d64b6fcda1e..30d96b2f92f 100644 --- a/release/io/netrender/utils.py +++ b/release/io/netrender/utils.py @@ -53,11 +53,22 @@ def clientSendJob(conn, scene, anim = False, chunks = 5): filename = bpy.data.filename job.files.append(filename) - name = netsettings.job_name - if name == "[default]": - path, name = os.path.split(filename) + job_name = netsettings.job_name + path, name = os.path.split(filename) + if job_name == "[default]": + job_name = name - job.name = name + for lib in bpy.data.libraries: + lib_path = lib.filename + + if lib_path.startswith("//"): + lib_path = path + os.sep + lib_path[2:] + + job.files.append(lib_path) + + print(job.files) + + job.name = job_name for slave in scene.network_render.slaves_blacklist: job.blacklist.append(slave.id) @@ -71,12 +82,13 @@ def clientSendJob(conn, scene, anim = False, chunks = 5): job_id = response.getheader("job-id") - # if not found, send whole file - if response.status == http.client.NOT_FOUND: - f = open(bpy.data.filename, "rb") - conn.request("PUT", "file", f, headers={"job-id": job_id}) - f.close() - response = conn.getresponse() + # if not ACCEPTED (but not processed), send files + if response.status == http.client.ACCEPTED: + for filepath in job.files: + f = open(filepath, "rb") + conn.request("PUT", "file", f, headers={"job-id": job_id, "job-file": filepath}) + f.close() + response = conn.getresponse() # server will reply with NOT_FOUD until all files are found @@ -84,3 +96,23 @@ def clientSendJob(conn, scene, anim = False, chunks = 5): def clientRequestResult(conn, scene, job_id): conn.request("GET", "render", headers={"job-id": job_id, "job-frame":str(scene.current_frame)}) + + +def prefixPath(prefix_directory, file_path, prefix_path): + if os.path.isabs(file_path): + # if an absolute path, make sure path exists, if it doesn't, use relative local path + full_path = file_path + if not os.path.exists(full_path): + p, n = os.path.split(full_path) + + if main_path and p.startswith(main_path): + directory = prefix_directory + p[len(main_path):] + full_path = directory + n + if not os.path.exists(directory): + os.mkdir(directory) + else: + full_path = prefix_directory + n + else: + full_path = prefix_directory + file_path + + return full_path \ No newline at end of file From bd7d26993f32bda6f0c0ca81e1455fb9f55418e3 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 2 Sep 2009 00:42:12 +0000 Subject: [PATCH 390/577] 2.5 - Rotation Order Tweaks for Armature Bones * All tools where rotation order matters for armature bones have now been adjusted to use the new code * Transform now uses the new code for bones too. However, there are some jumping issues here that I'm not too sure how to solve yet. Help fixing this is welcome. --- source/blender/blenlib/BLI_arithb.h | 3 +- source/blender/blenlib/intern/arithb.c | 74 +++++++++++++++++-- source/blender/editors/animation/keyframing.c | 2 +- source/blender/editors/armature/poseobject.c | 20 +++-- .../editors/space_view3d/view3d_buttons.c | 4 +- source/blender/editors/transform/transform.c | 16 ++-- source/blender/editors/transform/transform.h | 1 + .../editors/transform/transform_conversions.c | 31 +++++--- 8 files changed, 113 insertions(+), 38 deletions(-) diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h index 4156e3c52ec..5f3622e8aa5 100644 --- a/source/blender/blenlib/BLI_arithb.h +++ b/source/blender/blenlib/BLI_arithb.h @@ -193,6 +193,7 @@ typedef enum eEulerRotationOrders { } eEulerRotationOrders; void EulOToQuat(float eul[3], short order, float quat[4]); +void QuatToEulO(float quat[4], float eul[3], short order); void EulOToMat3(float eul[3], short order, float Mat[3][3]); void EulOToMat4(float eul[3], short order, float Mat[4][4]); @@ -200,7 +201,7 @@ void EulOToMat4(float eul[3], short order, float Mat[4][4]); void Mat3ToEulO(float Mat[3][3], float eul[3], short order); void Mat4ToEulO(float Mat[4][4], float eul[3], short order); -void QuatToEulO(float quat[4], float eul[3], short order); +void Mat3ToCompatibleEulO(float mat[3][3], float eul[3], float oldrot[3], short order); /** * @section Euler conversion routines (Blender XYZ) diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index e0f17864d73..64fb7d78ef1 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -2825,7 +2825,8 @@ static RotOrderInfo rotOrders[]= { * NOTE: since we start at 1 for the values, but arrays index from 0, * there is -1 factor involved in this process... */ -#define GET_ROTATIONORDER_INFO(order) (&rotOrders[(order)-1]) +// FIXME: what happens when invalid order given +#define GET_ROTATIONORDER_INFO(order) (((order)>=1) ? &rotOrders[(order)-1] : &rotOrders[0]) /* Construct quaternion from Euler angles (in radians). */ void EulOToQuat(float e[3], short order, float q[4]) @@ -2857,6 +2858,15 @@ void EulOToQuat(float e[3], short order, float q[4]) if (R->parity) q[j] = -q[j]; } +/* Convert quaternion to Euler angles (in radians). */ +void QuatToEulO(float q[4], float e[3], short order) +{ + float M[3][3]; + + QuatToMat3(q, M); + Mat3ToEulO(M, e, order); +} + /* Construct 3x3 matrix from Euler angles (in radians). */ void EulOToMat3(float e[3], short order, float M[3][3]) { @@ -2929,15 +2939,65 @@ void Mat4ToEulO(float M[4][4], float e[3], short order) Mat3ToEulO(m, e, order); } -/* Convert quaternion to Euler angles (in radians). */ -void QuatToEulO(float q[4], float e[3], short order) +/* returns two euler calculation methods, so we can pick the best */ +static void mat3_to_eulo2(float M[3][3], float *e1, float *e2, short order) { - float M[3][3]; + RotOrderInfo *R= GET_ROTATIONORDER_INFO(order); + short i=R->i, j=R->j, k=R->k; + double cy = sqrt(M[i][i]*M[i][i] + M[j][i]*M[j][i]); - QuatToMat3(q, M); - Mat3ToEulO(M, e, order); + if (cy > 16*FLT_EPSILON) { + e1[0] = atan2(M[j][k], M[k][k]); + e1[1] = atan2(-M[i][k], cy); + e1[2] = atan2(M[i][j], M[i][i]); + + e2[0] = atan2(-M[j][k], -M[k][k]); + e2[1] = atan2(-M[i][k], -cy); + e2[2] = atan2(-M[i][j], -M[i][i]); + } + else { + e1[0] = atan2(-M[k][j], M[j][j]); + e1[1] = atan2(-M[i][k], cy); + e1[2] = 0; + + VecCopyf(e2, e1); + } + + if (R->parity) { + e1[0] = -e1[0]; + e1[1] = -e1[1]; + e1[2] = -e1[2]; + + e2[0] = -e2[0]; + e2[1] = -e2[1]; + e2[2] = -e2[2]; + } } +/* uses 2 methods to retrieve eulers, and picks the closest */ +// FIXME: this does not work well with the other rotation modes... +void Mat3ToCompatibleEulO(float mat[3][3], float eul[3], float oldrot[3], short order) +{ + float eul1[3], eul2[3]; + float d1, d2; + + mat3_to_eulo2(mat, eul1, eul2, order); + + compatible_eul(eul1, oldrot); + compatible_eul(eul2, oldrot); + + d1= (float)fabs(eul1[0]-oldrot[0]) + (float)fabs(eul1[1]-oldrot[1]) + (float)fabs(eul1[2]-oldrot[2]); + d2= (float)fabs(eul2[0]-oldrot[0]) + (float)fabs(eul2[1]-oldrot[1]) + (float)fabs(eul2[2]-oldrot[2]); + + /* return best, which is just the one with lowest difference */ + if (d1 > d2) + VecCopyf(eul, eul2); + else + VecCopyf(eul, eul1); +} + + + /* ************ EULER (old XYZ) *************** */ /* XYZ order */ @@ -3102,7 +3162,7 @@ void euler_rot(float *beul, float ang, char axis) } /* exported to transform.c */ -/* XYZ order */ +/* order independent! */ void compatible_eul(float *eul, float *oldrot) { float dx, dy, dz; diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index dc73011549c..5f444609baa 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -704,7 +704,7 @@ static float visualkey_get_value (PointerRNA *ptr, PropertyRNA *prop, int array_ float eul[3]; /* euler-rotation test before standard rotation, as standard rotation does quats */ - Mat4ToEul(tmat, eul); + Mat4ToEulO(tmat, eul, pchan->rotmode); return eul[array_index]; } else if (strstr(identifier, "rotation")) { diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index 5b378878f91..9a72fce2bcf 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -760,6 +760,7 @@ void pose_copy_menu(Scene *scene) break; case 2: /* Local Rotation */ QUATCOPY(pchan->quat, pchanact->quat); + VECCOPY(pchan->eul, pchanact->eul); break; case 3: /* Local Size */ VECCOPY(pchan->size, pchanact->size); @@ -808,11 +809,14 @@ void pose_copy_menu(Scene *scene) break; case 10: /* Visual Rotation */ { - float delta_mat[4][4], quat[4]; + float delta_mat[4][4]; armature_mat_pose_to_bone(pchan, pchanact->pose_mat, delta_mat); - Mat4ToQuat(delta_mat, quat); - QUATCOPY(pchan->quat, quat); + + if (pchan->rotmode > 0) + Mat4ToEulO(delta_mat, pchan->eul, pchan->rotmode); + else + Mat4ToQuat(delta_mat, pchan->quat); } break; case 11: /* Visual Size */ @@ -990,20 +994,20 @@ static int pose_paste_exec (bContext *C, wmOperator *op) /* check if rotation modes are compatible (i.e. do they need any conversions) */ if (pchan->rotmode == chan->rotmode) { /* copy the type of rotation in use */ - if (pchan->rotmode) { + if (pchan->rotmode > 0) { VECCOPY(pchan->eul, chan->eul); } else { QUATCOPY(pchan->quat, chan->quat); } } - else if (pchan->rotmode) { + else if (pchan->rotmode > 0) { /* quat to euler */ - QuatToEul(chan->quat, pchan->eul); + QuatToEulO(chan->quat, pchan->eul, pchan->rotmode); } else { /* euler to quat */ - EulToQuat(chan->eul, pchan->quat); + EulOToQuat(chan->eul, chan->rotmode, pchan->quat); } /* paste flipped pose? */ @@ -1011,7 +1015,7 @@ static int pose_paste_exec (bContext *C, wmOperator *op) pchan->loc[0]*= -1; /* has to be done as eulers... */ - if (pchan->rotmode) { + if (pchan->rotmode > 0) { pchan->eul[1] *= -1; pchan->eul[2] *= -1; } diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 2fbe7e5db79..7c305d59866 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -512,7 +512,7 @@ static void v3d_posearmature_buts(uiBlock *block, View3D *v3d, Object *ob, float uiButSetFunc(but, validate_bonebutton_cb, bone, NULL); uiButSetCompleteFunc(but, autocomplete_bone, (void *)ob); - QuatToEul(pchan->quat, tfp->ob_eul); + QuatToEulO(pchan->quat, tfp->ob_eul, pchan->rotmode); // XXX? tfp->ob_eul[0]*= 180.0/M_PI; tfp->ob_eul[1]*= 180.0/M_PI; tfp->ob_eul[2]*= 180.0/M_PI; @@ -841,7 +841,7 @@ static void do_view3d_region_buttons(bContext *C, void *arg, int event) eul[0]= M_PI*tfp->ob_eul[0]/180.0; eul[1]= M_PI*tfp->ob_eul[1]/180.0; eul[2]= M_PI*tfp->ob_eul[2]/180.0; - EulToQuat(eul, pchan->quat); + EulOToQuat(eul, pchan->rotmode, pchan->quat); // xxx? } /* no break, pass on */ case B_ARMATUREPANEL2: diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 4a376f35552..f0de28476f0 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -2670,21 +2670,21 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short /* this function works on end result */ protectedQuaternionBits(td->protectflag, td->ext->quat, td->ext->iquat); } - else { // TODO: need some methods for the new euler types... + else { float eulmat[3][3]; - + Mat3MulMat3(totmat, mat, td->mtx); Mat3MulMat3(smat, td->smtx, totmat); - + /* calculate the total rotatation in eulers */ VECCOPY(eul, td->ext->irot); - EulToMat3(eul, eulmat); - + EulOToMat3(eul, td->rotOrder, eulmat); + /* mat = transform, obmat = bone rotation */ Mat3MulMat3(fmat, smat, eulmat); - - Mat3ToCompatibleEul(fmat, eul, td->ext->rot); - + + Mat3ToCompatibleEulO(fmat, eul, td->ext->rot, td->rotOrder); + /* and apply (to end result only) */ protectedRotateBits(td->protectflag, eul, td->ext->irot); VECCOPY(td->ext->rot, eul); diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index efa60b15293..e5bd405c0cd 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -199,6 +199,7 @@ typedef struct TransData { void *extra; /* extra data (mirrored element pointer, in editmode mesh to EditVert) (editbone for roll fixing) (...) */ short flag; /* Various flags */ short protectflag; /* If set, copy of Object or PoseChannel protection */ + int rotOrder; /* rotation order (for eulers), as defined in BLI_arithb.h */ } TransData; typedef struct MouseInput { diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 86d3af31c85..e0dfd90a3d1 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -502,22 +502,29 @@ static short apply_targetless_ik(Object *ob) /* apply and decompose, doesn't work for constraints or non-uniform scale well */ { - float rmat3[3][3], qmat[3][3], imat[3][3], smat[3][3]; + float rmat3[3][3], qrmat[3][3], imat[3][3], smat[3][3]; Mat3CpyMat4(rmat3, rmat); - - /* quaternion */ - Mat3ToQuat(rmat3, parchan->quat); - + + /* rotation */ + if (parchan->rotmode > 0) + Mat3ToEulO(rmat3, parchan->eul, parchan->rotmode); + else + Mat3ToQuat(rmat3, parchan->quat); + /* for size, remove rotation */ /* causes problems with some constraints (so apply only if needed) */ if (data->flag & CONSTRAINT_IK_STRETCH) { - QuatToMat3(parchan->quat, qmat); - Mat3Inv(imat, qmat); + if (parchan->rotmode > 0) + EulOToMat3(parchan->eul, parchan->rotmode, qrmat); + else + QuatToMat3(parchan->quat, qrmat); + + Mat3Inv(imat, qrmat); Mat3MulMat3(smat, rmat3, imat); Mat3ToSize(smat, parchan->size); } - + /* causes problems with some constraints (e.g. childof), so disable this */ /* as it is IK shouldn't affect location directly */ /* VECCOPY(parchan->loc, rmat[3]); */ @@ -568,18 +575,20 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr td->ext->size= pchan->size; VECCOPY(td->ext->isize, pchan->size); - if (pchan->rotmode) { + if (pchan->rotmode > 0) { td->ext->rot= pchan->eul; td->ext->quat= NULL; - + VECCOPY(td->ext->irot, pchan->eul); + td->rotOrder= pchan->rotmode; } else { td->ext->rot= NULL; td->ext->quat= pchan->quat; - + QUATCOPY(td->ext->iquat, pchan->quat); } + /* proper way to get parent transform + own transform + constraints transform */ Mat3CpyMat4(omat, ob->obmat); From 32b2b1f544661f6dee4a81428b562fe7a3bc3f13 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 2 Sep 2009 01:39:46 +0000 Subject: [PATCH 391/577] Game options like enable physics visualisation, nomipmap, displaylists, ignore_deprecation_warnings etc work again. space_set_commmandline_options from space.c as game_set_commmandline_options --- .../editors/space_view3d/view3d_view.c | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index c61b2f0f31d..de8166b372b 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -81,6 +81,10 @@ #include "PIL_time.h" /* smoothview */ +#if GAMEBLENDER == 1 +#include "SYS_System.h" +#endif + #include "view3d_intern.h" // own include /* use this call when executing an operator, @@ -1442,6 +1446,56 @@ static void RestoreState(bContext *C) glPopAttrib(); } +/* was space_set_commmandline_options in 2.4x */ +void game_set_commmandline_options(GameData *gm) +{ + SYS_SystemHandle syshandle; + int test; + + if ( (syshandle = SYS_GetSystem()) ) { + /* User defined settings */ + test= (U.gameflags & USER_DISABLE_SOUND); + /* if user already disabled audio at the command-line, don't re-enable it */ + if (test) + SYS_WriteCommandLineInt(syshandle, "noaudio", test); + + test= (U.gameflags & USER_DISABLE_MIPMAP); + GPU_set_mipmap(!test); + SYS_WriteCommandLineInt(syshandle, "nomipmap", test); + + /* File specific settings: */ + /* Only test the first one. These two are switched + * simultaneously. */ + test= (gm->flag & GAME_SHOW_FRAMERATE); + SYS_WriteCommandLineInt(syshandle, "show_framerate", test); + SYS_WriteCommandLineInt(syshandle, "show_profile", test); + + test = (gm->flag & GAME_SHOW_FRAMERATE); + SYS_WriteCommandLineInt(syshandle, "show_properties", test); + + test= (gm->flag & GAME_SHOW_PHYSICS); + SYS_WriteCommandLineInt(syshandle, "show_physics", test); + + test= (gm->flag & GAME_ENABLE_ALL_FRAMES); + SYS_WriteCommandLineInt(syshandle, "fixedtime", test); + +// a= (G.fileflags & G_FILE_GAME_TO_IPO); +// SYS_WriteCommandLineInt(syshandle, "game2ipo", a); + + test= (gm->flag & GAME_IGNORE_DEPRECATION_WARNINGS); + SYS_WriteCommandLineInt(syshandle, "ignore_deprecation_warnings", test); + + test= (gm->matmode == GAME_MAT_MULTITEX); + SYS_WriteCommandLineInt(syshandle, "blender_material", test); + test= (gm->matmode == GAME_MAT_GLSL); + SYS_WriteCommandLineInt(syshandle, "blender_glsl_material", test); + test= (gm->flag & GAME_DISPLAY_LISTS); + SYS_WriteCommandLineInt(syshandle, "displaylists", test); + + + } +} + /* maybe we need this defined somewhere else */ extern void StartKetsjiShell(struct bContext *C, struct ARegion *ar, int always_use_expand_framing); @@ -1483,6 +1537,8 @@ static int game_engine_exec(bContext *C, wmOperator *unused) view3d_operator_needs_opengl(C); + game_set_commmandline_options(&startscene->gm); + SaveState(C); StartKetsjiShell(C, ar, 1); RestoreState(C); From a0229b21cb5cfc6e263cc2396d5b1e8530d9d38d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 2 Sep 2009 03:14:38 +0000 Subject: [PATCH 392/577] text display (debug info) in the game engine working again & other minor changes. --- .../BlenderRoutines/KX_BlenderGL.cpp | 34 ++++++------------- .../gameengine/BlenderRoutines/KX_BlenderGL.h | 4 +-- .../BlenderRoutines/KX_BlenderRenderTools.cpp | 8 ++--- .../gameengine/Expressions/PyObjectPlus.cpp | 9 ++--- 4 files changed, 21 insertions(+), 34 deletions(-) diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp index 5cf696fe146..dba6d1113c9 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.cpp @@ -103,6 +103,8 @@ void BL_SwapBuffers(wmWindow *win) void DisableForText() { + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); /* needed for texture fonts otherwise they render as wireframe */ + if(glIsEnabled(GL_BLEND)) glDisable(GL_BLEND); if(glIsEnabled(GL_ALPHA_TEST)) glDisable(GL_ALPHA_TEST); @@ -135,32 +137,25 @@ void DisableForText() } } -void BL_print_gamedebug_line(char* text, int xco, int yco, int width, int height) +void BL_print_gamedebug_line(const char* text, int xco, int yco, int width, int height) { /* gl prepping */ DisableForText(); - //glDisable(GL_TEXTURE_2D); glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); - - glOrtho(0, width, - 0, height, 0, 1); - + + glOrtho(0, width, 0, height, -100, 100); + glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); - glMatrixMode(GL_TEXTURE); - glPushMatrix(); - glLoadIdentity(); /* the actual drawing */ glColor3ub(255, 255, 255); - BLF_draw_default(xco, height-yco, 0.0f, text); + BLF_draw_default(xco, height-yco, 0.0f, (char *)text); - glMatrixMode(GL_TEXTURE); - glPopMatrix(); glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); @@ -168,36 +163,29 @@ void BL_print_gamedebug_line(char* text, int xco, int yco, int width, int height glEnable(GL_DEPTH_TEST); } -void BL_print_gamedebug_line_padded(char* text, int xco, int yco, int width, int height) +void BL_print_gamedebug_line_padded(const char* text, int xco, int yco, int width, int height) { /* This is a rather important line :( The gl-mode hasn't been left * behind quite as neatly as we'd have wanted to. I don't know * what cause it, though :/ .*/ DisableForText(); - //glDisable(GL_TEXTURE_2D); glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); - glOrtho(0, width, - 0, height, 0, 1); + glOrtho(0, width, 0, height, -100, 100); glMatrixMode(GL_MODELVIEW); glPushMatrix(); glLoadIdentity(); - glMatrixMode(GL_TEXTURE); - glPushMatrix(); - glLoadIdentity(); /* draw in black first*/ glColor3ub(0, 0, 0); - BLF_draw_default(xco+1, height-yco-1, 0.0f, text); + BLF_draw_default(xco+2, height-yco-2, 0.0f, (char *)text); glColor3ub(255, 255, 255); - BLF_draw_default(xco, height-yco, 0.0f, text); + BLF_draw_default(xco, height-yco, 0.0f, (char *)text); - glMatrixMode(GL_TEXTURE); - glPopMatrix(); glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); diff --git a/source/gameengine/BlenderRoutines/KX_BlenderGL.h b/source/gameengine/BlenderRoutines/KX_BlenderGL.h index 1e65f29d87c..5c947ff630e 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderGL.h +++ b/source/gameengine/BlenderRoutines/KX_BlenderGL.h @@ -47,8 +47,8 @@ void BL_HideMouse(); void BL_NormalMouse(); void BL_WaitMouse(); -void BL_print_gamedebug_line(char* text, int xco, int yco, int width, int height); -void BL_print_gamedebug_line_padded(char* text, int xco, int yco, int width, int height); +void BL_print_gamedebug_line(const char* text, int xco, int yco, int width, int height); +void BL_print_gamedebug_line_padded(const char* text, int xco, int yco, int width, int height); diff --git a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp index 8ed36e860b4..ee9dae14b9b 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderRenderTools.cpp @@ -284,12 +284,10 @@ void KX_BlenderRenderTools::RenderText2D(RAS_TEXT_RENDER_MODE mode, int width, int height) { - STR_String tmpstr(text); - if(mode == RAS_IRenderTools::RAS_TEXT_PADDED) - BL_print_gamedebug_line_padded(tmpstr.Ptr(), xco, yco, width, height); + BL_print_gamedebug_line_padded(text, xco, yco, width, height); else - BL_print_gamedebug_line(tmpstr.Ptr(), xco, yco, width, height); + BL_print_gamedebug_line(text, xco, yco, width, height); } /* Render Text renders text into a (series of) polygon, using a texture font, @@ -390,4 +388,4 @@ void KX_BlenderRenderTools::Update2DFilter(vector& propNames, void* void KX_BlenderRenderTools::Render2DFilters(RAS_ICanvas* canvas) { m_filtermanager.RenderFilters(canvas); -} \ No newline at end of file +} diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp index 99c943d4f24..1d1d9e6103b 100644 --- a/source/gameengine/Expressions/PyObjectPlus.cpp +++ b/source/gameengine/Expressions/PyObjectPlus.cpp @@ -751,16 +751,17 @@ int PyObjectPlus::py_set_attrdef(PyObject *self_py, PyObject *value, const PyAtt STR_String *var = reinterpret_cast(ptr); if (PyUnicode_Check(value)) { - char *val = _PyUnicode_AsString(value); + Py_ssize_t val_len; + char *val = _PyUnicode_AsStringAndSize(value, &val_len); if (attrdef->m_clamp) { - if (strlen(val) < attrdef->m_imin) + if (val_len < attrdef->m_imin) { // can't increase the length of the string PyErr_Format(PyExc_ValueError, "string length too short for attribute \"%s\"", attrdef->m_name); goto FREE_AND_ERROR; } - else if (strlen(val) > attrdef->m_imax) + else if (val_len > attrdef->m_imax) { // trim the string char c = val[attrdef->m_imax]; @@ -769,7 +770,7 @@ int PyObjectPlus::py_set_attrdef(PyObject *self_py, PyObject *value, const PyAtt val[attrdef->m_imax] = c; break; } - } else if (strlen(val) < attrdef->m_imin || strlen(val) > attrdef->m_imax) + } else if (val_len < attrdef->m_imin || val_len > attrdef->m_imax) { PyErr_Format(PyExc_ValueError, "string length out of range for attribute \"%s\"", attrdef->m_name); goto FREE_AND_ERROR; From 0763627e394bf4b634584a11f1b15dca33d94258 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Wed, 2 Sep 2009 04:55:33 +0000 Subject: [PATCH 393/577] * quick fix from Moguri to get things compiling again. --- source/blender/editors/space_view3d/SConscript | 1 + 1 file changed, 1 insertion(+) diff --git a/source/blender/editors/space_view3d/SConscript b/source/blender/editors/space_view3d/SConscript index 4eb9f3f5ecb..057c98a1d49 100644 --- a/source/blender/editors/space_view3d/SConscript +++ b/source/blender/editors/space_view3d/SConscript @@ -9,6 +9,7 @@ incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' incs += ' ../../render/extern/include #/intern/guardedalloc' incs += ' ../../gpu ../../makesrna ../../blenfont' incs += ' #/intern/smoke/extern' +incs += ' #source/kernel/gen_system' if env['WITH_BF_GAMEENGINE']: defs.append('GAMEBLENDER=1') From 01b4caa701c21b88b4447d7d4fd5570b05fa5979 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 2 Sep 2009 10:45:11 +0000 Subject: [PATCH 394/577] 2.5 - Rotation order is now taken into account for constraints * Added a 'rotOrder' parameter for constraint evaluation objects and constraint targets, which describes the rotation mode used for the matrices there. Todos: * Constraint targets default to using XYZ only for now. This will need be be addressed eventually. * Copy Rotation constraint currently cannot use the new rotation order code for the target matrix. What's surprising is that even though it's just using XYZ as the old code did, it doesn't work, and yet everything else works nicely. Silly constraint! (it is almost impossible to improve this constraint further without breaking a rig out there) --- source/blender/blenkernel/BKE_constraint.h | 1 + source/blender/blenkernel/intern/constraint.c | 43 +++++++++------ source/blender/blenlib/BLI_arithb.h | 7 ++- source/blender/blenlib/intern/arithb.c | 52 +++++++++++++++++-- .../blender/makesdna/DNA_constraint_types.h | 2 +- 5 files changed, 83 insertions(+), 22 deletions(-) diff --git a/source/blender/blenkernel/BKE_constraint.h b/source/blender/blenkernel/BKE_constraint.h index 6e69906b71d..a0061173438 100644 --- a/source/blender/blenkernel/BKE_constraint.h +++ b/source/blender/blenkernel/BKE_constraint.h @@ -49,6 +49,7 @@ typedef struct bConstraintOb { float startmat[4][4]; /* original matrix (before constraint solving) */ short type; /* type of owner */ + short rotOrder; /* rotation order for constraint owner (as defined in eEulerRotationOrders in BLI_arithb.h) */ } bConstraintOb; /* ---------------------------------------------------------------------------- */ diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 88e73a00ba7..e6e65ebd614 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -121,6 +121,7 @@ bConstraintOb *constraints_make_evalob (Scene *scene, Object *ob, void *subdata, if (ob) { cob->ob = ob; cob->type = datatype; + cob->rotOrder = EULER_ORDER_DEFAULT; // TODO: when objects have rotation order too, use that Mat4CpyMat4(cob->matrix, ob->obmat); } else @@ -137,6 +138,15 @@ bConstraintOb *constraints_make_evalob (Scene *scene, Object *ob, void *subdata, cob->pchan = (bPoseChannel *)subdata; cob->type = datatype; + if (cob->pchan->rotmode > 0) { + /* should be some type of Euler order */ + cob->rotOrder= cob->pchan->rotmode; + } + else { + /* Quats, so eulers should just use default order */ + cob->rotOrder= EULER_ORDER_DEFAULT; + } + /* matrix in world-space */ Mat4MulMat4(cob->matrix, cob->pchan->pose_mat, ob->obmat); } @@ -664,6 +674,7 @@ static void default_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstrain * (Hopefully all compilers will be happy with the lines with just a space on them. Those are * really just to help this code easier to read) */ +// TODO: cope with getting rotation order... #define SINGLETARGET_GET_TARS(con, datatar, datasubtarget, ct, list) \ { \ ct= MEM_callocN(sizeof(bConstraintTarget), "tempConstraintTarget"); \ @@ -687,6 +698,7 @@ static void default_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstrain * (Hopefully all compilers will be happy with the lines with just a space on them. Those are * really just to help this code easier to read) */ +// TODO: cope with getting rotation order... #define SINGLETARGETNS_GET_TARS(con, datatar, ct, list) \ { \ ct= MEM_callocN(sizeof(bConstraintTarget), "tempConstraintTarget"); \ @@ -795,11 +807,11 @@ static void childof_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta /* extract components of both matrices */ VECCOPY(loc, ct->matrix[3]); - Mat4ToEul(ct->matrix, eul); + Mat4ToEulO(ct->matrix, eul, ct->rotOrder); Mat4ToSize(ct->matrix, size); VECCOPY(loco, invmat[3]); - Mat4ToEul(invmat, eulo); + Mat4ToEulO(invmat, eulo, cob->rotOrder); Mat4ToSize(invmat, sizo); /* disable channels not enabled */ @@ -814,8 +826,8 @@ static void childof_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta if (!(data->flag & CHILDOF_SIZEZ)) size[2]= sizo[2]= 1.0f; /* make new target mat and offset mat */ - LocEulSizeToMat4(ct->matrix, loc, eul, size); - LocEulSizeToMat4(invmat, loco, eulo, sizo); + LocEulOSizeToMat4(ct->matrix, loc, eul, size, ct->rotOrder); + LocEulOSizeToMat4(invmat, loco, eulo, sizo, cob->rotOrder); /* multiply target (parent matrix) by offset (parent inverse) to get * the effect of the parent that will be exherted on the owner @@ -1304,7 +1316,7 @@ static void rotlimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *t VECCOPY(loc, cob->matrix[3]); Mat4ToSize(cob->matrix, size); - Mat4ToEul(cob->matrix, eul); + Mat4ToEulO(cob->matrix, eul, cob->rotOrder); /* eulers: radians to degrees! */ eul[0] = (float)(eul[0] / M_PI * 180); @@ -1339,7 +1351,7 @@ static void rotlimit_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *t eul[1] = (float)(eul[1] / 180 * M_PI); eul[2] = (float)(eul[2] / 180 * M_PI); - LocEulSizeToMat4(cob->matrix, loc, eul, size); + LocEulOSizeToMat4(cob->matrix, loc, eul, size, cob->rotOrder); } static bConstraintTypeInfo CTI_ROTLIMIT = { @@ -1546,14 +1558,15 @@ static void rotlike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta VECCOPY(loc, cob->matrix[3]); Mat4ToSize(cob->matrix, size); - Mat4ToEul(ct->matrix, eul); - Mat4ToEul(cob->matrix, obeul); + //Mat4ToEulO(ct->matrix, eul, ct->rotOrder); + Mat4ToEul(ct->matrix, eul); // the version we should be using causes errors... + Mat4ToEulO(cob->matrix, obeul, cob->rotOrder); if ((data->flag & ROTLIKE_X)==0) eul[0] = obeul[0]; else { if (data->flag & ROTLIKE_OFFSET) - euler_rot(eul, obeul[0], 'x'); + eulerO_rot(eul, obeul[0], 'x', cob->rotOrder); if (data->flag & ROTLIKE_X_INVERT) eul[0] *= -1; @@ -1563,7 +1576,7 @@ static void rotlike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta eul[1] = obeul[1]; else { if (data->flag & ROTLIKE_OFFSET) - euler_rot(eul, obeul[1], 'y'); + eulerO_rot(eul, obeul[1], 'y', cob->rotOrder); if (data->flag & ROTLIKE_Y_INVERT) eul[1] *= -1; @@ -1573,14 +1586,14 @@ static void rotlike_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *ta eul[2] = obeul[2]; else { if (data->flag & ROTLIKE_OFFSET) - euler_rot(eul, obeul[2], 'z'); + eulerO_rot(eul, obeul[2], 'z', cob->rotOrder); if (data->flag & ROTLIKE_Z_INVERT) eul[2] *= -1; } compatible_eul(eul, obeul); - LocEulSizeToMat4(cob->matrix, loc, eul, size); + LocEulOSizeToMat4(cob->matrix, loc, eul, size, cob->rotOrder); } } @@ -3036,7 +3049,7 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase * Mat4ToSize(ct->matrix, dvec); break; case 1: /* rotation (convert to degrees first) */ - Mat4ToEul(ct->matrix, dvec); + Mat4ToEulO(ct->matrix, dvec, cob->rotOrder); for (i=0; i<3; i++) dvec[i] = (float)(dvec[i] / M_PI * 180); break; @@ -3047,7 +3060,7 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase * /* extract components of owner's matrix */ VECCOPY(loc, cob->matrix[3]); - Mat4ToEul(cob->matrix, eul); + Mat4ToEulO(cob->matrix, eul, cob->rotOrder); Mat4ToSize(cob->matrix, size); /* determine where in range current transforms lie */ @@ -3102,7 +3115,7 @@ static void transform_evaluate (bConstraint *con, bConstraintOb *cob, ListBase * } /* apply to matrix */ - LocEulSizeToMat4(cob->matrix, loc, eul, size); + LocEulOSizeToMat4(cob->matrix, loc, eul, size, cob->rotOrder); } } diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h index 5f3622e8aa5..2ab60c6a8d0 100644 --- a/source/blender/blenlib/BLI_arithb.h +++ b/source/blender/blenlib/BLI_arithb.h @@ -202,6 +202,8 @@ void Mat3ToEulO(float Mat[3][3], float eul[3], short order); void Mat4ToEulO(float Mat[4][4], float eul[3], short order); void Mat3ToCompatibleEulO(float mat[3][3], float eul[3], float oldrot[3], short order); + +void eulerO_rot(float beul[3], float ang, char axis, short order); /** * @section Euler conversion routines (Blender XYZ) @@ -484,8 +486,9 @@ void Mat4ToSize(float mat[][4], float *size); void triatoquat(float *v1, float *v2, float *v3, float *quat); -void LocEulSizeToMat4(float mat[][4], float loc[3], float eul[3], float size[3]); -void LocQuatSizeToMat4(float mat[][4], float loc[3], float quat[4], float size[3]); +void LocEulSizeToMat4(float mat[4][4], float loc[3], float eul[3], float size[3]); +void LocEulOSizeToMat4(float mat[4][4], float loc[3], float eul[3], float size[3], short rotOrder); +void LocQuatSizeToMat4(float mat[4][4], float loc[3], float quat[4], float size[3]); void tubemap(float x, float y, float z, float *u, float *v); void spheremap(float x, float y, float z, float *u, float *v); diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index 64fb7d78ef1..9d67ac50108 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -2825,7 +2825,6 @@ static RotOrderInfo rotOrders[]= { * NOTE: since we start at 1 for the values, but arrays index from 0, * there is -1 factor involved in this process... */ -// FIXME: what happens when invalid order given #define GET_ROTATIONORDER_INFO(order) (((order)>=1) ? &rotOrders[(order)-1] : &rotOrders[0]) /* Construct quaternion from Euler angles (in radians). */ @@ -2936,6 +2935,7 @@ void Mat4ToEulO(float M[4][4], float e[3], short order) /* for now, we'll just do this the slow way (i.e. copying matrices) */ Mat3CpyMat4(m, M); + Mat3Ortho(m); Mat3ToEulO(m, e, order); } @@ -2996,7 +2996,27 @@ void Mat3ToCompatibleEulO(float mat[3][3], float eul[3], float oldrot[3], short VecCopyf(eul, eul1); } - +/* rotate the given euler by the given angle on the specified axis */ +// NOTE: is this safe to do with different axis orders? +void eulerO_rot(float beul[3], float ang, char axis, short order) +{ + float eul[3], mat1[3][3], mat2[3][3], totmat[3][3]; + + eul[0]= eul[1]= eul[2]= 0.0f; + if (axis=='x') + eul[0]= ang; + else if (axis=='y') + eul[1]= ang; + else + eul[2]= ang; + + EulOToMat3(eul, order, mat1); + EulOToMat3(beul, order, mat2); + + Mat3MulMat3(totmat, mat2, mat1); + + Mat3ToEulO(totmat, beul, order); +} /* ************ EULER (old XYZ) *************** */ @@ -4947,7 +4967,7 @@ float PdistVL3Dfl(float *v1, float *v2, float *v3) /* make a 4x4 matrix out of 3 transform components */ /* matrices are made in the order: scale * rot * loc */ // TODO: need to have a version that allows for rotation order... -void LocEulSizeToMat4(float mat[][4], float loc[3], float eul[3], float size[3]) +void LocEulSizeToMat4(float mat[4][4], float loc[3], float eul[3], float size[3]) { float rmat[3][3], smat[3][3], tmat[3][3]; @@ -4970,7 +4990,31 @@ void LocEulSizeToMat4(float mat[][4], float loc[3], float eul[3], float size[3]) /* make a 4x4 matrix out of 3 transform components */ /* matrices are made in the order: scale * rot * loc */ -void LocQuatSizeToMat4(float mat[][4], float loc[3], float quat[4], float size[3]) +void LocEulOSizeToMat4(float mat[4][4], float loc[3], float eul[3], float size[3], short rotOrder) +{ + float rmat[3][3], smat[3][3], tmat[3][3]; + + /* initialise new matrix */ + Mat4One(mat); + + /* make rotation + scaling part */ + EulOToMat3(eul, rotOrder, rmat); + SizeToMat3(size, smat); + Mat3MulMat3(tmat, rmat, smat); + + /* copy rot/scale part to output matrix*/ + Mat4CpyMat3(mat, tmat); + + /* copy location to matrix */ + mat[3][0] = loc[0]; + mat[3][1] = loc[1]; + mat[3][2] = loc[2]; +} + + +/* make a 4x4 matrix out of 3 transform components */ +/* matrices are made in the order: scale * rot * loc */ +void LocQuatSizeToMat4(float mat[4][4], float loc[3], float quat[4], float size[3]) { float rmat[3][3], smat[3][3], tmat[3][3]; diff --git a/source/blender/makesdna/DNA_constraint_types.h b/source/blender/makesdna/DNA_constraint_types.h index 79f032d0d21..6fab633b192 100644 --- a/source/blender/makesdna/DNA_constraint_types.h +++ b/source/blender/makesdna/DNA_constraint_types.h @@ -85,7 +85,7 @@ typedef struct bConstraintTarget { short space; /* space that target should be evaluated in (overrides bConstraint->tarspace) */ short flag; /* runtime settings (for editor, etc.) */ short type; /* type of target (B_CONSTRAINT_OB_TYPE) */ - short pad; + short rotOrder; /* rotation order for target (as defined in BLI_arithb.h) */ } bConstraintTarget; /* bConstraintTarget -> flag */ From 0415e3be054bd6ad742da786e01ec3edc81f9e78 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 2 Sep 2009 12:16:00 +0000 Subject: [PATCH 395/577] 2.5 - UI Bugfixes * Modifiers for Lattices now get shown again * Auto IK and X-Axis Mirror options are now visible again in Armatures UI. Their placement isn't ideal yet, and they also need some proper poll-based visibility adjustments * F-Modifiers now correctly update the keyframes view after their settings are modified --- release/ui/buttons_data_armature.py | 5 ++- .../editors/space_buttons/buttons_context.c | 2 +- source/blender/makesrna/intern/rna_fcurve.c | 38 ++++++++++++++++++- source/blender/makesrna/intern/rna_nla.c | 25 ++++++++++++ 4 files changed, 66 insertions(+), 4 deletions(-) diff --git a/release/ui/buttons_data_armature.py b/release/ui/buttons_data_armature.py index ed350caa3bd..ff0cc531c67 100644 --- a/release/ui/buttons_data_armature.py +++ b/release/ui/buttons_data_armature.py @@ -45,6 +45,9 @@ class DATA_PT_skeleton(DataButtonsPanel): col.template_layers(arm, "layer") col.itemL(text="Protected Layers:") col.template_layers(arm, "layer_protection") + col.itemL(text="Edit Options:") + col.itemR(arm, "x_axis_mirror") + col.itemR(arm, "auto_ik") col = split.column() col.itemR(arm, "rest_position") @@ -53,8 +56,6 @@ class DATA_PT_skeleton(DataButtonsPanel): col.itemR(arm, "deform_envelope", text="Envelopes") col.itemR(arm, "deform_quaternion", text="Quaternion") col.itemR(arm, "deform_bbone_rest", text="B-Bones Rest") - #col.itemR(arm, "x_axis_mirror") - #col.itemR(arm, "auto_ik") class DATA_PT_display(DataButtonsPanel): __label__ = "Display" diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 8306487013a..635abd429f6 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -200,7 +200,7 @@ static int buttons_context_path_modifier(ButsContextPath *path) if(buttons_context_path_object(path)) { ob= path->ptr[path->len-1].data; - if(ob && ELEM4(ob->type, OB_MESH, OB_CURVE, OB_FONT, OB_SURF)) + if(ob && ELEM5(ob->type, OB_MESH, OB_CURVE, OB_FONT, OB_SURF, OB_LATTICE)) return 1; } diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index fa6eea5f8a9..bafe83f1812 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -34,6 +34,8 @@ #include "MEM_guardedalloc.h" +#include "WM_types.h" + EnumPropertyItem fmodifier_type_items[] = { {FMODIFIER_TYPE_NULL, "NULL", 0, "Invalid", ""}, {FMODIFIER_TYPE_GENERATOR, "GENERATOR", 0, "Generator", ""}, @@ -168,17 +170,20 @@ static void rna_def_fmodifier_generator(BlenderRNA *brna) prop= RNA_def_property(srna, "additive", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_GENERATOR_ADDITIVE); RNA_def_property_ui_text(prop, "Additive", "Values generated by this modifier are applied on top of the existing values instead of overwriting them."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); // XXX this has a special validation func prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_mode_items); RNA_def_property_ui_text(prop, "Mode", "Type of generator to use."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); /* order of the polynomial */ // XXX this has a special validation func prop= RNA_def_property(srna, "poly_order", PROP_INT, PROP_NONE); RNA_def_property_ui_text(prop, "Polynomial Order", "The highest power of 'x' for this polynomial. (number of coefficients - 1)"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); /* coefficients array */ // FIXME: this is quite difficult to try to wrap @@ -210,25 +215,31 @@ static void rna_def_fmodifier_function_generator(BlenderRNA *brna) /* coefficients */ prop= RNA_def_property(srna, "amplitude", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "Amplitude", "Scale factor determining the maximum/minimum values."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "phase_multiplier", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "Phase Multiplier", "Scale factor determining the 'speed' of the function."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "phase_offset", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "Phase Offset", "Constant factor to offset time by for function."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "value_offset", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "Value Offset", "Constant factor to offset values by."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); /* flags */ prop= RNA_def_property(srna, "additive", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_GENERATOR_ADDITIVE); RNA_def_property_ui_text(prop, "Additive", "Values generated by this modifier are applied on top of the existing values instead of overwriting them."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "function_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Type", "Type of built-in function to use."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); } /* --------- */ @@ -249,15 +260,18 @@ static void rna_def_fmodifier_envelope_ctrl(BlenderRNA *brna) prop= RNA_def_property(srna, "minimum", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "min"); RNA_def_property_ui_text(prop, "Minimum Value", "Lower bound of envelope at this control-point."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "maximum", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max"); RNA_def_property_ui_text(prop, "Maximum Value", "Upper bound of envelope at this control-point."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); /* Frame */ prop= RNA_def_property(srna, "frame", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "time"); RNA_def_property_ui_text(prop, "Frame", "Frame this control-point occurs on."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); // TODO: // - selection flags (not implemented in UI yet though) @@ -282,14 +296,17 @@ static void rna_def_fmodifier_envelope(BlenderRNA *brna) prop= RNA_def_property(srna, "reference_value", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "midval"); RNA_def_property_ui_text(prop, "Reference Value", "Value that envelope's influence is centered around / based on."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "default_minimum", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "min"); RNA_def_property_ui_text(prop, "Default Minimum", "Lower distance from Reference Value for 1:1 default influence."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "default_maximum", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max"); RNA_def_property_ui_text(prop, "Default Maximum", "Upper distance from Reference Value for 1:1 default influence."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); } /* --------- */ @@ -314,18 +331,21 @@ static void rna_def_fmodifier_cycles(BlenderRNA *brna) prop= RNA_def_property(srna, "before_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Before Mode", "Cycling mode to use before first keyframe."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "before_cycles", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "Before Cycles", "Maximum number of cycles to allow before first keyframe. (0 = infinite)"); - + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); /* after */ prop= RNA_def_property(srna, "after_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "After Mode", "Cycling mode to use after last keyframe."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "after_cycles", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(prop, "After Cycles", "Maximum number of cycles to allow after last keyframe. (0 = infinite)"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); } /* --------- */ @@ -354,34 +374,42 @@ static void rna_def_fmodifier_limits(BlenderRNA *brna) prop= RNA_def_property(srna, "use_minimum_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_XMIN); RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "use_minimum_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_YMIN); RNA_def_property_ui_text(prop, "Minimum Y", "Use the minimum Y value."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "use_maximum_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_XMAX); RNA_def_property_ui_text(prop, "Maximum X", "Use the maximum X value."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "use_maximum_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FCM_LIMIT_YMAX); RNA_def_property_ui_text(prop, "Maximum Y", "Use the maximum Y value."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "minimum_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rect.xmin"); RNA_def_property_ui_text(prop, "Minimum X", "Lowest X value to allow."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "minimum_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rect.ymin"); RNA_def_property_ui_text(prop, "Minimum Y", "Lowest Y value to allow."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "maximum_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rect.xmax"); RNA_def_property_ui_text(prop, "Maximum X", "Highest X value to allow."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "maximum_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rect.ymax"); RNA_def_property_ui_text(prop, "Maximum Y", "Highest Y value to allow."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); } /* --------- */ @@ -405,22 +433,27 @@ static void rna_def_fmodifier_noise(BlenderRNA *brna) prop= RNA_def_property(srna, "modification", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_modification_items); RNA_def_property_ui_text(prop, "Modification", "Method of modifying the existing F-Curve."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "size"); RNA_def_property_ui_text(prop, "Size", "Scaling (in time) of the noise"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "strength"); RNA_def_property_ui_text(prop, "Strength", "Amplitude of the noise - the amount that it modifies the underlying curve"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "phase", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "phase"); RNA_def_property_ui_text(prop, "Phase", "A random seed for the noise effect"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); prop= RNA_def_property(srna, "depth", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "depth"); RNA_def_property_ui_text(prop, "Depth", "Amount of fine level detail present in the noise"); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_EDIT, NULL); } @@ -459,17 +492,20 @@ void rna_def_fmodifier(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_MUTED); RNA_def_property_ui_text(prop, "Muted", "F-Curve Modifier will not be evaluated."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); // XXX this is really an internal flag, but it may be useful for some tools to be able to access this... prop= RNA_def_property(srna, "disabled", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_DISABLED); RNA_def_property_ui_text(prop, "Disabled", "F-Curve Modifier has invalid settings and will not be evaluated."); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); // TODO: setting this to true must ensure that all others in stack are turned off too... prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FMODIFIER_FLAG_ACTIVE); RNA_def_property_ui_text(prop, "Active", "F-Curve Modifier is the one being edited "); + RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); } /* *********************** */ diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index 98c72b7ee74..98fdf4a6878 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -61,6 +61,30 @@ void rna_NlaStrip_name_set(PointerRNA *ptr, const char *value) } } +static char *rna_NlaStrip_path(PointerRNA *ptr) +{ + NlaStrip *strip= (NlaStrip *)ptr->data; + AnimData *adt= BKE_animdata_from_id(ptr->id.data); + + /* if we're attached to AnimData, try to resolve path back to AnimData */ + if (adt) { + NlaTrack *nlt; + NlaStrip *nls; + + for (nlt= adt->nla_tracks.first; nlt; nlt= nlt->next) { + for (nls = nlt->strips.first; nls; nls = nls->next) { + if (nls == strip) { + // XXX but if we animate like this, the control will never work... + return BLI_sprintfN("animation_data.nla_tracks[\"%s\"].strips[\"%s\"]", nlt->name, strip->name); + } + } + } + } + + /* no path */ + return ""; +} + static void rna_NlaStrip_start_frame_set(PointerRNA *ptr, float value) { @@ -271,6 +295,7 @@ void rna_def_nlastrip(BlenderRNA *brna) /* struct definition */ srna= RNA_def_struct(brna, "NlaStrip", NULL); RNA_def_struct_ui_text(srna, "NLA Strip", "A container referencing an existing Action."); + RNA_def_struct_path_func(srna, "rna_NlaStrip_path"); RNA_def_struct_ui_icon(srna, ICON_NLA); // XXX /* name property */ From 21af438ef8c7cbc19ec0050195c3898ef4d95c29 Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Wed, 2 Sep 2009 17:13:47 +0000 Subject: [PATCH 396/577] Blender 2.5 * recent files now just write content of G.recent_files, was adding untitled.blend! * removed unused and now superfluous code reading the .Bfs file (is done in fsmenu now) --- .../blender/windowmanager/intern/wm_files.c | 54 +------------------ .../windowmanager/intern/wm_operators.c | 18 ++----- 2 files changed, 5 insertions(+), 67 deletions(-) diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index b98717c8629..3921da4f062 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -388,7 +388,7 @@ void WM_read_autosavefile(bContext *C) void read_Blog(void) { - char name[FILE_MAX], filename[FILE_MAX]; + char name[FILE_MAX]; LinkNode *l, *lines; struct RecentFile *recent; char *line; @@ -420,58 +420,6 @@ void read_Blog(void) BLI_free_file_lines(lines); -#ifdef WIN32 - /* Add the drive names to the listing */ - { - __int64 tmp; - char folder[MAX_PATH]; - char tmps[4]; - int i; - - tmp= GetLogicalDrives(); - - for (i=2; i < 26; i++) { - if ((tmp>>i) & 1) { - tmps[0]='a'+i; - tmps[1]=':'; - tmps[2]='\\'; - tmps[3]=0; - -// XX fsmenu_insert_entry(tmps, 0, 0); - } - } - - /* Adding Desktop and My Documents */ -// XXX fsmenu_append_separator(); - - SHGetSpecialFolderPath(0, folder, CSIDL_PERSONAL, 0); -// XXX fsmenu_insert_entry(folder, 0, 0); - SHGetSpecialFolderPath(0, folder, CSIDL_DESKTOPDIRECTORY, 0); -// XXX fsmenu_insert_entry(folder, 0, 0); - -// XXX fsmenu_append_separator(); - } -#endif - - BLI_make_file_string(G.sce, name, BLI_gethome(), ".Bfs"); - lines= BLI_read_file_as_lines(name); - - for (l= lines; l; l= l->next) { - char *line= l->link; - - if (!BLI_streq(line, "")) { -// XXX fsmenu_insert_entry(line, 0, 1); - } - } - -// XXX fsmenu_append_separator(); - - /* add last saved file */ - BLI_split_dirfile(G.sce, name, filename); /* G.sce shouldn't be relative */ - -// XXX fsmenu_insert_entry(name, 0, 0); - - BLI_free_file_lines(lines); } static void writeBlog(void) diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 5a385418e5d..b51fcfddc47 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -814,22 +814,12 @@ static EnumPropertyItem *open_recentfile_itemf(bContext *C, PointerRNA *ptr, int struct RecentFile *recent; int totitem= 0, i, ofs= 0; - if(G.sce[0]) { - tmp.value= 1; - tmp.identifier= G.sce; - tmp.name= G.sce; - RNA_enum_item_add(&item, &totitem, &tmp); - ofs = 1; - } - /* dynamically construct enum */ for(recent = G.recent_files.first, i=0; (inext, i++) { - if(strcmp(recent->filename, G.sce)) { - tmp.value= i+ofs+1; - tmp.identifier= recent->filename; - tmp.name= recent->filename; - RNA_enum_item_add(&item, &totitem, &tmp); - } + tmp.value= i+ofs+1; + tmp.identifier= recent->filename; + tmp.name= recent->filename; + RNA_enum_item_add(&item, &totitem, &tmp); } RNA_enum_item_end(&item, &totitem); From e80b37cd751260232678ebd550aa5a0f2226b693 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 2 Sep 2009 20:46:28 +0000 Subject: [PATCH 397/577] * KX_PythonSeq - comparisons work again. eg. act1.sensors == act2.sensors, had to copy Py_CmpToRich inline grr!, mailed python-dev about this. * Shift-Click on states in the logic UI works again. * New Logic Space has all the view options pressed. --- .../editors/space_logic/logic_window.c | 27 ++----------- .../blender/editors/space_logic/space_logic.c | 7 ++++ source/gameengine/Ketsji/KX_PythonInit.cpp | 38 +++++++++++++++++++ source/gameengine/Ketsji/KX_PythonSeq.cpp | 20 ++++++++-- 4 files changed, 64 insertions(+), 28 deletions(-) diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 118bcaa0cf4..47ba197daa0 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -83,9 +83,6 @@ static int pupmenu() {return 1;} #define B_REDR 1 #define B_IDNAME 2 -#define B_ADD_PROP 2701 -#define B_CHANGE_PROP 2702 - #define B_ADD_SENS 2703 #define B_CHANGE_SENS 2704 #define B_DEL_SENS 2705 @@ -364,7 +361,6 @@ static void sca_move_actuator(bContext *C, void *datav, void *data2_unused) void do_logic_buts(bContext *C, void *arg, int event) { - bProperty *prop; bSensor *sens; bController *cont; bActuator *act; @@ -386,25 +382,7 @@ void do_logic_buts(bContext *C, void *arg, int event) case B_SETMAINACTOR: ob->gameflag &= ~(OB_SECTOR|OB_PROP); break; - - - case B_ADD_PROP: - prop= new_property(PROP_FLOAT); - make_unique_prop_names(C, prop->name); - BLI_addtail(&ob->prop, prop); - ED_undo_push(C, "Add property"); - break; -#if 0 // XXX Now done in python - case B_CHANGE_PROP: - prop= ob->prop.first; - while(prop) { - if(prop->type!=prop->otype) { - init_property(prop); - } - prop= prop->next; - } - break; -#endif + case B_ADD_SENS: for(ob=G.main->object.first; ob; ob=ob->id.next) { if(ob->scaflag & OB_ADDSENS) { @@ -1666,7 +1644,8 @@ char *get_state_name(Object *ob, short bit) static void check_state_mask(bContext *C, void *arg1_but, void *arg2_mask) { - int shift= 0; // XXX + wmWindow *win= CTX_wm_window(C); + int shift= win->eventstate->shift; unsigned int *cont_mask = arg2_mask; uiBut *but = arg1_but; diff --git a/source/blender/editors/space_logic/space_logic.c b/source/blender/editors/space_logic/space_logic.c index 703b408aae6..3c46522bba2 100644 --- a/source/blender/editors/space_logic/space_logic.c +++ b/source/blender/editors/space_logic/space_logic.c @@ -102,6 +102,13 @@ static SpaceLink *logic_new(const bContext *C) slogic= MEM_callocN(sizeof(SpaceLogic), "initlogic"); slogic->spacetype= SPACE_LOGIC; + /* default options */ + slogic->scaflag = (BUTS_SENS_SEL|BUTS_SENS_ACT|BUTS_SENS_LINK) | + (BUTS_CONT_SEL|BUTS_CONT_ACT|BUTS_CONT_LINK) | + (BUTS_ACT_SEL|BUTS_ACT_ACT|BUTS_ACT_LINK) | + (BUTS_SENS_STATE|BUTS_ACT_STATE); + + /* header */ ar= MEM_callocN(sizeof(ARegion), "header for logic"); diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 67ab67814b2..667b4cd5d89 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -2018,4 +2018,42 @@ void resetGamePythonPath() } +/* Copied from pythons 3's Object.c + * also in blenders bpy_uitl.c, mailed the python-dev + * list about enabling something like this again for py3 */ +PyObject * +Py_CmpToRich(int op, int cmp) +{ + PyObject *res; + int ok; + + if (PyErr_Occurred()) + return NULL; + switch (op) { + case Py_LT: + ok = cmp < 0; + break; + case Py_LE: + ok = cmp <= 0; + break; + case Py_EQ: + ok = cmp == 0; + break; + case Py_NE: + ok = cmp != 0; + break; + case Py_GT: + ok = cmp > 0; + break; + case Py_GE: + ok = cmp >= 0; + break; + default: + PyErr_BadArgument(); + return NULL; + } + res = ok ? Py_True : Py_False; + Py_INCREF(res); + return res; +} diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp index 1098dc03b62..165a85e2c14 100644 --- a/source/gameengine/Ketsji/KX_PythonSeq.cpp +++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp @@ -345,6 +345,19 @@ static int KX_PythonSeq_compare( KX_PythonSeq * a, KX_PythonSeq * b ) /* TODO - return ( a->type == b->type && a->base == b->base) ? 0 : -1; } +extern PyObject *Py_CmpToRich(int op, int cmp); + +static PyObject *KX_PythonSeq_richcmp(PyObject *a, PyObject *b, int op) +{ + int cmp_result= -1; /* assume false */ + + if(BPy_KX_PythonSeq_Check(a) && BPy_KX_PythonSeq_Check(b)) { + cmp_result= KX_PythonSeq_compare((KX_PythonSeq *)a, (KX_PythonSeq *)b); + } + + return Py_CmpToRich(op, cmp_result); +} + /* * repr function * convert to a list and get its string value @@ -374,8 +387,7 @@ PyTypeObject KX_PythonSeq_Type = { NULL, /* printfunc tp_print; */ NULL, /* getattrfunc tp_getattr; */ NULL, /* setattrfunc tp_setattr; */ - /* TODO, richcmp */ - NULL, /* ( cmpfunc ) KX_PythonSeq_compare, // cmpfunc tp_compare; */ + NULL, /* cmpfunc tp_compare; */ ( reprfunc ) KX_PythonSeq_repr, /* reprfunc tp_repr; */ /* Method suites for standard classes */ @@ -401,14 +413,14 @@ PyTypeObject KX_PythonSeq_Type = { NULL, /* char *tp_doc; Documentation string */ /*** Assigned meaning in release 2.0 ***/ /* call function for all accessible objects */ - NULL, /* traverseproc tp_traverse; */ + NULL, /* traverseproc tp_traverse; */ /* delete references to contained objects */ NULL, /* inquiry tp_clear; */ /*** Assigned meaning in release 2.1 ***/ /*** rich comparisons ***/ - NULL, /* richcmpfunc tp_richcompare; */ + (richcmpfunc)KX_PythonSeq_richcmp, /* richcmpfunc tp_richcompare; */ /*** weak reference enabler ***/ 0, /* long tp_weaklistoffset; */ From 375f36dfcf21f046b2cde0a24a0846999e87d57a Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Wed, 2 Sep 2009 20:54:33 +0000 Subject: [PATCH 398/577] * actually commit the sndfile dll copying (and not just claiming I did) --- SConstruct | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SConstruct b/SConstruct index f2eb7146930..5a64cd7c117 100644 --- a/SConstruct +++ b/SConstruct @@ -575,6 +575,8 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc'): if env['WITH_BF_OPENAL']: dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll') dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll') + if env['WITH_BF_SNDFILE']: + dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll') if env['WITH_BF_FFMPEG']: dllsources += ['${LCGDIR}/ffmpeg/lib/avcodec-52.dll', '${LCGDIR}/ffmpeg/lib/avformat-52.dll', From 9004dc665cd303dc6bc84d1ea92716dc0c0020d3 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Wed, 2 Sep 2009 20:57:18 +0000 Subject: [PATCH 399/577] Fix thread hanging problem (mostly seen with material preview, but that sneaky f*er could strike any time). Story time: Once upon a time, in the green valley of fileselect, BLI_end_threads would get called on an empty threadbase, depending on the result of a previous call to readdir(). The function would then gladly decrement thread_level to -1 which would cause all kinds of fun havoc. THE END. Made sure thread_level is only incremented and decremented when needed. The caller should never have to make sure of that, especially since it already lets you call with a null threadbase. Please report any further hang (and how to reproduce, if possible). --- source/blender/blenlib/intern/threads.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c index 2812f17d58f..ed3e07b7f7e 100644 --- a/source/blender/blenlib/intern/threads.c +++ b/source/blender/blenlib/intern/threads.c @@ -142,10 +142,10 @@ void BLI_init_threads(ListBase *threadbase, void *(*do_thread)(void *), int tot) tslot->do_thread= do_thread; tslot->avail= 1; } + + MEM_set_lock_callback(BLI_lock_malloc_thread, BLI_unlock_malloc_thread); + thread_levels++; } - - MEM_set_lock_callback(BLI_lock_malloc_thread, BLI_unlock_malloc_thread); - thread_levels++; } /* amount of available threads */ @@ -235,18 +235,21 @@ void BLI_end_threads(ListBase *threadbase) { ThreadSlot *tslot; - if (threadbase) { + /* only needed if there's actually some stuff to end + * this way we don't end up decrementing thread_levels on an empty threadbase + * */ + if (threadbase && threadbase->first != NULL) { for(tslot= threadbase->first; tslot; tslot= tslot->next) { if(tslot->avail==0) { pthread_join(tslot->pthread, NULL); } } BLI_freelistN(threadbase); + + thread_levels--; + if(thread_levels==0) + MEM_set_lock_callback(NULL, NULL); } - - thread_levels--; - if(thread_levels==0) - MEM_set_lock_callback(NULL, NULL); } void BLI_lock_thread(int type) From ac3f0695a2cf3d5706d8f49b1276579889997990 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 3 Sep 2009 01:52:10 +0000 Subject: [PATCH 400/577] remove Py_CmpToRich (copy of py3.0 function), instead only support == and != for PyRNA and KX_PySequence types. mesh1 > mesh2 # will raise an error. --- source/blender/python/intern/bpy_rna.c | 61 ++++++++++++++++++---- source/blender/python/intern/bpy_util.c | 38 -------------- source/blender/python/intern/bpy_util.h | 2 - source/gameengine/Ketsji/KX_PythonInit.cpp | 41 --------------- source/gameengine/Ketsji/KX_PythonSeq.cpp | 32 +++++++++--- 5 files changed, 75 insertions(+), 99 deletions(-) diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 3902a9fd9b5..8ba3b5f8732 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -144,25 +144,64 @@ static int pyrna_prop_compare( BPy_PropertyRNA * a, BPy_PropertyRNA * b ) return (a->prop==b->prop && a->ptr.data==b->ptr.data ) ? 0 : -1; } -/* For some reason python3 needs these :/ */ -static PyObject *pyrna_struct_richcmp(BPy_StructRNA * a, BPy_StructRNA * b, int op) +static PyObject *pyrna_struct_richcmp(PyObject *a, PyObject *b, int op) { - int cmp_result= -1; /* assume false */ - if (BPy_StructRNA_Check(a) && BPy_StructRNA_Check(b)) { - cmp_result= pyrna_struct_compare(a, b); + PyObject *res; + int ok= -1; /* zero is true */ + + if (BPy_StructRNA_Check(a) && BPy_StructRNA_Check(b)) + ok= pyrna_struct_compare((BPy_StructRNA *)a, (BPy_StructRNA *)b); + + switch (op) { + case Py_NE: + ok = !ok; /* pass through */ + case Py_EQ: + res = ok ? Py_False : Py_True; + break; + + case Py_LT: + case Py_LE: + case Py_GT: + case Py_GE: + res = Py_NotImplemented; + break; + default: + PyErr_BadArgument(); + return NULL; } - return Py_CmpToRich(op, cmp_result); + Py_INCREF(res); + return res; } -static PyObject *pyrna_prop_richcmp(BPy_PropertyRNA * a, BPy_PropertyRNA * b, int op) +static PyObject *pyrna_prop_richcmp(PyObject *a, PyObject *b, int op) { - int cmp_result= -1; /* assume false */ - if (BPy_PropertyRNA_Check(a) && BPy_PropertyRNA_Check(b)) { - cmp_result= pyrna_prop_compare(a, b); + PyObject *res; + int ok= -1; /* zero is true */ + + if (BPy_PropertyRNA_Check(a) && BPy_PropertyRNA_Check(b)) + ok= pyrna_prop_compare((BPy_PropertyRNA *)a, (BPy_PropertyRNA *)b); + + switch (op) { + case Py_NE: + ok = !ok; /* pass through */ + case Py_EQ: + res = ok ? Py_False : Py_True; + break; + + case Py_LT: + case Py_LE: + case Py_GT: + case Py_GE: + res = Py_NotImplemented; + break; + default: + PyErr_BadArgument(); + return NULL; } - return Py_CmpToRich(op, cmp_result); + Py_INCREF(res); + return res; } /*----------------------repr--------------------------------------------*/ diff --git a/source/blender/python/intern/bpy_util.c b/source/blender/python/intern/bpy_util.c index be343843acc..1766be62c83 100644 --- a/source/blender/python/intern/bpy_util.c +++ b/source/blender/python/intern/bpy_util.c @@ -122,44 +122,6 @@ int BPY_flag_from_seq(BPY_flag_def *flagdef, PyObject *seq, int *flag) return 0; /* ok */ } - -/* Copied from pythons 3's Object.c */ -PyObject * -Py_CmpToRich(int op, int cmp) -{ - PyObject *res; - int ok; - - if (PyErr_Occurred()) - return NULL; - switch (op) { - case Py_LT: - ok = cmp < 0; - break; - case Py_LE: - ok = cmp <= 0; - break; - case Py_EQ: - ok = cmp == 0; - break; - case Py_NE: - ok = cmp != 0; - break; - case Py_GT: - ok = cmp > 0; - break; - case Py_GE: - ok = cmp >= 0; - break; - default: - PyErr_BadArgument(); - return NULL; - } - res = ok ? Py_True : Py_False; - Py_INCREF(res); - return res; -} - /* for debugging */ void PyObSpit(char *name, PyObject *var) { fprintf(stderr, "<%s> : ", name); diff --git a/source/blender/python/intern/bpy_util.h b/source/blender/python/intern/bpy_util.h index 0400d595520..83fa7a5b7c4 100644 --- a/source/blender/python/intern/bpy_util.h +++ b/source/blender/python/intern/bpy_util.h @@ -50,8 +50,6 @@ void PyObSpit(char *name, PyObject *var); void PyLineSpit(void); void BPY_getFileAndNum(char **filename, int *lineno); -PyObject *Py_CmpToRich(int op, int cmp); - PyObject *BPY_exception_buffer(void); /* own python like utility function */ diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 667b4cd5d89..9e81bcb3871 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -2016,44 +2016,3 @@ void resetGamePythonPath() { gp_GamePythonPathOrig[0] = '\0'; } - - -/* Copied from pythons 3's Object.c - * also in blenders bpy_uitl.c, mailed the python-dev - * list about enabling something like this again for py3 */ -PyObject * -Py_CmpToRich(int op, int cmp) -{ - PyObject *res; - int ok; - - if (PyErr_Occurred()) - return NULL; - switch (op) { - case Py_LT: - ok = cmp < 0; - break; - case Py_LE: - ok = cmp <= 0; - break; - case Py_EQ: - ok = cmp == 0; - break; - case Py_NE: - ok = cmp != 0; - break; - case Py_GT: - ok = cmp > 0; - break; - case Py_GE: - ok = cmp >= 0; - break; - default: - PyErr_BadArgument(); - return NULL; - } - res = ok ? Py_True : Py_False; - Py_INCREF(res); - return res; -} - diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp index 165a85e2c14..75a7c9b8aeb 100644 --- a/source/gameengine/Ketsji/KX_PythonSeq.cpp +++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp @@ -340,24 +340,42 @@ static PyObject *KX_PythonSeq_nextIter(KX_PythonSeq *self) } -static int KX_PythonSeq_compare( KX_PythonSeq * a, KX_PythonSeq * b ) /* TODO - python3.x wants richcmp */ +static int KX_PythonSeq_compare( KX_PythonSeq * a, KX_PythonSeq * b ) { return ( a->type == b->type && a->base == b->base) ? 0 : -1; } -extern PyObject *Py_CmpToRich(int op, int cmp); - static PyObject *KX_PythonSeq_richcmp(PyObject *a, PyObject *b, int op) { - int cmp_result= -1; /* assume false */ + PyObject *res; + int ok= -1; /* zero is true */ + + if(BPy_KX_PythonSeq_Check(a) && BPy_KX_PythonSeq_Check(b)) + ok= KX_PythonSeq_compare((KX_PythonSeq *)a, (KX_PythonSeq *)b); - if(BPy_KX_PythonSeq_Check(a) && BPy_KX_PythonSeq_Check(b)) { - cmp_result= KX_PythonSeq_compare((KX_PythonSeq *)a, (KX_PythonSeq *)b); + switch (op) { + case Py_NE: + ok = !ok; /* pass through */ + case Py_EQ: + res = ok ? Py_False : Py_True; + break; + + case Py_LT: + case Py_LE: + case Py_GT: + case Py_GE: + res = Py_NotImplemented; + break; + default: + PyErr_BadArgument(); + return NULL; } - return Py_CmpToRich(op, cmp_result); + Py_INCREF(res); + return res; } + /* * repr function * convert to a list and get its string value From 6239d18d50911959a8d5a40056ef87e7253cc70e Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Thu, 3 Sep 2009 02:55:23 +0000 Subject: [PATCH 401/577] BlenderPlayer linking again for cmake - 148 errors gone. After talking with Ton and Campbell we agreed that it wouldn't hurt to have blenderplayer again (specially now since BGE is almost 100% working in 2.5). However in order to make it link, I needed to bring back stubs, a lot of so-called bad calls. I'm not sure how we should proceed from here, but it looks like people could start to take a look at source/blenderplayer/bad_level_calls_stubs/stubs.c and fix their own modules/functions ** NOTE: I removed the sound calls from BlenderPlayer. In order to fix it look at //XXX ADD SOUND in GPG_Application.cpp and GPC_Engine *** tested in CMake+MSVC. - Scons is not building !!! (why does the building systems have to be so different?) And someone may like to fix make. (take a look at /trunk/source/blender/blenkernel/bad_level_call_stubs/Makefile ) **** it may work better inside /source/gameengine/GamePlayer --- blenderplayer/CMakeLists.txt | 4 + .../bad_level_call_stubs/CMakeLists.txt | 40 ++++ blenderplayer/bad_level_call_stubs/Makefile | 45 +++++ blenderplayer/bad_level_call_stubs/SConscript | 14 ++ blenderplayer/bad_level_call_stubs/stubs.c | 179 ++++++++++++++++++ .../GamePlayer/common/GPC_Engine.cpp | 6 +- .../GamePlayer/ghost/GPG_Application.cpp | 18 +- 7 files changed, 302 insertions(+), 4 deletions(-) create mode 100644 blenderplayer/bad_level_call_stubs/CMakeLists.txt create mode 100644 blenderplayer/bad_level_call_stubs/Makefile create mode 100644 blenderplayer/bad_level_call_stubs/SConscript create mode 100644 blenderplayer/bad_level_call_stubs/stubs.c diff --git a/blenderplayer/CMakeLists.txt b/blenderplayer/CMakeLists.txt index 0407361b845..35d26662f2f 100644 --- a/blenderplayer/CMakeLists.txt +++ b/blenderplayer/CMakeLists.txt @@ -130,4 +130,8 @@ ELSE(UNIX) TARGET_LINK_LIBRARIES(blenderplayer ${BLENDER_LINK_LIBS}) ENDIF(UNIX) +IF(WITH_PLAYER) + ADD_SUBDIRECTORY(bad_level_call_stubs) +ENDIF(WITH_PLAYER) + SETUP_LIBLINKS(blenderplayer) diff --git a/blenderplayer/bad_level_call_stubs/CMakeLists.txt b/blenderplayer/bad_level_call_stubs/CMakeLists.txt new file mode 100644 index 00000000000..abb086b072a --- /dev/null +++ b/blenderplayer/bad_level_call_stubs/CMakeLists.txt @@ -0,0 +1,40 @@ +# $Id$ +# ***** 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) 2006, Blender Foundation +# All rights reserved. +# +# The Original Code is: all of this file. +# +# Contributor(s): Jacques Beaurain. +# +# ***** END GPL LICENSE BLOCK ***** + +FILE(GLOB SRC stubs.c) + +SET(INC + . + .. + ../../source/blender/makesdna + ../../source/blender/makesrna +) + +IF(WITH_INTERNATIONAL) + ADD_DEFINITIONS(-DWITH_FREETYPE2) +ENDIF(WITH_INTERNATIONAL) + +BLENDERLIB_NOLIST(blenkernel_blc "${SRC}" "${INC}") diff --git a/blenderplayer/bad_level_call_stubs/Makefile b/blenderplayer/bad_level_call_stubs/Makefile new file mode 100644 index 00000000000..1d9f6a27327 --- /dev/null +++ b/blenderplayer/bad_level_call_stubs/Makefile @@ -0,0 +1,45 @@ +# +# $Id$ +# +# ***** 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 = blenkernel_blc +DIR = $(OCGDIR)/blenderplayer/$(LIBNAME) + +include nan_compile.mk + +CFLAGS += $(LEVEL_2_C_WARNINGS) +CFLAGS += $(FIX_STUBS_WARNINGS) + +CPPFLAGS += $(OGL_CPPFLAGS) +CPPFLAGS += -I../../source/blender/makesdna +CPPFLAGS += -I../../source/blender/makesrna + +# path to our own external headerfiles +CPPFLAGS += -I.. + diff --git a/blenderplayer/bad_level_call_stubs/SConscript b/blenderplayer/bad_level_call_stubs/SConscript new file mode 100644 index 00000000000..bd3df38b557 --- /dev/null +++ b/blenderplayer/bad_level_call_stubs/SConscript @@ -0,0 +1,14 @@ +#!/usr/bin/python +Import ('env') + +sources = 'stubs.c' + +incs = '. ..' +incs += '../../source/blender/makesdna' +incs += '../../source/blender/makesrna' + +defs = '' +if env['WITH_BF_INTERNATIONAL']: + defs += 'WITH_FREETYPE2' + +env.BlenderLib ('blenkernel_blc', sources = Split(sources), includes=Split(incs), defines=Split(defs), libtype='player',priority=225 ) diff --git a/blenderplayer/bad_level_call_stubs/stubs.c b/blenderplayer/bad_level_call_stubs/stubs.c new file mode 100644 index 00000000000..b3c18784ccd --- /dev/null +++ b/blenderplayer/bad_level_call_stubs/stubs.c @@ -0,0 +1,179 @@ +/** + * $Id$ + * + * ***** 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 ***** + * BKE_bad_level_calls function stubs + */ + +#include +#include "dna_listbase.h" +#include "RNA_types.h" + +/*new render funcs */ +float *RE_RenderLayerGetPass(struct RenderLayer *rl, int passtype) {return NULL;} +float RE_filter_value(int type, float x) {return 0.0f;} +struct RenderLayer *RE_GetRenderLayer(struct RenderResult *rr, const char *name) {return (struct RenderLayer *)NULL;} + +/* zbuf.c stub */ +void antialias_tagbuf(int xsize, int ysize, char *rectmove) {} +void RE_zbuf_accumulate_vecblur(struct NodeBlurData *nbd, int xsize, int ysize, float *newrect, float *imgrect, float *vecbufrect, float *zbufrect) {} + +/* imagetexture.c stub */ +void ibuf_sample(struct ImBuf *ibuf, float fx, float fy, float dx, float dy, float *result) {} + +/* texture.c */ +int multitex_thread(struct Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, struct TexResult *texres, short thread, short which_output) {return 0;} +int multitex_ext(struct Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, struct TexResult *texres){return 0;} + +/* nodes */ +struct RenderResult *RE_GetResult(struct Render *re){return (struct RenderResult *) NULL;} +struct Render *RE_GetRender(const char *name){return (struct Render *) NULL;} + +/* blenkernel */ +char* btempdir(){return NULL;} +void RE_FreeRenderResult(struct RenderResult *res){} +char* datatoc_bmonofont_ttf(){return NULL;} +int datatoc_bmonofont_ttf_size(){return 0;} +struct RenderResult *RE_MultilayerConvert(void *exrhandle, int rectx, int recty){return (struct RenderResult *) NULL;} +void RE_GetResultImage(struct Render *re, struct RenderResult *rr){} +int RE_RenderInProgress(struct Render *re){return 0;} +struct Scene *RE_GetScene(struct Render *re){return (struct Scene *) NULL;} +void RE_Database_Free(struct Render *re){} +void RE_FreeRender(struct Render *re){} +void RE_shade_external(struct Render *re, struct ShadeInput *shi, struct ShadeResult *shr){} +void RE_DataBase_GetView(struct Render *re, float mat[][4]){} +int externtex(struct MTex *mtex, float *vec, float *tin, float *tr, float *tg, float *tb, float *ta){return 0;} +float texture_value_blend(float tex, float out, float fact, float facg, int blendtype, int flip){return 0.0f;} +void texture_rgb_blend(float *in, float *tex, float *out, float fact, float facg, int blendtype){} +char stipple_quarttone[1]; //GLubyte stipple_quarttone[128] +double elbeemEstimateMemreq(int res, float sx, float sy, float sz, int refine, char *retstr) {return 0.0f;} +char bprogname[]=""; + +/* rna */ +void WM_event_add_notifier(const struct bContext *C, unsigned int type, void *reference){} +void ED_armature_bone_rename(struct bArmature *arm, char *oldnamep, char *newnamep){} +void object_test_constraints (struct Object *owner){} +void ED_object_parent(struct Object *ob, struct Object *par, int type, const char *substr){} +void ED_node_composit_default(struct Scene *sce){} + +struct EditBone *ED_armature_bone_get_mirrored(struct ListBase *edbo, struct EditBone *ebo){return (struct EditBone *) NULL;} +struct ListBase *get_active_constraints (struct Object *ob){return (struct ListBase *) NULL;} +int ED_pose_channel_in_IK_chain(struct Object *ob, struct bPoseChannel *pchan){return 0;} + +int ED_space_image_show_uvedit(struct SpaceImage *sima, struct Object *obedit){return 0;} +int ED_space_image_show_render(struct SpaceImage *sima){return 0;} +int ED_space_image_show_paint(struct SpaceImage *sima){return 0;} +void ED_space_image_set(struct bContext *C, struct SpaceImage *sima, struct Scene *scene, struct Object *obedit, struct Image *ima){} +struct ImBuf *ED_space_image_buffer(struct SpaceImage *sima){return (struct ImBuf *) NULL;} + +struct PTCacheEdit *PE_get_current(struct Scene *scene, struct Object *ob){return (struct PTCacheEdit *) NULL;} + +/* rna editors */ +char *ED_info_stats_string(struct Scene *scene){return NULL;} +void ED_area_tag_redraw(struct ScrArea *sa){} +void WM_event_add_fileselect(struct bContext *C, struct wmOperator *op){} +void ED_node_texture_default(struct Tex *tx){} +int text_file_modified(struct Text *text){return 0;} +void ED_node_shader_default(struct Material *ma){} +void ED_screen_animation_timer_update(struct bContext *C, int redraws){} +int ED_object_modifier_remove(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct ModifierData *md){return 0;} +int ED_object_modifier_add(struct ReportList *reports, struct Scene *scene, struct Object *ob, int type){return 0;} +int uiLayoutGetActive(struct uiLayout *layout){return 0;} +int uiLayoutGetOperatorContext(struct uiLayout *layout){return 0;} +int uiLayoutGetAlignment(struct uiLayout *layout){return 0;} +int uiLayoutGetEnabled(struct uiLayout *layout){return 0;} +float uiLayoutGetScaleX(struct uiLayout *layout){return 0.0f;} +float uiLayoutGetScaleY(struct uiLayout *layout){return 0.0f;} +void uiLayoutSetActive(struct uiLayout *layout, int active){} +void uiLayoutSetOperatorContext(struct uiLayout *layout, int opcontext){} +void uiLayoutSetEnabled(struct uiLayout *layout, int enabled){} +void uiLayoutSetAlignment(struct uiLayout *layout, int alignment){} +void uiLayoutSetScaleX(struct uiLayout *layout, float scale){} +void uiLayoutSetScaleY(struct uiLayout *layout, float scale){} + +void uiItemR(struct uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, int flag){} + +PointerRNA uiItemFullO(struct uiLayout *layout, char *name, int icon, char *idname, struct IDProperty *properties, int context, int flag){PointerRNA a; return a;} +struct uiLayout *uiLayoutRow(struct uiLayout *layout, int align){return (struct uiLayout *) NULL;} +struct uiLayout *uiLayoutColumn(struct uiLayout *layout, int align){return (struct uiLayout *) NULL;} +struct uiLayout *uiLayoutColumnFlow(struct uiLayout *layout, int number, int align){return (struct uiLayout *) NULL;} +struct uiLayout *uiLayoutBox(struct uiLayout *layout){return (struct uiLayout *) NULL;} +struct uiLayout *uiLayoutSplit(struct uiLayout *layout, float percentage){return (struct uiLayout *) NULL;} +void uiItemsEnumR(struct uiLayout *layout, struct PointerRNA *ptr, char *propname){} +void uiItemMenuEnumR(struct uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname){} +void uiItemEnumR_string(struct uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, char *value){} +void uiItemPointerR(struct uiLayout *layout, char *name, int icon, struct PointerRNA *ptr, char *propname, struct PointerRNA *searchptr, char *searchpropname){} +void uiItemsEnumO(struct uiLayout *layout, char *opname, char *propname){} +void uiItemEnumO_string(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, char *value_str){} +void uiItemMenuEnumO(struct uiLayout *layout, char *name, int icon, char *opname, char *propname){} +void uiItemBooleanO(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, int value){} +void uiItemIntO(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, int value){} +void uiItemFloatO(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, float value){} +void uiItemStringO(struct uiLayout *layout, char *name, int icon, char *opname, char *propname, char *value){} +void uiItemL(struct uiLayout *layout, char *name, int icon){} +void uiItemM(struct uiLayout *layout, struct bContext *C, char *name, int icon, char *menuname){} +void uiItemS(struct uiLayout *layout){} +void uiLayoutSetContextPointer(struct uiLayout *layout, char *name, struct PointerRNA *ptr){} + +/* rna template */ +void uiTemplateHeader(struct uiLayout *layout, struct bContext *C, int menus){} +void uiTemplateID(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, char *newop, char *unlinkop){} +struct uiLayout *uiTemplateModifier(struct uiLayout *layout, struct PointerRNA *ptr){return (struct uiLayout *) NULL;} +struct uiLayout *uiTemplateConstraint(struct uiLayout *layout, struct PointerRNA *ptr){return (struct uiLayout *) NULL;} +void uiTemplatePreview(struct uiLayout *layout, struct ID *id, struct ID *parent, struct MTex *slot){} +void uiTemplateCurveMapping(struct uiLayout *layout, struct CurveMapping *cumap, int type, int compact){} +void uiTemplateColorRamp(struct uiLayout *layout, struct ColorBand *coba, int expand){} +void uiTemplateLayers(struct uiLayout *layout, struct PointerRNA *ptr, char *propname){} +void uiTemplateTriColorSet(struct uiLayout *layout, struct PointerRNA *ptr, char *propname){} +void uiTemplateImageLayers(struct uiLayout *layout, struct bContext *C, struct Image *ima, struct ImageUser *iuser){} +ListBase uiTemplateList(struct uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, struct PointerRNA *activeptr, char *activepropname, int rows, int listtype){struct ListBase b = {0,0}; return b;} +void uiTemplateRunningJobs(struct uiLayout *layout, struct bContext *C){} +void uiTemplateOperatorSearch(struct uiLayout *layout){} +void uiTemplateHeader3D(struct uiLayout *layout, struct bContext *C){} +void uiTemplate_view3d_select_faceselmenu(struct uiLayout *layout, struct bContext *C){} +void uiTemplateTextureImage(struct uiLayout *layout, struct bContext *C, struct Tex *tex){} + +/* rna render */ +struct RenderResult *RE_engine_begin_result(struct RenderEngine *engine, int x, int y, int w, int h){return (struct RenderResult *) NULL;} +void RE_engine_update_result(struct RenderEngine *engine, struct RenderResult *result){} +void RE_engine_end_result(struct RenderEngine *engine, struct RenderResult *result){} +void RE_engine_update_stats(struct RenderEngine *engine, char *stats, char *info){} +void RE_layer_load_from_file(struct RenderLayer *layer, struct ReportList *reports, char *filename){} +void RE_result_load_from_file(struct RenderResult *result, struct ReportList *reports, char *filename){} +int RE_engine_test_break(struct RenderEngine *engine){return 0;} + +/* python */ +struct wmOperatorType *WM_operatortype_find(const char *idname, int quiet){return (struct wmOperatorType *) NULL;} +struct wmOperatorType *WM_operatortype_first(){return (struct wmOperatorType *) NULL;} +struct wmOperatorType *WM_operatortype_exists(const char *idname){return (struct wmOperatorType *) NULL;} +int WM_operator_call_py(struct bContext *C, struct wmOperatorType *ot, struct PointerRNA *properties, struct ReportList *reports){return 0;} +int WM_operatortype_remove(const char *idname){return 0;} +void WM_operator_properties_free(struct PointerRNA *ptr){} +void WM_operator_properties_create(struct PointerRNA *ptr, const char *opstring){} +void WM_operatortype_append_ptr(void (*opfunc)(struct wmOperatorType*, void*), void *userdata){} +void WM_operator_bl_idname(char *to, const char *from){} +short insert_keyframe (struct ID *id, struct bAction *act, const char group[], const char rna_path[], int array_index, float cfra, short flag){return 0;} + diff --git a/source/gameengine/GamePlayer/common/GPC_Engine.cpp b/source/gameengine/GamePlayer/common/GPC_Engine.cpp index a46f30c1209..9ccb55f37bc 100644 --- a/source/gameengine/GamePlayer/common/GPC_Engine.cpp +++ b/source/gameengine/GamePlayer/common/GPC_Engine.cpp @@ -58,7 +58,9 @@ #include "NG_LoopBackNetworkDeviceInterface.h" #include "RAS_IRenderTools.h" -#include "SND_DeviceManager.h" +#if 0 //XXX - ADD SOUND + #include "SND_DeviceManager.h" +#endif #include "GPC_Engine.h" #include "GPC_KeyboardDevice.h" @@ -339,8 +341,10 @@ void GPC_Engine::Exit() if (m_audiodevice) { +#if 0 //XXX - ADD SOUND SND_DeviceManager::Unsubscribe(); m_audiodevice = 0; +#endif } m_initialized = false; diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index c9a2e81bdae..879c2264247 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -84,7 +84,10 @@ extern "C" #include "KX_BlenderSceneConverter.h" #include "NG_LoopBackNetworkDeviceInterface.h" -#include "SND_DeviceManager.h" + +#if 0 //XXX - ADD SOUND + #include "SND_DeviceManager.h" +#endif #include "GPC_MouseDevice.h" #include "GPC_RenderTools.h" @@ -584,13 +587,16 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) if (!m_networkdevice) goto initFailed; +#if 0 //XXX - ADD SOUND // get an audiodevice SND_DeviceManager::Subscribe(); m_audiodevice = SND_DeviceManager::Instance(); if (!m_audiodevice) goto initFailed; m_audiodevice->UseCD(); - +#endif + + // create a ketsjisystem (only needed for timing and stuff) m_kxsystem = new GPG_System (m_system); if (!m_kxsystem) @@ -607,7 +613,9 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) m_ketsjiengine->SetRenderTools(m_rendertools); m_ketsjiengine->SetRasterizer(m_rasterizer); m_ketsjiengine->SetNetworkDevice(m_networkdevice); +#if 0 //XXX - ADD SOUND m_ketsjiengine->SetAudioDevice(m_audiodevice); +#endif m_ketsjiengine->SetTimingDisplay(frameRate, false, false); CValue::SetDeprecationWarnings(nodepwarnings); @@ -621,7 +629,9 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) return m_engineInitialized; initFailed: delete m_kxsystem; +#if 0 // XXX - ADD SOUND delete m_audiodevice; +#endif delete m_networkdevice; delete m_mouse; delete m_keyboard; @@ -680,7 +690,7 @@ bool GPG_Application::startEngine(void) KX_Scene* startscene = new KX_Scene(m_keyboard, m_mouse, m_networkdevice, - m_audiodevice, +// m_audiodevice, // XXX ADD SOUND startscenename, m_startScene); @@ -783,8 +793,10 @@ void GPG_Application::exitEngine() } if (m_audiodevice) { +#if 0 //XXX - ADD SOUND SND_DeviceManager::Unsubscribe(); m_audiodevice = 0; +#endif } if (m_networkdevice) { From 8d407b7b28242fbccb6f314f02056bcab753a67a Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 3 Sep 2009 05:12:34 +0000 Subject: [PATCH 402/577] Grease Pencil: Datablock bugfixes * Grease Pencil datablocks can now be properly browsed/added/unlinked from the UI panels * Made Grease Pencil use the brush icon for now. A proper icon for this would be nice ;) --- source/blender/editors/gpencil/gpencil_buttons.c | 11 +++++++---- source/blender/makesrna/intern/rna_ID.c | 1 + source/blender/makesrna/intern/rna_gpencil.c | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c index c3f779b59b8..0d7cd263245 100644 --- a/source/blender/editors/gpencil/gpencil_buttons.c +++ b/source/blender/editors/gpencil/gpencil_buttons.c @@ -238,12 +238,15 @@ static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, Poi col= uiLayoutColumn(layout, 0); /* current Grease Pencil block */ // TODO: show some info about who owns this? - //uiTemplateID(col, C, ctx_ptr, "grease_pencil", "GPENCIL_OT_data_new", "GPENCIL_OT_data_unlink"); // XXX not working - uiItemR(col, NULL, 0, ctx_ptr, "grease_pencil", 0); // XXX this will have to do for now... + uiTemplateID(col, C, ctx_ptr, "grease_pencil", "GPENCIL_OT_data_add", "GPENCIL_OT_data_unlink"); - /* add new layer button */ + /* add new layer button - can be used even when no data, since it can add a new block too */ uiItemO(col, NULL, 0, "GPENCIL_OT_layer_add"); + /* sanity checks... */ + if (gpd == NULL) + return; + /* draw each layer --------------------------------------------- */ for (gpl= gpd->layers.first; gpl; gpl= gpl->next) { col= uiLayoutColumn(layout, 1); @@ -271,7 +274,7 @@ void gpencil_panel_standard(const bContext *C, Panel *pa) /* get pointer to Grease Pencil Data */ gpd_ptr= gpencil_data_get_pointers((bContext *)C, &ptr); - if (gpd_ptr && *gpd_ptr) + if (gpd_ptr) draw_gpencil_panel((bContext *)C, pa->layout, *gpd_ptr, &ptr); } diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index dd26391b11e..f5c6063e892 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -65,6 +65,7 @@ short RNA_type_to_ID_code(StructRNA *type) if(RNA_struct_is_a(type, &RNA_Brush)) return ID_BR; if(RNA_struct_is_a(type, &RNA_Camera)) return ID_CA; if(RNA_struct_is_a(type, &RNA_Curve)) return ID_CU; + if(RNA_struct_is_a(type, &RNA_GreasePencil)) return ID_GD; if(RNA_struct_is_a(type, &RNA_Group)) return ID_GR; if(RNA_struct_is_a(type, &RNA_Image)) return ID_IM; if(RNA_struct_is_a(type, &RNA_Key)) return ID_KE; diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index df0e5ae6703..5caa868fd2e 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -223,7 +223,7 @@ void rna_def_gpencil_data(BlenderRNA *brna) srna= RNA_def_struct(brna, "GreasePencil", "ID"); RNA_def_struct_sdna(srna, "bGPdata"); RNA_def_struct_ui_text(srna, "Grease Pencil", "Freehand annotation sketchbook."); - //RNA_def_struct_ui_icon(srna, ICON_GPENCIL); + RNA_def_struct_ui_icon(srna, ICON_BRUSH_DATA); // XXX: ICON_GPENCIL!!! /* Layers */ prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE); From 99fbcbcf4d97c83e3c2d976244919889278a9366 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 3 Sep 2009 06:34:03 +0000 Subject: [PATCH 403/577] changes needed for building the blenderplayer with cmake on linux. --- SConstruct | 3 --- blenderplayer/CMakeLists.txt | 12 ++++++++--- blenderplayer/bad_level_call_stubs/stubs.c | 25 ++++++++++++++++++++-- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/SConstruct b/SConstruct index 5a64cd7c117..ec302d90fce 100644 --- a/SConstruct +++ b/SConstruct @@ -402,9 +402,6 @@ dobj = B.buildinfo(env, "dynamic") + B.resources thestatlibs, thelibincs = B.setup_staticlibs(env) thesyslibs = B.setup_syslibs(env) -if env['WITH_BF_PLAYER']: - print("Warning: Game player may not build on 2.5") - if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']: #env.BlenderProg(B.root_build_dir, "blender", dobj , [], mainlist + thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender') env.BlenderProg(B.root_build_dir, "blender", dobj + mainlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender') diff --git a/blenderplayer/CMakeLists.txt b/blenderplayer/CMakeLists.txt index 35d26662f2f..030d9dbbba0 100644 --- a/blenderplayer/CMakeLists.txt +++ b/blenderplayer/CMakeLists.txt @@ -80,11 +80,11 @@ IF(UNIX) bf_oglrasterizer bf_expressions bf_scenegraph - bf_IK + bf_IK bf_moto bf_kernel bf_nodes - bf_gpu + bf_gpu bf_imbuf bf_avi kx_network @@ -93,15 +93,21 @@ IF(UNIX) extern_bullet bf_guardedalloc bf_memutil + bf_python + bf_gen_python bf_blenlib bf_cineon bf_openexr extern_libopenjpeg bf_dds bf_readblenfile + bf_dna + bf_rna + bf_blenfont + bf_audaspace blenkernel_blc extern_binreloc - extern_glew + extern_glew ) IF(WITH_QUICKTIME) diff --git a/blenderplayer/bad_level_call_stubs/stubs.c b/blenderplayer/bad_level_call_stubs/stubs.c index b3c18784ccd..2db012ebcea 100644 --- a/blenderplayer/bad_level_call_stubs/stubs.c +++ b/blenderplayer/bad_level_call_stubs/stubs.c @@ -29,7 +29,7 @@ */ #include -#include "dna_listbase.h" +#include "DNA_listBase.h" #include "RNA_types.h" /*new render funcs */ @@ -70,7 +70,6 @@ float texture_value_blend(float tex, float out, float fact, float facg, int blen void texture_rgb_blend(float *in, float *tex, float *out, float fact, float facg, int blendtype){} char stipple_quarttone[1]; //GLubyte stipple_quarttone[128] double elbeemEstimateMemreq(int res, float sx, float sy, float sz, int refine, char *retstr) {return 0.0f;} -char bprogname[]=""; /* rna */ void WM_event_add_notifier(const struct bContext *C, unsigned int type, void *reference){} @@ -177,3 +176,25 @@ void WM_operatortype_append_ptr(void (*opfunc)(struct wmOperatorType*, void*), v void WM_operator_bl_idname(char *to, const char *from){} short insert_keyframe (struct ID *id, struct bAction *act, const char group[], const char rna_path[], int array_index, float cfra, short flag){return 0;} +/* smoke */ +void lzo1x_1_compress(void) {return;}; +void LzmaCompress(void) {return;}; +void smoke_export(void) {return;}; +void lzo1x_decompress(void) {return;}; +void LzmaUncompress(void) {return;}; +void smoke_init(void) {return;}; +void smoke_turbulence_init(void) {return;}; +void smoke_turbulence_initBlenderRNA(void) {return;}; +void smoke_initBlenderRNA(void) {return;}; +void smoke_free(void) {return;}; +void smoke_turbulence_free(void) {return;}; +void smoke_turbulence_step(void) {return;}; +void smoke_dissolve(void) {return;}; +void smoke_get_density(void) {return;}; +void smoke_get_heat(void) {return;}; +void smoke_get_velocity_x(void) {return;}; +void smoke_get_velocity_y(void) {return;}; +void smoke_get_velocity_z(void) {return;}; +void smoke_get_obstacle(void) {return;}; +void smoke_get_index(void) {return;}; +void smoke_step(void) {return;}; From 070f12d0ddd186769b0c0760e5ccd2de08d1e493 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 3 Sep 2009 07:12:41 +0000 Subject: [PATCH 404/577] sound init/exit so at least the player opens --- source/gameengine/GamePlayer/common/GPC_Engine.cpp | 2 +- source/gameengine/GamePlayer/ghost/GPG_ghost.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source/gameengine/GamePlayer/common/GPC_Engine.cpp b/source/gameengine/GamePlayer/common/GPC_Engine.cpp index 9ccb55f37bc..f131987095a 100644 --- a/source/gameengine/GamePlayer/common/GPC_Engine.cpp +++ b/source/gameengine/GamePlayer/common/GPC_Engine.cpp @@ -343,8 +343,8 @@ void GPC_Engine::Exit() { #if 0 //XXX - ADD SOUND SND_DeviceManager::Unsubscribe(); - m_audiodevice = 0; #endif + m_audiodevice = 0; } m_initialized = false; diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index 2433c587179..d399d6b3443 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -59,6 +59,7 @@ extern "C" #include "BKE_icons.h" #include "BKE_node.h" #include "BKE_report.h" +#include "BKE_sound.h" #include "BLI_blenlib.h" #include "DNA_scene_types.h" #include "BLO_readfile.h" @@ -358,6 +359,8 @@ int main(int argc, char** argv) quicktime_init(); #endif + sound_init(); + libtiff_init(); // Parse command line options @@ -818,6 +821,8 @@ int main(int argc, char** argv) } free_nodesystem(); + + sound_exit(); return error ? -1 : 0; } From 40c89b5c6ee639539fdc74e669d92152e9e9fc06 Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Thu, 3 Sep 2009 10:34:54 +0000 Subject: [PATCH 405/577] Missing header include for non-linux OS "BLI_exist()" --- source/blender/python/intern/bpy_interface.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index ac8acc2c07c..a935b517f77 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -55,6 +55,7 @@ #include "MEM_guardedalloc.h" #include "BLI_util.h" +#include "BLI_storage.h" #include "BLI_fileops.h" #include "BLI_string.h" From 78425fb6577e7d1a27e331daacf48c7c53422efd Mon Sep 17 00:00:00 2001 From: Michael Fox Date: Thu, 3 Sep 2009 10:42:53 +0000 Subject: [PATCH 406/577] 2.5 ***** first commit in a long time, and its great to be back! commited Select Mirror operator for objects eg. L.sword->R.sword added to 3dview select menu aswel the hotkey is shift-ctrl-m (hope its not taken) --- release/ui/space_view3d.py | 1 + source/blender/editors/object/object_edit.c | 161 ++++++++++++++++++ source/blender/editors/object/object_intern.h | 1 + source/blender/editors/object/object_ops.c | 2 + 4 files changed, 165 insertions(+) diff --git a/release/ui/space_view3d.py b/release/ui/space_view3d.py index c5c1abf1d40..8477e52acab 100644 --- a/release/ui/space_view3d.py +++ b/release/ui/space_view3d.py @@ -167,6 +167,7 @@ class VIEW3D_MT_select_OBJECT(bpy.types.Menu): layout.itemO("object.select_all_toggle", text="Select/Deselect All") layout.itemO("object.select_inverse", text="Inverse") layout.itemO("object.select_random", text="Random") + layout.itemO("object.select_mirror", text="Mirror") layout.itemO("object.select_by_layer", text="Select All by Layer") layout.item_enumO("object.select_by_type", "type", "", text="Select All by Type...") layout.itemO("object.select_grouped", text="Select Grouped...") diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 04187c93196..33ecb144f13 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include "MEM_guardedalloc.h" @@ -2189,6 +2191,165 @@ void OBJECT_OT_select_all_toggle(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } +/* ****** select mirror *******/ +/* finds the best possible flipped name. For renaming; check for unique names afterwards */ +/* if strip_number: removes number extensions */ +void object_flip_name (char *name) +{ + int len; + char prefix[128]={""}; /* The part before the facing */ + char suffix[128]={""}; /* The part after the facing */ + char replace[128]={""}; /* The replacement string */ + char number[128]={""}; /* The number extension string */ + char *index=NULL; + + len= strlen(name); + if(len<3) return; // we don't do names like .R or .L + + /* We first check the case with a .### extension, let's find the last period */ + if(isdigit(name[len-1])) { + index= strrchr(name, '.'); // last occurrance + if (index && isdigit(index[1]) ) { // doesnt handle case bone.1abc2 correct..., whatever! + strcpy(number, index); + *index= 0; + len= strlen(name); + } + } + + strcpy (prefix, name); + +#define IS_SEPARATOR(a) ((a)=='.' || (a)==' ' || (a)=='-' || (a)=='_') + + /* first case; separator . - _ with extensions r R l L */ + if( IS_SEPARATOR(name[len-2]) ) { + switch(name[len-1]) { + case 'l': + prefix[len-1]= 0; + strcpy(replace, "r"); + break; + case 'r': + prefix[len-1]= 0; + strcpy(replace, "l"); + break; + case 'L': + prefix[len-1]= 0; + strcpy(replace, "R"); + break; + case 'R': + prefix[len-1]= 0; + strcpy(replace, "L"); + break; + } + } + /* case; beginning with r R l L , with separator after it */ + else if( IS_SEPARATOR(name[1]) ) { + switch(name[0]) { + case 'l': + strcpy(replace, "r"); + strcpy(suffix, name+1); + prefix[0]= 0; + break; + case 'r': + strcpy(replace, "l"); + strcpy(suffix, name+1); + prefix[0]= 0; + break; + case 'L': + strcpy(replace, "R"); + strcpy(suffix, name+1); + prefix[0]= 0; + break; + case 'R': + strcpy(replace, "L"); + strcpy(suffix, name+1); + prefix[0]= 0; + break; + } + } + else if(len > 5) { + /* hrms, why test for a separator? lets do the rule 'ultimate left or right' */ + index = BLI_strcasestr(prefix, "right"); + if (index==prefix || index==prefix+len-5) { + if(index[0]=='r') + strcpy (replace, "left"); + else { + if(index[1]=='I') + strcpy (replace, "LEFT"); + else + strcpy (replace, "Left"); + } + *index= 0; + strcpy (suffix, index+5); + } + else { + index = BLI_strcasestr(prefix, "left"); + if (index==prefix || index==prefix+len-4) { + if(index[0]=='l') + strcpy (replace, "right"); + else { + if(index[1]=='E') + strcpy (replace, "RIGHT"); + else + strcpy (replace, "Right"); + } + *index= 0; + strcpy (suffix, index+4); + } + } + } + +#undef IS_SEPARATOR + + sprintf (name, "%s%s%s%s", prefix, replace, suffix, number); +} + +static int object_select_mirror_exec(bContext *C, wmOperator *op) +{ + char tmpname[32]; + short seltype; + + seltype = RNA_enum_get(op->ptr, "seltype"); + + CTX_DATA_BEGIN(C, Base*, primbase, selected_bases) { + + strcpy(tmpname, primbase->object->id.name+2); + object_flip_name(tmpname); + + CTX_DATA_BEGIN(C, Base*, secbase, visible_bases) { + if(!strcmp(secbase->object->id.name+2, tmpname)) { + ED_base_object_select(secbase, BA_SELECT); + } + } + CTX_DATA_END; + + if (seltype == 0) ED_base_object_select(primbase, BA_DESELECT); + + } + CTX_DATA_END; + + /* undo? */ + WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, CTX_data_scene(C)); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_select_mirror(wmOperatorType *ot) +{ + + /* identifiers */ + ot->name= "Select Mirror"; + ot->description = "Select the Mirror objects of the selected object eg. L.sword -> R.sword"; + ot->idname= "OBJECT_OT_select_mirror"; + + /* api callbacks */ + ot->exec= object_select_mirror_exec; + ot->poll= ED_operator_scene_editable; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + RNA_def_enum(ot->srna, "seltype", prop_select_types, 1, "Selection", "Extend selection or clear selection then select"); +} /* ****** random selection *******/ static int object_select_random_exec(bContext *C, wmOperator *op) diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index 82bbb34f59a..27f80186bf9 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -54,6 +54,7 @@ void OBJECT_OT_select_by_type(struct wmOperatorType *ot); void OBJECT_OT_select_by_layer(struct wmOperatorType *ot); void OBJECT_OT_select_linked(struct wmOperatorType *ot); void OBJECT_OT_select_grouped(struct wmOperatorType *ot); +void OBJECT_OT_select_mirror(struct wmOperatorType *ot); void OBJECT_OT_location_clear(struct wmOperatorType *ot); void OBJECT_OT_rotation_clear(struct wmOperatorType *ot); void OBJECT_OT_scale_clear(struct wmOperatorType *ot); diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 73dad7895a1..5e90ed85625 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -79,6 +79,7 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_select_by_layer); WM_operatortype_append(OBJECT_OT_select_linked); WM_operatortype_append(OBJECT_OT_select_grouped); + WM_operatortype_append(OBJECT_OT_select_mirror); WM_operatortype_append(OBJECT_OT_location_clear); WM_operatortype_append(OBJECT_OT_rotation_clear); WM_operatortype_append(OBJECT_OT_scale_clear); @@ -192,6 +193,7 @@ void ED_keymap_object(wmWindowManager *wm) WM_keymap_add_item(keymap, "OBJECT_OT_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "OBJECT_OT_select_linked", LKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "OBJECT_OT_select_grouped", GKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "OBJECT_OT_select_mirror", MKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); WM_keymap_verify_item(keymap, "OBJECT_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_verify_item(keymap, "OBJECT_OT_parent_clear", PKEY, KM_PRESS, KM_ALT, 0); From 92395bb93cf862c5d19a40942ba3c8fbc94de962 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Thu, 3 Sep 2009 12:20:59 +0000 Subject: [PATCH 407/577] 2.5 - A few bugfixes... * Autoside renaming tools in EditMode for armatures now works again. (Wrong property name) * Action used by NLA Strips can now be chosen/changed to another action --- release/ui/buttons_data_bone.py | 1 + release/ui/space_view3d.py | 6 +++--- source/blender/editors/armature/editarmature.c | 4 ++-- source/blender/editors/space_nla/nla_buttons.c | 3 ++- source/blender/makesrna/intern/rna_nla.c | 1 + 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/release/ui/buttons_data_bone.py b/release/ui/buttons_data_bone.py index 8098648886b..276ca066af5 100644 --- a/release/ui/buttons_data_bone.py +++ b/release/ui/buttons_data_bone.py @@ -80,6 +80,7 @@ class BONE_PT_bone(BoneButtonsPanel): if not bone: bone = context.edit_bone + pchan = None else: pchan = ob.pose.pose_channels[context.bone.name] diff --git a/release/ui/space_view3d.py b/release/ui/space_view3d.py index 8477e52acab..1d7ea280222 100644 --- a/release/ui/space_view3d.py +++ b/release/ui/space_view3d.py @@ -1069,9 +1069,9 @@ class VIEW3D_MT_edit_ARMATURE(bpy.types.Menu): layout.itemS() - layout.item_enumO("armature.autoside_names", "axis", 'XAXIS', text="AutoName Left/Right") - layout.item_enumO("armature.autoside_names", "axis", 'YAXIS', text="AutoName Front/Back") - layout.item_enumO("armature.autoside_names", "axis", 'ZAXIS', text="AutoName Top/Bottom") + layout.item_enumO("armature.autoside_names", "type", 'XAXIS', text="AutoName Left/Right") + layout.item_enumO("armature.autoside_names", "type", 'YAXIS', text="AutoName Front/Back") + layout.item_enumO("armature.autoside_names", "type", 'ZAXIS', text="AutoName Top/Bottom") layout.itemO("armature.flip_names") layout.itemS() diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 632f037679f..9f83733a640 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -5387,7 +5387,7 @@ static int armature_autoside_names_exec (bContext *C, wmOperator *op) Object *ob= CTX_data_edit_object(C); bArmature *arm; char newname[32]; - short axis= RNA_enum_get(op->ptr, "axis"); + short axis= RNA_enum_get(op->ptr, "type"); /* paranoia checks */ if (ELEM(NULL, ob, ob->pose)) @@ -5434,7 +5434,7 @@ void ARMATURE_OT_autoside_names (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* settings */ - RNA_def_enum(ot->srna, "axis", axis_items, 0, "Axis", "Axis tag names with."); + RNA_def_enum(ot->srna, "type", axis_items, 0, "Axis", "Axis tag names with."); } diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index 2ffca5185f2..facea34510e 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -119,6 +119,7 @@ static int nla_panel_context(const bContext *C, PointerRNA *adt_ptr, PointerRNA ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype); for (ale= anim_data.first; ale; ale= ale->next) { + // TODO: need some way to select active animdata too... if (ale->type == ANIMTYPE_NLATRACK) { NlaTrack *nlt= (NlaTrack *)ale->data; AnimData *adt= ale->adt; @@ -210,7 +211,7 @@ static void nla_panel_animdata (const bContext *C, Panel *pa) /* Active Action Properties ------------------------------------- */ /* action */ row= uiLayoutRow(layout, 1); - uiItemR(row, NULL, 0, &adt_ptr, "action", 0); + uiTemplateID(row, C, &adt_ptr, "action", NULL, NULL/*"ACT_OT_new", "ACT_OT_unlink"*/); // XXX: need to make these operators /* extrapolation */ row= uiLayoutRow(layout, 1); diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index 98fdf4a6878..690a198f12c 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -350,6 +350,7 @@ void rna_def_nlastrip(BlenderRNA *brna) /* Action */ prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "act"); + RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Action", "Action referenced by this strip."); /* Action extents */ From 9250ab0619387d80964c64738334e437a92c25cf Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Thu, 3 Sep 2009 17:45:04 +0000 Subject: [PATCH 408/577] 2.5/Multires: * Added back multires delete higher levels (new operator + button) --- release/ui/buttons_data_modifier.py | 6 +++- source/blender/editors/object/object_intern.h | 1 + .../blender/editors/object/object_modifier.c | 28 +++++++++++++++++++ source/blender/editors/object/object_ops.c | 1 + 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/release/ui/buttons_data_modifier.py b/release/ui/buttons_data_modifier.py index 66c8179f990..2835f55f71a 100644 --- a/release/ui/buttons_data_modifier.py +++ b/release/ui/buttons_data_modifier.py @@ -269,7 +269,11 @@ class DATA_PT_modifiers(DataButtonsPanel): def MULTIRES(self, layout, ob, md): layout.itemR(md, "subdivision_type") - layout.itemO("object.multires_subdivide", text="Subdivide") + + row = layout.row() + row.itemO("object.multires_subdivide", text="Subdivide") + row.itemO("object.multires_higher_levels_delete", text="Delete Higher") + layout.itemR(md, "level") def PARTICLE_INSTANCE(self, layout, ob, md): diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index 27f80186bf9..8eaa388cdf0 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -109,6 +109,7 @@ void OBJECT_OT_modifier_apply(struct wmOperatorType *ot); void OBJECT_OT_modifier_convert(struct wmOperatorType *ot); void OBJECT_OT_modifier_copy(struct wmOperatorType *ot); void OBJECT_OT_multires_subdivide(struct wmOperatorType *ot); +void OBJECT_OT_multires_higher_levels_delete(struct wmOperatorType *ot); void OBJECT_OT_meshdeform_bind(struct wmOperatorType *ot); void OBJECT_OT_hook_reset(struct wmOperatorType *ot); void OBJECT_OT_hook_recenter(struct wmOperatorType *ot); diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 0b8fedd2eda..f9e2ac2f4de 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -676,6 +676,34 @@ void OBJECT_OT_modifier_copy(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } +/************* multires delete higher levels operator ****************/ + +static int multires_higher_levels_delete_exec(bContext *C, wmOperator *op) +{ + PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_MultiresModifier); + Object *ob= ptr.id.data; + MultiresModifierData *mmd= ptr.data; + + if(mmd) { + multiresModifier_del_levels(mmd, ob, 1); + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); + } + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_multires_higher_levels_delete(wmOperatorType *ot) +{ + ot->name= "Delete Higher Levels"; + ot->idname= "OBJECT_OT_multires_higher_levels_delete"; + ot->poll= ED_operator_object_active; + + ot->exec= multires_higher_levels_delete_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + /****************** multires subdivide operator *********************/ static int multires_subdivide_exec(bContext *C, wmOperator *op) diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 5e90ed85625..09a27e9e613 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -119,6 +119,7 @@ void ED_operatortypes_object(void) WM_operatortype_append(OBJECT_OT_modifier_convert); WM_operatortype_append(OBJECT_OT_modifier_copy); WM_operatortype_append(OBJECT_OT_multires_subdivide); + WM_operatortype_append(OBJECT_OT_multires_higher_levels_delete); WM_operatortype_append(OBJECT_OT_meshdeform_bind); WM_operatortype_append(OBJECT_OT_hook_reset); WM_operatortype_append(OBJECT_OT_hook_recenter); From 579b8ef6e52255ff89ce62756709217fe68f596a Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 3 Sep 2009 18:38:52 +0000 Subject: [PATCH 409/577] 2.5: fix missing LIB_NEEDLINK check in windowmanager reading, would cause crash with linking/appending. --- source/blender/blenloader/intern/readfile.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 64fabc825bc..0231d841c2b 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4355,11 +4355,14 @@ static void direct_link_windowmanager(FileData *fd, wmWindowManager *wm) static void lib_link_windowmanager(FileData *fd, Main *main) { wmWindowManager *wm; + wmWindow *win; for(wm= main->wm.first; wm; wm= wm->id.next) { - wmWindow *win; - for(win= wm->windows.first; win; win= win->next) { - win->screen= newlibadr(fd, NULL, win->screen); + if(wm->id.flag & LIB_NEEDLINK) { + for(win= wm->windows.first; win; win= win->next) + win->screen= newlibadr(fd, NULL, win->screen); + + wm->id.flag -= LIB_NEEDLINK; } } } From fc975a91484a1346049071fa9c6c8877820245cd Mon Sep 17 00:00:00 2001 From: Daniel Genrich Date: Thu, 3 Sep 2009 19:08:16 +0000 Subject: [PATCH 410/577] Bugfix for usage of uninitialized variable on windows (props_ptr.data needs to be set to NULL before calling uiItemFullO() ) - please check if this also compiles on gcc --- source/blender/editors/object/object_edit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 33ecb144f13..a5e92096ef9 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -2951,7 +2951,7 @@ static int make_proxy_invoke (bContext *C, wmOperator *op, wmEvent *evt) else if (ob->id.lib) { uiPopupMenu *pup= uiPupMenuBegin(C, "OK?", ICON_QUESTION); uiLayout *layout= uiPupMenuLayout(pup); - PointerRNA props_ptr; + PointerRNA props_ptr = {0}; /* create operator menu item with relevant properties filled in */ props_ptr= uiItemFullO(layout, op->type->name, 0, op->idname, props_ptr.data, WM_OP_EXEC_REGION_WIN, UI_ITEM_O_RETURN_PROPS); From 02f951c3a05f6586f12d129c70adffd8315ec3b7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 3 Sep 2009 22:37:09 +0000 Subject: [PATCH 411/577] allow execution mode to be given as an argument to operators from python (requested by algorith) example. bpy.ops.tfm.rotate('INVOKE_REGION_WIN', pivot=(0,1,2), ......) bpy_array.c - was too strict with types, 0 should be allowed as well as 0.0 in a float array. --- blenderplayer/bad_level_call_stubs/stubs.c | 2 +- release/ui/bpy_ops.py | 28 +++++++++- .../makesdna/DNA_windowmanager_types.h | 4 ++ source/blender/python/intern/bpy_array.c | 6 +-- source/blender/python/intern/bpy_operator.c | 35 +++--------- source/blender/windowmanager/WM_api.h | 3 +- source/blender/windowmanager/intern/wm.c | 2 +- .../windowmanager/intern/wm_event_system.c | 54 ++++++++++++------- 8 files changed, 79 insertions(+), 55 deletions(-) diff --git a/blenderplayer/bad_level_call_stubs/stubs.c b/blenderplayer/bad_level_call_stubs/stubs.c index 2db012ebcea..5ddafca5340 100644 --- a/blenderplayer/bad_level_call_stubs/stubs.c +++ b/blenderplayer/bad_level_call_stubs/stubs.c @@ -168,7 +168,7 @@ int RE_engine_test_break(struct RenderEngine *engine){return 0;} struct wmOperatorType *WM_operatortype_find(const char *idname, int quiet){return (struct wmOperatorType *) NULL;} struct wmOperatorType *WM_operatortype_first(){return (struct wmOperatorType *) NULL;} struct wmOperatorType *WM_operatortype_exists(const char *idname){return (struct wmOperatorType *) NULL;} -int WM_operator_call_py(struct bContext *C, struct wmOperatorType *ot, struct PointerRNA *properties, struct ReportList *reports){return 0;} +int WM_operator_call_py(struct bContext *C, struct wmOperatorType *ot, int context, struct PointerRNA *properties, struct ReportList *reports){return 0;} int WM_operatortype_remove(const char *idname){return 0;} void WM_operator_properties_free(struct PointerRNA *ptr){} void WM_operator_properties_create(struct PointerRNA *ptr, const char *opstring){} diff --git a/release/ui/bpy_ops.py b/release/ui/bpy_ops.py index aa9bfb460f0..dff8125fca1 100644 --- a/release/ui/bpy_ops.py +++ b/release/ui/bpy_ops.py @@ -5,6 +5,18 @@ from bpy.__ops__ import dir as op_dir from bpy.__ops__ import call as op_call from bpy.__ops__ import get_rna as op_get_rna +# Keep in sync with WM_types.h +context_dict = { + 'INVOKE_DEFAULT':0, + 'INVOKE_REGION_WIN':1, + 'INVOKE_AREA':2, + 'INVOKE_SCREEN':3, + 'EXEC_DEFAULT':4, + 'EXEC_REGION_WIN':5, + 'EXEC_AREA':6, + 'EXEC_SCREEN':7, +} + class bpy_ops(object): ''' Fake module like class. @@ -94,10 +106,22 @@ class bpy_ops_submodule_op(object): # submod.foo -> SUBMOD_OT_foo return self.module.upper() + '_OT_' + self.func - def __call__(self, **kw): + def __call__(self, *args, **kw): # Get the operator from blender - return op_call(self.idname(), kw) + if len(args) > 1: + raise ValueError("only one argument for the execution context is supported ") + + if args: + try: + context = context_dict[args[0]] + except: + raise ValueError("Expected a single context argument in: " + str(list(context_dict.keys()))) + + return op_call(self.idname(), kw, context) + + else: + return op_call(self.idname(), kw) def get_rna(self): ''' diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index 7d03bbec1ee..10f83c8b9ec 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -285,6 +285,7 @@ typedef struct wmOperator { ListBase macro; /* list of operators, can be a tree */ struct wmOperator *opm; /* current running macro, not saved */ + short flag, pad[3]; } wmOperator; @@ -295,6 +296,9 @@ typedef struct wmOperator { /* add this flag if the event should pass through */ #define OPERATOR_PASS_THROUGH 8 +/* wmOperator flag */ +#define OPERATOR_REPORT_FREE 1 + /* ************** wmEvent ************************ */ /* for read-only rna access, dont save this */ diff --git a/source/blender/python/intern/bpy_array.c b/source/blender/python/intern/bpy_array.c index d52bfda202d..669cccb7011 100644 --- a/source/blender/python/intern/bpy_array.c +++ b/source/blender/python/intern/bpy_array.c @@ -203,17 +203,17 @@ static void pyrna_py_to_boolean(PyObject *py, char *data) static int py_float_check(PyObject *py) { - return PyFloat_Check(py); + return PyFloat_Check(py) || (PyIndex_Check(py)); } static int py_int_check(PyObject *py) { - return PyLong_Check(py); + return PyLong_Check(py) || (PyIndex_Check(py)); } static int py_bool_check(PyObject *py) { - return PyBool_Check(py); + return PyBool_Check(py) || (PyIndex_Check(py)); } int pyrna_py_to_float_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, char *error_str, int error_str_size) diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index e431f2a21e9..062db42e0e9 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -40,42 +40,23 @@ #include "BKE_utildefines.h" -/* 'self' stores the operator string */ static PyObject *pyop_call( PyObject * self, PyObject * args) { wmOperatorType *ot; int error_val = 0; PointerRNA ptr; - char *opname; - PyObject *kw= NULL; + char *opname; + PyObject *kw= NULL; /* optional args */ + + /* note that context is an int, python does the conversion in this case */ + int context= WM_OP_EXEC_DEFAULT; // XXX Todo, work out a better solution for passing on context, could make a tuple from self and pack the name and Context into it... bContext *C = BPy_GetContext(); - - switch(PyTuple_Size(args)) { - case 2: - kw = PyTuple_GET_ITEM(args, 1); - - if(!PyDict_Check(kw)) { - PyErr_SetString( PyExc_AttributeError, "bpy.__ops__.call: expected second arg to be a dict"); - return NULL; - } - /* pass through */ - case 1: - opname = _PyUnicode_AsString(PyTuple_GET_ITEM(args, 0)); - - if(opname==NULL) { - PyErr_SetString( PyExc_AttributeError, "bpy.__ops__.call: expected the first arg to be a string"); - return NULL; - } - break; - default: - PyErr_SetString( PyExc_AttributeError, "bpy.__ops__.call: expected a string and optional dict"); + if (!PyArg_ParseTuple(args, "s|O!i:bpy.__ops__.call", &opname, &PyDict_Type, &kw, &context)) return NULL; - } - ot= WM_operatortype_find(opname, TRUE); @@ -88,7 +69,7 @@ static PyObject *pyop_call( PyObject * self, PyObject * args) PyErr_SetString( PyExc_SystemError, "bpy.__ops__.call: operator poll() function failed, context is incorrect"); return NULL; } - + /* WM_operator_properties_create(&ptr, opname); */ /* Save another lookup */ RNA_pointer_create(NULL, ot->srna, NULL, &ptr); @@ -102,7 +83,7 @@ static PyObject *pyop_call( PyObject * self, PyObject * args) BKE_reports_init(&reports, RPT_STORE); - WM_operator_call_py(C, ot, &ptr, &reports); + WM_operator_call_py(C, ot, context, &ptr, &reports); if(BPy_reports_to_error(&reports)) error_val = -1; diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 0f5558382c4..544804b26d6 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -165,7 +165,7 @@ wmOperatorTypeMacro *WM_operatortype_macro_define(wmOperatorType *ot, const char int WM_operator_call (struct bContext *C, struct wmOperator *op); int WM_operator_repeat (struct bContext *C, struct wmOperator *op); int WM_operator_name_call (struct bContext *C, const char *opstring, int context, struct PointerRNA *properties); -int WM_operator_call_py(struct bContext *C, struct wmOperatorType *ot, struct PointerRNA *properties, struct ReportList *reports); +int WM_operator_call_py(struct bContext *C, struct wmOperatorType *ot, int context, struct PointerRNA *properties, struct ReportList *reports); void WM_operator_properties_create(struct PointerRNA *ptr, const char *opstring); void WM_operator_properties_free(struct PointerRNA *ptr); @@ -245,6 +245,5 @@ void WM_jobs_stop_all(struct wmWindowManager *wm); char *WM_clipboard_text_get(int selection); void WM_clipboard_text_set(char *buf, int selection); - #endif /* WM_API_H */ diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index 85f8a647826..fecd5c20a15 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -69,7 +69,7 @@ void WM_operator_free(wmOperator *op) MEM_freeN(op->properties); } - if(op->reports) { + if(op->reports && (op->flag & OPERATOR_REPORT_FREE)) { BKE_reports_clear(op->reports); MEM_freeN(op->reports); } diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 6c34ed6f902..717c2d25261 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -345,11 +345,12 @@ static wmOperator *wm_operator_create(wmWindowManager *wm, wmOperatorType *ot, P /* initialize error reports */ if (reports) { - op->reports= reports; /* must be initialized alredy */ + op->reports= reports; /* must be initialized already */ } else { op->reports= MEM_mallocN(sizeof(ReportList), "wmOperatorReportList"); BKE_reports_init(op->reports, RPT_STORE); + op->flag |= OPERATOR_REPORT_FREE; } /* recursive filling of operator macro list */ @@ -392,13 +393,13 @@ static void wm_region_mouse_co(bContext *C, wmEvent *event) } } -static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, PointerRNA *properties) +static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, PointerRNA *properties, ReportList *reports) { wmWindowManager *wm= CTX_wm_manager(C); int retval= OPERATOR_PASS_THROUGH; if(wm_operator_poll(C, ot)) { - wmOperator *op= wm_operator_create(wm, ot, properties, NULL); + wmOperator *op= wm_operator_create(wm, ot, properties, reports); /* if reports==NULL, theyll be initialized */ if((G.f & G_DEBUG) && event && event->type!=MOUSEMOVE) printf("handle evt %d win %d op %s\n", event?event->type:0, CTX_wm_screen(C)->subwinactive, ot->idname); @@ -442,10 +443,12 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, P return retval; } -/* invokes operator in context */ -int WM_operator_name_call(bContext *C, const char *opstring, int context, PointerRNA *properties) +/* WM_operator_name_call is the main accessor function + * this is for python to access since its done the operator lookup + * + * invokes operator in context */ +static int wm_operator_call_internal(bContext *C, wmOperatorType *ot, int context, PointerRNA *properties, ReportList *reports) { - wmOperatorType *ot= WM_operatortype_find(opstring, 0); wmWindow *window= CTX_wm_window(C); wmEvent *event; @@ -473,7 +476,7 @@ int WM_operator_name_call(bContext *C, const char *opstring, int context, Pointe CTX_wm_region_set(C, ar1); } - retval= wm_operator_invoke(C, ot, event, properties); + retval= wm_operator_invoke(C, ot, event, properties, reports); /* set region back */ CTX_wm_region_set(C, ar); @@ -488,7 +491,7 @@ int WM_operator_name_call(bContext *C, const char *opstring, int context, Pointe ARegion *ar= CTX_wm_region(C); CTX_wm_region_set(C, NULL); - retval= wm_operator_invoke(C, ot, event, properties); + retval= wm_operator_invoke(C, ot, event, properties, reports); CTX_wm_region_set(C, ar); return retval; @@ -503,7 +506,7 @@ int WM_operator_name_call(bContext *C, const char *opstring, int context, Pointe CTX_wm_region_set(C, NULL); CTX_wm_area_set(C, NULL); - retval= wm_operator_invoke(C, ot, event, properties); + retval= wm_operator_invoke(C, ot, event, properties, reports); CTX_wm_region_set(C, ar); CTX_wm_area_set(C, area); @@ -512,32 +515,45 @@ int WM_operator_name_call(bContext *C, const char *opstring, int context, Pointe case WM_OP_EXEC_DEFAULT: event= NULL; /* pass on without break */ case WM_OP_INVOKE_DEFAULT: - return wm_operator_invoke(C, ot, event, properties); + return wm_operator_invoke(C, ot, event, properties, reports); } } return 0; } + +/* invokes operator in context */ +int WM_operator_name_call(bContext *C, const char *opstring, int context, PointerRNA *properties) +{ + wmOperatorType *ot= WM_operatortype_find(opstring, 0); + if(ot) + return wm_operator_call_internal(C, ot, context, properties, NULL); + + return 0; +} + /* Similar to WM_operator_name_call called with WM_OP_EXEC_DEFAULT context. - wmOperatorType is used instead of operator name since python alredy has the operator type - poll() must be called by python before this runs. - reports can be passed to this function (so python can report them as exceptions) */ -int WM_operator_call_py(bContext *C, wmOperatorType *ot, PointerRNA *properties, ReportList *reports) +int WM_operator_call_py(bContext *C, wmOperatorType *ot, int context, PointerRNA *properties, ReportList *reports) { - wmWindowManager *wm= CTX_wm_manager(C); - wmOperator *op= wm_operator_create(wm, ot, properties, reports); int retval= OPERATOR_CANCELLED; - + +#if 0 + wmOperator *op; + wmWindowManager *wm= CTX_wm_manager(C); + op= wm_operator_create(wm, ot, properties, reports); + if (op->type->exec) retval= op->type->exec(C, op); else printf("error \"%s\" operator has no exec function, python cannot call it\n", op->type->name); - - if (reports) - op->reports= NULL; /* dont let the operator free reports passed to this function */ - WM_operator_free(op); +#endif + + retval= wm_operator_call_internal(C, ot, context, properties, reports); return retval; } @@ -820,7 +836,7 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand wmOperatorType *ot= WM_operatortype_find(event->keymap_idname, 0); if(ot) - retval= wm_operator_invoke(C, ot, event, properties); + retval= wm_operator_invoke(C, ot, event, properties, NULL); } if(retval & OPERATOR_PASS_THROUGH) From 993037d3cb52aa438096215e9d120e6f3d95205b Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 4 Sep 2009 00:18:44 +0000 Subject: [PATCH 412/577] 2.5 - Bugfixes for Armature operators AutoSide names now gets called correctly from menus. However, the toggle bone settings operators aren't. I can't seem to get them to call the invoke again after making autoside call exec... --- release/ui/space_view3d.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/release/ui/space_view3d.py b/release/ui/space_view3d.py index 1d7ea280222..ae1edc0295b 100644 --- a/release/ui/space_view3d.py +++ b/release/ui/space_view3d.py @@ -622,6 +622,7 @@ class VIEW3D_MT_POSE(bpy.types.Menu): layout.itemS() + layout.operator_context = "EXEC_AREA" layout.item_enumO("pose.autoside_names", "axis", 'XAXIS', text="AutoName Left/Right") layout.item_enumO("pose.autoside_names", "axis", 'YAXIS', text="AutoName Front/Back") layout.item_enumO("pose.autoside_names", "axis", 'ZAXIS', text="AutoName Top/Bottom") @@ -630,6 +631,7 @@ class VIEW3D_MT_POSE(bpy.types.Menu): layout.itemS() + layout.operator_context = "INVOKE_AREA" layout.itemO("pose.armature_layers", text="Change Armature Layers...") layout.itemO("pose.bone_layers", text="Change Bone Layers...") @@ -1068,14 +1070,16 @@ class VIEW3D_MT_edit_ARMATURE(bpy.types.Menu): layout.itemO("armature.subdivide_multi", text="Subdivide") layout.itemS() - + + layout.operator_context = "EXEC_AREA" layout.item_enumO("armature.autoside_names", "type", 'XAXIS', text="AutoName Left/Right") layout.item_enumO("armature.autoside_names", "type", 'YAXIS', text="AutoName Front/Back") layout.item_enumO("armature.autoside_names", "type", 'ZAXIS', text="AutoName Top/Bottom") layout.itemO("armature.flip_names") layout.itemS() - + + layout.operator_context = "INVOKE_DEFAULT" layout.itemO("armature.armature_layers") layout.itemO("armature.bone_layers") @@ -1084,7 +1088,7 @@ class VIEW3D_MT_edit_ARMATURE(bpy.types.Menu): layout.itemM("VIEW3D_MT_edit_ARMATURE_parent") layout.itemS() - + layout.item_menu_enumO("armature.flags_set", "mode", text="Bone Settings") class VIEW3D_MT_edit_ARMATURE_parent(bpy.types.Menu): From 640e39206b25bcd433223d85298961a860fc5cd7 Mon Sep 17 00:00:00 2001 From: Martin Poirier Date: Fri, 4 Sep 2009 01:33:22 +0000 Subject: [PATCH 413/577] add blendcache files to dependancies. next step, per frames deps. --- release/io/netrender/utils.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/release/io/netrender/utils.py b/release/io/netrender/utils.py index 30d96b2f92f..62571011bc1 100644 --- a/release/io/netrender/utils.py +++ b/release/io/netrender/utils.py @@ -1,5 +1,6 @@ import bpy import sys, os +import re import http, http.client, http.server, urllib import subprocess, shutil, time, hashlib @@ -66,7 +67,22 @@ def clientSendJob(conn, scene, anim = False, chunks = 5): job.files.append(lib_path) - print(job.files) + root, ext = os.path.splitext(name) + cache_path = path + os.sep + "blendcache_" + root + os.sep # need an API call for that + + print("cache:", cache_path) + + if os.path.exists(cache_path): + pattern = re.compile("[a-zA-Z0-9]+_([0-9]+)_[0-9]+\.bphys") + for cache_name in sorted(os.listdir(cache_path)): + match = pattern.match(cache_name) + + if match: + print("Frame:", int(match.groups()[0]), cache_name) + + job.files.append(cache_path + cache_name) + + #print(job.files) job.name = job_name From fa01703ac3caf08c42509e17be94559efd69bd2b Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 4 Sep 2009 02:44:56 +0000 Subject: [PATCH 414/577] 2.5 - Keyframe Types for DopeSheet It is now possible to tag certain keyframes as being 'breakdowns' in the DopeSheet. Breakdown keyframes are drawn as slightly smaller blue diamonds. Simply select the relevant keyframes and use the RKEY hotkey (or from the menus, Key->Keyframe Type) to choose between tagging the keyframe as a 'proper' keyframe and a 'breakdown' keyframe. Notes: * Please note that this feature does not currently imply anything about breakdowns moving around keyframes or behaving any differently from any other type of keyframe * In future, if there is any such need, more keyframe types could be added, though this is not really likely at all --- .../editors/animation/keyframes_draw.c | 37 +++++++--- .../editors/animation/keyframes_edit.c | 31 +++++++- source/blender/editors/include/ED_anim_api.h | 7 +- .../editors/include/ED_keyframes_draw.h | 6 +- .../editors/include/ED_keyframes_edit.h | 3 +- .../editors/space_action/action_edit.c | 71 +++++++++++++++++++ .../editors/space_action/action_header.c | 18 +++-- .../editors/space_action/action_intern.h | 1 + .../blender/editors/space_action/action_ops.c | 2 + .../editors/space_graph/graph_header.c | 10 +-- .../blender/editors/space_nla/nla_buttons.c | 2 +- source/blender/editors/space_nla/nla_draw.c | 2 +- source/blender/makesdna/DNA_curve_types.h | 17 +++-- source/blender/makesrna/RNA_enum_types.h | 1 + source/blender/makesrna/intern/rna_curve.c | 19 ++++- 15 files changed, 193 insertions(+), 34 deletions(-) diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index 2107e6e4252..abea38e129e 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -98,9 +98,7 @@ static ActKeyColumn *bezt_to_new_actkeycolumn(BezTriple *bezt) /* store settings based on state of BezTriple */ ak->cfra= bezt->vec[1][0]; ak->sel= BEZSELECTED(bezt) ? SELECT : 0; - - // TODO: handle type = bezt->h1 or bezt->h2 - ak->handle_type= 0; + ak->key_type= BEZKEYTYPE(bezt); /* set 'modified', since this is used to identify long keyframes */ ak->modified = 1; @@ -134,6 +132,10 @@ static void add_bezt_to_keycolumns_list(DLRBT_Tree *keys, BezTriple *bezt) if (BEZSELECTED(bezt)) ak->sel = SELECT; ak->modified += 1; + /* for keyframe type, 'proper' keyframes have priority over breakdowns (and other types for now) */ + if (BEZKEYTYPE(bezt) == BEZT_KEYTYPE_KEYFRAME) + ak->key_type= BEZT_KEYTYPE_KEYFRAME; + /* done... no need to insert */ return; } @@ -340,7 +342,7 @@ static const float _unit_diamond_shape[4][2] = { }; /* draw a simple diamond shape with OpenGL */ -void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel, short mode) +void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel, short key_type, short mode) { static GLuint displist1=0; static GLuint displist2=0; @@ -371,6 +373,11 @@ void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel glEndList(); } + /* tweak size of keyframe shape according to type of keyframe + * - 'proper' keyframes have key_type=0, so get drawn at full size + */ + hsize -= 0.5f*key_type; + /* adjust view transform before starting */ glTranslatef(x, y, 0.0f); glScalef(1.0f/xscale*hsize, hsize, 1.0f); @@ -381,8 +388,22 @@ void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel /* draw! */ if ELEM(mode, KEYFRAME_SHAPE_INSIDE, KEYFRAME_SHAPE_BOTH) { /* interior - hardcoded colors (for selected and unselected only) */ - if (sel) UI_ThemeColorShade(TH_STRIP_SELECT, 50); - else glColor3ub(0xE9, 0xE9, 0xE9); + switch (key_type) { + case BEZT_KEYTYPE_BREAKDOWN: /* bluish frames for now */ + { + if (sel) glColor3f(0.33f, 0.75f, 0.93f); + else glColor3f(0.70f, 0.86f, 0.91f); + } + break; + + case BEZT_KEYTYPE_KEYFRAME: /* traditional yellowish frames for now */ + default: + { + if (sel) UI_ThemeColorShade(TH_STRIP_SELECT, 50); + else glColor3f(0.91f, 0.91f, 0.91f); + } + break; + } glCallList(displist2); } @@ -454,7 +475,7 @@ static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, DLRBT_Tree *blocks, floa /* draw using OpenGL - uglier but faster */ // NOTE1: a previous version of this didn't work nice for some intel cards // NOTE2: if we wanted to go back to icons, these are icon = (ak->sel & SELECT) ? ICON_SPACE2 : ICON_SPACE3; - draw_keyframe_shape(ak->cfra, ypos, xscale, 5.0f, (ak->sel & SELECT), KEYFRAME_SHAPE_BOTH); + draw_keyframe_shape(ak->cfra, ypos, xscale, 5.0f, (ak->sel & SELECT), ak->key_type, KEYFRAME_SHAPE_BOTH); } } @@ -695,7 +716,7 @@ void gpl_to_keylist(bDopeSheet *ads, bGPDlayer *gpl, DLRBT_Tree *keys, DLRBT_Tre ak->cfra= (float)gpf->framenum; ak->modified = 1; - ak->handle_type= 0; + ak->key_type= 0; if (gpf->flag & GP_FRAME_SELECT) ak->sel = SELECT; diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c index 77826eca87a..ac04dc7d1a8 100644 --- a/source/blender/editors/animation/keyframes_edit.c +++ b/source/blender/editors/animation/keyframes_edit.c @@ -655,7 +655,7 @@ static short set_bezt_bezier(BeztEditData *bed, BezTriple *bezt) return 0; } -/* Set the interpolation type of the selected BezTriples in each IPO curve to the specified one */ +/* Set the interpolation type of the selected BezTriples in each F-Curve to the specified one */ // ANIM_editkeyframes_ipocurve_ipotype() ! BeztEditFunc ANIM_editkeyframes_ipo(short code) { @@ -669,6 +669,35 @@ BeztEditFunc ANIM_editkeyframes_ipo(short code) } } +/* ------- */ + +static short set_keytype_keyframe(BeztEditData *bed, BezTriple *bezt) +{ + if (bezt->f2 & SELECT) + BEZKEYTYPE(bezt)= BEZT_KEYTYPE_KEYFRAME; + return 0; +} + +static short set_keytype_breakdown(BeztEditData *bed, BezTriple *bezt) +{ + if (bezt->f2 & SELECT) + BEZKEYTYPE(bezt)= BEZT_KEYTYPE_BREAKDOWN; + return 0; +} + +/* Set the interpolation type of the selected BezTriples in each F-Curve to the specified one */ +BeztEditFunc ANIM_editkeyframes_keytype(short code) +{ + switch (code) { + case BEZT_KEYTYPE_BREAKDOWN: /* breakdown */ + return set_keytype_breakdown; + + case BEZT_KEYTYPE_KEYFRAME: /* proper keyframe */ + default: + return set_keytype_keyframe; + } +} + /* ******************************************* */ /* Selection */ diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 179f362b13f..af37cd87254 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -434,7 +434,12 @@ void ED_nla_postop_refresh(bAnimContext *ac); /* ------------- Utility macros ----------------------- */ /* checks if the given BezTriple is selected */ -#define BEZSELECTED(bezt) ((bezt->f2 & SELECT) || (bezt->f1 & SELECT) || (bezt->f3 & SELECT)) +#define BEZSELECTED(bezt) (((bezt)->f2 & SELECT) || ((bezt)->f1 & SELECT) || ((bezt)->f3 & SELECT)) + +/* provide access to Keyframe Type info in BezTriple + * NOTE: this is so that we can change it from being stored in 'hide' + */ +#define BEZKEYTYPE(bezt) ((bezt)->hide) /* set/clear/toggle macro * - channel - channel with a 'flag' member that we're setting diff --git a/source/blender/editors/include/ED_keyframes_draw.h b/source/blender/editors/include/ED_keyframes_draw.h index e940aaed36e..259104f7263 100644 --- a/source/blender/editors/include/ED_keyframes_draw.h +++ b/source/blender/editors/include/ED_keyframes_draw.h @@ -56,8 +56,8 @@ typedef struct ActKeyColumn { char tree_col; /* DLRB_BLACK or DLRB_RED */ /* keyframe info */ - char sel; - short handle_type; + char key_type; /* eBezTripe_KeyframeType */ + short sel; float cfra; /* only while drawing - used to determine if long-keyframe needs to be drawn */ @@ -99,7 +99,7 @@ typedef enum eKeyframeShapeDrawOpts { } eKeyframeShapeDrawOpts; /* draw simple diamond-shape keyframe (with OpenGL) */ -void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel, short mode); +void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel, short key_type, short mode); /* ******************************* Methods ****************************** */ diff --git a/source/blender/editors/include/ED_keyframes_edit.h b/source/blender/editors/include/ED_keyframes_edit.h index 77e95dc77de..390729eaec4 100644 --- a/source/blender/editors/include/ED_keyframes_edit.h +++ b/source/blender/editors/include/ED_keyframes_edit.h @@ -40,8 +40,6 @@ struct Scene; /* --------- BezTriple Selection ------------- */ -#define BEZSELECTED(bezt) ((bezt->f2 & SELECT) || (bezt->f1 & SELECT) || (bezt->f3 & SELECT)) - #define BEZ_SEL(bezt) { (bezt)->f1 |= SELECT; (bezt)->f2 |= SELECT; (bezt)->f3 |= SELECT; } #define BEZ_DESEL(bezt) { (bezt)->f1 &= ~SELECT; (bezt)->f2 &= ~SELECT; (bezt)->f3 &= ~SELECT; } #define BEZ_INVSEL(bezt) { (bezt)->f1 ^= SELECT; (bezt)->f2 ^= SELECT; (bezt)->f3 ^= SELECT; } @@ -133,6 +131,7 @@ BeztEditFunc ANIM_editkeyframes_mirror(short mode); BeztEditFunc ANIM_editkeyframes_select(short mode); BeztEditFunc ANIM_editkeyframes_handles(short mode); BeztEditFunc ANIM_editkeyframes_ipo(short mode); +BeztEditFunc ANIM_editkeyframes_keytype(short mode); /* ----------- BezTriple Callback (Assorted Utilities) ---------- */ diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index d4709e94e5e..b087736a368 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -1038,6 +1038,77 @@ void ACT_OT_handle_type (wmOperatorType *ot) RNA_def_enum(ot->srna, "type", beztriple_handle_type_items, 0, "Type", ""); } +/* ******************** Set Keyframe-Type Operator *********************** */ + +/* this function is responsible for setting interpolation mode for keyframes */ +static void setkeytype_action_keys(bAnimContext *ac, short mode) +{ + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + int filter; + BeztEditFunc set_cb= ANIM_editkeyframes_keytype(mode); + + /* filter data */ + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY); + ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); + + /* loop through setting BezTriple interpolation + * Note: we do not supply BeztEditData to the looper yet. Currently that's not necessary here... + */ + for (ale= anim_data.first; ale; ale= ale->next) + ANIM_fcurve_keys_bezier_loop(NULL, ale->key_data, NULL, set_cb, NULL); + + /* cleanup */ + BLI_freelistN(&anim_data); +} + +/* ------------------- */ + +static int actkeys_keytype_exec(bContext *C, wmOperator *op) +{ + bAnimContext ac; + short mode; + + /* get editor data */ + if (ANIM_animdata_get_context(C, &ac) == 0) + return OPERATOR_CANCELLED; + if (ac.datatype == ANIMCONT_GPENCIL) + return OPERATOR_PASS_THROUGH; + + /* get handle setting mode */ + mode= RNA_enum_get(op->ptr, "type"); + + /* set handle type */ + setkeytype_action_keys(&ac, mode); + + /* validate keyframes after editing */ + ANIM_editkeyframes_refresh(&ac); + + /* set notifier that keyframe properties have changed */ + WM_event_add_notifier(C, NC_ANIMATION|ND_KEYFRAME_PROP, NULL); + + return OPERATOR_FINISHED; +} + +void ACT_OT_keyframe_type (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Set Keyframe Type"; + ot->idname= "ACT_OT_keyframe_type"; + ot->description= "Set type of keyframe for the seleced keyframes."; + + /* api callbacks */ + ot->invoke= WM_menu_invoke; + ot->exec= actkeys_keytype_exec; + ot->poll= ED_operator_action_active; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* id-props */ + RNA_def_enum(ot->srna, "type", beztriple_keyframe_type_items, 0, "Type", ""); +} + /* ************************************************************************** */ /* TRANSFORM STUFF */ diff --git a/source/blender/editors/space_action/action_header.c b/source/blender/editors/space_action/action_header.c index e2a725164c9..f18d31915f9 100644 --- a/source/blender/editors/space_action/action_header.c +++ b/source/blender/editors/space_action/action_header.c @@ -168,7 +168,7 @@ static void act_edit_transformmenu(bContext *C, uiLayout *layout, void *arg_unus static void act_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); // xxx? + uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); uiItemEnumO(layout, NULL, 0, "ACT_OT_snap", "type", ACTKEYS_SNAP_CFRA); uiItemEnumO(layout, NULL, 0, "ACT_OT_snap", "type", ACTKEYS_SNAP_NEAREST_FRAME); uiItemEnumO(layout, NULL, 0, "ACT_OT_snap", "type", ACTKEYS_SNAP_NEAREST_SECOND); @@ -177,16 +177,23 @@ static void act_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused) static void act_edit_mirrormenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); // xxx? + uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); uiItemEnumO(layout, NULL, 0, "ACT_OT_mirror", "type", ACTKEYS_MIRROR_CFRA); uiItemEnumO(layout, NULL, 0, "ACT_OT_mirror", "type", ACTKEYS_MIRROR_YAXIS); uiItemEnumO(layout, NULL, 0, "ACT_OT_mirror", "type", ACTKEYS_MIRROR_XAXIS); uiItemEnumO(layout, NULL, 0, "ACT_OT_mirror", "type", ACTKEYS_MIRROR_MARKER); } +static void act_edit_keytypesmenu(bContext *C, uiLayout *layout, void *arg_unused) +{ + uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); + uiItemEnumO(layout, NULL, 0, "ACT_OT_keyframe_type", "type", BEZT_KEYTYPE_KEYFRAME); + uiItemEnumO(layout, NULL, 0, "ACT_OT_keyframe_type", "type", BEZT_KEYTYPE_BREAKDOWN); +} + static void act_edit_handlesmenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); // xxx? + uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type", "type", HD_FREE); uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type", "type", HD_AUTO); uiItemEnumO(layout, NULL, 0, "ACT_OT_handle_type", "type", HD_VECT); @@ -196,7 +203,7 @@ static void act_edit_handlesmenu(bContext *C, uiLayout *layout, void *arg_unused static void act_edit_ipomenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); // xxx? + uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); uiItemEnumO(layout, NULL, 0, "ACT_OT_interpolation_type", "type", BEZT_IPO_CONST); uiItemEnumO(layout, NULL, 0, "ACT_OT_interpolation_type", "type", BEZT_IPO_LIN); uiItemEnumO(layout, NULL, 0, "ACT_OT_interpolation_type", "type", BEZT_IPO_BEZ); @@ -204,7 +211,7 @@ static void act_edit_ipomenu(bContext *C, uiLayout *layout, void *arg_unused) static void act_edit_expomenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); // xxx? + uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); uiItemEnumO(layout, NULL, 0, "ACT_OT_extrapolation_type", "type", FCURVE_EXTRAPOLATE_CONSTANT); uiItemEnumO(layout, NULL, 0, "ACT_OT_extrapolation_type", "type", FCURVE_EXTRAPOLATE_LINEAR); } @@ -226,6 +233,7 @@ static void act_editmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemS(layout); + uiItemMenuF(layout, "Keyframe Type", 0, act_edit_keytypesmenu, NULL); uiItemMenuF(layout, "Handle Type", 0, act_edit_handlesmenu, NULL); uiItemMenuF(layout, "Interpolation Mode", 0, act_edit_ipomenu, NULL); uiItemMenuF(layout, "Extrapolation Mode", 0, act_edit_expomenu, NULL); diff --git a/source/blender/editors/space_action/action_intern.h b/source/blender/editors/space_action/action_intern.h index 1aeeeff0c80..e5f0ab8994e 100644 --- a/source/blender/editors/space_action/action_intern.h +++ b/source/blender/editors/space_action/action_intern.h @@ -89,6 +89,7 @@ void ACT_OT_delete(struct wmOperatorType *ot); void ACT_OT_clean(struct wmOperatorType *ot); void ACT_OT_sample(struct wmOperatorType *ot); +void ACT_OT_keyframe_type(struct wmOperatorType *ot); void ACT_OT_handle_type(struct wmOperatorType *ot); void ACT_OT_interpolation_type(struct wmOperatorType *ot); void ACT_OT_extrapolation_type(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c index f18b6197eb3..42b033040b1 100644 --- a/source/blender/editors/space_action/action_ops.c +++ b/source/blender/editors/space_action/action_ops.c @@ -75,6 +75,7 @@ void action_operatortypes(void) WM_operatortype_append(ACT_OT_handle_type); WM_operatortype_append(ACT_OT_interpolation_type); WM_operatortype_append(ACT_OT_extrapolation_type); + WM_operatortype_append(ACT_OT_keyframe_type); WM_operatortype_append(ACT_OT_sample); WM_operatortype_append(ACT_OT_clean); WM_operatortype_append(ACT_OT_delete); @@ -133,6 +134,7 @@ static void action_keymap_keyframes (wmWindowManager *wm, ListBase *keymap) WM_keymap_add_item(keymap, "ACT_OT_handle_type", HKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "ACT_OT_interpolation_type", TKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "ACT_OT_extrapolation_type", EKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "ACT_OT_keyframe_type", RKEY, KM_PRESS, 0, 0); /* destructive */ WM_keymap_add_item(keymap, "ACT_OT_clean", OKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/space_graph/graph_header.c b/source/blender/editors/space_graph/graph_header.c index 06d48fe20f3..dd304cd8cf3 100644 --- a/source/blender/editors/space_graph/graph_header.c +++ b/source/blender/editors/space_graph/graph_header.c @@ -160,7 +160,7 @@ static void graph_edit_transformmenu(bContext *C, uiLayout *layout, void *arg_un static void graph_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); // xxx? + uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); uiItemEnumO(layout, NULL, 0, "GRAPH_OT_snap", "type", GRAPHKEYS_SNAP_CFRA); uiItemEnumO(layout, NULL, 0, "GRAPH_OT_snap", "type", GRAPHKEYS_SNAP_NEAREST_FRAME); uiItemEnumO(layout, NULL, 0, "GRAPH_OT_snap", "type", GRAPHKEYS_SNAP_NEAREST_SECOND); @@ -169,7 +169,7 @@ static void graph_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused) static void graph_edit_mirrormenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); // xxx? + uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); uiItemEnumO(layout, NULL, 0, "GRAPH_OT_mirror", "type", GRAPHKEYS_MIRROR_CFRA); uiItemEnumO(layout, NULL, 0, "GRAPH_OT_mirror", "type", GRAPHKEYS_MIRROR_YAXIS); uiItemEnumO(layout, NULL, 0, "GRAPH_OT_mirror", "type", GRAPHKEYS_MIRROR_XAXIS); @@ -178,7 +178,7 @@ static void graph_edit_mirrormenu(bContext *C, uiLayout *layout, void *arg_unuse static void graph_edit_handlesmenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); // xxx? + uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); uiItemEnumO(layout, NULL, 0, "GRAPH_OT_handle_type", "type", HD_FREE); uiItemEnumO(layout, NULL, 0, "GRAPH_OT_handle_type", "type", HD_AUTO); uiItemEnumO(layout, NULL, 0, "GRAPH_OT_handle_type", "type", HD_VECT); @@ -188,7 +188,7 @@ static void graph_edit_handlesmenu(bContext *C, uiLayout *layout, void *arg_unus static void graph_edit_ipomenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); // xxx? + uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); uiItemEnumO(layout, NULL, 0, "GRAPH_OT_interpolation_type", "type", BEZT_IPO_CONST); uiItemEnumO(layout, NULL, 0, "GRAPH_OT_interpolation_type", "type", BEZT_IPO_LIN); uiItemEnumO(layout, NULL, 0, "GRAPH_OT_interpolation_type", "type", BEZT_IPO_BEZ); @@ -196,7 +196,7 @@ static void graph_edit_ipomenu(bContext *C, uiLayout *layout, void *arg_unused) static void graph_edit_expomenu(bContext *C, uiLayout *layout, void *arg_unused) { - uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); // xxx? + uiLayoutSetOperatorContext(layout, WM_OP_EXEC_DEFAULT); uiItemEnumO(layout, NULL, 0, "GRAPH_OT_extrapolation_type", "type", FCURVE_EXTRAPOLATE_CONSTANT); uiItemEnumO(layout, NULL, 0, "GRAPH_OT_extrapolation_type", "type", FCURVE_EXTRAPOLATE_LINEAR); } diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index facea34510e..bbf1358a37c 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -211,7 +211,7 @@ static void nla_panel_animdata (const bContext *C, Panel *pa) /* Active Action Properties ------------------------------------- */ /* action */ row= uiLayoutRow(layout, 1); - uiTemplateID(row, C, &adt_ptr, "action", NULL, NULL/*"ACT_OT_new", "ACT_OT_unlink"*/); // XXX: need to make these operators + uiTemplateID(row, (bContext *)C, &adt_ptr, "action", NULL, NULL/*"ACT_OT_new", "ACT_OT_unlink"*/); // XXX: need to make these operators /* extrapolation */ row= uiLayoutRow(layout, 1); diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index f30954292b4..b21f37ab678 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -167,7 +167,7 @@ static void nla_action_draw_keyframes (AnimData *adt, bAction *act, View2D *v2d, * - size is 3.0f which is smaller than the editable keyframes, so that there is a distinction */ for (ak= keys.first; ak; ak= ak->next) - draw_keyframe_shape(ak->cfra, y, xscale, 3.0f, 0, KEYFRAME_SHAPE_FRAME); + draw_keyframe_shape(ak->cfra, y, xscale, 3.0f, 0, ak->key_type, KEYFRAME_SHAPE_FRAME); /* free icons */ BLI_dlrbTree_free(&keys); diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index b0f089d670f..3bac2c73bcb 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -75,25 +75,28 @@ typedef struct BevPoint { short f1, f2; } BevPoint; -/* Keyframes on IPO curves and Points on Bezier Curves/Paths are generally BezTriples */ +/* Keyframes on F-Curves (allows code reuse of Bezier eval code) and + * Points on Bezier Curves/Paths are generally BezTriples + */ /* note: alfa location in struct is abused by Key system */ /* vec in BezTriple looks like this: vec[0][0]=x location of handle 1 vec[0][1]=y location of handle 1 - vec[0][2]=z location of handle 1 (not used for IpoCurve Points(2d)) + vec[0][2]=z location of handle 1 (not used for FCurve Points(2d)) vec[1][0]=x location of control point vec[1][1]=y location of control point vec[1][2]=z location of control point vec[2][0]=x location of handle 2 vec[2][1]=y location of handle 2 - vec[2][2]=z location of handle 2 (not used for IpoCurve Points(2d)) + vec[2][2]=z location of handle 2 (not used for FCurve Points(2d)) */ typedef struct BezTriple { float vec[3][3]; float alfa, weight, radius; /* alfa: tilt in 3D View, weight: used for softbody goal weight, radius: for bevel tapering */ short ipo; /* ipo: interpolation mode for segment from this BezTriple to the next */ char h1, h2; /* h1, h2: the handle type of the two handles */ - char f1, f2, f3, hide; /* f1, f2, f3: used for selection status, hide: used to indicate whether BezTriple is hidden */ + char f1, f2, f3; /* f1, f2, f3: used for selection status */ + char hide; /* hide: used to indicate whether BezTriple is hidden (3D), type of keyframe (eBezTriple_KeyframeTypes) */ } BezTriple; /* note; alfa location in struct is abused by Key system */ @@ -279,6 +282,12 @@ typedef enum eBezTriple_Interpolation { BEZT_IPO_BEZ, /* bezier interpolation */ } eBezTriple_Interpolation; +/* types of keyframe (used only for BezTriple->hide when BezTriple is used in F-Curves) */ +typedef enum eBezTriple_KeyframeType { + BEZT_KEYTYPE_KEYFRAME = 0, /* default - 'proper' Keyframe */ + BEZT_KEYTYPE_BREAKDOWN, /* 'breakdown' keyframe */ +} eBezTriple_KeyframeType; + /* *************** CHARINFO **************** */ /* flag */ diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h index 3bba474677f..a59fc8716ec 100644 --- a/source/blender/makesrna/RNA_enum_types.h +++ b/source/blender/makesrna/RNA_enum_types.h @@ -38,6 +38,7 @@ extern EnumPropertyItem modifier_type_items[]; extern EnumPropertyItem constraint_type_items[]; extern EnumPropertyItem boidrule_type_items[]; +extern EnumPropertyItem beztriple_keyframe_type_items[]; extern EnumPropertyItem beztriple_handle_type_items[]; extern EnumPropertyItem beztriple_interpolation_mode_items[]; diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index bb094eef962..503ca031fb6 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -48,6 +48,11 @@ EnumPropertyItem beztriple_interpolation_mode_items[] = { {BEZT_IPO_LIN, "LINEAR", 0, "Linear", ""}, {BEZT_IPO_BEZ, "BEZIER", 0, "Bezier", ""}, {0, NULL, 0, NULL, NULL}}; + +EnumPropertyItem beztriple_keyframe_type_items[] = { + {BEZT_KEYTYPE_KEYFRAME, "KEYFRAME", 0, "Keyframe", ""}, + {BEZT_KEYTYPE_BREAKDOWN, "BREAKDOWN", 0, "Breakdown", ""}, + {0, NULL, 0, NULL, NULL}}; #ifdef RNA_RUNTIME @@ -155,7 +160,10 @@ static void rna_Curve_update_data(bContext *C, PointerRNA *ptr) Scene *scene= CTX_data_scene(C); Curve *cu= ptr->id.data; Object *ob; - + + if (cu == NULL) + return; + for(ob=bmain->object.first; ob; ob= ob->id.next) { if(ob->data == cu) { /* XXX this will loop over all objects again (slow) */ @@ -259,10 +267,15 @@ static void rna_def_beztriple(BlenderRNA *brna) prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ipo"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_enum_items(prop, beztriple_interpolation_mode_items); RNA_def_property_ui_text(prop, "Interpolation", "(For F-Curves Only) Interpolation to use for segment of curve starting from current BezTriple."); - RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + //RNA_def_property_update(prop, 0, "rna_Curve_update_data"); // this should be an F-Curve update call instead... + + prop= RNA_def_property(srna, "keyframe_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "hide"); + RNA_def_property_enum_items(prop, beztriple_keyframe_type_items); + RNA_def_property_ui_text(prop, "Keyframe Type", "(For F-Curves only) The type of keyframe this control point defines."); + //RNA_def_property_update(prop, 0, "rna_Curve_update_data"); // this should be an F-Curve update call instead... /* Vector values */ prop= RNA_def_property(srna, "handle1", PROP_FLOAT, PROP_TRANSLATION); From d577e0d986651ee28c6c1031df7db966430f218f Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Fri, 4 Sep 2009 04:05:29 +0000 Subject: [PATCH 415/577] * clean commented-out parts --- SConstruct | 8 -------- 1 file changed, 8 deletions(-) diff --git a/SConstruct b/SConstruct index ec302d90fce..a66587695f3 100644 --- a/SConstruct +++ b/SConstruct @@ -207,7 +207,6 @@ if env['WITH_BF_OPENMP'] == 1: env.Append(CCFLAGS=['-fopenmp']) env.Append(CPPFLAGS=['-fopenmp']) env.Append(CXXFLAGS=['-fopenmp']) - # env.Append(LINKFLAGS=['-fprofile-generate']) #check for additional debug libnames @@ -301,7 +300,6 @@ if env['WITH_BF_SDL'] == False and env['OURPLATFORM'] in ('win32-vc', 'win32-min env['PLATFORM_LINKFLAGS'].append('/ENTRY:main') # lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir -#B.root_build_dir = B.arguments.get('BF_BUILDDIR', '..'+os.sep+'build'+os.sep+platform+os.sep) B.root_build_dir = env['BF_BUILDDIR'] B.doc_build_dir = env['BF_DOCDIR'] if not B.root_build_dir[-1]==os.sep: @@ -403,7 +401,6 @@ thestatlibs, thelibincs = B.setup_staticlibs(env) thesyslibs = B.setup_syslibs(env) if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']: - #env.BlenderProg(B.root_build_dir, "blender", dobj , [], mainlist + thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender') env.BlenderProg(B.root_build_dir, "blender", dobj + mainlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender') if env['WITH_BF_PLAYER']: playerlist = B.create_blender_liblist(env, 'player') @@ -579,11 +576,6 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc'): '${LCGDIR}/ffmpeg/lib/avformat-52.dll', '${LCGDIR}/ffmpeg/lib/avdevice-52.dll', '${LCGDIR}/ffmpeg/lib/avutil-50.dll', -# '${LCGDIR}/ffmpeg/lib/libfaad-2.dll', -# '${LCGDIR}/ffmpeg/lib/libfaac-0.dll', -# '${LCGDIR}/ffmpeg/lib/libmp3lame-0.dll', -# '${LCGDIR}/ffmpeg/lib/libx264-67.dll', -# '${LCGDIR}/ffmpeg/lib/xvidcore.dll', '${LCGDIR}/ffmpeg/lib/swscale-0.dll'] if env['WITH_BF_JACK']: dllsources += ['${LCGDIR}/jack/lib/libjack.dll'] From a819ef1bf2222b2e1132c0a3d9b6b133c8263348 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 4 Sep 2009 04:27:06 +0000 Subject: [PATCH 416/577] 2.5 - Keyframing Bugfixes + Code Cleanups * DopeSheet + Graph Editor - 'Sample Keyframes' option now tags newly created keyframes as being breakdowns. Also moved reduced the code duplication here by moving the core code for this to the animation module. * Keyframing (Standard/Auto) - Added proper 'replace' option Keyframes can now be rekeyed non-destructively when the INSERTKEY_REPLACE flag is provided to the keyframing API functions, since this option will make sure that only the values of the handles get altered. For the Auto-Keyframing 'Replace/Edit Keys' option, this means that it truly works as it describes now, since it will now only replace the values of the keyframes on the current frame, and won't create new keyframes in the process or destroy the tangents already created for those keys. For things like the sliders in animation editors, keyframes changing the value won't destroy existing tangents. --- .../editors/animation/anim_channels_defines.c | 6 ++ .../editors/animation/keyframes_general.c | 76 +++++++++++++++- source/blender/editors/animation/keyframing.c | 90 +++++++++++++------ source/blender/editors/animation/keyingsets.c | 3 +- .../editors/include/ED_keyframes_draw.h | 2 +- .../editors/include/ED_keyframes_edit.h | 1 + .../blender/editors/include/ED_keyframing.h | 5 +- .../editors/interface/interface_anim.c | 2 + .../editors/space_action/action_edit.c | 67 +------------- .../editors/space_action/action_header.c | 2 +- .../blender/editors/space_graph/graph_edit.c | 69 +------------- .../editors/transform/transform_conversions.c | 52 ++++++----- 12 files changed, 186 insertions(+), 189 deletions(-) diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index b16420a7094..e3418fa194f 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -2003,6 +2003,8 @@ static void achannel_setting_slider_cb(bContext *C, void *id_poin, void *fcu_poi flag |= INSERTKEY_NEEDED; if (IS_AUTOKEY_FLAG(AUTOMATKEY)) flag |= INSERTKEY_MATRIX; + if (IS_AUTOKEY_MODE(scene, EDITKEYS)) + flag |= INSERTKEY_REPLACE; /* get RNA pointer, and resolve the path */ @@ -2010,6 +2012,10 @@ static void achannel_setting_slider_cb(bContext *C, void *id_poin, void *fcu_poi /* try to resolve the path stored in the F-Curve */ if (RNA_path_resolve(&id_ptr, fcu->rna_path, &ptr, &prop)) { + /* set the special 'replace' flag if on a keyframe */ + if (fcurve_frame_has_keyframe(fcu, cfra, 0)) + flag |= INSERTKEY_REPLACE; + /* insert a keyframe for this F-Curve */ done= insert_keyframe_direct(ptr, prop, fcu, cfra, flag); diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index ced3c117700..f13d35c7d4a 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -357,6 +357,76 @@ void smooth_fcurve (FCurve *fcu) calchandles_fcurve(fcu); } +/* ---------------- */ + +/* little cache for values... */ +typedef struct tempFrameValCache { + float frame, val; +} tempFrameValCache; + + +/* Evaluates the curves between each selected keyframe on each frame, and keys the value */ +void sample_fcurve (FCurve *fcu) +{ + BezTriple *bezt, *start=NULL, *end=NULL; + tempFrameValCache *value_cache, *fp; + int sfra, range; + int i, n, nIndex; + + /* find selected keyframes... once pair has been found, add keyframes */ + for (i=0, bezt=fcu->bezt; i < fcu->totvert; i++, bezt++) { + /* check if selected, and which end this is */ + if (BEZSELECTED(bezt)) { + if (start) { + /* set end */ + end= bezt; + + /* cache values then add keyframes using these values, as adding + * keyframes while sampling will affect the outcome... + * - only start sampling+adding from index=1, so that we don't overwrite original keyframe + */ + range= (int)( ceil(end->vec[1][0] - start->vec[1][0]) ); + sfra= (int)( floor(start->vec[1][0]) ); + + if (range) { + value_cache= MEM_callocN(sizeof(tempFrameValCache)*range, "IcuFrameValCache"); + + /* sample values */ + for (n=1, fp=value_cache; nframe= (float)(sfra + n); + fp->val= evaluate_fcurve(fcu, fp->frame); + } + + /* add keyframes with these, tagging as 'breakdowns' */ + for (n=1, fp=value_cache; nframe, fp->val, 1); + BEZKEYTYPE(fcu->bezt + nIndex)= BEZT_KEYTYPE_BREAKDOWN; + } + + /* free temp cache */ + MEM_freeN(value_cache); + + /* as we added keyframes, we need to compensate so that bezt is at the right place */ + bezt = fcu->bezt + i + range - 1; + i += (range - 1); + } + + /* bezt was selected, so it now marks the start of a whole new chain to search */ + start= bezt; + end= NULL; + } + else { + /* just set start keyframe */ + start= bezt; + end= NULL; + } + } + } + + /* recalculate channel's handles? */ + calchandles_fcurve(fcu); +} + /* **************************************************** */ /* Copy/Paste Tools */ /* - The copy/paste buffer currently stores a set of temporary F-Curves containing only the keyframes @@ -529,8 +599,10 @@ short paste_animedit_keys (bAnimContext *ac, ListBase *anim_data) bezt->vec[1][0] += offset; bezt->vec[2][0] += offset; - /* insert the keyframe */ - insert_bezt_fcurve(fcu, bezt); + /* insert the keyframe + * NOTE: no special flags here for now + */ + insert_bezt_fcurve(fcu, bezt, 0); /* un-apply offset from src beztriple after copying */ bezt->vec[0][0] -= offset; diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 5f444609baa..d731ec6f148 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -262,9 +262,8 @@ static int binarysearch_bezt_index (BezTriple array[], float frame, int arraylen * NOTE: any recalculate of the F-Curve that needs to be done will need to * be done by the caller. */ -int insert_bezt_fcurve (FCurve *fcu, BezTriple *bezt) +int insert_bezt_fcurve (FCurve *fcu, BezTriple *bezt, short flag) { - BezTriple *newb; int i= 0; if (fcu->bezt) { @@ -273,13 +272,34 @@ int insert_bezt_fcurve (FCurve *fcu, BezTriple *bezt) if (replace) { /* sanity check: 'i' may in rare cases exceed arraylen */ - // FIXME: do not overwrite handletype if just replacing...? - if ((i >= 0) && (i < fcu->totvert)) - *(fcu->bezt + i) = *bezt; + if ((i >= 0) && (i < fcu->totvert)) { + /* take care with the handletypes and other info if the replacement flags are set */ + if (flag & INSERTKEY_REPLACE) { + BezTriple *dst= (fcu->bezt + i); + float dy= bezt->vec[1][1] - dst->vec[1][1]; + + /* just apply delta value change to the handle values */ + dst->vec[0][1] += dy; + dst->vec[1][1] += dy; + dst->vec[2][1] += dy; + + // TODO: perform some other operations? + } + else { + /* just brutally replace the values */ + *(fcu->bezt + i) = *bezt; + } + } } - else { - /* add new */ - newb= MEM_callocN((fcu->totvert+1)*sizeof(BezTriple), "beztriple"); + else if ((flag & INSERTKEY_REPLACE) == 0) { + /* add new - if we're not restricted to replacing keyframes only */ + BezTriple *newb; + + /* allocate a new array only if we have to */ + if ((flag & INSERTKEY_FASTR) == 0) + newb= MEM_callocN((fcu->totvert+1)*sizeof(BezTriple), "beztriple"); + else + newb= fcu->bezt; /* add the beztriples that should occur before the beztriple to be pasted (originally in ei->icu) */ if (i > 0) @@ -292,9 +312,11 @@ int insert_bezt_fcurve (FCurve *fcu, BezTriple *bezt) if (i < fcu->totvert) memcpy(newb+i+1, fcu->bezt+i, (fcu->totvert-i)*sizeof(BezTriple)); - /* replace (+ free) old with new */ - MEM_freeN(fcu->bezt); - fcu->bezt= newb; + /* replace (+ free) old with new, only if necessary to do so */ + if ((flag & INSERTKEY_FASTR) == 0) { + MEM_freeN(fcu->bezt); + fcu->bezt= newb; + } fcu->totvert++; } @@ -313,13 +335,11 @@ int insert_bezt_fcurve (FCurve *fcu, BezTriple *bezt) return i; } -/* This function is a wrapper for insert_bezt_icu, and should be used when - * adding a new keyframe to a curve, when the keyframe doesn't exist anywhere - * else yet. - * - * 'fast' - is only for the python API where importing BVH's would take an extreamly long time. +/* This function is a wrapper for insert_bezt_fcurve_internal(), and should be used when + * adding a new keyframe to a curve, when the keyframe doesn't exist anywhere else yet. + * It returns the index at which the keyframe was added. */ -void insert_vert_fcurve (FCurve *fcu, float x, float y, short fast) +int insert_vert_fcurve (FCurve *fcu, float x, float y, short flag) { BezTriple beztr; int a; @@ -337,21 +357,22 @@ void insert_vert_fcurve (FCurve *fcu, float x, float y, short fast) beztr.h1= beztr.h2= HD_AUTO; // XXX what about when we replace an old one? /* add temp beztriple to keyframes */ - a= insert_bezt_fcurve(fcu, &beztr); + a= insert_bezt_fcurve(fcu, &beztr, flag); /* what if 'a' is a negative index? * for now, just exit to prevent any segfaults */ - if (a < 0) return; + if (a < 0) return -1; /* don't recalculate handles if fast is set * - this is a hack to make importers faster - * - we may calculate twice (see editipo_changed(), due to autohandle needing two calculations) + * - we may calculate twice (due to autohandle needing to be calculated twice) */ - if (!fast) calchandles_fcurve(fcu); + if ((flag & INSERTKEY_FAST) == 0) + calchandles_fcurve(fcu); /* set handletype and interpolation */ - if (fcu->totvert > 2) { + if ((fcu->totvert > 2) && (flag & INSERTKEY_REPLACE)==0) { BezTriple *bezt= (fcu->bezt + a); char h1, h2; @@ -370,10 +391,14 @@ void insert_vert_fcurve (FCurve *fcu, float x, float y, short fast) /* don't recalculate handles if fast is set * - this is a hack to make importers faster - * - we may calculate twice (see editipo_changed(), due to autohandle needing two calculations) + * - we may calculate twice (due to autohandle needing to be calculated twice) */ - if (!fast) calchandles_fcurve(fcu); + if ((flag & INSERTKEY_FAST) == 0) + calchandles_fcurve(fcu); } + + /* return the index at which the keyframe was added */ + return a; } /* -------------- 'Smarter' Keyframing Functions -------------------- */ @@ -812,7 +837,7 @@ short insert_keyframe_direct (PointerRNA ptr, PropertyRNA *prop, FCurve *fcu, fl /* insert new keyframe at current frame */ if (insert_mode) - insert_vert_fcurve(fcu, cfra, curval, (flag & INSERTKEY_FAST)); + insert_vert_fcurve(fcu, cfra, curval, flag); /* delete keyframe immediately before/after newly added */ switch (insert_mode) { @@ -830,7 +855,7 @@ short insert_keyframe_direct (PointerRNA ptr, PropertyRNA *prop, FCurve *fcu, fl } else { /* just insert keyframe */ - insert_vert_fcurve(fcu, cfra, curval, (flag & INSERTKEY_FAST)); + insert_vert_fcurve(fcu, cfra, curval, flag); /* return success */ return 1; @@ -1303,6 +1328,15 @@ static int insert_key_button_exec (bContext *C, wmOperator *op) float cfra= (float)CFRA; // XXX for now, don't bother about all the yucky offset crap short success= 0; int a, index, length, all= RNA_boolean_get(op->ptr, "all"); + short flag = 0; + + /* flags for inserting keyframes */ + if (IS_AUTOKEY_FLAG(AUTOMATKEY)) + flag |= INSERTKEY_MATRIX; + if (IS_AUTOKEY_FLAG(INSERTNEEDED)) + flag |= INSERTKEY_NEEDED; + if (IS_AUTOKEY_MODE(scene, EDITKEYS)) + flag |= INSERTKEY_REPLACE; /* try to insert keyframe using property retrieved from UI */ memset(&ptr, 0, sizeof(PointerRNA)); @@ -1322,14 +1356,14 @@ static int insert_key_button_exec (bContext *C, wmOperator *op) length= 1; for (a=0; afcurves, RNA_property_identifier(prop), 0); + FCurve *fcu= list_find_fcurve(&strip->fcurves, RNA_property_identifier(prop), flag); success+= insert_keyframe_direct(ptr, prop, fcu, cfra, 0); } diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 21f969467aa..f81f57d526a 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -879,6 +879,7 @@ short modifykey_get_context_data (bContext *C, ListBase *dsources, KeyingSet *ks */ int modify_keyframes (bContext *C, ListBase *dsources, bAction *act, KeyingSet *ks, short mode, float cfra) { + Scene *scene= CTX_data_scene(C); KS_Path *ksp; int kflag=0, success= 0; char *groupname= NULL; @@ -891,7 +892,7 @@ int modify_keyframes (bContext *C, ListBase *dsources, bAction *act, KeyingSet * /* suppliment with info from the context */ if (IS_AUTOKEY_FLAG(AUTOMATKEY)) kflag |= INSERTKEY_MATRIX; if (IS_AUTOKEY_FLAG(INSERTNEEDED)) kflag |= INSERTKEY_NEEDED; - // if (IS_AUTOKEY_MODE(EDITKEYS)) flag |= INSERTKEY_REPLACE; + if (IS_AUTOKEY_MODE(scene, EDITKEYS)) kflag |= INSERTKEY_REPLACE; } else if (mode == MODIFYKEY_MODE_DELETE) kflag= 0; diff --git a/source/blender/editors/include/ED_keyframes_draw.h b/source/blender/editors/include/ED_keyframes_draw.h index 259104f7263..0969398f1e2 100644 --- a/source/blender/editors/include/ED_keyframes_draw.h +++ b/source/blender/editors/include/ED_keyframes_draw.h @@ -99,7 +99,7 @@ typedef enum eKeyframeShapeDrawOpts { } eKeyframeShapeDrawOpts; /* draw simple diamond-shape keyframe (with OpenGL) */ -void draw_keyframe_shape (float x, float y, float xscale, float hsize, short sel, short key_type, short mode); +void draw_keyframe_shape(float x, float y, float xscale, float hsize, short sel, short key_type, short mode); /* ******************************* Methods ****************************** */ diff --git a/source/blender/editors/include/ED_keyframes_edit.h b/source/blender/editors/include/ED_keyframes_edit.h index 390729eaec4..b2bf05ea5ea 100644 --- a/source/blender/editors/include/ED_keyframes_edit.h +++ b/source/blender/editors/include/ED_keyframes_edit.h @@ -147,6 +147,7 @@ void duplicate_fcurve_keys(struct FCurve *fcu); void clean_fcurve(struct FCurve *fcu, float thresh); void smooth_fcurve(struct FCurve *fcu); +void sample_fcurve(struct FCurve *fcu); /* ----------- */ diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index 4bc24a0adeb..c492143751c 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -65,13 +65,14 @@ struct FCurve *verify_fcurve(struct bAction *act, const char group[], const char * Use this when validation of necessary animation data isn't necessary as it already * exists, and there is a beztriple that can be directly copied into the array. */ -int insert_bezt_fcurve(struct FCurve *fcu, struct BezTriple *bezt); +int insert_bezt_fcurve(struct FCurve *fcu, struct BezTriple *bezt, short flag); /* Main Keyframing API call: * Use this when validation of necessary animation data isn't necessary as it * already exists. It will insert a keyframe using the current value being keyframed. + * Returns the index at which a keyframe was added (or -1 if failed) */ -void insert_vert_fcurve(struct FCurve *fcu, float x, float y, short flag); +int insert_vert_fcurve(struct FCurve *fcu, float x, float y, short flag); /* -------- */ diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c index 784d820ea52..d7904a19bfe 100644 --- a/source/blender/editors/interface/interface_anim.c +++ b/source/blender/editors/interface/interface_anim.c @@ -152,6 +152,8 @@ void ui_but_anim_autokey(uiBut *but, Scene *scene, float cfra) flag |= INSERTKEY_NEEDED; if (IS_AUTOKEY_FLAG(AUTOMATKEY)) flag |= INSERTKEY_MATRIX; + if (IS_AUTOKEY_MODE(scene, EDITKEYS)) + flag |= INSERTKEY_REPLACE; fcu->flag &= ~FCURVE_SELECTED; insert_keyframe(id, action, ((fcu->grp)?(fcu->grp->name):(NULL)), fcu->rna_path, fcu->array_index, cfra, flag); diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index b087736a368..89633d0cdfe 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -397,7 +397,7 @@ static void insert_action_keys(bAnimContext *ac, short mode) /* init keyframing flag */ if (IS_AUTOKEY_FLAG(AUTOMATKEY)) flag |= INSERTKEY_MATRIX; if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED; - // if (IS_AUTOKEY_MODE(EDITKEYS)) flag |= INSERTKEY_REPLACE; + if (IS_AUTOKEY_MODE(scene, EDITKEYS)) flag |= INSERTKEY_REPLACE; /* insert keyframes */ for (ale= anim_data.first; ale; ale= ale->next) { @@ -679,11 +679,6 @@ void ACT_OT_clean (wmOperatorType *ot) /* ******************** Sample Keyframes Operator *********************** */ -/* little cache for values... */ -typedef struct tempFrameValCache { - float frame, val; -} tempFrameValCache; - /* Evaluates the curves between each selected keyframe on each frame, and keys the value */ static void sample_action_keys (bAnimContext *ac) { @@ -696,64 +691,8 @@ static void sample_action_keys (bAnimContext *ac) ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* loop through filtered data and add keys between selected keyframes on every frame */ - for (ale= anim_data.first; ale; ale= ale->next) { - FCurve *fcu= (FCurve *)ale->key_data; - BezTriple *bezt, *start=NULL, *end=NULL; - tempFrameValCache *value_cache, *fp; - int sfra, range; - int i, n; - - /* find selected keyframes... once pair has been found, add keyframes */ - for (i=0, bezt=fcu->bezt; i < fcu->totvert; i++, bezt++) { - /* check if selected, and which end this is */ - if (BEZSELECTED(bezt)) { - if (start) { - /* set end */ - end= bezt; - - /* cache values then add keyframes using these values, as adding - * keyframes while sampling will affect the outcome... - */ - range= (int)( ceil(end->vec[1][0] - start->vec[1][0]) ); - sfra= (int)( floor(start->vec[1][0]) ); - - if (range) { - value_cache= MEM_callocN(sizeof(tempFrameValCache)*range, "IcuFrameValCache"); - - /* sample values */ - for (n=0, fp=value_cache; nframe= (float)(sfra + n); - fp->val= evaluate_fcurve(fcu, fp->frame); - } - - /* add keyframes with these */ - for (n=0, fp=value_cache; nframe, fp->val, 1); - } - - /* free temp cache */ - MEM_freeN(value_cache); - - /* as we added keyframes, we need to compensate so that bezt is at the right place */ - bezt = fcu->bezt + i + range - 1; - i += (range - 1); - } - - /* bezt was selected, so it now marks the start of a whole new chain to search */ - start= bezt; - end= NULL; - } - else { - /* just set start keyframe */ - start= bezt; - end= NULL; - } - } - } - - /* recalculate channel's handles? */ - calchandles_fcurve(fcu); - } + for (ale= anim_data.first; ale; ale= ale->next) + sample_fcurve((FCurve *)ale->key_data); /* admin and redraws */ BLI_freelistN(&anim_data); diff --git a/source/blender/editors/space_action/action_header.c b/source/blender/editors/space_action/action_header.c index f18d31915f9..8674f481a18 100644 --- a/source/blender/editors/space_action/action_header.c +++ b/source/blender/editors/space_action/action_header.c @@ -431,7 +431,7 @@ void action_header_buttons(const bContext *C, ARegion *ar) "Auto-snapping mode for keyframes when transforming"); } - xco += (70 + 8); + xco += (90 + 8); } /* COPY PASTE */ diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 37389b32b3a..d718ef28e99 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -430,7 +430,7 @@ static void insert_graph_keys(bAnimContext *ac, short mode) /* init keyframing flag */ if (IS_AUTOKEY_FLAG(AUTOMATKEY)) flag |= INSERTKEY_MATRIX; if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED; - // if (IS_AUTOKEY_MODE(EDITKEYS)) flag |= INSERTKEY_REPLACE; + if (IS_AUTOKEY_MODE(scene, EDITKEYS)) flag |= INSERTKEY_REPLACE; /* insert keyframes */ for (ale= anim_data.first; ale; ale= ale->next) { @@ -989,13 +989,6 @@ void GRAPH_OT_bake (wmOperatorType *ot) * of selected keyframes. It is useful for creating keyframes for tweaking overlap. */ -// XXX some of the common parts (with DopeSheet) should be unified in animation module... - -/* little cache for values... */ -typedef struct tempFrameValCache { - float frame, val; -} tempFrameValCache; - /* Evaluates the curves between each selected keyframe on each frame, and keys the value */ static void sample_graph_keys (bAnimContext *ac) { @@ -1008,64 +1001,8 @@ static void sample_graph_keys (bAnimContext *ac) ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* loop through filtered data and add keys between selected keyframes on every frame */ - for (ale= anim_data.first; ale; ale= ale->next) { - FCurve *fcu= (FCurve *)ale->key_data; - BezTriple *bezt, *start=NULL, *end=NULL; - tempFrameValCache *value_cache, *fp; - int sfra, range; - int i, n; - - /* find selected keyframes... once pair has been found, add keyframes */ - for (i=0, bezt=fcu->bezt; i < fcu->totvert; i++, bezt++) { - /* check if selected, and which end this is */ - if (BEZSELECTED(bezt)) { - if (start) { - /* set end */ - end= bezt; - - /* cache values then add keyframes using these values, as adding - * keyframes while sampling will affect the outcome... - */ - range= (int)( ceil(end->vec[1][0] - start->vec[1][0]) ); - sfra= (int)( floor(start->vec[1][0]) ); - - if (range) { - value_cache= MEM_callocN(sizeof(tempFrameValCache)*range, "IcuFrameValCache"); - - /* sample values */ - for (n=0, fp=value_cache; nframe= (float)(sfra + n); - fp->val= evaluate_fcurve(fcu, fp->frame); - } - - /* add keyframes with these */ - for (n=0, fp=value_cache; nframe, fp->val, 1); - } - - /* free temp cache */ - MEM_freeN(value_cache); - - /* as we added keyframes, we need to compensate so that bezt is at the right place */ - bezt = fcu->bezt + i + range - 1; - i += (range - 1); - } - - /* bezt was selected, so it now marks the start of a whole new chain to search */ - start= bezt; - end= NULL; - } - else { - /* just set start keyframe */ - start= bezt; - end= NULL; - } - } - } - - /* recalculate channel's handles? */ - calchandles_fcurve(fcu); - } + for (ale= anim_data.first; ale; ale= ale->next) + sample_fcurve((FCurve *)ale->key_data); /* admin and redraws */ BLI_freelistN(&anim_data); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index e0dfd90a3d1..302d9b675a0 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -1748,7 +1748,7 @@ void flushTransParticles(TransInfo *t) Object *ob = OBACT; PTCacheEdit *edit = PE_get_current(scene, ob); ParticleSystem *psys = edit->psys; - ParticleSystemModifierData *psmd; + ParticleSystemModifierData *psmd = NULL; PTCacheEditPoint *point; PTCacheEditKey *key; TransData *td; @@ -4348,12 +4348,14 @@ void autokeyframe_ob_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode) AnimData *adt= ob->adt; float cfra= (float)CFRA; // xxx this will do for now short flag = 0; - + if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED; if (IS_AUTOKEY_FLAG(AUTOMATKEY)) flag |= INSERTKEY_MATRIX; - + if (IS_AUTOKEY_MODE(scene, EDITKEYS)) + flag |= INSERTKEY_REPLACE; + if (IS_AUTOKEY_FLAG(INSERTAVAIL)) { /* only key on available channels */ if (adt && adt->action) { @@ -4365,7 +4367,7 @@ void autokeyframe_ob_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode) } else if (IS_AUTOKEY_FLAG(INSERTNEEDED)) { short doLoc=0, doRot=0, doScale=0; - + /* filter the conditions when this happens (assume that curarea->spacetype==SPACE_VIE3D) */ if (tmode == TFM_TRANSLATION) { doLoc = 1; @@ -4377,7 +4379,7 @@ void autokeyframe_ob_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode) } else if (v3d->around == V3D_CURSOR) doLoc = 1; - + if ((v3d->flag & V3D_ALIGN)==0) doRot = 1; } @@ -4388,11 +4390,11 @@ void autokeyframe_ob_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode) } else if (v3d->around == V3D_CURSOR) doLoc = 1; - + if ((v3d->flag & V3D_ALIGN)==0) doScale = 1; } - + // TODO: the group names here are temporary... // TODO: should this be made to use the builtin KeyingSets instead? if (doLoc) { @@ -4417,16 +4419,16 @@ void autokeyframe_ob_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode) insert_keyframe(id, NULL, "Object Transform", "location", 0, cfra, flag); insert_keyframe(id, NULL, "Object Transform", "location", 1, cfra, flag); insert_keyframe(id, NULL, "Object Transform", "location", 2, cfra, flag); - + insert_keyframe(id, NULL, "Object Transform", "rotation", 0, cfra, flag); insert_keyframe(id, NULL, "Object Transform", "rotation", 1, cfra, flag); insert_keyframe(id, NULL, "Object Transform", "rotation", 2, cfra, flag); - + insert_keyframe(id, NULL, "Object Transform", "scale", 0, cfra, flag); insert_keyframe(id, NULL, "Object Transform", "scale", 1, cfra, flag); insert_keyframe(id, NULL, "Object Transform", "scale", 2, cfra, flag); } - + // XXX todo... find a way to send notifiers from here... } } @@ -4450,7 +4452,7 @@ void autokeyframe_pose_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode, float cfra= (float)CFRA; short flag= 0; char buf[512]; - + /* flag is initialised from UserPref keyframing settings * - special exception for targetless IK - INSERTKEY_MATRIX keyframes should get * visual keyframes even if flag not set, as it's not that useful otherwise @@ -4460,12 +4462,14 @@ void autokeyframe_pose_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode, flag |= INSERTKEY_MATRIX; if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED; - + if (IS_AUTOKEY_MODE(scene, EDITKEYS)) + flag |= INSERTKEY_REPLACE; + for (pchan=pose->chanbase.first; pchan; pchan=pchan->next) { if (pchan->bone->flag & BONE_TRANSFORM) { /* clear any 'unkeyed' flag it may have */ pchan->bone->flag &= ~BONE_UNKEYED; - + /* only insert into available channels? */ if (IS_AUTOKEY_FLAG(INSERTAVAIL)) { if (act) { @@ -4476,7 +4480,7 @@ void autokeyframe_pose_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode, /* only insert keyframe if needed? */ else if (IS_AUTOKEY_FLAG(INSERTNEEDED)) { short doLoc=0, doRot=0, doScale=0; - + /* filter the conditions when this happens (assume that curarea->spacetype==SPACE_VIE3D) */ if (tmode == TFM_TRANSLATION) { if (targetless_ik) @@ -4487,18 +4491,18 @@ void autokeyframe_pose_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode, else if (tmode == TFM_ROTATION) { if (ELEM(v3d->around, V3D_CURSOR, V3D_ACTIVE)) doLoc = 1; - + if ((v3d->flag & V3D_ALIGN)==0) doRot = 1; } else if (tmode == TFM_RESIZE) { if (ELEM(v3d->around, V3D_CURSOR, V3D_ACTIVE)) doLoc = 1; - + if ((v3d->flag & V3D_ALIGN)==0) doScale = 1; } - + if (doLoc) { sprintf(buf, "pose.pose_channels[\"%s\"].location", pchan->name); insert_keyframe(id, NULL, pchan->name, buf, 0, cfra, flag); @@ -4533,7 +4537,7 @@ void autokeyframe_pose_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode, insert_keyframe(id, NULL, pchan->name, buf, 0, cfra, flag); insert_keyframe(id, NULL, pchan->name, buf, 1, cfra, flag); insert_keyframe(id, NULL, pchan->name, buf, 2, cfra, flag); - + if (pchan->rotmode == PCHAN_ROT_QUAT) { sprintf(buf, "pose.pose_channels[\"%s\"].rotation", pchan->name); insert_keyframe(id, NULL, pchan->name, buf, 0, cfra, flag); @@ -4547,7 +4551,7 @@ void autokeyframe_pose_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode, insert_keyframe(id, NULL, pchan->name, buf, 1, cfra, flag); insert_keyframe(id, NULL, pchan->name, buf, 2, cfra, flag); } - + sprintf(buf, "pose.pose_channels[\"%s\"].scale", pchan->name); insert_keyframe(id, NULL, pchan->name, buf, 0, cfra, flag); insert_keyframe(id, NULL, pchan->name, buf, 1, cfra, flag); @@ -4555,14 +4559,14 @@ void autokeyframe_pose_cb_func(Scene *scene, View3D *v3d, Object *ob, int tmode, } } } - + // XXX todo... figure out way to get appropriate notifiers sent - + /* do the bone paths */ -#if 0 // TRANSFORM_FIX_ME +#if 0 // XXX TRANSFORM FIX ME if (arm->pathflag & ARM_PATH_ACFRA) { - pose_clear_paths(ob); - pose_recalculate_paths(ob); + //pose_clear_paths(ob); // XXX for now, don't need to clear + ED_pose_recalculate_paths(C, scene, ob); } #endif } From 6caff6b390b257f70abe3949463797898b8bd2fd Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 4 Sep 2009 04:29:54 +0000 Subject: [PATCH 417/577] - rna documentation layout now matches blenders internal layout, autogenerate packages for nested modules. bpy.data, bpy.ops.object etc. - added basic docs for bpy.props - omit panel, menu and operator classes (took up too much space and not useful) - exec cant be used as an operator suffix eg- CONSOLE_OT_exec --> CONSOLE_OT_execute (same for file) - fixed some crashes when generating docs Updated docs here http://www.graphicall.org/ftp/ideasman42/html/ --- release/ui/space_console.py | 2 +- .../blender/editors/object/object_modifier.c | 4 +- source/blender/editors/screen/screen_ops.c | 2 +- .../editors/space_console/console_report.c | 2 +- .../editors/space_console/space_console.c | 4 +- .../blender/editors/space_file/file_intern.h | 2 +- source/blender/editors/space_file/file_ops.c | 4 +- .../blender/editors/space_file/space_file.c | 2 +- .../makesrna/intern/rna_sculpt_paint.c | 17 +- source/blender/python/epy_doc_gen.py | 212 +++++++++++++++--- .../blender/python/intern/bpy_operator_wrap.c | 4 +- 11 files changed, 203 insertions(+), 52 deletions(-) diff --git a/release/ui/space_console.py b/release/ui/space_console.py index f1038b5616a..dbf202f924c 100644 --- a/release/ui/space_console.py +++ b/release/ui/space_console.py @@ -110,7 +110,7 @@ class CONSOLE_OT_exec(bpy.types.Operator): ''' Operator documentatuon text, will be used for the operator tooltip and python docs. ''' - __idname__ = "console.exec" + __idname__ = "console.execute" __label__ = "Console Execute" __register__ = False diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index f9e2ac2f4de..96e485e5462 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -434,10 +434,8 @@ static EnumPropertyItem *modifier_add_itemf(bContext *C, PointerRNA *ptr, int *f Object *ob; int totitem= 0, a; - if(!C) /* needed for docs */ + if(!C || !(ob= CTX_data_active_object(C))) /* needed for docs */ return modifier_type_items; - - ob= CTX_data_active_object(C); for(a=0; modifier_type_items[a].identifier; a++) { md_item= &modifier_type_items[a]; diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 799bb0741f3..cb874ec1447 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -3336,7 +3336,7 @@ void ED_keymap_screen(wmWindowManager *wm) WM_keymap_verify_item(keymap, "SCRIPT_OT_python_run_ui_scripts", F8KEY, KM_PRESS, 0, 0); /* files */ - WM_keymap_add_item(keymap, "FILE_OT_exec", RETKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "FILE_OT_execute", RETKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "FILE_OT_cancel", ESCKEY, KM_PRESS, 0, 0); /* undo */ diff --git a/source/blender/editors/space_console/console_report.c b/source/blender/editors/space_console/console_report.c index 08d003f0706..b6920d148fd 100644 --- a/source/blender/editors/space_console/console_report.c +++ b/source/blender/editors/space_console/console_report.c @@ -97,7 +97,7 @@ static int report_replay_exec(bContext *C, wmOperator *op) for(report=reports->list.last; report; report=report->prev) { if((report->type & report_mask) && (report->type & RPT_OPERATOR_ALL) && (report->flag & SELECT)) { console_history_add_str(C, report->message, 0); - WM_operator_name_call(C, "CONSOLE_OT_exec", WM_OP_EXEC_DEFAULT, NULL); + WM_operator_name_call(C, "CONSOLE_OT_execute", WM_OP_EXEC_DEFAULT, NULL); ED_area_tag_redraw(CTX_wm_area(C)); } diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c index a763e7ce153..48890d6cac2 100644 --- a/source/blender/editors/space_console/space_console.c +++ b/source/blender/editors/space_console/space_console.c @@ -278,8 +278,8 @@ void console_keymap(struct wmWindowManager *wm) RNA_enum_set(WM_keymap_add_item(keymap, "CONSOLE_OT_delete", BACKSPACEKEY, KM_PRESS, 0, 0)->ptr, "type", DEL_PREV_CHAR); #ifndef DISABLE_PYTHON - WM_keymap_add_item(keymap, "CONSOLE_OT_exec", RETKEY, KM_PRESS, 0, 0); /* python operator - space_text.py */ - WM_keymap_add_item(keymap, "CONSOLE_OT_exec", PADENTER, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "CONSOLE_OT_execute", RETKEY, KM_PRESS, 0, 0); /* python operator - space_text.py */ + WM_keymap_add_item(keymap, "CONSOLE_OT_execute", PADENTER, KM_PRESS, 0, 0); //WM_keymap_add_item(keymap, "CONSOLE_OT_autocomplete", TABKEY, KM_PRESS, 0, 0); /* python operator - space_text.py */ WM_keymap_add_item(keymap, "CONSOLE_OT_autocomplete", SPACEKEY, KM_PRESS, KM_CTRL, 0); /* python operator - space_text.py */ diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h index 9f1e4ad0e25..a99594e9575 100644 --- a/source/blender/editors/space_file/file_intern.h +++ b/source/blender/editors/space_file/file_intern.h @@ -59,7 +59,7 @@ void FILE_OT_add_bookmark(struct wmOperatorType *ot); void FILE_OT_delete_bookmark(struct wmOperatorType *ot); void FILE_OT_hidedot(struct wmOperatorType *ot); void FILE_OT_loadimages(struct wmOperatorType *ot); -void FILE_OT_exec(struct wmOperatorType *ot); +void FILE_OT_execute(struct wmOperatorType *ot); void FILE_OT_cancel(struct wmOperatorType *ot); void FILE_OT_parent(struct wmOperatorType *ot); void FILE_OT_directory_new(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 9c73956d375..a06c1663d8e 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -566,11 +566,11 @@ int file_exec(bContext *C, wmOperator *unused) return OPERATOR_FINISHED; } -void FILE_OT_exec(struct wmOperatorType *ot) +void FILE_OT_execute(struct wmOperatorType *ot) { /* identifiers */ ot->name= "Execute File Window"; - ot->idname= "FILE_OT_exec"; + ot->idname= "FILE_OT_execute"; /* api callbacks */ ot->exec= file_exec; diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 22ad03f3523..793f7cf8815 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -330,7 +330,7 @@ void file_operatortypes(void) WM_operatortype_append(FILE_OT_select_bookmark); WM_operatortype_append(FILE_OT_loadimages); WM_operatortype_append(FILE_OT_highlight); - WM_operatortype_append(FILE_OT_exec); + WM_operatortype_append(FILE_OT_execute); WM_operatortype_append(FILE_OT_cancel); WM_operatortype_append(FILE_OT_parent); WM_operatortype_append(FILE_OT_previous); diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index fabe0b647ea..b00119efaf6 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -122,9 +122,6 @@ static void rna_ParticleEdit_update(bContext *C, PointerRNA *ptr) static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *ptr, int *free) { - Scene *scene= CTX_data_scene(C); - PTCacheEdit *edit; - if(C==NULL) { EnumPropertyItem *item= NULL; int totitem= 0; @@ -137,13 +134,15 @@ static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *pt return item; } + else { + Scene *scene= CTX_data_scene(C); + PTCacheEdit *edit = PE_get_current(scene, CTX_data_active_object(C)); + + if(edit && edit->psys) + return particle_edit_hair_brush_items; - edit = PE_get_current(scene, CTX_data_active_object(C)); - - if(edit && edit->psys) - return particle_edit_hair_brush_items; - - return particle_edit_cache_brush_items; + return particle_edit_cache_brush_items; + } } static int rna_ParticleEdit_editable_get(PointerRNA *ptr) diff --git a/source/blender/python/epy_doc_gen.py b/source/blender/python/epy_doc_gen.py index 6a515648340..c2ef6bbc0d0 100644 --- a/source/blender/python/epy_doc_gen.py +++ b/source/blender/python/epy_doc_gen.py @@ -37,6 +37,94 @@ Generate html docs by running... # if you dont have graphvis installed ommit the --graph arg. +# GLOBALS['BASEDIR'] = './source/blender/python/doc' + +import os + +SUBMODULES = {} +INIT_SUBMODULES = {} # store initialized files + +INIT_SUBMODULES_IMPORTS = {} # dont import the same module twice + +def append_package(package_path, mod_name): + + init_path = os.path.join(os.path.dirname(package_path), "__init__.py") + + # avoid double ups + if mod_name: + imports = INIT_SUBMODULES_IMPORTS.setdefault(init_path, []) + if mod_name in imports: + return + imports.append(mod_name) + + try: + os.makedirs(os.path.dirname(init_path)) # make the dirs if they are not there + except: + pass + + # Open the new file for the first time, otherwise keep it open. + f = INIT_SUBMODULES.get(init_path) + if f == None: + f = INIT_SUBMODULES[init_path] = open(init_path, 'w') + + if mod_name: + f.write("import %s\n" % mod_name) + + return f + +def append_package_recursive(package_path, BASEPATH): + ''' + assume the last item of package_path will be a file (not a dir thats created) + ''' + + package_path = os.path.splitext(package_path)[0] # incase of .py + + try: + os.makedirs(os.path.join(BASEPATH, os.path.dirname(package_path))) # make the dirs if they are not there + except: + pass + + new_path = BASEPATH + + for mod_name in package_path.split(os.sep): + init_path = os.path.join(new_path, "__init__.py") + new_path = os.path.join(new_path, mod_name) + append_package(init_path, mod_name) + + +def open_submodule(subpath, BASEPATH): + ''' + This is a utility function that lets us quickly add submodules + ''' + + # create all the package paths leading up to this module + append_package_recursive(subpath, BASEPATH) + + module_name = os.path.basename( os.path.splitext(subpath)[0] ) + mod_path = os.path.join(BASEPATH, subpath) + + # Open the new file for the first time, otherwise keep it open. + f = SUBMODULES.get(mod_path) + if f == None: + f = SUBMODULES[mod_path] = open(mod_path, 'w') + + f = open(mod_path, 'w') + return f + +def close_all(): + for files in (INIT_SUBMODULES.values(), SUBMODULES.values()): + for f in files: + if f.name.endswith('.py'): + f_name = f.name + f.close() + + f = open(f_name, 'a') + f.write("\ndel __package__\n") # annoying, no need do show this + + + f.close() + + def range_str(val): if val < -10000000: return '-inf' if val > 10000000: return 'inf' @@ -59,6 +147,19 @@ def full_rna_struct_path(rna_struct): else: return rna_struct.identifier +def rna_id_ignore(rna_id): + if rna_id == "rna_type": + return True + + if "_OT_" in rna_id: + return True + if "_MT_" in rna_id: + return True + if "_PT_" in rna_id: + return True + + return False + def write_func(rna, ident, out, func_type): # Keyword attributes kw_args = [] # "foo = 1", "bar=0.5", "spam='ENUM'" @@ -68,7 +169,7 @@ def write_func(rna, ident, out, func_type): # Operators and functions work differently if func_type=='OPERATOR': - rna_func_name = rna_struct.identifier + rna_func_name = rna_struct.identifier.split("_OT_")[-1] rna_func_desc = rna_struct.description.strip() items = rna_struct.properties.items() else: @@ -78,7 +179,7 @@ def write_func(rna, ident, out, func_type): for rna_prop_identifier, rna_prop in items: - if rna_prop_identifier=='rna_type': + if rna_id_ignore(rna_prop_identifier): continue # clear vars @@ -196,7 +297,7 @@ def write_func(rna, ident, out, func_type): -def rna2epy(target_path): +def rna2epy(BASEPATH): # Use for faster lookups # use rna_struct.identifier as the key for each dict @@ -255,7 +356,7 @@ def rna2epy(target_path): for rna_prop_identifier, rna_prop in rna_struct.properties.items(): if rna_prop_identifier=='RNA': continue - if rna_prop_identifier=='rna_type': continue + if rna_id_ignore(rna_prop_identifier): continue if rna_prop_identifier in rna_base_prop_keys: continue # does this prop exist in our parent class, if so skip rna_desc = rna_prop.description.strip() @@ -320,7 +421,10 @@ def rna2epy(target_path): for child in rna_children_dict[identifier]: write_struct(child, ident + '\t') - out = open(target_path, 'w') + + + # out = open(target_path, 'w') + out = open_submodule("types.py", BASEPATH) # bpy.types def base_id(rna_struct): try: return rna_struct.base.identifier @@ -343,21 +447,23 @@ def rna2epy(target_path): #if not rna_type_name.startswith('__'): identifier = rna_struct.identifier - structs.append( (base_id(rna_struct), identifier, rna_struct) ) - # Simple lookup - rna_struct_dict[identifier] = rna_struct - - # Store full rna path 'GameObjectSettings' -> 'Object.GameObjectSettings' - rna_full_path_dict[identifier] = full_rna_struct_path(rna_struct) - - # Store a list of functions, remove inherited later - rna_functions_dict[identifier]= list(rna_struct.functions) - - - # fill in these later - rna_children_dict[identifier]= [] - rna_references_dict[identifier]= [] + if not rna_id_ignore(identifier): + structs.append( (base_id(rna_struct), identifier, rna_struct) ) + + # Simple lookup + rna_struct_dict[identifier] = rna_struct + + # Store full rna path 'GameObjectSettings' -> 'Object.GameObjectSettings' + rna_full_path_dict[identifier] = full_rna_struct_path(rna_struct) + + # Store a list of functions, remove inherited later + rna_functions_dict[identifier]= list(rna_struct.functions) + + + # fill in these later + rna_children_dict[identifier]= [] + rna_references_dict[identifier]= [] else: @@ -417,7 +523,7 @@ def rna2epy(target_path): for rna_prop_identifier, rna_prop in rna_struct.properties.items(): if rna_prop_identifier=='RNA': continue - if rna_prop_identifier=='rna_type': continue + if rna_id_ignore(rna_prop_identifier): continue if rna_prop_identifier in rna_base_prop_keys: continue try: rna_prop_ptr = rna_prop.fixed_type @@ -431,7 +537,7 @@ def rna2epy(target_path): for rna_prop_identifier, rna_prop in rna_func.parameters.items(): if rna_prop_identifier=='RNA': continue - if rna_prop_identifier=='rna_type': continue + if rna_id_ignore(rna_prop_identifier): continue if rna_prop_identifier in rna_base_func_keys: continue @@ -476,6 +582,7 @@ def rna2epy(target_path): # # We could also just run.... # os.system('epydoc source/blender/python/doc/rna.py -o ./source/blender/python/doc/html -v') + target_path = os.path.join(BASEPATH, "dump.py") # XXX - used for other funcs # Write graphviz out= open(target_path.replace('.py', '.dot'), 'w') @@ -546,8 +653,8 @@ def rna2epy(target_path): out.write('%s\n' % w) -def op2epy(target_path): - out = open(target_path, 'w') +def op2epy(BASEPATH): + # out = open(target_path, 'w') op_mods = dir(bpy.ops) op_mods.remove('add') @@ -556,26 +663,73 @@ def op2epy(target_path): for op_mod_name in sorted(op_mods): if op_mod_name.startswith('__'): continue + + # open the submodule + mod_path = os.path.join("ops", op_mod_name + ".py") + out = open_submodule(mod_path, BASEPATH) + op_mod = getattr(bpy.ops, op_mod_name) - operators = dir(op_mod) for op in sorted(operators): # rna = getattr(bpy.types, op).__rna__ rna = getattr(op_mod, op).get_rna() write_func(rna, '', out, 'OPERATOR') + + out.write('\n') + out.close() + +def misc2epy(BASEPATH): + ''' + Hard coded modules, try to avoid adding stuff here + ''' - out.write('\n') - out.close() + f = append_package(os.path.join(BASEPATH, ""), ""); # add a slash on the end of the base path + f.write(''' +""" +@type data: L{bpy.types.Main} +@var data: blender data is accessed from here +""" +''') + + f = open_submodule("props.py", BASEPATH) + f.write(''' +MAX_INT= 2**31 +MAX_FLOAT= 1e+37 +def BoolProperty(attr, name="", description="", default=False): + """ + return a new bool property + """ +def IntProperty(attr, name="", description="", min=-MAX_INT, max=MAX_INT, soft_min=-MAX_INT, soft_max=MAX_INT, default=0): + """ + return a new int property + """ +def FloatProperty(attr, name="", description="", min=-MAX_FLOAT, max=MAX_FLOAT, soft_min=-MAX_FLOAT, soft_max=MAX_FLOAT, default=0.0): + """ + return a new float property + """ +def StringProperty(attr, name="", description="", maxlen=0, default=""): + """ + return a new string property + """ +def EnumProperty(attr, items, name="", description="", default=""): + """ + return a new enum property + """ +''') + if __name__ == '__main__': if 'bpy' not in dir(): print("\nError, this script must run from inside blender2.5") print(script_help_msg) - else: - rna2epy('source/blender/python/doc/rna.py') - op2epy('source/blender/python/doc/bpyoperator.py') + misc2epy('source/blender/python/doc/bpy') # first to write in info in some of the modules. + rna2epy('source/blender/python/doc/bpy') + op2epy('source/blender/python/doc/bpy') + + + close_all() import sys sys.exit() diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c index 9a74bf0aee8..0a487a8dbe8 100644 --- a/source/blender/python/intern/bpy_operator_wrap.c +++ b/source/blender/python/intern/bpy_operator_wrap.c @@ -228,7 +228,7 @@ static int PYTHON_OT_invoke(bContext *C, wmOperator *op, wmEvent *event) return PYTHON_OT_generic(PYOP_INVOKE, C, op, event); } -static int PYTHON_OT_exec(bContext *C, wmOperator *op) +static int PYTHON_OT_execute(bContext *C, wmOperator *op) { return PYTHON_OT_generic(PYOP_EXEC, C, op, NULL); } @@ -268,7 +268,7 @@ void PYTHON_OT_wrapper(wmOperatorType *ot, void *userdata) if (PyObject_HasAttrString(py_class, "invoke")) ot->invoke= PYTHON_OT_invoke; if (PyObject_HasAttrString(py_class, "execute")) - ot->exec= PYTHON_OT_exec; + ot->exec= PYTHON_OT_execute; if (PyObject_HasAttrString(py_class, "poll")) ot->poll= PYTHON_OT_poll; From 62dd488ad16911620137ac655ae2f5980374c2bc Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Fri, 4 Sep 2009 06:55:01 +0000 Subject: [PATCH 418/577] * New and improved voxel interpolation methods, from Alfredo. Now there is (in order of speed): * Nearest neighbour (very rough quality) * Linear (medium quality) * Quadratic (good quality) * Cubic Catmull-rom (very good quality, crisp) * Cubic B-spline (very good quality, smooth) Thanks! --- source/blender/blenlib/BLI_voxel.h | 3 +- source/blender/blenlib/intern/voxel.c | 347 +++++++----------- source/blender/makesdna/DNA_texture_types.h | 5 +- source/blender/makesrna/intern/rna_texture.c | 8 +- .../blender/render/intern/source/voxeldata.c | 8 +- 5 files changed, 140 insertions(+), 231 deletions(-) diff --git a/source/blender/blenlib/BLI_voxel.h b/source/blender/blenlib/BLI_voxel.h index 9b815ccbf42..934bc820259 100644 --- a/source/blender/blenlib/BLI_voxel.h +++ b/source/blender/blenlib/BLI_voxel.h @@ -35,6 +35,7 @@ /* 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); +float voxel_sample_triquadratic(float *data, int *res, float *co); +float voxel_sample_tricubic(float *data, int *res, float *co, int bspline); #endif /* BLI_VOXEL_H */ diff --git a/source/blender/blenlib/intern/voxel.c b/source/blender/blenlib/intern/voxel.c index b5b2ae793f9..7dad854af3a 100644 --- a/source/blender/blenlib/intern/voxel.c +++ b/source/blender/blenlib/intern/voxel.c @@ -57,243 +57,142 @@ float voxel_sample_nearest(float *data, int *res, float *co) 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; +// returns highest integer <= x as integer (slightly faster than floor()) +inline int FLOORI(float x) +{ + const int r = (int)x; + return ((x >= 0.f) || (float)r == x) ? r : (r - 1); +} + +// clamp function, cannot use the CLAMPIS macro, it sometimes returns unwanted results apparently related to gcc optimization flag -fstrict-overflow which is enabled at -O2 +// this causes the test (x + 2) < 0 with int x == 2147483647 to return false (x being an integer, x + 2 should wrap around to -2147483647 so the test < 0 should return true, which it doesn't) +inline int _clamp(int a, int b, int c) +{ + return (a < b) ? b : ((a > c) ? c : a); } -/* 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) { - if (!data) return 0.f; + const float xf = co[0] * res[0] - 0.5f; + const float yf = co[1] * res[1] - 0.5f; + const float zf = co[2] * res[2] - 0.5f; + + const int x = FLOORI(xf), y = FLOORI(yf), z = FLOORI(zf); - voxx = co[0] * res[0] - 0.5f; - voxy = co[1] * res[1] - 0.5f; - voxz = co[2] * res[2] - 0.5f; + const int xc[2] = {_clamp(x, 0, res[0] - 1), _clamp(x + 1, 0, res[0] - 1)}; + const int yc[2] = {res[0] * _clamp(y, 0, res[1] - 1), res[0] * _clamp(y + 1, 0, res[1] - 1)}; + const int zc[2] = {res[0] * res[1] * _clamp(z, 0, res[2] - 1), res[0] * res[1] * _clamp(z + 1, 0, res[2] - 1)}; - vx = (int)voxx; vy = (int)voxy; vz = (int)voxz; + const float dx = xf - (float)x; + const float dy = yf - (float)y; + const float dz = zf - (float)z; + + const float u[2] = {1.f - dx, dx}; + const float v[2] = {1.f - dy, dy}; + const float w[2] = {1.f - dz, dz}; - dx = voxx - vx; dy = voxy - vy; dz = voxz - vz; + return w[0] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[0]] + u[1] * data[xc[1] + yc[0] + zc[0]] ) + + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[0]] + u[1] * data[xc[1] + yc[1] + zc[0]] ) ) + + w[1] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[1]] + u[1] * data[xc[1] + yc[0] + zc[1]] ) + + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[1]] + u[1] * data[xc[1] + yc[1] + zc[1]] ) ); - 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] = { -{ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{-3, 3, 0, 0, 0, 0, 0, 0,-2,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 2,-2, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 9,-9,-9, 9, 0, 0, 0, 0, 6, 3,-6,-3, 0, 0, 0, 0, 6,-6, 3,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{-6, 6, 6,-6, 0, 0, 0, 0,-3,-3, 3, 3, 0, 0, 0, 0,-4, 4,-2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-2,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 2, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{-6, 6, 6,-6, 0, 0, 0, 0,-4,-2, 4, 2, 0, 0, 0, 0,-3, 3,-3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-1,-2,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 4,-4,-4, 4, 0, 0, 0, 0, 2, 2,-2,-2, 0, 0, 0, 0, 2,-2, 2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 3, 0, 0, 0, 0, 0, 0,-2,-1, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,-2, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9,-9,-9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 3,-6,-3, 0, 0, 0, 0, 6,-6, 3,-3, 0, 0, 0, 0, 4, 2, 2, 1, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-6, 6, 6,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3,-3, 3, 3, 0, 0, 0, 0,-4, 4,-2, 2, 0, 0, 0, 0,-2,-2,-1,-1, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-6, 6, 6,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4,-2, 4, 2, 0, 0, 0, 0,-3, 3,-3, 3, 0, 0, 0, 0,-2,-1,-2,-1, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4,-4,-4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2,-2,-2, 0, 0, 0, 0, 2,-2, 2,-2, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0}, -{-3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0, 0, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0, 0, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 9,-9, 0, 0,-9, 9, 0, 0, 6, 3, 0, 0,-6,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,-6, 0, 0, 3,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 2, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{-6, 6, 0, 0, 6,-6, 0, 0,-3,-3, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4, 4, 0, 0,-2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-2, 0, 0,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0, 0, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0, 0, 0,-1, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9,-9, 0, 0,-9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 3, 0, 0,-6,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6,-6, 0, 0, 3,-3, 0, 0, 4, 2, 0, 0, 2, 1, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-6, 6, 0, 0, 6,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3,-3, 0, 0, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4, 4, 0, 0,-2, 2, 0, 0,-2,-2, 0, 0,-1,-1, 0, 0}, -{ 9, 0,-9, 0,-9, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 3, 0,-6, 0,-3, 0, 6, 0,-6, 0, 3, 0,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 2, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 9, 0,-9, 0,-9, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 3, 0,-6, 0,-3, 0, 6, 0,-6, 0, 3, 0,-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 2, 0, 2, 0, 1, 0}, -{-27,27,27,-27,27,-27,-27,27,-18,-9,18, 9,18, 9,-18,-9,-18,18,-9, 9,18,-18, 9,-9,-18,18,18,-18,-9, 9, 9,-9,-12,-6,-6,-3,12, 6, 6, 3,-12,-6,12, 6,-6,-3, 6, 3,-12,12,-6, 6,-6, 6,-3, 3,-8,-4,-4,-2,-4,-2,-2,-1}, -{18,-18,-18,18,-18,18,18,-18, 9, 9,-9,-9,-9,-9, 9, 9,12,-12, 6,-6,-12,12,-6, 6,12,-12,-12,12, 6,-6,-6, 6, 6, 6, 3, 3,-6,-6,-3,-3, 6, 6,-6,-6, 3, 3,-3,-3, 8,-8, 4,-4, 4,-4, 2,-2, 4, 4, 2, 2, 2, 2, 1, 1}, -{-6, 0, 6, 0, 6, 0,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0,-3, 0, 3, 0, 3, 0,-4, 0, 4, 0,-2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-2, 0,-1, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0,-6, 0, 6, 0, 6, 0,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 0,-3, 0, 3, 0, 3, 0,-4, 0, 4, 0,-2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-2, 0,-1, 0,-1, 0}, -{18,-18,-18,18,-18,18,18,-18,12, 6,-12,-6,-12,-6,12, 6, 9,-9, 9,-9,-9, 9,-9, 9,12,-12,-12,12, 6,-6,-6, 6, 6, 3, 6, 3,-6,-3,-6,-3, 8, 4,-8,-4, 4, 2,-4,-2, 6,-6, 6,-6, 3,-3, 3,-3, 4, 2, 4, 2, 2, 1, 2, 1}, -{-12,12,12,-12,12,-12,-12,12,-6,-6, 6, 6, 6, 6,-6,-6,-6, 6,-6, 6, 6,-6, 6,-6,-8, 8, 8,-8,-4, 4, 4,-4,-3,-3,-3,-3, 3, 3, 3, 3,-4,-4, 4, 4,-2,-2, 2, 2,-4, 4,-4, 4,-2, 2,-2, 2,-2,-2,-2,-2,-1,-1,-1,-1}, -{ 2, 0, 0, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{-6, 6, 0, 0, 6,-6, 0, 0,-4,-2, 0, 0, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 3, 0, 0,-3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2,-1, 0, 0,-2,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 4,-4, 0, 0,-4, 4, 0, 0, 2, 2, 0, 0,-2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,-2, 0, 0, 2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-6, 6, 0, 0, 6,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4,-2, 0, 0, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-3, 3, 0, 0,-3, 3, 0, 0,-2,-1, 0, 0,-2,-1, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4,-4, 0, 0,-4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0,-2,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,-2, 0, 0, 2,-2, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0}, -{-6, 0, 6, 0, 6, 0,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4, 0,-2, 0, 4, 0, 2, 0,-3, 0, 3, 0,-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0,-2, 0,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0,-6, 0, 6, 0, 6, 0,-6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,-4, 0,-2, 0, 4, 0, 2, 0,-3, 0, 3, 0,-3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,-2, 0,-1, 0,-2, 0,-1, 0}, -{18,-18,-18,18,-18,18,18,-18,12, 6,-12,-6,-12,-6,12, 6,12,-12, 6,-6,-12,12,-6, 6, 9,-9,-9, 9, 9,-9,-9, 9, 8, 4, 4, 2,-8,-4,-4,-2, 6, 3,-6,-3, 6, 3,-6,-3, 6,-6, 3,-3, 6,-6, 3,-3, 4, 2, 2, 1, 4, 2, 2, 1}, -{-12,12,12,-12,12,-12,-12,12,-6,-6, 6, 6, 6, 6,-6,-6,-8, 8,-4, 4, 8,-8, 4,-4,-6, 6, 6,-6,-6, 6, 6,-6,-4,-4,-2,-2, 4, 4, 2, 2,-3,-3, 3, 3,-3,-3, 3, 3,-4, 4,-2, 2,-4, 4,-2, 2,-2,-2,-1,-1,-2,-2,-1,-1}, -{ 4, 0,-4, 0,-4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0,-2, 0,-2, 0, 2, 0,-2, 0, 2, 0,-2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 0, 0, 0, 0, 0, 0, 0, 4, 0,-4, 0,-4, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0,-2, 0,-2, 0, 2, 0,-2, 0, 2, 0,-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]; - } } + return 0.f; } - - - - -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 voxel_sample_triquadratic(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); - + if (data) { + + const float xf = co[0] * res[0], yf = co[1] * res[1], zf = co[2] * res[2]; + const int x = FLOORI(xf), y = FLOORI(yf), z = FLOORI(zf); + + const int xc[3] = {_clamp(x - 1, 0, res[0] - 1), _clamp(x, 0, res[0] - 1), _clamp(x + 1, 0, res[0] - 1)}; + const int yc[3] = {res[0] * _clamp(y - 1, 0, res[1] - 1), res[0] * _clamp(y, 0, res[1] - 1), res[0] * _clamp(y + 1, 0, res[1] - 1)}; + const int zc[3] = {res[0] * res[1] * _clamp(z - 1, 0, res[2] - 1), res[0] * res[1] * _clamp(z, 0, res[2] - 1), res[0] * res[1] * _clamp(z + 1, 0, res[2] - 1)}; + + const float dx = xf - (float)x, dy = yf - (float)y, dz = zf - (float)z; + const float u[3] = {dx*(0.5f*dx - 1.f) + 0.5f, dx*(1.f - dx) + 0.5f, 0.5f*dx*dx}; + const float v[3] = {dy*(0.5f*dy - 1.f) + 0.5f, dy*(1.f - dy) + 0.5f, 0.5f*dy*dy}; + const float w[3] = {dz*(0.5f*dz - 1.f) + 0.5f, dz*(1.f - dz) + 0.5f, 0.5f*dz*dz}; + + return w[0] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[0]] + u[1] * data[xc[1] + yc[0] + zc[0]] + u[2] * data[xc[2] + yc[0] + zc[0]] ) + + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[0]] + u[1] * data[xc[1] + yc[1] + zc[0]] + u[2] * data[xc[2] + yc[1] + zc[0]] ) + + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[0]] + u[1] * data[xc[1] + yc[2] + zc[0]] + u[2] * data[xc[2] + yc[2] + zc[0]] ) ) + + w[1] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[1]] + u[1] * data[xc[1] + yc[0] + zc[1]] + u[2] * data[xc[2] + yc[0] + zc[1]] ) + + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[1]] + u[1] * data[xc[1] + yc[1] + zc[1]] + u[2] * data[xc[2] + yc[1] + zc[1]] ) + + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[1]] + u[1] * data[xc[1] + yc[2] + zc[1]] + u[2] * data[xc[2] + yc[2] + zc[1]] ) ) + + w[2] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[2]] + u[1] * data[xc[1] + yc[0] + zc[2]] + u[2] * data[xc[2] + yc[0] + zc[2]] ) + + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[2]] + u[1] * data[xc[1] + yc[1] + zc[2]] + u[2] * data[xc[2] + yc[1] + zc[2]] ) + + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[2]] + u[1] * data[xc[1] + yc[2] + zc[2]] + u[2] * data[xc[2] + yc[2] + zc[2]] ) ); + +} + return 0.f; } +float voxel_sample_tricubic(float *data, int *res, float *co, int bspline) +{ + if (data) { + + const float xf = co[0] * res[0] - 0.5f, yf = co[1] * res[1] - 0.5f, zf = co[2] * res[2] - 0.5f; + const int x = FLOORI(xf), y = FLOORI(yf), z = FLOORI(zf); + + const int xc[4] = {_clamp(x - 1, 0, res[0] - 1), _clamp(x, 0, res[0] - 1), _clamp(x + 1, 0, res[0] - 1), _clamp(x + 2, 0, res[0] - 1)}; + const int yc[4] = {res[0] * _clamp(y - 1, 0, res[1] - 1), res[0] * _clamp(y, 0, res[1] - 1), res[0] * _clamp(y + 1, 0, res[1] - 1), res[0] * _clamp(y + 2, 0, res[1] - 1)}; + const int zc[4] = {res[0] * res[1] * _clamp(z - 1, 0, res[2] - 1), res[0] * res[1] * _clamp(z, 0, res[2] - 1), res[0] * res[1] * _clamp(z + 1, 0, res[2] - 1), res[0] * res[1] * _clamp(z + 2, 0, res[2] - 1)}; + + const float dx = xf - (float)x, dy = yf - (float)y, dz = zf - (float)z; + + float u[4], v[4], w[4]; + if (bspline) { // B-Spline + u[0] = (((-1.f/6.f)*dx + 0.5f)*dx - 0.5f)*dx + (1.f/6.f); + u[1] = (( 0.5f*dx - 1.f )*dx )*dx + (2.f/3.f); + u[2] = (( -0.5f*dx + 0.5f)*dx + 0.5f)*dx + (1.f/6.f); + u[3] = ( 1.f/6.f)*dx*dx*dx; + v[0] = (((-1.f/6.f)*dy + 0.5f)*dy - 0.5f)*dy + (1.f/6.f); + v[1] = (( 0.5f*dy - 1.f )*dy )*dy + (2.f/3.f); + v[2] = (( -0.5f*dy + 0.5f)*dy + 0.5f)*dy + (1.f/6.f); + v[3] = ( 1.f/6.f)*dy*dy*dy; + w[0] = (((-1.f/6.f)*dz + 0.5f)*dz - 0.5f)*dz + (1.f/6.f); + w[1] = (( 0.5f*dz - 1.f )*dz )*dz + (2.f/3.f); + w[2] = (( -0.5f*dz + 0.5f)*dz + 0.5f)*dz + (1.f/6.f); + w[3] = ( 1.f/6.f)*dz*dz*dz; + } + else { // Catmull-Rom + u[0] = ((-0.5f*dx + 1.0f)*dx - 0.5f)*dx; + u[1] = (( 1.5f*dx - 2.5f)*dx )*dx + 1.0f; + u[2] = ((-1.5f*dx + 2.0f)*dx + 0.5f)*dx; + u[3] = (( 0.5f*dx - 0.5f)*dx )*dx; + v[0] = ((-0.5f*dy + 1.0f)*dy - 0.5f)*dy; + v[1] = (( 1.5f*dy - 2.5f)*dy )*dy + 1.0f; + v[2] = ((-1.5f*dy + 2.0f)*dy + 0.5f)*dy; + v[3] = (( 0.5f*dy - 0.5f)*dy )*dy; + w[0] = ((-0.5f*dz + 1.0f)*dz - 0.5f)*dz; + w[1] = (( 1.5f*dz - 2.5f)*dz )*dz + 1.0f; + w[2] = ((-1.5f*dz + 2.0f)*dz + 0.5f)*dz; + w[3] = (( 0.5f*dz - 0.5f)*dz )*dz; + } + + return w[0] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[0]] + u[1] * data[xc[1] + yc[0] + zc[0]] + u[2] * data[xc[2] + yc[0] + zc[0]] + u[3] * data[xc[3] + yc[0] + zc[0]] ) + + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[0]] + u[1] * data[xc[1] + yc[1] + zc[0]] + u[2] * data[xc[2] + yc[1] + zc[0]] + u[3] * data[xc[3] + yc[1] + zc[0]] ) + + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[0]] + u[1] * data[xc[1] + yc[2] + zc[0]] + u[2] * data[xc[2] + yc[2] + zc[0]] + u[3] * data[xc[3] + yc[2] + zc[0]] ) + + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[0]] + u[1] * data[xc[1] + yc[3] + zc[0]] + u[2] * data[xc[2] + yc[3] + zc[0]] + u[3] * data[xc[3] + yc[3] + zc[0]] ) ) + + w[1] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[1]] + u[1] * data[xc[1] + yc[0] + zc[1]] + u[2] * data[xc[2] + yc[0] + zc[1]] + u[3] * data[xc[3] + yc[0] + zc[1]] ) + + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[1]] + u[1] * data[xc[1] + yc[1] + zc[1]] + u[2] * data[xc[2] + yc[1] + zc[1]] + u[3] * data[xc[3] + yc[1] + zc[1]] ) + + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[1]] + u[1] * data[xc[1] + yc[2] + zc[1]] + u[2] * data[xc[2] + yc[2] + zc[1]] + u[3] * data[xc[3] + yc[2] + zc[1]] ) + + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[1]] + u[1] * data[xc[1] + yc[3] + zc[1]] + u[2] * data[xc[2] + yc[3] + zc[1]] + u[3] * data[xc[3] + yc[3] + zc[1]] ) ) + + w[2] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[2]] + u[1] * data[xc[1] + yc[0] + zc[2]] + u[2] * data[xc[2] + yc[0] + zc[2]] + u[3] * data[xc[3] + yc[0] + zc[2]] ) + + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[2]] + u[1] * data[xc[1] + yc[1] + zc[2]] + u[2] * data[xc[2] + yc[1] + zc[2]] + u[3] * data[xc[3] + yc[1] + zc[2]] ) + + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[2]] + u[1] * data[xc[1] + yc[2] + zc[2]] + u[2] * data[xc[2] + yc[2] + zc[2]] + u[3] * data[xc[3] + yc[2] + zc[2]] ) + + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[2]] + u[1] * data[xc[1] + yc[3] + zc[2]] + u[2] * data[xc[2] + yc[3] + zc[2]] + u[3] * data[xc[3] + yc[3] + zc[2]] ) ) + + w[3] * ( v[0] * ( u[0] * data[xc[0] + yc[0] + zc[3]] + u[1] * data[xc[1] + yc[0] + zc[3]] + u[2] * data[xc[2] + yc[0] + zc[3]] + u[3] * data[xc[3] + yc[0] + zc[3]] ) + + v[1] * ( u[0] * data[xc[0] + yc[1] + zc[3]] + u[1] * data[xc[1] + yc[1] + zc[3]] + u[2] * data[xc[2] + yc[1] + zc[3]] + u[3] * data[xc[3] + yc[1] + zc[3]] ) + + v[2] * ( u[0] * data[xc[0] + yc[2] + zc[3]] + u[1] * data[xc[1] + yc[2] + zc[3]] + u[2] * data[xc[2] + yc[2] + zc[3]] + u[3] * data[xc[3] + yc[2] + zc[3]] ) + + v[3] * ( u[0] * data[xc[0] + yc[3] + zc[3]] + u[1] * data[xc[1] + yc[3] + zc[3]] + u[2] * data[xc[2] + yc[3] + zc[3]] + u[3] * data[xc[3] + yc[3] + zc[3]] ) ); + + } + return 0.f; +} diff --git a/source/blender/makesdna/DNA_texture_types.h b/source/blender/makesdna/DNA_texture_types.h index 1b6ed1bc032..4df63ee9cd9 100644 --- a/source/blender/makesdna/DNA_texture_types.h +++ b/source/blender/makesdna/DNA_texture_types.h @@ -515,7 +515,10 @@ typedef struct TexMapping { /* interpolation */ #define TEX_VD_NEARESTNEIGHBOR 0 #define TEX_VD_LINEAR 1 -#define TEX_VD_TRICUBIC 2 +#define TEX_VD_QUADRATIC 2 +#define TEX_VD_TRICUBIC_CATROM 3 +#define TEX_VD_TRICUBIC_BSPLINE 4 +#define TEX_VD_TRICUBIC_SLOW 5 /* file format */ #define TEX_VD_BLENDERVOXEL 0 diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 6de0be9b19c..b11e5c6c12f 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -1496,10 +1496,12 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna) static EnumPropertyItem interpolation_type_items[] = { {TEX_VD_NEARESTNEIGHBOR, "NEREASTNEIGHBOR", 0, "Nearest Neighbor", "No interpolation, fast but blocky and low quality."}, - {TEX_VD_LINEAR, "TRILINEAR", 0, "Trilinear", "Good smoothness and speed"}, - {TEX_VD_TRICUBIC, "TRICUBIC", 0, "Tricubic", "High quality interpolation, but slow"}, + {TEX_VD_LINEAR, "TRILINEAR", 0, "Linear", "Good smoothness and speed"}, + {TEX_VD_QUADRATIC, "QUADRATIC", 0, "Quadratic", "Mid-range quality and speed"}, + {TEX_VD_TRICUBIC_CATROM, "TRICUBIC_CATROM", 0, "Cubic Catmull-Rom", "High quality interpolation, but slower"}, + {TEX_VD_TRICUBIC_BSPLINE, "TRICUBIC_BSPLINE", 0, "Cubic B-Spline", "Smoothed high quality interpolation, but slower"}, {0, NULL, 0, NULL, NULL}}; - + static EnumPropertyItem file_format_items[] = { {TEX_VD_BLENDERVOXEL, "BLENDER_VOXEL", 0, "Blender Voxel", "Default binary voxel file format"}, {TEX_VD_RAW_8BIT, "RAW_8BIT", 0, "8 bit RAW", "8 bit greyscale binary data"}, diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c index 836faeb05b9..17858e55e3d 100644 --- a/source/blender/render/intern/source/voxeldata.c +++ b/source/blender/render/intern/source/voxeldata.c @@ -322,8 +322,12 @@ int voxeldatatex(struct Tex *tex, float *texvec, struct TexResult *texres) case TEX_VD_LINEAR: texres->tin = voxel_sample_trilinear(vd->dataset, vd->resol, co); break; - case TEX_VD_TRICUBIC: - texres->tin = voxel_sample_tricubic(vd->dataset, vd->resol, co); + case TEX_VD_QUADRATIC: + texres->tin = voxel_sample_triquadratic(vd->dataset, vd->resol, co); + break; + case TEX_VD_TRICUBIC_CATROM: + case TEX_VD_TRICUBIC_BSPLINE: + texres->tin = voxel_sample_tricubic(vd->dataset, vd->resol, co, (vd->interp_type == TEX_VD_TRICUBIC_BSPLINE)); break; } From 15ef88b90239af30b08e798cc57cea317f1d56c9 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 4 Sep 2009 07:26:32 +0000 Subject: [PATCH 419/577] Keying Sets: Added options to add/remove properties from the active Keying Set to the RMB menu (and also via KKEY and ALT-K respectively) --- source/blender/blenkernel/intern/anim_sys.c | 2 +- .../blender/editors/animation/anim_intern.h | 30 +++- source/blender/editors/animation/anim_ops.c | 6 +- source/blender/editors/animation/drivers.c | 4 +- source/blender/editors/animation/keyingsets.c | 165 ++++++++++++++++++ .../blender/editors/include/ED_keyframing.h | 6 + .../editors/interface/interface_anim.c | 26 +++ .../editors/interface/interface_handlers.c | 19 +- .../editors/interface/interface_intern.h | 2 + 9 files changed, 249 insertions(+), 11 deletions(-) diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index df7004d3f6b..b7cc98063ed 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -239,7 +239,7 @@ KS_Path *BKE_keyingset_find_destination (KeyingSet *ks, ID *id, const char group if ((ksp->rna_path==0) || strcmp(rna_path, ksp->rna_path)) eq_path= 0; - /* index */ + /* index - need to compare whole-array setting too... */ if (ksp->array_index != array_index) eq_index= 0; diff --git a/source/blender/editors/animation/anim_intern.h b/source/blender/editors/animation/anim_intern.h index e903007fbc0..462ef76ea8d 100644 --- a/source/blender/editors/animation/anim_intern.h +++ b/source/blender/editors/animation/anim_intern.h @@ -1,18 +1,42 @@ -/* Testing code for 2.5 animation system - * Copyright 2009, Joshua Leung +/** + * $Id$ + * + * ***** 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) 2009, Blender Foundation, Joshua Leung + * This is a new part of Blender (with some old code) + * + * Contributor(s): Joshua Leung + * + * ***** END GPL LICENSE BLOCK ***** */ #ifndef ANIM_INTERN_H #define ANIM_INTERN_H - /* KeyingSets/Keyframing Interface ------------- */ /* list of builtin KeyingSets (defined in keyingsets.c) */ extern ListBase builtin_keyingsets; +/* for builtin keyingsets - context poll */ short keyingset_context_ok_poll(bContext *C, KeyingSet *ks); +/* Main KeyingSet operations API call */ short modifykey_get_context_data (bContext *C, ListBase *dsources, KeyingSet *ks); #endif // ANIM_INTERN_H diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index 3d45dcc92ca..fedbe12c0e6 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -381,13 +381,14 @@ void ANIM_OT_time_toggle(wmOperatorType *ot) void ED_operatortypes_anim(void) { + /* Animation Editors only -------------------------- */ WM_operatortype_append(ANIM_OT_change_frame); WM_operatortype_append(ANIM_OT_time_toggle); WM_operatortype_append(ANIM_OT_previewrange_set); WM_operatortype_append(ANIM_OT_previewrange_clear); - // XXX this is used all over... maybe for screen instead? + /* Entire UI --------------------------------------- */ WM_operatortype_append(ANIM_OT_insert_keyframe); WM_operatortype_append(ANIM_OT_delete_keyframe); WM_operatortype_append(ANIM_OT_insert_keyframe_menu); @@ -398,6 +399,9 @@ void ED_operatortypes_anim(void) WM_operatortype_append(ANIM_OT_add_driver_button); WM_operatortype_append(ANIM_OT_remove_driver_button); + + WM_operatortype_append(ANIM_OT_add_keyingset_button); + WM_operatortype_append(ANIM_OT_remove_keyingset_button); } void ED_keymap_anim(wmWindowManager *wm) diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index e7b7d785d7b..8349b7f9bde 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -281,7 +281,7 @@ void ANIM_OT_add_driver_button (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "all", 1, "All", "Insert a keyframe for all element of the array."); + RNA_def_boolean(ot->srna, "all", 1, "All", "Create drivers for all elements of the array."); } /* Remove Driver Button Operator ------------------------ */ @@ -344,7 +344,7 @@ void ANIM_OT_remove_driver_button (wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* properties */ - RNA_def_boolean(ot->srna, "all", 1, "All", "Delete keyfames from all elements of the array."); + RNA_def_boolean(ot->srna, "all", 1, "All", "Delete drivers for all elements of the array."); } /* ************************************************** */ diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index f81f57d526a..a91a9bfa911 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -77,6 +77,171 @@ #include "anim_intern.h" +/* ************************************************** */ +/* KEYING SETS - OPERATORS (for use in UI menus) */ + +/* Add to KeyingSet Button Operator ------------------------ */ + +static int add_keyingset_button_exec (bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + KeyingSet *ks = NULL; + PropertyRNA *prop= NULL; + PointerRNA ptr; + char *path = NULL; + short success= 0; + int index=0, pflag=0; + int all= RNA_boolean_get(op->ptr, "all"); + + /* verify the Keying Set to use: + * - use the active one for now (more control over this can be added later) + * - add a new one if it doesn't exist + */ + if (scene->active_keyingset == 0) { + short flag=0, keyingflag=0; + + /* validate flags + * - absolute KeyingSets should be created by default + */ + flag |= KEYINGSET_ABSOLUTE; + + if (IS_AUTOKEY_FLAG(AUTOMATKEY)) + keyingflag |= INSERTKEY_MATRIX; + if (IS_AUTOKEY_FLAG(INSERTNEEDED)) + keyingflag |= INSERTKEY_NEEDED; + + /* call the API func, and set the active keyingset index */ + ks= BKE_keyingset_add(&scene->keyingsets, "ButtonKeyingSet", flag, keyingflag); + + scene->active_keyingset= BLI_countlist(&scene->keyingsets); + } + else + ks= BLI_findlink(&scene->keyingsets, scene->active_keyingset-1); + + /* try to add to keyingset using property retrieved from UI */ + memset(&ptr, 0, sizeof(PointerRNA)); + uiAnimContextProperty(C, &ptr, &prop, &index); + + /* check if property is able to be added */ + if (ptr.data && prop && RNA_property_animateable(ptr.data, prop)) { + path= RNA_path_from_ID_to_property(&ptr, prop); + + if (path) { + /* set flags */ + if (all) + pflag |= KSP_FLAG_WHOLE_ARRAY; + + /* add path to this setting */ + BKE_keyingset_add_destination(ks, ptr.id.data, NULL, path, index, pflag, KSP_GROUP_KSNAME); + + /* free the temp path created */ + MEM_freeN(path); + } + } + + if (success) { + /* send updates */ + ED_anim_dag_flush_update(C); + + /* for now, only send ND_KEYS for KeyingSets */ + WM_event_add_notifier(C, ND_KEYS, NULL); + } + + return (success)? OPERATOR_FINISHED: OPERATOR_CANCELLED; +} + +void ANIM_OT_add_keyingset_button (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add to Keying Set"; + ot->idname= "ANIM_OT_add_keyingset_button"; + + /* callbacks */ + ot->exec= add_keyingset_button_exec; + //op->poll= ??? + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* properties */ + RNA_def_boolean(ot->srna, "all", 1, "All", "Add all elements of the array to a Keying Set."); +} + +/* Remove from KeyingSet Button Operator ------------------------ */ + +static int remove_keyingset_button_exec (bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + KeyingSet *ks = NULL; + PropertyRNA *prop= NULL; + PointerRNA ptr; + char *path = NULL; + short success= 0; + int index=0; + + /* verify the Keying Set to use: + * - use the active one for now (more control over this can be added later) + * - return error if it doesn't exist + */ + if (scene->active_keyingset == 0) { + BKE_report(op->reports, RPT_ERROR, "No active Keying Set to remove property from"); + return OPERATOR_CANCELLED; + } + else + ks= BLI_findlink(&scene->keyingsets, scene->active_keyingset-1); + + /* try to add to keyingset using property retrieved from UI */ + memset(&ptr, 0, sizeof(PointerRNA)); + uiAnimContextProperty(C, &ptr, &prop, &index); + + if (ptr.data && prop) { + path= RNA_path_from_ID_to_property(&ptr, prop); + + if (path) { + KS_Path *ksp; + + /* try to find a path matching this description */ + ksp= BKE_keyingset_find_destination(ks, ptr.id.data, ks->name, path, index, KSP_GROUP_KSNAME); + + if (ksp) { + /* just free it... */ + MEM_freeN(ksp->rna_path); + BLI_freelinkN(&ks->paths, ksp); + + success= 1; + } + + /* free temp path used */ + MEM_freeN(path); + } + } + + + if (success) { + /* send updates */ + ED_anim_dag_flush_update(C); + + /* for now, only send ND_KEYS for KeyingSets */ + WM_event_add_notifier(C, ND_KEYS, NULL); + } + + return (success)? OPERATOR_FINISHED: OPERATOR_CANCELLED; +} + +void ANIM_OT_remove_keyingset_button (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Remove from Keying Set"; + ot->idname= "ANIM_OT_remove_keyingset_button"; + + /* callbacks */ + ot->exec= remove_keyingset_button_exec; + //op->poll= ??? + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + /* ************************************************** */ /* KEYING SETS - EDITING API */ diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index c492143751c..20c2301d2ac 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -155,6 +155,12 @@ struct KeyingSet *ANIM_builtin_keyingset_get_named(struct KeyingSet *prevKS, cha /* Initialise builtin KeyingSets on startup */ void init_builtin_keyingsets(void); +/* -------- */ + +/* KeyingSet managment operators for UI buttons. */ +void ANIM_OT_add_keyingset_button(struct wmOperatorType *ot); +void ANIM_OT_remove_keyingset_button(struct wmOperatorType *ot); + /* ************ Drivers ********************** */ /* Main Driver Management API calls: diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c index d7904a19bfe..8e15bbde201 100644 --- a/source/blender/editors/interface/interface_anim.c +++ b/source/blender/editors/interface/interface_anim.c @@ -209,6 +209,18 @@ void ui_but_anim_remove_driver(bContext *C) WM_operator_name_call(C, "ANIM_OT_remove_driver_button", WM_OP_INVOKE_DEFAULT, NULL); } +void ui_but_anim_add_keyingset(bContext *C) +{ + /* this operator calls uiAnimContextProperty above */ + WM_operator_name_call(C, "ANIM_OT_add_keyingset_button", WM_OP_INVOKE_DEFAULT, NULL); +} + +void ui_but_anim_remove_keyingset(bContext *C) +{ + /* this operator calls uiAnimContextProperty above */ + WM_operator_name_call(C, "ANIM_OT_remove_keyingset_button", WM_OP_INVOKE_DEFAULT, NULL); +} + void ui_but_anim_menu(bContext *C, uiBut *but) { uiPopupMenu *pup; @@ -264,6 +276,20 @@ void ui_but_anim_menu(bContext *C, uiBut *but) else uiItemBooleanO(layout, "Add Driver", 0, "ANIM_OT_add_driver_button", "all", 0); } + + if(RNA_property_animateable(&but->rnapoin, but->rnaprop)) { + uiItemS(layout); + + if(length) { + uiItemBooleanO(layout, "Add All to Keying Set", 0, "ANIM_OT_add_keyingset_button", "all", 1); + uiItemBooleanO(layout, "Add Single to Keying Set", 0, "ANIM_OT_add_keyingset_button", "all", 0); + uiItemBooleanO(layout, "Remove from Keying Set", 0, "ANIM_OT_remove_keyingset_button", "all", 0); + } + else { + uiItemBooleanO(layout, "Add to Keying Set", 0, "ANIM_OT_add_keyingset_button", "all", 0); + uiItemBooleanO(layout, "Remove from Keying Set", 0, "ANIM_OT_remove_keyingset_button", "all", 0); + } + } uiPupMenuEnd(C, pup); } diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 79c707f5535..259ccba6b89 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3265,18 +3265,18 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event) ui_but_copy_paste(C, but, data, (event->type == CKEY)? 'c': 'v'); return WM_UI_HANDLER_BREAK; } - /* handle keyframeing */ + /* handle keyframing */ else if(event->type == IKEY && event->val == KM_PRESS) { if(event->alt) ui_but_anim_delete_keyframe(C); else ui_but_anim_insert_keyframe(C); - + ED_region_tag_redraw(CTX_wm_region(C)); - + return WM_UI_HANDLER_BREAK; } - /* handle driver adding */ + /* handle drivers */ else if(event->type == DKEY && event->val == KM_PRESS) { if(event->alt) ui_but_anim_remove_driver(C); @@ -3287,6 +3287,17 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event) return WM_UI_HANDLER_BREAK; } + /* handle keyingsets */ + else if(event->type == KKEY && event->val == KM_PRESS) { + if(event->alt) + ui_but_anim_remove_keyingset(C); + else + ui_but_anim_remove_keyingset(C); + + ED_region_tag_redraw(CTX_wm_region(C)); + + return WM_UI_HANDLER_BREAK; + } /* handle menu */ else if(event->type == RIGHTMOUSE && event->val == KM_PRESS) { /* RMB has two options now */ diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 806b40b8646..2e623114fe9 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -467,6 +467,8 @@ void ui_but_anim_insert_keyframe(struct bContext *C); void ui_but_anim_delete_keyframe(struct bContext *C); void ui_but_anim_add_driver(struct bContext *C); void ui_but_anim_remove_driver(struct bContext *C); +void ui_but_anim_add_keyingset(struct bContext *C); +void ui_but_anim_remove_keyingset(struct bContext *C); void ui_but_anim_menu(struct bContext *C, uiBut *but); int ui_but_anim_expression_get(uiBut *but, char *str, int maxlen); int ui_but_anim_expression_set(uiBut *but, const char *str); From 6ed49857a4408bf413f4bf626229aa00d6c8cad7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 4 Sep 2009 08:49:11 +0000 Subject: [PATCH 420/577] poll functions to stop crashing when running operators in an invalid context. --- .../blender/editors/object/editconstraint.c | 32 ++++++++++++++++++- .../blender/editors/physics/ed_pointcache.c | 16 +++++++--- .../editors/space_buttons/buttons_ops.c | 10 ++++++ .../editors/space_console/console_ops.c | 6 ++++ source/blender/editors/space_text/text_ops.c | 2 +- 5 files changed, 59 insertions(+), 7 deletions(-) diff --git a/source/blender/editors/object/editconstraint.c b/source/blender/editors/object/editconstraint.c index 23b3caf8e26..dc0442a5af9 100644 --- a/source/blender/editors/object/editconstraint.c +++ b/source/blender/editors/object/editconstraint.c @@ -465,6 +465,12 @@ void object_test_constraints (Object *owner) /* ---------- Distance-Dependent Constraints ---------- */ /* StretchTo, Limit Distance */ +static int stretchto_poll(bContext *C) +{ + PointerRNA ptr= CTX_data_pointer_get_type(C, "constraint", &RNA_StretchToConstraint); + return (ptr.id.data && ptr.data); +} + static int stretchto_reset_exec (bContext *C, wmOperator *op) { PointerRNA ptr= CTX_data_pointer_get_type(C, "constraint", &RNA_StretchToConstraint); @@ -484,6 +490,7 @@ void CONSTRAINT_OT_stretchto_reset (wmOperatorType *ot) ot->description= "Reset original length of bone for Stretch To Constraint."; ot->exec= stretchto_reset_exec; + ot->poll= stretchto_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -501,6 +508,12 @@ static int limitdistance_reset_exec (bContext *C, wmOperator *op) return OPERATOR_FINISHED; } +static int limitdistance_poll(bContext *C) +{ + PointerRNA ptr= CTX_data_pointer_get_type(C, "constraint", &RNA_LimitDistanceConstraint); + return (ptr.id.data && ptr.data); +} + void CONSTRAINT_OT_limitdistance_reset (wmOperatorType *ot) { /* identifiers */ @@ -509,6 +522,7 @@ void CONSTRAINT_OT_limitdistance_reset (wmOperatorType *ot) ot->description= "Reset limiting distance for Limit Distance Constraint."; ot->exec= limitdistance_reset_exec; + ot->poll= limitdistance_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -516,6 +530,12 @@ void CONSTRAINT_OT_limitdistance_reset (wmOperatorType *ot) /* ------------- Child-Of Constraint ------------------ */ +static int childof_poll(bContext *C) +{ + PointerRNA ptr= CTX_data_pointer_get_type(C, "constraint", &RNA_ChildOfConstraint); + return (ptr.id.data && ptr.data); +} + /* ChildOf Constraint - set inverse callback */ static int childof_set_inverse_exec (bContext *C, wmOperator *op) { @@ -582,12 +602,12 @@ void CONSTRAINT_OT_childof_set_inverse (wmOperatorType *ot) ot->description= "Set inverse correction for ChildOf constraint."; ot->exec= childof_set_inverse_exec; + ot->poll= childof_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } - /* ChildOf Constraint - clear inverse callback */ static int childof_clear_inverse_exec (bContext *C, wmOperator *op) { @@ -612,6 +632,7 @@ void CONSTRAINT_OT_childof_clear_inverse (wmOperatorType *ot) ot->description= "Clear inverse correction for ChildOf constraint."; ot->exec= childof_clear_inverse_exec; + ot->poll= childof_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -684,6 +705,12 @@ void ED_object_constraint_set_active(Object *ob, bConstraint *con) } } +static int constraint_poll(bContext *C) +{ + PointerRNA ptr= CTX_data_pointer_get_type(C, "constraint", &RNA_Constraint); + return (ptr.id.data && ptr.data); +} + static int constraint_delete_exec (bContext *C, wmOperator *op) { PointerRNA ptr= CTX_data_pointer_get_type(C, "constraint", &RNA_Constraint); @@ -711,6 +738,7 @@ void CONSTRAINT_OT_delete (wmOperatorType *ot) /* callbacks */ ot->exec= constraint_delete_exec; + ot->poll= constraint_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -747,6 +775,7 @@ void CONSTRAINT_OT_move_down (wmOperatorType *ot) /* callbacks */ ot->exec= constraint_move_down_exec; + ot->poll= constraint_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -784,6 +813,7 @@ void CONSTRAINT_OT_move_up (wmOperatorType *ot) /* callbacks */ ot->exec= constraint_move_up_exec; + ot->poll= constraint_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; diff --git a/source/blender/editors/physics/ed_pointcache.c b/source/blender/editors/physics/ed_pointcache.c index 68e0c28e9c1..22316290c7b 100644 --- a/source/blender/editors/physics/ed_pointcache.c +++ b/source/blender/editors/physics/ed_pointcache.c @@ -72,6 +72,12 @@ static int ptcache_bake_all_poll(bContext *C) return 1; } +static int ptcache_poll(bContext *C) +{ + PointerRNA ptr= CTX_data_pointer_get_type(C, "PointCache", &RNA_PointCache); + return (ptr.data && ptr.id.data); +} + static int ptcache_bake_all_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); @@ -215,7 +221,7 @@ void PTCACHE_OT_bake(wmOperatorType *ot) /* api callbacks */ ot->exec= ptcache_bake_exec; - ot->poll= ptcache_bake_all_poll; + ot->poll= ptcache_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -230,7 +236,7 @@ void PTCACHE_OT_free_bake(wmOperatorType *ot) /* api callbacks */ ot->exec= ptcache_free_bake_exec; - ot->poll= ptcache_bake_all_poll; + ot->poll= ptcache_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -243,7 +249,7 @@ void PTCACHE_OT_bake_from_cache(wmOperatorType *ot) /* api callbacks */ ot->exec= ptcache_bake_from_cache_exec; - ot->poll= ptcache_bake_all_poll; + ot->poll= ptcache_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -308,7 +314,7 @@ void PTCACHE_OT_add_new(wmOperatorType *ot) /* api callbacks */ ot->exec= ptcache_add_new_exec; - ot->poll= ptcache_bake_all_poll; + ot->poll= ptcache_poll; // ptcache_bake_all_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -321,7 +327,7 @@ void PTCACHE_OT_remove(wmOperatorType *ot) /* api callbacks */ ot->exec= ptcache_remove_exec; - ot->poll= ptcache_bake_all_poll; + ot->poll= ptcache_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 057f35a2487..954a52c54aa 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -613,6 +613,12 @@ void OBJECT_OT_particle_system_remove(wmOperatorType *ot) /********************** new particle settings operator *********************/ +static int psys_poll(bContext *C) +{ + PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); + return (ptr.data != NULL); +} + static int new_particle_settings_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); @@ -657,6 +663,7 @@ void PARTICLE_OT_new(wmOperatorType *ot) /* api callbacks */ ot->exec= new_particle_settings_exec; + ot->poll= psys_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -948,6 +955,9 @@ static int file_browse_exec(bContext *C, wmOperator *op) FileBrowseOp *fbo= op->customdata; char *str; + if (RNA_property_is_set(op->ptr, "filename")==0 || fbo==NULL) + return OPERATOR_CANCELLED; + str= RNA_string_get_alloc(op->ptr, "filename", 0, 0); RNA_property_string_set(&fbo->ptr, fbo->prop, str); RNA_property_update(C, &fbo->ptr, fbo->prop); diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index f8dbe0c3dd4..3d0d284b501 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -234,6 +234,11 @@ static int console_edit_poll(bContext *C) return 1; } +static int console_poll(bContext *C) +{ + return (CTX_wm_space_console(C) != NULL); +} + /* static funcs for text editing */ @@ -695,6 +700,7 @@ void CONSOLE_OT_zoom(wmOperatorType *ot) /* api callbacks */ ot->exec= zoom_exec; + ot->poll= console_poll; /* flags */ /* ot->flag= OPTYPE_REGISTER; */ /* super annoying */ diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 7e514ea723a..14b72e13856 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -1478,7 +1478,7 @@ static int move_cursor(bContext *C, int type, int select) ARegion *ar= CTX_wm_region(C); /* ensure we have the right region, it's optional */ - if(ar->regiontype != RGN_TYPE_WINDOW) + if(ar && ar->regiontype != RGN_TYPE_WINDOW) ar= NULL; switch(type) { From bade641408882919ef3f22b3d5223d533678120c Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Fri, 4 Sep 2009 10:40:41 +0000 Subject: [PATCH 421/577] == SCons == * first working changes to get blenderplayer linking * blenderplayer/ moved into source/ (CMakeLists.txt changed for that too) * added externs for bprogname to gp_ghost, so that it links properly --- CMakeLists.txt | 2 +- SConstruct | 3 ++- intern/guardedalloc/SConscript | 2 +- intern/memutil/SConscript | 2 +- source/SConscript | 5 ++++- source/blender/blenkernel/SConscript | 2 +- source/blender/blenlib/SConscript | 2 +- source/blender/blenlib/intern/util.c | 2 ++ source/blender/blenloader/SConscript | 2 +- source/blender/blenpluginapi/SConscript | 2 +- source/blender/gpu/SConscript | 2 +- source/blender/imbuf/intern/cineon/SConscript | 2 +- source/blender/imbuf/intern/dds/SConscript | 2 +- source/blender/makesdna/SConscript | 2 +- source/blender/python/SConscript | 4 ++-- source/blender/readblenfile/SConscript | 2 +- {blenderplayer => source/blenderplayer}/CMakeLists.txt | 0 .../blenderplayer}/bad_level_call_stubs/CMakeLists.txt | 0 .../blenderplayer}/bad_level_call_stubs/Makefile | 0 .../blenderplayer}/bad_level_call_stubs/SConscript | 7 +++---- .../blenderplayer}/bad_level_call_stubs/stubs.c | 0 source/gameengine/BlenderRoutines/SConscript | 2 +- source/gameengine/Converter/SConscript | 2 +- source/gameengine/Expressions/SConscript | 2 +- source/gameengine/GameLogic/SConscript | 2 +- source/gameengine/GamePlayer/common/SConscript | 2 +- source/gameengine/GamePlayer/ghost/GPG_ghost.cpp | 3 +++ source/gameengine/GamePlayer/ghost/SConscript | 2 +- source/gameengine/Ketsji/KXNetwork/SConscript | 2 +- source/gameengine/Ketsji/SConscript | 2 +- source/gameengine/Network/LoopBackNetwork/SConscript | 2 +- source/gameengine/Network/SConscript | 2 +- source/gameengine/Physics/Bullet/SConscript | 2 +- source/gameengine/Physics/Dummy/SConscript | 2 +- source/gameengine/Physics/common/SConscript | 2 +- .../gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript | 2 +- source/gameengine/Rasterizer/SConscript | 2 +- source/gameengine/SceneGraph/SConscript | 2 +- source/gameengine/VideoTexture/SConscript | 2 +- source/kernel/SConscript | 2 +- 40 files changed, 46 insertions(+), 38 deletions(-) rename {blenderplayer => source/blenderplayer}/CMakeLists.txt (100%) rename {blenderplayer => source/blenderplayer}/bad_level_call_stubs/CMakeLists.txt (100%) rename {blenderplayer => source/blenderplayer}/bad_level_call_stubs/Makefile (100%) rename {blenderplayer => source/blenderplayer}/bad_level_call_stubs/SConscript (53%) rename {blenderplayer => source/blenderplayer}/bad_level_call_stubs/stubs.c (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 529d65b0dfe..5000ecfac5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -574,6 +574,6 @@ ADD_SUBDIRECTORY(source/creator) #----------------------------------------------------------------------------- # Blender Player IF(WITH_PLAYER) - ADD_SUBDIRECTORY(blenderplayer) + ADD_SUBDIRECTORY(source/blenderplayer) ENDIF(WITH_PLAYER) diff --git a/SConstruct b/SConstruct index a66587695f3..b3291c37e1a 100644 --- a/SConstruct +++ b/SConstruct @@ -390,7 +390,7 @@ SConscript(B.root_build_dir+'/source/SConscript') # libraries to give as objects to linking phase mainlist = [] for tp in B.possible_types: - if not tp == 'player' and not tp == 'player2': + if not tp == 'player': mainlist += B.create_blender_liblist(env, tp) if B.arguments.get('BF_PRIORITYLIST', '0')=='1': @@ -404,6 +404,7 @@ if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']: env.BlenderProg(B.root_build_dir, "blender", dobj + mainlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender') if env['WITH_BF_PLAYER']: playerlist = B.create_blender_liblist(env, 'player') + playerlist = playerlist[0:2] + [playerlist[3]] + mainlist[2:] + [playerlist[29]] env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer') ##### Now define some targets diff --git a/intern/guardedalloc/SConscript b/intern/guardedalloc/SConscript index 0184ddd9785..a93e12bebda 100644 --- a/intern/guardedalloc/SConscript +++ b/intern/guardedalloc/SConscript @@ -5,4 +5,4 @@ Import('env') sources = env.Glob('intern/*.c') incs = '.' -env.BlenderLib ('bf_guardedalloc', sources, Split(incs), defines=[], libtype=['intern', 'player'], priority = [5, 175] ) +env.BlenderLib ('bf_guardedalloc', sources, Split(incs), defines=[], libtype=['intern', 'player'], priority = [5, 130] ) diff --git a/intern/memutil/SConscript b/intern/memutil/SConscript index 4528de814f3..3e15dde8855 100644 --- a/intern/memutil/SConscript +++ b/intern/memutil/SConscript @@ -5,4 +5,4 @@ sources = env.Glob('intern/*.cpp') incs = '. ..' -env.BlenderLib ('bf_memutil', sources, Split(incs), [], libtype=['intern', 'player'], priority = [0, 180] ) +env.BlenderLib ('bf_memutil', sources, Split(incs), [], libtype=['intern', 'player'], priority = [0, 135] ) diff --git a/source/SConscript b/source/SConscript index d3a9373b4d8..e4e89671653 100644 --- a/source/SConscript +++ b/source/SConscript @@ -6,6 +6,9 @@ SConscript(['blender/SConscript', 'creator/SConscript']) if env['WITH_BF_GAMEENGINE']: SConscript (['gameengine/SConscript']) - + +if env['WITH_BF_PLAYER']: + SConscript (['blenderplayer/bad_level_call_stubs/SConscript']) + if env['OURPLATFORM'] in ('win64-vc', 'win32-vc', 'win32-mingw'): SConscript (['icons/SConscript']) diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript index 0c7922de6ff..a5bb843cbef 100644 --- a/source/blender/blenkernel/SConscript +++ b/source/blender/blenkernel/SConscript @@ -65,4 +65,4 @@ if env['WITH_BF_LCMS']: if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): incs += ' ' + env['BF_PTHREADS_INC'] -env.BlenderLib ( libname = 'bf_blenkernel', sources = sources, includes = Split(incs), defines = defs, libtype=['core'], priority = [165] ) +env.BlenderLib ( libname = 'bf_blenkernel', sources = sources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [165,137] ) diff --git a/source/blender/blenlib/SConscript b/source/blender/blenlib/SConscript index 3d7d6b63e64..b6c549fd145 100644 --- a/source/blender/blenlib/SConscript +++ b/source/blender/blenlib/SConscript @@ -16,4 +16,4 @@ if env['OURPLATFORM'] == 'linux2': if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): incs += ' ' + env['BF_PTHREADS_INC'] -env.BlenderLib ( 'bf_blenlib', sources, Split(incs), Split(defs), libtype=['core'], priority = [180], compileflags =cflags ) +env.BlenderLib ( 'bf_blenlib', sources, Split(incs), Split(defs), libtype=['core','player'], priority = [180,120], compileflags =cflags ) diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index 3c441a81d6b..acf236d382b 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -54,6 +54,8 @@ #include "BKE_utildefines.h" + + #ifdef HAVE_CONFIG_H #include #endif diff --git a/source/blender/blenloader/SConscript b/source/blender/blenloader/SConscript index 19a89b7e604..1bc834ab9f4 100644 --- a/source/blender/blenloader/SConscript +++ b/source/blender/blenloader/SConscript @@ -11,4 +11,4 @@ incs += ' ' + env['BF_ZLIB_INC'] defs = [] -env.BlenderLib ( 'bf_blenloader', sources, Split(incs), defs, libtype=['core','player'], priority = [135, 30] ) +env.BlenderLib ( 'bf_blenloader', sources, Split(incs), defs, libtype=['core','player'], priority = [135, 20] ) diff --git a/source/blender/blenpluginapi/SConscript b/source/blender/blenpluginapi/SConscript index 776c188d73b..af69b4519b4 100644 --- a/source/blender/blenpluginapi/SConscript +++ b/source/blender/blenpluginapi/SConscript @@ -11,4 +11,4 @@ if env['WITH_BF_QUICKTIME']: defs.append('WITH_QUICKTIME') incs += ' ' + env['BF_QUICKTIME_INC'] -env.BlenderLib ( libname = 'bf_blenpluginapi', sources = sources, includes = Split(incs), defines = defs, libtype=['core', 'player'], priority = [170, 35] ) +env.BlenderLib ( libname = 'bf_blenpluginapi', sources = sources, includes = Split(incs), defines = defs, libtype=['core'], priority = [170] ) diff --git a/source/blender/gpu/SConscript b/source/blender/gpu/SConscript index 63f5fe53238..d40f3a97874 100644 --- a/source/blender/gpu/SConscript +++ b/source/blender/gpu/SConscript @@ -8,4 +8,4 @@ incs += ' #/extern/glew/include #intern/guardedalloc ../imbuf .' incs += ' ' + env['BF_OPENGL_INC'] -env.BlenderLib ( 'bf_gpu', sources, Split(incs), [], libtype=['core', 'player'], priority=[160, 20] ) +env.BlenderLib ( 'bf_gpu', sources, Split(incs), [], libtype=['core', 'player'], priority=[160, 35] ) diff --git a/source/blender/imbuf/intern/cineon/SConscript b/source/blender/imbuf/intern/cineon/SConscript index ef9c44b85c8..371e4cff9eb 100644 --- a/source/blender/imbuf/intern/cineon/SConscript +++ b/source/blender/imbuf/intern/cineon/SConscript @@ -14,4 +14,4 @@ incs = ['.', defs = [] -env.BlenderLib ('bf_cineon', source_files, incs, defs, libtype=['core','player'], priority = [220, 75]) +env.BlenderLib ('bf_cineon', source_files, incs, defs, libtype=['core'], priority = [220]) diff --git a/source/blender/imbuf/intern/dds/SConscript b/source/blender/imbuf/intern/dds/SConscript index cec6023648b..6cabc3f7d79 100644 --- a/source/blender/imbuf/intern/dds/SConscript +++ b/source/blender/imbuf/intern/dds/SConscript @@ -16,4 +16,4 @@ incs = ['.', defs = ['WITH_DDS'] -env.BlenderLib ('bf_dds', source_files, incs, defs, libtype=['core','player'], priority = [230, 105]) +env.BlenderLib ('bf_dds', source_files, incs, defs, libtype=['core'], priority = [230]) diff --git a/source/blender/makesdna/SConscript b/source/blender/makesdna/SConscript index f91cf166f62..6d96811e1cb 100644 --- a/source/blender/makesdna/SConscript +++ b/source/blender/makesdna/SConscript @@ -8,4 +8,4 @@ objs += o incs = '#/intern/guardedalloc .' -env.BlenderLib ( 'bf_dna', objs, Split(incs), [], libtype=['core','player'], priority = [215, 215] ) +env.BlenderLib ( 'bf_dna', objs, Split(incs), [], libtype=['core','player'], priority = [215, 140] ) diff --git a/source/blender/python/SConscript b/source/blender/python/SConscript index d44cf762a0f..c681c5bdc39 100644 --- a/source/blender/python/SConscript +++ b/source/blender/python/SConscript @@ -13,9 +13,9 @@ defs = [] if env['OURPLATFORM'] in ('win32-mingw', 'win32-vc','win64-vc') and env['BF_DEBUG']: defs.append('_DEBUG') -env.BlenderLib( libname = 'bf_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core'], priority = [140]) +env.BlenderLib( libname = 'bf_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core','player'], priority = [140,10]) # generic sources = env.Glob('generic/*.c') -env.BlenderLib( libname = 'bf_gen_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core'], priority = [361]) # ketsji is 360 +env.BlenderLib( libname = 'bf_gen_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core','player'], priority = [361,85]) # ketsji is 360 diff --git a/source/blender/readblenfile/SConscript b/source/blender/readblenfile/SConscript index 59771aa0829..534ab0f7d4c 100644 --- a/source/blender/readblenfile/SConscript +++ b/source/blender/readblenfile/SConscript @@ -5,4 +5,4 @@ sources = env.Glob('intern/*.c') incs = '. ../blenloader ../blenloader/intern ../blenkernel ../blenlib ../makesdna ../../kernel/gen_messaging' -env.BlenderLib ( 'bf_readblenfile', sources, Split(incs), [], libtype=['core','player'], priority = [0, 220] ) +env.BlenderLib ( 'bf_readblenfile', sources, Split(incs), [], libtype=['core','player'], priority = [0, 0] ) diff --git a/blenderplayer/CMakeLists.txt b/source/blenderplayer/CMakeLists.txt similarity index 100% rename from blenderplayer/CMakeLists.txt rename to source/blenderplayer/CMakeLists.txt diff --git a/blenderplayer/bad_level_call_stubs/CMakeLists.txt b/source/blenderplayer/bad_level_call_stubs/CMakeLists.txt similarity index 100% rename from blenderplayer/bad_level_call_stubs/CMakeLists.txt rename to source/blenderplayer/bad_level_call_stubs/CMakeLists.txt diff --git a/blenderplayer/bad_level_call_stubs/Makefile b/source/blenderplayer/bad_level_call_stubs/Makefile similarity index 100% rename from blenderplayer/bad_level_call_stubs/Makefile rename to source/blenderplayer/bad_level_call_stubs/Makefile diff --git a/blenderplayer/bad_level_call_stubs/SConscript b/source/blenderplayer/bad_level_call_stubs/SConscript similarity index 53% rename from blenderplayer/bad_level_call_stubs/SConscript rename to source/blenderplayer/bad_level_call_stubs/SConscript index bd3df38b557..ce502af57be 100644 --- a/blenderplayer/bad_level_call_stubs/SConscript +++ b/source/blenderplayer/bad_level_call_stubs/SConscript @@ -3,12 +3,11 @@ Import ('env') sources = 'stubs.c' -incs = '. ..' -incs += '../../source/blender/makesdna' -incs += '../../source/blender/makesrna' +incs = '#/source/blender/makesdna' +incs += ' #/source/blender/makesrna' defs = '' if env['WITH_BF_INTERNATIONAL']: defs += 'WITH_FREETYPE2' -env.BlenderLib ('blenkernel_blc', sources = Split(sources), includes=Split(incs), defines=Split(defs), libtype='player',priority=225 ) +env.BlenderLib ('blenkernel_blc', sources = Split(sources), includes=Split(incs), defines=Split(defs), libtype=['player'],priority=[145] ) diff --git a/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c similarity index 100% rename from blenderplayer/bad_level_call_stubs/stubs.c rename to source/blenderplayer/bad_level_call_stubs/stubs.c diff --git a/source/gameengine/BlenderRoutines/SConscript b/source/gameengine/BlenderRoutines/SConscript index dc5a93a2e48..831f898853b 100644 --- a/source/gameengine/BlenderRoutines/SConscript +++ b/source/gameengine/BlenderRoutines/SConscript @@ -28,4 +28,4 @@ incs += ' ' + env['BF_PYTHON_INC'] incs += ' ' + env['BF_BULLET_INC'] incs += ' ' + env['BF_OPENGL_INC'] -env.BlenderLib ( 'bf_bloutines', sources, Split(incs), defs, libtype=['core', 'player'], priority=[300, 45] , cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_bloutines', sources, Split(incs), defs, libtype=['core', 'player'], priority=[300, 25] , cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Converter/SConscript b/source/gameengine/Converter/SConscript index 9164a9f6d78..2d126310475 100644 --- a/source/gameengine/Converter/SConscript +++ b/source/gameengine/Converter/SConscript @@ -23,4 +23,4 @@ incs += ' #source/blender/makesrna' incs += ' ' + env['BF_PYTHON_INC'] incs += ' ' + env['BF_BULLET_INC'] -env.BlenderLib ( 'bf_converter', sources, Split(incs), defs, libtype=['core','player'], priority=[305,50], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_converter', sources, Split(incs), defs, libtype=['core','player'], priority=[305,40], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Expressions/SConscript b/source/gameengine/Expressions/SConscript index dc9c184fd8a..51c3a0cc5af 100644 --- a/source/gameengine/Expressions/SConscript +++ b/source/gameengine/Expressions/SConscript @@ -6,4 +6,4 @@ sources = env.Glob('*.cpp') incs ='. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/SceneGraph #source/blender/blenloader' incs += ' ' + env['BF_PYTHON_INC'] -env.BlenderLib ( 'bf_expressions', sources, Split(incs), [], libtype=['core','player'], priority = [360,120], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_expressions', sources, Split(incs), [], libtype=['core','player'], priority = [360,75], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/GameLogic/SConscript b/source/gameengine/GameLogic/SConscript index f259a338dc0..442420a8876 100644 --- a/source/gameengine/GameLogic/SConscript +++ b/source/gameengine/GameLogic/SConscript @@ -21,4 +21,4 @@ if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): if env['BF_DEBUG']: defs.append('_DEBUG') -env.BlenderLib ( 'bf_logic', sources, Split(incs), defs, libtype=['core','player'], priority=[330, 100], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_logic', sources, Split(incs), defs, libtype=['core','player'], priority=[330, 50], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/GamePlayer/common/SConscript b/source/gameengine/GamePlayer/common/SConscript index 3ac2576b46d..6f37c2f769e 100644 --- a/source/gameengine/GamePlayer/common/SConscript +++ b/source/gameengine/GamePlayer/common/SConscript @@ -62,4 +62,4 @@ incs += Split(env['BF_PYTHON_INC']) incs += Split(env['BF_PNG_INC']) incs += Split(env['BF_ZLIB_INC']) -env.BlenderLib (libname='gp_common', sources=source_files, includes=incs, defines = [], libtype='player', priority=5, cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib (libname='gp_common', sources=source_files, includes=incs, defines = [], libtype=['player'], priority=[15], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index d399d6b3443..b7677d29507 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -68,6 +68,9 @@ extern "C" int GHOST_HACK_getFirstFile(char buf[]); +extern char bprogname[]; /* holds a copy of argv[0], from creator.c */ +extern char btempdir[]; /* use this to store a valid temp directory */ + #ifdef __cplusplus } #endif // __cplusplus diff --git a/source/gameengine/GamePlayer/ghost/SConscript b/source/gameengine/GamePlayer/ghost/SConscript index ce8b07b9393..6c71eafa1dc 100644 --- a/source/gameengine/GamePlayer/ghost/SConscript +++ b/source/gameengine/GamePlayer/ghost/SConscript @@ -46,4 +46,4 @@ defs = [] if env['WITH_BF_FFMPEG']: defs.append('WITH_FFMPEG') -env.BlenderLib (libname='gp_ghost', sources=source_files, includes = incs, defines = defs, libtype='player',priority=5, cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib (libname='gp_ghost', sources=source_files, includes = incs, defines = defs, libtype=['player'],priority=[5], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Ketsji/KXNetwork/SConscript b/source/gameengine/Ketsji/KXNetwork/SConscript index ce4a29b9492..f2283f0b28d 100644 --- a/source/gameengine/Ketsji/KXNetwork/SConscript +++ b/source/gameengine/Ketsji/KXNetwork/SConscript @@ -9,4 +9,4 @@ incs += ' #source/gameengine/Network #source/gameengine/SceneGraph' incs += ' ' + env['BF_PYTHON_INC'] -env.BlenderLib ( 'kx_network', Split(sources), Split(incs), defines=[],libtype=['core', 'player'], priority=[400, 145], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_network', Split(sources), Split(incs), defines=[],libtype=['core', 'player'], priority=[400, 100], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript index ea9d32fa0bf..1f5df8dea00 100644 --- a/source/gameengine/Ketsji/SConscript +++ b/source/gameengine/Ketsji/SConscript @@ -33,4 +33,4 @@ if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): if env['BF_DEBUG']: defs.append('_DEBUG') # for Python -env.BlenderLib ( 'bf_ketsji', sources, Split(incs), defs, libtype=['core','player'], priority=[320, 60], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_ketsji', sources, Split(incs), defs, libtype=['core','player'], priority=[320, 80], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Network/LoopBackNetwork/SConscript b/source/gameengine/Network/LoopBackNetwork/SConscript index be6545b4fd6..62b0a65a514 100644 --- a/source/gameengine/Network/LoopBackNetwork/SConscript +++ b/source/gameengine/Network/LoopBackNetwork/SConscript @@ -5,4 +5,4 @@ sources = 'NG_LoopBackNetworkDeviceInterface.cpp' incs = '. #source/kernel/gen_system #intern/string #source/gameengine/Network' -env.BlenderLib ( 'bf_loopbacknetwork', Split(sources), Split(incs), defines=[],libtype=['core', 'player'], priority=[400, 155] ) +env.BlenderLib ( 'bf_loopbacknetwork', Split(sources), Split(incs), defines=[],libtype=['core', 'player'], priority=[400, 115] ) diff --git a/source/gameengine/Network/SConscript b/source/gameengine/Network/SConscript index 804851973af..297cfdb6748 100644 --- a/source/gameengine/Network/SConscript +++ b/source/gameengine/Network/SConscript @@ -5,4 +5,4 @@ sources = env.Glob('*.cpp') #'NG_NetworkMessage.cpp NG_NetworkObject.cpp NG_Netw incs = '. #source/kernel/gen_system #intern/string #intern/moto/include' -env.BlenderLib ( 'bf_ngnetwork', sources, Split(incs), [], libtype=['core', 'player'], priority=[400, 150] ) +env.BlenderLib ( 'bf_ngnetwork', sources, Split(incs), [], libtype=['core', 'player'], priority=[400, 110] ) diff --git a/source/gameengine/Physics/Bullet/SConscript b/source/gameengine/Physics/Bullet/SConscript index 0b797c2cb8b..1489e4c46f6 100644 --- a/source/gameengine/Physics/Bullet/SConscript +++ b/source/gameengine/Physics/Bullet/SConscript @@ -21,4 +21,4 @@ incs += ' #intern/guardedalloc' incs += ' ' + env['BF_BULLET_INC'] incs += ' ' + env['BF_PYTHON_INC'] -env.BlenderLib ( 'bf_bullet', Split(sources), Split(incs), [], libtype=['core','player'], priority=[350,80], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_bullet', Split(sources), Split(incs), [], libtype=['core','player'], priority=[350,70], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Physics/Dummy/SConscript b/source/gameengine/Physics/Dummy/SConscript index 93d6ac36446..cb4a09559be 100644 --- a/source/gameengine/Physics/Dummy/SConscript +++ b/source/gameengine/Physics/Dummy/SConscript @@ -5,4 +5,4 @@ sources = 'DummyPhysicsEnvironment.cpp' incs = '. ../common' -env.BlenderLib ( 'bf_dummy', Split(sources), Split(incs), [], libtype=['core','player'], priority=[350,95] ) +env.BlenderLib ( 'bf_dummy', Split(sources), Split(incs), [], libtype=['core','player'], priority=[350,55] ) diff --git a/source/gameengine/Physics/common/SConscript b/source/gameengine/Physics/common/SConscript index 8b373ec830c..bbf2d345a30 100644 --- a/source/gameengine/Physics/common/SConscript +++ b/source/gameengine/Physics/common/SConscript @@ -5,4 +5,4 @@ sources = 'PHY_IMotionState.cpp PHY_IController.cpp PHY_IPhysicsController.cpp P incs = '. ../Dummy #intern/moto/include' -env.BlenderLib ( 'bf_common', Split(sources), Split(incs), [], libtype=['core','player'], priority=[360, 90], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_physics_common', Split(sources), Split(incs), [], libtype=['core','player'], priority=[360, 90], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript index 963c6616b64..851ec0c47c3 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript @@ -8,4 +8,4 @@ incs += ' #source/blender/gpu #extern/glew/include ' + env['BF_OPENGL_INC'] incs += ' #source/blender/gameengine/Ketsji #source/gameengine/SceneGraph #source/blender/makesdna #source/blender/blenkernel' incs += ' #intern/guardedalloc #source/blender/blenlib' -env.BlenderLib ( 'bf_oglrasterizer', Split(sources), Split(incs), [], libtype=['core','player'], priority=[350, 115], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_oglrasterizer', Split(sources), Split(incs), [], libtype=['core','player'], priority=[350, 65], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Rasterizer/SConscript b/source/gameengine/Rasterizer/SConscript index c2af14e8ce5..a1a1c7a4038 100644 --- a/source/gameengine/Rasterizer/SConscript +++ b/source/gameengine/Rasterizer/SConscript @@ -7,4 +7,4 @@ sources = env.Glob('*.cpp') incs = '. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/BlenderRoutines #extern/glew/include #source/gameengine/Expressions #source/gameengine/SceneGraph #source/blender/blenkernel #source/blender/makesdna' incs += ' ' + env['BF_PYTHON_INC'] -env.BlenderLib ( 'bf_rasterizer', sources, Split(incs), [], libtype=['core','player'], priority=[350,115], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_rasterizer', sources, Split(incs), [], libtype=['core','player'], priority=[350,60], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/SceneGraph/SConscript b/source/gameengine/SceneGraph/SConscript index 8f433a21e49..b7d8de450ab 100644 --- a/source/gameengine/SceneGraph/SConscript +++ b/source/gameengine/SceneGraph/SConscript @@ -6,4 +6,4 @@ sources = env.Glob('*.cpp') incs = '. #intern/moto/include' -env.BlenderLib ( 'bf_scenegraph', sources, Split(incs), [], libtype=['core','player'], priority=[325,125], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_scenegraph', sources, Split(incs), [], libtype=['core','player'], priority=[325,45], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/VideoTexture/SConscript b/source/gameengine/VideoTexture/SConscript index 583ccf29dbd..ada878b74f2 100644 --- a/source/gameengine/VideoTexture/SConscript +++ b/source/gameengine/VideoTexture/SConscript @@ -27,4 +27,4 @@ if env['WITH_BF_FFMPEG']: incs += ' ' + env['BF_FFMPEG_INC'] + ' ' + env['BF_PTHREADS_INC'] defs.append('__STDC_CONSTANT_MACROS') -env.BlenderLib ( 'bf_videotex', sources, Split(incs), defs, libtype=['core','player'], priority=[300, 72], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_videotex', sources, Split(incs), defs, libtype=['core','player'], priority=[300, 30], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/kernel/SConscript b/source/kernel/SConscript index 908e059ceab..88fc58755c0 100644 --- a/source/kernel/SConscript +++ b/source/kernel/SConscript @@ -7,4 +7,4 @@ sources += ' gen_system/SYS_System.cpp' incs = 'gen_messaging gen_system #/intern/string #/intern/moto/include #/source/blender/blenloader ' -env.BlenderLib ( 'bf_kernel', Split(sources), Split(incs), [], libtype = ['core', 'player'], priority = [400, 150] ) +env.BlenderLib ( 'bf_kernel', Split(sources), Split(incs), [], libtype = ['core', 'player'], priority = [400, 95] ) From 1e6efcc96526a0d1ba16384c5500959ec9b5824d Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 4 Sep 2009 10:41:02 +0000 Subject: [PATCH 422/577] 2.5 - KeyingSet fixes * Fixed warnings in console about missing (removed) property * Fixed update problems after creating a new keyingset --- source/blender/editors/animation/keyingsets.c | 5 +++-- source/blender/editors/interface/interface_anim.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index a91a9bfa911..15d47211615 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -133,6 +133,7 @@ static int add_keyingset_button_exec (bContext *C, wmOperator *op) /* add path to this setting */ BKE_keyingset_add_destination(ks, ptr.id.data, NULL, path, index, pflag, KSP_GROUP_KSNAME); + success= 1; /* free the temp path created */ MEM_freeN(path); @@ -144,7 +145,7 @@ static int add_keyingset_button_exec (bContext *C, wmOperator *op) ED_anim_dag_flush_update(C); /* for now, only send ND_KEYS for KeyingSets */ - WM_event_add_notifier(C, ND_KEYS, NULL); + WM_event_add_notifier(C, NC_SCENE|ND_KEYINGSET, NULL); } return (success)? OPERATOR_FINISHED: OPERATOR_CANCELLED; @@ -222,7 +223,7 @@ static int remove_keyingset_button_exec (bContext *C, wmOperator *op) ED_anim_dag_flush_update(C); /* for now, only send ND_KEYS for KeyingSets */ - WM_event_add_notifier(C, ND_KEYS, NULL); + WM_event_add_notifier(C, NC_SCENE|ND_KEYINGSET, NULL); } return (success)? OPERATOR_FINISHED: OPERATOR_CANCELLED; diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c index 8e15bbde201..8c41726b81b 100644 --- a/source/blender/editors/interface/interface_anim.c +++ b/source/blender/editors/interface/interface_anim.c @@ -283,11 +283,11 @@ void ui_but_anim_menu(bContext *C, uiBut *but) if(length) { uiItemBooleanO(layout, "Add All to Keying Set", 0, "ANIM_OT_add_keyingset_button", "all", 1); uiItemBooleanO(layout, "Add Single to Keying Set", 0, "ANIM_OT_add_keyingset_button", "all", 0); - uiItemBooleanO(layout, "Remove from Keying Set", 0, "ANIM_OT_remove_keyingset_button", "all", 0); + uiItemO(layout, "Remove from Keying Set", 0, "ANIM_OT_remove_keyingset_button"); } else { uiItemBooleanO(layout, "Add to Keying Set", 0, "ANIM_OT_add_keyingset_button", "all", 0); - uiItemBooleanO(layout, "Remove from Keying Set", 0, "ANIM_OT_remove_keyingset_button", "all", 0); + uiItemO(layout, "Remove from Keying Set", 0, "ANIM_OT_remove_keyingset_button"); } } From 0e40abf642b4360212b72791a01b4e7fe0cfacf5 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 4 Sep 2009 11:19:12 +0000 Subject: [PATCH 423/577] 2.5 - Patches + Cleanups * Some of the patches in patch #19034 - by Wolfgang W. (bender) - outliner.patch - a small fix to make the outliner draw the last line of the list, if the list is bigger than the window. - scroll.patch - enables vertical scrolling in the buttons window in horizontal mode. Necessary if a panel is opened that is higher than the buttons window. * Also, fixed some messy comments in drivers code --- source/blender/editors/animation/drivers.c | 28 +++++++++---------- source/blender/editors/screen/area.c | 9 ++++-- .../blender/editors/space_outliner/outliner.c | 3 ++ 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index 8349b7f9bde..8b9224511ba 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -151,33 +151,33 @@ short ANIM_add_driver (ID *id, const char rna_path[], int array_index, short fla /* create F-Curve with Driver */ fcu= verify_driver_fcurve(id, rna_path, array_index, 1); - if(fcu && fcu->driver) { + if (fcu && fcu->driver) { fcu->driver->type= type; - + /* fill in current value for python */ - if(type == DRIVER_TYPE_PYTHON) { + if (type == DRIVER_TYPE_PYTHON) { PropertyType proptype= RNA_property_type(prop); int array= RNA_property_array_length(&ptr, prop); char *expression= fcu->driver->expression; int val, maxlen= sizeof(fcu->driver->expression); float fval; - - if(proptype == PROP_BOOLEAN) { + + if (proptype == PROP_BOOLEAN) { if(!array) val= RNA_property_boolean_get(&ptr, prop); else val= RNA_property_boolean_get_index(&ptr, prop, array_index); - + BLI_strncpy(expression, (val)? "True": "False", maxlen); } - else if(proptype == PROP_INT) { - if(!array) val= RNA_property_int_get(&ptr, prop); + else if (proptype == PROP_INT) { + if (!array) val= RNA_property_int_get(&ptr, prop); else val= RNA_property_int_get_index(&ptr, prop, array_index); - + BLI_snprintf(expression, maxlen, "%d", val); } - else if(proptype == PROP_FLOAT) { - if(!array) fval= RNA_property_float_get(&ptr, prop); + else if (proptype == PROP_FLOAT) { + if (!array) fval= RNA_property_float_get(&ptr, prop); else fval= RNA_property_float_get_index(&ptr, prop, array_index); - + BLI_snprintf(expression, maxlen, "%.3f", fval); } @@ -232,7 +232,7 @@ static int add_driver_button_exec (bContext *C, wmOperator *op) short success= 0; int a, index, length, all= RNA_boolean_get(op->ptr, "all"); - /* try to insert keyframe using property retrieved from UI */ + /* try to create driver using property retrieved from UI */ memset(&ptr, 0, sizeof(PointerRNA)); uiAnimContextProperty(C, &ptr, &prop, &index); @@ -294,7 +294,7 @@ static int remove_driver_button_exec (bContext *C, wmOperator *op) short success= 0; int a, index, length, all= RNA_boolean_get(op->ptr, "all"); - /* try to insert keyframe using property retrieved from UI */ + /* try to find driver using property retrieved from UI */ memset(&ptr, 0, sizeof(PointerRNA)); uiAnimContextProperty(C, &ptr, &prop, &index); diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 8c55cccd6b0..9a116bf95c0 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1248,6 +1248,7 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, char *contex /* before setting the view */ if(vertical) { + /* only allow scrolling in vertical direction */ v2d->keepofs |= V2D_LOCKOFS_X|V2D_KEEPOFS_Y; v2d->keepofs &= ~(V2D_LOCKOFS_Y|V2D_KEEPOFS_X); @@ -1258,8 +1259,12 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, char *contex y= -y; } else { - v2d->keepofs |= V2D_LOCKOFS_Y|V2D_KEEPOFS_X; - v2d->keepofs &= ~(V2D_LOCKOFS_X|V2D_KEEPOFS_Y); + /* for now, allow scrolling in both directions (since layouts are optimised for vertical, + * they often don't fit in horizontal layout) + */ + v2d->keepofs &= ~(V2D_LOCKOFS_X|V2D_LOCKOFS_Y|V2D_KEEPOFS_X|V2D_KEEPOFS_Y); + //v2d->keepofs |= V2D_LOCKOFS_Y|V2D_KEEPOFS_X; + //v2d->keepofs &= ~(V2D_LOCKOFS_X|V2D_KEEPOFS_Y); // don't jump back when panels close or hide if(!newcontext) diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index e6cd9c0e448..a9a9a5dab5f 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -5288,6 +5288,9 @@ void draw_outliner(const bContext *C) sizex += OL_TOGW*3; } + /* tweak to display last line (when list bigger than window) */ + sizey += V2D_SCROLL_HEIGHT; + /* update size of tot-rect (extents of data/viewable area) */ UI_view2d_totRect_set(v2d, sizex, sizey); From 20f39ec7d81af22d30700b3dde28938facfb2588 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Fri, 4 Sep 2009 12:56:30 +0000 Subject: [PATCH 424/577] == SCons == * further cleaning of 'player' stuff. Now only 3 libs are remaining, of which ideally the stubs lib will be fixed at some point, fading away into the dark history of not-so-nice code. The current blenderplayer part is still a little bit hackish, I'll see if I can find a better alternative, for now it works good enough. --- SConstruct | 2 +- extern/libredcode/SConscript | 4 ++-- intern/guardedalloc/SConscript | 2 +- intern/memutil/SConscript | 2 +- source/blender/blenkernel/SConscript | 2 +- source/blender/blenlib/SConscript | 2 +- source/blender/blenloader/SConscript | 2 +- source/blender/gpu/SConscript | 2 +- source/blender/imbuf/intern/openexr/SConscript | 2 +- source/blender/makesdna/SConscript | 2 +- source/blender/python/SConscript | 4 ++-- source/blender/readblenfile/SConscript | 2 +- source/gameengine/BlenderRoutines/SConscript | 2 +- source/gameengine/Converter/SConscript | 2 +- source/gameengine/Expressions/SConscript | 2 +- source/gameengine/GameLogic/SConscript | 2 +- source/gameengine/Ketsji/KXNetwork/SConscript | 2 +- source/gameengine/Ketsji/SConscript | 2 +- source/gameengine/Network/LoopBackNetwork/SConscript | 2 +- source/gameengine/Network/SConscript | 2 +- source/gameengine/Physics/Bullet/SConscript | 2 +- source/gameengine/Physics/Dummy/SConscript | 2 +- source/gameengine/Physics/common/SConscript | 2 +- source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript | 2 +- source/gameengine/Rasterizer/SConscript | 2 +- source/gameengine/SceneGraph/SConscript | 2 +- source/gameengine/VideoTexture/SConscript | 2 +- source/icons/SConscript | 2 +- source/kernel/SConscript | 2 +- 29 files changed, 31 insertions(+), 31 deletions(-) diff --git a/SConstruct b/SConstruct index b3291c37e1a..3227e15aaa3 100644 --- a/SConstruct +++ b/SConstruct @@ -404,7 +404,7 @@ if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']: env.BlenderProg(B.root_build_dir, "blender", dobj + mainlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender') if env['WITH_BF_PLAYER']: playerlist = B.create_blender_liblist(env, 'player') - playerlist = playerlist[0:2] + [playerlist[3]] + mainlist[2:] + [playerlist[29]] + playerlist = [mainlist[0]] + playerlist[0:2] + mainlist[2:] + [playerlist[2]] env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer') ##### Now define some targets diff --git a/extern/libredcode/SConscript b/extern/libredcode/SConscript index 9fd25ad63c7..3fb78dbea0f 100644 --- a/extern/libredcode/SConscript +++ b/extern/libredcode/SConscript @@ -12,5 +12,5 @@ incs = '. ../libopenjpeg' env.BlenderLib ( libname='extern_redcode', sources=sources, includes=Split(incs), defines=[], - libtype=['core','intern','player'], - priority=[5, 5, 200], compileflags = []) + libtype=['core','intern'], + priority=[5, 5], compileflags = []) diff --git a/intern/guardedalloc/SConscript b/intern/guardedalloc/SConscript index a93e12bebda..8927bef2efc 100644 --- a/intern/guardedalloc/SConscript +++ b/intern/guardedalloc/SConscript @@ -5,4 +5,4 @@ Import('env') sources = env.Glob('intern/*.c') incs = '.' -env.BlenderLib ('bf_guardedalloc', sources, Split(incs), defines=[], libtype=['intern', 'player'], priority = [5, 130] ) +env.BlenderLib ('bf_guardedalloc', sources, Split(incs), defines=[], libtype=['intern'], priority = [5] ) diff --git a/intern/memutil/SConscript b/intern/memutil/SConscript index 3e15dde8855..55c314d5211 100644 --- a/intern/memutil/SConscript +++ b/intern/memutil/SConscript @@ -5,4 +5,4 @@ sources = env.Glob('intern/*.cpp') incs = '. ..' -env.BlenderLib ('bf_memutil', sources, Split(incs), [], libtype=['intern', 'player'], priority = [0, 135] ) +env.BlenderLib ('bf_memutil', sources, Split(incs), [], libtype=['intern'], priority = [0] ) diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript index a5bb843cbef..0c7922de6ff 100644 --- a/source/blender/blenkernel/SConscript +++ b/source/blender/blenkernel/SConscript @@ -65,4 +65,4 @@ if env['WITH_BF_LCMS']: if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): incs += ' ' + env['BF_PTHREADS_INC'] -env.BlenderLib ( libname = 'bf_blenkernel', sources = sources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [165,137] ) +env.BlenderLib ( libname = 'bf_blenkernel', sources = sources, includes = Split(incs), defines = defs, libtype=['core'], priority = [165] ) diff --git a/source/blender/blenlib/SConscript b/source/blender/blenlib/SConscript index b6c549fd145..3d7d6b63e64 100644 --- a/source/blender/blenlib/SConscript +++ b/source/blender/blenlib/SConscript @@ -16,4 +16,4 @@ if env['OURPLATFORM'] == 'linux2': if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): incs += ' ' + env['BF_PTHREADS_INC'] -env.BlenderLib ( 'bf_blenlib', sources, Split(incs), Split(defs), libtype=['core','player'], priority = [180,120], compileflags =cflags ) +env.BlenderLib ( 'bf_blenlib', sources, Split(incs), Split(defs), libtype=['core'], priority = [180], compileflags =cflags ) diff --git a/source/blender/blenloader/SConscript b/source/blender/blenloader/SConscript index 1bc834ab9f4..0a9b8d05747 100644 --- a/source/blender/blenloader/SConscript +++ b/source/blender/blenloader/SConscript @@ -11,4 +11,4 @@ incs += ' ' + env['BF_ZLIB_INC'] defs = [] -env.BlenderLib ( 'bf_blenloader', sources, Split(incs), defs, libtype=['core','player'], priority = [135, 20] ) +env.BlenderLib ( 'bf_blenloader', sources, Split(incs), defs, libtype=['core'], priority = [135] ) diff --git a/source/blender/gpu/SConscript b/source/blender/gpu/SConscript index d40f3a97874..b45547e359c 100644 --- a/source/blender/gpu/SConscript +++ b/source/blender/gpu/SConscript @@ -8,4 +8,4 @@ incs += ' #/extern/glew/include #intern/guardedalloc ../imbuf .' incs += ' ' + env['BF_OPENGL_INC'] -env.BlenderLib ( 'bf_gpu', sources, Split(incs), [], libtype=['core', 'player'], priority=[160, 35] ) +env.BlenderLib ( 'bf_gpu', sources, Split(incs), [], libtype=['core'], priority=[160] ) diff --git a/source/blender/imbuf/intern/openexr/SConscript b/source/blender/imbuf/intern/openexr/SConscript index 30757db1cef..729619c963b 100644 --- a/source/blender/imbuf/intern/openexr/SConscript +++ b/source/blender/imbuf/intern/openexr/SConscript @@ -15,4 +15,4 @@ incs += Split(env['BF_OPENEXR_INC']) defs = ['WITH_OPENEXR'] -env.BlenderLib ('bf_openexr', source_files, incs, defs, libtype=['core','player'], priority = [225, 85]) +env.BlenderLib ('bf_openexr', source_files, incs, defs, libtype=['core'], priority = [225]) diff --git a/source/blender/makesdna/SConscript b/source/blender/makesdna/SConscript index 6d96811e1cb..1cb61f59121 100644 --- a/source/blender/makesdna/SConscript +++ b/source/blender/makesdna/SConscript @@ -8,4 +8,4 @@ objs += o incs = '#/intern/guardedalloc .' -env.BlenderLib ( 'bf_dna', objs, Split(incs), [], libtype=['core','player'], priority = [215, 140] ) +env.BlenderLib ( 'bf_dna', objs, Split(incs), [], libtype=['core'], priority = [215] ) diff --git a/source/blender/python/SConscript b/source/blender/python/SConscript index c681c5bdc39..d44cf762a0f 100644 --- a/source/blender/python/SConscript +++ b/source/blender/python/SConscript @@ -13,9 +13,9 @@ defs = [] if env['OURPLATFORM'] in ('win32-mingw', 'win32-vc','win64-vc') and env['BF_DEBUG']: defs.append('_DEBUG') -env.BlenderLib( libname = 'bf_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core','player'], priority = [140,10]) +env.BlenderLib( libname = 'bf_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core'], priority = [140]) # generic sources = env.Glob('generic/*.c') -env.BlenderLib( libname = 'bf_gen_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core','player'], priority = [361,85]) # ketsji is 360 +env.BlenderLib( libname = 'bf_gen_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core'], priority = [361]) # ketsji is 360 diff --git a/source/blender/readblenfile/SConscript b/source/blender/readblenfile/SConscript index 534ab0f7d4c..c8189501d4b 100644 --- a/source/blender/readblenfile/SConscript +++ b/source/blender/readblenfile/SConscript @@ -5,4 +5,4 @@ sources = env.Glob('intern/*.c') incs = '. ../blenloader ../blenloader/intern ../blenkernel ../blenlib ../makesdna ../../kernel/gen_messaging' -env.BlenderLib ( 'bf_readblenfile', sources, Split(incs), [], libtype=['core','player'], priority = [0, 0] ) +env.BlenderLib ( 'bf_readblenfile', sources, Split(incs), [], libtype=['core'], priority = [0] ) diff --git a/source/gameengine/BlenderRoutines/SConscript b/source/gameengine/BlenderRoutines/SConscript index 831f898853b..cfb5b0ef525 100644 --- a/source/gameengine/BlenderRoutines/SConscript +++ b/source/gameengine/BlenderRoutines/SConscript @@ -28,4 +28,4 @@ incs += ' ' + env['BF_PYTHON_INC'] incs += ' ' + env['BF_BULLET_INC'] incs += ' ' + env['BF_OPENGL_INC'] -env.BlenderLib ( 'bf_bloutines', sources, Split(incs), defs, libtype=['core', 'player'], priority=[300, 25] , cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_bloutines', sources, Split(incs), defs, libtype=['core'], priority=[300] , cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Converter/SConscript b/source/gameengine/Converter/SConscript index 2d126310475..bf2dfa5e659 100644 --- a/source/gameengine/Converter/SConscript +++ b/source/gameengine/Converter/SConscript @@ -23,4 +23,4 @@ incs += ' #source/blender/makesrna' incs += ' ' + env['BF_PYTHON_INC'] incs += ' ' + env['BF_BULLET_INC'] -env.BlenderLib ( 'bf_converter', sources, Split(incs), defs, libtype=['core','player'], priority=[305,40], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_converter', sources, Split(incs), defs, libtype=['core'], priority=[305], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Expressions/SConscript b/source/gameengine/Expressions/SConscript index 51c3a0cc5af..cbf33f39568 100644 --- a/source/gameengine/Expressions/SConscript +++ b/source/gameengine/Expressions/SConscript @@ -6,4 +6,4 @@ sources = env.Glob('*.cpp') incs ='. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/SceneGraph #source/blender/blenloader' incs += ' ' + env['BF_PYTHON_INC'] -env.BlenderLib ( 'bf_expressions', sources, Split(incs), [], libtype=['core','player'], priority = [360,75], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_expressions', sources, Split(incs), [], libtype=['core'], priority = [360], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/GameLogic/SConscript b/source/gameengine/GameLogic/SConscript index 442420a8876..f456f4125ab 100644 --- a/source/gameengine/GameLogic/SConscript +++ b/source/gameengine/GameLogic/SConscript @@ -21,4 +21,4 @@ if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): if env['BF_DEBUG']: defs.append('_DEBUG') -env.BlenderLib ( 'bf_logic', sources, Split(incs), defs, libtype=['core','player'], priority=[330, 50], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_logic', sources, Split(incs), defs, libtype=['core'], priority=[330], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Ketsji/KXNetwork/SConscript b/source/gameengine/Ketsji/KXNetwork/SConscript index f2283f0b28d..6429bd76a37 100644 --- a/source/gameengine/Ketsji/KXNetwork/SConscript +++ b/source/gameengine/Ketsji/KXNetwork/SConscript @@ -9,4 +9,4 @@ incs += ' #source/gameengine/Network #source/gameengine/SceneGraph' incs += ' ' + env['BF_PYTHON_INC'] -env.BlenderLib ( 'bf_network', Split(sources), Split(incs), defines=[],libtype=['core', 'player'], priority=[400, 100], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_network', Split(sources), Split(incs), defines=[],libtype=['core'], priority=[400], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript index 1f5df8dea00..122b77e0173 100644 --- a/source/gameengine/Ketsji/SConscript +++ b/source/gameengine/Ketsji/SConscript @@ -33,4 +33,4 @@ if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): if env['BF_DEBUG']: defs.append('_DEBUG') # for Python -env.BlenderLib ( 'bf_ketsji', sources, Split(incs), defs, libtype=['core','player'], priority=[320, 80], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_ketsji', sources, Split(incs), defs, libtype=['core'], priority=[320], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Network/LoopBackNetwork/SConscript b/source/gameengine/Network/LoopBackNetwork/SConscript index 62b0a65a514..2c27ee707f0 100644 --- a/source/gameengine/Network/LoopBackNetwork/SConscript +++ b/source/gameengine/Network/LoopBackNetwork/SConscript @@ -5,4 +5,4 @@ sources = 'NG_LoopBackNetworkDeviceInterface.cpp' incs = '. #source/kernel/gen_system #intern/string #source/gameengine/Network' -env.BlenderLib ( 'bf_loopbacknetwork', Split(sources), Split(incs), defines=[],libtype=['core', 'player'], priority=[400, 115] ) +env.BlenderLib ( 'bf_loopbacknetwork', Split(sources), Split(incs), defines=[],libtype=['core'], priority=[400] ) diff --git a/source/gameengine/Network/SConscript b/source/gameengine/Network/SConscript index 297cfdb6748..f584503e109 100644 --- a/source/gameengine/Network/SConscript +++ b/source/gameengine/Network/SConscript @@ -5,4 +5,4 @@ sources = env.Glob('*.cpp') #'NG_NetworkMessage.cpp NG_NetworkObject.cpp NG_Netw incs = '. #source/kernel/gen_system #intern/string #intern/moto/include' -env.BlenderLib ( 'bf_ngnetwork', sources, Split(incs), [], libtype=['core', 'player'], priority=[400, 110] ) +env.BlenderLib ( 'bf_ngnetwork', sources, Split(incs), [], libtype=['core'], priority=[400] ) diff --git a/source/gameengine/Physics/Bullet/SConscript b/source/gameengine/Physics/Bullet/SConscript index 1489e4c46f6..baba40bcdc7 100644 --- a/source/gameengine/Physics/Bullet/SConscript +++ b/source/gameengine/Physics/Bullet/SConscript @@ -21,4 +21,4 @@ incs += ' #intern/guardedalloc' incs += ' ' + env['BF_BULLET_INC'] incs += ' ' + env['BF_PYTHON_INC'] -env.BlenderLib ( 'bf_bullet', Split(sources), Split(incs), [], libtype=['core','player'], priority=[350,70], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_bullet', Split(sources), Split(incs), [], libtype=['core'], priority=[350], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Physics/Dummy/SConscript b/source/gameengine/Physics/Dummy/SConscript index cb4a09559be..f4444cf6746 100644 --- a/source/gameengine/Physics/Dummy/SConscript +++ b/source/gameengine/Physics/Dummy/SConscript @@ -5,4 +5,4 @@ sources = 'DummyPhysicsEnvironment.cpp' incs = '. ../common' -env.BlenderLib ( 'bf_dummy', Split(sources), Split(incs), [], libtype=['core','player'], priority=[350,55] ) +env.BlenderLib ( 'bf_dummy', Split(sources), Split(incs), [], libtype=['core'], priority=[350] ) diff --git a/source/gameengine/Physics/common/SConscript b/source/gameengine/Physics/common/SConscript index bbf2d345a30..b9adbd7210a 100644 --- a/source/gameengine/Physics/common/SConscript +++ b/source/gameengine/Physics/common/SConscript @@ -5,4 +5,4 @@ sources = 'PHY_IMotionState.cpp PHY_IController.cpp PHY_IPhysicsController.cpp P incs = '. ../Dummy #intern/moto/include' -env.BlenderLib ( 'bf_physics_common', Split(sources), Split(incs), [], libtype=['core','player'], priority=[360, 90], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_physics_common', Split(sources), Split(incs), [], libtype=['core'], priority=[360], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript index 851ec0c47c3..b1e5289c14c 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript @@ -8,4 +8,4 @@ incs += ' #source/blender/gpu #extern/glew/include ' + env['BF_OPENGL_INC'] incs += ' #source/blender/gameengine/Ketsji #source/gameengine/SceneGraph #source/blender/makesdna #source/blender/blenkernel' incs += ' #intern/guardedalloc #source/blender/blenlib' -env.BlenderLib ( 'bf_oglrasterizer', Split(sources), Split(incs), [], libtype=['core','player'], priority=[350, 65], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_oglrasterizer', Split(sources), Split(incs), [], libtype=['core'], priority=[350], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Rasterizer/SConscript b/source/gameengine/Rasterizer/SConscript index a1a1c7a4038..064736bcc88 100644 --- a/source/gameengine/Rasterizer/SConscript +++ b/source/gameengine/Rasterizer/SConscript @@ -7,4 +7,4 @@ sources = env.Glob('*.cpp') incs = '. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/BlenderRoutines #extern/glew/include #source/gameengine/Expressions #source/gameengine/SceneGraph #source/blender/blenkernel #source/blender/makesdna' incs += ' ' + env['BF_PYTHON_INC'] -env.BlenderLib ( 'bf_rasterizer', sources, Split(incs), [], libtype=['core','player'], priority=[350,60], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_rasterizer', sources, Split(incs), [], libtype=['core'], priority=[350], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/SceneGraph/SConscript b/source/gameengine/SceneGraph/SConscript index b7d8de450ab..79bf3033fa1 100644 --- a/source/gameengine/SceneGraph/SConscript +++ b/source/gameengine/SceneGraph/SConscript @@ -6,4 +6,4 @@ sources = env.Glob('*.cpp') incs = '. #intern/moto/include' -env.BlenderLib ( 'bf_scenegraph', sources, Split(incs), [], libtype=['core','player'], priority=[325,45], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_scenegraph', sources, Split(incs), [], libtype=['core'], priority=[325], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/VideoTexture/SConscript b/source/gameengine/VideoTexture/SConscript index ada878b74f2..0b35c019178 100644 --- a/source/gameengine/VideoTexture/SConscript +++ b/source/gameengine/VideoTexture/SConscript @@ -27,4 +27,4 @@ if env['WITH_BF_FFMPEG']: incs += ' ' + env['BF_FFMPEG_INC'] + ' ' + env['BF_PTHREADS_INC'] defs.append('__STDC_CONSTANT_MACROS') -env.BlenderLib ( 'bf_videotex', sources, Split(incs), defs, libtype=['core','player'], priority=[300, 30], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_videotex', sources, Split(incs), defs, libtype=['core'], priority=[300], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/icons/SConscript b/source/icons/SConscript index 1471a06c09d..c929729f05b 100644 --- a/source/icons/SConscript +++ b/source/icons/SConscript @@ -3,4 +3,4 @@ Import ('env') source = 'winblender.rcscons' -env.BlenderRes('winresource', source, ['core', 'player'], priority=[95 , 100]) \ No newline at end of file +env.BlenderRes('winresource', source, ['core'], priority=[95]) diff --git a/source/kernel/SConscript b/source/kernel/SConscript index 88fc58755c0..746fb60d4ff 100644 --- a/source/kernel/SConscript +++ b/source/kernel/SConscript @@ -7,4 +7,4 @@ sources += ' gen_system/SYS_System.cpp' incs = 'gen_messaging gen_system #/intern/string #/intern/moto/include #/source/blender/blenloader ' -env.BlenderLib ( 'bf_kernel', Split(sources), Split(incs), [], libtype = ['core', 'player'], priority = [400, 95] ) +env.BlenderLib ( 'bf_kernel', Split(sources), Split(incs), [], libtype = ['core'], priority = [400] ) From 461cb87e1df40b87709a568967da6d252715b1ee Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Fri, 4 Sep 2009 15:54:06 +0000 Subject: [PATCH 425/577] == SCons == * apply a patch from b333rt. I modified to test for relative/absolute paths before doing mods by b333rt. Fixes troubles with using absolute paths in BF_BUILDDIR --- tools/Blender.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/Blender.py b/tools/Blender.py index 421a79454df..d7cbe1076e7 100644 --- a/tools/Blender.py +++ b/tools/Blender.py @@ -101,7 +101,10 @@ def create_blender_liblist(lenv = None, libtype = None): sortlist.sort() for sk in sortlist: v = curlib[sk] - target = os.path.abspath(os.getcwd() + os.sep + root_build_dir + 'lib' + os.sep +lenv['LIBPREFIX'] + v + lenv['LIBSUFFIX']) + if not (root_build_dir[0]==os.sep or root_build_dir[1]==':'): + target = os.path.abspath(os.getcwd() + os.sep + root_build_dir + 'lib' + os.sep +lenv['LIBPREFIX'] + v + lenv['LIBSUFFIX']) + else: + target = os.path.abspath(root_build_dir + 'lib' + os.sep +lenv['LIBPREFIX'] + v + lenv['LIBSUFFIX']) lst.append(target) return lst @@ -465,7 +468,11 @@ class BlenderEnvironment(SConsEnvironment): print bc.HEADER+'Configuring resource '+bc.ENDC+bc.OKGREEN+libname+bc.ENDC lenv = self.Clone() - res = lenv.RES('#'+root_build_dir+'lib/'+libname, source) + if not (root_build_dir[0]==os.sep or root_build_dir[1]==':'): + res = lenv.RES('#'+root_build_dir+'lib/'+libname, source) + else: + res = lenv.RES(root_build_dir+'lib/'+libname, source) + SConsEnvironment.Default(self, res) resources.append(res) From b537da1837f8d41ad99a41def20f8bcdd41c64c3 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Fri, 4 Sep 2009 16:13:43 +0000 Subject: [PATCH 426/577] * shuffle a bit with playerlist. Fixes some undefined references, but not all. 15 undefined references left for mingw. (msvc is fine) --- SConstruct | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 3227e15aaa3..f322ae27e06 100644 --- a/SConstruct +++ b/SConstruct @@ -404,7 +404,7 @@ if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']: env.BlenderProg(B.root_build_dir, "blender", dobj + mainlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender') if env['WITH_BF_PLAYER']: playerlist = B.create_blender_liblist(env, 'player') - playerlist = [mainlist[0]] + playerlist[0:2] + mainlist[2:] + [playerlist[2]] + playerlist = playerlist[0:2] + [mainlist[0]] + mainlist[2:] + [playerlist[2]] env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer') ##### Now define some targets From 01f9b34abec653aa445cc00788a35f646849b07f Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Fri, 4 Sep 2009 16:41:46 +0000 Subject: [PATCH 427/577] * remove mtio.h - no magnetic tape support has been coded. Helps compilation on osx10.6. --- source/blender/blenlib/intern/storage.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index e6e37c58805..7cbef85b938 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -70,9 +70,6 @@ #include -#if !defined(WIN32) -#include /* tape comando's */ -#endif #include /* strcpy etc.. */ #ifndef WIN32 From d65a908ec10a1f58aff70abd831b33ae2d53439d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 4 Sep 2009 18:32:31 +0000 Subject: [PATCH 428/577] update relative paths for CMake --- source/blenderplayer/bad_level_call_stubs/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blenderplayer/bad_level_call_stubs/CMakeLists.txt b/source/blenderplayer/bad_level_call_stubs/CMakeLists.txt index abb086b072a..fea19d90ed0 100644 --- a/source/blenderplayer/bad_level_call_stubs/CMakeLists.txt +++ b/source/blenderplayer/bad_level_call_stubs/CMakeLists.txt @@ -29,8 +29,8 @@ FILE(GLOB SRC stubs.c) SET(INC . .. - ../../source/blender/makesdna - ../../source/blender/makesrna + ../../../source/blender/makesdna + ../../../source/blender/makesrna ) IF(WITH_INTERNATIONAL) From 5bc0fa9a04fae41433ea296221b1f8837453d517 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 4 Sep 2009 19:09:05 +0000 Subject: [PATCH 429/577] fix for ffmpeg with cmake, still not linking yet --- source/blenderplayer/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/source/blenderplayer/CMakeLists.txt b/source/blenderplayer/CMakeLists.txt index 030d9dbbba0..01ec55f10c3 100644 --- a/source/blenderplayer/CMakeLists.txt +++ b/source/blenderplayer/CMakeLists.txt @@ -103,6 +103,7 @@ IF(UNIX) bf_readblenfile bf_dna bf_rna + bf_videotex bf_blenfont bf_audaspace blenkernel_blc From 9303254e4f137c2810c5bc99ef1783fab249bc16 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Fri, 4 Sep 2009 19:27:15 +0000 Subject: [PATCH 430/577] fix for ffmpeg with cmake, now linking --- source/blenderplayer/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blenderplayer/CMakeLists.txt b/source/blenderplayer/CMakeLists.txt index 01ec55f10c3..30a1c08ebc9 100644 --- a/source/blenderplayer/CMakeLists.txt +++ b/source/blenderplayer/CMakeLists.txt @@ -66,6 +66,7 @@ IF(UNIX) gp_common bf_string bf_ghost + bf_rna bf_blenkernel bf_blenloader bf_blenpluginapi @@ -102,7 +103,6 @@ IF(UNIX) bf_dds bf_readblenfile bf_dna - bf_rna bf_videotex bf_blenfont bf_audaspace From 944d0e908728d07a5a8da809baf448592ba9e701 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Fri, 4 Sep 2009 20:03:27 +0000 Subject: [PATCH 431/577] Fixed sound stuff for gameplayer, no sound though as U.audiodevice is set to 0 (="No Audio"). --- .../GamePlayer/common/GPC_Engine.cpp | 15 +------- .../gameengine/GamePlayer/common/GPC_Engine.h | 3 -- .../GamePlayer/ghost/GPG_Application.cpp | 36 ++++--------------- .../GamePlayer/ghost/GPG_Application.h | 3 -- .../gameengine/GamePlayer/ghost/GPG_ghost.cpp | 5 --- 5 files changed, 7 insertions(+), 55 deletions(-) diff --git a/source/gameengine/GamePlayer/common/GPC_Engine.cpp b/source/gameengine/GamePlayer/common/GPC_Engine.cpp index f131987095a..85a362d042a 100644 --- a/source/gameengine/GamePlayer/common/GPC_Engine.cpp +++ b/source/gameengine/GamePlayer/common/GPC_Engine.cpp @@ -58,9 +58,6 @@ #include "NG_LoopBackNetworkDeviceInterface.h" #include "RAS_IRenderTools.h" -#if 0 //XXX - ADD SOUND - #include "SND_DeviceManager.h" -#endif #include "GPC_Engine.h" #include "GPC_KeyboardDevice.h" @@ -77,8 +74,7 @@ GPC_Engine::GPC_Engine(char *customLoadingAnimationURL, m_system(NULL), m_keyboarddev(NULL), m_mousedev(NULL), m_canvas(NULL), m_rendertools(NULL), m_portal(NULL), m_sceneconverter(NULL), m_networkdev(NULL), - m_audiodevice(NULL), m_curarea(NULL), - m_customLoadingAnimationURL(NULL), + m_curarea(NULL), m_customLoadingAnimationURL(NULL), m_foregroundColor(foregroundColor), m_backgroundColor(backgroundColor), m_frameRate(frameRate), m_BlenderLogo(0), m_Blender3DLogo(0)/*, m_NaNLogo(0)*/ @@ -203,7 +199,6 @@ bool GPC_Engine::StartKetsji(void) m_keyboarddev, m_mousedev, m_networkdev, - m_audiodevice, m_system); m_system->SetMainLoop(m_portal->m_ketsjieng); @@ -339,14 +334,6 @@ void GPC_Engine::Exit() m_networkdev = 0; } - if (m_audiodevice) - { -#if 0 //XXX - ADD SOUND - SND_DeviceManager::Unsubscribe(); -#endif - m_audiodevice = 0; - } - m_initialized = false; } diff --git a/source/gameengine/GamePlayer/common/GPC_Engine.h b/source/gameengine/GamePlayer/common/GPC_Engine.h index b7121599c6e..42234bcbcd6 100644 --- a/source/gameengine/GamePlayer/common/GPC_Engine.h +++ b/source/gameengine/GamePlayer/common/GPC_Engine.h @@ -40,7 +40,6 @@ class RAS_IRenderTools; class KetsjiPortal; class KX_ISceneConverter; class NG_LoopBackNetworkDeviceInterface; -class SND_IAudioDevice; class GPC_RawImage; @@ -77,8 +76,6 @@ public: KX_ISceneConverter* m_sceneconverter; /** Network interface. */ NG_LoopBackNetworkDeviceInterface* m_networkdev; - /** Audiodevice interface */ - SND_IAudioDevice* m_audiodevice; struct ScrArea *m_curarea; // for future use, not used yet diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index 879c2264247..8ec41968042 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -57,6 +57,7 @@ extern "C" #include "BLO_readfile.h" #include "BKE_global.h" #include "BKE_main.h" +#include "BKE_sound.h" #include "IMB_imbuf.h" #include "DNA_scene_types.h" #ifdef __cplusplus @@ -85,10 +86,6 @@ extern "C" #include "KX_BlenderSceneConverter.h" #include "NG_LoopBackNetworkDeviceInterface.h" -#if 0 //XXX - ADD SOUND - #include "SND_DeviceManager.h" -#endif - #include "GPC_MouseDevice.h" #include "GPC_RenderTools.h" #include "GPG_Canvas.h" @@ -128,8 +125,7 @@ GPG_Application::GPG_Application(GHOST_ISystem* system) m_rendertools(0), m_rasterizer(0), m_sceneconverter(0), - m_networkdevice(0), - m_audiodevice(0), + m_networkdevice(0), m_blendermat(0), m_blenderglslmat(0), m_pyGlobalDictString(0), @@ -587,15 +583,7 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) if (!m_networkdevice) goto initFailed; -#if 0 //XXX - ADD SOUND - // get an audiodevice - SND_DeviceManager::Subscribe(); - m_audiodevice = SND_DeviceManager::Instance(); - if (!m_audiodevice) - goto initFailed; - m_audiodevice->UseCD(); -#endif - + sound_init(); // create a ketsjisystem (only needed for timing and stuff) m_kxsystem = new GPG_System (m_system); @@ -613,9 +601,7 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) m_ketsjiengine->SetRenderTools(m_rendertools); m_ketsjiengine->SetRasterizer(m_rasterizer); m_ketsjiengine->SetNetworkDevice(m_networkdevice); -#if 0 //XXX - ADD SOUND - m_ketsjiengine->SetAudioDevice(m_audiodevice); -#endif + m_ketsjiengine->SetTimingDisplay(frameRate, false, false); CValue::SetDeprecationWarnings(nodepwarnings); @@ -628,10 +614,8 @@ bool GPG_Application::initEngine(GHOST_IWindow* window, const int stereoMode) return m_engineInitialized; initFailed: + sound_exit(); delete m_kxsystem; -#if 0 // XXX - ADD SOUND - delete m_audiodevice; -#endif delete m_networkdevice; delete m_mouse; delete m_keyboard; @@ -644,7 +628,6 @@ initFailed: m_keyboard = NULL; m_mouse = NULL; m_networkdevice = NULL; - m_audiodevice = NULL; m_kxsystem = NULL; return false; } @@ -690,7 +673,6 @@ bool GPG_Application::startEngine(void) KX_Scene* startscene = new KX_Scene(m_keyboard, m_mouse, m_networkdevice, -// m_audiodevice, // XXX ADD SOUND startscenename, m_startScene); @@ -780,6 +762,7 @@ void GPG_Application::stopEngine() void GPG_Application::exitEngine() { + sound_exit(); if (m_ketsjiengine) { stopEngine(); @@ -791,13 +774,6 @@ void GPG_Application::exitEngine() delete m_kxsystem; m_kxsystem = 0; } - if (m_audiodevice) - { -#if 0 //XXX - ADD SOUND - SND_DeviceManager::Unsubscribe(); - m_audiodevice = 0; -#endif - } if (m_networkdevice) { delete m_networkdevice; diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.h b/source/gameengine/GamePlayer/ghost/GPG_Application.h index 845686f5770..73430213078 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.h +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.h @@ -38,7 +38,6 @@ class KX_KetsjiEngine; class KX_ISceneConverter; class NG_LoopBackNetworkDeviceInterface; -class SND_IAudioDevice; class RAS_IRasterizer; class GHOST_IEvent; class GHOST_ISystem; @@ -142,8 +141,6 @@ protected: KX_ISceneConverter* m_sceneconverter; /** Network interface. */ NG_LoopBackNetworkDeviceInterface* m_networkdevice; - /** Sound device. */ - SND_IAudioDevice* m_audiodevice; bool m_blendermat; bool m_blenderglslmat; diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index b7677d29507..edc32093eab 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -59,7 +59,6 @@ extern "C" #include "BKE_icons.h" #include "BKE_node.h" #include "BKE_report.h" -#include "BKE_sound.h" #include "BLI_blenlib.h" #include "DNA_scene_types.h" #include "BLO_readfile.h" @@ -362,8 +361,6 @@ int main(int argc, char** argv) quicktime_init(); #endif - sound_init(); - libtiff_init(); // Parse command line options @@ -824,8 +821,6 @@ int main(int argc, char** argv) } free_nodesystem(); - - sound_exit(); return error ? -1 : 0; } From 5342f7930fb26855b92f337ace45f2ee51153957 Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Fri, 4 Sep 2009 20:14:59 +0000 Subject: [PATCH 432/577] Added sound device default settings for the gameplayer. --- source/gameengine/GamePlayer/ghost/GPG_ghost.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index edc32093eab..fb2e1c72a85 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -61,6 +61,7 @@ extern "C" #include "BKE_report.h" #include "BLI_blenlib.h" #include "DNA_scene_types.h" +#include "DNA_userdef_types.h" #include "BLO_readfile.h" #include "BLO_readblenfile.h" #include "IMB_imbuf.h" @@ -390,6 +391,13 @@ int main(int argc, char** argv) } } #endif + // XXX add the ability to change this values to the command line parsing. + U.mixbufsize = 2048; + U.audiodevice = 2; + U.audiorate = 44100; + U.audioformat = 0x24; + U.audiochannels = 2; + for (i = 1; (i < argc) && !error #ifdef WIN32 && scr_saver_mode == SCREEN_SAVER_MODE_NONE From 7df35db1b1364dcd81dd8247ad3707d40a78fd59 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 4 Sep 2009 20:51:09 +0000 Subject: [PATCH 433/577] 2.5 Notifiers --------- Various fixes for wrong use of notifiers, and some new notifiers to make things a bit more clear and consistent, with two notable changes: * Geometry changes are now done with NC_GEOM, rather than NC_OBJECT|ND_GEOM_, so an object does need to be available. * Space data now use NC_SPACE|ND_SPACE_*, instead of data notifiers or even NC_WINDOW in some cases. Note that NC_SPACE should only be used for notifying about changes in space data, we don't want to go back to allqueue(REDRAW..). Depsgraph --------- The dependency graph now has a different flush call: DAG_object_flush_update(scene, ob, flag) is replaced by: DAG_id_flush_update(id, flag) It still works basically the same, one difference is that it now also accepts object data (e.g. Mesh), again to avoid requiring an Object to be available. Other ID types will simply do nothing at the moment. Docs ---- I made some guidelines for how/when to do which kinds of updates and notifiers. I can't specify totally exact how to make these decisions, but these are basically the guidelines I use. So, new and updated docs are here: http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers --- source/blender/blenkernel/BKE_depsgraph.h | 7 +- source/blender/blenkernel/intern/armature.c | 1 - source/blender/blenkernel/intern/booleanops.c | 2 +- source/blender/blenkernel/intern/depsgraph.c | 93 +++-- source/blender/blenkernel/intern/mesh.c | 4 +- source/blender/blenkernel/intern/multires.c | 2 +- source/blender/blenkernel/intern/particle.c | 13 +- source/blender/blenkernel/intern/pointcache.c | 2 +- .../blender/editors/armature/editarmature.c | 25 +- source/blender/editors/armature/poselib.c | 6 +- source/blender/editors/armature/poseobject.c | 18 +- source/blender/editors/curve/editcurve.c | 121 +++--- source/blender/editors/curve/editfont.c | 14 +- .../editors/interface/interface_templates.c | 10 +- source/blender/editors/mesh/editmesh.c | 8 +- source/blender/editors/mesh/editmesh_add.c | 78 ++-- source/blender/editors/mesh/editmesh_loop.c | 7 +- source/blender/editors/mesh/editmesh_mods.c | 121 +++--- source/blender/editors/mesh/editmesh_tools.c | 147 +++---- source/blender/editors/mesh/mesh_layers.c | 88 ++-- source/blender/editors/mesh/meshtools.c | 2 +- source/blender/editors/metaball/editmball.c | 30 +- .../blender/editors/object/editconstraint.c | 13 +- source/blender/editors/object/editkey.c | 107 +---- source/blender/editors/object/editlattice.c | 9 +- source/blender/editors/object/object_edit.c | 55 ++- .../blender/editors/object/object_modifier.c | 52 +-- source/blender/editors/object/object_vgroup.c | 80 ++-- source/blender/editors/physics/editparticle.c | 62 ++- .../editors/sculpt_paint/paint_image.c | 2 +- .../editors/sculpt_paint/paint_vertex.c | 18 +- .../editors/space_action/space_action.c | 4 + .../editors/space_buttons/buttons_ops.c | 19 +- .../editors/space_buttons/space_buttons.c | 17 +- .../editors/space_console/space_console.c | 6 +- source/blender/editors/space_file/file_ops.c | 30 +- .../blender/editors/space_file/space_file.c | 16 +- .../blender/editors/space_graph/space_graph.c | 4 + .../blender/editors/space_image/space_image.c | 12 +- .../blender/editors/space_info/space_info.c | 5 +- source/blender/editors/space_nla/space_nla.c | 4 + .../blender/editors/space_node/space_node.c | 9 + .../blender/editors/space_outliner/outliner.c | 6 +- .../editors/space_outliner/space_outliner.c | 8 + .../editors/space_sequencer/space_sequencer.c | 9 + .../blender/editors/space_text/space_text.c | 4 + source/blender/editors/space_text/text_ops.c | 3 +- .../blender/editors/space_time/space_time.c | 11 + .../editors/space_view3d/space_view3d.c | 37 +- .../editors/space_view3d/view3d_buttons.c | 16 +- .../editors/space_view3d/view3d_header.c | 6 +- .../editors/space_view3d/view3d_select.c | 4 +- .../editors/space_view3d/view3d_snap.c | 8 +- source/blender/editors/transform/transform.c | 2 +- .../editors/transform/transform_conversions.c | 14 +- .../editors/transform/transform_generics.c | 14 +- source/blender/editors/util/editmode_undo.c | 2 +- source/blender/editors/uvedit/uvedit_ops.c | 50 +-- .../editors/uvedit/uvedit_unwrap_ops.c | 40 +- source/blender/makesrna/intern/rna_armature.c | 18 +- source/blender/makesrna/intern/rna_boid.c | 103 ++--- source/blender/makesrna/intern/rna_cloth.c | 63 +-- .../blender/makesrna/intern/rna_constraint.c | 5 +- source/blender/makesrna/intern/rna_curve.c | 17 +- source/blender/makesrna/intern/rna_define.c | 3 +- source/blender/makesrna/intern/rna_fluidsim.c | 18 +- source/blender/makesrna/intern/rna_internal.h | 1 + source/blender/makesrna/intern/rna_key.c | 5 +- source/blender/makesrna/intern/rna_lattice.c | 14 +- source/blender/makesrna/intern/rna_mesh.c | 110 ++++- source/blender/makesrna/intern/rna_mesh_api.c | 11 +- source/blender/makesrna/intern/rna_meta.c | 12 +- source/blender/makesrna/intern/rna_modifier.c | 344 ++++++++-------- source/blender/makesrna/intern/rna_object.c | 19 +- .../makesrna/intern/rna_object_force.c | 90 +++-- source/blender/makesrna/intern/rna_particle.c | 356 ++++++++-------- source/blender/makesrna/intern/rna_pose.c | 2 +- .../makesrna/intern/rna_sculpt_paint.c | 19 +- source/blender/makesrna/intern/rna_smoke.c | 2 +- source/blender/makesrna/intern/rna_space.c | 227 ++++++----- source/blender/makesrna/intern/rna_userdef.c | 380 +++++++++--------- source/blender/makesrna/intern/rna_wm.c | 1 + source/blender/windowmanager/WM_types.h | 51 ++- source/blender/windowmanager/intern/wm.c | 2 +- .../windowmanager/intern/wm_event_system.c | 4 +- 85 files changed, 1746 insertions(+), 1688 deletions(-) diff --git a/source/blender/blenkernel/BKE_depsgraph.h b/source/blender/blenkernel/BKE_depsgraph.h index 70b6c1d13f4..e242ead3b87 100644 --- a/source/blender/blenkernel/BKE_depsgraph.h +++ b/source/blender/blenkernel/BKE_depsgraph.h @@ -32,6 +32,8 @@ #define DEPS_DEBUG */ +struct ID; +struct Main; struct Scene; struct DagNodeQueue; struct DagForest; @@ -103,8 +105,9 @@ void DAG_object_update_flags(struct Scene *sce, struct Object *ob, unsigned int /* flushes all recalc flags in objects down the dependency tree */ void DAG_scene_flush_update(struct Scene *sce, unsigned int lay, int time); - /* flushes all recalc flags for this object down the dependency tree */ -void DAG_object_flush_update(struct Scene *sce, struct Object *ob, short flag); + /* flushes all recalc flags for this object down the dependency tree, + but not the DAG only supports objects and object data currently */ +void DAG_id_flush_update(struct ID *id, short flag); void DAG_pose_sort(struct Object *ob); diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 631bc2cb88c..e568f1b2c0e 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -130,7 +130,6 @@ void free_bones (bArmature *arm) void free_armature(bArmature *arm) { if (arm) { - /* unlink_armature(arm);*/ free_bones(arm); /* free editmode data */ diff --git a/source/blender/blenkernel/intern/booleanops.c b/source/blender/blenkernel/intern/booleanops.c index eb3aefe7ee6..5f0697f06ce 100644 --- a/source/blender/blenkernel/intern/booleanops.c +++ b/source/blender/blenkernel/intern/booleanops.c @@ -589,7 +589,7 @@ int NewBooleanMesh(Scene *scene, Base *base, Base *base_select, int int_op_type) MEM_freeN(mat); /* update dag */ - DAG_object_flush_update(scene, ob_new, OB_RECALC_DATA); + DAG_id_flush_update(&ob_new->id, OB_RECALC_DATA); return 1; } diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c index 6c765b02e5d..6a14762e0ed 100644 --- a/source/blender/blenkernel/intern/depsgraph.c +++ b/source/blender/blenkernel/intern/depsgraph.c @@ -61,6 +61,7 @@ #include "DNA_space_types.h" #include "DNA_view2d_types.h" #include "DNA_view3d_types.h" +#include "DNA_windowmanager_types.h" #include "BLI_ghash.h" @@ -2141,39 +2142,77 @@ void DAG_scene_update_flags(Scene *scene, unsigned int lay) } - -/* flag this object and all its relations to recalc */ -/* if you need to do more objects, tag object yourself and - use DAG_scene_flush_update() in end */ -void DAG_object_flush_update(Scene *sce, Object *ob, short flag) +void DAG_id_flush_update(ID *id, short flag) { - - if(ob==NULL || sce->theDag==NULL) return; + Main *bmain= G.main; + wmWindowManager *wm; + wmWindow *win; + Scene *sce; + Object *obt, *ob= NULL; + short idtype; - ob->recalc |= flag; - BKE_ptcache_object_reset(sce, ob, PTCACHE_RESET_DEPSGRAPH); - - /* all users of this ob->data should be checked */ - /* BUT! displists for curves are still only on cu */ - if(flag & OB_RECALC_DATA) { - if(ob->type!=OB_CURVE && ob->type!=OB_SURF) { - ID *id= ob->data; - if(id && id->us>1) { - /* except when there's a key and shapes are locked */ - if(ob_get_key(ob) && (ob->shapeflag & (OB_SHAPE_LOCK|OB_SHAPE_TEMPLOCK))); - else { - Object *obt; - for (obt=G.main->object.first; obt; obt= obt->id.next) { - if (obt != ob && obt->data==ob->data) { - obt->recalc |= OB_RECALC_DATA; - BKE_ptcache_object_reset(sce, obt, PTCACHE_RESET_DEPSGRAPH); - } - } + /* only one scene supported currently, making more scenes work + correctly requires changes beyond just the dependency graph */ + + if((wm= bmain->wm.first)) { + /* if we have a windowmanager, use sce from first window */ + for(win=wm->windows.first; win; win=win->next) { + sce= (win->screen)? win->screen->scene: NULL; + + if(sce) + break; + } + } + else + /* if not, use the first sce */ + sce= bmain->scene.first; + + if(!id || !sce || !sce->theDag) + return; + + /* set flags & pointcache for object */ + if(GS(id->name) == ID_OB) { + ob= (Object*)id; + ob->recalc |= flag; + BKE_ptcache_object_reset(sce, ob, PTCACHE_RESET_DEPSGRAPH); + + if(flag & OB_RECALC_DATA) { + /* all users of this ob->data should be checked */ + id= ob->data; + + /* no point in trying in this cases */ + if(!id || id->us <= 1) + id= NULL; + /* curves and surfaces only need to mark one object, since + otherwise cu->displist would be computed multiple times */ + else if(ob->type==OB_CURVE || ob->type==OB_SURF) + id= NULL; + /* also for locked shape keys we make an exception */ + else if(ob_get_key(ob) && (ob->shapeflag & (OB_SHAPE_LOCK|OB_SHAPE_TEMPLOCK))) + id= NULL; + } + } + + /* set flags & pointcache for object data */ + if(id) { + idtype= GS(id->name); + + if(ELEM7(idtype, ID_ME, ID_CU, ID_MB, ID_LA, ID_LT, ID_CA, ID_AR)) { + for(obt=bmain->object.first; obt; obt= obt->id.next) { + if(!(ob && obt == ob) && obt->data == id) { + obt->recalc |= OB_RECALC_DATA; + BKE_ptcache_object_reset(sce, obt, PTCACHE_RESET_DEPSGRAPH); + + /* for these we only flag one object, otherwise cu->displist + would be computed multiple times */ + if(obt->type==OB_CURVE || obt->type==OB_SURF) + break; } } } } - + + /* flush to other objects that depend on this one */ // XXX if(G.curscreen) // DAG_scene_flush_update(sce, dag_screen_view3d_layers(), 0); // else diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index c7454d3b832..c92eda6d169 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -977,7 +977,7 @@ void mesh_set_smooth_flag(Object *meshOb, int enableSmooth) } } -// XXX do this in caller DAG_object_flush_update(scene, meshOb, OB_RECALC_DATA); +// XXX do this in caller DAG_id_flush_update(&me->id, OB_RECALC_DATA); } void mesh_calc_normals(MVert *mverts, int numVerts, MFace *mfaces, int numFaces, float **faceNors_r) @@ -1265,7 +1265,7 @@ void mesh_pmv_revert(Object *ob, Mesh *me) MEM_freeN(me->pv->vert_map); me->pv->vert_map= NULL; -// XXX do this in caller DAG_object_flush_update(scene, ob, OB_RECALC_DATA); +// XXX do this in caller DAG_id_flush_update(&me->id, OB_RECALC_DATA); } } diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index 9ba5769843f..37e7e55050a 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -83,7 +83,7 @@ int multiresModifier_switch_level(Object *ob, const int distance) mmd->lvl += distance; if(mmd->lvl < 1) mmd->lvl = 1; else if(mmd->lvl > mmd->totlvl) mmd->lvl = mmd->totlvl; - /* XXX: DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA); + /* XXX: DAG_id_flush_update(&ob->id, OB_RECALC_DATA); object_handle_update(ob);*/ return 1; } diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 18e3512967a..1ae3ec5dd50 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -2631,7 +2631,7 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra ParticleInterpolationData pind; float birthtime = 0.0, dietime = 0.0; - float t, time = 0.0, keytime = 0.0, dfra = 1.0, frs_sec = scene->r.frs_sec; + float t, time = 0.0, dfra = 1.0, frs_sec = scene->r.frs_sec; float col[4] = {0.5f, 0.5f, 0.5f, 1.0f}; float prev_tangent[3], hairmat[4][4]; float rotmat[3][3]; @@ -2853,14 +2853,13 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf ParticleSystem *psys = edit->psys; ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys); - ParticleSettings *part = psys ? psys->part : NULL; ParticleData *pa = psys ? psys->particles : NULL; ParticleInterpolationData pind; ParticleKey result; float birthtime = 0.0, dietime = 0.0; - float t, time = 0.0, keytime = 0.0, dfra = 1.0, frs_sec; + float t, time = 0.0, keytime = 0.0, frs_sec; float hairmat[4][4]; int k,i; int steps = (int)pow(2.0, (double)pset->draw_step); @@ -3161,7 +3160,7 @@ void object_add_particle_system(Scene *scene, Object *ob) psys->cfra=bsystem_time(scene,ob,scene->r.cfra+1,0.0); DAG_scene_sort(scene); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } void object_remove_particle_system(Scene *scene, Object *ob) { @@ -3184,7 +3183,7 @@ void object_remove_particle_system(Scene *scene, Object *ob) ((ParticleSystem *) ob->particlesystem.first)->flag |= PSYS_CURRENT; DAG_scene_sort(scene); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } static void default_particle_settings(ParticleSettings *part) { @@ -3364,7 +3363,7 @@ void psys_flush_particle_settings(Scene *scene, ParticleSettings *part, int reca } } if(flush) - DAG_object_flush_update(scene, base->object, OB_RECALC_DATA); + DAG_id_flush_update(&base->object->id, OB_RECALC_DATA); } } @@ -3396,7 +3395,7 @@ LinkNode *psys_using_settings(struct Scene *scene, ParticleSettings *part, int f } if(flush_update && found) - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } return node; diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index c0223d1690c..7a156f56d72 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -1947,7 +1947,7 @@ void BKE_ptcache_set_continue_physics(Scene *scene, int enable) if(CONTINUE_PHYSICS == 0) { for(ob=G.main->object.first; ob; ob=ob->id.next) if(BKE_ptcache_object_reset(scene, ob, PTCACHE_RESET_OUTDATED)) - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } } } diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 9f83733a640..65051c384b3 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -340,7 +340,7 @@ void ED_armature_from_edit(Scene *scene, Object *obedit) armature_rebuild_pose(obt, arm); } - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + DAG_id_flush_update(&obedit->id, OB_RECALC_DATA); } @@ -1054,8 +1054,8 @@ static int separate_armature_exec (bContext *C, wmOperator *op) /* 4) fix links before depsgraph flushes */ // err... or after? separated_armature_fix_links(oldob, newob); - DAG_object_flush_update(scene, oldob, OB_RECALC_DATA); /* this is the original one */ - DAG_object_flush_update(scene, newob, OB_RECALC_DATA); /* this is the separated one */ + DAG_id_flush_update(&oldob->id, OB_RECALC_DATA); /* this is the original one */ + DAG_id_flush_update(&newob->id, OB_RECALC_DATA); /* this is the separated one */ /* 5) restore original conditions */ @@ -1890,7 +1890,7 @@ void mouse_armature(bContext *C, short mval[2], int extend) if(nearBone->flag & BONE_SELECTED) nearBone->flag |= BONE_ACTIVE; } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, vc.obedit); + WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, vc.obedit); } } @@ -4335,7 +4335,7 @@ int ED_do_pose_selectbuffer(Scene *scene, Base *base, unsigned int *buffer, shor if (ob->mode & OB_MODE_WEIGHT_PAINT) { if (nearBone->flag & BONE_ACTIVE) { vertexgroup_select_by_name(OBACT, nearBone->name); - DAG_object_flush_update(scene, OBACT, OB_RECALC_DATA); + DAG_id_flush_update(&OBACT->id, OB_RECALC_DATA); } } @@ -4765,7 +4765,6 @@ void create_vgroups_from_armature(Scene *scene, Object *ob, Object *par, int mod static int pose_clear_scale_exec(bContext *C, wmOperator *op) { - Scene *scene = CTX_data_scene(C); Object *ob= CTX_data_active_object(C); /* only clear those channels that are not locked */ @@ -4782,7 +4781,7 @@ static int pose_clear_scale_exec(bContext *C, wmOperator *op) } CTX_DATA_END; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); /* note, notifier might evolve */ WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, ob); @@ -4807,7 +4806,6 @@ void POSE_OT_scale_clear(wmOperatorType *ot) static int pose_clear_loc_exec(bContext *C, wmOperator *op) { - Scene *scene = CTX_data_scene(C); Object *ob= CTX_data_active_object(C); /* only clear those channels that are not locked */ @@ -4824,7 +4822,7 @@ static int pose_clear_loc_exec(bContext *C, wmOperator *op) } CTX_DATA_END; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); /* note, notifier might evolve */ WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, ob); @@ -4849,7 +4847,6 @@ void POSE_OT_loc_clear(wmOperatorType *ot) static int pose_clear_rot_exec(bContext *C, wmOperator *op) { - Scene *scene = CTX_data_scene(C); Object *ob= CTX_data_active_object(C); /* only clear those channels that are not locked */ @@ -4899,7 +4896,7 @@ static int pose_clear_rot_exec(bContext *C, wmOperator *op) } CTX_DATA_END; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); /* note, notifier might evolve */ WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, ob); @@ -5337,7 +5334,6 @@ void ED_armature_bone_rename(bArmature *arm, char *oldnamep, char *newnamep) static int armature_flip_names_exec (bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_edit_object(C); bArmature *arm; char newname[32]; @@ -5357,7 +5353,7 @@ static int armature_flip_names_exec (bContext *C, wmOperator *op) CTX_DATA_END; /* since we renamed stuff... */ - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); /* note, notifier might evolve */ WM_event_add_notifier(C, NC_OBJECT|ND_POSE, ob); @@ -5383,7 +5379,6 @@ void ARMATURE_OT_flip_names (wmOperatorType *ot) static int armature_autoside_names_exec (bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_edit_object(C); bArmature *arm; char newname[32]; @@ -5404,7 +5399,7 @@ static int armature_autoside_names_exec (bContext *C, wmOperator *op) CTX_DATA_END; /* since we renamed stuff... */ - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); /* note, notifier might evolve */ WM_event_add_notifier(C, NC_OBJECT|ND_POSE, ob); diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c index 021bec05a3b..56d714fd058 100644 --- a/source/blender/editors/armature/poselib.c +++ b/source/blender/editors/armature/poselib.c @@ -843,7 +843,7 @@ static void poselib_preview_apply (bContext *C, wmOperator *op) */ // FIXME: shouldn't this use the builtin stuff? if ((pld->arm->flag & ARM_DELAYDEFORM)==0) - DAG_object_flush_update(pld->scene, pld->ob, OB_RECALC_DATA); /* sets recalc flags */ + DAG_id_flush_update(&pld->ob->id, OB_RECALC_DATA); /* sets recalc flags */ else where_is_pose(pld->scene, pld->ob); } @@ -1346,7 +1346,7 @@ static void poselib_preview_cleanup (bContext *C, wmOperator *op) * - note: code copied from transform_generics.c -> recalcData() */ if ((arm->flag & ARM_DELAYDEFORM)==0) - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); /* sets recalc flags */ + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); /* sets recalc flags */ else where_is_pose(scene, ob); @@ -1360,7 +1360,7 @@ static void poselib_preview_cleanup (bContext *C, wmOperator *op) action_set_activemarker(act, marker, 0); /* Update event for pose and deformation children */ - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); /* updates */ if (IS_AUTOKEY_MODE(scene, NORMAL)) { diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index 9a72fce2bcf..2673640b213 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -893,7 +893,7 @@ void pose_copy_menu(Scene *scene) ob->pose->flag |= POSE_RECALC; } - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); // and all its relations + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); // and all its relations BIF_undo_push("Copy Pose Attributes"); @@ -1067,7 +1067,7 @@ static int pose_paste_exec (bContext *C, wmOperator *op) } /* Update event for pose and deformation children */ - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); if (IS_AUTOKEY_ON(scene)) { // XXX remake_action_ipos(ob->action); @@ -1124,7 +1124,7 @@ void pose_adds_vgroups(Scene *scene, Object *meshobj, int heatweights) // and all its relations - DAG_object_flush_update(scene, meshobj, OB_RECALC_DATA); + DAG_id_flush_update(&meshobj->id, OB_RECALC_DATA); } /* ********************************************** */ @@ -1540,7 +1540,6 @@ void pose_select_grouped_menu (Scene *scene) static int pose_flip_names_exec (bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); bArmature *arm; char newname[32]; @@ -1560,7 +1559,7 @@ static int pose_flip_names_exec (bContext *C, wmOperator *op) CTX_DATA_END; /* since we renamed stuff... */ - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); /* note, notifier might evolve */ WM_event_add_notifier(C, NC_OBJECT|ND_POSE, ob); @@ -1587,7 +1586,6 @@ void POSE_OT_flip_names (wmOperatorType *ot) static int pose_autoside_names_exec (bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); bArmature *arm; char newname[32]; @@ -1608,7 +1606,7 @@ static int pose_autoside_names_exec (bContext *C, wmOperator *op) CTX_DATA_END; /* since we renamed stuff... */ - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); /* note, notifier might evolve */ WM_event_add_notifier(C, NC_OBJECT|ND_POSE, ob); @@ -1677,7 +1675,7 @@ void pose_activate_flipped_bone(Scene *scene) /* in weightpaint we select the associated vertex group too */ if(ob->mode & OB_MODE_WEIGHT_PAINT) { vertexgroup_select_by_name(OBACT, name); - DAG_object_flush_update(scene, OBACT, OB_RECALC_DATA); + DAG_id_flush_update(&OBACT->id, OB_RECALC_DATA); } // XXX notifiers need to be sent to other editors to update @@ -2116,7 +2114,7 @@ void pose_relax(Scene *scene) pchan->bone->flag &= ~ BONE_TRANSFORM; /* do depsgraph flush */ - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); BIF_undo_push("Relax Pose"); } @@ -2211,7 +2209,7 @@ void pose_clear_user_transforms(Scene *scene, Object *ob) rest_pose(ob->pose); } - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); BIF_undo_push("Clear User Transform"); } diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 28a9d3ac7c9..4246c889de0 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -409,10 +409,10 @@ static int separate_exec(bContext *C, wmOperator *op) load_editNurb(newob); free_editNurb(newob); - DAG_object_flush_update(scene, oldob, OB_RECALC_DATA); /* this is the original one */ - DAG_object_flush_update(scene, newob, OB_RECALC_DATA); /* this is the separated one */ + DAG_id_flush_update(&oldob->id, OB_RECALC_DATA); /* this is the original one */ + DAG_id_flush_update(&newob->id, OB_RECALC_DATA); /* this is the separated one */ - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, oldob); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, oldob->data); WM_cursor_wait(0); @@ -1005,8 +1005,8 @@ static int switch_direction_exec(bContext *C, wmOperator *op) if(isNurbsel(nu)) switchdirectionNurb(nu); - DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -1052,8 +1052,8 @@ static int set_weight_exec(bContext *C, wmOperator *op) } } - DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -1103,8 +1103,8 @@ static int set_radius_exec(bContext *C, wmOperator *op) } } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); - DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); return OPERATOR_FINISHED; } @@ -1178,8 +1178,8 @@ static int smooth_exec(bContext *C, wmOperator *op) } } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); - DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); return OPERATOR_FINISHED; } @@ -1343,8 +1343,8 @@ static int smooth_radius_exec(bContext *C, wmOperator *op) } } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); - DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); return OPERATOR_FINISHED; } @@ -1493,7 +1493,7 @@ static int de_select_first_exec(bContext *C, wmOperator *op) Object *obedit= CTX_data_edit_object(C); selectend_nurb(obedit, FIRST, 1, DESELECT); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -1517,7 +1517,7 @@ static int de_select_last_exec(bContext *C, wmOperator *op) Object *obedit= CTX_data_edit_object(C); selectend_nurb(obedit, LAST, 1, DESELECT); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -1585,7 +1585,7 @@ static int de_select_all_exec(bContext *C, wmOperator *op) select_adjacent_cp(editnurb, 1, 1, SELECT); /* cascade selection */ } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -1654,8 +1654,8 @@ static int hide_exec(bContext *C, wmOperator *op) } } - DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -1714,8 +1714,8 @@ static int reveal_exec(bContext *C, wmOperator *op) } } - DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -1770,7 +1770,7 @@ static int select_inverse_exec(bContext *C, wmOperator *op) } } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -2166,8 +2166,8 @@ static int subdivide_exec(bContext *C, wmOperator *op) } /* End of 'if((nu->type & 7)==CU_NURBS)' */ } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); - DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); return OPERATOR_FINISHED; } @@ -2500,14 +2500,13 @@ void CURVE_OT_spline_type_set(wmOperatorType *ot) static int set_handle_type_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); ListBase *editnurb= curve_get_editcurve(obedit); sethandlesNurb(editnurb, RNA_enum_get(op->ptr, "type")); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); return OPERATOR_FINISHED; } @@ -2861,8 +2860,8 @@ static int merge_nurb(bContext *C, wmOperator *op) set_actNurb(obedit, NULL); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); - DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); return OPERATOR_FINISHED; } @@ -2870,7 +2869,6 @@ static int merge_nurb(bContext *C, wmOperator *op) static int make_segment_exec(bContext *C, wmOperator *op) { /* joins 2 curves */ - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); ListBase *editnurb= curve_get_editcurve(obedit); Nurb *nu, *nu1=0, *nu2=0; @@ -3015,8 +3013,8 @@ static int make_segment_exec(bContext *C, wmOperator *op) set_actNurb(obedit, NULL); /* for selected */ - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); return OPERATOR_FINISHED; } @@ -3100,7 +3098,7 @@ void mouse_nurb(bContext *C, short mval[2], int extend) } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); if(nu!=get_actNurb(obedit)) set_actNurb(obedit, nu); @@ -3231,8 +3229,8 @@ static int spin_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); return OPERATOR_FINISHED; } @@ -3255,7 +3253,6 @@ void CURVE_OT_spin(wmOperatorType *ot) static int addvert_Nurb(bContext *C, short mode, float location[3]) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); ListBase *editnurb= curve_get_editcurve(obedit); Nurb *nu; @@ -3367,8 +3364,8 @@ static int addvert_Nurb(bContext *C, short mode, float location[3]) test2DNurb(nu); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); return OPERATOR_FINISHED; } @@ -3423,7 +3420,6 @@ void CURVE_OT_vertex_add(wmOperatorType *ot) static int extrude_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); ListBase *editnurb= curve_get_editcurve(obedit); Nurb *nu; @@ -3438,8 +3434,8 @@ static int extrude_exec(bContext *C, wmOperator *op) } else { if(extrudeflagNurb(editnurb, 1)) { /* '1'= flag */ - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); } } @@ -3549,8 +3545,8 @@ static int toggle_cyclic_exec(bContext *C, wmOperator *op) } } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); - DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); return OPERATOR_FINISHED; } @@ -3641,7 +3637,7 @@ static int select_linked_exec(bContext *C, wmOperator *op) } } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -3733,7 +3729,7 @@ static int select_row_exec(bContext *C, wmOperator *op) } } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -3760,7 +3756,7 @@ static int select_next_exec(bContext *C, wmOperator *op) ListBase *editnurb= curve_get_editcurve(obedit); select_adjacent_cp(editnurb, 1, 0, SELECT); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -3787,7 +3783,7 @@ static int select_previous_exec(bContext *C, wmOperator *op) ListBase *editnurb= curve_get_editcurve(obedit); select_adjacent_cp(editnurb, -1, 0, SELECT); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -3874,7 +3870,7 @@ static int select_more_exec(bContext *C, wmOperator *op) select_adjacent_cp(editnurb, -1, 0, SELECT); } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -4035,7 +4031,7 @@ static int select_less_exec(bContext *C, wmOperator *op) } } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -4131,7 +4127,7 @@ static int select_random_exec(bContext *C, wmOperator *op) MEM_freeN(itemstobeselected); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -4165,7 +4161,7 @@ static int select_every_nth_exec(bContext *C, wmOperator *op) select_adjacent_cp(editnurb, n, 1, SELECT); select_adjacent_cp(editnurb, -n, 1, SELECT); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -4231,7 +4227,6 @@ void CURVE_OT_duplicate(wmOperatorType *ot) static int delete_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); ListBase *editnurb= curve_get_editcurve(obedit); Nurb *nu, *next, *nu1; @@ -4243,8 +4238,8 @@ static int delete_exec(bContext *C, wmOperator *op) if(type==0) deleteflagNurb(C, op, 1); else freeNurblist(editnurb); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); return OPERATOR_FINISHED; } @@ -4373,8 +4368,8 @@ static int delete_exec(bContext *C, wmOperator *op) bezt2= bezt+(nu->pntsu-1); if( (bezt2->f1 & SELECT) || (bezt2->f2 & SELECT) || (bezt2->f3 & SELECT) ) { nu->flagu &= ~CU_CYCLIC; - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); } } @@ -4399,8 +4394,8 @@ static int delete_exec(bContext *C, wmOperator *op) bp2= bp+(nu->pntsu-1); if( bp2->f1 & SELECT ) { nu->flagu &= ~CU_CYCLIC; - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); } } @@ -4497,8 +4492,8 @@ static int delete_exec(bContext *C, wmOperator *op) else if(type==2) freeNurblist(editnurb); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); return OPERATOR_FINISHED; } @@ -4569,8 +4564,8 @@ static int shade_smooth_exec(bContext *C, wmOperator *op) } } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); - DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); return OPERATOR_FINISHED; } @@ -5119,8 +5114,8 @@ static int clear_tilt_exec(bContext *C, wmOperator *op) } } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); - DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index 46be95063ec..ae34f30a4f1 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -273,15 +273,14 @@ static void text_update_edited(bContext *C, Scene *scene, Object *obedit, int re BKE_text_to_curve(scene, obedit, mode); if(recalc) - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); } /********************** insert lorem operator *********************/ static int insert_lorem_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); char *p, *p2; int i; @@ -308,8 +307,8 @@ static int insert_lorem_exec(bContext *C, wmOperator *op) insert_into_textbuf(obedit, '\n'); insert_into_textbuf(obedit, '\n'); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -614,7 +613,6 @@ static EnumPropertyItem style_items[]= { static int set_style(bContext *C, int style, int clear) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); Curve *cu= obedit->data; EditFont *ef= cu->editfont; @@ -630,8 +628,8 @@ static int set_style(bContext *C, int style, int clear) ef->textbufinfo[i].flag |= style; } - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 6aa5f5efc41..d253948e2e8 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -328,7 +328,6 @@ void uiTemplateID(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname static void modifiers_setOnCage(bContext *C, void *ob_v, void *md_v) { - Scene *scene= CTX_data_scene(C); Object *ob = ob_v; ModifierData *md; @@ -343,12 +342,11 @@ static void modifiers_setOnCage(bContext *C, void *ob_v, void *md_v) } WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } static void modifiers_convertToReal(bContext *C, void *ob_v, void *md_v) { - Scene *scene= CTX_data_scene(C); Object *ob = ob_v; ModifierData *md = md_v; ModifierData *nmd = modifier_new(md->type); @@ -361,7 +359,7 @@ static void modifiers_convertToReal(bContext *C, void *ob_v, void *md_v) ob->partype = PAROBJECT; WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); ED_undo_push(C, "Modifier convert to real"); } @@ -597,8 +595,8 @@ void do_constraint_panels(bContext *C, void *arg, int event) if(ob->pose) update_pose_constraint_flags(ob->pose); - if(ob->type==OB_ARMATURE) DAG_object_flush_update(scene, ob, OB_RECALC_DATA|OB_RECALC_OB); - else DAG_object_flush_update(scene, ob, OB_RECALC_OB); + if(ob->type==OB_ARMATURE) DAG_id_flush_update(&ob->id, OB_RECALC_DATA|OB_RECALC_OB); + else DAG_id_flush_update(&ob->id, OB_RECALC_OB); // XXX allqueue(REDRAWVIEW3D, 0); // XXX allqueue(REDRAWBUTSOBJECT, 0); diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index c3f1637d3af..980d699dda5 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -1280,7 +1280,7 @@ void load_editMesh(Scene *scene, Object *ob) void remake_editMesh(Scene *scene, Object *ob) { make_editMesh(scene, ob); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); BIF_undo_push("Undo all changes"); } @@ -1390,8 +1390,8 @@ static int mesh_separate_selected(Scene *scene, Base *editbase) /* hashedges are invalid now, make new! */ editMesh_set_hash(em); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - DAG_object_flush_update(scene, basenew->object, OB_RECALC_DATA); + DAG_id_flush_update(&obedit->id, OB_RECALC_DATA); + DAG_id_flush_update(&basenew->object->id, OB_RECALC_DATA); BKE_mesh_end_editmesh(me, em); @@ -1469,7 +1469,7 @@ static int mesh_separate_exec(bContext *C, wmOperator *op) retval= mesh_separate_loose(scene, base); if(retval) { - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, base->object); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, base->object->data); return OPERATOR_FINISHED; } return OPERATOR_CANCELLED; diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index 19078d2f6ff..4af5ddf56fa 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -217,8 +217,8 @@ static int dupli_extrude_cursor(bContext *C, wmOperator *op, wmEvent *event) } //retopo_do_all(); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, vc.obedit); - DAG_object_flush_update(vc.scene, vc.obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, vc.obedit->data); + DAG_id_flush_update(vc.obedit->data, OB_RECALC_DATA); return OPERATOR_FINISHED; } @@ -343,9 +343,8 @@ static int make_fgon_exec(bContext *C, wmOperator *op) EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); if( make_fgon(em, op, 1) ) { - DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); - - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -376,9 +375,8 @@ static int clear_fgon_exec(bContext *C, wmOperator *op) EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); if( make_fgon(em, op, 0) ) { - DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); - - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -666,7 +664,7 @@ void addfaces_from_edgenet(EditMesh *em) EM_select_flush(em); -// XXX DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); +// XXX DAG_id_flush_update(obedit->data, OB_RECALC_DATA); } static void addedgeface_mesh(EditMesh *em, wmOperator *op) @@ -695,7 +693,7 @@ static void addedgeface_mesh(EditMesh *em, wmOperator *op) eed= addedgelist(em, neweve[0], neweve[1], NULL); EM_select_edge(eed, 1); - // XXX DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + // XXX DAG_id_flush_update(obedit->data, OB_RECALC_DATA); return; } else if(amount > 4) { @@ -792,9 +790,8 @@ static int addedgeface_mesh_exec(bContext *C, wmOperator *op) addedgeface_mesh(em, op); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - - DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -1311,7 +1308,6 @@ static float new_primitive_matrix(bContext *C, float primmat[][4]) static int add_primitive_plane_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); float dia, mat[4][4]; @@ -1321,8 +1317,8 @@ static int add_primitive_plane_exec(bContext *C, wmOperator *op) make_prim(obedit, PRIM_PLANE, mat, 4, 0, 0, dia, 0.0f, 0, 1); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -1344,7 +1340,6 @@ void MESH_OT_primitive_plane_add(wmOperatorType *ot) static int add_primitive_cube_exec(bContext *C, wmOperator *op) { - Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); float dia, mat[4][4]; @@ -1354,8 +1349,8 @@ static int add_primitive_cube_exec(bContext *C, wmOperator *op) make_prim(obedit, PRIM_CUBE, mat, 4, 0, 0, dia, 1.0f, 1, 1); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -1377,7 +1372,6 @@ void MESH_OT_primitive_cube_add(wmOperatorType *ot) static int add_primitive_circle_exec(bContext *C, wmOperator *op) { - Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); float dia, mat[4][4]; @@ -1387,8 +1381,8 @@ static int add_primitive_circle_exec(bContext *C, wmOperator *op) make_prim(obedit, PRIM_CIRCLE, mat, RNA_int_get(op->ptr, "vertices"), 0, 0, dia, 0.0f, 0, RNA_boolean_get(op->ptr, "fill")); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -1415,7 +1409,6 @@ void MESH_OT_primitive_circle_add(wmOperatorType *ot) static int add_primitive_cylinder_exec(bContext *C, wmOperator *op) { - Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); float dia, mat[4][4]; @@ -1425,8 +1418,8 @@ static int add_primitive_cylinder_exec(bContext *C, wmOperator *op) make_prim(obedit, PRIM_CYLINDER, mat, RNA_int_get(op->ptr, "vertices"), 0, 0, dia, RNA_float_get(op->ptr, "depth"), 1, 1); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -1453,7 +1446,6 @@ void MESH_OT_primitive_cylinder_add(wmOperatorType *ot) static int add_primitive_tube_exec(bContext *C, wmOperator *op) { - Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); float dia, mat[4][4]; @@ -1463,8 +1455,8 @@ static int add_primitive_tube_exec(bContext *C, wmOperator *op) make_prim(obedit, PRIM_CYLINDER, mat, RNA_int_get(op->ptr, "vertices"), 0, 0, dia, RNA_float_get(op->ptr, "depth"), 1, 0); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -1491,7 +1483,6 @@ void MESH_OT_primitive_tube_add(wmOperatorType *ot) static int add_primitive_cone_exec(bContext *C, wmOperator *op) { - Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); float dia, mat[4][4]; @@ -1501,8 +1492,8 @@ static int add_primitive_cone_exec(bContext *C, wmOperator *op) make_prim(obedit, PRIM_CONE, mat, RNA_int_get(op->ptr, "vertices"), 0, 0, dia, RNA_float_get(op->ptr, "depth"), 0, RNA_boolean_get(op->ptr, "cap_end")); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -1531,7 +1522,6 @@ void MESH_OT_primitive_cone_add(wmOperatorType *ot) static int add_primitive_grid_exec(bContext *C, wmOperator *op) { - Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); float dia, mat[4][4]; @@ -1541,8 +1531,8 @@ static int add_primitive_grid_exec(bContext *C, wmOperator *op) make_prim(obedit, PRIM_GRID, mat, RNA_int_get(op->ptr, "x_subdivisions"), RNA_int_get(op->ptr, "y_subdivisions"), 0, dia, 0.0f, 0, 1); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -1569,7 +1559,6 @@ void MESH_OT_primitive_grid_add(wmOperatorType *ot) static int add_primitive_monkey_exec(bContext *C, wmOperator *op) { - Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); float mat[4][4]; @@ -1577,8 +1566,8 @@ static int add_primitive_monkey_exec(bContext *C, wmOperator *op) make_prim(obedit, PRIM_MONKEY, mat, 0, 0, 2, 0.0f, 0.0f, 0, 0); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -1600,7 +1589,6 @@ void MESH_OT_primitive_monkey_add(wmOperatorType *ot) static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op) { - Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); float dia, mat[4][4]; @@ -1610,8 +1598,8 @@ static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op) make_prim(obedit, PRIM_UVSPHERE, mat, RNA_int_get(op->ptr, "rings"), RNA_int_get(op->ptr, "segments"), 0, dia, 0.0f, 0, 0); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -1638,7 +1626,6 @@ void MESH_OT_primitive_uv_sphere_add(wmOperatorType *ot) static int add_primitive_icosphere_exec(bContext *C, wmOperator *op) { - Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); float dia, mat[4][4]; @@ -1648,8 +1635,8 @@ static int add_primitive_icosphere_exec(bContext *C, wmOperator *op) make_prim(obedit, PRIM_ICOSPHERE, mat, 0, 0, RNA_int_get(op->ptr, "subdivisions"), dia, 0.0f, 0, 0); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -1677,7 +1664,6 @@ void MESH_OT_primitive_ico_sphere_add(wmOperatorType *ot) static int mesh_duplicate_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(ob->data); @@ -1685,8 +1671,8 @@ static int mesh_duplicate_exec(bContext *C, wmOperator *op) BKE_mesh_end_editmesh(ob->data, em); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, ob); + DAG_id_flush_update(ob->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/mesh/editmesh_loop.c b/source/blender/editors/mesh/editmesh_loop.c index b46f745e8f5..4c3e76f2285 100644 --- a/source/blender/editors/mesh/editmesh_loop.c +++ b/source/blender/editors/mesh/editmesh_loop.c @@ -389,7 +389,7 @@ void CutEdgeloop(Object *obedit, wmOperator *op, EditMesh *em, int numcuts) EM_selectmode_set(em); } -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); +// DAG_id_flush_update(obedit->data, OB_RECALC_DATA); return; } @@ -624,7 +624,6 @@ static float seg_intersect(EditEdge *e, CutCurve *c, int len, char mode, struct static int knife_cut_exec(bContext *C, wmOperator *op) { - Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); ARegion *ar= CTX_wm_region(C); @@ -705,8 +704,8 @@ static int knife_cut_exec(bContext *C, wmOperator *op) BKE_mesh_end_editmesh(obedit->data, em); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index f2c5b7fb727..667a889b5fc 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -127,7 +127,7 @@ void EM_automerge(int update) // if (len) { // em->totvert -= len; /* saves doing a countall */ // if (update) { -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); +// DAG_id_flush_update(obedit->data, OB_RECALC_DATA); // } // } // } @@ -807,7 +807,7 @@ static int similar_face_select_exec(bContext *C, wmOperator *op) if (selcount) { /* here was an edge-mode only select flush case, has to be generalized */ EM_selectmode_flush(em); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(me, em); return OPERATOR_FINISHED; } @@ -839,7 +839,7 @@ static EnumPropertyItem prop_simedge_types[] = { {0, NULL, 0, NULL, NULL} }; -static int similar_edge_select__internal(Scene *scene, EditMesh *em, int mode) +static int similar_edge_select__internal(ToolSettings *ts, EditMesh *em, int mode) { EditEdge *eed, *base_eed=NULL; unsigned int selcount=0; /* count how many new edges we select*/ @@ -849,7 +849,7 @@ static int similar_edge_select__internal(Scene *scene, EditMesh *em, int mode) unsigned int deselcount=0; short ok=0; - float thresh= scene->toolsettings->select_thresh; + float thresh= ts->select_thresh; for(eed= em->edges.first; eed; eed= eed->next) { if (!eed->h) { @@ -1039,17 +1039,17 @@ static int similar_edge_select__internal(Scene *scene, EditMesh *em, int mode) /* wrap the above function but do selection flushing edge to face */ static int similar_edge_select_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); Object *obedit= CTX_data_edit_object(C); Mesh *me= obedit->data; EditMesh *em= BKE_mesh_get_editmesh(me); - int selcount = similar_edge_select__internal(scene, em, RNA_int_get(op->ptr, "type")); + int selcount = similar_edge_select__internal(ts, em, RNA_int_get(op->ptr, "type")); if (selcount) { /* here was an edge-mode only select flush case, has to be generalized */ EM_selectmode_flush(em); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(me, em); return OPERATOR_FINISHED; } @@ -1081,7 +1081,7 @@ static EnumPropertyItem prop_simvertex_types[] = { static int similar_vert_select_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); Object *obedit= CTX_data_edit_object(C); Mesh *me= obedit->data; EditMesh *em= BKE_mesh_get_editmesh(me); @@ -1094,7 +1094,7 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op) int mode= RNA_enum_get(op->ptr, "type"); short ok=0; - float thresh= scene->toolsettings->select_thresh; + float thresh= ts->select_thresh; for(eve= em->verts.first; eve; eve= eve->next) { if (!eve->h) { @@ -1207,7 +1207,7 @@ static int similar_vert_select_exec(bContext *C, wmOperator *op) } /* end basevert loop */ if(selcount) { - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(me, em); return OPERATOR_FINISHED; } @@ -1413,7 +1413,7 @@ void EM_mesh_copy_edge(EditMesh *em, short type) } if (change) { -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); +// DAG_id_flush_update(obedit->data, OB_RECALC_DATA); } } @@ -1541,7 +1541,7 @@ void EM_mesh_copy_face(EditMesh *em, wmOperator *op, short type) } if (change) { -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); +// DAG_id_flush_update(obedit->data, OB_RECALC_DATA); } } @@ -1671,7 +1671,7 @@ void EM_mesh_copy_face_layer(EditMesh *em, wmOperator *op, short type) } if (change) { -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); +// DAG_id_flush_update(obedit->data, OB_RECALC_DATA); } } @@ -1991,7 +1991,7 @@ static int loop_multiselect(bContext *C, wmOperator *op) MEM_freeN(edarray); // if (EM_texFaceCheck()) - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -2060,7 +2060,7 @@ static void mouse_mesh_loop(bContext *C, short mval[2], short extend, short ring EM_selectmode_flush(em); // if (EM_texFaceCheck()) - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, vc.obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, vc.obedit->data); } } @@ -2159,9 +2159,8 @@ static void mouse_mesh_shortest_path(bContext *C, short mval[2]) break; } - DAG_object_flush_update(vc.scene, vc.obedit, OB_RECALC_DATA); - - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, vc.obedit); + DAG_id_flush_update(vc.obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, vc.obedit->data); } } @@ -2261,7 +2260,7 @@ void mouse_mesh(bContext *C, short mval[2], short extend) } } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, vc.obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, vc.obedit->data); } @@ -2405,12 +2404,12 @@ static int select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event /* return warning! */ if(limit) { int retval= select_linked_limited_invoke(&vc, 0, sel); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return retval; } if( unified_findnearest(&vc, &eve, &eed, &efa)==0 ) { - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_CANCELLED; } @@ -2464,7 +2463,7 @@ static int select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event // if (EM_texFaceCheck()) - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -2545,7 +2544,7 @@ static int select_linked_exec(bContext *C, wmOperator *op) else selectconnected_mesh_all(em); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -2671,7 +2670,7 @@ void EM_hide_mesh(EditMesh *em, int swap) em->totedgesel= em->totfacesel= em->totvertsel= 0; // if(EM_texFaceCheck()) - // DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + // DAG_id_flush_update(obedit->data, OB_RECALC_DATA); } static int hide_mesh_exec(bContext *C, wmOperator *op) @@ -2681,7 +2680,7 @@ static int hide_mesh_exec(bContext *C, wmOperator *op) EM_hide_mesh(em, RNA_boolean_get(op->ptr, "unselected")); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -2738,7 +2737,7 @@ void EM_reveal_mesh(EditMesh *em) EM_selectmode_flush(em); // if (EM_texFaceCheck()) -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); +// DAG_id_flush_update(obedit->data, OB_RECALC_DATA); } static int reveal_mesh_exec(bContext *C, wmOperator *op) @@ -2748,7 +2747,7 @@ static int reveal_mesh_exec(bContext *C, wmOperator *op) EM_reveal_mesh(em); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -2798,7 +2797,7 @@ int select_by_number_vertices_exec(bContext *C, wmOperator *op) } } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -2924,7 +2923,7 @@ static int select_sharp_edges_exec(bContext *C, wmOperator *op) // if (EM_texFaceCheck()) - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); //TODO is this needed ? + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); //TODO is this needed ? BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -3092,7 +3091,7 @@ static int select_linked_flat_faces_exec(bContext *C, wmOperator *op) select_linked_flat_faces(em, op, RNA_float_get(op->ptr, "sharpness")); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -3193,7 +3192,7 @@ static int select_non_manifold_exec(bContext *C, wmOperator *op) select_non_manifold(em, op); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -3257,7 +3256,7 @@ static int select_inverse_mesh_exec(bContext *C, wmOperator *op) EM_select_swap(em); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -3295,7 +3294,7 @@ static int toggle_select_all_exec(bContext *C, wmOperator *op) EM_toggle_select_all(em); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -3366,7 +3365,7 @@ static int select_more(bContext *C, wmOperator *op) // if (EM_texFaceCheck(em)) - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -3456,7 +3455,7 @@ static int select_less(bContext *C, wmOperator *op) EM_select_less(em); // if (EM_texFaceCheck(em)) - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -3526,7 +3525,7 @@ static int mesh_select_random_exec(bContext *C, wmOperator *op) selectrandom_mesh(em, RNA_float_get(op->ptr,"percent")); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -3577,7 +3576,7 @@ void EM_deselect_by_material(EditMesh *em, int index) EM_selectmode_flush(em); } -static void mesh_selection_type(Scene *scene, EditMesh *em, int val) +static void mesh_selection_type(ToolSettings *ts, EditMesh *em, int val) { if(val>0) { if(val==1) { @@ -3598,7 +3597,7 @@ static void mesh_selection_type(Scene *scene, EditMesh *em, int val) /* note, em stores selectmode to be able to pass it on everywhere without scene, this is only until all select modes and toolsettings are settled more */ - scene->toolsettings->selectmode= em->selectmode; + ts->selectmode= em->selectmode; // if (EM_texFaceCheck()) } } @@ -3612,13 +3611,13 @@ static EnumPropertyItem prop_mesh_edit_types[] = { static int mesh_selection_type_exec(bContext *C, wmOperator *op) { - + ToolSettings *ts= CTX_data_tool_settings(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); - mesh_selection_type(CTX_data_scene(C), em, RNA_enum_get(op->ptr,"type")); + mesh_selection_type(ts, em, RNA_enum_get(op->ptr,"type")); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -3648,7 +3647,6 @@ void MESH_OT_selection_type(wmOperatorType *ot) static int editmesh_mark_seam(bContext *C, wmOperator *op) { - Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); Mesh *me= ((Mesh *)obedit->data); @@ -3681,8 +3679,8 @@ static int editmesh_mark_seam(bContext *C, wmOperator *op) BKE_mesh_end_editmesh(obedit->data, em); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -3706,7 +3704,6 @@ void MESH_OT_mark_seam(wmOperatorType *ot) static int editmesh_mark_sharp(bContext *C, wmOperator *op) { - Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); Mesh *me= ((Mesh *)obedit->data); @@ -3734,8 +3731,8 @@ static int editmesh_mark_sharp(bContext *C, wmOperator *op) BKE_mesh_end_editmesh(obedit->data, em); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -3965,7 +3962,7 @@ void righthandfaces(EditMesh *em, int select) /* makes faces righthand turning * recalc_editnormals(em); -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); +// DAG_id_flush_update(obedit->data, OB_RECALC_DATA); waitcursor(0); } @@ -3973,7 +3970,6 @@ void righthandfaces(EditMesh *em, int select) /* makes faces righthand turning * static int righthandfaces_exec(bContext *C, wmOperator *op) { - Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); @@ -3984,8 +3980,8 @@ static int righthandfaces_exec(bContext *C, wmOperator *op) BKE_mesh_end_editmesh(obedit->data, em); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); //TODO is this needed ? + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); //TODO is this needed ? return OPERATOR_FINISHED; } @@ -4185,7 +4181,7 @@ void editmesh_align_view_to_selected(Object *obedit, EditMesh *em, wmOperator *o static int smooth_vertex(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); EditVert *eve, *eve_mir = NULL; @@ -4273,7 +4269,7 @@ static int smooth_vertex(bContext *C, wmOperator *op) if(eve->f & SELECT) { if(eve->f1) { - if (scene->toolsettings->editbutflag & B_MESH_X_MIRROR) { + if (ts->editbutflag & B_MESH_X_MIRROR) { eve_mir= editmesh_get_x_mirror_vert(obedit, em, eve->co); } @@ -4315,8 +4311,8 @@ static int smooth_vertex(bContext *C, wmOperator *op) BKE_mesh_end_editmesh(obedit->data, em); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -4393,7 +4389,7 @@ void vertexnoise(Object *obedit, EditMesh *em) } recalc_editnormals(em); -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); +// DAG_id_flush_update(obedit->data, OB_RECALC_DATA); } @@ -4450,23 +4446,23 @@ static void vertices_to_sphere(Scene *scene, View3D *v3d, Object *obedit, EditMe } recalc_editnormals(em); -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); +// DAG_id_flush_update(obedit->data, OB_RECALC_DATA); } static int vertices_to_sphere_exec(bContext *C, wmOperator *op) { + Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); View3D *v3d = CTX_wm_view3d(C); - Scene *scene = CTX_data_scene(C); EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); vertices_to_sphere(scene, v3d, obedit, em, RNA_float_get(op->ptr,"percent")); BKE_mesh_end_editmesh(obedit->data, em); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -4512,7 +4508,6 @@ void flipface(EditMesh *em, EditFace *efa) static int flip_normals(bContext *C, wmOperator *op) { - Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); EditFace *efa; @@ -4530,8 +4525,8 @@ static int flip_normals(bContext *C, wmOperator *op) BKE_mesh_end_editmesh(obedit->data, em); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index ac65820bfea..5a4397256de 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -484,11 +484,11 @@ int removedoublesflag(EditMesh *em, short flag, short automerge, float limit) / static int removedoublesflag_exec(bContext *C, wmOperator *op) { Object *obedit= CTX_data_edit_object(C); - Scene *scene = CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); EditMesh *em= BKE_mesh_get_editmesh(((Mesh *)obedit->data)); char msg[100]; - int cnt = removedoublesflag(em,1,0,scene->toolsettings->doublimit); + int cnt = removedoublesflag(em,1,0,ts->doublimit); if(cnt) { @@ -496,8 +496,8 @@ static int removedoublesflag_exec(bContext *C, wmOperator *op) BKE_report(op->reports, RPT_INFO, msg); } - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -677,7 +677,7 @@ void extrude_mesh(Scene *scene, Object *obedit, EditMesh *em, wmOperator *op) * This shouldn't be necessary, derived queries should be * automatically building this data if invalid. Or something. */ -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); +// DAG_id_flush_update(obedit->data, OB_RECALC_DATA); object_handle_update(scene, obedit); /* individual faces? */ @@ -711,8 +711,8 @@ static int mesh_extrude_invoke(bContext *C, wmOperator *op, wmEvent *event) BKE_mesh_end_editmesh(obedit->data, em); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); RNA_enum_set(op->ptr, "proportional", 0); RNA_boolean_set(op->ptr, "mirror", 0); @@ -736,8 +736,8 @@ static int mesh_extrude_exec(bContext *C, wmOperator *op) extrude_mesh(scene, obedit, em, op); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -762,7 +762,6 @@ void MESH_OT_extrude(wmOperatorType *ot) static int split_mesh(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -776,8 +775,8 @@ static int split_mesh(bContext *C, wmOperator *op) WM_cursor_wait(0); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -801,7 +800,6 @@ void MESH_OT_split(wmOperatorType *ot) static int extrude_repeat_mesh(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -837,8 +835,8 @@ static int extrude_repeat_mesh(bContext *C, wmOperator *op) EM_fgon_flags(em); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -869,7 +867,7 @@ void MESH_OT_extrude_repeat(wmOperatorType *ot) static int spin_mesh(bContext *C, wmOperator *op, float *dvec, int steps, float degr, int dupli ) { Object *obedit= CTX_data_edit_object(C); - Scene *scene = CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); EditVert *eve,*nextve; float nor[3]= {0.0f, 0.0f, 0.0f}; @@ -891,7 +889,7 @@ static int spin_mesh(bContext *C, wmOperator *op, float *dvec, int steps, float phi= degr*M_PI/360.0; phi/= steps; - if(scene->toolsettings->editbutflag & B_CLOCKWISE) phi= -phi; + if(ts->editbutflag & B_CLOCKWISE) phi= -phi; RNA_float_get_array(op->ptr, "axis", n); Normalize(n); @@ -907,7 +905,7 @@ static int spin_mesh(bContext *C, wmOperator *op, float *dvec, int steps, float Mat3MulMat3(bmat,imat,tmat); if(dupli==0) - if(scene->toolsettings->editbutflag & B_KEEPORIG) + if(ts->editbutflag & B_KEEPORIG) adduplicateflag(em, 1); for(a=0; adata, OB_RECALC_DATA); } BKE_mesh_end_editmesh(obedit->data, em); @@ -950,7 +948,6 @@ static int spin_mesh(bContext *C, wmOperator *op, float *dvec, int steps, float static int spin_mesh_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); int ok; @@ -960,8 +957,8 @@ static int spin_mesh_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -1006,7 +1003,6 @@ void MESH_OT_spin(wmOperatorType *ot) static int screw_mesh_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); EditVert *eve,*v1=0,*v2=0; @@ -1062,8 +1058,8 @@ static int screw_mesh_exec(bContext *C, wmOperator *op) } if(spin_mesh(C, op, dvec, turns*steps, 360.0f*turns, 0)) { - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -1308,14 +1304,13 @@ static EnumPropertyItem prop_mesh_delete_types[] = { static int delete_mesh_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); delete_mesh(obedit, em, op, RNA_enum_get(op->ptr, "type")); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -2722,7 +2717,7 @@ void esubdivideflag(Object *obedit, EditMesh *em, int flag, float smooth, float } } -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); +// DAG_id_flush_update(obedit->data, OB_RECALC_DATA); // Now for each face in the mesh we need to figure out How many edges were cut // and which filling method to use for that face for(ef = em->faces.first;ef;ef = ef->next) { @@ -3696,7 +3691,6 @@ static void edge_rotate(EditMesh *em, wmOperator *op, EditEdge *eed, int dir) /* only accepts 1 selected edge, or 2 selected faces */ static int edge_rotate_selected(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); EditEdge *eed; @@ -3760,8 +3754,8 @@ static int edge_rotate_selected(bContext *C, wmOperator *op) BKE_mesh_end_editmesh(obedit->data, em); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -4611,7 +4605,7 @@ useless: } else { draw = 0; } -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); +// DAG_id_flush_update(obedit->data, OB_RECALC_DATA); } @@ -4631,7 +4625,7 @@ useless: if(!immediate) EM_automerge(0); -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); +// DAG_id_flush_update(obedit->data, OB_RECALC_DATA); // scrarea_queue_winredraw(curarea); //BLI_ghash_free(edgesgh, freeGHash, NULL); @@ -4681,7 +4675,7 @@ int EdgeLoopDelete(EditMesh *em, wmOperator *op) EM_select_more(em); removedoublesflag(em, 1,0, 0.001); EM_select_flush(em); - // DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + // DAG_id_flush_update(obedit->data, OB_RECALC_DATA); return 1; } @@ -4793,7 +4787,6 @@ static void mesh_rip_setface(EditMesh *em, EditFace *sefa) /* based on mouse cursor position, it defines how is being ripped */ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) { - Scene *scene= CTX_data_scene(C); ARegion *ar= CTX_wm_region(C); RegionView3D *rv3d= ar->regiondata; Object *obedit= CTX_data_edit_object(C); @@ -4989,8 +4982,8 @@ static int mesh_rip_invoke(bContext *C, wmOperator *op, wmEvent *event) } } - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); @@ -5061,7 +5054,7 @@ void shape_propagate(Scene *scene, Object *obedit, EditMesh *em, wmOperator *op) } } - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); return; } @@ -5106,7 +5099,7 @@ void shape_copy_from_lerp(EditMesh *em, KeyBlock* thisBlock, KeyBlock* fromBlock } } sprintf(str,"Blending at %d%c MMB to Copy at 100%c",(int)(perc*100),'%','%'); -// DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); +// DAG_id_flush_update(obedit->data, OB_RECALC_DATA); // headerprint(str); // force_draw(0); @@ -5764,7 +5757,6 @@ int merge_target(EditMesh *em, int target, int uvmerge) static int merge_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); int count= 0, uvs= RNA_boolean_get(op->ptr, "uvs"); @@ -5794,8 +5786,8 @@ static int merge_exec(bContext *C, wmOperator *op) BKE_mesh_end_editmesh(obedit->data, em); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -6040,7 +6032,7 @@ int select_vertex_path_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -6108,7 +6100,7 @@ static int region_to_loop(bContext *C, wmOperator *op) BKE_mesh_end_editmesh(obedit->data, em); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -6284,7 +6276,7 @@ static int loop_to_region(bContext *C, wmOperator *op) freecollections(&allcollections); BKE_mesh_end_editmesh(obedit->data, em); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -6311,7 +6303,6 @@ void MESH_OT_loop_to_region(wmOperatorType *ot) static int mesh_rotate_uvs(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -6378,15 +6369,14 @@ static int mesh_rotate_uvs(bContext *C, wmOperator *op) if(!change) return OPERATOR_CANCELLED; - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } static int mesh_mirror_uvs(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -6468,15 +6458,14 @@ static int mesh_mirror_uvs(bContext *C, wmOperator *op) if(!change) return OPERATOR_CANCELLED; - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } static int mesh_rotate_colors(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -6525,8 +6514,8 @@ static int mesh_rotate_colors(bContext *C, wmOperator *op) if(!change) return OPERATOR_CANCELLED; - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -6534,7 +6523,6 @@ static int mesh_rotate_colors(bContext *C, wmOperator *op) static int mesh_mirror_colors(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -6582,8 +6570,8 @@ static int mesh_mirror_colors(bContext *C, wmOperator *op) if(!change) return OPERATOR_CANCELLED; - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -6664,7 +6652,7 @@ void MESH_OT_colors_mirror(wmOperatorType *ot) static int subdivide_exec(bContext *C, wmOperator *op) { - Scene *scene = CTX_data_scene(C); + ToolSettings *ts= CTX_data_tool_settings(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); int cuts= RNA_int_get(op->ptr,"number_cuts"); @@ -6677,10 +6665,10 @@ static int subdivide_exec(bContext *C, wmOperator *op) if(fractal != 0.0f) flag |= B_FRACTAL; - esubdivideflag(obedit, em, 1, smooth, fractal, scene->toolsettings->editbutflag|flag, cuts, 0); + esubdivideflag(obedit, em, 1, smooth, fractal, ts->editbutflag|flag, cuts, 0); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -6953,7 +6941,6 @@ static void fill_mesh(EditMesh *em) static int fill_mesh_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -6961,8 +6948,8 @@ static int fill_mesh_exec(bContext *C, wmOperator *op) BKE_mesh_end_editmesh(obedit->data, em); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; @@ -6985,7 +6972,6 @@ void MESH_OT_fill(wmOperatorType *ot) static int beauty_fill_exec(bContext *C, wmOperator *op) { - Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -6993,8 +6979,8 @@ static int beauty_fill_exec(bContext *C, wmOperator *op) BKE_mesh_end_editmesh(obedit->data, em); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -7018,14 +7004,13 @@ void MESH_OT_beauty_fill(wmOperatorType *ot) static int quads_convert_to_tris_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); convert_to_triface(em,0); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -7048,14 +7033,13 @@ void MESH_OT_quads_convert_to_tris(wmOperatorType *ot) static int tris_convert_to_quads_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); join_triangles(em); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -7078,14 +7062,13 @@ void MESH_OT_tris_convert_to_quads(wmOperatorType *ot) static int edge_flip_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); edge_flip(em); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -7124,7 +7107,6 @@ void mesh_set_smooth_faces(EditMesh *em, short smooth) static int mesh_faces_shade_smooth_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); @@ -7132,8 +7114,8 @@ static int mesh_faces_shade_smooth_exec(bContext *C, wmOperator *op) BKE_mesh_end_editmesh(obedit->data, em); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -7155,14 +7137,13 @@ void MESH_OT_faces_shade_smooth(wmOperatorType *ot) static int mesh_faces_shade_flat_exec(bContext *C, wmOperator *op) { - Scene *scene = CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); mesh_set_smooth_faces(em, 0); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/mesh/mesh_layers.c b/source/blender/editors/mesh/mesh_layers.c index 17a448ecf90..a36c7a56b7c 100644 --- a/source/blender/editors/mesh/mesh_layers.c +++ b/source/blender/editors/mesh/mesh_layers.c @@ -152,20 +152,21 @@ static void delete_customdata_layer(bContext *C, Object *ob, CustomDataLayer *la /*********************** UV texture operators ************************/ +static int layers_poll(bContext *C) +{ + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + ID *data= (ob)? ob->data: NULL; + return (ob && !ob->id.lib && ob->type==OB_MESH && data && !data->lib); +} + static int uv_texture_add_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; - Mesh *me; + Mesh *me= ob->data; EditMesh *em; int layernum; - if(!ob || ob->type!=OB_MESH) - return OPERATOR_CANCELLED; - - me= (Mesh*)ob->data; - - if(scene->obedit == ob) { + if(me->edit_mesh) { em= me->edit_mesh; layernum= CustomData_number_of_layers(&em->fdata, CD_MTFACE); @@ -175,7 +176,7 @@ static int uv_texture_add_exec(bContext *C, wmOperator *op) EM_add_data_layer(em, &em->fdata, CD_MTFACE); CustomData_set_layer_active(&em->fdata, CD_MTFACE, layernum); } - else if(ob) { + else { layernum= CustomData_number_of_layers(&me->fdata, CD_MTFACE); if(layernum >= MAX_MTFACE) return OPERATOR_CANCELLED; @@ -189,8 +190,8 @@ static int uv_texture_add_exec(bContext *C, wmOperator *op) mesh_update_customdata_pointers(me); } - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + DAG_id_flush_update(&me->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, me); return OPERATOR_FINISHED; } @@ -203,6 +204,7 @@ void MESH_OT_uv_texture_add(wmOperatorType *ot) ot->idname= "MESH_OT_uv_texture_add"; /* api callbacks */ + ot->poll= layers_poll; ot->exec= uv_texture_add_exec; /* flags */ @@ -211,16 +213,11 @@ void MESH_OT_uv_texture_add(wmOperatorType *ot) static int uv_texture_remove_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; - Mesh *me; + Mesh *me= ob->data; CustomDataLayer *cdl; int index; - if(!ob || ob->type!=OB_MESH) - return OPERATOR_CANCELLED; - - me= (Mesh*)ob->data; index= CustomData_get_active_layer_index(&me->fdata, CD_MTFACE); cdl= (index == -1)? NULL: &me->fdata.layers[index]; @@ -229,8 +226,8 @@ static int uv_texture_remove_exec(bContext *C, wmOperator *op) delete_customdata_layer(C, ob, cdl); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + DAG_id_flush_update(&me->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, me); return OPERATOR_FINISHED; } @@ -243,6 +240,7 @@ void MESH_OT_uv_texture_remove(wmOperatorType *ot) ot->idname= "MESH_OT_uv_texture_remove"; /* api callbacks */ + ot->poll= layers_poll; ot->exec= uv_texture_remove_exec; /* flags */ @@ -255,17 +253,12 @@ static int vertex_color_add_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; - Mesh *me; + Mesh *me= ob->data; EditMesh *em; MCol *mcol; int layernum; - if(!ob || ob->type!=OB_MESH) - return OPERATOR_CANCELLED; - - me= (Mesh*)ob->data; - - if(scene->obedit == ob) { + if(me->edit_mesh) { em= me->edit_mesh; layernum= CustomData_number_of_layers(&em->fdata, CD_MCOL); @@ -294,8 +287,8 @@ static int vertex_color_add_exec(bContext *C, wmOperator *op) shadeMeshMCol(scene, ob, me); } - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + DAG_id_flush_update(&me->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, me); return OPERATOR_FINISHED; } @@ -308,6 +301,7 @@ void MESH_OT_vertex_color_add(wmOperatorType *ot) ot->idname= "MESH_OT_vertex_color_add"; /* api callbacks */ + ot->poll= layers_poll; ot->exec= vertex_color_add_exec; /* flags */ @@ -316,16 +310,11 @@ void MESH_OT_vertex_color_add(wmOperatorType *ot) static int vertex_color_remove_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; - Mesh *me; + Mesh *me= ob->data; CustomDataLayer *cdl; int index; - if(!ob || ob->type!=OB_MESH) - return OPERATOR_CANCELLED; - - me= (Mesh*)ob->data; index= CustomData_get_active_layer_index(&me->fdata, CD_MCOL); cdl= (index == -1)? NULL: &me->fdata.layers[index]; @@ -334,8 +323,8 @@ static int vertex_color_remove_exec(bContext *C, wmOperator *op) delete_customdata_layer(C, ob, cdl); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + DAG_id_flush_update(&me->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, me); return OPERATOR_FINISHED; } @@ -349,6 +338,7 @@ void MESH_OT_vertex_color_remove(wmOperatorType *ot) /* api callbacks */ ot->exec= vertex_color_remove_exec; + ot->poll= layers_poll; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -358,22 +348,16 @@ void MESH_OT_vertex_color_remove(wmOperatorType *ot) static int sticky_add_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; - Mesh *me; - - if(!ob || ob->type!=OB_MESH) - return OPERATOR_CANCELLED; - - me= (Mesh*)ob->data; + Mesh *me= ob->data; if(me->msticky) return OPERATOR_CANCELLED; // XXX RE_make_sticky(); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + DAG_id_flush_update(&me->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, me); return OPERATOR_FINISHED; } @@ -386,6 +370,7 @@ void MESH_OT_sticky_add(wmOperatorType *ot) ot->idname= "MESH_OT_sticky_add"; /* api callbacks */ + ot->poll= layers_poll; ot->exec= sticky_add_exec; /* flags */ @@ -394,14 +379,8 @@ void MESH_OT_sticky_add(wmOperatorType *ot) static int sticky_remove_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; - Mesh *me; - - if(!ob || ob->type!=OB_MESH) - return OPERATOR_CANCELLED; - - me= (Mesh*)ob->data; + Mesh *me= ob->data; if(!me->msticky) return OPERATOR_CANCELLED; @@ -409,8 +388,8 @@ static int sticky_remove_exec(bContext *C, wmOperator *op) CustomData_free_layer_active(&me->vdata, CD_MSTICKY, me->totvert); me->msticky= NULL; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + DAG_id_flush_update(&me->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, me); return OPERATOR_FINISHED; } @@ -423,6 +402,7 @@ void MESH_OT_sticky_remove(wmOperatorType *ot) ot->idname= "MESH_OT_sticky_remove"; /* api callbacks */ + ot->poll= layers_poll; ot->exec= sticky_remove_exec; /* flags */ diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 5d4be254593..2ef1d3b214d 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -681,7 +681,7 @@ void sort_faces(Scene *scene, View3D *v3d) MEM_freeN(index); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(ob->data, OB_RECALC_DATA); } diff --git a/source/blender/editors/metaball/editmball.c b/source/blender/editors/metaball/editmball.c index b9bb219783f..9ab985fb3fb 100644 --- a/source/blender/editors/metaball/editmball.c +++ b/source/blender/editors/metaball/editmball.c @@ -212,8 +212,8 @@ static int select_deselect_all_metaelems_exec(bContext *C, wmOperator *op) else ml->flag |= SELECT; ml= ml->next; } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); - //DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, mb); + //DAG_id_flush_update(obedit->data, OB_RECALC_DATA); } return OPERATOR_FINISHED; @@ -251,7 +251,7 @@ static int select_inverse_metaelems_exec(bContext *C, wmOperator *op) ml->flag |= SELECT; ml= ml->next; } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, mb); } return OPERATOR_FINISHED; @@ -296,7 +296,7 @@ static int select_random_metaelems_exec(bContext *C, wmOperator *op) ml= ml->next; } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, mb); return OPERATOR_FINISHED; } @@ -325,7 +325,6 @@ void MBALL_OT_select_random_metaelems(struct wmOperatorType *ot) /* Duplicate selected MetaElements */ static int duplicate_metaelems_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); MetaBall *mb = (MetaBall*)obedit->data; MetaElem *ml, *newml; @@ -341,8 +340,8 @@ static int duplicate_metaelems_exec(bContext *C, wmOperator *op) } ml= ml->prev; } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, mb); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); } return OPERATOR_FINISHED; @@ -384,7 +383,6 @@ void MBALL_OT_duplicate_metaelems(wmOperatorType *ot) /* Delete all selected MetaElems (not MetaBall) */ static int delete_metaelems_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); MetaBall *mb= (MetaBall*)obedit->data; MetaElem *ml, *next; @@ -400,8 +398,8 @@ static int delete_metaelems_exec(bContext *C, wmOperator *op) } ml= next; } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, mb); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); } return OPERATOR_FINISHED; @@ -426,7 +424,6 @@ void MBALL_OT_delete_metaelems(wmOperatorType *ot) /* Hide selected MetaElems */ static int hide_metaelems_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); MetaBall *mb= (MetaBall*)obedit->data; MetaElem *ml; @@ -450,8 +447,8 @@ static int hide_metaelems_exec(bContext *C, wmOperator *op) ml= ml->next; } } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, mb); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); } return OPERATOR_FINISHED; @@ -479,7 +476,6 @@ void MBALL_OT_hide_metaelems(wmOperatorType *ot) /* Unhide all edited MetaElems */ static int reveal_metaelems_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *obedit= CTX_data_edit_object(C); MetaBall *mb= (MetaBall*)obedit->data; MetaElem *ml; @@ -491,8 +487,8 @@ static int reveal_metaelems_exec(bContext *C, wmOperator *op) ml->flag &= ~MB_HIDE; ml= ml->next; } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, mb); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); } return OPERATOR_FINISHED; @@ -584,7 +580,7 @@ void mouse_mball(bContext *C, short mval[2], int extend) } mb->lastelem= act; - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, mb); } } } diff --git a/source/blender/editors/object/editconstraint.c b/source/blender/editors/object/editconstraint.c index dc0442a5af9..c1b1062bfc4 100644 --- a/source/blender/editors/object/editconstraint.c +++ b/source/blender/editors/object/editconstraint.c @@ -825,7 +825,6 @@ void CONSTRAINT_OT_move_up (wmOperatorType *ot) static int pose_constraints_clear_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); /* free constraints for all selected bones */ @@ -836,7 +835,7 @@ static int pose_constraints_clear_exec(bContext *C, wmOperator *op) CTX_DATA_END; /* do updates */ - DAG_object_flush_update(scene, ob, OB_RECALC_OB); + DAG_id_flush_update(&ob->id, OB_RECALC_OB); WM_event_add_notifier(C, NC_OBJECT|ND_POSE|ND_CONSTRAINT|NA_REMOVED, ob); return OPERATOR_FINISHED; @@ -857,7 +856,6 @@ void POSE_OT_constraints_clear(wmOperatorType *ot) static int object_constraints_clear_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); /* do freeing */ @@ -865,7 +863,7 @@ static int object_constraints_clear_exec(bContext *C, wmOperator *op) free_constraints(&ob->constraints); /* do updates */ - DAG_object_flush_update(scene, ob, OB_RECALC_OB); + DAG_id_flush_update(&ob->id, OB_RECALC_OB); WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT|NA_REMOVED, ob); return OPERATOR_FINISHED; @@ -1138,10 +1136,10 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase if ((ob->type==OB_ARMATURE) && (pchan)) { ob->pose->flag |= POSE_RECALC; /* sort pose channels */ - DAG_object_flush_update(scene, ob, OB_RECALC_DATA|OB_RECALC_OB); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA|OB_RECALC_OB); } else - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); /* notifiers for updates */ WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT|NA_ADDED, ob); @@ -1376,7 +1374,6 @@ void POSE_OT_ik_add(wmOperatorType *ot) /* remove IK constraints from selected bones */ static int pose_ik_clear_exec(bContext *C, wmOperator *op) { - Scene *scene = CTX_data_scene(C); Object *ob= CTX_data_active_object(C); /* only remove IK Constraints */ @@ -1397,7 +1394,7 @@ static int pose_ik_clear_exec(bContext *C, wmOperator *op) CTX_DATA_END; /* */ - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); /* note, notifier might evolve */ WM_event_add_notifier(C, NC_OBJECT|ND_CONSTRAINT|NA_REMOVED, ob); diff --git a/source/blender/editors/object/editkey.c b/source/blender/editors/object/editkey.c index 82194a4c3b4..2ec3edd846a 100644 --- a/source/blender/editors/object/editkey.c +++ b/source/blender/editors/object/editkey.c @@ -473,7 +473,7 @@ int ED_object_shape_key_remove(bContext *C, Scene *scene, Object *ob) free_libblock_us(&(bmain->key), key); } - DAG_object_flush_update(scene, OBACT, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); return 1; @@ -481,14 +481,18 @@ int ED_object_shape_key_remove(bContext *C, Scene *scene, Object *ob) /********************** shape key operators *********************/ +static int shape_key_poll(bContext *C) +{ + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + ID *data= (ob)? ob->data: NULL; + return (ob && !ob->id.lib && data && !data->lib); +} + static int shape_key_add_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; - if(!ob) - return OPERATOR_CANCELLED; - ED_object_shape_key_add(C, scene, ob); return OPERATOR_FINISHED; @@ -501,6 +505,7 @@ void OBJECT_OT_shape_key_add(wmOperatorType *ot) ot->idname= "OBJECT_OT_shape_key_add"; /* api callbacks */ + ot->poll= shape_key_poll; ot->exec= shape_key_add_exec; /* flags */ @@ -509,12 +514,9 @@ void OBJECT_OT_shape_key_add(wmOperatorType *ot) static int shape_key_remove_exec(bContext *C, wmOperator *op) { - Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; - if(!ob) - return OPERATOR_CANCELLED; - if(!ED_object_shape_key_remove(C, scene, ob)) return OPERATOR_CANCELLED; @@ -528,97 +530,10 @@ void OBJECT_OT_shape_key_remove(wmOperatorType *ot) ot->idname= "OBJECT_OT_shape_key_remove"; /* api callbacks */ + ot->poll= shape_key_poll; ot->exec= shape_key_remove_exec; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } -void move_keys(Object *ob) -{ -#if 0 - /* XXX probably goes away entirely */ - Key *key; - KeyBlock *kb; - float div, dy, oldpos, vec[3], dvec[3]; - int afbreek=0, firsttime= 1; - unsigned short event = 0; - short mval[2], val, xo, yo; - char str[32]; - - if(G.sipo->blocktype!=ID_KE) return; - - if(G.sipo->ipo && G.sipo->ipo->id.lib) return; - if(G.sipo->editipo==NULL) return; - - key= ob_get_key(ob); - if(key==NULL) return; - - /* which kb is involved */ - kb= BLI_findlink(&key->block, ob->shapenr-1); - if(kb==NULL) return; - - oldpos= kb->pos; - - getmouseco_areawin(mval); - xo= mval[0]; - yo= mval[1]; - dvec[0]=dvec[1]=dvec[2]= 0.0; - - while(afbreek==0) { - getmouseco_areawin(mval); - if(mval[0]!=xo || mval[1]!=yo || firsttime) { - firsttime= 0; - - dy= (float)(mval[1]- yo); - - div= (float)(G.v2d->mask.ymax-G.v2d->mask.ymin); - dvec[1]+= (G.v2d->cur.ymax-G.v2d->cur.ymin)*(dy)/div; - - VECCOPY(vec, dvec); - - apply_keyb_grid(vec, 0.0, 1.0, 0.1, U.flag & USER_AUTOGRABGRID); - apply_keyb_grid(vec+1, 0.0, 1.0, 0.1, U.flag & USER_AUTOGRABGRID); - - kb->pos= oldpos+vec[1]; - - sprintf(str, "Y: %.3f ", vec[1]); - headerprint(str); - - xo= mval[0]; - yo= mval[1]; - - force_draw(0); - } - else BIF_wait_for_statechange(); - - while(qtest()) { - event= extern_qread(&val); - if(val) { - switch(event) { - case ESCKEY: - case LEFTMOUSE: - case SPACEKEY: - afbreek= 1; - break; - default: - arrows_move_cursor(event); - } - } - } - } - - if(event==ESCKEY) { - kb->pos= oldpos; - } - - sort_keys(key); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - - /* for boundbox */ - editipo_changed(G.sipo, 0); - - BIF_undo_push("Move Shapekey(s)"); -#endif -} - diff --git a/source/blender/editors/object/editlattice.c b/source/blender/editors/object/editlattice.c index 3e30efd635a..3ec1f3af014 100644 --- a/source/blender/editors/object/editlattice.c +++ b/source/blender/editors/object/editlattice.c @@ -203,7 +203,7 @@ int de_select_all_exec(bContext *C, wmOperator *op) else setflagsLatt(obedit, 1); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); return OPERATOR_FINISHED; } @@ -234,7 +234,6 @@ int make_regular_poll(bContext *C) int make_regular_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_edit_object(C); Lattice *lt; @@ -248,8 +247,8 @@ int make_regular_exec(bContext *C, wmOperator *op) resizelattice(lt, lt->pntsu, lt->pntsv, lt->pntsw, NULL); } - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data); return OPERATOR_FINISHED; } @@ -318,7 +317,7 @@ void mouse_lattice(bContext *C, short mval[2], int extend) else bp->f1 ^= SELECT; /* swap */ - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, vc.obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, vc.obedit->data); } } diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index a5e92096ef9..53882ad8424 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -193,7 +193,7 @@ void ED_base_object_activate(bContext *C, Base *base) for(tbase=FIRSTBASE; tbase; tbase= tbase->next) { if(base!=tbase && (tbase->object->shapeflag & OB_SHAPE_TEMPLOCK)) { tbase->object->shapeflag &= ~OB_SHAPE_TEMPLOCK; - DAG_object_flush_update(scene, tbase->object, OB_RECALC_DATA); + DAG_id_flush_update(&tbase->object->id, OB_RECALC_DATA); } } WM_event_add_notifier(C, NC_SCENE|ND_OB_ACTIVE, scene); @@ -343,7 +343,7 @@ static int object_add_mesh_exec(bContext *C, wmOperator *op) ED_object_enter_editmode(C, EM_DO_UNDO); newob = 1; } - else DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); + else DAG_id_flush_update(&obedit->id, OB_RECALC_DATA); switch(RNA_enum_get(op->ptr, "type")) { case 0: @@ -379,7 +379,7 @@ static int object_add_mesh_exec(bContext *C, wmOperator *op) ED_object_exit_editmode(C, EM_FREEDATA); } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, obedit); return OPERATOR_FINISHED; } @@ -425,7 +425,7 @@ static int object_add_curve_exec(bContext *C, wmOperator *op) ED_object_enter_editmode(C, 0); newob = 1; } - else DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); + else DAG_id_flush_update(&obedit->id, OB_RECALC_DATA); obedit= CTX_data_edit_object(C); nu= add_nurbs_primitive(C, RNA_enum_get(op->ptr, "type"), newob); @@ -437,7 +437,7 @@ static int object_add_curve_exec(bContext *C, wmOperator *op) ED_object_exit_editmode(C, EM_FREEDATA); } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, obedit); return OPERATOR_FINISHED; } @@ -500,7 +500,7 @@ static int object_add_surface_exec(bContext *C, wmOperator *op) ED_object_enter_editmode(C, 0); newob = 1; } - else DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); + else DAG_id_flush_update(&obedit->id, OB_RECALC_DATA); obedit= CTX_data_edit_object(C); nu= add_nurbs_primitive(C, RNA_enum_get(op->ptr, "type"), newob); @@ -512,7 +512,7 @@ static int object_add_surface_exec(bContext *C, wmOperator *op) ED_object_exit_editmode(C, EM_FREEDATA); } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, obedit); return OPERATOR_FINISHED; } @@ -557,7 +557,7 @@ static int object_metaball_add_exec(bContext *C, wmOperator *op) ED_object_enter_editmode(C, 0); newob = 1; } - else DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); + else DAG_id_flush_update(&obedit->id, OB_RECALC_DATA); obedit= CTX_data_edit_object(C); elem= (MetaElem*)add_metaball_primitive(C, RNA_enum_get(op->ptr, "type"), newob); @@ -569,7 +569,7 @@ static int object_metaball_add_exec(bContext *C, wmOperator *op) ED_object_exit_editmode(C, EM_FREEDATA); } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, obedit); return OPERATOR_FINISHED; } @@ -621,7 +621,7 @@ static int object_add_text_exec(bContext *C, wmOperator *op) if(U.flag & USER_ADD_EDITMODE) ED_object_enter_editmode(C, 0); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, obedit); return OPERATOR_FINISHED; } @@ -653,7 +653,7 @@ static int object_armature_add_exec(bContext *C, wmOperator *op) ED_object_enter_editmode(C, 0); newob = 1; } - else DAG_object_flush_update(CTX_data_scene(C), obedit, OB_RECALC_DATA); + else DAG_id_flush_update(&obedit->id, OB_RECALC_DATA); if(v3d) rv3d= CTX_wm_region(C)->regiondata; @@ -666,7 +666,7 @@ static int object_armature_add_exec(bContext *C, wmOperator *op) ED_object_exit_editmode(C, EM_FREEDATA); } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, obedit); return OPERATOR_FINISHED; } @@ -3034,7 +3034,7 @@ static int make_proxy_exec (bContext *C, wmOperator *op) /* depsgraph flushes are needed for the new data */ DAG_scene_sort(scene); - DAG_object_flush_update(scene, newob, OB_RECALC); + DAG_id_flush_update(&newob->id, OB_RECALC); WM_event_add_notifier(C, NC_OBJECT, NULL); } @@ -3543,7 +3543,7 @@ static int object_center_set_exec(bContext *C, wmOperator *op) recalc_editnormals(em); tot_change++; - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + DAG_id_flush_update(&obedit->id, OB_RECALC_DATA); BKE_mesh_end_editmesh(me, em); } } @@ -3735,7 +3735,7 @@ static int object_center_set_exec(bContext *C, wmOperator *op) tot_change++; if(obedit) { if (centermode==0) { - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + DAG_id_flush_update(&obedit->id, OB_RECALC_DATA); } break; } @@ -3884,7 +3884,7 @@ void ED_object_exit_editmode(bContext *C, int flag) scene->obedit= NULL; // XXX for context /* also flush ob recalc, doesn't take much overhead, but used for particles */ - DAG_object_flush_update(scene, obedit, OB_RECALC_OB|OB_RECALC_DATA); + DAG_id_flush_update(&obedit->id, OB_RECALC_OB|OB_RECALC_DATA); ED_undo_push(C, "Editmode"); @@ -3963,7 +3963,7 @@ void ED_object_enter_editmode(bContext *C, int flag) scene->obedit= ob; ED_armature_to_edit(ob); /* to ensure all goes in restposition and without striding */ - DAG_object_flush_update(scene, ob, OB_RECALC); + DAG_id_flush_update(&ob->id, OB_RECALC); WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_EDITMODE_ARMATURE, scene); } @@ -3997,7 +3997,7 @@ void ED_object_enter_editmode(bContext *C, int flag) } if(ok) { - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } else { scene->obedit= NULL; // XXX for context @@ -4327,7 +4327,7 @@ void special_editmenu(Scene *scene, View3D *v3d) } } } - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } else if(ob->mode & OB_MODE_VERTEX_PAINT) { Mesh *me= get_mesh(ob); @@ -4339,7 +4339,7 @@ void special_editmenu(Scene *scene, View3D *v3d) // XXX do_shared_vertexcol(me); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } } else if(ob->mode & OB_MODE_WEIGHT_PAINT) { @@ -4386,7 +4386,7 @@ void special_editmenu(Scene *scene, View3D *v3d) break; } - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + DAG_id_flush_update(&obedit->id, OB_RECALC_DATA); if(nr>0) waitcursor(0); #endif @@ -4809,7 +4809,7 @@ static void object_flip_subdivison_particles(Scene *scene, Object *ob, int *set, } } - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } if(ob->dup_group && depth<=4) { @@ -6790,7 +6790,6 @@ void OBJECT_OT_join(wmOperatorType *ot) static int shade_smooth_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *ob; Curve *cu; Nurb *nu; @@ -6803,7 +6802,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op) if(ob->type==OB_MESH) { mesh_set_smooth_flag(ob, !clear); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); done= 1; @@ -6817,7 +6816,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op) nu= nu->next; } - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); done= 1; @@ -6904,7 +6903,7 @@ void image_aspect(Scene *scene, View3D *v3d) else ob->size[1]= ob->size[0]*y/x; done= 1; - DAG_object_flush_update(scene, ob, OB_RECALC_OB); + DAG_id_flush_update(&ob->id, OB_RECALC_OB); } } if(done) break; @@ -7184,7 +7183,7 @@ void hookmenu(Scene *scene, View3D *v3d) Mat4MulSerie(hmd->parentinv, hmd->object->imat, ob->obmat, NULL, NULL, NULL, NULL, NULL, NULL); changed= 1; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } } else { float *curs = give_cursor(scene, v3d); @@ -7202,7 +7201,7 @@ void hookmenu(Scene *scene, View3D *v3d) Mat3MulVecfl(imat, hmd->cent); changed= 1; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } } } diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 96e485e5462..aecb778db06 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -119,7 +119,7 @@ int ED_object_modifier_add(ReportList *reports, Scene *scene, Object *ob, int ty DAG_scene_sort(scene); } - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); return 1; } @@ -168,7 +168,7 @@ int ED_object_modifier_remove(ReportList *reports, Scene *scene, Object *ob, Mod BLI_remlink(&ob->modifiers, md); modifier_free(md); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); return 1; } @@ -376,7 +376,7 @@ int ED_object_modifier_apply(ReportList *reports, Scene *scene, Object *ob, Modi MEM_freeN(vertexCos); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } else { BKE_report(reports, RPT_ERROR, "Cannot apply modifier for this object type"); @@ -408,7 +408,8 @@ int ED_object_modifier_copy(ReportList *reports, Object *ob, ModifierData *md) static int modifier_poll(bContext *C) { - return (CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier).data != NULL); + PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier); + return (ptr.data != NULL && !((ID*)ptr.id.data)->lib); } /************************ add modifier operator *********************/ @@ -518,7 +519,6 @@ void OBJECT_OT_modifier_remove(wmOperatorType *ot) static int modifier_move_up_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier); Object *ob= ptr.id.data; ModifierData *md= ptr.data; @@ -526,7 +526,7 @@ static int modifier_move_up_exec(bContext *C, wmOperator *op) if(!ED_object_modifier_move_up(op->reports, ob, md)) return OPERATOR_CANCELLED; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -550,7 +550,6 @@ void OBJECT_OT_modifier_move_up(wmOperatorType *ot) static int modifier_move_down_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier); Object *ob= ptr.id.data; ModifierData *md= ptr.data; @@ -558,7 +557,7 @@ static int modifier_move_down_exec(bContext *C, wmOperator *op) if(!ob || !md || !ED_object_modifier_move_down(op->reports, ob, md)) return OPERATOR_CANCELLED; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -590,7 +589,7 @@ static int modifier_apply_exec(bContext *C, wmOperator *op) if(!ob || !md || !ED_object_modifier_apply(op->reports, scene, ob, md)) return OPERATOR_CANCELLED; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -622,7 +621,7 @@ static int modifier_convert_exec(bContext *C, wmOperator *op) if(!ob || !md || !ED_object_modifier_convert(op->reports, scene, ob, md)) return OPERATOR_CANCELLED; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -646,7 +645,6 @@ void OBJECT_OT_modifier_convert(wmOperatorType *ot) static int modifier_copy_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_Modifier); Object *ob= ptr.id.data; ModifierData *md= ptr.data; @@ -654,7 +652,7 @@ static int modifier_copy_exec(bContext *C, wmOperator *op) if(!ob || !md || !ED_object_modifier_copy(op->reports, ob, md)) return OPERATOR_CANCELLED; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -718,8 +716,9 @@ static int multires_subdivide_exec(bContext *C, wmOperator *op) static int multires_subdivide_poll(bContext *C) { - return (CTX_data_pointer_get_type(C, "modifier", &RNA_MultiresModifier).data != NULL) && - CTX_data_edit_object(C) == NULL; + PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_MultiresModifier); + ID *id= ptr.id.data; + return (ptr.data && id && !id->lib); } void OBJECT_OT_multires_subdivide(wmOperatorType *ot) @@ -739,7 +738,9 @@ void OBJECT_OT_multires_subdivide(wmOperatorType *ot) static int meshdeform_poll(bContext *C) { - return CTX_data_pointer_get_type(C, "modifier", &RNA_MeshDeformModifier).data != NULL; + PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_MeshDeformModifier); + ID *id= ptr.id.data; + return (ptr.data && id && !id->lib); } static int meshdeform_bind_exec(bContext *C, wmOperator *op) @@ -864,12 +865,13 @@ static uiBlock *modifiers_add_menu(void *ob_v) static int hook_poll(bContext *C) { - return CTX_data_pointer_get_type(C, "modifier", &RNA_HookModifier).data != NULL; + PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_HookModifier); + ID *id= ptr.id.data; + return (ptr.data && id && !id->lib); } static int hook_reset_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_HookModifier); Object *ob= ptr.id.data; HookModifierData *hmd= ptr.data; @@ -892,7 +894,7 @@ static int hook_reset_exec(bContext *C, wmOperator *op) } } - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -925,7 +927,7 @@ static int hook_recenter_exec(bContext *C, wmOperator *op) VECSUB(hmd->cent, scene->cursor, ob->obmat[3]); Mat3MulVecfl(imat, hmd->cent); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -952,7 +954,7 @@ static int hook_select_exec(bContext *C, wmOperator *op) object_hook_select(ob, hmd); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, ob); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, ob->data); return OPERATOR_FINISHED; } @@ -972,7 +974,6 @@ void OBJECT_OT_hook_select(wmOperatorType *ot) static int hook_assign_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_HookModifier); Object *ob= ptr.id.data; HookModifierData *hmd= ptr.data; @@ -992,7 +993,7 @@ static int hook_assign_exec(bContext *C, wmOperator *op) hmd->indexar= indexar; hmd->totindex= tot; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); return OPERATOR_FINISHED; @@ -1015,19 +1016,20 @@ void OBJECT_OT_hook_assign(wmOperatorType *ot) static int explode_refresh_poll(bContext *C) { - return CTX_data_pointer_get_type(C, "modifier", &RNA_ExplodeModifier).data != NULL; + PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_ExplodeModifier); + ID *id= ptr.id.data; + return (ptr.data && id && !id->lib); } static int explode_refresh_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); PointerRNA ptr= CTX_data_pointer_get_type(C, "modifier", &RNA_ExplodeModifier); Object *ob= ptr.id.data; ExplodeModifierData *emd= ptr.data; emd->flag |= eExplodeFlag_CalcFaces; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); return OPERATOR_FINISHED; diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 767a04d9170..1660160b56c 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -1102,17 +1102,21 @@ void vgroup_operation_with_menu(Object *ob) /********************** vertex group operators *********************/ +static int vertex_group_poll(bContext *C) +{ + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + ID *data= (ob)? ob->data: NULL; + return (ob && !ob->id.lib && data && !data->lib); +} + static int vertex_group_add_exec(bContext *C, wmOperator *op) { Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; - Scene *scene= CTX_data_scene(C); - - if(!ob) - return OPERATOR_CANCELLED; add_defgroup(ob); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); return OPERATOR_FINISHED; } @@ -1124,6 +1128,7 @@ void OBJECT_OT_vertex_group_add(wmOperatorType *ot) ot->idname= "OBJECT_OT_vertex_group_add"; /* api callbacks */ + ot->poll= vertex_group_poll; ot->exec= vertex_group_add_exec; /* flags */ @@ -1135,18 +1140,16 @@ static int vertex_group_remove_exec(bContext *C, wmOperator *op) Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; Scene *scene= CTX_data_scene(C); - if(!ob) - return OPERATOR_CANCELLED; - if(scene->obedit == ob) { del_defgroup(ob); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); } else { del_defgroup_in_object_mode(ob); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } + + WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); return OPERATOR_FINISHED; } @@ -1158,6 +1161,7 @@ void OBJECT_OT_vertex_group_remove(wmOperatorType *ot) ot->idname= "OBJECT_OT_vertex_group_remove"; /* api callbacks */ + ot->poll= vertex_group_poll; ot->exec= vertex_group_remove_exec; /* flags */ @@ -1166,16 +1170,12 @@ void OBJECT_OT_vertex_group_remove(wmOperatorType *ot) static int vertex_group_assign_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); ToolSettings *ts= CTX_data_tool_settings(C); Object *ob= CTX_data_edit_object(C); - if(!ob) - return OPERATOR_CANCELLED; - assign_verts_defgroup(ob, ts->vgroup_weight); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data); return OPERATOR_FINISHED; } @@ -1187,6 +1187,7 @@ void OBJECT_OT_vertex_group_assign(wmOperatorType *ot) ot->idname= "OBJECT_OT_vertex_group_assign"; /* api callbacks */ + ot->poll= vertex_group_poll; ot->exec= vertex_group_assign_exec; /* flags */ @@ -1195,15 +1196,11 @@ void OBJECT_OT_vertex_group_assign(wmOperatorType *ot) static int vertex_group_remove_from_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_edit_object(C); - if(!ob) - return OPERATOR_CANCELLED; - remove_verts_defgroup(ob, 0); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data); return OPERATOR_FINISHED; } @@ -1215,6 +1212,7 @@ void OBJECT_OT_vertex_group_remove_from(wmOperatorType *ot) ot->idname= "OBJECT_OT_vertex_group_remove_from"; /* api callbacks */ + ot->poll= vertex_group_poll; ot->exec= vertex_group_remove_from_exec; /* flags */ @@ -1225,11 +1223,11 @@ static int vertex_group_select_exec(bContext *C, wmOperator *op) { Object *ob= CTX_data_edit_object(C); - if(!ob) + if(!ob || ob->id.lib) return OPERATOR_CANCELLED; - sel_verts_defgroup(ob, 1); /* runs countall() */ - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, ob); + sel_verts_defgroup(ob, 1); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, ob->data); return OPERATOR_FINISHED; } @@ -1241,6 +1239,7 @@ void OBJECT_OT_vertex_group_select(wmOperatorType *ot) ot->idname= "OBJECT_OT_vertex_group_select"; /* api callbacks */ + ot->poll= vertex_group_poll; ot->exec= vertex_group_select_exec; /* flags */ @@ -1251,11 +1250,8 @@ static int vertex_group_deselect_exec(bContext *C, wmOperator *op) { Object *ob= CTX_data_edit_object(C); - if(!ob) - return OPERATOR_CANCELLED; - - sel_verts_defgroup(ob, 0); /* runs countall() */ - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, ob); + sel_verts_defgroup(ob, 0); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, ob->data); return OPERATOR_FINISHED; } @@ -1267,6 +1263,7 @@ void OBJECT_OT_vertex_group_deselect(wmOperatorType *ot) ot->idname= "OBJECT_OT_vertex_group_deselect"; /* api callbacks */ + ot->poll= vertex_group_poll; ot->exec= vertex_group_deselect_exec; /* flags */ @@ -1275,15 +1272,12 @@ void OBJECT_OT_vertex_group_deselect(wmOperatorType *ot) static int vertex_group_copy_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; - if(!ob) - return OPERATOR_CANCELLED; - duplicate_defgroup(ob); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data); return OPERATOR_FINISHED; } @@ -1295,6 +1289,7 @@ void OBJECT_OT_vertex_group_copy(wmOperatorType *ot) ot->idname= "OBJECT_OT_vertex_group_copy"; /* api callbacks */ + ot->poll= vertex_group_poll; ot->exec= vertex_group_copy_exec; /* flags */ @@ -1308,9 +1303,6 @@ static int vertex_group_copy_to_linked_exec(bContext *C, wmOperator *op) Base *base; int retval= OPERATOR_CANCELLED; - if(!ob) - return retval; - for(base=scene->base.first; base; base= base->next) { if(base->object->type==ob->type) { if(base->object!=ob && base->object->data==ob->data) { @@ -1318,8 +1310,9 @@ static int vertex_group_copy_to_linked_exec(bContext *C, wmOperator *op) BLI_duplicatelist(&base->object->defbase, &ob->defbase); base->object->actdef= ob->actdef; - DAG_object_flush_update(scene, base->object, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, base->object); + DAG_id_flush_update(&base->object->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, base->object); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, base->object->data); retval = OPERATOR_FINISHED; } @@ -1336,6 +1329,7 @@ void OBJECT_OT_vertex_group_copy_to_linked(wmOperatorType *ot) ot->idname= "OBJECT_OT_vertex_group_copy_to_linked"; /* api callbacks */ + ot->poll= vertex_group_poll; ot->exec= vertex_group_copy_to_linked_exec; /* flags */ diff --git a/source/blender/editors/physics/editparticle.c b/source/blender/editors/physics/editparticle.c index 220928cb79c..3ddc143b5a3 100644 --- a/source/blender/editors/physics/editparticle.c +++ b/source/blender/editors/physics/editparticle.c @@ -1018,7 +1018,6 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys) static void PE_update_selection(Scene *scene, Object *ob, int useflag) { - ParticleEditSettings *pset= PE_settings(scene); PTCacheEdit *edit= PE_get_current(scene, ob); HairKey *hkey; POINT_P; KEY_K; @@ -1156,7 +1155,7 @@ void PE_update_object(Scene *scene, Object *ob, int useflag) point->flag &= ~PEP_EDIT_RECALC; } - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } /************************************************/ @@ -1235,7 +1234,7 @@ static int de_select_all_exec(bContext *C, wmOperator *op) } PE_update_selection(scene, ob, 1); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, ob); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, ob); return OPERATOR_FINISHED; } @@ -1283,7 +1282,7 @@ int PE_mouse_particles(bContext *C, short *mval, int extend) for_mouse_hit_keys(&data, toggle_key_select, 1); /* nearest only */ PE_update_selection(scene, ob, 1); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, data.ob); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, data.ob); return OPERATOR_FINISHED; } @@ -1301,7 +1300,7 @@ static int select_first_exec(bContext *C, wmOperator *op) PE_set_data(C, &data); foreach_point(&data, select_root); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, data.ob); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, data.ob); return OPERATOR_FINISHED; } @@ -1334,7 +1333,7 @@ static int select_last_exec(bContext *C, wmOperator *op) PE_set_data(C, &data); foreach_point(&data, select_tip); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, data.ob); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, data.ob); return OPERATOR_FINISHED; } @@ -1374,7 +1373,7 @@ static int select_linked_exec(bContext *C, wmOperator *op) for_mouse_hit_keys(&data, select_keys, 1); /* nearest only */ PE_update_selection(data.scene, data.ob, 1); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, data.ob); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, data.ob); return OPERATOR_FINISHED; } @@ -1429,7 +1428,7 @@ int PE_border_select(bContext *C, rcti *rect, int select) for_mouse_hit_keys(&data, select_key, 0); PE_update_selection(scene, ob, 1); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, ob); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, ob); return OPERATOR_FINISHED; } @@ -1454,7 +1453,7 @@ int PE_circle_select(bContext *C, int selecting, short *mval, float rad) for_mouse_hit_keys(&data, select_key, 0); PE_update_selection(scene, ob, 1); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, ob); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, ob); return OPERATOR_FINISHED; } @@ -1520,7 +1519,7 @@ int PE_lasso_select(bContext *C, short mcords[][2], short moves, short select) } PE_update_selection(scene, ob, 1); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, ob); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, ob); return OPERATOR_FINISHED; } @@ -1554,7 +1553,7 @@ static int hide_exec(bContext *C, wmOperator *op) } PE_update_selection(scene, ob, 1); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, ob); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, ob); return OPERATOR_FINISHED; } @@ -1596,7 +1595,7 @@ static int reveal_exec(bContext *C, wmOperator *op) } PE_update_selection(scene, ob, 1); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, ob); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, ob); return OPERATOR_FINISHED; } @@ -1650,7 +1649,7 @@ static int select_less_exec(bContext *C, wmOperator *op) PE_set_data(C, &data); foreach_point(&data, select_less_keys); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, data.ob); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, data.ob); return OPERATOR_FINISHED; } @@ -1708,7 +1707,7 @@ static int select_more_exec(bContext *C, wmOperator *op) PE_set_data(C, &data); foreach_point(&data, select_more_keys); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, data.ob); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, data.ob); return OPERATOR_FINISHED; } @@ -1796,7 +1795,7 @@ static int rekey_exec(bContext *C, wmOperator *op) recalc_lengths(data.edit); PE_update_object(data.scene, data.ob, 1); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, data.ob); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, data.ob); return OPERATOR_FINISHED; } @@ -2091,7 +2090,7 @@ static int subdivide_exec(bContext *C, wmOperator *op) recalc_lengths(data.edit); PE_update_object(data.scene, data.ob, 1); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, data.ob); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, data.ob); return OPERATOR_FINISHED; } @@ -2180,8 +2179,8 @@ static int remove_doubles_exec(bContext *C, wmOperator *op) BKE_reportf(op->reports, RPT_INFO, "Remove %d double particles.", totremoved); PE_update_object(scene, ob, 0); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, ob); return OPERATOR_FINISHED; } @@ -2358,8 +2357,8 @@ static int delete_exec(bContext *C, wmOperator *op) PE_update_object(data.scene, data.ob, 0); - DAG_object_flush_update(data.scene, data.ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, data.ob); + DAG_id_flush_update(&data.ob->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, data.ob); return OPERATOR_FINISHED; } @@ -2512,8 +2511,8 @@ static int mirror_exec(bContext *C, wmOperator *op) PE_mirror_x(scene, ob, 0); update_world_cos(ob, edit); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, ob); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); return OPERATOR_FINISHED; } @@ -2593,11 +2592,11 @@ static int set_edit_mode_exec(bContext *C, wmOperator *op) void PARTICLE_OT_edit_type_set(wmOperatorType *ot) { /* identifiers */ - ot->name= "Set Brush"; + ot->name= "Set Edit Type"; ot->idname= "PARTICLE_OT_edit_type_set"; /* api callbacks */ - ot->exec= set_brush_exec; + ot->exec= set_edit_mode_exec; ot->invoke= WM_menu_invoke; ot->poll= PE_poll; @@ -2627,11 +2626,9 @@ static void brush_comb(PEData *data, float mat[][4], float imat[][4], int point_ static void brush_cut(PEData *data, int pa_index) { PTCacheEdit *edit = data->edit; - ParticleSystem *psys= edit->psys; ARegion *ar= data->vc.ar; Object *ob= data->ob; ParticleEditSettings *pset= PE_settings(data->scene); - ParticleData *pa= &psys->particles[pa_index]; ParticleCacheKey *key= edit->pathcache[pa_index]; float rad2, cut_time= 1.0; float x0, x1, v0, v1, o0, o1, xo0, xo1, d, dv; @@ -3237,12 +3234,12 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) update_world_cos(ob,edit); psys_free_path_cache(NULL, edit); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } else PE_update_object(scene, ob, 1); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, ob); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_SELECT, ob); bedit->lastmouse[0]= mouse[0]; bedit->lastmouse[1]= mouse[1]; @@ -3553,7 +3550,7 @@ void PE_undo_step(Scene *scene, int step) } PE_update_object(scene, OBACT, 0); - DAG_object_flush_update(scene, OBACT, OB_RECALC_DATA); + DAG_id_flush_update(&OBACT->id, OB_RECALC_DATA); } static void PTCacheUndo_number(Scene *scene, PTCacheEdit *edit, int nr) @@ -3780,9 +3777,7 @@ static int particle_edit_toggle_poll(bContext *C) static int particle_edit_toggle_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); - PTCacheEdit *edit= PE_get_current(scene, ob); if(!(ob->mode & OB_MODE_PARTICLE_EDIT)) { ob->mode |= OB_MODE_PARTICLE_EDIT; @@ -3795,7 +3790,7 @@ static int particle_edit_toggle_exec(bContext *C, wmOperator *op) WM_event_add_notifier(C, NC_SCENE|ND_MODE|NS_MODE_OBJECT, NULL); } - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); return OPERATOR_FINISHED; } @@ -3819,7 +3814,6 @@ void PARTICLE_OT_particle_edit_toggle(wmOperatorType *ot) static int clear_edited_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_active_object(C); ParticleSystem *psys = psys_get_current(ob); @@ -3833,7 +3827,7 @@ static int clear_edited_exec(bContext *C, wmOperator *op) psys->recalc |= PSYS_RECALC_RESET; psys_reset(psys, PSYS_RESET_DEPSGRAPH); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } } diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index d082e17cda3..870b66cdbbd 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -5184,7 +5184,7 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op) toggle_paint_cursor(C, 1); } - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_SCENE|ND_MODE, scene); return OPERATOR_FINISHED; diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index f66a9fbc1ed..953a055c9e5 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -295,7 +295,7 @@ void make_vertexcol(Scene *scene, int shade) /* single ob */ else memset(me->mcol, 255, 4*sizeof(MCol)*me->totface); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&me->id, OB_RECALC_DATA); } @@ -358,7 +358,7 @@ void clear_vpaint(Scene *scene, int selected) } } - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&me->id, OB_RECALC_DATA); } @@ -468,7 +468,7 @@ void clear_wpaint_selectedfaces(Scene *scene) MEM_freeN(indexar); copy_wpaint_prev(wp, NULL, 0); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&me->id, OB_RECALC_DATA); } @@ -923,7 +923,7 @@ void sample_wpaint(Scene *scene, ARegion *ar, View3D *v3d, int mode) val= 0; // XXX pupmenu(str); if(val>=0) { ob->actdef= val+1; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&me->id, OB_RECALC_DATA); } MEM_freeN(str); } @@ -1049,7 +1049,7 @@ static int set_wpaint(bContext *C, wmOperator *op) /* toggle */ * exit (exit needs doing regardless because we * should redeform). */ - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&me->id, OB_RECALC_DATA); if(ob->mode & OB_MODE_WEIGHT_PAINT) { Object *par; @@ -1446,7 +1446,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P MTC_Mat4SwapMat4(vc->rv3d->persmat, mat); - DAG_object_flush_update(vc->scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(ob->data, OB_RECALC_DATA); ED_region_tag_redraw(vc->ar); } @@ -1478,7 +1478,7 @@ static void wpaint_stroke_done(bContext *C, struct PaintStroke *stroke) } } - DAG_object_flush_update(CTX_data_scene(C), ob, OB_RECALC_DATA); + DAG_id_flush_update(ob->data, OB_RECALC_DATA); MEM_freeN(wpd); } @@ -1564,7 +1564,7 @@ static int set_vpaint(bContext *C, wmOperator *op) /* toggle */ if (me) /* update modifier stack for mapping requirements */ - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&me->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_SCENE|ND_MODE, scene); @@ -1735,7 +1735,7 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P ED_region_tag_redraw(vc->ar); - DAG_object_flush_update(vc->scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(ob->data, OB_RECALC_DATA); } static void vpaint_stroke_done(bContext *C, struct PaintStroke *stroke) diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index 2977d07d845..b7a3df563ea 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -372,6 +372,10 @@ static void action_listener(ScrArea *sa, wmNotifier *wmn) }*/ ED_area_tag_refresh(sa); break; + case NC_SPACE: + if(wmn->data == ND_SPACE_DOPESHEET) + ED_area_tag_redraw(sa); + break; } } diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 954a52c54aa..8cdc6b0cd2b 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -260,7 +260,6 @@ void OBJECT_OT_material_slot_remove(wmOperatorType *ot) static int material_slot_assign_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; if(!ob) @@ -298,8 +297,8 @@ static int material_slot_assign_exec(bContext *C, wmOperator *op) } } - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, ob->data); return OPERATOR_FINISHED; } @@ -377,7 +376,7 @@ static int material_slot_de_select(bContext *C, int select) } } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, ob); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, ob->data); return OPERATOR_FINISHED; } @@ -648,7 +647,7 @@ static int new_particle_settings_exec(bContext *C, wmOperator *op) psys_check_boid_data(psys); DAG_scene_sort(scene); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); @@ -695,7 +694,7 @@ static int new_particle_target_exec(bContext *C, wmOperator *op) BLI_addtail(&psys->targets, pt); DAG_scene_sort(scene); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); @@ -742,7 +741,7 @@ static int remove_particle_target_exec(bContext *C, wmOperator *op) pt->flag |= PTARGET_CURRENT; DAG_scene_sort(scene); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); @@ -766,7 +765,6 @@ void PARTICLE_OT_remove_target(wmOperatorType *ot) static int target_move_up_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= ptr.data; Object *ob = ptr.id.data; @@ -781,7 +779,7 @@ static int target_move_up_exec(bContext *C, wmOperator *op) BLI_remlink(&psys->targets, pt); BLI_insertlink(&psys->targets, pt->prev->prev, pt); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); break; } @@ -806,7 +804,6 @@ void PARTICLE_OT_target_move_up(wmOperatorType *ot) static int target_move_down_exec(bContext *C, wmOperator *op) { - Scene *scene= CTX_data_scene(C); PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= ptr.data; Object *ob = ptr.id.data; @@ -820,7 +817,7 @@ static int target_move_down_exec(bContext *C, wmOperator *op) BLI_remlink(&psys->targets, pt); BLI_insertlink(&psys->targets, pt->next, pt); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); break; } diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 71f8642afd4..5d1dbe47345 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -335,7 +335,6 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn) case ND_TRANSFORM: case ND_BONE_ACTIVE: case ND_BONE_SELECT: - case ND_GEOM_SELECT: case ND_CONSTRAINT: ED_area_tag_redraw(sa); break; @@ -346,6 +345,13 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn) break; } break; + case NC_GEOM: + switch(wmn->data) { + case ND_SELECT: + ED_area_tag_redraw(sa); + break; + } + break; case NC_MATERIAL: ED_area_tag_redraw(sa); @@ -358,14 +364,15 @@ static void buttons_area_listener(ScrArea *sa, wmNotifier *wmn) } break; case NC_WORLD: - ED_area_tag_redraw(sa); - sbuts->preview= 1; case NC_LAMP: - ED_area_tag_redraw(sa); - sbuts->preview= 1; case NC_TEXTURE: ED_area_tag_redraw(sa); sbuts->preview= 1; + break; + case NC_SPACE: + if(wmn->data == ND_SPACE_PROPERTIES) + ED_area_tag_redraw(sa); + break; } if(wmn->data == ND_KEYS) diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c index 48890d6cac2..7e0dfe94432 100644 --- a/source/blender/editors/space_console/space_console.c +++ b/source/blender/editors/space_console/space_console.c @@ -321,11 +321,11 @@ static void console_main_area_listener(ScrArea *sa, wmNotifier *wmn) /* context changes */ switch(wmn->category) { - case NC_CONSOLE: - if(wmn->data == ND_CONSOLE) { /* generic redraw request */ + case NC_SPACE: + if(wmn->data == ND_SPACE_CONSOLE) { /* generic redraw request */ ED_area_tag_redraw(sa); } - else if(wmn->data == ND_CONSOLE_REPORT && sc->type==CONSOLE_TYPE_REPORT) { + else if(wmn->data == ND_SPACE_CONSOLE_REPORT && sc->type==CONSOLE_TYPE_REPORT) { /* redraw also but only for report view, could do less redraws by checking the type */ ED_area_tag_redraw(sa); } diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index a06c1663d8e..e1a6e346ce2 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -190,9 +190,9 @@ static int file_border_select_exec(bContext *C, wmOperator *op) BLI_isect_rcti(&(ar->v2d.mask), &rect, &rect); if (FILE_SELECT_DIR == file_select(sfile, ar, &rect, val )) { - WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL); } else { - WM_event_add_notifier(C, NC_FILE|ND_PARAMS, NULL); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); } return OPERATOR_FINISHED; } @@ -239,12 +239,12 @@ static int file_select_invoke(bContext *C, wmOperator *op, wmEvent *event) file_deselect_all(sfile); if (FILE_SELECT_DIR == file_select(sfile, ar, &rect, val )) - WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL); else - WM_event_add_notifier(C, NC_FILE|ND_PARAMS, NULL); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); WM_event_add_mousemove(C); /* for directory changes */ - WM_event_add_notifier(C, NC_FILE|ND_PARAMS, NULL); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); return OPERATOR_FINISHED; } @@ -322,7 +322,7 @@ static int bookmark_select_invoke(bContext *C, wmOperator *op, wmEvent *event) BLI_cleanup_dir(G.sce, params->dir); file_change_dir(sfile); - WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL); } return OPERATOR_FINISHED; @@ -587,7 +587,7 @@ int file_parent_exec(bContext *C, wmOperator *unused) BLI_parent_dir(sfile->params->dir); BLI_cleanup_dir(G.sce, sfile->params->dir); file_change_dir(sfile); - WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL); } } @@ -614,7 +614,7 @@ int file_refresh_exec(bContext *C, wmOperator *unused) file_change_dir(sfile); - WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL); return OPERATOR_FINISHED; @@ -645,7 +645,7 @@ int file_previous_exec(bContext *C, wmOperator *unused) file_change_dir(sfile); } - WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL); return OPERATOR_FINISHED; } @@ -676,7 +676,7 @@ int file_next_exec(bContext *C, wmOperator *unused) file_change_dir(sfile); } - WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL); return OPERATOR_FINISHED; } @@ -705,7 +705,7 @@ int file_directory_new_exec(bContext *C, wmOperator *unused) BLI_strncpy(sfile->params->dir, filelist_dir(sfile->files), FILE_MAX); } } - WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL); return OPERATOR_FINISHED; } @@ -754,7 +754,7 @@ int file_directory_exec(bContext *C, wmOperator *unused) BLI_cleanup_dir(G.sce, sfile->params->dir); BLI_add_slash(sfile->params->dir); file_change_dir(sfile); - WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL); } @@ -769,7 +769,7 @@ int file_filename_exec(bContext *C, wmOperator *unused) if (file_select_match(sfile, sfile->params->file)) { sfile->params->file[0] = '\0'; - WM_event_add_notifier(C, NC_FILE|ND_PARAMS, NULL); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); } } @@ -796,7 +796,7 @@ int file_hidedot_exec(bContext *C, wmOperator *unused) sfile->params->flag ^= FILE_HIDE_DOT; filelist_free(sfile->files); sfile->params->active_file = -1; - WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL); } return OPERATOR_FINISHED; @@ -958,7 +958,7 @@ int file_delete_exec(bContext *C, wmOperator *op) file = filelist_file(sfile->files, sfile->params->active_file); BLI_make_file_string(G.sce, str, sfile->params->dir, file->relname); BLI_delete(str, 0, 0); - WM_event_add_notifier(C, NC_FILE | ND_FILELIST, NULL); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL); return OPERATOR_FINISHED; diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 793f7cf8815..722fa475727 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -212,14 +212,14 @@ static void file_listener(ScrArea *sa, wmNotifier *wmn) /* context changes */ switch(wmn->category) { - case NC_FILE: + case NC_SPACE: switch (wmn->data) { - case ND_FILELIST: + case ND_SPACE_FILE_LIST: if (sfile->files) filelist_free(sfile->files); ED_area_tag_refresh(sa); ED_area_tag_redraw(sa); break; - case ND_PARAMS: + case ND_SPACE_FILE_PARAMS: ED_area_tag_refresh(sa); ED_area_tag_redraw(sa); break; @@ -249,12 +249,12 @@ static void file_main_area_listener(ARegion *ar, wmNotifier *wmn) { /* context changes */ switch(wmn->category) { - case NC_FILE: + case NC_SPACE: switch (wmn->data) { - case ND_FILELIST: + case ND_SPACE_FILE_LIST: ED_region_tag_redraw(ar); break; - case ND_PARAMS: + case ND_SPACE_FILE_PARAMS: ED_region_tag_redraw(ar); break; } @@ -470,9 +470,9 @@ static void file_ui_area_listener(ARegion *ar, wmNotifier *wmn) { /* context changes */ switch(wmn->category) { - case NC_FILE: + case NC_SPACE: switch (wmn->data) { - case ND_FILELIST: + case ND_SPACE_FILE_LIST: ED_region_tag_redraw(ar); break; } diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 3717ccc8244..8887d464f30 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -423,6 +423,10 @@ static void graph_listener(ScrArea *sa, wmNotifier *wmn) }*/ ED_area_tag_refresh(sa); break; + case NC_SPACE: + if(wmn->data == ND_SPACE_GRAPH) + ED_area_tag_redraw(sa); + break; default: if(wmn->data==ND_KEYS) ED_area_tag_refresh(sa); diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index bb647e68917..c57bc5773b0 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -295,10 +295,14 @@ static void image_listener(ScrArea *sa, wmNotifier *wmn) case NC_IMAGE: ED_area_tag_redraw(sa); break; - case NC_OBJECT: + case NC_SPACE: + if(wmn->data == ND_SPACE_IMAGE) + ED_area_tag_redraw(sa); + break; + case NC_GEOM: switch(wmn->data) { - case ND_GEOM_SELECT: - case ND_GEOM_DATA: + case ND_DATA: + case ND_SELECT: ED_area_tag_redraw(sa); break; } @@ -625,7 +629,7 @@ void ED_space_image_set(bContext *C, SpaceImage *sima, Scene *scene, Object *obe if(C) { if(obedit) - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); ED_area_tag_redraw(CTX_wm_area(C)); } diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index b6f9cbeabb5..d3f9c97205c 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -167,8 +167,9 @@ static void info_header_listener(ARegion *ar, wmNotifier *wmn) if(wmn->data==ND_RENDER_RESULT) ED_region_tag_redraw(ar); break; - case NC_INFO: - ED_region_tag_redraw(ar); + case NC_SPACE: + if(wmn->data == ND_SPACE_INFO) + ED_region_tag_redraw(ar); break; } diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index c4f929274c7..89d4e7cddf2 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -488,6 +488,10 @@ static void nla_listener(ScrArea *sa, wmNotifier *wmn) }*/ ED_area_tag_refresh(sa); break; + case NC_SPACE: + if(wmn->data == ND_SPACE_NLA) + ED_area_tag_redraw(sa); + break; } } diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index 2233a4db3a0..d3a445b18c0 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -163,6 +163,15 @@ static void node_area_listener(ScrArea *sa, wmNotifier *wmn) if(wmn->data==ND_NODES) ED_area_tag_refresh(sa); break; + case NC_TEXT: + /* pynodes */ + if(wmn->data==ND_SHADING) + ED_area_tag_refresh(sa); + break; + case NC_SPACE: + if(wmn->data==ND_SPACE_NODE) + ED_area_tag_refresh(sa); + break; } } diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index a9a9a5dab5f..a3b47d505fd 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -1994,7 +1994,7 @@ static int tree_element_active_defgroup(bContext *C, Scene *scene, TreeElement * ob= (Object *)tselem->id; if(set) { ob->actdef= te->index+1; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, ob); } else { @@ -2121,7 +2121,7 @@ static int tree_element_active_psys(bContext *C, Scene *scene, TreeElement *te, if(set) { Object *ob= (Object *)tselem->id; - WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, ob); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, ob); // XXX extern_set_butspace(F7KEY, 0); } @@ -4682,7 +4682,7 @@ static void restrictbutton_modifier_cb(bContext *C, void *poin, void *poin2) Scene *scene = (Scene *)poin; Object *ob = (Object *)poin2; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); object_handle_update(scene, ob); WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, ob); diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index f57445a32f1..5058a167a29 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -137,6 +137,10 @@ static void outliner_main_area_listener(ARegion *ar, wmNotifier *wmn) /* all actions now, todo: check outliner view mode? */ ED_region_tag_redraw(ar); break; + case NC_SPACE: + if(wmn->data == ND_SPACE_OUTLINER) + ED_region_tag_redraw(ar); + break; } } @@ -190,6 +194,10 @@ static void outliner_header_area_listener(ARegion *ar, wmNotifier *wmn) if(wmn->data == ND_KEYINGSET) ED_region_tag_redraw(ar); break; + case NC_SPACE: + if(wmn->data == ND_SPACE_OUTLINER) + ED_region_tag_redraw(ar); + break; } } diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index 084416f3a60..26ffd88ae67 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -219,6 +219,10 @@ static void sequencer_main_area_listener(ARegion *ar, wmNotifier *wmn) break; } break; + case NC_SPACE: + if(wmn->data == ND_SPACE_SEQUENCER) + ED_region_tag_redraw(ar); + break; } } @@ -241,6 +245,10 @@ static void sequencer_buttons_area_listener(ARegion *ar, wmNotifier *wmn) { /* context changes */ switch(wmn->category) { + case NC_SPACE: + if(wmn->data == ND_SPACE_SEQUENCER) + ED_region_tag_redraw(ar); + break; } } @@ -293,6 +301,7 @@ void ED_spacetype_sequencer(void) art->init= sequencer_header_area_init; art->draw= sequencer_header_area_draw; + art->listener= sequencer_main_area_listener; BLI_addhead(&st->regiontypes, art); diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index 4394fbfe1f5..0d08490cfb0 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -143,6 +143,10 @@ static void text_listener(ScrArea *sa, wmNotifier *wmn) ED_area_tag_redraw(sa); break; + case NC_SPACE: + if(wmn->data == ND_SPACE_TEXT) + ED_area_tag_redraw(sa); + break; } } diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 14b72e13856..a8ef72e3273 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -549,7 +549,6 @@ static int refresh_pyconstraints_exec(bContext *C, wmOperator *op) { #ifndef DISABLE_PYTHON Text *text= CTX_data_edit_text(C); - Scene *scene= CTX_data_scene(C); Object *ob; bConstraint *con; short update; @@ -579,7 +578,7 @@ static int refresh_pyconstraints_exec(bContext *C, wmOperator *op) } if(update) { - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } } #endif diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c index ce6846a4489..8f7486f81d9 100644 --- a/source/blender/editors/space_time/space_time.c +++ b/source/blender/editors/space_time/space_time.c @@ -260,6 +260,11 @@ static void time_main_area_listener(ARegion *ar, wmNotifier *wmn) { /* context changes */ switch(wmn->category) { + case NC_SPACE: + if(wmn->data == ND_SPACE_TIME) + ED_region_tag_redraw(ar); + break; + case NC_ANIMATION: ED_region_tag_redraw(ar); break; @@ -293,6 +298,7 @@ static void time_header_area_listener(ARegion *ar, wmNotifier *wmn) if(wmn->data==ND_ANIMPLAY) ED_region_tag_redraw(ar); break; + case NC_SCENE: switch (wmn->data) { case ND_FRAME: @@ -300,6 +306,11 @@ static void time_header_area_listener(ARegion *ar, wmNotifier *wmn) ED_region_tag_redraw(ar); break; } + + case NC_SPACE: + if(wmn->data == ND_SPACE_TIME) + ED_region_tag_redraw(ar); + break; } } diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 97c5549e1ea..2250c2e7718 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -452,16 +452,24 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn) case ND_BONE_ACTIVE: case ND_BONE_SELECT: case ND_TRANSFORM: - case ND_GEOM_SELECT: - case ND_GEOM_DATA: case ND_DRAW: case ND_MODIFIER: case ND_CONSTRAINT: case ND_KEYS: - case ND_PARTICLE: + case ND_PARTICLE_SELECT: + case ND_PARTICLE_DATA: ED_region_tag_redraw(ar); break; } + break; + case NC_GEOM: + switch(wmn->data) { + case ND_DATA: + case ND_SELECT: + ED_region_tag_redraw(ar); + break; + } + break; case NC_GROUP: /* all group ops for now */ ED_region_tag_redraw(ar); @@ -483,6 +491,10 @@ static void view3d_main_area_listener(ARegion *ar, wmNotifier *wmn) * more context than just the region */ ED_region_tag_redraw(ar); break; + case NC_SPACE: + if(wmn->data == ND_SPACE_VIEW3D) + ED_region_tag_redraw(ar); + break; } } @@ -528,6 +540,10 @@ static void view3d_header_area_listener(ARegion *ar, wmNotifier *wmn) break; } break; + case NC_SPACE: + if(wmn->data == ND_SPACE_VIEW3D) + ED_region_tag_redraw(ar); + break; } } @@ -576,13 +592,24 @@ static void view3d_buttons_area_listener(ARegion *ar, wmNotifier *wmn) case ND_BONE_ACTIVE: case ND_BONE_SELECT: case ND_TRANSFORM: - case ND_GEOM_SELECT: - case ND_GEOM_DATA: case ND_DRAW: case ND_KEYS: ED_region_tag_redraw(ar); break; } + break; + case NC_GEOM: + switch(wmn->data) { + case ND_DATA: + case ND_SELECT: + ED_region_tag_redraw(ar); + break; + } + break; + case NC_SPACE: + if(wmn->data == ND_SPACE_VIEW3D) + ED_region_tag_redraw(ar); + break; } } diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 7c305d59866..c854de8e54d 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -660,7 +660,7 @@ static void do_view3d_region_buttons(bContext *C, void *arg, int event) return; /* no notifier! */ case B_OBJECTPANEL: - DAG_object_flush_update(scene, ob, OB_RECALC_OB); + DAG_id_flush_update(&ob->id, OB_RECALC_OB); break; case B_OBJECTPANELROT: @@ -668,7 +668,7 @@ static void do_view3d_region_buttons(bContext *C, void *arg, int event) ob->rot[0]= M_PI*tfp->ob_eul[0]/180.0; ob->rot[1]= M_PI*tfp->ob_eul[1]/180.0; ob->rot[2]= M_PI*tfp->ob_eul[2]/180.0; - DAG_object_flush_update(scene, ob, OB_RECALC_OB); + DAG_id_flush_update(&ob->id, OB_RECALC_OB); } break; @@ -706,7 +706,7 @@ static void do_view3d_region_buttons(bContext *C, void *arg, int event) VECCOPY(ob->size, tfp->ob_scale); } - DAG_object_flush_update(scene, ob, OB_RECALC_OB); + DAG_id_flush_update(&ob->id, OB_RECALC_OB); } break; @@ -752,14 +752,14 @@ static void do_view3d_region_buttons(bContext *C, void *arg, int event) /* prevent multiple B_OBJECTPANELDIMS events to keep scaling, cycling with TAB on buttons can cause that */ VECCOPY(tfp->ob_dims, old_dims); - DAG_object_flush_update(scene, ob, OB_RECALC_OB); + DAG_id_flush_update(&ob->id, OB_RECALC_OB); } break; case B_OBJECTPANELMEDIAN: if(ob) { v3d_editvertex_buts(C, NULL, v3d, ob, 1.0); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } break; @@ -770,7 +770,7 @@ static void do_view3d_region_buttons(bContext *C, void *arg, int event) ob->parent= NULL; else { DAG_scene_sort(scene); - DAG_object_flush_update(scene, ob, OB_RECALC_OB); + DAG_id_flush_update(&ob->id, OB_RECALC_OB); } } break; @@ -847,7 +847,7 @@ static void do_view3d_region_buttons(bContext *C, void *arg, int event) case B_ARMATUREPANEL2: { ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } break; case B_TRANSFORMSPACEADD: @@ -900,7 +900,7 @@ static void do_view3d_region_buttons(bContext *C, void *arg, int event) int a; for(a=0; atotvert; a++) remove_vert_defgroup (ob, defGroup, a); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } } break; diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 305b6956037..2283d36e018 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -1725,7 +1725,7 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event) em->selectmode= SCE_SELECT_VERTEX; ts->selectmode= em->selectmode; EM_selectmode_set(em); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); ED_undo_push(C, "Selectmode Set: Vertex"); } break; @@ -1739,7 +1739,7 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event) } ts->selectmode= em->selectmode; EM_selectmode_set(em); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); ED_undo_push(C, "Selectmode Set: Edge"); } break; @@ -1753,7 +1753,7 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event) } ts->selectmode= em->selectmode; EM_selectmode_set(em); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); ED_undo_push(C, "Selectmode Set: Face"); } break; diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 7743ede399b..5c6a22f5157 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1359,7 +1359,7 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op) vc.em= me->edit_mesh; do_mesh_box_select(&vc, &rect, (val==LEFTMOUSE)); // if (EM_texFaceCheck()) - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); } else if(ELEM(obedit->type, OB_CURVE, OB_SURF)) { @@ -1802,7 +1802,7 @@ static int view3d_circle_select_exec(bContext *C, wmOperator *op) if(CTX_data_edit_object(C)) { obedit_circle_select(&vc, selecting, mval, (float)radius); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obact); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obact->data); } else return PE_circle_select(C, selecting, mval, (float)radius); diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index 335bc2c9e56..2e5696170e2 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -106,7 +106,7 @@ static void special_transvert_update(Scene *scene, Object *obedit) if(obedit) { - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); if(obedit->type==OB_MESH) { Mesh *me= obedit->data; @@ -514,7 +514,7 @@ static int snap_sel_to_grid(bContext *C, wmOperator *op) /* auto-keyframing */ // XXX autokeyframe_pose_cb_func(ob, TFM_TRANSLATION, 0); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } else { ob->recalc |= OB_RECALC_OB; @@ -640,7 +640,7 @@ static int snap_sel_to_curs(bContext *C, wmOperator *op) /* auto-keyframing */ // XXX autokeyframe_pose_cb_func(ob, TFM_TRANSLATION, 0); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } else { ob->recalc |= OB_RECALC_OB; @@ -1028,7 +1028,7 @@ static int snap_selected_to_center(bContext *C, wmOperator *op) /* auto-keyframing */ ob->pose->flag |= POSE_DO_UNLOCK; // XXX autokeyframe_pose_cb_func(ob, TFM_TRANSLATION, 0); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } else { ob->recalc |= OB_RECALC_OB; diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index f0de28476f0..370e98ebd07 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -333,7 +333,7 @@ static void viewRedrawForce(bContext *C, TransInfo *t) else force_draw(0); #endif - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, t->obedit); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, t->obedit->data); } } diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 302d9b675a0..0fce9592d1d 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -4722,9 +4722,9 @@ void special_aftertrans_update(TransInfo *t) ob->ctime= -1234567.0f; if (ob->pose || ob_get_key(ob)) - DAG_object_flush_update(scene, ob, OB_RECALC); + DAG_id_flush_update(&ob->id, OB_RECALC); else - DAG_object_flush_update(scene, ob, OB_RECALC_OB); + DAG_id_flush_update(&ob->id, OB_RECALC_OB); } /* Do curve cleanups? */ @@ -4748,7 +4748,7 @@ void special_aftertrans_update(TransInfo *t) } #endif // XXX old animation system - DAG_object_flush_update(scene, OBACT, OB_RECALC_DATA); + DAG_id_flush_update(&OBACT->id, OB_RECALC_DATA); } #if 0 // XXX future of this is still not clear else if (ac.datatype == ANIMCONT_GPENCIL) { @@ -4912,15 +4912,15 @@ void special_aftertrans_update(TransInfo *t) /* automatic inserting of keys and unkeyed tagging - only if transform wasn't cancelled (or TFM_DUMMY) */ if (!cancelled && (t->mode != TFM_DUMMY)) { autokeyframe_pose_cb_func(t->scene, (View3D *)t->view, ob, t->mode, targetless_ik); - DAG_object_flush_update(t->scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } else if (arm->flag & ARM_DELAYDEFORM) { /* old optimize trick... this enforces to bypass the depgraph */ - DAG_object_flush_update(t->scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); ob->recalc= 0; // is set on OK position already by recalcData() } else - DAG_object_flush_update(t->scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); //if (t->mode==TFM_BONESIZE || t->mode==TFM_BONE_ENVELOPE) // allqueue(REDRAWBUTSEDIT, 0); @@ -4948,7 +4948,7 @@ void special_aftertrans_update(TransInfo *t) /* Creates troubles for moving animated objects without */ /* autokey though, probably needed is an anim sys override? */ /* Please remove if some other solution is found. -jahka */ - DAG_object_flush_update(scene, ob, OB_RECALC_OB); + DAG_id_flush_update(&ob->id, OB_RECALC_OB); /* Set autokey if necessary */ if (!cancelled) diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 0f715f1d35a..0b7029adde0 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -283,7 +283,7 @@ static void animedit_refresh_id_tags (Scene *scene, ID *id) case ID_OB: { Object *ob= (Object *)id; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); /* sets recalc flags */ + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); /* sets recalc flags */ } break; } @@ -621,7 +621,7 @@ void recalcData(TransInfo *t) Curve *cu= t->obedit->data; Nurb *nu= cu->editnurb->first; - DAG_object_flush_update(scene, t->obedit, OB_RECALC_DATA); /* sets recalc flags */ + DAG_id_flush_update(t->obedit->data, OB_RECALC_DATA); /* sets recalc flags */ if (t->state == TRANS_CANCEL) { while(nu) { @@ -641,7 +641,7 @@ void recalcData(TransInfo *t) } else if(t->obedit->type==OB_LATTICE) { Lattice *la= t->obedit->data; - DAG_object_flush_update(scene, t->obedit, OB_RECALC_DATA); /* sets recalc flags */ + DAG_id_flush_update(t->obedit->data, OB_RECALC_DATA); /* sets recalc flags */ if(la->editlatt->flag & LT_OUTSIDE) outside_lattice(la->editlatt); } @@ -653,7 +653,7 @@ void recalcData(TransInfo *t) if(sima->flag & SI_LIVE_UNWRAP) ED_uvedit_live_unwrap_re_solve(); - DAG_object_flush_update(scene, t->obedit, OB_RECALC_DATA); + DAG_id_flush_update(t->obedit->data, OB_RECALC_DATA); } else { EditMesh *em = ((Mesh*)t->obedit->data)->edit_mesh; /* mirror modifier clipping? */ @@ -668,7 +668,7 @@ void recalcData(TransInfo *t) if((t->options & CTX_NO_MIRROR) == 0 && (t->flag & T_MIRROR)) editmesh_apply_to_mirror(t); - DAG_object_flush_update(scene, t->obedit, OB_RECALC_DATA); /* sets recalc flags */ + DAG_id_flush_update(t->obedit->data, OB_RECALC_DATA); /* sets recalc flags */ recalc_editnormals(em); } @@ -752,7 +752,7 @@ void recalcData(TransInfo *t) } else - DAG_object_flush_update(scene, t->obedit, OB_RECALC_DATA); /* sets recalc flags */ + DAG_id_flush_update(t->obedit->data, OB_RECALC_DATA); /* sets recalc flags */ } else if( (t->flag & T_POSE) && t->poseobj) { Object *ob= t->poseobj; @@ -772,7 +772,7 @@ void recalcData(TransInfo *t) /* old optimize trick... this enforces to bypass the depgraph */ if (!(arm->flag & ARM_DELAYDEFORM)) { - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); /* sets recalc flags */ + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); /* sets recalc flags */ } else where_is_pose(scene, ob); diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index 17a1e0b6cdb..2d73a9f1d25 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -267,7 +267,7 @@ void undo_editmode_step(bContext *C, int step) } } -// DAG_object_flush_update(G.scene, obedit, OB_RECALC_DATA); +// DAG_id_flush_update(&obedit->id, OB_RECALC_DATA); /* XXX notifiers */ } diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index bb5a8b1dd40..a44421e8145 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -139,7 +139,7 @@ void ED_uvedit_assign_image(Scene *scene, Object *obedit, Image *ima, Image *pre /* and update depdency graph */ if(update) - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); BKE_mesh_end_editmesh(obedit->data, em); } @@ -169,8 +169,8 @@ void ED_uvedit_set_tile(bContext *C, Scene *scene, Object *obedit, Image *ima, i tf->tile= curtile; /* set tile index */ } - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); } @@ -1058,8 +1058,8 @@ static void weld_align_uv(bContext *C, int tool) } } - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); } @@ -1279,8 +1279,8 @@ static int stitch_exec(bContext *C, wmOperator *op) MEM_freeN(uv_average); } - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -1336,7 +1336,7 @@ static int select_inverse_exec(bContext *C, wmOperator *op) } } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -1406,7 +1406,7 @@ static int de_select_all_exec(bContext *C, wmOperator *op) } } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -1710,8 +1710,8 @@ static int mouse_select(bContext *C, float co[2], int extend, int loop) } } - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_PASS_THROUGH|OPERATOR_FINISHED; @@ -1834,8 +1834,8 @@ static int select_linked_exec(bContext *C, wmOperator *op) uvedit_pixel_to_float(sima, limit, 0.05f); select_linked(scene, ima, em, limit, NULL, extend); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -1890,8 +1890,8 @@ static int unlink_selection_exec(bContext *C, wmOperator *op) } } - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -2167,7 +2167,7 @@ static int border_select_exec(bContext *C, wmOperator *op) } } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -2262,7 +2262,7 @@ int circle_select_exec(bContext *C, wmOperator *op) if(select) EM_select_flush(em); else EM_deselect_flush(em); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -2567,8 +2567,8 @@ static int snap_selection_exec(bContext *C, wmOperator *op) if(!change) return OPERATOR_CANCELLED; - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); return OPERATOR_FINISHED; } @@ -2627,7 +2627,7 @@ static int pin_exec(bContext *C, wmOperator *op) } } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -2672,7 +2672,7 @@ static int select_pinned_exec(bContext *C, wmOperator *op) } } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -2704,7 +2704,7 @@ static int hide_exec(bContext *C, wmOperator *op) if(ts->uv_flag & UV_SYNC_SELECTION) { EM_hide_mesh(em, swap); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -2812,7 +2812,7 @@ static int hide_exec(bContext *C, wmOperator *op) } EM_validate_selections(em); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -2847,7 +2847,7 @@ static int reveal_exec(bContext *C, wmOperator *op) /* call the mesh function if we are in mesh sync sel */ if(ts->uv_flag & UV_SYNC_SELECTION) { EM_reveal_mesh(em); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -2943,7 +2943,7 @@ static int reveal_exec(bContext *C, wmOperator *op) EM_select_face(efa, 1); } - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit); + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index c4f4704e47e..c18c9f8e022 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -263,8 +263,8 @@ static void minimize_stretch_iteration(bContext *C, wmOperator *op, int interact ms->lasttime = PIL_check_seconds_timer(); - DAG_object_flush_update(ms->scene, ms->obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ms->obedit); + DAG_id_flush_update(ms->obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, ms->obedit->data); } } @@ -286,8 +286,8 @@ static void minimize_stretch_exit(bContext *C, wmOperator *op, int cancel) param_stretch_end(ms->handle); param_delete(ms->handle); - DAG_object_flush_update(ms->scene, ms->obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ms->obedit); + DAG_id_flush_update(ms->obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, ms->obedit->data); MEM_freeN(ms); op->customdata= NULL; @@ -413,8 +413,8 @@ static int pack_islands_exec(bContext *C, wmOperator *op) param_flush(handle); param_delete(handle); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -446,8 +446,8 @@ static int average_islands_scale_exec(bContext *C, wmOperator *op) param_flush(handle); param_delete(handle); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -810,8 +810,8 @@ static int unwrap_exec(bContext *C, wmOperator *op) param_delete(handle); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -943,8 +943,8 @@ static int from_view_exec(bContext *C, wmOperator *op) uv_map_clip_correct(em, op); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -1010,8 +1010,8 @@ static int reset_exec(bContext *C, wmOperator *op) } } - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -1098,8 +1098,8 @@ static int sphere_project_exec(bContext *C, wmOperator *op) uv_map_clip_correct(em, op); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -1170,8 +1170,8 @@ static int cylinder_project_exec(bContext *C, wmOperator *op) uv_map_clip_correct(em, op); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; @@ -1257,8 +1257,8 @@ static int cube_project_exec(bContext *C, wmOperator *op) uv_map_clip_correct(em, op); - DAG_object_flush_update(scene, obedit, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit); + DAG_id_flush_update(obedit->data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, obedit->data); BKE_mesh_end_editmesh(obedit->data, em); return OPERATOR_FINISHED; diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index 7bab7947843..3f4b75508fe 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -48,29 +48,17 @@ static void rna_Armature_update_data(bContext *C, PointerRNA *ptr) { - Main *bmain= CTX_data_main(C); - Scene *scene= CTX_data_scene(C); ID *id= ptr->id.data; - Object *ob; - for(ob=bmain->object.first; ob; ob= ob->id.next) { - if(ob->data == id) { - /* XXX this will loop over all objects again (slow) */ - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); - } - } + DAG_id_flush_update(id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, id); } static void rna_Armature_redraw_data(bContext *C, PointerRNA *ptr) { - Main *bmain= CTX_data_main(C); ID *id= ptr->id.data; - Object *ob; - for(ob=bmain->object.first; ob; ob= ob->id.next) - if(ob->data == id) - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, id); } static void rna_bone_layer_set(short *layer, const int *values) diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c index 0c5565e253a..8002aa89313 100644 --- a/source/blender/makesrna/intern/rna_boid.c +++ b/source/blender/makesrna/intern/rna_boid.c @@ -41,6 +41,7 @@ #include "DNA_object_types.h" #include "DNA_particle_types.h" +#include "WM_api.h" #include "WM_types.h" EnumPropertyItem boidrule_type_items[] ={ @@ -82,14 +83,15 @@ static void rna_Boids_reset(bContext *C, PointerRNA *ptr) psys->recalc = PSYS_RECALC_RESET; - if(ob) { - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - } + if(ob) + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } else { part = ptr->id.data; psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET); } + + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL); } static void rna_Boids_reset_deps(bContext *C, PointerRNA *ptr) { @@ -102,15 +104,16 @@ static void rna_Boids_reset_deps(bContext *C, PointerRNA *ptr) psys->recalc = PSYS_RECALC_RESET; - if(ob) { - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - } + if(ob) + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } else { part = ptr->id.data; psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET); DAG_scene_sort(scene); } + + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL); } static StructRNA* rna_BoidRule_refine(struct PointerRNA *ptr) @@ -247,12 +250,12 @@ static void rna_def_boidrule_goal(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "ob"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Object", "Goal object."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset_deps"); + RNA_def_property_update(prop, 0, "rna_Boids_reset_deps"); prop= RNA_def_property(srna, "predict", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_GOAL_AVOID_PREDICT); RNA_def_property_ui_text(prop, "Predict", "Predict target movement."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); } static void rna_def_boidrule_avoid(BlenderRNA *brna) @@ -268,17 +271,17 @@ static void rna_def_boidrule_avoid(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "ob"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Object", "Object to avoid."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset_deps"); + RNA_def_property_update(prop, 0, "rna_Boids_reset_deps"); prop= RNA_def_property(srna, "predict", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_GOAL_AVOID_PREDICT); RNA_def_property_ui_text(prop, "Predict", "Predict target movement."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "fear_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Fear factor", "Avoid object if danger from it is above this threshol."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); } static void rna_def_boidrule_avoid_collision(BlenderRNA *brna) @@ -292,17 +295,17 @@ static void rna_def_boidrule_avoid_collision(BlenderRNA *brna) prop= RNA_def_property(srna, "boids", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_ACOLL_WITH_BOIDS); RNA_def_property_ui_text(prop, "Boids", "Avoid collision with other boids."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "deflectors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_ACOLL_WITH_DEFLECTORS); RNA_def_property_ui_text(prop, "Deflectors", "Avoid collision with deflector objects."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "look_ahead", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Look ahead", "Time to look ahead in seconds."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); } static void rna_def_boidrule_follow_leader(BlenderRNA *brna) @@ -317,22 +320,22 @@ static void rna_def_boidrule_follow_leader(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "ob"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Object", "Follow this object instead of a boid."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset_deps"); + RNA_def_property_update(prop, 0, "rna_Boids_reset_deps"); prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Distance", "Distance behind leader to follow."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "queue_size", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Queue Size", "How many boids in a line."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "line", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "options", BRULE_LEADER_IN_LINE); RNA_def_property_ui_text(prop, "Line", "Follow leader in a line."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); } static void rna_def_boidrule_average_speed(BlenderRNA *brna) @@ -346,17 +349,17 @@ static void rna_def_boidrule_average_speed(BlenderRNA *brna) prop= RNA_def_property(srna, "wander", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Wander", "How fast velocity's direction is randomized."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "level", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Level", "How much velocity's z-component is kept constant."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Speed", "Percentage of maximum speed."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); } static void rna_def_boidrule_fight(BlenderRNA *brna) @@ -370,12 +373,12 @@ static void rna_def_boidrule_fight(BlenderRNA *brna) prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Fight Distance", "Attack boids at max this distance."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "flee_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Flee Distance", "Flee to this distance."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); } static void rna_def_boidrule(BlenderRNA *brna) @@ -405,12 +408,12 @@ static void rna_def_boidrule(BlenderRNA *brna) prop= RNA_def_property(srna, "in_air", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BOIDRULE_IN_AIR); RNA_def_property_ui_text(prop, "In Air", "Use rule when boid is flying."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "on_land", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BOIDRULE_ON_LAND); RNA_def_property_ui_text(prop, "On Land", "Use rule when boid is on land."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); //prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE); //RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Expanded); @@ -457,17 +460,17 @@ static void rna_def_boidstate(BlenderRNA *brna) prop= RNA_def_property(srna, "rule_fuzziness", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Rule Fuzzines", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_ui_text(prop, "Volume", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_ui_text(prop, "Falloff", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); } static void rna_def_boid_settings(BlenderRNA *brna) { @@ -480,17 +483,17 @@ static void rna_def_boid_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "landing_smoothness", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_ui_text(prop, "Landing Smoothness", "How smoothly the boids land."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "banking", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 2.0); RNA_def_property_ui_text(prop, "Banking", "Amount of rotation around velocity vector on turns."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 2.0); RNA_def_property_ui_text(prop, "Height", "Boid height relative to particle size."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); /* states */ prop= RNA_def_property(srna, "states", PROP_COLLECTION, PROP_NONE); @@ -510,99 +513,99 @@ static void rna_def_boid_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "health", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_ui_text(prop, "Health", "Initial boid health when born."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_ui_text(prop, "Strength", "Maximum caused damage on attack per second."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "aggression", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_ui_text(prop, "Aggression", "Boid will fight this times stronger enemy."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "accuracy", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Accuracy", "Accuracy of attack."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_ui_text(prop, "Range", "The maximum distance from which a boid can attack."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); /* physical properties */ prop= RNA_def_property(srna, "air_min_speed", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Min Air Speed", "Minimum speed in air (relative to maximum speed)."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "air_max_speed", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_ui_text(prop, "Max Air Speed", "Maximum speed in air."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "air_max_acc", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Max Air Acceleration", "Maximum acceleration in air (relative to maximum speed)."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "air_max_ave", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Max Air Angular Velocity", "Maximum angular velocity in air (relative to 180 degrees)."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "air_personal_space", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_ui_text(prop, "Air Personal Space", "Radius of boids personal space in air (% of particle size)."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "land_jump_speed", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_ui_text(prop, "Jump Speed", "Maximum speed for jumping."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "land_max_speed", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_ui_text(prop, "Max Land Speed", "Maximum speed on land."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "land_max_acc", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Max Land Acceleration", "Maximum acceleration on land (relative to maximum speed)."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "land_max_ave", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Max Land Angular Velocity", "Maximum angular velocity on land (relative to 180 degrees)."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "land_personal_space", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_ui_text(prop, "Land Personal Space", "Radius of boids personal space on land (% of particle size)."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "land_stick_force", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 1000.0); RNA_def_property_ui_text(prop, "Land Stick Force", "How strong a force must be to start effecting a boid on land."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); /* options */ prop= RNA_def_property(srna, "allow_flight", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "options", BOID_ALLOW_FLIGHT); RNA_def_property_ui_text(prop, "Allow Flight", "Allow boids to move in air."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "allow_land", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "options", BOID_ALLOW_LAND); RNA_def_property_ui_text(prop, "Allow Land", "Allow boids to move on land."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop= RNA_def_property(srna, "allow_climb", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "options", BOID_ALLOW_CLIMB); RNA_def_property_ui_text(prop, "Allow Climbing", "Allow boids to climb goal objects."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Boids_reset"); + RNA_def_property_update(prop, 0, "rna_Boids_reset"); } void RNA_def_boid(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c index 9096bfc2844..38086502d6f 100644 --- a/source/blender/makesrna/intern/rna_cloth.c +++ b/source/blender/makesrna/intern/rna_cloth.c @@ -37,6 +37,7 @@ #include "DNA_object_types.h" #include "DNA_scene_types.h" +#include "WM_api.h" #include "WM_types.h" #ifdef RNA_RUNTIME @@ -46,10 +47,10 @@ static void rna_cloth_update(bContext *C, PointerRNA *ptr) { - Scene *scene = CTX_data_scene(C); - Object *ob = ptr->id.data; + Object *ob= (Object*)ptr->id.data; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); } static void rna_ClothSettings_max_bend_set(struct PointerRNA *ptr, float value) @@ -180,50 +181,50 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "mingoal"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Goal Minimum", "Goal minimum, vertex group weights are scaled to match this range."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "goal_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "maxgoal"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Goal Maximum", "Goal maximum, vertex group weights are scaled to match this range."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "goal_default", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "defgoal"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Goal Default", "Default Goal (vertex target position) value, when no Vertex Group used."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "goal_spring", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "goalspring"); RNA_def_property_range(prop, 0.0f, 0.999f); RNA_def_property_ui_text(prop, "Goal Stiffness", "Goal (vertex target position) spring stiffness."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "goal_friction", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "goalfrict"); RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_ui_text(prop, "Goal Damping", "Goal (vertex target position) friction."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); /* mass */ prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Mass", "Mass of cloth material."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "mass_vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_ClothSettings_mass_vgroup_get", "rna_ClothSettings_mass_vgroup_length", "rna_ClothSettings_mass_vgroup_set"); RNA_def_property_ui_text(prop, "Mass Vertex Group", "Vertex Group for pinning of vertices."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION); RNA_def_property_array(prop, 3); RNA_def_property_range(prop, -100.0, 100.0); RNA_def_property_float_funcs(prop, "rna_ClothSettings_gravity_get", "rna_ClothSettings_gravity_set", NULL); RNA_def_property_ui_text(prop, "Gravity", "Gravity or external force vector."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); /* various */ @@ -231,73 +232,73 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "Cvi"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Air Damping", "Air has normally some thickness which slows falling things down."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "pin_cloth", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_GOAL); RNA_def_property_ui_text(prop, "Pin Cloth", "Enable pinning of cloth vertices to other objects/positions."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "pin_stiffness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "goalspring"); RNA_def_property_range(prop, 0.0f, 50.0); RNA_def_property_ui_text(prop, "Pin Stiffness", "Pin (vertex target position) spring stiffness."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "quality", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "stepsPerFrame"); RNA_def_property_range(prop, 4, 80); RNA_def_property_ui_text(prop, "Quality", "Quality of the simulation in steps per frame. (higher is better quality but slower)"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); /* springs */ prop= RNA_def_property(srna, "stiffness_scaling", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_SCALING); RNA_def_property_ui_text(prop, "Stiffness Scaling", "If enabled, stiffness can be scaled along a weight painted vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "spring_damping", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "Cdis"); RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_ui_text(prop, "Spring Damping", "Damping of cloth velocity. (higher = more smooth, less jiggling)"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "structural_stiffness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "structural"); RNA_def_property_range(prop, 1.0f, 10000.0f); RNA_def_property_ui_text(prop, "Structural Stiffness", "Overall stiffness of structure."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "structural_stiffness_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max_struct"); RNA_def_property_range(prop, 0.0f, 10000.0f); RNA_def_property_float_funcs(prop, NULL, "rna_ClothSettings_max_struct_set", NULL); RNA_def_property_ui_text(prop, "Structural Stiffness Maximum", "Maximum structural stiffness value."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "structural_stiffness_vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_ClothSettings_struct_vgroup_get", "rna_ClothSettings_struct_vgroup_length", "rna_ClothSettings_struct_vgroup_set"); RNA_def_property_ui_text(prop, "Structural Stiffness Vertex Group", "Vertex group for fine control over structural stiffness."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "bending_stiffness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bending"); RNA_def_property_range(prop, 0.0f, 10000.0f); RNA_def_property_ui_text(prop, "Bending Stiffness", "Wrinkle coefficient. (higher = less smaller but more big wrinkles)"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "bending_stiffness_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max_bend"); RNA_def_property_range(prop, 0.0f, 10000.0f); RNA_def_property_float_funcs(prop, NULL, "rna_ClothSettings_max_bend_set", NULL); RNA_def_property_ui_text(prop, "Bending Stiffness Maximum", "Maximum bending stiffness value."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "bending_vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_ClothSettings_bend_vgroup_get", "rna_ClothSettings_bend_vgroup_length", "rna_ClothSettings_bend_vgroup_set"); RNA_def_property_ui_text(prop, "Bending Stiffness Vertex Group", "Vertex group for fine control over bending stiffness."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); /* unused */ @@ -358,48 +359,48 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "enable_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_COLLSETTINGS_FLAG_ENABLED); RNA_def_property_ui_text(prop, "Enable Collision", "Enable collisions with other objects."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "min_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "epsilon"); RNA_def_property_range(prop, 0.001f, 1.0f); RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance between collision objects before collision response takes in."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "friction", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 80.0f); RNA_def_property_ui_text(prop, "Friction", "Friction force if a collision happened. (higher = less movement)"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "collision_quality", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "loop_count"); RNA_def_property_range(prop, 1, 20); RNA_def_property_ui_text(prop, "Collision Quality", "How many collision iterations should be done. (higher is better quality but slower)"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); /* self collision */ prop= RNA_def_property(srna, "enable_self_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_COLLSETTINGS_FLAG_SELF); RNA_def_property_ui_text(prop, "Enable Self Collision", "Enable self collisions."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "self_min_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "selfepsilon"); RNA_def_property_range(prop, 0.5f, 1.0f); RNA_def_property_ui_text(prop, "Self Minimum Distance", "0.5 means no distance at all, 1.0 is maximum distance."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "self_friction", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 80.0f); RNA_def_property_ui_text(prop, "Self Friction", "Friction/damping with self contact."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "self_collision_quality", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "self_loop_count"); RNA_def_property_range(prop, 1, 10); RNA_def_property_ui_text(prop, "Self Collision Quality", "How many self collision iterations should be done. (higher is better quality but slower)"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_cloth_update"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); } void RNA_def_cloth(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index a8dc0454cef..c09a71f752a 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -160,15 +160,14 @@ static char *rna_Constraint_path(PointerRNA *ptr) static void rna_Constraint_update(bContext *C, PointerRNA *ptr) { - Scene *scene= CTX_data_scene(C); Object *ob= ptr->id.data; if(ob->pose) update_pose_constraint_flags(ob->pose); object_test_constraints(ob); - if(ob->type==OB_ARMATURE) DAG_object_flush_update(scene, ob, OB_RECALC_DATA|OB_RECALC_OB); - else DAG_object_flush_update(scene, ob, OB_RECALC_OB); + if(ob->type==OB_ARMATURE) DAG_id_flush_update(&ob->id, OB_RECALC_DATA|OB_RECALC_OB); + else DAG_id_flush_update(&ob->id, OB_RECALC_OB); } static void rna_Constraint_dependency_update(bContext *C, PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 503ca031fb6..d19a2289490 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -156,21 +156,10 @@ static void rna_BPoint_array_begin(CollectionPropertyIterator *iter, PointerRNA static void rna_Curve_update_data(bContext *C, PointerRNA *ptr) { - Main *bmain= CTX_data_main(C); - Scene *scene= CTX_data_scene(C); - Curve *cu= ptr->id.data; - Object *ob; + ID *id= ptr->id.data; - if (cu == NULL) - return; - - for(ob=bmain->object.first; ob; ob= ob->id.next) { - if(ob->data == cu) { - /* XXX this will loop over all objects again (slow) */ - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); - } - } + DAG_id_flush_update(id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, id); } #else diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 1f51b3ff34c..69e6698bd3b 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -2559,13 +2559,14 @@ void RNA_def_property_free_pointers(PropertyRNA *prop) } case PROP_ENUM: { EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop; - if(eprop->item) MEM_freeN((void*)eprop->item); for(a=0; atotitem; a++) { if(eprop->item[a].identifier) MEM_freeN((void*)eprop->item[a].identifier); if(eprop->item[a].name) MEM_freeN((void*)eprop->item[a].name); if(eprop->item[a].description) MEM_freeN((void*)eprop->item[a].description); } + + if(eprop->item) MEM_freeN((void*)eprop->item); break; } case PROP_STRING: { diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c index dda21f63528..a62002365c9 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -72,10 +72,17 @@ static StructRNA* rna_FluidSettings_refine(struct PointerRNA *ptr) } } +static void rna_fluid_update(bContext *C, PointerRNA *ptr) +{ + Object *ob= ptr->id.data; + + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); +} + static void rna_FluidSettings_update_type(bContext *C, PointerRNA *ptr) { Main *bmain= CTX_data_main(C); - Scene *scene= CTX_data_scene(C); Object *ob= (Object*)ptr->id.data; FluidsimModifierData *fluidmd; ParticleSystemModifierData *psmd; @@ -124,8 +131,7 @@ static void rna_FluidSettings_update_type(bContext *C, PointerRNA *ptr) } } - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + rna_fluid_update(C, ptr); } static void rna_DomainFluidSettings_memory_estimate_get(PointerRNA *ptr, char *value) @@ -216,7 +222,7 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "guiDisplayMode"); RNA_def_property_enum_items(prop, quality_items); RNA_def_property_ui_text(prop, "Viewport Display Mode", "How to display the mesh in the viewport."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_fluid_update"); prop= RNA_def_property(srna, "render_display_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "renderDisplayMode"); @@ -231,7 +237,7 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna) RNA_def_property_string_maxlength(prop, 240); RNA_def_property_string_sdna(prop, NULL, "surfdataPath"); RNA_def_property_ui_text(prop, "Path", "Directory (and/or filename prefix) to store baked fluid simulation files in."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_fluid_update"); prop= RNA_def_property(srna, "memory_estimate", PROP_STRING, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -431,7 +437,7 @@ static void rna_def_fluidsim_particle(BlenderRNA *brna) RNA_def_property_string_maxlength(prop, 240); RNA_def_property_string_sdna(prop, NULL, "surfdataPath"); RNA_def_property_ui_text(prop, "Path", "Directory (and/or filename prefix) to store and load particles from."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_fluid_update"); } static void rna_def_fluidsim_control(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 0a9ef9f90d1..13cc2ae9017 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -195,6 +195,7 @@ void rna_object_vcollayer_name_set(struct PointerRNA *ptr, const char *value, ch void rna_Object_update(struct bContext *C, struct PointerRNA *ptr); void rna_Object_update_data(struct bContext *C, struct PointerRNA *ptr); +void rna_Mesh_update_draw(struct bContext *C, struct PointerRNA *ptr); /* API functions */ diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index 88047cda12b..fbe339fe7f3 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -260,14 +260,13 @@ static PointerRNA rna_ShapeKey_data_get(CollectionPropertyIterator *iter) static void rna_Key_update_data(bContext *C, PointerRNA *ptr) { Main *bmain= CTX_data_main(C); - Scene *scene= CTX_data_scene(C); Key *key= ptr->id.data; Object *ob; for(ob=bmain->object.first; ob; ob= ob->id.next) { if(ob_get_key(ob) == key) { - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); } } } diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c index b53a0589ba6..1f7eee4d2d8 100644 --- a/source/blender/makesrna/intern/rna_lattice.c +++ b/source/blender/makesrna/intern/rna_lattice.c @@ -89,18 +89,10 @@ static void rna_Lattice_points_begin(CollectionPropertyIterator *iter, PointerRN static void rna_Lattice_update_data(bContext *C, PointerRNA *ptr) { - Main *bmain= CTX_data_main(C); - Scene *scene= CTX_data_scene(C); - Lattice *lt= ptr->id.data; - Object *ob; + ID *id= ptr->id.data; - for(ob=bmain->object.first; ob; ob= ob->id.next) { - if(ob->data == lt) { - /* XXX this will loop over all objects again (slow) */ - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); - } - } + DAG_id_flush_update(id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, id); } static void rna_Lattice_update_size(bContext *C, PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index edecfc8cdb0..f7235db49a5 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -52,18 +52,24 @@ static void rna_Mesh_update_data(bContext *C, PointerRNA *ptr) { - Main *bmain= CTX_data_main(C); - Scene *scene= CTX_data_scene(C); ID *id= ptr->id.data; - Object *ob; - for(ob=bmain->object.first; ob; ob= ob->id.next) { - if(ob->data == id) { - /* XXX this will loop over all objects again (slow) */ - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); - } - } + DAG_id_flush_update(id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, id); +} + +static void rna_Mesh_update_select(bContext *C, PointerRNA *ptr) +{ + ID *id= ptr->id.data; + + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, id); +} + +void rna_Mesh_update_draw(bContext *C, PointerRNA *ptr) +{ + ID *id= ptr->id.data; + + WM_event_add_notifier(C, NC_GEOM|ND_DATA, id); } static void rna_MeshVertex_normal_get(PointerRNA *ptr, float *value) @@ -867,10 +873,12 @@ static void rna_def_mvert_group(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "def_nr"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Group Index", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "weight", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Weight", "Vertex Weight"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); } static void rna_def_mvert(BlenderRNA *brna) @@ -886,6 +894,7 @@ static void rna_def_mvert(BlenderRNA *brna) prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_ui_text(prop, "Location", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_DIRECTION); RNA_def_property_float_sdna(prop, NULL, "no"); @@ -896,14 +905,17 @@ static void rna_def_mvert(BlenderRNA *brna) prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT); RNA_def_property_ui_text(prop, "Selected", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_select"); prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_HIDE); RNA_def_property_ui_text(prop, "Hidden", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_select"); prop= RNA_def_property(srna, "bevel_weight", PROP_FLOAT, PROP_NONE); RNA_def_property_float_funcs(prop, "rna_MeshVertex_bevel_weight_get", "rna_MeshVertex_bevel_weight_set", NULL); RNA_def_property_ui_text(prop, "Bevel Weight", "Weight used by the Bevel modifier 'Only Vertices' option"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_funcs(prop, "rna_MeshVertex_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0, 0, 0); @@ -931,26 +943,32 @@ static void rna_def_medge(BlenderRNA *brna) prop= RNA_def_property(srna, "crease", PROP_FLOAT, PROP_NONE); RNA_def_property_float_funcs(prop, "rna_MEdge_crease_get", "rna_MEdge_crease_set", NULL); RNA_def_property_ui_text(prop, "Crease", "Weight used by the Subsurf modifier for creasing"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "bevel_weight", PROP_FLOAT, PROP_NONE); RNA_def_property_float_funcs(prop, "rna_MEdge_bevel_weight_get", "rna_MEdge_bevel_weight_set", NULL); RNA_def_property_ui_text(prop, "Bevel Weight", "Weight used by the Bevel modifier"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT); RNA_def_property_ui_text(prop, "Selected", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_select"); prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_HIDE); RNA_def_property_ui_text(prop, "Hidden", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_select"); prop= RNA_def_property(srna, "seam", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SEAM); RNA_def_property_ui_text(prop, "Seam", "Seam edge for UV unwrapping"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_select"); prop= RNA_def_property(srna, "sharp", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SHARP); RNA_def_property_ui_text(prop, "Sharp", "Sharp edge for the EdgeSplit modifier"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); } static void rna_def_mface(BlenderRNA *brna) @@ -984,18 +1002,22 @@ static void rna_def_mface(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "mat_nr"); RNA_def_property_ui_text(prop, "Material Index", ""); RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MeshFace_material_index_range"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_FACE_SEL); RNA_def_property_ui_text(prop, "Selected", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_select"); prop= RNA_def_property(srna, "hidden", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_HIDE); RNA_def_property_ui_text(prop, "Hidden", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_select"); prop= RNA_def_property(srna, "smooth", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_SMOOTH); RNA_def_property_ui_text(prop, "Smooth", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_DIRECTION); RNA_def_property_array(prop, 3); @@ -1021,20 +1043,24 @@ static void rna_def_mtface(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Mesh Texture Face Layer", "Layer of texture faces in a Mesh datablock."); RNA_def_struct_sdna(srna, "CustomDataLayer"); RNA_def_struct_path_func(srna, "rna_MeshTextureFaceLayer_path"); + RNA_def_struct_ui_icon(srna, ICON_GROUP_UVS); prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshTextureFaceLayer_name_set"); RNA_def_property_ui_text(prop, "Name", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_MeshTextureFaceLayer_active_get", "rna_MeshTextureFaceLayer_active_set"); RNA_def_property_ui_text(prop, "Active", "Sets the layer as active for display and editing"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "active_render", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "active_rnd", 0); RNA_def_property_boolean_funcs(prop, "rna_MeshTextureFaceLayer_active_render_get", "rna_MeshTextureFaceLayer_active_render_set"); RNA_def_property_ui_text(prop, "Active Render", "Sets the layer as active for rendering"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshTextureFace"); @@ -1052,88 +1078,109 @@ static void rna_def_mtface(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, NULL, "rna_TextureFace_image_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Image", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "tex", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_TEX); RNA_def_property_ui_text(prop, "Tex", "Render face with texture"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "light", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_LIGHT); RNA_def_property_ui_text(prop, "Light", "Use light for face"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "invisible", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_INVISIBLE); RNA_def_property_ui_text(prop, "Invisible", "Make face invisible"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_DYNAMIC); RNA_def_property_ui_text(prop, "Collision", "Use face for collision and ray-sensor detection"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "shared", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_SHAREDCOL); RNA_def_property_ui_text(prop, "Shared", "Blend vertex colors across face when vertices are shared"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "twoside", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_TWOSIDE); RNA_def_property_ui_text(prop, "Twoside", "Render face twosided"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "object_color", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_OBCOL); RNA_def_property_ui_text(prop, "Object Color", "Use ObColor instead of vertex colors"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "halo", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_BILLBOARD); RNA_def_property_ui_text(prop, "Halo", "Screen aligned billboard"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "billboard", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_BILLBOARD2); RNA_def_property_ui_text(prop, "Billboard", "Billboard with Z-axis constraint"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "shadow", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_SHADOW); RNA_def_property_ui_text(prop, "Shadow", "Face is used for shadow"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "text", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_BMFONT); RNA_def_property_ui_text(prop, "Text", "Enable bitmap text on face"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "alpha_sort", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", TF_ALPHASORT); RNA_def_property_ui_text(prop, "Alpha Sort", "Enable sorting of faces for correct alpha drawing (slow, use Clip Alpha instead when possible)"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "transp", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, transp_items); RNA_def_property_ui_text(prop, "Transparency", "Transparency blending mode"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "uv_selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TF_SEL1); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "UV Selected", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_select"); prop= RNA_def_property(srna, "uv_pinned", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "unwrap", TF_PIN1); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "UV Pinned", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_select"); prop= RNA_def_property(srna, "uv1", PROP_FLOAT, PROP_XYZ); RNA_def_property_array(prop, 2); RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv1_get", "rna_MeshTextureFace_uv1_set", NULL); RNA_def_property_ui_text(prop, "UV 1", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "uv2", PROP_FLOAT, PROP_XYZ); RNA_def_property_array(prop, 2); RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv2_get", "rna_MeshTextureFace_uv2_set", NULL); RNA_def_property_ui_text(prop, "UV 2", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "uv3", PROP_FLOAT, PROP_XYZ); RNA_def_property_array(prop, 2); RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv3_get", "rna_MeshTextureFace_uv3_set", NULL); RNA_def_property_ui_text(prop, "UV 3", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "uv4", PROP_FLOAT, PROP_XYZ); RNA_def_property_array(prop, 2); RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv4_get", "rna_MeshTextureFace_uv4_set", NULL); RNA_def_property_ui_text(prop, "UV 4", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "uv", PROP_FLOAT, PROP_XYZ); RNA_def_property_multidimensional_array(prop, 4 * 2, 2, uv_dim); @@ -1141,6 +1188,7 @@ static void rna_def_mtface(BlenderRNA *brna) RNA_def_property_dynamic_array_funcs(prop, "rna_MeshTextureFace_uv_get_length", "rna_MeshTextureFace_uv_set_length"); RNA_def_property_float_funcs(prop, "rna_MeshTextureFace_uv_get", "rna_MeshTextureFace_uv_set", NULL); RNA_def_property_ui_text(prop, "UV", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); } static void rna_def_msticky(BlenderRNA *brna) @@ -1155,6 +1203,7 @@ static void rna_def_msticky(BlenderRNA *brna) prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_XYZ); RNA_def_property_ui_text(prop, "Location", "Sticky texture coordinate location."); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); } static void rna_def_mcol(BlenderRNA *brna) @@ -1166,20 +1215,24 @@ static void rna_def_mcol(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Mesh Vertex Color Layer", "Layer of vertex colors in a Mesh datablock."); RNA_def_struct_sdna(srna, "CustomDataLayer"); RNA_def_struct_path_func(srna, "rna_MeshColorLayer_path"); + RNA_def_struct_ui_icon(srna, ICON_GROUP_VCOL); prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshColorLayer_name_set"); RNA_def_property_ui_text(prop, "Name", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_MeshColorLayer_active_get", "rna_MeshColorLayer_active_set"); RNA_def_property_ui_text(prop, "Active", "Sets the layer as active for display and editing"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "active_render", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "active_rnd", 0); RNA_def_property_boolean_funcs(prop, "rna_MeshColorLayer_active_render_get", "rna_MeshColorLayer_active_render_set"); RNA_def_property_ui_text(prop, "Active Render", "Sets the layer as active for rendering"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshColor"); @@ -1196,24 +1249,28 @@ static void rna_def_mcol(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_float_funcs(prop, "rna_MeshColor_color1_get", "rna_MeshColor_color1_set", NULL); RNA_def_property_ui_text(prop, "Color 1", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "color2", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_float_funcs(prop, "rna_MeshColor_color2_get", "rna_MeshColor_color2_set", NULL); RNA_def_property_ui_text(prop, "Color 2", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "color3", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_float_funcs(prop, "rna_MeshColor_color3_get", "rna_MeshColor_color3_set", NULL); RNA_def_property_ui_text(prop, "Color 3", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "color4", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_float_funcs(prop, "rna_MeshColor_color4_get", "rna_MeshColor_color4_set", NULL); RNA_def_property_ui_text(prop, "Color 4", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); } static void rna_def_mproperties(BlenderRNA *brna) @@ -1230,6 +1287,7 @@ static void rna_def_mproperties(BlenderRNA *brna) prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); RNA_def_property_ui_text(prop, "Name", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshFloatProperty"); @@ -1244,6 +1302,7 @@ static void rna_def_mproperties(BlenderRNA *brna) prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "f"); RNA_def_property_ui_text(prop, "Value", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); /* Int */ srna= RNA_def_struct(brna, "MeshIntPropertyLayer", NULL); @@ -1254,6 +1313,7 @@ static void rna_def_mproperties(BlenderRNA *brna) prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); RNA_def_property_ui_text(prop, "Name", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshIntProperty"); @@ -1268,6 +1328,7 @@ static void rna_def_mproperties(BlenderRNA *brna) prop= RNA_def_property(srna, "value", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "i"); RNA_def_property_ui_text(prop, "Value", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); /* String */ srna= RNA_def_struct(brna, "MeshStringPropertyLayer", NULL); @@ -1278,6 +1339,7 @@ static void rna_def_mproperties(BlenderRNA *brna) prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); RNA_def_property_ui_text(prop, "Name", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); prop= RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MeshStringProperty"); @@ -1292,6 +1354,7 @@ static void rna_def_mproperties(BlenderRNA *brna) prop= RNA_def_property(srna, "value", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "s"); RNA_def_property_ui_text(prop, "Value", ""); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); } void rna_def_texmat_common(StructRNA *srna, const char *texspace_editable) @@ -1307,17 +1370,20 @@ void rna_def_texmat_common(StructRNA *srna, const char *texspace_editable) RNA_def_property_float_sdna(prop, NULL, "loc"); RNA_def_property_ui_text(prop, "Texure Space Location", "Texture space location."); RNA_def_property_editable_func(prop, texspace_editable); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop= RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "size"); RNA_def_property_ui_text(prop, "Texture Space Size", "Texture space size."); RNA_def_property_editable_func(prop, texspace_editable); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); /* not supported yet prop= RNA_def_property(srna, "texspace_rot", PROP_FLOAT, PROP_EULER); RNA_def_property_float(prop, NULL, "rot"); RNA_def_property_ui_text(prop, "Texture Space Rotation", "Texture space rotation"); - RNA_def_property_editable_func(prop, texspace_editable);*/ + RNA_def_property_editable_func(prop, texspace_editable); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");*/ /* materials */ prop= RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE); @@ -1445,58 +1511,58 @@ static void rna_def_mesh(BlenderRNA *brna) prop= RNA_def_property(srna, "draw_edges", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEDGES); RNA_def_property_ui_text(prop, "Draw Edges", "Displays selected edges using hilights in the 3d view and UV editor"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop= RNA_def_property(srna, "draw_faces", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWFACES); RNA_def_property_ui_text(prop, "Draw Faces", "Displays all faces as shades in the 3d view and UV editor"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop= RNA_def_property(srna, "draw_normals", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWNORMALS); RNA_def_property_ui_text(prop, "Draw Normals", "Displays face normals as lines"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop= RNA_def_property(srna, "draw_vertex_normals", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_VNORMALS); RNA_def_property_ui_text(prop, "Draw Vertex Normals", "Displays vertex normals as lines"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop= RNA_def_property(srna, "draw_creases", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWCREASES); RNA_def_property_ui_text(prop, "Draw Creases", "Displays creases created for subsurf weighting"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop= RNA_def_property(srna, "draw_bevel_weights", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWBWEIGHTS); RNA_def_property_ui_text(prop, "Draw Bevel Weights", "Displays weights created for the Bevel modifier"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop= RNA_def_property(srna, "draw_seams", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWSEAMS); RNA_def_property_ui_text(prop, "Draw Seams", "Displays UV unwrapping seams"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop= RNA_def_property(srna, "draw_sharp", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWSHARP); RNA_def_property_ui_text(prop, "Draw Sharp", "Displays sharp edges, used with the EdgeSplit modifier"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop= RNA_def_property(srna, "draw_edge_lenght", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_EDGELEN); RNA_def_property_ui_text(prop, "Edge Length", "Displays selected edge lengths"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop= RNA_def_property(srna, "draw_edge_angle", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_EDGEANG); RNA_def_property_ui_text(prop, "Edge Angles", "Displays the angles in the selected edges in degrees"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop= RNA_def_property(srna, "draw_face_area", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_FACEAREA); RNA_def_property_ui_text(prop, "Face Area", "Displays the area of selected faces"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); rna_def_texmat_common(srna, "rna_Mesh_texspace_editable"); diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c index c98b3fb7b09..686d91e4fe2 100644 --- a/source/blender/makesrna/intern/rna_mesh_api.c +++ b/source/blender/makesrna/intern/rna_mesh_api.c @@ -102,20 +102,13 @@ static void rna_Mesh_calc_edges(Mesh *mesh) static void rna_Mesh_update(Mesh *mesh, bContext *C) { - Main *bmain= CTX_data_main(C); - Object *ob; - if(mesh->totface && mesh->totedge == 0) rna_Mesh_calc_edges(mesh); mesh_calc_normals(mesh->mvert, mesh->totvert, mesh->mface, mesh->totface, NULL); - for(ob=bmain->object.first; ob; ob=ob->id.next) { - if(ob->data == mesh) { - ob->recalc |= OB_RECALC_DATA; - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); - } - } + DAG_id_flush_update(&mesh->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, mesh); } static void rna_Mesh_add_verts(Mesh *mesh, int len) diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c index 7b14a7a4712..f3160a7bb18 100644 --- a/source/blender/makesrna/intern/rna_meta.c +++ b/source/blender/makesrna/intern/rna_meta.c @@ -57,14 +57,12 @@ static void rna_MetaBall_update_data(bContext *C, PointerRNA *ptr) MetaBall *mb= ptr->id.data; Object *ob; - for(ob=bmain->object.first; ob; ob= ob->id.next) { - if(ob->data == mb) { + for(ob=bmain->object.first; ob; ob= ob->id.next) + if(ob->data == mb) copy_mball_properties(scene, ob); - /* XXX this will loop over all objects again (slow) */ - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); - } - } + + DAG_id_flush_update(&mb->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_GEOM|ND_DATA, mb); } #else diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index bb073d19a46..f8c8ddb9431 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -40,6 +40,7 @@ #include "BKE_bmesh.h" /* For BevelModifierData */ #include "BKE_smoke.h" /* For smokeModifier_free & smokeModifier_createType */ +#include "WM_api.h" #include "WM_types.h" EnumPropertyItem modifier_type_items[] ={ @@ -170,7 +171,8 @@ static char *rna_Modifier_path(PointerRNA *ptr) static void rna_Modifier_update(bContext *C, PointerRNA *ptr) { - DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_DATA); + DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ptr->id.data); } static void rna_Modifier_dependency_update(bContext *C, PointerRNA *ptr) @@ -441,7 +443,7 @@ static void rna_def_property_subdivision_common(StructRNA *srna, const char type RNA_def_property_enum_sdna(prop, NULL, type); RNA_def_property_enum_items(prop, prop_subdivision_type_items); RNA_def_property_ui_text(prop, "Subdivision Type", "Selects type of subdivision algorithm."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_subsurf(BlenderRNA *brna) @@ -461,7 +463,7 @@ static void rna_def_modifier_subsurf(BlenderRNA *brna) RNA_def_property_range(prop, 1, 6); RNA_def_property_ui_range(prop, 1, 6, 1, 0); RNA_def_property_ui_text(prop, "Levels", "Number of subdivisions to perform."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "render_levels", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "renderLevels"); @@ -472,12 +474,12 @@ static void rna_def_modifier_subsurf(BlenderRNA *brna) prop= RNA_def_property(srna, "optimal_draw", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", eSubsurfModifierFlag_ControlEdges); RNA_def_property_ui_text(prop, "Optimal Draw", "Skip drawing/rendering of interior subdivided edges"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "subsurf_uv", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", eSubsurfModifierFlag_SubsurfUv); RNA_def_property_ui_text(prop, "Subsurf UV", "Use subsurf to subdivide UVs."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_multires(BlenderRNA *brna) @@ -496,7 +498,7 @@ static void rna_def_modifier_multires(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "lvl"); RNA_def_property_ui_text(prop, "Level", ""); RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MultiresModifier_level_range"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_lattice(BlenderRNA *brna) @@ -513,13 +515,13 @@ static void rna_def_modifier_lattice(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Object", "Lattice object to deform with."); RNA_def_property_pointer_funcs(prop, NULL, "rna_LatticeModifier_object_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_LatticeModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_curve(BlenderRNA *brna) @@ -545,19 +547,19 @@ static void rna_def_modifier_curve(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Object", "Curve object to deform with."); RNA_def_property_pointer_funcs(prop, NULL, "rna_CurveModifier_object_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_CurveModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "deform_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "defaxis"); RNA_def_property_enum_items(prop, prop_deform_axis_items); RNA_def_property_ui_text(prop, "Deform Axis", "The axis that the curve deforms along."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_build(BlenderRNA *brna) @@ -573,21 +575,21 @@ static void rna_def_modifier_build(BlenderRNA *brna) prop= RNA_def_property(srna, "start", PROP_FLOAT, PROP_TIME); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); RNA_def_property_ui_text(prop, "Start", "Specify the start frame of the effect."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "length", PROP_FLOAT, PROP_TIME); RNA_def_property_range(prop, 1, MAXFRAMEF); RNA_def_property_ui_text(prop, "Length", "Specify the total time the build effect requires"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "randomize", PROP_BOOLEAN, PROP_NONE); RNA_def_property_ui_text(prop, "Randomize", "Randomize the faces or edges during build."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "seed", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 1, MAXFRAMEF); RNA_def_property_ui_text(prop, "Seed", "Specify the seed for random if used."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_mirror(BlenderRNA *brna) @@ -603,50 +605,50 @@ static void rna_def_modifier_mirror(BlenderRNA *brna) prop= RNA_def_property(srna, "x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_AXIS_X); RNA_def_property_ui_text(prop, "X", "Enable X axis mirror."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_AXIS_Y); RNA_def_property_ui_text(prop, "Y", "Enable Y axis mirror."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_AXIS_Z); RNA_def_property_ui_text(prop, "Z", "Enable Z axis mirror."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "clip", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_CLIPPING); RNA_def_property_ui_text(prop, "Clip", "Prevents vertices from going through the mirror during transform."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "mirror_vertex_groups", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_VGROUP); RNA_def_property_ui_text(prop, "Mirror Vertex Groups", "Mirror vertex groups (e.g. .R->.L)."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "mirror_u", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_MIRROR_U); RNA_def_property_ui_text(prop, "Mirror U", "Mirror the U texture coordinate around the 0.5 point."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "mirror_v", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_MIRROR_V); RNA_def_property_ui_text(prop, "Mirror V", "Mirror the V texture coordinate around the 0.5 point."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "merge_limit", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "tolerance"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Merge Limit", "Distance from axis within which mirrored vertices are merged."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "mirror_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "mirror_ob"); RNA_def_property_ui_text(prop, "Mirror Object", "Object to use as mirror."); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); } static void rna_def_modifier_decimate(BlenderRNA *brna) @@ -663,7 +665,7 @@ static void rna_def_modifier_decimate(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "percent"); RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_text(prop, "Ratio", "Defines the ratio of triangles to reduce to."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "face_count", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "faceCount"); @@ -691,135 +693,135 @@ static void rna_def_modifier_wave(BlenderRNA *brna) prop= RNA_def_property(srna, "x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_X); RNA_def_property_ui_text(prop, "X", "X axis motion."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_Y); RNA_def_property_ui_text(prop, "Y", "Y axis motion."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "cyclic", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_CYCL); RNA_def_property_ui_text(prop, "Cyclic", "Cyclic wave effect."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "normals", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM); RNA_def_property_ui_text(prop, "Normals", "Dispace along normals."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "x_normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM_X); RNA_def_property_ui_text(prop, "X Normal", "Enable displacement along the X normal"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "y_normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM_Y); RNA_def_property_ui_text(prop, "Y Normal", "Enable displacement along the Y normal"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "z_normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_NORM_Z); RNA_def_property_ui_text(prop, "Z Normal", "Enable displacement along the Z normal"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "time_offset", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "timeoffs"); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); RNA_def_property_ui_text(prop, "Time Offset", "Either the starting frame (for positive speed) or ending frame (for negative speed.)"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); RNA_def_property_ui_text(prop, "Lifetime", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "damping_time", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "damp"); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); RNA_def_property_ui_text(prop, "Damping Time", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "falloff_radius", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "falloff"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 100, 100, 2); RNA_def_property_ui_text(prop, "Falloff Radius", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "start_position_x", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "startx"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -100, 100, 100, 2); RNA_def_property_ui_text(prop, "Start Position X", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "start_position_y", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "starty"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -100, 100, 100, 2); RNA_def_property_ui_text(prop, "Start Position Y", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "start_position_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "objectcenter"); RNA_def_property_ui_text(prop, "Start Position Object", ""); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "defgrp_name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name for modulating the wave."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WaveModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Texture", "Texture for modulating the wave."); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "texture_coordinates", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "texmapping"); RNA_def_property_enum_items(prop, prop_texture_coordinates_items); RNA_def_property_ui_text(prop, "Texture Coordinates", "Texture coordinates used for modulating input."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "uvlayer_name"); RNA_def_property_ui_text(prop, "UV Layer", "UV layer name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_WaveModifier_uvlayer_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "texture_coordinates_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "map_object"); RNA_def_property_ui_text(prop, "Texture Coordinates Object", ""); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -1, 1, 10, 2); RNA_def_property_ui_text(prop, "Speed", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "height", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -2, 2, 10, 2); RNA_def_property_ui_text(prop, "Height", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "width", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 5, 10, 2); RNA_def_property_ui_text(prop, "Width", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "narrowness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "narrow"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 10, 10, 2); RNA_def_property_ui_text(prop, "Narrowness", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_armature(BlenderRNA *brna) @@ -836,43 +838,43 @@ static void rna_def_modifier_armature(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Object", "Armature object to deform with."); RNA_def_property_pointer_funcs(prop, NULL, "rna_ArmatureModifier_object_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "defgrp_name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ArmatureModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_INVERT_VGROUP); RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_vertex_groups", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_VGROUP); RNA_def_property_ui_text(prop, "Use Vertex Groups", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_bone_envelopes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_ENVELOPE); RNA_def_property_ui_text(prop, "Use Bone Envelopes", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "quaternion", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_QUATERNION); RNA_def_property_ui_text(prop, "Quaternion", "Deform rotation interpolation with quaternions."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "b_bone_rest", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_B_BONE_REST); RNA_def_property_ui_text(prop, "B-Bone Rest", "Make B-Bones deform already in rest position"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "multi_modifier", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "multi", 0); RNA_def_property_ui_text(prop, "Multi Modifier", "Use same input as previous modifier, and mix results using overall vgroup"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_hook(BlenderRNA *brna) @@ -889,28 +891,28 @@ static void rna_def_modifier_hook(BlenderRNA *brna) RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 100, 100, 2); RNA_def_property_ui_text(prop, "Falloff", "If not zero, the distance from the hook where influence ends."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "force", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_text(prop, "Force", "Relative force of the hook."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Object", "Parent Object for hook, also recalculates and clears offset"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "subtarget"); RNA_def_property_ui_text(prop, "Sub-Target", "Name of Parent Bone for hook (if applicable), also recalculates and clears offset"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_HookModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_softbody(BlenderRNA *brna) @@ -954,12 +956,12 @@ static void rna_def_modifier_boolean(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Object", "Mesh object to use for boolean operation."); RNA_def_property_pointer_funcs(prop, NULL, "rna_BooleanModifier_object_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_operation_items); RNA_def_property_ui_text(prop, "Operation", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_array(BlenderRNA *brna) @@ -982,90 +984,90 @@ static void rna_def_modifier_array(BlenderRNA *brna) prop= RNA_def_property(srna, "fit_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_fit_type_items); RNA_def_property_ui_text(prop, "Fit Type", "Array length calculation method."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "count", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 1, INT_MAX); RNA_def_property_ui_range(prop, 1, 1000, 1, 0); RNA_def_property_ui_text(prop, "Count", "Number of duplicates to make."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "length", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_range(prop, 0, INT_MAX); RNA_def_property_ui_range(prop, 0, 10000, 10, 2); RNA_def_property_ui_text(prop, "Length", "Length to fit array within."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "curve_ob"); RNA_def_property_ui_text(prop, "Curve", "Curve object to fit array length to."); RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_curve_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); /* Offset parameters */ prop= RNA_def_property(srna, "constant_offset", PROP_BOOLEAN, PROP_TRANSLATION); RNA_def_property_boolean_sdna(prop, NULL, "offset_type", MOD_ARR_OFF_CONST); RNA_def_property_ui_text(prop, "Constant Offset", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "constant_offset_displacement", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "offset"); RNA_def_property_ui_text(prop, "Constant Offset Displacement", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "relative_offset", PROP_BOOLEAN, PROP_TRANSLATION); RNA_def_property_boolean_sdna(prop, NULL, "offset_type", MOD_ARR_OFF_RELATIVE); RNA_def_property_ui_text(prop, "Relative Offset", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "relative_offset_displacement", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "scale"); RNA_def_property_ui_text(prop, "Relative Offset Displacement", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); /* Vertex merging parameters */ prop= RNA_def_property(srna, "merge_adjacent_vertices", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_ARR_MERGE); RNA_def_property_ui_text(prop, "Merge Vertices", "Merge vertices in adjacent duplicates."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "merge_end_vertices", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_ARR_MERGEFINAL); RNA_def_property_ui_text(prop, "Merge Vertices", "Merge vertices in first and last duplicates."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "merge_distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "merge_dist"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 1, 1, 4); RNA_def_property_ui_text(prop, "Merge Distance", "Limit below which to merge vertices."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); /* Offset object */ prop= RNA_def_property(srna, "add_offset_object", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "offset_type", MOD_ARR_OFF_OBJ); RNA_def_property_ui_text(prop, "Add Offset Object", "Add an object transformation to the total offset."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "offset_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "offset_ob"); RNA_def_property_ui_text(prop, "Offset Object", ""); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); /* Caps */ prop= RNA_def_property(srna, "start_cap", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Start Cap", "Mesh object to use as a start cap."); RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_start_cap_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "end_cap", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "End Cap", "Mesh object to use as an end cap."); RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_end_cap_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); } static void rna_def_modifier_edgesplit(BlenderRNA *brna) @@ -1082,17 +1084,17 @@ static void rna_def_modifier_edgesplit(BlenderRNA *brna) RNA_def_property_range(prop, 0, 180); RNA_def_property_ui_range(prop, 0, 180, 100, 2); RNA_def_property_ui_text(prop, "Split Angle", "Angle above which to split edges."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_edge_angle", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_EDGESPLIT_FROMANGLE); RNA_def_property_ui_text(prop, "Use Edge Angle", "Split edges with high angle between faces."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_sharp", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_EDGESPLIT_FROMFLAG); RNA_def_property_ui_text(prop, "Use Sharp Edges", "Split edges that are marked as sharp."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_displace(BlenderRNA *brna) @@ -1124,47 +1126,47 @@ static void rna_def_modifier_displace(BlenderRNA *brna) RNA_def_property_string_sdna(prop, NULL, "defgrp_name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_DisplaceModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Texture", ""); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "midlevel", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_range(prop, 0, 1, 10, 3); RNA_def_property_ui_text(prop, "Midlevel", "Material value that gives no displacement."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -100, 100, 10, 2); RNA_def_property_ui_text(prop, "Strength", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "direction", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_direction_items); RNA_def_property_ui_text(prop, "Direction", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "texture_coordinates", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "texmapping"); RNA_def_property_enum_items(prop, prop_texture_coordinates_items); RNA_def_property_ui_text(prop, "Texture Coordinates", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "uvlayer_name"); RNA_def_property_ui_text(prop, "UV Layer", "UV layer name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_DisplaceModifier_uvlayer_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "texture_coordinate_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "map_object"); RNA_def_property_ui_text(prop, "Texture Coordinate Object", ""); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); } static void rna_def_modifier_uvproject(BlenderRNA *brna) @@ -1181,13 +1183,13 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna) RNA_def_property_string_sdna(prop, NULL, "uvlayer_name"); RNA_def_property_ui_text(prop, "UV Layer", "UV layer name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_UVProjectModifier_uvlayer_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "num_projectors", PROP_INT, PROP_NONE); RNA_def_property_ui_text(prop, "Number of Projectors", "Number of projectors to use."); RNA_def_property_int_funcs(prop, NULL, "rna_UVProjectModifier_num_projectors_set", NULL); RNA_def_property_range(prop, 1, MOD_UVPROJECT_MAX); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "projectors", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "UVProjector"); @@ -1197,26 +1199,26 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna) prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Image", ""); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "horizontal_aspect_ratio", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "aspectx"); RNA_def_property_range(prop, 1, FLT_MAX); RNA_def_property_ui_range(prop, 1, 1000, 100, 2); RNA_def_property_ui_text(prop, "Horizontal Aspect Ratio", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "vertical_aspect_ratio", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "aspecty"); RNA_def_property_range(prop, 1, FLT_MAX); RNA_def_property_ui_range(prop, 1, 1000, 100, 2); RNA_def_property_ui_text(prop, "Vertical Aspect Ratio", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "override_image", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_UVPROJECT_OVERRIDEIMAGE); RNA_def_property_ui_text(prop, "Override Image", "Override faces' current images with the given image."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); srna= RNA_def_struct(brna, "UVProjector", NULL); RNA_def_struct_ui_text(srna, "UVProjector", "UV projector used by the UV project modifier."); @@ -1241,35 +1243,35 @@ static void rna_def_modifier_smooth(BlenderRNA *brna) prop= RNA_def_property(srna, "x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_X); RNA_def_property_ui_text(prop, "X", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_Y); RNA_def_property_ui_text(prop, "Y", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_Z); RNA_def_property_ui_text(prop, "Z", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fac"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -10, 10, 0.5, 2); RNA_def_property_ui_text(prop, "Factor", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "repeat", PROP_INT, PROP_NONE); RNA_def_property_ui_range(prop, 0, 30, 1, 0); RNA_def_property_ui_text(prop, "Repeat", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "defgrp_name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SmoothModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_cast(BlenderRNA *brna) @@ -1292,63 +1294,63 @@ static void rna_def_modifier_cast(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, prop_cast_type_items); RNA_def_property_ui_text(prop, "Cast Type", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Object", "Control object: if available, its location determines the center of the effect"); RNA_def_property_pointer_funcs(prop, NULL, "rna_CastModifier_object_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_X); RNA_def_property_ui_text(prop, "X", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_Y); RNA_def_property_ui_text(prop, "Y", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_Z); RNA_def_property_ui_text(prop, "Z", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "from_radius", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_SIZE_FROM_RADIUS); RNA_def_property_ui_text(prop, "From Radius", "Use radius as size of projection shape (0 = auto)"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "use_transform", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_USE_OB_TRANSFORM); RNA_def_property_ui_text(prop, "Use transform", "Use object transform to control projection shape"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "fac"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -10, 10, 5, 2); RNA_def_property_ui_text(prop, "Factor", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "radius", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 100, 10, 2); RNA_def_property_ui_text(prop, "Radius", "Only deform vertices within this distance from the center of the effect (leave as 0 for infinite.)"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 100, 10, 2); RNA_def_property_ui_text(prop, "Size", "Size of projection shape (leave as 0 for auto.)"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "defgrp_name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_CastModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_meshdeform(BlenderRNA *brna) @@ -1365,29 +1367,29 @@ static void rna_def_modifier_meshdeform(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Object", "Mesh object to deform with."); RNA_def_property_pointer_funcs(prop, NULL, "rna_MeshDeformModifier_object_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MDEF_INVERT_VGROUP); RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "defgrp_name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MeshDeformModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "precision", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "gridsize"); RNA_def_property_range(prop, 2, 10); RNA_def_property_ui_text(prop, "Precision", "The grid size for binding."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "dynamic", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MDEF_DYNAMIC_BIND); RNA_def_property_ui_text(prop, "Dynamic", "Recompute binding dynamically on top of other deformers (slower and more memory consuming.)"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } @@ -1422,71 +1424,71 @@ static void rna_def_modifier_particleinstance(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "ob"); RNA_def_property_ui_text(prop, "Object", "Object that has the particle system."); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "particle_system_number", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "psys"); RNA_def_property_range(prop, 1, 10); RNA_def_property_ui_text(prop, "Particle System Number", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "axis"); RNA_def_property_enum_items(prop, particleinstance_axis); RNA_def_property_ui_text(prop, "Axis", "Pole axis for rotation"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Parents); RNA_def_property_ui_text(prop, "Normal", "Create instances from normal particles."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "children", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Children); RNA_def_property_ui_text(prop, "Children", "Create instances from child particles."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "path", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Path); RNA_def_property_ui_text(prop, "Path", "Create instances along particle paths."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "unborn", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Unborn); RNA_def_property_ui_text(prop, "Unborn", "Show instances when particles are unborn."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "alive", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Alive); RNA_def_property_ui_text(prop, "Alive", "Show instances when particles are alive."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "dead", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Dead); RNA_def_property_ui_text(prop, "Dead", "Show instances when particles are dead."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "keep_shape", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_KeepShape); RNA_def_property_ui_text(prop, "Keep Shape", "Don't stretch the object."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "size", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_UseSize); RNA_def_property_ui_text(prop, "Size", "Use particle size to scale the instances."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "position", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "position"); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Position", "Position along path."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "random_position", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "random_position"); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Random Position", "Randomize position along path."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_explode(BlenderRNA *brna) @@ -1506,27 +1508,27 @@ static void rna_def_modifier_explode(BlenderRNA *brna) prop= RNA_def_property(srna, "protect", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_text(prop, "Protect", "Clean vertex group edges"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "split_edges", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_EdgeSplit); RNA_def_property_ui_text(prop, "Split Edges", "Split face edges for nicer shrapnel."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "unborn", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_Unborn); RNA_def_property_ui_text(prop, "Unborn", "Show mesh when particles are unborn."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "alive", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_Alive); RNA_def_property_ui_text(prop, "Alive", "Show mesh when particles are alive."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "dead", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_Dead); RNA_def_property_ui_text(prop, "Dead", "Show mesh when particles are dead."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_cloth(BlenderRNA *brna) @@ -1583,7 +1585,7 @@ static void rna_def_modifier_smoke(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, prop_smoke_type_items); RNA_def_property_ui_text(prop, "Type", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_set_type"); + RNA_def_property_update(prop, 0, "rna_Smoke_set_type"); } static void rna_def_modifier_collision(BlenderRNA *brna) @@ -1605,7 +1607,7 @@ static void rna_def_modifier_collision(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "absorption"); RNA_def_property_ui_range(prop, 0, 100, 1, 2); RNA_def_property_ui_text(prop, "Absorption %", "How much of effector force gets lost during collision with this object (in percent)."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_bevel(BlenderRNA *brna) @@ -1634,31 +1636,31 @@ static void rna_def_modifier_bevel(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "value"); RNA_def_property_range(prop, 0, 0.5); RNA_def_property_ui_text(prop, "Width", "Bevel value/amount."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "only_vertices", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", BME_BEVEL_VERT); RNA_def_property_ui_text(prop, "Only Vertices", "Bevel verts/corners, not edges."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "limit_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "lim_flags"); RNA_def_property_enum_items(prop, prop_limit_method_items); RNA_def_property_ui_text(prop, "Limit Method", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "edge_weight_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "e_flags"); RNA_def_property_enum_items(prop, prop_edge_weight_method_items); RNA_def_property_ui_text(prop, "Edge Weight Method", "What edge weight to use for weighting a vertex."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bevel_angle"); RNA_def_property_range(prop, 0, 180); RNA_def_property_ui_range(prop, 0, 180, 100, 2); RNA_def_property_ui_text(prop, "Angle", "Angle above which to bevel edges."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_shrinkwrap(BlenderRNA *brna) @@ -1681,80 +1683,80 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "shrinkType"); RNA_def_property_enum_items(prop, prop_mode_items); RNA_def_property_ui_text(prop, "Mode", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Target", "Mesh target to shrink to."); RNA_def_property_pointer_funcs(prop, NULL, "rna_ShrinkwrapModifier_target_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "auxiliary_target", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "auxTarget"); RNA_def_property_ui_text(prop, "Auxiliary Target", "Additional mesh target to shrink to."); RNA_def_property_pointer_funcs(prop, NULL, "rna_ShrinkwrapModifier_auxiliary_target_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "vgroup_name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ShrinkwrapModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "offset", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "keepDist"); RNA_def_property_range(prop, 0, FLT_MAX); RNA_def_property_ui_range(prop, 0, 100, 1, 2); RNA_def_property_ui_text(prop, "Offset", "Distance to keep from the target."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_X_AXIS); RNA_def_property_ui_text(prop, "X", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_Y_AXIS); RNA_def_property_ui_text(prop, "Y", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "projAxis", MOD_SHRINKWRAP_PROJECT_OVER_Z_AXIS); RNA_def_property_ui_text(prop, "Z", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "subsurf_levels", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "subsurfLevels"); RNA_def_property_range(prop, 0, 6); RNA_def_property_ui_range(prop, 0, 6, 1, 0); RNA_def_property_ui_text(prop, "Subsurf Levels", "Number of subdivisions that must be performed before extracting vertices' positions and normals."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "negative", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR); RNA_def_property_ui_text(prop, "Negative", "Allow vertices to move in the negative direction of axis."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "positive", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR); RNA_def_property_ui_text(prop, "Positive", "Allow vertices to move in the positive direction of axis."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "cull_front_faces", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE); RNA_def_property_ui_text(prop, "Cull Front Faces", "Stop vertices from projecting to a front face on the target."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "cull_back_faces", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_CULL_TARGET_BACKFACE); RNA_def_property_ui_text(prop, "Cull Back Faces", "Stop vertices from projecting to a back face on the target."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "keep_above_surface", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE); RNA_def_property_ui_text(prop, "Keep Above Surface", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_fluidsim(BlenderRNA *brna) @@ -1790,25 +1792,25 @@ static void rna_def_modifier_mask(BlenderRNA *brna) prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_mode_items); RNA_def_property_ui_text(prop, "Mode", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "armature", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "ob_arm"); RNA_def_property_ui_text(prop, "Armature", "Armature to use as source of bones to mask."); RNA_def_property_pointer_funcs(prop, NULL, "rna_MaskModifier_armature_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "vgroup"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MaskModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "inverse", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MASK_INV); RNA_def_property_ui_text(prop, "Inverse", "Use vertices that are not part of region defined."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_simpledeform(BlenderRNA *brna) @@ -1831,29 +1833,29 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna) prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_mode_items); RNA_def_property_ui_text(prop, "Mode", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "vgroup_name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name."); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SimpleDeformModifier_vgroup_set"); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "origin", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Origin", "Origin of modifier space coordinates."); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_dependency_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); prop= RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "originOpts", MOD_SIMPLEDEFORM_ORIGIN_LOCAL); RNA_def_property_ui_text(prop, "Relative", "Sets the origin of deform space to be relative to the object."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, -10, 10, 0.5, 2); RNA_def_property_ui_text(prop, "Factor", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "limits", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "limit"); @@ -1861,17 +1863,17 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna) RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_range(prop, 0, 1, 5, 2); RNA_def_property_ui_text(prop, "Limits", "Lower/Upper limits for deform."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "lock_x_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "axis", MOD_SIMPLEDEFORM_LOCK_AXIS_X); RNA_def_property_ui_text(prop, "Lock X Axis", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "lock_y_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "axis", MOD_SIMPLEDEFORM_LOCK_AXIS_Y); RNA_def_property_ui_text(prop, "Lock Y Axis", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_surface(BlenderRNA *brna) @@ -1911,7 +1913,7 @@ void RNA_def_modifier(BlenderRNA *brna) prop= RNA_def_property(srna, "realtime", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Realtime); RNA_def_property_ui_text(prop, "Realtime", "Realtime display of a modifier."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 0); prop= RNA_def_property(srna, "render", PROP_BOOLEAN, PROP_NONE); @@ -1922,13 +1924,13 @@ void RNA_def_modifier(BlenderRNA *brna) prop= RNA_def_property(srna, "editmode", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Editmode); RNA_def_property_ui_text(prop, "Editmode", "Use modifier while in the edit mode."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); RNA_def_property_ui_icon(prop, ICON_EDITMODE_HLT, 0); prop= RNA_def_property(srna, "on_cage", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_OnCage); RNA_def_property_ui_text(prop, "On Cage", "Enable direct editing of modifier control cage."); - RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Expanded); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index bbb10991564..50ccbc86719 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -39,9 +39,9 @@ #include "DNA_property_types.h" #include "DNA_scene_types.h" +#include "WM_api.h" #include "WM_types.h" - EnumPropertyItem object_mode_items[] = { {OB_MODE_OBJECT, "OBJECT", ICON_OBJECT_DATAMODE, "Object", ""}, {OB_MODE_EDIT, "EDIT", ICON_EDITMODE_HLT, "Edit", ""}, @@ -84,17 +84,18 @@ static EnumPropertyItem parent_type_items[] = { void rna_Object_update(bContext *C, PointerRNA *ptr) { - DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_OB); + DAG_id_flush_update(ptr->id.data, OB_RECALC_OB); } void rna_Object_update_data(bContext *C, PointerRNA *ptr) { - DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_DATA); + DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ptr->id.data); } static void rna_Object_dependency_update(bContext *C, PointerRNA *ptr) { - DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_OB); + DAG_id_flush_update(ptr->id.data, OB_RECALC_OB); DAG_scene_sort(CTX_data_scene(C)); } @@ -1042,7 +1043,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_editable_func(prop, "rna_Object_data_editable"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Data", "Object data."); - RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_Object_update_data"); prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); @@ -1223,13 +1224,13 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_struct_type(prop, "VertexGroup"); RNA_def_property_pointer_funcs(prop, "rna_Object_active_vertex_group_get", "rna_Object_active_vertex_group_set", NULL); RNA_def_property_ui_text(prop, "Active Vertex Group", "Vertex groups of the object."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_Object_update_data"); prop= RNA_def_property(srna, "active_vertex_group_index", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "actdef"); RNA_def_property_int_funcs(prop, "rna_Object_active_vertex_group_index_get", "rna_Object_active_vertex_group_index_set", "rna_Object_active_vertex_group_index_range"); RNA_def_property_ui_text(prop, "Active Vertex Group Index", "Active index in vertex group array."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_Object_update_data"); /* empty */ @@ -1490,7 +1491,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, NULL, "rna_Object_shape_key_lock_set"); RNA_def_property_ui_text(prop, "Shape Key Lock", "Always show the current Shape for this Object."); RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_Object_update_data"); prop= RNA_def_property(srna, "active_shape_key", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ShapeKey"); @@ -1501,7 +1502,7 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "shapenr"); RNA_def_property_int_funcs(prop, "rna_Object_active_shape_key_index_get", "rna_Object_active_shape_key_index_set", "rna_Object_active_shape_key_index_range"); RNA_def_property_ui_text(prop, "Active Shape Key Index", "Current shape key index."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_Object_update_data"); RNA_api_object(srna); } diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 932bef9969d..3dfbfcccacf 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -54,7 +54,6 @@ static void rna_Cache_change(bContext *C, PointerRNA *ptr) { - Scene *scene = CTX_data_scene(C); Object *ob = CTX_data_active_object(C); PointCache *cache = (PointCache*)ptr->data; PTCacheID *pid = NULL; @@ -67,7 +66,7 @@ static void rna_Cache_change(bContext *C, PointerRNA *ptr) BKE_ptcache_ids_from_object(&pidlist, ob); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); for(pid=pidlist.first; pid; pid=pid->next) { if(pid->cache==cache) @@ -105,7 +104,6 @@ static void rna_Cache_toggle_disk_cache(bContext *C, PointerRNA *ptr) static void rna_Cache_idname_change(bContext *C, PointerRNA *ptr) { - Scene *scene = CTX_data_scene(C); Object *ob = CTX_data_active_object(C); PointCache *cache = (PointCache*)ptr->data; PTCacheID *pid = NULL, *pid2= NULL; @@ -133,7 +131,7 @@ static void rna_Cache_idname_change(bContext *C, PointerRNA *ptr) cache->flag &= ~(PTCACHE_OUTDATED|PTCACHE_FRAMES_SKIPPED); BKE_ptcache_load_external(pid); - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } else { for(pid=pidlist.first; pid; pid=pid->next) { @@ -362,7 +360,6 @@ static void rna_SoftBodySettings_goal_vgroup_set(PointerRNA *ptr, const char *va static void rna_FieldSettings_update(bContext *C, PointerRNA *ptr) { - Scene *scene= CTX_data_scene(C); Object *ob= (Object*)ptr->id.data; if(ob->pd->forcefield != PFIELD_TEXTURE && ob->pd->tex) { @@ -370,7 +367,7 @@ static void rna_FieldSettings_update(bContext *C, PointerRNA *ptr) ob->pd->tex= 0; } - DAG_object_flush_update(scene, ob, OB_RECALC_OB); + DAG_id_flush_update(&ob->id, OB_RECALC_OB); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); } @@ -413,9 +410,9 @@ static void rna_FieldSettings_dependency_update(bContext *C, PointerRNA *ptr) DAG_scene_sort(scene); if(ob->type == OB_CURVE && ob->pd->forcefield == PFIELD_GUIDE) - DAG_object_flush_update(scene, ob, OB_RECALC); + DAG_id_flush_update(&ob->id, OB_RECALC); else - DAG_object_flush_update(scene, ob, OB_RECALC_OB); + DAG_id_flush_update(&ob->id, OB_RECALC_OB); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); } @@ -437,13 +434,20 @@ static void rna_CollisionSettings_dependency_update(bContext *C, PointerRNA *ptr static void rna_CollisionSettings_update(bContext *C, PointerRNA *ptr) { - Scene *scene= CTX_data_scene(C); Object *ob= (Object*)ptr->id.data; - DAG_object_flush_update(scene, ob, OB_RECALC); + DAG_id_flush_update(&ob->id, OB_RECALC); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); } +static void rna_softbody_update(bContext *C, PointerRNA *ptr) +{ + Object *ob= (Object*)ptr->id.data; + + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob); +} + #else static void rna_def_pointcache(BlenderRNA *brna) @@ -896,25 +900,25 @@ static void rna_def_softbody(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "mediafrict"); RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_ui_text(prop, "Friction", "General media friction for point movements"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "nodemass"); RNA_def_property_range(prop, 0.0f, 50000.0f); RNA_def_property_ui_text(prop, "Mass", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION); RNA_def_property_float_sdna(prop, NULL, "grav"); RNA_def_property_range(prop, -10.0f, 10.0f); RNA_def_property_ui_text(prop, "Gravitation", "Apply gravitation to point movement"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "speed", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "physics_speed"); RNA_def_property_range(prop, 0.01f, 100.0f); RNA_def_property_ui_text(prop, "Speed", "Tweak timing for physics to control frequency and speed"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); /* Goal */ @@ -927,31 +931,31 @@ static void rna_def_softbody(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "mingoal"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Goal Minimum", "Goal minimum, vertex group weights are scaled to match this range."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "goal_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "maxgoal"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Goal Maximum", "Goal maximum, vertex group weights are scaled to match this range."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "goal_default", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "defgoal"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Goal Default", "Default Goal (vertex target position) value, when no Vertex Group used."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "goal_spring", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "goalspring"); RNA_def_property_range(prop, 0.0f, 0.999f); RNA_def_property_ui_text(prop, "Goal Stiffness", "Goal (vertex target position) spring stiffness."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "goal_friction", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "goalfrict"); RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_ui_text(prop, "Goal Damping", "Goal (vertex target position) friction."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); /* Edge Spring Settings */ @@ -959,43 +963,43 @@ static void rna_def_softbody(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "inspring"); RNA_def_property_range(prop, 0.0f, 0.999f); RNA_def_property_ui_text(prop, "Pull", "Edge spring stiffness when longer than rest length"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "push", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "inpush"); RNA_def_property_range(prop, 0.0f, 0.999f); RNA_def_property_ui_text(prop, "Push", "Edge spring stiffness when shorter than rest length"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "damp", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "infrict"); RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_ui_text(prop, "Damp", "Edge spring friction"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "spring_length", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "springpreload"); RNA_def_property_range(prop, 0.0f, 200.0f); RNA_def_property_ui_text(prop, "SL", "Alter spring length to shrink/blow up (unit %) 0 to disable"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "aero", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "aeroedge"); RNA_def_property_range(prop, 0.0f, 30000.0f); RNA_def_property_ui_text(prop, "Aero", "Make edges 'sail'"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "plastic", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "plastic"); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Plastic", "Permanent deform"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "bending", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "secondspring"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Bending", "Bending Stiffness"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "shear", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "shearstiff"); @@ -1008,25 +1012,25 @@ static void rna_def_softbody(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "sbc_mode"); RNA_def_property_enum_items(prop, collision_type_items); RNA_def_property_ui_text(prop, "Collision Type", "Choose Collision Type"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "ball_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "colball"); RNA_def_property_range(prop, -10.0f, 10.0f); RNA_def_property_ui_text(prop, "Ball Size", "Absolute ball size or factor if not manual adjusted"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "ball_stiff", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ballstiff"); RNA_def_property_range(prop, 0.001f, 100.0f); RNA_def_property_ui_text(prop, "Ball Size", "Ball inflating presure"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "ball_damp", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "balldamp"); RNA_def_property_range(prop, 0.001f, 1.0f); RNA_def_property_ui_text(prop, "Ball Size", "Blending to inelastic collision"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); /* Solver */ @@ -1034,36 +1038,36 @@ static void rna_def_softbody(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "rklimit"); RNA_def_property_range(prop, 0.001f, 10.0f); RNA_def_property_ui_text(prop, "Error Limit", "The Runge-Kutta ODE solver error limit, low value gives more precision, high values speed"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "minstep", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "minloops"); RNA_def_property_range(prop, 0, 30000); RNA_def_property_ui_text(prop, "Min Step", "Minimal # solver steps/frame"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "maxstep", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "maxloops"); RNA_def_property_range(prop, 0, 30000); RNA_def_property_ui_text(prop, "Max Step", "Maximal # solver steps/frame"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "choke", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "choke"); RNA_def_property_range(prop, 0, 100); RNA_def_property_ui_text(prop, "Choke", "'Viscosity' inside collision target"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "fuzzy", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "fuzzyness"); RNA_def_property_range(prop, 1, 100); RNA_def_property_ui_text(prop, "Fuzzy", "Fuzzyness while on collision, high values make collsion handling faster but less stable"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "auto_step", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "solverflags", SBSO_OLDERR); RNA_def_property_ui_text(prop, "V", "Use velocities for automagic step sizes"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "diagnose", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "solverflags", SBSO_MONITOR); @@ -1074,37 +1078,37 @@ static void rna_def_softbody(BlenderRNA *brna) prop= RNA_def_property(srna, "use_goal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_use_goal_get", "rna_SoftBodySettings_use_goal_set"); RNA_def_property_ui_text(prop, "Use Goal", "Define forces for vertices to stick to animated position."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "use_edges", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_use_edges_get", "rna_SoftBodySettings_use_edges_set"); RNA_def_property_ui_text(prop, "Use Edges", "Use Edges as springs"); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "stiff_quads", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_stiff_quads_get", "rna_SoftBodySettings_stiff_quads_set"); RNA_def_property_ui_text(prop, "Stiff Quads", "Adds diagonal springs on 4-gons."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "edge_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_edge_collision_get", "rna_SoftBodySettings_edge_collision_set"); RNA_def_property_ui_text(prop, "Edge Collision", "Edges collide too."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "face_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_face_collision_get", "rna_SoftBodySettings_face_collision_set"); RNA_def_property_ui_text(prop, "Face Collision", "Faces collide too, SLOOOOOW warning."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "new_aero", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_new_aero_get", "rna_SoftBodySettings_new_aero_set"); RNA_def_property_ui_text(prop, "N", "New aero(uses angle and length)."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); prop= RNA_def_property(srna, "self_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_SoftBodySettings_self_collision_get", "rna_SoftBodySettings_self_collision_set"); RNA_def_property_ui_text(prop, "Self Collision", "Enable naive vertex ball self collision."); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + RNA_def_property_update(prop, 0, "rna_softbody_update"); } void RNA_def_object_force(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index a1f35eca3c2..2525209c3be 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -114,12 +114,14 @@ static void rna_Particle_redo(bContext *C, PointerRNA *ptr) psys->recalc = PSYS_RECALC_REDO; if(ob) - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } else { part = ptr->id.data; psys_flush_particle_settings(scene, part, PSYS_RECALC_REDO); } + + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL); } static void rna_Particle_reset(bContext *C, PointerRNA *ptr) @@ -134,13 +136,15 @@ static void rna_Particle_reset(bContext *C, PointerRNA *ptr) psys->recalc = PSYS_RECALC_RESET; if(ob) { - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } } else { part = ptr->id.data; psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET); } + + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL); } static void rna_Particle_target_reset(bContext *C, PointerRNA *ptr) @@ -172,22 +176,23 @@ static void rna_Particle_target_reset(bContext *C, PointerRNA *ptr) psys->recalc = PSYS_RECALC_RESET; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); DAG_scene_sort(scene); } + + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL); } static void rna_Particle_target_redo(bContext *C, PointerRNA *ptr) { - Scene *scene = CTX_data_scene(C); - if(ptr->type==&RNA_ParticleTarget) { Object *ob = (Object*)ptr->id.data; ParticleSystem *psys = psys_get_current(ob); psys->recalc = PSYS_RECALC_REDO; - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL); } } @@ -203,13 +208,15 @@ static void rna_Particle_change_type(bContext *C, PointerRNA *ptr) psys->recalc = PSYS_RECALC_RESET|PSYS_RECALC_TYPE; if(ob) { - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } } else { part = ptr->id.data; psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET|PSYS_RECALC_TYPE); } + + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL); } static void rna_Particle_change_physics(bContext *C, PointerRNA *ptr) @@ -217,6 +224,7 @@ static void rna_Particle_change_physics(bContext *C, PointerRNA *ptr) Scene *scene = CTX_data_scene(C); ParticleSettings *part = ptr->id.data; psys_flush_particle_settings(scene, part, PSYS_RECALC_RESET|PSYS_RECALC_PHYS); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL); } static void rna_Particle_redo_child(bContext *C, PointerRNA *ptr) @@ -231,13 +239,15 @@ static void rna_Particle_redo_child(bContext *C, PointerRNA *ptr) psys->recalc = PSYS_RECALC_CHILD; if(ob) - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } else { part = ptr->id.data; psys_flush_particle_settings(scene, part, PSYS_RECALC_CHILD); } + + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL); } static PointerRNA rna_particle_settings_get(PointerRNA *ptr) { @@ -892,19 +902,19 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_REACT_STA_END); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Start/End", "Give birth to unreacted particles eventually."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "react_multiple", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_REACT_MULTIPLE); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Multi React", "React multiple times."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "loop", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_LOOP); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Loop", "Loop particle lives."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* TODO: used somewhere? */ prop= RNA_def_property(srna, "hair_geometry", PROP_BOOLEAN, PROP_NONE); @@ -914,94 +924,94 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "unborn", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_UNBORN); RNA_def_property_ui_text(prop, "Unborn", "Show particles before they are emitted."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "died", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_DIED); RNA_def_property_ui_text(prop, "Died", "Show particles after they have died"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "trand", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_TRAND); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Random", "Emit in random order of elements"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "even_distribution", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_EDISTR); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Even Distribution", "Use even distribution from faces based on face areas or edge lengths."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "sticky", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_STICKY); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Sticky", "Particles stick to collided objects if they die in the collision."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "die_on_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_DIE_ON_COL); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Die on hit", "Particles die when they collide with a deflector object."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "size_deflect", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SIZE_DEFL); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Size Deflect", "Use particle's size in deflection."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "rotation_dynamic", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ROT_DYN); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Dynamic", "Sets rotation to dynamic/constant"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "sizemass", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SIZEMASS); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Mass from Size", "Multiply mass with particle size."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "boids_2d", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_BOIDS_2D); RNA_def_property_ui_text(prop, "Boids 2D", "Constrain boids to a surface"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "branching", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_BRANCHING); RNA_def_property_ui_text(prop, "Branching", "Branch child paths from each other."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "animate_branching", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ANIM_BRANCHING); RNA_def_property_ui_text(prop, "Animated", "Animate branching"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "symmetric_branching", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SYMM_BRANCHING); RNA_def_property_ui_text(prop, "Symmetric", "Start and end points are the same."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "hair_bspline", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_HAIR_BSPLINE); RNA_def_property_ui_text(prop, "B-Spline", "Interpolate hair using B-Splines."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "grid_invert", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_GRID_INVERT); RNA_def_property_ui_text(prop, "Invert", "Invert what is considered object and what is not."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "child_effector", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_EFFECT); RNA_def_property_ui_text(prop, "Children", "Apply effectors to children."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "child_seams", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_SEAMS); RNA_def_property_ui_text(prop, "Use seams", "Use seams to determine parents"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); /* TODO: used somewhere? */ prop= RNA_def_property(srna, "child_render", PROP_BOOLEAN, PROP_NONE); @@ -1011,19 +1021,19 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "child_guide", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_CHILD_GUIDE); RNA_def_property_ui_text(prop, "child_guide", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "self_effect", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_SELF_EFFECT); RNA_def_property_ui_text(prop, "Self Effect", "Particle effectors effect themselves."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, type_items); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Type", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_change_type"); + RNA_def_property_update(prop, 0, "rna_Particle_change_type"); prop= RNA_def_property(srna, "emit_from", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "from"); @@ -1031,14 +1041,14 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_from_itemf"); RNA_def_property_ui_text(prop, "Emit From", "Where to emit particles from"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "distribution", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "distr"); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_enum_items(prop, dist_items); RNA_def_property_ui_text(prop, "Distribution", "How to distribute particles on selected element"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* physics modes */ prop= RNA_def_property(srna, "physics_type", PROP_ENUM, PROP_NONE); @@ -1046,130 +1056,130 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_enum_items(prop, phys_type_items); RNA_def_property_ui_text(prop, "Physics Type", "Particle physics type"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_change_physics"); + RNA_def_property_update(prop, 0, "rna_Particle_change_physics"); prop= RNA_def_property(srna, "rotation_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rotmode"); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_enum_items(prop, rot_mode_items); RNA_def_property_ui_text(prop, "Rotation", "Particles initial rotation"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "angular_velocity_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "avemode"); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_enum_items(prop, ave_mode_items); RNA_def_property_ui_text(prop, "Angular Velocity Mode", "Particle angular velocity mode."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "react_event", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "reactevent"); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_enum_items(prop, react_event_items); RNA_def_property_ui_text(prop, "React On", "The event of target particles to react on."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /*draw flag*/ prop= RNA_def_property(srna, "velocity", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_VEL); RNA_def_property_ui_text(prop, "Velocity", "Show particle velocity"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "show_size", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_SIZE); RNA_def_property_ui_text(prop, "Size", "Show particle size"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "emitter", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_EMITTER); RNA_def_property_ui_text(prop, "Emitter", "Render emitter Object also."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "draw_health", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_HEALTH); RNA_def_property_ui_text(prop, "Health", "Draw boid health"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "abs_path_time", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_ABS_PATH_TIME); RNA_def_property_ui_text(prop, "Absolute Path Time", "Path timing is in absolute frames"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_abspathtime_update"); + RNA_def_property_update(prop, 0, "rna_Particle_abspathtime_update"); prop= RNA_def_property(srna, "billboard_lock", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_BB_LOCK); RNA_def_property_ui_text(prop, "Lock Billboard", "Lock the billboards align axis"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "parent", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_PARENT); RNA_def_property_ui_text(prop, "Parents", "Render parent particles."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "num", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_NUM); RNA_def_property_ui_text(prop, "Number", "Show particle number"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "rand_group", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_RAND_GR); RNA_def_property_ui_text(prop, "Pick Random", "Pick objects from group randomly"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "render_adaptive", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_REN_ADAPT); RNA_def_property_ui_text(prop, "Adaptive render", "Draw steps of the particle path"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "velocity_length", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_VEL_LENGTH); RNA_def_property_ui_text(prop, "Speed", "Multiply line length by particle speed"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "material_color", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_MAT_COL); RNA_def_property_ui_text(prop, "Material Color", "Draw particles using material's diffuse color."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "whole_group", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_WHOLE_GR); RNA_def_property_ui_text(prop, "Whole Group", "Use whole group at once."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "render_strand", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_REN_STRAND); RNA_def_property_ui_text(prop, "Strand render", "Use the strand primitive for rendering"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "draw_as", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "draw_as"); RNA_def_property_enum_items(prop, part_draw_as_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_draw_as_itemf"); RNA_def_property_ui_text(prop, "Particle Drawing", "How particles are drawn in viewport"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "ren_as", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ren_as"); RNA_def_property_enum_items(prop, part_ren_as_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Particle_ren_as_itemf"); RNA_def_property_ui_text(prop, "Particle Rendering", "How particles are rendered"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "draw_size", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 10); RNA_def_property_ui_text(prop, "Draw Size", "Size of particles on viewport in pixels (0=default)"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "child_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "childtype"); RNA_def_property_enum_items(prop, child_type_items); RNA_def_property_ui_text(prop, "Children From", "Create child particles"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 7); RNA_def_property_ui_range(prop, 0, 10, 1, 0); RNA_def_property_ui_text(prop, "Steps", "How many steps paths are drawn with (power of 2)"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "render_step", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ren_step"); @@ -1180,7 +1190,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "hair_step", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 2, 50); RNA_def_property_ui_text(prop, "Segments", "Number of hair segments"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); //TODO: not found in UI, readonly? @@ -1203,13 +1213,13 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "disp"); RNA_def_property_range(prop, 0, 100); RNA_def_property_ui_text(prop, "Display", "Percentage of particles to display in 3d view"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "material", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "omat"); RNA_def_property_range(prop, 1, 16); RNA_def_property_ui_text(prop, "Material", "Specify material used for the particles"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); //TODO: is this read only/internal? @@ -1221,24 +1231,24 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "integrator", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, integrator_type_items); RNA_def_property_ui_text(prop, "Integration", "Select physics integrator type"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "kink", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, kink_type_items); RNA_def_property_ui_text(prop, "Kink", "Type of periodic offset on the path"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "kink_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, kink_axis_items); RNA_def_property_ui_text(prop, "Axis", "Which axis to use for offset"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); /* billboards */ prop= RNA_def_property(srna, "billboard_align", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "bb_align"); RNA_def_property_enum_items(prop, bb_align_items); RNA_def_property_ui_text(prop, "Align to", "In respect to what the billboards are aligned"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "billboard_uv_split", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "bb_uv_split"); @@ -1260,13 +1270,13 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "bb_tilt"); RNA_def_property_range(prop, -1.0f, 1.0f); RNA_def_property_ui_text(prop, "Tilt", "Tilt of the billboards"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "billboard_random_tilt", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bb_rand_tilt"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Random Tilt", "Random tilt of the billboards"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "billboard_offset", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "bb_offset"); @@ -1274,7 +1284,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_range(prop, -100.0f, 100.0f); RNA_def_property_ui_range(prop, -1.0, 1.0, 0.1, 3); RNA_def_property_ui_text(prop, "Billboard Offset", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); /* simplification */ prop= RNA_def_property(srna, "enable_simplify", PROP_BOOLEAN, PROP_NONE); @@ -1309,7 +1319,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_float_funcs(prop, NULL, "rna_PartSettings_start_set", NULL); RNA_def_property_ui_text(prop, "Start", "Frame # to start emitting particles."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "end", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); @@ -1317,37 +1327,37 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_float_funcs(prop, NULL, "rna_PartSettings_end_set", NULL); RNA_def_property_ui_text(prop, "End", "Frame # to stop emitting particles."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "lifetime", PROP_FLOAT, PROP_TIME); RNA_def_property_range(prop, 1.0f, MAXFRAMEF); RNA_def_property_ui_text(prop, "Lifetime", "Specify the life span of the particles"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "random_lifetime", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "randlife"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Random", "Give the particle life a random variation."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "time_tweak", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "timetweak"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Tweak", "A multiplier for physics timestep (1.0 means one frame = 1/25 seconds)"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "jitter_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_float_sdna(prop, NULL, "jitfac"); RNA_def_property_range(prop, 0.0f, 2.0f); RNA_def_property_ui_text(prop, "Amount", "Amount of jitter applied to the sampling."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "effect_hair", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "eff_hair"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Stiffnes", "Hair stiffness for effectors"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "amount", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "totpart"); @@ -1358,14 +1368,14 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_range(prop, 0, 10000000); RNA_def_property_ui_range(prop, 0, 100000, 1, 0); RNA_def_property_ui_text(prop, "Amount", "Total number of particles."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "userjit", PROP_INT, PROP_UNSIGNED);//TODO: can we get a better name for userjit? RNA_def_property_int_sdna(prop, NULL, "userjit"); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_range(prop, 0, 1000); RNA_def_property_ui_text(prop, "P/F", "Emission locations / face (0 = automatic)."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "grid_resolution", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "grid_res"); @@ -1373,102 +1383,102 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_range(prop, 1, 46); /* ~100k particles in a cube */ RNA_def_property_ui_range(prop, 1, 215, 1, 0); /* ~10M particles in a cube */ RNA_def_property_ui_text(prop, "Resolution", "The resolution of the particle grid."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* initial velocity factors */ prop= RNA_def_property(srna, "normal_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "normfac");//optional if prop names are the same RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_text(prop, "Normal", "Let the surface normal give the particle a starting speed."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "object_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "obfac"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Object", "Let the object give the particle a starting speed"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "random_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "randfac");//optional if prop names are the same RNA_def_property_range(prop, 0.0f, 200.0f); RNA_def_property_ui_text(prop, "Random", "Give the starting speed a random variation."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "particle_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "partfac"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, -1.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Particle", "Let the target particle give the particle a starting speed."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "tangent_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "tanfac"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_text(prop, "Tangent", "Let the surface tangent give the particle a starting speed."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "tangent_phase", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "tanphase"); RNA_def_property_range(prop, -1.0f, 1.0f); RNA_def_property_ui_text(prop, "Rot", "Rotate the surface tangent."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "reactor_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "reactfac"); RNA_def_property_range(prop, -10.0f, 10.0f); RNA_def_property_ui_text(prop, "Reactor", "Let the vector away from the target particles location give the particle a starting speed."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "angular_velocity_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "avefac"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_text(prop, "Angular Velocity", "Angular velocity amount"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "phase_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "phasefac"); RNA_def_property_range(prop, -1.0f, 1.0f); RNA_def_property_ui_text(prop, "Phase", "Initial rotation phase"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "random_rotation_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "randrotfac"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Random Rotation", "Randomize rotation"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "random_phase_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "randphasefac"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Random Phase", "Randomize rotation phase"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* physical properties */ prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.001f, 100000.0f); RNA_def_property_ui_range(prop, 0.01f, 100.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Mass", "Specify the mass of the particles"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "particle_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "size"); RNA_def_property_range(prop, 0.001f, 100000.0f); RNA_def_property_ui_range(prop, 0.01f, 100.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Size", "The size of the particles"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "random_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "randsize"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Random Size", "Give the particle size a random variation"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "reaction_shape", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "reactshape"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Shape", "Power of reaction strength dependence on distance to target."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* global physical properties */ @@ -1477,38 +1487,38 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_text(prop, "Acceleration", "Constant acceleration"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION); RNA_def_property_float_sdna(prop, NULL, "acc[2]"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_text(prop, "Gravity", "Constant acceleration in global Z axis direction"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "drag_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dragfac"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Drag", "Specify the amount of air-drag."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "brownian_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "brownfac"); RNA_def_property_range(prop, 0.0f, 200.0f); RNA_def_property_ui_text(prop, "Brownian", "Specify the amount of brownian motion"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "damp_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dampfac"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Damp", "Specify the amount of damping"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* random length */ prop= RNA_def_property(srna, "random_length", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "randlength"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Random Length", "Give path length a random variation."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); /* children */ prop= RNA_def_property(srna, "child_nbr", PROP_INT, PROP_NONE); @@ -1516,7 +1526,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_range(prop, 0, 100000); RNA_def_property_ui_range(prop, 0, 1000, 1, 0); RNA_def_property_ui_text(prop, "Children Per Parent", "Amount of children/parent"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "rendered_child_nbr", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ren_child_nbr"); @@ -1528,45 +1538,45 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "parents"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Virtual Parents", "Relative amount of virtual parents."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "child_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "childsize"); RNA_def_property_range(prop, 0.001f, 100000.0f); RNA_def_property_ui_range(prop, 0.01f, 100.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Child Size", "A multiplier for the child particle size."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "child_random_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "childrandsize"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Random Child Size", "Random variation to the size of the child particles."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "child_radius", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "childrad"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Child Radius", "Radius of children around parent."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "child_roundness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "childflat"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Child Roundness", "Roundness of children around parent."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); /* clumping */ prop= RNA_def_property(srna, "clump_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "clumpfac"); RNA_def_property_range(prop, -1.0f, 1.0f); RNA_def_property_ui_text(prop, "Clump", "Amount of clumping"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "clumppow", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "clumppow"); RNA_def_property_range(prop, -0.999f, 0.999f); RNA_def_property_ui_text(prop, "Shape", "Shape of clumping"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); /* kink */ @@ -1575,19 +1585,19 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_range(prop, -100000.0f, 100000.0f); RNA_def_property_ui_range(prop, -10.0f, 10.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Amplitude", "The amplitude of the offset."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "kink_frequency", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "kink_freq"); RNA_def_property_range(prop, -100000.0f, 100000.0f); RNA_def_property_ui_range(prop, -10.0f, 10.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Frequency", "The frequency of the offset (1/total length)"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "kink_shape", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, -0.999f, 0.999f); RNA_def_property_ui_text(prop, "Shape", "Adjust the offset to the beginning/end"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); /* rough */ @@ -1595,64 +1605,64 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f, 100000.0f); RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Rough1", "Amount of location dependent rough."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "rough1_size", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.01f, 100000.0f); RNA_def_property_ui_range(prop, 0.01f, 10.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Size1", "Size of location dependent rough."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "rough2", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rough2"); RNA_def_property_range(prop, 0.0f, 100000.0f); RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Rough2", "Amount of random rough."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "rough2_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rough2_size"); RNA_def_property_range(prop, 0.01f, 100000.0f); RNA_def_property_ui_range(prop, 0.01f, 10.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Size2", "Size of random rough."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "rough2_thres", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rough2_thres"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Threshold", "Amount of particles left untouched by random rough."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "rough_endpoint", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rough_end"); RNA_def_property_range(prop, 0.0f, 100000.0f); RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Rough Endpoint", "Amount of end point rough."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "rough_end_shape", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Shape", "Shape of end point rough"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "child_length", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "clength"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Length", "Length of child paths"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "child_length_thres", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "clength_thres"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Threshold", "Amount of particles left untouched by child path length."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); /* branching */ prop= RNA_def_property(srna, "branch_threshold", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "branch_thres"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Threshold", "Threshold of branching."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); /* drawing stuff */ prop= RNA_def_property(srna, "line_length_tail", PROP_FLOAT, PROP_NONE); @@ -1660,33 +1670,33 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f, 100000.0f); RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Back", "Length of the line's tail"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "line_length_head", PROP_FLOAT, PROP_NONE); RNA_def_property_float_funcs(prop, "rna_PartSetting_linelenhead_get", "rna_PartSetting_linelenhead_set", NULL); RNA_def_property_range(prop, 0.0f, 100000.0f); RNA_def_property_ui_range(prop, 0.0f, 10.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Head", "Length of the line's head"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "path_start", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "path_start"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_PartSetting_pathstartend_range"); RNA_def_property_ui_text(prop, "Path Start", "Starting time of drawn path."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "path_end", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "path_end"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_PartSetting_pathstartend_range"); RNA_def_property_ui_text(prop, "Path End", "End time of drawn path."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "trail_count", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "trail_count"); RNA_def_property_range(prop, 1, 100000); RNA_def_property_ui_range(prop, 1, 100, 1, 0); RNA_def_property_ui_text(prop, "Trail Count", "Number of trail particles."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); /* keyed particles */ prop= RNA_def_property(srna, "keyed_loops", PROP_INT, PROP_NONE); @@ -1694,7 +1704,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_range(prop, 1.0f, 10000.0f); RNA_def_property_ui_range(prop, 1.0f, 100.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Loop count", "Number of times the keys are looped."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); /* boids */ prop= RNA_def_property(srna, "boids", PROP_POINTER, PROP_NONE); @@ -1709,21 +1719,21 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Group"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Dupli Group", "Show Objects in this Group in place of particles"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "dupli_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "dup_ob"); RNA_def_property_struct_type(prop, "Object"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Dupli Object", "Show this Object in place of particles."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "billboard_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "bb_ob"); RNA_def_property_struct_type(prop, "Object"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Billboard Object", "Billboards face this object (default is active camera)"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); /* effectors */ prop= RNA_def_property(srna, "effector_group", PROP_POINTER, PROP_NONE); @@ -1731,77 +1741,77 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Group"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Effector Group", "Limit effectors to this Group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "eweight_all", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "effector_weight[0]"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "All", "All effector's weight."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "eweight_spherical", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "effector_weight[1]"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Spherical", "Spherical effector weight."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "eweight_vortex", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "effector_weight[2]"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Vortex", "Vortex effector weight."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "eweight_magnetic", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "effector_weight[3]"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Magnetic", "Magnetic effector weight."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "eweight_wind", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "effector_weight[4]"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Wind", "Wind effector weight."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "eweight_curveguide", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "effector_weight[5]"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Curve Guide", "Curve guide effector weight."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "eweight_texture", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "effector_weight[6]"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Magnetic", "Texture effector weight."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "eweight_harmonic", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "effector_weight[7]"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Harmonic", "Harmonic effector weight."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "eweight_charge", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "effector_weight[8]"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Charge", "Charge effector weight."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "eweight_lennardjones", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "effector_weight[9]"); RNA_def_property_range(prop, -200.0f, 200.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Lennard-Jones", "Lennard-Jones effector weight."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* animation here? */ rna_def_animdata_common(srna); @@ -1836,25 +1846,25 @@ static void rna_def_particle_target(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "ob"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Target Object", "The object that has the target particle system (empty if same object)."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_target_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_target_reset"); prop= RNA_def_property(srna, "system", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "psys"); RNA_def_property_range(prop, 1, INT_MAX); RNA_def_property_ui_text(prop, "Target Particle System", "The index of particle system on the target object."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_target_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_target_reset"); prop= RNA_def_property(srna, "time", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "time"); RNA_def_property_range(prop, 0.0, 30000.0f); //TODO: replace 30000 with MAXFRAMEF when available in 2.5 RNA_def_property_ui_text(prop, "Time", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_target_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_target_redo"); prop= RNA_def_property(srna, "duration", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "duration"); RNA_def_property_range(prop, 0.0, 30000.0f); //TODO: replace 30000 with MAXFRAMEF when available in 2.5 RNA_def_property_ui_text(prop, "Duration", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_target_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_target_redo"); prop= RNA_def_property(srna, "valid", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PTARGET_VALID); @@ -1865,7 +1875,7 @@ static void rna_def_particle_target(BlenderRNA *brna) RNA_def_property_enum_items(prop, mode_items); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Mode", ""); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_target_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_target_reset"); } static void rna_def_particle_system(BlenderRNA *brna) @@ -1889,7 +1899,7 @@ static void rna_def_particle_system(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_pointer_funcs(prop, "rna_particle_settings_get", "rna_particle_settings_set", NULL); RNA_def_property_ui_text(prop, "Settings", "Particle system settings."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "particles", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "particles", "totpart"); @@ -1903,7 +1913,7 @@ static void rna_def_particle_system(BlenderRNA *brna) prop= RNA_def_property(srna, "seed", PROP_INT, PROP_UNSIGNED); RNA_def_property_ui_text(prop, "Seed", "Offset in the random number table, to get a different randomized result."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* hair */ prop= RNA_def_property(srna, "softbody", PROP_POINTER, PROP_NONE); @@ -1919,20 +1929,20 @@ static void rna_def_particle_system(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "target_ob"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Reactor Target Object", "For reactor systems, the object that has the target particle system (empty if same object)."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "reactor_target_particle_system", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "target_psys"); RNA_def_property_range(prop, 1, INT_MAX); RNA_def_property_ui_text(prop, "Reactor Target Particle System", "For reactor systems, index of particle system on the target object."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* keyed */ prop= RNA_def_property(srna, "keyed_timing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_KEYED_TIMING); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Keyed timing", "Use key times"); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "ParticleTarget"); @@ -1968,122 +1978,122 @@ static void rna_def_particle_system(BlenderRNA *brna) prop= RNA_def_property(srna, "vertex_group_density", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[0]"); RNA_def_property_ui_text(prop, "Vertex Group Density", "Vertex group to control density."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "vertex_group_density_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_DENSITY)); RNA_def_property_ui_text(prop, "Vertex Group Density Negate", "Negate the effect of the density vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "vertex_group_velocity", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[1]"); RNA_def_property_ui_text(prop, "Vertex Group Velocity", "Vertex group to control velocity."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "vertex_group_velocity_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_VEL)); RNA_def_property_ui_text(prop, "Vertex Group Velocity Negate", "Negate the effect of the velocity vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "vertex_group_length", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[2]"); RNA_def_property_ui_text(prop, "Vertex Group Length", "Vertex group to control length."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "vertex_group_length_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_LENGTH)); RNA_def_property_ui_text(prop, "Vertex Group Length Negate", "Negate the effect of the length vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); prop= RNA_def_property(srna, "vertex_group_clump", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[3]"); RNA_def_property_ui_text(prop, "Vertex Group Clump", "Vertex group to control clump."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "vertex_group_clump_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_CLUMP)); RNA_def_property_ui_text(prop, "Vertex Group Clump Negate", "Negate the effect of the clump vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "vertex_group_kink", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[4]"); RNA_def_property_ui_text(prop, "Vertex Group Kink", "Vertex group to control kink."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "vertex_group_kink_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_KINK)); RNA_def_property_ui_text(prop, "Vertex Group Kink Negate", "Negate the effect of the kink vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "vertex_group_roughness1", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[5]"); RNA_def_property_ui_text(prop, "Vertex Group Roughness 1", "Vertex group to control roughness 1."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "vertex_group_roughness1_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGH1)); RNA_def_property_ui_text(prop, "Vertex Group Roughness 1 Negate", "Negate the effect of the roughness 1 vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "vertex_group_roughness2", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[6]"); RNA_def_property_ui_text(prop, "Vertex Group Roughness 2", "Vertex group to control roughness 2."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "vertex_group_roughness2_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGH2)); RNA_def_property_ui_text(prop, "Vertex Group Roughness 2 Negate", "Negate the effect of the roughness 2 vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "vertex_group_roughness_end", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[7]"); RNA_def_property_ui_text(prop, "Vertex Group Roughness End", "Vertex group to control roughness end."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "vertex_group_roughness_end_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROUGHE)); RNA_def_property_ui_text(prop, "Vertex Group Roughness End Negate", "Negate the effect of the roughness end vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo_child"); + RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop= RNA_def_property(srna, "vertex_group_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[8]"); RNA_def_property_ui_text(prop, "Vertex Group Size", "Vertex group to control size."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "vertex_group_size_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_SIZE)); RNA_def_property_ui_text(prop, "Vertex Group Size Negate", "Negate the effect of the size vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "vertex_group_tangent", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[9]"); RNA_def_property_ui_text(prop, "Vertex Group Tangent", "Vertex group to control tangent."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "vertex_group_tangent_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_TAN)); RNA_def_property_ui_text(prop, "Vertex Group Tangent Negate", "Negate the effect of the tangent vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "vertex_group_rotation", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[10]"); RNA_def_property_ui_text(prop, "Vertex Group Rotation", "Vertex group to control rotation."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "vertex_group_rotation_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_ROT)); RNA_def_property_ui_text(prop, "Vertex Group Rotation Negate", "Negate the effect of the rotation vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "vertex_group_field", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "vgroup[11]"); RNA_def_property_ui_text(prop, "Vertex Group Field", "Vertex group to control field."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "vertex_group_field_negate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "vg_neg", (1 << PSYS_VG_EFFECTOR)); RNA_def_property_ui_text(prop, "Vertex Group Field Negate", "Negate the effect of the field vertex group."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* pointcache */ prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NEVER_NULL); @@ -2101,7 +2111,7 @@ static void rna_def_particle_system(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "parent"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Parent", "Use this object's coordinate system instead of global coordinate system."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + RNA_def_property_update(prop, 0, "rna_Particle_redo"); /* hair or cache editing */ prop= RNA_def_property(srna, "editable", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 727e3ff6a6d..6c951b5a1b7 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -55,7 +55,7 @@ static void rna_Pose_update(bContext *C, PointerRNA *ptr) { // XXX when to use this? ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK); - DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_DATA); + DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA); } static char *rna_PoseChannel_path(PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index b00119efaf6..5575b170398 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -45,13 +45,6 @@ static EnumPropertyItem particle_edit_hair_brush_items[] = { {PE_BRUSH_CUT, "CUT", 0, "Cut", "Cut hairs."}, {0, NULL, 0, NULL, NULL}}; -static EnumPropertyItem particle_edit_cache_brush_items[] = { - {PE_BRUSH_NONE, "NONE", 0, "None", "Don't use any brush."}, - {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb paths."}, - {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth paths."}, - {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make paths longer or shorter."}, - {0, NULL, 0, NULL, NULL}}; - #ifdef RNA_RUNTIME #include "BKE_context.h" @@ -61,6 +54,13 @@ static EnumPropertyItem particle_edit_cache_brush_items[] = { #include "ED_particle.h" +static EnumPropertyItem particle_edit_cache_brush_items[] = { + {PE_BRUSH_NONE, "NONE", 0, "None", "Don't use any brush."}, + {PE_BRUSH_COMB, "COMB", 0, "Comb", "Comb paths."}, + {PE_BRUSH_SMOOTH, "SMOOTH", 0, "Smooth", "Smooth paths."}, + {PE_BRUSH_LENGTH, "LENGTH", 0, "Length", "Make paths longer or shorter."}, + {0, NULL, 0, NULL, NULL}}; + static PointerRNA rna_ParticleEdit_brush_get(PointerRNA *ptr) { ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data; @@ -72,7 +72,6 @@ static PointerRNA rna_ParticleEdit_brush_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, &RNA_ParticleBrush, brush); } - static PointerRNA rna_ParticleBrush_curve_get(PointerRNA *ptr) { return rna_pointer_inherit_refine(ptr, &RNA_CurveMapping, NULL); @@ -113,11 +112,9 @@ static void rna_ParticleEdit_redo(bContext *C, PointerRNA *ptr) static void rna_ParticleEdit_update(bContext *C, PointerRNA *ptr) { - Scene *scene = CTX_data_scene(C); Object *ob = CTX_data_active_object(C); - if(ob) - DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + if(ob) DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *ptr, int *free) diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c index d7c70d8b9e9..b3192b110f4 100644 --- a/source/blender/makesrna/intern/rna_smoke.c +++ b/source/blender/makesrna/intern/rna_smoke.c @@ -52,7 +52,7 @@ static void rna_Smoke_update(bContext *C, PointerRNA *ptr) { - DAG_object_flush_update(CTX_data_scene(C), ptr->id.data, OB_RECALC_DATA); + DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA); } static void rna_Smoke_dependency_update(bContext *C, PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index d6a17526a65..0ac7fa40727 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -375,65 +375,68 @@ static void rna_def_space_image_uv(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "sticky"); RNA_def_property_enum_items(prop, sticky_mode_items); RNA_def_property_ui_text(prop, "Sticky Selection Mode", "Automatically select also UVs sharing the same vertex as the ones being selected."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); /* drawing */ prop= RNA_def_property(srna, "edge_draw_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "dt_uv"); RNA_def_property_enum_items(prop, dt_uv_items); RNA_def_property_ui_text(prop, "Edge Draw Type", "Draw type for drawing UV edges."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "draw_smooth_edges", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_SMOOTH_UV); RNA_def_property_ui_text(prop, "Draw Smooth Edges", "Draw UV edges anti-aliased."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "draw_stretch", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_STRETCH); RNA_def_property_ui_text(prop, "Draw Stretch", "Draw faces colored according to the difference in shape between UVs and their 3D coordinates (blue for low distortion, red for high distortion)."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "draw_stretch_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "dt_uvstretch"); RNA_def_property_enum_items(prop, dt_uvstretch_items); RNA_def_property_ui_text(prop, "Draw Stretch Type", "Type of stretch to draw."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "draw_modified_edges", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWSHADOW); RNA_def_property_ui_text(prop, "Draw Modified Edges", "Draw edges after modifiers are applied."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "draw_other_objects", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_OTHER); RNA_def_property_ui_text(prop, "Draw Other Objects", "Draw other selected objects that share the same image."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "normalized_coordinates", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_COORDFLOATS); RNA_def_property_ui_text(prop, "Normalized Coordinates", "Display UV coordinates from 0.0 to 1.0 rather than in pixels."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); /* todo: move edge and face drawing options here from G.f */ prop= RNA_def_property(srna, "snap_to_pixels", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_PIXELSNAP); RNA_def_property_ui_text(prop, "Snap to Pixels", "Snap UVs to pixel locations while editing."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "constrain_to_image_bounds", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_CLIP_UV); RNA_def_property_ui_text(prop, "Constrain to Image Bounds", "Constraint to stay within the image bounds while editing."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "live_unwrap", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_LIVE_UNWRAP); RNA_def_property_ui_text(prop, "Live Unwrap", "Continuously unwrap the selected UV island while transforming pinned vertices."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "pivot", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "around"); RNA_def_property_enum_items(prop, pivot_items); RNA_def_property_ui_text(prop, "Pivot", "Rotation/Scaling Pivot."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); } static void rna_def_space_outliner(BlenderRNA *brna) @@ -464,12 +467,12 @@ static void rna_def_space_outliner(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "outlinevis"); RNA_def_property_enum_items(prop, display_mode_items); RNA_def_property_ui_text(prop, "Display Mode", "Type of information to display"); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL); prop= RNA_def_property(srna, "show_restriction_columns", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SO_HIDE_RESTRICTCOLS); RNA_def_property_ui_text(prop, "Show Restriction Columns", "Show colum"); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_OUTLINER, NULL); } @@ -486,35 +489,34 @@ static void rna_def_background_image(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "ima"); RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space."); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "iuser"); RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "xof"); RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally from the view center"); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "yof"); RNA_def_property_ui_text(prop, "Y Offset", "Offsets image vertically from the view center"); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "size"); RNA_def_property_ui_text(prop, "Size", "Scaling factor for the background image."); RNA_def_property_range(prop, 0.0, FLT_MAX); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "transparency", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "blend"); RNA_def_property_ui_text(prop, "Transparency", "Amount to blend the image against the background color."); RNA_def_property_range(prop, 0.0, 1.0); - RNA_def_property_update(prop, NC_WINDOW, NULL); - + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); } static void rna_def_space_3dview(BlenderRNA *brna) @@ -553,10 +555,12 @@ static void rna_def_space_3dview(BlenderRNA *brna) prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "camera"); RNA_def_property_ui_text(prop, "Camera", "Active camera used in this view (when unlocked from the scene's active camera)."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "lock_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "ob_centre"); RNA_def_property_ui_text(prop, "Lock Object", "3D View center is locked to this object's position"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "background_image", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "bgpic"); @@ -566,136 +570,142 @@ static void rna_def_space_3dview(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "drawtype"); RNA_def_property_enum_items(prop, viewport_shading_items); RNA_def_property_ui_text(prop, "Viewport Shading", "Method to display/shade objects in the 3D View."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "localview", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "localview", 0); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Local View", "Display an isolated sub-set of objects, apart from the scene visibility."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "lens"); RNA_def_property_ui_text(prop, "Lens", "Lens angle (mm) in perspective view."); RNA_def_property_range(prop, 1.0f, 250.0f); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "near"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_text(prop, "Clip Start", "3D View near clipping distance."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "far"); RNA_def_property_range(prop, 1.0f, FLT_MAX); RNA_def_property_ui_text(prop, "Clip End", "3D View far clipping distance."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "grid_spacing", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "grid"); RNA_def_property_ui_text(prop, "Grid Spacing", "The distance between 3D View grid lines."); RNA_def_property_range(prop, 0.0f, FLT_MAX); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "grid_lines", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "gridlines"); RNA_def_property_ui_text(prop, "Grid Lines", "The number of grid lines to display in perspective view."); RNA_def_property_range(prop, 0, 1024); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "grid_subdivisions", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "gridsubdiv"); RNA_def_property_ui_text(prop, "Grid Subdivisions", "The number of subdivisions between grid lines."); RNA_def_property_range(prop, 1, 1024); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "display_floor", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_FLOOR); RNA_def_property_ui_text(prop, "Display Grid Floor", "Show the ground plane grid in perspective view."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "display_x_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_X); RNA_def_property_ui_text(prop, "Display X Axis", "Show the X axis line in perspective view."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "display_y_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Y); RNA_def_property_ui_text(prop, "Display Y Axis", "Show the Y axis line in perspective view."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "display_z_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_Z); RNA_def_property_ui_text(prop, "Display Z Axis", "Show the Z axis line in perspective view."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "outline_selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_SELECT_OUTLINE); RNA_def_property_ui_text(prop, "Outline Selected", "Show an outline highlight around selected objects in non-wireframe views."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "all_object_centers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DRAW_CENTERS); RNA_def_property_ui_text(prop, "All Object Centers", "Show the object center dot for all (selected and unselected) objects."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "relationship_lines", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", V3D_HIDE_HELPLINES); RNA_def_property_ui_text(prop, "Relationship Lines", "Show dashed lines indicating parent or constraint relationships."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "textured_solid", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag2", V3D_SOLID_TEX); RNA_def_property_ui_text(prop, "Textured Solid", "Display face-assigned textures in solid view"); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "display_background_image", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, NULL, "rna_View3D_display_background_image_set"); RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_DISPBGPIC); RNA_def_property_ui_text(prop, "Display Background Image", "Display a reference image behind objects in the 3D View"); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "pivot_point", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "around"); RNA_def_property_enum_items(prop, pivot_items); RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "manipulator", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_USE_MANIPULATOR); RNA_def_property_ui_text(prop, "Manipulator", "Use a 3D manipulator widget for controlling transforms."); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "manipulator_translate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_TRANSLATE); RNA_def_property_ui_text(prop, "Manipulator Translate", "Use the manipulator for movement transformations."); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "manipulator_rotate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_ROTATE); RNA_def_property_ui_text(prop, "Manipulator Rotate", "Use the manipulator for rotation transformations."); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "manipulator_scale", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_SCALE); RNA_def_property_ui_text(prop, "Manipulator Scale", "Use the manipulator for scale transformations."); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "transform_orientation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "twmode"); RNA_def_property_enum_items(prop, transform_orientation_items); RNA_def_property_ui_text(prop, "Transform Orientation", "The alignment of manipulator handles."); - RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "lock_rotation", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, "RegionView3D", "viewlock", RV3D_LOCKED); RNA_def_property_ui_text(prop, "Lock", "Lock View Rotation"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "box_preview", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, "RegionView3D", "viewlock", RV3D_BOXVIEW); RNA_def_property_ui_text(prop, "Box", ""); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "box_clip", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, "RegionView3D", "viewlock", RV3D_BOXCLIP); RNA_def_property_ui_text(prop, "Clip", ""); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); } static void rna_def_space_buttons(BlenderRNA *brna) @@ -730,19 +740,19 @@ static void rna_def_space_buttons(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "mainb"); RNA_def_property_enum_items(prop, buttons_context_items); RNA_def_property_ui_text(prop, "Context", "Type of active data to display and edit."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL); prop= RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "align"); RNA_def_property_enum_items(prop, align_items); RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceProperties_align_set", NULL); RNA_def_property_ui_text(prop, "Align", "Arrangement of the panels."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL); prop= RNA_def_property(srna, "brush_texture", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SB_BRUSH_TEX); RNA_def_property_ui_text(prop, "Brush Texture", "Show brush textures."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL); /* pinned data */ prop= RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE); @@ -750,6 +760,7 @@ static void rna_def_space_buttons(BlenderRNA *brna) RNA_def_property_struct_type(prop, "ID"); RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_SpaceProperties_pin_id_typef"); RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, NULL); } static void rna_def_space_image(BlenderRNA *brna) @@ -766,35 +777,35 @@ static void rna_def_space_image(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceImageEditor_image_set", NULL); RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space."); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "image_user", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "iuser"); RNA_def_property_ui_text(prop, "Image User", "Parameters defining which layer, pass and frame of the image is displayed."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "curves", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "cumap"); RNA_def_property_ui_text(prop, "Curves", "Color curve mapping to use for displaying the image."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "image_pin", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "pin", 0); RNA_def_property_ui_text(prop, "Image Pin", "Display current image regardless of object selection."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); /* image draw */ prop= RNA_def_property(srna, "draw_repeated", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAW_TILE); RNA_def_property_ui_text(prop, "Draw Repeated", "Draw the image repeated outside of the main view."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); prop= RNA_def_property(srna, "draw_channels", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, dc_all_items); RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_SpaceImageEditor_draw_channels_itemf"); RNA_def_property_ui_text(prop, "Draw Channels", "Channels of the image to draw."); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); /* uv */ prop= RNA_def_property(srna, "uv_editor", PROP_POINTER, PROP_NEVER_NULL); @@ -807,7 +818,7 @@ static void rna_def_space_image(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", SI_DRAWTOOL); RNA_def_property_ui_text(prop, "Image Painting", "Enable image painting mode."); RNA_def_property_ui_icon(prop, ICON_TPAINT_HLT, 0); - RNA_def_property_update(prop, NC_IMAGE|ND_DISPLAY, "rna_SpaceImageEditor_paint_update"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, "rna_SpaceImageEditor_paint_update"); /* grease pencil */ prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); @@ -866,64 +877,69 @@ static void rna_def_space_sequencer(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "mainb"); RNA_def_property_enum_items(prop, display_mode_items); RNA_def_property_ui_text(prop, "Display Mode", "The view mode to use for displaying sequencer output."); - RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); /* flag's */ prop= RNA_def_property(srna, "draw_frames", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAWFRAMES); RNA_def_property_ui_text(prop, "Draw Frames", "Draw frames rather then seconds."); - RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); prop= RNA_def_property(srna, "transform_markers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MARKER_TRANS); RNA_def_property_ui_text(prop, "Transform Markers", "Transform markers as well as strips."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); prop= RNA_def_property(srna, "seperate_color_preview", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_COLOR_SEPERATED); RNA_def_property_ui_text(prop, "Seperate Colors", "Seperate color channels in preview."); - RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); prop= RNA_def_property(srna, "draw_safe_margin", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_SAFE_MARGINS); RNA_def_property_ui_text(prop, "Safe Margin", "Draw title safe margins in preview."); - RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); prop= RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_GPENCIL); RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit the grease pencil freehand annotations overlay."); - RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); /* grease pencil */ prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "gpd"); RNA_def_property_struct_type(prop, "UnknownType"); RNA_def_property_ui_text(prop, "Grease Pencil", "Grease pencil data for this space."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); prop= RNA_def_property(srna, "display_channel", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "chanshown"); RNA_def_property_ui_text(prop, "Display Channel", "The channel number shown in the image preview. 0 is the result of all strips combined."); RNA_def_property_range(prop, 0, 32); // MAXSEQ --- todo, move from BKE_sequence.h - RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); prop= RNA_def_property(srna, "draw_overexposed", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "zebra"); RNA_def_property_ui_text(prop, "Show Overexposed", "Show overexposed areas with zebra stripes."); RNA_def_property_range(prop, 0, 110); - RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); /* not sure we need rna access to these but adding anyway */ prop= RNA_def_property(srna, "offset_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "xof"); RNA_def_property_ui_text(prop, "X Offset", "Offsets image horizontally from the view center"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); prop= RNA_def_property(srna, "offset_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "yof"); RNA_def_property_ui_text(prop, "Y Offset", "Offsets image horizontally from the view center"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); prop= RNA_def_property(srna, "zoom", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "zoom"); RNA_def_property_ui_text(prop, "Zoom", "Display zoom level"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_SEQUENCER, NULL); } static void rna_def_space_text(BlenderRNA *brna) @@ -940,63 +956,68 @@ static void rna_def_space_text(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Text", "Text displayed and edited in this space."); RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceTextEditor_text_set", NULL); - RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); /* display */ prop= RNA_def_property(srna, "syntax_highlight", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "showsyntax", 0); RNA_def_property_ui_text(prop, "Syntax Highlight", "Syntax highlight for scripting."); RNA_def_property_ui_icon(prop, ICON_SYNTAX_OFF, 1); - RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); prop= RNA_def_property(srna, "word_wrap", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "wordwrap", 0); RNA_def_property_boolean_funcs(prop, NULL, "rna_SpaceTextEditor_word_wrap_set"); RNA_def_property_ui_text(prop, "Word Wrap", "Wrap words if there is not enough horizontal space."); RNA_def_property_ui_icon(prop, ICON_WORDWRAP_OFF, 1); - RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); prop= RNA_def_property(srna, "line_numbers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "showlinenrs", 0); RNA_def_property_ui_text(prop, "Line Numbers", "Show line numbers next to the text."); RNA_def_property_ui_icon(prop, ICON_LINENUMBERS_OFF, 1); - RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); prop= RNA_def_property(srna, "overwrite", PROP_BOOLEAN, PROP_NONE); RNA_def_property_ui_text(prop, "Overwrite", "Overwrite characters when typing rather than inserting them."); - RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); prop= RNA_def_property(srna, "live_edit", PROP_BOOLEAN, PROP_NONE); RNA_def_property_ui_text(prop, "Live Edit", "Run python while editing."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); prop= RNA_def_property(srna, "tab_width", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "tabnumber"); RNA_def_property_range(prop, 2, 8); RNA_def_property_ui_text(prop, "Tab Width", "Number of spaces to display tabs with."); - RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); prop= RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "lheight"); RNA_def_property_range(prop, 8, 32); RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text."); - RNA_def_property_update(prop, NC_TEXT|ND_DISPLAY, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); /* find */ prop= RNA_def_property(srna, "find_all", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_ALL); RNA_def_property_ui_text(prop, "Find All", "Search in all text datablocks, instead of only the active one."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); prop= RNA_def_property(srna, "find_wrap", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", ST_FIND_WRAP); RNA_def_property_ui_text(prop, "Find Wrap", "Search again from the start of the file when reaching the end."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); prop= RNA_def_property(srna, "find_text", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "findstr"); RNA_def_property_ui_text(prop, "Find Text", "Text to search for with the find tool."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); prop= RNA_def_property(srna, "replace_text", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "replacestr"); RNA_def_property_ui_text(prop, "Replace Text", "Text to replace selected text with using the replace tool."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); } static void rna_def_space_dopesheet(BlenderRNA *brna) @@ -1021,25 +1042,30 @@ static void rna_def_space_dopesheet(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, mode_items); RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL); /* display */ prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_DRAWTIME); RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL); prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NODRAWCFRANUM); RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL); prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SACTION_SLIDERS); RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL); /* editing */ prop= RNA_def_property(srna, "automerge_keyframes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SACTION_NOTRANSKEYCULL); RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Show handles of Bezier control points."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_DOPESHEET, NULL); // TODO... autosnap, dopesheet? } @@ -1064,33 +1090,40 @@ static void rna_def_space_graph(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, mode_items); RNA_def_property_ui_text(prop, "Mode", "Editing context being displayed."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); /* display */ prop= RNA_def_property(srna, "show_seconds", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_DRAWTIME); RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NODRAWCFRANUM); RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); prop= RNA_def_property(srna, "show_sliders", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SLIDERS); RNA_def_property_ui_text(prop, "Show Sliders", "Show sliders beside F-Curve channels."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); prop= RNA_def_property(srna, "show_handles", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_NOHANDLES); RNA_def_property_ui_text(prop, "Show Handles", "Show handles of Bezier control points."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); prop= RNA_def_property(srna, "only_selected_curves_handles", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SIPO_SELCUVERTSONLY); RNA_def_property_ui_text(prop, "Only Selected Curve Keyframes", "Only keyframes of selected F-Curves are visible and editable."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); /* editing */ prop= RNA_def_property(srna, "automerge_keyframes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SIPO_NOTRANSKEYCULL); RNA_def_property_ui_text(prop, "AutoMerge Keyframes", "Show handles of Bezier control points."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_GRAPH, NULL); // TODO... autosnap, dopesheet? } @@ -1109,14 +1142,17 @@ static void rna_def_space_nla(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", SNLA_DRAWTIME); RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX for now, only set with operator RNA_def_property_ui_text(prop, "Show Seconds", "Show timing in seconds not frames."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL); prop= RNA_def_property(srna, "show_cframe_indicator", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NODRAWCFRANUM); RNA_def_property_ui_text(prop, "Show Frame Number Indicator", "Show frame number beside the current frame indicator line."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL); prop= RNA_def_property(srna, "show_strip_curves", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", SNLA_NOSTRIPCURVES); RNA_def_property_ui_text(prop, "Show Control Curves", "Show influence curves on strips."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NLA, NULL); /* editing */ // TODO... autosnap, dopesheet? @@ -1136,43 +1172,44 @@ static void rna_def_space_time(BlenderRNA *brna) prop= RNA_def_property(srna, "play_top_left", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_REGION); RNA_def_property_ui_text(prop, "Top-Left 3D Window", ""); - RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update"); prop= RNA_def_property(srna, "play_all_3d", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_3D_WIN); RNA_def_property_ui_text(prop, "All 3D Windows", ""); - RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update"); prop= RNA_def_property(srna, "play_anim", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_ANIM_WIN); RNA_def_property_ui_text(prop, "Animation Windows", ""); - RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update"); prop= RNA_def_property(srna, "play_buttons", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_BUTS_WIN); RNA_def_property_ui_text(prop, "Properties Windows", ""); - RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update"); prop= RNA_def_property(srna, "play_image", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_ALL_IMAGE_WIN); RNA_def_property_ui_text(prop, "Image Windows", ""); - RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update"); prop= RNA_def_property(srna, "play_sequencer", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_SEQ); RNA_def_property_ui_text(prop, "Sequencer Windows", ""); - RNA_def_property_update(prop, 0, "rna_SpaceTime_redraw_update"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, "rna_SpaceTime_redraw_update"); /* Other options */ prop= RNA_def_property(srna, "continue_physics", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws", TIME_CONTINUE_PHYSICS); RNA_def_property_ui_text(prop, "Continue Physics", "During playblack, continue physics simulations regardless of the frame number"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL); prop= RNA_def_property(srna, "only_selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TIME_ONLYACTSEL); RNA_def_property_ui_text(prop, "Only Selected channels", "Show keyframes only from active/selected channels."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TIME, NULL); } static void rna_def_console_line(BlenderRNA *brna) @@ -1182,15 +1219,17 @@ static void rna_def_console_line(BlenderRNA *brna) srna = RNA_def_struct(brna, "ConsoleLine", NULL); RNA_def_struct_ui_text(srna, "Console Input", "Input line for the interactive console."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL); prop= RNA_def_property(srna, "line", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_ConsoleLine_line_get", "rna_ConsoleLine_line_length", "rna_ConsoleLine_line_set"); RNA_def_property_ui_text(prop, "Line", "Text in the line."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL); prop= RNA_def_property(srna, "current_character", PROP_INT, PROP_NONE); /* copied from text editor */ RNA_def_property_int_sdna(prop, NULL, "cursor"); RNA_def_property_int_funcs(prop, NULL, NULL, "rna_ConsoleLine_cursor_index_range"); - + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL); } static EnumPropertyItem console_type_items[] = { @@ -1212,39 +1251,39 @@ static void rna_def_space_console(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "lheight"); RNA_def_property_range(prop, 8, 32); RNA_def_property_ui_text(prop, "Font Size", "Font size to use for displaying the text."); - RNA_def_property_update(prop, NC_CONSOLE | ND_CONSOLE, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL); prop= RNA_def_property(srna, "console_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, console_type_items); RNA_def_property_ui_text(prop, "Type", "Console type."); - RNA_def_property_update(prop, NC_CONSOLE | ND_CONSOLE, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL); /* reporting display */ prop= RNA_def_property(srna, "show_report_debug", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", CONSOLE_RPT_DEBUG); RNA_def_property_ui_text(prop, "Show Debug", "Display debug reporting info."); - RNA_def_property_update(prop, NC_CONSOLE | ND_CONSOLE_REPORT, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE_REPORT, NULL); prop= RNA_def_property(srna, "show_report_info", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", CONSOLE_RPT_INFO); RNA_def_property_ui_text(prop, "Show Info", "Display general information."); - RNA_def_property_update(prop, NC_CONSOLE | ND_CONSOLE_REPORT, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE_REPORT, NULL); prop= RNA_def_property(srna, "show_report_operator", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", CONSOLE_RPT_OP); RNA_def_property_ui_text(prop, "Show Operator", "Display the operator log."); - RNA_def_property_update(prop, NC_CONSOLE | ND_CONSOLE_REPORT, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE_REPORT, NULL); prop= RNA_def_property(srna, "show_report_warn", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", CONSOLE_RPT_WARN); RNA_def_property_ui_text(prop, "Show Warn", "Display warnings."); - RNA_def_property_update(prop, NC_CONSOLE | ND_CONSOLE_REPORT, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE_REPORT, NULL); prop= RNA_def_property(srna, "show_report_error", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "rpt_mask", CONSOLE_RPT_ERR); RNA_def_property_ui_text(prop, "Show Error", "Display error text."); - RNA_def_property_update(prop, NC_CONSOLE | ND_CONSOLE_REPORT, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE_REPORT, NULL); @@ -1292,82 +1331,82 @@ static void rna_def_fileselect_params(BlenderRNA *brna) prop= RNA_def_property(srna, "directory", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "dir"); RNA_def_property_ui_text(prop, "Directory", "Directory displayed in the file browser."); - RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); prop= RNA_def_property(srna, "file", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "file"); RNA_def_property_ui_text(prop, "File Name", "Active file in the file browser."); - RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); prop= RNA_def_property(srna, "display", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "display"); RNA_def_property_enum_items(prop, file_display_items); RNA_def_property_ui_text(prop, "Display Mode", "Display mode for the file list"); - RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); prop= RNA_def_property(srna, "do_filter", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_FILTER); RNA_def_property_ui_text(prop, "Filter Files", "Enable filtering of files."); - RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL); prop= RNA_def_property(srna, "hide_dot", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", FILE_HIDE_DOT); RNA_def_property_ui_text(prop, "Hide Dot Files", "Hide hidden dot files."); - RNA_def_property_update(prop, NC_FILE | ND_FILELIST , NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST , NULL); prop= RNA_def_property(srna, "sort", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "sort"); RNA_def_property_enum_items(prop, file_sort_items); RNA_def_property_ui_text(prop, "Sort", ""); - RNA_def_property_update(prop, NC_FILE | ND_PARAMS, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); prop= RNA_def_property(srna, "filter_image", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filter", IMAGEFILE); RNA_def_property_ui_text(prop, "Filter Images", "Show image files."); RNA_def_property_ui_icon(prop, ICON_FILE_IMAGE, 0); - RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL); prop= RNA_def_property(srna, "filter_blender", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filter", BLENDERFILE); RNA_def_property_ui_text(prop, "Filter Blender", "Show .blend files."); RNA_def_property_ui_icon(prop, ICON_FILE_BLEND, 0); - RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL); prop= RNA_def_property(srna, "filter_movie", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filter", MOVIEFILE); RNA_def_property_ui_text(prop, "Filter Movies", "Show movie files."); RNA_def_property_ui_icon(prop, ICON_FILE_MOVIE, 0); - RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL); prop= RNA_def_property(srna, "filter_script", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filter", PYSCRIPTFILE); RNA_def_property_ui_text(prop, "Filter Script", "Show script files."); RNA_def_property_ui_icon(prop, ICON_FILE_SCRIPT, 0); - RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL); prop= RNA_def_property(srna, "filter_font", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filter", FTFONTFILE); RNA_def_property_ui_text(prop, "Filter Fonts", "Show font files."); RNA_def_property_ui_icon(prop, ICON_FILE_FONT, 0); - RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL); prop= RNA_def_property(srna, "filter_sound", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filter", SOUNDFILE); RNA_def_property_ui_text(prop, "Filter Sound", "Show sound files."); RNA_def_property_ui_icon(prop, ICON_FILE_SOUND, 0); - RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL); prop= RNA_def_property(srna, "filter_text", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filter", TEXTFILE); RNA_def_property_ui_text(prop, "Filter Text", "Show text files."); RNA_def_property_ui_icon(prop, ICON_FILE_BLANK, 0); - RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL); prop= RNA_def_property(srna, "filter_folder", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "filter", FOLDERFILE); RNA_def_property_ui_text(prop, "Filter Folder", "Show folders."); RNA_def_property_ui_icon(prop, ICON_FILE_FOLDER, 0); - RNA_def_property_update(prop, NC_FILE | ND_FILELIST, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_FILE_LIST, NULL); } @@ -1430,13 +1469,13 @@ static void rna_def_space_node(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "treetype"); RNA_def_property_enum_items(prop, tree_type_items); RNA_def_property_ui_text(prop, "Tree Type", "Node tree type to display and edit."); - RNA_def_property_update(prop, NC_NODE, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, NULL); prop= RNA_def_property(srna, "texture_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "texfrom"); RNA_def_property_enum_items(prop, texture_type_items); RNA_def_property_ui_text(prop, "Texture Type", "Type of data to take texture from."); - RNA_def_property_update(prop, NC_NODE, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, NULL); prop= RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -1454,7 +1493,7 @@ static void rna_def_space_node(BlenderRNA *brna) prop= RNA_def_property(srna, "backdrop", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_BACKDRAW); RNA_def_property_ui_text(prop, "Backdrop", "Use active Viewer Node output as backdrop for compositing nodes."); - RNA_def_property_update(prop, NC_NODE, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE, NULL); } static void rna_def_space_logic(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index a0716cc7dc7..ffc3f1696fc 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -33,6 +33,7 @@ #include "DNA_space_types.h" #include "DNA_userdef_types.h" +#include "WM_api.h" #include "WM_types.h" #include "BKE_utildefines.h" @@ -41,7 +42,12 @@ #ifdef RNA_RUNTIME -static void rna_userdef_lmb_select_set(struct PointerRNA *ptr,int value) +static void rna_userdef_update(bContext *C, PointerRNA *ptr) +{ + WM_event_add_notifier(C, NC_WINDOW, NULL); +} + +static void rna_userdef_lmb_select_set(PointerRNA *ptr,int value) { UserDef *userdef = (UserDef*)ptr->data; @@ -53,12 +59,12 @@ static void rna_userdef_lmb_select_set(struct PointerRNA *ptr,int value) userdef->flag &= ~USER_LMOUSESELECT; } -static void rna_userdef_rmb_select_set(struct PointerRNA *ptr,int value) +static void rna_userdef_rmb_select_set(PointerRNA *ptr,int value) { rna_userdef_lmb_select_set(ptr, !value); } -static void rna_userdef_emulate_set(struct PointerRNA *ptr,int value) +static void rna_userdef_emulate_set(PointerRNA *ptr,int value) { UserDef *userdef = (UserDef*)ptr->data; @@ -68,7 +74,7 @@ static void rna_userdef_emulate_set(struct PointerRNA *ptr,int value) userdef->flag ^= USER_TWOBUTTONMOUSE; } -static int rna_userdef_autokeymode_get(struct PointerRNA *ptr) +static int rna_userdef_autokeymode_get(PointerRNA *ptr) { UserDef *userdef = (UserDef*)ptr->data; short retval = userdef->autokey_mode; @@ -79,7 +85,7 @@ static int rna_userdef_autokeymode_get(struct PointerRNA *ptr) return retval; } -static void rna_userdef_autokeymode_set(struct PointerRNA *ptr,int value) +static void rna_userdef_autokeymode_set(PointerRNA *ptr,int value) { UserDef *userdef = (UserDef*)ptr->data; @@ -142,38 +148,38 @@ static void rna_def_userdef_theme_ui_font_style(BlenderRNA *brna) prop= RNA_def_property(srna, "points", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 6, 48); RNA_def_property_ui_text(prop, "Points", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "font_kerning_style", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "kerning"); RNA_def_property_enum_items(prop, font_kerning_style); RNA_def_property_ui_text(prop, "Kerning Style", "Which style to use for font kerning."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "shadow", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 5); RNA_def_property_ui_text(prop, "Shadow Size", "Shadow size in pixels (0, 3 and 5 supported)"); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "shadx", PROP_INT, PROP_NONE); RNA_def_property_range(prop, -10, 10); RNA_def_property_ui_text(prop, "Shadow X Offset", "Shadow offset in pixels"); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "shady", PROP_INT, PROP_NONE); RNA_def_property_range(prop, -10, 10); RNA_def_property_ui_text(prop, "Shadow Y Offset", "Shadow offset in pixels"); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "shadowalpha", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Shadow Alpha", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "shadowcolor", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Shadow Brightness", "Shadow color in grey value"); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_ui_style(BlenderRNA *brna) @@ -195,25 +201,25 @@ static void rna_def_userdef_theme_ui_style(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "paneltitle"); RNA_def_property_struct_type(prop, "ThemeFontStyle"); RNA_def_property_ui_text(prop, "Panel Font", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "grouplabel", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "grouplabel"); RNA_def_property_struct_type(prop, "ThemeFontStyle"); RNA_def_property_ui_text(prop, "Group Label Font", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "widgetlabel", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "widgetlabel"); RNA_def_property_struct_type(prop, "ThemeFontStyle"); RNA_def_property_ui_text(prop, "Widget Label Font", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "widget", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "widget"); RNA_def_property_struct_type(prop, "ThemeFontStyle"); RNA_def_property_ui_text(prop, "Widget Font", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } @@ -229,47 +235,47 @@ static void rna_def_userdef_theme_ui_wcol(BlenderRNA *brna) prop= RNA_def_property(srna, "outline", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Outline", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "inner", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Inner", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "inner_sel", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Inner Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "item", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Item", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Text", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "text_sel", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Text Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "shaded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "shaded", 1); RNA_def_property_ui_text(prop, "Shaded", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "shadetop", PROP_INT, PROP_NONE); RNA_def_property_range(prop, -100, 100); RNA_def_property_ui_text(prop, "Shade Top", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "shadedown", PROP_INT, PROP_NONE); RNA_def_property_range(prop, -100, 100); RNA_def_property_ui_text(prop, "Shade Down", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_ui_wcol_state(BlenderRNA *brna) @@ -284,36 +290,36 @@ static void rna_def_userdef_theme_ui_wcol_state(BlenderRNA *brna) prop= RNA_def_property(srna, "inner_anim", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Animated", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "inner_anim_sel", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Animated Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "inner_key", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Keyframe", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "inner_key_sel", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Keyframe Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "inner_driven", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Driven", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "inner_driven_sel", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Driven Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "blend", PROP_FLOAT, PROP_PERCENTAGE); RNA_def_property_ui_text(prop, "Blend", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_ui(BlenderRNA *brna) @@ -332,102 +338,102 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "wcol_regular"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Regular Widget Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_tool", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_tool"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Tool Widget Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_radio", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_radio"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Radio Widget Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_text", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_text"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Text Widget Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_option", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_option"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Option Widget Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_toggle", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_toggle"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Toggle Widget Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_num", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_num"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Number Widget Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_numslider", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_numslider"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Slider Widget Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_box", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_box"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Box Backdrop Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_menu", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Menu Widget Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_pulldown", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_pulldown"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Pulldown Widget Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_menu_back", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu_back"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Menu Backdrop Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_menu_item", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_menu_item"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Menu Item Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_scroll", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_scroll"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "Scroll Widget Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_list_item", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_list_item"); RNA_def_property_struct_type(prop, "ThemeWidgetColors"); RNA_def_property_ui_text(prop, "List Item Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wcol_state", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "wcol_state"); RNA_def_property_struct_type(prop, "ThemeWidgetStateColors"); RNA_def_property_ui_text(prop, "State Colors", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "icon_file", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_sdna(prop, NULL, "iconfile"); RNA_def_property_ui_text(prop, "Icon File", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_spaces_main(StructRNA *srna, int spacetype) @@ -438,60 +444,60 @@ static void rna_def_userdef_theme_spaces_main(StructRNA *srna, int spacetype) prop= RNA_def_property(srna, "back", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Window Back", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "title", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Window Title", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "text", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Window Text", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "text_hi", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Window Text Highlight", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); /* header */ prop= RNA_def_property(srna, "header", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Header", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "header_text", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Header Text", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "header_text_hi", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Header Text Highlight", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); /* buttons */ if(! ELEM(spacetype, SPACE_BUTS, SPACE_OUTLINER)) { prop= RNA_def_property(srna, "button", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Button Back", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "button_title", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Button Title", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "button_text", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Button Text", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "button_text_hi", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Button Text Highlight", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } /* list/channels */ @@ -499,22 +505,22 @@ static void rna_def_userdef_theme_spaces_main(StructRNA *srna, int spacetype) prop= RNA_def_property(srna, "list", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "List Back", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "list_title", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "List Title", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "list_text", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "List Text", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "list_text_hi", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "List Text Highlight", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } } @@ -525,17 +531,17 @@ static void rna_def_userdef_theme_spaces_vertex(StructRNA *srna) prop= RNA_def_property(srna, "vertex", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Vertex", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "vertex_select", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Vertex Select", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "vertex_size", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 1, 10); RNA_def_property_ui_text(prop, "Vertex Size", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_spaces_edge(StructRNA *srna) @@ -545,22 +551,22 @@ static void rna_def_userdef_theme_spaces_edge(StructRNA *srna) prop= RNA_def_property(srna, "edge_select", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "edge Select", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "edge_seam", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Edge Seam", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "edge_sharp", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Edge Sharp", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "edge_facesel", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Edge UV Face Select", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_spaces_face(StructRNA *srna) @@ -570,22 +576,22 @@ static void rna_def_userdef_theme_spaces_face(StructRNA *srna) prop= RNA_def_property(srna, "face", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Face", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "face_select", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Face Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "face_dot", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Face Dot Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "facedot_size", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 1, 10); RNA_def_property_ui_text(prop, "Face Dot Size", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna) @@ -604,51 +610,51 @@ static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna) prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Grid", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Panel", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Wire", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "lamp", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Lamp", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "object_selected", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "select"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Object Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "object_active", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "active"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Active Object", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "object_grouped", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "group"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Object Grouped", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "object_grouped_active", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "group_active"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Object Grouped Active", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "transform", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Transform", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); rna_def_userdef_theme_spaces_vertex(srna); rna_def_userdef_theme_spaces_edge(srna); @@ -657,28 +663,28 @@ static void rna_def_userdef_theme_space_view3d(BlenderRNA *brna) prop= RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Active Vert/Edge/Face", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Normal", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "bone_solid", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Bone Solid", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "bone_pose", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Bone Pose", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "current_frame", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "cframe"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Current Frame", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_graph(BlenderRNA *brna) @@ -697,24 +703,24 @@ static void rna_def_userdef_theme_space_graph(BlenderRNA *brna) prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Grid", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Panel", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade1"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Window Sliders", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "channels_region", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade2"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Channels Region", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); rna_def_userdef_theme_spaces_vertex(srna); @@ -722,46 +728,46 @@ static void rna_def_userdef_theme_space_graph(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "cframe"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Current Frame", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "handle_vertex", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Handle Vertex", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "handle_vertex_select", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Handle Vertex Select", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "handle_vertex_size", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 255); RNA_def_property_ui_text(prop, "Handle Vertex Size", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "channel_group", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "group"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Channel Group", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "active_channels_group", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "group_active"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Active Channel Group", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "ds_channel"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "DopeSheet Channel", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "dopesheet_subchannel", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "ds_subchannel"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "DopeSheet Sub-Channel", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_file(BlenderRNA *brna) @@ -781,37 +787,37 @@ static void rna_def_userdef_theme_space_file(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "hilite"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Selected File", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "tiles", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "panel"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Tiles", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "scrollbar", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade1"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Scrollbar", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "scroll_handle", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade2"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Scroll Handle", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "active_file", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "active"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Active File", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "active_file_text", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "grid"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Active File Text", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_outliner(BlenderRNA *brna) @@ -871,55 +877,55 @@ static void rna_def_userdef_theme_space_text(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "grid"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Line Numbers Background", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "scroll_bar", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade1"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Scroll Bar", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade2"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Selected Text", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "cursor", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "hilite"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Cursor", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "syntax_builtin", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "syntaxb"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Syntax Builtin", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "syntax_special", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "syntaxv"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Syntax Special", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "syntax_comment", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "syntaxc"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Syntax Comment", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "syntax_string", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "syntaxl"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Syntax String", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "syntax_numbers", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "syntaxn"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Syntax Numbers", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_node(BlenderRNA *brna) @@ -939,49 +945,49 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "wire"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Wires", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "wire_select", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "edge_select"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Wire Select", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "selected_text", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade2"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Selected Text", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "node_backdrop", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "syntaxl"); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Node Backdrop", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "in_out_node", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "syntaxn"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "In/Out Node", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "converter_node", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "syntaxv"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Converter Node", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "operator_node", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "syntaxb"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Operator Node", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "group_node", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "syntaxc"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Group Node", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_logic(BlenderRNA *brna) @@ -1000,7 +1006,7 @@ static void rna_def_userdef_theme_space_logic(BlenderRNA *brna) prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Panel", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } @@ -1020,7 +1026,7 @@ static void rna_def_userdef_theme_space_buts(BlenderRNA *brna) prop= RNA_def_property(srna, "panel", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Panel", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_time(BlenderRNA *brna) @@ -1039,13 +1045,13 @@ static void rna_def_userdef_theme_space_time(BlenderRNA *brna) prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Grid", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "current_frame", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "cframe"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Current Frame", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_sound(BlenderRNA *brna) @@ -1064,19 +1070,19 @@ static void rna_def_userdef_theme_space_sound(BlenderRNA *brna) prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Grid", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade1"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Window Sliders", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "current_frame", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "cframe"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Current Frame", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_image(BlenderRNA *brna) @@ -1097,7 +1103,7 @@ static void rna_def_userdef_theme_space_image(BlenderRNA *brna) prop= RNA_def_property(srna, "editmesh_active", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Active Vert/Edge/Face", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_seq(BlenderRNA *brna) @@ -1114,79 +1120,79 @@ static void rna_def_userdef_theme_space_seq(BlenderRNA *brna) prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Grid", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "window_sliders", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade1"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Window Sliders", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "movie_strip", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "movie"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Movie Strip", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "image_strip", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "image"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Image Strip", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "scene_strip", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "scene"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Scene Strip", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "audio_strip", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "audio"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Audio Strip", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "effect_strip", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "effect"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Effect Strip", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "plugin_strip", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "plugin"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Plugin Strip", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "transition_strip", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "transition"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Transition Strip", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "meta_strip", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "meta"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Meta Strip", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "current_frame", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "cframe"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Current Frame", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "keyframe", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "vertex_select"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Keyframe", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "draw_action", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "bone_pose"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Draw Action", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_action(BlenderRNA *brna) @@ -1205,73 +1211,73 @@ static void rna_def_userdef_theme_space_action(BlenderRNA *brna) prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Grid", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "value_sliders", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "face"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Value Sliders", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "view_sliders", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade1"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "View Sliders", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "channels", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade2"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Channels", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "channels_selected", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "hilite"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Channels Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "channel_group", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "group"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Channel Group", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "active_channels_group", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "group_active"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Active Channel Group", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "long_key", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "strip"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Long Key", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "long_key_selected", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "strip_select"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Long Key Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "current_frame", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "cframe"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Current Frame", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "dopesheet_channel", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "ds_channel"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "DopeSheet Channel", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "dopesheet_subchannel", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "ds_subchannel"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "DopeSheet Sub-Channel", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_space_nla(BlenderRNA *brna) @@ -1290,43 +1296,43 @@ static void rna_def_userdef_theme_space_nla(BlenderRNA *brna) prop= RNA_def_property(srna, "grid", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Grid", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "view_sliders", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade1"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "View Sliders", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "bars", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "shade2"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Bars", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "bars_selected", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "hilite"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Bars Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "strips", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "strip"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "strips", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "strips_selected", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "strip_select"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Strips Selected", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "current_frame", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "cframe"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Current Frame", ""); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_theme_colorset(BlenderRNA *brna) @@ -1342,23 +1348,23 @@ static void rna_def_userdef_theme_colorset(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "solid"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Normal", "Color used for the surface of bones."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "selected", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "select"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Selected", "Color used for selected bones."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "active", PROP_FLOAT, PROP_COLOR); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Active", "Color used for active bones."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "colored_constraints", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TH_WIRECOLOR_CONSTCOLS); RNA_def_property_ui_text(prop, "Colored Constraints", "Allow the use of colors indicating constraints/keyed status."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_themes(BlenderRNA *brna) @@ -1547,27 +1553,27 @@ static void rna_def_userdef_view(BlenderRNA *brna) prop= RNA_def_property(srna, "display_object_info", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_DRAWVIEWINFO); RNA_def_property_ui_text(prop, "Display Object Info", "Display objects name and frame number in 3d view."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "global_scene", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", USER_SCENEGLOBAL); RNA_def_property_ui_text(prop, "Global Scene", "Forces the current Scene to be displayed in all Screens."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "use_large_cursors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "curssize", 0); RNA_def_property_ui_text(prop, "Large Cursors", "Use large mouse cursors when available."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "show_view_name", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_VIEWPORTNAME); RNA_def_property_ui_text(prop, "Show View Name", "Show the name of the view's direction in each 3D View."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "show_playback_fps", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_FPS); RNA_def_property_ui_text(prop, "Show Playback FPS", "Show the frames per second screen refresh rate, while animation is played back."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); /* menus */ prop= RNA_def_property(srna, "open_mouse_over", PROP_BOOLEAN, PROP_NONE); @@ -1662,19 +1668,19 @@ static void rna_def_userdef_view(BlenderRNA *brna) prop= RNA_def_property(srna, "show_mini_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_ROTVIEWICON); RNA_def_property_ui_text(prop, "Show Mini Axis", "Show a small rotating 3D axis in the bottom left corner of the 3D View."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "mini_axis_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "rvisize"); RNA_def_property_range(prop, 10, 64); RNA_def_property_ui_text(prop, "Mini Axis Size", "The axis icon's size."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "mini_axis_brightness", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "rvibright"); RNA_def_property_range(prop, 0, 10); RNA_def_property_ui_text(prop, "Mini Axis Brightness", "The brightness of the icon."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); /* middle mouse button */ prop= RNA_def_property(srna, "middle_mouse_rotate", PROP_BOOLEAN, PROP_NONE); @@ -1708,19 +1714,19 @@ static void rna_def_userdef_view(BlenderRNA *brna) prop= RNA_def_property(srna, "use_manipulator", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "tw_flag", 1); RNA_def_property_ui_text(prop, "Manipulator", "Use 3d transform manipulator."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "manipulator_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "tw_size"); RNA_def_property_range(prop, 2, 40); RNA_def_property_ui_text(prop, "Manipulator Size", "Diameter of widget, in 10 pixel units."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "manipulator_handle_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "tw_handlesize"); RNA_def_property_range(prop, 2, 40); RNA_def_property_ui_text(prop, "Manipulator Handle Size", "Size of widget handles as percentage of widget radius."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "manipulator_hotspot", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "tw_hotspot"); @@ -1731,7 +1737,7 @@ static void rna_def_userdef_view(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "obcenter_dia"); RNA_def_property_range(prop, 4, 10); RNA_def_property_ui_text(prop, "Object Center Size", "Diameter in Pixels for Object/Lamp center display."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "ndof_pan_speed", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ndof_pan"); @@ -1951,13 +1957,13 @@ static void rna_def_userdef_language(BlenderRNA *brna) prop= RNA_def_property(srna, "international_fonts", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_DOTRANSLATE); RNA_def_property_ui_text(prop, "International Fonts", "Use international fonts."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "dpi", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "dpi"); RNA_def_property_range(prop, 48, 128); RNA_def_property_ui_text(prop, "DPI", "Font size and resolution for display."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "scrollback", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "scrollback"); @@ -1969,27 +1975,27 @@ static void rna_def_userdef_language(BlenderRNA *brna) prop= RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, language_items); RNA_def_property_ui_text(prop, "Language", "Language use for translation."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "translate_tooltips", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_TOOLTIPS); RNA_def_property_ui_text(prop, "Translate Tooltips", "Translate Tooltips."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "translate_buttons", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_BUTTONS); RNA_def_property_ui_text(prop, "Translate Buttons", "Translate button labels."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "translate_toolbox", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_TR_MENUS); RNA_def_property_ui_text(prop, "Translate Toolbox", "Translate toolbox menu."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); prop= RNA_def_property(srna, "use_textured_fonts", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "transopts", USER_USETEXTUREFONT); RNA_def_property_ui_text(prop, "Textured Fonts", "Use textures for drawing international fonts."); - RNA_def_property_update(prop, NC_WINDOW, NULL); + RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_system(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index eaed0100386..148af2c28e9 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -419,6 +419,7 @@ static void rna_def_windowmanager(BlenderRNA *brna) srna= RNA_def_struct(brna, "WindowManager", "ID"); RNA_def_struct_ui_text(srna, "Window Manager", "Window manager datablock defining open windows and other user interface data."); + RNA_def_struct_clear_flag(srna, STRUCT_ID_REFCOUNT); RNA_def_struct_sdna(srna, "wmWindowManager"); prop= RNA_def_property(srna, "operators", PROP_COLLECTION, PROP_NONE); diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index 5687cb565d1..806f5409b0a 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -130,11 +130,10 @@ typedef struct wmNotifier { #define NC_BRUSH (11<<24) #define NC_TEXT (12<<24) #define NC_WORLD (13<<24) -#define NC_FILE (14<<24) -#define NC_ANIMATION (15<<24) -#define NC_CONSOLE (16<<24) -#define NC_NODE (17<<24) -#define NC_INFO (18<<24) +#define NC_ANIMATION (14<<24) +#define NC_SPACE (15<<24) +#define NC_NODE (15<<24) +#define NC_GEOM (16<<24) /* data type, 256 entries is enough, it can overlap */ #define NOTE_DATA 0x00FF0000 @@ -172,13 +171,12 @@ typedef struct wmNotifier { #define ND_POSE (18<<16) #define ND_BONE_ACTIVE (19<<16) #define ND_BONE_SELECT (20<<16) -#define ND_GEOM_SELECT (21<<16) -#define ND_DRAW (22<<16) -#define ND_MODIFIER (23<<16) -#define ND_KEYS (24<<16) -#define ND_GEOM_DATA (25<<16) -#define ND_CONSTRAINT (26<<16) -#define ND_PARTICLE (27<<16) +#define ND_DRAW (21<<16) +#define ND_MODIFIER (22<<16) /* modifiers edited */ +#define ND_KEYS (23<<16) +#define ND_CONSTRAINT (24<<16) /* constraints edited */ +#define ND_PARTICLE_DATA (25<<16) /* particles edited */ +#define ND_PARTICLE_SELECT (26<<16) /* particles selecting change */ /* NC_MATERIAL Material */ #define ND_SHADING (30<<16) @@ -193,10 +191,6 @@ typedef struct wmNotifier { #define ND_CURSOR (50<<16) #define ND_DISPLAY (51<<16) - /* NC_FILE Filebrowser */ -#define ND_PARAMS (60<<16) -#define ND_FILELIST (61<<16) - /* NC_ANIMATION Animato */ #define ND_KEYFRAME_SELECT (70<<16) #define ND_KEYFRAME_EDIT (71<<16) @@ -207,9 +201,28 @@ typedef struct wmNotifier { #define ND_NLA_EDIT (76<<16) #define ND_NLA_ACTCHANGE (77<<16) - /* console */ -#define ND_CONSOLE (78<<16) /* general redraw */ -#define ND_CONSOLE_REPORT (79<<16) /* update for reports, could spesify type */ + /* NC_GEOM Geometry */ + /* Mesh, Curve, MetaBall, Armature, .. */ +#define ND_SELECT (80<<16) +#define ND_DATA (81<<16) + + /* NC_SPACE */ +#define ND_SPACE_CONSOLE (1<<16) /* general redraw */ +#define ND_SPACE_CONSOLE_REPORT (2<<16) /* update for reports, could specify type */ +#define ND_SPACE_INFO (2<<16) +#define ND_SPACE_IMAGE (3<<16) +#define ND_SPACE_FILE_PARAMS (4<<16) +#define ND_SPACE_FILE_LIST (5<<16) +#define ND_SPACE_NODE (6<<16) +#define ND_SPACE_OUTLINER (7<<16) +#define ND_SPACE_VIEW3D (8<<16) +#define ND_SPACE_PROPERTIES (9<<16) +#define ND_SPACE_TEXT (10<<16) +#define ND_SPACE_TIME (11<<16) +#define ND_SPACE_GRAPH (12<<16) +#define ND_SPACE_DOPESHEET (13<<16) +#define ND_SPACE_NLA (14<<16) +#define ND_SPACE_SEQUENCER (15<<16) /* subtype, 256 entries too */ #define NOTE_SUBTYPE 0x0000FF00 diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index fecd5c20a15..38cf39c2081 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -108,7 +108,7 @@ void wm_operator_register(bContext *C, wmOperator *op) MEM_freeN(buf); /* so the console is redrawn */ - WM_event_add_notifier(C, NC_CONSOLE|ND_CONSOLE_REPORT, NULL); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_CONSOLE_REPORT, NULL); } diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 717c2d25261..c2c90f055b0 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -177,9 +177,9 @@ void wm_event_do_notifiers(bContext *C) do_anim= 1; } } - if(note->category == NC_SCENE || note->category == NC_OBJECT) { + if(ELEM3(note->category, NC_SCENE, NC_OBJECT, NC_GEOM)) { ED_info_stats_clear(CTX_data_scene(C)); - WM_event_add_notifier(C, NC_INFO, NULL); + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_INFO, NULL); } } if(do_anim) { From 670296dabe9c4c5444c696af54e1b4ef07a8e60b Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Fri, 4 Sep 2009 20:57:50 +0000 Subject: [PATCH 434/577] fix for relative path to build bplayer with cmake in windows (ffmpeg still needs to be off) --- source/blenderplayer/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blenderplayer/CMakeLists.txt b/source/blenderplayer/CMakeLists.txt index 30a1c08ebc9..76a1a405698 100644 --- a/source/blenderplayer/CMakeLists.txt +++ b/source/blenderplayer/CMakeLists.txt @@ -44,7 +44,7 @@ ADD_CUSTOM_COMMAND( ) IF(WIN32) - ADD_EXECUTABLE(blenderplayer ${EXETYPE} ${CMAKE_CURRENT_BINARY_DIR}/dna.c ../source/icons/winblender.rc) + ADD_EXECUTABLE(blenderplayer ${EXETYPE} ${CMAKE_CURRENT_BINARY_DIR}/dna.c ../icons/winblender.rc) ELSE(WIN32) ADD_EXECUTABLE(blenderplayer ${CMAKE_CURRENT_BINARY_DIR}/dna.c) ENDIF(WIN32) From 5dd9f7635afeda66ca4475288b1eb7ad621486f4 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 4 Sep 2009 21:02:43 +0000 Subject: [PATCH 435/577] 2.5 Make local and make single user are back for ID template. Internally these calls got unified, id_make_local and id_copy are now used to do these operations for all types that support it. Also reveals that for some ID types the implementation is still missing. Further, some small changes: * unlink_text is now in blenkernel. * copy_group was implemented. * ID template now has an open operator again. * fix preview to not change material reference count, even if temporary it shows up with threaded preview. * id_unlink unifies unlink for text, object and group. --- source/blender/blenkernel/BKE_armature.h | 1 - source/blender/blenkernel/BKE_group.h | 1 + source/blender/blenkernel/BKE_library.h | 3 + source/blender/blenkernel/BKE_sca.h | 1 - source/blender/blenkernel/BKE_scene.h | 2 - source/blender/blenkernel/BKE_text.h | 2 + source/blender/blenkernel/intern/group.c | 10 + source/blender/blenkernel/intern/library.c | 225 +++++++++++++++++- source/blender/blenkernel/intern/sca.c | 24 -- source/blender/blenkernel/intern/scene.c | 11 - source/blender/blenkernel/intern/text.c | 93 +++++++- .../blender/editors/gpencil/gpencil_buttons.c | 2 +- source/blender/editors/include/UI_interface.h | 2 +- .../editors/interface/interface_templates.c | 112 +++++++-- source/blender/editors/object/object_edit.c | 4 +- .../blender/editors/preview/previewrender.c | 10 +- .../blender/editors/space_nla/nla_buttons.c | 2 +- .../blender/editors/space_text/text_intern.h | 2 - source/blender/editors/space_text/text_ops.c | 44 +--- source/blender/makesrna/intern/rna_ui_api.c | 1 + 20 files changed, 436 insertions(+), 116 deletions(-) diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h index 0595134f5c9..1cbb2331782 100644 --- a/source/blender/blenkernel/BKE_armature.h +++ b/source/blender/blenkernel/BKE_armature.h @@ -74,7 +74,6 @@ struct bArmature *add_armature(char *name); struct bArmature *get_armature(struct Object *ob); void free_boneChildren(struct Bone *bone); void free_bones (struct bArmature *arm); -void unlink_armature(struct bArmature *arm); void free_armature(struct bArmature *arm); void make_local_armature(struct bArmature *arm); struct bArmature *copy_armature(struct bArmature *arm); diff --git a/source/blender/blenkernel/BKE_group.h b/source/blender/blenkernel/BKE_group.h index 35084aabadf..b66ddf13527 100644 --- a/source/blender/blenkernel/BKE_group.h +++ b/source/blender/blenkernel/BKE_group.h @@ -41,6 +41,7 @@ void free_group_object(struct GroupObject *go); void free_group(struct Group *group); void unlink_group(struct Group *group); struct Group *add_group(char *name); +struct Group *copy_group(struct Group *group); void add_to_group(struct Group *group, struct Object *ob); int rem_from_group(struct Group *group, struct Object *ob); struct Group *find_group(struct Object *ob, struct Group *group); diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h index 4e7db115168..54722dac910 100644 --- a/source/blender/blenkernel/BKE_library.h +++ b/source/blender/blenkernel/BKE_library.h @@ -46,6 +46,9 @@ void *copy_libblock(void *rt); void id_lib_extern(struct ID *id); void id_us_plus(struct ID *id); void id_us_min(struct ID *id); +int id_make_local(struct ID *id, int test); +int id_copy(struct ID *id, struct ID **newid, int test); +int id_unlink(struct ID *id, int test); int check_for_dupid(struct ListBase *lb, struct ID *id, char *name); int new_id(struct ListBase *lb, struct ID *id, const char *name); diff --git a/source/blender/blenkernel/BKE_sca.h b/source/blender/blenkernel/BKE_sca.h index 22c4f39148a..1b8e61f136f 100644 --- a/source/blender/blenkernel/BKE_sca.h +++ b/source/blender/blenkernel/BKE_sca.h @@ -47,7 +47,6 @@ void unlink_actuators(struct ListBase *lb); void free_actuator(struct bActuator *act); void free_actuators(struct ListBase *lb); -void free_text_controllers(struct Text *txt); void free_sensor(struct bSensor *sens); void free_sensors(struct ListBase *lb); struct bSensor *copy_sensor(struct bSensor *sens); diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h index 12a13a2b50c..686fc265de0 100644 --- a/source/blender/blenkernel/BKE_scene.h +++ b/source/blender/blenkernel/BKE_scene.h @@ -84,7 +84,5 @@ int get_render_child_particle_number(struct RenderData *r, int num); int get_render_shadow_samples(struct RenderData *r, int samples); float get_render_aosss_error(struct RenderData *r, float error); -void free_dome_warp_text(struct Text *txt); - #endif diff --git a/source/blender/blenkernel/BKE_text.h b/source/blender/blenkernel/BKE_text.h index d288c0b6516..bd14053d121 100644 --- a/source/blender/blenkernel/BKE_text.h +++ b/source/blender/blenkernel/BKE_text.h @@ -35,6 +35,7 @@ extern "C" { #endif +struct Main; struct Text; struct TextLine; struct SpaceText; @@ -46,6 +47,7 @@ struct Text* add_empty_text (char *name); int reopen_text (struct Text *text); struct Text* add_text (char *file, const char *relpath); struct Text* copy_text (struct Text *ta); +void unlink_text (struct Main *bmain, struct Text *text); char* txt_to_buf (struct Text *text); void txt_clean_text (struct Text *text); diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c index 6fffbd794ef..6bb47bc0f0f 100644 --- a/source/blender/blenkernel/intern/group.c +++ b/source/blender/blenkernel/intern/group.c @@ -142,6 +142,16 @@ Group *add_group(char *name) return group; } +Group *copy_group(Group *group) +{ + Group *groupn; + + groupn= MEM_dupallocN(group); + BLI_duplicatelist(&groupn->gobject, &group->gobject); + + return groupn; +} + /* external */ void add_to_group(Group *group, Object *ob) { diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 3c8bf9200f8..f15552ab40c 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -119,6 +119,13 @@ #define MAX_IDPUP 60 /* was 24 */ +/* GS reads the memory pointed at in a specific ordering. + only use this definition, makes little and big endian systems + work fine, in conjunction with MAKE_ID */ + +/* from blendef: */ +#define GS(a) (*((short *)(a))) + /* ************* general ************************ */ void id_lib_extern(ID *id) @@ -148,6 +155,217 @@ void id_us_min(ID *id) id->us--; } +int id_make_local(ID *id, int test) +{ + if(id->flag & LIB_INDIRECT) + return 0; + + switch(GS(id->name)) { + case ID_SCE: + return 0; /* not implemented */ + case ID_LI: + return 0; /* can't be linked */ + case ID_OB: + if(!test) make_local_object((Object*)id); + return 1; + case ID_ME: + if(!test) { + make_local_mesh((Mesh*)id); + make_local_key(((Mesh*)id)->key); + } + return 1; + case ID_CU: + if(!test) { + make_local_curve((Curve*)id); + make_local_key(((Curve*)id)->key); + } + return 1; + case ID_MB: + if(!test) make_local_mball((MetaBall*)id); + return 1; + case ID_MA: + if(!test) make_local_material((Material*)id); + return 1; + case ID_TE: + if(!test) make_local_texture((Tex*)id); + return 1; + case ID_IM: + return 0; /* not implemented */ + case ID_WV: + return 0; /* deprecated */ + case ID_LT: + if(!test) make_local_lattice((Lattice*)id); + return 1; + case ID_LA: + if(!test) make_local_lamp((Lamp*)id); + return 1; + case ID_CA: + if(!test) make_local_camera((Camera*)id); + return 1; + case ID_IP: + return 0; /* deprecated */ + case ID_KE: + if(!test) make_local_key((Key*)id); + return 1; + case ID_WO: + if(!test) make_local_world((World*)id); + return 1; + case ID_SCR: + return 0; /* can't be linked */ + case ID_VF: + return 0; /* not implemented */ + case ID_TXT: + return 0; /* not implemented */ + case ID_SCRIPT: + return 0; /* deprecated */ + case ID_SO: + return 0; /* not implemented */ + case ID_GR: + return 0; /* not implemented */ + case ID_AR: + if(!test) make_local_armature((bArmature*)id); + return 1; + case ID_AC: + if(!test) make_local_action((bAction*)id); + return 1; + case ID_NT: + return 0; /* not implemented */ + case ID_BR: + if(!test) make_local_brush((Brush*)id); + return 1; + case ID_PA: + if(!test) make_local_particlesettings((ParticleSettings*)id); + return 1; + case ID_WM: + return 0; /* can't be linked */ + case ID_GD: + return 0; /* not implemented */ + } + + return 0; +} + +int id_copy(ID *id, ID **newid, int test) +{ + if(!test) *newid= NULL; + + /* conventions: + * - make shallow copy, only this ID block + * - id.us of the new ID is set to 1 */ + switch(GS(id->name)) { + case ID_SCE: + return 0; /* can't be copied from here */ + case ID_LI: + return 0; /* can't be copied from here */ + case ID_OB: + if(!test) *newid= (ID*)copy_object((Object*)id); + return 1; + case ID_ME: + if(!test) *newid= (ID*)copy_mesh((Mesh*)id); + return 1; + case ID_CU: + if(!test) *newid= (ID*)copy_curve((Curve*)id); + return 1; + case ID_MB: + if(!test) *newid= (ID*)copy_mball((MetaBall*)id); + return 1; + case ID_MA: + if(!test) *newid= (ID*)copy_material((Material*)id); + return 1; + case ID_TE: + if(!test) *newid= (ID*)copy_texture((Tex*)id); + return 1; + case ID_IM: + return 0; /* not implemented */ + case ID_WV: + return 0; /* deprecated */ + case ID_LT: + if(!test) *newid= (ID*)copy_lattice((Lattice*)id); + return 1; + case ID_LA: + if(!test) *newid= (ID*)copy_lamp((Lamp*)id); + return 1; + case ID_CA: + if(!test) *newid= (ID*)copy_camera((Camera*)id); + return 1; + case ID_IP: + return 0; /* deprecated */ + case ID_KE: + if(!test) *newid= (ID*)copy_key((Key*)id); + return 1; + case ID_WO: + if(!test) *newid= (ID*)copy_world((World*)id); + return 1; + case ID_SCR: + return 0; /* can't be copied from here */ + case ID_VF: + return 0; /* not implemented */ + case ID_TXT: + if(!test) *newid= (ID*)copy_text((Text*)id); + return 1; + case ID_SCRIPT: + return 0; /* deprecated */ + case ID_SO: + return 0; /* not implemented */ + case ID_GR: + if(!test) *newid= (ID*)copy_group((Group*)id); + return 1; + case ID_AR: + if(!test) *newid= (ID*)copy_armature((bArmature*)id); + return 1; + case ID_AC: + if(!test) *newid= (ID*)copy_action((bAction*)id); + return 1; + case ID_NT: + if(!test) *newid= (ID*)ntreeCopyTree((bNodeTree*)id, 0); + return 1; + case ID_BR: + if(!test) *newid= (ID*)copy_brush((Brush*)id); + return 1; + case ID_PA: + if(!test) *newid= (ID*)psys_copy_settings((ParticleSettings*)id); + return 1; + case ID_WM: + return 0; /* can't be copied from here */ + case ID_GD: + return 0; /* not implemented */ + } + + return 0; +} + +int id_unlink(ID *id, int test) +{ + Main *mainlib= G.main; + ListBase *lb; + + switch(GS(id->name)) { + case ID_TXT: + if(test) return 1; + unlink_text(mainlib, (Text*)id); + break; + case ID_GR: + if(test) return 1; + unlink_group((Group*)id); + break; + case ID_OB: + if(test) return 1; + unlink_object(NULL, (Object*)id); + break; + } + + if(id->us == 0) { + if(test) return 1; + + lb= wich_libbase(mainlib, GS(id->name)); + free_libblock(lb, id); + + return 1; + } + + return 0; +} + ListBase *wich_libbase(Main *mainlib, short type) { switch( type ) { @@ -409,13 +627,6 @@ void *alloc_libblock(ListBase *lb, short type, const char *name) return id; } -/* GS reads the memory pointed at in a specific ordering. - only use this definition, makes little and big endian systems - work fine, in conjunction with MAKE_ID */ - -/* from blendef: */ -#define GS(a) (*((short *)(a))) - /* by spec, animdata is first item after ID */ /* we still read ->adt itself, to ensure compiler warns when it doesnt exist */ static void id_copy_animdata(ID *id) diff --git a/source/blender/blenkernel/intern/sca.c b/source/blender/blenkernel/intern/sca.c index e4d73208c64..de2118af202 100644 --- a/source/blender/blenkernel/intern/sca.c +++ b/source/blender/blenkernel/intern/sca.c @@ -52,30 +52,6 @@ #include "BKE_blender.h" #include "BKE_sca.h" -//#include "wm_event_types.h" - -void free_text_controllers(Text *txt) -{ - Object *ob; - bController *cont; - - ob= G.main->object.first; - while(ob) { - cont= ob->controllers.first; - while(cont) { - if(cont->type==CONT_PYTHON) { - bPythonCont *pc; - - pc= cont->data; - if(pc->text==txt) pc->text= NULL; - } - cont= cont->next; - } - ob= ob->id.next; - } -} - - /* ******************* SENSORS ************************ */ void free_sensor(bSensor *sens) diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 10f6a8cf47c..6f9ed3e0978 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -860,14 +860,3 @@ float get_render_aosss_error(RenderData *r, float error) return error; } -void free_dome_warp_text(struct Text *txt) -{ - Scene *scene; - - scene = G.main->scene.first; - while(scene) { - if (scene->r.dometext == txt) - scene->r.dometext = NULL; - scene = scene->id.next; - } -} diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 8e3d59bbc58..dac426de4eb 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -37,14 +37,22 @@ #include "BLI_blenlib.h" +#include "DNA_action_types.h" +#include "DNA_armature_types.h" +#include "DNA_constraint_types.h" +#include "DNA_controller_types.h" #include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_space_types.h" #include "DNA_text_types.h" -#include "BKE_utildefines.h" -#include "BKE_text.h" -#include "BKE_library.h" +#include "BKE_depsgraph.h" #include "BKE_global.h" +#include "BKE_library.h" #include "BKE_main.h" +#include "BKE_node.h" +#include "BKE_text.h" +#include "BKE_utildefines.h" #ifndef DISABLE_PYTHON #include "BPY_extern.h" @@ -451,6 +459,85 @@ Text *copy_text(Text *ta) return tan; } +void unlink_text(Main *bmain, Text *text) +{ + bScreen *scr; + ScrArea *area; + SpaceLink *sl; + Scene *scene; + Object *ob; + bController *cont; + bConstraint *con; + short update; + + /* dome */ + for(scene=bmain->scene.first; scene; scene=scene->id.next) + if(scene->r.dometext == text) + scene->r.dometext = NULL; + + for(ob=bmain->object.first; ob; ob=ob->id.next) { + /* game controllers */ + for(cont=ob->controllers.first; cont; cont=cont->next) { + if(cont->type==CONT_PYTHON) { + bPythonCont *pc; + + pc= cont->data; + if(pc->text==text) pc->text= NULL; + } + } + + /* pyconstraints */ + update = 0; + + if(ob->type==OB_ARMATURE && ob->pose) { + bPoseChannel *pchan; + for(pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { + for(con = pchan->constraints.first; con; con=con->next) { + if(con->type==CONSTRAINT_TYPE_PYTHON) { + bPythonConstraint *data = con->data; + if (data->text==text) data->text = NULL; + update = 1; + + } + } + } + } + + for(con = ob->constraints.first; con; con=con->next) { + if(con->type==CONSTRAINT_TYPE_PYTHON) { + bPythonConstraint *data = con->data; + if (data->text==text) data->text = NULL; + update = 1; + } + } + + if(update) + DAG_id_flush_update(&ob->id, OB_RECALC_DATA); + } + + /* pynodes */ + // XXX nodeDynamicUnlinkText(&text->id); + + /* text space */ + for(scr= bmain->screen.first; scr; scr= scr->id.next) { + for(area= scr->areabase.first; area; area= area->next) { + for(sl= area->spacedata.first; sl; sl= sl->next) { + if(sl->spacetype==SPACE_TEXT) { + SpaceText *st= (SpaceText*) sl; + + if(st->text==text) { + st->text= NULL; + st->top= 0; + } + } + } + } + } + + text->id.us= 0; +} + + /*****************************/ /* Editing utility functions */ /*****************************/ diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c index 0d7cd263245..1036b4ccd8f 100644 --- a/source/blender/editors/gpencil/gpencil_buttons.c +++ b/source/blender/editors/gpencil/gpencil_buttons.c @@ -238,7 +238,7 @@ static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, Poi col= uiLayoutColumn(layout, 0); /* current Grease Pencil block */ // TODO: show some info about who owns this? - uiTemplateID(col, C, ctx_ptr, "grease_pencil", "GPENCIL_OT_data_add", "GPENCIL_OT_data_unlink"); + uiTemplateID(col, C, ctx_ptr, "grease_pencil", "GPENCIL_OT_data_add", NULL, "GPENCIL_OT_data_unlink"); /* add new layer button - can be used even when no data, since it can add a new block too */ uiItemO(col, NULL, 0, "GPENCIL_OT_layer_add"); diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 0cb6964b39e..e2338078a8a 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -633,7 +633,7 @@ uiBlock *uiLayoutFreeBlock(uiLayout *layout); /* templates */ void uiTemplateHeader(uiLayout *layout, struct bContext *C, int menus); void uiTemplateID(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, char *propname, - char *newop, char *unlinkop); + char *newop, char *openop, char *unlinkop); uiLayout *uiTemplateModifier(uiLayout *layout, struct PointerRNA *ptr); uiLayout *uiTemplateConstraint(uiLayout *layout, struct PointerRNA *ptr); void uiTemplatePreview(uiLayout *layout, struct ID *id, struct ID *parent, struct MTex *slot); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index d253948e2e8..2b7d6f383bf 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -157,7 +157,7 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event) { TemplateID *template= (TemplateID*)arg_litem; PointerRNA idptr= RNA_property_pointer_get(&template->ptr, template->prop); - ID *id= idptr.data; + ID *id= idptr.data, *newid; int event= GET_INT_FROM_POINTER(arg_event); switch(event) { @@ -185,28 +185,48 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event) } else return; break; -#if 0 - case UI_ID_ALONE: - if(!id || id->us < 1) - return; - break; case UI_ID_LOCAL: - if(!id || id->us < 1) - return; + if(id) { + if(id_make_local(id, 0)) { + /* reassign to get get proper updates/notifiers */ + idptr= RNA_property_pointer_get(&template->ptr, template->prop); + RNA_property_pointer_set(&template->ptr, template->prop, idptr); + RNA_property_update(C, &template->ptr, template->prop); + } + } break; + case UI_ID_ALONE: + if(id) { + /* make copy */ + if(id_copy(id, &newid, 0) && newid) { + /* us is 1 by convention, but RNA_property_pointer_set + will also incremement it, so set it to zero */ + newid->us= 0; + + /* assign copy */ + RNA_id_pointer_create(newid, &idptr); + RNA_property_pointer_set(&template->ptr, template->prop, idptr); + RNA_property_update(C, &template->ptr, template->prop); + } + } + break; +#if 0 case UI_ID_AUTO_NAME: break; #endif } } -static void template_ID(bContext *C, uiBlock *block, TemplateID *template, StructRNA *type, int flag, char *newop, char *unlinkop) +static void template_ID(bContext *C, uiBlock *block, TemplateID *template, StructRNA *type, int flag, char *newop, char *openop, char *unlinkop) { uiBut *but; PointerRNA idptr; ListBase *lb; + ID *id, *idfrom; idptr= RNA_property_pointer_get(&template->ptr, template->prop); + id= idptr.data; + idfrom= template->ptr.id.data; lb= template->idlb; uiBlockBeginAlign(block); @@ -221,33 +241,86 @@ static void template_ID(bContext *C, uiBlock *block, TemplateID *template, Struc but->flag|= UI_HAS_ICON; but->flag|= UI_ICON_LEFT; } + + if((idfrom && idfrom->lib)) + uiButSetFlag(but, UI_BUT_DISABLED); } /* text button with name */ - if(idptr.data) { + if(id) { char name[64]; - //text_idbutton(idptr.data, name); + //text_idbutton(id, name); name[0]= '\0'; but= uiDefButR(block, TEX, 0, name, 0, 0, UI_UNIT_X*6, UI_UNIT_Y, &idptr, "name", -1, 0, 0, -1, -1, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_RENAME)); + + if(id->lib) { + if(id->flag & LIB_INDIRECT) { + but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_INDIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, 0, 0, 0, 0, 0, + "Indirect library datablock, cannot change."); + uiButSetFlag(but, UI_BUT_DISABLED); + } + else { + but= uiDefIconBut(block, BUT, 0, ICON_LIBRARY_DATA_DIRECT, 0,0,UI_UNIT_X,UI_UNIT_Y, 0, 0, 0, 0, 0, + "Direct linked library datablock, click to make local."); + if(!id_make_local(id, 1 /* test */) || (idfrom && idfrom->lib)) + uiButSetFlag(but, UI_BUT_DISABLED); + } + + uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_LOCAL)); + } + + if(id->us > 1) { + char str[32]; + + sprintf(str, "%d", id->us); + + if(id->us<10) + but= uiDefBut(block, BUT, 0, str, 0,0,UI_UNIT_X,UI_UNIT_Y, 0, 0, 0, 0, 0, "Displays number of users of this data. Click to make a single-user copy."); + else + but= uiDefBut(block, BUT, 0, str, 0,0,UI_UNIT_X+10,UI_UNIT_Y, 0, 0, 0, 0, 0, "Displays number of users of this data. Click to make a single-user copy."); + + uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ALONE)); + if(!id_copy(id, NULL, 1 /* test only */) || (idfrom && idfrom->lib)) + uiButSetFlag(but, UI_BUT_DISABLED); + } } if(flag & UI_ID_ADD_NEW) { - int w= idptr.data?UI_UNIT_X:UI_UNIT_X*6; + int w= id?UI_UNIT_X: (flag & UI_ID_OPEN)? UI_UNIT_X*3: UI_UNIT_X*6; if(newop) { - but= uiDefIconTextButO(block, BUT, newop, WM_OP_INVOKE_REGION_WIN, ICON_ZOOMIN, (idptr.data)? "": "Add New", 0, 0, w, UI_UNIT_Y, NULL); + but= uiDefIconTextButO(block, BUT, newop, WM_OP_INVOKE_REGION_WIN, ICON_ZOOMIN, (id)? "": "New", 0, 0, w, UI_UNIT_Y, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW)); } else { - but= uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, (idptr.data)? "": "Add New", 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); + but= uiDefIconTextBut(block, BUT, 0, ICON_ZOOMIN, (id)? "": "New", 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ADD_NEW)); } + + if((idfrom && idfrom->lib)) + uiButSetFlag(but, UI_BUT_DISABLED); + } + + if(flag & UI_ID_OPEN) { + int w= id?UI_UNIT_X: (flag & UI_ID_ADD_NEW)? UI_UNIT_X*3: UI_UNIT_X*6; + + if(openop) { + but= uiDefIconTextButO(block, BUT, openop, WM_OP_INVOKE_REGION_WIN, ICON_FILESEL, (id)? "": "Open", 0, 0, w, UI_UNIT_Y, NULL); + uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_OPEN)); + } + else { + but= uiDefIconTextBut(block, BUT, 0, ICON_FILESEL, (id)? "": "Open", 0, 0, w, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); + uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_OPEN)); + } + + if((idfrom && idfrom->lib)) + uiButSetFlag(but, UI_BUT_DISABLED); } /* delete button */ - if(idptr.data && (flag & UI_ID_DELETE)) { + if(id && (flag & UI_ID_DELETE)) { if(unlinkop) { but= uiDefIconButO(block, BUT, unlinkop, WM_OP_INVOKE_REGION_WIN, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL); } @@ -255,12 +328,15 @@ static void template_ID(bContext *C, uiBlock *block, TemplateID *template, Struc but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, NULL); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_DELETE)); } + + if((idfrom && idfrom->lib)) + uiButSetFlag(but, UI_BUT_DISABLED); } uiBlockEndAlign(block); } -void uiTemplateID(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname, char *newop, char *unlinkop) +void uiTemplateID(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname, char *newop, char *openop, char *unlinkop) { TemplateID *template; uiBlock *block; @@ -286,6 +362,8 @@ void uiTemplateID(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname if(newop) flag |= UI_ID_ADD_NEW; + if(openop) + flag |= UI_ID_OPEN; type= RNA_property_pointer_type(ptr, prop); template->idlb= wich_libbase(CTX_data_main(C), RNA_type_to_ID_code(type)); @@ -293,7 +371,7 @@ void uiTemplateID(uiLayout *layout, bContext *C, PointerRNA *ptr, char *propname if(template->idlb) { uiLayoutRow(layout, 1); block= uiLayoutGetBlock(layout); - template_ID(C, block, template, type, flag, newop, unlinkop); + template_ID(C, block, template, type, flag, newop, openop, unlinkop); } MEM_freeN(template); diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 53882ad8424..0ae987f2308 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -2951,10 +2951,10 @@ static int make_proxy_invoke (bContext *C, wmOperator *op, wmEvent *evt) else if (ob->id.lib) { uiPopupMenu *pup= uiPupMenuBegin(C, "OK?", ICON_QUESTION); uiLayout *layout= uiPupMenuLayout(pup); - PointerRNA props_ptr = {0}; + PointerRNA props_ptr; /* create operator menu item with relevant properties filled in */ - props_ptr= uiItemFullO(layout, op->type->name, 0, op->idname, props_ptr.data, WM_OP_EXEC_REGION_WIN, UI_ITEM_O_RETURN_PROPS); + props_ptr= uiItemFullO(layout, op->type->name, 0, op->idname, NULL, WM_OP_EXEC_REGION_WIN, UI_ITEM_O_RETURN_PROPS); RNA_string_set(&props_ptr, "object", ob->id.name+2); /* present the menu and be done... */ diff --git a/source/blender/editors/preview/previewrender.c b/source/blender/editors/preview/previewrender.c index d17391811bb..714ebcef0fb 100644 --- a/source/blender/editors/preview/previewrender.c +++ b/source/blender/editors/preview/previewrender.c @@ -349,8 +349,14 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre for(base= sce->base.first; base; base= base->next) { if(base->object->id.name[2]=='p') { - if(ELEM4(base->object->type, OB_MESH, OB_CURVE, OB_SURF, OB_MBALL)) - assign_material(base->object, mat, base->object->actcol); + if(ELEM4(base->object->type, OB_MESH, OB_CURVE, OB_SURF, OB_MBALL)) { + /* don't use assign_material, it changed mat->id.us, which shows in the UI */ + Material ***matar= give_matarar(base->object); + int actcol= MAX2(base->object->actcol > 0, 1) - 1; + + if(matar && actcol < base->object->totcol) + (*matar)[actcol]= mat; + } } } } diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index bbf1358a37c..8532d78aa06 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -211,7 +211,7 @@ static void nla_panel_animdata (const bContext *C, Panel *pa) /* Active Action Properties ------------------------------------- */ /* action */ row= uiLayoutRow(layout, 1); - uiTemplateID(row, (bContext *)C, &adt_ptr, "action", NULL, NULL/*"ACT_OT_new", "ACT_OT_unlink"*/); // XXX: need to make these operators + uiTemplateID(row, (bContext *)C, &adt_ptr, "action", NULL /*"ACT_OT_new"*/, NULL, NULL /*"ACT_OT_unlink"*/); // XXX: need to make these operators /* extrapolation */ row= uiLayoutRow(layout, 1); diff --git a/source/blender/editors/space_text/text_intern.h b/source/blender/editors/space_text/text_intern.h index cb425274fc0..4847f2f0741 100644 --- a/source/blender/editors/space_text/text_intern.h +++ b/source/blender/editors/space_text/text_intern.h @@ -83,8 +83,6 @@ typedef struct FlattenString { int flatten_string(struct SpaceText *st, FlattenString *fs, char *in); void flatten_string_free(FlattenString *fs); -void unlink_text(struct Text *text); - int wrap_width(struct SpaceText *st, struct ARegion *ar); void wrap_offset(struct SpaceText *st, struct ARegion *ar, struct TextLine *linein, int cursin, int *offl, int *offc); diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index a8ef72e3273..7751355a14d 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -273,48 +273,9 @@ void TEXT_OT_reload(wmOperatorType *ot) /******************* delete operator *********************/ -static void text_unlink(Main *bmain, Text *text) -{ - bScreen *scr; - ScrArea *area; - SpaceLink *sl; - - /* XXX this ifdef is in fact dangerous, if python is - * disabled it will leave invalid pointers in files! */ - -#ifndef DISABLE_PYTHON - // XXX BPY_free_pyconstraint_links(text); - // XXX free_text_controllers(text); - // XXX free_dome_warp_text(text); - - /* equivalently for pynodes: */ - if(0) // XXX nodeDynamicUnlinkText ((ID*)text)) - ; // XXX notifier: allqueue(REDRAWNODE, 0); -#endif - - for(scr= bmain->screen.first; scr; scr= scr->id.next) { - for(area= scr->areabase.first; area; area= area->next) { - for(sl= area->spacedata.first; sl; sl= sl->next) { - if(sl->spacetype==SPACE_TEXT) { - SpaceText *st= (SpaceText*) sl; - - if(st->text==text) { - st->text= NULL; - st->top= 0; - - if(st==area->spacedata.first) - ED_area_tag_redraw(area); - } - } - } - } - } - - free_libblock(&bmain->text, text); -} - static int unlink_exec(bContext *C, wmOperator *op) { + Main *bmain= CTX_data_main(C); SpaceText *st= CTX_wm_space_text(C); Text *text= CTX_data_edit_text(C); @@ -330,7 +291,8 @@ static int unlink_exec(bContext *C, wmOperator *op) } } - text_unlink(CTX_data_main(C), text); + unlink_text(bmain, text); + free_libblock(&bmain->text, text); WM_event_add_notifier(C, NC_TEXT|NA_REMOVED, text); return OPERATOR_FINISHED; diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 7fc2d75a708..20948843f8a 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -247,6 +247,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_function_flag(func, FUNC_USE_CONTEXT); api_ui_item_rna_common(func); RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block."); + RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a file for creating a new ID block."); RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block."); func= RNA_def_function(srna, "template_modifier", "uiTemplateModifier"); From a49020b2414005cc7aef06749ff1f9c1c7e75a3f Mon Sep 17 00:00:00 2001 From: Joerg Mueller Date: Fri, 4 Sep 2009 21:21:12 +0000 Subject: [PATCH 436/577] Strip input is not used for sound strips in 2.5. --- release/ui/space_sequencer.py | 41 +++++++++++++++++------------------ 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/release/ui/space_sequencer.py b/release/ui/space_sequencer.py index bef48f5ebdb..daae4a83ec4 100644 --- a/release/ui/space_sequencer.py +++ b/release/ui/space_sequencer.py @@ -416,7 +416,7 @@ class SEQUENCER_PT_input(SequencerButtonsPanel): if not strip: return False - return strip.type in ('MOVIE', 'IMAGE', 'SOUND') + return strip.type in ('MOVIE', 'IMAGE') def draw(self, context): layout = self.layout @@ -440,27 +440,26 @@ class SEQUENCER_PT_input(SequencerButtonsPanel): col = split.column() col.itemR(elem, "filename", text="") # strip.elements[0] could be a fallback - if strip.type != 'SOUND': - layout.itemR(strip, "use_translation", text="Image Offset:") - if strip.transform: - col = layout.column(align=True) - col.active = strip.use_translation - col.itemR(strip.transform, "offset_x", text="X") - col.itemR(strip.transform, "offset_y", text="Y") - - layout.itemR(strip, "use_crop", text="Image Crop:") - if strip.crop: - col = layout.column(align=True) - col.active = strip.use_crop - col.itemR(strip.crop, "top") - col.itemR(strip.crop, "left") - col.itemR(strip.crop, "bottom") - col.itemR(strip.crop, "right") - + layout.itemR(strip, "use_translation", text="Image Offset:") + if strip.transform: col = layout.column(align=True) - col.itemL(text="Trim Duration:") - col.itemR(strip, "animation_start_offset", text="Start") - col.itemR(strip, "animation_end_offset", text="End") + col.active = strip.use_translation + col.itemR(strip.transform, "offset_x", text="X") + col.itemR(strip.transform, "offset_y", text="Y") + + layout.itemR(strip, "use_crop", text="Image Crop:") + if strip.crop: + col = layout.column(align=True) + col.active = strip.use_crop + col.itemR(strip.crop, "top") + col.itemR(strip.crop, "left") + col.itemR(strip.crop, "bottom") + col.itemR(strip.crop, "right") + + col = layout.column(align=True) + col.itemL(text="Trim Duration:") + col.itemR(strip, "animation_start_offset", text="Start") + col.itemR(strip, "animation_end_offset", text="End") class SEQUENCER_PT_sound(SequencerButtonsPanel): __label__ = "Sound" From d3e35f096811dced93cc213392db43b7cb426a29 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 4 Sep 2009 21:34:17 +0000 Subject: [PATCH 437/577] 2.5: increase subversion to init new sound userpref variables. --- source/blender/blenkernel/BKE_blender.h | 2 +- source/blender/blenloader/intern/readfile.c | 10 ---------- source/blender/editors/interface/resources.c | 12 ++++++++++++ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 42ee11587a7..d60737d62fe 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -43,7 +43,7 @@ struct bContext; struct ReportList; #define BLENDER_VERSION 250 -#define BLENDER_SUBVERSION 2 +#define BLENDER_SUBVERSION 3 #define BLENDER_MINVERSION 250 #define BLENDER_MINSUBVERSION 0 diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 0231d841c2b..5a628192af6 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -9686,16 +9686,6 @@ static BHead *read_userdef(BlendFileData *bfd, FileData *fd, BHead *bhead) bfd->user->uifonts.first= bfd->user->uifonts.last= NULL; bfd->user->uistyles.first= bfd->user->uistyles.last= NULL; - // AUD_XXX that's bad because if the user has saved No Audio, it changes to OpenAL always - if(bfd->user->audiochannels == 0) - bfd->user->audiochannels = 2; - if(bfd->user->audiodevice == 0) - bfd->user->audiodevice = 2; - if(bfd->user->audioformat == 0) - bfd->user->audioformat = 0x24; - if(bfd->user->audiorate == 0) - bfd->user->audiorate = 44100; - bhead = blo_nextbhead(fd, bhead); /* read all attached data */ diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 8aaede7515a..c54e09b2b40 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1245,6 +1245,18 @@ void init_userdef_do_versions(void) SETCOLF(btheme->tuserpref.back, 0.45, 0.45, 0.45, 1.0); } } + + if (G.main->versionfile < 250 || (G.main->versionfile == 250 && G.main->subversionfile < 3)) { + /* new audio system */ + if(U.audiochannels == 0) + U.audiochannels = 2; + if(U.audiodevice == 0) + U.audiodevice = 2; + if(U.audioformat == 0) + U.audioformat = 0x24; + if(U.audiorate == 0) + U.audiorate = 44100; + } /* GL Texture Garbage Collection (variable abused above!) */ if (U.textimeout == 0) { From eaa079b9b7e8650411da90419fce73ffe3334f55 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 4 Sep 2009 22:07:33 +0000 Subject: [PATCH 438/577] - buttons to move logic bricks up and down when they are collapsed - made actuators and sensors 300 wide (like they were in 2.4x, someone must have changed that). The layout didnt take advantage of the extra width and it looked odd. --- .../editors/space_logic/logic_window.c | 65 +++++++++++++------ 1 file changed, 45 insertions(+), 20 deletions(-) diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 47ba197daa0..3040d73bda9 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -74,11 +74,6 @@ #include "logic_intern.h" - -/* XXX */ -static int pupmenu() {return 1;} -/* XXX */ - #define MAX_RENDER_PASS 100 #define B_REDR 1 #define B_IDNAME 2 @@ -202,7 +197,7 @@ static void make_unique_prop_names_cb(bContext *C, void *strv, void *redraw_view } -static void sca_move_sensor(bContext *C, void *datav, void *data2_unused) +static void sca_move_sensor(bContext *C, void *datav, void *move_up) { Scene *scene= CTX_data_scene(C); bSensor *sens_to_delete= datav; @@ -210,7 +205,8 @@ static void sca_move_sensor(bContext *C, void *datav, void *data2_unused) Base *base; bSensor *sens, *tmp; - val= pupmenu("Move up%x1|Move down %x2"); + // val= pupmenu("Move up%x1|Move down %x2"); + val = move_up ? 1:2; if(val>0) { /* now find out which object has this ... */ @@ -253,7 +249,7 @@ static void sca_move_sensor(bContext *C, void *datav, void *data2_unused) } } -static void sca_move_controller(bContext *C, void *datav, void *data2_unused) +static void sca_move_controller(bContext *C, void *datav, void *move_up) { Scene *scene= CTX_data_scene(C); bController *controller_to_del= datav; @@ -261,7 +257,8 @@ static void sca_move_controller(bContext *C, void *datav, void *data2_unused) Base *base; bController *cont, *tmp; - val= pupmenu("Move up%x1|Move down %x2"); + //val= pupmenu("Move up%x1|Move down %x2"); + val = move_up ? 1:2; if(val>0) { /* now find out which object has this ... */ @@ -307,7 +304,7 @@ static void sca_move_controller(bContext *C, void *datav, void *data2_unused) } } -static void sca_move_actuator(bContext *C, void *datav, void *data2_unused) +static void sca_move_actuator(bContext *C, void *datav, void *move_up) { Scene *scene= CTX_data_scene(C); bActuator *actuator_to_move= datav; @@ -315,7 +312,8 @@ static void sca_move_actuator(bContext *C, void *datav, void *data2_unused) Base *base; bActuator *act, *tmp; - val= pupmenu("Move up%x1|Move down %x2"); + //val= pupmenu("Move up%x1|Move down %x2"); + val = move_up ? 1:2; if(val>0) { /* now find out which object has this ... */ @@ -981,6 +979,7 @@ static void draw_default_sensor_header(bSensor *sens, uiBut *but; /* Pulsing and frequency */ + uiBlockBeginAlign(block); uiDefIconButBitS(block, TOG, SENS_PULSE_REPEAT, 1, ICON_DOTSUP, (short)(x + 10 + 0. * (w-20)), (short)(y - 21), (short)(0.1 * (w-20)), 19, &sens->pulse, 0.0, 0.0, 0, 0, @@ -994,8 +993,10 @@ static void draw_default_sensor_header(bSensor *sens, (short)(x + 10 + 0.2 * (w-20)), (short)(y - 21), (short)(0.275 * (w-20)), 19, &sens->freq, 0.0, 10000.0, 0, 0, "Delay between repeated pulses (in logic tics, 0 = no delay)"); + uiBlockEndAlign(block); /* value or shift? */ + uiBlockBeginAlign(block); but= uiDefButS(block, TOG, 1, "Level", (short)(x + 10 + 0.5 * (w-20)), (short)(y - 21), (short)(0.20 * (w-20)), 19, &sens->level, 0.0, 0.0, 0, 0, @@ -1006,6 +1007,7 @@ static void draw_default_sensor_header(bSensor *sens, &sens->tap, 0.0, 0.0, 0, 0, "Trigger controllers only for an instant, even while the sensor remains true"); uiButSetFunc(but, verify_logicbutton_func, sens, &(sens->tap)); + uiBlockEndAlign(block); uiDefButS(block, TOG, 1, "Inv", (short)(x + 10 + 0.85 * (w-20)), (short)(y - 21), (short)(0.15 * (w-20)), 19, @@ -3020,7 +3022,7 @@ void logic_buttons(bContext *C, ARegion *ar) /* start with the controller because we need to know which one is visible */ /* ******************************* */ - xco= 500; yco= 170; width= 300; + xco= 400; yco= 170; width= 300; uiDefBlockBut(block, controller_menu, NULL, "Controllers", xco-10, yco+35, 100, UI_UNIT_Y, ""); @@ -3129,9 +3131,17 @@ void logic_buttons(bContext *C, ARegion *ar) cpack(0x999999); glRecti(xco+22, yco, xco+width-22,yco+19); but= uiDefBut(block, LABEL, 0, controller_name(cont->type), (short)(xco+22), yco, 70, UI_UNIT_Y, cont, 0, 0, 0, 0, "Controller type"); - uiButSetFunc(but, sca_move_controller, cont, NULL); + //uiButSetFunc(but, sca_move_controller, cont, NULL); but= uiDefBut(block, LABEL, 0, cont->name,(short)(xco+92), yco,(short)(width-158), UI_UNIT_Y, cont, 0, 0, 0, 0, "Controller name"); - uiButSetFunc(but, sca_move_controller, cont, NULL); + //uiButSetFunc(but, sca_move_controller, cont, NULL); + + uiBlockBeginAlign(block); + but= uiDefIconBut(block, BUT, B_REDR, VICON_MOVE_UP, (short)(xco+width-(110+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick up"); + uiButSetFunc(but, sca_move_controller, cont, (void *)TRUE); + but= uiDefIconBut(block, BUT, B_REDR, VICON_MOVE_DOWN, (short)(xco+width-(88+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick down"); + uiButSetFunc(but, sca_move_controller, cont, (void *)FALSE); + uiBlockEndAlign(block); + ycoo= yco; } @@ -3152,7 +3162,7 @@ void logic_buttons(bContext *C, ARegion *ar) } /* ******************************* */ - xco= 10; yco= 170; width= 400; + xco= 10; yco= 170; width= 300; uiDefBlockBut(block, sensor_menu, NULL, "Sensors", xco-10, yco+35, 70, UI_UNIT_Y, ""); @@ -3213,9 +3223,16 @@ void logic_buttons(bContext *C, ARegion *ar) set_col_sensor(sens->type, 1); glRecti(xco+22, yco, xco+width-22,yco+19); but= uiDefBut(block, LABEL, 0, sensor_name(sens->type), (short)(xco+22), yco, 80, UI_UNIT_Y, sens, 0, 0, 0, 0, ""); - uiButSetFunc(but, sca_move_sensor, sens, NULL); + //uiButSetFunc(but, sca_move_sensor, sens, NULL); but= uiDefBut(block, LABEL, 0, sens->name, (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens, 0, 31, 0, 0, ""); - uiButSetFunc(but, sca_move_sensor, sens, NULL); + //uiButSetFunc(but, sca_move_sensor, sens, NULL); + + uiBlockBeginAlign(block); + but= uiDefIconBut(block, BUT, B_REDR, VICON_MOVE_UP, (short)(xco+width-(66+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick up"); + uiButSetFunc(but, sca_move_sensor, sens, (void *)TRUE); + but= uiDefIconBut(block, BUT, B_REDR, VICON_MOVE_DOWN, (short)(xco+width-(44+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick down"); + uiButSetFunc(but, sca_move_sensor, sens, (void *)FALSE); + uiBlockEndAlign(block); } but= uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); @@ -3230,7 +3247,7 @@ void logic_buttons(bContext *C, ARegion *ar) } /* ******************************* */ - xco= 900; yco= 170; width= 400; + xco= 800; yco= 170; width= 300; uiDefBlockBut(block, actuator_menu, NULL, "Actuators", xco-10, yco+35, 90, UI_UNIT_Y, ""); @@ -3286,9 +3303,17 @@ void logic_buttons(bContext *C, ARegion *ar) set_col_actuator(act->type, 1); glRecti((short)(xco+22), yco, (short)(xco+width-22),(short)(yco+19)); but= uiDefBut(block, LABEL, 0, actuator_name(act->type), (short)(xco+22), yco, 90, UI_UNIT_Y, act, 0, 0, 0, 0, "Actuator type"); - uiButSetFunc(but, sca_move_actuator, act, NULL); + // uiButSetFunc(but, sca_move_actuator, act, NULL); but= uiDefBut(block, LABEL, 0, act->name, (short)(xco+112), yco, (short)(width-(pin?156:134)), UI_UNIT_Y, act, 0, 0, 0, 0, "Actuator name"); - uiButSetFunc(but, sca_move_actuator, act, NULL); + // uiButSetFunc(but, sca_move_actuator, act, NULL); + + uiBlockBeginAlign(block); + but= uiDefIconBut(block, BUT, B_REDR, VICON_MOVE_UP, (short)(xco+width-(66+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick up"); + uiButSetFunc(but, sca_move_actuator, act, (void *)TRUE); + but= uiDefIconBut(block, BUT, B_REDR, VICON_MOVE_DOWN, (short)(xco+width-(44+5)), yco, 22, UI_UNIT_Y, NULL, 0, 0, 0, 0, "Move this logic brick down"); + uiButSetFunc(but, sca_move_actuator, act, (void *)FALSE); + uiBlockEndAlign(block); + ycoo= yco; } From ec5a8c010c8100a1709786f81d5b9b501383287a Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 4 Sep 2009 22:50:15 +0000 Subject: [PATCH 439/577] 2.5 - Animation Tweaks * Sequencer data is now animateable. Was missing a 'path' setting. For now, sequencer data is animated under scene, since SequenceEditor is not an ID block. * Fixed some buggy insert-keyframe code. --- source/blender/editors/animation/keyframing.c | 18 +++++------------- source/blender/makesrna/intern/rna_sequence.c | 11 +++++++++++ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index d731ec6f148..7135f8802bc 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -292,14 +292,8 @@ int insert_bezt_fcurve (FCurve *fcu, BezTriple *bezt, short flag) } } else if ((flag & INSERTKEY_REPLACE) == 0) { - /* add new - if we're not restricted to replacing keyframes only */ - BezTriple *newb; - - /* allocate a new array only if we have to */ - if ((flag & INSERTKEY_FASTR) == 0) - newb= MEM_callocN((fcu->totvert+1)*sizeof(BezTriple), "beztriple"); - else - newb= fcu->bezt; + /* insert new - if we're not restricted to replacing keyframes only */ + BezTriple *newb= MEM_callocN((fcu->totvert+1)*sizeof(BezTriple), "beztriple"); /* add the beztriples that should occur before the beztriple to be pasted (originally in ei->icu) */ if (i > 0) @@ -313,11 +307,9 @@ int insert_bezt_fcurve (FCurve *fcu, BezTriple *bezt, short flag) memcpy(newb+i+1, fcu->bezt+i, (fcu->totvert-i)*sizeof(BezTriple)); /* replace (+ free) old with new, only if necessary to do so */ - if ((flag & INSERTKEY_FASTR) == 0) { - MEM_freeN(fcu->bezt); - fcu->bezt= newb; - } - + MEM_freeN(fcu->bezt); + fcu->bezt= newb; + fcu->totvert++; } } diff --git a/source/blender/makesrna/intern/rna_sequence.c b/source/blender/makesrna/intern/rna_sequence.c index 5d275f7a87c..9f016f73694 100644 --- a/source/blender/makesrna/intern/rna_sequence.c +++ b/source/blender/makesrna/intern/rna_sequence.c @@ -221,6 +221,16 @@ static StructRNA* rna_Sequence_refine(struct PointerRNA *ptr) } } +static char *rna_Sequence_path(PointerRNA *ptr) +{ + Sequence *seq= (Sequence*)ptr->data; + + /* sequencer data comes from scene... + * TODO: would be nice to make SequenceEditor data a datablock of its own (for shorter paths) + */ + return BLI_sprintfN("sequence_editor.sequences[\"%s\"]", seq->name+2); +} + static PointerRNA rna_SequenceEdtior_meta_stack_get(CollectionPropertyIterator *iter) { ListBaseIterator *internal= iter->internal; @@ -393,6 +403,7 @@ static void rna_def_sequence(BlenderRNA *brna) srna = RNA_def_struct(brna, "Sequence", NULL); RNA_def_struct_ui_text(srna, "Sequence", "Sequence strip in the sequence editor."); RNA_def_struct_refine_func(srna, "rna_Sequence_refine"); + RNA_def_struct_path_func(srna, "rna_Sequence_path"); prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_Sequence_name_get", "rna_Sequence_name_length", "rna_Sequence_name_set"); From f09d6054100a17cc6129d035cf3634394f5e9377 Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Fri, 4 Sep 2009 23:06:15 +0000 Subject: [PATCH 440/577] Some particles cleanup & fixes: - Some big refresh issues with softbody & cloth point cache usage should now be fixed. - Removed sticky objects from particles (better stuff will come back when I get to updating reactor particles). - Some initial easy memory efficiency cleanup for ParticleData struct. The ultimate goal is to get particles less memory hungry -> more particles possible in single scene. - Wrong path timing clamping caused hair particles to seem disappeared when changing between normal<->hair particles. - "Calculate to current frame" in cache buttons baked instead of the intended function. - Boids particle data is now a bit better organized. --- release/ui/buttons_particle.py | 1 - source/blender/blenkernel/BKE_particle.h | 4 + source/blender/blenkernel/intern/boids.c | 198 +++++---- source/blender/blenkernel/intern/cloth.c | 27 +- source/blender/blenkernel/intern/modifier.c | 6 +- source/blender/blenkernel/intern/object.c | 51 ++- source/blender/blenkernel/intern/particle.c | 140 +++---- .../blenkernel/intern/particle_system.c | 383 ++++++++---------- source/blender/blenkernel/intern/pointcache.c | 10 +- source/blender/blenkernel/intern/softbody.c | 40 +- source/blender/blenloader/intern/readfile.c | 9 - source/blender/blenloader/intern/writefile.c | 2 +- source/blender/editors/object/object_edit.c | 3 + .../blender/editors/physics/ed_pointcache.c | 2 +- source/blender/editors/physics/editparticle.c | 61 +-- .../blender/editors/space_view3d/drawobject.c | 11 +- source/blender/makesdna/DNA_particle_types.h | 45 +- source/blender/makesrna/intern/rna_particle.c | 42 +- .../render/intern/source/convertblender.c | 6 +- 19 files changed, 512 insertions(+), 529 deletions(-) diff --git a/release/ui/buttons_particle.py b/release/ui/buttons_particle.py index 0b18b7c2072..f3339049962 100644 --- a/release/ui/buttons_particle.py +++ b/release/ui/buttons_particle.py @@ -396,7 +396,6 @@ class PARTICLE_PT_physics(ParticleButtonsPanel): if part.physics_type=='NEWTON': sub.itemR(part, "size_deflect") sub.itemR(part, "die_on_collision") - sub.itemR(part, "sticky") elif part.physics_type=='KEYED' or part.physics_type=='BOIDS': if part.physics_type=='BOIDS': layout.itemL(text="Relations:") diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h index e24114cd219..15896477a6a 100644 --- a/source/blender/blenkernel/BKE_particle.h +++ b/source/blender/blenkernel/BKE_particle.h @@ -59,6 +59,9 @@ struct SurfaceModifierData; struct BVHTreeRay; struct BVHTreeRayHit; +#define PARTICLE_P ParticleData *pa; int p +#define LOOP_PARTICLES for(p=0, pa=psys->particles; ptotpart; p++, pa++) + typedef struct ParticleEffectorCache { struct ParticleEffectorCache *next, *prev; struct Object *ob; @@ -207,6 +210,7 @@ void free_child_path_cache(struct ParticleSystem *psys); void psys_free_path_cache(struct ParticleSystem *psys, struct PTCacheEdit *edit); void free_hair(struct ParticleSystem *psys, int softbody); void free_keyed_keys(struct ParticleSystem *psys); +void psys_free_particles(struct ParticleSystem *psys); void psys_free(struct Object * ob, struct ParticleSystem * psys); void psys_free_children(struct ParticleSystem *psys); diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c index 5c62e434cb6..18f065b59d9 100644 --- a/source/blender/blenkernel/intern/boids.c +++ b/source/blender/blenkernel/intern/boids.c @@ -74,6 +74,7 @@ static int rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, BoidSettings *boids = bbd->part->boids; ParticleEffectorCache *ec; Object *priority_ob = NULL; + BoidParticle *bpa = pa->boid; float vec[3] = {0.0f, 0.0f, 0.0f}, loc[3] = {0.0f, 0.0f, 0.0f}; float mul = (rule->type == eBoidRuleType_Avoid ? 1.0 : -1.0); float priority = 0.0f, len = 0.0f; @@ -81,7 +82,7 @@ static int rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, /* first find out goal/predator with highest priority */ /* if rule->ob specified use it */ - if(gabr->ob && (rule->type != eBoidRuleType_Goal || gabr->ob != pa->stick_ob)) { + if(gabr->ob && (rule->type != eBoidRuleType_Goal || gabr->ob != bpa->ground)) { PartDeflect *pd = gabr->ob->pd; float vec_to_part[3]; @@ -104,7 +105,7 @@ static int rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, PartDeflect *pd = eob->pd; /* skip current object */ - if(rule->type == eBoidRuleType_Goal && eob == pa->stick_ob) + if(rule->type == eBoidRuleType_Goal && eob == bpa->ground) continue; if(pd->forcefield == PFIELD_BOID && mul * pd->f_strength > 0.0f) { @@ -169,10 +170,10 @@ static int rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, VECCOPY(bbd->goal_nor, nor); } } - else if(rule->type == eBoidRuleType_Avoid && pa->boid->mode == eBoidMode_Climbing && + else if(rule->type == eBoidRuleType_Avoid && bpa->data.mode == eBoidMode_Climbing && priority > 2.0f * gabr->fear_factor) { /* detach from surface and try to fly away from danger */ - VECCOPY(vec_to_part, pa->r_ve); + VECCOPY(vec_to_part, bpa->gravity); VecMulf(vec_to_part, -1.0f); } @@ -205,6 +206,7 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues * KDTreeNearest *ptn = NULL; ParticleEffectorCache *ec; ParticleTarget *pt; + BoidParticle *bpa = pa->boid; float vec[3] = {0.0f, 0.0f, 0.0f}, loc[3] = {0.0f, 0.0f, 0.0f}; float co1[3], vel1[3], co2[3], vel2[3]; float len, t, inp, t_min = 2.0f; @@ -231,7 +233,7 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues * Object *eob = ec->ob; /* don't check with current ground object */ - if(eob == pa->stick_ob) + if(eob == bpa->ground) continue; col.md = ( CollisionModifierData * ) ( modifiers_findByType ( eob, eModifierType_Collision ) ); @@ -558,18 +560,19 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va } static int rule_average_speed(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, ParticleData *pa) { + BoidParticle *bpa = pa->boid; BoidRuleAverageSpeed *asbr = (BoidRuleAverageSpeed*)rule; float vec[3] = {0.0f, 0.0f, 0.0f}; if(asbr->wander > 0.0f) { /* abuse pa->r_ave for wandering */ - pa->r_ave[0] += asbr->wander * (-1.0f + 2.0f * BLI_frand()); - pa->r_ave[1] += asbr->wander * (-1.0f + 2.0f * BLI_frand()); - pa->r_ave[2] += asbr->wander * (-1.0f + 2.0f * BLI_frand()); + bpa->wander[0] += asbr->wander * (-1.0f + 2.0f * BLI_frand()); + bpa->wander[1] += asbr->wander * (-1.0f + 2.0f * BLI_frand()); + bpa->wander[2] += asbr->wander * (-1.0f + 2.0f * BLI_frand()); - Normalize(pa->r_ave); + Normalize(bpa->wander); - VECCOPY(vec, pa->r_ave); + VECCOPY(vec, bpa->wander); QuatMulVecf(pa->prev_state.rot, vec); @@ -615,6 +618,7 @@ static int rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti ParticleTarget *pt; ParticleData *epars; ParticleData *enemy_pa = NULL; + BoidParticle *bpa; /* friends & enemies */ float closest_enemy[3] = {0.0f,0.0f,0.0f}; float closest_dist = fbr->distance + 1.0f; @@ -624,8 +628,10 @@ static int rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti /* calculate own group strength */ int neighbors = BLI_kdtree_range_search(bbd->psys->tree, fbr->distance, pa->prev_state.co, NULL, &ptn); - for(n=0; npsys->particles[ptn[n].index].boid->health; + for(n=0; npsys->particles[ptn[n].index].boid; + health += bpa->data.health; + } f_strength += bbd->part->boids->strength * health; @@ -642,7 +648,8 @@ static int rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti health = 0.0f; for(n=0; nhealth; + bpa = epars[ptn[n].index].boid; + health += bpa->data.health; if(n==0 && pt->mode==PTARGET_MODE_ENEMY && ptn[n].dist < closest_dist) { VECCOPY(closest_enemy, ptn[n].co); @@ -674,7 +681,8 @@ static int rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti /* must face enemy to fight */ if(Inpf(pa->prev_state.ave, enemy_dir)>0.5f) { - enemy_pa->boid->health -= bbd->part->boids->strength * bbd->timestep * ((1.0f-bbd->part->boids->accuracy)*damage + bbd->part->boids->accuracy); + bpa = enemy_pa->boid; + bpa->data.health -= bbd->part->boids->strength * bbd->timestep * ((1.0f-bbd->part->boids->accuracy)*damage + bbd->part->boids->accuracy); } } else { @@ -683,7 +691,8 @@ static int rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti } /* check if boid doesn't want to fight */ - if(pa->boid->health/bbd->part->boids->health * bbd->part->boids->aggression < e_strength / f_strength) { + bpa = pa->boid; + if(bpa->data.health/bbd->part->boids->health * bbd->part->boids->aggression < e_strength / f_strength) { /* decide to flee */ if(closest_dist < fbr->flee_distance * fbr->distance) { VecMulf(bbd->wanted_co, -1.0f); @@ -721,18 +730,20 @@ static boid_rule_cb boid_rules[] = { static void set_boid_values(BoidValues *val, BoidSettings *boids, ParticleData *pa) { - if(ELEM(pa->boid->mode, eBoidMode_OnLand, eBoidMode_Climbing)) { - val->max_speed = boids->land_max_speed * pa->boid->health/boids->health; + BoidParticle *bpa = pa->boid; + + if(ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing)) { + val->max_speed = boids->land_max_speed * bpa->data.health/boids->health; val->max_acc = boids->land_max_acc * val->max_speed; - val->max_ave = boids->land_max_ave * M_PI * pa->boid->health/boids->health; + val->max_ave = boids->land_max_ave * M_PI * bpa->data.health/boids->health; val->min_speed = 0.0f; /* no minimum speed on land */ val->personal_space = boids->land_personal_space; - val->jump_speed = boids->land_jump_speed * pa->boid->health/boids->health; + val->jump_speed = boids->land_jump_speed * bpa->data.health/boids->health; } else { - val->max_speed = boids->air_max_speed * pa->boid->health/boids->health; + val->max_speed = boids->air_max_speed * bpa->data.health/boids->health; val->max_acc = boids->air_max_acc * val->max_speed; - val->max_ave = boids->air_max_ave * M_PI * pa->boid->health/boids->health; + val->max_ave = boids->air_max_ave * M_PI * bpa->data.health/boids->health; val->min_speed = boids->air_min_speed * boids->air_max_speed; val->personal_space = boids->air_personal_space; val->jump_speed = 0.0f; /* no jumping in air */ @@ -740,11 +751,13 @@ static void set_boid_values(BoidValues *val, BoidSettings *boids, ParticleData * } static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float *ground_co, float *ground_nor) { - if(pa->boid->mode == eBoidMode_Climbing) { + BoidParticle *bpa = pa->boid; + + if(bpa->data.mode == eBoidMode_Climbing) { SurfaceModifierData *surmd = NULL; float x[3], v[3]; - surmd = (SurfaceModifierData *)modifiers_findByType ( pa->stick_ob, eModifierType_Surface ); + surmd = (SurfaceModifierData *)modifiers_findByType ( bpa->ground, eModifierType_Surface ); /* take surface velocity into account */ effector_find_co(bbd->scene, pa->state.co, surmd, NULL, NULL, x, NULL, v, NULL); @@ -753,7 +766,7 @@ static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float *gro /* get actual position on surface */ effector_find_co(bbd->scene, x, surmd, NULL, NULL, ground_co, ground_nor, NULL, NULL); - return pa->stick_ob; + return bpa->ground; } else { float zvec[3] = {0.0f, 0.0f, 2000.0f}; @@ -803,13 +816,15 @@ static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float *gro } static int boid_rule_applies(ParticleData *pa, BoidSettings *boids, BoidRule *rule) { + BoidParticle *bpa = pa->boid; + if(rule==NULL) return 0; - if(ELEM(pa->boid->mode, eBoidMode_OnLand, eBoidMode_Climbing) && rule->flag & BOIDRULE_ON_LAND) + if(ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing) && rule->flag & BOIDRULE_ON_LAND) return 1; - if(pa->boid->mode==eBoidMode_InAir && rule->flag & BOIDRULE_IN_AIR) + if(bpa->data.mode==eBoidMode_InAir && rule->flag & BOIDRULE_IN_AIR) return 1; return 0; @@ -835,12 +850,13 @@ void boids_precalc_rules(ParticleSettings *part, float cfra) } static void boid_climb(BoidSettings *boids, ParticleData *pa, float *surface_co, float *surface_nor) { + BoidParticle *bpa = pa->boid; float nor[3], vel[3]; VECCOPY(nor, surface_nor); - /* gather apparent gravity to r_ve */ - VECADDFAC(pa->r_ve, pa->r_ve, surface_nor, -1.0); - Normalize(pa->r_ve); + /* gather apparent gravity */ + VECADDFAC(bpa->gravity, bpa->gravity, surface_nor, -1.0); + Normalize(bpa->gravity); /* raise boid it's size from surface */ VecMulf(nor, pa->size * boids->height); @@ -877,16 +893,17 @@ static int apply_boid_rule(BoidBrainData *bbd, BoidRule *rule, BoidValues *val, } static BoidState *get_boid_state(BoidSettings *boids, ParticleData *pa) { BoidState *state = boids->states.first; + BoidParticle *bpa = pa->boid; for(; state; state=state->next) { - if(state->id==pa->boid->state_id) + if(state->id==bpa->data.state_id) return state; } /* for some reason particle isn't at a valid state */ state = boids->states.first; if(state) - pa->boid->state_id = state->id; + bpa->data.state_id = state->id; return state; } @@ -902,9 +919,11 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa) BoidSettings *boids = bbd->part->boids; BoidValues val; BoidState *state = get_boid_state(boids, pa); + BoidParticle *bpa = pa->boid; + int rand; //BoidCondition *cond; - if(pa->boid->health <= 0.0f) { + if(bpa->data.health <= 0.0f) { pa->alive = PARS_DYING; return; } @@ -922,7 +941,9 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa) bbd->wanted_co[0]=bbd->wanted_co[1]=bbd->wanted_co[2]=bbd->wanted_speed=0.0f; /* create random seed for every particle & frame */ - BLI_srandom(bbd->psys->seed + p + (int)bbd->cfra + (int)(1000*pa->r_rot[0])); + BLI_srandom(bbd->psys->seed + p); + rand = BLI_rand(); + BLI_srandom((int)bbd->cfra + rand); set_boid_values(&val, bbd->part->boids, pa); @@ -939,7 +960,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa) case eBoidRulesetType_Random: { /* use random rule for each particle (allways same for same particle though) */ - rule = BLI_findlink(&state->rules, (int)(1000.0f * pa->r_rot[1]) % BLI_countlist(&state->rules)); + rule = BLI_findlink(&state->rules, rand % BLI_countlist(&state->rules)); apply_boid_rule(bbd, rule, &val, pa, -1.0); } @@ -969,7 +990,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa) } /* decide on jumping & liftoff */ - if(pa->boid->mode == eBoidMode_OnLand) { + if(bpa->data.mode == eBoidMode_OnLand) { /* fuzziness makes boids capable of misjudgement */ float mul = 1.0 + state->rule_fuzziness; @@ -983,7 +1004,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa) Normalize2(cvel); if(Inp2f(cvel, dir) > 0.95 / mul) - pa->boid->mode = eBoidMode_Liftoff; + bpa->data.mode = eBoidMode_Liftoff; } else if(val.jump_speed > 0.0f) { float jump_v[3]; @@ -1036,7 +1057,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa) if(jump) { VECCOPY(pa->prev_state.vel, jump_v); - pa->boid->mode = eBoidMode_Falling; + bpa->data.mode = eBoidMode_Falling; } } } @@ -1045,6 +1066,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa) void boid_body(BoidBrainData *bbd, ParticleData *pa) { BoidSettings *boids = bbd->part->boids; + BoidParticle *bpa = pa->boid; BoidValues val; float acc[3] = {0.0f, 0.0f, 0.0f}, tan_acc[3], nor_acc[3]; float dvec[3], bvec[3]; @@ -1066,10 +1088,10 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) pa_mass*=pa->size; /* if boids can't fly they fall to the ground */ - if((boids->options & BOID_ALLOW_FLIGHT)==0 && ELEM(pa->boid->mode, eBoidMode_OnLand, eBoidMode_Climbing)==0 && bbd->part->acc[2] != 0.0f) - pa->boid->mode = eBoidMode_Falling; + if((boids->options & BOID_ALLOW_FLIGHT)==0 && ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing)==0 && bbd->part->acc[2] != 0.0f) + bpa->data.mode = eBoidMode_Falling; - if(pa->boid->mode == eBoidMode_Falling) { + if(bpa->data.mode == eBoidMode_Falling) { /* Falling boids are only effected by gravity. */ acc[2] = bbd->part->acc[2]; } @@ -1079,14 +1101,14 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) float level = landing_level + 1.0f; float new_vel[3]; - if(pa->boid->mode == eBoidMode_Liftoff) { - pa->boid->mode = eBoidMode_InAir; - pa->stick_ob = boid_find_ground(bbd, pa, ground_co, ground_nor); + if(bpa->data.mode == eBoidMode_Liftoff) { + bpa->data.mode = eBoidMode_InAir; + bpa->ground = boid_find_ground(bbd, pa, ground_co, ground_nor); } - else if(pa->boid->mode == eBoidMode_InAir && boids->options & BOID_ALLOW_LAND) { + else if(bpa->data.mode == eBoidMode_InAir && boids->options & BOID_ALLOW_LAND) { /* auto-leveling & landing if close to ground */ - pa->stick_ob = boid_find_ground(bbd, pa, ground_co, ground_nor); + bpa->ground = boid_find_ground(bbd, pa, ground_co, ground_nor); /* level = how many particle sizes above ground */ level = (pa->prev_state.co[2] - ground_co[2])/(2.0f * pa->size) - 0.5; @@ -1097,7 +1119,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) if(level < 1.0f) { bbd->wanted_co[0] = bbd->wanted_co[1] = bbd->wanted_co[2] = 0.0f; bbd->wanted_speed = 0.0f; - pa->boid->mode = eBoidMode_Falling; + bpa->data.mode = eBoidMode_Falling; } else if(level < landing_level) { bbd->wanted_speed *= (level - 1.0f)/landing_level; @@ -1188,7 +1210,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) /* account for effectors */ do_effectors(p, pa, &pa->state, bbd->scene, bbd->ob, bbd->psys, pa->state.co, force, tvel, bbd->dfra, bbd->cfra); - if(ELEM(pa->boid->mode, eBoidMode_OnLand, eBoidMode_Climbing)) { + if(ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing)) { float length = Normalize(force); length = MAX2(0.0f, length - boids->land_stick_force); @@ -1199,8 +1221,8 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) VecAddf(acc, acc, force); /* store smoothed acceleration for nice banking etc. */ - VECADDFAC(pa->boid->acc, pa->boid->acc, acc, dtime); - VecMulf(pa->boid->acc, 1.0f / (1.0f + dtime)); + VECADDFAC(bpa->data.acc, bpa->data.acc, acc, dtime); + VecMulf(bpa->data.acc, 1.0f / (1.0f + dtime)); /* integrate new location & velocity */ @@ -1218,32 +1240,32 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) VECADDFAC(pa->state.vel, pa->state.vel, acc, dtime); - if(pa->boid->mode != eBoidMode_InAir) - pa->stick_ob = boid_find_ground(bbd, pa, ground_co, ground_nor); + if(bpa->data.mode != eBoidMode_InAir) + bpa->ground = boid_find_ground(bbd, pa, ground_co, ground_nor); /* change modes, constrain movement & keep track of down vector */ - switch(pa->boid->mode) { + switch(bpa->data.mode) { case eBoidMode_InAir: { float grav[3] = {0.0f, 0.0f, bbd->part->acc[2] < 0.0f ? -1.0f : 0.0f}; /* don't take forward acceleration into account (better banking) */ - if(Inpf(pa->boid->acc, pa->state.vel) > 0.0f) { - Projf(dvec, pa->boid->acc, pa->state.vel); - VecSubf(dvec, pa->boid->acc, dvec); + if(Inpf(bpa->data.acc, pa->state.vel) > 0.0f) { + Projf(dvec, bpa->data.acc, pa->state.vel); + VecSubf(dvec, bpa->data.acc, dvec); } else { - VECCOPY(dvec, pa->boid->acc); + VECCOPY(dvec, bpa->data.acc); } - /* gather apparent gravity to r_ve */ - VECADDFAC(pa->r_ve, grav, dvec, -boids->banking); - Normalize(pa->r_ve); + /* gather apparent gravity */ + VECADDFAC(bpa->gravity, grav, dvec, -boids->banking); + Normalize(bpa->gravity); /* stick boid on goal when close enough */ if(bbd->goal_ob && boid_goal_signed_dist(pa->state.co, bbd->goal_co, bbd->goal_nor) <= pa->size * boids->height) { - pa->boid->mode = eBoidMode_Climbing; - pa->stick_ob = bbd->goal_ob; + bpa->data.mode = eBoidMode_Climbing; + bpa->ground = bbd->goal_ob; boid_find_ground(bbd, pa, ground_co, ground_nor); boid_climb(boids, pa, ground_co, ground_nor); } @@ -1251,7 +1273,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) else if(boids->options & BOID_ALLOW_LAND && pa->state.co[2] <= ground_co[2] + pa->size * boids->height) { pa->state.co[2] = ground_co[2] + pa->size * boids->height; pa->state.vel[2] = 0.0f; - pa->boid->mode = eBoidMode_OnLand; + bpa->data.mode = eBoidMode_OnLand; } break; } @@ -1259,15 +1281,15 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) { float grav[3] = {0.0f, 0.0f, bbd->part->acc[2] < 0.0f ? -1.0f : 0.0f}; - /* gather apparent gravity to r_ve */ - VECADDFAC(pa->r_ve, pa->r_ve, grav, dtime); - Normalize(pa->r_ve); + /* gather apparent gravity */ + VECADDFAC(bpa->gravity, bpa->gravity, grav, dtime); + Normalize(bpa->gravity); if(boids->options & BOID_ALLOW_LAND) { /* stick boid on goal when close enough */ if(bbd->goal_ob && boid_goal_signed_dist(pa->state.co, bbd->goal_co, bbd->goal_nor) <= pa->size * boids->height) { - pa->boid->mode = eBoidMode_Climbing; - pa->stick_ob = bbd->goal_ob; + bpa->data.mode = eBoidMode_Climbing; + bpa->ground = bbd->goal_ob; boid_find_ground(bbd, pa, ground_co, ground_nor); boid_climb(boids, pa, ground_co, ground_nor); } @@ -1275,14 +1297,14 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) else if(pa->state.co[2] <= ground_co[2] + 1.01 * pa->size * boids->height){ pa->state.co[2] = ground_co[2] + pa->size * boids->height; pa->state.vel[2] = 0.0f; - pa->boid->mode = eBoidMode_OnLand; + bpa->data.mode = eBoidMode_OnLand; } /* if we're falling, can fly and want to go upwards lets fly */ else if(boids->options & BOID_ALLOW_FLIGHT && bbd->wanted_co[2] > 0.0f) - pa->boid->mode = eBoidMode_InAir; + bpa->data.mode = eBoidMode_InAir; } else - pa->boid->mode = eBoidMode_InAir; + bpa->data.mode = eBoidMode_InAir; break; } case eBoidMode_Climbing: @@ -1308,14 +1330,14 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) { /* stick boid on goal when close enough */ if(bbd->goal_ob && boid_goal_signed_dist(pa->state.co, bbd->goal_co, bbd->goal_nor) <= pa->size * boids->height) { - pa->boid->mode = eBoidMode_Climbing; - pa->stick_ob = bbd->goal_ob; + bpa->data.mode = eBoidMode_Climbing; + bpa->ground = bbd->goal_ob; boid_find_ground(bbd, pa, ground_co, ground_nor); boid_climb(boids, pa, ground_co, ground_nor); } /* ground is too far away so boid falls */ else if(pa->state.co[2]-ground_co[2] > 1.1 * pa->size * boids->height) - pa->boid->mode = eBoidMode_Falling; + bpa->data.mode = eBoidMode_Falling; else { /* constrain to surface */ pa->state.co[2] = ground_co[2] + pa->size * boids->height; @@ -1329,17 +1351,17 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) VECCOPY(grav, ground_nor); VecMulf(grav, -1.0f); - Projf(dvec, pa->boid->acc, pa->state.vel); - VecSubf(dvec, pa->boid->acc, dvec); + Projf(dvec, bpa->data.acc, pa->state.vel); + VecSubf(dvec, bpa->data.acc, dvec); - /* gather apparent gravity to r_ve */ - VECADDFAC(pa->r_ve, grav, dvec, -boids->banking); - Normalize(pa->r_ve); + /* gather apparent gravity */ + VECADDFAC(bpa->gravity, grav, dvec, -boids->banking); + Normalize(bpa->gravity); } else { - /* gather negative surface normal to r_ve */ - VECADDFAC(pa->r_ve, pa->r_ve, ground_nor, -1.0f); - Normalize(pa->r_ve); + /* gather negative surface normal */ + VECADDFAC(bpa->gravity, bpa->gravity, ground_nor, -1.0f); + Normalize(bpa->gravity); } break; } @@ -1347,29 +1369,29 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) /* save direction to state.ave unless the boid is falling */ /* (boids can't effect their direction when falling) */ - if(pa->boid->mode!=eBoidMode_Falling && VecLength(pa->state.vel) > 0.1*pa->size) { + if(bpa->data.mode!=eBoidMode_Falling && VecLength(pa->state.vel) > 0.1*pa->size) { VECCOPY(pa->state.ave, pa->state.vel); Normalize(pa->state.ave); } /* apply damping */ - if(ELEM(pa->boid->mode, eBoidMode_OnLand, eBoidMode_Climbing)) + if(ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing)) VecMulf(pa->state.vel, 1.0f - 0.2f*bbd->part->dampfac); /* calculate rotation matrix based on forward & down vectors */ - if(pa->boid->mode == eBoidMode_InAir) { + if(bpa->data.mode == eBoidMode_InAir) { VECCOPY(mat[0], pa->state.ave); - Projf(dvec, pa->r_ve, pa->state.ave); - VecSubf(mat[2], pa->r_ve, dvec); + Projf(dvec, bpa->gravity, pa->state.ave); + VecSubf(mat[2], bpa->gravity, dvec); Normalize(mat[2]); } else { - Projf(dvec, pa->state.ave, pa->r_ve); + Projf(dvec, pa->state.ave, bpa->gravity); VecSubf(mat[0], pa->state.ave, dvec); Normalize(mat[0]); - VECCOPY(mat[2], pa->r_ve); + VECCOPY(mat[2], bpa->gravity); } VecMulf(mat[2], -1.0f); Crossf(mat[1], mat[2], mat[0]); diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index eafd9eb01fe..8be8df8e63b 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -496,23 +496,30 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, if(!do_init_cloth(ob, clmd, result, framenr)) return result; + if(framenr == startframe && cache->flag & PTCACHE_REDO_NEEDED) { + BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED); + cache->simframe= framenr; + cache->flag &= ~PTCACHE_REDO_NEEDED; + return result; + } + /* try to read from cache */ cache_result = BKE_ptcache_read_cache(&pid, (float)framenr, scene->r.frs_sec); if(cache_result == PTCACHE_READ_EXACT || cache_result == PTCACHE_READ_INTERPOLATED) { - cache->flag |= PTCACHE_SIMULATION_VALID; - cache->simframe= framenr; - implicit_set_positions(clmd); cloth_to_object (ob, clmd, result); + cache->simframe= framenr; + cache->flag |= PTCACHE_SIMULATION_VALID; + + if(cache_result == PTCACHE_READ_INTERPOLATED && cache->flag & PTCACHE_REDO_NEEDED) + BKE_ptcache_write_cache(&pid, framenr); + return result; } else if(cache_result==PTCACHE_READ_OLD) { - BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_FREE); - implicit_set_positions(clmd); - cache->flag |= PTCACHE_SIMULATION_VALID; } else if(ob->id.lib || (cache->flag & PTCACHE_BAKED)) { @@ -524,12 +531,10 @@ DerivedMesh *clothModifier_do(ClothModifierData *clmd, Scene *scene, Object *ob, } if(framenr == startframe) { - if(cache->flag & PTCACHE_REDO_NEEDED) { - BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED); - do_init_cloth(ob, clmd, result, framenr); - } - cache->flag |= PTCACHE_SIMULATION_VALID; + implicit_set_positions(clmd); + cache->simframe= framenr; + cache->flag |= PTCACHE_SIMULATION_VALID; /* don't write cache on first frame, but on second frame write * cache for frame 1 and 2 */ diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 7a0eb882083..9c8c43cc8cb 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -6696,10 +6696,8 @@ static DerivedMesh * particleInstanceModifier_applyModifier( if((psys->flag & (PSYS_HAIR_DONE|PSYS_KEYED) || psys->pointcache->flag & PTCACHE_BAKED) && pimd->flag & eParticleInstanceFlag_Path){ float ran = 0.0f; if(pimd->random_position != 0.0f) { - /* just use some static collection of random numbers */ - /* TODO: use something else that's unique to each instanced object */ - pa = psys->particles + (i/totvert)%totpart; - ran = pimd->random_position * 0.5 * (1.0f + pa->r_ave[0]); + BLI_srandom(psys->seed + (i/totvert)%totpart); + ran = pimd->random_position * BLI_frand(); } if(pimd->flag & eParticleInstanceFlag_KeepShape) { diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 1cb0abfe21c..9a137bdb7e6 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -481,15 +481,15 @@ void unlink_object(Scene *scene, Object *ob) if(tpsys->part->dup_ob==ob) tpsys->part->dup_ob= NULL; - if(tpsys->part->flag&PART_STICKY) { + if(tpsys->part->phystype==PART_PHYS_BOIDS) { ParticleData *pa; + BoidParticle *bpa; int p; for(p=0,pa=tpsys->particles; ptotpart; p++,pa++) { - if(pa->stick_ob==ob) { - pa->stick_ob= 0; - pa->flag &= ~PARS_STICKY; - } + bpa = pa->boid; + if(bpa->ground == ob) + bpa->ground = NULL; } } if(tpsys->part->boids) { @@ -1082,19 +1082,35 @@ ParticleSystem *copy_particlesystem(ParticleSystem *psys) { ParticleSystem *psysn; ParticleData *pa; - int a; + int p; psysn= MEM_dupallocN(psys); psysn->particles= MEM_dupallocN(psys->particles); psysn->child= MEM_dupallocN(psys->child); - if(psysn->particles->keys) - psysn->particles->keys = MEM_dupallocN(psys->particles->keys); - for(a=0, pa=psysn->particles; atotpart; a++, pa++) { - if(pa->hair) - pa->hair= MEM_dupallocN(pa->hair); - if(a) - pa->keys= (pa-1)->keys + (pa-1)->totkey; + if(psys->part->type == PART_HAIR) { + for(p=0, pa=psysn->particles; ptotpart; p++, pa++) + pa->hair = MEM_dupallocN(pa->hair); + } + + if(psysn->particles->keys || psysn->particles->boid) { + ParticleKey *key = psysn->particles->keys; + BoidParticle *boid = psysn->particles->boid; + + if(key) + key = MEM_dupallocN(key); + + if(boid) + boid = MEM_dupallocN(boid); + + for(p=0, pa=psysn->particles; ptotpart; p++, pa++) { + if(boid) + pa->boid = boid++; + if(key) { + pa->keys = key; + key += pa->totkey; + } + } } if(psys->soft) { @@ -1102,14 +1118,7 @@ ParticleSystem *copy_particlesystem(ParticleSystem *psys) psysn->soft->particles = psysn; } - if(psys->particles->boid) { - psysn->particles->boid = MEM_dupallocN(psys->particles->boid); - for(a=1, pa=psysn->particles+1; atotpart; a++, pa++) - pa->boid = (pa-1)->boid + 1; - } - - if(psys->targets.first) - BLI_duplicatelist(&psysn->targets, &psys->targets); + BLI_duplicatelist(&psysn->targets, &psys->targets); psysn->pathcache= NULL; psysn->childcache= NULL; diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 1ae3ec5dd50..81eb0b79c40 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -92,10 +92,10 @@ static void do_child_modifiers(Scene *scene, Object *ob, ParticleSystem *psys, P /* few helpers for countall etc. */ int count_particles(ParticleSystem *psys){ ParticleSettings *part=psys->part; - ParticleData *pa; - int tot=0,p; + PARTICLE_P; + int tot=0; - for(p=0,pa=psys->particles; ptotpart; p++,pa++){ + LOOP_PARTICLES { if(pa->alive == PARS_KILLED); else if(pa->alive == PARS_UNBORN && (part->flag & PART_UNBORN)==0); else if(pa->alive == PARS_DEAD && (part->flag & PART_DIED)==0); @@ -106,10 +106,10 @@ int count_particles(ParticleSystem *psys){ } int count_particles_mod(ParticleSystem *psys, int totgr, int cur){ ParticleSettings *part=psys->part; - ParticleData *pa; - int tot=0,p; + PARTICLE_P; + int tot=0; - for(p=0,pa=psys->particles; ptotpart; p++,pa++){ + LOOP_PARTICLES { if(pa->alive == PARS_KILLED); else if(pa->alive == PARS_UNBORN && (part->flag & PART_UNBORN)==0); else if(pa->alive == PARS_DEAD && (part->flag & PART_DIED)==0); @@ -120,10 +120,10 @@ int count_particles_mod(ParticleSystem *psys, int totgr, int cur){ } int psys_count_keys(ParticleSystem *psys) { - ParticleData *pa; - int i, totpart=psys->totpart, totkey=0; + PARTICLE_P; + int totkey=0; - for(i=0, pa=psys->particles; itotkey; return totkey; @@ -368,13 +368,16 @@ void psys_free_settings(ParticleSettings *part) void free_hair(ParticleSystem *psys, int softbody) { - ParticleData *pa; - int i, totpart=psys->totpart; + PARTICLE_P; - for(i=0, pa=psys->particles; ipart->type != PART_HAIR) + return; + + LOOP_PARTICLES { if(pa->hair) MEM_freeN(pa->hair); pa->hair = NULL; + pa->totkey = 0; } psys->flag &= ~PSYS_HAIR_DONE; @@ -386,13 +389,15 @@ void free_hair(ParticleSystem *psys, int softbody) } void free_keyed_keys(ParticleSystem *psys) { - ParticleData *pa; - int i; + PARTICLE_P; + + if(psys->part->type == PART_HAIR) + return; if(psys->particles && psys->particles->keys) { MEM_freeN(psys->particles->keys); - for(i=0, pa=psys->particles; itotpart; i++, pa++) { + LOOP_PARTICLES { if(pa->keys) { pa->keys= NULL; pa->totkey= 0; @@ -431,6 +436,29 @@ void psys_free_children(ParticleSystem *psys) free_child_path_cache(psys); } +void psys_free_particles(ParticleSystem *psys) +{ + PARTICLE_P; + + if(psys->particles) { + if(psys->part->type==PART_HAIR) { + LOOP_PARTICLES { + if(pa->hair) + MEM_freeN(pa->hair); + } + } + + if(psys->particles->keys) + MEM_freeN(psys->particles->keys); + + if(psys->particles->boid) + MEM_freeN(psys->particles->boid); + + MEM_freeN(psys->particles); + psys->particles= NULL; + psys->totpart= 0; + } +} /* free everything */ void psys_free(Object *ob, ParticleSystem * psys) { @@ -440,22 +468,11 @@ void psys_free(Object *ob, ParticleSystem * psys) psys_free_path_cache(psys, NULL); - free_hair(psys, 1); - - free_keyed_keys(psys); + psys_free_particles(psys); if(psys->edit && psys->free_edit) psys->free_edit(psys->edit); - if(psys->particles){ - if(psys->particles->boid) - MEM_freeN(psys->particles->boid); - - MEM_freeN(psys->particles); - psys->particles = 0; - psys->totpart = 0; - } - if(psys->child){ MEM_freeN(psys->child); psys->child = 0; @@ -485,14 +502,11 @@ void psys_free(Object *ob, ParticleSystem * psys) psys->part=0; } - if(psys->reactevents.first) - BLI_freelistN(&psys->reactevents); - BKE_ptcache_free_list(&psys->ptcaches); psys->pointcache = NULL; - if(psys->targets.first) - BLI_freelistN(&psys->targets); + BLI_freelistN(&psys->targets); + BLI_freelistN(&psys->reactevents); BLI_kdtree_free(psys->tree); @@ -1015,11 +1029,12 @@ static void init_particle_interpolation(Object *ob, ParticleSystem *psys, Partic pind->dietime = *((point->keys + point->totkey - 1)->time); } else if(pind->keyed) { - pind->kkey[0] = pa->keys; - pind->kkey[1] = pa->totkey > 1 ? pa->keys + 1 : NULL; + ParticleKey *key = pa->keys; + pind->kkey[0] = key; + pind->kkey[1] = pa->totkey > 1 ? key + 1 : NULL; - pind->birthtime = pa->keys->time; - pind->dietime = (pa->keys + pa->totkey - 1)->time; + pind->birthtime = key->time; + pind->dietime = (key + pa->totkey - 1)->time; } else if(pind->cache) { get_pointcache_keys_for_time(ob, pind->cache, -1, 0.0f, NULL, NULL); @@ -1028,17 +1043,18 @@ static void init_particle_interpolation(Object *ob, ParticleSystem *psys, Partic pind->dietime = pa ? pa->dietime : pind->cache->endframe; } else { - pind->hkey[0] = pa->hair; - pind->hkey[1] = pa->hair + 1; + HairKey *key = pa->hair; + pind->hkey[0] = key; + pind->hkey[1] = key + 1; - pind->birthtime = pa->hair->time; - pind->dietime = (pa->hair + pa->totkey - 1)->time; + pind->birthtime = key->time; + pind->dietime = (key + pa->totkey - 1)->time; } - if(pind->soft) { - pind->bp[0] = pind->soft->bpoint + pa->bpi; - pind->bp[1] = pind->soft->bpoint + pa->bpi + 1; - } + //if(pind->soft) { + // pind->bp[0] = pind->soft->bpoint + pa->bpi; + // pind->bp[1] = pind->soft->bpoint + pa->bpi + 1; + //} } static void edit_to_particle(ParticleKey *key, PTCacheEditKey *ekey) { @@ -2558,6 +2574,9 @@ void psys_cache_child_paths(Scene *scene, Object *ob, ParticleSystem *psys, floa ListBase threads; int i, totchild, totparent, totthread; + if(psys->flag & PSYS_GLOBAL_HAIR) + return; + pthreads= psys_threads_create(scene, ob, psys); if(!psys_threads_init_path(pthreads, scene, cfra, editupdate)) { @@ -2688,7 +2707,8 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra } if(!psys->totchild) { - pa_length = 1.0f - part->randlength * 0.5 * (1.0f + pa->r_ave[0]); + BLI_srandom(psys->seed + i); + pa_length = 1.0f - part->randlength * BLI_frand(); if(vg_length) pa_length *= psys_particle_value_from_verts(psmd->dm,part->from,pa,vg_length); } @@ -2740,7 +2760,7 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra do_particle_interpolation(psys, i, pa, t, frs_sec, &pind, &result); /* keyed, baked and softbody are allready in global space */ - if(!keyed && !baked && !soft) { + if(!keyed && !baked && !soft && !(psys->flag & PSYS_GLOBAL_HAIR)) { Mat4MulVecfl(hairmat, result.co); } @@ -3574,6 +3594,8 @@ float psys_get_size(Object *ob, Material *ma, ParticleSystemModifierData *psmd, { ParticleTexture ptex; float size=1.0f; + + BLI_srandom(psys->seed + (pa - psys->particles) + 100); if(ma && part->from!=PART_FROM_PARTICLE){ ptex.size=size; @@ -3592,7 +3614,7 @@ float psys_get_size(Object *ob, Material *ma, ParticleSystemModifierData *psmd, size*=psys_particle_value_from_verts(psmd->dm,part->from,pa,vg_size); if(part->randsize!=0.0) - size*= 1.0f - part->randsize*pa->sizemul; + size*= 1.0f - part->randsize * BLI_frand(); return size*part->size; } @@ -3759,13 +3781,6 @@ void psys_get_particle_on_path(Scene *scene, Object *ob, ParticleSystem *psys, i if(pparticles + p; - - if(pa->alive==PARS_DEAD && part->flag & PART_STICKY && pa->flag & PARS_STICKY && pa->stick_ob){ - copy_particle_key(state,&pa->state,0); - key_from_object(pa->stick_ob,state); - return; - } - pind.keyed = keyed; pind.cache = cached ? psys->pointcache : NULL; pind.soft = NULL; @@ -3981,20 +3996,11 @@ int psys_get_particle_state(struct Scene *scene, Object *ob, ParticleSystem *psy return 0; /* currently not supported */ else if(psys->totchild && p>=psys->totpart){ ChildParticle *cpa=psys->child+p-psys->totpart; - ParticleKey *key1, skey; + ParticleKey *key1; float t = (cfra - pa->time + pa->loop * pa->lifetime) / pa->lifetime; pa = psys->particles + cpa->parent; - - if(pa->alive==PARS_DEAD && part->flag&PART_STICKY && pa->flag&PARS_STICKY && pa->stick_ob) { - key1 = &skey; - copy_particle_key(key1,&pa->state,0); - key_from_object(pa->stick_ob,key1); - } - else { - key1=&pa->state; - } - + key1=&pa->state; offset_child(cpa, key1, state, part->childflat, part->childrad); CLAMP(t,0.0,1.0); @@ -4051,10 +4057,6 @@ int psys_get_particle_state(struct Scene *scene, Object *ob, ParticleSystem *psy } } - if(pa->alive==PARS_DEAD && part->flag&PART_STICKY && pa->flag&PARS_STICKY && pa->stick_ob){ - key_from_object(pa->stick_ob,state); - } - if(psys->lattice) calc_latt_deform(psys->lattice, state->co,1.0f); } diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 0f72c1c5866..eb570ba287c 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -123,21 +123,11 @@ static int get_current_display_percentage(ParticleSystem *psys) void psys_reset(ParticleSystem *psys, int mode) { ParticleSettings *part= psys->part; - ParticleData *pa; - int i; + PARTICLE_P; if(ELEM(mode, PSYS_RESET_ALL, PSYS_RESET_DEPSGRAPH)) { if(mode == PSYS_RESET_ALL || !(part->type == PART_HAIR && (psys->edit && psys->edit->edited))) { - if(psys->particles) { - if(psys->particles->keys) - MEM_freeN(psys->particles->keys); - - for(i=0, pa=psys->particles; itotpart; i++, pa++) - if(pa->hair) MEM_freeN(pa->hair); - - MEM_freeN(psys->particles); - psys->particles= NULL; - } + psys_free_particles(psys); psys->totpart= 0; psys->totkeyed= 0; @@ -155,10 +145,7 @@ void psys_reset(ParticleSystem *psys, int mode) } else if(mode == PSYS_RESET_CACHE_MISS) { /* set all particles to be skipped */ - ParticleData *pa = psys->particles; - int p=0; - - for(; ptotpart; p++, pa++) + LOOP_PARTICLES pa->flag |= PARS_NO_DISP; } @@ -180,9 +167,10 @@ void psys_reset(ParticleSystem *psys, int mode) static void realloc_particles(Object *ob, ParticleSystem *psys, int new_totpart) { - ParticleData *newpars = 0, *pa; - BoidData *newboids = 0; - int i, totpart, totsaved = 0; + ParticleData *newpars = NULL; + BoidParticle *newboids = NULL; + PARTICLE_P; + int totpart, totsaved = 0; if(new_totpart<0) { if(psys->part->distr==PART_DISTR_GRID && psys->part->from != PART_FROM_VERT) { @@ -195,47 +183,46 @@ static void realloc_particles(Object *ob, ParticleSystem *psys, int new_totpart) else totpart=new_totpart; - if(totpart) { + if(totpart && totpart != psys->totpart) { newpars= MEM_callocN(totpart*sizeof(ParticleData), "particles"); + + if(psys->particles) { + totsaved=MIN2(psys->totpart,totpart); + /*save old pars*/ + if(totsaved) { + memcpy(newpars,psys->particles,totsaved*sizeof(ParticleData)); - if(psys->part->phystype == PART_PHYS_BOIDS) - newboids = MEM_callocN(totpart*sizeof(BoidData), "Boid Data"); - } - if(psys->particles) { - totsaved=MIN2(psys->totpart,totpart); - /*save old pars*/ - if(totsaved) { - memcpy(newpars,psys->particles,totsaved*sizeof(ParticleData)); - - if(newboids) - memcpy(newboids, psys->particles->boid, totsaved*sizeof(BoidData)); - } - - if(psys->particles->keys) - MEM_freeN(psys->particles->keys); - - if(psys->particles->boid) - MEM_freeN(psys->particles->boid); - - for(i=0, pa=newpars; ikeys) { - pa->keys= NULL; - pa->totkey= 0; + if(psys->particles->boid) + memcpy(newboids, psys->particles->boid, totsaved*sizeof(BoidParticle)); } + + if(psys->particles->keys) + MEM_freeN(psys->particles->keys); + + if(psys->particles->boid) + MEM_freeN(psys->particles->boid); + + for(p=0, pa=newpars; pkeys) { + pa->keys= NULL; + pa->totkey= 0; + } + } + + for(p=totsaved, pa=psys->particles+totsaved; ptotpart; p++, pa++) + if(pa->hair) MEM_freeN(pa->hair); + + MEM_freeN(psys->particles); } + + psys->particles=newpars; - for(i=totsaved, pa=psys->particles+totsaved; itotpart; i++, pa++) - if(pa->hair) MEM_freeN(pa->hair); - - MEM_freeN(psys->particles); - } - psys->particles=newpars; - - if(newboids) { - pa = psys->particles; - pa->boid = newboids; - for(i=1, pa++; iboid = (pa-1)->boid + 1; + if(newboids) { + LOOP_PARTICLES + pa->boid = newboids++; + } + + psys->totpart=totpart; } if(psys->child) { @@ -243,8 +230,6 @@ static void realloc_particles(Object *ob, ParticleSystem *psys, int new_totpart) psys->child=0; psys->totchild=0; } - - psys->totpart=totpart; } static int get_psys_child_number(struct Scene *scene, ParticleSystem *psys) @@ -291,8 +276,7 @@ void psys_calc_dmcache(Object *ob, DerivedMesh *dm, ParticleSystem *psys) each original elements can reference its derived elements */ Mesh *me= (Mesh*)ob->data; - ParticleData *pa= 0; - int p; + PARTICLE_P; /* CACHE LOCATIONS */ if(!dm->deformedOnly) { @@ -329,7 +313,7 @@ void psys_calc_dmcache(Object *ob, DerivedMesh *dm, ParticleSystem *psys) } /* cache the verts/faces! */ - for(p=0,pa=psys->particles; ptotpart; p++,pa++) { + LOOP_PARTICLES { if(psys->part->from == PART_FROM_VERT) { if(nodearray[pa->num]) pa->num_dmcache= GET_INT_FROM_POINTER(nodearray[pa->num]->link); @@ -349,7 +333,7 @@ void psys_calc_dmcache(Object *ob, DerivedMesh *dm, ParticleSystem *psys) * should know to use the num or num_dmcache, set the num_dmcache to * an invalid value, just incase */ - for(p=0,pa=psys->particles; ptotpart; p++,pa++) + LOOP_PARTICLES pa->num_dmcache = -1; } } @@ -1449,12 +1433,11 @@ static void distribute_particles_on_dm(DerivedMesh *finaldm, Scene *scene, Objec /* ready for future use, to emit particles without geometry */ static void distribute_particles_on_shape(Object *ob, ParticleSystem *psys, int from) { - ParticleData *pa; - int totpart=psys->totpart, p; + PARTICLE_P; fprintf(stderr,"Shape emission not yet possible!\n"); - for(p=0,pa=psys->particles; pfuv[0]=pa->fuv[1]=pa->fuv[2]=pa->fuv[3]= 0.0; pa->foffset= 0.0f; pa->num= -1; @@ -1476,12 +1459,11 @@ static void distribute_particles(Scene *scene, Object *ob, ParticleSystem *psys, distribute_particles_on_shape(ob,psys,from); if(distr_error){ - ParticleData *pa; - int totpart=psys->totpart, p; + PARTICLE_P; fprintf(stderr,"Particle distribution error!\n"); - for(p=0,pa=psys->particles; pfuv[0]=pa->fuv[1]=pa->fuv[2]=pa->fuv[3]= 0.0; pa->foffset= 0.0f; pa->num= -1; @@ -1576,7 +1558,7 @@ void initialize_particle(ParticleData *pa, int p, Object *ob, ParticleSystem *ps Material *ma=0; //IpoCurve *icu=0; // XXX old animation system int totpart; - float rand,length; + float rand; part=psys->part; @@ -1631,40 +1613,8 @@ void initialize_particle(ParticleData *pa, int p, Object *ob, ParticleSystem *ps pa->dietime= pa->time+pa->lifetime; - pa->sizemul= BLI_frand(); - - rand= BLI_frand(); - - /* while loops are to have a spherical distribution (avoid cubic distribution) */ - if(part->phystype != PART_PHYS_BOIDS) { - /* boids store gravity in r_ve, so skip here */ - length=2.0f; - while(length>1.0){ - pa->r_ve[0]=2.0f*(BLI_frand()-0.5f); - pa->r_ve[1]=2.0f*(BLI_frand()-0.5f); - pa->r_ve[2]=2.0f*(BLI_frand()-0.5f); - length=VecLength(pa->r_ve); - } - } - - length=2.0f; - while(length>1.0){ - pa->r_ave[0]=2.0f*(BLI_frand()-0.5f); - pa->r_ave[1]=2.0f*(BLI_frand()-0.5f); - pa->r_ave[2]=2.0f*(BLI_frand()-0.5f); - length=VecLength(pa->r_ave); - } - - pa->r_rot[0]=2.0f*(BLI_frand()-0.5f); - pa->r_rot[1]=2.0f*(BLI_frand()-0.5f); - pa->r_rot[2]=2.0f*(BLI_frand()-0.5f); - pa->r_rot[3]=2.0f*(BLI_frand()-0.5f); - - NormalQuat(pa->r_rot); - if(part->type!=PART_HAIR && part->distr!=PART_DISTR_GRID && part->from != PART_FROM_VERT){ - /* any unique random number will do (r_ave[0]) */ - if(ptex.exist < 0.5*(1.0+pa->r_ave[0])) + if(ptex.exist < BLI_frand()) pa->flag |= PARS_UNEXIST; else pa->flag &= ~PARS_UNEXIST; @@ -1678,10 +1628,9 @@ void initialize_particle(ParticleData *pa, int p, Object *ob, ParticleSystem *ps static void initialize_all_particles(Object *ob, ParticleSystem *psys, ParticleSystemModifierData *psmd) { //IpoCurve *icu=0; // XXX old animation system - ParticleData *pa; - int p, totpart=psys->totpart; + PARTICLE_P; - for(p=0, pa=psys->particles; ppart->type != PART_FLUID) { @@ -1749,10 +1698,39 @@ void reset_particle(Scene *scene, ParticleData *pa, ParticleSystem *psys, Partic float fac, phasefac, nor[3]={0,0,0},loc[3],tloc[3],vel[3]={0.0,0.0,0.0},rot[4],q2[4]; float r_vel[3],r_ave[3],r_rot[4],p_vel[3]={0.0,0.0,0.0}; float x_vec[3]={1.0,0.0,0.0}, utan[3]={0.0,1.0,0.0}, vtan[3]={0.0,0.0,1.0}, rot_vec[3]={0.0,0.0,0.0}; - float q_phase[4]; + float q_phase[4], length, r_phase; part=psys->part; ptex.ivel=1.0; + + BLI_srandom(psys->seed + (pa - psys->particles)); + + /* we need to get every random even if they're not used so that they don't effect eachother */ + /* while loops are to have a spherical distribution (avoid cubic distribution) */ + length=2.0f; + while(length>1.0){ + r_vel[0]=2.0f*(BLI_frand()-0.5f); + r_vel[1]=2.0f*(BLI_frand()-0.5f); + r_vel[2]=2.0f*(BLI_frand()-0.5f); + length=VecLength(r_vel); + } + + length=2.0f; + while(length>1.0){ + r_ave[0]=2.0f*(BLI_frand()-0.5f); + r_ave[1]=2.0f*(BLI_frand()-0.5f); + r_ave[2]=2.0f*(BLI_frand()-0.5f); + length=VecLength(r_ave); + } + + r_rot[0]=2.0f*(BLI_frand()-0.5f); + r_rot[1]=2.0f*(BLI_frand()-0.5f); + r_rot[2]=2.0f*(BLI_frand()-0.5f); + r_rot[3]=2.0f*(BLI_frand()-0.5f); + + NormalQuat(r_rot); + + r_phase = BLI_frand(); if(part->from==PART_FROM_PARTICLE){ Object *tob; @@ -1763,29 +1741,26 @@ void reset_particle(Scene *scene, ParticleData *pa, ParticleSystem *psys, Partic if(tob==0) tob=ob; - tpsys=BLI_findlink(&tob->particlesystem,psys->target_psys-1); + tpsys=BLI_findlink(&tob->particlesystem, psys->target_psys-1); state.time = pa->time; if(pa->num == -1) memset(&state, 0, sizeof(state)); else psys_get_particle_state(scene, tob,tpsys,pa->num,&state,1); - psys_get_from_key(&state,loc,nor,rot,0); + psys_get_from_key(&state, loc, nor, rot, 0); - QuatMulVecf(rot,vtan); - QuatMulVecf(rot,utan); - VECCOPY(r_vel,pa->r_ve); - VECCOPY(r_rot,pa->r_rot); - VECCOPY(r_ave,pa->r_ave); + QuatMulVecf(rot, vtan); + QuatMulVecf(rot, utan); - VECCOPY(p_vel,state.vel); + VECCOPY(p_vel, state.vel); speed=Normalize(p_vel); - VecMulf(p_vel,Inpf(pa->r_ve,p_vel)); - VECSUB(p_vel,pa->r_ve,p_vel); + VecMulf(p_vel, Inpf(r_vel, p_vel)); + VECSUB(p_vel, r_vel, p_vel); Normalize(p_vel); - VecMulf(p_vel,speed); + VecMulf(p_vel, speed); - VECCOPY(pa->fuv,loc); /* abusing pa->fuv (not used for "from particle") for storing emit location */ + VECCOPY(pa->fuv, loc); /* abusing pa->fuv (not used for "from particle") for storing emit location */ } else{ /* get precise emitter matrix if particle is born */ @@ -1839,29 +1814,25 @@ void reset_particle(Scene *scene, ParticleData *pa, ParticleSystem *psys, Partic /* -velocity */ if(part->randfac!=0.0){ - VECADD(r_vel,tloc,pa->r_ve); - Mat4MulVecfl(ob->obmat,r_vel); - VECSUB(r_vel,r_vel,loc); + Mat4Mul3Vecfl(ob->obmat,r_vel); Normalize(r_vel); } /* -angular velocity */ if(part->avemode==PART_AVE_RAND){ - VECADD(r_ave,tloc,pa->r_ave); - Mat4MulVecfl(ob->obmat,r_ave); - VECSUB(r_ave,r_ave,loc); + Mat4Mul3Vecfl(ob->obmat,r_ave); Normalize(r_ave); } /* -rotation */ if(part->randrotfac != 0.0f){ - QUATCOPY(r_rot,pa->r_rot); Mat4ToQuat(ob->obmat,rot); QuatMul(r_rot,r_rot,rot); } } if(part->phystype==PART_PHYS_BOIDS) { + BoidParticle *bpa = pa->boid; float dvec[3], q[4], mat[3][3]; VECCOPY(pa->state.co,loc); @@ -1878,16 +1849,21 @@ void reset_particle(Scene *scene, ParticleData *pa, ParticleSystem *psys, Partic VECCOPY(pa->state.ave, nor); } /* and gravity in r_ve */ - pa->r_ve[0] = pa->r_ve[1] = 0.0f; - pa->r_ve[2] = -1.0f; + bpa->gravity[0] = bpa->gravity[1] = 0.0f; + bpa->gravity[2] = -1.0f; if(part->acc[2]!=0.0f) - pa->r_ve[2] = part->acc[2]; + bpa->gravity[2] = part->acc[2]; + + //pa->r_ve[0] = pa->r_ve[1] = 0.0f; + //pa->r_ve[2] = -1.0f; + //if(part->acc[2]!=0.0f) + // pa->r_ve[2] = part->acc[2]; /* calculate rotation matrix */ - Projf(dvec, pa->r_ve, pa->state.ave); + Projf(dvec, r_vel, pa->state.ave); VecSubf(mat[0], pa->state.ave, dvec); Normalize(mat[0]); - VECCOPY(mat[2], pa->r_ve); + VECCOPY(mat[2], r_vel); VecMulf(mat[2], -1.0f); Normalize(mat[2]); Crossf(mat[1], mat[2], mat[0]); @@ -1896,10 +1872,10 @@ void reset_particle(Scene *scene, ParticleData *pa, ParticleSystem *psys, Partic Mat3ToQuat_is_ok(mat, q); QuatCopy(pa->state.rot, q); - pa->boid->health = part->boids->health; - pa->boid->mode = eBoidMode_InAir; - pa->boid->state_id = ((BoidState*)part->boids->states.first)->id; - pa->boid->acc[0]=pa->boid->acc[1]=pa->boid->acc[2]=0.0f; + bpa->data.health = part->boids->health; + bpa->data.mode = eBoidMode_InAir; + bpa->data.state_id = ((BoidState*)part->boids->states.first)->id; + bpa->data.acc[0]=bpa->data.acc[1]=bpa->data.acc[2]=0.0f; } else { /* conversion done so now we apply new: */ @@ -1988,8 +1964,8 @@ void reset_particle(Scene *scene, ParticleData *pa, ParticleSystem *psys, Partic /* rotation phase */ phasefac = part->phasefac; - if(part->randphasefac != 0.0f) /* abuse r_ave[0] as a random number */ - phasefac += part->randphasefac * pa->r_ave[0]; + if(part->randphasefac != 0.0f) + phasefac += part->randphasefac * r_phase; VecRotToQuat(x_vec, phasefac*(float)M_PI, q_phase); /* combine base rotation & phase */ @@ -2027,8 +2003,7 @@ void reset_particle(Scene *scene, ParticleData *pa, ParticleSystem *psys, Partic pa->state.time = cfra; - pa->stick_ob = 0; - pa->flag &= ~PARS_STICKY; +// pa->flag &= ~PARS_STICKY; } static void reset_all_particles(Scene *scene, Object *ob, ParticleSystem *psys, ParticleSystemModifierData *psmd, float dtime, float cfra, int from) { @@ -2094,8 +2069,9 @@ static void set_keyed_keys(Scene *scene, Object *ob, ParticleSystem *psys) { ParticleSystem *kpsys = psys; ParticleTarget *pt; - ParticleData *pa; - int totpart = psys->totpart, i, k, totkeys = psys->totkeyed; + PARTICLE_P; + ParticleKey *key; + int totpart = psys->totpart, k, totkeys = psys->totkeyed; /* no proper targets so let's clear and bail out */ if(psys->totkeyed==0) { @@ -2107,12 +2083,12 @@ static void set_keyed_keys(Scene *scene, Object *ob, ParticleSystem *psys) if(totpart && psys->particles->totkey != totkeys) { free_keyed_keys(psys); - psys->particles->keys = MEM_callocN(totpart*totkeys*sizeof(ParticleKey), "Keyed keys"); - psys->particles->totkey = totkeys; + key = MEM_callocN(totpart*totkeys*sizeof(ParticleKey), "Keyed keys"); - for(i=1, pa=psys->particles+1; ikeys = (pa-1)->keys + totkeys; + LOOP_PARTICLES { + pa->keys = key; pa->totkey = totkeys; + key += totkeys; } } @@ -2126,22 +2102,23 @@ static void set_keyed_keys(Scene *scene, Object *ob, ParticleSystem *psys) else kpsys = BLI_findlink(&ob->particlesystem, pt->psys - 1); - for(i=0,pa=psys->particles; ikeys + k)->time = -1.0; /* use current time */ + LOOP_PARTICLES { + key = pa->keys + k; + key->time = -1.0; /* use current time */ - psys_get_particle_state(scene, pt->ob, kpsys, i%kpsys->totpart, pa->keys + k, 1); + psys_get_particle_state(scene, pt->ob, kpsys, p%kpsys->totpart, key, 1); if(psys->flag & PSYS_KEYED_TIMING){ - (pa->keys+k)->time = pa->time + pt->time; + key->time = pa->time + pt->time; if(pt->duration != 0.0f && k+1 < totkeys) { - copy_particle_key(pa->keys+k+1, pa->keys+k, 1); - (pa->keys+k+1)->time = pa->time + pt->time + pt->duration; + copy_particle_key(key+1, key, 1); + (key+1)->time = pa->time + pt->time + pt->duration; } } else if(totkeys > 1) - (pa->keys+k)->time = pa->time + (float)k / (float)(totkeys - 1) * pa->lifetime; + key->time = pa->time + (float)k / (float)(totkeys - 1) * pa->lifetime; else - pa->keys->time = pa->time; + key->time = pa->time; } if(psys->flag & PSYS_KEYED_TIMING && pt->duration!=0.0f) @@ -2296,16 +2273,15 @@ void psys_get_pointcache_start_end(Scene *scene, ParticleSystem *psys, int *sfra static void update_particle_tree(ParticleSystem *psys) { if(psys) { - ParticleData *pa = psys->particles; - int p, totpart = psys->totpart; + PARTICLE_P; if(!psys->tree || psys->tree_frame != psys->cfra) { BLI_kdtree_free(psys->tree); - psys->tree = BLI_kdtree_new(totpart); + psys->tree = BLI_kdtree_new(psys->totpart); - for(p=0, pa=psys->particles; pflag & (PARS_NO_DISP+PARS_UNEXIST) || pa->alive != PARS_ALIVE) continue; @@ -2548,9 +2524,9 @@ static void precalc_effectors(Scene *scene, Object *ob, ParticleSystem *psys, Pa ListBase *lb=&psys->effectors; ParticleEffectorCache *ec; ParticleSettings *part=psys->part; - ParticleData *pa; + PARTICLE_P; + int totpart; float vec2[3],loc[3],*co=0; - int p,totpart; for(ec= lb->first; ec; ec= ec->next) { PartDeflect *pd= ec->ob->pd; @@ -2574,7 +2550,7 @@ static void precalc_effectors(Scene *scene, Object *ob, ParticleSystem *psys, Pa ec->distances=MEM_callocN(totpart*sizeof(float),"particle distances"); ec->locations=MEM_callocN(totpart*3*sizeof(float),"particle locations"); - for(p=0,pa=psys->particles; pfrom == PART_FROM_PARTICLE) { VECCOPY(loc, pa->fuv); } @@ -3253,9 +3229,10 @@ static void deflect_particle(Scene *scene, Object *pob, ParticleSystemModifierDa /* override for boids */ if(part->phystype == PART_PHYS_BOIDS) { + BoidParticle *bpa = pa->boid; radius = pa->size; boid_z = pa->state.co[2]; - skip_ob = pa->stick_ob; + skip_ob = bpa->ground; } /* 10 iterations to catch multiple deflections */ @@ -3325,12 +3302,7 @@ static void deflect_particle(Scene *scene, Object *pob, ParticleSystemModifierDa deflections=max_deflections; /* store for reactors */ - copy_particle_key(&reaction_state,&pa->state,0); - - if(part->flag & PART_STICKY){ - pa->stick_ob=ob; - pa->flag |= PARS_STICKY; - } + copy_particle_key(&reaction_state, &pa->state, 0); } else { float nor_vec[3], tan_vec[3], tan_vel[3], vel[3]; @@ -3418,7 +3390,8 @@ static void deflect_particle(Scene *scene, Object *pob, ParticleSystemModifierDa VECADDFAC(co, co, col.nor, (through ? -0.0001f : 0.0001f)); if(part->phystype == PART_PHYS_BOIDS && part->boids->options & BOID_ALLOW_LAND) { - if(pa->boid->mode == eBoidMode_OnLand || co[2] <= boid_z) { + BoidParticle *bpa = pa->boid; + if(bpa->data.mode == eBoidMode_OnLand || co[2] <= boid_z) { co[2] = boid_z; vel[2] = 0.0f; } @@ -3460,10 +3433,9 @@ static void deflect_particle(Scene *scene, Object *pob, ParticleSystemModifierDa /* Hair */ /************************************************/ static void save_hair(Scene *scene, Object *ob, ParticleSystem *psys, ParticleSystemModifierData *psmd, float cfra){ - ParticleData *pa; - HairKey *key; + HairKey *key, *root; + PARTICLE_P; int totpart; - int i; Mat4Invert(ob->imat,ob->obmat); @@ -3474,21 +3446,22 @@ static void save_hair(Scene *scene, Object *ob, ParticleSystem *psys, ParticleSy totpart=psys->totpart; /* save new keys for elements if needed */ - for(i=0,pa=psys->particles; itotkey==0 || pa->hair==NULL) { pa->hair = MEM_callocN((psys->part->hair_step + 1) * sizeof(HairKey), "HairKeys"); pa->totkey = 0; } - key = pa->hair + pa->totkey; + key = root = pa->hair; + key += pa->totkey; /* convert from global to geometry space */ VecCopyf(key->co, pa->state.co); Mat4MulVecfl(ob->imat, key->co); if(pa->totkey) { - VECSUB(key->co, key->co, pa->hair->co); + VECSUB(key->co, key->co, root->co); psys_vec_rot_to_face(psmd->dm, pa, key->co); } @@ -3500,7 +3473,7 @@ static void save_hair(Scene *scene, Object *ob, ParticleSystem *psys, ParticleSy /* root is always in the origin of hair space so we set it to be so after the last key is saved*/ if(pa->totkey == psys->part->hair_step + 1) - pa->hair->co[0] = pa->hair->co[1] = pa->hair->co[2] = 0.0f; + root->co[0] = root->co[1] = root->co[2] = 0.0f; } } /************************************************/ @@ -3510,14 +3483,14 @@ static void save_hair(Scene *scene, Object *ob, ParticleSystem *psys, ParticleSy static void dynamics_step(Scene *scene, Object *ob, ParticleSystem *psys, ParticleSystemModifierData *psmd, float cfra, float *vg_vel, float *vg_tan, float *vg_rot, float *vg_size) { - ParticleData *pa; ParticleSettings *part=psys->part; KDTree *tree=0; IpoCurve *icu_esize= NULL; //=find_ipocurve(part->ipo,PART_EMIT_SIZE); // XXX old animation system Material *ma=give_current_material(ob,part->omat); BoidBrainData bbd; + PARTICLE_P; float timestep; - int p, totpart; + int totpart; /* current time */ float ctime, ipotime; // XXX old animation system /* frame & time changes */ @@ -3546,7 +3519,7 @@ static void dynamics_step(Scene *scene, Object *ob, ParticleSystem *psys, Partic if(part->type==PART_REACTOR) vg_size=psys_cache_vgroup(psmd->dm,psys,PSYS_VG_SIZE); - for(p=0, pa=psys->particles; pflag & PARS_UNEXIST) continue; /* set correct ipo timing */ @@ -3615,7 +3588,7 @@ static void dynamics_step(Scene *scene, Object *ob, ParticleSystem *psys, Partic } /* main loop: calculate physics for all particles */ - for(p=0, pa=psys->particles; pflag & (PARS_UNEXIST+PARS_NO_DISP)) continue; copy_particle_key(&pa->prev_state,&pa->state,1); @@ -3703,9 +3676,6 @@ static void dynamics_step(Scene *scene, Object *ob, ParticleSystem *psys, Partic else{ pa->alive=PARS_DEAD; pa->state.time=pa->dietime; - - if(pa->flag&PARS_STICKY) - psys_key_to_object(pa->stick_ob,&pa->state,0); } } else @@ -3769,12 +3739,13 @@ static void psys_update_path_cache(Scene *scene, Object *ob, ParticleSystemModif static void hair_step(Scene *scene, Object *ob, ParticleSystemModifierData *psmd, ParticleSystem *psys, float cfra) { ParticleSettings *part = psys->part; - ParticleData *pa; - int p; - float disp = (float)get_current_display_percentage(psys)/50.0f-1.0f; + PARTICLE_P; + float disp = (float)get_current_display_percentage(psys)/100.0f; - for(p=0, pa=psys->particles; ptotpart; p++,pa++){ - if(pa->r_rot[0] > disp) + BLI_srandom(psys->seed); + + LOOP_PARTICLES { + if(BLI_frand() > disp) pa->flag |= PARS_NO_DISP; else pa->flag &= ~PARS_NO_DISP; @@ -3798,13 +3769,14 @@ static void hair_step(Scene *scene, Object *ob, ParticleSystemModifierData *psmd static void cached_step(Scene *scene, Object *ob, ParticleSystemModifierData *psmd, ParticleSystem *psys, float cfra) { ParticleSettings *part=psys->part; - ParticleData *pa; ParticleKey state; IpoCurve *icu_esize= NULL; //=find_ipocurve(part->ipo,PART_EMIT_SIZE); // XXX old animation system Material *ma=give_current_material(ob,part->omat); - int p; + PARTICLE_P; float disp, birthtime, dietime, *vg_size= NULL; // XXX ipotime=cfra + BLI_srandom(psys->seed); + if(part->from!=PART_FROM_PARTICLE) vg_size= psys_cache_vgroup(psmd->dm,psys,PSYS_VG_SIZE); @@ -3817,9 +3789,9 @@ static void cached_step(Scene *scene, Object *ob, ParticleSystemModifierData *ps precalc_effectors(scene, ob,psys,psmd,cfra); //} - disp= (float)get_current_display_percentage(psys)/50.0f-1.0f; + disp= (float)get_current_display_percentage(psys)/100.0f; - for(p=0, pa=psys->particles; ptotpart; p++,pa++){ + LOOP_PARTICLES { #if 0 // XXX old animation system if((part->flag&PART_ABS_TIME)==0 && part->ipo){ ipotime=100.0f*(cfra-pa->time)/pa->lifetime; @@ -3866,7 +3838,7 @@ static void cached_step(Scene *scene, Object *ob, ParticleSystemModifierData *ps psys->lattice= NULL; } - if(pa->r_rot[0] > disp) + if(BLI_frand() > disp) pa->flag |= PARS_NO_DISP; else pa->flag &= ~PARS_NO_DISP; @@ -3919,8 +3891,8 @@ static void psys_changed_type(Object *ob, ParticleSystem *psys) else { free_hair(psys, 1); - CLAMP(part->path_start, part->sta, part->end + part->lifetime); - CLAMP(part->path_end, part->sta, part->end + part->lifetime); + CLAMP(part->path_start, 0.0f, MAX2(100.0f, part->end + part->lifetime)); + CLAMP(part->path_end, 0.0f, MAX2(100.0f, part->end + part->lifetime)); } psys->softflag= 0; @@ -3929,23 +3901,25 @@ static void psys_changed_type(Object *ob, ParticleSystem *psys) } void psys_check_boid_data(ParticleSystem *psys) { - ParticleData *pa = psys->particles; - int p = 1; + BoidParticle *bpa; + PARTICLE_P; + + pa = psys->particles; if(!pa) return; if(psys->part && psys->part->phystype==PART_PHYS_BOIDS) { if(!pa->boid) { - pa->boid = MEM_callocN(psys->totpart * sizeof(BoidData), "Boid Data"); + bpa = MEM_callocN(psys->totpart * sizeof(BoidParticle), "Boid Data"); - for(pa++; ptotpart; p++, pa++) - pa->boid = (pa-1)->boid + 1; + LOOP_PARTICLES + pa->boid = bpa++; } } else if(pa->boid){ MEM_freeN(pa->boid); - for(; ptotpart; p++, pa++) + LOOP_PARTICLES pa->boid = NULL; } } @@ -4093,10 +4067,10 @@ static void particles_fluid_step(Scene *scene, Object *ob, ParticleSystem *psys, static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, ParticleSystemModifierData *psmd, float cfra) { ParticleSettings *part; - ParticleData *pa; PointCache *cache; PTCacheID pid; - int totpart, oldtotpart, totchild, oldtotchild, p; + PARTICLE_P; + int totpart, oldtotpart, totchild, oldtotchild; float disp, *vg_vel= 0, *vg_tan= 0, *vg_rot= 0, *vg_size= 0; int init= 0, distr= 0, alloc= 0, usecache= 0, only_children_changed= 0; int framenr, framedelta, startframe, endframe; @@ -4239,7 +4213,7 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle } else if(result==PTCACHE_READ_OLD) { psys->cfra = (float)cache->simframe; - for(p=0, pa=psys->particles; ptime > psys->cfra) pa->alive = PARS_UNBORN; @@ -4278,10 +4252,11 @@ static void system_step(Scene *scene, Object *ob, ParticleSystem *psys, Particle } /* set particles to be not calculated TODO: can't work with pointcache */ - disp= (float)get_current_display_percentage(psys)/50.0f-1.0f; + disp= (float)get_current_display_percentage(psys)/100.0f; - for(p=0, pa=psys->particles; pr_rot[0] > disp) + BLI_srandom(psys->seed); + LOOP_PARTICLES { + if(BLI_frand() > disp) pa->flag |= PARS_NO_DISP; else pa->flag &= ~PARS_NO_DISP; diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 7a156f56d72..3e429749953 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -181,6 +181,7 @@ static int ptcache_write_particle(int index, void *psys_v, void **data) { ParticleSystem *psys= psys_v; ParticleData *pa = psys->particles + index; + BoidParticle *boid = (psys->part->phystype == PART_PHYS_BOIDS) ? pa->boid : NULL; float times[3] = {pa->time, pa->dietime, pa->lifetime}; if(data[BPHYS_DATA_INDEX]) { @@ -198,8 +199,8 @@ static int ptcache_write_particle(int index, void *psys_v, void **data) ptcache_data_from(data, BPHYS_DATA_SIZE, &pa->size); ptcache_data_from(data, BPHYS_DATA_TIMES, times); - if(pa->boid) - ptcache_data_from(data, BPHYS_DATA_TIMES, &pa->boid); + if(boid) + ptcache_data_from(data, BPHYS_DATA_BOIDS, &boid->data); return 1; } @@ -215,6 +216,7 @@ static void ptcache_read_particle(int index, void *psys_v, void **data, float fr { ParticleSystem *psys= psys_v; ParticleData *pa = psys->particles + index; + BoidParticle *boid = (psys->part->phystype == PART_PHYS_BOIDS) ? pa->boid : NULL; if(cfra > pa->state.time) memcpy(&pa->prev_state, &pa->state, sizeof(ParticleKey)); @@ -238,8 +240,8 @@ static void ptcache_read_particle(int index, void *psys_v, void **data, float fr pa->lifetime = times[2]; } - if(pa->boid) - ptcache_data_to(data, BPHYS_DATA_BOIDS, 0, &pa->boid); + if(boid) + ptcache_data_to(data, BPHYS_DATA_BOIDS, 0, &boid->data); /* determine velocity from previous location */ if(data[BPHYS_DATA_LOCATION] && !data[BPHYS_DATA_VELOCITY]) { diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 40a28251495..fdbfe154fae 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -3623,9 +3623,9 @@ static void particles_to_softbody(Scene *scene, Object *ob) /* find first BodyPoint index for each particle */ if(psys->totpart > 0) { - psys->particles->bpi = 0; - for(a=1, pa=psys->particles+1; atotpart; a++, pa++) - pa->bpi = (pa-1)->bpi + (pa-1)->totkey; +// psys->particles->bpi = 0; +// for(a=1, pa=psys->particles+1; atotpart; a++, pa++) +// pa->bpi = (pa-1)->bpi + (pa-1)->totkey; } /* we always make body points */ @@ -4079,7 +4079,7 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i if(framenr < startframe) { cache->flag &= ~PTCACHE_SIMULATION_VALID; cache->simframe= 0; - cache->last_exact= 0; + //cache->last_exact= 0; return; } @@ -4141,20 +4141,29 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i pa= sb->particles->particles; } + if(framenr == startframe && cache->flag & PTCACHE_REDO_NEEDED) { + BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_OUTDATED); + cache->simframe= framenr; + cache->flag &= ~PTCACHE_REDO_NEEDED; + return; + } + /* try to read from cache */ cache_result = BKE_ptcache_read_cache(&pid, framenr, scene->r.frs_sec); if(cache_result == PTCACHE_READ_EXACT || cache_result == PTCACHE_READ_INTERPOLATED) { - cache->flag |= PTCACHE_SIMULATION_VALID; - cache->simframe= framenr; - if(sb->particles==0) softbody_to_object(ob, vertexCos, numVerts, sb->local); + cache->simframe= framenr; + cache->flag |= PTCACHE_SIMULATION_VALID; + + if(cache_result == PTCACHE_READ_INTERPOLATED && cache->flag & PTCACHE_REDO_NEEDED) + BKE_ptcache_write_cache(&pid, framenr); + return; } else if(cache_result==PTCACHE_READ_OLD) { - BKE_ptcache_id_reset(scene, &pid, PTCACHE_RESET_FREE); cache->flag |= PTCACHE_SIMULATION_VALID; } else if(ob->id.lib || (cache->flag & PTCACHE_BAKED)) { @@ -4166,16 +4175,11 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i } if(framenr == startframe) { - if(cache->flag & PTCACHE_REDO_NEEDED) { - softbody_update_positions(ob, sb, vertexCos, numVerts); - softbody_reset(ob, sb, vertexCos, numVerts); - cache->flag &= ~PTCACHE_REDO_NEEDED; - } /* first frame, no simulation to do, just set the positions */ softbody_update_positions(ob, sb, vertexCos, numVerts); - cache->flag |= PTCACHE_SIMULATION_VALID; cache->simframe= framenr; + cache->flag |= PTCACHE_SIMULATION_VALID; /* don't write cache on first frame, but on second frame write * cache for frame 1 and 2 */ @@ -4187,10 +4191,6 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i softbody_update_positions(ob, sb, vertexCos, numVerts); - /* do simulation */ - cache->flag |= PTCACHE_SIMULATION_VALID; - cache->simframe= framenr; - /* checking time: */ dtime = framedelta*timescale; @@ -4199,6 +4199,10 @@ void sbObjectStep(Scene *scene, Object *ob, float cfra, float (*vertexCos)[3], i if(sb->particles==0) softbody_to_object(ob, vertexCos, numVerts, 0); + /* do simulation */ + cache->simframe= framenr; + cache->flag |= PTCACHE_SIMULATION_VALID; + BKE_ptcache_write_cache(&pid, framenr); } } diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 5a628192af6..6a26a71ee3d 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3055,11 +3055,8 @@ static void direct_link_particlesettings(FileData *fd, ParticleSettings *part) static void lib_link_particlesystems(FileData *fd, Object *ob, ID *id, ListBase *particles) { ParticleSystem *psys, *psysnext; - int a; for(psys=particles->first; psys; psys=psysnext){ - ParticleData *pa; - psysnext= psys->next; psys->part = newlibadr_us(fd, id->lib, psys->part); @@ -3070,12 +3067,6 @@ static void lib_link_particlesystems(FileData *fd, Object *ob, ID *id, ListBase pt->ob=newlibadr(fd, id->lib, pt->ob); psys->target_ob = newlibadr(fd, id->lib, psys->target_ob); - - for(a=0,pa=psys->particles; atotpart; a++,pa++){ - pa->stick_ob=newlibadr(fd, id->lib, pa->stick_ob); - } - - } else { /* particle modifier must be removed before particle system */ diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 88c6f205d15..c4a94660932 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -653,7 +653,7 @@ static void write_particlesystems(WriteData *wd, ListBase *particles) } if(psys->particles->boid && psys->part->phystype == PART_PHYS_BOIDS) - writestruct(wd, DATA, "BoidData", psys->totpart, psys->particles->boid); + writestruct(wd, DATA, "BoidParticle", psys->totpart, psys->particles->boid); } pt = psys->targets.first; for(; pt; pt=pt->next) diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 0ae987f2308..a5d365cafd4 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -102,6 +102,7 @@ #include "BKE_object.h" #include "BKE_paint.h" #include "BKE_particle.h" +#include "BKE_pointcache.h" #include "BKE_property.h" #include "BKE_report.h" #include "BKE_sca.h" @@ -3883,6 +3884,8 @@ void ED_object_exit_editmode(bContext *C, int flag) /* for example; displist make is different in editmode */ scene->obedit= NULL; // XXX for context + BKE_ptcache_object_reset(scene, obedit, PTCACHE_RESET_DEPSGRAPH); + /* also flush ob recalc, doesn't take much overhead, but used for particles */ DAG_id_flush_update(&obedit->id, OB_RECALC_OB|OB_RECALC_DATA); diff --git a/source/blender/editors/physics/ed_pointcache.c b/source/blender/editors/physics/ed_pointcache.c index 22316290c7b..f2c7b64032f 100644 --- a/source/blender/editors/physics/ed_pointcache.c +++ b/source/blender/editors/physics/ed_pointcache.c @@ -226,7 +226,7 @@ void PTCACHE_OT_bake(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_boolean(ot->srna, "bake", 1, "Bake", ""); + RNA_def_boolean(ot->srna, "bake", 0, "Bake", ""); } void PTCACHE_OT_free_bake(wmOperatorType *ot) { diff --git a/source/blender/editors/physics/editparticle.c b/source/blender/editors/physics/editparticle.c index 3ddc143b5a3..bc48d8f4f55 100644 --- a/source/blender/editors/physics/editparticle.c +++ b/source/blender/editors/physics/editparticle.c @@ -102,8 +102,6 @@ static void PTCacheUndo_clear(PTCacheEdit *edit); #define LOOP_SELECTED_KEYS for(k=0, key=point->keys; ktotkey; k++, key++) if((key->flag & PEK_SELECT) && !(key->flag & PEK_HIDE)) #define LOOP_TAGGED_KEYS for(k=0, key=point->keys; ktotkey; k++, key++) if(key->flag & PEK_TAG) -#define LOOP_PARTICLES(i, pa) for(i=0, pa=psys->particles; itotpart; i++, pa++) - #define KEY_WCO (key->flag & PEK_USE_WCO ? key->world_co : key->co) /**************************** utilities *******************************/ @@ -642,12 +640,13 @@ static int count_selected_keys(Scene *scene, PTCacheEdit *edit) static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys) { PTCacheEdit *edit; - ParticleData *pa; ParticleSystemModifierData *psmd; KDTree *tree; KDTreeNearest nearest; + HairKey *key; + PARTICLE_P; float mat[4][4], co[3]; - int i, index, totpart; + int index, totpart; edit= psys->edit; psmd= psys_get_modifier(ob, psys); @@ -656,11 +655,12 @@ static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys) tree= BLI_kdtree_new(totpart); /* insert particles into kd tree */ - LOOP_PARTICLES(i, pa) { + LOOP_PARTICLES { + key = pa->hair; psys_mat_hair_to_orco(ob, psmd->dm, psys->part->from, pa, mat); - VECCOPY(co, pa->hair[0].co); + VECCOPY(co, key->co); Mat4MulVecfl(mat, co); - BLI_kdtree_insert(tree, i, co, NULL); + BLI_kdtree_insert(tree, p, co, NULL); } BLI_kdtree_balance(tree); @@ -669,27 +669,28 @@ static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys) if(!edit->mirror_cache) edit->mirror_cache= MEM_callocN(sizeof(int)*totpart, "PE mirror cache"); - LOOP_PARTICLES(i, pa) { + LOOP_PARTICLES { + key = pa->hair; psys_mat_hair_to_orco(ob, psmd->dm, psys->part->from, pa, mat); - VECCOPY(co, pa->hair[0].co); + VECCOPY(co, key->co); Mat4MulVecfl(mat, co); co[0]= -co[0]; index= BLI_kdtree_find_nearest(tree, co, NULL, &nearest); /* this needs a custom threshold still, duplicated for editmode mirror */ - if(index != -1 && index != i && (nearest.dist <= 0.0002f)) - edit->mirror_cache[i]= index; + if(index != -1 && index != p && (nearest.dist <= 0.0002f)) + edit->mirror_cache[p]= index; else - edit->mirror_cache[i]= -1; + edit->mirror_cache[p]= -1; } /* make sure mirrors are in two directions */ - LOOP_PARTICLES(i, pa) { - if(edit->mirror_cache[i]) { - index= edit->mirror_cache[i]; - if(edit->mirror_cache[index] != i) - edit->mirror_cache[i]= -1; + LOOP_PARTICLES { + if(edit->mirror_cache[p]) { + index= edit->mirror_cache[p]; + if(edit->mirror_cache[index] != p) + edit->mirror_cache[p]= -1; } } @@ -1735,7 +1736,7 @@ static void rekey_particle(PEData *data, int pa_index) ParticleData *pa= psys->particles + pa_index; PTCacheEditPoint *point = edit->points + pa_index; ParticleKey state; - HairKey *key, *new_keys; + HairKey *key, *new_keys, *okey; PTCacheEditKey *ekey; float dval, sta, end; int k; @@ -1744,12 +1745,13 @@ static void rekey_particle(PEData *data, int pa_index) key= new_keys= MEM_callocN(data->totrekey * sizeof(HairKey),"Hair re-key keys"); + okey = pa->hair; /* root and tip stay the same */ - VECCOPY(key->co, pa->hair->co); - VECCOPY((key + data->totrekey - 1)->co, (pa->hair + pa->totkey - 1)->co); + VECCOPY(key->co, okey->co); + VECCOPY((key + data->totrekey - 1)->co, (okey + pa->totkey - 1)->co); - sta= key->time= pa->hair->time; - end= (key + data->totrekey - 1)->time= (pa->hair + pa->totkey - 1)->time; + sta= key->time= okey->time; + end= (key + data->totrekey - 1)->time= (okey + pa->totkey - 1)->time; dval= (end - sta) / (float)(data->totrekey - 1); /* interpolate new keys from old ones */ @@ -2034,9 +2036,11 @@ static void subdivide_particle(PEData *data, int pa_index) nkey= new_keys= MEM_callocN((pa->totkey+totnewkey)*(sizeof(HairKey)),"Hair subdivide keys"); nekey= new_ekeys= MEM_callocN((pa->totkey+totnewkey)*(sizeof(PTCacheEditKey)),"Hair subdivide edit keys"); - endtime= pa->hair[pa->totkey-1].time; + + key = pa->hair; + endtime= key[pa->totkey-1].time; - for(k=0, key=pa->hair, ekey=point->keys; ktotkey-1; k++, key++, ekey++) { + for(k=0, ekey=point->keys; ktotkey-1; k++, key++, ekey++) { memcpy(nkey,key,sizeof(HairKey)); memcpy(nekey,ekey,sizeof(PTCacheEditKey)); @@ -2461,7 +2465,6 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged) *newpa= *pa; *newpoint= *point; if(pa->hair) newpa->hair= MEM_dupallocN(pa->hair); - if(pa->keys) newpa->keys= MEM_dupallocN(pa->keys); if(point->keys) newpoint->keys= MEM_dupallocN(point->keys); /* rotate weights according to vertex index rotation */ @@ -2966,7 +2969,7 @@ static void brush_add(PEData *data, short number) weight[w] /= totw; for(k=0; ktotaddkey; k++) { - hkey= pa->hair + k; + hkey= (HairKey*)pa->hair + k; hkey->time= pa->time + k * framestep; key[0].time= hkey->time/ 100.0f; @@ -2990,15 +2993,15 @@ static void brush_add(PEData *data, short number) if(k==0) VECSUB(co1, pa->state.co, key[0].co); - VECADD(pa->hair[k].co, key[0].co, co1); + VECADD(hkey->co, key[0].co, co1); - pa->hair[k].time= key[0].time; + hkey->time= key[0].time; } } else { for(k=0, hkey=pa->hair; ktotaddkey; k++, hkey++) { VECADDFAC(hkey->co, pa->state.co, pa->state.vel, k * framestep * timestep); - pa->hair[k].time += k * framestep; + hkey->time += k * framestep; } } for(k=0, hkey=pa->hair; ktotaddkey; k++, hkey++) { diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index e49616fc740..25ff1244254 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -3373,8 +3373,9 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv pa_birthtime=pa->time; pa_dietime = pa->dietime; pa_size=pa->size; - if(part->phystype==PART_PHYS_BOIDS) - pa_health = pa->boid->health; + if(part->phystype==PART_PHYS_BOIDS) { + pa_health = pa->boid->data.health; + } else pa_health = -1.0; @@ -3409,8 +3410,10 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv } #endif // XXX old animation system - r_tilt = 1.0f + pa->r_ave[0]; - r_length = 0.5f * (1.0f + pa->r_ave[1]); + BLI_srandom(psys->seed+a); + + r_tilt = 2.0f*(BLI_frand() - 0.5f); + r_length = BLI_frand(); } else{ ChildParticle *cpa= &psys->child[a-totpart]; diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index 12c253a7cb8..d4dc3df0965 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -33,6 +33,7 @@ #define DNA_PARTICLE_TYPES_H #include "DNA_ID.h" +#include "DNA_boid_types.h" struct AnimData; @@ -52,6 +53,14 @@ typedef struct ParticleKey { /* when changed update size of struct to copy_parti float time; /* when this key happens */ } ParticleKey; +typedef struct BoidParticle { + struct Object *ground; + struct BoidData data; + float gravity[3]; + float wander[3]; + float rt; +} BoidParticle; + /* Child particles are created around or between parent particles */ typedef struct ChildParticle { int num, parent; /* num is face index on the final derived mesh */ @@ -69,42 +78,34 @@ typedef struct ParticleTarget { float time, duration; } ParticleTarget; -/* Everything that's non dynamic for a particle: */ typedef struct ParticleData { - struct Object *stick_ob;/* object that particle sticks to when dead */ - - ParticleKey state; /* normally current global coordinates or */ - /* in sticky object space if dead & sticky */ + ParticleKey state; /* current global coordinates */ ParticleKey prev_state; /* previous state */ - + HairKey *hair; /* hair vertices */ - ParticleKey *keys; /* keyed states */ + ParticleKey *keys; /* keyed keys */ - struct BoidData *boid; /* boids data */ + BoidParticle *boid; /* boids data */ - float r_rot[4]; /* random values */ - float r_ave[3],r_ve[3]; - - float fuv[4], foffset; /* coordinates on face/edge number "num" and depth along*/ - /* face normal for volume emission */ + int totkey; /* amount of hair or keyed keys*/ float time, lifetime; /* dietime is not nescessarily time+lifetime as */ float dietime; /* particles can die unnaturally (collision) */ - float size, sizemul; /* size and multiplier so that we can update size when ever */ - int num; /* index to vert/edge/face */ int num_dmcache; /* index to derived mesh data (face) to avoid slow lookups */ - int totkey; - int bpi; /* softbody body point start index */ + float fuv[4], foffset; /* coordinates on face/edge number "num" and depth along*/ + /* face normal for volume emission */ + + float size; /* size and multiplier so that we can update size when ever */ short flag; - short alive; /* the life state of a particle */ + short alive; /* the life state of a particle */ short loop; /* how many times particle life has looped */ - short rt2; + short rt; } ParticleData; typedef struct ParticleSettings { @@ -258,7 +259,7 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in #define PART_TRAND 128 #define PART_EDISTR 256 /* particle/face from face areas */ -#define PART_STICKY 512 /*collided particles can stick to collider*/ +//#define PART_STICKY 512 /*collided particles can stick to collider*/ #define PART_DIE_ON_COL (1<<12) #define PART_SIZE_DEFL (1<<13) /* swept sphere deflections */ #define PART_ROT_DYN (1<<14) /* dynamic rotation */ @@ -409,7 +410,7 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in /* psys->flag */ #define PSYS_CURRENT 1 -//#define PSYS_BAKING 2 +#define PSYS_GLOBAL_HAIR 2 //#define PSYS_BAKE_UI 4 #define PSYS_KEYED_TIMING 8 #define PSYS_ENABLED 16 /* deprecated */ @@ -426,7 +427,7 @@ typedef struct ParticleSystem{ /* note, make sure all (runtime) are NULL's in /* pars->flag */ #define PARS_UNEXIST 1 #define PARS_NO_DISP 2 -#define PARS_STICKY 4 +//#define PARS_STICKY 4 #define PARS_REKEY 8 /* pars->alive */ diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 2525209c3be..4a23605c717 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -643,12 +643,6 @@ static void rna_def_particle(BlenderRNA *brna) RNA_def_struct_sdna(srna, "ParticleData"); RNA_def_struct_ui_text(srna, "Particle", "Particle in a particle system."); - prop= RNA_def_property(srna, "stick_object", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "stick_ob"); - RNA_def_property_struct_type(prop, "Object"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Stick Object", "Object that particle sticks to when dead"); - /* Particle State & Previous State */ prop= RNA_def_property(srna, "location", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "state.co"); @@ -693,24 +687,6 @@ static void rna_def_particle(BlenderRNA *brna) RNA_def_property_collection_sdna(prop, NULL, "keys", "totkey"); RNA_def_property_struct_type(prop, "ParticleKey"); RNA_def_property_ui_text(prop, "Keyed States", ""); - - /* Random variables */ - - prop= RNA_def_property(srna, "random_rotation", PROP_FLOAT, PROP_QUATERNION); - RNA_def_property_float_sdna(prop, NULL, "r_rot"); -// RNA_def_property_range(prop, lowerLimitf, upperLimitf); - RNA_def_property_ui_text(prop, "Random Rotation", ""); - - prop= RNA_def_property(srna, "random_a_velocity", PROP_FLOAT, PROP_VELOCITY); - RNA_def_property_float_sdna(prop, NULL, "r_ave"); -// RNA_def_property_range(prop, lowerLimitf, upperLimitf); - RNA_def_property_ui_text(prop, "Random Angular Velocity", ""); - - prop= RNA_def_property(srna, "random_velocity", PROP_FLOAT, PROP_VELOCITY); - RNA_def_property_float_sdna(prop, NULL, "r_ve"); -// RNA_def_property_range(prop, lowerLimitf, upperLimitf); - RNA_def_property_ui_text(prop, "Random Velocity", ""); - // // float fuv[4], foffset; /* coordinates on face/edge number "num" and depth along*/ // /* face normal for volume emission */ @@ -733,18 +709,12 @@ static void rna_def_particle(BlenderRNA *brna) // RNA_def_property_range(prop, lowerLimitf, upperLimitf); RNA_def_property_ui_text(prop, "Size", ""); - prop= RNA_def_property(srna, "size_multiplier", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "sizemul"); -// RNA_def_property_range(prop, lowerLimitf, upperLimitf); - RNA_def_property_ui_text(prop, "Size Multiplier", ""); - // // int num; /* index to vert/edge/face */ // int num_dmcache; /* index to derived mesh data (face) to avoid slow lookups */ // int pad; // // int totkey; -// int bpi; /* softbody body point start index */ /* flag */ prop= RNA_def_property(srna, "unexist", PROP_BOOLEAN, PROP_NONE); @@ -755,10 +725,6 @@ static void rna_def_particle(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_NO_DISP); RNA_def_property_ui_text(prop, "no_disp", ""); - prop= RNA_def_property(srna, "sticky", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_STICKY); - RNA_def_property_ui_text(prop, "sticky", ""); - prop= RNA_def_property(srna, "rekey", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PARS_REKEY); RNA_def_property_ui_text(prop, "rekey", ""); @@ -942,13 +908,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); RNA_def_property_ui_text(prop, "Even Distribution", "Use even distribution from faces based on face areas or edge lengths."); RNA_def_property_update(prop, 0, "rna_Particle_reset"); - - prop= RNA_def_property(srna, "sticky", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_STICKY); - RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); - RNA_def_property_ui_text(prop, "Sticky", "Particles stick to collided objects if they die in the collision."); - RNA_def_property_update(prop, 0, "rna_Particle_reset"); - + prop= RNA_def_property(srna, "die_on_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_DIE_ON_COL); RNA_def_property_clear_flag(prop, PROP_ANIMATEABLE); diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index cf6246e3641..df99d5f2843 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -1743,8 +1743,10 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem pa_size = pa->size; - r_tilt = 1.0f + pa->r_ave[0]; - r_length = 0.5f * (1.0f + pa->r_ave[1]); + BLI_srandom(psys->seed+a); + + r_tilt = 2.0f*(BLI_frand() - 0.5f); + r_length = BLI_frand(); if(path_nbr) { cache = psys->pathcache[a]; From c802d187e5810441545e08dbf1b7d63a71c21f88 Mon Sep 17 00:00:00 2001 From: "Guillermo S. Romero" Date: Fri, 4 Sep 2009 23:20:45 +0000 Subject: [PATCH 441/577] Comment out line so build does not crash due to NULL pointer. --- source/blender/makesrna/intern/rna_space.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 0ac7fa40727..542f6e2aeda 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1219,7 +1219,7 @@ static void rna_def_console_line(BlenderRNA *brna) srna = RNA_def_struct(brna, "ConsoleLine", NULL); RNA_def_struct_ui_text(srna, "Console Input", "Input line for the interactive console."); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL); + // XXX using non-inited "prop", uh? RNA_def_property_update(prop, NC_SPACE|ND_SPACE_CONSOLE, NULL); prop= RNA_def_property(srna, "line", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_ConsoleLine_line_get", "rna_ConsoleLine_line_length", "rna_ConsoleLine_line_set"); From fc8ba755bd1f9171064528761934e11ca43918ce Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Fri, 4 Sep 2009 23:22:46 +0000 Subject: [PATCH 442/577] * fix linking order. NOTE: this needs changes to stubs.c, but need to check with ideasman_42 how to fix with cmake. Probably linking order issues, but stubs.c currently generates warnings for msvc (redefinition of funcs) and errors for mingw (same redefinitions). Removing the offending lines from stubs.c fixes that. --- source/blender/avi/SConscript | 3 +-- source/blender/blenkernel/SConscript | 2 +- source/blender/blenlib/SConscript | 2 +- source/blender/blenloader/SConscript | 2 +- source/blender/imbuf/SConscript | 2 +- source/blender/makesrna/SConscript | 2 +- source/blender/python/SConscript | 4 ++-- 7 files changed, 8 insertions(+), 9 deletions(-) diff --git a/source/blender/avi/SConscript b/source/blender/avi/SConscript index f6e5b787b58..61385958a84 100644 --- a/source/blender/avi/SConscript +++ b/source/blender/avi/SConscript @@ -1,5 +1,4 @@ #!/usr/bin/python -#Import ('extra_includes') Import ('env') sources = env.Glob('intern/*.c') @@ -7,4 +6,4 @@ sources = env.Glob('intern/*.c') incs = '. #/intern/guardedalloc' incs += ' ' + env['BF_JPEG_INC'] -env.BlenderLib ('bf_avi', sources, Split(incs), [], libtype=['core'], priority = [185] ) +env.BlenderLib ('bf_avi', sources, Split(incs), [], libtype=['core'], priority = [190] ) diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript index 0c7922de6ff..f000f778dcb 100644 --- a/source/blender/blenkernel/SConscript +++ b/source/blender/blenkernel/SConscript @@ -65,4 +65,4 @@ if env['WITH_BF_LCMS']: if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): incs += ' ' + env['BF_PTHREADS_INC'] -env.BlenderLib ( libname = 'bf_blenkernel', sources = sources, includes = Split(incs), defines = defs, libtype=['core'], priority = [165] ) +env.BlenderLib ( libname = 'bf_blenkernel', sources = sources, includes = Split(incs), defines = defs, libtype=['core'], priority = [166] ) diff --git a/source/blender/blenlib/SConscript b/source/blender/blenlib/SConscript index 3d7d6b63e64..65bd65bdc35 100644 --- a/source/blender/blenlib/SConscript +++ b/source/blender/blenlib/SConscript @@ -16,4 +16,4 @@ if env['OURPLATFORM'] == 'linux2': if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): incs += ' ' + env['BF_PTHREADS_INC'] -env.BlenderLib ( 'bf_blenlib', sources, Split(incs), Split(defs), libtype=['core'], priority = [180], compileflags =cflags ) +env.BlenderLib ( 'bf_blenlib', sources, Split(incs), Split(defs), libtype=['core'], priority = [363], compileflags =cflags ) diff --git a/source/blender/blenloader/SConscript b/source/blender/blenloader/SConscript index 0a9b8d05747..00e102c686c 100644 --- a/source/blender/blenloader/SConscript +++ b/source/blender/blenloader/SConscript @@ -11,4 +11,4 @@ incs += ' ' + env['BF_ZLIB_INC'] defs = [] -env.BlenderLib ( 'bf_blenloader', sources, Split(incs), defs, libtype=['core'], priority = [135] ) +env.BlenderLib ( 'bf_blenloader', sources, Split(incs), defs, libtype=['core'], priority = [167] ) diff --git a/source/blender/imbuf/SConscript b/source/blender/imbuf/SConscript index 9da0cf21596..cdc1a5f5257 100644 --- a/source/blender/imbuf/SConscript +++ b/source/blender/imbuf/SConscript @@ -35,4 +35,4 @@ if env['WITH_BF_QUICKTIME']: incs += ' ../quicktime ' + env['BF_QUICKTIME_INC'] defs.append('WITH_QUICKTIME') -env.BlenderLib ( libname = 'bf_imbuf', sources = sources, includes = Split(incs), defines = defs, libtype=['core'], priority = [190] ) +env.BlenderLib ( libname = 'bf_imbuf', sources = sources, includes = Split(incs), defines = defs, libtype=['core'], priority = [185] ) diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript index 80abd4fda61..482c9ce7afd 100644 --- a/source/blender/makesrna/SConscript +++ b/source/blender/makesrna/SConscript @@ -37,4 +37,4 @@ if env['WITH_BF_LCMS']: if env['WITH_BF_GAMEENGINE']: defs.append('GAMEBLENDER=1') -env.BlenderLib ( 'bf_rna', objs, Split(incs), defines=defs, libtype=['core'], priority = [195] ) +env.BlenderLib ( 'bf_rna', objs, Split(incs), defines=defs, libtype=['core'], priority = [165] ) diff --git a/source/blender/python/SConscript b/source/blender/python/SConscript index d44cf762a0f..2601626851e 100644 --- a/source/blender/python/SConscript +++ b/source/blender/python/SConscript @@ -13,9 +13,9 @@ defs = [] if env['OURPLATFORM'] in ('win32-mingw', 'win32-vc','win64-vc') and env['BF_DEBUG']: defs.append('_DEBUG') -env.BlenderLib( libname = 'bf_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core'], priority = [140]) +env.BlenderLib( libname = 'bf_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core'], priority = [361]) # generic sources = env.Glob('generic/*.c') -env.BlenderLib( libname = 'bf_gen_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core'], priority = [361]) # ketsji is 360 +env.BlenderLib( libname = 'bf_gen_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core'], priority = [362]) # ketsji is 360 From 9216efcba2a5c62b081872da3fbd9c59524685bf Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sat, 5 Sep 2009 01:58:02 +0000 Subject: [PATCH 443/577] == SCons == * bring back 'player' libtype, after investigation with ideasman. scons/mingw works nicely, for some reason msvc fails to link still, will look further into it. --- SConstruct | 2 +- extern/binreloc/SConscript | 2 +- extern/bullet2/src/SConscript | 16 ++++++++-------- extern/glew/SConscript | 2 +- extern/libopenjpeg/SConscript | 4 ++-- intern/audaspace/SConscript | 2 +- intern/ghost/SConscript | 2 +- intern/guardedalloc/SConscript | 2 +- intern/iksolver/SConscript | 2 +- intern/memutil/SConscript | 2 +- intern/moto/SConscript | 2 +- intern/string/SConscript | 2 +- source/blender/avi/SConscript | 2 +- source/blender/blenfont/SConscript | 2 +- source/blender/blenkernel/SConscript | 2 +- source/blender/blenlib/SConscript | 2 +- source/blender/blenloader/SConscript | 2 +- source/blender/gpu/SConscript | 2 +- source/blender/imbuf/SConscript | 2 +- source/blender/imbuf/intern/cineon/SConscript | 2 +- source/blender/imbuf/intern/dds/SConscript | 2 +- source/blender/imbuf/intern/openexr/SConscript | 2 +- source/blender/makesdna/SConscript | 2 +- source/blender/makesrna/SConscript | 2 +- source/blender/nodes/SConscript | 8 ++++---- source/blender/python/SConscript | 4 ++-- source/blender/quicktime/SConscript | 4 ++-- source/blender/readblenfile/SConscript | 2 +- .../bad_level_call_stubs/SConscript | 2 +- source/gameengine/BlenderRoutines/SConscript | 2 +- source/gameengine/Converter/SConscript | 2 +- source/gameengine/Expressions/SConscript | 2 +- source/gameengine/GameLogic/SConscript | 2 +- source/gameengine/GamePlayer/common/SConscript | 2 +- source/gameengine/GamePlayer/ghost/SConscript | 2 +- source/gameengine/Ketsji/KXNetwork/SConscript | 2 +- source/gameengine/Ketsji/SConscript | 2 +- .../Network/LoopBackNetwork/SConscript | 2 +- source/gameengine/Network/SConscript | 2 +- source/gameengine/Physics/Bullet/SConscript | 2 +- source/gameengine/Physics/Dummy/SConscript | 2 +- source/gameengine/Physics/common/SConscript | 2 +- .../Rasterizer/RAS_OpenGLRasterizer/SConscript | 2 +- source/gameengine/Rasterizer/SConscript | 2 +- source/gameengine/SceneGraph/SConscript | 2 +- source/gameengine/VideoTexture/SConscript | 2 +- source/kernel/SConscript | 2 +- 47 files changed, 60 insertions(+), 60 deletions(-) diff --git a/SConstruct b/SConstruct index f322ae27e06..12aa37772da 100644 --- a/SConstruct +++ b/SConstruct @@ -404,7 +404,7 @@ if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']: env.BlenderProg(B.root_build_dir, "blender", dobj + mainlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender') if env['WITH_BF_PLAYER']: playerlist = B.create_blender_liblist(env, 'player') - playerlist = playerlist[0:2] + [mainlist[0]] + mainlist[2:] + [playerlist[2]] + #playerlist = playerlist[0:2] + [mainlist[0]] + mainlist[2:] + [playerlist[2]] env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer') ##### Now define some targets diff --git a/extern/binreloc/SConscript b/extern/binreloc/SConscript index 98d7adb2d1e..331b70a4ebc 100644 --- a/extern/binreloc/SConscript +++ b/extern/binreloc/SConscript @@ -9,5 +9,5 @@ cflags = [] sources = ['binreloc.c'] incs = 'include' -env.BlenderLib ( 'extern_binreloc', sources, Split(incs), Split(defs), libtype=['extern'], priority=[36], compileflags = cflags) +env.BlenderLib ( 'extern_binreloc', sources, Split(incs), Split(defs), libtype=['extern','player'], priority=[36,225], compileflags = cflags) diff --git a/extern/bullet2/src/SConscript b/extern/bullet2/src/SConscript index 319cc57ce55..3d0c645e7a0 100644 --- a/extern/bullet2/src/SConscript +++ b/extern/bullet2/src/SConscript @@ -35,11 +35,11 @@ softbody_src = env.Glob("BulletSoftBody/*.cpp") incs = '. BulletCollision BulletDynamics LinearMath BulletSoftBody' -env.BlenderLib ( libname = 'extern_bullet2linmath', sources=linearmath_src, includes=Split(incs), defines=Split(defs), libtype=['extern'], priority=[20], compileflags=cflags ) -env.BlenderLib ( libname = 'extern_bullet2dynamics', sources=bulletdyn_src, includes=Split(incs), defines=Split(defs), libtype=['extern'], priority=[19], compileflags=cflags ) -env.BlenderLib ( libname = 'extern_bullet2collision_broadphase', sources=collision_broadphase_src, includes=Split(incs), defines=Split(defs), libtype=['extern'], priority=[25], compileflags=cflags ) -env.BlenderLib ( libname = 'extern_bullet2collision_dispatch', sources=collision_dispatch_src, includes=Split(incs), defines=Split(defs), libtype=['extern'], priority=[20], compileflags=cflags ) -env.BlenderLib ( libname = 'extern_bullet2collision_gimpact', sources=collision_gimpact_src, includes=Split(incs), defines=Split(defs), libtype=['extern'], priority=[20], compileflags=cflags ) -env.BlenderLib ( libname = 'extern_bullet2collision_shapes', sources=collision_shapes_src, includes=Split(incs), defines=Split(defs), libtype=['extern'], priority=[20], compileflags=cflags ) -env.BlenderLib ( libname = 'extern_bullet2collision_narrowphase', sources=collision_narrowphase_src, includes=Split(incs), defines=Split(defs), libtype=['extern'], priority=[20], compileflags=cflags ) -env.BlenderLib ( libname = 'extern_bullet2softbody', sources=softbody_src, includes=Split(incs), defines=Split(defs), libtype=['extern'], priority=[18], compileflags=cflags ) +env.BlenderLib ( libname = 'extern_bullet2linmath', sources=linearmath_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[20,137], compileflags=cflags ) +env.BlenderLib ( libname = 'extern_bullet2dynamics', sources=bulletdyn_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[19,136], compileflags=cflags ) +env.BlenderLib ( libname = 'extern_bullet2collision_broadphase', sources=collision_broadphase_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[25,145], compileflags=cflags ) +env.BlenderLib ( libname = 'extern_bullet2collision_dispatch', sources=collision_dispatch_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[20,138], compileflags=cflags ) +env.BlenderLib ( libname = 'extern_bullet2collision_gimpact', sources=collision_gimpact_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[20,138], compileflags=cflags ) +env.BlenderLib ( libname = 'extern_bullet2collision_shapes', sources=collision_shapes_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[20,138], compileflags=cflags ) +env.BlenderLib ( libname = 'extern_bullet2collision_narrowphase', sources=collision_narrowphase_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[20,138], compileflags=cflags ) +env.BlenderLib ( libname = 'extern_bullet2softbody', sources=softbody_src, includes=Split(incs), defines=Split(defs), libtype=['extern','player'], priority=[18,135], compileflags=cflags ) diff --git a/extern/glew/SConscript b/extern/glew/SConscript index b83525daffe..81a2fc67ccc 100644 --- a/extern/glew/SConscript +++ b/extern/glew/SConscript @@ -9,4 +9,4 @@ sources = ['src/glew.c'] defs = '' incs = 'include' -env.BlenderLib ( 'extern_glew', sources, Split(incs), Split(defs), libtype=['extern'], priority=[50]) +env.BlenderLib ( 'extern_glew', sources, Split(incs), Split(defs), libtype=['extern','player'], priority=[50,230]) diff --git a/extern/libopenjpeg/SConscript b/extern/libopenjpeg/SConscript index 693fee15c91..da661739783 100644 --- a/extern/libopenjpeg/SConscript +++ b/extern/libopenjpeg/SConscript @@ -24,5 +24,5 @@ if not env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): oj_env.BlenderLib ( libname='extern_openjpeg', sources=sources, includes=Split(incs), defines=defs, - libtype=['extern'], - priority=[10], compileflags = flags) + libtype=['extern','player'], + priority=[10,185], compileflags = flags) diff --git a/intern/audaspace/SConscript b/intern/audaspace/SConscript index 0dfd0bb9e3a..025fa5a2379 100644 --- a/intern/audaspace/SConscript +++ b/intern/audaspace/SConscript @@ -31,4 +31,4 @@ if env['WITH_BF_SNDFILE']: incs += ' sndfile ' + env['BF_SNDFILE_INC'] defs.append('WITH_SNDFILE') -env.BlenderLib ('bf_audaspace', sources, Split(incs), defs, libtype=['intern'], priority = [25] ) +env.BlenderLib ('bf_audaspace', sources, Split(incs), defs, libtype=['intern','player'], priority = [25,215] ) diff --git a/intern/ghost/SConscript b/intern/ghost/SConscript index 9de82ac44fb..48009152699 100644 --- a/intern/ghost/SConscript +++ b/intern/ghost/SConscript @@ -29,4 +29,4 @@ else: incs = '. ../string ' + env['BF_OPENGL_INC'] if window_system in ('win32-vc', 'win32-mingw', 'cygwin', 'linuxcross', 'win64-vc'): incs = env['BF_WINTAB_INC'] + ' ' + incs -env.BlenderLib ('bf_ghost', sources, Split(incs), defines=['_USE_MATH_DEFINES'], libtype=['intern'], priority = [40] ) +env.BlenderLib ('bf_ghost', sources, Split(incs), defines=['_USE_MATH_DEFINES'], libtype=['intern','player'], priority = [40,15] ) diff --git a/intern/guardedalloc/SConscript b/intern/guardedalloc/SConscript index 8927bef2efc..2ee0f84b464 100644 --- a/intern/guardedalloc/SConscript +++ b/intern/guardedalloc/SConscript @@ -5,4 +5,4 @@ Import('env') sources = env.Glob('intern/*.c') incs = '.' -env.BlenderLib ('bf_guardedalloc', sources, Split(incs), defines=[], libtype=['intern'], priority = [5] ) +env.BlenderLib ('bf_guardedalloc', sources, Split(incs), defines=[], libtype=['intern','player'], priority = [5,150] ) diff --git a/intern/iksolver/SConscript b/intern/iksolver/SConscript index df8c10b7302..7adb2d50893 100644 --- a/intern/iksolver/SConscript +++ b/intern/iksolver/SConscript @@ -5,5 +5,5 @@ sources = env.Glob('intern/*.cpp') incs = 'intern ../moto/include ../memutil' -env.BlenderLib ('bf_IK', sources, Split(incs), [], libtype=['intern'], priority=[100] ) +env.BlenderLib ('bf_IK', sources, Split(incs), [], libtype=['intern','player'], priority=[100,90] ) diff --git a/intern/memutil/SConscript b/intern/memutil/SConscript index 55c314d5211..318d4a3997e 100644 --- a/intern/memutil/SConscript +++ b/intern/memutil/SConscript @@ -5,4 +5,4 @@ sources = env.Glob('intern/*.cpp') incs = '. ..' -env.BlenderLib ('bf_memutil', sources, Split(incs), [], libtype=['intern'], priority = [0] ) +env.BlenderLib ('bf_memutil', sources, Split(incs), [], libtype=['intern','player'], priority = [0,155] ) diff --git a/intern/moto/SConscript b/intern/moto/SConscript index a730e6de535..d9bbafe4623 100644 --- a/intern/moto/SConscript +++ b/intern/moto/SConscript @@ -5,4 +5,4 @@ sources = env.Glob('intern/*.cpp') incs = 'include' -env.BlenderLib ('bf_moto', sources, Split(incs), [], libtype=['intern'], priority = [130] ) +env.BlenderLib ('bf_moto', sources, Split(incs), [], libtype=['intern','player'], priority = [130,95] ) diff --git a/intern/string/SConscript b/intern/string/SConscript index 8973ac88a66..4aca220183c 100644 --- a/intern/string/SConscript +++ b/intern/string/SConscript @@ -4,4 +4,4 @@ Import ('env') sources = env.Glob('intern/*.cpp') incs = '.' -env.BlenderLib ('bf_string', sources, Split(incs), [], libtype=['intern'], priority = [50] ) +env.BlenderLib ('bf_string', sources, Split(incs), [], libtype=['intern','player'], priority = [50,10] ) diff --git a/source/blender/avi/SConscript b/source/blender/avi/SConscript index 61385958a84..0bf8c3c74db 100644 --- a/source/blender/avi/SConscript +++ b/source/blender/avi/SConscript @@ -6,4 +6,4 @@ sources = env.Glob('intern/*.c') incs = '. #/intern/guardedalloc' incs += ' ' + env['BF_JPEG_INC'] -env.BlenderLib ('bf_avi', sources, Split(incs), [], libtype=['core'], priority = [190] ) +env.BlenderLib ('bf_avi', sources, Split(incs), [], libtype=['core','player'], priority = [190,120] ) diff --git a/source/blender/blenfont/SConscript b/source/blender/blenfont/SConscript index fa6fa19a9ef..d070d985247 100644 --- a/source/blender/blenfont/SConscript +++ b/source/blender/blenfont/SConscript @@ -14,4 +14,4 @@ defs = '' if sys.platform == 'win32': defs += ' _WIN32 USE_GETTEXT_DLL' -env.BlenderLib ( 'bf_blenfont', sources, Split(incs), Split(defs), libtype=['core'], priority=[210] ) +env.BlenderLib ( 'bf_blenfont', sources, Split(incs), Split(defs), libtype=['core','player'], priority=[210,210] ) diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript index f000f778dcb..1f42390504d 100644 --- a/source/blender/blenkernel/SConscript +++ b/source/blender/blenkernel/SConscript @@ -65,4 +65,4 @@ if env['WITH_BF_LCMS']: if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): incs += ' ' + env['BF_PTHREADS_INC'] -env.BlenderLib ( libname = 'bf_blenkernel', sources = sources, includes = Split(incs), defines = defs, libtype=['core'], priority = [166] ) +env.BlenderLib ( libname = 'bf_blenkernel', sources = sources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [166,25] ) diff --git a/source/blender/blenlib/SConscript b/source/blender/blenlib/SConscript index 65bd65bdc35..fc586de5085 100644 --- a/source/blender/blenlib/SConscript +++ b/source/blender/blenlib/SConscript @@ -16,4 +16,4 @@ if env['OURPLATFORM'] == 'linux2': if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): incs += ' ' + env['BF_PTHREADS_INC'] -env.BlenderLib ( 'bf_blenlib', sources, Split(incs), Split(defs), libtype=['core'], priority = [363], compileflags =cflags ) +env.BlenderLib ( 'bf_blenlib', sources, Split(incs), Split(defs), libtype=['core','player'], priority = [363,170], compileflags =cflags ) diff --git a/source/blender/blenloader/SConscript b/source/blender/blenloader/SConscript index 00e102c686c..88d345290e5 100644 --- a/source/blender/blenloader/SConscript +++ b/source/blender/blenloader/SConscript @@ -11,4 +11,4 @@ incs += ' ' + env['BF_ZLIB_INC'] defs = [] -env.BlenderLib ( 'bf_blenloader', sources, Split(incs), defs, libtype=['core'], priority = [167] ) +env.BlenderLib ( 'bf_blenloader', sources, Split(incs), defs, libtype=['core','player'], priority = [167,30] ) diff --git a/source/blender/gpu/SConscript b/source/blender/gpu/SConscript index b45547e359c..e55fbe973f8 100644 --- a/source/blender/gpu/SConscript +++ b/source/blender/gpu/SConscript @@ -8,4 +8,4 @@ incs += ' #/extern/glew/include #intern/guardedalloc ../imbuf .' incs += ' ' + env['BF_OPENGL_INC'] -env.BlenderLib ( 'bf_gpu', sources, Split(incs), [], libtype=['core'], priority=[160] ) +env.BlenderLib ( 'bf_gpu', sources, Split(incs), [], libtype=['core','player'], priority=[160,110] ) diff --git a/source/blender/imbuf/SConscript b/source/blender/imbuf/SConscript index cdc1a5f5257..6052b344da7 100644 --- a/source/blender/imbuf/SConscript +++ b/source/blender/imbuf/SConscript @@ -35,4 +35,4 @@ if env['WITH_BF_QUICKTIME']: incs += ' ../quicktime ' + env['BF_QUICKTIME_INC'] defs.append('WITH_QUICKTIME') -env.BlenderLib ( libname = 'bf_imbuf', sources = sources, includes = Split(incs), defines = defs, libtype=['core'], priority = [185] ) +env.BlenderLib ( libname = 'bf_imbuf', sources = sources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [185,115] ) diff --git a/source/blender/imbuf/intern/cineon/SConscript b/source/blender/imbuf/intern/cineon/SConscript index 371e4cff9eb..d9c8ab14d35 100644 --- a/source/blender/imbuf/intern/cineon/SConscript +++ b/source/blender/imbuf/intern/cineon/SConscript @@ -14,4 +14,4 @@ incs = ['.', defs = [] -env.BlenderLib ('bf_cineon', source_files, incs, defs, libtype=['core'], priority = [220]) +env.BlenderLib ('bf_cineon', source_files, incs, defs, libtype=['core','player'], priority = [220,175]) diff --git a/source/blender/imbuf/intern/dds/SConscript b/source/blender/imbuf/intern/dds/SConscript index 6cabc3f7d79..0b7fd50e317 100644 --- a/source/blender/imbuf/intern/dds/SConscript +++ b/source/blender/imbuf/intern/dds/SConscript @@ -16,4 +16,4 @@ incs = ['.', defs = ['WITH_DDS'] -env.BlenderLib ('bf_dds', source_files, incs, defs, libtype=['core'], priority = [230]) +env.BlenderLib ('bf_dds', source_files, incs, defs, libtype=['core','player'], priority = [230,190]) diff --git a/source/blender/imbuf/intern/openexr/SConscript b/source/blender/imbuf/intern/openexr/SConscript index 729619c963b..f504c503109 100644 --- a/source/blender/imbuf/intern/openexr/SConscript +++ b/source/blender/imbuf/intern/openexr/SConscript @@ -15,4 +15,4 @@ incs += Split(env['BF_OPENEXR_INC']) defs = ['WITH_OPENEXR'] -env.BlenderLib ('bf_openexr', source_files, incs, defs, libtype=['core'], priority = [225]) +env.BlenderLib ('bf_openexr', source_files, incs, defs, libtype=['core','player'], priority = [225,180]) diff --git a/source/blender/makesdna/SConscript b/source/blender/makesdna/SConscript index 1cb61f59121..c3d39783b00 100644 --- a/source/blender/makesdna/SConscript +++ b/source/blender/makesdna/SConscript @@ -8,4 +8,4 @@ objs += o incs = '#/intern/guardedalloc .' -env.BlenderLib ( 'bf_dna', objs, Split(incs), [], libtype=['core'], priority = [215] ) +env.BlenderLib ( 'bf_dna', objs, Split(incs), [], libtype=['core','player'], priority = [215,200] ) diff --git a/source/blender/makesrna/SConscript b/source/blender/makesrna/SConscript index 482c9ce7afd..c2790927cef 100644 --- a/source/blender/makesrna/SConscript +++ b/source/blender/makesrna/SConscript @@ -37,4 +37,4 @@ if env['WITH_BF_LCMS']: if env['WITH_BF_GAMEENGINE']: defs.append('GAMEBLENDER=1') -env.BlenderLib ( 'bf_rna', objs, Split(incs), defines=defs, libtype=['core'], priority = [165] ) +env.BlenderLib ( 'bf_rna', objs, Split(incs), defines=defs, libtype=['core','player'], priority = [165,20] ) diff --git a/source/blender/nodes/SConscript b/source/blender/nodes/SConscript index 0b35db3b4b7..771ce42e1dc 100644 --- a/source/blender/nodes/SConscript +++ b/source/blender/nodes/SConscript @@ -38,7 +38,7 @@ if env['WITH_BF_QUICKTIME']: defs.append('WITH_QUICKTIME') incs += ' ' + env['BF_QUICKTIME_INC'] -env.BlenderLib ( libname = 'bf_nodes', sources = sources, includes = Split(incs), defines = defs, libtype=['core'], priority = [190] ) -env.BlenderLib ( libname = 'bf_cmpnodes', sources = cmpsources, includes = Split(incs), defines = defs, libtype=['core'], priority = [175] ) -env.BlenderLib ( libname = 'bf_shdnodes', sources = shdsources, includes = Split(incs), defines = defs, libtype=['core'], priority = [175] ) -env.BlenderLib ( libname = 'bf_texnodes', sources = texsources, includes = Split(incs), defines = defs, libtype=['core'], priority = [175] ) +env.BlenderLib ( libname = 'bf_nodes', sources = sources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [190,105] ) +env.BlenderLib ( libname = 'bf_cmpnodes', sources = cmpsources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [175,101] ) +env.BlenderLib ( libname = 'bf_shdnodes', sources = shdsources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [175,101] ) +env.BlenderLib ( libname = 'bf_texnodes', sources = texsources, includes = Split(incs), defines = defs, libtype=['core','player'], priority = [175,101] ) diff --git a/source/blender/python/SConscript b/source/blender/python/SConscript index 2601626851e..ca742a3646a 100644 --- a/source/blender/python/SConscript +++ b/source/blender/python/SConscript @@ -13,9 +13,9 @@ defs = [] if env['OURPLATFORM'] in ('win32-mingw', 'win32-vc','win64-vc') and env['BF_DEBUG']: defs.append('_DEBUG') -env.BlenderLib( libname = 'bf_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core'], priority = [361]) +env.BlenderLib( libname = 'bf_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core','player'], priority = [361,160]) # generic sources = env.Glob('generic/*.c') -env.BlenderLib( libname = 'bf_gen_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core'], priority = [362]) # ketsji is 360 +env.BlenderLib( libname = 'bf_gen_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype = ['core','player'], priority = [362,165]) # ketsji is 360 diff --git a/source/blender/quicktime/SConscript b/source/blender/quicktime/SConscript index 5f3995a410a..10e88a8f461 100644 --- a/source/blender/quicktime/SConscript +++ b/source/blender/quicktime/SConscript @@ -19,7 +19,7 @@ incs = ['.', incs.append(env['BF_QUICKTIME_INC']) -types = ['core'] -priorities = [200] +types = ['core','player'] +priorities = [200,235] env.BlenderLib ('bf_quicktime', sources=source_files, includes=incs, defines=['WITH_QUICKTIME'], libtype=types, priority=priorities) diff --git a/source/blender/readblenfile/SConscript b/source/blender/readblenfile/SConscript index c8189501d4b..57ee1866263 100644 --- a/source/blender/readblenfile/SConscript +++ b/source/blender/readblenfile/SConscript @@ -5,4 +5,4 @@ sources = env.Glob('intern/*.c') incs = '. ../blenloader ../blenloader/intern ../blenkernel ../blenlib ../makesdna ../../kernel/gen_messaging' -env.BlenderLib ( 'bf_readblenfile', sources, Split(incs), [], libtype=['core'], priority = [0] ) +env.BlenderLib ( 'bf_readblenfile', sources, Split(incs), [], libtype=['core','player'], priority = [0,195] ) diff --git a/source/blenderplayer/bad_level_call_stubs/SConscript b/source/blenderplayer/bad_level_call_stubs/SConscript index ce502af57be..ab98e984cef 100644 --- a/source/blenderplayer/bad_level_call_stubs/SConscript +++ b/source/blenderplayer/bad_level_call_stubs/SConscript @@ -10,4 +10,4 @@ defs = '' if env['WITH_BF_INTERNATIONAL']: defs += 'WITH_FREETYPE2' -env.BlenderLib ('blenkernel_blc', sources = Split(sources), includes=Split(incs), defines=Split(defs), libtype=['player'],priority=[145] ) +env.BlenderLib ('blenkernel_blc', sources = Split(sources), includes=Split(incs), defines=Split(defs), libtype=['player'],priority=[220] ) diff --git a/source/gameengine/BlenderRoutines/SConscript b/source/gameengine/BlenderRoutines/SConscript index cfb5b0ef525..ad6f9f23fce 100644 --- a/source/gameengine/BlenderRoutines/SConscript +++ b/source/gameengine/BlenderRoutines/SConscript @@ -28,4 +28,4 @@ incs += ' ' + env['BF_PYTHON_INC'] incs += ' ' + env['BF_BULLET_INC'] incs += ' ' + env['BF_OPENGL_INC'] -env.BlenderLib ( 'bf_bloutines', sources, Split(incs), defs, libtype=['core'], priority=[300] , cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_bloutines', sources, Split(incs), defs, libtype=['core','player'], priority=[300,35] , cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Converter/SConscript b/source/gameengine/Converter/SConscript index bf2dfa5e659..2d126310475 100644 --- a/source/gameengine/Converter/SConscript +++ b/source/gameengine/Converter/SConscript @@ -23,4 +23,4 @@ incs += ' #source/blender/makesrna' incs += ' ' + env['BF_PYTHON_INC'] incs += ' ' + env['BF_BULLET_INC'] -env.BlenderLib ( 'bf_converter', sources, Split(incs), defs, libtype=['core'], priority=[305], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_converter', sources, Split(incs), defs, libtype=['core','player'], priority=[305,40], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Expressions/SConscript b/source/gameengine/Expressions/SConscript index cbf33f39568..c819bfb0d3e 100644 --- a/source/gameengine/Expressions/SConscript +++ b/source/gameengine/Expressions/SConscript @@ -6,4 +6,4 @@ sources = env.Glob('*.cpp') incs ='. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/SceneGraph #source/blender/blenloader' incs += ' ' + env['BF_PYTHON_INC'] -env.BlenderLib ( 'bf_expressions', sources, Split(incs), [], libtype=['core'], priority = [360], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_expressions', sources, Split(incs), [], libtype=['core','player'], priority = [360,80], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/GameLogic/SConscript b/source/gameengine/GameLogic/SConscript index f456f4125ab..1530c71c7f3 100644 --- a/source/gameengine/GameLogic/SConscript +++ b/source/gameengine/GameLogic/SConscript @@ -21,4 +21,4 @@ if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): if env['BF_DEBUG']: defs.append('_DEBUG') -env.BlenderLib ( 'bf_logic', sources, Split(incs), defs, libtype=['core'], priority=[330], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_logic', sources, Split(incs), defs, libtype=['core','player'], priority=[330,65], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/GamePlayer/common/SConscript b/source/gameengine/GamePlayer/common/SConscript index 6f37c2f769e..dd5a48c2b55 100644 --- a/source/gameengine/GamePlayer/common/SConscript +++ b/source/gameengine/GamePlayer/common/SConscript @@ -62,4 +62,4 @@ incs += Split(env['BF_PYTHON_INC']) incs += Split(env['BF_PNG_INC']) incs += Split(env['BF_ZLIB_INC']) -env.BlenderLib (libname='gp_common', sources=source_files, includes=incs, defines = [], libtype=['player'], priority=[15], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib (libname='gp_common', sources=source_files, includes=incs, defines = [], libtype=['player'], priority=[5], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/GamePlayer/ghost/SConscript b/source/gameengine/GamePlayer/ghost/SConscript index 6c71eafa1dc..fdd7792b72a 100644 --- a/source/gameengine/GamePlayer/ghost/SConscript +++ b/source/gameengine/GamePlayer/ghost/SConscript @@ -46,4 +46,4 @@ defs = [] if env['WITH_BF_FFMPEG']: defs.append('WITH_FFMPEG') -env.BlenderLib (libname='gp_ghost', sources=source_files, includes = incs, defines = defs, libtype=['player'],priority=[5], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib (libname='gp_ghost', sources=source_files, includes = incs, defines = defs, libtype=['player'],priority=[0], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Ketsji/KXNetwork/SConscript b/source/gameengine/Ketsji/KXNetwork/SConscript index 6429bd76a37..8f88511acca 100644 --- a/source/gameengine/Ketsji/KXNetwork/SConscript +++ b/source/gameengine/Ketsji/KXNetwork/SConscript @@ -9,4 +9,4 @@ incs += ' #source/gameengine/Network #source/gameengine/SceneGraph' incs += ' ' + env['BF_PYTHON_INC'] -env.BlenderLib ( 'bf_network', Split(sources), Split(incs), defines=[],libtype=['core'], priority=[400], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_network', Split(sources), Split(incs), defines=[],libtype=['core','player'], priority=[400,125], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript index 122b77e0173..5f38020780b 100644 --- a/source/gameengine/Ketsji/SConscript +++ b/source/gameengine/Ketsji/SConscript @@ -33,4 +33,4 @@ if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'): if env['BF_DEBUG']: defs.append('_DEBUG') # for Python -env.BlenderLib ( 'bf_ketsji', sources, Split(incs), defs, libtype=['core'], priority=[320], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_ketsji', sources, Split(incs), defs, libtype=['core','player'], priority=[320,45], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Network/LoopBackNetwork/SConscript b/source/gameengine/Network/LoopBackNetwork/SConscript index 2c27ee707f0..dd23e1327eb 100644 --- a/source/gameengine/Network/LoopBackNetwork/SConscript +++ b/source/gameengine/Network/LoopBackNetwork/SConscript @@ -5,4 +5,4 @@ sources = 'NG_LoopBackNetworkDeviceInterface.cpp' incs = '. #source/kernel/gen_system #intern/string #source/gameengine/Network' -env.BlenderLib ( 'bf_loopbacknetwork', Split(sources), Split(incs), defines=[],libtype=['core'], priority=[400] ) +env.BlenderLib ( 'bf_loopbacknetwork', Split(sources), Split(incs), defines=[],libtype=['core','player'], priority=[400,135] ) diff --git a/source/gameengine/Network/SConscript b/source/gameengine/Network/SConscript index f584503e109..3883dc71c9c 100644 --- a/source/gameengine/Network/SConscript +++ b/source/gameengine/Network/SConscript @@ -5,4 +5,4 @@ sources = env.Glob('*.cpp') #'NG_NetworkMessage.cpp NG_NetworkObject.cpp NG_Netw incs = '. #source/kernel/gen_system #intern/string #intern/moto/include' -env.BlenderLib ( 'bf_ngnetwork', sources, Split(incs), [], libtype=['core'], priority=[400] ) +env.BlenderLib ( 'bf_ngnetwork', sources, Split(incs), [], libtype=['core','player'], priority=[400,130] ) diff --git a/source/gameengine/Physics/Bullet/SConscript b/source/gameengine/Physics/Bullet/SConscript index baba40bcdc7..49f2af1b001 100644 --- a/source/gameengine/Physics/Bullet/SConscript +++ b/source/gameengine/Physics/Bullet/SConscript @@ -21,4 +21,4 @@ incs += ' #intern/guardedalloc' incs += ' ' + env['BF_BULLET_INC'] incs += ' ' + env['BF_PYTHON_INC'] -env.BlenderLib ( 'bf_bullet', Split(sources), Split(incs), [], libtype=['core'], priority=[350], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_bullet', Split(sources), Split(incs), [], libtype=['core','player'], priority=[350,50], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Physics/Dummy/SConscript b/source/gameengine/Physics/Dummy/SConscript index f4444cf6746..dc76e8046a0 100644 --- a/source/gameengine/Physics/Dummy/SConscript +++ b/source/gameengine/Physics/Dummy/SConscript @@ -5,4 +5,4 @@ sources = 'DummyPhysicsEnvironment.cpp' incs = '. ../common' -env.BlenderLib ( 'bf_dummy', Split(sources), Split(incs), [], libtype=['core'], priority=[350] ) +env.BlenderLib ( 'bf_dummy', Split(sources), Split(incs), [], libtype=['core','player'], priority=[350,60] ) diff --git a/source/gameengine/Physics/common/SConscript b/source/gameengine/Physics/common/SConscript index b9adbd7210a..719c028ee8f 100644 --- a/source/gameengine/Physics/common/SConscript +++ b/source/gameengine/Physics/common/SConscript @@ -5,4 +5,4 @@ sources = 'PHY_IMotionState.cpp PHY_IController.cpp PHY_IPhysicsController.cpp P incs = '. ../Dummy #intern/moto/include' -env.BlenderLib ( 'bf_physics_common', Split(sources), Split(incs), [], libtype=['core'], priority=[360], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_physics_common', Split(sources), Split(incs), [], libtype=['core','player'], priority=[360,55], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript index b1e5289c14c..fb4c685f8d3 100644 --- a/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript +++ b/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript @@ -8,4 +8,4 @@ incs += ' #source/blender/gpu #extern/glew/include ' + env['BF_OPENGL_INC'] incs += ' #source/blender/gameengine/Ketsji #source/gameengine/SceneGraph #source/blender/makesdna #source/blender/blenkernel' incs += ' #intern/guardedalloc #source/blender/blenlib' -env.BlenderLib ( 'bf_oglrasterizer', Split(sources), Split(incs), [], libtype=['core'], priority=[350], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_oglrasterizer', Split(sources), Split(incs), [], libtype=['core','player'], priority=[350,75], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/Rasterizer/SConscript b/source/gameengine/Rasterizer/SConscript index 064736bcc88..dbec2d92e31 100644 --- a/source/gameengine/Rasterizer/SConscript +++ b/source/gameengine/Rasterizer/SConscript @@ -7,4 +7,4 @@ sources = env.Glob('*.cpp') incs = '. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/BlenderRoutines #extern/glew/include #source/gameengine/Expressions #source/gameengine/SceneGraph #source/blender/blenkernel #source/blender/makesdna' incs += ' ' + env['BF_PYTHON_INC'] -env.BlenderLib ( 'bf_rasterizer', sources, Split(incs), [], libtype=['core'], priority=[350], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_rasterizer', sources, Split(incs), [], libtype=['core','player'], priority=[350,70], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/SceneGraph/SConscript b/source/gameengine/SceneGraph/SConscript index 79bf3033fa1..2a33cd67b5e 100644 --- a/source/gameengine/SceneGraph/SConscript +++ b/source/gameengine/SceneGraph/SConscript @@ -6,4 +6,4 @@ sources = env.Glob('*.cpp') incs = '. #intern/moto/include' -env.BlenderLib ( 'bf_scenegraph', sources, Split(incs), [], libtype=['core'], priority=[325], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_scenegraph', sources, Split(incs), [], libtype=['core','player'], priority=[325,85], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/gameengine/VideoTexture/SConscript b/source/gameengine/VideoTexture/SConscript index 0b35c019178..0d3e495f3e2 100644 --- a/source/gameengine/VideoTexture/SConscript +++ b/source/gameengine/VideoTexture/SConscript @@ -27,4 +27,4 @@ if env['WITH_BF_FFMPEG']: incs += ' ' + env['BF_FFMPEG_INC'] + ' ' + env['BF_PTHREADS_INC'] defs.append('__STDC_CONSTANT_MACROS') -env.BlenderLib ( 'bf_videotex', sources, Split(incs), defs, libtype=['core'], priority=[300], cxx_compileflags=env['BGE_CXXFLAGS']) +env.BlenderLib ( 'bf_videotex', sources, Split(incs), defs, libtype=['core','player'], priority=[300,205], cxx_compileflags=env['BGE_CXXFLAGS']) diff --git a/source/kernel/SConscript b/source/kernel/SConscript index 746fb60d4ff..3110f46cfad 100644 --- a/source/kernel/SConscript +++ b/source/kernel/SConscript @@ -7,4 +7,4 @@ sources += ' gen_system/SYS_System.cpp' incs = 'gen_messaging gen_system #/intern/string #/intern/moto/include #/source/blender/blenloader ' -env.BlenderLib ( 'bf_kernel', Split(sources), Split(incs), [], libtype = ['core'], priority = [400] ) +env.BlenderLib ( 'bf_kernel', Split(sources), Split(incs), [], libtype = ['core','player'], priority = [400,100] ) From d56f826ea9844a0289a216df6f62d28d123f0888 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sat, 5 Sep 2009 02:13:13 +0000 Subject: [PATCH 444/577] remove unnecessary semi-colons --- .../bad_level_call_stubs/stubs.c | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/source/blenderplayer/bad_level_call_stubs/stubs.c b/source/blenderplayer/bad_level_call_stubs/stubs.c index 5ddafca5340..c1585a71ac1 100644 --- a/source/blenderplayer/bad_level_call_stubs/stubs.c +++ b/source/blenderplayer/bad_level_call_stubs/stubs.c @@ -177,24 +177,24 @@ void WM_operator_bl_idname(char *to, const char *from){} short insert_keyframe (struct ID *id, struct bAction *act, const char group[], const char rna_path[], int array_index, float cfra, short flag){return 0;} /* smoke */ -void lzo1x_1_compress(void) {return;}; -void LzmaCompress(void) {return;}; -void smoke_export(void) {return;}; -void lzo1x_decompress(void) {return;}; -void LzmaUncompress(void) {return;}; -void smoke_init(void) {return;}; -void smoke_turbulence_init(void) {return;}; -void smoke_turbulence_initBlenderRNA(void) {return;}; -void smoke_initBlenderRNA(void) {return;}; -void smoke_free(void) {return;}; -void smoke_turbulence_free(void) {return;}; -void smoke_turbulence_step(void) {return;}; -void smoke_dissolve(void) {return;}; -void smoke_get_density(void) {return;}; -void smoke_get_heat(void) {return;}; -void smoke_get_velocity_x(void) {return;}; -void smoke_get_velocity_y(void) {return;}; -void smoke_get_velocity_z(void) {return;}; -void smoke_get_obstacle(void) {return;}; -void smoke_get_index(void) {return;}; -void smoke_step(void) {return;}; +void lzo1x_1_compress(void) {return;} +void LzmaCompress(void) { return; } +void smoke_export(void) {return;} +void lzo1x_decompress(void) {return;} +void LzmaUncompress(void) {return;} +void smoke_init(void) {return;} +void smoke_turbulence_init(void) {return;} +void smoke_turbulence_initBlenderRNA(void) {return;} +void smoke_initBlenderRNA(void) {return;} +void smoke_free(void) {return;} +void smoke_turbulence_free(void) {return;} +void smoke_turbulence_step(void) {return;} +void smoke_dissolve(void) {return;} +void smoke_get_density(void) {return;} +void smoke_get_heat(void) {return;} +void smoke_get_velocity_x(void) {return;} +void smoke_get_velocity_y(void) {return;} +void smoke_get_velocity_z(void) {return;} +void smoke_get_obstacle(void) {return;} +void smoke_get_index(void) {return;} +void smoke_step(void) {return;} From 668b92dfedca02959bbe3467a9f62ca597987544 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sat, 5 Sep 2009 02:14:45 +0000 Subject: [PATCH 445/577] * fix lib list creation. now blenderplayer links fine with both scons/mingw and scons/msvc --- SConstruct | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 12aa37772da..83ec6c1b718 100644 --- a/SConstruct +++ b/SConstruct @@ -404,7 +404,8 @@ if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']: env.BlenderProg(B.root_build_dir, "blender", dobj + mainlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender') if env['WITH_BF_PLAYER']: playerlist = B.create_blender_liblist(env, 'player') - #playerlist = playerlist[0:2] + [mainlist[0]] + mainlist[2:] + [playerlist[2]] + playerlist += B.create_blender_liblist(env, 'intern') + playerlist += B.create_blender_liblist(env, 'extern') env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer') ##### Now define some targets From 05c44056dc48bf718475a1e98c9abbd6cc00a535 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 5 Sep 2009 04:04:51 +0000 Subject: [PATCH 446/577] 2.5 - Demo of how to get node attributes animateable * Made sure that nodes have a working 'path' function (needed for any tools that will resolve paths needed for animating properties) * Replaced all the UI button controls for a single node (Vector Blur) with relevant RNA buttons which can be animated. There are probably some even nicer ways to do this (i.e. using layout engine for drawing all sets of buttons), though this is the easiest way forward in the immediate future. Anyways, if people are interested in getting this working, they will need to spend time to replace all the necessary button calls :) --- source/blender/editors/space_node/drawnode.c | 98 ++++--------------- source/blender/makesrna/intern/rna_nodetree.c | 10 ++ 2 files changed, 29 insertions(+), 79 deletions(-) diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 1fb8cb3452b..2f64108384e 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -1459,26 +1459,28 @@ static int node_composit_buts_lensdist(uiBlock *block, bNodeTree *ntree, bNode * static int node_composit_buts_vecblur(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *butr) { if(block) { - NodeBlurData *nbd= node->storage; + PointerRNA ptr; short dy= butr->ymin; short dx= (butr->xmax-butr->xmin); - uiBlockBeginAlign(block); - uiDefButS(block, NUM, B_NODE_EXEC, "Samples:", - butr->xmin, dy+76, dx, 19, - &nbd->samples, 1, 256, 0, 0, "Amount of samples"); - uiDefButS(block, NUM, B_NODE_EXEC, "MinSpeed:", - butr->xmin, dy+57, dx, 19, - &nbd->minspeed, 0, 1024, 0, 0, "Minimum speed for a pixel to be blurred, used to separate background from foreground"); - uiDefButS(block, NUM, B_NODE_EXEC, "MaxSpeed:", - butr->xmin, dy+38, dx, 19, - &nbd->maxspeed, 0, 1024, 0, 0, "If not zero, maximum speed in pixels"); - uiDefButF(block, NUM, B_NODE_EXEC, "Blur:", - butr->xmin, dy+19, dx, 19, - &nbd->fac, 0.0f, 2.0f, 10, 2, "Scaling factor for motion vectors, actually 'shutter speed' in frames"); - uiDefButS(block, TOG, B_NODE_EXEC, "Curved", - butr->xmin, dy, dx, 19, - &nbd->curved, 0.0f, 2.0f, 10, 2, "Interpolate between frames in a bezier curve, rather than linearly"); + RNA_pointer_create((ID *)ntree, &RNA_Node, node, &ptr); + + uiBlockBeginAlign(block); + uiDefButR(block, NUM, B_NODE_EXEC, NULL, + butr->xmin, dy+76, dx, 19, + &ptr, "samples", 0, 1, 256, 0, 0, NULL); + uiDefButR(block, NUM, B_NODE_EXEC, NULL, + butr->xmin, dy+57, dx, 19, + &ptr, "min_speed", 0, 0, 1024, 0, 0, NULL); + uiDefButR(block, NUM, B_NODE_EXEC, NULL, + butr->xmin, dy+38, dx, 19, + &ptr, "max_speed", 0, 0, 1024, 0, 0, NULL); + uiDefButR(block, NUM, B_NODE_EXEC, "Blur", + butr->xmin, dy+19, dx, 19, + &ptr, "factor", 0, 0, 2, 10, 2, NULL); + uiDefButR(block, TOG, B_NODE_EXEC, NULL, + butr->xmin, dy, dx, 19, + &ptr, "curved", 0, 0, 2, 10, 2, NULL); uiBlockEndAlign(block); } return 95; @@ -2625,66 +2627,4 @@ void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link) node_draw_link_bezier(v2d, snode, link, th_col1, th_col2, do_shaded); } -#if 0 -static void nodes_panel_gpencil(short cntrl) // NODES_HANDLER_GREASEPENCIL -{ - uiBlock *block; - SpaceNode *snode; - - snode= curarea->spacedata.first; - - block= uiNewBlock(&curarea->uiblocks, "nodes_panel_gpencil", UI_EMBOSS, UI_HELV, curarea->win); - uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); - uiSetPanelHandler(NODES_HANDLER_GREASEPENCIL); // for close and esc - if (uiNewPanel(curarea, block, "Grease Pencil", "SpaceNode", 100, 30, 318, 204)==0) return; - - /* we can only really draw stuff if there are nodes (otherwise no events are handled */ - if (snode->nodetree == NULL) - return; - - /* allocate memory for gpd if drawing enabled (this must be done first or else we crash) */ - if (snode->flag & SNODE_DISPGP) { - if (snode->gpd == NULL) - gpencil_data_setactive(curarea, gpencil_data_addnew()); - } - - if (snode->flag & SNODE_DISPGP) { - bGPdata *gpd= snode->gpd; - short newheight; - - /* this is a variable height panel, newpanel doesnt force new size on existing panels */ - /* so first we make it default height */ - uiNewPanelHeight(block, 204); - - /* draw button for showing gpencil settings and drawings */ - uiDefButBitS(block, TOG, SNODE_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &snode->flag, 0, 0, 0, 0, "Display freehand annotations overlay over this Node Editor (draw using Shift-LMB)"); - - /* extend the panel if the contents won't fit */ - newheight= draw_gpencil_panel(block, gpd, curarea); - uiNewPanelHeight(block, newheight); - } - else { - uiDefButBitS(block, TOG, SNODE_DISPGP, B_REDR, "Use Grease Pencil", 10, 225, 150, 20, &snode->flag, 0, 0, 0, 0, "Display freehand annotations overlay over this Node Editor"); - uiDefBut(block, LABEL, 1, " ", 160, 180, 150, 20, NULL, 0.0, 0.0, 0, 0, ""); - } -} - -static void nodes_blockhandlers(ScrArea *sa) -{ - SpaceNode *snode= sa->spacedata.first; - short a; - - for(a=0; ablockhandler[a]) { - case NODES_HANDLER_GREASEPENCIL: - nodes_panel_gpencil(snode->blockhandler[a+1]); - break; - } - - /* clear action value for event */ - snode->blockhandler[a+1]= 0; - } - uiDrawBlocksPanels(sa, 0); -} -#endif diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 23e79831292..9062cec3828 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -57,6 +57,15 @@ StructRNA *rna_Node_refine(struct PointerRNA *ptr) } } +static char *rna_Node_path(PointerRNA *ptr) +{ + bNodeTree *ntree= (bNodeTree*)ptr->id.data; + bNode *node= (bNode*)ptr->data; + int index = BLI_findindex(&ntree->nodes, node); + + return BLI_sprintfN("nodes[%d]", index); +} + #else #define MaxNodes 1000 @@ -1353,6 +1362,7 @@ static void rna_def_node(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Node", "Node in a node tree."); RNA_def_struct_sdna(srna, "bNode"); RNA_def_struct_refine_func(srna, "rna_Node_refine"); + RNA_def_struct_path_func(srna, "rna_Node_path"); prop = RNA_def_property(srna, "location", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "locx"); From 3b743ac5565663d2fd0be4bbbc92e404afafbce4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 5 Sep 2009 09:54:01 +0000 Subject: [PATCH 447/577] Option to correct for 3D curve twist error. example before and after. http://www.graphicall.org/ftp/ideasman42/curve_auto_twist.png Access next to the "3D" edit button. details... - open curves use the first points orientation and minimize twist for each new segment. - cyclic curves calculate the least twist in both directions and blend between them - AxisAngleToQuat replaced inline code. - Notice the model on the right now has more even corners. added Vec3ToTangent to arithb.c. --- source/blender/blenkernel/intern/curve.c | 176 +++++++++++++++++----- source/blender/blenlib/BLI_arithb.h | 1 + source/blender/blenlib/intern/arithb.c | 13 ++ source/blender/makesdna/DNA_curve_types.h | 2 + source/blender/src/buttons_editing.c | 3 +- 5 files changed, 158 insertions(+), 37 deletions(-) diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 0d6382a8d37..709507a9b26 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -1513,7 +1513,7 @@ void makeBevelList(Object *ob) BPoint *bp; BevList *bl, *blnew, *blnext; BevPoint *bevp, *bevp2, *bevp1 = NULL, *bevp0; - float min, inp, x1, x2, y1, y2, vec[3]; + float min, inp, x1, x2, y1, y2, vec[3], vec_prev[3], q[4], quat[4], quat_prev[4], cross[3]; float *coord_array, *tilt_array=NULL, *radius_array=NULL, *coord_fp, *tilt_fp=NULL, *radius_fp=NULL; float *v1, *v2; struct bevelsort *sortdata, *sd, *sd1; @@ -1872,7 +1872,10 @@ void makeBevelList(Object *ob) bl= cu->bev.first; while(bl) { - if(bl->nr==2) { /* 2 pnt, treat separate */ + if(bl->nr < 2) { + /* do nothing */ + } + else if(bl->nr==2) { /* 2 pnt, treat separate */ bevp2= (BevPoint *)(bl+1); bevp1= bevp2+1; @@ -1886,56 +1889,106 @@ void makeBevelList(Object *ob) if(cu->flag & CU_3D) { /* 3D */ float quat[4], q[4]; - vec[0]= bevp1->x - bevp2->x; - vec[1]= bevp1->y - bevp2->y; - vec[2]= bevp1->z - bevp2->z; + VecSubf(vec, &bevp1->x, &bevp2->x); vectoquat(vec, 5, 1, quat); - Normalize(vec); - q[0]= (float)cos(0.5*bevp1->alfa); - x1= (float)sin(0.5*bevp1->alfa); - q[1]= x1*vec[0]; - q[2]= x1*vec[1]; - q[3]= x1*vec[2]; + AxisAngleToQuat(q, vec, bevp1->alfa); QuatMul(quat, q, quat); QuatToMat3(quat, bevp1->mat); Mat3CpyMat3(bevp2->mat, bevp1->mat); } - } - else if(bl->nr>2) { + } /* this has to be >2 points */ + else if(cu->flag & CU_NO_TWIST && cu->flag & CU_3D && bl->poly != -1) { + + /* Special case, cyclic curve with no twisy. tricky... */ + + float quat[4], q[4], cross[3]; + + /* correcting a cyclic curve is more complicated, need to be corrected from both ends */ + float *quat_tmp1, *quat_tmp2; /* store a quat in the matrix temporarily */ + int iter_dir; + BevPoint *bevp_start= (BevPoint *)(bl+1); + + /* loop over the points twice, once up, once back, accumulate the quat rotations + * in both directions, then blend them in the 3rd loop and apply the tilt */ + for(iter_dir = 0; iter_dir < 2; iter_dir++) { + + bevp2= (BevPoint *)(bl+1); + bevp1= bevp2+(bl->nr-1); + bevp0= bevp1-1; + + nr= bl->nr; + while(nr--) { + + /* Normalizes */ + Vec3ToTangent(vec, &bevp0->x, &bevp1->x, &bevp2->x); + + if(bl->nr==nr+1) { /* first time */ + vectoquat(vec, 5, 1, quat); + } + else { + float angle = NormalizedVecAngle2(vec_prev, vec); + + if(angle > 0.0f) { /* otherwise we can keep as is */ + Crossf(cross, vec_prev, vec); + AxisAngleToQuat(q, cross, angle); + QuatMul(quat, q, quat_prev); + } + else { + QUATCOPY(quat, quat_prev); + } + } + QUATCOPY(quat_prev, quat); /* quat_prev can't have the tilt applied */ + VECCOPY(vec_prev, vec); + + if(iter_dir==0) { /* up, first time */ + quat_tmp1= (float *)bevp1->mat; + + bevp0= bevp1; + bevp1= bevp2; + bevp2++; + } + else { /* down second time */ + quat_tmp1= ((float *)bevp1->mat)+4; + + bevp2= bevp1; + bevp1= bevp0; + bevp0--; + + /* wrap around */ + if (bevp0 < bevp_start) + bevp0= bevp_start+(bl->nr-1); + } + + QUATCOPY(quat_tmp1, quat); + } + } + + /* Now interpolate the 2 quats and apply tilt */ + bevp2= (BevPoint *)(bl+1); bevp1= bevp2+(bl->nr-1); bevp0= bevp1-1; - nr= bl->nr; - while(nr--) { - - if(cu->flag & CU_3D) { /* 3D */ - float quat[4], q[4]; - - vec[0]= bevp2->x - bevp0->x; - vec[1]= bevp2->y - bevp0->y; - vec[2]= bevp2->z - bevp0->z; - - Normalize(vec); - vectoquat(vec, 5, 1, quat); - - q[0]= (float)cos(0.5*bevp1->alfa); - x1= (float)sin(0.5*bevp1->alfa); - q[1]= x1*vec[0]; - q[2]= x1*vec[1]; - q[3]= x1*vec[2]; - QuatMul(quat, q, quat); - - QuatToMat3(quat, bevp1->mat); - } + Vec3ToTangent(vec, &bevp0->x, &bevp1->x, &bevp2->x); + + quat_tmp1= (float *)bevp1->mat; + quat_tmp2= quat_tmp1+4; + + /* blend the 2 rotations gathered from both directions */ + QuatInterpol(quat, quat_tmp1, quat_tmp2, 1.0 - (((float)nr)/bl->nr)); + + AxisAngleToQuat(q, vec, bevp1->alfa); + QuatMul(quat, q, quat); + QuatToMat3(quat, bevp1->mat); + /* generic */ x1= bevp1->x- bevp0->x; x2= bevp1->x- bevp2->x; y1= bevp1->y- bevp0->y; @@ -1943,11 +1996,62 @@ void makeBevelList(Object *ob) calc_bevel_sin_cos(x1, y1, x2, y2, &(bevp1->sina), &(bevp1->cosa)); - bevp0= bevp1; bevp1= bevp2; bevp2++; } + } + else { + /* Any curve with 3 or more points */ + + bevp2= (BevPoint *)(bl+1); + bevp1= bevp2+(bl->nr-1); + bevp0= bevp1-1; + + nr= bl->nr; + while(nr--) { + + if(cu->flag & CU_3D) { /* 3D */ + + /* Normalizes */ + Vec3ToTangent(vec, &bevp0->x, &bevp1->x, &bevp2->x); + + if(bl->nr==nr+1 || !(cu->flag & CU_NO_TWIST)) { /* first time */ + vectoquat(vec, 5, 1, quat); + } + else { + float angle = NormalizedVecAngle2(vec_prev, vec); + + if(angle > 0.0f) { /* otherwise we can keep as is */ + Crossf(cross, vec_prev, vec); + AxisAngleToQuat(q, cross, angle); + QuatMul(quat, q, quat_prev); + } + else { + QUATCOPY(quat, quat_prev); + } + } + QUATCOPY(quat_prev, quat); /* quat_prev can't have the tilt applied */ + VECCOPY(vec_prev, vec); + + AxisAngleToQuat(q, vec, bevp1->alfa); + QuatMul(quat, q, quat); + QuatToMat3(quat, bevp1->mat); + } + + x1= bevp1->x- bevp0->x; + x2= bevp1->x- bevp2->x; + y1= bevp1->y- bevp0->y; + y2= bevp1->y- bevp2->y; + + calc_bevel_sin_cos(x1, y1, x2, y2, &(bevp1->sina), &(bevp1->cosa)); + + + bevp0= bevp1; + bevp1= bevp2; + bevp2++; + } + /* correct non-cyclic cases */ if(bl->poly== -1) { if(bl->nr>2) { diff --git a/source/blender/blenlib/BLI_arithb.h b/source/blender/blenlib/BLI_arithb.h index 092ed00fbe5..63b351016d4 100644 --- a/source/blender/blenlib/BLI_arithb.h +++ b/source/blender/blenlib/BLI_arithb.h @@ -270,6 +270,7 @@ void AxisAngleToQuat(float *q, float *axis, float angle); void RotationBetweenVectorsToQuat(float *q, float v1[3], float v2[3]); void vectoquat(float *vec, short axis, short upflag, float *q); +void Vec3ToTangent(float *v, float *v1, float *v2, float *v3); float VecAngle2(float *v1, float *v2); float VecAngle3(float *v1, float *v2, float *v3); float NormalizedVecAngle2(float *v1, float *v2); diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index ad1dc1ca12c..970d8f7d0de 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -2969,6 +2969,19 @@ void VecRotToQuat( float *vec, float phi, float *quat) } } +/* get a direction from 3 vectors that wont depend + * on the distance between the points */ +void Vec3ToTangent(float *v, float *v1, float *v2, float *v3) +{ + float d_12[3], d_23[3]; + VecSubf(d_12, v2, v1); + VecSubf(d_23, v3, v2); + Normalize(d_12); + Normalize(d_23); + VecAddf(v, d_12, d_23); + Normalize(v); +} + /* Return the angle in degrees between vecs 1-2 and 2-3 in degrees If v1 is a shoulder, v2 is the elbow and v3 is the hand, this would return the angle at the elbow */ diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index f809cac037d..88c03a41160 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -205,6 +205,8 @@ typedef struct Curve { #define CU_FAST 512 /* Font: no filling inside editmode */ #define CU_RETOPO 1024 +#define CU_NO_TWIST 4096 + /* spacemode */ #define CU_LEFT 0 #define CU_MIDDLE 1 diff --git a/source/blender/src/buttons_editing.c b/source/blender/src/buttons_editing.c index 2f9eac67d94..1e37fd0b9f8 100644 --- a/source/blender/src/buttons_editing.c +++ b/source/blender/src/buttons_editing.c @@ -3671,7 +3671,8 @@ static void editing_panel_curve_type(Object *ob, Curve *cu) uiBlockSetCol(block, TH_BUT_SETTING1); uiDefButBitS(block, TOG, CU_BACK, B_MAKEDISP, "Back", 760,115,50,19, &cu->flag, 0, 0, 0, 0, "Draw filled back for extruded/beveled curves"); uiDefButBitS(block, TOG, CU_FRONT, B_MAKEDISP, "Front",810,115,50,19, &cu->flag, 0, 0, 0, 0, "Draw filled front for extruded/beveled curves"); - uiDefButBitS(block, TOG, CU_3D, B_CU3D, "3D", 860,115,50,19, &cu->flag, 0, 0, 0, 0, "Allow Curve to be 3d, it doesn't fill then"); + uiDefButBitS(block, TOG, CU_3D, B_CU3D, "3D", 860,115,30,19, &cu->flag, 0, 0, 0, 0, "Allow Curve to be 3d, it doesn't fill then"); + uiDefIconButBitS(block, TOG, CU_NO_TWIST, B_MAKEDISP, ICON_AUTO, 890,115,20,19, &cu->flag, 0.0, 0.0, 0, 0, "Avoid twisting artifacts for 3D beveled/extruded curves"); } } From 08b8fc34cfc082d73e657d1c2941662c36bc3514 Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Sat, 5 Sep 2009 20:12:08 +0000 Subject: [PATCH 448/577] Disconnect/connect hair: - Moves hair from face-space to global space and back. - Allows for editing of emitter mesh after hair combing. - Disconnect hair before doing topology changing changes in mesh edit mode, connect after changes. - Notes: * The closest location on emitter surface to the hair root is used to connect the hair. * Emitter deflection, sticky roots and add brush don't apply for disconnect hair in particle mode. - Todo for future: * Copy disconnected hair from object to another (when 2.5 has proper copy operators again). * Possible automatic disconnect/connect with topology changing operations in mesh edit mode. Other changes/fixes: - Proper subtypes for some particle mode notifiers. - Particle mode selections didn't draw correctly because of using lighting for the paths. --- release/ui/buttons_particle.py | 5 + source/blender/blenkernel/BKE_pointcache.h | 1 + source/blender/blenkernel/intern/particle.c | 8 +- .../blenkernel/intern/particle_system.c | 2 +- source/blender/editors/physics/editparticle.c | 52 ++++- .../editors/space_buttons/buttons_intern.h | 2 + .../editors/space_buttons/buttons_ops.c | 218 ++++++++++++++++++ .../editors/space_buttons/space_buttons.c | 2 + .../blender/editors/space_view3d/drawobject.c | 18 +- .../editors/space_view3d/view3d_header.c | 6 +- .../editors/transform/transform_conversions.c | 8 +- source/blender/makesrna/intern/rna_particle.c | 5 + .../makesrna/intern/rna_sculpt_paint.c | 10 +- 13 files changed, 294 insertions(+), 43 deletions(-) diff --git a/release/ui/buttons_particle.py b/release/ui/buttons_particle.py index f3339049962..b0051453b29 100644 --- a/release/ui/buttons_particle.py +++ b/release/ui/buttons_particle.py @@ -151,6 +151,11 @@ class PARTICLE_PT_particles(ParticleButtonsPanel): row = split.row() row.enabled = particle_panel_enabled(psys) row.itemR(part, "hair_step") + if psys.edited==True: + if psys.global_hair: + layout.itemO("particle.connect_hair") + else: + layout.itemO("particle.disconnect_hair") elif part.type=='REACTOR': split.enabled = particle_panel_enabled(psys) split.itemR(psys, "reactor_target_object") diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h index 9ba34091064..b7ab07b0f91 100644 --- a/source/blender/blenkernel/BKE_pointcache.h +++ b/source/blender/blenkernel/BKE_pointcache.h @@ -192,6 +192,7 @@ typedef struct PTCacheUndo { struct ParticleData *particles; struct KDTree *emitter_field; float *emitter_cosnos; + int psys_flag; /* cache stuff */ struct ListBase mem_cache; diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 81eb0b79c40..0ba2f357a1f 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -418,7 +418,7 @@ void psys_free_path_cache(ParticleSystem *psys, PTCacheEdit *edit) edit->pathcache= NULL; edit->totcached= 0; } - else { + if(psys) { psys_free_path_cache_buffers(psys->pathcache, &psys->pathcachebufs); psys->pathcache= NULL; psys->totcached= 0; @@ -2676,7 +2676,7 @@ void psys_cache_paths(Scene *scene, Object *ob, ParticleSystem *psys, float cfra baked = psys->pointcache->flag & PTCACHE_BAKED; /* clear out old and create new empty path cache */ - psys_free_path_cache(psys, NULL); + psys_free_path_cache(psys, psys->edit); cache= psys->pathcache= psys_alloc_path_cache_buffers(&psys->pathcachebufs, totpart, steps+1); if(psys->soft && psys->softflag & OB_SB_ENABLE) { @@ -2891,7 +2891,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf if(!cache || edit->totpoint != edit->totcached) { /* clear out old and create new empty path cache */ - psys_free_path_cache(NULL, edit); + psys_free_path_cache(edit->psys, edit); cache= edit->pathcache= psys_alloc_path_cache_buffers(&edit->pathcachebufs, totpart, steps+1); } @@ -2946,7 +2946,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf do_particle_interpolation(psys, i, pa, t, frs_sec, &pind, &result); /* non-hair points are allready in global space */ - if(psys) + if(psys && !(psys->flag & PSYS_GLOBAL_HAIR)) Mat4MulVecfl(hairmat, result.co); VECCOPY(ca->co, result.co); diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index eb570ba287c..1931b89af38 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -158,7 +158,7 @@ void psys_reset(ParticleSystem *psys, int mode) psys->totchild= 0; /* reset path cache */ - psys_free_path_cache(psys, NULL); + psys_free_path_cache(psys, psys->edit); /* reset point cache */ psys->pointcache->flag &= ~PTCACHE_SIMULATION_VALID; diff --git a/source/blender/editors/physics/editparticle.c b/source/blender/editors/physics/editparticle.c index bc48d8f4f55..0f5e677b912 100644 --- a/source/blender/editors/physics/editparticle.c +++ b/source/blender/editors/physics/editparticle.c @@ -555,7 +555,7 @@ static void foreach_mouse_hit_key(PEData *data, ForKeyMatFunc func, int selected Mat4One(mat); LOOP_VISIBLE_POINTS { - if(edit->psys) { + if(edit->psys && !(edit->psys->flag & PSYS_GLOBAL_HAIR)) { psys_mat_hair_to_global(data->ob, psmd->dm, psys->part->from, psys->particles + p, mat); Mat4Invert(imat,mat); } @@ -812,7 +812,7 @@ static void pe_deflect_emitter(Scene *scene, Object *ob, PTCacheEdit *edit) float *vec, *nor, dvec[3], dot, dist_1st; float hairimat[4][4], hairmat[4][4]; - if(edit==NULL || edit->psys==NULL || (pset->flag & PE_DEFLECT_EMITTER)==0) + if(edit==NULL || edit->psys==NULL || (pset->flag & PE_DEFLECT_EMITTER)==0 || (edit->psys->flag & PSYS_GLOBAL_HAIR)) return; psys = edit->psys; @@ -876,6 +876,9 @@ void PE_apply_lengths(Scene *scene, PTCacheEdit *edit) if(edit==0 || (pset->flag & PE_KEEP_LENGTHS)==0) return; + if(edit->psys && edit->psys->flag & PSYS_GLOBAL_HAIR) + return; + LOOP_EDITED_POINTS { LOOP_KEYS { if(k) { @@ -899,10 +902,10 @@ static void pe_iterate_lengths(Scene *scene, PTCacheEdit *edit) float dv1[3]= {0.0f, 0.0f, 0.0f}; float dv2[3]= {0.0f, 0.0f, 0.0f}; - if(edit==0) + if(edit==0 || (pset->flag & PE_KEEP_LENGTHS)==0) return; - if((pset->flag & PE_KEEP_LENGTHS)==0) + if(edit->psys && edit->psys->flag & PSYS_GLOBAL_HAIR) return; LOOP_EDITED_POINTS { @@ -1057,11 +1060,13 @@ static void update_world_cos(Object *ob, PTCacheEdit *edit) return; LOOP_POINTS { - psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles+p, hairmat); + if(!(psys->flag & PSYS_GLOBAL_HAIR)) + psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles+p, hairmat); LOOP_KEYS { VECCOPY(key->world_co,key->co); - Mat4MulVecfl(hairmat, key->world_co); + if(!(psys->flag & PSYS_GLOBAL_HAIR)) + Mat4MulVecfl(hairmat, key->world_co); } } } @@ -1480,7 +1485,7 @@ int PE_lasso_select(bContext *C, short mcords[][2], short moves, short select) Mat4One(mat); LOOP_VISIBLE_POINTS { - if(edit->psys) + if(edit->psys && !(psys->flag & PSYS_GLOBAL_HAIR)) psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles + p, mat); if(pset->selectmode==SCE_SELECT_POINT) { @@ -1777,7 +1782,8 @@ static void rekey_particle(PEData *data, int pa_index) for(k=0, key=pa->hair; ktotkey; k++, key++, ekey++) { ekey->co= key->co; ekey->time= &key->time; - ekey->flag |= PEK_USE_WCO; + if(!(psys->flag & PSYS_GLOBAL_HAIR)) + ekey->flag |= PEK_USE_WCO; } pa->flag &= ~PARS_REKEY; @@ -2059,7 +2065,9 @@ static void subdivide_particle(PEData *data, int pa_index) nekey->co= nkey->co; nekey->time= &nkey->time; - nekey->flag |= (PEK_SELECT|PEK_USE_WCO); + nekey->flag |= PEK_SELECT; + if(!(psys->flag & PSYS_GLOBAL_HAIR)) + nekey->flag |= PEK_USE_WCO; nekey++; nkey++; @@ -2129,6 +2137,9 @@ static int remove_doubles_exec(bContext *C, wmOperator *op) float mat[4][4], co[3], threshold= RNA_float_get(op->ptr, "threshold"); int n, totn, removed, flag, totremoved; + if(psys->flag & PSYS_GLOBAL_HAIR) + return OPERATOR_CANCELLED; + edit= psys->edit; psmd= psys_get_modifier(ob, psys); totremoved= 0; @@ -2400,6 +2411,9 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged) int *mirrorfaces; int rotation, totpart, newtotpart; + if(psys->flag & PSYS_GLOBAL_HAIR) + return; + psmd= psys_get_modifier(ob, psys); mirrorfaces= mesh_get_x_mirror_faces(ob, NULL); @@ -2750,7 +2764,7 @@ static void brush_puff(PEData *data, int point_index) float mat[4][4], imat[4][4]; float lastco[3], rootco[3], co[3], nor[3], kco[3], dco[3], fac, length; - if(psys) { + if(psys && !(psys->flag & PSYS_GLOBAL_HAIR)) { psys_mat_hair_to_global(data->ob, data->dm, psys->part->from, psys->particles + point_index, mat); Mat4Invert(imat,mat); } @@ -2849,6 +2863,9 @@ static void brush_add(PEData *data, short number) DerivedMesh *dm=0; Mat4Invert(imat,ob->obmat); + if(psys->flag & PSYS_GLOBAL_HAIR) + return; + BLI_srandom(psys->seed+data->mval[0]+data->mval[1]); /* painting onto the deformed mesh, could be an option? */ @@ -3070,6 +3087,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) float vec[3], mousef[2]; short mval[2], mvalo[2]; int flip, mouse[2], dx, dy, removed= 0, selected= 0; + int lock_root = pset->flag & PE_LOCK_FIRST; if(!PE_start_edit(edit)) return; @@ -3093,6 +3111,10 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) mvalo[0]= bedit->lastmouse[0]; mvalo[1]= bedit->lastmouse[1]; + /* disable locking temporatily for disconnected hair */ + if(edit->psys && edit->psys->flag & PSYS_GLOBAL_HAIR) + pset->flag &= ~PE_LOCK_FIRST; + if(((pset->brushtype == PE_BRUSH_ADD) ? (sqrt(dx * dx + dy * dy) > pset->brush[PE_BRUSH_ADD].step) : (dx != 0 || dy != 0)) || bedit->first) { @@ -3248,6 +3270,8 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) bedit->lastmouse[1]= mouse[1]; bedit->first= 0; } + + pset->flag |= lock_root; } static void brush_edit_exit(bContext *C, wmOperator *op) @@ -3382,6 +3406,8 @@ static void make_PTCacheUndo(PTCacheEdit *edit, PTCacheUndo *undo) for(i=0; itotpoint; i++, pa++) pa->hair= MEM_dupallocN(pa->hair); + + undo->psys_flag = edit->psys->flag; } else { PTCacheMem *pm; @@ -3449,6 +3475,8 @@ static void get_PTCacheUndo(PTCacheEdit *edit, PTCacheUndo *undo) hkey++; } } + + psys->flag = undo->psys_flag; } else { PTCacheMem *pm; @@ -3704,7 +3732,8 @@ static void PE_create_particle_edit(Scene *scene, Object *ob, PointCache *cache, key->co= hkey->co; key->time= &hkey->time; key->flag= hkey->editflag; - key->flag |= PEK_USE_WCO; + if(!(psys->flag & PSYS_GLOBAL_HAIR)) + key->flag |= PEK_USE_WCO; hkey++; } pa++; @@ -3828,6 +3857,7 @@ static int clear_edited_exec(bContext *C, wmOperator *op) psys->free_edit = NULL; psys->recalc |= PSYS_RECALC_RESET; + psys->flag &= ~PSYS_GLOBAL_HAIR; psys_reset(psys, PSYS_RESET_DEPSGRAPH); DAG_id_flush_update(&ob->id, OB_RECALC_DATA); diff --git a/source/blender/editors/space_buttons/buttons_intern.h b/source/blender/editors/space_buttons/buttons_intern.h index 8ed17ab1fa8..0a5a5714a06 100644 --- a/source/blender/editors/space_buttons/buttons_intern.h +++ b/source/blender/editors/space_buttons/buttons_intern.h @@ -85,6 +85,8 @@ void PARTICLE_OT_new_target(struct wmOperatorType *ot); void PARTICLE_OT_remove_target(struct wmOperatorType *ot); void PARTICLE_OT_target_move_up(struct wmOperatorType *ot); void PARTICLE_OT_target_move_down(struct wmOperatorType *ot); +void PARTICLE_OT_connect_hair(struct wmOperatorType *ot); +void PARTICLE_OT_disconnect_hair(struct wmOperatorType *ot); void SCENE_OT_render_layer_add(struct wmOperatorType *ot); void SCENE_OT_render_layer_remove(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index 8cdc6b0cd2b..60480a9f165 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -35,6 +35,8 @@ #include "DNA_group_types.h" #include "DNA_object_types.h" #include "DNA_material_types.h" +#include "DNA_meshdata_types.h" +#include "DNA_modifier_types.h" #include "DNA_node_types.h" #include "DNA_texture_types.h" #include "DNA_scene_types.h" @@ -42,8 +44,11 @@ #include "DNA_space_types.h" #include "DNA_world_types.h" +#include "BKE_bvhutils.h" +#include "BKE_cdderivedmesh.h" #include "BKE_context.h" #include "BKE_depsgraph.h" +#include "BKE_DerivedMesh.h" #include "BKE_group.h" #include "BKE_font.h" #include "BKE_library.h" @@ -51,11 +56,13 @@ #include "BKE_material.h" #include "BKE_node.h" #include "BKE_particle.h" +#include "BKE_pointcache.h" #include "BKE_scene.h" #include "BKE_texture.h" #include "BKE_utildefines.h" #include "BKE_world.h" +#include "BLI_arithb.h" #include "BLI_editVert.h" #include "BLI_listbase.h" @@ -838,6 +845,217 @@ void PARTICLE_OT_target_move_down(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } +/************************ connect/disconnect hair operators *********************/ + +static void disconnect_hair(Scene *scene, Object *ob, ParticleSystem *psys) +{ + ParticleSystemModifierData *psmd = psys_get_modifier(ob,psys); + ParticleData *pa = psys->particles; + PTCacheEdit *edit = psys->edit; + PTCacheEditPoint *point = edit ? edit->points : NULL; + PTCacheEditKey *ekey = NULL; + HairKey *key; + int i, k; + float hairmat[4][4]; + + if(!ob || !psys || psys->flag & PSYS_GLOBAL_HAIR) + return; + + if(!psys->part || psys->part->type != PART_HAIR) + return; + + for(i=0; itotpart; i++,pa++) { + if(point) { + ekey = point->keys; + point++; + } + + psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat); + + for(k=0,key=pa->hair; ktotkey; k++,key++) { + Mat4MulVecfl(hairmat,key->co); + + if(ekey) { + ekey->flag &= ~PEK_USE_WCO; + ekey++; + } + } + } + + psys_free_path_cache(psys, psys->edit); + + psys->flag |= PSYS_GLOBAL_HAIR; + + PE_update_object(scene, ob, 0); +} + +static int disconnect_hair_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); + ParticleSystem *psys= NULL; + int all = RNA_boolean_get(op->ptr, "all"); + + if(!ob) + return OPERATOR_CANCELLED; + + if(all) { + for(psys=ob->particlesystem.first; psys; psys=psys->next) { + disconnect_hair(scene, ob, psys); + } + } + else { + psys = ptr.data; + disconnect_hair(scene, ob, psys); + } + + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); + + return OPERATOR_FINISHED; +} + +void PARTICLE_OT_disconnect_hair(wmOperatorType *ot) +{ + ot->name= "Disconnect Hair"; + ot->description= "Disconnect hair from the emitter mesh."; + ot->idname= "PARTICLE_OT_disconnect_hair"; + + ot->exec= disconnect_hair_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + RNA_def_boolean(ot->srna, "all", 0, "All hair", "Disconnect all hair systems from the emitter mesh"); +} + +static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys) +{ + ParticleSystemModifierData *psmd = psys_get_modifier(ob,psys); + ParticleData *pa = psys->particles; + PTCacheEdit *edit = psys->edit; + PTCacheEditPoint *point = edit ? edit->points : NULL; + PTCacheEditKey *ekey; + HairKey *key; + BVHTreeFromMesh bvhtree; + BVHTreeNearest nearest; + MFace *mface; + DerivedMesh *dm = CDDM_copy(psmd->dm); + int numverts = dm->getNumVerts (dm); + int i, k; + float hairmat[4][4], imat[4][4]; + float v[4][3], vec[3]; + + if(!psys || !psys->part || psys->part->type != PART_HAIR) + return; + + memset( &bvhtree, 0, sizeof(bvhtree) ); + + /* convert to global coordinates */ + for (i=0; iobmat, CDDM_get_vert(dm, i)->co); + + bvhtree_from_mesh_faces(&bvhtree, dm, 0.0, 2, 6); + + for(i=0; itotpart; i++,pa++) { + key = pa->hair; + + nearest.index = -1; + nearest.dist = FLT_MAX; + + BLI_bvhtree_find_nearest(bvhtree.tree, key->co, &nearest, bvhtree.nearest_callback, &bvhtree); + + if(nearest.index == -1) { + printf("No nearest point found for hair root!"); + continue; + } + + mface = CDDM_get_face(dm,nearest.index); + + VecCopyf(v[0], CDDM_get_vert(dm,mface->v1)->co); + VecCopyf(v[1], CDDM_get_vert(dm,mface->v2)->co); + VecCopyf(v[2], CDDM_get_vert(dm,mface->v3)->co); + if(mface->v4) { + VecCopyf(v[3], CDDM_get_vert(dm,mface->v4)->co); + MeanValueWeights(v, 4, nearest.co, pa->fuv); + } + else + MeanValueWeights(v, 3, nearest.co, pa->fuv); + + pa->num = nearest.index; + pa->num_dmcache = psys_particle_dm_face_lookup(ob,psmd->dm,pa->num,pa->fuv,NULL); + + psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat); + Mat4Invert(imat,hairmat); + + VECSUB(vec, nearest.co, key->co); + + if(point) { + ekey = point->keys; + point++; + } + + for(k=0,key=pa->hair; ktotkey; k++,key++) { + VECADD(key->co, key->co, vec); + Mat4MulVecfl(imat,key->co); + + if(ekey) { + ekey->flag |= PEK_USE_WCO; + ekey++; + } + } + } + + free_bvhtree_from_mesh(&bvhtree); + dm->release(dm); + + psys_free_path_cache(psys, psys->edit); + + psys->flag &= ~PSYS_GLOBAL_HAIR; + + PE_update_object(scene, ob, 0); +} + +static int connect_hair_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + Object *ob= CTX_data_pointer_get_type(C, "object", &RNA_Object).data; + PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); + ParticleSystem *psys= NULL; + int all = RNA_boolean_get(op->ptr, "all"); + + if(!ob) + return OPERATOR_CANCELLED; + + if(all) { + for(psys=ob->particlesystem.first; psys; psys=psys->next) { + connect_hair(scene, ob, psys); + } + } + else { + psys = ptr.data; + connect_hair(scene, ob, psys); + } + + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); + + return OPERATOR_FINISHED; +} + +void PARTICLE_OT_connect_hair(wmOperatorType *ot) +{ + ot->name= "Connect Hair"; + ot->description= "Connect hair to the emitter mesh."; + ot->idname= "PARTICLE_OT_connect_hair"; + + ot->exec= connect_hair_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + RNA_def_boolean(ot->srna, "all", 0, "All hair", "Connect all hair systems to the emitter mesh"); +} + /********************** render layer operators *********************/ static int render_layer_add_exec(bContext *C, wmOperator *op) diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 5d1dbe47345..385f55b71c1 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -204,6 +204,8 @@ void buttons_operatortypes(void) WM_operatortype_append(PARTICLE_OT_remove_target); WM_operatortype_append(PARTICLE_OT_target_move_up); WM_operatortype_append(PARTICLE_OT_target_move_down); + WM_operatortype_append(PARTICLE_OT_connect_hair); + WM_operatortype_append(PARTICLE_OT_disconnect_hair); WM_operatortype_append(SCENE_OT_render_layer_add); WM_operatortype_append(SCENE_OT_render_layer_remove); diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 25ff1244254..57e7d897e24 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -3749,7 +3749,6 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Obj nosel_col[1]=(float)nosel[1]/255.0f; nosel_col[2]=(float)nosel[2]/255.0f; - /* draw paths */ if(timed) { glEnable(GL_BLEND); @@ -3758,24 +3757,16 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Obj } glEnableClientState(GL_VERTEX_ARRAY); - - /* solid shaded with lighting */ - glEnableClientState(GL_NORMAL_ARRAY); + glDisableClientState(GL_NORMAL_ARRAY); glEnableClientState(GL_COLOR_ARRAY); glEnable(GL_COLOR_MATERIAL); glColorMaterial(GL_FRONT_AND_BACK, GL_DIFFUSE); - /* only draw child paths with lighting */ - if(dt > OB_WIRE) - glEnable(GL_LIGHTING); - - /* draw paths without lighting */ cache=edit->pathcache; for(i=0; ico); - glNormalPointer(GL_FLOAT, sizeof(ParticleCacheKey), path->vel); if(timed) { for(k=0, pcol=pathcol, pkey=path; kselectmode!=SCE_SELECT_PATH){ - glDisableClientState(GL_NORMAL_ARRAY); - glEnableClientState(GL_COLOR_ARRAY); - glDisable(GL_LIGHTING); glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE)); if(pset->selectmode==SCE_SELECT_POINT){ @@ -3810,7 +3798,7 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Obj if(!(point->flag & PEP_HIDE)) totkeys += point->totkey; - if(!edit->psys) + if(!(edit->points->keys->flag & PEK_USE_WCO)) pd=pdata=MEM_callocN(totkeys*3*sizeof(float), "particle edit point data"); cd=cdata=MEM_callocN(totkeys*(timed?4:3)*sizeof(float), "particle edit color data"); @@ -3843,7 +3831,7 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Obj if(point->flag & PEP_HIDE) continue; - if(edit->psys) + if(point->keys->flag & PEK_USE_WCO) glVertexPointer(3, GL_FLOAT, sizeof(PTCacheEditKey), point->keys->world_co); else glVertexPointer(3, GL_FLOAT, 3*sizeof(float), pd); diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 2283d36e018..b6159cf4314 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -1760,17 +1760,17 @@ static void do_view3d_header_buttons(bContext *C, void *arg, int event) case B_SEL_PATH: ts->particle.selectmode= SCE_SELECT_PATH; - WM_event_add_notifier(C, NC_OBJECT, ob); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); ED_undo_push(C, "Selectmode Set: Path"); break; case B_SEL_POINT: ts->particle.selectmode = SCE_SELECT_POINT; - WM_event_add_notifier(C, NC_OBJECT, ob); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); ED_undo_push(C, "Selectmode Set: Point"); break; case B_SEL_END: ts->particle.selectmode = SCE_SELECT_END; - WM_event_add_notifier(C, NC_OBJECT, ob); + WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); ED_undo_push(C, "Selectmode Set: End point"); break; diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 0fce9592d1d..3f32b707043 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -1690,11 +1690,11 @@ static void createTransParticleVerts(bContext *C, TransInfo *t) if(!(point->flag & PEP_TRANSFORM)) continue; - if(psys) + if(psys && !(psys->flag & PSYS_GLOBAL_HAIR)) psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles + i, mat); for(k=0, key=point->keys; ktotkey; k++, key++) { - if(psys) { + if(key->flag & PEK_USE_WCO) { VECCOPY(key->world_co, key->co); Mat4MulVecfl(mat, key->world_co); td->loc = key->world_co; @@ -1714,7 +1714,7 @@ static void createTransParticleVerts(bContext *C, TransInfo *t) Mat3One(td->smtx); /* don't allow moving roots */ - if(k==0 && pset->flag & PE_LOCK_FIRST) + if(k==0 && pset->flag & PE_LOCK_FIRST && (!psys || !(psys->flag & PSYS_GLOBAL_HAIR))) td->protectflag |= OB_LOCK_LOC; td->ob = ob; @@ -1764,7 +1764,7 @@ void flushTransParticles(TransInfo *t) for(i=0, point=edit->points; itotpoint; i++, point++, td++) { if(!(point->flag & PEP_TRANSFORM)) continue; - if(psys) { + if(psys && !(psys->flag & PSYS_GLOBAL_HAIR)) { psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles + i, mat); Mat4Invert(imat,mat); diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 4a23605c717..71b953effdf 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -1884,6 +1884,11 @@ static void rna_def_particle_system(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "softflag", OB_SB_ENABLE); RNA_def_property_ui_text(prop, "Use Soft Body", "Enable use of soft body for hair physics simulation."); + prop= RNA_def_property(srna, "global_hair", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", PSYS_GLOBAL_HAIR); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Global Hair", "Hair keys are in global coordinate space"); + /* reactor */ prop= RNA_def_property(srna, "reactor_target_object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "target_ob"); diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index 5575b170398..ab4b27cea7b 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -107,7 +107,7 @@ static void rna_ParticleEdit_redo(bContext *C, PointerRNA *ptr) if(!edit) return; - psys_free_path_cache(NULL, edit); + psys_free_path_cache(edit->psys, edit); } static void rna_ParticleEdit_update(bContext *C, PointerRNA *ptr) @@ -410,7 +410,7 @@ static void rna_def_particle_edit(BlenderRNA *brna) prop= RNA_def_property(srna, "fade_time", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_FADE_TIME); RNA_def_property_ui_text(prop, "Fade Time", "Fade paths and keys further away from current frame."); - RNA_def_property_update(prop, NC_OBJECT, "rna_ParticleEdit_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_update"); prop= RNA_def_property(srna, "auto_velocity", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_AUTO_VELOCITY); @@ -443,18 +443,18 @@ static void rna_def_particle_edit(BlenderRNA *brna) prop= RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 2, 10); RNA_def_property_ui_text(prop, "Steps", "How many steps to draw the path with."); - RNA_def_property_update(prop, NC_OBJECT, "rna_ParticleEdit_redo"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_redo"); prop= RNA_def_property(srna, "fade_frames", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 2, 100); RNA_def_property_ui_text(prop, "Frames", "How many frames to fade."); - RNA_def_property_update(prop, NC_OBJECT, "rna_ParticleEdit_update"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_update"); prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "edittype"); RNA_def_property_enum_items(prop, edit_type_items); RNA_def_property_ui_text(prop, "Type", ""); - RNA_def_property_update(prop, NC_OBJECT, "rna_ParticleEdit_redo"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_ParticleEdit_redo"); prop= RNA_def_property(srna, "editable", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_editable_get", NULL); From 75407a4ecceb701c9cc760768f5b58f2d099727b Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sat, 5 Sep 2009 22:39:42 +0000 Subject: [PATCH 449/577] == SCons == * makesrna and makesdna now use CFLAGS, CCFLAGS and Linking flags as specified in config. This might help with cross-compile on OSX 10.6 (32bit on 64bit). devroo & jensverwiebe, please test and report. --- source/blender/makesdna/intern/SConscript | 3 +++ source/blender/makesrna/intern/SConscript | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/source/blender/makesdna/intern/SConscript b/source/blender/makesdna/intern/SConscript index 1c716019e80..120398791a8 100644 --- a/source/blender/makesdna/intern/SConscript +++ b/source/blender/makesdna/intern/SConscript @@ -34,6 +34,9 @@ if not USE_WINE: if sys.platform != 'cygwin': makesdna_tool.Append (CCFLAGS = cflags) makesdna_tool.Append (CPPDEFINES = defines) +makesdna_tool.Append( CFLAGS = env['CFLAGS']) +makesdna_tool.Append( CCFLAGS = env['CCFLAGS']) +makesdna_tool.Append( LINKFLAGS = env['PLATFORM_LINKFLAGS']) targetdir = normpath(root_build_dir+'/lib') if not (root_build_dir[0]==os.sep or root_build_dir[1]==':'): diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript index a24c25b8b95..9234efa2a5d 100644 --- a/source/blender/makesrna/intern/SConscript +++ b/source/blender/makesrna/intern/SConscript @@ -6,7 +6,7 @@ def normpath(path): return os.path.abspath(os.path.normpath(path)) Import ('env') -cflags = '-Wall' +cflags = ['-Wall'] defines = [] root_build_dir=normpath(env['BF_BUILDDIR']) @@ -96,6 +96,10 @@ if not (root_build_dir[0]==os.sep or root_build_dir[1]==':'): makesrna_tool.Append (LIBPATH = libdir) +makesrna_tool.Append( CFLAGS = env['CFLAGS']) +makesrna_tool.Append( CCFLAGS = env['CCFLAGS']) +makesrna_tool.Append( LINKFLAGS = env['PLATFORM_LINKFLAGS']) + if env['BF_PROFILE']: makesrna_tool.Append (LINKFLAGS = env['BF_PROFILE_FLAGS']) From c9dd69c11a639aece463dac9018e88dede4b9515 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 6 Sep 2009 00:19:15 +0000 Subject: [PATCH 450/577] remove MTC_ functions, (don't merge) replacements... MTC_cross3Float -> Crossf MTC_diff3Float -> VecSubf MTC_dot3Float -> Inpf MTC_Mat3CpyMat4 -> Mat3CpyMat4 MTC_Mat3MulVecd -> Mat3MulVecd MTC_Mat3MulVecfl -> Mat3MulVecfl MTC_Mat4CpyMat4 -> Mat4CpyMat4 MTC_Mat4Invert -> Mat4Invert MTC_Mat4Mul3Vecfl -> Mat4Mul3Vecfl MTC_Mat4MulMat4 -> Mat4MulMat4 MTC_Mat4MulSerie -> Mat4MulSerie MTC_Mat4MulVec4fl -> Mat4MulVec4fl MTC_Mat4MulVecfl -> Mat4MulVecfl MTC_Mat4One -> Mat4One MTC_Mat4Ortho -> Mat4Ortho MTC_Mat4SwapMat4 -> Mat4SwapMat4 --- source/blender/blenkernel/intern/modifier.c | 34 +- source/blender/blenkernel/intern/texture.c | 2 +- source/blender/blenlib/MTC_matrixops.h | 162 ------- source/blender/blenlib/MTC_vectorops.h | 58 --- source/blender/blenlib/intern/matrixops.c | 438 ------------------ source/blender/blenlib/intern/vectorops.c | 166 ------- .../nodes/intern/TEX_nodes/TEX_rotate.c | 8 +- source/blender/python/api2_2x/Effect.c | 2 +- .../render/intern/source/convertblender.c | 102 ++-- source/blender/render/intern/source/envmap.c | 80 ++-- .../blender/render/intern/source/initrender.c | 2 +- .../render/intern/source/pixelshading.c | 12 +- source/blender/render/intern/source/shadbuf.c | 16 +- .../blender/render/intern/source/shadeinput.c | 14 +- .../render/intern/source/shadeoutput.c | 8 +- source/blender/render/intern/source/texture.c | 36 +- source/blender/render/intern/source/zbuf.c | 4 +- source/blender/src/drawobject.c | 6 +- source/blender/src/editface.c | 2 +- source/blender/src/editfont.c | 2 +- source/blender/src/editmesh_mods.c | 2 +- source/blender/src/editmesh_tools.c | 2 +- source/blender/src/fluidsim.c | 4 +- source/blender/src/previewrender.c | 2 +- source/blender/src/vpaint.c | 10 +- source/blender/yafray/intern/export_File.cpp | 39 +- .../blender/yafray/intern/export_Plugin.cpp | 38 +- .../blender/yafray/intern/yafray_Render.cpp | 2 +- source/blender/yafray/intern/yafray_Render.h | 3 +- 29 files changed, 216 insertions(+), 1040 deletions(-) delete mode 100644 source/blender/blenlib/MTC_matrixops.h delete mode 100644 source/blender/blenlib/MTC_vectorops.h delete mode 100644 source/blender/blenlib/intern/matrixops.c delete mode 100644 source/blender/blenlib/intern/vectorops.c diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index fa2f857cc8b..77d54125564 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -72,8 +72,8 @@ #include "BLI_editVert.h" -#include "MTC_matrixops.h" -#include "MTC_vectorops.h" + + #include "BKE_main.h" #include "BKE_anim.h" @@ -1182,7 +1182,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, if(amd->end_cap && amd->end_cap != ob) end_cap = mesh_get_derived_final(amd->end_cap, CD_MASK_MESH); - MTC_Mat4One(offset); + Mat4One(offset); indexMap = MEM_callocN(sizeof(*indexMap) * dm->getNumVerts(dm), "indexmap"); @@ -1204,14 +1204,14 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, float result_mat[4][4]; if(ob) - MTC_Mat4Invert(obinv, ob->obmat); + Mat4Invert(obinv, ob->obmat); else - MTC_Mat4One(obinv); + Mat4One(obinv); - MTC_Mat4MulSerie(result_mat, offset, + Mat4MulSerie(result_mat, offset, obinv, amd->offset_ob->obmat, NULL, NULL, NULL, NULL, NULL); - MTC_Mat4CpyMat4(offset, result_mat); + Mat4CpyMat4(offset, result_mat); } if(amd->fit_type == MOD_ARR_FITCURVE && amd->curve_ob) { @@ -1236,7 +1236,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, prescribed length */ if(amd->fit_type == MOD_ARR_FITLENGTH || amd->fit_type == MOD_ARR_FITCURVE) { - float dist = sqrt(MTC_dot3Float(offset[3], offset[3])); + float dist = sqrt(Inpf(offset[3], offset[3])); if(dist > 1e-6f) /* this gives length = first copy start to last copy end @@ -1269,11 +1269,11 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, result = CDDM_from_template(dm, finalVerts, finalEdges, finalFaces); /* calculate the offset matrix of the final copy (for merging) */ - MTC_Mat4One(final_offset); + Mat4One(final_offset); for(j=0; j < count - 1; j++) { - MTC_Mat4MulMat4(tmp_mat, final_offset, offset); - MTC_Mat4CpyMat4(final_offset, tmp_mat); + Mat4MulMat4(tmp_mat, final_offset, offset); + Mat4CpyMat4(final_offset, tmp_mat); } numVerts = numEdges = numFaces = 0; @@ -1309,7 +1309,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, if((count > 1) && (amd->flags & MOD_ARR_MERGE)) { float tmp_co[3]; VECCOPY(tmp_co, mv->co); - MTC_Mat4MulVecfl(offset, tmp_co); + Mat4MulVecfl(offset, tmp_co); for(j = 0; j < maxVerts; j++) { /* if vertex already merged, don't use it */ @@ -1324,7 +1324,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, if(amd->flags & MOD_ARR_MERGEFINAL) { VECCOPY(tmp_co, inMV->co); inMV = &src_mvert[i]; - MTC_Mat4MulVecfl(final_offset, tmp_co); + Mat4MulVecfl(final_offset, tmp_co); if(VecLenCompare(tmp_co, inMV->co, amd->merge_dist)) indexMap[i].merge_final = 1; } @@ -1342,7 +1342,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, *mv2 = *mv; numVerts++; - MTC_Mat4MulVecfl(offset, co); + Mat4MulVecfl(offset, co); VECCOPY(mv2->co, co); } } else if(indexMap[i].merge != i && indexMap[i].merge_final) { @@ -3174,7 +3174,7 @@ static void tag_and_count_extra_edges(SmoothMesh *mesh, float split_angle, /* we know the edge has 2 faces, so check the angle */ SmoothFace *face1 = edge->faces->link; SmoothFace *face2 = edge->faces->next->link; - float edge_angle_cos = MTC_dot3Float(face1->normal, + float edge_angle_cos = Inpf(face1->normal, face2->normal); if(edge_angle_cos < threshold) { @@ -4042,11 +4042,11 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd, /* find the projector which the face points at most directly * (projector normal with largest dot product is best) */ - best_dot = MTC_dot3Float(projectors[0].normal, face_no); + best_dot = Inpf(projectors[0].normal, face_no); best_projector = &projectors[0]; for(j = 1; j < num_projectors; ++j) { - float tmp_dot = MTC_dot3Float(projectors[j].normal, + float tmp_dot = Inpf(projectors[j].normal, face_no); if(tmp_dot > best_dot) { best_dot = tmp_dot; diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 52b88de06e0..be005af7827 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -38,7 +38,7 @@ #include "PIL_dynlib.h" -#include "MTC_matrixops.h" + #include "BLI_blenlib.h" #include "BLI_arithb.h" diff --git a/source/blender/blenlib/MTC_matrixops.h b/source/blender/blenlib/MTC_matrixops.h deleted file mode 100644 index 2bc644be564..00000000000 --- a/source/blender/blenlib/MTC_matrixops.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - * matrixops.h - * - * $Id$ - * - * ***** 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 ***** - */ - -#ifndef MATRIXOPS_H -#define MATRIXOPS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* ------------------------------------------------------------------------- */ -/* need rewriting: */ -/** - * copy the left upp3 3 by 3 of m2 to m1 - */ -void MTC_Mat3CpyMat4(float m1[][3], float m2[][4]); - -/* ------------------------------------------------------------------------- */ -/* operations based on 4 by 4 matrices */ - -/** - * Copy m1 to m2 - */ -void MTC_Mat4CpyMat4(float m1[][4], float m2[][4]); - -/** - * Multiply all matrices after the first, leave the result in the - * first argument - */ -void MTC_Mat4MulSerie(float answ[][4], - float m1[][4], float m2[][4], float m3[][4], - float m4[][4], float m5[][4], float m6[][4], - float m7[][4], float m8[][4]); - -/** - * m1 = m2 matprod m3 - */ -void MTC_Mat4MulMat4(float m1[][4], float m2[][4], float m3[][4]); - -/** - * Do vec^t prod mat, result in vec. Ignore vec[3] (vec is a - * float[3]) - */ -void MTC_Mat4MulVecfl(float mat[][4], float *vec); - -/** - * Invert mat, result in inverse. Always returns 1 - */ -int MTC_Mat4Invert(float inverse[][4], float mat[][4]); - -/** - * Make the set of mat orthonormal (mat should already be orthogonal)? - * (doesn't appear to normalize properly?) - */ -void MTC_Mat4Ortho(float mat[][4]); - -/** - * vec = mat prod vec, result in vec, ignore fourth component entirely - * (4th component is _not_ accessed!!! vec is 3d) - */ -void MTC_Mat4Mul3Vecfl(float mat[][4], float *vec); - -/** - * vec = mat prod vec, result in vec - */ -void MTC_Mat4MulVec4fl(float mat[][4], float *vec); - -/** - * Set to the 4-D unity matrix - */ -void MTC_Mat4One(float m[][4]); - -/** - * Swap matrices m1 and m2 - */ -void MTC_Mat4SwapMat4(float m1[][4], float m2[][4]); - -/** - * Copy m2 to the top-left 3x3 of m1, don't touch the remaining elements. - */ -void MTC_Mat4CpyMat3nc(float m1[][4], float m2[][3]); - -/** - * m1 = m2 * m3, but only the top-left 3x3 - */ -void MTC_Mat4MulMat33(float m1[][3], float m2[][4], float m3[][3]); - -/* ------------------------------------------------------------------------- */ -/* Operations based on 3 by 3 matrices */ -/** - * Do vec^t prod mat, result in vec.(vex is 3d) - */ -void MTC_Mat3MulVecfl(float mat[][3], float *vec); - -/** - * Copy m1 to m2 - */ -void MTC_Mat3CpyMat3(float m1[][3], float m2[][3]); - -/** - * m1 = m2 prod m3 - */ -void MTC_Mat3MulMat3(float m1[][3], float m3[][3], float m2[][3]); - -/** - * vec = vec prod mat - */ -void MTC_Mat3MulVecd(float mat[][3], double *vec); - -/** - * Guess: invert matrix - * result goes to m1 - */ -void MTC_Mat3Inv(float m1[][3], float m2[][3]); - -/** - * Sort of a determinant matrix? Doesn't seem very adjoint to me... - * result goes to m1 - */ -void MTC_Mat3Adj(float m1[][3], float m[][3]); - -/** - * Set to the 3D unity matrix - */ -void MTC_Mat3One(float m[][3]); - -/* ------------------------------------------------------------------------- */ - -#ifdef __cplusplus -} -#endif - -#endif /* MATRIXOPS_H */ - diff --git a/source/blender/blenlib/MTC_vectorops.h b/source/blender/blenlib/MTC_vectorops.h deleted file mode 100644 index 4fec93b37b9..00000000000 --- a/source/blender/blenlib/MTC_vectorops.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * vectorops.h - * - * $Id$ - * - * ***** 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 ***** - */ - -#ifndef VECTOROPS_H -#define VECTOROPS_H - -/* ------------------------------------------------------------------------- */ - -void MTC_diff3Int(int v1[3], int v2[3], int v3[3]); -void MTC_cross3Int(int v1[3], int v2[3], int v3[3]); -int MTC_dot3Int(int v1[3], int v2[3]); - -void MTC_diff3Float(float v1[3], float v2[3], float v3[3]); -void MTC_cross3Float(float v1[3], float v2[3], float v3[3]); -float MTC_dot3Float(float v1[3], float v2[3]); -void MTC_cp3Float(float v1[3], float v2[3]); -/** - * Copy vector with a minus sign (so a = -b) - */ -void MTC_cp3FloatInv(float v1[3], float v2[3]); - -void MTC_swapInt(int *i1, int *i2); - -void MTC_diff3DFF(double v1[3], float v2[3], float v3[3]); -void MTC_cross3Double(double v1[3], double v2[3], double v3[3]); -float MTC_normalize3DF(float n[3]); - -/* ------------------------------------------------------------------------- */ -#endif /* VECTOROPS_H */ - diff --git a/source/blender/blenlib/intern/matrixops.c b/source/blender/blenlib/intern/matrixops.c deleted file mode 100644 index 0f9fc65f016..00000000000 --- a/source/blender/blenlib/intern/matrixops.c +++ /dev/null @@ -1,438 +0,0 @@ -/* - * - * Some matrix operations. - * - * Always use - * - vector with x components : float x[3], int x[3], etc - * - * $Id$ - * - * ***** 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 ***** - */ - -/* ------------------------------------------------------------------------- */ -#include -#include "MTC_matrixops.h" -#include "MTC_vectorops.h" -/* ------------------------------------------------------------------------- */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#if defined(__sun__) || defined( __sun ) || defined (__sparc) || defined (__sparc__) -#include -#endif - -#define ABS(x) ((x) < 0 ? -(x) : (x)) -#define SWAP(type, a, b) { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; } - -void MTC_Mat4CpyMat4(float m1[][4], float m2[][4]) -{ - memcpy(m1, m2, 4*4*sizeof(float)); -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4MulSerie(float answ[][4], - float m1[][4], float m2[][4], float m3[][4], - float m4[][4], float m5[][4], float m6[][4], - float m7[][4], float m8[][4]) -{ - float temp[4][4]; - - if(m1==0 || m2==0) return; - - MTC_Mat4MulMat4(answ, m2, m1); - if(m3) { - MTC_Mat4MulMat4(temp, m3, answ); - if(m4) { - MTC_Mat4MulMat4(answ, m4, temp); - if(m5) { - MTC_Mat4MulMat4(temp, m5, answ); - if(m6) { - MTC_Mat4MulMat4(answ, m6, temp); - if(m7) { - MTC_Mat4MulMat4(temp, m7, answ); - if(m8) { - MTC_Mat4MulMat4(answ, m8, temp); - } - else MTC_Mat4CpyMat4(answ, temp); - } - } - else MTC_Mat4CpyMat4(answ, temp); - } - } - else MTC_Mat4CpyMat4(answ, temp); - } -} - -/* ------------------------------------------------------------------------- */ -void MTC_Mat4MulMat4(float m1[][4], float m2[][4], float m3[][4]) -{ - /* matrix product: c[j][k] = a[j][i].b[i][k] */ - - m1[0][0] = m2[0][0]*m3[0][0] + m2[0][1]*m3[1][0] + m2[0][2]*m3[2][0] + m2[0][3]*m3[3][0]; - m1[0][1] = m2[0][0]*m3[0][1] + m2[0][1]*m3[1][1] + m2[0][2]*m3[2][1] + m2[0][3]*m3[3][1]; - m1[0][2] = m2[0][0]*m3[0][2] + m2[0][1]*m3[1][2] + m2[0][2]*m3[2][2] + m2[0][3]*m3[3][2]; - m1[0][3] = m2[0][0]*m3[0][3] + m2[0][1]*m3[1][3] + m2[0][2]*m3[2][3] + m2[0][3]*m3[3][3]; - - m1[1][0] = m2[1][0]*m3[0][0] + m2[1][1]*m3[1][0] + m2[1][2]*m3[2][0] + m2[1][3]*m3[3][0]; - m1[1][1] = m2[1][0]*m3[0][1] + m2[1][1]*m3[1][1] + m2[1][2]*m3[2][1] + m2[1][3]*m3[3][1]; - m1[1][2] = m2[1][0]*m3[0][2] + m2[1][1]*m3[1][2] + m2[1][2]*m3[2][2] + m2[1][3]*m3[3][2]; - m1[1][3] = m2[1][0]*m3[0][3] + m2[1][1]*m3[1][3] + m2[1][2]*m3[2][3] + m2[1][3]*m3[3][3]; - - m1[2][0] = m2[2][0]*m3[0][0] + m2[2][1]*m3[1][0] + m2[2][2]*m3[2][0] + m2[2][3]*m3[3][0]; - m1[2][1] = m2[2][0]*m3[0][1] + m2[2][1]*m3[1][1] + m2[2][2]*m3[2][1] + m2[2][3]*m3[3][1]; - m1[2][2] = m2[2][0]*m3[0][2] + m2[2][1]*m3[1][2] + m2[2][2]*m3[2][2] + m2[2][3]*m3[3][2]; - m1[2][3] = m2[2][0]*m3[0][3] + m2[2][1]*m3[1][3] + m2[2][2]*m3[2][3] + m2[2][3]*m3[3][3]; - - m1[3][0] = m2[3][0]*m3[0][0] + m2[3][1]*m3[1][0] + m2[3][2]*m3[2][0] + m2[3][3]*m3[3][0]; - m1[3][1] = m2[3][0]*m3[0][1] + m2[3][1]*m3[1][1] + m2[3][2]*m3[2][1] + m2[3][3]*m3[3][1]; - m1[3][2] = m2[3][0]*m3[0][2] + m2[3][1]*m3[1][2] + m2[3][2]*m3[2][2] + m2[3][3]*m3[3][2]; - m1[3][3] = m2[3][0]*m3[0][3] + m2[3][1]*m3[1][3] + m2[3][2]*m3[2][3] + m2[3][3]*m3[3][3]; - -} -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4MulVecfl(float mat[][4], float *vec) -{ - float x,y; - - x=vec[0]; - y=vec[1]; - vec[0]=x*mat[0][0] + y*mat[1][0] + mat[2][0]*vec[2] + mat[3][0]; - vec[1]=x*mat[0][1] + y*mat[1][1] + mat[2][1]*vec[2] + mat[3][1]; - vec[2]=x*mat[0][2] + y*mat[1][2] + mat[2][2]*vec[2] + mat[3][2]; -} - -/* ------------------------------------------------------------------------- */ -void MTC_Mat3MulVecfl(float mat[][3], float *vec) -{ - float x,y; - - x=vec[0]; - y=vec[1]; - vec[0]= x*mat[0][0] + y*mat[1][0] + mat[2][0]*vec[2]; - vec[1]= x*mat[0][1] + y*mat[1][1] + mat[2][1]*vec[2]; - vec[2]= x*mat[0][2] + y*mat[1][2] + mat[2][2]*vec[2]; -} - -/* ------------------------------------------------------------------------- */ - -int MTC_Mat4Invert(float inverse[][4], float mat[][4]) -{ - int i, j, k; - double temp; - float tempmat[4][4]; - float max; - int maxj; - - /* Set inverse to identity */ - for (i=0; i<4; i++) - for (j=0; j<4; j++) - inverse[i][j] = 0; - for (i=0; i<4; i++) - inverse[i][i] = 1; - - /* Copy original matrix so we don't mess it up */ - for(i = 0; i < 4; i++) - for(j = 0; j <4; j++) - tempmat[i][j] = mat[i][j]; - - for(i = 0; i < 4; i++) { - /* Look for row with max pivot */ - max = ABS(tempmat[i][i]); - maxj = i; - for(j = i + 1; j < 4; j++) { - if(ABS(tempmat[j][i]) > max) { - max = ABS(tempmat[j][i]); - maxj = j; - } - } - /* Swap rows if necessary */ - if (maxj != i) { - for( k = 0; k < 4; k++) { - SWAP(float, tempmat[i][k], tempmat[maxj][k]); - SWAP(float, inverse[i][k], inverse[maxj][k]); - } - } - - temp = tempmat[i][i]; - if (temp == 0) - return 0; /* No non-zero pivot */ - for(k = 0; k < 4; k++) { - tempmat[i][k] /= temp; - inverse[i][k] /= temp; - } - for(j = 0; j < 4; j++) { - if(j != i) { - temp = tempmat[j][i]; - for(k = 0; k < 4; k++) { - tempmat[j][k] -= tempmat[i][k]*temp; - inverse[j][k] -= inverse[i][k]*temp; - } - } - } - } - return 1; -} - -/* ------------------------------------------------------------------------- */ -void MTC_Mat3CpyMat4(float m1[][3], float m2[][4]) -{ - - m1[0][0]= m2[0][0]; - m1[0][1]= m2[0][1]; - m1[0][2]= m2[0][2]; - - m1[1][0]= m2[1][0]; - m1[1][1]= m2[1][1]; - m1[1][2]= m2[1][2]; - - m1[2][0]= m2[2][0]; - m1[2][1]= m2[2][1]; - m1[2][2]= m2[2][2]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat3CpyMat3(float m1[][3], float m2[][3]) -{ - memcpy(m1, m2, 3*3*sizeof(float)); -} - -/* ------------------------------------------------------------------------- */ -/* void Mat3MulMat3(float m1[][3], float m3[][3], float m2[][3]) */ -void MTC_Mat3MulMat3(float m1[][3], float m3[][3], float m2[][3]) -{ - /* be careful about this rewrite... */ - /* m1[i][j] = m2[i][k]*m3[k][j], args are flipped! */ - m1[0][0]= m2[0][0]*m3[0][0] + m2[0][1]*m3[1][0] + m2[0][2]*m3[2][0]; - m1[0][1]= m2[0][0]*m3[0][1] + m2[0][1]*m3[1][1] + m2[0][2]*m3[2][1]; - m1[0][2]= m2[0][0]*m3[0][2] + m2[0][1]*m3[1][2] + m2[0][2]*m3[2][2]; - - m1[1][0]= m2[1][0]*m3[0][0] + m2[1][1]*m3[1][0] + m2[1][2]*m3[2][0]; - m1[1][1]= m2[1][0]*m3[0][1] + m2[1][1]*m3[1][1] + m2[1][2]*m3[2][1]; - m1[1][2]= m2[1][0]*m3[0][2] + m2[1][1]*m3[1][2] + m2[1][2]*m3[2][2]; - - m1[2][0]= m2[2][0]*m3[0][0] + m2[2][1]*m3[1][0] + m2[2][2]*m3[2][0]; - m1[2][1]= m2[2][0]*m3[0][1] + m2[2][1]*m3[1][1] + m2[2][2]*m3[2][1]; - m1[2][2]= m2[2][0]*m3[0][2] + m2[2][1]*m3[1][2] + m2[2][2]*m3[2][2]; - -/* m1[0]= m2[0]*m3[0] + m2[1]*m3[3] + m2[2]*m3[6]; */ -/* m1[1]= m2[0]*m3[1] + m2[1]*m3[4] + m2[2]*m3[7]; */ -/* m1[2]= m2[0]*m3[2] + m2[1]*m3[5] + m2[2]*m3[8]; */ -/* m1+=3; */ -/* m2+=3; */ -/* m1[0]= m2[0]*m3[0] + m2[1]*m3[3] + m2[2]*m3[6]; */ -/* m1[1]= m2[0]*m3[1] + m2[1]*m3[4] + m2[2]*m3[7]; */ -/* m1[2]= m2[0]*m3[2] + m2[1]*m3[5] + m2[2]*m3[8]; */ -/* m1+=3; */ -/* m2+=3; */ -/* m1[0]= m2[0]*m3[0] + m2[1]*m3[3] + m2[2]*m3[6]; */ -/* m1[1]= m2[0]*m3[1] + m2[1]*m3[4] + m2[2]*m3[7]; */ -/* m1[2]= m2[0]*m3[2] + m2[1]*m3[5] + m2[2]*m3[8]; */ -} /* end of void Mat3MulMat3(float m1[][3], float m3[][3], float m2[][3]) */ - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4Ortho(float mat[][4]) -{ - float len; - - len= MTC_normalize3DF(mat[0]); - if(len!=0.0) mat[0][3]/= len; - len= MTC_normalize3DF(mat[1]); - if(len!=0.0) mat[1][3]/= len; - len= MTC_normalize3DF(mat[2]); - if(len!=0.0) mat[2][3]/= len; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4Mul3Vecfl(float mat[][4], float *vec) -{ - float x,y; - /* vec = mat^T dot vec !!! or vec a row, then vec = vec dot mat*/ - - x= vec[0]; - y= vec[1]; - vec[0]= x*mat[0][0] + y*mat[1][0] + mat[2][0]*vec[2]; - vec[1]= x*mat[0][1] + y*mat[1][1] + mat[2][1]*vec[2]; - vec[2]= x*mat[0][2] + y*mat[1][2] + mat[2][2]*vec[2]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4One(float m[][4]) -{ - - m[0][0]= m[1][1]= m[2][2]= m[3][3]= 1.0; - m[0][1]= m[0][2]= m[0][3]= 0.0; - m[1][0]= m[1][2]= m[1][3]= 0.0; - m[2][0]= m[2][1]= m[2][3]= 0.0; - m[3][0]= m[3][1]= m[3][2]= 0.0; -} - - -/* ------------------------------------------------------------------------- */ -/* Result is a 3-vector!*/ -void MTC_Mat3MulVecd(float mat[][3], double *vec) -{ - double x,y; - - /* vec = mat^T dot vec !!! or vec a row, then vec = vec dot mat*/ - x=vec[0]; - y=vec[1]; - vec[0]= x * mat[0][0] + y * mat[1][0] + mat[2][0] * vec[2]; - vec[1]= x * mat[0][1] + y * mat[1][1] + mat[2][1] * vec[2]; - vec[2]= x * mat[0][2] + y * mat[1][2] + mat[2][2] * vec[2]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat3Inv(float m1[][3], float m2[][3]) -{ - short a,b; - float det; - - /* first adjoint */ - MTC_Mat3Adj(m1,m2); - - /* then determinant old mat! */ - det= m2[0][0]* (m2[1][1]*m2[2][2] - m2[1][2]*m2[2][1]) - -m2[1][0]* (m2[0][1]*m2[2][2] - m2[0][2]*m2[2][1]) - +m2[2][0]* (m2[0][1]*m2[1][2] - m2[0][2]*m2[1][1]); - - if(det==0) det=1; - det= 1/det; - for(a=0;a<3;a++) { - for(b=0;b<3;b++) { - m1[a][b]*=det; - } - } -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat3Adj(float m1[][3], float m[][3]) -{ - m1[0][0]=m[1][1]*m[2][2]-m[1][2]*m[2][1]; - m1[0][1]= -m[0][1]*m[2][2]+m[0][2]*m[2][1]; - m1[0][2]=m[0][1]*m[1][2]-m[0][2]*m[1][1]; - - m1[1][0]= -m[1][0]*m[2][2]+m[1][2]*m[2][0]; - m1[1][1]=m[0][0]*m[2][2]-m[0][2]*m[2][0]; - m1[1][2]= -m[0][0]*m[1][2]+m[0][2]*m[1][0]; - - m1[2][0]=m[1][0]*m[2][1]-m[1][1]*m[2][0]; - m1[2][1]= -m[0][0]*m[2][1]+m[0][1]*m[2][0]; - m1[2][2]=m[0][0]*m[1][1]-m[0][1]*m[1][0]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat3One(float m[][3]) -{ - - m[0][0]= m[1][1]= m[2][2]= 1.0; - m[0][1]= m[0][2]= 0.0; - m[1][0]= m[1][2]= 0.0; - m[2][0]= m[2][1]= 0.0; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4SwapMat4(float m1[][4], float m2[][4]) -{ - float t; - int i, j; - - for(i = 0; i < 4; i++) { - for (j = 0; j < 4; j++) { - t = m1[i][j]; - m1[i][j] = m2[i][j]; - m2[i][j] = t; - } - } -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4MulVec4fl(float mat[][4], float *vec) -{ - float x,y,z; - - x = vec[0]; - y = vec[1]; - z = vec[2]; - vec[0] = x*mat[0][0] + y*mat[1][0] + z*mat[2][0] + mat[3][0]*vec[3]; - vec[1] = x*mat[0][1] + y*mat[1][1] + z*mat[2][1] + mat[3][1]*vec[3]; - vec[2] = x*mat[0][2] + y*mat[1][2] + z*mat[2][2] + mat[3][2]*vec[3]; - vec[3] = x*mat[0][3] + y*mat[1][3] + z*mat[2][3] + mat[3][3]*vec[3]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4CpyMat3nc(float m1[][4], float m2[][3]) /* no clear */ -{ - m1[0][0]= m2[0][0]; - m1[0][1]= m2[0][1]; - m1[0][2]= m2[0][2]; - - m1[1][0]= m2[1][0]; - m1[1][1]= m2[1][1]; - m1[1][2]= m2[1][2]; - - m1[2][0]= m2[2][0]; - m1[2][1]= m2[2][1]; - m1[2][2]= m2[2][2]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4MulMat33(float m1[][3], float m2[][4], float m3[][3]) -{ - /* m1_i_j = m2_i_k * m3_k_j ? */ - - m1[0][0] = m2[0][0]*m3[0][0] + m2[0][1]*m3[1][0] + m2[0][2]*m3[2][0]; - m1[0][1] = m2[0][0]*m3[0][1] + m2[0][1]*m3[1][1] + m2[0][2]*m3[2][1]; - m1[0][2] = m2[0][0]*m3[0][2] + m2[0][1]*m3[1][2] + m2[0][2]*m3[2][2]; - - m1[1][0] = m2[1][0]*m3[0][0] + m2[1][1]*m3[1][0] + m2[1][2]*m3[2][0]; - m1[1][1] = m2[1][0]*m3[0][1] + m2[1][1]*m3[1][1] + m2[1][2]*m3[2][1]; - m1[1][2] = m2[1][0]*m3[0][2] + m2[1][1]*m3[1][2] + m2[1][2]*m3[2][2]; - - m1[2][0] = m2[2][0]*m3[0][0] + m2[2][1]*m3[1][0] + m2[2][2]*m3[2][0]; - m1[2][1] = m2[2][0]*m3[0][1] + m2[2][1]*m3[1][1] + m2[2][2]*m3[2][1]; - m1[2][2] = m2[2][0]*m3[0][2] + m2[2][1]*m3[1][2] + m2[2][2]*m3[2][2]; - -} - -/* ------------------------------------------------------------------------- */ - -/* eof */ diff --git a/source/blender/blenlib/intern/vectorops.c b/source/blender/blenlib/intern/vectorops.c deleted file mode 100644 index 3bff5235cfd..00000000000 --- a/source/blender/blenlib/intern/vectorops.c +++ /dev/null @@ -1,166 +0,0 @@ -/* - * - * Some vector operations. - * - * Always use - * - vector with x components : float x[3], int x[3], etc - * - * $Id$ - * - * ***** 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 ***** - */ - -/* ------------------------------------------------------------------------- */ -/* General format: op(a, b, c): a = b op c */ -/* Copying is done cp */ -/* ------------------------------------------------------------------------- */ - -#include "MTC_vectorops.h" -#include - -#ifdef HAVE_CONFIG_H -#include -#endif - -void MTC_diff3Int(int v1[3], int v2[3], int v3[3]) -{ - v1[0] = v2[0] - v3[0]; - v1[1] = v2[1] - v3[1]; - v1[2] = v2[2] - v3[2]; -} - -/* ------------------------------------------------------------------------- */ -void MTC_diff3Float(float v1[3], float v2[3], float v3[3]) -{ - v1[0] = v2[0] - v3[0]; - v1[1] = v2[1] - v3[1]; - v1[2] = v2[2] - v3[2]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_cross3Int(int v1[3], int v2[3], int v3[3]) -{ - v1[0] = v2[1]*v3[2] - v2[2]*v3[1]; - v1[1] = v2[2]*v3[0] - v2[0]*v3[2]; - v1[2] = v2[0]*v3[1] - v2[1]*v3[0]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_cross3Float(float v1[3], float v2[3], float v3[3]) -{ - v1[0] = v2[1]*v3[2] - v2[2]*v3[1]; - v1[1] = v2[2]*v3[0] - v2[0]*v3[2]; - v1[2] = v2[0]*v3[1] - v2[1]*v3[0]; -} -/* ------------------------------------------------------------------------- */ - -void MTC_cross3Double(double v1[3], double v2[3], double v3[3]) -{ - v1[0] = v2[1]*v3[2] - v2[2]*v3[1]; - v1[1] = v2[2]*v3[0] - v2[0]*v3[2]; - v1[2] = v2[0]*v3[1] - v2[1]*v3[0]; -} - -/* ------------------------------------------------------------------------- */ - -int MTC_dot3Int(int v1[3], int v2[3]) -{ - return (v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2]); -} - -/* ------------------------------------------------------------------------- */ - -float MTC_dot3Float(float v1[3], float v2[3]) -{ - return (v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2]); -} - -/* ------------------------------------------------------------------------- */ - -void MTC_cp3Float(float v1[3], float v2[3]) -{ - v2[0] = v1[0]; - v2[1] = v1[1]; - v2[2] = v1[2]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_cp3FloatInv(float v1[3], float v2[3]) -{ - v2[0] = -v1[0]; - v2[1] = -v1[1]; - v2[2] = -v1[2]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_swapInt(int *i1, int *i2) -{ - int swap; - swap = *i1; - *i1 = *i2; - *i2 = swap; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_diff3DFF(double v1[3], float v2[3], float v3[3]) -{ - v1[0] = v2[0] - v3[0]; - v1[1] = v2[1] - v3[1]; - v1[2] = v2[2] - v3[2]; -} - -/* ------------------------------------------------------------------------- */ -float MTC_normalize3DF(float n[3]) -{ - float d; - - d= n[0]*n[0]+n[1]*n[1]+n[2]*n[2]; - /* FLT_EPSILON is too large! A larger value causes normalize errors in */ - /* a scaled down utah teapot */ - if(d>0.0000000000001) { - - /* d= sqrt(d); This _should_ be sqrt, but internally it's a double*/ - /* anyway. This is safe. */ - d = sqrt(d); - - n[0]/=d; - n[1]/=d; - n[2]/=d; - } else { - n[0]=n[1]=n[2]= 0.0; - d= 0.0; - } - return d; -} - -/* ------------------------------------------------------------------------- */ - -/* eof */ diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c b/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c index 3a2c2b1def1..9fcc9dcb90c 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c @@ -27,7 +27,7 @@ */ #include -#include "MTC_vectorops.h" + #include "../TEX_util.h" static bNodeSocketType inputs[]= { @@ -64,19 +64,19 @@ static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, shor if(magsq == 0) magsq = 1; - ndx = MTC_dot3Float(coord, ax); + ndx = Inpf(coord, ax); para[0] = ax[0] * ndx * (1 - cos_a); para[1] = ax[1] * ndx * (1 - cos_a); para[2] = ax[2] * ndx * (1 - cos_a); - MTC_diff3Float(perp, coord, para); + VecSubf(perp, coord, para); perp[0] = coord[0] * cos_a; perp[1] = coord[1] * cos_a; perp[2] = coord[2] * cos_a; - MTC_cross3Float(cp, ax, coord); + Crossf(cp, ax, coord); cp[0] = cp[0] * sin_a; cp[1] = cp[1] * sin_a; diff --git a/source/blender/python/api2_2x/Effect.c b/source/blender/python/api2_2x/Effect.c index 4d3dce741fc..1a37856a4d6 100644 --- a/source/blender/python/api2_2x/Effect.c +++ b/source/blender/python/api2_2x/Effect.c @@ -41,7 +41,7 @@ #include "gen_utils.h" #include "blendef.h" #include "vector.h" -#include "MTC_matrixops.h" + #define EXPP_EFFECT_STA_MIN -250.0f #define EXPP_EFFECT_END_MIN 1.0f diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 3c6b872a16d..24f4a6f7ad3 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -32,7 +32,7 @@ #include #include "blendef.h" -#include "MTC_matrixops.h" + #include "MEM_guardedalloc.h" @@ -203,8 +203,8 @@ void RE_make_stars(Render *re, void (*initfunc)(void), if (re) re->flag |= R_HALO; else stargrid *= 1.0; /* then it draws fewer */ - if(re) MTC_Mat4Invert(mat, re->viewmat); - else MTC_Mat4One(mat); + if(re) Mat4Invert(mat, re->viewmat); + else Mat4One(mat); /* BOUNDING BOX CALCULATION * bbox goes from z = loc_near_var | loc_far_var, @@ -252,7 +252,7 @@ void RE_make_stars(Render *re, void (*initfunc)(void), done++; } else { - MTC_Mat4MulVecfl(re->viewmat, vec); + Mat4MulVecfl(re->viewmat, vec); /* in vec are global coordinates * calculate distance to camera @@ -841,7 +841,7 @@ static void autosmooth(Render *re, ObjectRen *obr, float mat[][4], int degr) /* rotate vertices and calculate normal of faces */ for(a=0; atotvert; a++) { ver= RE_findOrAddVert(obr, a); - MTC_Mat4MulVecfl(mat, ver->co); + Mat4MulVecfl(mat, ver->co); } for(a=0; atotvlak; a++) { vlr= RE_findOrAddVlak(obr, a); @@ -1278,19 +1278,19 @@ static void particle_billboard(Render *re, ObjectRen *obr, Material *ma, Particl VECADD(vlr->v1->co, bb_center, xvec); VECADD(vlr->v1->co, vlr->v1->co, yvec); - MTC_Mat4MulVecfl(re->viewmat, vlr->v1->co); + Mat4MulVecfl(re->viewmat, vlr->v1->co); VECSUB(vlr->v2->co, bb_center, xvec); VECADD(vlr->v2->co, vlr->v2->co, yvec); - MTC_Mat4MulVecfl(re->viewmat, vlr->v2->co); + Mat4MulVecfl(re->viewmat, vlr->v2->co); VECSUB(vlr->v3->co, bb_center, xvec); VECSUB(vlr->v3->co, vlr->v3->co, yvec); - MTC_Mat4MulVecfl(re->viewmat, vlr->v3->co); + Mat4MulVecfl(re->viewmat, vlr->v3->co); VECADD(vlr->v4->co, bb_center, xvec); VECSUB(vlr->v4->co, vlr->v4->co, yvec); - MTC_Mat4MulVecfl(re->viewmat, vlr->v4->co); + Mat4MulVecfl(re->viewmat, vlr->v4->co); CalcNormFloat4(vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co, vlr->n); VECCOPY(vlr->v1->n,vlr->n); @@ -1581,8 +1581,8 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem } /* 2.5 setup matrices */ - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); /* need to be that way, for imat texture */ + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); /* need to be that way, for imat texture */ Mat3CpyMat4(nmat, ob->imat); Mat3Transp(nmat); @@ -1854,7 +1854,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem time= curlen/strandlen; VECCOPY(loc,state.co); - MTC_Mat4MulVecfl(re->viewmat,loc); + Mat4MulVecfl(re->viewmat,loc); if(strandbuf) { VECCOPY(svert->co, loc); @@ -1894,7 +1894,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem VECCOPY(loc,state.co); if(part->draw_as!=PART_DRAW_BB) - MTC_Mat4MulVecfl(re->viewmat,loc); + Mat4MulVecfl(re->viewmat,loc); switch(part->draw_as) { case PART_DRAW_LINE: @@ -1903,7 +1903,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem sd.size = hasize; VECCOPY(vel,state.vel); - MTC_Mat4Mul3Vecfl(re->viewmat,vel); + Mat4Mul3Vecfl(re->viewmat,vel); Normalize(vel); if(part->draw & PART_DRAW_VEL_LENGTH) @@ -1997,8 +1997,8 @@ static void make_render_halos(Render *re, ObjectRen *obr, Mesh *me, int totvert, float vec[3], hasize, mat[4][4], imat[3][3]; int a, ok, seed= ma->seed1; - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat3CpyMat4(imat, ob->imat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat3CpyMat4(imat, ob->imat); re->flag |= R_HALO; @@ -2009,7 +2009,7 @@ static void make_render_halos(Render *re, ObjectRen *obr, Mesh *me, int totvert, hasize= ma->hasize; VECCOPY(vec, mvert->co); - MTC_Mat4MulVecfl(mat, vec); + Mat4MulVecfl(mat, vec); if(ma->mode & MA_HALOPUNO) { xn= mvert->no[0]; @@ -2142,7 +2142,7 @@ static void displace_render_vert(Render *re, ObjectRen *obr, ShadeInput *shi, Ve } if (texco & TEXCO_GLOB) { VECCOPY(shi->gl, shi->co); - MTC_Mat4MulVecfl(re->viewinv, shi->gl); + Mat4MulVecfl(re->viewinv, shi->gl); } if (texco & TEXCO_NORM) { VECCOPY(shi->orn, shi->vn); @@ -2282,9 +2282,9 @@ static void init_render_mball(Render *re, ObjectRen *obr) if (ob!=find_basis_mball(ob)) return; - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); - MTC_Mat3CpyMat4(imat, ob->imat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); + Mat3CpyMat4(imat, ob->imat); ma= give_render_material(re, ob, 1); @@ -2305,7 +2305,7 @@ static void init_render_mball(Render *re, ObjectRen *obr) ver= RE_findOrAddVert(obr, obr->totvert++); VECCOPY(ver->co, data); - MTC_Mat4MulVecfl(mat, ver->co); + Mat4MulVecfl(mat, ver->co); /* render normals are inverted */ xn= -nors[0]; @@ -2389,7 +2389,7 @@ static int dl_surf_to_renderdata(ObjectRen *obr, DispList *dl, Material **matar, if(orco) { v1->orco= orco; orco+= 3; orcoret++; } - MTC_Mat4MulVecfl(mat, v1->co); + Mat4MulVecfl(mat, v1->co); for (v = 1; v < sizev; v++) { ver= RE_findOrAddVert(obr, obr->totvert++); @@ -2397,7 +2397,7 @@ static int dl_surf_to_renderdata(ObjectRen *obr, DispList *dl, Material **matar, if(orco) { ver->orco= orco; orco+= 3; orcoret++; } - MTC_Mat4MulVecfl(mat, ver->co); + Mat4MulVecfl(mat, ver->co); } /* if V-cyclic, add extra vertices at end of the row */ if (dl->flag & DL_CYCL_U) { @@ -2547,8 +2547,8 @@ static void init_render_surf(Render *re, ObjectRen *obr) nu= cu->nurb.first; if(nu==0) return; - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); /* material array */ memset(matar, 0, 4*32); @@ -2609,8 +2609,8 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset) dl= cu->disp.first; if(cu->disp.first==NULL) return; - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); /* material array */ memset(matar, 0, 4*32); @@ -2651,7 +2651,7 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset) ver->flag = 0; } - MTC_Mat4MulVecfl(mat, ver->co); + Mat4MulVecfl(mat, ver->co); if (orco) { ver->orco = orco; @@ -2703,7 +2703,7 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset) ver= RE_findOrAddVert(obr, obr->totvert++); VECCOPY(ver->co, fp); - MTC_Mat4MulVecfl(mat, ver->co); + Mat4MulVecfl(mat, ver->co); fp+= 3; if (orco) { @@ -2951,9 +2951,9 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) me= ob->data; - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); - MTC_Mat3CpyMat4(imat, ob->imat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); + Mat3CpyMat4(imat, ob->imat); if(me->totvert==0) return; @@ -3046,7 +3046,7 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) ver= RE_findOrAddVert(obr, obr->totvert++); VECCOPY(ver->co, mvert->co); if(do_autosmooth==0) /* autosmooth on original unrotated data to prevent differences between frames */ - MTC_Mat4MulVecfl(mat, ver->co); + Mat4MulVecfl(mat, ver->co); if(orco) { ver->orco= orco; @@ -3267,13 +3267,13 @@ static void initshadowbuf(Render *re, LampRen *lar, float mat[][4]) shb->soft= lar->soft; shb->shadhalostep= lar->shadhalostep; - MTC_Mat4Ortho(mat); - MTC_Mat4Invert(shb->winmat, mat); /* winmat is temp */ + Mat4Ortho(mat); + Mat4Invert(shb->winmat, mat); /* winmat is temp */ /* matrix: combination of inverse view and lampmat */ /* calculate again: the ortho-render has no correct viewinv */ - MTC_Mat4Invert(viewinv, re->viewmat); - MTC_Mat4MulMat4(shb->viewmat, viewinv, shb->winmat); + Mat4Invert(viewinv, re->viewmat); + Mat4MulMat4(shb->viewmat, viewinv, shb->winmat); /* projection */ shb->d= lar->clipsta; @@ -3351,11 +3351,11 @@ static GroupObject *add_render_lamp(Render *re, Object *ob) BLI_addtail(&re->lampren, lar); go->lampren= lar; - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); - MTC_Mat3CpyMat4(lar->mat, mat); - MTC_Mat3CpyMat4(lar->imat, ob->imat); + Mat3CpyMat4(lar->mat, mat); + Mat3CpyMat4(lar->imat, ob->imat); lar->bufsize = la->bufsize; lar->samp = la->samp; @@ -3527,7 +3527,7 @@ static GroupObject *add_render_lamp(Render *re, Object *ob) lar->sh_invcampos[0]= -lar->co[0]; lar->sh_invcampos[1]= -lar->co[1]; lar->sh_invcampos[2]= -lar->co[2]; - MTC_Mat3MulVecfl(lar->imat, lar->sh_invcampos); + Mat3MulVecfl(lar->imat, lar->sh_invcampos); /* z factor, for a normalized volume */ angle= saacos(lar->spotsi); @@ -4149,7 +4149,7 @@ static void set_dupli_tex_mat(Render *re, ObjectInstanceRen *obi, DupliObject *d obi->duplitexmat= BLI_memarena_alloc(re->memArena, sizeof(float)*4*4); Mat4Invert(imat, dob->mat); - MTC_Mat4MulSerie(obi->duplitexmat, re->viewmat, dob->omat, imat, re->viewinv, 0, 0, 0, 0); + Mat4MulSerie(obi->duplitexmat, re->viewmat, dob->omat, imat, re->viewinv, 0, 0, 0, 0); } } @@ -4273,8 +4273,8 @@ static void init_render_object(Render *re, Object *ob, Object *par, DupliObject else if(render_object_type(ob->type)) add_render_object(re, ob, par, dob, timeoffset, vectorlay); else { - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); } time= PIL_check_seconds_timer(); @@ -4516,8 +4516,8 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp for(SETLOOPER(re->scene, base)) { ob= base->object; /* imat objects has to be done here, since displace can have texture using Object map-input */ - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); /* each object should only be rendered once */ ob->flag &= ~OB_DONE; ob->transflag &= ~OB_RENDER_DUPLI; @@ -4663,8 +4663,8 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp if(redoimat) { for(SETLOOPER(re->scene, base)) { ob= base->object; - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); } } @@ -5070,7 +5070,7 @@ static int load_fluidsimspeedvectors(Render *re, ObjectInstanceRen *obi, float * return 0; Mat4CpyMat4(mat, re->viewmat); - MTC_Mat4Invert(imat, mat); + Mat4Invert(imat, mat); /* set first vertex OK */ if(!fss->meshSurfNormals) return 0; diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c index 13fa9b17b71..46669fd8f47 100644 --- a/source/blender/render/intern/source/envmap.c +++ b/source/blender/render/intern/source/envmap.c @@ -51,7 +51,7 @@ #include "BKE_texture.h" #include "BKE_utildefines.h" -#include "MTC_matrixops.h" + /* this module */ #include "render_types.h" @@ -209,9 +209,9 @@ static void envmap_transmatrix(float mat[][4], int part) eul[2]= -M_PI/2.0; } - MTC_Mat4CpyMat4(tmat, mat); + Mat4CpyMat4(tmat, mat); EulToMat4(eul, rotmat); - MTC_Mat4MulSerie(mat, tmat, rotmat, + Mat4MulSerie(mat, tmat, rotmat, 0, 0, 0, 0, 0, 0); } @@ -229,12 +229,12 @@ static void env_rotate_scene(Render *re, float mat[][4], int mode) int a; if(mode==0) { - MTC_Mat4Invert(tmat, mat); - MTC_Mat3CpyMat4(imat, tmat); + Mat4Invert(tmat, mat); + Mat3CpyMat4(imat, tmat); } else { - MTC_Mat4CpyMat4(tmat, mat); - MTC_Mat3CpyMat4(imat, mat); + Mat4CpyMat4(tmat, mat); + Mat3CpyMat4(imat, mat); } for(obi=re->instancetable.first; obi; obi=obi->next) { @@ -265,7 +265,7 @@ static void env_rotate_scene(Render *re, float mat[][4], int mode) if((a & 255)==0) har= obr->bloha[a>>8]; else har++; - MTC_Mat4MulVecfl(tmat, har->co); + Mat4MulVecfl(tmat, har->co); } } @@ -278,22 +278,22 @@ static void env_rotate_scene(Render *re, float mat[][4], int mode) Mat3CpyMat3(cmat, lar->imat); Mat3MulMat3(lar->imat, cmat, imat); - MTC_Mat3MulVecfl(imat, lar->vec); - MTC_Mat4MulVecfl(tmat, lar->co); + Mat3MulVecfl(imat, lar->vec); + Mat4MulVecfl(tmat, lar->co); lar->sh_invcampos[0]= -lar->co[0]; lar->sh_invcampos[1]= -lar->co[1]; lar->sh_invcampos[2]= -lar->co[2]; - MTC_Mat3MulVecfl(lar->imat, lar->sh_invcampos); + Mat3MulVecfl(lar->imat, lar->sh_invcampos); lar->sh_invcampos[2]*= lar->sh_zfac; if(lar->shb) { if(mode==1) { - MTC_Mat4Invert(pmat, mat); - MTC_Mat4MulMat4(smat, pmat, lar->shb->viewmat); - MTC_Mat4MulMat4(lar->shb->persmat, smat, lar->shb->winmat); + Mat4Invert(pmat, mat); + Mat4MulMat4(smat, pmat, lar->shb->viewmat); + Mat4MulMat4(lar->shb->persmat, smat, lar->shb->winmat); } - else MTC_Mat4MulMat4(lar->shb->persmat, lar->shb->viewmat, lar->shb->winmat); + else Mat4MulMat4(lar->shb->persmat, lar->shb->viewmat, lar->shb->winmat); } } @@ -371,8 +371,8 @@ static void env_set_imats(Render *re) base= G.scene->base.first; while(base) { - MTC_Mat4MulMat4(mat, base->object->obmat, re->viewmat); - MTC_Mat4Invert(base->object->imat, mat); + Mat4MulMat4(mat, base->object->obmat, re->viewmat); + Mat4Invert(base->object->imat, mat); base= base->next; } @@ -391,18 +391,18 @@ static void render_envmap(Render *re, EnvMap *env) short part; /* need a recalc: ortho-render has no correct viewinv */ - MTC_Mat4Invert(oldviewinv, re->viewmat); + Mat4Invert(oldviewinv, re->viewmat); envre= envmap_render_copy(re, env); /* precalc orthmat for object */ - MTC_Mat4CpyMat4(orthmat, env->object->obmat); - MTC_Mat4Ortho(orthmat); + Mat4CpyMat4(orthmat, env->object->obmat); + Mat4Ortho(orthmat); /* need imat later for texture imat */ - MTC_Mat4MulMat4(mat, orthmat, re->viewmat); - MTC_Mat4Invert(tmat, mat); - MTC_Mat3CpyMat4(env->obimat, tmat); + Mat4MulMat4(mat, orthmat, re->viewmat); + Mat4Invert(tmat, mat); + Mat3CpyMat4(env->obimat, tmat); for(part=0; part<6; part++) { if(env->type==ENV_PLANE && part!=1) @@ -410,17 +410,17 @@ static void render_envmap(Render *re, EnvMap *env) re->display_clear(envre->result); - MTC_Mat4CpyMat4(tmat, orthmat); + Mat4CpyMat4(tmat, orthmat); envmap_transmatrix(tmat, part); - MTC_Mat4Invert(mat, tmat); + Mat4Invert(mat, tmat); /* mat now is the camera 'viewmat' */ - MTC_Mat4CpyMat4(envre->viewmat, mat); - MTC_Mat4CpyMat4(envre->viewinv, tmat); + Mat4CpyMat4(envre->viewmat, mat); + Mat4CpyMat4(envre->viewinv, tmat); /* we have to correct for the already rotated vertexcoords */ - MTC_Mat4MulMat4(tmat, oldviewinv, envre->viewmat); - MTC_Mat4Invert(env->imat, tmat); + Mat4MulMat4(tmat, oldviewinv, envre->viewmat); + Mat4Invert(env->imat, tmat); env_rotate_scene(envre, tmat, 1); init_render_world(envre); @@ -501,13 +501,13 @@ void make_envmaps(Render *re) float orthmat[4][4], mat[4][4], tmat[4][4]; /* precalc orthmat for object */ - MTC_Mat4CpyMat4(orthmat, env->object->obmat); - MTC_Mat4Ortho(orthmat); + Mat4CpyMat4(orthmat, env->object->obmat); + Mat4Ortho(orthmat); /* need imat later for texture imat */ - MTC_Mat4MulMat4(mat, orthmat, re->viewmat); - MTC_Mat4Invert(tmat, mat); - MTC_Mat3CpyMat4(env->obimat, tmat); + Mat4MulMat4(mat, orthmat, re->viewmat); + Mat4Invert(tmat, mat); + Mat3CpyMat4(env->obimat, tmat); } else { @@ -676,20 +676,20 @@ int envmaptex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexRe /* rotate to envmap space, if object is set */ VECCOPY(vec, texvec); - if(env->object) MTC_Mat3MulVecfl(env->obimat, vec); - else MTC_Mat4Mul3Vecfl(R.viewinv, vec); + if(env->object) Mat3MulVecfl(env->obimat, vec); + else Mat4Mul3Vecfl(R.viewinv, vec); face= envcube_isect(env, vec, sco); ibuf= env->cube[face]; if(osatex) { if(env->object) { - MTC_Mat3MulVecfl(env->obimat, dxt); - MTC_Mat3MulVecfl(env->obimat, dyt); + Mat3MulVecfl(env->obimat, dxt); + Mat3MulVecfl(env->obimat, dyt); } else { - MTC_Mat4Mul3Vecfl(R.viewinv, dxt); - MTC_Mat4Mul3Vecfl(R.viewinv, dyt); + Mat4Mul3Vecfl(R.viewinv, dxt); + Mat4Mul3Vecfl(R.viewinv, dyt); } set_dxtdyt(dxts, dyts, dxt, dyt, face); imagewraposa(tex, NULL, ibuf, sco, dxts, dyts, texres); diff --git a/source/blender/render/intern/source/initrender.c b/source/blender/render/intern/source/initrender.c index 40c0edb6e5f..e5894606454 100644 --- a/source/blender/render/intern/source/initrender.c +++ b/source/blender/render/intern/source/initrender.c @@ -41,7 +41,7 @@ #include "BLI_blenlib.h" #include "BLI_jitter.h" -#include "MTC_matrixops.h" + #include "DNA_camera_types.h" #include "DNA_group_types.h" diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c index af6093ab36c..58101b5126a 100644 --- a/source/blender/render/intern/source/pixelshading.c +++ b/source/blender/render/intern/source/pixelshading.c @@ -32,8 +32,8 @@ /* External modules: */ #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" -#include "MTC_matrixops.h" -#include "MTC_vectorops.h" + + #include "DNA_camera_types.h" #include "DNA_group_types.h" @@ -153,7 +153,7 @@ static void render_lighting_halo(HaloRen *har, float *colf) /* rotate view to lampspace */ VECCOPY(lvrot, lv); - MTC_Mat3MulVecfl(lar->imat, lvrot); + Mat3MulVecfl(lar->imat, lvrot); x= MAX2(fabs(lvrot[0]/lvrot[2]) , fabs(lvrot[1]/lvrot[2])); /* 1.0/(sqrt(1+x*x)) is equivalent to cos(atan(x)) */ @@ -545,7 +545,7 @@ void shadeSkyView(float *colf, float *rco, float *view, float *dxyview, short th VECCOPY(lo, view); if(R.wrld.skytype & WO_SKYREAL) { - MTC_Mat3MulVecfl(R.imat, lo); + Mat3MulVecfl(R.imat, lo); SWAP(float, lo[1], lo[2]); @@ -587,7 +587,7 @@ void shadeSunView(float *colf, float *view) VECCOPY(sview, view); Normalize(sview); - MTC_Mat3MulVecfl(R.imat, sview); + Mat3MulVecfl(R.imat, sview); if (sview[2] < 0.0) sview[2] = 0.0; Normalize(sview); @@ -668,7 +668,7 @@ void shadeAtmPixel(struct SunSky *sunsky, float *collector, float fx, float fy, calc_view_vector(view, fx, fy); Normalize(view); - /*MTC_Mat3MulVecfl(R.imat, view);*/ + /*Mat3MulVecfl(R.imat, view);*/ AtmospherePixleShader(sunsky, view, distance, collector); } diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c index c53a2b68c9c..cd7a0449d0e 100644 --- a/source/blender/render/intern/source/shadbuf.c +++ b/source/blender/render/intern/source/shadbuf.c @@ -26,7 +26,7 @@ #include #include -#include "MTC_matrixops.h" + #include "MEM_guardedalloc.h" #include "DNA_group_types.h" @@ -403,7 +403,7 @@ void makeshadowbuf(Render *re, LampRen *lar) wsize= shb->pixsize*(shb->size/2.0); i_window(-wsize, wsize, -wsize, wsize, shb->d, shb->clipend, shb->winmat); - MTC_Mat4MulMat4(shb->persmat, shb->viewmat, shb->winmat); + Mat4MulMat4(shb->persmat, shb->viewmat, shb->winmat); if(ELEM(lar->buftype, LA_SHADBUF_REGULAR, LA_SHADBUF_HALFWAY)) { /* jitter, weights - not threadsafe! */ @@ -673,7 +673,7 @@ float testshadowbuf(Render *re, ShadBuf *shb, float *rco, float *dxco, float *dy VECCOPY(co, rco); co[3]= 1.0f; - MTC_Mat4MulVec4fl(shb->persmat, co); /* rational hom co */ + Mat4MulVec4fl(shb->persmat, co); /* rational hom co */ xs1= siz*(1.0f+co[0]/co[3]); ys1= siz*(1.0f+co[1]/co[3]); @@ -714,7 +714,7 @@ float testshadowbuf(Render *re, ShadBuf *shb, float *rco, float *dxco, float *dy co[1]= rco[1]+dxco[1]; co[2]= rco[2]+dxco[2]; co[3]= 1.0; - MTC_Mat4MulVec4fl(shb->persmat,co); /* rational hom co */ + Mat4MulVec4fl(shb->persmat,co); /* rational hom co */ dx[0]= xs1- siz*(1.0+co[0]/co[3]); dx[1]= ys1- siz*(1.0+co[1]/co[3]); @@ -722,7 +722,7 @@ float testshadowbuf(Render *re, ShadBuf *shb, float *rco, float *dxco, float *dy co[1]= rco[1]+dyco[1]; co[2]= rco[2]+dyco[2]; co[3]= 1.0; - MTC_Mat4MulVec4fl(shb->persmat,co); /* rational hom co */ + Mat4MulVec4fl(shb->persmat,co); /* rational hom co */ dy[0]= xs1- siz*(1.0+co[0]/co[3]); dy[1]= ys1- siz*(1.0+co[1]/co[3]); @@ -858,7 +858,7 @@ float shadow_halo(LampRen *lar, float *p1, float *p2) co[1]= p1[1]; co[2]= p1[2]/lar->sh_zfac; co[3]= 1.0; - MTC_Mat4MulVec4fl(shb->winmat, co); /* rational hom co */ + Mat4MulVec4fl(shb->winmat, co); /* rational hom co */ xf1= siz*(1.0+co[0]/co[3]); yf1= siz*(1.0+co[1]/co[3]); zf1= (co[2]/co[3]); @@ -868,7 +868,7 @@ float shadow_halo(LampRen *lar, float *p1, float *p2) co[1]= p2[1]; co[2]= p2[2]/lar->sh_zfac; co[3]= 1.0; - MTC_Mat4MulVec4fl(shb->winmat, co); /* rational hom co */ + Mat4MulVec4fl(shb->winmat, co); /* rational hom co */ xf2= siz*(1.0+co[0]/co[3]); yf2= siz*(1.0+co[1]/co[3]); zf2= (co[2]/co[3]); @@ -1659,7 +1659,7 @@ static int viewpixel_to_lampbuf(ShadBuf *shb, ObjectInstanceRen *obi, VlakRen *v } /* move 3d vector to lampbuf */ - MTC_Mat4MulVec4fl(shb->persmat, hoco); /* rational hom co */ + Mat4MulVec4fl(shb->persmat, hoco); /* rational hom co */ /* clip We can test for -1.0/1.0 because of the properties of the * coordinate transformations. */ diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index 1cd8ec110f9..7e3d906b035 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -29,7 +29,7 @@ #include #include -#include "MTC_matrixops.h" + #include "BLI_arithb.h" #include "BLI_blenlib.h" @@ -416,13 +416,13 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert if(texco & TEXCO_GLOB) { VECCOPY(shi->gl, shi->co); - MTC_Mat4MulVecfl(R.viewinv, shi->gl); + Mat4MulVecfl(R.viewinv, shi->gl); if(shi->osatex) { VECCOPY(shi->dxgl, shi->dxco); - MTC_Mat3MulVecfl(R.imat, shi->dxco); + Mat3MulVecfl(R.imat, shi->dxco); VECCOPY(shi->dygl, shi->dyco); - MTC_Mat3MulVecfl(R.imat, shi->dyco); + Mat3MulVecfl(R.imat, shi->dyco); } } @@ -974,12 +974,12 @@ void shade_input_set_shade_texco(ShadeInput *shi) if(texco & TEXCO_GLOB) { VECCOPY(shi->gl, shi->co); - MTC_Mat4MulVecfl(R.viewinv, shi->gl); + Mat4MulVecfl(R.viewinv, shi->gl); if(shi->osatex) { VECCOPY(shi->dxgl, shi->dxco); - MTC_Mat3MulVecfl(R.imat, shi->dxco); + Mat3MulVecfl(R.imat, shi->dxco); VECCOPY(shi->dygl, shi->dyco); - MTC_Mat3MulVecfl(R.imat, shi->dyco); + Mat3MulVecfl(R.imat, shi->dyco); } } diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index 2fbd93df0ce..4bdd0b69699 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -30,7 +30,7 @@ #include #include -#include "MTC_matrixops.h" + #include "BLI_arithb.h" #include "BKE_colortools.h" @@ -168,7 +168,7 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens) p1[0]= shi->co[0]-lar->co[0]; p1[1]= shi->co[1]-lar->co[1]; p1[2]= -lar->co[2]; - MTC_Mat3MulVecfl(lar->imat, p1); + Mat3MulVecfl(lar->imat, p1); VECCOPY(npos, p1); // npos is double! /* pre-scale */ @@ -180,7 +180,7 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens) /* rotate view */ VECCOPY(nray, shi->view); - MTC_Mat3MulVecd(lar->imat, nray); + Mat3MulVecd(lar->imat, nray); if(R.wrld.mode & WO_MIST) { /* patchy... */ @@ -1143,7 +1143,7 @@ float lamp_get_visibility(LampRen *lar, float *co, float *lv, float *dist) /* rotate view to lampspace */ VECCOPY(lvrot, lv); - MTC_Mat3MulVecfl(lar->imat, lvrot); + Mat3MulVecfl(lar->imat, lvrot); x= MAX2(fabs(lvrot[0]/lvrot[2]) , fabs(lvrot[1]/lvrot[2])); /* 1.0f/(sqrt(1+x*x)) is equivalent to cos(atan(x)) */ diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index 007b69a9b97..3e8cf71605d 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -30,7 +30,7 @@ #include #include -#include "MTC_matrixops.h" + #include "BLI_blenlib.h" #include "BLI_arithb.h" @@ -829,7 +829,7 @@ static int cubemap_glob(float *n, float x, float y, float z, float *adr1, float else { VECCOPY(nor, n); } - MTC_Mat4Mul3Vecfl(R.viewinv, nor); + Mat4Mul3Vecfl(R.viewinv, nor); x1= fabs(nor[0]); y1= fabs(nor[1]); @@ -922,7 +922,7 @@ static int cubemap_ob(Object *ob, float *n, float x, float y, float z, float *ad if(n==NULL) return 0; VECCOPY(nor, n); - if(ob) MTC_Mat4Mul3Vecfl(ob->imat, nor); + if(ob) Mat4Mul3Vecfl(ob->imat, nor); x1= fabs(nor[0]); y1= fabs(nor[1]); @@ -1540,13 +1540,13 @@ void do_material_tex(ShadeInput *shi) VECCOPY(tempvec, shi->co); if(mtex->texflag & MTEX_OB_DUPLI_ORIG) if(shi->obi && shi->obi->duplitexmat) - MTC_Mat4MulVecfl(shi->obi->duplitexmat, tempvec); - MTC_Mat4MulVecfl(ob->imat, tempvec); + Mat4MulVecfl(shi->obi->duplitexmat, tempvec); + Mat4MulVecfl(ob->imat, tempvec); if(shi->osatex) { VECCOPY(dxt, shi->dxco); VECCOPY(dyt, shi->dyco); - MTC_Mat4Mul3Vecfl(ob->imat, dxt); - MTC_Mat4Mul3Vecfl(ob->imat, dyt); + Mat4Mul3Vecfl(ob->imat, dxt); + Mat4Mul3Vecfl(ob->imat, dyt); } } else { @@ -2237,7 +2237,7 @@ void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, f case TEXCO_OBJECT: if(mtex->object) { VECCOPY(tempvec, lo); - MTC_Mat4MulVecfl(mtex->object->imat, tempvec); + Mat4MulVecfl(mtex->object->imat, tempvec); co= tempvec; } break; @@ -2245,16 +2245,16 @@ void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, f case TEXCO_GLOB: if(rco) { VECCOPY(tempvec, rco); - MTC_Mat4MulVecfl(R.viewinv, tempvec); + Mat4MulVecfl(R.viewinv, tempvec); co= tempvec; } else co= lo; // VECCOPY(shi->dxgl, shi->dxco); -// MTC_Mat3MulVecfl(R.imat, shi->dxco); +// Mat3MulVecfl(R.imat, shi->dxco); // VECCOPY(shi->dygl, shi->dyco); -// MTC_Mat3MulVecfl(R.imat, shi->dyco); +// Mat3MulVecfl(R.imat, shi->dyco); break; } @@ -2376,12 +2376,12 @@ void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf, int ef dx= dxt; dy= dyt; VECCOPY(tempvec, shi->co); - MTC_Mat4MulVecfl(ob->imat, tempvec); + Mat4MulVecfl(ob->imat, tempvec); if(shi->osatex) { VECCOPY(dxt, shi->dxco); VECCOPY(dyt, shi->dyco); - MTC_Mat4Mul3Vecfl(ob->imat, dxt); - MTC_Mat4Mul3Vecfl(ob->imat, dyt); + Mat4Mul3Vecfl(ob->imat, dxt); + Mat4Mul3Vecfl(ob->imat, dyt); } } else { @@ -2392,12 +2392,12 @@ void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf, int ef else if(mtex->texco==TEXCO_GLOB) { co= shi->gl; dx= shi->dxco; dy= shi->dyco; VECCOPY(shi->gl, shi->co); - MTC_Mat4MulVecfl(R.viewinv, shi->gl); + Mat4MulVecfl(R.viewinv, shi->gl); } else if(mtex->texco==TEXCO_VIEW) { VECCOPY(tempvec, lavec); - MTC_Mat3MulVecfl(la->imat, tempvec); + Mat3MulVecfl(la->imat, tempvec); if(la->type==LA_SPOT) { tempvec[0]*= la->spottexfac; @@ -2410,8 +2410,8 @@ void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf, int ef VECCOPY(dxt, shi->dxlv); VECCOPY(dyt, shi->dylv); /* need some matrix conversion here? la->imat is a [3][3] matrix!!! **/ - MTC_Mat3MulVecfl(la->imat, dxt); - MTC_Mat3MulVecfl(la->imat, dyt); + Mat3MulVecfl(la->imat, dxt); + Mat3MulVecfl(la->imat, dyt); VecMulf(dxt, la->spottexfac); VecMulf(dyt, la->spottexfac); diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index 509ac81c58b..19ec0059a08 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -42,7 +42,7 @@ #include "BLI_jitter.h" #include "BLI_threads.h" -#include "MTC_matrixops.h" + #include "MEM_guardedalloc.h" #include "DNA_lamp_types.h" @@ -2314,7 +2314,7 @@ void RE_zbufferall_radio(struct RadView *vw, RNode **rg_elem, int rg_totelem, Re hashlist_projectvert(NULL, winmat, NULL); /* needed for projectvert */ - MTC_Mat4MulMat4(winmat, vw->viewmat, vw->winmat); + Mat4MulMat4(winmat, vw->viewmat, vw->winmat); /* 1.0f for clipping in clippyra()... bad stuff actually */ zbuf_alloc_span(&zspan, vw->rectx, vw->recty, 1.0f); diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index ef37b184a85..fddbadac22d 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -41,7 +41,7 @@ #include "IMB_imbuf.h" -#include "MTC_matrixops.h" + #include "DNA_armature_types.h" #include "DNA_camera_types.h" @@ -1040,7 +1040,7 @@ static void drawcamera(Object *ob, int flag) Mat4Ortho(vec); mymultmatrix(vec); - MTC_Mat4SwapMat4(G.vd->persmat, tmat); + Mat4SwapMat4(G.vd->persmat, tmat); mygetsingmatrix(G.vd->persmat); if(cam->flag & CAM_SHOWLIMITS) { @@ -1053,7 +1053,7 @@ static void drawcamera(Object *ob, int flag) if(cam->flag & CAM_SHOWMIST) if(wrld) draw_limit_line(wrld->miststa, wrld->miststa+wrld->mistdist, 0xFFFFFF); - MTC_Mat4SwapMat4(G.vd->persmat, tmat); + Mat4SwapMat4(G.vd->persmat, tmat); } } } diff --git a/source/blender/src/editface.c b/source/blender/src/editface.c index f6a0b88cbc8..1430c6ad0d5 100644 --- a/source/blender/src/editface.c +++ b/source/blender/src/editface.c @@ -39,7 +39,7 @@ #include "BLI_edgehash.h" #include "BLI_editVert.h" -#include "MTC_matrixops.h" + #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" diff --git a/source/blender/src/editfont.c b/source/blender/src/editfont.c index 682125dabb1..30097f9e786 100644 --- a/source/blender/src/editfont.c +++ b/source/blender/src/editfont.c @@ -42,7 +42,7 @@ #include #endif -#include "MTC_matrixops.h" + #include "MEM_guardedalloc.h" diff --git a/source/blender/src/editmesh_mods.c b/source/blender/src/editmesh_mods.c index 3dbbe7d7336..980478945cb 100644 --- a/source/blender/src/editmesh_mods.c +++ b/source/blender/src/editmesh_mods.c @@ -39,7 +39,7 @@ editmesh_mods.c, UI level access, no geometry changes #include "MEM_guardedalloc.h" -#include "MTC_matrixops.h" + #include "DNA_mesh_types.h" #include "DNA_material_types.h" diff --git a/source/blender/src/editmesh_tools.c b/source/blender/src/editmesh_tools.c index 0fb072c1af4..4c72d7450b6 100644 --- a/source/blender/src/editmesh_tools.c +++ b/source/blender/src/editmesh_tools.c @@ -106,7 +106,7 @@ editmesh_tool.c: UI called tools for editmesh, geometry changes here, otherwise #include "editmesh.h" -#include "MTC_vectorops.h" + #include "PIL_time.h" diff --git a/source/blender/src/fluidsim.c b/source/blender/src/fluidsim.c index 4be00b63ecb..c176ff7800e 100644 --- a/source/blender/src/fluidsim.c +++ b/source/blender/src/fluidsim.c @@ -57,7 +57,7 @@ #include "BLI_blenlib.h" #include "BLI_threads.h" #include "BLI_arithb.h" -#include "MTC_matrixops.h" + #include "BKE_customdata.h" #include "BKE_displist.h" @@ -801,7 +801,7 @@ void fluidsimBake(struct Object *ob) } // init trafo matrix - MTC_Mat4CpyMat4(domainMat, fsDomain->obmat); + Mat4CpyMat4(domainMat, fsDomain->obmat); if(!Mat4Invert(invDomMat, domainMat)) { snprintf(debugStrBuffer,256,"fluidsimBake::error - Invalid obj matrix?\n"); elbeemDebugOut(debugStrBuffer); diff --git a/source/blender/src/previewrender.c b/source/blender/src/previewrender.c index 21be4b2cf49..98cdb99b6d2 100644 --- a/source/blender/src/previewrender.c +++ b/source/blender/src/previewrender.c @@ -47,7 +47,7 @@ #include "BLI_arithb.h" #include "BLI_blenlib.h" -#include "MTC_matrixops.h" + #include "DNA_texture_types.h" #include "DNA_world_types.h" diff --git a/source/blender/src/vpaint.c b/source/blender/src/vpaint.c index 8da5e1b2572..2b4c4b33ddf 100644 --- a/source/blender/src/vpaint.c +++ b/source/blender/src/vpaint.c @@ -43,7 +43,7 @@ #include "BLI_blenlib.h" #include "BLI_arithb.h" -#include "MTC_matrixops.h" + #include "DNA_action_types.h" #include "DNA_armature_types.h" @@ -1204,7 +1204,7 @@ void weight_paint(void) else totindex= 0; } - MTC_Mat4SwapMat4(G.vd->persmat, mat); + Mat4SwapMat4(G.vd->persmat, mat); if(Gwp.flag & VP_COLINDEX) { for(index=0; indexpersmat, mat); + Mat4SwapMat4(G.vd->persmat, mat); } else BIF_wait_for_statechange(); @@ -1436,7 +1436,7 @@ void vertex_paint() else totindex= 0; } - MTC_Mat4SwapMat4(G.vd->persmat, mat); + Mat4SwapMat4(G.vd->persmat, mat); if(Gvp.flag & VP_COLINDEX) { for(index=0; indexpersmat, mat); + Mat4SwapMat4(G.vd->persmat, mat); do_shared_vertexcol(me); diff --git a/source/blender/yafray/intern/export_File.cpp b/source/blender/yafray/intern/export_File.cpp index ea700965826..425ec66bab3 100644 --- a/source/blender/yafray/intern/export_File.cpp +++ b/source/blender/yafray/intern/export_File.cpp @@ -6,6 +6,8 @@ using namespace std; +#define MTC_cp3Float(_a, _b) VecCopyf(_b, _a) + static string command_path = ""; #ifdef WIN32 @@ -20,7 +22,6 @@ static string command_path = ""; #define FILE_MAXFILE 80 #endif - static string find_path() { HKEY hkey; @@ -1036,10 +1037,10 @@ void yafrayFileRender_t::writeMaterialsAndModulators() // In this case this means the inverse of that matrix float texmat[4][4], itexmat[4][4]; if ((mtex->texco & TEXCO_OBJECT) && (mtex->object)) - MTC_Mat4CpyMat4(texmat, mtex->object->obmat); + Mat4CpyMat4(texmat, mtex->object->obmat); else // also for refl. map - MTC_Mat4CpyMat4(texmat, maincam_obj->obmat); - MTC_Mat4Invert(itexmat, texmat); + Mat4CpyMat4(texmat, maincam_obj->obmat); + Mat4Invert(itexmat, texmat); ostr << "\n\t\tm00=\"" << itexmat[0][0] << "\" m01=\"" << itexmat[1][0] << "\" m02=\"" << itexmat[2][0] << "\" m03=\"" << itexmat[3][0] << "\"\n"; ostr << "\t\tm10=\"" << itexmat[0][1] << "\" m11=\"" << itexmat[1][1] @@ -1304,8 +1305,8 @@ void yafrayFileRender_t::writeObject(Object* obj, ObjectRen *obr, const vectorimat is no longer valid, // so have to create inverse render matrix ourselves here float mat[4][4], imat[4][4]; - MTC_Mat4MulMat4(mat, obj->obmat, re->viewmat); - MTC_Mat4Invert(imat, mat); + Mat4MulMat4(mat, obj->obmat, re->viewmat); + Mat4Invert(imat, mat); for (vector::const_iterator fci=VLR_list.begin(); fci!=VLR_list.end();++fci) @@ -1319,7 +1320,7 @@ void yafrayFileRender_t::writeObject(Object* obj, ObjectRen *obr, const vectorv1] = vidx++; ver = vlr->v1; MTC_cp3Float(ver->co, tvec); - MTC_Mat4MulVecfl(imat, tvec); + Mat4MulVecfl(imat, tvec); ostr << "\t\t\t